(MESS) sg1000: added emulation of the Card Catcher passthrough cart. [Fabio Priuli]

eventually, softlist will better document which dumps come from cards and which from carts. 
for the moment you can load any sg dump <= 32K as a card
This commit is contained in:
Fabio Priuli 2013-05-24 12:34:50 +00:00
parent 8da97d5847
commit c9024eef8e
5 changed files with 116 additions and 26 deletions

View File

@ -459,19 +459,6 @@ A135 : 森林歷險記 / Sēnlín lìxiǎn jì -> Pitfall II (same as R-049 by A
</part>
</software>
<software name="champbox1" cloneof="champbox">
<description>Champion Boxing (MyCard) (Jpn)</description>
<year>1984</year>
<publisher>Sega</publisher>
<info name="serial" value="C-33"/>
<info name="alt_title" value="チャンピオン ボクシング"/>
<part name="cart" interface="sg1000_cart">
<dataarea name="rom" size="32768">
<rom name="champion boxing (japan) (mycard).bin" size="32768" crc="f8b2ac1d" sha1="7a7ace132090f11bac4f4aec58bcbf6a2a1c6168" offset="000000" />
</dataarea>
</part>
</software>
<software name="champglf">
<description>Champion Golf (Jpn)</description>
<year>1983</year>
@ -489,19 +476,6 @@ A135 : 森林歷險記 / Sēnlín lìxiǎn jì -> Pitfall II (same as R-049 by A
</part>
</software>
<software name="champglf1" cloneof="champglf">
<description>Champion Golf (MyCard) (Jpn)</description>
<year>1983</year>
<publisher>Sega / Logitec</publisher>
<info name="serial" value="C-05"/>
<info name="alt_title" value="チャンピオン ゴルフ"/>
<part name="cart" interface="sg1000_cart">
<dataarea name="rom" size="32768">
<rom name="champion golf [card].bin" size="32768" crc="5a904122" sha1="f58f14581919c431ac85da72fd1a39bbe1da5e66" offset="000000" />
</dataarea>
</part>
</software>
<software name="champglfk" cloneof="champglf">
<description>Champion Golf (Kor)</description>
<year>198?</year>
@ -2965,4 +2939,46 @@ A135 : 森林歷險記 / Sēnlín lìxiǎn jì -> Pitfall II (same as R-049 by A
</part>
</software>
<!-- MyCard -->
<software name="cardctch">
<description>Sega Card Catcher (Jpn)</description>
<year>198?</year>
<publisher>Sega</publisher>
<part name="cart" interface="sg1000_cart">
<feature name="slot" value="cardcatcher" />
<dataarea name="rom" size="1">
<!-- this cartridge is just an adapted -->
</dataarea>
</part>
</software>
<software name="champbox1" cloneof="champbox">
<description>Champion Boxing (Jpn, MyCard)</description>
<year>1984</year>
<publisher>Sega</publisher>
<info name="serial" value="C-33"/>
<info name="alt_title" value="チャンピオン ボクシング"/>
<part name="cart" interface="sg1000_cart">
<dataarea name="rom" size="32768">
<rom name="champion boxing (japan) (mycard).bin" size="32768" crc="f8b2ac1d" sha1="7a7ace132090f11bac4f4aec58bcbf6a2a1c6168" offset="000000" />
</dataarea>
</part>
</software>
<software name="champglf1" cloneof="champglf">
<description>Champion Golf (Jpn, MyCard)</description>
<year>1983</year>
<publisher>Sega / Logitec</publisher>
<info name="serial" value="C-05"/>
<info name="alt_title" value="チャンピオン ゴルフ"/>
<part name="cart" interface="sg1000_cart">
<dataarea name="rom" size="32768">
<rom name="champion golf [card].bin" size="32768" crc="5a904122" sha1="f58f14581919c431ac85da72fd1a39bbe1da5e66" offset="000000" />
</dataarea>
</part>
</software>
</softwarelist>

View File

@ -787,6 +787,7 @@ static SLOT_INTERFACE_START(sg1000_cart)
SLOT_INTERFACE_INTERNAL("music_editor", SEGA8_ROM_MUSIC_EDITOR)
SLOT_INTERFACE_INTERNAL("dahjee_typea", SEGA8_ROM_DAHJEE_TYPEA)
SLOT_INTERFACE_INTERNAL("dahjee_typeb", SEGA8_ROM_DAHJEE_TYPEB)
SLOT_INTERFACE_INTERNAL("cardcatcher", SEGA8_ROM_CARDCATCH)
SLOT_INTERFACE_END
/*-------------------------------------------------

View File

@ -20,6 +20,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_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>;
@ -54,6 +55,13 @@ sega8_rom_device::sega8_rom_device(const machine_config &mconfig, const char *ta
sega8_cardcatch_device::sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: sega8_rom_device(mconfig, SEGA8_ROM_CARDCATCH, "SG-1000 Card Catcher Cart", tag, owner, clock, "sega8_ccatch", __FILE__),
m_card(*this, "cardslot")
{
}
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__)
{
@ -356,6 +364,43 @@ WRITE8_MEMBER(sega8_rom_device::write_mapper)
}
}
/*-------------------------------------------------
Sega Card Catcher is a passthrough adapter for
SG-1000 to load games in MyCard format into the
main cartslot
-------------------------------------------------*/
READ8_MEMBER(sega8_cardcatch_device::read_cart)
{
if (offset < 0x8000)
return m_card->read_cart(space, offset);
return 0xff;
}
WRITE8_MEMBER(sega8_cardcatch_device::write_cart)
{
// this should never happen, because there is no RAM on cards
if (offset < 0x8000)
logerror("Attempt to write to MyCard\n");
}
static SLOT_INTERFACE_START(sg1000_card)
SLOT_INTERFACE_INTERNAL("rom", SEGA8_ROM_STD)
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( sub_slot )
MCFG_SG1000_CARD_ADD("cardslot", sg1000_card, NULL, NULL)
MACHINE_CONFIG_END
machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( sub_slot );
}
/*-------------------------------------------------
The Castle is a SG-1000 game featuring 8K of

View File

@ -34,6 +34,26 @@ protected:
// ======================> sega8_cardcatch_device
class sega8_cardcatch_device : public sega8_rom_device
{
public:
// construction/destruction
sega8_cardcatch_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) {}
virtual machine_config_constructor device_mconfig_additions() const;
protected:
required_device<sega8_card_slot_device> m_card;
};
// ======================> sega8_castle_device
class sega8_castle_device : public sega8_rom_device
@ -327,6 +347,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_CASTLE;
extern const device_type SEGA8_ROM_BASIC_L3;
extern const device_type SEGA8_ROM_MUSIC_EDITOR;

View File

@ -219,5 +219,12 @@ public:
static_cast<sega8_card_slot_device *>(device)->set_intf("sms_card"); \
static_cast<sega8_card_slot_device *>(device)->set_ext("bin"); \
#define MCFG_SG1000_CARD_ADD(_tag,_slot_intf,_def_slot,_def_inp) \
MCFG_DEVICE_ADD(_tag, SEGA8_CARD_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) \
static_cast<sega8_card_slot_device *>(device)->set_intf("sg1000_cart"); \
static_cast<sega8_card_slot_device *>(device)->set_ext("bin,sg"); \
#endif