Previous 199869 Revisions Next

r34061 Friday 26th December, 2014 at 07:00:33 UTC by Fabio Priuli
(MESS) gamegear: fixed detection of SMS games (via adapter) and added
support for connecting a SMS pad to the unit (via Gear2Gear port + adapter)
to play 2players games. [Enik Land]

out of whatsnew: needless to say, we are not yet in the position to use the
Gear2Gear port to link two gamegear units, so don't ask ;-)
[src/emu/bus]bus.mak
[src/emu/bus/sms_ctrl]multitap.c sportsjp.c sportsjp.h
[src/mess]mess.mak
[src/mess/drivers]sms.c
[src/mess/includes]sms.h
[src/mess/machine]sms.c

trunk/src/emu/bus/bus.mak
r242572r242573
12541254
12551255#-------------------------------------------------
12561256#
1257#@src/emu/bus/gamegear/gear2gear.h,BUSES += GAMEGEAR
1258#-------------------------------------------------
1259
1260ifneq ($(filter GAMEGEAR,$(BUSES)),)
1261OBJDIRS += $(BUSOBJ)/gamegear
1262BUSOBJS += $(BUSOBJ)/gamegear/gear2gear.o
1263BUSOBJS += $(BUSOBJ)/gamegear/smsctrladp.o
1264endif
1265
1266#-------------------------------------------------
1267#
12571268#@src/emu/bus/gba/gba_slot.h,BUSES += GBA
12581269#-------------------------------------------------
12591270
trunk/src/emu/bus/sms_ctrl/multitap.c
r242572r242573
2929//-------------------------------------------------
3030
3131sms_multitap_device::sms_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
32   device_t(mconfig, SMS_MULTITAP, "Furrtek's Multitap", tag, owner, clock, "sms_multitap", __FILE__),
32   device_t(mconfig, SMS_MULTITAP, "Multitap", tag, owner, clock, "sms_multitap", __FILE__),
3333   device_sms_control_port_interface(mconfig, *this),
3434   m_subctrl1_port(*this, "ctrl1"),
3535   m_subctrl2_port(*this, "ctrl2"),
trunk/src/emu/bus/sms_ctrl/sportsjp.c
r242572r242573
11/**********************************************************************
22
3    Sega Master System "Sports Pad" (japanese model) emulation
3    Sega Master System "Sports Pad" (Japanese model) emulation
44
55    Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88**********************************************************************/
99
10// The japanese Sports Pad controller is only required to play the cartridge
10// The Japanese Sports Pad controller is only required to play the cartridge
1111// Sports Pad Soccer, released in Japan. It uses a different mode than the
1212// used by the US model, due to missing output lines on Sega Mark III
1313// controller ports.
trunk/src/emu/bus/sms_ctrl/sportsjp.h
r242572r242573
11/**********************************************************************
22
3    Sega Master System "Sports Pad" (japanese model) emulation
3    Sega Master System "Sports Pad" (Japanese model) emulation
44
55    Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88**********************************************************************/
99
10// The japanese Sports Pad controller is only required to play the cartridge
10// The Japanese Sports Pad controller is only required to play the cartridge
1111// Sports Pad Soccer, released in Japan. It uses a different mode than the
1212// used by the US model, due to missing output lines on Sega Mark III
1313// controller ports.
trunk/src/mess/drivers/sms.c
r242572r242573
1313 To do:
1414
1515 - SIO interface for Game Gear (needs netplay, I guess)
16 - Gear to Gear Port SMS Controller Adaptor
1716 - Sega Demo Unit II (kiosk expansion device)
1817 - SMS Disk System (floppy disk drive expansion device) - unreleased
1918 - Rapid button of Japanese Master System
r242572r242573
2423 - Software compatibility flags, by region and/or BIOS
2524 - Emulate SRAM cartridges? (for use with Bock's dump tool)
2625 - Support for other DE-9 compatible controllers, like the Mega Drive 6-Button
27   that has software support (at least a test tool made by Charles MacDonald)
26   that has homebrew software support
2827
2928 The Game Gear SIO hardware is not emulated but has some
3029 placeholders in 'machine/sms.c'
r242572r242573
4746
4847--------------------------------------------------------------------------------
4948
49General compatibility issues on real hardware (not emulation bugs):
50
51- Some ROMs have issues or don't work when running on a console of different
52  region;
53- Many Japanese/Korean or homebrew ROMs don't have the signature required by
54  BIOSes of consoles sold overseas;
55- Paddle games need to detect the system region as Japanese to work with the
56  Paddle controller;
57- Few games of the ones with FM support need to detect the system region as
58  Japanese to play FM sound;
59- The Light Phaser gun doesn't work with the Japanese SMS;
60- There are reports about Light Phaser working on the second Korean console
61  version, and a Korean advert shows support on the first version (Gam*Boy I,
62  although based on Japanese SMS);
63- The Korean SMS versions have Japanese-format cartridge slot, but only on the
64  first (Gam*Boy I) the region is detected as Japanese;
65- Some SMS ROMs don't run when are plugged-in to SMS expansion slot, through
66  the gender adapter;
67- Some SMS ROMs don't run when are plugged-in to a Game Gear, through the
68  Master Gear adapter;
69
70--------------------------------------------------------------------------------
71
5072Sega Master System II
5173Sega 1990
5274
r242572r242573
338360   AM_RANGE(0x40, 0x7f)                 AM_DEVWRITE("gamegear", gamegear_device, write)
339361   AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, vram_read, vram_write)
340362   AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, register_read, register_write)
341   AM_RANGE(0xc0, 0xc0)                 AM_READ_PORT("GG_PORT_DC")
342   AM_RANGE(0xc1, 0xc1)                 AM_READ_PORT("GG_PORT_DD")
343   AM_RANGE(0xdc, 0xdc)                 AM_READ_PORT("GG_PORT_DC")
344   AM_RANGE(0xdd, 0xdd)                 AM_READ_PORT("GG_PORT_DD")
363   AM_RANGE(0xc0, 0xc0)                 AM_READ(sms_input_port_dc_r)
364   AM_RANGE(0xc1, 0xc1)                 AM_READ(sms_input_port_dd_r)
365   AM_RANGE(0xdc, 0xdc)                 AM_READ(sms_input_port_dc_r)
366   AM_RANGE(0xdd, 0xdd)                 AM_READ(sms_input_port_dd_r)
345367ADDRESS_MAP_END
346368
347369
r242572r242573
439461   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
440462   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
441463
442   PORT_START("GG_PORT_DD")
443   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
444
445464   PORT_START("START")
446465   PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
447466   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("Start") /* Game Gear START */
r242572r242573
785804   MCFG_GG_CARTRIDGE_ADD("slot", gg_cart, NULL)
786805
787806   MCFG_SOFTWARE_LIST_ADD("cart_list", "gamegear")
807
808   MCFG_GG_GEAR2GEAR_PORT_ADD("gear2gear", gg_gear2gear_port_devices, NULL)
809   MCFG_GG_GEAR2GEAR_PORT_TH_INPUT_HANDLER(WRITELINE(sms_state, sms_ctrl2_th_input)) // not verified
810   //MCFG_GG_GEAR2GEAR_PORT_PIXEL_HANDLER(READ32(sms_state, sms_pixel_color)) // only for GG-TV mod
788811MACHINE_CONFIG_END
789812
790813
r242572r242573
963986   - Sega Mark III Soft Desk 10
964987   - Sega Shooting Zone
965988
989   The SMS Store Display Unit is labeled PD-W UNIT. Pictures found on Internet
990   show cartridges with a label where a not-for-sale message is written along
991   the information that it is for use on the Product Display-Working Unit.
992
966993***************************************************************************/
967994
968995/*    YEAR  NAME        PARENT      COMPAT  MACHINE      INPUT     CLASS           INIT      COMPANY     FULLNAME                            FLAGS */
trunk/src/mess/includes/sms.h
r242572r242573
1919#define CONTROL1_TAG   "ctrl1"
2020#define CONTROL2_TAG   "ctrl2"
2121
22#include "bus/gamegear/gear2gear.h"
2223#include "bus/sms_ctrl/smsctrl.h"
2324#include "bus/sms_exp/smsexp.h"
2425#include "bus/sega8/sega8_slot.h"
r242572r242573
3637      m_region_maincpu(*this, "maincpu"),
3738      m_port_ctrl1(*this, CONTROL1_TAG),
3839      m_port_ctrl2(*this, CONTROL2_TAG),
40      m_port_gear2gear(*this, "gear2gear"),
41      m_port_gg_dc(*this, "GG_PORT_DC"),
3942      m_port_pause(*this, "PAUSE"),
4043      m_port_reset(*this, "RESET"),
4144      m_port_start(*this, "START"),
r242572r242573
6366   required_memory_region m_region_maincpu;
6467   optional_device<sms_control_port_device> m_port_ctrl1;
6568   optional_device<sms_control_port_device> m_port_ctrl2;
69   optional_device<gg_gear2gear_port_device> m_port_gear2gear;
70   optional_ioport m_port_gg_dc;
6671   optional_ioport m_port_pause;
6772   optional_ioport m_port_reset;
6873   optional_ioport m_port_start;
r242572r242573
195200   void setup_media_slots();
196201   void setup_enabled_slots();
197202   void lphaser_hcount_latch();
198   void sms_get_inputs(address_space &space);
203   void sms_get_inputs();
199204};
200205
201206class smssdisp_state : public sms_state
trunk/src/mess/machine/sms.c
r242572r242573
4545
4646WRITE_LINE_MEMBER(sms_state::sms_ctrl2_th_input)
4747{
48   if (m_is_gamegear && (!m_cartslot->exists() || !m_cartslot->m_cart->get_sms_mode()))
49      return;
50
4851   // Check if TH of controller port 2 is set to input (1)
4952   if (m_io_ctrl_reg & 0x08)
5053   {
r242572r242573
6366}
6467
6568
66void sms_state::sms_get_inputs( address_space &space )
69void sms_state::sms_get_inputs()
6770{
68   UINT8 data1, data2;
71   UINT8 data1 = 0xff;
72   UINT8 data2 = 0xff;
6973
7074   m_port_dc_reg = 0xff;
7175   m_port_dd_reg = 0xff;
r242572r242573
7478   // physical pins numbering. For register bits whose order differs,
7579   // it's necessary move the equivalent controller bits to match.
7680
77   data1 = m_port_ctrl1->port_r();
78   m_port_dc_reg &= ~0x0f | data1; // Up, Down, Left, Right
79   m_port_dc_reg &= ~0x10 | (data1 >> 1); // TL (Button 1)
80   m_port_dc_reg &= ~0x20 | (data1 >> 2); // TR (Button 2)
81   if (m_is_gamegear)
82   {
83      data1 = m_port_gg_dc->read();
84      m_port_dc_reg &= ~0x03f | data1;
85   }
86   else
87   {
88      data1 = m_port_ctrl1->port_r();
89      m_port_dc_reg &= ~0x0f | data1; // Up, Down, Left, Right
90      m_port_dc_reg &= ~0x10 | (data1 >> 1); // TL (Button 1)
91      m_port_dc_reg &= ~0x20 | (data1 >> 2); // TR (Button 2)
92   }
8193
82   data2 = m_port_ctrl2->port_r();
94   if (m_is_gamegear)
95   {
96      if (m_cartslot->exists() && m_cartslot->m_cart->get_sms_mode())
97         data2 = m_port_gear2gear->port_r();
98   }
99   else
100   {
101      data2 = m_port_ctrl2->port_r();
102   }
83103   m_port_dc_reg &= ~0xc0 | (data2 << 6); // Up, Down
84104   m_port_dd_reg &= ~0x03 | (data2 >> 2); // Left, Right
85105   m_port_dd_reg &= ~0x04 | (data2 >> 3); // TL (Button 1)
r242572r242573
116136      }
117137      else
118138      {
119         sms_get_inputs(space);
139         sms_get_inputs();
120140         return m_port_dc_reg;
121141      }
122142   }
r242572r242573
129149   UINT8 ctrl1_port_data = 0xff;
130150   UINT8 ctrl2_port_data = 0xff;
131151
152   if (m_is_gamegear && (!m_cartslot->exists() || !m_cartslot->m_cart->get_sms_mode()))
153   {
154      m_io_ctrl_reg = data;
155      return;
156   }
157
132158   // Controller Port 1:
133159
134160   // check if TR or TH are set to output (0).
r242572r242573
171197      }
172198      if (!m_is_gamegear)
173199         m_port_ctrl2->port_w(ctrl2_port_data);
200      else
201         m_port_gear2gear->port_w(ctrl2_port_data); // not verified
174202   }
175203   // check if TH is set to input (1).
176204   if (data & 0x08)
177205   {
178206      if (!m_is_gamegear)
179207         ctrl2_port_data &= ~0x40 | m_port_ctrl2->port_r();
208      else
209         ctrl2_port_data &= ~0x40 | m_port_gear2gear->port_r(); // not verified
180210
181211      // check if TH input level is high (1) and was output/low (0)
182212      if ((ctrl2_port_data & 0x40) && !(m_io_ctrl_reg & 0x88))
r242572r242573
232262{
233263   if (m_is_mark_iii)
234264   {
235      sms_get_inputs(space);
265      sms_get_inputs();
236266      return m_port_dc_reg;
237267   }
238268
239   if (m_mem_ctrl_reg & IO_CHIP)
269   if (!m_is_gamegear && (m_mem_ctrl_reg & IO_CHIP))
240270   {
241271      return 0xff;
242272   }
243273   else
244274   {
245      sms_get_inputs(space);
275      sms_get_inputs();
246276
247277      // Check if TR of controller port 1 is set to output (0)
248278      if (!(m_io_ctrl_reg & 0x01))
r242572r242573
260290{
261291   if (m_is_mark_iii)
262292   {
263      sms_get_inputs(space);
293      sms_get_inputs();
264294      return m_port_dd_reg;
265295   }
266296
267   if (m_mem_ctrl_reg & IO_CHIP)
297   if (!m_is_gamegear && (m_mem_ctrl_reg & IO_CHIP))
268298      return 0xff;
269299
270   sms_get_inputs(space);
300   sms_get_inputs();
271301
272302   // Check if TR of controller port 2 is set to output (0)
273303   if (!(m_io_ctrl_reg & 0x04))
r242572r242573
276306      m_port_dd_reg &= ~0x08 | ((m_io_ctrl_reg & 0x40) >> 3);
277307   }
278308
279   if (m_is_smsj)
309   if (m_is_smsj || (m_is_gamegear && m_is_gg_region_japan))
280310   {
281311      // For Japanese Master System, set upper 4 bits with TH/TR
282312      // direction bits of IO control register, according to Enri's
283313      // docs (http://www43.tok2.com/home/cmpslv/Sms/EnrSms.htm).
284314      // This makes the console incapable of using the Light Phaser.
315      // Assume the same for a Japanese Game Gear.
285316      m_port_dd_reg &= ~0x10 | ((m_io_ctrl_reg & 0x01) << 4);
286317      m_port_dd_reg &= ~0x20 | ((m_io_ctrl_reg & 0x04) << 3);
287318      m_port_dd_reg &= ~0x40 | ((m_io_ctrl_reg & 0x02) << 5);
trunk/src/mess/mess.mak
r242572r242573
595595BUSES += EP64
596596BUSES += EPSON_SIO
597597BUSES += GAMEBOY
598BUSES += GAMEGEAR
598599BUSES += GBA
599600BUSES += GENERIC
600601BUSES += IEEE488


Previous 199869 Revisions Next


© 1997-2024 The MAME Team