[BS-X] Fix Block Allocation Flags when needed

This commit is contained in:
LuigiBlood 2018-05-02 00:56:28 +02:00
parent c727189d3e
commit 4f6e5bfcc0
1 changed files with 6 additions and 0 deletions

View File

@ -1477,6 +1477,12 @@ void S9xInitBSX (void)
FlashMode = (header[0x18] & 0xEF) == 0x20 ? FALSE : TRUE;
FlashSize = FLASH_SIZE;
// Fix Block Allocation Flags
// (for games that don't have it setup properly,
// for exemple when taken seperately from the upper memory of the Memory Pack,
// else the game will error out on BS-X)
for (; (header[0x10] & 1) == 0; (header[0x10] >>= 1));
#ifdef BSX_DEBUG
for (int i = 0; i <= 0x1F; i++)
printf("BS: ROM Header %02X: %02X\n", i, header[i]);