(MESS) Added force_resynch on master/slave communication buffer, fixes at least Ichidant-R booting

This commit is contained in:
Angelo Salese 2013-01-23 15:38:14 +00:00
parent 5f3f87965b
commit 5ced0b56db
2 changed files with 37 additions and 2 deletions

View File

@ -1175,6 +1175,11 @@ static INPUT_PORTS_START( saturn )
PORT_CONFSETTING(0x70,"Megadrive 6B Pad")
PORT_CONFSETTING(0x80,"Saturn Mouse")
PORT_CONFSETTING(0x90,"<unconnected>")
PORT_START("fake")
PORT_CONFNAME(0x01,0x01,"Master-Slave Comms Hack")
PORT_CONFSETTING(0x00,"No")
PORT_CONFSETTING(0x01,"Yes")
INPUT_PORTS_END
#define STV_PLAYER_INPUTS(_n_, _b1_, _b2_, _b3_,_b4_) \
@ -2348,6 +2353,24 @@ static MACHINE_CONFIG_DERIVED( stv_slot, stv )
MACHINE_CONFIG_END
/* we use a clever hack here. Basically 0x60ffc13 is used for master slave comms, synching there should avoid crashes in several spots. */
READ32_MEMBER(saturn_state::workram_h_comms_r)
{
if(m_fake_comms->read() & 1)
machine().scheduler().synchronize(); // force resync
return m_workram_h[0x0ffc10/4];
}
WRITE32_MEMBER(saturn_state::workram_h_comms_w)
{
if(m_fake_comms->read() & 1)
machine().scheduler().synchronize(); // force resync
COMBINE_DATA(&m_workram_h[0x0ffc10/4]);
}
void saturn_state::saturn_init_driver(int rgn)
{
m_saturn_region = rgn;
@ -2357,6 +2380,11 @@ void saturn_state::saturn_init_driver(int rgn)
sh2drc_set_options(machine().device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
sh2drc_set_options(machine().device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x060ffc10, 0x060ffc13, read32_delegate(FUNC(saturn_state::workram_h_comms_r),this));
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x060ffc10, 0x060ffc13, write32_delegate(FUNC(saturn_state::workram_h_comms_w),this));
machine().device("slave")->memory().space(AS_PROGRAM).install_read_handler(0x060ffc10, 0x060ffc13, read32_delegate(FUNC(saturn_state::workram_h_comms_r),this));
machine().device("slave")->memory().space(AS_PROGRAM).install_write_handler(0x060ffc10, 0x060ffc13, write32_delegate(FUNC(saturn_state::workram_h_comms_w),this));
/* amount of time to boost interleave for on MINIT / SINIT, needed for communication to work */
m_minit_boost = 400;
m_sinit_boost = 400;

View File

@ -7,14 +7,18 @@ public:
: driver_device(mconfig, type, tag),
m_workram_l(*this, "workram_l"),
m_workram_h(*this, "workram_h"),
m_sound_ram(*this, "sound_ram") { }
m_sound_ram(*this, "sound_ram"),
m_fake_comms(*this, "fake")
{ }
required_shared_ptr<UINT32> m_workram_l;
required_shared_ptr<UINT32> m_workram_h;
required_shared_ptr<UINT16> m_sound_ram;
optional_ioport m_fake_comms;
UINT8 *m_backupram;
UINT8 *m_cart_backupram;
UINT32 *m_scu_regs;
required_shared_ptr<UINT16> m_sound_ram;
UINT16 *m_scsp_regs;
UINT16 *m_vdp2_regs;
UINT32 *m_vdp2_vram;
@ -25,6 +29,7 @@ public:
UINT8 m_NMI_reset;
UINT8 m_en_68k;
struct {
UINT32 src[3]; /* Source DMA lv n address*/
UINT32 dst[3]; /* Destination DMA lv n address*/
@ -228,6 +233,8 @@ public:
DECLARE_WRITE32_MEMBER(saturn_cart_dram1_w);
DECLARE_READ32_MEMBER(saturn_cs1_r);
DECLARE_WRITE32_MEMBER(saturn_cs1_w);
DECLARE_READ32_MEMBER(workram_h_comms_r);
DECLARE_WRITE32_MEMBER(workram_h_comms_w);
WRITE_LINE_MEMBER(scsp_to_main_irq);
void saturn_init_driver(int rgn);