Merge pull request #284 from LuigiBlood/bsx

[BS-X] Fix Block Allocation Flags when needed
This commit is contained in:
bearoso 2018-05-01 18:17:48 -05:00 committed by GitHub
commit 125a6dea24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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]);