diff --git a/source/arm11/cheat.c b/source/arm11/cheat.c index eedf2a6..404f94e 100644 --- a/source/arm11/cheat.c +++ b/source/arm11/cheat.c @@ -401,7 +401,13 @@ static CodeLocation rom_fit_newsize( CodeLocation rom, int realend, int totalsiz // grow cart volumn else if( szrom < size || nextPow2(size) != nextPow2(szrom) ) - *newsize = size; + { + u32 sznrom = nextPow2(size); + u32 start = realend - INSTR_SIZE; + memset( &rom[INSTR_LEN(start)], 0, sznrom-start ); + *newsize = sznrom; + return rom + sznrom - ( (totalsize+0x1f) & (~0xf) ); + } return rom + INSTR_LEN( realend ); }