From 9b6ff8fe490cae56f6a3bc24e0ac19e47b5eaa41 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 5 Jun 2018 02:17:38 -0400 Subject: [PATCH] Mapper 30 4-screen (#10) mapper 30 support for both 1-screen and 4-screen configurations (see: Black Box Challenge) --- src/boards/unrom512.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/boards/unrom512.cpp b/src/boards/unrom512.cpp index 57b2ae7f..ac6bd57b 100644 --- a/src/boards/unrom512.cpp +++ b/src/boards/unrom512.cpp @@ -240,8 +240,24 @@ void UNROM512_Init(CartInfo *info) { chrram_mask = 0x20; else chrram_mask = 0x60; - - SetupCartMirroring(info->mirror,(info->mirror>=MI_0)?0:1,0); + + int mirror = (head.ROM_type & 1) | ((head.ROM_type & 8) >> 2); + switch (mirror) + { + case 0: // hard horizontal, internal + SetupCartMirroring(MI_H, 1, NULL); + break; + case 1: // hard vertical, internal + SetupCartMirroring(MI_V, 1, NULL); + break; + case 2: // switchable 1-screen, internal (flags: 4-screen + horizontal) + SetupCartMirroring(MI_0, 0, NULL); + break; + case 3: // hard four screen, last 8k of 32k RAM (flags: 4-screen + vertical) + SetupCartMirroring( 4, 1, VROM + (info->vram_size - 8192)); + break; + } + bus_conflict = !info->battery; latcheinit = 0; WLSync = UNROM512LSync;