diff --git a/src/mame/includes/amstrad.h b/src/mame/includes/amstrad.h index b46afb75dc8..a8723c09325 100644 --- a/src/mame/includes/amstrad.h +++ b/src/mame/includes/amstrad.h @@ -317,6 +317,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); int m_centronics_busy; + UINT8 m_last_write; }; diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 192702abd08..e253856b2f1 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -1863,8 +1863,8 @@ READ8_MEMBER(amstrad_state::amstrad_cpc_io_r) } } - if ( m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000 ) // Plus systems return 0 when attempting to read the gate array (and any other unreadable space too?) - data = 0; + if ( m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000 ) // Plus systems return 0x78 (464+) or 0x79 (6128+) when attempting to read the gate array (and any other unreadable space too?) + data = 0x79; /* if b14 = 0 : CRTC Read selected */ if ((offset & (1<<14)) == 0) @@ -1913,6 +1913,9 @@ b9 b8 | PPI Function Read/Write status { if (r1r0 < 0x03 ) data = m_ppi->read(space, r1r0); + if ( m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000 ) // Plus systems return the data written to port C (I/O status is ignored) + if(r1r0 == 0x02) + data = m_last_write; } /* if b10 = 0 : Expansion Peripherals Read selected @@ -2104,9 +2107,11 @@ WRITE8_MEMBER(amstrad_state::amstrad_cpc_io_w) */ if ((offset & (1<<11)) == 0) { - unsigned int Index = ((offset & 0x0300) >> 8); + unsigned int idx = ((offset & 0x0300) >> 8); - m_ppi->write(space, Index, data); + m_ppi->write(space, idx, data); + if(idx == 0x02) + m_last_write = data; } /* if b10 = 0 : Expansion Peripherals Write selected */ @@ -2335,6 +2340,8 @@ Once all tables and jumpblocks have been set up, control is passed to the default entry in rom 0*/ void amstrad_state::amstrad_reset_machine() { + m_last_write = 0xff; + /* enable lower rom (OS rom) */ amstrad_GateArray_write(0x089);