summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/champbas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/champbas.cpp')
-rw-r--r--src/mame/drivers/champbas.cpp79
1 files changed, 53 insertions, 26 deletions
diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp
index c30c85745c4..112356e9e6c 100644
--- a/src/mame/drivers/champbas.cpp
+++ b/src/mame/drivers/champbas.cpp
@@ -81,6 +81,7 @@ TODO:
#include "emu.h"
#include "includes/champbas.h"
#include "cpu/z80/z80.h"
+#include "machine/74259.h"
#include "machine/gen_latch.h"
#include "machine/watchdog.h"
#include "sound/ay8910.h"
@@ -102,9 +103,9 @@ CUSTOM_INPUT_MEMBER(champbas_state::watchdog_bit2)
return (0x10 - m_watchdog->get_vblank_counter()) >> 2 & 1;
}
-WRITE8_MEMBER(champbas_state::irq_enable_w)
+WRITE_LINE_MEMBER(champbas_state::irq_enable_w)
{
- m_irq_mask = data & 1;
+ m_irq_mask = state;
if (!m_irq_mask)
m_maincpu->set_input_line(0, CLEAR_LINE);
@@ -123,15 +124,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(champbas_state::exctsccr_sound_irq)
*
*************************************/
-WRITE8_MEMBER(champbas_state::mcu_switch_w)
+WRITE_LINE_MEMBER(champbas_state::mcu_switch_w)
{
// switch shared RAM between CPU and MCU bus
- m_alpha_8201->bus_dir_w(data & 1);
+ m_alpha_8201->bus_dir_w(state);
}
-WRITE8_MEMBER(champbas_state::mcu_start_w)
+WRITE_LINE_MEMBER(champbas_state::mcu_start_w)
{
- m_alpha_8201->mcu_start_w(data & 1);
+ m_alpha_8201->mcu_start_w(state);
}
/* champbja another protection */
@@ -190,14 +191,7 @@ static ADDRESS_MAP_START( champbas_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0xa080, 0xa080) AM_MIRROR(0x0020) AM_READ_PORT("DSW")
AM_RANGE(0xa0c0, 0xa0c0) AM_READ_PORT("SYSTEM")
- AM_RANGE(0xa000, 0xa000) AM_WRITE(irq_enable_w)
- AM_RANGE(0xa001, 0xa001) AM_WRITENOP // !WORK board output (no use?)
- AM_RANGE(0xa002, 0xa002) AM_WRITE(gfxbank_w)
- AM_RANGE(0xa003, 0xa003) AM_WRITE(flipscreen_w)
- AM_RANGE(0xa004, 0xa004) AM_WRITE(palette_bank_w)
- AM_RANGE(0xa005, 0xa005) AM_WRITENOP // n.c.
- AM_RANGE(0xa006, 0xa006) AM_WRITENOP // no MCU
- AM_RANGE(0xa007, 0xa007) AM_WRITENOP // no MCU
+ AM_RANGE(0xa000, 0xa007) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
AM_RANGE(0xa060, 0xa06f) AM_WRITEONLY AM_SHARE("spriteram")
AM_RANGE(0xa080, 0xa080) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
@@ -207,8 +201,6 @@ ADDRESS_MAP_END
// base map + ALPHA-8x0x protection
static ADDRESS_MAP_START( champbasj_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("alpha_8201", alpha_8201_device, ext_ram_r, ext_ram_w)
- AM_RANGE(0xa006, 0xa006) AM_WRITE(mcu_start_w)
- AM_RANGE(0xa007, 0xa007) AM_WRITE(mcu_switch_w)
AM_IMPORT_FROM( champbas_map )
ADDRESS_MAP_END
@@ -231,25 +223,16 @@ static ADDRESS_MAP_START( champbb2_map, AS_PROGRAM, 8, champbas_state )
AM_IMPORT_FROM( champbasj_map )
ADDRESS_MAP_END
-// talbot
-static ADDRESS_MAP_START( talbot_map, AS_PROGRAM, 8, champbas_state )
- AM_RANGE(0xa002, 0xa002) AM_WRITENOP // no gfxbank
- AM_RANGE(0xa004, 0xa004) AM_WRITENOP // no palettebank
- AM_IMPORT_FROM( champbasj_map )
-ADDRESS_MAP_END
-
// more sprites in exctsccr
static ADDRESS_MAP_START( exctsccr_map, AS_PROGRAM, 8, champbas_state )
AM_RANGE(0x7000, 0x7001) AM_UNMAP // aysnd is controlled by audiocpu
AM_RANGE(0x7c00, 0x7fff) AM_RAM
- AM_RANGE(0xa004, 0xa004) AM_WRITENOP // no palettebank
AM_RANGE(0xa040, 0xa04f) AM_WRITEONLY AM_SHARE("spriteram2")
AM_IMPORT_FROM( champbasj_map )
ADDRESS_MAP_END
// exctsccrb
static ADDRESS_MAP_START( exctsccrb_map, AS_PROGRAM, 8, champbas_state )
- AM_RANGE(0xa004, 0xa004) AM_WRITENOP // no palettebank
AM_RANGE(0xa040, 0xa04f) AM_WRITEONLY AM_SHARE("spriteram2")
AM_IMPORT_FROM( champbasj_map )
ADDRESS_MAP_END
@@ -524,9 +507,19 @@ static MACHINE_CONFIG_START( talbot )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)
- MCFG_CPU_PROGRAM_MAP(talbot_map)
+ MCFG_CPU_PROGRAM_MAP(champbasj_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq)
+ MCFG_DEVICE_ADD("mainlatch", LS259, 0)
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(champbas_state, irq_enable_w))
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?)
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // no gfxbank
+ MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(champbas_state, flipscreen_w))
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // no palettebank
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c.
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(champbas_state, mcu_start_w))
+ MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(champbas_state, mcu_switch_w))
+
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
@@ -564,6 +557,16 @@ static MACHINE_CONFIG_START( champbas )
MCFG_CPU_PROGRAM_MAP(champbas_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq)
+ MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 9D; 8G on Champion Baseball II Double Board Configuration
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(champbas_state, irq_enable_w))
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?)
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(champbas_state, gfxbank_w))
+ MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(champbas_state, flipscreen_w))
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(champbas_state, palette_bank_w))
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c.
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(NOOP) // no MCU
+ MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(NOOP) // no MCU
+
MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6)
MCFG_CPU_PROGRAM_MAP(champbas_sound_map)
@@ -603,6 +606,10 @@ static MACHINE_CONFIG_DERIVED( champbasj, champbas )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(champbasj_map)
+ MCFG_DEVICE_MODIFY("mainlatch")
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(champbas_state, mcu_start_w))
+ MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(champbas_state, mcu_switch_w))
+
MCFG_DEVICE_ADD("alpha_8201", ALPHA_8201, XTAL_18_432MHz/6/8) // note: 8302 rom on champbb2 (same device!)
MCFG_QUANTUM_PERFECT_CPU("alpha_8201:mcu")
MACHINE_CONFIG_END
@@ -636,6 +643,16 @@ static MACHINE_CONFIG_START( exctsccr )
MCFG_CPU_PROGRAM_MAP(exctsccr_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq)
+ MCFG_DEVICE_ADD("mainlatch", LS259, 0)
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(champbas_state, irq_enable_w))
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?)
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(champbas_state, gfxbank_w))
+ MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(champbas_state, flipscreen_w))
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // no palettebank
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c.
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(champbas_state, mcu_start_w))
+ MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(champbas_state, mcu_switch_w))
+
MCFG_CPU_ADD("audiocpu", Z80, XTAL_14_31818MHz/4 )
MCFG_CPU_PROGRAM_MAP(exctsccr_sound_map)
MCFG_CPU_IO_MAP(exctsccr_sound_io_map)
@@ -697,6 +714,16 @@ static MACHINE_CONFIG_START( exctsccrb )
MCFG_CPU_PROGRAM_MAP(exctsccrb_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", champbas_state, vblank_irq)
+ MCFG_DEVICE_ADD("mainlatch", LS259, 0)
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(champbas_state, irq_enable_w))
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP) // !WORK board output (no use?)
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(champbas_state, gfxbank_w))
+ MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(champbas_state, flipscreen_w))
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(NOOP) // no palettebank
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // n.c.
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(champbas_state, mcu_start_w))
+ MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(champbas_state, mcu_switch_w))
+
MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6)
MCFG_CPU_PROGRAM_MAP(champbas_sound_map)