From 3d38857b4466d4cef65a0e0af0b0e218b069d2b9 Mon Sep 17 00:00:00 2001 From: luigiblood Date: Thu, 24 Nov 2016 03:19:36 +0100 Subject: [PATCH] [BS-X] Make Empty Memory Pack if loaded from Multi Cart menu (This is a conscious choice. It means no empty Memory Pack will be made if loaded like a regular ROM, which is fine.) --- memmap.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/memmap.cpp b/memmap.cpp index 23659fc6..0ee574d7 100644 --- a/memmap.cpp +++ b/memmap.cpp @@ -2002,6 +2002,15 @@ bool8 CMemory::LoadBSCart () CalculatedSize = Multi.cartSizeA; + if (Multi.cartSizeB == 0 && Multi.cartSizeA <= (MAX_ROM_SIZE - 0x100000)) + { + //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.cartSizeB = 0x100000; + memset(Memory.ROM + Multi.cartOffsetB, 0xFF, 0x100000); + } + return (TRUE); }