From c80d2b129768755e1bb959df3a2df6f04b8ed115 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Wed, 27 Jul 2022 11:56:35 +0200 Subject: [PATCH] Add mapper 459 --- src/boards/addrlatch.c | 18 ++++++++++++++++++ src/ines.c | 1 + src/ines.h | 1 + 3 files changed, 20 insertions(+) diff --git a/src/boards/addrlatch.c b/src/boards/addrlatch.c index 836e7a8..14dba25 100644 --- a/src/boards/addrlatch.c +++ b/src/boards/addrlatch.c @@ -758,6 +758,24 @@ void Mapper435_Init(CartInfo *info) { Latch_Init(info, M435Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1); } +/*------------------ Map 459 ---------------------------*/ +static void M459Sync(void) { + int p =latche >>5; + int c =latche &0x03 | latche >>2 &0x04 | latche >>4 &0x08; + if (latche &0x04) { + setprg32(0x8000, p); + } else { + setprg16(0x8000, p <<1); + setprg16(0xC000, p <<1 |7); + } + setchr8(c &(latche &0x08? 0x0F: 0x08)); + setmirror(latche &0x100? MI_H: MI_V); +} + +void Mapper459_Init(CartInfo *info) { + Latch_Init(info, M459Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1); +} + /*------------------ Map 464 ---------------------------*/ static void M464Sync(void) { int p =latche >>7; diff --git a/src/ines.c b/src/ines.c index ce3791e..2350f51 100644 --- a/src/ines.c +++ b/src/ines.c @@ -820,6 +820,7 @@ INES_BOARD_BEGIN() INES_BOARD( "NC-7000M/NC-8000M", 444, Mapper444_Init ) INES_BOARD( "DS-9-27", 452, Mapper452_Init ) INES_BOARD( "K6C3001A", 456, Mapper456_Init ) + INES_BOARD( "8-in-1", 459, Mapper459_Init ) INES_BOARD( "YH810X1", 463, Mapper463_Init ) INES_BOARD( "NTDEC 9012", 464, Mapper464_Init ) INES_BOARD( "Keybyte Computer", 466, Mapper466_Init ) diff --git a/src/ines.h b/src/ines.h index 2a489cf..4afc8c8 100644 --- a/src/ines.h +++ b/src/ines.h @@ -328,6 +328,7 @@ void Mapper443_Init(CartInfo *); void Mapper444_Init(CartInfo *); void Mapper452_Init(CartInfo *); void Mapper456_Init(CartInfo *); +void Mapper459_Init(CartInfo *); void Mapper463_Init(CartInfo *); void Mapper464_Init(CartInfo *); void Mapper466_Init(CartInfo *);