[BS-X] Making sure there's enough space in ROM memory, simple precaution

This commit is contained in:
luigiblood 2016-11-24 03:28:05 +01:00
parent 3d38857b44
commit ff05060f01
1 changed files with 2 additions and 2 deletions

View File

@ -2002,11 +2002,11 @@ bool8 CMemory::LoadBSCart ()
CalculatedSize = Multi.cartSizeA;
if (Multi.cartSizeB == 0 && Multi.cartSizeA <= (MAX_ROM_SIZE - 0x100000))
if (Multi.cartSizeB == 0 && Multi.cartSizeA <= (MAX_ROM_SIZE - 0x100000 - Multi.cartOffsetA))
{
//Initialize 1MB Empty Memory Pack only if cart B is cleared
//It does not make a Memory Pack if game is loaded like a normal ROM
Multi.cartOffsetB = CalculatedSize;
Multi.cartOffsetB = Multi.cartOffsetA + CalculatedSize;
Multi.cartSizeB = 0x100000;
memset(Memory.ROM + Multi.cartOffsetB, 0xFF, 0x100000);
}