sms.cpp: more accurate FM Sound Unit behavior [Enik Land]

This commit is contained in:
MetalliC 2016-09-09 12:41:12 +03:00
parent 3291684c2b
commit 211e5f544d
3 changed files with 28 additions and 7 deletions

View File

@ -9,6 +9,15 @@ Release data from the Sega Retro project:
Year: 1987 Country/region: JP Model code: FM-70
Notes:
This emulation is based on Charles MacDonald's analysis of Enri's schematics
of the FM unit hardware.
Any software that access controllers through IO ports $C0/$C1 instead $DC/$DD
(the game Fushigi no Oshiro Pit Pot is a known example) has control problems
when the FM Sound Unit is attached (real hardware behavior).
**********************************************************************/
#include "fm_unit.h"
@ -69,7 +78,7 @@ void sega_fm_unit_device::device_start()
READ8_MEMBER(sega_fm_unit_device::peripheral_r)
{
if (offset == 2)
if (offset <= 3)
{
return m_audio_control & 0x01;
}
@ -98,6 +107,7 @@ WRITE8_MEMBER(sega_fm_unit_device::peripheral_w)
}
break;
case 2: // control port
case 3: // mirror
m_audio_control = data & 0x01;
break;
default:
@ -108,11 +118,11 @@ WRITE8_MEMBER(sega_fm_unit_device::peripheral_w)
bool sega_fm_unit_device::is_readable(UINT8 offset)
{
return (offset == 2) ? true : false;
return (offset <= 3) ? true : false;
}
bool sega_fm_unit_device::is_writeable(UINT8 offset)
{
return (offset <= 2) ? true : false;
return (offset <= 3) ? true : false;
}

View File

@ -870,8 +870,15 @@ static MACHINE_CONFIG_DERIVED( sms1_kr, sms1_ntsc )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(smskr_io)
// need to replace the cartridge slot with the Japanese version, so to
// keep the usual media order, remove and reinsert all of them.
MCFG_DEVICE_REMOVE("slot")
MCFG_DEVICE_REMOVE("mycard")
MCFG_DEVICE_REMOVE("smsexp")
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, nullptr)
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
MCFG_SMS_EXPANSION_ADD("smsexp", sms_expansion_devices, nullptr)
MCFG_SOFTWARE_LIST_ADD("cart_list2","sg1000")
MCFG_DEVICE_MODIFY("sms_vdp")
@ -890,13 +897,17 @@ static MACHINE_CONFIG_DERIVED( sg1000m3, sms1_ntsc )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(sg1000m3_io)
// Remove and reinsert all media slots, as done with the sms1_kr config,
// and also replace the expansion slot with the SG-1000 version.
MCFG_DEVICE_REMOVE("slot")
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, nullptr)
MCFG_SOFTWARE_LIST_ADD("cart_list2","sg1000")
MCFG_DEVICE_REMOVE("mycard")
MCFG_DEVICE_REMOVE("smsexp")
MCFG_SG1000MK3_CARTRIDGE_ADD("slot", sg1000mk3_cart, nullptr)
MCFG_SMS_CARD_ADD("mycard", sms_cart, nullptr)
MCFG_SG1000_EXPANSION_ADD("sgexp", sg1000_expansion_devices, nullptr, false)
MCFG_SOFTWARE_LIST_ADD("cart_list2","sg1000")
// Mark III does not have TH connected.
MCFG_SMS_CONTROL_PORT_MODIFY(CONTROL1_TAG)
MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(NOOP)

View File

@ -287,7 +287,7 @@ WRITE_LINE_MEMBER(sms_state::sms_csync_callback)
{
// Timings for Rapid Fire and LED verified by Charles MacDonald.
// Read state is changed at each 256 C-Sync pulses
// Read state is probably changed at each 256 C-Sync pulses
if ((m_csync_counter & 0xff) == 0)
{
m_rapid_read_state ^= 0xff;