summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2016-12-02 00:26:59 +0100
committer Dirk Best <mail@dirk-best.de>2016-12-02 00:27:50 +0100
commit39b3caf77b697296c275c2e80c020dc792565a0e (patch)
treeb392682ae602946dd57ec76e839d746ea5e7aaca
parent47d25ad9748e5f36412b8fd1db40f319aea3464a (diff)
guab: more cleanups, hook up ppi and acia
-rw-r--r--src/mame/drivers/guab.cpp357
1 files changed, 190 insertions, 167 deletions
diff --git a/src/mame/drivers/guab.cpp b/src/mame/drivers/guab.cpp
index 70712546fea..7fb1f1333f7 100644
--- a/src/mame/drivers/guab.cpp
+++ b/src/mame/drivers/guab.cpp
@@ -1,5 +1,5 @@
-// license:BSD-3-Clause
-// copyright-holders:Philip Bennett, Dirk Best
+// license: BSD-3-Clause
+// copyright-holders: Philip Bennett, Dirk Best
/***************************************************************************
JPM Give us a Break hardware
@@ -24,16 +24,22 @@
directly into RAM for now.
* Verify WD FDC type
* Are IRQs 1 or 2 connected to something?
- * Hook up ACIA (IRQ 4)
+ * Hook up ACIA properly (IRQ 4)
* Hook up watchdog NMI
* Verify clocks
* Use real video timings
+ * Create layouts
+
+ Notes:
+ * Video hardware seems to match JPM System 5
***************************************************************************/
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "machine/6840ptm.h"
+#include "machine/i8255.h"
+#include "machine/6850acia.h"
#include "video/tms34061.h"
#include "video/ef9369.h"
#include "sound/sn76496.h"
@@ -43,6 +49,10 @@
#include "guab.lh"
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
class guab_state : public driver_device
{
public:
@@ -88,11 +98,108 @@ private:
};
-/*************************************
- *
- * Video hardware
- *
- *************************************/
+//**************************************************************************
+// ADDRESS MAPS
+//**************************************************************************
+
+static ADDRESS_MAP_START( guab_map, AS_PROGRAM, 16, guab_state )
+ AM_RANGE(0x000000, 0x00ffff) AM_ROM
+ AM_RANGE(0x040000, 0x04ffff) AM_ROM AM_REGION("maincpu", 0x10000)
+ AM_RANGE(0x0c0000, 0x0c0007) AM_DEVREADWRITE8("i8255_1", i8255_device, read, write, 0x00ff)
+ AM_RANGE(0x0c0020, 0x0c0027) AM_DEVREADWRITE8("i8255_2", i8255_device, read, write, 0x00ff)
+ AM_RANGE(0x0c0040, 0x0c0047) AM_DEVREADWRITE8("i8255_3", i8255_device, read, write, 0x00ff)
+ AM_RANGE(0x0c0060, 0x0c0061) AM_READ8(sn76489_ready_r, 0x00ff) AM_DEVWRITE8("snsnd", sn76489_device, write, 0x00ff)
+ AM_RANGE(0x0c0062, 0x0c0063) AM_WRITE8(floppy_ctrl_w, 0x00ff)
+ AM_RANGE(0x0c0064, 0x0c0065) AM_WRITE8(watchdog_w, 0x00ff)
+ AM_RANGE(0x0c0066, 0x0c0067) AM_WRITE8(unknown_w, 0x00ff)
+ AM_RANGE(0x0c0080, 0x0c0081) AM_DEVREADWRITE8("acia6850_1", acia6850_device, status_r, control_w, 0x00ff)
+ AM_RANGE(0x0c0082, 0x0c0083) AM_DEVREADWRITE8("acia6850_1", acia6850_device, data_r, data_w, 0x00ff)
+ AM_RANGE(0x0c00a0, 0x0c00a1) AM_DEVREADWRITE8("acia6850_2", acia6850_device, status_r, control_w, 0x00ff)
+ AM_RANGE(0x0c00a2, 0x0c00a3) AM_DEVREADWRITE8("acia6850_2", acia6850_device, data_r, data_w, 0x00ff)
+ AM_RANGE(0x0c00c0, 0x0c00cf) AM_DEVREADWRITE8("6840ptm", ptm6840_device, read, write, 0x00ff)
+ AM_RANGE(0x0c00e0, 0x0c00e7) AM_DEVREADWRITE8("fdc", wd1773_t, read, write, 0x00ff)
+ AM_RANGE(0x080000, 0x080fff) AM_RAM
+ AM_RANGE(0x100000, 0x100001) AM_DEVREADWRITE8("ef9369", ef9369_device, data_r, data_w, 0x00ff)
+ AM_RANGE(0x100002, 0x100003) AM_DEVWRITE8("ef9369", ef9369_device, address_w, 0x00ff)
+ AM_RANGE(0x800000, 0xb0ffff) AM_READWRITE(tms34061_r, tms34061_w)
+ AM_RANGE(0xb10000, 0xb1ffff) AM_RAM
+ AM_RANGE(0xb80000, 0xb8ffff) AM_RAM
+ AM_RANGE(0xb90000, 0xb9ffff) AM_RAM
+ADDRESS_MAP_END
+
+
+//**************************************************************************
+// INPUTS
+//**************************************************************************
+
+static INPUT_PORTS_START( guab )
+ PORT_START("IN0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)50)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)100)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("50p level")
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("100p level")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
+
+ PORT_START("IN1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B")
+
+ PORT_START("IN2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Select")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("D")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)10)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)20)
+INPUT_PORTS_END
+
+static INPUT_PORTS_START( tenup )
+ PORT_START("IN0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)50)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)100)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("10p level")
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("100p level")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
+
+ PORT_START("IN1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Pass")
+
+ PORT_START("IN2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Collect")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)10)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)20)
+INPUT_PORTS_END
+
+
+//**************************************************************************
+// VIDEO EMULATION
+//**************************************************************************
EF9369_COLOR_UPDATE( guab_state::ef9369_color_update )
{
@@ -140,8 +247,6 @@ READ16_MEMBER( guab_state::tms34061_r )
uint32_t guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int x, y;
-
m_tms34061->get_display_state();
/* If blanked, fill with black */
@@ -151,12 +256,12 @@ uint32_t guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bit
return 0;
}
- for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
+ for (int y = cliprect.min_y; y <= cliprect.max_y; ++y)
{
uint8_t *src = &m_tms34061->m_display.vram[256 * y];
uint16_t *dest = &bitmap.pix16(y);
- for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
+ for (int x = cliprect.min_x; x <= cliprect.max_x; x += 2)
{
uint8_t pen = src[x >> 1];
@@ -170,13 +275,36 @@ uint32_t guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bit
}
-/*************************************
- *
- * I/O
- *
- *************************************/
+//**************************************************************************
+// MACHINE EMULATION
+//**************************************************************************
+
+void guab_state::machine_start()
+{
+ m_fdc->set_floppy(m_floppy->get_device());
+}
+
+WRITE8_MEMBER( guab_state::watchdog_w )
+{
+ // nibbles only
+ // reads from the port, then writes the sequence
+ // b 3 1 5 d a 2 0 4 0 8 b 3 1 5 d a 2 0 4 0 8
+ // after that it just continues writing f to it
+}
+
+WRITE8_MEMBER( guab_state::unknown_w )
+{
+ // unknown
+ // at startup, 0x88 or 0x98 is written here
+ // while the game is running only 0x88
+}
+
+
+//**************************************************************************
+// INPUTS/OUTPUTS
+//**************************************************************************
-INPUT_CHANGED_MEMBER(guab_state::coin_inserted)
+INPUT_CHANGED_MEMBER( guab_state::coin_inserted )
{
if (newval == 0)
{
@@ -261,12 +389,22 @@ WRITE8_MEMBER( guab_state::output6_w )
output().set_value("led_47", BIT(data, 7));
}
+
+//**************************************************************************
+// AUDIO
+//**************************************************************************
+
READ8_MEMBER( guab_state::sn76489_ready_r )
{
// bit 7 connected to sn76489 ready output (0 = ready)
return ~(m_sn->ready_r() << 7);
}
+
+//**************************************************************************
+// FLOPPY DRIVE
+//**************************************************************************
+
WRITE8_MEMBER( guab_state::floppy_ctrl_w )
{
m_floppy->get_device()->ss_w(BIT(data, 3));
@@ -275,141 +413,6 @@ WRITE8_MEMBER( guab_state::floppy_ctrl_w )
m_floppy->get_device()->mon_w(0);
}
-WRITE8_MEMBER( guab_state::watchdog_w )
-{
- // nibbles only
- // reads from the port, then writes the sequence
- // b 3 1 5 d a 2 0 4 0 8 b 3 1 5 d a 2 0 4 0 8
- // this continues 10 times, after that it just
- // continues writing f to it
-}
-
-WRITE8_MEMBER( guab_state::unknown_w )
-{
- // unknown
- // at startup, 0x88 or 0x98 is written here
- // while the game is running only 0x88
-}
-
-
-/*************************************
- *
- * 68000 CPU memory handlers
- *
- *************************************/
-
-static ADDRESS_MAP_START( guab_map, AS_PROGRAM, 16, guab_state )
- AM_RANGE(0x000000, 0x00ffff) AM_ROM
- AM_RANGE(0x040000, 0x04ffff) AM_ROM AM_REGION("maincpu", 0x10000)
- AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("IN0")
- AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("IN1")
- AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("IN2")
- AM_RANGE(0x0c0020, 0x0c0021) AM_WRITE8(output1_w, 0x00ff)
- AM_RANGE(0x0c0022, 0x0c0023) AM_WRITE8(output2_w, 0x00ff)
- AM_RANGE(0x0c0024, 0x0c0025) AM_WRITE8(output3_w, 0x00ff)
- AM_RANGE(0x0c0040, 0x0c0041) AM_WRITE8(output4_w, 0x00ff)
- AM_RANGE(0x0c0042, 0x0c0043) AM_WRITE8(output5_w, 0x00ff)
- AM_RANGE(0x0c0044, 0x0c0045) AM_WRITE8(output6_w, 0x00ff)
- AM_RANGE(0x0c0060, 0x0c0061) AM_READ8(sn76489_ready_r, 0x00ff) AM_DEVWRITE8("snsnd", sn76489_device, write, 0x00ff)
- AM_RANGE(0x0c0062, 0x0c0063) AM_WRITE8(floppy_ctrl_w, 0x00ff)
- AM_RANGE(0x0c0064, 0x0c0065) AM_WRITE8(watchdog_w, 0x00ff)
- AM_RANGE(0x0c0066, 0x0c0067) AM_WRITE8(unknown_w, 0x00ff)
-// AM_RANGE(0x0c0080, 0x0c0083) AM_NOP /* ACIA 1 */
-// AM_RANGE(0x0c00a0, 0x0c00a3) AM_NOP /* ACIA 2 */
- AM_RANGE(0x0c00c0, 0x0c00cf) AM_DEVREADWRITE8("6840ptm", ptm6840_device, read, write, 0x00ff)
- AM_RANGE(0x0c00e0, 0x0c00e7) AM_DEVREADWRITE8("fdc", wd1773_t, read, write, 0x00ff)
- AM_RANGE(0x080000, 0x080fff) AM_RAM
- AM_RANGE(0x100000, 0x100001) AM_DEVREADWRITE8("ef9369", ef9369_device, data_r, data_w, 0x00ff)
- AM_RANGE(0x100002, 0x100003) AM_DEVWRITE8("ef9369", ef9369_device, address_w, 0x00ff)
- AM_RANGE(0x800000, 0xb0ffff) AM_READWRITE(tms34061_r, tms34061_w)
- AM_RANGE(0xb10000, 0xb1ffff) AM_RAM
- AM_RANGE(0xb80000, 0xb8ffff) AM_RAM
- AM_RANGE(0xb90000, 0xb9ffff) AM_RAM
-ADDRESS_MAP_END
-
-
-/*************************************
- *
- * Port definitions
- *
- *************************************/
-
-static INPUT_PORTS_START( guab )
- PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)50)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)100)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
- PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("50p level")
- PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("100p level")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
-
- PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A")
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B")
-
- PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Select")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C")
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("D")
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)10)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)20)
-INPUT_PORTS_END
-
-static INPUT_PORTS_START( tenup )
- PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)50)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)100)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key switch") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
- PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("10p level")
- PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED ) PORT_NAME("100p level")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
-
- PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Pass")
-
- PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Collect")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("B")
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("C")
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)10)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p") PORT_CHANGED_MEMBER(DEVICE_SELF, guab_state,coin_inserted, (void *)20)
-INPUT_PORTS_END
-
-
-/*************************************
- *
- * Machine driver
- *
- *************************************/
-
-void guab_state::machine_start()
-{
- m_fdc->set_floppy(m_floppy->get_device());
-}
-
FLOPPY_FORMATS_MEMBER( guab_state::floppy_formats )
FLOPPY_GUAB_FORMAT
FLOPPY_FORMATS_END
@@ -418,6 +421,11 @@ static SLOT_INTERFACE_START( guab_floppies )
SLOT_INTERFACE("dd", FLOPPY_35_DD)
SLOT_INTERFACE_END
+
+//**************************************************************************
+// MACHINE DEFINTIONS
+//**************************************************************************
+
static MACHINE_CONFIG_START( guab, guab_state )
/* TODO: Verify clock */
MCFG_CPU_ADD("maincpu", M68000, 8000000)
@@ -448,12 +456,30 @@ static MACHINE_CONFIG_START( guab, guab_state )
MCFG_SOUND_ADD("snsnd", SN76489, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- /* 6840 PTM */
MCFG_DEVICE_ADD("6840ptm", PTM6840, 0)
MCFG_PTM6840_INTERNAL_CLOCK(1000000)
MCFG_PTM6840_EXTERNAL_CLOCKS(0, 0, 0)
MCFG_PTM6840_IRQ_CB(INPUTLINE("maincpu", 3))
+ MCFG_DEVICE_ADD("i8255_1", I8255, 0)
+ MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
+ MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
+ MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+
+ MCFG_DEVICE_ADD("i8255_2", I8255, 0)
+ MCFG_I8255_OUT_PORTA_CB(WRITE8(guab_state, output1_w))
+ MCFG_I8255_OUT_PORTB_CB(WRITE8(guab_state, output2_w))
+ MCFG_I8255_OUT_PORTC_CB(WRITE8(guab_state, output3_w))
+
+ MCFG_DEVICE_ADD("i8255_3", I8255, 0)
+ MCFG_I8255_OUT_PORTA_CB(WRITE8(guab_state, output4_w))
+ MCFG_I8255_OUT_PORTB_CB(WRITE8(guab_state, output5_w))
+ MCFG_I8255_OUT_PORTC_CB(WRITE8(guab_state, output6_w))
+
+ MCFG_DEVICE_ADD("acia6850_1", ACIA6850, 0)
+
+ MCFG_DEVICE_ADD("acia6850_2", ACIA6850, 0)
+
// floppy
MCFG_WD1773_ADD("fdc", 8000000)
MCFG_WD_FDC_DRQ_CALLBACK(INPUTLINE("maincpu", 6))
@@ -467,11 +493,9 @@ static MACHINE_CONFIG_START( guab, guab_state )
MACHINE_CONFIG_END
-/*************************************
- *
- * ROM definition(s)
- *
- *************************************/
+//**************************************************************************
+// ROM DEFINITIONS
+//**************************************************************************
ROM_START( guab )
ROM_REGION( 0x20000, "maincpu", 0 )
@@ -496,12 +520,11 @@ ROM_START( tenup )
ROM_END
-/*************************************
- *
- * Game driver(s)
- *
- *************************************/
+//**************************************************************************
+// SYSTEM DRIVERS
+//**************************************************************************
-GAME( 1986, guab, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break", 0 )
-GAME( 1986, crisscrs, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Criss Cross (Sweden)", MACHINE_NOT_WORKING )
-GAME( 1988, tenup, 0, guab, tenup, driver_device, 0, ROT0, "JPM", "Ten Up", 0 )
+// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROTATION COMPANY FULLNAME FLAGS
+GAME( 1986, guab, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break", 0 )
+GAME( 1986, crisscrs, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Criss Cross (Sweden)", MACHINE_NOT_WORKING )
+GAME( 1988, tenup, 0, guab, tenup, driver_device, 0, ROT0, "JPM", "Ten Up", 0 )