summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorGravatarGravatar smf- <smf-@users.noreply.github.com>2014-01-10 20:12:15 +0000
committerGravatarGravatar smf- <smf-@users.noreply.github.com>2014-01-10 20:12:15 +0000
commitfc59ec00a093224ffd1f56a8accae2abaf1f6cbf (patch)
tree986f5eaf5e94600e82f163295da11f071beca773 /src
parent9176cfff3ce62370925dee8713ddb1f8e1da7d3d (diff)
fixed pc1403 & pc1403h crashing and standardised devcb2 callbacks (nw)
Diffstat (limited to 'src')
-rw-r--r--src/emu/cpu/sc61860/sc61860.c10
-rw-r--r--src/emu/cpu/sc61860/sc61860.h31
-rw-r--r--src/mess/drivers/pocketc.c56
3 files changed, 59 insertions, 38 deletions
diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c
index e983beebbb7..1abc5975efd 100644
--- a/src/emu/cpu/sc61860/sc61860.c
+++ b/src/emu/cpu/sc61860/sc61860.c
@@ -119,11 +119,11 @@ void sc61860_device::device_start()
m_reset.resolve();
m_brk.resolve();
m_x.resolve();
- m_ina.resolve();
- m_outa.resolve();
- m_inb.resolve();
- m_outb.resolve();
- m_outc.resolve();
+ m_ina.resolve_safe(0);
+ m_outa.resolve_safe();
+ m_inb.resolve_safe(0);
+ m_outb.resolve_safe();
+ m_outc.resolve_safe();
m_p = 0;
m_q = 0;
diff --git a/src/emu/cpu/sc61860/sc61860.h b/src/emu/cpu/sc61860/sc61860.h
index 86e62ccd8fc..c29e7079126 100644
--- a/src/emu/cpu/sc61860/sc61860.h
+++ b/src/emu/cpu/sc61860/sc61860.h
@@ -54,16 +54,29 @@ enum
};
-#define MCFG_SC61860_CONFIG(_reset, _brk, _x, _ina, _outa, _inb, _outb, _outc) \
- sc61860_device::set_reset_cb(*device, DEVCB2_##_reset); \
- sc61860_device::set_brk_cb(*device, DEVCB2_##_brk); \
- sc61860_device::set_x_cb(*device, DEVCB2_##_x); \
- sc61860_device::set_ina_cb(*device, DEVCB2_##_ina); \
- sc61860_device::set_outa_cb(*device, DEVCB2_##_outa); \
- sc61860_device::set_inb_cb(*device, DEVCB2_##_inb); \
- sc61860_device::set_outb_cb(*device, DEVCB2_##_outb); \
- sc61860_device::set_outc_cb(*device, DEVCB2_##_outc);
+#define MCFG_SC61860_READ_RESET_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_reset_cb(*device, DEVCB2_##_devcb);
+#define MCFG_SC61860_READ_BRK_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_brk_cb(*device, DEVCB2_##_devcb);
+
+#define MCFG_SC61860_READ_X_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_x_cb(*device, DEVCB2_##_devcb);
+
+#define MCFG_SC61860_READ_A_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_ina_cb(*device, DEVCB2_##_devcb);
+
+#define MCFG_SC61860_WRITE_A_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_outa_cb(*device, DEVCB2_##_devcb);
+
+#define MCFG_SC61860_READ_B_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_inb_cb(*device, DEVCB2_##_devcb);
+
+#define MCFG_SC61860_WRITE_B_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_outb_cb(*device, DEVCB2_##_devcb);
+
+#define MCFG_SC61860_WRITE_C_HANDLER(_devcb) \
+ devcb = &sc61860_device::set_outc_cb(*device, DEVCB2_##_devcb);
class sc61860_device : public cpu_device
{
diff --git a/src/mess/drivers/pocketc.c b/src/mess/drivers/pocketc.c
index db216671a8c..c77859eb8eb 100644
--- a/src/mess/drivers/pocketc.c
+++ b/src/mess/drivers/pocketc.c
@@ -738,12 +738,14 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1401, pc1401_state )
MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */
MCFG_CPU_PROGRAM_MAP(pc1401_mem)
- MCFG_SC61860_CONFIG(
- READLINE(pc1401_state,pc1401_reset), READLINE(pc1401_state,pc1401_brk), NULL,
- READ8(pc1401_state,pc1401_ina), WRITE8(pc1401_state,pc1401_outa),
- READ8(pc1401_state,pc1401_inb), WRITE8(pc1401_state,pc1401_outb),
- WRITE8(pc1401_state,pc1401_outc)
- )
+ MCFG_SC61860_READ_RESET_HANDLER(READLINE(pc1401_state,pc1401_reset))
+ MCFG_SC61860_READ_BRK_HANDLER(READLINE(pc1401_state,pc1401_brk))
+ MCFG_SC61860_READ_X_HANDLER(NULL)
+ MCFG_SC61860_READ_A_HANDLER(READ8(pc1401_state,pc1401_ina))
+ MCFG_SC61860_WRITE_A_HANDLER(WRITE8(pc1401_state,pc1401_outa))
+ MCFG_SC61860_READ_B_HANDLER(READ8(pc1401_state,pc1401_inb))
+ MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1401_state,pc1401_outb))
+ MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1401_state,pc1401_outc))
MCFG_FRAGMENT_ADD(pocketc)
@@ -759,12 +761,14 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1250, pc1251_state )
MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */
MCFG_CPU_PROGRAM_MAP( pc1250_mem)
- MCFG_SC61860_CONFIG(
- NULL, READLINE(pc1251_state,pc1251_brk), NULL,
- READ8(pc1251_state,pc1251_ina), WRITE8(pc1251_state,pc1251_outa),
- READ8(pc1251_state,pc1251_inb), WRITE8(pc1251_state,pc1251_outb),
- WRITE8(pc1251_state,pc1251_outc)
- )
+ MCFG_SC61860_READ_RESET_HANDLER(NULL)
+ MCFG_SC61860_READ_BRK_HANDLER(READLINE(pc1251_state,pc1251_brk))
+ MCFG_SC61860_READ_X_HANDLER(NULL)
+ MCFG_SC61860_READ_A_HANDLER(READ8(pc1251_state,pc1251_ina))
+ MCFG_SC61860_WRITE_A_HANDLER(WRITE8(pc1251_state,pc1251_outa))
+ MCFG_SC61860_READ_B_HANDLER(READ8(pc1251_state,pc1251_inb))
+ MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1251_state,pc1251_outb))
+ MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1251_state,pc1251_outc))
MCFG_FRAGMENT_ADD(pocketc)
@@ -801,12 +805,14 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1350, pc1350_state )
MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */
MCFG_CPU_PROGRAM_MAP( pc1350_mem)
- MCFG_SC61860_CONFIG(
- NULL, READLINE(pc1350_state,pc1350_brk), NULL,
- READ8(pc1350_state,pc1350_ina), WRITE8(pc1350_state,pc1350_outa),
- READ8(pc1350_state,pc1350_inb), WRITE8(pc1350_state,pc1350_outb),
- WRITE8(pc1350_state,pc1350_outc)
- )
+ MCFG_SC61860_READ_RESET_HANDLER(NULL)
+ MCFG_SC61860_READ_BRK_HANDLER(READLINE(pc1350_state,pc1350_brk))
+ MCFG_SC61860_READ_X_HANDLER(NULL)
+ MCFG_SC61860_READ_A_HANDLER(READ8(pc1350_state,pc1350_ina))
+ MCFG_SC61860_WRITE_A_HANDLER(WRITE8(pc1350_state,pc1350_outa))
+ MCFG_SC61860_READ_B_HANDLER(READ8(pc1350_state,pc1350_inb))
+ MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1350_state,pc1350_outb))
+ MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1350_state,pc1350_outc))
MCFG_FRAGMENT_ADD( pocketc )
@@ -829,12 +835,14 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1403, pc1403_state )
MCFG_CPU_ADD( "maincpu", SC61860, 256000 )
MCFG_CPU_PROGRAM_MAP( pc1403_mem)
- MCFG_SC61860_CONFIG(
- NULL, READLINE(pc1403_state,pc1403_brk), NULL,
- READ8(pc1403_state,pc1403_ina), WRITE8(pc1403_state,pc1403_outa),
- NULL, NULL,
- WRITE8(pc1403_state,pc1403_outc)
- )
+ MCFG_SC61860_READ_RESET_HANDLER(NULL)
+ MCFG_SC61860_READ_BRK_HANDLER(READLINE(pc1403_state,pc1403_brk))
+ MCFG_SC61860_READ_X_HANDLER(NULL)
+ MCFG_SC61860_READ_A_HANDLER(READ8(pc1403_state,pc1403_ina))
+ MCFG_SC61860_WRITE_A_HANDLER(WRITE8(pc1403_state,pc1403_outa))
+ MCFG_SC61860_READ_B_HANDLER(NULL)
+ MCFG_SC61860_WRITE_B_HANDLER(NULL)
+ MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1403_state,pc1403_outc))
MCFG_FRAGMENT_ADD( pocketc )