UNIF: Fix potential crash when accessing non-existing rom banks
- As stated, prevent a potential crash on some certain roms using split rom banks. This is done by counting the number of prg/chr banks loaded and using this as limit count during mapper bank switching. - Update related boards.
This commit is contained in:
@@ -53,6 +53,9 @@ static int PRGram[32];
|
||||
uint8 *PRGptr[32];
|
||||
uint8 *CHRptr[32];
|
||||
|
||||
uint32 PRGchip_max;
|
||||
uint32 CHRchip_max;
|
||||
|
||||
uint32 PRGsize[32];
|
||||
uint32 CHRsize[32];
|
||||
|
||||
@@ -104,6 +107,8 @@ void ResetCartMapping(void) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
MMC5SPRVPage[x] = MMC5BGVPage[x] = VPageR[x] = nothing - 0x400 * x;
|
||||
}
|
||||
PRGchip_max = 0;
|
||||
CHRchip_max = 0;
|
||||
}
|
||||
|
||||
void SetupCartPRGMapping(int chip, uint8 *p, uint32 size, int ram) {
|
||||
|
||||
Reference in New Issue
Block a user