From b62b0f7ab1de77aea5e36c96b8a849978658302b Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Wed, 13 Mar 2013 15:30:59 +0000 Subject: [PATCH] (MESS) snes: better support for Korean Super 20 in 1. Now games 15-20 work. nw. --- hash/snes.xml | 10 ++-------- src/mess/machine/sns_rom.c | 14 ++++++++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hash/snes.xml b/hash/snes.xml index 9376d0ce4a4..f4feec3c348 100644 --- a/hash/snes.xml +++ b/hash/snes.xml @@ -4337,7 +4337,6 @@ more investigation needed... Super 5 in 1 (Bad Dump) 199? <unlicensed> - @@ -4351,7 +4350,6 @@ more investigation needed... Super 6 in 1 199? <unlicensed> - @@ -4366,7 +4364,6 @@ more investigation needed... 1997 New 7 in 1 (Bad Dump) 199? <unlicensed> - @@ -4381,7 +4378,6 @@ more investigation needed... Super 7-in-1 1997 (Bad Dump) 199? <unlicensed> - @@ -4396,7 +4392,6 @@ more investigation needed... 8 in 1 and 10 in 1 (Bad Dump) 199? <unlicensed> - @@ -4411,7 +4406,6 @@ more investigation needed... Super 11 in 1 (Bad Dump) 199? <unlicensed> - @@ -4421,9 +4415,9 @@ more investigation needed... - + - Super 20 Collection (Kor) + Super 20 Hab (Kor) 199? <unlicensed> diff --git a/src/mess/machine/sns_rom.c b/src/mess/machine/sns_rom.c index 084de845738..529020826b4 100644 --- a/src/mess/machine/sns_rom.c +++ b/src/mess/machine/sns_rom.c @@ -446,7 +446,12 @@ WRITE8_MEMBER( sns_rom_mcpirate2_device::chip_write ) } // Korean 20 in 1 collection with NES games -// base bank is selected (in 32KB chunks) by bits 0-4 of data written at 0x808000 +// - base bank is selected (in 32KB chunks) by bits 0-4 of data written at 0x808000 +// - bits 6-7 seem related to prg size: 0x00 means 4*32KB, 0xc0 means 2*32KB, 0x80 means 1*32KB +// (they are used to setup how large is the ROM to be accessed, games 15-20 don't work well if +// accesses in [01-3f] don't go to the only 32KB bank) +// - bit 5 is always 0 +// it's worth to notice that for FC games size of bank is twice the size of original FC PRG READ8_MEMBER(sns_rom_20col_device::read_l) { return read_h(space, offset); @@ -454,8 +459,9 @@ READ8_MEMBER(sns_rom_20col_device::read_l) READ8_MEMBER(sns_rom_20col_device::read_h) { - int bank = (offset / 0x10000); - return m_rom[(rom_bank_map[bank] + m_base_bank) * 0x8000 + (offset & 0x7fff)]; + int prg32k = (!BIT(m_base_bank, 6) && BIT(m_base_bank, 7)); + int bank = prg32k ? 0 : (offset / 0x10000); + return m_rom[((m_base_bank & 0x1f) + bank) * 0x8000 + (offset & 0x7fff)]; } WRITE8_MEMBER( sns_rom_20col_device::chip_write ) @@ -481,7 +487,7 @@ WRITE8_MEMBER( sns_rom_20col_device::chip_write ) // [18] donkey kong jr - 9a // [19] mario bros - 9b // [20] popeye - 9c - m_base_bank = data & 0x1f; + m_base_bank = data & 0xdf; // printf("offset %X data %X bank %X\n", offset, data, m_base_bank); }