diff --git a/source/arm11/cheat.c b/source/arm11/cheat.c index 6504c94..fc94959 100644 --- a/source/arm11/cheat.c +++ b/source/arm11/cheat.c @@ -316,12 +316,13 @@ static CodeLocation rom_fit_newsize( CodeLocation rom, int realend, int totalsiz // get the biggest space that all bytes is 0 CodeLocation found=NULL, current=NULL; int szfound=0, szcurrent=0; + int reallen = realend / sizeof(instruction_t); for( int i=0; i < realend; ++i ) { if( rom[i] == 0 ) { if( szcurrent == 0 ) current = rom+i; - szcurrent++; + szcurrent += sizeof(instruction_t); } else if( szcurrent > 0 ) {