From c581dbaf047f8510514b46157afbfae4798ffec1 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Fri, 1 Mar 2013 10:51:56 +0000 Subject: [PATCH] (MESS) gameboy: added emulation of Rockman 8 pirate cart by Yong Yong. [Fabio Priuli] (MESS) gameboy: added correct handling of Echo RAM, needed by Rockman 8. [Fabio Priuli] (MESS) gbcolor: added proper type to Stone Age / Shi Qi Shi Dai, making it working on gbpocket (it freezes on gb/gbc due to unemulated interaction with the bios). nw. also backing up some wip code which I'm not sure when I will have time to improve... --- hash/gameboy.xml | 29 ++-- hash/gbcolor.xml | 65 ++++---- src/mess/drivers/gb.c | 37 +++-- src/mess/includes/gb.h | 2 + src/mess/machine/gb_mbc.c | 297 ++++++++++++++++++++++++++++++++++++- src/mess/machine/gb_mbc.h | 59 ++++++++ src/mess/machine/gb_slot.c | 3 + src/mess/machine/gb_slot.h | 3 + 8 files changed, 438 insertions(+), 57 deletions(-) diff --git a/hash/gameboy.xml b/hash/gameboy.xml index f523e22b3ad..6db3202710e 100644 --- a/hash/gameboy.xml +++ b/hash/gameboy.xml @@ -23500,6 +23500,20 @@ + + Rockman 8 (Chi) + 1999 + Yong Yong + + + + + + + + + + Super Mario Land 4 (Chi) 1997? @@ -23610,7 +23624,7 @@ - + La Sa Ma Chuan Qi - Story of Lasama (Tw) 19?? GOWIN @@ -23625,19 +23639,6 @@ - - La Sa Ma Chuan Qi - Story of Lasama (Tw, Hacked) - 19?? - GOWIN - - - - - - - - - Magic Ball (Tw) 19?? diff --git a/hash/gbcolor.xml b/hash/gbcolor.xml index 7dd084f7307..11a9eb1c422 100644 --- a/hash/gbcolor.xml +++ b/hash/gbcolor.xml @@ -23280,6 +23280,22 @@ Undumped Pirates: + + Zhen San Guo Wu Shuang 2 - Shin Sangokumusou 2 (Chi, Pirate) + 200? + <pirate> + + + + + + + + + + + + Zhi Zhu Xia III (Chi) @@ -23931,13 +23947,14 @@ Undumped Pirates: - + + Shi Qi Shi Dai - Jing Ling Wang Dan Sheng (Chi) 20?? GOWIN - + @@ -23947,13 +23964,14 @@ Undumped Pirates: - + + Shi Qi Shi Dai - Jing Ling Wang Dan Sheng (Chi, Hacked?) 20?? GOWIN - + @@ -23963,22 +23981,6 @@ Undumped Pirates: - - Shin Sangoku Musou 2 - Zhen San Guo Wu Shuang 2 (Chi) - 20?? - <unknown> - - - - - - - - - - - - Dragon Quest 4 - Yongzhe Dou E Long 4 (Chi) 20?? @@ -24094,14 +24096,23 @@ Undumped Pirates: + - Super Mario 3 Special (Chi, Bad? Protected?) - 200? + Super Mario 3 Special (Chi) + 2000 Yong Yong - - - + + + @@ -24112,7 +24123,7 @@ Undumped Pirates: 20?? Yong Yong - + @@ -24157,7 +24168,7 @@ Undumped Pirates: 20?? Yong Yong - + diff --git a/src/mess/drivers/gb.c b/src/mess/drivers/gb.c index 917744f7ff2..b9d87edcd53 100644 --- a/src/mess/drivers/gb.c +++ b/src/mess/drivers/gb.c @@ -522,6 +522,16 @@ WRITE8_MEMBER(gb_state::gb_ram_w) m_cartslot->m_cart->write_ram(space, offset, data); } +READ8_MEMBER(gb_state::gb_echo_r) +{ + return space.read_byte(0xc000 + offset); +} + +WRITE8_MEMBER(gb_state::gb_echo_w) +{ + return space.write_byte(0xc000 + offset, data); +} + READ8_MEMBER(megaduck_state::cart_r) { if (m_cartslot && m_cartslot->m_cart) @@ -546,11 +556,12 @@ WRITE8_MEMBER(megaduck_state::bank2_w) static ADDRESS_MAP_START(gameboy_map, AS_PROGRAM, 8, gb_state ) ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x0000, 0x7fff) AM_READWRITE(gb_cart_r, gb_bank_w) - AM_RANGE(0x8000, 0x9fff) AM_READWRITE(gb_vram_r, gb_vram_w ) /* 8k VRAM */ - AM_RANGE(0xa000, 0xbfff) AM_READWRITE(gb_ram_r, gb_ram_w ) /* 8k switched RAM bank (cartridge) */ - AM_RANGE(0xc000, 0xfdff) AM_RAM /* 8k low RAM, echo RAM */ - AM_RANGE(0xfe00, 0xfeff) AM_READWRITE(gb_oam_r, gb_oam_w ) /* OAM RAM */ - AM_RANGE(0xff00, 0xff0f) AM_READWRITE(gb_io_r, gb_io_w ) /* I/O */ + AM_RANGE(0x8000, 0x9fff) AM_READWRITE(gb_vram_r, gb_vram_w ) /* 8k VRAM */ + AM_RANGE(0xa000, 0xbfff) AM_READWRITE(gb_ram_r, gb_ram_w ) /* 8k switched RAM bank (cartridge) */ + AM_RANGE(0xc000, 0xdfff) AM_RAM /* 8k low RAM */ + AM_RANGE(0xe000, 0xfdff) AM_READWRITE(gb_echo_r, gb_echo_w ) /* echo RAM */ + AM_RANGE(0xfe00, 0xfeff) AM_READWRITE(gb_oam_r, gb_oam_w ) /* OAM RAM */ + AM_RANGE(0xff00, 0xff0f) AM_READWRITE(gb_io_r, gb_io_w ) /* I/O */ AM_RANGE(0xff10, 0xff26) AM_DEVREADWRITE_LEGACY("custom", gb_sound_r, gb_sound_w ) /* sound registers */ AM_RANGE(0xff27, 0xff2f) AM_NOP /* unused */ AM_RANGE(0xff30, 0xff3f) AM_DEVREADWRITE_LEGACY("custom", gb_wave_r, gb_wave_w ) /* Wave ram */ @@ -562,11 +573,12 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(sgb_map, AS_PROGRAM, 8, gb_state ) ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x0000, 0x7fff) AM_READWRITE(gb_cart_r, gb_bank_w) - AM_RANGE(0x8000, 0x9fff) AM_READWRITE(gb_vram_r, gb_vram_w ) /* 8k VRAM */ - AM_RANGE(0xa000, 0xbfff) AM_READWRITE(gb_ram_r, gb_ram_w ) /* 8k switched RAM bank (cartridge) */ - AM_RANGE(0xc000, 0xfdff) AM_RAM /* 8k low RAM, echo RAM */ - AM_RANGE(0xfe00, 0xfeff) AM_READWRITE(gb_oam_r, gb_oam_w ) /* OAM RAM */ - AM_RANGE(0xff00, 0xff0f) AM_READWRITE(gb_io_r, sgb_io_w ) /* I/O */ + AM_RANGE(0x8000, 0x9fff) AM_READWRITE(gb_vram_r, gb_vram_w ) /* 8k VRAM */ + AM_RANGE(0xa000, 0xbfff) AM_READWRITE(gb_ram_r, gb_ram_w ) /* 8k switched RAM bank (cartridge) */ + AM_RANGE(0xc000, 0xdfff) AM_RAM /* 8k low RAM */ + AM_RANGE(0xe000, 0xfdff) AM_READWRITE(gb_echo_r, gb_echo_w ) /* echo RAM */ + AM_RANGE(0xfe00, 0xfeff) AM_READWRITE(gb_oam_r, gb_oam_w ) /* OAM RAM */ + AM_RANGE(0xff00, 0xff0f) AM_READWRITE(gb_io_r, sgb_io_w ) /* I/O */ AM_RANGE(0xff10, 0xff26) AM_DEVREADWRITE_LEGACY("custom", gb_sound_r, gb_sound_w ) /* sound registers */ AM_RANGE(0xff27, 0xff2f) AM_NOP /* unused */ AM_RANGE(0xff30, 0xff3f) AM_DEVREADWRITE_LEGACY("custom", gb_wave_r, gb_wave_w ) /* Wave RAM */ @@ -582,7 +594,7 @@ static ADDRESS_MAP_START(gbc_map, AS_PROGRAM, 8, gb_state ) AM_RANGE(0xa000, 0xbfff) AM_READWRITE(gb_ram_r, gb_ram_w ) /* 8k switched RAM bank (cartridge) */ AM_RANGE(0xc000, 0xcfff) AM_RAM /* 4k fixed RAM bank */ AM_RANGE(0xd000, 0xdfff) AM_RAMBANK("cgb_ram") /* 4k switched RAM bank */ - AM_RANGE(0xe000, 0xfdff) AM_RAM /* echo RAM */ + AM_RANGE(0xe000, 0xfdff) AM_READWRITE(gb_echo_r, gb_echo_w ) /* echo RAM */ AM_RANGE(0xfe00, 0xfeff) AM_READWRITE(gb_oam_r, gb_oam_w ) /* OAM RAM */ AM_RANGE(0xff00, 0xff0f) AM_READWRITE(gb_io_r, gb_io_w ) /* I/O */ AM_RANGE(0xff10, 0xff26) AM_DEVREADWRITE_LEGACY("custom", gb_sound_r, gb_sound_w ) /* sound controller */ @@ -647,6 +659,9 @@ static SLOT_INTERFACE_START(gb_cart) SLOT_INTERFACE_INTERNAL("rom_camera", GB_STD_ROM) SLOT_INTERFACE_INTERNAL("rom_sintax", GB_ROM_SINTAX) SLOT_INTERFACE_INTERNAL("rom_chong", GB_ROM_CHONGWU) + SLOT_INTERFACE_INTERNAL("rom_digimon", GB_ROM_DIGIMON) + SLOT_INTERFACE_INTERNAL("rom_rock8", GB_ROM_ROCKMAN8) + SLOT_INTERFACE_INTERNAL("rom_sm3sp", GB_ROM_SM3SP) SLOT_INTERFACE_END static SLOT_INTERFACE_START(megaduck_cart) diff --git a/src/mess/includes/gb.h b/src/mess/includes/gb.h index 0205be2a7d7..aea1086654e 100644 --- a/src/mess/includes/gb.h +++ b/src/mess/includes/gb.h @@ -205,6 +205,8 @@ public: DECLARE_WRITE8_MEMBER(gb_bank_w); DECLARE_READ8_MEMBER(gb_ram_r); DECLARE_WRITE8_MEMBER(gb_ram_w); + DECLARE_READ8_MEMBER(gb_echo_r); + DECLARE_WRITE8_MEMBER(gb_echo_w); optional_device m_cartslot; protected: diff --git a/src/mess/machine/gb_mbc.c b/src/mess/machine/gb_mbc.c index da29103d21d..33a7b0276bb 100644 --- a/src/mess/machine/gb_mbc.c +++ b/src/mess/machine/gb_mbc.c @@ -26,6 +26,9 @@ const device_type GB_ROM_MBC7 = &device_creator; const device_type GB_ROM_MMM01 = &device_creator; const device_type GB_ROM_SINTAX = &device_creator; const device_type GB_ROM_CHONGWU = &device_creator; +const device_type GB_ROM_DIGIMON = &device_creator; +const device_type GB_ROM_ROCKMAN8 = &device_creator; +const device_type GB_ROM_SM3SP = &device_creator; gb_rom_mbc_device::gb_rom_mbc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) @@ -89,6 +92,21 @@ gb_rom_chongwu_device::gb_rom_chongwu_device(const machine_config &mconfig, cons { } +gb_rom_digimon_device::gb_rom_digimon_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : gb_rom_mbc5_device(mconfig, GB_ROM_DIGIMON, "GB Digimon", tag, owner, clock) +{ +} + +gb_rom_rockman8_device::gb_rom_rockman8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : gb_rom_mbc_device(mconfig, GB_ROM_ROCKMAN8, "GB MBC1 Rockman 8", tag, owner, clock) +{ +} + +gb_rom_sm3sp_device::gb_rom_sm3sp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : gb_rom_mbc_device(mconfig, GB_ROM_SM3SP, "GB MBC1 Super Mario 3 Special", tag, owner, clock) +{ +} + void gb_rom_mbc_device::device_start() { @@ -305,6 +323,57 @@ void gb_rom_chongwu_device::device_start() save_item(NAME(m_protection_checked)); } +void gb_rom_digimon_device::device_start() +{ + has_timer = FALSE; + has_rumble = FALSE; + + m_latch_bank = 0; + m_latch_bank2 = 1; + m_ram_bank = 0; + m_ram_enable = 0; + m_mode = 0; + save_item(NAME(m_latch_bank)); + save_item(NAME(m_latch_bank2)); + save_item(NAME(m_ram_bank)); + save_item(NAME(m_ram_enable)); + save_item(NAME(m_mode)); +} + +void gb_rom_rockman8_device::device_start() +{ + has_timer = FALSE; + has_rumble = FALSE; + + m_latch_bank = 0; + m_latch_bank2 = 1; + m_ram_bank = 0; + m_ram_enable = 0; + m_mode = 0; + save_item(NAME(m_latch_bank)); + save_item(NAME(m_latch_bank2)); + save_item(NAME(m_ram_bank)); + save_item(NAME(m_ram_enable)); + save_item(NAME(m_mode)); +} + +void gb_rom_sm3sp_device::device_start() +{ + has_timer = FALSE; + has_rumble = FALSE; + + m_latch_bank = 0; + m_latch_bank2 = 1; + m_ram_bank = 0; + m_ram_enable = 0; + m_mode = 0; + save_item(NAME(m_latch_bank)); + save_item(NAME(m_latch_bank2)); + save_item(NAME(m_ram_bank)); + save_item(NAME(m_ram_enable)); + save_item(NAME(m_mode)); +} + /*------------------------------------------------- mapper specific handlers @@ -573,15 +642,17 @@ WRITE8_MEMBER(gb_rom_mbc5_device::write_bank) { if (offset < 0x2000) m_ram_enable = ((data & 0x0f) == 0x0a) ? 1 : 0; - else if (offset < 0x4000) + else if (offset < 0x3000) { // MBC5 has a 9 bit bank select // Writing into 2000-2fff sets the lower 8 bits + m_latch_bank2 = (m_latch_bank2 & 0x100) | data; + } + else if (offset < 0x4000) + { + // MBC5 has a 9 bit bank select // Writing into 3000-3fff sets the 9th bit - if (offset & 0x1000) - m_latch_bank2 = (m_latch_bank2 & 0xff) | ((data & 0x01) << 8); - else - m_latch_bank2 = (m_latch_bank2 & 0x100) | data; + m_latch_bank2 = (m_latch_bank2 & 0xff) | ((data & 0x01) << 8); } else if (offset < 0x6000) { @@ -897,3 +968,219 @@ WRITE8_MEMBER(gb_rom_sintax_device::write_ram) m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)] = data; } +/* + + Further MBC5 variants to emulate: + + Digimon 2 & Digimon 4 (Yong Yong) + + Digimon 2 writes at $2000 to select latch2 (data must be divided by 2, and 0 becomes 1), + then writes to $2400 a series of values that the patched version does not write... + Digimon 4 seems to share part of the $2000 behavior, but does not write to $2400... + + */ + +// MBC5 variant used by Digimon 2 (and maybe 4?) + +READ8_MEMBER(gb_rom_digimon_device::read_rom) +{ + if (offset < 0x4000) + return m_rom[rom_bank_map[m_latch_bank] * 0x4000 + (offset & 0x3fff)]; + else + return m_rom[rom_bank_map[m_latch_bank2] * 0x4000 + (offset & 0x3fff)]; +} + +WRITE8_MEMBER(gb_rom_digimon_device::write_bank) +{ + if (offset < 0x2000) + m_ram_enable = ((data & 0x0f) == 0x0a) ? 1 : 0; + else if (offset == 0x2000) + { +// printf("written $02 %X at %X\n", data, offset); + if (!data) + data++; + m_latch_bank2 = data/2; + } + else if (offset < 0x3000) + { +// printf("written $03 %X at %X\n", data, offset); + } + else if (offset < 0x4000) + { +// printf("written $04 %X at %X\n", data, offset); + } + else if (offset < 0x6000) + { +// printf("written $05-$06 %X at %X\n", data, offset); + data &= 0x0f; + if (has_rumble) + data &= 0x7; + m_ram_bank = data; + } +// else +// printf("written $07 %X at %X\n", data, offset); +} + +READ8_MEMBER(gb_rom_digimon_device::read_ram) +{ + if (m_ram && m_ram_enable) + return m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)]; + else + return 0xff; +} + +WRITE8_MEMBER(gb_rom_digimon_device::write_ram) +{ + if (m_ram && m_ram_enable) + m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)] = data; +} + + +// MBC1 variant used by Yong Yong for Rockman 8 + +READ8_MEMBER(gb_rom_rockman8_device::read_rom) +{ + if (offset < 0x4000) + return m_rom[m_latch_bank * 0x4000 + (offset & 0x3fff)]; + else + return m_rom[m_latch_bank2 * 0x4000 + (offset & 0x3fff)]; +} + +WRITE8_MEMBER(gb_rom_rockman8_device::write_bank) +{ + if (offset < 0x2000) + return; + else if (offset < 0x4000) + { + // 5bits only + data &= 0x1f; + if (data == 0) + data = 1; + if (data > 0xf) + data -= 8; + + m_latch_bank2 = data; + } +} + +READ8_MEMBER(gb_rom_rockman8_device::read_ram) +{ + if (m_ram) + return m_ram[offset]; + else + return 0xff; +} + +WRITE8_MEMBER(gb_rom_rockman8_device::write_ram) +{ + if (m_ram) + m_ram[offset] = data; +} + +// MBC1 variant used by Yong Yong for Super Mario 3 Special + +// Mario special seems to be 512k image (mirrored up to 1m or 2m [redump needed to establish this]) +// it consists of 13 unique 16k chunks layed out as follows +// unique chunk --> bank in bin +// 1st to 7th --> 0x00 to 0x06 +// 8th --> 0x08 +// 9th --> 0x0b +// 10th --> 0x0c +// 11th --> 0x0d +// 12th --> 0x0f +// 13th --> 0x13 + +// writing data to 0x2000-0x2fff switches bank according to the table below +// (the value values corresponding to table[0x0f] is not confirmed, choices +// 0,1,2,3,8,c,f freeze the game, while 4,5,6,7,b,d,0x13 work with glitches) +static UINT8 smb3_table1[0x20] = +{ + 0x00,0x04,0x01,0x05, 0x02,0x06,0x03,0x05, 0x08,0x0c,0x03,0x0d, 0x03,0x0b,0x0b,0x08 /* original doc here put 0x0f (i.e. 11th unique bank) */, + 0x05,0x06,0x0b,0x0d, 0x08,0x06,0x13,0x0b, 0x08,0x05,0x05,0x08, 0x0b,0x0d,0x06,0x05 +}; + +// according to old doc from Brian Provinciano, writing bit5 in 0x5000-0x5fff should +// change the bank layout, in the sense that writing to bankswitch acts like if +// the original rom has a different layout (as if unique chunks were under permutations +// (24), (365) and (8a9) with 0,1,7,b,c fixed) and the same table above is used +// however, no such a write ever happen (only bit4 is written, but changing mode with +// bit4 breaks the gfx...) + +READ8_MEMBER(gb_rom_sm3sp_device::read_rom) +{ + if (offset < 0x4000) + return m_rom[rom_bank_map[0] * 0x4000 + (offset & 0x3fff)]; + else + return m_rom[m_latch_bank2 * 0x4000 + (offset & 0x3fff)]; +} + +WRITE8_MEMBER(gb_rom_sm3sp_device::write_bank) +{ +// printf("write 0x%x at %x\n", data, offset); + if (offset < 0x2000) + return; + else if (offset < 0x3000) + { + // Table 1 confirmed... + // 0->0, 4->2, 6->3 + // 1e -> 6 (level 1 bg gfx) + // 19 -> 5 (level 2 bg gfx) + // 1b -> 8 (level 3 bg gfx) + // 1d -> D (level 4 bg gfx) + // 1c -> B (bonus house bg gfx) + // 1 (9 maybe, or 3)? f (5 maybe)? 2->1? + // 16 -> 4-8? b? + + // 5bits only + data &= 0x1f; + + m_latch_bank2 = smb3_table1[data]; + if (m_mode) + { + switch (m_latch_bank2) + { + case 0x02: m_latch_bank2 = 4; break; + case 0x03: m_latch_bank2 = 6; break; + case 0x04: m_latch_bank2 = 2; break; + case 0x05: m_latch_bank2 = 3; break; + case 0x06: m_latch_bank2 = 5; break; + case 0x0b: m_latch_bank2 = 0xd; break; + case 0x0c: m_latch_bank2 = 0xb; break; + case 0x0d: m_latch_bank2 = 0xc; break; + + case 0x00: + case 0x01: + case 0x08: + case 0x0f: + case 0x13: + default: + break; + } + } + } + else if (offset < 0x5000) + { +// printf("write $5 %x\n", data); + //maybe rumble?? + } + else if (offset < 0x6000) + { +// printf("write mode %x\n", data); + m_mode = BIT(data, 5); +// write_bank(space, 0x2000, 1); + } +} + +READ8_MEMBER(gb_rom_sm3sp_device::read_ram) +{ + if (m_ram) + return m_ram[offset]; + else + return 0xff; +} + +WRITE8_MEMBER(gb_rom_sm3sp_device::write_ram) +{ + if (m_ram) + m_ram[offset] = data; +} diff --git a/src/mess/machine/gb_mbc.h b/src/mess/machine/gb_mbc.h index 9a624b66a14..ed030b87512 100644 --- a/src/mess/machine/gb_mbc.h +++ b/src/mess/machine/gb_mbc.h @@ -189,6 +189,24 @@ public: UINT8 m_protection_checked; }; +// ======================> gb_rom_digimon_device + +class gb_rom_digimon_device : public gb_rom_mbc5_device +{ +public: + // construction/destruction + gb_rom_digimon_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start(); + virtual void device_config_complete() { m_shortname = "gb_rom_digimon"; } + + virtual DECLARE_READ8_MEMBER(read_rom); + virtual DECLARE_WRITE8_MEMBER(write_bank); + virtual DECLARE_READ8_MEMBER(read_ram); + virtual DECLARE_WRITE8_MEMBER(write_ram); +}; + // ======================> gb_rom_sintax_device class gb_rom_sintax_device : public gb_rom_mbc_device { @@ -211,6 +229,44 @@ public: UINT8 m_currentxor, m_xor2, m_xor3, m_xor4, m_xor5, m_sintax_mode; }; +// ======================> gb_rom_rockman8_device +class gb_rom_rockman8_device : public gb_rom_mbc_device +{ +public: + // construction/destruction + gb_rom_rockman8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start(); + virtual void device_config_complete() { m_shortname = "gb_rom_rockman8"; } + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom); + virtual DECLARE_WRITE8_MEMBER(write_bank); + virtual DECLARE_READ8_MEMBER(read_ram); + virtual DECLARE_WRITE8_MEMBER(write_ram); + UINT8 m_bank_mask, m_bank, m_reg; +}; + +// ======================> gb_rom_sm3sp_device +class gb_rom_sm3sp_device : public gb_rom_mbc_device +{ +public: + // construction/destruction + gb_rom_sm3sp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start(); + virtual void device_config_complete() { m_shortname = "gb_rom_sm3sp"; } + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_rom); + virtual DECLARE_WRITE8_MEMBER(write_bank); + virtual DECLARE_READ8_MEMBER(read_ram); + virtual DECLARE_WRITE8_MEMBER(write_ram); + UINT8 m_bank_mask, m_bank, m_reg; +}; + // device type definition @@ -225,5 +281,8 @@ extern const device_type GB_ROM_MBC7; extern const device_type GB_ROM_MMM01; extern const device_type GB_ROM_SINTAX; extern const device_type GB_ROM_CHONGWU; +extern const device_type GB_ROM_DIGIMON; +extern const device_type GB_ROM_ROCKMAN8; +extern const device_type GB_ROM_SM3SP; #endif diff --git a/src/mess/machine/gb_slot.c b/src/mess/machine/gb_slot.c index 3c6813284b4..a2e2a10f168 100644 --- a/src/mess/machine/gb_slot.c +++ b/src/mess/machine/gb_slot.c @@ -216,6 +216,9 @@ static const gb_slot slot_list[] = { GB_MBC_ATVRACIN, "rom_atvrac" }, { GB_MBC_SINTAX, "rom_sintax" }, { GB_MBC_CHONGWU, "rom_chong" }, + { GB_MBC_DIGIMON, "rom_digimon" }, + { GB_MBC_ROCKMAN8, "rom_rock8" }, + { GB_MBC_SM3SP, "rom_sm3sp" }, { GB_MBC_CAMERA, "rom_camera" } }; diff --git a/src/mess/machine/gb_slot.h b/src/mess/machine/gb_slot.h index 4de37aebf18..2b8fbbfdc12 100644 --- a/src/mess/machine/gb_slot.h +++ b/src/mess/machine/gb_slot.h @@ -29,6 +29,9 @@ enum GB_MBC_CAMERA, GB_MBC_SINTAX, GB_MBC_CHONGWU, + GB_MBC_DIGIMON, + GB_MBC_ROCKMAN8, + GB_MBC_SM3SP, GB_MBC_MEGADUCK, /* MEGADUCK style banking */ GB_MBC_UNKNOWN /* Unknown mapper */ };