Connect ROM 6351-1J to the PPS-4 port A/B lines.

This commit is contained in:
jbu 2014-12-05 01:49:11 +01:00
parent 6258f598c6
commit a0b9994942

View File

@ -70,6 +70,14 @@ ToDo:
#include "cpu/pps4/pps4.h"
//#include "gts1.lh"
#define VERBOSE 1
#if VERBOSE
#define LOG(x) logerror x
#else
#define LOG(x)
#endif
class gts1_state : public genpin_class
{
public:
@ -79,12 +87,15 @@ public:
{ }
DECLARE_DRIVER_INIT(gts1);
DECLARE_READ8_MEMBER (gts1_pa_r);
DECLARE_WRITE8_MEMBER(gts1_pa_w);
DECLARE_WRITE8_MEMBER(gts1_pb_w);
private:
virtual void machine_reset();
required_device<cpu_device> m_maincpu;
UINT8 m_6351_addr;
};
static ADDRESS_MAP_START( gts1_map, AS_PROGRAM, 8, gts1_state )
AM_RANGE(0x0000, 0x0fff) AM_ROM
ADDRESS_MAP_END
@ -95,6 +106,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( gts1_io, AS_IO, 8, gts1_state )
AM_RANGE(0x0000, 0x00ff) AM_RAM // connects to all the other chips
AM_RANGE(0x0100, 0x0100) AM_READ (gts1_pa_r) AM_WRITE(gts1_pa_w)
AM_RANGE(0x0101, 0x0101) AM_WRITE(gts1_pb_w)
ADDRESS_MAP_END
static INPUT_PORTS_START( gts1 )
@ -179,12 +192,37 @@ INPUT_PORTS_END
void gts1_state::machine_reset()
{
m_6351_addr = 0;
}
DRIVER_INIT_MEMBER(gts1_state,gts1)
{
}
READ8_MEMBER (gts1_state::gts1_pa_r)
{
// return ROM nibble
UINT8 *ROM = memregion("maincpu")->base();
UINT8 data = ROM[0x2000 + m_6351_addr] & 0x0f;
LOG(("%s: ROM[%03x]:%02x\n", __FUNCTION__, m_6351_addr, data));
return data;
}
WRITE8_MEMBER(gts1_state::gts1_pa_w)
{
// write address lines 7-4
m_6351_addr = (m_6351_addr & 0x0f) | ((data & 0x0f) << 4);
LOG(("%s: ROM hi:%x addr:%02x\n", __FUNCTION__, data & 0x0f, m_6351_addr));
}
WRITE8_MEMBER(gts1_state::gts1_pb_w)
{
// write address lines 3-0
m_6351_addr = (m_6351_addr & 0xf0) | (data & 0x0f);
LOG(("%s: ROM lo:%x addr:%02x\n", __FUNCTION__, data & 0x0f, m_6351_addr));
}
static MACHINE_CONFIG_START( gts1, gts1_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", PPS4, XTAL_3_579545MHz / 18) // divided in the CPU