From e37026ea3b9d7b121aeb1fd38fe81ab82a1e2e33 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 1 Feb 2021 09:45:55 -0500 Subject: Fixed bug in LZ77 algo --- tools/sprite_dumper/common.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/sprite_dumper/common.h b/tools/sprite_dumper/common.h index 2aca4fa..d9fb5da 100644 --- a/tools/sprite_dumper/common.h +++ b/tools/sprite_dumper/common.h @@ -78,8 +78,11 @@ public: int n = ((t >> 12) & 0xF) + 3; // num of bytes to copy int o = (t & 0xFFF); - memcpy(result.data() + bPos, result.data() + bPos - o - 1, n); - bPos += n; + for (int j=0; j= length) break; + result[bPos] = result[bPos - o - 1]; + bPos++; + } break; } default: break; -- cgit 1.4.1