qncrash: Start hooking up peripherals

This commit is contained in:
AJR 2023-09-23 11:12:45 -04:00
parent 65e3b60f03
commit 0b2fbdb3e2

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:
// copyright-holders:AJR
/*
@ -18,7 +18,7 @@ Main PCB has both 'Namco TY294-V-0 1331960101' and 'Tamura DNP0674A'
Namco H-5 CPU PCB (8830970101 - 8830960101)
- TMPZ84C015BF-12
- D24OP8I XTAL
- Epson SED1531F0A
- Epson SED1351F0A
- 2x TC55257DFL-70L
*/
@ -49,7 +49,9 @@ private:
required_device<kl5c80a12_device> m_maincpu;
void main_program_map(address_map &map) ATTR_COLD;
void main_io_map(address_map &map) ATTR_COLD;
void dot_program_map(address_map &map) ATTR_COLD;
void dot_io_map(address_map &map) ATTR_COLD;
};
@ -59,9 +61,24 @@ void qncrash_state::main_program_map(address_map &map)
map(0xff800, 0xffdff).ram(); // 0xffe00 - 0xfffff is internal RAM
}
void qncrash_state::main_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x40, 0x40).lw8(NAME([this] (u8 data) { logerror("%s: port40 out %02X\n", machine().describe_context(), data); }));
//map(0x50, 0x50).rw("oki", FUNC(okim9810_device::read), FUNC(okim9810_device::write_command_or_tmp_register));
map(0x58, 0x5b).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
}
void qncrash_state::dot_program_map(address_map &map)
{
map(0x0000, 0x7fff).rom().region("dotcpu", 0x0000);
map(0x8000, 0xffff).ram();
}
void qncrash_state::dot_io_map(address_map &map)
{
map.global_mask(0xff);
//map(0xc0, 0xcf).m("lcdc", FUNC(sed1351_device::register_map));
}
@ -73,6 +90,36 @@ static INPUT_PORTS_START( qncrash ) // no DIPs on PCB
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) // configured as output
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@ -83,21 +130,26 @@ void qncrash_state::qncrash(machine_config &config)
// basic machine hardware
KL5C80A12(config, m_maincpu, 20_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &qncrash_state::main_program_map);
m_maincpu->in_p0_callback().set([this] () { logerror("%s: p0 in", machine().describe_context()); return u8(0); });
m_maincpu->out_p0_callback().set([this] (u8 data) { logerror("%s: p0 out %02X", machine().describe_context(), data); });
m_maincpu->in_p1_callback().set([this] () { logerror("%s: p1 in", machine().describe_context()); return u8(0); });
m_maincpu->out_p1_callback().set([this] (u8 data) { logerror("%s: p1 out %02X", machine().describe_context(), data); });
m_maincpu->in_p2_callback().set([this] () { logerror("%s: p2 in", machine().describe_context()); return u8(0); });
m_maincpu->out_p2_callback().set([this] (u8 data) { logerror("%s: p2 out %02X", machine().describe_context(), data); });
m_maincpu->in_p3_callback().set([this] () { logerror("%s: p3 in", machine().describe_context()); return u8(0); });
m_maincpu->out_p3_callback().set([this] (u8 data) { logerror("%s: p3 out %02X", machine().describe_context(), data); });
m_maincpu->set_addrmap(AS_IO, &qncrash_state::main_io_map);
m_maincpu->in_p0_callback().set_ioport("IN0");
m_maincpu->out_p0_callback().set([this] (u8 data) { logerror("%s: p0 out %02X\n", machine().describe_context(), data); });
m_maincpu->out_p1_callback().set("eeprom", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(0);
m_maincpu->out_p1_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(1);
m_maincpu->out_p1_callback().append("eeprom", FUNC(eeprom_serial_93cxx_device::di_write)).bit(2);
m_maincpu->out_p2_callback().set([this] (u8 data) { logerror("%s: p2 out %02X\n", machine().describe_context(), data); });
m_maincpu->out_p3_callback().set([this] (u8 data) { logerror("%s: p3 out %02X\n", machine().describe_context(), data); });
m_maincpu->out_p4_callback().set([this] (u8 data) { logerror("%s: p4 out %02X\n", machine().describe_context(), data); });
tmpz84c015_device &dotcpu(TMPZ84C015(config, "dotcpu", 24'000'000 / 2)); // unknown D24OP8I XTAL, but TMPZ84C015BF-12 is rated for max 12 MHz, so guessed
dotcpu.set_addrmap(AS_PROGRAM, &qncrash_state::dot_program_map);
dotcpu.set_addrmap(AS_IO, &qncrash_state::dot_io_map);
I8255(config, "ppi"); // NEC D71055C
i8255_device &ppi(I8255(config, "ppi")); // NEC D71055C
ppi.in_pa_callback().set_ioport("IN1");
ppi.in_pb_callback().set_ioport("IN2");
ppi.in_pc_callback().set_ioport("IN3");
EEPROM_93C66_8BIT(config, "eeprom");
EEPROM_93C66_16BIT(config, "eeprom");
// video hardware
// TODO: 2 LED screens (one for shots left / level infos, one for time left)