(MESS) sms: fixed Korean Gam*Boy 2 being detected as a Japanese

machine when a real unit does not. [Enik Land]

New driver added :
- Samsung Gam*Boy I [Enik Land]
This commit is contained in:
Fabio Priuli 2014-03-26 09:36:44 +00:00
parent 49b16af8c9
commit c368097095
4 changed files with 96 additions and 85 deletions

View File

@ -11,26 +11,18 @@
- SIO interface for Game Gear (needs netplay, I guess)
- Gear to Gear Port SMS Controller Adaptor
- SMS Store Display Unit (Kiosk)
- SMS Disk System (floppy disk drive) - unreleased
- SMS Store Display Unit (kiosk console)
- Sega Demo Unit II (kiosk expansion device)
- SMS Disk System (floppy disk drive expansion device) - unreleased
- Sega Graphic Board (black version) - unreleased
- Rapid button of japanese Master System
- Keyboard support for Sega Mark III (sg1000m3 driver)
- Link between two Mark III's through keyboard, supported by F-16 Fighting Falcon
- Mark III expansion slot, used by keyboard and FM module
- Software compatibility flags, by region and/or BIOS
- Emulate SRAM cartridges? (for use with Bock's dump tool)
- Support for other DE-9 compatible controllers, like the Mega Drive 6-Button
that has software support (at least a test tool made by Charles MacDonald)
- Figure out how korean SMS versions have support for the Light Phaser gun
Light Phaser support of korean SMS consoles is shown in some korean adverts:
www.smspower.org/forums/viewtopic.php?p=45903#45903
The support requires read of TH input state through the 2 upper bits of
port $dd. Because the korean driver is set to Japan region, it behaves like
the japanese SMS, which sets those bits with TH direction state, not input.
The first korean SMS is derivered from the japanese SMS, but only the units
with plug-in AC adaptor have the FM chip. Games only play FM sound when detect
the japanese region by testing how the 2 upper bits of port $dd behave.
The Game Gear SIO hardware is not emulated but has some
placeholders in 'machine/sms.c'
@ -273,30 +265,6 @@ static ADDRESS_MAP_START( sms_store_mem, AS_PROGRAM, 8, smssdisp_state )
AM_RANGE(0xdc00, 0xdc00) AM_READ(sms_store_select2) /* Game selector port #2 */
ADDRESS_MAP_END
static ADDRESS_MAP_START( sms_io, AS_IO, 8, sms_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00, 0x00) AM_MIRROR(0x3e) AM_WRITE(sms_mem_control_w)
AM_RANGE(0x01, 0x01) AM_MIRROR(0x3e) AM_WRITE(sms_io_control_w)
AM_RANGE(0x40, 0x7f) AM_READ(sms_count_r)
AM_RANGE(0x40, 0x7f) AM_DEVWRITE("segapsg", segapsg_device, write)
AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, vram_read, vram_write)
AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, register_read, register_write)
AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1e) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xc1, 0xc1) AM_MIRROR(0x1e) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0e) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xe1, 0xe1) AM_MIRROR(0x0e) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xf0, 0xf0) AM_READWRITE(sms_input_port_dc_r, sms_ym2413_register_port_w)
AM_RANGE(0xf1, 0xf1) AM_READWRITE(sms_input_port_dd_r, sms_ym2413_data_port_w)
AM_RANGE(0xf2, 0xf2) AM_READWRITE(sms_fm_detect_r, sms_fm_detect_w)
AM_RANGE(0xf3, 0xf3) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xf4, 0xf4) AM_MIRROR(0x02) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xf5, 0xf5) AM_MIRROR(0x02) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xf8, 0xf8) AM_MIRROR(0x06) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xf9, 0xf9) AM_MIRROR(0x06) AM_READ(sms_input_port_dd_r)
ADDRESS_MAP_END
// I/O ports $3E and $3F do not exist on Mark III
static ADDRESS_MAP_START( sg1000m3_io, AS_IO, 8, sms_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
@ -320,35 +288,38 @@ static ADDRESS_MAP_START( sg1000m3_io, AS_IO, 8, sms_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( sms_io, AS_IO, 8, sms_state )
AM_IMPORT_FROM(sg1000m3_io)
AM_RANGE(0x00, 0x00) AM_MIRROR(0x3e) AM_WRITE(sms_mem_control_w)
AM_RANGE(0x01, 0x01) AM_MIRROR(0x3e) AM_WRITE(sms_io_control_w)
ADDRESS_MAP_END
// It seems the Korean versions do some more strict decoding on the I/O
// addresses.
// At least the mirrors for I/O ports $3E/$3F don't seem to exist there.
// Enri's doc about the Japanese SMS also doesn't mention them.
// Leaving the mirrors breaks the Korean cartridge bublboky.
// Assume the same for the japanese SMS, which derived the first korean
// version.
static ADDRESS_MAP_START( smsj_io, AS_IO, 8, sms_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
ADDRESS_MAP_UNMAP_HIGH
AM_IMPORT_FROM(sg1000m3_io)
AM_RANGE(0x3e, 0x3e) AM_WRITE(sms_mem_control_w)
AM_RANGE(0x3f, 0x3f) AM_WRITE(sms_io_control_w)
AM_RANGE(0x40, 0x7f) AM_READ(sms_count_r)
AM_RANGE(0x40, 0x7f) AM_DEVWRITE("segapsg", segapsg_device, write)
AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, vram_read, vram_write)
AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_DEVREADWRITE("sms_vdp", sega315_5124_device, register_read, register_write)
AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1e) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xc1, 0xc1) AM_MIRROR(0x1e) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0e) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xe1, 0xe1) AM_MIRROR(0x0e) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xf0, 0xf0) AM_READWRITE(sms_input_port_dc_r, sms_ym2413_register_port_w)
AM_RANGE(0xf1, 0xf1) AM_READWRITE(sms_input_port_dd_r, sms_ym2413_data_port_w)
AM_RANGE(0xf2, 0xf2) AM_READWRITE(sms_fm_detect_r, sms_fm_detect_w)
AM_RANGE(0xf3, 0xf3) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xf4, 0xf4) AM_MIRROR(0x02) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xf5, 0xf5) AM_MIRROR(0x02) AM_READ(sms_input_port_dd_r)
AM_RANGE(0xf8, 0xf8) AM_MIRROR(0x06) AM_READ(sms_input_port_dc_r)
AM_RANGE(0xf9, 0xf9) AM_MIRROR(0x06) AM_READ(sms_input_port_dd_r)
ADDRESS_MAP_END
// The first Korean version also seems to lack I/O port $3F.
// Games detect the first version as Japanese region (opposite to the second
// version). The region detection tests the behavior of the TH bits of port
// $DD. Port $3F sets the mode used by those bits. If the first version would
// use the same mode used by Japanese SMS, it would't support the Light Phaser,
// as it does. If it would use the standard mode of other SMS versions, the
// system would be detected as Export region.
static ADDRESS_MAP_START( sms1kr_io, AS_IO, 8, sms_state )
AM_IMPORT_FROM(sg1000m3_io)
AM_RANGE(0x3e, 0x3e) AM_WRITE(sms_mem_control_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( gg_io, AS_IO, 8, sms_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
ADDRESS_MAP_UNMAP_HIGH
@ -763,7 +734,20 @@ static MACHINE_CONFIG_DERIVED( sms1_pal, sms_pal_base )
MCFG_SMS_EXPANSION_ADD("exp", sms_expansion_devices, NULL)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( sms_fm, sms1_ntsc )
static MACHINE_CONFIG_DERIVED( sms1_kr, sms1_ntsc )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(sms1kr_io)
MCFG_DEVICE_REMOVE("slot")
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, NULL)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( sms1_krfm, sms1_kr )
MCFG_SOUND_ADD("ym2413", YM2413, XTAL_53_693175MHz/15)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( smsj, sms1_krfm )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(smsj_io)
@ -774,22 +758,19 @@ static MACHINE_CONFIG_DERIVED( sms_fm, sms1_ntsc )
MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(NULL)
MCFG_SMS_CONTROL_PORT_MODIFY(CONTROL2_TAG)
MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(NULL)
MCFG_SOUND_ADD("ym2413", YM2413, XTAL_53_693175MHz/15)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( sg1000m3, sms_fm )
static MACHINE_CONFIG_DERIVED( sg1000m3, smsj )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(sg1000m3_io)
MCFG_DEVICE_REMOVE("slot")
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, NULL)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( sms2_kr, sms2_ntsc )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(smsj_io)
MCFG_DEVICE_REMOVE("slot")
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, NULL)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( gamegear, sms_state )
@ -909,7 +890,7 @@ ROM_START(smsj) /* PCB Label: "SEGA(R) IC BOARD M4J MAIN // 837-6418"; has "YM24
ROMX_LOAD("mpr-11124.ic2", 0x0000, 0x2000, CRC(48d44a13) SHA1(a8c1b39a2e41137835eda6a5de6d46dd9fadbaf2), ROM_BIOS(1)) /* "SONY 7J06 // MPR-11124 // JAPAN 021" @ IC2 */
ROM_END
ROM_START(sms2kr)
ROM_START(smskr)
ROM_REGION(0x4000, "maincpu", 0)
ROM_FILL(0x0000, 0x4000, 0xff)
@ -929,6 +910,8 @@ ROM_START(gamegear)
ROM_END
#define rom_gamegeaj rom_gamegear
#define rom_sms1krfm rom_smsj
#define rom_sms1kr rom_smsj
/***************************************************************************
@ -941,23 +924,26 @@ ROM_END
- built-in Hang On/Safari Hunt v2.4 - 1988
- built-in Hang On v3.4 - 1988
- built-in Missile Defense 3-D v4.4 - 1988
- built-in Hang On/Astro Warrior ????
- built-in Hang On/Astro Warrior - 19??
- Sega Master System II (sms)
- built-in Alex Kidd in Miracle World - 1990
JP
- Sega SG-1000 Mark III (sg1000m3)
- no bios
- no bios - 1985
- Sega Master System (I) (smsj)
- without built-in game v2.1 - 1987
KR
- Samsung Gam*Boy (same as smsj)
- Samsung Gam*Boy (I) - with FM Chip (sms1krfm)
- without built-in game v2.1 - 1989
(same smsj driver used, despite units with plug-in AC adaptor
have FM and the ones with built-in AC adaptor do not)
- Samsung Gam*Boy II / Aladdin Boy (sms2kr)
- built-in Alex Kidd in Miracle World (Korean) - 1992 for A.Boy
- Samsung Gam*Boy (I) (sms1kr)
- without built-in game v2.1 - 19??
- Samsung Gam*Boy II / Aladdin Boy (smskr)
- built-in Alex Kidd in Miracle World (Korean) - 1991 (GB II) / 1992 (AB)
Note about KR:
- units of Gam*Boy (I) with plug-in AC adaptor have FM and the ones with
built-in AC adaptor do not.
EU
- Sega Master System (I) (sms1pal)
@ -965,7 +951,7 @@ ROM_END
- built-in Hang On/Safari Hunt v2.4 - 1988
- built-in Hang On v3.4 - 1988
- built-in Missile Defense 3-D v4.4 - 1988
- built-in Hang On/Astro Warrior ????
- built-in Hang On/Astro Warrior - 19??
- Sega Master System II (smspal)
- built-in Alex Kidd in Miracle World - 1990
- built-in Sonic the Hedgehog - 1991
@ -979,14 +965,14 @@ ROM_END
- built-in Alex Kidd in Miracle World - 1992
- built-in Sonic the Hedgehog - 1993
- built-in World Cup Italia '90 (Super Futebol II) - 1994
- built-in Hang On/Safari Hunt v2.4 (blue L.Phaser pack)
- built-in Hang On/Safari Hunt v2.4 (blue L.Phaser pack) - 199?
- Tec Toy Master System Super Compact (no driver)
- built-in Alex Kidd in Miracle World - 1993 (or 1994?)
- built-in Sonic the Hedgehog - 1993
- built-in Alex Kidd in Miracle World - 1994 ?
- built-in World Cup Italia '90 (Super Futebol II) - 1994
- Tec Toy Master System Girl (no driver)
- built-in Monica no Castelo do Dragao
- built-in Sonic the Hedgehog (T. Monica em O Resgate pack)
- built-in Monica no Castelo do Dragao - 199?
- built-in Sonic the Hedgehog (T. Monica em O Resgate pack) - 199?
Notes about BR:
- PAL-M has same frequency and line count of NTSC
- Tec Toy later changed its logo twice and its name to Tectoy
@ -997,18 +983,21 @@ ROM_END
- Sega Game Box 9
- Sega Mark III Soft Desk 5
- Sega Mark III Soft Desk 10
- Sega Shooting Zone
***************************************************************************/
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
CONS( 1984, sg1000m3, sms, 0, sg1000m3, sg1000m3, sms_state, sg1000m3, "Sega", "SG-1000 Mark III", GAME_SUPPORTS_SAVE )
CONS( 1985, sg1000m3, sms, 0, sg1000m3, sg1000m3, sms_state, sg1000m3, "Sega", "SG-1000 Mark III", GAME_SUPPORTS_SAVE )
CONS( 1986, sms1, sms, 0, sms1_ntsc, sms1, sms_state, sms1, "Sega", "Master System I", GAME_SUPPORTS_SAVE )
CONS( 1986, sms1pal, sms, 0, sms1_pal, sms1, sms_state, sms1, "Sega", "Master System I (PAL)" , GAME_SUPPORTS_SAVE )
CONS( 1986, smssdisp, sms, 0, sms_sdisp, sms, smssdisp_state, smssdisp, "Sega", "Master System Store Display Unit", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
CONS( 1987, smsj, sms, 0, sms_fm, smsj, sms_state, smsj, "Sega", "Master System (Japan)", GAME_SUPPORTS_SAVE )
CONS( 1987, smsj, sms, 0, smsj, smsj, sms_state, smsj, "Sega", "Master System (Japan)", GAME_SUPPORTS_SAVE )
CONS( 1990, sms, 0, 0, sms2_ntsc, sms, sms_state, sms1, "Sega", "Master System II", GAME_SUPPORTS_SAVE )
CONS( 1990, smspal, sms, 0, sms2_pal, sms, sms_state, sms1, "Sega", "Master System II (PAL)", GAME_SUPPORTS_SAVE )
CONS( 1990, sms2kr, sms, 0, sms2_kr, sms, sms_state, sms2kr, "Samsung", "Gam*Boy II (Korea)", GAME_SUPPORTS_SAVE )
CONS( 1989, sms1krfm, sms, 0, sms1_krfm, smsj, sms_state, sms1krfm, "Samsung", "Gam*Boy I - FM (Korea)", GAME_SUPPORTS_SAVE )
CONS( 19??, sms1kr, sms, 0, sms1_kr, smsj, sms_state, sms1kr, "Samsung", "Gam*Boy I (Korea)", GAME_SUPPORTS_SAVE )
CONS( 1991, smskr, sms, 0, sms2_kr, sms, sms_state, smskr, "Samsung", "Gam*Boy II (Korea)", GAME_SUPPORTS_SAVE )
CONS( 1990, gamegear, 0, sms, gamegear, gg, sms_state, gamegear, "Sega", "Game Gear (Europe/America)", GAME_SUPPORTS_SAVE )
CONS( 1990, gamegeaj, gamegear, 0, gamegear, gg, sms_state, gamegeaj, "Sega", "Game Gear (Japan)", GAME_SUPPORTS_SAVE )

View File

@ -45,6 +45,7 @@ public:
m_mainram(NULL),
m_is_gamegear(0),
m_is_region_japan(0),
m_is_smsj(0),
m_is_mark_iii(0),
m_is_sdisp(0),
m_has_bios_0400(0),
@ -97,6 +98,7 @@ public:
// model identifiers
UINT8 m_is_gamegear;
UINT8 m_is_region_japan;
UINT8 m_is_smsj;
UINT8 m_is_mark_iii;
UINT8 m_is_sdisp;
UINT8 m_has_bios_0400;
@ -153,7 +155,9 @@ public:
DECLARE_DRIVER_INIT(sg1000m3);
DECLARE_DRIVER_INIT(gamegear);
DECLARE_DRIVER_INIT(gamegeaj);
DECLARE_DRIVER_INIT(sms2kr);
DECLARE_DRIVER_INIT(sms1krfm);
DECLARE_DRIVER_INIT(sms1kr);
DECLARE_DRIVER_INIT(smskr);
DECLARE_DRIVER_INIT(smsj);
DECLARE_DRIVER_INIT(sms1);
DECLARE_MACHINE_START(sms);

View File

@ -87,7 +87,7 @@ void sms_state::sms_get_inputs( address_space &space )
// Sega Mark III does not have TH line connected.
// Also, the japanese Master System does not set port $dd with TH input.
if (!m_is_region_japan)
if (!m_is_mark_iii && !m_is_smsj)
{
m_port_dd_reg &= ~0x40 | data1; // TH ctrl1
m_port_dd_reg &= ~0x80 | (data2 << 1); // TH ctrl2
@ -276,7 +276,7 @@ READ8_MEMBER(sms_state::sms_input_port_dd_r)
m_port_dd_reg &= ~0x08 | ((m_io_ctrl_reg & 0x40) >> 3);
}
if (m_is_region_japan)
if (m_is_smsj)
{
// For japanese Master System, set upper 4 bits with TH/TR
// direction bits of IO control register, according to Enri's
@ -963,15 +963,31 @@ DRIVER_INIT_MEMBER(sms_state,sms1)
DRIVER_INIT_MEMBER(sms_state,smsj)
{
m_is_region_japan = 1;
m_is_smsj = 1;
m_has_bios_2000 = 1;
m_has_fm = 1;
}
DRIVER_INIT_MEMBER(sms_state,sms2kr)
DRIVER_INIT_MEMBER(sms_state,sms1krfm)
{
m_is_region_japan = 1;
m_has_bios_2000 = 1;
m_has_fm = 1;
}
DRIVER_INIT_MEMBER(sms_state,sms1kr)
{
m_is_region_japan = 1;
m_has_bios_2000 = 1;
}
DRIVER_INIT_MEMBER(sms_state,smskr)
{
m_has_bios_full = 1;
// Despite Korean sms1 version is detected as Japanese region, the sms2 version is not.
}

View File

@ -94,7 +94,9 @@ sms1pal // Sega Master System I (PAL)
smspal // Sega Master System II (PAL)
smsj // Sega Master System (Japan) with FM Chip
sg1000m3 // Sega SG-1000 Mark III (Japan)
sms2kr // Samsung Gam*Boy II (Korea)
sms1krfm // Samsung Gam*Boy I (Korea) with FM Chip
sms1kr // Samsung Gam*Boy I (Korea)
smskr // Samsung Gam*Boy II (Korea)
smssdisp // Sega Master System Store Display Unit
megadrij // 1988 Sega Mega Drive (Japan)