From 357fead53b0d1fd21ea078144e16318897e813ab Mon Sep 17 00:00:00 2001 From: OV2 Date: Fri, 7 Oct 2016 21:40:17 +0200 Subject: [PATCH] Fix multicart loading with only one cart --- memmap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/memmap.cpp b/memmap.cpp index 6a21050c..f7973066 100644 --- a/memmap.cpp +++ b/memmap.cpp @@ -1871,9 +1871,9 @@ bool8 CMemory::LoadMultiCartInt () if(Multi.cartType == 4 && Multi.cartOffsetA == 0) { // try to load bios from file Multi.cartOffsetA = 0x40000; if(Multi.cartSizeA) - memmove(ROM + Multi.cartOffsetA,ROM,Multi.cartOffsetB - Multi.cartOffsetA); - else // clear cart A so the bios can detect that it's not present - memset(ROM,0,Multi.cartOffsetB); + memmove(ROM + Multi.cartOffsetA, ROM, Multi.cartSizeA + Multi.cartSizeB); + else if(Multi.cartOffsetB) // clear cart A so the bios can detect that it's not present + memset(ROM, 0, Multi.cartOffsetB); FILE *fp; size_t size;