Previous 199869 Revisions Next

r32688 Sunday 12th October, 2014 at 11:30:13 UTC by Fabio Priuli
(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.
[hash]gamegear.xml
[src/emu/bus]bus.mak
[src/emu/bus/sega8]ccatch.c* ccatch.h* mgear.c* mgear.h* rom.c rom.h sega8_slot.c
[src/mess/drivers]sg1000.c sms.c

trunk/hash/gamegear.xml
r32687r32688
99609960      </part>
99619961   </software>
99629962
9963   <software name="mgear">
9964      <description>Master Gear Adapter</description>
9965      <year>198?</year>
9966      <publisher>&lt;unknown&gt;</publisher>
9967      <part name="cart" interface="gamegear_cart">
9968         <feature name="slot" value="mgear" />
9969         <feature name="pin_42" value="sms_mode" />
9970         <dataarea name="rom" size="1">
9971            <!-- this cartridge is just an adapted -->
9972         </dataarea>
9973      </part>
9974   </software>
9975
99639976</softwarelist>
trunk/src/emu/bus/sega8/sega8_slot.c
r32687r32688
822822
823823// slot interfaces
824824#include "rom.h"
825#include "ccatch.h"
826#include "mgear.h"
825827
826828SLOT_INTERFACE_START(sg1000_cart)
827829   SLOT_INTERFACE_INTERNAL("rom",  SEGA8_ROM_STD)
r32687r32688
869871   SLOT_INTERFACE_INTERNAL("rom",  SEGA8_ROM_STD)
870872   SLOT_INTERFACE_INTERNAL("eeprom",  SEGA8_ROM_EEPROM)
871873   SLOT_INTERFACE_INTERNAL("codemasters",  SEGA8_ROM_CODEMASTERS)
874   SLOT_INTERFACE_INTERNAL("mgear",  SEGA8_ROM_MGEAR)
872875SLOT_INTERFACE_END
873876
trunk/src/emu/bus/sega8/ccatch.h
r0r32688
1#ifndef __SEGA8_CCATCH_H
2#define __SEGA8_CCATCH_H
3
4#include "sega8_slot.h"
5#include "rom.h"
6
7// ======================> sega8_cardcatch_device
8
9class sega8_cardcatch_device : public sega8_rom_device
10{
11public:
12   // construction/destruction
13   sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
14
15   // reading and writing
16   virtual DECLARE_READ8_MEMBER(read_cart);
17   virtual DECLARE_WRITE8_MEMBER(write_cart);
18   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
19
20   virtual machine_config_constructor device_mconfig_additions() const;
21
22protected:
23   required_device<sega8_card_slot_device> m_card;
24};
25
26
27
28
29
30// device type definition
31extern const device_type SEGA8_ROM_CARDCATCH;
32
33#endif
Property changes on: trunk/src/emu/bus/sega8/ccatch.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/sega8/mgear.c
r0r32688
1/***********************************************************************************************************
2
3 Master Gear Adapter emulation
4
5 ***********************************************************************************************************/
6
7
8#include "emu.h"
9#include "mgear.h"
10
11
12//-------------------------------------------------
13//  constructors
14//-------------------------------------------------
15
16const device_type SEGA8_ROM_MGEAR = &device_creator<sega8_mgear_device>;
17
18sega8_mgear_device::sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
19               : sega8_rom_device(mconfig, SEGA8_ROM_MGEAR, "Master Gear Adapter", tag, owner, clock, "sega8_mgear", __FILE__),
20                  m_subslot(*this, "subslot")
21{
22}
23
24
25void sega8_mgear_device::device_start()
26{
27}
28
29void sega8_mgear_device::device_reset()
30{
31}
32
33/*-------------------------------------------------
34 mapper specific handlers
35 -------------------------------------------------*/
36
37static MACHINE_CONFIG_FRAGMENT( sub_slot )
38   MCFG_SMS_CARTRIDGE_ADD("subslot", sms_cart, NULL)
39MACHINE_CONFIG_END
40
41machine_config_constructor sega8_mgear_device::device_mconfig_additions() const
42{
43   return MACHINE_CONFIG_NAME( sub_slot );
44}
Property changes on: trunk/src/emu/bus/sega8/mgear.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/sega8/rom.c
r32687r32688
2020const device_type SEGA8_ROM_STD = &device_creator<sega8_rom_device>;
2121
2222// Specific SG-1000 MkI - MkII cart types
23const device_type SEGA8_ROM_CARDCATCH = &device_creator<sega8_cardcatch_device>;
2423const device_type SEGA8_ROM_OTHELLO = &device_creator<sega8_othello_device>;
2524const device_type SEGA8_ROM_CASTLE = &device_creator<sega8_castle_device>;
2625const device_type SEGA8_ROM_BASIC_L3 = &device_creator<sega8_basic_l3_device>;
r32687r32688
5655
5756
5857
59sega8_cardcatch_device::sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
60               : sega8_rom_device(mconfig, SEGA8_ROM_CARDCATCH, "SG-1000 Card Catcher Cart", tag, owner, clock, "sega8_ccatch", __FILE__),
61                  m_card(*this, "cardslot")
62{
63}
64
65
6658sega8_othello_device::sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6759               : sega8_rom_device(mconfig, SEGA8_ROM_OTHELLO, "SG-1000 Othello Cart", tag, owner, clock, "sega8_othello", __FILE__)
6860{
r32687r32688
374366
375367/*-------------------------------------------------
376368
377 Sega Card Catcher is a passthrough adapter for
378 SG-1000 to load games in MyCard format into the
379 main cartslot
380
381 -------------------------------------------------*/
382
383READ8_MEMBER(sega8_cardcatch_device::read_cart)
384{
385   if (offset < 0x8000)
386      return m_card->read_cart(space, offset);
387
388   return 0xff;
389}
390
391WRITE8_MEMBER(sega8_cardcatch_device::write_cart)
392{
393   // this should never happen, because there is no RAM on cards
394   if (offset < 0x8000)
395      logerror("Attempt to write to MyCard\n");
396}
397
398static SLOT_INTERFACE_START(sg1000_card)
399   SLOT_INTERFACE_INTERNAL("rom",  SEGA8_ROM_STD)
400SLOT_INTERFACE_END
401
402static MACHINE_CONFIG_FRAGMENT( sub_slot )
403   MCFG_SG1000_CARD_ADD("cardslot", sg1000_card, NULL)
404MACHINE_CONFIG_END
405
406machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() const
407{
408   return MACHINE_CONFIG_NAME( sub_slot );
409}
410
411/*-------------------------------------------------
412
413369 Othello is a SG-1000 game featuring 2K of
414370 oncart RAM, mapped at 0x8000-0x9fff.
415371 Is RAM mirrored? For now we assume so...
trunk/src/emu/bus/sega8/mgear.h
r0r32688
1#ifndef __SEGA8_MGEAR_H
2#define __SEGA8_MGEAR_H
3
4#include "sega8_slot.h"
5#include "rom.h"
6
7
8// ======================> sega8_mgear_device
9
10class sega8_mgear_device : public sega8_rom_device
11{
12public:
13   // construction/destruction
14   sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   
16   // device-level overrides
17   virtual void device_start();
18   virtual void device_reset();
19   
20   // reading and writing
21   virtual DECLARE_READ8_MEMBER(read_cart) { return m_subslot->read_cart(space, offset); }
22   virtual DECLARE_WRITE8_MEMBER(write_cart) { m_subslot->write_cart(space, offset, data); }
23   virtual DECLARE_WRITE8_MEMBER(write_mapper) { m_subslot->write_mapper(space, offset, data); }
24
25   virtual machine_config_constructor device_mconfig_additions() const;
26
27protected:
28   required_device<sega8_cart_slot_device> m_subslot;
29};
30
31
32// device type definition
33extern const device_type SEGA8_ROM_MGEAR;
34
35
36#endif
Property changes on: trunk/src/emu/bus/sega8/mgear.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/sega8/rom.h
r32687r32688
3434
3535
3636
37// ======================> sega8_cardcatch_device
38
39class sega8_cardcatch_device : public sega8_rom_device
40{
41public:
42   // construction/destruction
43   sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
44
45   // reading and writing
46   virtual DECLARE_READ8_MEMBER(read_cart);
47   virtual DECLARE_WRITE8_MEMBER(write_cart);
48   virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
49
50   virtual machine_config_constructor device_mconfig_additions() const;
51
52protected:
53   required_device<sega8_card_slot_device> m_card;
54};
55
56
5737// ======================> sega8_othello_device
5838
5939class sega8_othello_device : public sega8_rom_device
r32687r32688
363343
364344// device type definition
365345extern const device_type SEGA8_ROM_STD;
366extern const device_type SEGA8_ROM_CARDCATCH;
367346extern const device_type SEGA8_ROM_OTHELLO;
368347extern const device_type SEGA8_ROM_CASTLE;
369348extern const device_type SEGA8_ROM_BASIC_L3;
trunk/src/emu/bus/sega8/ccatch.c
r0r32688
1/***********************************************************************************************************
2
3 SG-1000 Card Catcher emulation
4 
5 Sega Card Catcher is a passthrough adapter for
6 SG-1000 to load games in MyCard format into the
7 main cartslot
8
9 ***********************************************************************************************************/
10
11
12#include "emu.h"
13#include "ccatch.h"
14
15
16//-------------------------------------------------
17//  constructors
18//-------------------------------------------------
19
20const device_type SEGA8_ROM_CARDCATCH = &device_creator<sega8_cardcatch_device>;
21
22
23
24sega8_cardcatch_device::sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
25               : sega8_rom_device(mconfig, SEGA8_ROM_CARDCATCH, "SG-1000 Card Catcher Cart", tag, owner, clock, "sega8_ccatch", __FILE__),
26                  m_card(*this, "cardslot")
27{
28}
29
30
31/*-------------------------------------------------
32 mapper specific handlers
33 -------------------------------------------------*/
34
35READ8_MEMBER(sega8_cardcatch_device::read_cart)
36{
37   if (offset < 0x8000)
38      return m_card->read_cart(space, offset);
39
40   return 0xff;
41}
42
43WRITE8_MEMBER(sega8_cardcatch_device::write_cart)
44{
45   // this should never happen, because there is no RAM on cards
46   if (offset < 0x8000)
47      logerror("Attempt to write to MyCard\n");
48}
49
50static SLOT_INTERFACE_START(sg1000_card)
51   SLOT_INTERFACE_INTERNAL("rom",  SEGA8_ROM_STD)
52SLOT_INTERFACE_END
53
54static MACHINE_CONFIG_FRAGMENT( sub_slot )
55   MCFG_SG1000_CARD_ADD("cardslot", sg1000_card, NULL)
56MACHINE_CONFIG_END
57
58machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() const
59{
60   return MACHINE_CONFIG_NAME( sub_slot );
61}
Property changes on: trunk/src/emu/bus/sega8/ccatch.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/bus.mak
r32687r32688
11431143OBJDIRS += $(BUSOBJ)/sega8
11441144BUSOBJS += $(BUSOBJ)/sega8/sega8_slot.o
11451145BUSOBJS += $(BUSOBJ)/sega8/rom.o
1146BUSOBJS += $(BUSOBJ)/sega8/ccatch.o
1147BUSOBJS += $(BUSOBJ)/sega8/mgear.o
11461148endif
11471149
11481150#-------------------------------------------------
trunk/src/mess/drivers/sg1000.c
r32687r32688
6767
6868#include "includes/sg1000.h"
6969#include "bus/rs232/rs232.h"
70#include "bus/sega8/rom.h"
7170
7271
7372/***************************************************************************
trunk/src/mess/drivers/sms.c
r32687r32688
231231#include "sound/2413intf.h"
232232#include "video/315_5124.h"
233233#include "includes/sms.h"
234#include "bus/sega8/rom.h"
235234
236235#include "sms1.lh"
237236

Previous 199869 Revisions Next


© 1997-2024 The MAME Team