对于扩容的rom,修改扩容方案

This commit is contained in:
anod 2023-03-21 10:06:40 +08:00
parent 402a71dc22
commit f4a73b2901

View File

@ -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 );
}