diff options
author | 2013-05-27 05:27:08 +0000 | |
---|---|---|
committer | 2013-05-27 05:27:08 +0000 | |
commit | af6d6ee63e8f1ded54a1ce4965c365e5d4170ef6 (patch) | |
tree | 5eca13dff5db7f159773e7116363051b3167125b /src/mess/machine | |
parent | 20687380f678b6d7e8af762757712da868d35188 (diff) |
(MESS) sg1000: fixed RAM in a few games and added support for the Othello PCB (ROM + 2K RAM). nw.
Diffstat (limited to 'src/mess/machine')
-rw-r--r-- | src/mess/machine/sega8_rom.c | 32 | ||||
-rw-r--r-- | src/mess/machine/sega8_rom.h | 16 | ||||
-rw-r--r-- | src/mess/machine/sega8_slot.c | 6 | ||||
-rw-r--r-- | src/mess/machine/sega8_slot.h | 1 |
4 files changed, 55 insertions, 0 deletions
diff --git a/src/mess/machine/sega8_rom.c b/src/mess/machine/sega8_rom.c index 82402bc1110..5b2698f85af 100644 --- a/src/mess/machine/sega8_rom.c +++ b/src/mess/machine/sega8_rom.c @@ -21,6 +21,7 @@ const device_type SEGA8_ROM_STD = &device_creator<sega8_rom_device>; // Specific SG-1000 MkI - MkII cart types const device_type SEGA8_ROM_CARDCATCH = &device_creator<sega8_cardcatch_device>; +const device_type SEGA8_ROM_OTHELLO = &device_creator<sega8_othello_device>; const device_type SEGA8_ROM_CASTLE = &device_creator<sega8_castle_device>; const device_type SEGA8_ROM_BASIC_L3 = &device_creator<sega8_basic_l3_device>; const device_type SEGA8_ROM_MUSIC_EDITOR = &device_creator<sega8_music_editor_device>; @@ -62,6 +63,12 @@ sega8_cardcatch_device::sega8_cardcatch_device(const machine_config &mconfig, co } +sega8_othello_device::sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sega8_rom_device(mconfig, SEGA8_ROM_OTHELLO, "SG-1000 Othello Cart", tag, owner, clock, "sega8_othello", __FILE__) +{ +} + + sega8_castle_device::sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : sega8_rom_device(mconfig, SEGA8_ROM_CASTLE, "SG-1000 The Castle Cart", tag, owner, clock, "sega8_castle", __FILE__) { @@ -403,6 +410,31 @@ machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() co /*------------------------------------------------- + Othello is a SG-1000 game featuring 2K of + oncart RAM, mapped at 0x8000-0x9fff. + Is RAM mirrored? For now we assume so... + + -------------------------------------------------*/ + +READ8_MEMBER(sega8_othello_device::read_cart) +{ + // 8K of RAM sits in 0x8000-0x9fff + if (offset >= 0x8000 && offset < 0xa000) + return m_ram[offset & 0x7ff]; + + return m_rom[offset % m_rom_size]; +} + +WRITE8_MEMBER(sega8_othello_device::write_cart) +{ + // 2K of RAM sits in 0x8000-0x9fff + if (offset >= 0x8000 && offset < 0xa000) + m_ram[offset & 0x7ff] = data; +} + + +/*------------------------------------------------- + The Castle is a SG-1000 game featuring 8K of oncart RAM, mapped at 0x8000-0x9fff diff --git a/src/mess/machine/sega8_rom.h b/src/mess/machine/sega8_rom.h index 1d8be4f0db4..1c78a20788f 100644 --- a/src/mess/machine/sega8_rom.h +++ b/src/mess/machine/sega8_rom.h @@ -54,6 +54,21 @@ protected: }; +// ======================> sega8_othello_device + +class sega8_othello_device : public sega8_rom_device +{ +public: + // construction/destruction + sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // reading and writing + virtual DECLARE_READ8_MEMBER(read_cart); + virtual DECLARE_WRITE8_MEMBER(write_cart); + virtual DECLARE_WRITE8_MEMBER(write_mapper) {} +}; + + // ======================> sega8_castle_device class sega8_castle_device : public sega8_rom_device @@ -348,6 +363,7 @@ public: // device type definition extern const device_type SEGA8_ROM_STD; extern const device_type SEGA8_ROM_CARDCATCH; +extern const device_type SEGA8_ROM_OTHELLO; extern const device_type SEGA8_ROM_CASTLE; extern const device_type SEGA8_ROM_BASIC_L3; extern const device_type SEGA8_ROM_MUSIC_EDITOR; diff --git a/src/mess/machine/sega8_slot.c b/src/mess/machine/sega8_slot.c index 673ec44579c..31d8245d966 100644 --- a/src/mess/machine/sega8_slot.c +++ b/src/mess/machine/sega8_slot.c @@ -183,6 +183,7 @@ static const sega8_slot slot_list[] = { SEGA8_JANGGUN, "janggun" }, { SEGA8_KOREAN, "korean" }, { SEGA8_KOREAN_NOBANK, "korean_nb" }, + { SEGA8_OTHELLO, "othello" }, { SEGA8_CASTLE, "castle" }, { SEGA8_BASIC_L3, "level3" }, { SEGA8_MUSIC_EDITOR, "music_editor" }, @@ -282,6 +283,11 @@ void sega8_cart_slot_device::setup_ram() m_cart->ram_alloc(machine(), 0x2000); m_cart->set_has_battery(FALSE); } + else if (m_type == SEGA8_OTHELLO) + { + m_cart->ram_alloc(machine(), 0x800); + m_cart->set_has_battery(FALSE); + } else if (m_type == SEGA8_BASIC_L3) { m_cart->ram_alloc(machine(), 0x8000); diff --git a/src/mess/machine/sega8_slot.h b/src/mess/machine/sega8_slot.h index e88b0976ea0..23d54af0f21 100644 --- a/src/mess/machine/sega8_slot.h +++ b/src/mess/machine/sega8_slot.h @@ -19,6 +19,7 @@ enum SEGA8_JANGGUN, SEGA8_KOREAN, SEGA8_KOREAN_NOBANK, + SEGA8_OTHELLO, SEGA8_CASTLE, SEGA8_BASIC_L3, SEGA8_MUSIC_EDITOR, |