diff --git a/hash/gameboy.xml b/hash/gameboy.xml index b8411c7d02d..54a0cac4cd0 100644 --- a/hash/gameboy.xml +++ b/hash/gameboy.xml @@ -10996,7 +10996,20 @@ - + + Mani 4 in 1 (Chi, DMG-601 CHN) + 19?? + Mani + + + + + + + + + + Mani 4 in 1 (Chi, DMG-602 CHN) 19?? Mani @@ -11004,12 +11017,12 @@ - + - + Mani 4 in 1 (Chi, DMG-603 CHN) 19?? Mani @@ -11017,7 +11030,33 @@ - + + + + + + + Mani 4 in 1 (Chi, DMG-604 CHN) + 19?? + Mani + + + + + + + + + + + Mani 4 in 1 (Chi, DMG-605 CHN) + 19?? + Mani + + + + + @@ -23435,7 +23474,7 @@ - + @@ -23461,7 +23500,7 @@ - + @@ -23474,7 +23513,7 @@ - + @@ -23487,7 +23526,7 @@ - + @@ -23500,7 +23539,7 @@ - + @@ -23513,7 +23552,7 @@ - + @@ -23526,7 +23565,7 @@ - + diff --git a/src/emu/bus/gameboy/gb_slot.c b/src/emu/bus/gameboy/gb_slot.c index 16c16373824..996f91f6c3f 100644 --- a/src/emu/bus/gameboy/gb_slot.c +++ b/src/emu/bus/gameboy/gb_slot.c @@ -209,6 +209,7 @@ static const gb_slot slot_list[] = { GB_MBC_MBC7, "rom_mbc7" }, { GB_MBC_TAMA5, "rom_tama5" }, { GB_MBC_MMM01, "rom_mmm01" }, + { GB_MBC_M161, "rom_m161_m12" }, { GB_MBC_MBC3, "rom_huc1" }, // for now treat this as alias for MBC3 { GB_MBC_MBC3, "rom_huc3" }, // for now treat this as alias for MBC3 { GB_MBC_SACHEN1, "rom_sachen1" }, diff --git a/src/emu/bus/gameboy/gb_slot.h b/src/emu/bus/gameboy/gb_slot.h index 8df7531d636..921a8707d4b 100644 --- a/src/emu/bus/gameboy/gb_slot.h +++ b/src/emu/bus/gameboy/gb_slot.h @@ -12,7 +12,6 @@ enum GB_MBC_NONE = 0, /* 32KB ROM - No memory bank controller */ GB_MBC_MBC1, /* ~2MB ROM, 8KB RAM -or- 512KB ROM, 32KB RAM */ GB_MBC_MBC2, /* 256KB ROM, 32KB RAM */ - GB_MBC_MMM01, /* ?? ROM, ?? RAM */ GB_MBC_MBC3, /* 2MB ROM, 32KB RAM, RTC */ GB_MBC_MBC4, /* ?? ROM, ?? RAM */ GB_MBC_MBC5, /* 8MB ROM, 128KB RAM (32KB w/ Rumble) */ @@ -21,6 +20,8 @@ enum GB_MBC_HUC3, /* ?? ROM, ?? RAM - Hudson Soft Controller */ GB_MBC_MBC6, /* ?? ROM, 32KB SRAM */ GB_MBC_MBC7, /* ?? ROM, ?? RAM */ + GB_MBC_M161, /* ?? ROM, ?? RAM */ + GB_MBC_MMM01, /* ?? ROM, ?? RAM */ GB_MBC_WISDOM, /* ?? ROM, ?? RAM - Wisdom tree controller */ GB_MBC_MBC1_COL, /* 1MB ROM, 32KB RAM - workaround for MBC1 on PCB that maps rom address lines differently */ GB_MBC_SACHEN1, /* ?? ROM, ?? RAM - Sachen MMC-1 variant */ diff --git a/src/emu/bus/gameboy/mbc.c b/src/emu/bus/gameboy/mbc.c index 433c2c58e17..7969468fe7c 100644 --- a/src/emu/bus/gameboy/mbc.c +++ b/src/emu/bus/gameboy/mbc.c @@ -22,6 +22,7 @@ const device_type GB_ROM_MBC3 = &device_creator; const device_type GB_ROM_MBC5 = &device_creator; const device_type GB_ROM_MBC6 = &device_creator; const device_type GB_ROM_MBC7 = &device_creator; +const device_type GB_ROM_M161_M12 = &device_creator; const device_type GB_ROM_MMM01 = &device_creator; const device_type GB_ROM_SACHEN1 = &device_creator; const device_type GB_ROM_SACHEN2 = &device_creator; // Just a placeholder for the moment... @@ -84,6 +85,11 @@ gb_rom_mbc7_device::gb_rom_mbc7_device(const machine_config &mconfig, const char { } +gb_rom_m161_device::gb_rom_m161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : gb_rom_mbc_device(mconfig, GB_ROM_M161_M12, "GB M161-M12 Carts", tag, owner, clock, "gb_rom_m161m12", __FILE__) +{ +} + gb_rom_mmm01_device::gb_rom_mmm01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : gb_rom_mbc_device(mconfig, GB_ROM_MMM01, "GB MMM01 Carts", tag, owner, clock, "gb_rom_mmm01", __FILE__) { @@ -195,6 +201,18 @@ void gb_rom_mbc6_device::device_reset() m_ram_enable = 0; } +void gb_rom_m161_device::device_start() +{ + shared_start(); + save_item(NAME(m_base_bank)); +} + +void gb_rom_m161_device::device_reset() +{ + shared_reset(); + m_base_bank = 0; +} + void gb_rom_mmm01_device::device_start() { shared_start(); @@ -615,6 +633,33 @@ WRITE8_MEMBER(gb_rom_mbc7_device::write_ram) } +// M161-M12 + +READ8_MEMBER(gb_rom_m161_device::read_rom) +{ + if (offset < 0x4000) + return m_rom[rom_bank_map[m_base_bank | m_latch_bank] * 0x4000 + offset]; + else + return m_rom[rom_bank_map[m_base_bank | m_latch_bank2] * 0x4000 + (offset & 0x3fff)]; +} + +WRITE8_MEMBER(gb_rom_m161_device::write_bank) +{ + switch (offset & 0xe000) + { + case 0x2000: // ROM Bank Register? Tetris writes 1 here when selected... + data &= 0x1f; + m_latch_bank2 = data ? data : 1; + break; + case 0x4000: // Base Bank Register + m_base_bank = data << 1; + break; + default: + break; + } +} + + // MMM01 // This mmm01 implementation is mostly guess work, no clue how correct it all is diff --git a/src/emu/bus/gameboy/mbc.h b/src/emu/bus/gameboy/mbc.h index af82965fb5c..bda06a65523 100644 --- a/src/emu/bus/gameboy/mbc.h +++ b/src/emu/bus/gameboy/mbc.h @@ -151,6 +151,27 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram); }; +// ======================> gb_rom_m161_device + +class gb_rom_m161_device : public gb_rom_mbc_device +{ +public: + + // construction/destruction + gb_rom_m161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + virtual DECLARE_READ8_MEMBER(read_rom); + virtual DECLARE_WRITE8_MEMBER(write_bank); + virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } + virtual DECLARE_WRITE8_MEMBER(write_ram) { } + + UINT8 m_base_bank; +}; + // ======================> gb_rom_mmm01_device class gb_rom_mmm01_device : public gb_rom_mbc_device { @@ -168,7 +189,7 @@ public: UINT8 m_bank_mask, m_bank, m_reg; }; -// ======================> gb_rom_mbc1_device +// ======================> gb_rom_sachen1_device class gb_rom_sachen1_device : public gb_rom_mbc1_device { @@ -324,6 +345,7 @@ extern const device_type GB_ROM_MBC4; extern const device_type GB_ROM_MBC5; extern const device_type GB_ROM_MBC6; extern const device_type GB_ROM_MBC7; +extern const device_type GB_ROM_M161_M12; extern const device_type GB_ROM_MMM01; extern const device_type GB_ROM_SACHEN1; extern const device_type GB_ROM_SACHEN2; diff --git a/src/mess/drivers/gb.c b/src/mess/drivers/gb.c index cb8150a9d4c..ca2cdb613e2 100644 --- a/src/mess/drivers/gb.c +++ b/src/mess/drivers/gb.c @@ -648,6 +648,7 @@ static SLOT_INTERFACE_START(gb_cart) SLOT_INTERFACE_INTERNAL("rom_mbc7", GB_ROM_MBC7) SLOT_INTERFACE_INTERNAL("rom_tama5", GB_ROM_TAMA5) SLOT_INTERFACE_INTERNAL("rom_mmm01", GB_ROM_MMM01) + SLOT_INTERFACE_INTERNAL("rom_m161_m12",GB_ROM_M161_M12) SLOT_INTERFACE_INTERNAL("rom_sachen1", GB_ROM_SACHEN1) SLOT_INTERFACE_INTERNAL("rom_sachen2", GB_ROM_SACHEN2) SLOT_INTERFACE_INTERNAL("rom_wisdom", GB_ROM_WISDOM)