(MESS) gamegear: added preliminary emulation of the Master Gear Adapter

which allows to launch SMS games in the gamegear driver, with video chip
in SMS mode. You can try this by launching
  mess.exe gamegear -cart mgear -cart2 your_sms_game
(the -cart2 switch becomes available when you mount "mgear" in the main
gamegear cart slot) [Fabio Priuli]

out of the whatsnew: for the moment only fullpath loading is supported, and it is not
ensured to work 100%. thanks to Enik Land for pointing me to the necessary info.
This commit is contained in:
Fabio Priuli 2014-10-12 11:30:13 +00:00
parent 2c4831d5da
commit ab592dea63
12 changed files with 196 additions and 67 deletions

4
.gitattributes vendored
View File

@ -1534,6 +1534,10 @@ src/emu/bus/scv/rom.c svneol=native#text/plain
src/emu/bus/scv/rom.h svneol=native#text/plain
src/emu/bus/scv/slot.c svneol=native#text/plain
src/emu/bus/scv/slot.h svneol=native#text/plain
src/emu/bus/sega8/ccatch.c svneol=native#text/plain
src/emu/bus/sega8/ccatch.h svneol=native#text/plain
src/emu/bus/sega8/mgear.c svneol=native#text/plain
src/emu/bus/sega8/mgear.h svneol=native#text/plain
src/emu/bus/sega8/rom.c svneol=native#text/plain
src/emu/bus/sega8/rom.h svneol=native#text/plain
src/emu/bus/sega8/sega8_slot.c svneol=native#text/plain

View File

@ -9960,4 +9960,17 @@ a certain item) -->
</part>
</software>
<software name="mgear">
<description>Master Gear Adapter</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="gamegear_cart">
<feature name="slot" value="mgear" />
<feature name="pin_42" value="sms_mode" />
<dataarea name="rom" size="1">
<!-- this cartridge is just an adapted -->
</dataarea>
</part>
</software>
</softwarelist>

View File

@ -1143,6 +1143,8 @@ ifneq ($(filter SEGA8,$(BUSES)),)
OBJDIRS += $(BUSOBJ)/sega8
BUSOBJS += $(BUSOBJ)/sega8/sega8_slot.o
BUSOBJS += $(BUSOBJ)/sega8/rom.o
BUSOBJS += $(BUSOBJ)/sega8/ccatch.o
BUSOBJS += $(BUSOBJ)/sega8/mgear.o
endif
#-------------------------------------------------

View File

@ -0,0 +1,61 @@
/***********************************************************************************************************
SG-1000 Card Catcher emulation
Sega Card Catcher is a passthrough adapter for
SG-1000 to load games in MyCard format into the
main cartslot
***********************************************************************************************************/
#include "emu.h"
#include "ccatch.h"
//-------------------------------------------------
// constructors
//-------------------------------------------------
const device_type SEGA8_ROM_CARDCATCH = &device_creator<sega8_cardcatch_device>;
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")
{
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
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)
MACHINE_CONFIG_END
machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( sub_slot );
}

View File

@ -0,0 +1,33 @@
#ifndef __SEGA8_CCATCH_H
#define __SEGA8_CCATCH_H
#include "sega8_slot.h"
#include "rom.h"
// ======================> 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;
};
// device type definition
extern const device_type SEGA8_ROM_CARDCATCH;
#endif

44
src/emu/bus/sega8/mgear.c Normal file
View File

@ -0,0 +1,44 @@
/***********************************************************************************************************
Master Gear Adapter emulation
***********************************************************************************************************/
#include "emu.h"
#include "mgear.h"
//-------------------------------------------------
// constructors
//-------------------------------------------------
const device_type SEGA8_ROM_MGEAR = &device_creator<sega8_mgear_device>;
sega8_mgear_device::sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: sega8_rom_device(mconfig, SEGA8_ROM_MGEAR, "Master Gear Adapter", tag, owner, clock, "sega8_mgear", __FILE__),
m_subslot(*this, "subslot")
{
}
void sega8_mgear_device::device_start()
{
}
void sega8_mgear_device::device_reset()
{
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
static MACHINE_CONFIG_FRAGMENT( sub_slot )
MCFG_SMS_CARTRIDGE_ADD("subslot", sms_cart, NULL)
MACHINE_CONFIG_END
machine_config_constructor sega8_mgear_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( sub_slot );
}

36
src/emu/bus/sega8/mgear.h Normal file
View File

@ -0,0 +1,36 @@
#ifndef __SEGA8_MGEAR_H
#define __SEGA8_MGEAR_H
#include "sega8_slot.h"
#include "rom.h"
// ======================> sega8_mgear_device
class sega8_mgear_device : public sega8_rom_device
{
public:
// construction/destruction
sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// device-level overrides
virtual void device_start();
virtual void device_reset();
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart) { return m_subslot->read_cart(space, offset); }
virtual DECLARE_WRITE8_MEMBER(write_cart) { m_subslot->write_cart(space, offset, data); }
virtual DECLARE_WRITE8_MEMBER(write_mapper) { m_subslot->write_mapper(space, offset, data); }
virtual machine_config_constructor device_mconfig_additions() const;
protected:
required_device<sega8_cart_slot_device> m_subslot;
};
// device type definition
extern const device_type SEGA8_ROM_MGEAR;
#endif

View File

@ -20,7 +20,6 @@
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>;
@ -56,13 +55,6 @@ 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_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__)
{
@ -372,42 +364,6 @@ 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)
MACHINE_CONFIG_END
machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( sub_slot );
}
/*-------------------------------------------------
Othello is a SG-1000 game featuring 2K of

View File

@ -34,26 +34,6 @@ 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_othello_device
class sega8_othello_device : public sega8_rom_device
@ -363,7 +343,6 @@ 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;

View File

@ -822,6 +822,8 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN
// slot interfaces
#include "rom.h"
#include "ccatch.h"
#include "mgear.h"
SLOT_INTERFACE_START(sg1000_cart)
SLOT_INTERFACE_INTERNAL("rom", SEGA8_ROM_STD)
@ -869,5 +871,6 @@ SLOT_INTERFACE_START(gg_cart)
SLOT_INTERFACE_INTERNAL("rom", SEGA8_ROM_STD)
SLOT_INTERFACE_INTERNAL("eeprom", SEGA8_ROM_EEPROM)
SLOT_INTERFACE_INTERNAL("codemasters", SEGA8_ROM_CODEMASTERS)
SLOT_INTERFACE_INTERNAL("mgear", SEGA8_ROM_MGEAR)
SLOT_INTERFACE_END

View File

@ -67,7 +67,6 @@ Notes:
#include "includes/sg1000.h"
#include "bus/rs232/rs232.h"
#include "bus/sega8/rom.h"
/***************************************************************************

View File

@ -231,7 +231,6 @@ DC00 - Selection buttons #2, 9-16 (R)
#include "sound/2413intf.h"
#include "video/315_5124.h"
#include "includes/sms.h"
#include "bus/sega8/rom.h"
#include "sms1.lh"