From 3543bf10129273c493a1ac7a965407b2d758157e Mon Sep 17 00:00:00 2001 From: dinkc64 Date: Thu, 24 Oct 2024 09:17:04 -0400 Subject: [PATCH] nes, add mapper 72 --- src/burn/drv/nes/d_nes.cpp | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/burn/drv/nes/d_nes.cpp b/src/burn/drv/nes/d_nes.cpp index 0436e79b4f..6f99ab8591 100644 --- a/src/burn/drv/nes/d_nes.cpp +++ b/src/burn/drv/nes/d_nes.cpp @@ -2563,6 +2563,38 @@ static void mapper193_map() #undef mapper193_chr #undef mapper193_mirror +// ---[ mapper 72: Jaleco JF-17 (JF-19?), Pinball Quest Japan +#define mapper72_prg (mapper_regs[0]) +#define mapper72_prglatch (mapper_regs[1]) +#define mapper72_chr (mapper_regs[2]) +#define mapper72_chrlatch (mapper_regs[3]) + +static void mapper72_write(UINT16 address, UINT8 data) +{ + if (mapper72_prglatch == 0 && data & 0x80) { + mapper72_prg = data & 0x0f; + } + if (mapper72_chrlatch == 0 && data & 0x40) { + mapper72_chr = data & 0x0f; + } + mapper72_prglatch = data & 0x80; + mapper72_chrlatch = data & 0x40; + + mapper_map(); +} + +static void mapper72_map() +{ + mapper_map_prg(16, 0, mapper72_prg); + mapper_map_prg(16, 1, -1); + + mapper_map_chr( 8, 0, mapper72_chr); +} + +#undef mapper72_prg +#undef mapper72_chr +#undef mapper72_mirror + // ---[ mapper 15 Contra 168-in-1 Multicart #define mapper15_prg (mapper_regs[0]) #define mapper15_prgbit (mapper_regs[1]) @@ -8585,6 +8617,14 @@ static INT32 mapper_init(INT32 mappernum) break; } + case 72: { // Jaleco JF-17, Pinball Quest Japan + mapper_write = mapper72_write; + mapper_map = mapper72_map; + mapper_map(); + retval = 0; + break; + } + case 41: { // Caltron 6-in-1 cart_exp_write = mapper41_write; mapper_write = mapper41_write;