summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/a2bus/a2arcadebd.cpp2
-rw-r--r--src/devices/bus/a2bus/pc_xporter.cpp3
-rw-r--r--src/devices/bus/a2bus/ssprite.cpp151
-rw-r--r--src/devices/bus/a2bus/ssprite.h56
-rw-r--r--src/devices/bus/dmv/k230.cpp3
-rw-r--r--src/devices/bus/hp80_optroms/hp80_optrom.cpp116
-rw-r--r--src/devices/bus/hp80_optroms/hp80_optrom.h77
-rw-r--r--src/devices/bus/lpci/southbridge.cpp10
-rw-r--r--src/devices/bus/s100/wunderbus.cpp7
-rw-r--r--src/devices/cpu/arm7/arm7.cpp229
-rw-r--r--src/devices/cpu/arm7/arm7.h74
-rw-r--r--src/devices/cpu/arm7/arm7core.h15
-rw-r--r--src/devices/cpu/arm7/lpc210x.cpp2
-rw-r--r--src/devices/cpu/nec/v53.cpp5
-rw-r--r--src/devices/cpu/upd7725/upd7725.cpp46
-rw-r--r--src/devices/cpu/upd7725/upd7725.h6
-rw-r--r--src/devices/cpu/z8/z8.cpp153
-rw-r--r--src/devices/cpu/z8/z8.h12
-rw-r--r--src/devices/cpu/z8/z8ops.hxx51
-rw-r--r--src/devices/imagedev/floppy.cpp54
-rw-r--r--src/devices/imagedev/floppy.h9
-rw-r--r--src/devices/machine/cs4031.cpp11
-rw-r--r--src/devices/machine/eeprompar.cpp105
-rw-r--r--src/devices/machine/eeprompar.h26
-rw-r--r--src/devices/machine/genpc.cpp3
-rw-r--r--src/devices/machine/i80130.cpp3
-rw-r--r--src/devices/machine/i82371sb.cpp10
-rw-r--r--src/devices/machine/ins8250.cpp97
-rw-r--r--src/devices/machine/pic8259.cpp6
-rw-r--r--src/devices/machine/pic8259.h20
-rw-r--r--src/devices/machine/sis85c496.cpp10
-rw-r--r--src/devices/machine/smc91c9x.cpp11
-rw-r--r--src/devices/machine/upd765.cpp27
-rw-r--r--src/devices/machine/upd765.h13
-rw-r--r--src/devices/machine/vrc5074.cpp68
-rw-r--r--src/devices/machine/vrc5074.h6
-rw-r--r--src/devices/machine/wd7600.cpp11
-rw-r--r--src/devices/sound/ay8910.cpp10
-rw-r--r--src/devices/sound/saa1099.cpp6
-rw-r--r--src/devices/video/mb_vcu.cpp67
-rw-r--r--src/devices/video/vooddefs.h2
-rw-r--r--src/devices/video/voodoo.cpp9
-rw-r--r--src/emu/rendlay.cpp29
-rw-r--r--src/emu/rendutil.cpp33
-rw-r--r--src/emu/rendutil.h14
-rw-r--r--src/frontend/mame/luaengine.cpp2
-rw-r--r--src/frontend/mame/ui/info.cpp2
-rw-r--r--src/lib/util/corestr.cpp18
-rw-r--r--src/lib/util/corestr.h8
-rw-r--r--src/lib/util/png.cpp45
-rw-r--r--src/lib/util/png.h2
-rw-r--r--src/mame/audio/starwars.cpp7
-rw-r--r--src/mame/drivers/a7150.cpp3
-rw-r--r--src/mame/drivers/aerofgt.cpp2
-rw-r--r--src/mame/drivers/airbustr.cpp36
-rw-r--r--src/mame/drivers/alien.cpp13
-rw-r--r--src/mame/drivers/altos486.cpp6
-rw-r--r--src/mame/drivers/altos8600.cpp21
-rw-r--r--src/mame/drivers/amusco.cpp3
-rw-r--r--src/mame/drivers/apc.cpp11
-rw-r--r--src/mame/drivers/apple2.cpp4
-rw-r--r--src/mame/drivers/apple2e.cpp2
-rw-r--r--src/mame/drivers/apricot.cpp3
-rw-r--r--src/mame/drivers/apricotp.cpp5
-rw-r--r--src/mame/drivers/aquarium.cpp61
-rw-r--r--src/mame/drivers/arcadecl.cpp9
-rw-r--r--src/mame/drivers/astrocde.cpp37
-rw-r--r--src/mame/drivers/atarig1.cpp8
-rw-r--r--src/mame/drivers/atarig42.cpp16
-rw-r--r--src/mame/drivers/atarigt.cpp8
-rw-r--r--src/mame/drivers/atarigx2.cpp8
-rw-r--r--src/mame/drivers/atarisy1.cpp9
-rw-r--r--src/mame/drivers/atarisy2.cpp2
-rw-r--r--src/mame/drivers/b2m.cpp3
-rw-r--r--src/mame/drivers/badlands.cpp15
-rw-r--r--src/mame/drivers/batman.cpp10
-rw-r--r--src/mame/drivers/bebox.cpp11
-rw-r--r--src/mame/drivers/bking.cpp23
-rw-r--r--src/mame/drivers/blstroid.cpp9
-rw-r--r--src/mame/drivers/boogwing.cpp3
-rw-r--r--src/mame/drivers/buggychl.cpp118
-rw-r--r--src/mame/drivers/cbm2.cpp10
-rw-r--r--src/mame/drivers/champbwl.cpp54
-rw-r--r--src/mame/drivers/cninja.cpp55
-rw-r--r--src/mame/drivers/cyberbal.cpp36
-rw-r--r--src/mame/drivers/dblewing.cpp36
-rw-r--r--src/mame/drivers/ddragon3.cpp84
-rw-r--r--src/mame/drivers/deco32.cpp61
-rw-r--r--src/mame/drivers/deniam.cpp12
-rw-r--r--src/mame/drivers/dietgo.cpp3
-rw-r--r--src/mame/drivers/dreambal.cpp3
-rw-r--r--src/mame/drivers/dvk_ksm.cpp3
-rw-r--r--src/mame/drivers/eprom.cpp18
-rw-r--r--src/mame/drivers/fanucspmg.cpp10
-rw-r--r--src/mame/drivers/fastinvaders.cpp3
-rw-r--r--src/mame/drivers/fmtowns.cpp11
-rw-r--r--src/mame/drivers/funkyjet.cpp3
-rw-r--r--src/mame/drivers/funworld.cpp405
-rw-r--r--src/mame/drivers/gaelco2.cpp41
-rw-r--r--src/mame/drivers/gaiden.cpp9
-rw-r--r--src/mame/drivers/galaxian.cpp112
-rw-r--r--src/mame/drivers/gauntlet.cpp8
-rw-r--r--src/mame/drivers/gba.cpp2
-rw-r--r--src/mame/drivers/gcpinbal.cpp6
-rw-r--r--src/mame/drivers/grchamp.cpp99
-rw-r--r--src/mame/drivers/gstriker.cpp166
-rw-r--r--src/mame/drivers/hh_sm510.cpp73
-rw-r--r--src/mame/drivers/hp80.cpp68
-rw-r--r--src/mame/drivers/hp9k_3xx.cpp35
-rw-r--r--src/mame/drivers/hvyunit.cpp65
-rw-r--r--src/mame/drivers/ibm6580.cpp3
-rw-r--r--src/mame/drivers/ibmpcjr.cpp3
-rw-r--r--src/mame/drivers/imds2.cpp9
-rw-r--r--src/mame/drivers/iq151.cpp3
-rw-r--r--src/mame/drivers/irisha.cpp3
-rw-r--r--src/mame/drivers/isbc.cpp16
-rw-r--r--src/mame/drivers/isbc8030.cpp3
-rw-r--r--src/mame/drivers/karnov.cpp2
-rw-r--r--src/mame/drivers/kdt6.cpp23
-rw-r--r--src/mame/drivers/klax.cpp12
-rw-r--r--src/mame/drivers/lemmings.cpp3
-rw-r--r--src/mame/drivers/lkage.cpp39
-rw-r--r--src/mame/drivers/m107.cpp3
-rw-r--r--src/mame/drivers/m20.cpp3
-rw-r--r--src/mame/drivers/m72.cpp18
-rw-r--r--src/mame/drivers/m90.cpp14
-rw-r--r--src/mame/drivers/m92.cpp5
-rw-r--r--src/mame/drivers/mainsnk.cpp33
-rw-r--r--src/mame/drivers/mastboy.cpp39
-rw-r--r--src/mame/drivers/mazerbla.cpp18
-rw-r--r--src/mame/drivers/mbc55x.cpp3
-rw-r--r--src/mame/drivers/mc1502.cpp3
-rw-r--r--src/mame/drivers/megaplay.cpp4
-rw-r--r--src/mame/drivers/midzeus.cpp2
-rw-r--r--src/mame/drivers/mrflea.cpp3
-rw-r--r--src/mame/drivers/mugsmash.cpp2
-rw-r--r--src/mame/drivers/multi16.cpp3
-rw-r--r--src/mame/drivers/munchmo.cpp28
-rw-r--r--src/mame/drivers/nds.cpp155
-rw-r--r--src/mame/drivers/neogeo.cpp4
-rw-r--r--src/mame/drivers/ngen.cpp6
-rw-r--r--src/mame/drivers/ninjaw.cpp9
-rw-r--r--src/mame/drivers/notetaker.cpp8
-rw-r--r--src/mame/drivers/octopus.cpp10
-rw-r--r--src/mame/drivers/offtwall.cpp12
-rw-r--r--src/mame/drivers/onetwo.cpp13
-rw-r--r--src/mame/drivers/paso1600.cpp3
-rw-r--r--src/mame/drivers/pc100.cpp4
-rw-r--r--src/mame/drivers/pc1512.cpp8
-rw-r--r--src/mame/drivers/pc88va.cpp11
-rw-r--r--src/mame/drivers/pc9801.cpp11
-rw-r--r--src/mame/drivers/pcd.cpp7
-rw-r--r--src/mame/drivers/peoplepc.cpp10
-rw-r--r--src/mame/drivers/pg685.cpp15
-rw-r--r--src/mame/drivers/pk8020.cpp4
-rw-r--r--src/mame/drivers/pktgaldx.cpp3
-rw-r--r--src/mame/drivers/poisk1.cpp3
-rw-r--r--src/mame/drivers/qx10.cpp10
-rw-r--r--src/mame/drivers/rampart.cpp14
-rw-r--r--src/mame/drivers/rc759.cpp3
-rw-r--r--src/mame/drivers/relief.cpp15
-rw-r--r--src/mame/drivers/rohga.cpp12
-rw-r--r--src/mame/drivers/sage2.cpp3
-rw-r--r--src/mame/drivers/segajw.cpp11
-rw-r--r--src/mame/drivers/segasp.cpp106
-rw-r--r--src/mame/drivers/seta.cpp82
-rw-r--r--src/mame/drivers/shadfrce.cpp21
-rw-r--r--src/mame/drivers/shuuz.cpp8
-rw-r--r--src/mame/drivers/simpl156.cpp22
-rw-r--r--src/mame/drivers/skullxbo.cpp8
-rw-r--r--src/mame/drivers/sm7238.cpp3
-rw-r--r--src/mame/drivers/snowbros.cpp74
-rw-r--r--src/mame/drivers/spartanxtec.cpp10
-rw-r--r--src/mame/drivers/spbactn.cpp15
-rw-r--r--src/mame/drivers/spyhuntertec.cpp13
-rw-r--r--src/mame/drivers/sshangha.cpp3
-rw-r--r--src/mame/drivers/starwars.cpp2
-rw-r--r--src/mame/drivers/sub.cpp55
-rw-r--r--src/mame/drivers/superslave.cpp3
-rw-r--r--src/mame/drivers/taito_h.cpp86
-rw-r--r--src/mame/drivers/taitosj.cpp123
-rw-r--r--src/mame/drivers/tandy2k.cpp6
-rw-r--r--src/mame/drivers/tdv2324.cpp2
-rw-r--r--src/mame/drivers/tecmosys.cpp32
-rw-r--r--src/mame/drivers/thedeep.cpp14
-rw-r--r--src/mame/drivers/thunderj.cpp9
-rw-r--r--src/mame/drivers/tnzs.cpp86
-rw-r--r--src/mame/drivers/toobin.cpp10
-rw-r--r--src/mame/drivers/triforce.cpp2
-rw-r--r--src/mame/drivers/trs80m2.cpp3
-rw-r--r--src/mame/drivers/tsispch.cpp3
-rw-r--r--src/mame/drivers/ultraman.cpp24
-rw-r--r--src/mame/drivers/vegas.cpp231
-rw-r--r--src/mame/drivers/victor9k.cpp3
-rw-r--r--src/mame/drivers/vindictr.cpp8
-rw-r--r--src/mame/drivers/wallc.cpp299
-rw-r--r--src/mame/drivers/wangpc.cpp3
-rw-r--r--src/mame/drivers/wc90.cpp16
-rw-r--r--src/mame/drivers/wc90b.cpp12
-rw-r--r--src/mame/drivers/wwfsstar.cpp9
-rw-r--r--src/mame/drivers/xybots.cpp9
-rw-r--r--src/mame/drivers/z100.cpp10
-rw-r--r--src/mame/drivers/zn.cpp16
-rw-r--r--src/mame/includes/airbustr.h8
-rw-r--r--src/mame/includes/aquarium.h14
-rw-r--r--src/mame/includes/astrocde.h1
-rw-r--r--src/mame/includes/bking.h9
-rw-r--r--src/mame/includes/buggychl.h2
-rw-r--r--src/mame/includes/cninja.h5
-rw-r--r--src/mame/includes/ddragon3.h5
-rw-r--r--src/mame/includes/deco32.h6
-rw-r--r--src/mame/includes/deniam.h1
-rw-r--r--src/mame/includes/galaxian.h3
-rw-r--r--src/mame/includes/gcpinbal.h3
-rw-r--r--src/mame/includes/grchamp.h14
-rw-r--r--src/mame/includes/gstriker.h24
-rw-r--r--src/mame/includes/harddriv.h1
-rw-r--r--src/mame/includes/lkage.h11
-rw-r--r--src/mame/includes/m90.h1
-rw-r--r--src/mame/includes/mainsnk.h4
-rw-r--r--src/mame/includes/munchmo.h8
-rw-r--r--src/mame/includes/nds.h48
-rw-r--r--src/mame/includes/seta.h3
-rw-r--r--src/mame/includes/shadfrce.h2
-rw-r--r--src/mame/includes/snowbros.h4
-rw-r--r--src/mame/includes/spbactn.h2
-rw-r--r--src/mame/includes/starwars.h1
-rw-r--r--src/mame/includes/taitosj.h66
-rw-r--r--src/mame/includes/tecmosys.h9
-rw-r--r--src/mame/includes/thedeep.h1
-rw-r--r--src/mame/includes/ultraman.h8
-rw-r--r--src/mame/includes/wwfsstar.h1
-rw-r--r--src/mame/machine/apollo.cpp11
-rw-r--r--src/mame/machine/at.cpp10
-rw-r--r--src/mame/machine/atarigen.cpp113
-rw-r--r--src/mame/machine/atarigen.h70
-rw-r--r--src/mame/machine/deco146.cpp43
-rw-r--r--src/mame/machine/deco146.h31
-rw-r--r--src/mame/machine/pcshare.cpp11
-rw-r--r--src/mame/machine/xbox.cpp11
-rw-r--r--src/mame/mame.lst34
-rw-r--r--src/mame/mess.flt1
-rw-r--r--src/mame/video/galaxian.cpp2
-rw-r--r--src/mame/video/gstriker.cpp58
-rw-r--r--src/mame/video/k007420.cpp3
-rw-r--r--src/mame/video/mb60553.cpp44
-rw-r--r--src/mame/video/munchmo.cpp13
-rw-r--r--src/mame/video/rockrage.cpp8
248 files changed, 4135 insertions, 2410 deletions
diff --git a/src/devices/bus/a2bus/a2arcadebd.cpp b/src/devices/bus/a2bus/a2arcadebd.cpp
index 959b7b7f9a4..85dbe13e770 100644
--- a/src/devices/bus/a2bus/a2arcadebd.cpp
+++ b/src/devices/bus/a2bus/a2arcadebd.cpp
@@ -110,10 +110,12 @@ void a2bus_arcboard_device::write_c0nx(address_space &space, uint8_t offset, uin
{
switch (offset)
{
+ case 0:
case 2:
m_tms->vram_write(space, 0, data);
break;
+ case 1:
case 3:
m_tms->register_write(space, 0, data);
break;
diff --git a/src/devices/bus/a2bus/pc_xporter.cpp b/src/devices/bus/a2bus/pc_xporter.cpp
index 25149f4d206..3583781a871 100644
--- a/src/devices/bus/a2bus/pc_xporter.cpp
+++ b/src/devices/bus/a2bus/pc_xporter.cpp
@@ -145,7 +145,8 @@ MACHINE_CONFIG_MEMBER( a2bus_pcxporter_device::device_add_mconfig )
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(a2bus_pcxporter_device, pc_dack2_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(a2bus_pcxporter_device, pc_dack3_w))
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("v30", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("v30", 0))
MCFG_DEVICE_ADD("isa", ISA8, 0)
MCFG_ISA8_CPU("^v30")
diff --git a/src/devices/bus/a2bus/ssprite.cpp b/src/devices/bus/a2bus/ssprite.cpp
new file mode 100644
index 00000000000..5f101bcf6ac
--- /dev/null
+++ b/src/devices/bus/a2bus/ssprite.cpp
@@ -0,0 +1,151 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont, Golden Child
+/*********************************************************************
+
+ ssprite.cpp
+
+ Implementation of the Synetix SuperSprite
+
+*********************************************************************/
+
+#include "emu.h"
+#include "ssprite.h"
+#include "sound/tms5220.h"
+#include "speaker.h"
+
+
+/***************************************************************************
+ PARAMETERS
+***************************************************************************/
+
+#define TMS_TAG "ssprite_tms"
+#define TMS5220_TAG "ssprite_tms5220"
+#define AY_TAG "ssprite_ay"
+#define SCREEN_TAG "screen"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(A2BUS_SSPRITE, a2bus_ssprite_device, "a2ssprite", "Synetix SuperSprite")
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+MACHINE_CONFIG_MEMBER( a2bus_ssprite_device::device_add_mconfig )
+ MCFG_DEVICE_ADD( TMS_TAG, TMS9918A, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000) // 16k of VRAM
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(a2bus_ssprite_device, tms_irq_w))
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
+ MCFG_SCREEN_UPDATE_DEVICE( TMS_TAG, tms9918a_device, screen_update )
+
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD(AY_TAG, AY8912, 1022727)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_SOUND_ADD(TMS5220_TAG, TMS5220, 640000)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+MACHINE_CONFIG_END
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+a2bus_ssprite_device::a2bus_ssprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ a2bus_ssprite_device(mconfig, A2BUS_SSPRITE, tag, owner, clock)
+{
+}
+
+a2bus_ssprite_device::a2bus_ssprite_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, type, tag, owner, clock),
+ device_a2bus_card_interface(mconfig, *this),
+ m_tms(*this, TMS_TAG),
+ m_ay(*this, AY_TAG),
+ m_tms5220(*this, TMS5220_TAG)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void a2bus_ssprite_device::device_start()
+{
+ // set_a2bus_device makes m_slot valid
+ set_a2bus_device();
+}
+
+void a2bus_ssprite_device::device_reset()
+{
+}
+
+/*
+ C0nx map: (info from Synetix SuperSprite Owners manual.pdf page 33 of 266)
+ 0 - TMS9918 VDP vram read/write
+ 1 - TMS9918 VDP register write
+ 2 - TMS5220 Speech read/write
+ 3 - Video Switch APPLE VIDEO IN OFF
+ 4 - Video Switch APPLE VIDEO IN ON
+ 5 - Video Switch APPLE ONLY OUT
+ 6 - Video Switch MIX VDP/EXTERNAL VIDEO
+ 7 - TMS 9918 WRITE ONLY/FRAME RESET
+ C - AY Sound data write
+ D - AY Sound data write
+ E - AY Sound register write or data read
+ F - AY Sound register write or data read
+*/
+
+
+uint8_t a2bus_ssprite_device::read_c0nx(address_space &space, uint8_t offset)
+{
+ switch (offset)
+ {
+ case 0:
+ return m_tms->vram_read(space, 0);
+ case 1:
+ return m_tms->register_read(space, 0);
+ case 2:
+ return 0x1f | m_tms5220->status_r(space, 0); // copied this line from a2echoii.cpp
+ case 14:
+ case 15:
+ return m_ay->data_r(space, 0);
+ }
+
+ return 0xff;
+}
+
+void a2bus_ssprite_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data)
+{
+ switch (offset)
+ {
+ case 0:
+ m_tms->vram_write(space, 0, data);
+ break;
+ case 1:
+ m_tms->register_write(space, 0, data);
+ break;
+ case 2:
+ m_tms5220->data_w(space, offset, data);
+ break;
+ case 12:
+ case 13:
+ m_ay->data_w(space, 0, data);
+ break;
+ case 14:
+ case 15:
+ m_ay->address_w(space, 0, data);
+ break;
+ }
+}
+
+WRITE_LINE_MEMBER( a2bus_ssprite_device::tms_irq_w )
+{
+ if (state)
+ {
+ raise_slot_irq();
+ }
+ else
+ {
+ lower_slot_irq();
+ }
+}
diff --git a/src/devices/bus/a2bus/ssprite.h b/src/devices/bus/a2bus/ssprite.h
new file mode 100644
index 00000000000..8b5df012a51
--- /dev/null
+++ b/src/devices/bus/a2bus/ssprite.h
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:R. Belmont, Golden Child
+/*********************************************************************
+
+ ssprite.h
+
+ Synetix SuperSprite
+ (code based on Third Millenium Engineering Arcade Board)
+
+*********************************************************************/
+
+#ifndef MAME_BUS_A2BUS_A2SSPRITE_H
+#define MAME_BUS_A2BUS_A2SSPRITE_H
+
+#pragma once
+
+#include "a2bus.h"
+#include "video/tms9928a.h"
+#include "sound/ay8910.h"
+#include "sound/tms5220.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class a2bus_ssprite_device:
+ public device_t,
+ public device_a2bus_card_interface
+{
+public:
+ // construction/destruction
+ a2bus_ssprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ a2bus_ssprite_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ // overrides of standard a2bus slot functions
+ virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override;
+ virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override;
+
+private:
+ DECLARE_WRITE_LINE_MEMBER( tms_irq_w );
+
+ required_device<tms9918a_device> m_tms;
+ required_device<ay8910_device> m_ay;
+ required_device<tms5220_device> m_tms5220;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(A2BUS_SSPRITE, a2bus_ssprite_device)
+
+#endif // MAME_BUS_A2BUS_SSPRITE_H
diff --git a/src/devices/bus/dmv/k230.cpp b/src/devices/bus/dmv/k230.cpp
index 48b5672f328..96ec71b182a 100644
--- a/src/devices/bus/dmv/k230.cpp
+++ b/src/devices/bus/dmv/k230.cpp
@@ -179,7 +179,8 @@ MACHINE_CONFIG_MEMBER( dmv_k235_device::device_add_mconfig )
MCFG_CPU_IO_MAP(k235_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MACHINE_CONFIG_END
//-------------------------------------------------
diff --git a/src/devices/bus/hp80_optroms/hp80_optrom.cpp b/src/devices/bus/hp80_optroms/hp80_optrom.cpp
new file mode 100644
index 00000000000..2797e37b69d
--- /dev/null
+++ b/src/devices/bus/hp80_optroms/hp80_optrom.cpp
@@ -0,0 +1,116 @@
+// license:BSD-3-Clause
+// copyright-holders: F. Ulivi
+/*********************************************************************
+
+ hp80_optrom.cpp
+
+ Optional ROMs for HP80 systems
+
+*********************************************************************/
+
+#include "emu.h"
+#include "hp80_optrom.h"
+#include "softlist.h"
+
+// Debugging
+#define VERBOSE 1
+#include "logmacro.h"
+
+DEFINE_DEVICE_TYPE(HP80_OPTROM_CART, hp80_optrom_cart_device, "hp80_optrom_cart", "HP80 optional ROM cartridge")
+DEFINE_DEVICE_TYPE(HP80_OPTROM_SLOT, hp80_optrom_slot_device, "hp80_optrom_slot", "HP80 optional ROM slot")
+
+// +-----------------------+
+// |hp80_optrom_cart_device|
+// +-----------------------+
+hp80_optrom_cart_device::hp80_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, type, tag, owner, clock),
+ device_slot_card_interface(mconfig, *this)
+{
+}
+
+hp80_optrom_cart_device::hp80_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ hp80_optrom_cart_device(mconfig, HP80_OPTROM_CART, tag, owner, clock)
+{
+}
+
+// +-----------------------+
+// |hp80_optrom_slot_device|
+// +-----------------------+
+hp80_optrom_slot_device::hp80_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, HP80_OPTROM_SLOT, tag, owner, clock),
+ device_image_interface(mconfig, *this),
+ device_slot_interface(mconfig, *this),
+ m_cart(nullptr),
+ m_select_code(0)
+{
+}
+
+hp80_optrom_slot_device::~hp80_optrom_slot_device()
+{
+}
+
+void hp80_optrom_slot_device::install_read_handler(address_space& space)
+{
+ if (loaded_through_softlist()) {
+ offs_t start = (offs_t)m_select_code * HP80_OPTROM_SIZE;
+ space.install_rom(start , start + HP80_OPTROM_SIZE - 1 , get_software_region("rom"));
+ }
+}
+
+void hp80_optrom_slot_device::device_start()
+{
+ m_cart = dynamic_cast<hp80_optrom_cart_device *>(get_card_device());
+}
+
+image_init_result hp80_optrom_slot_device::call_load()
+{
+ LOG("hp80_optrom: call_load\n");
+ if (m_cart == nullptr || !loaded_through_softlist()) {
+ LOG("hp80_optrom: must be loaded from sw list\n");
+ return image_init_result::FAIL;
+ }
+
+ const char *sc_feature = get_feature("sc");
+ if (sc_feature == nullptr) {
+ LOG("hp80_optrom: no 'sc' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ unsigned sc;
+ if (sc_feature[ 0 ] != '0' || sc_feature[ 1 ] != 'x' || sscanf(&sc_feature[ 2 ] , "%x" , &sc) != 1) {
+ LOG("hp80_optrom: can't parse 'sc' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ // Valid SC values: 0x01..0xff
+ if (sc < 1 || sc > 0xff) {
+ LOG("hp80_optrom: illegal select code (%x)\n" , sc);
+ return image_init_result::FAIL;
+ }
+
+ auto length = get_software_region_length("rom");
+
+ if (length != HP80_OPTROM_SIZE) {
+ LOG("hp80_optrom: illegal region length (%x)\n" , length);
+ return image_init_result::FAIL;
+ }
+
+ LOG("hp80_optrom: loaded SC=0x%02x\n" , sc);
+ m_select_code = sc;
+ return image_init_result::PASS;
+}
+
+void hp80_optrom_slot_device::call_unload()
+{
+ LOG("hp80_optrom: call_unload\n");
+ machine().schedule_soft_reset();
+}
+
+std::string hp80_optrom_slot_device::get_default_card_software(get_default_card_software_hook &hook) const
+{
+ return software_get_default_slot("rom");
+}
+
+SLOT_INTERFACE_START(hp80_optrom_slot_device)
+ SLOT_INTERFACE_INTERNAL("rom", HP80_OPTROM_CART)
+SLOT_INTERFACE_END
diff --git a/src/devices/bus/hp80_optroms/hp80_optrom.h b/src/devices/bus/hp80_optroms/hp80_optrom.h
new file mode 100644
index 00000000000..2fd43456264
--- /dev/null
+++ b/src/devices/bus/hp80_optroms/hp80_optrom.h
@@ -0,0 +1,77 @@
+// license:BSD-3-Clause
+// copyright-holders: F. Ulivi
+/*********************************************************************
+
+ hp80_optrom.h
+
+ Optional ROMs for HP80 systems
+
+*********************************************************************/
+
+#ifndef MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
+#define MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
+
+#pragma once
+
+#include "softlist_dev.h"
+
+// Size of optional ROMs (8k)
+static constexpr offs_t HP80_OPTROM_SIZE = 0x2000;
+
+class hp80_optrom_cart_device : public device_t,
+ public device_slot_card_interface
+{
+public:
+ // construction/destruction
+ hp80_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ hp80_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override { }
+};
+
+class hp80_optrom_slot_device : public device_t,
+ public device_image_interface,
+ public device_slot_interface
+{
+public:
+ // construction/destruction
+ hp80_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~hp80_optrom_slot_device();
+
+ void install_read_handler(address_space& space);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // image-level overrides
+ virtual image_init_result call_load() override;
+ virtual void call_unload() override;
+ virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
+
+ virtual iodevice_t image_type() const override { return IO_ROM; }
+ virtual bool is_readable() const override { return true; }
+ virtual bool is_writeable() const override { return false; }
+ virtual bool is_creatable() const override { return false; }
+ virtual bool must_be_loaded() const override { return false; }
+ virtual bool is_reset_on_load() const override { return true; }
+ virtual const char *image_interface() const override { return "hp80_rom"; }
+ virtual const char *file_extensions() const override { return "bin"; }
+
+ // slot interface overrides
+ virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
+
+ hp80_optrom_cart_device *m_cart;
+ uint8_t m_select_code;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(HP80_OPTROM_SLOT, hp80_optrom_slot_device)
+DECLARE_DEVICE_TYPE(HP80_OPTROM_CART, hp80_optrom_cart_device)
+
+SLOT_INTERFACE_EXTERN(hp80_optrom_slot_device);
+
+#endif // MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
diff --git a/src/devices/bus/lpci/southbridge.cpp b/src/devices/bus/lpci/southbridge.cpp
index 3bc4108b28e..c571815ab06 100644
--- a/src/devices/bus/lpci/southbridge.cpp
+++ b/src/devices/bus/lpci/southbridge.cpp
@@ -70,8 +70,14 @@ MACHINE_CONFIG_MEMBER( southbridge_device::device_add_mconfig )
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(southbridge_device, pc_dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(southbridge_device, pc_dack7_w))
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE(":maincpu", 0), VCC, READ8(southbridge_device, get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir2_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(":maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(southbridge_device, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, XTAL_12MHz)
MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(INPUTLINE(":maincpu", INPUT_LINE_RESET))
diff --git a/src/devices/bus/s100/wunderbus.cpp b/src/devices/bus/s100/wunderbus.cpp
index 1c594bc7ac0..e0eec1b3b4f 100644
--- a/src/devices/bus/s100/wunderbus.cpp
+++ b/src/devices/bus/s100/wunderbus.cpp
@@ -88,17 +88,22 @@ WRITE_LINE_MEMBER( s100_wunderbus_device::rtc_tp_w )
MACHINE_CONFIG_MEMBER( s100_wunderbus_device::device_add_mconfig )
- MCFG_PIC8259_ADD(I8259A_TAG, DEVWRITELINE(DEVICE_SELF, s100_wunderbus_device, pic_int_w), VCC, NOOP)
+ MCFG_DEVICE_ADD(I8259A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(s100_wunderbus_device, pic_int_w))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+
MCFG_DEVICE_ADD(INS8250_1_TAG, INS8250, XTAL_18_432MHz/10)
MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_txd))
MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_dtr))
MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_rts))
MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir3_w))
+
MCFG_DEVICE_ADD(INS8250_2_TAG, INS8250, XTAL_18_432MHz/10)
MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_txd))
MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_dtr))
MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_rts))
MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir4_w))
+
MCFG_DEVICE_ADD(INS8250_3_TAG, INS8250, XTAL_18_432MHz/10)
MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_C_TAG, rs232_port_device, write_txd))
MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_C_TAG, rs232_port_device, write_dtr))
diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp
index 314003c8bdb..d9380b40a7a 100644
--- a/src/devices/cpu/arm7/arm7.cpp
+++ b/src/devices/cpu/arm7/arm7.cpp
@@ -45,77 +45,124 @@ void (*arm7_coproc_dt_r_callback)(arm_state *arm, uint32_t insn, uint32_t *prn,
void (*arm7_coproc_dt_w_callback)(arm_state *arm, uint32_t insn, uint32_t *prn, void (*write32)(arm_state *arm, uint32_t addr, uint32_t data));
-DEFINE_DEVICE_TYPE(ARM7, arm7_cpu_device, "arm7_le", "ARM7 (little)")
-DEFINE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device, "arm7_be", "ARM7 (big)")
-DEFINE_DEVICE_TYPE(ARM7500, arm7500_cpu_device, "arm7500", "ARM7500")
-DEFINE_DEVICE_TYPE(ARM9, arm9_cpu_device, "arm9", "ARM9")
-DEFINE_DEVICE_TYPE(ARM920T, arm920t_cpu_device, "arm920t", "ARM920T")
-DEFINE_DEVICE_TYPE(PXA255, pxa255_cpu_device, "pxa255", "Intel XScale PXA255")
-DEFINE_DEVICE_TYPE(SA1110, sa1110_cpu_device, "sa1110", "Intel StrongARM SA-1110")
-
+DEFINE_DEVICE_TYPE(ARM7, arm7_cpu_device, "arm7_le", "ARM7 (little)")
+DEFINE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device, "arm7_be", "ARM7 (big)")
+DEFINE_DEVICE_TYPE(ARM7500, arm7500_cpu_device, "arm7500", "ARM7500")
+DEFINE_DEVICE_TYPE(ARM9, arm9_cpu_device, "arm9", "ARM9")
+DEFINE_DEVICE_TYPE(ARM920T, arm920t_cpu_device, "arm920t", "ARM920T")
+DEFINE_DEVICE_TYPE(ARM946ES, arm946es_cpu_device, "arm946es", "ARM946ES")
+DEFINE_DEVICE_TYPE(PXA255, pxa255_cpu_device, "pxa255", "Intel XScale PXA255")
+DEFINE_DEVICE_TYPE(SA1110, sa1110_cpu_device, "sa1110", "Intel StrongARM SA-1110")
arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, ARM7, tag, owner, clock, 4, eARM_ARCHFLAGS_T, ENDIANNESS_LITTLE)
+ : arm7_cpu_device(mconfig, ARM7, tag, owner, clock, 4, ARCHFLAG_T, ENDIANNESS_LITTLE)
{
}
-
arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t archRev, uint8_t archFlags, endianness_t endianness)
: cpu_device(mconfig, type, tag, owner, clock)
, m_program_config("program", endianness, 32, 32, 0)
, m_endian(endianness)
, m_archRev(archRev)
, m_archFlags(archFlags)
- , m_copro_id(0x41 | (1 << 23) | (7 << 12)) // <-- where did this come from?
, m_pc(0)
{
memset(m_r, 0x00, sizeof(m_r));
+ uint32_t arch = ARM9_COPRO_ID_ARCH_V4;
+ if (m_archFlags & ARCHFLAG_T)
+ arch = ARM9_COPRO_ID_ARCH_V4T;
+
+ m_copro_id = ARM9_COPRO_ID_MFR_ARM | arch | ARM9_COPRO_ID_PART_GENERICARM7;
}
arm7_be_cpu_device::arm7_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, ARM7_BE, tag, owner, clock, 4, eARM_ARCHFLAGS_T, ENDIANNESS_BIG)
+ : arm7_cpu_device(mconfig, ARM7_BE, tag, owner, clock, 4, ARCHFLAG_T, ENDIANNESS_BIG)
{
}
arm7500_cpu_device::arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, ARM7500, tag, owner, clock, 3, eARM_ARCHFLAGS_MODE26, ENDIANNESS_LITTLE)
+ : arm7_cpu_device(mconfig, ARM7500, tag, owner, clock, 4, ARCHFLAG_MODE26, ENDIANNESS_LITTLE)
{
- m_copro_id = (0x41 << 24) | (0 << 20) | (1 << 16) | (0x710 << 4) | (0 << 0);
+ m_copro_id = ARM9_COPRO_ID_MFR_ARM
+ | ARM9_COPRO_ID_ARCH_V4
+ | ARM9_COPRO_ID_PART_ARM710;
}
arm9_cpu_device::arm9_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, ARM9, tag, owner, clock, 5, eARM_ARCHFLAGS_T | eARM_ARCHFLAGS_E, ENDIANNESS_LITTLE)
- // ARMv5
- // has TE extensions
+ : arm9_cpu_device(mconfig, ARM9, tag, owner, clock, 5, ARCHFLAG_T | ARCHFLAG_E, ENDIANNESS_LITTLE)
{
}
+arm9_cpu_device::arm9_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t archRev, uint8_t archFlags, endianness_t endianness)
+ : arm7_cpu_device(mconfig, type, tag, owner, clock, archRev, archFlags, endianness)
+{
+ uint32_t arch = ARM9_COPRO_ID_ARCH_V4;
+ switch (archRev)
+ {
+ case 4:
+ if (archFlags & ARCHFLAG_T)
+ arch = ARM9_COPRO_ID_ARCH_V4T;
+ break;
+ case 5:
+ arch = ARM9_COPRO_ID_ARCH_V5;
+ if (archFlags & ARCHFLAG_T)
+ {
+ arch = ARM9_COPRO_ID_ARCH_V5T;
+ if (archFlags & ARCHFLAG_E)
+ {
+ arch = ARM9_COPRO_ID_ARCH_V5TE;
+ }
+ }
+ break;
+ default: break;
+ }
+
+ m_copro_id = ARM9_COPRO_ID_MFR_ARM | arch | (0x900 << 4);
+}
+
+
arm920t_cpu_device::arm920t_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, ARM920T, tag, owner, clock, 4, eARM_ARCHFLAGS_T, ENDIANNESS_LITTLE)
- // ARMv4
- // has T extension
+ : arm9_cpu_device(mconfig, ARM920T, tag, owner, clock, 4, ARCHFLAG_T, ENDIANNESS_LITTLE)
{
- m_copro_id = (0x41 << 24) | (1 << 20) | (2 << 16) | (0x920 << 4) | (0 << 0);
+ m_copro_id = ARM9_COPRO_ID_MFR_ARM
+ | ARM9_COPRO_ID_SPEC_REV1
+ | ARM9_COPRO_ID_ARCH_V4T
+ | ARM9_COPRO_ID_PART_ARM920
+ | 0; // Stepping
}
-pxa255_cpu_device::pxa255_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, PXA255, tag, owner, clock, 5, eARM_ARCHFLAGS_T | eARM_ARCHFLAGS_E | eARM_ARCHFLAGS_XSCALE, ENDIANNESS_LITTLE)
- // ARMv5
- // has TE and XScale extensions
+arm946es_cpu_device::arm946es_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : arm9_cpu_device(mconfig, ARM946ES, tag, owner, clock, 5, ARCHFLAG_T | ARCHFLAG_E, ENDIANNESS_LITTLE)
{
+ m_copro_id = ARM9_COPRO_ID_MFR_ARM
+ | ARM9_COPRO_ID_ARCH_V5TE
+ | ARM9_COPRO_ID_PART_ARM946
+ | ARM9_COPRO_ID_STEP_ARM946_A0;
}
+pxa255_cpu_device::pxa255_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : arm7_cpu_device(mconfig, PXA255, tag, owner, clock, 5, ARCHFLAG_T | ARCHFLAG_E | ARCHFLAG_XSCALE, ENDIANNESS_LITTLE)
+{
+ m_copro_id = ARM9_COPRO_ID_MFR_INTEL
+ | ARM9_COPRO_ID_ARCH_V5TE
+ | ARM9_COPRO_ID_PXA255_CORE_GEN_XSCALE
+ | (3 << ARM9_COPRO_ID_PXA255_CORE_REV_SHIFT)
+ | ARM9_COPRO_ID_STEP_PXA255_A0;
+}
sa1110_cpu_device::sa1110_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, SA1110, tag, owner, clock, 4, eARM_ARCHFLAGS_SA, ENDIANNESS_LITTLE)
- // ARMv4
+ : arm7_cpu_device(mconfig, SA1110, tag, owner, clock, 4, ARCHFLAG_SA, ENDIANNESS_LITTLE)
// has StrongARM, no Thumb, no Enhanced DSP
{
+ m_copro_id = ARM9_COPRO_ID_MFR_INTEL
+ | ARM9_COPRO_ID_ARCH_V4
+ | ARM9_COPRO_ID_PART_SA1110
+ | ARM9_COPRO_ID_STEP_SA1110_A0;
}
device_memory_interface::space_config_vector arm7_cpu_device::memory_space_config() const
@@ -133,7 +180,7 @@ void arm7_cpu_device::update_reg_ptr()
void arm7_cpu_device::set_cpsr(uint32_t val)
{
uint8_t old_mode = GET_CPSR & MODE_FLAG;
- if (m_archFlags & eARM_ARCHFLAGS_MODE26)
+ if (m_archFlags & ARCHFLAG_MODE26)
{
if ((val & 0x10) != (m_r[eCPSR] & 0x10))
{
@@ -815,35 +862,35 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback )
// we only handle system copro here
if (cpnum != 15)
{
- if (m_archFlags & eARM_ARCHFLAGS_XSCALE)
- {
- // handle XScale specific CP14
- if (cpnum == 14)
+ if (m_archFlags & ARCHFLAG_XSCALE)
{
- switch( cReg )
+ // handle XScale specific CP14
+ if (cpnum == 14)
{
- case 1: // clock counter
- data = (uint32_t)total_cycles();
- break;
+ switch( cReg )
+ {
+ case 1: // clock counter
+ data = (uint32_t)total_cycles();
+ break;
- default:
- break;
+ default:
+ break;
+ }
}
+ else
+ {
+ fatalerror("XScale: Unhandled coprocessor %d (archFlags %x)\n", cpnum, m_archFlags);
+ }
+
+ return data;
}
else
{
- fatalerror("XScale: Unhandled coprocessor %d (archFlags %x)\n", cpnum, m_archFlags);
+ LOG( ("ARM7: Unhandled coprocessor %d (archFlags %x)\n", cpnum, m_archFlags) );
+ m_pendingUnd = true;
+ update_irq_state();
+ return 0;
}
-
- return data;
- }
- else
- {
- LOG( ("ARM7: Unhandled coprocessor %d (archFlags %x)\n", cpnum, m_archFlags) );
- m_pendingUnd = true;
- update_irq_state();
- return 0;
- }
}
switch( cReg )
@@ -859,73 +906,25 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback )
LOG( ( "arm7_rt_r_callback CR%d, RESERVED\n", cReg ) );
break;
case 0: // ID
- switch(op2)
- {
- case 0:
- switch (m_archRev)
+ switch(op2)
{
- case 3: // ARM6 32-bit
- data = 0x41;
+ case 0:
+ data = m_copro_id;
+ break;
+ case 1: // cache type
+ data = 0x0f0d2112; // HACK: value expected by ARMWrestler (probably Nintendo DS ARM9's value)
+ //data = (6 << 25) | (1 << 24) | (0x172 << 12) | (0x172 << 0); // ARM920T (S3C24xx)
+ break;
+ case 2: // TCM type
+ data = 0;
+ break;
+ case 3: // TLB type
+ data = 0;
+ break;
+ case 4: // MPU type
+ data = 0;
break;
-
- case 4: // ARM7/SA11xx
- if (m_archFlags & eARM_ARCHFLAGS_SA)
- {
- // ARM Architecture Version 4
- // Part Number 0xB11 (SA1110)
- // Stepping B5
- data = 0x69 | ( 0x01 << 16 ) | ( 0xB11 << 4 ) | 0x9;
- }
- else
- {
- data = m_copro_id;
- }
- break;
-
- case 5: // ARM9/10/XScale
- data = 0x41 | (9 << 12);
- if (m_archFlags & eARM_ARCHFLAGS_T)
- {
- if (m_archFlags & eARM_ARCHFLAGS_E)
- {
- if (m_archFlags & eARM_ARCHFLAGS_J)
- {
- data |= (6<<16); // v5TEJ
- }
- else
- {
- data |= (5<<16); // v5TE
- }
- }
- else
- {
- data |= (4<<16); // v5T
- }
- }
-
- /* ID from PXA-250 manual */
- //data = 0x69052100;
- break;
-
- case 6: // ARM11
- data = 0x41 | (10<< 12) | (7<<16); // v6
- break;
}
- break;
- case 1: // cache type
- data = 0x0f0d2112; // HACK: value expected by ARMWrestler (probably Nintendo DS ARM9's value)
- //data = (6 << 25) | (1 << 24) | (0x172 << 12) | (0x172 << 0); // ARM920T (S3C24xx)
- break;
- case 2: // TCM type
- data = 0;
- break;
- case 3: // TLB type
- data = 0;
- break;
- case 4: // MPU type
- data = 0;
- break;
- }
LOG( ( "arm7_rt_r_callback, ID %02x (%02x) -> %08x (PC=%08x)\n",op2,m_archRev,data,GET_PC ) );
break;
case 1: // Control
@@ -1079,7 +1078,7 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback )
void arm7_cpu_device::arm7_dt_r_callback(uint32_t insn, uint32_t *prn)
{
uint8_t cpn = (insn >> 8) & 0xF;
- if ((m_archFlags & eARM_ARCHFLAGS_XSCALE) && (cpn == 0))
+ if ((m_archFlags & ARCHFLAG_XSCALE) && (cpn == 0))
{
LOG( ( "arm7_dt_r_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC ) );
}
@@ -1094,7 +1093,7 @@ void arm7_cpu_device::arm7_dt_r_callback(uint32_t insn, uint32_t *prn)
void arm7_cpu_device::arm7_dt_w_callback(uint32_t insn, uint32_t *prn)
{
uint8_t cpn = (insn >> 8) & 0xF;
- if ((m_archFlags & eARM_ARCHFLAGS_XSCALE) && (cpn == 0))
+ if ((m_archFlags & ARCHFLAG_XSCALE) && (cpn == 0))
{
LOG( ( "arm7_dt_w_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC ) );
}
diff --git a/src/devices/cpu/arm7/arm7.h b/src/devices/cpu/arm7/arm7.h
index 7ee80f91fdd..3f7f82fed8a 100644
--- a/src/devices/cpu/arm7/arm7.h
+++ b/src/devices/cpu/arm7/arm7.h
@@ -53,6 +53,52 @@ public:
arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ enum
+ {
+ ARCHFLAG_T = 1, // Thumb present
+ ARCHFLAG_E = 2, // extended DSP operations present (only for v5+)
+ ARCHFLAG_J = 4, // "Jazelle" (direct execution of Java bytecode)
+ ARCHFLAG_MMU = 8, // has on-board MMU (traditional ARM style like the SA1110)
+ ARCHFLAG_SA = 16, // StrongARM extensions (enhanced TLB)
+ ARCHFLAG_XSCALE = 32, // XScale extensions (CP14, enhanced TLB)
+ ARCHFLAG_MODE26 = 64 // supports 26-bit backwards compatibility mode
+ };
+
+ enum
+ {
+ ARM9_COPRO_ID_STEP_SA1110_A0 = 0,
+ ARM9_COPRO_ID_STEP_SA1110_B0 = 4,
+ ARM9_COPRO_ID_STEP_SA1110_B1 = 5,
+ ARM9_COPRO_ID_STEP_SA1110_B2 = 6,
+ ARM9_COPRO_ID_STEP_SA1110_B4 = 8,
+
+ ARM9_COPRO_ID_STEP_PXA255_A0 = 6,
+
+ ARM9_COPRO_ID_STEP_ARM946_A0 = 1,
+
+ ARM9_COPRO_ID_PART_SA1110 = 0xB11 << 4,
+ ARM9_COPRO_ID_PART_ARM946 = 0x946 << 4,
+ ARM9_COPRO_ID_PART_ARM920 = 0x920 << 4,
+ ARM9_COPRO_ID_PART_ARM710 = 0x710 << 4,
+ ARM9_COPRO_ID_PART_GENERICARM7 = 0x700 << 4,
+
+ ARM9_COPRO_ID_PXA255_CORE_REV_SHIFT = 10,
+ ARM9_COPRO_ID_PXA255_CORE_GEN_XSCALE = 0x01 << 13,
+
+ ARM9_COPRO_ID_ARCH_V4 = 0x01 << 16,
+ ARM9_COPRO_ID_ARCH_V4T = 0x02 << 16,
+ ARM9_COPRO_ID_ARCH_V5 = 0x03 << 16,
+ ARM9_COPRO_ID_ARCH_V5T = 0x04 << 16,
+ ARM9_COPRO_ID_ARCH_V5TE = 0x05 << 16,
+
+ ARM9_COPRO_ID_SPEC_REV0 = 0x00 << 20,
+ ARM9_COPRO_ID_SPEC_REV1 = 0x01 << 20,
+
+ ARM9_COPRO_ID_MFR_ARM = 0x41 << 24,
+ ARM9_COPRO_ID_MFR_DEC = 0x44 << 24,
+ ARM9_COPRO_ID_MFR_INTEL = 0x69 << 24
+ };
+
arm7_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t archRev, uint8_t archFlags, endianness_t endianness);
// device-level overrides
@@ -523,10 +569,13 @@ class arm9_cpu_device : public arm7_cpu_device
public:
// construction/destruction
arm9_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ arm9_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t archRev, uint8_t archFlags, endianness_t endianness);
};
-class arm920t_cpu_device : public arm7_cpu_device
+class arm920t_cpu_device : public arm9_cpu_device
{
public:
// construction/destruction
@@ -534,6 +583,14 @@ public:
};
+class arm946es_cpu_device : public arm9_cpu_device
+{
+public:
+ // construction/destruction
+ arm946es_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
class pxa255_cpu_device : public arm7_cpu_device
{
public:
@@ -550,12 +607,13 @@ public:
};
-DECLARE_DEVICE_TYPE(ARM7, arm7_cpu_device)
-DECLARE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device)
-DECLARE_DEVICE_TYPE(ARM7500, arm7500_cpu_device)
-DECLARE_DEVICE_TYPE(ARM9, arm9_cpu_device)
-DECLARE_DEVICE_TYPE(ARM920T, arm920t_cpu_device)
-DECLARE_DEVICE_TYPE(PXA255, pxa255_cpu_device)
-DECLARE_DEVICE_TYPE(SA1110, sa1110_cpu_device)
+DECLARE_DEVICE_TYPE(ARM7, arm7_cpu_device)
+DECLARE_DEVICE_TYPE(ARM7_BE, arm7_be_cpu_device)
+DECLARE_DEVICE_TYPE(ARM7500, arm7500_cpu_device)
+DECLARE_DEVICE_TYPE(ARM9, arm9_cpu_device)
+DECLARE_DEVICE_TYPE(ARM920T, arm920t_cpu_device)
+DECLARE_DEVICE_TYPE(ARM946ES, arm946es_cpu_device)
+DECLARE_DEVICE_TYPE(PXA255, pxa255_cpu_device)
+DECLARE_DEVICE_TYPE(SA1110, sa1110_cpu_device)
#endif // MAME_CPU_ARM7_ARM7_H
diff --git a/src/devices/cpu/arm7/arm7core.h b/src/devices/cpu/arm7/arm7core.h
index 85b26043152..14d6f6267e8 100644
--- a/src/devices/cpu/arm7/arm7core.h
+++ b/src/devices/cpu/arm7/arm7core.h
@@ -140,18 +140,6 @@ enum
#define COPRO_FCSE_PID m_fcsePID
-enum
-{
- eARM_ARCHFLAGS_T = 1, // Thumb present
- eARM_ARCHFLAGS_E = 2, // extended DSP operations present (only for v5+)
- eARM_ARCHFLAGS_J = 4, // "Jazelle" (direct execution of Java bytecode)
- eARM_ARCHFLAGS_MMU = 8, // has on-board MMU (traditional ARM style like the SA1110)
- eARM_ARCHFLAGS_SA = 16, // StrongARM extensions (enhanced TLB)
- eARM_ARCHFLAGS_XSCALE = 32, // XScale extensions (CP14, enhanced TLB)
- eARM_ARCHFLAGS_MODE26 = 64 // supports 26-bit backwards compatibility mode
-};
-
-
//#define ARM7_USE_DRC
/* forward declaration of implementation-specific state */
@@ -522,7 +510,8 @@ enum arm_flavor
/* ARM9 variants */
ARM_TYPE_ARM9,
- ARM_TYPE_ARM920T
+ ARM_TYPE_ARM920T,
+ ARM_TYPE_ARM946ES
};
#endif /* __ARM7CORE_H__ */
diff --git a/src/devices/cpu/arm7/lpc210x.cpp b/src/devices/cpu/arm7/lpc210x.cpp
index fd4a375a102..f2f508781e8 100644
--- a/src/devices/cpu/arm7/lpc210x.cpp
+++ b/src/devices/cpu/arm7/lpc210x.cpp
@@ -41,7 +41,7 @@ ADDRESS_MAP_END
lpc210x_device::lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : arm7_cpu_device(mconfig, LPC2103, tag, owner, clock, 4, eARM_ARCHFLAGS_T, ENDIANNESS_LITTLE)
+ : arm7_cpu_device(mconfig, LPC2103, tag, owner, clock, 4, ARCHFLAG_T, ENDIANNESS_LITTLE)
, m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0, ADDRESS_MAP_NAME(lpc2103_map))
{
}
diff --git a/src/devices/cpu/nec/v53.cpp b/src/devices/cpu/nec/v53.cpp
index 7a1d087c1b7..2674c73813c 100644
--- a/src/devices/cpu/nec/v53.cpp
+++ b/src/devices/cpu/nec/v53.cpp
@@ -515,7 +515,10 @@ MACHINE_CONFIG_MEMBER( v53_base_device::device_add_mconfig )
MCFG_AM9517A_OUT_DACK_3_CB(WRITELINE(v53_base_device, dma_dack3_trampoline_w))
- MCFG_PIC8259_ADD( "upd71059pic", WRITELINE(v53_base_device, internal_irq_w), VCC, READ8(v53_base_device, get_pic_ack))
+ MCFG_DEVICE_ADD("upd71059pic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(v53_base_device, internal_irq_w))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(v53_base_device, get_pic_ack))
diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp
index 697a8b075b7..7ef876613db 100644
--- a/src/devices/cpu/upd7725/upd7725.cpp
+++ b/src/devices/cpu/upd7725/upd7725.cpp
@@ -119,16 +119,12 @@ void necdsp_device::device_start()
save_item(NAME(regs.flaga.z));
save_item(NAME(regs.flaga.ov1));
save_item(NAME(regs.flaga.ov0));
- save_item(NAME(regs.flaga.ov0p));
- save_item(NAME(regs.flaga.ov0pp));
save_item(NAME(regs.flagb.s1));
save_item(NAME(regs.flagb.s0));
save_item(NAME(regs.flagb.c));
save_item(NAME(regs.flagb.z));
save_item(NAME(regs.flagb.ov1));
save_item(NAME(regs.flagb.ov0));
- save_item(NAME(regs.flagb.ov0p));
- save_item(NAME(regs.flagb.ov0pp));
save_item(NAME(regs.tr));
save_item(NAME(regs.trb));
save_item(NAME(regs.dr));
@@ -251,9 +247,7 @@ void necdsp_device::state_string_export(const device_state_entry &entry, std::st
regs.flaga.c ? 'C' : 'c',
regs.flaga.z ? 'Z' : 'z',
regs.flaga.ov1 ? "OV1" : "ov1",
- regs.flaga.ov0 ? "OV0" : "ov0",
- regs.flaga.ov0p ? "OV0P" : "ov0p",
- regs.flaga.ov0pp ? "OV0PP" : "ov0pp");
+ regs.flaga.ov0 ? "OV0" : "ov0");
break;
case UPD7725_FLAGB:
@@ -263,9 +257,7 @@ void necdsp_device::state_string_export(const device_state_entry &entry, std::st
regs.flagb.c ? 'C' : 'c',
regs.flagb.z ? 'Z' : 'z',
regs.flagb.ov1 ? "OV1" : "ov1",
- regs.flagb.ov0 ? "OV0" : "ov0",
- regs.flagb.ov0p ? "OV0P" : "ov0p",
- regs.flagb.ov0pp ? "OV0PP" : "ov0pp");
+ regs.flagb.ov0 ? "OV0" : "ov0");
break;
}
}
@@ -442,8 +434,6 @@ void necdsp_device::exec_op(uint32_t opcode) {
flag.s1 = 0;
flag.ov0 = 0;
flag.ov1 = 0;
- flag.ov0p = 0;
- flag.ov0pp = 0;
switch(pselect) {
case 0: p = dataRAM[regs.dp]; break;
@@ -469,7 +459,7 @@ void necdsp_device::exec_op(uint32_t opcode) {
case 9: r = q + 1; p = 1; break; //INC
case 10: r = ~q; break; //CMP
case 11: r = (q >> 1) | (q & 0x8000); break; //SHR1 (ASR)
- case 12: r = (q << 1) | (c ? 1 : 0); break; //SHL1 (ROL)
+ case 12: r = (q << 1) | (c ? 1 : 0); break; //SHL1 (ROL)
case 13: r = (q << 2) | 3; break; //SHL2
case 14: r = (q << 4) | 15; break; //SHL4
case 15: r = (q << 8) | (q >> 8); break; //XCHG
@@ -477,13 +467,12 @@ void necdsp_device::exec_op(uint32_t opcode) {
flag.s0 = (r & 0x8000);
flag.z = (r == 0);
- flag.ov0pp = flag.ov0p;
- flag.ov0p = flag.ov0;
+ if (!flag.ov1) flag.s1 = flag.s0;
switch(alu) {
case 1: case 2: case 3: case 10: case 13: case 14: case 15: {
flag.c = 0;
- flag.ov0 = flag.ov0p = flag.ov0pp = 0; // ASSUMPTION: previous ov0 values are nulled here to make ov1 zero
+ flag.ov0 = flag.ov1 = 0; // OV0 and OV1 are cleared by any non-add/sub/nop operation
break;
}
case 4: case 5: case 6: case 7: case 8: case 9: {
@@ -496,23 +485,20 @@ void necdsp_device::exec_op(uint32_t opcode) {
flag.ov0 = (q ^ r) & (q ^ p) & 0x8000;
flag.c = (r > q);
}
+ flag.ov1 = (flag.ov0 & flag.ov1) ? (flag.s1 == flag.s0) : (flag.ov0 | flag.ov1);
break;
}
case 11: {
flag.c = q & 1;
- flag.ov0 = flag.ov0p = flag.ov0pp = 0; // ASSUMPTION: previous ov0 values are nulled here to make ov1 zero
+ flag.ov0 = flag.ov1 = 0; // OV0 and OV1 are cleared by any non-add/sub/nop operation
break;
}
case 12: {
flag.c = q >> 15;
- flag.ov0 = flag.ov0p = flag.ov0pp = 0; // ASSUMPTION: previous ov0 values are nulled here to make ov1 zero
+ flag.ov0 = flag.ov1 = 0; // OV0 and OV1 are cleared by any non-add/sub/nop operation
break;
}
}
- // flag.ov1 is only set if the number of overflows of the past 3 opcodes (of type 4,5,6,7,8,9) is odd
- flag.ov1 = (flag.ov0 + flag.ov0p + flag.ov0pp) & 1;
- // flag.s1 is based on ov1: s1 = ov1 ^ s0;
- flag.s1 = flag.ov1 ^ flag.s0;
switch(asl) {
case 0: regs.a = r; regs.flaga = flag; break;
@@ -522,15 +508,17 @@ void necdsp_device::exec_op(uint32_t opcode) {
exec_ld((regs.idb << 6) + dst);
- switch(dpl) {
- case 1: regs.dp = (regs.dp & 0xf0) + ((regs.dp + 1) & 0x0f); break; //DPINC
- case 2: regs.dp = (regs.dp & 0xf0) + ((regs.dp - 1) & 0x0f); break; //DPDEC
- case 3: regs.dp = (regs.dp & 0xf0); break; //DPCLR
- }
+ if (dst != 4) {
+ switch(dpl) {
+ case 1: regs.dp = (regs.dp & 0xf0) + ((regs.dp + 1) & 0x0f); break; //DPINC
+ case 2: regs.dp = (regs.dp & 0xf0) + ((regs.dp - 1) & 0x0f); break; //DPDEC
+ case 3: regs.dp = (regs.dp & 0xf0); break; //DPCLR
+ }
- regs.dp ^= dphm << 4;
+ regs.dp ^= dphm << 4;
+ }
- if(rpdcr) regs.rp--;
+ if(rpdcr && (dst != 5)) regs.rp--;
}
void necdsp_device::exec_rt(uint32_t opcode) {
diff --git a/src/devices/cpu/upd7725/upd7725.h b/src/devices/cpu/upd7725/upd7725.h
index 3210c4d6c3a..76cc13b9226 100644
--- a/src/devices/cpu/upd7725/upd7725.h
+++ b/src/devices/cpu/upd7725/upd7725.h
@@ -119,16 +119,16 @@ protected:
private:
struct Flag
{
- bool s1, s0, c, z, ov1, ov0, ov0p, ov0pp;
+ bool s1, s0, c, z, ov1, ov0;
inline operator unsigned() const
{
- return (s1 << 7) + (s0 << 6) + (c << 5) + (z << 4) + (ov1 << 3) + (ov0 << 2) + (ov0p << 1) + (ov0pp << 0);
+ return (s1 << 5) + (s0 << 4) + (c << 3) + (z << 2) + (ov1 << 1) + (ov0 << 0);
}
inline unsigned operator=(unsigned d)
{
- s1 = d & 0x80; s0 = d & 0x40; c = d & 0x20; z = d & 0x10; ov1 = d & 0x08; ov0 = d & 0x04; ov0p = d & 0x02; ov0pp = d & 0x01;
+ s1 = d & 0x20; s0 = d & 0x10; c = d & 0x08; z = d & 0x04; ov1 = d & 0x02; ov0 = d & 0x01;
return d;
}
};
diff --git a/src/devices/cpu/z8/z8.cpp b/src/devices/cpu/z8/z8.cpp
index cef5a96e0ab..cbabf70eab2 100644
--- a/src/devices/cpu/z8/z8.cpp
+++ b/src/devices/cpu/z8/z8.cpp
@@ -91,7 +91,7 @@ enum
#define Z8_P01M_P0L_MODE_MASK 0x03
#define Z8_P01M_P0L_MODE_OUTPUT 0x00
#define Z8_P01M_P0L_MODE_INPUT 0x01
-#define Z8_P01M_P0L_MODE_A8_A11 0x02 /* not supported */
+#define Z8_P01M_P0L_MODE_A8_A11 0x02
#define Z8_P01M_INTERNAL_STACK 0x04
#define Z8_P01M_P1_MODE_MASK 0x18
#define Z8_P01M_P1_MODE_OUTPUT 0x00
@@ -102,7 +102,7 @@ enum
#define Z8_P01M_P0H_MODE_MASK 0xc0
#define Z8_P01M_P0H_MODE_OUTPUT 0x00
#define Z8_P01M_P0H_MODE_INPUT 0x40
-#define Z8_P01M_P0H_MODE_A12_A15 0x80 /* not supported */
+#define Z8_P01M_P0H_MODE_A12_A15 0x80
#define Z8_P3M_P2_ACTIVE_PULLUPS 0x01 /* not supported */
#define Z8_P3M_P0_STROBED 0x04 /* not supported */
@@ -214,19 +214,63 @@ offs_t z8_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint
device_memory_interface::space_config_vector z8_device::memory_space_config() const
{
- return space_config_vector {
- std::make_pair(AS_PROGRAM, &m_program_config),
- std::make_pair(AS_DATA, &m_data_config)
- };
+ // Separate data space is optional
+ if (has_configured_map(AS_DATA))
+ {
+ return space_config_vector {
+ std::make_pair(AS_PROGRAM, &m_program_config),
+ std::make_pair(AS_DATA, &m_data_config)
+ };
+ }
+ else
+ {
+ return space_config_vector {
+ std::make_pair(AS_PROGRAM, &m_program_config)
+ };
+ }
}
/***************************************************************************
INLINE FUNCTIONS
***************************************************************************/
+uint16_t z8_device::mask_external_address(uint16_t addr)
+{
+ switch (P01M & (Z8_P01M_P0L_MODE_A8_A11 | Z8_P01M_P0H_MODE_A12_A15))
+ {
+ case 0:
+ addr = (addr & 0x00ff) | register_read(Z8_REGISTER_P0) << 8;
+ break;
+
+ case Z8_P01M_P0L_MODE_A8_A11:
+ addr = (addr & 0x0fff) | (register_read(Z8_REGISTER_P0) & 0xf0) << 8;
+ break;
+
+ case Z8_P01M_P0H_MODE_A12_A15:
+ addr = (addr & 0xf0ff) | (register_read(Z8_REGISTER_P0) & 0x0f) << 8;
+ break;
+ }
+ return addr;
+}
+
+
uint8_t z8_device::fetch()
{
- uint8_t data = m_direct->read_byte(m_pc);
+ uint16_t real_pc = (m_pc < m_rom_size) ? m_pc : mask_external_address(m_pc);
+ uint8_t data = m_direct->read_byte(real_pc);
+
+ m_pc++;
+
+ return data;
+}
+
+
+uint8_t z8_device::fetch_opcode()
+{
+ m_ppc = (m_pc < m_rom_size) ? m_pc : mask_external_address(m_pc);
+ debugger_instruction_hook(this, m_ppc);
+
+ uint8_t data = m_direct->read_byte(m_ppc);
m_pc++;
@@ -234,6 +278,16 @@ uint8_t z8_device::fetch()
}
+uint16_t z8_device::fetch_word()
+{
+ // ensure correct order of operations by using separate instructions
+ uint16_t data = fetch() << 8;
+ data |= fetch();
+
+ return data;
+}
+
+
uint8_t z8_device::register_read(uint8_t offset)
{
uint8_t data = 0xff;
@@ -447,21 +501,21 @@ void z8_device::stack_push_byte(uint8_t src)
{
if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK)
{
- /* SP <- SP - 1 */
+ // SP <- SP - 1 (predecrement)
uint8_t sp = register_read(Z8_REGISTER_SPL) - 1;
register_write(Z8_REGISTER_SPL, sp);
- /* @SP <- src */
+ // @SP <- src
register_write(sp, src);
}
else
{
- /* SP <- SP - 1 */
+ // SP <- SP - 1 (predecrement)
uint16_t sp = register_pair_read(Z8_REGISTER_SPH) - 1;
register_pair_write(Z8_REGISTER_SPH, sp);
- /* @SP <- src */
- m_data->write_byte(sp, src);
+ // @SP <- src
+ m_data->write_byte(mask_external_address(sp), src);
}
}
@@ -469,21 +523,21 @@ void z8_device::stack_push_word(uint16_t src)
{
if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK)
{
- /* SP <- SP - 2 */
+ // SP <- SP - 2 (predecrement)
uint8_t sp = register_read(Z8_REGISTER_SPL) - 2;
register_write(Z8_REGISTER_SPL, sp);
- /* @SP <- src */
+ // @SP <- src
register_pair_write(sp, src);
}
else
{
- /* SP <- SP - 2 */
+ // SP <- SP - 2 (predecrement)
uint16_t sp = register_pair_read(Z8_REGISTER_SPH) - 2;
register_pair_write(Z8_REGISTER_SPH, sp);
- /* @SP <- src */
- m_data->write_word(sp, src);
+ // @SP <- src
+ m_data->write_word(mask_external_address(sp), src);
}
}
@@ -491,21 +545,25 @@ uint8_t z8_device::stack_pop_byte()
{
if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK)
{
- /* SP <- SP + 1 */
- uint8_t sp = register_read(Z8_REGISTER_SPL) + 1;
- register_write(Z8_REGISTER_SPL, sp);
+ // @SP <- src
+ uint8_t sp = register_read(Z8_REGISTER_SPL);
+ uint8_t byte = register_read(sp);
- /* @SP <- src */
- return register_read(sp);
+ // SP <- SP + 1 (postincrement)
+ register_write(Z8_REGISTER_SPL, sp + 1);
+
+ return byte;
}
else
{
- /* SP <- SP + 1 */
- uint16_t sp = register_pair_read(Z8_REGISTER_SPH) + 1;
- register_pair_write(Z8_REGISTER_SPH, sp);
+ // @SP <- src
+ uint16_t sp = register_pair_read(Z8_REGISTER_SPH);
+ uint8_t byte = m_data->read_byte(mask_external_address(sp));
+
+ // SP <- SP + 1 (postincrement)
+ register_pair_write(Z8_REGISTER_SPH, sp + 1);
- /* @SP <- src */
- return m_data->read_byte(sp);
+ return byte;
}
}
@@ -513,21 +571,25 @@ uint16_t z8_device::stack_pop_word()
{
if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK)
{
- /* SP <- SP + 2 */
- uint8_t sp = register_read(Z8_REGISTER_SPL) + 2;
- register_write(Z8_REGISTER_SPL, sp);
+ // @SP <- src
+ uint8_t sp = register_read(Z8_REGISTER_SPL);
+ uint16_t word = register_pair_read(sp);
+
+ // SP <- SP + 2 (postincrement)
+ register_write(Z8_REGISTER_SPL, sp + 2);
- /* @SP <- src */
- return register_read(sp);
+ return word;
}
else
{
- /* SP <- SP + 2 */
- uint16_t sp = register_pair_read(Z8_REGISTER_SPH) + 2;
- register_pair_write(Z8_REGISTER_SPH, sp);
+ // @SP <- src
+ uint16_t sp = register_pair_read(Z8_REGISTER_SPH);
+ uint16_t word = m_data->read_word(mask_external_address(sp));
+
+ // SP <- SP + 2 (postincrement)
+ register_pair_write(Z8_REGISTER_SPH, sp + 2);
- /* @SP <- src */
- return m_data->read_word(sp);
+ return word;
}
}
@@ -691,7 +753,7 @@ void z8_device::device_start()
{
state_add(Z8_PC, "PC", m_pc);
state_add(STATE_GENPC, "GENPC", m_pc).noshow();
- state_add(STATE_GENPCBASE, "CURPC", m_pc).noshow();
+ state_add(STATE_GENPCBASE, "CURPC", m_ppc).noshow();
state_add(Z8_SP, "SP", m_fake_sp).callimport().callexport();
state_add(STATE_GENSP, "GENSP", m_fake_sp).callimport().callexport().noshow();
state_add(Z8_RP, "RP", m_r[Z8_REGISTER_RP]);
@@ -715,7 +777,7 @@ void z8_device::device_start()
/* find address spaces */
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
- m_data = &space(AS_DATA);
+ m_data = has_space(AS_DATA) ? &space(AS_DATA) : m_program;
/* allocate timers */
m_t0_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(z8_device::t0_tick), this));
@@ -755,17 +817,12 @@ void z8_device::execute_run()
{
do
{
- uint8_t opcode;
- int cycles;
-
- debugger_instruction_hook(this, m_pc);
-
/* TODO: sample interrupts */
m_input[3] = m_input_cb[3]();
/* fetch opcode */
- opcode = fetch();
- cycles = Z8601_OPCODE_MAP[opcode].execution_cycles;
+ uint8_t opcode = fetch_opcode();
+ int cycles = Z8601_OPCODE_MAP[opcode].execution_cycles;
/* execute instruction */
(this->*(Z8601_OPCODE_MAP[opcode].function))(opcode, &cycles);
@@ -783,10 +840,6 @@ void z8_device::device_reset()
{
m_pc = 0x000c;
- // crude hack for Z8681
- if (m_rom_size == 0)
- m_pc |= m_input_cb[0]() << 8;
-
register_write(Z8_REGISTER_TMR, 0x00);
register_write(Z8_REGISTER_PRE1, PRE1 & 0xfc);
register_write(Z8_REGISTER_PRE0, PRE0 & 0xfe);
diff --git a/src/devices/cpu/z8/z8.h b/src/devices/cpu/z8/z8.h
index e28378a4697..bc2698e5607 100644
--- a/src/devices/cpu/z8/z8.h
+++ b/src/devices/cpu/z8/z8.h
@@ -114,6 +114,7 @@ private:
/* registers */
uint16_t m_pc; /* program counter */
+ uint16_t m_ppc; /* program counter at last opcode fetch */
uint8_t m_r[256]; /* register file */
uint8_t m_input[4]; /* port input latches */
uint8_t m_output[4]; /* port output latches */
@@ -137,7 +138,10 @@ private:
TIMER_CALLBACK_MEMBER( t0_tick );
TIMER_CALLBACK_MEMBER( t1_tick );
+ inline uint16_t mask_external_address(uint16_t addr);
inline uint8_t fetch();
+ inline uint8_t fetch_opcode();
+ inline uint16_t fetch_word();
inline uint8_t register_read(uint8_t offset);
inline uint16_t register_pair_read(uint8_t offset);
inline void register_write(uint8_t offset, uint8_t data);
@@ -152,10 +156,10 @@ private:
inline void set_flag(uint8_t flag, int state);
inline void clear(uint8_t dst);
inline void load(uint8_t dst, uint8_t src);
- inline void load_from_memory(address_space *space);
- inline void load_to_memory(address_space *space);
- inline void load_from_memory_autoinc(address_space *space);
- inline void load_to_memory_autoinc(address_space *space);
+ inline void load_from_memory(address_space &space);
+ inline void load_to_memory(address_space &space);
+ inline void load_from_memory_autoinc(address_space &space);
+ inline void load_to_memory_autoinc(address_space &space);
inline void pop(uint8_t dst);
inline void push(uint8_t src);
inline void add_carry(uint8_t dst, int8_t src);
diff --git a/src/devices/cpu/z8/z8ops.hxx b/src/devices/cpu/z8/z8ops.hxx
index 48d0b226859..470df009749 100644
--- a/src/devices/cpu/z8/z8ops.hxx
+++ b/src/devices/cpu/z8/z8ops.hxx
@@ -139,31 +139,38 @@ INSTRUCTION( ld_IR2_R1 ) { mode_IR2_R1(load) }
INSTRUCTION( ld_R1_IM ) { mode_R1_IM(load) }
INSTRUCTION( ld_IR1_IM ) { mode_IR1_IM(load) }
-void z8_device::load_from_memory(address_space *space)
+void z8_device::load_from_memory(address_space &space)
{
uint8_t operands = fetch();
uint8_t dst = get_working_register(operands >> 4);
uint8_t src = get_working_register(operands & 0x0f);
uint16_t address = register_pair_read(src);
- uint8_t data = m_direct->read_byte(address);
+
+ uint8_t data;
+ if (&space == m_program && address < m_rom_size)
+ data = m_direct->read_byte(address);
+ else
+ data = space.read_byte(mask_external_address(address));
register_write(dst, data);
}
-void z8_device::load_to_memory(address_space *space)
+void z8_device::load_to_memory(address_space &space)
{
uint8_t operands = fetch();
uint8_t src = get_working_register(operands >> 4);
uint8_t dst = get_working_register(operands & 0x0f);
uint16_t address = register_pair_read(dst);
- uint8_t data = register_read(src);
+ if (&space != m_program || address >= m_rom_size)
+ address = mask_external_address(address);
- m_program->write_byte(address, data);
+ uint8_t data = register_read(src);
+ space.write_byte(address, data);
}
-void z8_device::load_from_memory_autoinc(address_space *space)
+void z8_device::load_from_memory_autoinc(address_space &space)
{
uint8_t operands = fetch();
uint8_t dst = get_working_register(operands >> 4);
@@ -171,15 +178,19 @@ void z8_device::load_from_memory_autoinc(address_space *space)
uint8_t src = get_working_register(operands & 0x0f);
uint16_t address = register_pair_read(src);
- uint8_t data = m_direct->read_byte(address);
+ uint8_t data;
+ if (&space == m_program && address < m_rom_size)
+ data = m_direct->read_byte(address);
+ else
+ data = space.read_byte(mask_external_address(address));
register_write(real_dst, data);
register_write(dst, real_dst + 1);
register_pair_write(src, address + 1);
}
-void z8_device::load_to_memory_autoinc(address_space *space)
+void z8_device::load_to_memory_autoinc(address_space &space)
{
uint8_t operands = fetch();
uint8_t src = get_working_register(operands >> 4);
@@ -189,20 +200,22 @@ void z8_device::load_to_memory_autoinc(address_space *space)
uint16_t address = register_pair_read(dst);
uint8_t data = register_read(real_src);
- m_program->write_byte(address, data);
+ if (&space != m_program || address >= m_rom_size)
+ address = mask_external_address(address);
+ space.write_byte(address, data);
register_pair_write(dst, address + 1);
register_write(src, real_src + 1);
}
-INSTRUCTION( ldc_r1_Irr2 ) { load_from_memory(m_program); }
-INSTRUCTION( ldc_r2_Irr1 ) { load_to_memory(m_program); }
-INSTRUCTION( ldci_Ir1_Irr2 ) { load_from_memory_autoinc(m_program); }
-INSTRUCTION( ldci_Ir2_Irr1 ) { load_to_memory_autoinc(m_program); }
-INSTRUCTION( lde_r1_Irr2 ) { load_from_memory(m_data); }
-INSTRUCTION( lde_r2_Irr1 ) { load_to_memory(m_data); }
-INSTRUCTION( ldei_Ir1_Irr2 ) { load_from_memory_autoinc(m_data); }
-INSTRUCTION( ldei_Ir2_Irr1 ) { load_to_memory_autoinc(m_data); }
+INSTRUCTION( ldc_r1_Irr2 ) { load_from_memory(*m_program); }
+INSTRUCTION( ldc_r2_Irr1 ) { load_to_memory(*m_program); }
+INSTRUCTION( ldci_Ir1_Irr2 ) { load_from_memory_autoinc(*m_program); }
+INSTRUCTION( ldci_Ir2_Irr1 ) { load_to_memory_autoinc(*m_program); }
+INSTRUCTION( lde_r1_Irr2 ) { load_from_memory(*m_data); }
+INSTRUCTION( lde_r2_Irr1 ) { load_to_memory(*m_data); }
+INSTRUCTION( ldei_Ir1_Irr2 ) { load_from_memory_autoinc(*m_data); }
+INSTRUCTION( ldei_Ir2_Irr1 ) { load_to_memory_autoinc(*m_data); }
void z8_device::pop(uint8_t dst)
{
@@ -490,7 +503,7 @@ void z8_device::call(uint16_t dst)
}
INSTRUCTION( call_IRR1 ) { uint16_t dst = register_pair_read(get_intermediate_register(get_register(fetch()))); call(dst); }
-INSTRUCTION( call_DA ) { uint16_t dst = (fetch() << 8) | fetch(); call(dst); }
+INSTRUCTION( call_DA ) { uint16_t dst = fetch_word(); call(dst); }
INSTRUCTION( djnz_r1_RA )
{
@@ -567,7 +580,7 @@ int z8_device::check_condition_code(int cc)
INSTRUCTION( jp_cc_DA )
{
- uint16_t dst = (fetch() << 8) | fetch();
+ uint16_t dst = fetch_word();
/* if cc is true, then PC <- dst */
if (check_condition_code(opcode >> 4))
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
index e1b7361a597..483d303bd38 100644
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
@@ -185,7 +185,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
motor_always_on(false),
dskchg_writable(false),
has_trk00_sensor(true),
- dir(0), stp(0), wtg(0), mon(0), ss(0), idx(0), wpt(0), rdy(0), dskchg(0),
+ dir(0), stp(0), wtg(0), mon(0), ss(0), ds(-1), idx(0), wpt(0), rdy(0), dskchg(0),
ready(false),
rpm(0),
floppy_ratio_1(0),
@@ -240,6 +240,11 @@ void floppy_image_device::setup_wpt_cb(wpt_cb cb)
cur_wpt_cb = cb;
}
+void floppy_image_device::setup_led_cb(led_cb cb)
+{
+ cur_led_cb = cb;
+}
+
void floppy_image_device::set_formats(const floppy_format_type *formats)
{
extension_list[0] = '\0';
@@ -314,6 +319,9 @@ void floppy_image_device::device_start()
dskchg_writable = false;
has_trk00_sensor = true;
+ // better would be an extra parameter in the MCFG macro
+ drive_index = atoi(owner()->basetag());
+
idx = 0;
/* motor off */
@@ -322,6 +330,7 @@ void floppy_image_device::device_start()
cyl = 0;
subcyl = 0;
ss = 0;
+ ds = -1;
stp = 1;
wpt = 0;
dskchg = exists() ? 1 : 0;
@@ -349,11 +358,7 @@ void floppy_image_device::device_reset()
revolution_start_time = attotime::never;
revolution_count = 0;
mon = 1;
- if(!ready) {
- ready = true;
- if(!cur_ready_cb.isnull())
- cur_ready_cb(this, ready);
- }
+ set_ready(true);
if(motor_always_on)
mon_w(0);
}
@@ -480,11 +485,9 @@ void floppy_image_device::call_unload()
if (motor_always_on) {
// When disk is removed, stop motor
mon_w(1);
- } else if(!ready) {
- ready = true;
- if(!cur_ready_cb.isnull())
- cur_ready_cb(this, ready);
}
+
+ set_ready(true);
}
image_init_result floppy_image_device::call_create(int format_type, util::option_resolution *format_options)
@@ -535,9 +538,7 @@ void floppy_image_device::mon_w(int state)
if (motor_always_on) {
// Drives with motor that is always spinning are immediately ready when a disk is loaded
// because there is no spin-up time
- ready = false;
- if(!cur_ready_cb.isnull())
- cur_ready_cb(this, ready);
+ set_ready(false);
} else {
ready_counter = 2;
}
@@ -550,11 +551,7 @@ void floppy_image_device::mon_w(int state)
commit_image();
revolution_start_time = attotime::never;
index_timer->adjust(attotime::zero);
- if(!ready) {
- ready = true;
- if(!cur_ready_cb.isnull())
- cur_ready_cb(this, ready);
- }
+ set_ready(true);
}
// Create a motor sound (loaded or empty)
@@ -602,9 +599,7 @@ void floppy_image_device::index_resync()
ready_counter--;
if(!ready_counter) {
// logerror("Drive spun up\n");
- ready = false;
- if(!cur_ready_cb.isnull())
- cur_ready_cb(this, ready);
+ set_ready(false);
}
}
if (!cur_index_pulse_cb.isnull())
@@ -617,6 +612,23 @@ bool floppy_image_device::ready_r()
return ready;
}
+void floppy_image_device::set_ready(bool state)
+{
+ if (state != ready)
+ {
+ ready = state;
+ check_led();
+ if (!cur_ready_cb.isnull())
+ cur_ready_cb(this, ready);
+ }
+}
+
+void floppy_image_device::check_led()
+{
+ if(!cur_led_cb.isnull())
+ cur_led_cb(this, (ds == drive_index) && !ready ? 1 : 0);
+}
+
double floppy_image_device::get_pos()
{
return index_timer->elapsed().as_double();
diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h
index 9f2d494fb7f..5954e72883f 100644
--- a/src/devices/imagedev/floppy.h
+++ b/src/devices/imagedev/floppy.h
@@ -76,6 +76,7 @@ public:
typedef delegate<void (floppy_image_device *, int)> index_pulse_cb;
typedef delegate<void (floppy_image_device *, int)> ready_cb;
typedef delegate<void (floppy_image_device *, int)> wpt_cb;
+ typedef delegate<void (floppy_image_device *, int)> led_cb;
// construction/destruction
virtual ~floppy_image_device();
@@ -109,12 +110,14 @@ public:
void setup_index_pulse_cb(index_pulse_cb cb);
void setup_ready_cb(ready_cb cb);
void setup_wpt_cb(wpt_cb cb);
+ void setup_led_cb(led_cb cb);
std::vector<uint32_t> &get_buffer() { return image->get_buffer(cyl, ss, subcyl); }
int get_cyl() { return cyl; }
void mon_w(int state);
bool ready_r();
+ void set_ready(bool state);
double get_pos();
bool wpt_r() { return wpt; }
@@ -131,6 +134,7 @@ public:
void ss_w(int state) { ss = state; }
void inuse_w(int state) { }
void dskchg_w(int state) { if (dskchg_writable) dskchg = state; }
+ void ds_w(int state) { ds = state; check_led(); }
void index_resync();
attotime time_next_index();
@@ -173,12 +177,15 @@ protected:
bool dskchg_writable;
bool has_trk00_sensor;
+ int drive_index;
+
/* state of input lines */
int dir; /* direction */
int stp; /* step */
int wtg; /* write gate */
int mon; /* motor on */
int ss; /* side select */
+ int ds; /* drive select */
/* state of output lines */
int idx; /* index pulse */
@@ -203,7 +210,9 @@ protected:
index_pulse_cb cur_index_pulse_cb;
ready_cb cur_ready_cb;
wpt_cb cur_wpt_cb;
+ led_cb cur_led_cb;
+ void check_led();
uint32_t find_position(attotime &base, const attotime &when);
int find_index(uint32_t position, const std::vector<uint32_t> &buf);
void write_zone(uint32_t *buf, int &cells, int &index, uint32_t spos, uint32_t epos, uint32_t mg);
diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp
index ecc3ec4b107..05f92c3d355 100644
--- a/src/devices/machine/cs4031.cpp
+++ b/src/devices/machine/cs4031.cpp
@@ -128,8 +128,15 @@ MACHINE_CONFIG_MEMBER( cs4031_device::device_add_mconfig )
MCFG_I8237_OUT_DACK_1_CB(WRITELINE(cs4031_device, dma2_dack1_w))
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(cs4031_device, dma2_dack2_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(cs4031_device, dma2_dack3_w))
- MCFG_PIC8259_ADD("intc1", WRITELINE(cs4031_device, intc1_int_w), VCC, READ8(cs4031_device, intc1_slave_ack_r))
- MCFG_PIC8259_ADD("intc2", DEVWRITELINE("intc1", pic8259_device, ir2_w), GND, NOOP)
+
+ MCFG_DEVICE_ADD("intc1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(cs4031_device, intc1_int_w))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(cs4031_device, intc1_slave_ack_r))
+
+ MCFG_DEVICE_ADD("intc2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("intc1", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("ctc", PIT8254, 0)
MCFG_PIT8253_CLK0(XTAL_14_31818MHz / 12.0)
diff --git a/src/devices/machine/eeprompar.cpp b/src/devices/machine/eeprompar.cpp
index 5e63b320add..6d11e66141f 100644
--- a/src/devices/machine/eeprompar.cpp
+++ b/src/devices/machine/eeprompar.cpp
@@ -36,11 +36,24 @@
datasheet, for example), and the /WE must be held low for the entire
write/erase duration in order to guarantee the data is written.
+ Though it is possible for the /OE line to be strobed directly upon
+ read accesses, it may also be controlled independently of /CS. For the
+ sake of convenience, the device here can also be configured to emulate
+ a small amount of external circuitry (1/2 of a LS74 flip-flop and 1
+ gate of a LS02 or LS08), typically used by Atari Games, that reasserts
+ /OE low to lock the EEPROM after each byte of data is written and upon
+ reset, with extra writes required to unlock the EEPROM in between.
+
***************************************************************************/
#include "emu.h"
#include "machine/eeprompar.h"
+//#define VERBOSE 1
+#include "logmacro.h"
+
+// set this to 1 to break Prop Cycle (28C64 page write emulation needed)
+#define EMULATE_POLLING 0
//**************************************************************************
@@ -89,8 +102,49 @@ void eeprom_parallel_base_device::device_reset()
//-------------------------------------------------
eeprom_parallel_28xx_device::eeprom_parallel_28xx_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner)
- : eeprom_parallel_base_device(mconfig, devtype, tag, owner)
+ : eeprom_parallel_base_device(mconfig, devtype, tag, owner),
+ m_lock_after_write(false),
+ m_oe(-1)
+{
+}
+
+
+//-------------------------------------------------
+// static_set_lock_after_write - configuration
+// helper to enable simulation of external
+// flip-flop hooked to lock EEPROM after writes
+//-------------------------------------------------
+
+void eeprom_parallel_28xx_device::static_set_lock_after_write(device_t &device, bool lock)
+{
+ downcast<eeprom_parallel_28xx_device &>(device).m_lock_after_write = lock;
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void eeprom_parallel_28xx_device::device_start()
+{
+ // start the base class
+ eeprom_parallel_base_device::device_start();
+
+ save_item(NAME(m_oe));
+}
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void eeprom_parallel_28xx_device::device_reset()
{
+ // reset the base class
+ eeprom_parallel_base_device::device_reset();
+
+ if (m_lock_after_write)
+ m_oe = 0;
}
@@ -100,15 +154,60 @@ eeprom_parallel_28xx_device::eeprom_parallel_28xx_device(const machine_config &m
WRITE8_MEMBER(eeprom_parallel_28xx_device::write)
{
- eeprom_base_device::write(offset, data);
+ if (m_oe == 0)
+ {
+ // Master Boy writes every byte twice, resetting a control line in between, for some reason not clear
+ if (internal_read(offset) != data)
+ LOG("%s: Write attempted while /OE active (offset = %X, data = %02X)\n", machine().describe_context(), offset, data);
+ }
+ else
+ {
+ LOG("%s: Write cycle started (offset = %X, data = %02X)\n", machine().describe_context(), offset, data);
+ eeprom_base_device::write(offset, data);
+ if (m_lock_after_write)
+ m_oe = 0;
+ }
}
READ8_MEMBER(eeprom_parallel_28xx_device::read)
{
- return eeprom_base_device::read(offset);
+ if (m_oe == 1)
+ {
+ LOG("%s: Read attempted while /OE inactive (offset = %X)\n", machine().describe_context(), offset);
+ return space.unmap();
+ }
+
+ // if a write has not completed yet, the highest bit of data written will be read back inverted when polling the offset
+ if (ready() || !EMULATE_POLLING)
+ return eeprom_base_device::read(offset);
+ else
+ {
+ LOG("%s: Data read back before write completed (offset = %X)\n", machine().describe_context(), offset);
+ return ~internal_read(offset) & 0x80;
+ }
+}
+
+
+//-------------------------------------------------
+// oe_w - direct write to /OE (true line state)
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER(eeprom_parallel_28xx_device::oe_w)
+{
+ LOG("%s: EEPROM %s for writing\n", machine().describe_context(), state ? "unlocked" : "locked");
+ m_oe = state ? 1 : 0;
}
+//-------------------------------------------------
+// unlock_write - unlock EEPROM by deasserting
+// /OE line through external flip-flop
+//-------------------------------------------------
+
+WRITE8_MEMBER(eeprom_parallel_28xx_device::unlock_write) { oe_w(1); }
+WRITE16_MEMBER(eeprom_parallel_28xx_device::unlock_write) { oe_w(1); }
+WRITE32_MEMBER(eeprom_parallel_28xx_device::unlock_write) { oe_w(1); }
+
//**************************************************************************
// DERIVED TYPES
diff --git a/src/devices/machine/eeprompar.h b/src/devices/machine/eeprompar.h
index 62a4b539e8b..2370f1c0e46 100644
--- a/src/devices/machine/eeprompar.h
+++ b/src/devices/machine/eeprompar.h
@@ -38,6 +38,9 @@
#define MCFG_EEPROM_28040_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_28040, 0)
+// true when external circuit is used to lock EEPROM after every write
+#define MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(_lock) \
+ eeprom_parallel_28xx_device::static_set_lock_after_write(*device, _lock);
//**************************************************************************
@@ -65,14 +68,33 @@ protected:
class eeprom_parallel_28xx_device : public eeprom_parallel_base_device
{
public:
- // read/write data lines - for now we cheat and ignore the control lines, assuming
- // they are handled reasonably
+ // static configuration helpers
+ static void static_set_lock_after_write(device_t &device, bool lock);
+
+ // read/write data lines
DECLARE_WRITE8_MEMBER(write);
DECLARE_READ8_MEMBER(read);
+ // control lines
+ DECLARE_WRITE_LINE_MEMBER(oe_w);
+ DECLARE_WRITE8_MEMBER(unlock_write);
+ DECLARE_WRITE16_MEMBER(unlock_write);
+ DECLARE_WRITE32_MEMBER(unlock_write);
+
protected:
// construction/destruction
eeprom_parallel_28xx_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+private:
+ // configuration state
+ bool m_lock_after_write; // lock EEPROM after writes
+
+ // runtime state
+ int m_oe; // state of OE line (-1 = synchronized with read)
};
diff --git a/src/devices/machine/genpc.cpp b/src/devices/machine/genpc.cpp
index aa8b8dbc18d..12457166cc6 100644
--- a/src/devices/machine/genpc.cpp
+++ b/src/devices/machine/genpc.cpp
@@ -426,7 +426,8 @@ MACHINE_CONFIG_MEMBER( ibm5160_mb_device::device_add_mconfig )
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(ibm5160_mb_device, pc_dack2_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(ibm5160_mb_device, pc_dack3_w))
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE(":maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(":maincpu", 0))
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(READ8(ibm5160_mb_device, pc_ppi_porta_r))
diff --git a/src/devices/machine/i80130.cpp b/src/devices/machine/i80130.cpp
index f4c24f8e191..9102a914d79 100644
--- a/src/devices/machine/i80130.cpp
+++ b/src/devices/machine/i80130.cpp
@@ -99,7 +99,8 @@ const tiny_rom_entry *i80130_device::device_rom_region() const
//-------------------------------------------------
MACHINE_CONFIG_MEMBER( i80130_device::device_add_mconfig )
- MCFG_PIC8259_ADD("pic", DEVWRITELINE(DEVICE_SELF, i80130_device, irq_w), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(i80130_device, irq_w))
MCFG_DEVICE_ADD("pit", PIT8254, 0)
MCFG_PIT8253_CLK0(0)
diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp
index 3139cefeb87..611c4fc6481 100644
--- a/src/devices/machine/i82371sb.cpp
+++ b/src/devices/machine/i82371sb.cpp
@@ -99,8 +99,14 @@ MACHINE_CONFIG_MEMBER( i82371sb_isa_device::device_add_mconfig )
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(i82371sb_isa_device, pc_dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(i82371sb_isa_device, pc_dack7_w))
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE(":maincpu", 0), VCC, READ8(i82371sb_isa_device, get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir2_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(":maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(i82371sb_isa_device, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, XTAL_12MHz)
MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(INPUTLINE(":maincpu", INPUT_LINE_RESET))
diff --git a/src/devices/machine/ins8250.cpp b/src/devices/machine/ins8250.cpp
index e70e771e7c5..0b1f68aab62 100644
--- a/src/devices/machine/ins8250.cpp
+++ b/src/devices/machine/ins8250.cpp
@@ -144,6 +144,28 @@ void pc16552_device::device_start()
#define COM_INT_PENDING_MODEM_STATUS_REGISTER 0x0008
#define COM_INT_PENDING_CHAR_TIMEOUT 0x0011
+static constexpr uint8_t INS8250_LSR_TSRE = 0x40;
+static constexpr uint8_t INS8250_LSR_THRE = 0x20;
+//static constexpr uint8_t INS8250_LSR_BI = 0x10;
+//static constexpr uint8_t INS8250_LSR_FE = 0x08;
+//static constexpr uint8_t INS8250_LSR_PE = 0x04;
+static constexpr uint8_t INS8250_LSR_OE = 0x02;
+static constexpr uint8_t INS8250_LSR_DR = 0x01;
+
+static constexpr uint8_t INS8250_MCR_DTR = 0x01;
+static constexpr uint8_t INS8250_MCR_RTS = 0x02;
+static constexpr uint8_t INS8250_MCR_OUT1 = 0x04;
+static constexpr uint8_t INS8250_MCR_OUT2 = 0x08;
+static constexpr uint8_t INS8250_MCR_LOOPBACK = 0x10;
+
+static constexpr uint8_t INS8250_LCR_BITCOUNT_MASK= 0x03;
+static constexpr uint8_t INS8250_LCR_2STOP_BITS = 0x04;
+//static constexpr uint8_t INS8250_LCR_PEN = 0x08;
+//static constexpr uint8_t INS8250_LCR_EVEN_PAR = 0x10;
+//static constexpr uint8_t INS8250_LCR_PARITY = 0x20;
+//static constexpr uint8_t INS8250_LCR_BREAK = 0x40;
+static constexpr uint8_t INS8250_LCR_DLAB = 0x80;
+
/* ints will continue to be set for as long as there are ints pending */
void ins8250_uart_device::update_interrupt()
{
@@ -210,7 +232,7 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
switch (offset)
{
case 0:
- if (m_regs.lcr & 0x80)
+ if (m_regs.lcr & INS8250_LCR_DLAB)
{
m_regs.dl = (m_regs.dl & 0xff00) | data;
set_rate(clock(), m_regs.dl*16);
@@ -218,23 +240,23 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
else
{
m_regs.thr = data;
- m_regs.lsr &= ~0x20;
+ m_regs.lsr &= ~INS8250_LSR_THRE;
if((m_device_type >= dev_type::NS16550) && (m_regs.fcr & 1))
push_tx(data);
clear_int(COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY);
- if(m_regs.lsr & 0x40)
+ if(m_regs.lsr & INS8250_LSR_TSRE)
tra_complete();
}
break;
case 1:
- if (m_regs.lcr & 0x80)
+ if (m_regs.lcr & INS8250_LCR_DLAB)
{
m_regs.dl = (m_regs.dl & 0xff) | (data << 8);
set_rate(clock(), m_regs.dl*16);
}
else
{
- if ((m_regs.lsr & 0x20) && (data & COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY))
+ if ((m_regs.lsr & INS8250_LSR_THRE) && (data & COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY))
trigger_int(COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY);
m_regs.ier = data;
update_interrupt();
@@ -247,7 +269,7 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
m_regs.lcr = data;
{
- int data_bit_count = (m_regs.lcr & 3) + 5;
+ int data_bit_count = (m_regs.lcr & INS8250_LCR_BITCOUNT_MASK) + 5;
parity_t parity;
stop_bits_t stop_bits;
@@ -274,7 +296,7 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
break;
}
- if (!(m_regs.lcr & 4))
+ if (!(m_regs.lcr & INS8250_LCR_2STOP_BITS))
stop_bits = STOP_BITS_1;
else if (data_bit_count == 5)
stop_bits = STOP_BITS_1_5;
@@ -291,7 +313,7 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
update_msr();
- if (m_regs.mcr & 0x10) /* loopback test */
+ if (m_regs.mcr & INS8250_MCR_LOOPBACK)
{
m_out_tx_cb(1);
device_serial_interface::rx_w(m_txd);
@@ -304,10 +326,10 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
{
m_out_tx_cb(m_txd);
device_serial_interface::rx_w(m_rxd);
- m_out_dtr_cb((m_regs.mcr & 1) ? 0 : 1);
- m_out_rts_cb((m_regs.mcr & 2) ? 0 : 1);
- m_out_out1_cb((m_regs.mcr & 4) ? 0 : 1);
- m_out_out2_cb((m_regs.mcr & 8) ? 0 : 1);
+ m_out_dtr_cb((m_regs.mcr & INS8250_MCR_DTR) ? 0 : 1);
+ m_out_rts_cb((m_regs.mcr & INS8250_MCR_RTS) ? 0 : 1);
+ m_out_out1_cb((m_regs.mcr & INS8250_MCR_OUT1) ? 0 : 1);
+ m_out_out2_cb((m_regs.mcr & INS8250_MCR_OUT2) ? 0 : 1);
}
}
break;
@@ -317,12 +339,12 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w )
bits 5 - 0, you could cause an interrupt if the appropriate IER bit
is set.
*/
- m_regs.lsr = (m_regs.lsr & 0x60) | (data & ~0x60);
+ m_regs.lsr = (m_regs.lsr & (INS8250_LSR_TSRE|INS8250_LSR_THRE)) | (data & ~(INS8250_LSR_TSRE|INS8250_LSR_THRE));
tmp = 0;
- tmp |= ( m_regs.lsr & 0x01 ) ? COM_INT_PENDING_RECEIVED_DATA_AVAILABLE : 0;
+ tmp |= ( m_regs.lsr & INS8250_LSR_DR ) ? COM_INT_PENDING_RECEIVED_DATA_AVAILABLE : 0;
tmp |= ( m_regs.lsr & 0x1e ) ? COM_INT_PENDING_RECEIVER_LINE_STATUS : 0;
- tmp |= ( m_regs.lsr & 0x20 ) ? COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY : 0;
+ tmp |= ( m_regs.lsr & INS8250_LSR_THRE ) ? COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY : 0;
trigger_int(tmp);
break;
@@ -350,7 +372,7 @@ READ8_MEMBER( ins8250_uart_device::ins8250_r )
switch (offset)
{
case 0:
- if (m_regs.lcr & 0x80)
+ if (m_regs.lcr & INS8250_LCR_DLAB)
data = (m_regs.dl & 0xff);
else
{
@@ -359,14 +381,14 @@ READ8_MEMBER( ins8250_uart_device::ins8250_r )
else
{
clear_int(COM_INT_PENDING_RECEIVED_DATA_AVAILABLE);
- if( m_regs.lsr & 0x01 )
- m_regs.lsr &= ~0x01;
+ if( m_regs.lsr & INS8250_LSR_DR )
+ m_regs.lsr &= ~INS8250_LSR_DR;
}
data = m_regs.rbr;
}
break;
case 1:
- if (m_regs.lcr & 0x80)
+ if (m_regs.lcr & INS8250_LCR_DLAB)
data = (m_regs.dl >> 8);
else
data = m_regs.ier & 0x0f;
@@ -416,12 +438,12 @@ void ns16550_device::rcv_complete()
if(m_rnum == 16)
{
- m_regs.lsr |= 0x02; //overrun
+ m_regs.lsr |= INS8250_LSR_OE; //overrun
trigger_int(COM_INT_PENDING_RECEIVER_LINE_STATUS);
return;
}
- m_regs.lsr |= 0x01;
+ m_regs.lsr |= INS8250_LSR_DR;
m_rfifo[m_rhead] = get_received_char();
++m_rhead &= 0x0f;
m_rnum++;
@@ -439,10 +461,10 @@ void ns16550_device::tra_complete()
{
transmit_register_setup(m_tfifo[m_ttail]);
++m_ttail &= 0x0f;
- m_regs.lsr &= ~0x40;
+ m_regs.lsr &= ~INS8250_LSR_TSRE;
if(m_ttail == m_thead)
{
- m_regs.lsr |= 0x20;
+ m_regs.lsr |= INS8250_LSR_THRE;
trigger_int(COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY);
}
}
@@ -452,15 +474,15 @@ void ns16550_device::tra_complete()
void ins8250_uart_device::rcv_complete()
{
- if(m_regs.lsr & 0x01)
+ if(m_regs.lsr & INS8250_LSR_DR)
{
- m_regs.lsr |= 0x02; //overrun
+ m_regs.lsr |= INS8250_LSR_OE; //overrun
trigger_int(COM_INT_PENDING_RECEIVER_LINE_STATUS);
receive_register_reset();
}
else
{
- m_regs.lsr |= 0x01;
+ m_regs.lsr |= INS8250_LSR_DR;
receive_register_extract();
m_regs.rbr = get_received_char();
trigger_int(COM_INT_PENDING_RECEIVED_DATA_AVAILABLE);
@@ -469,21 +491,21 @@ void ins8250_uart_device::rcv_complete()
void ins8250_uart_device::tra_complete()
{
- if(!(m_regs.lsr & 0x20))
+ if(!(m_regs.lsr & INS8250_LSR_THRE))
{
transmit_register_setup(m_regs.thr);
- m_regs.lsr &= ~0x40;
- m_regs.lsr |= 0x20;
+ m_regs.lsr &= ~INS8250_LSR_TSRE;
+ m_regs.lsr |= INS8250_LSR_THRE;
trigger_int(COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY);
}
else
- m_regs.lsr |= 0x40;
+ m_regs.lsr |= INS8250_LSR_TSRE;
}
void ins8250_uart_device::tra_callback()
{
m_txd = transmit_register_get_data_bit();
- if (m_regs.mcr & 0x10)
+ if (m_regs.mcr & INS8250_MCR_LOOPBACK)
{
device_serial_interface::rx_w(m_txd);
}
@@ -498,9 +520,10 @@ void ins8250_uart_device::update_msr()
uint8_t data;
int change;
- if (m_regs.mcr & 0x10)
+ if (m_regs.mcr & INS8250_MCR_LOOPBACK)
{
- data = (((m_regs.mcr & 0x0c) << 4) | ((m_regs.mcr & 0x01) << 5) | ((m_regs.mcr & 0x02) << 3));
+ data = ((m_regs.mcr & (INS8250_MCR_OUT1|INS8250_MCR_OUT2) << 4) | \
+ ((m_regs.mcr & INS8250_MCR_DTR) << 5) | ((m_regs.mcr & INS8250_MCR_RTS) << 3));
change = (m_regs.msr ^ data) >> 4;
if(!(m_regs.msr & 0x40) && (data & 0x40))
change &= ~4;
@@ -545,7 +568,7 @@ WRITE_LINE_MEMBER(ins8250_uart_device::rx_w)
{
m_rxd = state;
- if (!(m_regs.mcr & 0x10))
+ if (!(m_regs.mcr & INS8250_MCR_LOOPBACK))
device_serial_interface::rx_w(m_rxd);
}
@@ -586,7 +609,7 @@ void ins8250_uart_device::device_reset()
m_regs.iir = 1;
m_regs.lcr = 0;
m_regs.mcr = 0;
- m_regs.lsr = (1<<5) | (1<<6);
+ m_regs.lsr = INS8250_LSR_THRE | INS8250_LSR_TSRE;
update_msr();
m_regs.msr &= 0xf0;
m_int_pending = 0;
@@ -661,7 +684,7 @@ uint8_t ns16550_device::pop_rx()
else
{
m_timeout->adjust(attotime::never);
- m_regs.lsr &= ~1;
+ m_regs.lsr &= ~INS8250_LSR_DR;
}
return data;
@@ -689,7 +712,7 @@ void ns16550_device::set_fcr(uint8_t data)
{
memset(&m_tfifo, '\0', sizeof(m_tfifo));
m_thead = m_ttail = 0;
- m_regs.lsr |= 0x20;
+ m_regs.lsr |= INS8250_LSR_THRE;
trigger_int(COM_INT_PENDING_TRANSMITTER_HOLDING_REGISTER_EMPTY);
}
m_rintlvl = bytes_per_int[(data>>6)&3];
diff --git a/src/devices/machine/pic8259.cpp b/src/devices/machine/pic8259.cpp
index 4dea41992c2..e985518d47c 100644
--- a/src/devices/machine/pic8259.cpp
+++ b/src/devices/machine/pic8259.cpp
@@ -340,7 +340,7 @@ void pic8259_device::device_start()
{
// resolve callbacks
m_out_int_func.resolve_safe();
- m_sp_en_func.resolve_safe(1);
+ m_in_sp_func.resolve_safe(1);
m_read_slave_ack_func.resolve_safe(0);
// Register save state items
@@ -395,7 +395,7 @@ void pic8259_device::device_reset()
m_vector_addr_low = 0;
m_vector_addr_high = 0;
- m_master = m_sp_en_func();
+ m_master = m_in_sp_func();
}
DEFINE_DEVICE_TYPE(PIC8259, pic8259_device, "pic8259", "Intel 8259 PIC")
@@ -403,7 +403,7 @@ DEFINE_DEVICE_TYPE(PIC8259, pic8259_device, "pic8259", "Intel 8259 PIC")
pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, PIC8259, tag, owner, clock)
, m_out_int_func(*this)
- , m_sp_en_func(*this)
+ , m_in_sp_func(*this)
, m_read_slave_ack_func(*this)
, m_irr(0)
, m_irq_lines(0)
diff --git a/src/devices/machine/pic8259.h b/src/devices/machine/pic8259.h
index b788fead80e..af46b03569d 100644
--- a/src/devices/machine/pic8259.h
+++ b/src/devices/machine/pic8259.h
@@ -32,11 +32,17 @@
DEVICE CONFIGURATION MACROS
***************************************************************************/
-#define MCFG_PIC8259_ADD(_tag, _out_int, _sp_en, _read_slave_ack) \
- MCFG_DEVICE_ADD(_tag, PIC8259, 0) \
- devcb = &pic8259_device::static_set_out_int_callback( *device, DEVCB_##_out_int ); \
- devcb = &pic8259_device::static_set_sp_en_callback( *device, DEVCB_##_sp_en ); \
- devcb = &pic8259_device::static_set_read_slave_ack_callback( *device, DEVCB_##_read_slave_ack );
+// Interrupt request output to CPU or master 8259 (active high)
+#define MCFG_PIC8259_OUT_INT_CB(_devcb) \
+ devcb = &pic8259_device::static_set_out_int_callback(*device, DEVCB_##_devcb);
+
+// Slave program select (VCC = master; GND = slave; pin becomes EN output in buffered mode)
+#define MCFG_PIC8259_IN_SP_CB(_devcb) \
+ devcb = &pic8259_device::static_set_in_sp_callback(*device, DEVCB_##_devcb);
+
+// Cascaded interrupt acknowledge request for slave 8259 to place vector on data bus
+#define MCFG_PIC8259_CASCADE_ACK_CB(_devcb) \
+ devcb = &pic8259_device::static_set_read_slave_ack_callback(*device, DEVCB_##_devcb);
class pic8259_device : public device_t
@@ -45,7 +51,7 @@ public:
pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> static devcb_base &static_set_out_int_callback(device_t &device, Object &&cb) { return downcast<pic8259_device &>(device).m_out_int_func.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &static_set_sp_en_callback(device_t &device, Object &&cb) { return downcast<pic8259_device &>(device).m_sp_en_func.set_callback(std::forward<Object>(cb)); }
+ template <class Object> static devcb_base &static_set_in_sp_callback(device_t &device, Object &&cb) { return downcast<pic8259_device &>(device).m_in_sp_func.set_callback(std::forward<Object>(cb)); }
template <class Object> static devcb_base &static_set_read_slave_ack_callback(device_t &device, Object &&cb) { return downcast<pic8259_device &>(device).m_read_slave_ack_func.set_callback(std::forward<Object>(cb)); }
DECLARE_READ8_MEMBER( read );
@@ -86,7 +92,7 @@ private:
};
devcb_write_line m_out_int_func;
- devcb_read_line m_sp_en_func;
+ devcb_read_line m_in_sp_func;
devcb_read8 m_read_slave_ack_func;
state_t m_state;
diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp
index 56505d1a9b1..572bc5dd28b 100644
--- a/src/devices/machine/sis85c496.cpp
+++ b/src/devices/machine/sis85c496.cpp
@@ -87,8 +87,14 @@ MACHINE_CONFIG_MEMBER(sis85c496_host_device::device_add_mconfig)
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(sis85c496_host_device, pc_dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(sis85c496_host_device, pc_dack7_w))
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE(":maincpu", 0), VCC, READ8(sis85c496_host_device, get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir2_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(":maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(sis85c496_host_device, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("keybc", AT_KEYBOARD_CONTROLLER, XTAL_12MHz)
MCFG_AT_KEYBOARD_CONTROLLER_SYSTEM_RESET_CB(INPUTLINE(":maincpu", INPUT_LINE_RESET))
diff --git a/src/devices/machine/smc91c9x.cpp b/src/devices/machine/smc91c9x.cpp
index 201c8c6fc22..ee5214d2323 100644
--- a/src/devices/machine/smc91c9x.cpp
+++ b/src/devices/machine/smc91c9x.cpp
@@ -387,7 +387,8 @@ void smc91c9x_device::process_command(uint16_t data)
logerror(" RESET TX FIFOS\n");
break;
}
- m_reg[EREG_MMU_COMMAND] &= ~0x0001;
+ // Set Busy (clear on next read)
+ m_reg[EREG_MMU_COMMAND] |= 0x0001;
}
@@ -412,6 +413,11 @@ READ16_MEMBER( smc91c9x_device::read )
switch (offset)
{
+ case EREG_MMU_COMMAND:
+ // Clear busy
+ m_reg[EREG_MMU_COMMAND] &= ~0x0001;
+ break;
+
case EREG_PNR_ARR:
if (ACCESSING_BITS_8_15)
{
@@ -556,6 +562,9 @@ WRITE16_MEMBER( smc91c9x_device::write )
case EREG_INTERRUPT:
m_reg[EREG_INTERRUPT] &= ~(data & 0x56);
+ // Need to clear tx int here for vegas cartfury
+ if (m_reg[EREG_FIFO_PORTS] & 0x0080)
+ m_reg[EREG_INTERRUPT] &= ~EINT_TX;
update_ethernet_irq();
break;
}
diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp
index da34165100d..39cc69d8c9b 100644
--- a/src/devices/machine/upd765.cpp
+++ b/src/devices/machine/upd765.cpp
@@ -11,6 +11,7 @@ DEFINE_DEVICE_TYPE(UPD765A, upd765a_device, "upd765a", "NEC
DEFINE_DEVICE_TYPE(UPD765B, upd765b_device, "upd765b", "NEC uPD765B FDC")
DEFINE_DEVICE_TYPE(I8272A, i8272a_device, "i8272a", "Intel 8272A FDC")
DEFINE_DEVICE_TYPE(UPD72065, upd72065_device, "upd72065", "NEC uPD72065 FDC")
+DEFINE_DEVICE_TYPE(I82072, i82072_device, "i82072", "Intel 82072 FDC")
DEFINE_DEVICE_TYPE(SMC37C78, smc37c78_device, "smc37c78", "SMC FDC73C78 FDC")
DEFINE_DEVICE_TYPE(N82077AA, n82077aa_device, "n82077aa", "Intel N82077AA FDC")
DEFINE_DEVICE_TYPE(PC_FDC_SUPERIO, pc_fdc_superio_device, "pc_fdc_superio", "PC FDC SUPERIO")
@@ -40,6 +41,11 @@ DEVICE_ADDRESS_MAP_START(map, 8, upd72065_device)
AM_RANGE(0x1, 0x1) AM_READWRITE(fifo_r, fifo_w)
ADDRESS_MAP_END
+DEVICE_ADDRESS_MAP_START(map, 8, i82072_device)
+ AM_RANGE(0x0, 0x0) AM_READWRITE(msr_r, dsr_w)
+ AM_RANGE(0x1, 0x1) AM_READWRITE(fifo_r, fifo_w)
+ADDRESS_MAP_END
+
DEVICE_ADDRESS_MAP_START(map, 8, smc37c78_device)
AM_RANGE(0x2, 0x2) AM_READWRITE(dor_r, dor_w)
AM_RANGE(0x3, 0x3) AM_READWRITE(tdr_r, tdr_w)
@@ -261,6 +267,16 @@ bool upd765_family_device::get_ready(int fid)
return !external_ready;
}
+void upd765_family_device::set_ds(int state)
+{
+ for(int i = 0; i < 4; i++)
+ {
+ floppy_info &fi = flopi[i];
+ if (fi.dev)
+ fi.dev->ds_w(state);
+ }
+}
+
void upd765_family_device::set_floppy(floppy_image_device *flop)
{
for(auto & elem : flopi) {
@@ -1518,6 +1534,7 @@ void upd765_family_device::read_data_start(floppy_info &fi)
st1 = ST1_MA;
st2 = 0x00;
hdl_cb(1);
+ set_ds(command[1] & 3);
fi.ready = get_ready(command[1] & 3);
if(!fi.ready)
@@ -1563,6 +1580,7 @@ void upd765_family_device::scan_start(floppy_info &fi)
st2 = 0x00;
scan_done = false;
hdl_cb(1);
+ set_ds(command[1] & 3);
fi.ready = get_ready(command[1] & 3);
if(!fi.ready)
@@ -1752,6 +1770,7 @@ void upd765_family_device::write_data_start(floppy_info &fi)
st1 = ST1_MA;
st2 = 0x00;
hdl_cb(1);
+ set_ds(command[1] & 3);
fi.ready = get_ready(command[1] & 3);
if(!fi.ready)
@@ -1873,6 +1892,7 @@ void upd765_family_device::read_track_start(floppy_info &fi)
st1 = ST1_MA;
st2 = 0x00;
hdl_cb(1);
+ set_ds(command[1] & 3);
fi.ready = get_ready(command[1] & 3);
if(!fi.ready)
@@ -2034,6 +2054,7 @@ void upd765_family_device::format_track_start(floppy_info &fi)
command[1], command[2], command[3], command[4], command[5]);
hdl_cb(1);
+ set_ds(command[1] & 3);
fi.ready = get_ready(command[1] & 3);
if(!fi.ready)
@@ -2111,6 +2132,7 @@ void upd765_family_device::read_id_start(floppy_info &fi)
cur_live.idbuf[i] = 0x00;
hdl_cb(1);
+ set_ds(command[1] & 3);
fi.ready = get_ready(command[1] & 3);
if(!fi.ready)
@@ -2446,6 +2468,11 @@ upd72065_device::upd72065_device(const machine_config &mconfig, const char *tag,
dor_reset = 0x0c;
}
+i82072_device::i82072_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, I82072, tag, owner, clock)
+{
+ dor_reset = 0x0c;
+}
+
smc37c78_device::smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, SMC37C78, tag, owner, clock)
{
ready_connected = false;
diff --git a/src/devices/machine/upd765.h b/src/devices/machine/upd765.h
index 52b545c2be7..067551dbe8f 100644
--- a/src/devices/machine/upd765.h
+++ b/src/devices/machine/upd765.h
@@ -33,6 +33,10 @@
downcast<upd72065_device *>(device)->set_ready_line_connected(_ready); \
downcast<upd72065_device *>(device)->set_select_lines_connected(_select);
+#define MCFG_I82072_ADD(_tag, _ready) \
+ MCFG_DEVICE_ADD(_tag, I82072, 0) \
+ downcast<i82072_device *>(device)->set_ready_line_connected(_ready);
+
#define MCFG_SMC37C78_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SMC37C78, 0)
@@ -369,6 +373,7 @@ protected:
uint8_t fifo_pop(bool internal);
void set_drq(bool state);
bool get_ready(int fid);
+ void set_ds(int state);
void enable_transfer();
void disable_transfer();
@@ -441,6 +446,13 @@ public:
virtual DECLARE_ADDRESS_MAP(map, 8) override;
};
+class i82072_device : public upd765_family_device {
+public:
+ i82072_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ virtual DECLARE_ADDRESS_MAP(map, 8) override;
+};
+
class smc37c78_device : public upd765_family_device {
public:
smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -526,6 +538,7 @@ DECLARE_DEVICE_TYPE(UPD765A, upd765a_device)
DECLARE_DEVICE_TYPE(UPD765B, upd765b_device)
DECLARE_DEVICE_TYPE(I8272A, i8272a_device)
DECLARE_DEVICE_TYPE(UPD72065, upd72065_device)
+DECLARE_DEVICE_TYPE(I82072, i82072_device)
DECLARE_DEVICE_TYPE(SMC37C78, smc37c78_device)
DECLARE_DEVICE_TYPE(N82077AA, n82077aa_device)
DECLARE_DEVICE_TYPE(PC_FDC_SUPERIO, pc_fdc_superio_device)
diff --git a/src/devices/machine/vrc5074.cpp b/src/devices/machine/vrc5074.cpp
index ade82af624e..ca4b1540df7 100644
--- a/src/devices/machine/vrc5074.cpp
+++ b/src/devices/machine/vrc5074.cpp
@@ -241,6 +241,7 @@ void vrc5074_device::device_start()
save_item(NAME(m_nile_irq_state));
save_item(NAME(m_sdram_addr));
save_item(NAME(m_uart_irq));
+ save_item(NAME(m_timer_period));
machine().save().register_postload(save_prepost_delegate(FUNC(vrc5074_device::postload), this));
}
@@ -740,21 +741,12 @@ void vrc5074_device::update_nile_irqs()
TIMER_CALLBACK_MEMBER(vrc5074_device::nile_timer_callback)
{
int which = param;
- uint32_t *regs = &m_cpu_regs[NREG_T0CTRL + which * 4];
+
if (LOG_TIMERS) logerror("timer %d fired\n", which);
/* adjust the timer to fire again */
{
- uint32_t scale = regs[0];
- if (regs[1] & 2) {
- uint32_t scaleSrc = (regs[1] >> 2) & 0x3;
- uint32_t *scaleReg = &m_cpu_regs[NREG_T0CTRL + scaleSrc * 4];
- scale *= scaleReg[0];
- //logerror("Unexpected value: timer %d is prescaled\n", which);
- logerror("Timer Scaling value: timer %d is prescaled from %08X to %08X\n", which, regs[0], scale);
- }
- if (scale != 0)
- m_timer[which]->adjust(TIMER_PERIOD * scale, which);
+ m_timer[which]->adjust(attotime::from_double(m_timer_period[which]), which);
}
/* trigger the interrupt */
@@ -837,15 +829,8 @@ READ32_MEMBER(vrc5074_device::cpu_reg_r)
which = (offset - NREG_T0CNTR) / 4;
if (m_cpu_regs[offset - 1] & 1)
{
- //if (m_cpu_regs[offset - 1] & 2)
- // logerror("Unexpected value: timer %d is prescaled\n", which);
- uint32_t scale = 1;
- if (m_cpu_regs[offset - 1] & 2) {
- uint32_t scaleSrc = (m_cpu_regs[offset - 1] >> 2) & 0x3;
- scale = m_cpu_regs[NREG_T0CTRL + scaleSrc * 4];
- logerror("Timer value: timer %d is prescaled by \n", which, scale);
- }
- result = m_cpu_regs[offset + 1] = m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK / scale;
+ // Should check for cascaded timer
+ result = m_cpu_regs[offset] = m_timer[which]->remaining().as_double() * SYSTEM_CLOCK;
}
if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", m_cpu_space->device().safe_pc(), which, offset * 4, result);
@@ -961,37 +946,26 @@ WRITE32_MEMBER(vrc5074_device::cpu_reg_w)
case NREG_T2CTRL + 1: /* general purpose timer control (control bits) */
case NREG_T3CTRL + 1: /* watchdog timer control (control bits) */
which = (offset - NREG_T0CTRL) / 4;
- if (LOG_NILE) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", m_cpu_space->device().safe_pc(), which, offset * 4, data, mem_mask);
+ if (LOG_NILE | LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", m_cpu_space->device().safe_pc(), which, offset * 4, data, mem_mask);
logit = 0;
-
+ m_timer_period[which] = (uint64_t(m_cpu_regs[NREG_T0CTRL + which * 4]) + 1) * attotime::from_hz(SYSTEM_CLOCK).as_double();
+ if (m_cpu_regs[offset] & 2) {
+ // Cascade timer
+ uint32_t scaleSrc = (m_cpu_regs[offset] >> 2) & 0x3;
+ m_timer_period[which] += (uint64_t(m_cpu_regs[NREG_T0CTRL + scaleSrc * 4]) + 1) * attotime::from_hz(SYSTEM_CLOCK).as_double();
+ logerror("Timer scale: timer %d is scaled by %08X\n", which, m_cpu_regs[NREG_T0CTRL + which * 4]);
+ }
/* timer just enabled? */
if (!(olddata & 1) && (m_cpu_regs[offset] & 1))
{
- uint32_t scale = m_cpu_regs[offset - 1];
- //if (m_cpu_regs[offset] & 2)
- // logerror("Unexpected value: timer %d is prescaled\n", which);
- if (m_cpu_regs[offset] & 2) {
- uint32_t scaleSrc = (m_cpu_regs[offset] >> 2) & 0x3;
- scale *= m_cpu_regs[NREG_T0CTRL + scaleSrc * 4];
- logerror("Timer scale: timer %d is scaled by %08X\n", which, m_cpu_regs[NREG_T0CTRL + which * 4]);
- }
- if (scale != 0)
- m_timer[which]->adjust(TIMER_PERIOD * scale, which);
- if (LOG_TIMERS) logerror("Starting timer %d at a rate of %f Hz scale = %08X\n", which, ATTOSECONDS_TO_HZ((TIMER_PERIOD * (m_cpu_regs[offset + 1] + 1)).attoseconds()), scale);
+ m_timer[which]->adjust(attotime::from_double(m_timer_period[which]), which);
+ if (LOG_TIMERS) logerror("Starting timer %d at a rate of %f Hz\n", which, ATTOSECONDS_TO_HZ(attotime::from_double(m_timer_period[which]).as_attoseconds()));
}
/* timer disabled? */
else if ((olddata & 1) && !(m_cpu_regs[offset] & 1))
{
- //if (m_cpu_regs[offset] & 2)
- // logerror("Unexpected value: timer %d is prescaled\n", which);
- uint32_t scale = 1;
- if (m_cpu_regs[offset] & 2) {
- uint32_t scaleSrc = (m_cpu_regs[offset] >> 2) & 0x3;
- scale = m_cpu_regs[NREG_T0CTRL + scaleSrc * 4];
- logerror("Timer scale: timer %d is scaled by %08X\n", which, scale);
- }
- m_cpu_regs[offset + 1] = m_timer[which]->remaining().as_double() * SYSTEM_CLOCK / scale;
+ m_cpu_regs[offset + 1] = m_timer[which]->remaining().as_double() * SYSTEM_CLOCK;
m_timer[which]->adjust(attotime::never, which);
}
break;
@@ -1006,15 +980,7 @@ WRITE32_MEMBER(vrc5074_device::cpu_reg_w)
if (m_cpu_regs[offset - 1] & 1)
{
- //if (m_cpu_regs[offset - 1] & 2)
- // logerror("Unexpected value: timer %d is prescaled\n", which);
- uint32_t scale = 1;
- if (m_cpu_regs[offset - 1] & 2) {
- uint32_t scaleSrc = (m_cpu_regs[offset - 1] >> 2) & 0x3;
- scale = m_cpu_regs[NREG_T0CTRL + scaleSrc * 4];
- logerror("Timer scale: timer %d is scaled by %08X\n", which, scale);
- }
- m_timer[which]->adjust(TIMER_PERIOD * m_cpu_regs[offset] * scale, which);
+ m_timer[which]->adjust(attotime::from_hz(SYSTEM_CLOCK) * m_cpu_regs[offset], which);
}
break;
}
diff --git a/src/devices/machine/vrc5074.h b/src/devices/machine/vrc5074.h
index a1ef79a630a..c49902d9491 100644
--- a/src/devices/machine/vrc5074.h
+++ b/src/devices/machine/vrc5074.h
@@ -24,8 +24,6 @@
class vrc5074_device : public pci_host_device {
public:
- static constexpr unsigned SYSTEM_CLOCK = 100000000;
-
vrc5074_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
required_device<ns16550_device> m_uart;
@@ -79,6 +77,9 @@ protected:
virtual void device_reset() override;
private:
+ // This value is not verified to be correct
+ static constexpr unsigned SYSTEM_CLOCK = 100000000;
+
enum
{
AS_PCI_MEM = 1,
@@ -99,6 +100,7 @@ private:
emu_timer* m_dma_timer;
TIMER_CALLBACK_MEMBER(dma_transfer);
emu_timer *m_timer[4];
+ double m_timer_period[4];
TIMER_CALLBACK_MEMBER(nile_timer_callback);
required_memory_region m_romRegion;
diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp
index fba48197a59..ee2ed5bb195 100644
--- a/src/devices/machine/wd7600.cpp
+++ b/src/devices/machine/wd7600.cpp
@@ -53,8 +53,15 @@ MACHINE_CONFIG_MEMBER( wd7600_device::device_add_mconfig )
MCFG_I8237_OUT_DACK_1_CB(WRITELINE(wd7600_device, dma2_dack1_w))
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(wd7600_device, dma2_dack2_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(wd7600_device, dma2_dack3_w))
- MCFG_PIC8259_ADD("intc1", WRITELINE(wd7600_device, pic1_int_w), VCC, READ8(wd7600_device, pic1_slave_ack_r))
- MCFG_PIC8259_ADD("intc2", DEVWRITELINE("intc1", pic8259_device, ir2_w), GND, NOOP)
+
+ MCFG_DEVICE_ADD("intc1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(wd7600_device, pic1_int_w))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(wd7600_device, pic1_slave_ack_r))
+
+ MCFG_DEVICE_ADD("intc2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("intc1", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("ctc", PIT8254, 0)
MCFG_PIT8253_CLK0(XTAL_14_31818MHz / 12.0)
diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp
index f5456163398..10c29f88eed 100644
--- a/src/devices/sound/ay8910.cpp
+++ b/src/devices/sound/ay8910.cpp
@@ -494,10 +494,12 @@ Yamaha YM2203: 2 I/O ports
The first 16 registers are the same(?) as the YM2149.
YM2203: Unused bits in registers have unknown behavior.
I/O current source/sink behavior is unknown.
- YM2203 die is unknown; two die revisions, 'F' and 'H', have been observed
- from Yamaha chip/datecode silkscreen surface markings. It is unknown
- what behavioral differences exist between these two revisions.
- The 'F' revision only appears during the first year of production.
+ YM2203 die is unknown; three die revisions, 'D', 'F' and 'H', have been
+ observed from Yamaha chip/datecode silkscreen surface markings. It is
+ unknown what behavioral differences exist between these revisions.
+ The 'D' revision only appears during the first year of production, 1984, on chips marked 'YM2203B'
+ The 'F' revision exists from 1984?-1991, chips are marked 'YM2203C'
+ The 'H' revision exists from 1991 onward, chips are marked 'YM2203C'
Yamaha YM3439: limited info: CMOS version of YM2149?
Yamaha YMZ284: limited info: 0 I/O port, different clock divider
The chip selection logic is again simplified here: pin 1 is /WR, pin 2 is
diff --git a/src/devices/sound/saa1099.cpp b/src/devices/sound/saa1099.cpp
index 3c9b334b46f..c8c6c527221 100644
--- a/src/devices/sound/saa1099.cpp
+++ b/src/devices/sound/saa1099.cpp
@@ -350,7 +350,7 @@ WRITE8_MEMBER( saa1099_device::control_w )
if ((data & 0xff) > 0x1c)
{
/* Error! */
- logerror("%s: (SAA1099 '%s') Unknown register selected\n", machine().describe_context(), tag());
+ logerror("%s: Unknown register selected\n", machine().describe_context());
}
m_selected_reg = data & 0x1f;
@@ -435,7 +435,7 @@ WRITE8_MEMBER( saa1099_device::data_w )
int i;
/* Synch & Reset generators */
- logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n", machine().describe_context(), tag());
+ logerror("%s: -reg 0x1c- Chip reset\n", machine().describe_context());
for (i = 0; i < 6; i++)
{
m_channels[i].level = 0;
@@ -445,7 +445,7 @@ WRITE8_MEMBER( saa1099_device::data_w )
break;
default: /* Error! */
if (data != 0)
- logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n", machine().describe_context(), tag(), reg, data);
+ logerror("%s: Unknown operation (reg:%02x, data:%02x)\n", machine().describe_context(), reg, data);
}
}
diff --git a/src/devices/video/mb_vcu.cpp b/src/devices/video/mb_vcu.cpp
index 46087f9997f..7a5371ec761 100644
--- a/src/devices/video/mb_vcu.cpp
+++ b/src/devices/video/mb_vcu.cpp
@@ -283,8 +283,10 @@ READ8_MEMBER( mb_vcu_device::load_gfx )
uint8_t pen = 0;
uint8_t cur_layer;
+// printf("%02x %02x\n",m_mode >> 2,m_mode & 3);
+
// cur_layer = (m_mode & 0x3);
- cur_layer = 0;
+ cur_layer = (m_mode & 2) >> 1;
switch(m_mode >> 2)
{
@@ -375,7 +377,10 @@ READ8_MEMBER( mb_vcu_device::load_gfx )
return 0; // open bus?
}
+
/*
+Read-Modify-Write operation, not fully understood
+
---0 -111 (0x07) write to i/o?
---0 -011 (0x03) read to i/o?
---1 -011 (0x13) read to vram?
@@ -386,7 +391,8 @@ READ8_MEMBER( mb_vcu_device::load_set_clr )
int dstx,dsty;
// uint8_t dot;
int bits = 0;
- if(m_mode == 0x13 || m_mode == 0x03)
+ #if 0
+ if(m_mode == 0x13) //|| m_mode == 0x03)
{
printf("[0] %02x ",m_ram[m_param_offset_latch]);
printf("X: %04x ",m_xpos);
@@ -399,11 +405,14 @@ READ8_MEMBER( mb_vcu_device::load_set_clr )
printf("VB:%02x ",m_vbank);
printf("\n");
}
-
+ #endif
+
switch(m_mode)
{
case 0x13:
case 0x03:
+ {
+
for (yi = 0; yi < m_pix_ysize; yi++)
{
for (xi = 0; xi < m_pix_xsize; xi++)
@@ -413,6 +422,11 @@ READ8_MEMBER( mb_vcu_device::load_set_clr )
if(dstx < 256 && dsty < 256)
{
+ if(m_mode == 0x03)
+ write_byte(dstx|dsty<<8|0<<16|(m_vbank)<<18, 0xf);
+// else
+// write_byte(dstx|dsty<<8|1<<16|(m_vbank)<<18, 0xf);
+
#if 0
dot = m_cpu->space(AS_PROGRAM).read_byte(((offset + (bits >> 3)) & 0x1fff) + 0x4000) >> (6-(bits & 7));
dot&= 3;
@@ -441,6 +455,7 @@ READ8_MEMBER( mb_vcu_device::load_set_clr )
}
}
break;
+ }
case 0x07:
for(int i=0;i<m_pix_xsize;i++)
@@ -500,13 +515,13 @@ uint32_t mb_vcu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
int x,y;
uint8_t dot;
- bitmap.fill(0x100,cliprect);
+ bitmap.fill(m_palette->pen(0x100),cliprect);
for(y=0;y<256;y++)
{
for(x=0;x<256;x++)
{
- dot = read_byte((x >> 0)|(y<<8)|0<<16|(m_vbank ^ 1)<<18);
+ dot = read_byte((x >> 0)|(y<<8)|1<<16|(m_vbank ^ 1)<<18);
//if(dot != 0xf)
{
dot|= m_vregs[1] << 4;
@@ -516,62 +531,32 @@ uint32_t mb_vcu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
}
}
- #if 0
for(y=0;y<256;y++)
{
for(x=0;x<256;x++)
{
- dot = read_byte((x >> 0)|(y<<8)|3<<16);
-
- if(dot != 0xf)
- {
- dot|= m_vregs[1] << 4;
-
- bitmap.pix32(y,x) = machine().pens[dot];
- }
- }
- }
-
- for(y=0;y<256;y++)
- {
- for(x=0;x<256;x++)
- {
- dot = read_byte((x >> 0)|(y<<8)|0<<16);
-
- if(dot != 0xf)
- {
- dot|= m_vregs[1] << 4;
-
- bitmap.pix32(y,x) = machine().pens[dot];
- }
- }
- }
-
- for(y=0;y<256;y++)
- {
- for(x=0;x<256;x++)
- {
- dot = read_byte((x >> 0)|(y<<8)|1<<16);
+ dot = read_byte((x >> 0)|(y<<8)|0<<16|(m_vbank ^ 1)<<18);
if(dot != 0xf)
{
dot|= m_vregs[1] << 4;
- bitmap.pix32(y,x) = machine().pens[dot];
+ bitmap.pix32(y,x) = m_palette->pen(dot);
}
}
}
- #endif
return 0;
}
void mb_vcu_device::screen_eof(void)
{
- //for(int i=0;i<0x10000;i++)
+ #if 0
+ for(int i=0;i<0x10000;i++)
{
- //write_byte(i|0x00000|m_vbank<<18,0x0f);
+ write_byte(i|0x00000|m_vbank<<18,0x0f);
//write_byte(i|0x10000|m_vbank<<18,0x0f);
//write_byte(i|0x30000|m_vbank<<18,0x0f);
}
+ #endif
}
diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h
index 734100e43a5..9acdab33044 100644
--- a/src/devices/video/vooddefs.h
+++ b/src/devices/video/vooddefs.h
@@ -2651,7 +2651,7 @@ void voodoo_device::raster_##name(void *destbase, int32_t y, const poly_extent *
/* determine the screen Y */ \
scry = y; \
if (FBZMODE_Y_ORIGIN(FBZMODE)) \
- scry = (vd->fbi.yorigin - y) & 0x3ff; \
+ scry = (vd->fbi.yorigin - y); \
\
/* compute dithering */ \
COMPUTE_DITHER_POINTERS(FBZMODE, y, FOGMODE); \
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index 43805172613..cc25e658d1d 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -2860,6 +2860,7 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat
break;
case trexInit1:
+ vd->logerror("VOODOO.%d.REG:%s(%d) write = %08X\n", vd->index, (regnum < 0x384 / 4) ? vd->regnames[regnum] : "oob", chips, data);
/* send tmu config data to the frame buffer */
vd->send_config = (TREXINIT_SEND_TMU_CONFIG(data) > 0);
goto default_case;
@@ -3189,7 +3190,7 @@ int32_t voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, uint32_t data, ui
/* determine the screen Y */
scry = y;
if (LFBMODE_Y_ORIGIN(vd->reg[lfbMode].u))
- scry = (vd->fbi.yorigin - y) & 0x3ff;
+ scry = (vd->fbi.yorigin - y);
/* advance pointers to the proper row */
bufoffs = scry * vd->fbi.rowpixels + x;
@@ -3247,7 +3248,7 @@ int32_t voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, uint32_t data, ui
/* determine the screen Y */
scry = y;
if (FBZMODE_Y_ORIGIN(vd->reg[fbzMode].u))
- scry = (vd->fbi.yorigin - y) & 0x3ff;
+ scry = (vd->fbi.yorigin - y);
/* advance pointers to the proper row */
dest += scry * vd->fbi.rowpixels;
@@ -4055,7 +4056,7 @@ static uint32_t lfb_r(voodoo_device *vd, offs_t offset, bool lfb_3d)
/* determine the screen Y */
scry = y;
if (LFBMODE_Y_ORIGIN(vd->reg[lfbMode].u))
- scry = (vd->fbi.yorigin - y) & 0x3ff;
+ scry = (vd->fbi.yorigin - y);
} else {
// Direct lfb access
buffer = (uint16_t *)(vd->fbi.ram + vd->fbi.lfb_base*4);
@@ -5884,7 +5885,7 @@ void voodoo_device::raster_fastfill(void *destbase, int32_t y, const poly_extent
/* determine the screen Y */
scry = y;
if (FBZMODE_Y_ORIGIN(vd->reg[fbzMode].u))
- scry = (vd->fbi.yorigin - y) & 0x3ff;
+ scry = (vd->fbi.yorigin - y);
/* fill this RGB row */
if (FBZMODE_RGB_BUFFER_MASK(vd->reg[fbzMode].u))
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp
index d196afa0850..b9e5b413f61 100644
--- a/src/emu/rendlay.cpp
+++ b/src/emu/rendlay.cpp
@@ -675,17 +675,28 @@ private:
// internal helpers
void load_bitmap()
{
- // load the basic bitmap
assert(m_file != nullptr);
- m_hasalpha = render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str());
-
- // load the alpha bitmap if specified
- if (m_bitmap.valid() && !m_alphafile.empty())
- render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_alphafile.c_str(), true);
- // PNG failed, let's try JPG
- if (!m_bitmap.valid())
- render_load_jpeg(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str());
+ ru_imgformat const format = render_detect_image(*m_file, m_dirname.c_str(), m_imagefile.c_str());
+ switch (format)
+ {
+ case RENDUTIL_IMGFORMAT_ERROR:
+ break;
+
+ case RENDUTIL_IMGFORMAT_PNG:
+ // load the basic bitmap
+ m_hasalpha = render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str());
+
+ // load the alpha bitmap if specified
+ if (m_bitmap.valid() && !m_alphafile.empty())
+ render_load_png(m_bitmap, *m_file, m_dirname.c_str(), m_alphafile.c_str(), true);
+ break;
+
+ default:
+ // try JPG
+ render_load_jpeg(m_bitmap, *m_file, m_dirname.c_str(), m_imagefile.c_str());
+ break;
+ }
// if we can't load the bitmap, allocate a dummy one and report an error
if (!m_bitmap.valid())
diff --git a/src/emu/rendutil.cpp b/src/emu/rendutil.cpp
index bbedfab9dae..3511d311bdc 100644
--- a/src/emu/rendutil.cpp
+++ b/src/emu/rendutil.cpp
@@ -5,6 +5,7 @@
rendutil.c
Core rendering utilities.
+
***************************************************************************/
#include "emu.h"
@@ -795,3 +796,35 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info &png)
// set the hasalpha flag
return (accumalpha != 0xff);
}
+
+
+/*-------------------------------------------------
+ render_detect_image - detect image format
+-------------------------------------------------*/
+
+ru_imgformat render_detect_image(emu_file &file, const char *dirname, const char *filename)
+{
+ // open the file
+ std::string fname;
+ if (dirname)
+ fname.assign(dirname).append(PATH_SEPARATOR).append(filename);
+ else
+ fname.assign(filename);
+ osd_file::error const filerr = file.open(fname.c_str());
+ if (filerr != osd_file::error::NONE)
+ return RENDUTIL_IMGFORMAT_ERROR;
+
+ // PNG: check for valid header
+ png_error const result = png_info::verify_header(file);
+ if (result == PNGERR_NONE)
+ {
+ file.close();
+ return RENDUTIL_IMGFORMAT_PNG;
+ }
+
+ file.seek(0, SEEK_SET);
+ // TODO: add more when needed
+
+ file.close();
+ return RENDUTIL_IMGFORMAT_UNKNOWN;
+}
diff --git a/src/emu/rendutil.h b/src/emu/rendutil.h
index b84fc60f704..1824fb0a34a 100644
--- a/src/emu/rendutil.h
+++ b/src/emu/rendutil.h
@@ -5,6 +5,7 @@
rendutil.h
Core rendering utilities.
+
***************************************************************************/
#ifndef MAME_EMU_RENDUTIL_H
@@ -17,6 +18,18 @@
#include <math.h>
+/* ----- image formats ----- */
+
+enum ru_imgformat
+{
+ RENDUTIL_IMGFORMAT_PNG,
+
+ RENDUTIL_IMGFORMAT_UNKNOWN,
+ RENDUTIL_IMGFORMAT_ERROR
+};
+
+
+
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
@@ -29,6 +42,7 @@ bool render_clip_quad(render_bounds *bounds, const render_bounds *clip, render_q
void render_line_to_quad(const render_bounds *bounds, float width, float length_extension, render_bounds *bounds0, render_bounds *bounds1);
void render_load_jpeg(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, const char *filename);
bool render_load_png(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, const char *filename, bool load_as_alpha_to_existing = false);
+ru_imgformat render_detect_image(emu_file &file, const char *dirname, const char *filename);
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index b2ea5e017d2..f2398bc57f7 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -746,6 +746,7 @@ void lua_engine::initialize()
* emu.print_info(str) -- output to stderr at info level
* emu.print_debug(str) -- output to stderr at debug level
* emu.driver_find(driver) -- find and return game_driver for driver
+ * emu.wait(len) -- wait from len within coroutine
*/
sol::table emu = sol().create_named_table("emu");
emu["app_name"] = &emulator_info::get_appname_lower;
@@ -806,6 +807,7 @@ void lua_engine::initialize()
engine->machine().scheduler().timer_set(attotime::from_double(lua_tonumber(L, 1)), timer_expired_delegate(FUNC(lua_engine::resume), engine), 0, L);
return lua_yield(L, 0);
});
+ emu["lang_translate"] = &lang_translate;
/*
* emu.file([opt] searchpath, flags) - flags can be as in osdcore "OPEN_FLAG_*" or lua style with 'rwc' with addtional c for create *and truncate* (be careful)
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 035f36c7b64..93480a17a34 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -180,7 +180,7 @@ std::string machine_info::warnings_string() const
buf << m_machine.rom_load().software_load_warnings_message();
// if we have at least one warning flag, print the general header
- if ((m_machine.rom_load().knownbad() > 0) || (machine_flags() & (MACHINE_WARNINGS | MACHINE_BTANB)) || unemulated_features() || imperfect_features())
+ if ((m_machine.rom_load().knownbad() > 0) || (machine_flags() & (MACHINE_ERRORS | MACHINE_WARNINGS | MACHINE_BTANB)) || unemulated_features() || imperfect_features())
{
if (!buf.str().empty())
buf << '\n';
diff --git a/src/lib/util/corestr.cpp b/src/lib/util/corestr.cpp
index c8775f1cec0..b9e56c5cdc5 100644
--- a/src/lib/util/corestr.cpp
+++ b/src/lib/util/corestr.cpp
@@ -171,7 +171,7 @@ void strreplacechr(std::string& str, char ch, char newch)
}
}
-static std::string internal_strtrimspace(std::string& str, bool right_only)
+static std::string &internal_strtrimspace(std::string& str, bool right_only)
{
// identify the start
std::string::iterator start = str.begin();
@@ -196,33 +196,33 @@ static std::string internal_strtrimspace(std::string& str, bool right_only)
return str;
}
-std::string strtrimspace(std::string& str)
+std::string &strtrimspace(std::string& str)
{
return internal_strtrimspace(str, false);
}
-std::string strtrimrightspace(std::string& str)
+std::string &strtrimrightspace(std::string& str)
{
return internal_strtrimspace(str, true);
}
-std::string strmakeupper(std::string& str)
+std::string &strmakeupper(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), ::toupper);
return str;
}
/**
- * @fn std::string strmakelower(std::string& str)
+ * @fn std::string &strmakelower(std::string& str)
*
- * @brief Strmakelowers the given string.
+ * @brief Changes the given string to lower case.
*
- * @param [in,out] str The string.
+ * @param [in,out] str The string to make lower case
*
- * @return A std::string.
+ * @return A reference to the original std::string having been changed to lower case
*/
-std::string strmakelower(std::string& str)
+std::string &strmakelower(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
return str;
diff --git a/src/lib/util/corestr.h b/src/lib/util/corestr.h
index d31c1e5f8df..f4d8d7bed09 100644
--- a/src/lib/util/corestr.h
+++ b/src/lib/util/corestr.h
@@ -66,10 +66,10 @@ int strcatvprintf(std::string &str, const char *format, va_list args);
void strdelchr(std::string& str, char chr);
void strreplacechr(std::string& str, char ch, char newch);
-std::string strtrimspace(std::string& str);
-std::string strtrimrightspace(std::string& str);
-std::string strmakeupper(std::string& str);
-std::string strmakelower(std::string& str);
+std::string &strtrimspace(std::string& str);
+std::string &strtrimrightspace(std::string& str);
+std::string &strmakeupper(std::string& str);
+std::string &strmakelower(std::string& str);
int strreplace(std::string &str, const std::string& search, const std::string& replace);
#endif /* __CORESTR_H__ */
diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp
index 54f943e3955..0a3b616b01f 100644
--- a/src/lib/util/png.cpp
+++ b/src/lib/util/png.cpp
@@ -66,7 +66,7 @@ void png_info::free_data()
namespace {
-#define PNG_Signature "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"
+constexpr std::uint8_t PNG_SIGNATURE[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a };
#define MNG_Signature "\x8A\x4D\x4E\x47\x0D\x0A\x1A\x0A"
// Chunk names
@@ -413,21 +413,6 @@ private:
return ((samples[pnginfo.color_type] * pnginfo.bit_depth) + 7) >> 3;
}
- static png_error verify_header(util::core_file &fp)
- {
- uint8_t signature[8];
-
- /* read 8 bytes */
- if (fp.read(signature, 8) != 8)
- return PNGERR_FILE_TRUNCATED;
-
- /* return an error if we don't match */
- if (memcmp(signature, PNG_Signature, 8) != 0)
- return PNGERR_BAD_SIGNATURE;
-
- return PNGERR_NONE;
- }
-
static png_error read_chunk(util::core_file &fp, std::unique_ptr<std::uint8_t []> &data, std::uint32_t &type, std::uint32_t &length)
{
std::uint8_t tempbuff[4];
@@ -741,6 +726,21 @@ public:
return error;
}
+
+ static png_error verify_header(util::core_file &fp)
+ {
+ EQUIVALENT_ARRAY(PNG_SIGNATURE, std::uint8_t) signature;
+
+ // read 8 bytes
+ if (fp.read(signature, sizeof(signature)) != sizeof(signature))
+ return PNGERR_FILE_TRUNCATED;
+
+ // return an error if we don't match
+ if (std::memcmp(signature, PNG_SIGNATURE, sizeof(PNG_SIGNATURE)))
+ return PNGERR_BAD_SIGNATURE;
+
+ return PNGERR_NONE;
+ }
};
constexpr unsigned png_private::ADAM7_X_BIAS[7];
@@ -756,6 +756,17 @@ constexpr unsigned png_private::ADAM7_Y_OFFS[7];
/*-------------------------------------------------
+ verify_header - verify PNG file header from a
+ core stream
+-------------------------------------------------*/
+
+png_error png_info::verify_header(util::core_file &fp)
+{
+ return png_private::verify_header(fp);
+}
+
+
+/*-------------------------------------------------
read_file - read a PNG from a core stream
-------------------------------------------------*/
@@ -1219,7 +1230,7 @@ png_error png_write_bitmap(util::core_file &fp, png_info *info, bitmap_t const &
info = &pnginfo;
// write the PNG signature
- if (fp.write(PNG_Signature, 8) != 8)
+ if (fp.write(PNG_SIGNATURE, sizeof(PNG_SIGNATURE)) != sizeof(PNG_SIGNATURE))
return PNGERR_FILE_ERROR;
/* write the rest of the PNG data */
diff --git a/src/lib/util/png.h b/src/lib/util/png.h
index d4805876215..ff14ff5f674 100644
--- a/src/lib/util/png.h
+++ b/src/lib/util/png.h
@@ -66,6 +66,8 @@ public:
void free_data();
void reset() { free_data(); operator=(png_info()); }
+ static png_error verify_header(util::core_file &fp);
+
std::unique_ptr<std::uint8_t []> image;
std::uint32_t width, height;
std::uint32_t xres = 0, yres = 0;
diff --git a/src/mame/audio/starwars.cpp b/src/mame/audio/starwars.cpp
index 1f97abfd2de..817749a5e10 100644
--- a/src/mame/audio/starwars.cpp
+++ b/src/mame/audio/starwars.cpp
@@ -56,6 +56,13 @@ WRITE8_MEMBER(starwars_state::r6532_porta_w)
*
*************************************/
+WRITE_LINE_MEMBER(starwars_state::boost_interleave_hack)
+{
+ if (state)
+ machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+}
+
+
READ8_MEMBER(starwars_state::starwars_main_ready_flag_r)
{
return m_riot->porta_in_get() & 0xc0; /* only upper two flag bits mapped */
diff --git a/src/mame/drivers/a7150.cpp b/src/mame/drivers/a7150.cpp
index cc6974e19c3..a8316c24cb5 100644
--- a/src/mame/drivers/a7150.cpp
+++ b/src/mame/drivers/a7150.cpp
@@ -418,7 +418,8 @@ static MACHINE_CONFIG_START( a7150 )
MCFG_CPU_IO_MAP(a7150_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
// IFSP port on processor card
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
diff --git a/src/mame/drivers/aerofgt.cpp b/src/mame/drivers/aerofgt.cpp
index 37a3075c78d..d6f4e54072a 100644
--- a/src/mame/drivers/aerofgt.cpp
+++ b/src/mame/drivers/aerofgt.cpp
@@ -3045,7 +3045,7 @@ GAME( 1991, spikes91, pspikes, spikes91, pspikes, aerofgt_state, 0, ROT0, "
GAME( 1991, spikes91b, pspikes, spikes91, pspikes, aerofgt_state, 0, ROT0, "bootleg", "1991 Spikes (Italian bootleg, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND | MACHINE_NO_COCKTAIL )
GAME( 1991, pspikesc, pspikes, pspikesc, pspikesc, aerofgt_state, 0, ROT0, "bootleg", "Power Spikes (China)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND )
GAME( 1997, wbbc97, 0, wbbc97, wbbc97, aerofgt_state, 0, ROT0, "Comad", "Beach Festival World Championship 1997", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // based on power spikes codebase
-GAME( 1998, kickball, 0, kickball, pspikes, aerofgt_state, kickball, ROT0, "Seoung Youn", "Kick Ball", MACHINE_NOT_WORKING ) // based on power spikes codebase
+GAME( 1998, kickball, 0, kickball, pspikes, aerofgt_state, kickball, ROT0, "Seoung Youn", "Kick Ball", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) // based on power spikes codebase, wrong priorities
GAME( 1991, karatblz, 0, karatblz, karatblz, aerofgt_state, 0, ROT0, "Video System Co.", "Karate Blazers (World, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1991, karatblza, karatblz, karatblz, karatblz, aerofgt_state, 0, ROT0, "Video System Co.", "Karate Blazers (World, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
diff --git a/src/mame/drivers/airbustr.cpp b/src/mame/drivers/airbustr.cpp
index c4d1b42c1f3..153f4cc80b5 100644
--- a/src/mame/drivers/airbustr.cpp
+++ b/src/mame/drivers/airbustr.cpp
@@ -292,32 +292,7 @@ WRITE8_MEMBER(airbustr_state::sound_bankswitch_w)
READ8_MEMBER(airbustr_state::soundcommand_status_r)
{
// bits: 2 <-> ? 1 <-> soundlatch full 0 <-> soundlatch2 empty
- return 4 + m_soundlatch_status * 2 + (1 - m_soundlatch2_status);
-}
-
-READ8_MEMBER(airbustr_state::soundcommand_r)
-{
- m_soundlatch_status = 0; // soundlatch has been read
- return m_soundlatch->read(space, 0);
-}
-
-READ8_MEMBER(airbustr_state::soundcommand2_r)
-{
- m_soundlatch2_status = 0; // soundlatch2 has been read
- return m_soundlatch2->read(space, 0);
-}
-
-WRITE8_MEMBER(airbustr_state::soundcommand_w)
-{
- m_soundlatch->write(space, 0, data);
- m_soundlatch_status = 1; // soundlatch has been written
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
-}
-
-WRITE8_MEMBER(airbustr_state::soundcommand2_w)
-{
- m_soundlatch2->write(space, 0, data);
- m_soundlatch2_status = 1; // soundlatch2 has been written
+ return 4 | (m_soundlatch->pending_r() << 1) | !m_soundlatch2->pending_r();
}
@@ -362,7 +337,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( slave_io_map, AS_IO, 8, airbustr_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(slave_bankswitch_w)
- AM_RANGE(0x02, 0x02) AM_READWRITE(soundcommand2_r, soundcommand_w)
+ AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x04, 0x0c) AM_WRITE(scrollregs_w)
AM_RANGE(0x0e, 0x0e) AM_READ(soundcommand_status_r)
AM_RANGE(0x20, 0x20) AM_READ_PORT("P1")
@@ -383,7 +358,7 @@ static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, airbustr_state )
AM_RANGE(0x00, 0x00) AM_WRITE(sound_bankswitch_w)
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write)
AM_RANGE(0x04, 0x04) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x06, 0x06) AM_READWRITE(soundcommand_r, soundcommand2_w)
+ AM_RANGE(0x06, 0x06) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
ADDRESS_MAP_END
/* Input Ports */
@@ -550,8 +525,6 @@ void airbustr_state::machine_start()
membank("slavebank")->configure_entries(0, 8, memregion("slave")->base(), 0x4000);
membank("audiobank")->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000);
- save_item(NAME(m_soundlatch_status));
- save_item(NAME(m_soundlatch2_status));
save_item(NAME(m_bg_scrollx));
save_item(NAME(m_bg_scrolly));
save_item(NAME(m_fg_scrollx));
@@ -561,7 +534,6 @@ void airbustr_state::machine_start()
void airbustr_state::machine_reset()
{
- m_soundlatch_status = m_soundlatch2_status = 0;
m_bg_scrollx = 0;
m_bg_scrolly = 0;
m_fg_scrollx = 0;
@@ -617,6 +589,8 @@ static MACHINE_CONFIG_START( airbustr )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
diff --git a/src/mame/drivers/alien.cpp b/src/mame/drivers/alien.cpp
index 76acafcef02..0ac18f4af80 100644
--- a/src/mame/drivers/alien.cpp
+++ b/src/mame/drivers/alien.cpp
@@ -6,12 +6,19 @@
skeleton driver
- - sh-4 clocked with 200MHz
- - 2 x Panasonic MN677511DE chips (MPEG2 decoders)
+ Main board:
+ - Hitachi SH-4 HD6417750S at 200MHz
+ - 2 x Fujitsu MB86292 Graphics Controller
- Altera ACEX 1K PLD
- M48T35Y timekeeper device
- - CF interface
- YMZ770B-F
+ Upper board (game specific):
+ - CF interface
+ - 2 x Panasonic MN677511DE MPEG2 decoders (optional)
+
+ Known undumped games:
+ - Donkey Kong: Jungle Fever (c) 2005 Capcom / Nintendo / Namco
+ - Donkey Kong: Banana Kingdom (c) 2006 Capcom / Nintendo / Namco
***********************************************************************************/
diff --git a/src/mame/drivers/altos486.cpp b/src/mame/drivers/altos486.cpp
index 4698f0be9e8..ff0f4b9bb4c 100644
--- a/src/mame/drivers/altos486.cpp
+++ b/src/mame/drivers/altos486.cpp
@@ -129,7 +129,11 @@ static MACHINE_CONFIG_START( altos486 )
MCFG_CPU_PROGRAM_MAP(altos486_z80_mem)
MCFG_CPU_IO_MAP(altos486_z80_io)
- MCFG_PIC8259_ADD("pic8259", DEVWRITELINE("maincpu", i80186_cpu_device, int0_w), VCC, READ8(altos486_state, read_rmx_ack))
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("maincpu", i80186_cpu_device, int0_w))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(altos486_state, read_rmx_ack))
+
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
MCFG_UPD765A_ADD("fdc", false, false)
diff --git a/src/mame/drivers/altos8600.cpp b/src/mame/drivers/altos8600.cpp
index b1773ee6e6c..cc0801353e7 100644
--- a/src/mame/drivers/altos8600.cpp
+++ b/src/mame/drivers/altos8600.cpp
@@ -134,7 +134,7 @@ READ16_MEMBER(altos8600_state::errhi_r)
WRITE16_MEMBER(altos8600_state::clear_w)
{
- m_mmuerr = 0xff;
+ m_mmuerr = 0xffff;
m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
m_nmistat = false;
}
@@ -281,6 +281,7 @@ void altos8600_state::xlate_w(address_space &space, offs_t offset, u16 data, u16
else if(m_user && BIT(flags, 3) && ((offset & 0x7ff) < 64))
seterr(offset, mem_mask, 8);
COMBINE_DATA(&((u16 *)(m_ram->pointer()))[(page << 11) | (offset & 0x7ff)]);
+ m_mmuflags[offset >> 11] |= 4;
}
READ16_MEMBER(altos8600_state::cpuram_r)
@@ -365,6 +366,7 @@ WRITE16_MEMBER(altos8600_state::dmacram_w)
return;
}
COMBINE_DATA(&((u16 *)(m_ram->pointer()))[(page << 11) | (offset & 0x7ff)]);
+ m_mmuflags[offset >> 11] |= 4;
}
READ16_MEMBER(altos8600_state::nmi_r)
@@ -454,9 +456,18 @@ static MACHINE_CONFIG_START(altos8600)
MCFG_I8089_SINTR1(DEVWRITELINE("pic8259_2", pic8259_device, ir3_w))
MCFG_I8089_SINTR2(DEVWRITELINE("pic8259_2", pic8259_device, ir4_w))
- MCFG_PIC8259_ADD("pic8259_1", INPUTLINE("maincpu", 0), VCC, READ8(altos8600_state, get_slave_ack))
- MCFG_PIC8259_ADD("pic8259_2", DEVWRITELINE("pic8259_1", pic8259_device, ir2_w), GND, NOOP)
- MCFG_PIC8259_ADD("pic8259_3", DEVWRITELINE("pic8259_1", pic8259_device, ir3_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(altos8600_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
+
+ MCFG_DEVICE_ADD("pic8259_3", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir3_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("1M")
@@ -508,4 +519,4 @@ ROM_START(altos8600)
ROMX_LOAD("11753_1.5_hi.bin", 0x0001, 0x1000, CRC(9b5e812c) SHA1(c2ef24859edd48d2096db47e16855c9bc01dae75), ROM_SKIP(1) | ROM_BIOS(1))
ROM_END
-COMP(1981, altos8600, 0, 0, altos8600, 0, altos8600_state, 0, "Altos", "8600", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW)
+COMP(1981, altos8600, 0, 0, altos8600, 0, altos8600_state, 0, "Altos Computer Systems", "ACS8600", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW)
diff --git a/src/mame/drivers/amusco.cpp b/src/mame/drivers/amusco.cpp
index d3e9bb2ecdd..f55d49fda8d 100644
--- a/src/mame/drivers/amusco.cpp
+++ b/src/mame/drivers/amusco.cpp
@@ -477,7 +477,8 @@ static MACHINE_CONFIG_START( amusco )
MCFG_CPU_IO_MAP(amusco_io_map)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
MCFG_PIT8253_CLK0(PIT_CLOCK0)
diff --git a/src/mame/drivers/apc.cpp b/src/mame/drivers/apc.cpp
index 9f49de1e0f0..98952ae0cdb 100644
--- a/src/mame/drivers/apc.cpp
+++ b/src/mame/drivers/apc.cpp
@@ -923,8 +923,15 @@ static MACHINE_CONFIG_START( apc )
MCFG_PIT8253_CLK1(MAIN_CLOCK) /* Memory Refresh */
MCFG_PIT8253_CLK2(MAIN_CLOCK) /* RS-232c */
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(apc_state,get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NOOP) // TODO: check ir7_w
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(apc_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir7_w)) // TODO: check ir7_w
+ MCFG_PIC8259_IN_SP_CB(GND)
+
MCFG_DEVICE_ADD("i8237", AM9517A, MAIN_CLOCK)
MCFG_I8237_OUT_HREQ_CB(WRITELINE(apc_state, apc_dma_hrq_changed))
MCFG_I8237_OUT_EOP_CB(WRITELINE(apc_state, apc_tc_w))
diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp
index 6caba17e4ad..33e4bc731d3 100644
--- a/src/mame/drivers/apple2.cpp
+++ b/src/mame/drivers/apple2.cpp
@@ -76,6 +76,7 @@ II Plus: RAM options reduced to 16/32/48 KB.
#include "bus/a2bus/ramcard128k.h"
#include "bus/a2bus/ramcard16k.h"
#include "bus/a2bus/timemasterho.h"
+#include "bus/a2bus/ssprite.h"
#include "screen.h"
#include "softlist.h"
@@ -1318,6 +1319,7 @@ static SLOT_INTERFACE_START(apple2_cards)
SLOT_INTERFACE("ezcgi", A2BUS_EZCGI) /* E-Z Color Graphics Interface */
SLOT_INTERFACE("ezcgi9938", A2BUS_EZCGI_9938) /* E-Z Color Graphics Interface (TMS9938) */
SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958) /* E-Z Color Graphics Interface (TMS9958) */
+ SLOT_INTERFACE("ssprite", A2BUS_SSPRITE) /* Synetix SuperSprite Board */
// SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN) /* Magic Musician Card */
SLOT_INTERFACE_END
@@ -1396,9 +1398,11 @@ static MACHINE_CONFIG_START( apple2_common )
MCFG_A2BUS_SLOT_ADD(A2_BUS_TAG, "sl7", apple2_cards, nullptr)
MCFG_SOFTWARE_LIST_ADD("flop525_list","apple2")
+ MCFG_SOFTWARE_LIST_ADD("cass_list", "apple2_cass")
MCFG_CASSETTE_ADD(A2_CASSETTE_TAG)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED)
+ MCFG_CASSETTE_INTERFACE("apple2_cass")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( apple2, apple2_common )
diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp
index 732a525b6d5..9e423c3c2e6 100644
--- a/src/mame/drivers/apple2e.cpp
+++ b/src/mame/drivers/apple2e.cpp
@@ -146,6 +146,7 @@ Address bus A0-A11 is Y0-Y11
#include "bus/a2bus/a2estd80col.h"
#include "bus/a2bus/a2eext80col.h"
#include "bus/a2bus/a2eramworks3.h"
+#include "bus/a2bus/ssprite.h"
#include "bus/rs232/rs232.h"
@@ -3734,6 +3735,7 @@ static SLOT_INTERFACE_START(apple2_cards)
SLOT_INTERFACE("ezcgi9958", A2BUS_EZCGI_9958) /* E-Z Color Graphics Interface (TMS9958) */
// SLOT_INTERFACE("magicmusician", A2BUS_MAGICMUSICIAN) /* Magic Musician Card */
SLOT_INTERFACE("pcxport", A2BUS_PCXPORTER) /* Applied Engineering PC Transporter */
+ SLOT_INTERFACE("ssprite", A2BUS_SSPRITE) /* Synetix SuperSprite Board */
SLOT_INTERFACE_END
static SLOT_INTERFACE_START(apple2eaux_cards)
diff --git a/src/mame/drivers/apricot.cpp b/src/mame/drivers/apricot.cpp
index c317ae92fc3..f3460ddda8d 100644
--- a/src/mame/drivers/apricot.cpp
+++ b/src/mame/drivers/apricot.cpp
@@ -395,7 +395,8 @@ static MACHINE_CONFIG_START( apricot )
MCFG_I8255_IN_PORTC_CB(READ8(apricot_state, i8255_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(apricot_state, i8255_portc_w))
- MCFG_PIC8259_ADD("ic31", INPUTLINE("ic91", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("ic31", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("ic91", 0))
MCFG_DEVICE_ADD("ic16", PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL_4MHz / 16)
diff --git a/src/mame/drivers/apricotp.cpp b/src/mame/drivers/apricotp.cpp
index ee378250daf..3e8d5e862e1 100644
--- a/src/mame/drivers/apricotp.cpp
+++ b/src/mame/drivers/apricotp.cpp
@@ -619,11 +619,14 @@ static MACHINE_CONFIG_START( fp )
/* Devices */
MCFG_DEVICE_ADD(APRICOT_KEYBOARD_TAG, APRICOT_KEYBOARD, 0)
+
MCFG_DEVICE_ADD(I8237_TAG, AM9517A, 250000)
MCFG_I8237_OUT_EOP_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir7_w))
MCFG_I8237_IN_IOR_1_CB(DEVREAD8(WD2797_TAG, wd_fdc_device_base, data_r))
MCFG_I8237_OUT_IOW_1_CB(DEVWRITE8(WD2797_TAG, wd_fdc_device_base, data_w))
- MCFG_PIC8259_ADD(I8259A_TAG, INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+
+ MCFG_DEVICE_ADD(I8259A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(I8253A5_TAG, PIT8253, 0)
MCFG_PIT8253_CLK0(2000000)
diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp
index 3f56ea94131..c4278c1346d 100644
--- a/src/mame/drivers/aquarium.cpp
+++ b/src/mame/drivers/aquarium.cpp
@@ -59,27 +59,10 @@ Notes:
#include "speaker.h"
-READ16_MEMBER(aquarium_state::aquarium_coins_r)
+WRITE8_MEMBER(aquarium_state::aquarium_watchdog_w)
{
- int data;
- data = (ioport("SYSTEM")->read() & 0x7fff);
- data |= m_aquarium_snd_ack;
- m_aquarium_snd_ack = 0;
-
- return data;
-}
-
-WRITE8_MEMBER(aquarium_state::aquarium_snd_ack_w)
-{
- m_aquarium_snd_ack = 0x8000;
-}
-
-WRITE16_MEMBER(aquarium_state::aquarium_sound_w)
-{
-// popmessage("sound write %04x",data);
-
- m_soundlatch->write(space, 1, data & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
+ m_watchdog->write_line_ck(BIT(data, 7));
+ // bits 0 & 1 also used
}
WRITE8_MEMBER(aquarium_state::aquarium_z80_bank_w)
@@ -99,18 +82,7 @@ WRITE8_MEMBER(aquarium_state::aquarium_z80_bank_w)
uint8_t aquarium_state::aquarium_snd_bitswap( uint8_t scrambled_data )
{
- uint8_t data = 0;
-
- data |= ((scrambled_data & 0x01) << 7);
- data |= ((scrambled_data & 0x02) << 5);
- data |= ((scrambled_data & 0x04) << 3);
- data |= ((scrambled_data & 0x08) << 1);
- data |= ((scrambled_data & 0x10) >> 1);
- data |= ((scrambled_data & 0x20) >> 3);
- data |= ((scrambled_data & 0x40) >> 5);
- data |= ((scrambled_data & 0x80) >> 7);
-
- return data;
+ return BITSWAP8(scrambled_data, 0, 1, 2, 3, 4, 5, 6, 7);
}
READ8_MEMBER(aquarium_state::aquarium_oki_r)
@@ -139,9 +111,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, aquarium_state )
AM_RANGE(0xd80080, 0xd80081) AM_READ_PORT("DSW")
AM_RANGE(0xd80082, 0xd80083) AM_READNOP /* stored but not read back ? check code at 0x01f440 */
AM_RANGE(0xd80084, 0xd80085) AM_READ_PORT("INPUTS")
- AM_RANGE(0xd80086, 0xd80087) AM_READ(aquarium_coins_r)
- AM_RANGE(0xd80088, 0xd80089) AM_WRITENOP /* ?? video related */
- AM_RANGE(0xd8008a, 0xd8008b) AM_WRITE(aquarium_sound_w)
+ AM_RANGE(0xd80086, 0xd80087) AM_READ_PORT("SYSTEM")
+ AM_RANGE(0xd80088, 0xd80089) AM_WRITE8(aquarium_watchdog_w, 0xff00)
+ AM_RANGE(0xd8008a, 0xd8008b) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0xff0000, 0xffffff) AM_RAM
ADDRESS_MAP_END
@@ -156,7 +128,7 @@ static ADDRESS_MAP_START( snd_portmap, AS_IO, 8, aquarium_state )
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
AM_RANGE(0x02, 0x02) AM_READWRITE(aquarium_oki_r, aquarium_oki_w)
AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0x06, 0x06) AM_WRITE(aquarium_snd_ack_w)
+ AM_RANGE(0x06, 0x06) AM_DEVWRITE("soundlatch", generic_latch_8_device, acknowledge_w) // only written with 0 for some reason
AM_RANGE(0x08, 0x08) AM_WRITE(aquarium_z80_bank_w)
ADDRESS_MAP_END
@@ -225,7 +197,7 @@ static INPUT_PORTS_START( aquarium )
PORT_SERVICE( 0x1000, IP_ACTIVE_LOW )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* sound status */
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r)
INPUT_PORTS_END
static const gfx_layout char5bpplayout =
@@ -312,16 +284,6 @@ static GFXDECODE_START( aquarium )
GFXDECODE_ENTRY( "gfx4", 0, char5bpplayout, 0x400, 32 )
GFXDECODE_END
-void aquarium_state::machine_start()
-{
- save_item(NAME(m_aquarium_snd_ack));
-}
-
-void aquarium_state::machine_reset()
-{
- m_aquarium_snd_ack = 0;
-}
-
static MACHINE_CONFIG_START( aquarium )
/* basic machine hardware */
@@ -333,6 +295,9 @@ static MACHINE_CONFIG_START( aquarium )
MCFG_CPU_PROGRAM_MAP(snd_map)
MCFG_CPU_IO_MAP(snd_portmap)
+ // Is this the actual IC type? Some other Excellent games from this period use a MAX693.
+ MCFG_DEVICE_ADD("watchdog", MB3773, 0)
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -352,6 +317,8 @@ static MACHINE_CONFIG_START( aquarium )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
MCFG_YM2151_ADD("ymsnd", XTAL_14_31818MHz/4) // clock not verified on pcb
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/arcadecl.cpp b/src/mame/drivers/arcadecl.cpp
index b0236430897..79ebc19a18d 100644
--- a/src/mame/drivers/arcadecl.cpp
+++ b/src/mame/drivers/arcadecl.cpp
@@ -71,6 +71,7 @@
#include "emu.h"
#include "includes/arcadecl.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "video/atarimo.h"
@@ -161,8 +162,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, arcadecl_state )
AM_RANGE(0x640024, 0x640025) AM_READ_PORT("TRACKX1")
AM_RANGE(0x640026, 0x640027) AM_READ_PORT("TRACKY1")
AM_RANGE(0x640040, 0x64004f) AM_WRITE(latch_w)
- AM_RANGE(0x640060, 0x64006f) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
- AM_RANGE(0x641000, 0x641fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x640060, 0x64006f) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
+ AM_RANGE(0x641000, 0x641fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x642000, 0x642001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00)
AM_RANGE(0x646000, 0x646fff) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0x647000, 0x647fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
@@ -325,7 +326,9 @@ static MACHINE_CONFIG_START( arcadecl )
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen)
MCFG_MACHINE_RESET_OVERRIDE(arcadecl_state,arcadecl)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp
index b3ddca0d109..dd57dfd4b37 100644
--- a/src/mame/drivers/astrocde.cpp
+++ b/src/mame/drivers/astrocde.cpp
@@ -455,13 +455,6 @@ WRITE8_MEMBER(astrocde_state::demndrgn_sound_w)
*
*************************************/
-WRITE8_MEMBER(astrocde_state::tenpindx_sound_w)
-{
- m_soundlatch->write(space, offset, data);
- m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
-}
-
-
WRITE8_MEMBER(astrocde_state::tenpindx_lamp_w)
{
/* lamps */
@@ -671,6 +664,20 @@ static ADDRESS_MAP_START( port_map_16col_pattern_nosound, AS_IO, 8, astrocde_sta
ADDRESS_MAP_END
+static ADDRESS_MAP_START( port_map_16col_pattern_tenpindx, AS_IO, 8, astrocde_state )
+ AM_RANGE(0x0060, 0x0060) AM_MIRROR(0xff00) AM_READ_PORT("P60")
+ AM_RANGE(0x0061, 0x0061) AM_MIRROR(0xff00) AM_READ_PORT("P61")
+ AM_RANGE(0x0062, 0x0062) AM_MIRROR(0xff00) AM_READ_PORT("P62")
+ AM_RANGE(0x0063, 0x0063) AM_MIRROR(0xff00) AM_READ_PORT("P63")
+ AM_RANGE(0x0064, 0x0064) AM_MIRROR(0xff00) AM_READ_PORT("P64")
+ AM_RANGE(0x0065, 0x0066) AM_MIRROR(0xff00) AM_WRITE(tenpindx_lamp_w)
+ AM_RANGE(0x0067, 0x0067) AM_MIRROR(0xff00) AM_WRITE(tenpindx_counter_w)
+ AM_RANGE(0x0068, 0x0068) AM_MIRROR(0xff00) AM_WRITE(tenpindx_lights_w)
+ AM_RANGE(0x0097, 0x0097) AM_MIRROR(0xff00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
+ AM_IMPORT_FROM(port_map_16col_pattern_nosound)
+ADDRESS_MAP_END
+
+
static ADDRESS_MAP_START( tenpin_sub_io_map, AS_IO, 8, astrocde_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
@@ -1443,7 +1450,7 @@ static MACHINE_CONFIG_DERIVED( tenpindx, astrocade_16color_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(profpac_map)
- MCFG_CPU_IO_MAP(port_map_16col_pattern_nosound)
+ MCFG_CPU_IO_MAP(port_map_16col_pattern_tenpindx)
MCFG_CPU_ADD("sub", Z80, ASTROCADE_CLOCK/4) /* real clock unknown */
MCFG_Z80_DAISY_CHAIN(tenpin_daisy_chain)
@@ -1457,6 +1464,7 @@ static MACHINE_CONFIG_DERIVED( tenpindx, astrocade_16color_base )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
MCFG_SOUND_ADD("aysnd", AY8912, ASTROCADE_CLOCK/4) /* real clock unknown */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DIPSW"))
@@ -1767,18 +1775,7 @@ DRIVER_INIT_MEMBER(astrocde_state,demndrgn)
DRIVER_INIT_MEMBER(astrocde_state,tenpindx)
{
- address_space &iospace = m_maincpu->space(AS_IO);
-
m_video_config = 0x00;
- iospace.install_read_port(0x60, 0x60, 0xff00, "P60");
- iospace.install_read_port(0x61, 0x61, 0xff00, "P61");
- iospace.install_read_port(0x62, 0x62, 0xff00, "P62");
- iospace.install_read_port(0x63, 0x63, 0xff00, "P63");
- iospace.install_read_port(0x64, 0x64, 0xff00, "P64");
- iospace.install_write_handler(0x65, 0x66, 0, 0xff00, 0x0000, write8_delegate(FUNC(astrocde_state::tenpindx_lamp_w), this));
- iospace.install_write_handler(0x67, 0x67, 0, 0xff00, 0x0000, write8_delegate(FUNC(astrocde_state::tenpindx_counter_w), this));
- iospace.install_write_handler(0x68, 0x68, 0, 0xff00, 0x0000, write8_delegate(FUNC(astrocde_state::tenpindx_lights_w), this));
- iospace.install_write_handler(0x97, 0x97, 0, 0xff00, 0x0000, write8_delegate(FUNC(astrocde_state::tenpindx_sound_w), this));
/* configure banking */
m_bank8000->configure_entries(0, 4, memregion("banks")->base() + 0x4000, 0x8000);
@@ -1818,5 +1815,5 @@ GAME( 1981, robby, 0, robby, robby, astrocde_state, robby, ROT0,
GAME( 1983, profpac, 0, profpac, profpac, astrocde_state, profpac, ROT0, "Dave Nutting Associates / Bally Midway", "Professor Pac-Man", MACHINE_SUPPORTS_SAVE )
/* 91465 CPU board + 91699 game board + 91466 RAM board + 91488 pattern board + 91467 memory board */
-GAME( 1982, demndrgn, 0, demndrgn, demndrgn, astrocde_state, demndrgn, ROT0, "Dave Nutting Associates / Bally Midway", "Demons & Dragons (prototype)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1982, demndrgn, 0, demndrgn, demndrgn, astrocde_state, demndrgn, ROT0, "Dave Nutting Associates / Bally Midway", "Demons & Dragons (prototype)", MACHINE_IS_INCOMPLETE | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
GAMEL(1983, tenpindx, 0, tenpindx, tenpindx, astrocde_state, tenpindx, ROT0, "Dave Nutting Associates / Bally Midway", "Ten Pin Deluxe", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_MECHANICAL, layout_tenpindx )
diff --git a/src/mame/drivers/atarig1.cpp b/src/mame/drivers/atarig1.cpp
index 3e18b3dec66..4ae33e667ee 100644
--- a/src/mame/drivers/atarig1.cpp
+++ b/src/mame/drivers/atarig1.cpp
@@ -22,6 +22,7 @@
#include "emu.h"
#include "includes/atarig1.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "speaker.h"
@@ -195,7 +196,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig1_state )
AM_RANGE(0x040000, 0x077fff) AM_ROM
AM_RANGE(0x078000, 0x07ffff) AM_ROM /* hydra slapstic goes here */
AM_RANGE(0xf80000, 0xf80001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0xf88000, 0xf8ffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xf88000, 0xf8ffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xf90000, 0xf90001) AM_DEVWRITE8("jsa", atari_jsa_ii_device, main_command_w, 0xff00)
AM_RANGE(0xf98000, 0xf98001) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
AM_RANGE(0xfa0000, 0xfa0001) AM_DEVWRITE8("rle", atari_rle_objects_device, control_write, 0x00ff)
@@ -203,7 +204,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig1_state )
AM_RANGE(0xfc0000, 0xfc0001) AM_READ(special_port0_r)
AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE(a2d_data_r, a2d_select_w)
AM_RANGE(0xfd0000, 0xfd0001) AM_DEVREAD8("jsa", atari_jsa_ii_device, main_response_r, 0xff00)
- AM_RANGE(0xfd8000, 0xfdffff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xfd8000, 0xfdffff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
/* AM_RANGE(0xfe0000, 0xfe7fff) AM_READ(from_r)*/
AM_RANGE(0xfe8000, 0xfe89ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xff0000, 0xff0fff) AM_RAM AM_SHARE("rle")
@@ -433,7 +434,8 @@ static MACHINE_CONFIG_START( atarig1 )
MCFG_MACHINE_START_OVERRIDE(atarig1_state,atarig1)
MCFG_MACHINE_RESET_OVERRIDE(atarig1_state,atarig1)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/atarig42.cpp b/src/mame/drivers/atarig42.cpp
index 3dfb46e04db..832d32896fc 100644
--- a/src/mame/drivers/atarig42.cpp
+++ b/src/mame/drivers/atarig42.cpp
@@ -21,6 +21,7 @@
#include "emu.h"
#include "includes/atarig42.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "speaker.h"
@@ -329,14 +330,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig42_state )
AM_RANGE(0xe00030, 0xe00031) AM_DEVREAD8("jsa", atari_jsa_iii_device, main_response_r, 0x00ff)
AM_RANGE(0xe00040, 0xe00041) AM_DEVWRITE8("jsa", atari_jsa_iii_device, main_command_w, 0x00ff)
AM_RANGE(0xe00050, 0xe00051) AM_WRITE(io_latch_w)
- AM_RANGE(0xe00060, 0xe00061) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xe00060, 0xe00061) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xe03000, 0xe03001) AM_WRITE(video_int_ack_w)
AM_RANGE(0xe03800, 0xe03801) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xe80000, 0xe80fff) AM_RAM
AM_RANGE(0xf40000, 0xf40001) AM_DEVREAD("asic65", asic65_device, io_r)
AM_RANGE(0xf60000, 0xf60001) AM_DEVREAD("asic65", asic65_device, read)
AM_RANGE(0xf80000, 0xf80003) AM_DEVWRITE("asic65", asic65_device, data_w)
- AM_RANGE(0xfa0000, 0xfa0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xfa0000, 0xfa0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0xfc0000, 0xfc0fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xff0000, 0xff0fff) AM_RAM AM_SHARE("rle")
AM_RANGE(0xff2000, 0xff5fff) AM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
@@ -531,7 +532,8 @@ static MACHINE_CONFIG_START( atarig42 )
MCFG_MACHINE_START_OVERRIDE(atarig42_state,atarig42)
MCFG_MACHINE_RESET_OVERRIDE(atarig42_state,atarig42)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -632,7 +634,7 @@ ROM_START( roadriot )
ROM_LOAD( "136089-1050.15e", 0x40000, 0x20000, CRC(64d410bb) SHA1(877bccca7ff37a9dd8294bc1453487a2f516ca7d) )
ROM_LOAD( "136089-1051.12e", 0x60000, 0x20000, CRC(bffd01c8) SHA1(f6de000f61ea0c1ddb31ee5301506e5e966638c2) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "roadriot-eeprom.5c", 0x0000, 0x800, CRC(8d9b957d) SHA1(9d895c5977a3f405130594a10d530a82a6aa265f) )
ROM_REGION( 0x0600, "proms", 0 ) /* microcode for growth renderer */
@@ -689,7 +691,7 @@ ROM_START( roadriota )
ROM_LOAD( "136089-1050.15e", 0x40000, 0x20000, CRC(64d410bb) SHA1(877bccca7ff37a9dd8294bc1453487a2f516ca7d) )
ROM_LOAD( "136089-1051.12e", 0x60000, 0x20000, CRC(bffd01c8) SHA1(f6de000f61ea0c1ddb31ee5301506e5e966638c2) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "roadriot-eeprom.5c", 0x0000, 0x800, CRC(8d9b957d) SHA1(9d895c5977a3f405130594a10d530a82a6aa265f) )
ROM_REGION( 0x0600, "proms", 0 ) /* microcode for growth renderer */
@@ -746,7 +748,7 @@ ROM_START( roadriotb )
ROM_LOAD( "136089-1050.15e", 0x40000, 0x20000, CRC(64d410bb) SHA1(877bccca7ff37a9dd8294bc1453487a2f516ca7d) )
ROM_LOAD( "136089-1051.12e", 0x60000, 0x20000, CRC(bffd01c8) SHA1(f6de000f61ea0c1ddb31ee5301506e5e966638c2) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "roadriot-eeprom.5c", 0x0000, 0x800, CRC(8d9b957d) SHA1(9d895c5977a3f405130594a10d530a82a6aa265f) )
ROM_REGION( 0x0600, "proms", 0 ) /* microcode for growth renderer */
@@ -794,7 +796,7 @@ ROM_START( guardian )
ROM_REGION( 0x80000, "jsa:oki1", 0 )
ROM_LOAD( "136092-0010-snd.19e", 0x00000, 0x80000, CRC(bca27f40) SHA1(91a41eac116eb7d9a790abc590eb06328726d1c2) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "guardian-eeprom.5c", 0x0000, 0x800, CRC(85835fab) SHA1(747e2851c8baa0e7f1c0784b0d6900514230ab07) )
ROM_REGION( 0x0600, "proms", 0 ) /* microcode for growth renderer */
diff --git a/src/mame/drivers/atarigt.cpp b/src/mame/drivers/atarigt.cpp
index 2a6a248b72d..a86d026b6ef 100644
--- a/src/mame/drivers/atarigt.cpp
+++ b/src/mame/drivers/atarigt.cpp
@@ -56,6 +56,7 @@
#include "includes/atarigt.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#define LOG_PROTECTION (0)
@@ -600,8 +601,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atarigt_state )
AM_RANGE(0xc00000, 0xc00003) AM_READWRITE(sound_data_r, sound_data_w)
AM_RANGE(0xd00014, 0xd00017) AM_READ(analog_port0_r)
AM_RANGE(0xd0001c, 0xd0001f) AM_READ(analog_port1_r)
- AM_RANGE(0xd20000, 0xd20fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0xff00ff00)
- AM_RANGE(0xd40000, 0xd4ffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xd20000, 0xd20fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0xff00ff00)
+ AM_RANGE(0xd40000, 0xd4ffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xd72000, 0xd75fff) AM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xd76000, 0xd76fff) AM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
AM_RANGE(0xd78000, 0xd78fff) AM_RAM AM_SHARE("rle")
@@ -809,7 +810,8 @@ static MACHINE_CONFIG_START( atarigt )
MCFG_MACHINE_RESET_OVERRIDE(atarigt_state,atarigt)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atarigt)
diff --git a/src/mame/drivers/atarigx2.cpp b/src/mame/drivers/atarigx2.cpp
index 2320667e3b0..ee2bad3564c 100644
--- a/src/mame/drivers/atarigx2.cpp
+++ b/src/mame/drivers/atarigx2.cpp
@@ -28,6 +28,7 @@
#include "includes/atarigx2.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "speaker.h"
@@ -1200,14 +1201,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atarigx2_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0xc80000, 0xc80fff) AM_RAM
AM_RANGE(0xd00000, 0xd1ffff) AM_READ(a2d_data_r)
- AM_RANGE(0xd20000, 0xd20fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0xff00ff00)
+ AM_RANGE(0xd20000, 0xd20fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0xff00ff00)
AM_RANGE(0xd40000, 0xd40fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xd72000, 0xd75fff) AM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xd76000, 0xd76fff) AM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
AM_RANGE(0xd78000, 0xd78fff) AM_RAM AM_SHARE("rle")
AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_SHARE("mo_command")
AM_RANGE(0xd70000, 0xd7ffff) AM_RAM
- AM_RANGE(0xd80000, 0xd9ffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xd80000, 0xd9ffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xe06000, 0xe06003) AM_DEVWRITE8("jsa", atari_jsa_iiis_device, main_command_w, 0xff000000)
AM_RANGE(0xe08000, 0xe08003) AM_WRITE(latch_w)
AM_RANGE(0xe0c000, 0xe0c003) AM_WRITE16(video_int_ack_w, 0xffffffff)
@@ -1502,7 +1503,8 @@ static MACHINE_CONFIG_START( atarigx2 )
MCFG_MACHINE_RESET_OVERRIDE(atarigx2_state,atarigx2)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", atarigx2)
diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp
index f100079edad..da07124c3dd 100644
--- a/src/mame/drivers/atarisy1.cpp
+++ b/src/mame/drivers/atarisy1.cpp
@@ -194,8 +194,8 @@ RoadBlasters (aka Future Vette):005*
#include "includes/atarisy1.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
-#include "machine/atarigen.h"
#include "machine/6522via.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/pokey.h"
#include "sound/ym2151.h"
@@ -456,13 +456,13 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy1_state )
AM_RANGE(0x860000, 0x860001) AM_WRITE(atarisy1_bankselect_w) AM_SHARE("bankselect")
AM_RANGE(0x880000, 0x880001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x8a0000, 0x8a0001) AM_WRITE(video_int_ack_w)
- AM_RANGE(0x8c0000, 0x8c0001) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x8c0000, 0x8c0001) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x900000, 0x9fffff) AM_RAM
AM_RANGE(0xa00000, 0xa01fff) AM_RAM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xa02000, 0xa02fff) AM_RAM_WRITE(atarisy1_spriteram_w) AM_SHARE("mob")
AM_RANGE(0xa03000, 0xa03fff) AM_RAM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
AM_RANGE(0xb00000, 0xb007ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0xf00000, 0xf00fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xf00000, 0xf00fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r)
AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w)
AM_RANGE(0xf60000, 0xf60003) AM_READ_PORT("F60000")
@@ -738,7 +738,8 @@ static MACHINE_CONFIG_START( atarisy1 )
MCFG_MACHINE_START_OVERRIDE(atarisy1_state,atarisy1)
MCFG_MACHINE_RESET_OVERRIDE(atarisy1_state,atarisy1)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_DEVICE_ADD("outlatch", LS259, 0) // 15H (TTL) or 14F (LSI)
MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(DEVWRITELINE("ymsnd", ym2151_device, reset_w))
diff --git a/src/mame/drivers/atarisy2.cpp b/src/mame/drivers/atarisy2.cpp
index d2edbf0ecd3..4739ae4e358 100644
--- a/src/mame/drivers/atarisy2.cpp
+++ b/src/mame/drivers/atarisy2.cpp
@@ -127,6 +127,8 @@
#include "emu.h"
#include "includes/atarisy2.h"
+
+#include "machine/eeprompar.h"
#include "speaker.h"
diff --git a/src/mame/drivers/b2m.cpp b/src/mame/drivers/b2m.cpp
index d9c02c4d791..0d383ac4e06 100644
--- a/src/mame/drivers/b2m.cpp
+++ b/src/mame/drivers/b2m.cpp
@@ -227,7 +227,8 @@ static MACHINE_CONFIG_START( b2m )
MCFG_I8255_OUT_PORTB_CB(WRITE8(b2m_state, b2m_romdisk_portb_w))
MCFG_I8255_OUT_PORTC_CB(WRITE8(b2m_state, b2m_romdisk_portc_w))
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
/* sound */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/badlands.cpp b/src/mame/drivers/badlands.cpp
index a927d15d5de..1e04ff7c31c 100644
--- a/src/mame/drivers/badlands.cpp
+++ b/src/mame/drivers/badlands.cpp
@@ -168,6 +168,7 @@ Measurements -
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/ym2151.h"
#include "speaker.h"
@@ -377,7 +378,7 @@ WRITE8_MEMBER(badlands_state::audio_io_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0xfc0000, 0xfc1fff) AM_READ(sound_busy_r) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
- AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0xfe0000, 0xfe1fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(video_int_ack_w)
AM_RANGE(0xfe4000, 0xfe5fff) AM_READ_PORT("FE4000")
@@ -388,7 +389,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0xfe8000, 0xfe9fff) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff00)
AM_RANGE(0xfea000, 0xfebfff) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff00)
AM_RANGE(0xfec000, 0xfedfff) AM_WRITE(badlands_pf_bank_w)
- AM_RANGE(0xfee000, 0xfeffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xfee000, 0xfeffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xffc000, 0xffc3ff) AM_DEVREADWRITE8("palette", palette_device, read, write, 0xff00) AM_SHARE("palette")
AM_RANGE(0xffe000, 0xffefff) AM_RAM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xfff000, 0xfff1ff) AM_RAM AM_SHARE("mob")
@@ -513,7 +514,8 @@ static MACHINE_CONFIG_START( badlands )
MCFG_MACHINE_START_OVERRIDE(badlands_state,badlands)
MCFG_MACHINE_RESET_OVERRIDE(badlands_state,badlands)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -660,7 +662,7 @@ static ADDRESS_MAP_START( bootleg_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0xfc0000, 0xfc0001) AM_READ(badlandsb_unk_r ) // sound comms?
- AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
//AM_RANGE(0xfe0000, 0xfe1fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xfe2000, 0xfe3fff) AM_WRITE(video_int_ack_w)
@@ -669,7 +671,7 @@ static ADDRESS_MAP_START( bootleg_map, AS_PROGRAM, 16, badlands_state )
AM_RANGE(0xfe4004, 0xfe4005) AM_READ_PORT("P1")
AM_RANGE(0xfe4006, 0xfe4007) AM_READ_PORT("P2")
AM_RANGE(0xfe4008, 0xfe4009) AM_WRITE(badlands_pf_bank_w)
- AM_RANGE(0xfe400c, 0xfe400d) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xfe400c, 0xfe400d) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xffc000, 0xffc3ff) AM_DEVREADWRITE8("palette", palette_device, read, write, 0xff00) AM_SHARE("palette")
AM_RANGE(0xffe000, 0xffefff) AM_RAM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
@@ -768,7 +770,8 @@ static MACHINE_CONFIG_START( badlandsb )
MCFG_MACHINE_START_OVERRIDE(badlands_state,badlands)
MCFG_MACHINE_RESET_OVERRIDE(badlands_state,badlandsb)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", badlandsb)
diff --git a/src/mame/drivers/batman.cpp b/src/mame/drivers/batman.cpp
index 158ee3a7aa0..ea9432aacff 100644
--- a/src/mame/drivers/batman.cpp
+++ b/src/mame/drivers/batman.cpp
@@ -22,6 +22,7 @@
#include "emu.h"
#include "includes/batman.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "video/atarimo.h"
#include "speaker.h"
@@ -99,14 +100,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, batman_state )
ADDRESS_MAP_GLOBAL_MASK(0x3fffff)
AM_RANGE(0x000000, 0x0bffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM
- AM_RANGE(0x120000, 0x120fff) AM_MIRROR(0x01f000) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x120000, 0x120fff) AM_MIRROR(0x01f000) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x11ff8c) AM_READ_PORT("260000")
AM_RANGE(0x260002, 0x260003) AM_MIRROR(0x11ff8c) AM_READ_PORT("260002")
AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ_PORT("260010")
AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_DEVREAD8("jsa", atari_jsa_iii_device, main_response_r, 0x00ff)
AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_DEVWRITE8("jsa", atari_jsa_iii_device, main_command_w, 0x00ff)
AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE(latch_w)
- AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x260060, 0x260061) AM_MIRROR(0x11ff8e) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x2a0000, 0x2a0001) AM_MIRROR(0x11fffe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x2e0000, 0x2e0fff) AM_MIRROR(0x100000) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x2effc0, 0x2effff) AM_MIRROR(0x100000) AM_DEVREADWRITE("vad", atari_vad_device, control_read, control_write)
@@ -205,7 +206,8 @@ static MACHINE_CONFIG_START( batman )
MCFG_MACHINE_START_OVERRIDE(batman_state,batman)
MCFG_MACHINE_RESET_OVERRIDE(batman_state,batman)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -287,7 +289,7 @@ ROM_START( batman )
ROM_LOAD( "136085-1043.15e", 0x40000, 0x20000, CRC(51812d3b) SHA1(6748fecef753179a9257c0da5a7b7c9648437208) )
ROM_LOAD( "136085-1044.12e", 0x60000, 0x20000, CRC(5e2d7f31) SHA1(737c7204d91f5dd5c9ed0321fc6c0d6194a18f8a) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "batman-eeprom.bin", 0x0000, 0x800, CRC(c859b535) SHA1(b7f37aab1e869e92fbcc69af98a9c14f7cf2b418) )
ROM_REGION( 0x1000, "plds", 0 )
diff --git a/src/mame/drivers/bebox.cpp b/src/mame/drivers/bebox.cpp
index 63dc8be2c42..2743c90f9ef 100644
--- a/src/mame/drivers/bebox.cpp
+++ b/src/mame/drivers/bebox.cpp
@@ -172,9 +172,14 @@ static MACHINE_CONFIG_START( bebox )
MCFG_DEVICE_ADD( "dma8237_2", AM9517A, XTAL_14_31818MHz/3 )
- MCFG_PIC8259_ADD( "pic8259_1", WRITELINE(bebox_state,bebox_pic8259_master_set_int_line), VCC, READ8(bebox_state,get_slave_ack) )
-
- MCFG_PIC8259_ADD( "pic8259_2", WRITELINE(bebox_state,bebox_pic8259_slave_set_int_line), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(bebox_state, bebox_pic8259_master_set_int_line))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(bebox_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(bebox_state, bebox_pic8259_slave_set_int_line))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD( "ns16550_0", NS16550, 0 ) /* TODO: Verify model */
MCFG_DEVICE_ADD( "ns16550_1", NS16550, 0 ) /* TODO: Verify model */
diff --git a/src/mame/drivers/bking.cpp b/src/mame/drivers/bking.cpp
index e8609acad97..3b0bc074f84 100644
--- a/src/mame/drivers/bking.cpp
+++ b/src/mame/drivers/bking.cpp
@@ -31,26 +31,18 @@ DIP Locations verified for:
READ8_MEMBER(bking_state::bking_sndnmi_disable_r)
{
- m_sound_nmi_enable = 0;
+ m_soundnmi->in_w<1>(0);
return 0;
}
WRITE8_MEMBER(bking_state::bking_sndnmi_enable_w)
{
- m_sound_nmi_enable = 1;
+ m_soundnmi->in_w<1>(1);
}
WRITE8_MEMBER(bking_state::bking_soundlatch_w)
{
- int i, code = 0;
-
- for (i = 0;i < 8;i++)
- if (data & (1 << i))
- code |= 0x80 >> i;
-
- m_soundlatch->write(space, offset, code);
- if (m_sound_nmi_enable)
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_soundlatch->write(space, offset, BITSWAP8(data, 0, 1, 2, 3, 4, 5, 6, 7));
}
WRITE8_MEMBER(bking_state::bking3_addr_l_w)
@@ -347,9 +339,6 @@ void bking_state::machine_start()
save_item(NAME(m_palette_bank));
save_item(NAME(m_controller));
save_item(NAME(m_hit));
-
- /* sound */
- save_item(NAME(m_sound_nmi_enable));
}
MACHINE_START_MEMBER(bking_state,bking3)
@@ -384,7 +373,7 @@ void bking_state::machine_reset()
m_hit = 0;
/* sound */
- m_sound_nmi_enable = 1;
+ m_soundnmi->in_w<1>(0);
}
MACHINE_RESET_MEMBER(bking_state,bking3)
@@ -432,6 +421,10 @@ static MACHINE_CONFIG_START( bking )
MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(DEVWRITELINE("soundnmi", input_merger_device, in_w<0>))
+
+ MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ay1", AY8910, XTAL_6MHz/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
diff --git a/src/mame/drivers/blstroid.cpp b/src/mame/drivers/blstroid.cpp
index 357f1d10516..0b317bdf4d5 100644
--- a/src/mame/drivers/blstroid.cpp
+++ b/src/mame/drivers/blstroid.cpp
@@ -21,9 +21,9 @@
#include "emu.h"
#include "includes/blstroid.h"
-#include "machine/atarigen.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "speaker.h"
@@ -71,7 +71,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, blstroid_state )
AM_RANGE(0x800000, 0x800001) AM_MIRROR(0x0381fe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x800200, 0x800201) AM_MIRROR(0x0381fe) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0x800400, 0x800401) AM_MIRROR(0x0381fe) AM_WRITE(video_int_ack_w)
- AM_RANGE(0x800600, 0x800601) AM_MIRROR(0x0381fe) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x800600, 0x800601) AM_MIRROR(0x0381fe) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x800800, 0x8009ff) AM_MIRROR(0x038000) AM_WRITEONLY AM_SHARE("priorityram")
AM_RANGE(0x800a00, 0x800a01) AM_MIRROR(0x0381fe) AM_DEVWRITE8("jsa", atari_jsa_i_device, main_command_w, 0x00ff)
AM_RANGE(0x800c00, 0x800c01) AM_MIRROR(0x0381fe) AM_DEVWRITE("jsa", atari_jsa_i_device, sound_reset_w)
@@ -82,7 +82,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, blstroid_state )
AM_RANGE(0x801c00, 0x801c01) AM_MIRROR(0x0383fc) AM_READ_PORT("IN0")
AM_RANGE(0x801c02, 0x801c03) AM_MIRROR(0x0383fc) AM_READ_PORT("IN1")
AM_RANGE(0x802000, 0x8023ff) AM_MIRROR(0x038c00) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x803000, 0x8033ff) AM_MIRROR(0x038c00) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x803000, 0x8033ff) AM_MIRROR(0x038c00) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x804000, 0x804fff) AM_MIRROR(0x038000) AM_RAM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0x805000, 0x805fff) AM_MIRROR(0x038000) AM_RAM AM_SHARE("mob")
AM_RANGE(0x806000, 0x807fff) AM_MIRROR(0x038000) AM_RAM
@@ -183,7 +183,8 @@ static MACHINE_CONFIG_START( blstroid )
MCFG_MACHINE_RESET_OVERRIDE(blstroid_state,blstroid)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/boogwing.cpp b/src/mame/drivers/boogwing.cpp
index eedc7fcd2dc..3c073ab7546 100644
--- a/src/mame/drivers/boogwing.cpp
+++ b/src/mame/drivers/boogwing.cpp
@@ -389,6 +389,9 @@ static MACHINE_CONFIG_START( boogwing )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
diff --git a/src/mame/drivers/buggychl.cpp b/src/mame/drivers/buggychl.cpp
index 574b5e6054e..e56a176e94d 100644
--- a/src/mame/drivers/buggychl.cpp
+++ b/src/mame/drivers/buggychl.cpp
@@ -104,16 +104,6 @@ WRITE8_MEMBER(buggychl_state::bankswitch_w)
membank("bank1")->set_entry(data & 0x07); // shall we check if data&7 < # banks?
}
-WRITE8_MEMBER(buggychl_state::nmi_disable_w)
-{
- m_soundnmi->in_w<1>(0);
-}
-
-WRITE8_MEMBER(buggychl_state::nmi_enable_w)
-{
- m_soundnmi->in_w<1>(1);
-}
-
WRITE8_MEMBER(buggychl_state::sound_enable_w)
{
machine().sound().system_enable(data & 1);
@@ -130,7 +120,8 @@ READ8_MEMBER(buggychl_state::mcu_status_r)
// the schematics show that the two sound semaphore latch bits are actually flipped backwards when read by the sound cpu
// vs when read by the main cpu.
-// Given the other schematic errors, is this even correct?
+// Given the other schematic errors, and the fact that the sound board schematic is for the wrong pcb, is this even correct?
+// It isn't even obvious if the maincpu or sound cpu read the semaphores at all, ever.
// a cpu write to soundlatch sets ic12.2 so /Q is low, so cpu bit 1 and sound bit 0 read as clear
// a sound write to soundlatch2 clears ic12.1 so /Q is high, so cpu bit 0 and sound bit 1 read as set
// a cpu read of soundlatch2 sets ic12.1 so /Q is low, so cpu bit 0 and sound bit 1 read as clear
@@ -146,7 +137,59 @@ READ8_MEMBER(buggychl_state::sound_status_sound_r)
return (m_soundlatch2->pending_r() ? 2 : 0) | (m_soundlatch->pending_r() ? 0 : 1);
}
-
+/* Main cpu address map ( * = used within this section; x = don't care )
+ | | |
+15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+ * * R 74LS139 @ ic53
+ 0 0 * * * * * * * * * * * * * * R ROM (ic23)
+ 0 1 * * * * * * * * * * * * * * R ROM (ic22)
+ 1 * * * RW 74LS138 @ ic66
+ 1 0 0 0 0 * * * * * * * * * * * RW SRAM (ic36)
+ 1 0 0 0 1 * * * * * * * * * * * RW SRAM (ic35)
+ 1 0 0 1 * * * * * * * * * * * * RW /STYLRQ
+ (TODO: finish above, its quite complicated)
+ 1 0 1 * * * * * * * * * * * * * R /EXROMRD and /CDRRQW, banked ROM reads (generates a waitstate)
+ 1 1 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? (unknown, cut off on schematic)
+ 1 1 0 1 0 0 0 0 ? ? ? ? ? ? ? ? W HORIZON
+ 1 1 0 1 0 0 0 1 x x x x x x x x W ANY OUT (lamp d7, lockout d6, unused d5, ojmode d4, skyoff d3, sn31/4off d2, hinv d1, vinv d0)
+ 1 1 0 1 0 0 1 0 x x x x x x x x W BANKSWITCH (banking, rom selected on d2, d1, upper/lower half of rom on d0)
+ 1 1 0 1 0 0 1 1 x x x x x * * * W 74LS138 @ ic39
+ 1 1 0 1 0 0 1 1 x x x x x 0 0 0 W /TRESET (watchdog reset)
+ 1 1 0 1 0 0 1 1 x x x x x 0 0 1 W FLPD1,E1,F1,D2,E2,F2 on d0-d5 respectively
+ 1 1 0 1 0 0 1 1 x x x x x 0 1 0 W /SRESET (value of d0 latched; this is the mcu reset and resets the mcu semaphores as well)
+ 1 1 0 1 0 0 1 1 x x x x x 0 1 1 W STYLBANK (d4 controls latch at v-ic25.1)
+ 1 1 0 1 0 0 1 1 x x x x x 1 0 0 W SCCON1
+ 1 1 0 1 0 0 1 1 x x x x x 1 0 1 W SCCON2
+ 1 1 0 1 0 0 1 1 x x x x x 1 1 0 W SCCON3
+ 1 1 0 1 0 0 1 1 x x x x x 1 1 1 W SCCON4
+ (the four ports above are probably for connecting to a bezel score display, almost identical to that of Grand Champion; see https://ia800501.us.archive.org/16/items/ArcadeGameManualGrandchampion/grandchampion.pdf pdf pages 54 and 55)
+ 1 1 0 1 0 1 0 0 x x x x x x * * RW SEQRQ 74ls155 @ ic42
+ 1 1 0 1 0 1 0 0 x x x x x x 0 0 W Write to MCU in latch and set ic43.1 semaphore
+ 1 1 0 1 0 1 0 0 x x x x x x 0 0 R Read from MCU out latch and clear ic43.2 semaphore
+ 1 1 0 1 0 1 0 0 x x x x x x 0 1 R Read semaphores : /ic43.0 in d0 and ic43.1 in d1
+ 1 1 0 1 0 1 0 0 x x x x x x 1 x OPEN BUS
+ 1 1 0 1 0 1 0 1 * * * * * * * * RW OBJRQ (read/write obj SRAM vb-ic34)
+ 1 1 0 1 0 1 1 0 x x x * * W 74LS139 @ ic52
+ 1 1 0 1 0 1 1 0 x x x 0 0 x * * R INPUTA
+ (16 inputs read here in the 4 bytes)
+ 1 1 0 1 0 1 1 0 x x x 0 1 x * * R INPUTB
+ (16 inputs read here in the 4 bytes)
+ 1 1 0 1 0 1 1 0 x x x 1 0 x * * * SOUNDCS 74ls155 @ s-ic40
+ 1 1 0 1 0 1 1 0 x x x 1 0 x 0 0 R Read from Sound out latch, set s-ic12.1
+ 1 1 0 1 0 1 1 0 x x x 1 0 x 0 1 R Read sound semaphores: /s-ic12.1 in d0 and /s-ic12.2 in d1
+ 1 1 0 1 0 1 1 0 x x x 1 0 x 1 x R OPEN BUS
+ 1 1 0 1 0 1 1 0 x x x 1 0 x 0 0 W Write to Sound in latch, set s-ic12.2
+ 1 1 0 1 0 1 1 0 x x x 1 0 x 0 1 W OPEN BUS
+ 1 1 0 1 0 1 1 0 x x x 1 0 x 1 0 W OPEN BUS
+ 1 1 0 1 0 1 1 0 x x x 1 0 x 1 1 W SNDRESET (value of d0 latched; if high, this sets s-ic12.1, clears s-ic12.2, clears soundnmi enable, clears sound control latch, resets sound z80(s), zeroes all dac input latches, resets ay-3-8910 chips, and resets the waitstate request)
+ 1 1 0 1 0 1 1 0 x x x 1 1 x x x W ACCELCL
+ 1 1 0 1 0 1 1 1 x x * * * * * * RW /VCRRQ
+ (TODO: palette sram)
+ 1 1 0 1 1 0 ? ? ? ? ? ? ? ? ? ? ? /SCROLRQ
+ 1 1 0 1 1 1 ? ? ? ? ? ? ? ? ? ? ? /S_POSI
+ 1 1 1 0 ? ? ? ? ? ? ? ? ? ? ? ? ? (unknown, cut off on schematic)
+ 1 1 1 1 ? ? ? ? ? ? ? ? ? ? ? ? ? (unknown, cut off on schematic)
+*/
static ADDRESS_MAP_START( buggychl_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM /* A22-04 (23) */
AM_RANGE(0x4000, 0x7fff) AM_ROM /* A22-05 (22) */
@@ -155,25 +198,28 @@ static ADDRESS_MAP_START( buggychl_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0x9000, 0x9fff) AM_WRITE(buggychl_sprite_lookup_w)
AM_RANGE(0xa000, 0xbfff) AM_ROMBANK("bank1") AM_WRITE(buggychl_chargen_w) AM_SHARE("charram")
AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("videoram")
- AM_RANGE(0xd100, 0xd100) AM_WRITE(buggychl_ctrl_w)
- AM_RANGE(0xd200, 0xd200) AM_WRITE(bankswitch_w)
- AM_RANGE(0xd300, 0xd300) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
- AM_RANGE(0xd303, 0xd303) AM_WRITE(buggychl_sprite_lookup_bank_w)
- AM_RANGE(0xd400, 0xd400) AM_DEVREADWRITE("bmcu", taito68705_mcu_device, data_r, data_w)
- AM_RANGE(0xd401, 0xd401) AM_READ(mcu_status_r)
+ AM_RANGE(0xd100, 0xd100) AM_MIRROR(0x00ff) AM_WRITE(buggychl_ctrl_w)
+ AM_RANGE(0xd200, 0xd200) AM_MIRROR(0x00ff) AM_WRITE(bankswitch_w)
+ AM_RANGE(0xd300, 0xd300) AM_MIRROR(0x00f8) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
+ // d301 = flp stuff, unused?
+ // d302 = mcu reset latched d0
+ AM_RANGE(0xd303, 0xd303) AM_MIRROR(0x00f8) AM_WRITE(buggychl_sprite_lookup_bank_w)
+ // d304-d307 is SCCON, which seems to be for a bezel mounted 7seg score/time display like Grand Champion has
+ AM_RANGE(0xd400, 0xd400) AM_MIRROR(0x00fc) AM_DEVREADWRITE("bmcu", taito68705_mcu_device, data_r, data_w)
+ AM_RANGE(0xd401, 0xd401) AM_MIRROR(0x00fc) AM_READ(mcu_status_r)
AM_RANGE(0xd500, 0xd57f) AM_WRITEONLY AM_SHARE("spriteram")
- AM_RANGE(0xd600, 0xd600) AM_READ_PORT("DSW1")
- AM_RANGE(0xd601, 0xd601) AM_READ_PORT("DSW2")
- AM_RANGE(0xd602, 0xd602) AM_READ_PORT("DSW3")
- AM_RANGE(0xd603, 0xd603) AM_READ_PORT("IN0") /* player inputs */
- AM_RANGE(0xd608, 0xd608) AM_READ_PORT("WHEEL")
- AM_RANGE(0xd609, 0xd609) AM_READ_PORT("IN1") /* coin + accelerator */
-// AM_RANGE(0xd60a, 0xd60a) // other inputs, not used?
-// AM_RANGE(0xd60b, 0xd60b) // other inputs, not used?
- AM_RANGE(0xd610, 0xd610) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
- AM_RANGE(0xd611, 0xd611) AM_READ(sound_status_main_r)
-// AM_RANGE(0xd613, 0xd613) AM_WRITE(sound_reset_w)
- AM_RANGE(0xd618, 0xd618) AM_WRITENOP /* accelerator clear */
+ AM_RANGE(0xd600, 0xd600) AM_MIRROR(0x00e4) AM_READ_PORT("DSW1")
+ AM_RANGE(0xd601, 0xd601) AM_MIRROR(0x00e4) AM_READ_PORT("DSW2")
+ AM_RANGE(0xd602, 0xd602) AM_MIRROR(0x00e4) AM_READ_PORT("DSW3")
+ AM_RANGE(0xd603, 0xd603) AM_MIRROR(0x00e4) AM_READ_PORT("IN0") /* player inputs */
+ AM_RANGE(0xd608, 0xd608) AM_MIRROR(0x00e4) AM_READ_PORT("WHEEL")
+ AM_RANGE(0xd609, 0xd609) AM_MIRROR(0x00e4) AM_READ_PORT("IN1") /* coin + accelerator */
+// AM_RANGE(0xd60a, 0xd60a) AM_MIRROR(0x00e4) // other inputs, not used?
+// AM_RANGE(0xd60b, 0xd60b) AM_MIRROR(0x00e4) // other inputs, not used?
+ AM_RANGE(0xd610, 0xd610) AM_MIRROR(0x00e4) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
+ AM_RANGE(0xd611, 0xd611) AM_MIRROR(0x00e4) AM_READ(sound_status_main_r)
+// AM_RANGE(0xd613, 0xd613) AM_MIRROR(0x00e4) AM_WRITE(sound_reset_w)
+ AM_RANGE(0xd618, 0xd618) AM_MIRROR(0x00e7) AM_WRITENOP /* accelerator clear; TODO: should we emulate the proper quadrature counter here? */
AM_RANGE(0xd700, 0xd7ff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xd840, 0xd85f) AM_WRITEONLY AM_SHARE("scrollv")
AM_RANGE(0xdb00, 0xdbff) AM_WRITEONLY AM_SHARE("scrollh")
@@ -181,6 +227,10 @@ static ADDRESS_MAP_START( buggychl_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0xdc06, 0xdc06) AM_WRITE(buggychl_bg_scrollx_w)
ADDRESS_MAP_END
+/* The schematics for buggy challenge has the wrong sound board schematic attached to it.
+ (The schematic is for an unknown taito game, possibly never released.)
+ The final buggy challenge sound board is more similar to Fairyland Story sound
+ hardware, except it has two YM2149 chips instead of one, and much less ROM space. */
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
@@ -188,11 +238,11 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, buggychl_state )
AM_RANGE(0x4802, 0x4803) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
AM_RANGE(0x4810, 0x481d) AM_DEVWRITE("msm", msm5232_device, write)
AM_RANGE(0x4820, 0x4820) AM_RAM /* VOL/BAL for the 7630 on the MSM5232 output */
- AM_RANGE(0x4830, 0x4830) AM_RAM /* TRBL/BASS for the 7630 on the MSM5232 output */
+ AM_RANGE(0x4830, 0x4830) AM_RAM /* TRBL/BASS for the 7630 on the MSM5232 output */
AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
- AM_RANGE(0x5001, 0x5001) AM_READ(sound_status_sound_r) AM_WRITE(nmi_enable_w)
- AM_RANGE(0x5002, 0x5002) AM_WRITE(nmi_disable_w)
- AM_RANGE(0x5003, 0x5003) AM_WRITE(sound_enable_w) // this actually controls the irq generation for the sound cpu as well as a few other things
+ AM_RANGE(0x5001, 0x5001) AM_READ(sound_status_sound_r) AM_DEVWRITE("soundnmi", input_merger_device, in_set<1>)
+ AM_RANGE(0x5002, 0x5002) AM_DEVWRITE("soundnmi", input_merger_device, in_clear<1>)
+ AM_RANGE(0x5003, 0x5003) AM_WRITE(sound_enable_w) // unclear what this actually controls
AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostics ROM */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp
index 14dd1adcd86..6a36af382a8 100644
--- a/src/mame/drivers/cbm2.cpp
+++ b/src/mame/drivers/cbm2.cpp
@@ -2701,12 +2701,15 @@ static MACHINE_CONFIG_DERIVED( bx256hp, b256hp )
MCFG_CPU_IO_MAP(ext_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE(EXT_I8259A_TAG, pic8259_device, inta_cb)
- MCFG_PIC8259_ADD(EXT_I8259A_TAG, INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+ MCFG_DEVICE_ADD(EXT_I8259A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0))
+
MCFG_DEVICE_ADD(EXT_MOS6525_TAG, TPI6525, 0)
MCFG_TPI6525_IN_PA_CB(DEVREAD8(EXT_MOS6526_TAG, mos6526_device, pa_r))
MCFG_TPI6525_IN_PB_CB(READ8(cbm2_state, ext_tpi_pb_r))
MCFG_TPI6525_OUT_PB_CB(WRITE8(cbm2_state, ext_tpi_pb_w))
MCFG_TPI6525_OUT_PC_CB(WRITE8(cbm2_state, ext_tpi_pc_w))
+
MCFG_DEVICE_ADD(EXT_MOS6526_TAG, MOS6526, XTAL_18MHz/9)
MCFG_MOS6526_TOD(60)
MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(cbm2_state, ext_cia_irq_w))
@@ -2764,12 +2767,15 @@ static MACHINE_CONFIG_DERIVED( cbm730, cbm720 )
MCFG_CPU_IO_MAP(ext_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE(EXT_I8259A_TAG, pic8259_device, inta_cb)
- MCFG_PIC8259_ADD(EXT_I8259A_TAG, INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+ MCFG_DEVICE_ADD(EXT_I8259A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(EXT_I8088_TAG, INPUT_LINE_IRQ0))
+
MCFG_DEVICE_ADD(EXT_MOS6525_TAG, TPI6525, 0)
MCFG_TPI6525_IN_PA_CB(DEVREAD8(EXT_MOS6526_TAG, mos6526_device, pa_r))
MCFG_TPI6525_IN_PB_CB(READ8(cbm2_state, ext_tpi_pb_r))
MCFG_TPI6525_OUT_PB_CB(WRITE8(cbm2_state, ext_tpi_pb_w))
MCFG_TPI6525_OUT_PC_CB(WRITE8(cbm2_state, ext_tpi_pc_w))
+
MCFG_DEVICE_ADD(EXT_MOS6526_TAG, MOS6526, XTAL_18MHz/9)
MCFG_MOS6526_TOD(50)
MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(cbm2_state, ext_cia_irq_w))
diff --git a/src/mame/drivers/champbwl.cpp b/src/mame/drivers/champbwl.cpp
index 7e358ebc34a..e0795918195 100644
--- a/src/mame/drivers/champbwl.cpp
+++ b/src/mame/drivers/champbwl.cpp
@@ -169,7 +169,9 @@ public:
m_maincpu(*this, "maincpu"),
m_seta001(*this, "spritegen"),
m_palette(*this, "palette"),
- m_x1(*this, "x1snd") { }
+ m_x1(*this, "x1snd"),
+ m_fakex(*this, "FAKEX"),
+ m_fakey(*this, "FAKEY") { }
int m_screenflip;
@@ -177,8 +179,13 @@ public:
required_device<seta001_device> m_seta001;
required_device<palette_device> m_palette;
required_device<x1_010_device> m_x1;
+
+ optional_ioport m_fakex;
+ optional_ioport m_fakey;
uint8_t m_last_trackball_val[2];
+
DECLARE_READ8_MEMBER(trackball_r);
+ DECLARE_READ8_MEMBER(trackball_reset_r);
DECLARE_WRITE8_MEMBER(champbwl_misc_w);
DECLARE_WRITE8_MEMBER(doraemon_outputs_w);
DECLARE_MACHINE_START(champbwl);
@@ -207,17 +214,24 @@ PALETTE_INIT_MEMBER(champbwl_state,champbwl)
READ8_MEMBER(champbwl_state::trackball_r)
{
uint8_t ret;
- uint8_t port4 = ioport("FAKEX")->read();
- uint8_t port5 = ioport("FAKEY")->read();
+ uint8_t port4 = m_fakex->read();
+ uint8_t port5 = m_fakey->read();
ret = (((port4 - m_last_trackball_val[0]) & 0x0f)<<4) | ((port5 - m_last_trackball_val[1]) & 0x0f);
- m_last_trackball_val[0] = port4;
- m_last_trackball_val[1] = port5;
-
return ret;
}
+READ8_MEMBER(champbwl_state::trackball_reset_r)
+{
+ if (!machine().side_effect_disabled())
+ {
+ m_last_trackball_val[0] = m_fakex->read();
+ m_last_trackball_val[1] = m_fakey->read();
+ }
+ return 0xff;
+}
+
WRITE8_MEMBER(champbwl_state::champbwl_misc_w)
{
machine().bookkeeping().coin_counter_w(0, data & 1);
@@ -242,7 +256,7 @@ static ADDRESS_MAP_START( champbwl_map, AS_PROGRAM, 8, champbwl_state )
AM_RANGE(0xf000, 0xf000) AM_READ(trackball_r)
AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN0")
- AM_RANGE(0xf004, 0xf004) AM_READ_PORT("IN1")
+ AM_RANGE(0xf004, 0xf004) AM_READ(trackball_reset_r)
AM_RANGE(0xf006, 0xf006) AM_READ_PORT("IN2")
AM_RANGE(0xf007, 0xf007) AM_READ_PORT("IN3")
@@ -298,32 +312,6 @@ static INPUT_PORTS_START( champbwl )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) // INT( 4M)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) // INT(16M)
- PORT_START("IN1")
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
PORT_START("IN2")
PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:1" )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:2")
diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp
index eabf178c61c..3b683834867 100644
--- a/src/mame/drivers/cninja.cpp
+++ b/src/mame/drivers/cninja.cpp
@@ -407,8 +407,21 @@ static ADDRESS_MAP_START( stoneage_s_map, AS_PROGRAM, 8, cninja_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x8800, 0x8801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
+ AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( cninjabl2_s_map, AS_PROGRAM, 8, cninja_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM
+ AM_RANGE(0x8000, 0x87ff) AM_RAM
+ AM_RANGE(0x9000, 0x9000) AM_WRITE(cninjabl2_oki_bank_w)
AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
+ AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( cninjabl2_oki_map, 0, 8, cninja_state )
+ AM_RANGE(0x00000, 0x2ffff) AM_ROM AM_REGION("oki1", 0)
+ AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank")
ADDRESS_MAP_END
/***********************************************************
@@ -793,6 +806,11 @@ WRITE8_MEMBER(cninja_state::sound_bankswitch_w)
m_oki2->set_rom_bank(data & 1);
}
+WRITE8_MEMBER(cninja_state::cninjabl2_oki_bank_w)
+{
+ m_okibank->set_entry(data & 7);
+}
+
/**********************************************************************************/
DECO16IC_BANK_CB_MEMBER(cninja_state::cninja_bank_callback)
@@ -908,6 +926,9 @@ static MACHINE_CONFIG_START( cninja )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
/* sound hardware */
@@ -997,6 +1018,9 @@ static MACHINE_CONFIG_START( stoneage )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
@@ -1012,15 +1036,20 @@ static MACHINE_CONFIG_START( stoneage )
MCFG_OKIM6295_ADD("oki1", 32220000/32, PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
-
- MCFG_OKIM6295_ADD("oki2", 32220000/16, PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cninjabl2, stoneage )
+ MCFG_CPU_MODIFY("audiocpu")
+ MCFG_CPU_PROGRAM_MAP(cninjabl2_s_map)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(cninja_state, screen_update_cninjabl2)
+
+ MCFG_DEVICE_REMOVE("ymsnd")
+
+ MCFG_OKIM6295_REPLACE("oki1", 32220000/32, PIN7_LOW)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_DEVICE_ADDRESS_MAP(0, cninjabl2_oki_map)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( cninjabl )
@@ -1158,6 +1187,9 @@ static MACHINE_CONFIG_START( edrandy )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1245,6 +1277,9 @@ static MACHINE_CONFIG_START( robocop2 )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
@@ -1341,6 +1376,9 @@ static MACHINE_CONFIG_START( mutantf )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -1596,9 +1634,6 @@ ROM_START( stoneage )
ROM_REGION( 0x40000, "oki1", 0 ) /* Oki samples */
ROM_LOAD( "sa_1_069.bin", 0x00000, 0x40000, CRC(2188f3ca) SHA1(9c29b62ed261e63d701ff8d43020089c89a64ab2) )
-
- /* No extra Oki samples in the bootleg */
- ROM_REGION( 0x80000, "oki2", ROMREGION_ERASEFF )
ROM_END
ROM_START( cninjabl )
@@ -1662,9 +1697,9 @@ ROM_START( cninjabl2 )
ROM_LOAD16_BYTE( "mag-04.rom", 0x100000, 0x80000, CRC(144b94cc) SHA1(d982508608942a714b428a2b721bf24e1627cbb6) )
ROM_LOAD16_BYTE( "mag-06.rom", 0x100001, 0x80000, CRC(82d44749) SHA1(c471fa573e00c2f8ae44068439ba6d849a124c68) )
- ROM_REGION( 0x40000, "oki1", 0 ) /* Oki samples */
+ ROM_REGION( 0x30000, "oki1", 0 ) /* Oki samples */
ROM_LOAD( "audio-samp.2", 0x00000, 0x20000, CRC(c6638568) SHA1(b5e38d807146b033d1a0b5fb013ac755cd4a2699) )
- ROM_LOAD( "audio-samp.1", 0x00000, 0x10000, CRC(7815e6ab) SHA1(3112b4e8a4008b519f73e6f2d1393ef1e620a0c5) )
+ ROM_LOAD( "audio-samp.1", 0x20000, 0x10000, CRC(7815e6ab) SHA1(3112b4e8a4008b519f73e6f2d1393ef1e620a0c5) )
ROM_REGION( 0x80000, "oki2", 0 ) /* Extra Oki samples */
ROM_LOAD( "audio-samp.18", 0x00000, 0x80000, CRC(06f1bc18) SHA1(fe551d78466dc5b098263520f0ab00200d651593) ) /* banked */
@@ -2308,6 +2343,8 @@ DRIVER_INIT_MEMBER(cninja_state,cninjabl2)
{
m_maincpu->space(AS_PROGRAM).install_ram(0x180000, 0x18ffff);
m_maincpu->space(AS_PROGRAM).install_read_handler(0x1b4000, 0x1b4001, read16_delegate(FUNC(cninja_state::cninjabl2_sprite_dma_r),this));
+
+ m_okibank->configure_entries(0, 8, memregion("oki2")->base(), 0x10000);
}
DRIVER_INIT_MEMBER(cninja_state,mutantf)
@@ -2337,7 +2374,7 @@ GAME( 1991, cninjau, cninja, cninja, cninjau, cninja_state, cninja, ROT0
GAME( 1991, joemac, cninja, cninja, cninja, cninja_state, cninja, ROT0, "Data East Corporation", "Tatakae Genshizin Joe & Mac (Japan ver 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, stoneage, cninja, stoneage, cninja, cninja_state, stoneage, ROT0, "bootleg", "Stoneage (bootleg of Caveman Ninja)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, cninjabl, cninja, cninjabl, cninja, cninja_state, 0, ROT0, "bootleg", "Caveman Ninja (bootleg)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, cninjabl2,cninja, cninjabl2,cninja, cninja_state, cninjabl2,ROT0, "bootleg", "Tatakae Genshizin Joe & Mac (Japan, bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // tile layers need adjusting, sound is wrong
+GAME( 1991, cninjabl2,cninja, cninjabl2,cninja, cninja_state, cninjabl2,ROT0, "bootleg", "Tatakae Genshizin Joe & Mac (Japan, bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // tile layers need adjusting
GAME( 1991, robocop2, 0, robocop2, robocop2, cninja_state, 0, ROT0, "Data East Corporation", "Robocop 2 (Euro/Asia v0.10)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, robocop2u,robocop2, robocop2, robocop2, cninja_state, 0, ROT0, "Data East Corporation", "Robocop 2 (US v0.10)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/cyberbal.cpp b/src/mame/drivers/cyberbal.cpp
index 3145013d72b..8fd7c144413 100644
--- a/src/mame/drivers/cyberbal.cpp
+++ b/src/mame/drivers/cyberbal.cpp
@@ -24,6 +24,7 @@
#include "emu.h"
#include "includes/cyberbal.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/volt_reg.h"
#include "speaker.h"
@@ -128,9 +129,9 @@ WRITE16_MEMBER(cyberbal_state::p2_reset_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
- AM_RANGE(0xfc0000, 0xfc0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xfc0000, 0xfc0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0xfc8000, 0xfcffff) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0xff00)
- AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xfd0000, 0xfd1fff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xfd2000, 0xfd3fff) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0xfd4000, 0xfd5fff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE(p2_reset_w)
@@ -232,9 +233,9 @@ static ADDRESS_MAP_START( cyberbal2p_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0xfc2000, 0xfc2003) AM_READ_PORT("IN1")
AM_RANGE(0xfc4000, 0xfc4003) AM_READ_PORT("IN2")
AM_RANGE(0xfc6000, 0xfc6003) AM_DEVREAD8("jsa", atari_jsa_ii_device, main_response_r, 0xff00)
- AM_RANGE(0xfc8000, 0xfc8fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xfc8000, 0xfc8fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0xfca000, 0xfcafff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0xfd0000, 0xfd0003) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xfd0000, 0xfd0003) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xfd2000, 0xfd2003) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
AM_RANGE(0xfd4000, 0xfd4003) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xfd6000, 0xfd6003) AM_WRITE(video_int_ack_w)
@@ -417,7 +418,8 @@ static MACHINE_CONFIG_START( cyberbal )
MCFG_MACHINE_START_OVERRIDE(cyberbal_state,cyberbal)
MCFG_MACHINE_RESET_OVERRIDE(cyberbal_state,cyberbal)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -476,7 +478,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cyberbalt, cyberbal )
MCFG_DEVICE_REMOVE("eeprom")
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_SLAPSTIC_ADD("slapstic", 116)
MACHINE_CONFIG_END
@@ -492,7 +495,8 @@ static MACHINE_CONFIG_START( cyberbal2p )
MCFG_MACHINE_START_OVERRIDE(cyberbal_state,cyberbal2p)
MCFG_MACHINE_RESET_OVERRIDE(cyberbal_state,cyberbal2p)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -587,7 +591,7 @@ ROM_START( cyberbal )
ROM_LOAD( "gal16v8-136064-1029.d58", 0x0600, 0x0117, CRC(fd39d238) SHA1(55c1b9a56c9b2bfa434eed54f7baea436ea141b8) )
ROM_LOAD( "gal16v8-136064-1030.d91", 0x0800, 0x0117, CRC(84102588) SHA1(b6bffb47e5975c96b056d07357eb020caf3f0a0a) )
- ROM_REGION( 0x200, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x200, "eeprom", 0 )
ROM_LOAD( "cyberbal-eeprom.bin", 0x0000, 0x200, CRC(c6f256b2) SHA1(e0c62adcd9fd38e9d3ac60e6b08d468e04a350c6) )
ROM_END
@@ -640,7 +644,7 @@ ROM_START( cyberbal2 )
ROM_LOAD( "136064-1121.15n", 0x000000, 0x010000, CRC(0ca1e3b3) SHA1(d934bc9a1def4404fb86175878404cbb18127a11) )
ROM_LOAD( "136064-1122.16n", 0x010000, 0x010000, CRC(882f4e1c) SHA1(f7517ff03502ff029fb375260a35e45414567433) )
- ROM_REGION( 0x200, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x200, "eeprom", 0 )
ROM_LOAD( "cyberbal-eeprom.bin", 0x0000, 0x200, CRC(c6f256b2) SHA1(e0c62adcd9fd38e9d3ac60e6b08d468e04a350c6) )
ROM_END
@@ -693,7 +697,7 @@ ROM_START( cyberbalp )
ROM_LOAD( "136064-1121.15n", 0x000000, 0x010000, CRC(0ca1e3b3) SHA1(d934bc9a1def4404fb86175878404cbb18127a11) )
ROM_LOAD( "136064-1122.16n", 0x010000, 0x010000, CRC(882f4e1c) SHA1(f7517ff03502ff029fb375260a35e45414567433) )
- ROM_REGION( 0x200, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x200, "eeprom", 0 )
ROM_LOAD( "cyberbal-eeprom.bin", 0x0000, 0x200, CRC(c6f256b2) SHA1(e0c62adcd9fd38e9d3ac60e6b08d468e04a350c6) )
ROM_END
@@ -742,7 +746,7 @@ ROM_START( cyberbal2p )
ROM_LOAD( "136071-1045.7e", 0x020000, 0x010000, CRC(f82558b9) SHA1(afbecccc6203db9bdcf60638e0f4e95040d7aaf2) )
ROM_LOAD( "136071-1046.7d", 0x030000, 0x010000, CRC(d96437ad) SHA1(b0b5cd75de4048e54b9d7d09a75381eb73c22ee1) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "cyberbal2p-eeprom.bin", 0x0000, 0x800, CRC(3753f0e2) SHA1(26feab263a4d2d1dfcdf62e1225e0596cc036e1d) )
ROM_END
@@ -791,7 +795,7 @@ ROM_START( cyberbal2p3 )
ROM_LOAD( "136071-1045.7e", 0x020000, 0x010000, CRC(f82558b9) SHA1(afbecccc6203db9bdcf60638e0f4e95040d7aaf2) )
ROM_LOAD( "136071-1046.7d", 0x030000, 0x010000, CRC(d96437ad) SHA1(b0b5cd75de4048e54b9d7d09a75381eb73c22ee1) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "cyberbal2p-eeprom.bin", 0x0000, 0x800, CRC(3753f0e2) SHA1(26feab263a4d2d1dfcdf62e1225e0596cc036e1d) )
ROM_END
@@ -840,7 +844,7 @@ ROM_START( cyberbal2p2 )
ROM_LOAD( "136071-1045.7e", 0x020000, 0x010000, CRC(f82558b9) SHA1(afbecccc6203db9bdcf60638e0f4e95040d7aaf2) )
ROM_LOAD( "136071-1046.7d", 0x030000, 0x010000, CRC(d96437ad) SHA1(b0b5cd75de4048e54b9d7d09a75381eb73c22ee1) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "cyberbal2p-eeprom.bin", 0x0000, 0x800, CRC(3753f0e2) SHA1(26feab263a4d2d1dfcdf62e1225e0596cc036e1d) )
ROM_END
@@ -889,7 +893,7 @@ ROM_START( cyberbal2p1 )
ROM_LOAD( "136071-1045.7e", 0x020000, 0x010000, CRC(f82558b9) SHA1(afbecccc6203db9bdcf60638e0f4e95040d7aaf2) )
ROM_LOAD( "136071-1046.7d", 0x030000, 0x010000, CRC(d96437ad) SHA1(b0b5cd75de4048e54b9d7d09a75381eb73c22ee1) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "cyberbal2p-eeprom.bin", 0x0000, 0x800, CRC(3753f0e2) SHA1(26feab263a4d2d1dfcdf62e1225e0596cc036e1d) )
ROM_END
@@ -940,7 +944,7 @@ ROM_START( cyberbalt )
ROM_LOAD( "136073-1005.15n", 0x000000, 0x010000, CRC(833b4768) SHA1(754f00089d439fb0aa1f650c1fef73cf7e5f33a1) )
ROM_LOAD( "136073-1006.16n", 0x010000, 0x010000, CRC(4976cffd) SHA1(4cac8d9bd30743da6e6e4f013e6101ebc27060b6) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "cyberbalt-eeprom.bin", 0x0000, 0x800, CRC(0743c0a6) SHA1(0b7421484f640b528e96aed103775e81bbb60f62) )
ROM_END
@@ -991,7 +995,7 @@ ROM_START( cyberbalt1 )
ROM_LOAD( "136073-1005.15n", 0x000000, 0x010000, CRC(833b4768) SHA1(754f00089d439fb0aa1f650c1fef73cf7e5f33a1) )
ROM_LOAD( "136073-1006.16n", 0x010000, 0x010000, CRC(4976cffd) SHA1(4cac8d9bd30743da6e6e4f013e6101ebc27060b6) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "cyberbalt-eeprom.bin", 0x0000, 0x800, CRC(0743c0a6) SHA1(0b7421484f640b528e96aed103775e81bbb60f62) )
ROM_END
diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp
index fc65892b079..57e86d496a4 100644
--- a/src/mame/drivers/dblewing.cpp
+++ b/src/mame/drivers/dblewing.cpp
@@ -61,7 +61,8 @@ Notes:
- - sound CPU seems to miss commands sometimes
+ - Main program writes two commands to soundlatch without pause in some places. Should the 104 custom
+ chip be handling this through an internal FIFO?
- should sprites be buffered, is the Deco '77' a '71' or similar?
*/
@@ -73,6 +74,7 @@ Notes:
#include "machine/deco104.h"
#include "machine/decocrpt.h"
#include "machine/gen_latch.h"
+#include "machine/input_merger.h"
#include "sound/okim6295.h"
#include "sound/ym2151.h"
#include "video/deco16ic.h"
@@ -103,9 +105,6 @@ public:
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_decrypted_opcodes;
- /* misc */
- uint8_t m_sound_irq;
-
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@@ -114,7 +113,6 @@ public:
required_device<decospr_device> m_sprgen;
required_device<generic_latch_8_device> m_soundlatch;
- DECLARE_WRITE_LINE_MEMBER(sound_irq);
DECLARE_READ8_MEMBER(irq_latch_r);
DECLARE_DRIVER_INIT(dblewing);
virtual void machine_start() override;
@@ -191,10 +189,7 @@ ADDRESS_MAP_END
READ8_MEMBER(dblewing_state::irq_latch_r)
{
- /* bit 1 of dblewing_sound_irq specifies IRQ command writes */
- m_sound_irq &= ~0x02;
- m_audiocpu->set_input_line(0, (m_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
- return m_sound_irq;
+ return m_soundlatch->pending_r() ? 0 : 1;
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, dblewing_state )
@@ -329,16 +324,6 @@ static INPUT_PORTS_START( dblewing )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
INPUT_PORTS_END
-WRITE_LINE_MEMBER(dblewing_state::sound_irq)
-{
- /* bit 0 of dblewing_sound_irq specifies IRQ from sound chip */
- if (state)
- m_sound_irq |= 0x01;
- else
- m_sound_irq &= ~0x01;
- m_audiocpu->set_input_line(0, (m_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
-}
-
DECO16IC_BANK_CB_MEMBER(dblewing_state::bank_callback)
{
return ((bank >> 4) & 0x7) * 0x1000;
@@ -352,19 +337,15 @@ DECOSPR_PRIORITY_CB_MEMBER(dblewing_state::pri_callback)
void dblewing_state::machine_start()
{
- save_item(NAME(m_sound_irq));
}
void dblewing_state::machine_reset()
{
- m_sound_irq = 0;
}
void dblewing_state::dblewing_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask )
{
m_soundlatch->write(space, 0, data & 0xff);
- m_sound_irq |= 0x02;
- m_audiocpu->set_input_line(0, (m_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
}
static MACHINE_CONFIG_START( dblewing )
@@ -379,6 +360,9 @@ static MACHINE_CONFIG_START( dblewing )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_io)
+ MCFG_INPUT_MERGER_ANY_HIGH("soundirq")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", 0))
+
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
@@ -416,6 +400,9 @@ static MACHINE_CONFIG_START( dblewing )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(dblewing_state, dblewing_sound_cb)
@@ -424,9 +411,10 @@ static MACHINE_CONFIG_START( dblewing )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(DEVWRITELINE("soundirq", input_merger_device, in_w<1>))
MCFG_YM2151_ADD("ymsnd", XTAL_32_22MHz/9)
- MCFG_YM2151_IRQ_HANDLER(WRITELINE(dblewing_state, sound_irq))
+ MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("soundirq", input_merger_device, in_w<0>))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MCFG_OKIM6295_ADD("oki", XTAL_28MHz/28, PIN7_HIGH)
diff --git a/src/mame/drivers/ddragon3.cpp b/src/mame/drivers/ddragon3.cpp
index 4f6616b16ed..accead64048 100644
--- a/src/mame/drivers/ddragon3.cpp
+++ b/src/mame/drivers/ddragon3.cpp
@@ -205,48 +205,28 @@ WRITE8_MEMBER(ddragon3_state::oki_bankswitch_w)
WRITE16_MEMBER(wwfwfest_state::wwfwfest_soundwrite)
{
- m_soundlatch->write(space,1,data & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
+ // upper byte is always set to 0x31 for some reason
+ m_soundlatch->write(space, 0, data & 0xff);
}
-WRITE16_MEMBER(ddragon3_state::ddragon3_io_w)
+WRITE16_MEMBER(ddragon3_state::ddragon3_vreg_w)
{
- COMBINE_DATA(&m_io_reg[offset]);
+ COMBINE_DATA(&m_vreg);
+}
- switch (offset)
- {
- case 0:
- m_vreg = m_io_reg[0];
- break;
-
- case 1: /* soundlatch write */
- m_soundlatch->write(space, 1, m_io_reg[1] & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
- break;
-
- case 2:
- /* this gets written to on startup and at the end of IRQ6
- ** possibly trigger IRQ on sound CPU
- */
- m_maincpu->set_input_line(6, CLEAR_LINE);
- break;
-
- case 3:
- /* this gets written to on startup,
- ** and at the end of IRQ5 (input port read) */
- m_maincpu->set_input_line(5, CLEAR_LINE);
- break;
-
- case 4:
- /* this gets written to at the end of IRQ6 only */
- m_maincpu->set_input_line(6, CLEAR_LINE);
- break;
-
- default:
- logerror("OUTPUT 1400[%02x] %08x, pc=%06x \n", offset, (unsigned)data, space.device().safe_pc() );
- break;
- }
+
+WRITE16_MEMBER(ddragon3_state::irq6_ack_w)
+{
+ // this gets written to on startup and at the end of IRQ6
+ m_maincpu->set_input_line(6, CLEAR_LINE);
+}
+
+
+WRITE16_MEMBER(ddragon3_state::irq5_ack_w)
+{
+ // this gets written to on startup and at the end of IRQ5 (input port read)
+ m_maincpu->set_input_line(5, CLEAR_LINE);
}
@@ -312,6 +292,7 @@ CUSTOM_INPUT_MEMBER(wwfwfest_state::dsw_c0_r)
static ADDRESS_MAP_START( ddragon3_map, AS_PROGRAM, 16, ddragon3_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
+ AM_RANGE(0x000004, 0x000007) AM_WRITENOP
AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(ddragon3_fg_videoram_w) AM_SHARE("fg_videoram") /* Foreground (32x32 Tiles - 4 by per tile) */
AM_RANGE(0x082000, 0x0827ff) AM_RAM_WRITE(ddragon3_bg_videoram_w) AM_SHARE("bg_videoram") /* Background (32x32 Tiles - 2 by per tile) */
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(ddragon3_scroll_w)
@@ -319,7 +300,10 @@ static ADDRESS_MAP_START( ddragon3_map, AS_PROGRAM, 16, ddragon3_state )
AM_RANGE(0x100002, 0x100003) AM_READ_PORT("SYSTEM")
AM_RANGE(0x100004, 0x100005) AM_READ_PORT("DSW")
AM_RANGE(0x100006, 0x100007) AM_READ_PORT("P3")
- AM_RANGE(0x100000, 0x10000f) AM_WRITE(ddragon3_io_w)
+ AM_RANGE(0x100000, 0x100001) AM_WRITE(ddragon3_vreg_w)
+ AM_RANGE(0x100002, 0x100003) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
+ AM_RANGE(0x100004, 0x100005) AM_WRITE(irq6_ack_w)
+ AM_RANGE(0x100006, 0x100007) AM_WRITE(irq5_ack_w)
AM_RANGE(0x140000, 0x1405ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") /* Palette RAM */
AM_RANGE(0x180000, 0x180fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* working RAM */
@@ -332,7 +316,11 @@ static ADDRESS_MAP_START( dd3b_map, AS_PROGRAM, 16, ddragon3_state )
AM_RANGE(0x082000, 0x0827ff) AM_RAM_WRITE(ddragon3_bg_videoram_w) AM_SHARE("bg_videoram") /* Background (32x32 Tiles - 2 by per tile) */
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(ddragon3_scroll_w)
AM_RANGE(0x100000, 0x1005ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") /* Palette RAM */
- AM_RANGE(0x140000, 0x14000f) AM_WRITE(ddragon3_io_w)
+ AM_RANGE(0x140000, 0x140001) AM_WRITE(ddragon3_vreg_w)
+ AM_RANGE(0x140002, 0x140003) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
+ AM_RANGE(0x140004, 0x140005) AM_WRITE(irq6_ack_w)
+ AM_RANGE(0x140006, 0x140007) AM_WRITE(irq5_ack_w)
+ AM_RANGE(0x140008, 0x140009) AM_DEVWRITE("spriteram", buffered_spriteram16_device, write)
AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN0")
AM_RANGE(0x180002, 0x180003) AM_READ_PORT("IN1")
AM_RANGE(0x180004, 0x180005) AM_READ_PORT("IN2")
@@ -348,7 +336,11 @@ static ADDRESS_MAP_START( ctribe_map, AS_PROGRAM, 16, ddragon3_state )
AM_RANGE(0x082800, 0x082fff) AM_RAM
AM_RANGE(0x0c0000, 0x0c000f) AM_READWRITE(ddragon3_scroll_r, ddragon3_scroll_w)
AM_RANGE(0x100000, 0x1005ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") /* Palette RAM */
- AM_RANGE(0x140000, 0x14000f) AM_WRITE(ddragon3_io_w)
+ AM_RANGE(0x140000, 0x140001) AM_WRITE(ddragon3_vreg_w)
+ AM_RANGE(0x140002, 0x140003) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
+ AM_RANGE(0x140004, 0x140005) AM_WRITE(irq6_ack_w)
+ AM_RANGE(0x140006, 0x140007) AM_WRITE(irq5_ack_w)
+ AM_RANGE(0x140008, 0x140009) AM_DEVWRITE("spriteram", buffered_spriteram16_device, write)
AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN0")
AM_RANGE(0x180002, 0x180003) AM_READ_PORT("IN1")
AM_RANGE(0x180004, 0x180005) AM_READ_PORT("IN2")
@@ -810,22 +802,16 @@ void ddragon3_state::machine_start()
save_item(NAME(m_fg_scrollx));
save_item(NAME(m_fg_scrolly));
save_item(NAME(m_bg_tilebase));
- save_item(NAME(m_io_reg));
}
void ddragon3_state::machine_reset()
{
- int i;
-
m_vreg = 0;
m_bg_scrollx = 0;
m_bg_scrolly = 0;
m_fg_scrollx = 0;
m_fg_scrolly = 0;
m_bg_tilebase = 0;
-
- for (i = 0; i < 8; i++)
- m_io_reg[i] = 0;
}
static MACHINE_CONFIG_START( ddragon3 )
@@ -855,6 +841,7 @@ static MACHINE_CONFIG_START( ddragon3 )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_YM2151_ADD("ym2151", XTAL_3_579545MHz)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -870,6 +857,9 @@ static MACHINE_CONFIG_DERIVED( ddragon3b, ddragon3 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(dd3b_map)
+
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_VBLANK_CALLBACK(NOOP)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ctribe, ddragon3 )
@@ -885,6 +875,7 @@ static MACHINE_CONFIG_DERIVED( ctribe, ddragon3 )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(ddragon3_state, screen_update_ctribe)
+ MCFG_SCREEN_VBLANK_CALLBACK(NOOP)
MCFG_SOUND_MODIFY("ym2151")
MCFG_SOUND_ROUTES_RESET()
@@ -925,6 +916,7 @@ static MACHINE_CONFIG_START( wwfwfest )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_YM2151_ADD("ym2151", XTAL_3_579545MHz)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp
index 2c7fa75d2bf..fcb88205ab1 100644
--- a/src/mame/drivers/deco32.cpp
+++ b/src/mame/drivers/deco32.cpp
@@ -728,11 +728,6 @@ WRITE32_MEMBER(deco32_state::tattass_control_w)
/**********************************************************************************/
-uint16_t deco32_state::port_b_nslasher(int unused)
-{
- return (m_eeprom->do_read());
-}
-
void deco32_state::nslasher_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask )
{
/* bit 1 of nslasher_sound_irq specifies IRQ command writes */
@@ -741,7 +736,7 @@ void deco32_state::nslasher_sound_cb( address_space &space, uint16_t data, uint1
m_audiocpu->set_input_line(0, (m_nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
}
-uint16_t deco32_state::port_b_tattass(int unused)
+READ16_MEMBER(deco32_state::port_b_tattass)
{
return m_tattass_eprom_bit;
}
@@ -1913,6 +1908,9 @@ static MACHINE_CONFIG_START( captaven )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb)
MCFG_VIDEO_START_OVERRIDE(deco32_state,captaven)
@@ -1938,21 +1936,6 @@ static MACHINE_CONFIG_START( captaven )
MACHINE_CONFIG_END
-uint16_t deco32_state::port_a_fghthist(int unused)
-{
- return machine().root_device().ioport(":IN0")->read();
-}
-
-uint16_t deco32_state::port_b_fghthist(int unused)
-{
- return machine().device<eeprom_serial_93cxx_device>(":eeprom")->do_read();
-}
-
-uint16_t deco32_state::port_c_fghthist(int unused)
-{
- return machine().root_device().ioport(":IN1")->read();
-}
-
DECO16IC_BANK_CB_MEMBER(deco32_state::fghthist_bank_callback)
{
bank = bank >> 4;
@@ -2018,9 +2001,9 @@ static MACHINE_CONFIG_START( fghthist ) /* DE-0380-2 PCB */
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
- MCFG_DECO146_SET_PORTA_CALLBACK( deco32_state, port_a_fghthist )
- MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_fghthist )
- MCFG_DECO146_SET_PORTC_CALLBACK( deco32_state, port_c_fghthist )
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0"))
+ MCFG_DECO146_IN_PORTB_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
@@ -2104,9 +2087,9 @@ static MACHINE_CONFIG_START( fghthsta ) /* DE-0395-1 PCB */
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
- MCFG_DECO146_SET_PORTA_CALLBACK( deco32_state, port_a_fghthist )
- MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_fghthist )
- MCFG_DECO146_SET_PORTC_CALLBACK( deco32_state, port_c_fghthist )
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0"))
+ MCFG_DECO146_IN_PORTB_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
@@ -2149,9 +2132,9 @@ static MACHINE_CONFIG_DERIVED( fghthistz, fghthsta )
/*
MCFG_DEVICE_REMOVE("ioprot")
MCFG_DECO146_ADD("ioprot")
- MCFG_DECO146_SET_PORTA_CALLBACK( deco32_state, port_a_fghthist )
- MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_fghthist )
- MCFG_DECO146_SET_PORTC_CALLBACK( deco32_state, port_c_fghthist )
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("IN0"))
+ MCFG_DECO146_IN_PORTB_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("IN1"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, nslasher_sound_cb)
@@ -2236,6 +2219,9 @@ static MACHINE_CONFIG_START( dragngun )
MCFG_VIDEO_START_OVERRIDE(dragngun_state,dragngun)
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb)
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
@@ -2344,6 +2330,9 @@ static MACHINE_CONFIG_START( lockload )
MCFG_DECO_ZOOMSPR_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb)
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
@@ -2441,7 +2430,9 @@ static MACHINE_CONFIG_START( tattass )
MCFG_PALETTE_ADD("palette", 2048)
MCFG_DECO104_ADD("ioprot104")
- MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_tattass )
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(READ16(deco32_state, port_b_tattass))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, tattass_sound_cb)
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
@@ -2517,7 +2508,9 @@ static MACHINE_CONFIG_START( nslasher )
MCFG_VIDEO_START_OVERRIDE(deco32_state,nslasher)
MCFG_DECO104_ADD("ioprot104")
- MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_nslasher )
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, nslasher_sound_cb)
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
@@ -2551,7 +2544,9 @@ static MACHINE_CONFIG_DERIVED( nslasheru, nslasher )
MCFG_DEVICE_REMOVE("ioprot104")
MCFG_DECO104_ADD("ioprot104")
- MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_nslasher )
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(DEVREADLINE("eeprom", eeprom_serial_93cxx_device, do_read)) MCFG_DEVCB_BIT(0)
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb)
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/deniam.cpp b/src/mame/drivers/deniam.cpp
index ca1e338a95d..a8f7368c199 100644
--- a/src/mame/drivers/deniam.cpp
+++ b/src/mame/drivers/deniam.cpp
@@ -54,15 +54,6 @@ Notes:
#include "speaker.h"
-WRITE16_MEMBER(deniam_state::sound_command_w)
-{
- if (ACCESSING_BITS_8_15)
- {
- m_soundlatch->write(space,offset, (data >> 8) & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- }
-}
-
WRITE8_MEMBER(deniam_state::deniam16b_oki_rom_bank_w)
{
m_oki->set_rom_bank((data >> 6) & 1);
@@ -88,7 +79,7 @@ static ADDRESS_MAP_START( deniam16b_map, AS_PROGRAM, 16, deniam_state )
AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(deniam_textram_w) AM_SHARE("textram")
AM_RANGE(0x440000, 0x4407ff) AM_WRITEONLY AM_SHARE("spriteram")
AM_RANGE(0x840000, 0x840fff) AM_WRITE(deniam_palette_w) AM_SHARE("paletteram")
- AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_w)
+ AM_RANGE(0xc40000, 0xc40001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0xff00)
AM_RANGE(0xc40002, 0xc40003) AM_READWRITE(deniam_coinctrl_r, deniam_coinctrl_w)
AM_RANGE(0xc40004, 0xc40005) AM_WRITE(deniam_irq_ack_w)
AM_RANGE(0xc44000, 0xc44001) AM_READ_PORT("SYSTEM")
@@ -285,6 +276,7 @@ static MACHINE_CONFIG_START( deniam16b )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_25MHz/6) /* "SM64" ym3812 clone; 4.166470 measured, = 4.166666Mhz verified */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp
index 7afb407d721..74eb95c36ff 100644
--- a/src/mame/drivers/dietgo.cpp
+++ b/src/mame/drivers/dietgo.cpp
@@ -256,6 +256,9 @@ static MACHINE_CONFIG_START( dietgo )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp
index f404248ac37..3e0e5714571 100644
--- a/src/mame/drivers/dreambal.cpp
+++ b/src/mame/drivers/dreambal.cpp
@@ -327,6 +327,9 @@ static MACHINE_CONFIG_START( dreambal )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") // 93lc46b
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0)
MCFG_DECO16IC_SPLIT(0)
diff --git a/src/mame/drivers/dvk_ksm.cpp b/src/mame/drivers/dvk_ksm.cpp
index 0ca74a201a0..59c7a08dcea 100644
--- a/src/mame/drivers/dvk_ksm.cpp
+++ b/src/mame/drivers/dvk_ksm.cpp
@@ -428,7 +428,8 @@ static MACHINE_CONFIG_START( ksm )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ksm)
MCFG_PALETTE_ADD_MONOCHROME("palette")
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
// D30
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
diff --git a/src/mame/drivers/eprom.cpp b/src/mame/drivers/eprom.cpp
index 9e647a6e4bb..5a68af1b488 100644
--- a/src/mame/drivers/eprom.cpp
+++ b/src/mame/drivers/eprom.cpp
@@ -28,6 +28,7 @@
#include "emu.h"
#include "includes/eprom.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "screen.h"
#include "speaker.h"
@@ -147,10 +148,10 @@ WRITE16_MEMBER(eprom_state::sync_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, eprom_state )
AM_RANGE(0x000000, 0x09ffff) AM_ROM
- AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x16cc00, 0x16cc01) AM_READWRITE(sync_r, sync_w)
AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
@@ -172,10 +173,10 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( guts_map, AS_PROGRAM, 16, eprom_state )
AM_RANGE(0x000000, 0x09ffff) AM_ROM
- AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x16cc00, 0x16cc01) AM_READWRITE(sync_r, sync_w)
AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
@@ -401,7 +402,8 @@ static MACHINE_CONFIG_START( eprom )
MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom)
MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -446,7 +448,8 @@ static MACHINE_CONFIG_START( klaxp )
MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom)
MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -490,7 +493,8 @@ static MACHINE_CONFIG_START( guts )
MCFG_MACHINE_START_OVERRIDE(eprom_state,eprom)
MCFG_MACHINE_RESET_OVERRIDE(eprom_state,eprom)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/fanucspmg.cpp b/src/mame/drivers/fanucspmg.cpp
index 7e2366bb5d6..459af673aea 100644
--- a/src/mame/drivers/fanucspmg.cpp
+++ b/src/mame/drivers/fanucspmg.cpp
@@ -986,8 +986,14 @@ static MACHINE_CONFIG_START( fanucspmg )
MCFG_I8257_IN_IOR_0_CB(READ8(fanucspmg_state, fdcdma_r))
MCFG_I8257_OUT_IOW_0_CB(WRITE8(fanucspmg_state, fdcdma_w))
- MCFG_PIC8259_ADD(PIC0_TAG, INPUTLINE("maincpu", 0), VCC, READ8(fanucspmg_state, get_slave_ack))
- MCFG_PIC8259_ADD(PIC1_TAG, DEVWRITELINE(PIC0_TAG, pic8259_device, ir7_w), GND, NOOP)
+ MCFG_DEVICE_ADD(PIC0_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(fanucspmg_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD(PIC1_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE(PIC0_TAG, pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_UPD765A_ADD(FDC_TAG, true, true)
MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE(PIC0_TAG, pic8259_device, ir3_w))
diff --git a/src/mame/drivers/fastinvaders.cpp b/src/mame/drivers/fastinvaders.cpp
index 76c9fc8770b..9b747d743b9 100644
--- a/src/mame/drivers/fastinvaders.cpp
+++ b/src/mame/drivers/fastinvaders.cpp
@@ -641,7 +641,8 @@ static MACHINE_CONFIG_START( fastinvaders )
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259", pic8259_device, inta_cb)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", fastinvaders_state, scanline_timer, "screen", 0, 1)
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("dma8257", I8257, 6144100)
MCFG_I8257_IN_MEMR_CB(READ8(fastinvaders_state, memory_read_byte))
diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp
index 89d2af1efd7..83cd95e392e 100644
--- a/src/mame/drivers/fmtowns.cpp
+++ b/src/mame/drivers/fmtowns.cpp
@@ -2808,9 +2808,14 @@ static MACHINE_CONFIG_START( towns_base )
MCFG_PIT8253_OUT1_HANDLER(WRITELINE(towns_state, pit2_out1_changed))
MCFG_PIT8253_CLK2(307200) // reserved
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(towns_state,get_slave_ack))
-
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(towns_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_MB8877_ADD("fdc",XTAL_8MHz/4) // clock unknown
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(towns_state,mb8877a_irq_w))
diff --git a/src/mame/drivers/funkyjet.cpp b/src/mame/drivers/funkyjet.cpp
index c93ded46258..1d9caebcd15 100644
--- a/src/mame/drivers/funkyjet.cpp
+++ b/src/mame/drivers/funkyjet.cpp
@@ -331,6 +331,9 @@ static MACHINE_CONFIG_START( funkyjet )
MCFG_SCREEN_PALETTE("palette")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
diff --git a/src/mame/drivers/funworld.cpp b/src/mame/drivers/funworld.cpp
index 9db102d1b23..892ca94d93c 100644
--- a/src/mame/drivers/funworld.cpp
+++ b/src/mame/drivers/funworld.cpp
@@ -1,6 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Roberto Fresca, Peter Ferrie
-/**********************************************************************************
+/****************************************************************************************
Fun World / TAB / Impera
Series 7000 hardware.
@@ -12,94 +12,95 @@
Driver by Roberto Fresca.
Based on a preliminary work of Curt Coder & Peter Trauner.
-***********************************************************************************
+*****************************************************************************************
Games running on this hardware:
- * Jolly Card (Austrian, set 1), TAB Austria, 1985.
- * Jolly Card (Austrian, set 2), TAB Austria, 1985.
- * Jolly Card (3x3 deal), TAB Austria, 1985.
- * Jolly Card Professional 2.0 (MZS Tech), MZS Tech, 1993.
- * Jolly Card Professional 2.0 (Spale Soft), Spale Soft, 2000.
- * Jolly Card (Evona Electronic), Evona Electronic 1998.
- * Jolly Card (Croatian, set 1), TAB Austria, 1985.
- * Jolly Card (Croatian, set 2), Soft Design, 1993.
- * Jolly Card (Italian, blue TAB board, encrypted), bootleg, 199?.
- * Jolly Card (Italian, encrypted bootleg, set 1), bootleg, 1990.
- * Jolly Card (Italian, encrypted bootleg, set 2), bootleg, 1993.
- * Jolly Card (Italian, different colors, set 1), bootleg, 1990.
- * Jolly Card (Italian, different colors, set 2), bootleg, 1990.
- * Super Joly 2000 - 3x, M.P. 1985.
- * Jolly Card (Austrian, Fun World, bootleg), Inter Games, 1986.
- * Jolly Card (Spanish, blue TAB board, encrypted), TAB Austria, 1992.
- * Bonus Card (Austrian), Fun World, 1986.
- * Bonus Card (Austrian, ATG Electronic hack), Fun World, 1986.
- * Big Deal (Hungarian, set 1), Fun World, 1986.
- * Big Deal (Hungarian, set 2), Fun World, 1986.
- * Power Card (Ver 0263, encrypted), Fun World, 1993.
- * Cuore 1 (Italian), C.M.C., 1996.
- * Elephant Family (Italian, new), C.M.C., 1997.
- * Elephant Family (Italian, old), C.M.C., 1996.
- * Pool 10 (Italian, set 1), C.M.C., 1996.
- * Pool 10 (Italian, set 2), C.M.C., 1996.
- * Pool 10 (Italian, set 3), C.M.C., 1996.
- * Pool 10 (Italian, set 4), C.M.C., 1997.
- * Pool 10 (Italian, set 5), C.M.C., 1996.
- * Pool 10 (Italian, set 6), C.M.C., 1996.
- * Pool 10 (Italian, set 7), C.M.C., 1997.
- * Pool 10 (Italian, set 8), C.M.C., 1997.
- * Pool 10 (Italian, Dino 4 hardware, encrypted), C.M.C., 1997.
- * Royal (Pool 10 hack), unknown, 2001.
- * Tortuga Family (Italian), C.M.C., 1997.
- * Pot Game (Italian), C.M.C., 1996.
- * Bottle 10 (Italian, set 1), C.M.C., 1996.
- * Bottle 10 (Italian, set 2), C.M.C., 1996.
- * Luna Park (set 1, dual program), unknown, 1998.
- * Luna Park (set 2, dual program), unknown, 1998.
- * Luna Park (set 3), unknown, 1998.
- * Crystal Colours (CMC hardware), J.C.D. srl, 1998.
- * Royal Card (Austrian, set 1), TAB Austria, 1991.
- * Royal Card (Austrian, set 2), TAB Austria, 1991.
- * Royal Card (Austrian/Polish, set 3), TAB Austria, 1991.
- * Royal Card (Austrian, set 4), TAB Austria, 1991.
- * Royal Card (Austrian, set 5), TAB Austria, 1991.
- * Royal Card (Austrian, set 6), TAB Austria, 1991.
- * Royal Card (Austrian, set 7, CMC C1030 HW), bootleg, 1991.
- * Royal Card (French), TAB Austria, 1991.
- * Royal Card (TAB original), TAB Austria, 1991.
- * Royal Card (Slovak, encrypted), Evona Electronic, 1991.
- * Royal Card Professional 2.0, Digital Dreams, 1993.
- * Royal Card (Italian, Dino 4 hardware, encrypted) unknown, 1998.
- * Lucky Lady (3x3 deal), TAB Austria, 1991.
- * Lucky Lady (4x1 aces), TAB Austria, 1991.
- * Magic Card II (Bulgarian), Impera, 1996.
- * Magic Card II (Nov, Yugoslavian), Impera, 1996.
- * Magic Card II (green TAB or Impera board), Impera, 1996.
- * Magic Card II (blue TAB board, encrypted), Impera, 1996.
- * Royal Vegas Joker Card (Slow deal), Fun World, 1993.
- * Royal Vegas Joker Card (Fast deal), Soft Design, 1993.
- * Royal Vegas Joker Card (Fast deal, english gfx), Soft Design, 1993.
- * Royal Vegas Joker Card (Fast deal, Mile), Mile, 1993.
- * Jolly Joker (98bet, set 1). Impera, 198?.
- * Jolly Joker (98bet, set 2). Impera, 198?.
- * Jolly Joker (40bet, croatian hack), Impera, 198?.
- * Jolly Joker (Apple Time), Apple Time, 198?.
- * Multi Win (Ver.0167, encrypted), Fun World, 1992.
- * Joker Card (Ver.A267BC, encrypted), Vesely Svet, 1993.
- * Mongolfier New (Italian), unknown, 199?.
- * Soccer New (Italian), unknown, 199?.
- * Saloon (French, encrypted), unknown, 199?.
- * Fun World Quiz (Austrian), Fun World, 198?.
- * Witch Royal (Export version 2.1), Video Klein, 199?.
- * Novo Play Multi Card / Club Card, Admiral/Novomatic, 1986.
- * unknown encrypted Royal Card (Dino4 HW), unknown, 1998.
- * China Town (Ver 1B, Dino4 HW), unknown, 1998.
- * Unknown Inter Games poker, Inter Games, 1991.
- * Unknown Fun World A7-11 game 1, Fun World, 1985.
- * Unknown Fun World A7-11 game 2, Fun World, 1985.
- * Unknown Fun World A0-1 game, Fun World, 1991.
-
-***********************************************************************************
+ * Jolly Card (Austrian, set 1), TAB Austria, 1985.
+ * Jolly Card (Austrian, set 2), TAB Austria, 1985.
+ * Jolly Card (3x3 deal), TAB Austria, 1985.
+ * Jolly Card Professional 2.0 (MZS Tech), MZS Tech, 1993.
+ * Jolly Card Professional 2.0 (Spale Soft), Spale Soft, 2000.
+ * Jolly Card (Evona Electronic), Evona Electronic 1998.
+ * Jolly Card (Croatian, set 1), TAB Austria, 1985.
+ * Jolly Card (Croatian, set 2), Soft Design, 1993.
+ * Jolly Card (Italian, blue TAB board, encrypted), bootleg, 199?.
+ * Jolly Card (Italian, encrypted bootleg, set 1), bootleg, 1990.
+ * Jolly Card (Italian, encrypted bootleg, set 2), bootleg, 1993.
+ * Jolly Card (Italian, different colors, set 1), bootleg, 1990.
+ * Jolly Card (Italian, different colors, set 2), bootleg, 1990.
+ * Super Joly 2000 - 3x, M.P. 1985.
+ * Jolly Card (Austrian, Fun World, bootleg), Inter Games, 1986.
+ * Jolly Card (Spanish, blue TAB board, encrypted), TAB Austria, 1992.
+ * Bonus Card (Austrian), Fun World, 1986.
+ * Bonus Card (Austrian, ATG Electronic hack), Fun World, 1986.
+ * Big Deal (Hungarian, set 1), Fun World, 1986.
+ * Big Deal (Hungarian, set 2), Fun World, 1986.
+ * Power Card (Ver 0263, encrypted), Fun World, 1993.
+ * Cuore 1 (Italian), C.M.C., 1996.
+ * Elephant Family (Italian, new), C.M.C., 1997.
+ * Elephant Family (Italian, old), C.M.C., 1996.
+ * Pool 10 (Italian, set 1), C.M.C., 1996.
+ * Pool 10 (Italian, set 2), C.M.C., 1996.
+ * Pool 10 (Italian, set 3), C.M.C., 1996.
+ * Pool 10 (Italian, set 4), C.M.C., 1997.
+ * Pool 10 (Italian, set 5), C.M.C., 1996.
+ * Pool 10 (Italian, set 6), C.M.C., 1996.
+ * Pool 10 (Italian, set 7), C.M.C., 1997.
+ * Pool 10 (Italian, set 8), C.M.C., 1997.
+ * Pool 10 (Italian, Dino 4 hardware, encrypted), C.M.C., 1997.
+ * Royal (Pool 10 hack), unknown, 2001.
+ * Tortuga Family (Italian), C.M.C., 1997.
+ * Pot Game (Italian), C.M.C., 1996.
+ * Bottle 10 (Italian, set 1), C.M.C., 1996.
+ * Bottle 10 (Italian, set 2), C.M.C., 1996.
+ * Luna Park (set 1, dual program), unknown, 1998.
+ * Luna Park (set 2, dual program), unknown, 1998.
+ * Luna Park (set 3), unknown, 1998.
+ * Crystal Colours (CMC hardware), J.C.D. srl, 1998.
+ * Royal Card (Austrian, set 1), TAB Austria, 1991.
+ * Royal Card (Austrian, set 2), TAB Austria, 1991.
+ * Royal Card (Austrian/Polish, set 3), TAB Austria, 1991.
+ * Royal Card (Austrian, set 4), TAB Austria, 1991.
+ * Royal Card (Austrian, set 5), TAB Austria, 1991.
+ * Royal Card (Austrian, set 6), TAB Austria, 1991.
+ * Royal Card (Austrian, set 7, CMC C1030 HW), bootleg, 1991.
+ * Royal Card (French), TAB Austria, 1991.
+ * Royal Card (TAB original), TAB Austria, 1991.
+ * Royal Card (Slovak, encrypted), Evona Electronic, 1991.
+ * Royal Card Professional 2.0, Digital Dreams, 1993.
+ * Royal Card (Italian, Dino 4 hardware, encrypted), unknown, 1998.
+ * RRoyal Card / Royal Jackpot (with a third draw)(encrypted), TAB / Video Klein, 1991
+ * Lucky Lady (3x3 deal), TAB Austria, 1991.
+ * Lucky Lady (4x1 aces), TAB Austria, 1991.
+ * Magic Card II (Bulgarian), Impera, 1996.
+ * Magic Card II (Nov, Yugoslavian), Impera, 1996.
+ * Magic Card II (green TAB or Impera board), Impera, 1996.
+ * Magic Card II (blue TAB board, encrypted), Impera, 1996.
+ * Royal Vegas Joker Card (Slow deal), Fun World, 1993.
+ * Royal Vegas Joker Card (Fast deal), Soft Design, 1993.
+ * Royal Vegas Joker Card (Fast deal, english gfx), Soft Design, 1993.
+ * Royal Vegas Joker Card (Fast deal, Mile), Mile, 1993.
+ * Jolly Joker (98bet, set 1). Impera, 198?.
+ * Jolly Joker (98bet, set 2). Impera, 198?.
+ * Jolly Joker (40bet, croatian hack), Impera, 198?.
+ * Jolly Joker (Apple Time), Apple Time, 198?.
+ * Multi Win (Ver.0167, encrypted), Fun World, 1992.
+ * Joker Card (Ver.A267BC, encrypted), Vesely Svet, 1993.
+ * Mongolfier New (Italian), unknown, 199?.
+ * Soccer New (Italian), unknown, 199?.
+ * Saloon (French, encrypted), unknown, 199?.
+ * Fun World Quiz (Austrian), Fun World, 198?.
+ * Witch Royal (Export version 2.1), Video Klein, 199?.
+ * Novo Play Multi Card / Club Card, Admiral/Novomatic, 1986.
+ * unknown encrypted Royal Card (Dino4 HW), unknown, 1998.
+ * China Town (Ver 1B, Dino4 HW), unknown, 1998.
+ * Unknown Inter Games poker, Inter Games, 1991.
+ * Unknown Fun World A7-11 game 1, Fun World, 1985.
+ * Unknown Fun World A7-11 game 2, Fun World, 1985.
+ * Unknown Fun World A0-1 game, Fun World, 1991.
+
+*****************************************************************************************
The hardware is generally composed by:
@@ -468,8 +469,7 @@
The only visible changes are in the NVRAM, where the $0000 offset hasn't the JMP $C210 instruction
injected at the start...
-***********************************************************************************
-
+*****************************************************************************************
Memory Map (generic)
--------------------
@@ -522,16 +522,14 @@
chinatow: 0x7C 0x60 0x65 0x08 0x21 0x08 0x1F 0x1F 0x00 0x07 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00.
-***********************************************************************************
-
+*****************************************************************************************
*** Hardware Info ***
Moved all technical info to the ROM load section...
-***********************************************************************************
-
+*****************************************************************************************
*** Driver Updates by Roberto Fresca and Peter Ferrie ***
@@ -983,7 +981,7 @@
- Implement the MCU in monglfir and soccernw.
-***********************************************************************************/
+****************************************************************************************/
#define MASTER_CLOCK XTAL_16MHz
#define CPU_CLOCK (MASTER_CLOCK/8)
@@ -1879,6 +1877,92 @@ static INPUT_PORTS_START( royalcrd )
PORT_DIPSETTING( 0x80, "Manual Payout SW" )
INPUT_PORTS_END
+static INPUT_PORTS_START( royaljp )
+ PORT_START("IN0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_NAME("Remote")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Halten (Hold) 1 / Hoch (High)")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) PORT_NAME("Loeschen/Gamble (Cancel/Play)")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Geben (Start)")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Halten (Hold) 5 / Half Gamble")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Buchhalt (Service1)")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Einstellen (Service2)")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Halten (Hold) 4 / Kassieren (Take)")
+
+ PORT_START("IN1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Halten (Hold) 2")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Halten (Hold) 3 / Tief (Low)")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("unknown bit 08") PORT_CODE(KEYCODE_8)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hoppersch") PORT_CODE(KEYCODE_H)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Abschreib (Payout)")
+
+ PORT_START("IN2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
+ 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 )
+
+/* ________________________________________________________________________
+ |DIP Schalter 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
+ |________________________________________|___|___|___|___|___|___|___|___|
+ |Hopperbetrieb über Board ein/on |on | | | | | | | |
+ |(Hopper Payout) aus/off |off| | | | | | | |
+ |________________________________________|___|___|___|___|___|___|___|___|
+ |Autohold an/yes | |on | | | | | | |
+ | aus/no | |off| | | | | | |
+ |________________________________________|___|___|___|___|___|___|___|___|
+ |Gewinn ab: "Hohes Paar"/"High pair" | | |on | | | | | |
+ |(Profit) "König oder As"/"King or Ace"| | |off| | | | | |
+ |________________________________________|___|___|___|___|___|___|___|___|
+ |Insert "Dattl" | | | |on | | | | |
+ |Insert "Royal-Jackpot" | | | |off| | | | |
+ |________________________________________|___|___|___|___|___|___|___|___|
+ |Coin A = 10 Coin B = 50 | | | | |on |on | | |
+ |Coin A = 10 Coin B = 20 | | | | |on |off| | |
+ |Coin A = 1 Coin B = 20 | | | | |off|off| | |
+ |Coin A = 1 Coin B = 50 | | | | |off|on | | |
+ |________________________________________|___|___|___|___|___|___|___|___|
+ |Immer / always | | | | | | |off| |
+ |________________________________________|___|___|___|___|___|___|___|___|
+ |Keyboard Test | | | | | | | |on |
+ |Spielbetrieb / Maingame | | | | | | | |off|
+ |________________________________________|___|___|___|___|___|___|___|___|
+
+ Default Settings from Video Klein: 01101100
+
+*/
+ PORT_START("DSW")
+ PORT_DIPNAME( 0x01, 0x01, "State" ) PORT_DIPLOCATION("SW1:8")
+ PORT_DIPSETTING( 0x00, "Keyboard Test" )
+ PORT_DIPSETTING( 0x01, "Main Game" )
+ PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:7" ) // Shown as "Always Off" in the manual
+ PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:6")
+ PORT_DIPSETTING( 0x00, "50 Points/Coin" )
+ PORT_DIPSETTING( 0x04, "20 Points/Coin" )
+ PORT_DIPNAME( 0x08, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5")
+ PORT_DIPSETTING( 0x00, "10 Points/Coin" )
+ PORT_DIPSETTING( 0x08, "1 Point/Coin" )
+ PORT_DIPNAME( 0x10, 0x10, "Insert" ) PORT_DIPLOCATION("SW1:4")
+ PORT_DIPSETTING( 0x00, "Dattl Insert" )
+ PORT_DIPSETTING( 0x10, "Royal Jackpot" )
+ PORT_DIPNAME( 0x20, 0x00, "Profit" ) PORT_DIPLOCATION("SW1:3")
+ PORT_DIPSETTING( 0x00, "Hohes Paar" )
+ PORT_DIPSETTING( 0x20, "2 Kings or Aces" )
+ PORT_DIPNAME( 0x40, 0x00, "Autohold" ) PORT_DIPLOCATION("SW1:2")
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( No ) )
+ PORT_DIPNAME( 0x80, 0x80, "Hopper Payout" ) PORT_DIPLOCATION("SW1:1")
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+INPUT_PORTS_END
+
+
static INPUT_PORTS_START( cuoreuno )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* no remote credits */
@@ -4880,6 +4964,38 @@ ROM_START( royalcrdp )
ROM_END
+/*
+ Royal Card / Royal Jackpot (with third draw) (encrypted)
+
+ Encrypted graphics 'alla TAB blue PCB.
+ Maybe is the infamous encrypted Impera green PCB.
+
+ From the manual: "With third draw"
+ ...but I couldn't trigger this feature.
+
+ */
+
+ROM_START( royaljp )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "3.z.1_10.bin", 0x8000, 0x8000, CRC(ad03c41c) SHA1(8241a7eb02d7c06b7ea5bea5ab0d9ed4c6fcfd50) )
+
+ ROM_REGION( 0x10000, "gfx1", 0 )
+ ROM_LOAD( "02.bin", 0x0000, 0x8000, CRC(c8f6f3e4) SHA1(5d8b32609562647c698926ea75c8f806b703332e) )
+ ROM_LOAD( "01.bin", 0x8000, 0x8000, CRC(3ced6423) SHA1(2309a856226404789fd219cf77ba2f378a90eee7) )
+
+ ROM_REGION( 0x0200, "proms", 0 )
+ ROM_LOAD( "rj_d27hc65d-2_(82s147).bin", 0x0000, 0x0200, CRC(d6570420) SHA1(90b6c126b485db823acffbfd195964a6282e60ea) )
+
+ ROM_REGION( 0x0800, "nvram", 0 )
+ ROM_LOAD( "royaljp_nvram.bin", 0x0000, 0x0800, CRC(48e51e2a) SHA1(b81a1741eef299384d4fa98a534099b2c0332074) )
+
+ ROM_REGION( 0x0600, "plds", 0 ) /* There are 3 GALs */
+ ROM_LOAD( "gal20v8b.bin", 0x0000, 0x0157, NO_DUMP )
+ ROM_LOAD( "gal20v8a.bin", 0x0200, 0x0157, NO_DUMP )
+ ROM_LOAD( "gal16v8d.bin", 0x0400, 0x0117, NO_DUMP )
+ROM_END
+
+
/******************************** Lucky Lady sets ************************************/
ROM_START( lluck3x3 )
@@ -6180,8 +6296,8 @@ DRIVER_INIT_MEMBER(funworld_state, tabblue)
| Blue TAB PCB Decryption |
+-------------------------+
- It perform by byte nibble a boolean XOR against the same value shifted to the right, then shift
- the result to the left carring the less significant bit and losing the most significant one.
+ It performs by byte nibble a boolean XOR against the same value shifted to the right, then shift
+ the result to the left, carring the less significant bit and losing the most significant one.
Encrypted nibble: 0 1 2 3 4 5 6 7 8 9 A B C D E F
@@ -6260,7 +6376,7 @@ DRIVER_INIT_MEMBER(funworld_state, mongolnw)
ROM[0x9115] = 0xa5;
-/* prevent one test from triggering hardware error */
+/* prevents one test from triggering hardware error */
ROM[0xb8f3] = 0xff;
}
@@ -6940,72 +7056,73 @@ GAMEL( 1998, lunaparkc, lunapark, cuoreuno, cuoreuno, funworld_state, 0,
GAMEL( 1998, crystal, 0, cuoreuno, cuoreuno, funworld_state, 0, ROT0, "J.C.D. srl", "Crystal Colours (CMC hardware)", 0, layout_jollycrd )
// Royal Card based...
-GAMEL( 1991, royalcrd, 0, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 1)", 0, layout_jollycrd )
-GAMEL( 1991, royalcrda, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 2)", 0, layout_jollycrd )
-GAMEL( 1991, royalcrdb, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian/Polish, set 3)", 0, layout_jollycrd )
-GAMEL( 1991, royalcrdc, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 4)", MACHINE_IMPERFECT_GRAPHICS, layout_jollycrd )
-GAMEL( 1991, royalcrdd, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 5)", 0, layout_royalcrd )
-GAMEL( 1991, royalcrde, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 6)", 0, layout_jollycrd )
-GAMEL( 1991, royalcrdt, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (TAB original)", 0, layout_jollycrd )
-GAME( 1991, royalcrdf, royalcrd, royalcd1, royalcrd, funworld_state, royalcdc, ROT0, "Evona Electronic","Royal Card (Slovak, encrypted)", MACHINE_NOT_WORKING )
-GAMEL( 1990, royalcrdg, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "bootleg", "Royal Card (Austrian, set 7, CMC C1030 HW)", 0, layout_jollycrd ) // big CPLD
-GAMEL( 1991, royalcrdh, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 8)", 0 , layout_jollycrd )
-GAMEL( 1991, royalcdfr, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (French)", 0, layout_jollycrd )
-GAME( 1993, royalcrdp, royalcrd, cuoreuno, royalcrd, funworld_state, 0, ROT0, "Digital Dreams", "Royal Card v2.0 Professional", 0 )
-GAMEL( 199?, witchryl, 0, witchryl, witchryl, funworld_state, 0, ROT0, "Video Klein", "Witch Royal (Export version 2.1)", 0, layout_jollycrd )
+GAMEL( 1991, royalcrd, 0, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 1)", 0, layout_jollycrd )
+GAMEL( 1991, royalcrda, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 2)", 0, layout_jollycrd )
+GAMEL( 1991, royalcrdb, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian/Polish, set 3)", 0, layout_jollycrd )
+GAMEL( 1991, royalcrdc, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 4)", MACHINE_IMPERFECT_GRAPHICS, layout_jollycrd )
+GAMEL( 1991, royalcrdd, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 5)", 0, layout_royalcrd )
+GAMEL( 1991, royalcrde, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 6)", 0, layout_jollycrd )
+GAMEL( 1991, royalcrdt, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (TAB original)", 0, layout_jollycrd )
+GAME( 1991, royalcrdf, royalcrd, royalcd1, royalcrd, funworld_state, royalcdc, ROT0, "Evona Electronic", "Royal Card (Slovak, encrypted)", MACHINE_NOT_WORKING )
+GAMEL( 1990, royalcrdg, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "bootleg", "Royal Card (Austrian, set 7, CMC C1030 HW)", 0, layout_jollycrd ) // big CPLD
+GAMEL( 1991, royalcrdh, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (Austrian, set 8)", 0 , layout_jollycrd )
+GAMEL( 1991, royalcdfr, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Royal Card (French)", 0, layout_jollycrd )
+GAME( 1993, royalcrdp, royalcrd, cuoreuno, royalcrd, funworld_state, 0, ROT0, "Digital Dreams", "Royal Card v2.0 Professional", 0 )
+GAMEL( 199?, royaljp, royalcrd, royalcd1, royaljp, funworld_state, tabblue, ROT0, "TAB / Video Klein", "Royal Card / Royal Jackpot (with a third draw)(encrypted)", 0, layout_jollycrd )
+GAMEL( 199?, witchryl, 0, witchryl, witchryl, funworld_state, 0, ROT0, "Video Klein", "Witch Royal (Export version 2.1)", 0, layout_jollycrd )
// Lucky Lady based...
-GAMEL( 1991, lluck3x3, royalcrd, cuoreuno, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Lucky Lady (3x3 deal)", 0, layout_jollycrd )
-GAMEL( 1991, lluck4x1, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Lucky Lady (4x1 aces)", 0, layout_jollycrd )
+GAMEL( 1991, lluck3x3, royalcrd, cuoreuno, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Lucky Lady (3x3 deal)", 0, layout_jollycrd )
+GAMEL( 1991, lluck4x1, royalcrd, royalcd1, royalcrd, funworld_state, 0, ROT0, "TAB Austria", "Lucky Lady (4x1 aces)", 0, layout_jollycrd )
// Magic Card 2 based...
-GAMEL( 1996, magicrd2, 0, magicrd2, magicrd2, funworld_state, 0, ROT0, "Impera", "Magic Card II (Bulgarian)", 0, layout_jollycrd )
-GAMEL( 1996, magicrd2a, magicrd2, magicrd2, magicrd2, funworld_state, 0, ROT0, "Impera", "Magic Card II (Nov, Yugoslavian)", 0, layout_jollycrd )
-GAME( 1996, magicrd2b, magicrd2, magicrd2, magicrd2, funworld_state, magicd2b, ROT0, "Impera", "Magic Card II (green TAB or Impera board)", 0 )
-GAME( 1996, magicrd2c, magicrd2, magicrd2, magicrd2, funworld_state, magicd2c, ROT0, "Impera", "Magic Card II (blue TAB board, encrypted)", 0 )
+GAMEL( 1996, magicrd2, 0, magicrd2, magicrd2, funworld_state, 0, ROT0, "Impera", "Magic Card II (Bulgarian)", 0, layout_jollycrd )
+GAMEL( 1996, magicrd2a, magicrd2, magicrd2, magicrd2, funworld_state, 0, ROT0, "Impera", "Magic Card II (Nov, Yugoslavian)", 0, layout_jollycrd )
+GAME( 1996, magicrd2b, magicrd2, magicrd2, magicrd2, funworld_state, magicd2b, ROT0, "Impera", "Magic Card II (green TAB or Impera board)", 0 )
+GAME( 1996, magicrd2c, magicrd2, magicrd2, magicrd2, funworld_state, magicd2c, ROT0, "Impera", "Magic Card II (blue TAB board, encrypted)", 0 )
// Joker Card based...
-GAMEL( 1993, vegasslw, 0, fw2ndpal, vegasslw, funworld_state, 0, ROT0, "Fun World", "Royal Vegas Joker Card (slow deal)", 0, layout_jollycrd )
-GAMEL( 1993, vegasfst, vegasslw, fw2ndpal, vegasfst, funworld_state, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal)", 0, layout_jollycrd )
-GAMEL( 1993, vegasfte, vegasslw, fw2ndpal, vegasfte, funworld_state, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal, English gfx)", 0, layout_jollycrd )
-GAMEL( 1993, vegasmil, vegasslw, fw2ndpal, vegasmil, funworld_state, 0, ROT0, "Mile", "Royal Vegas Joker Card (fast deal, Mile)", 0, layout_jollycrd )
+GAMEL( 1993, vegasslw, 0, fw2ndpal, vegasslw, funworld_state, 0, ROT0, "Fun World", "Royal Vegas Joker Card (slow deal)", 0, layout_jollycrd )
+GAMEL( 1993, vegasfst, vegasslw, fw2ndpal, vegasfst, funworld_state, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal)", 0, layout_jollycrd )
+GAMEL( 1993, vegasfte, vegasslw, fw2ndpal, vegasfte, funworld_state, 0, ROT0, "Soft Design", "Royal Vegas Joker Card (fast deal, English gfx)", 0, layout_jollycrd )
+GAMEL( 1993, vegasmil, vegasslw, fw2ndpal, vegasmil, funworld_state, 0, ROT0, "Mile", "Royal Vegas Joker Card (fast deal, Mile)", 0, layout_jollycrd )
// Jolly Joker based...
-GAMEL( 198?, jolyjokr, 0, fw1stpal, funworld, funworld_state, 0, ROT0, "Impera", "Jolly Joker (98bet, set 1)", 0, layout_jollycrd )
-GAMEL( 198?, jolyjokra, jolyjokr, fw1stpal, jolyjokra, funworld_state, 0, ROT0, "Impera", "Jolly Joker (98bet, set 2)", 0, layout_jollycrd )
-GAMEL( 198?, jolyjokrb, jolyjokr, fw1stpal, funworld, funworld_state, 0, ROT0, "Impera", "Jolly Joker (40bet, Croatian hack)", 0, layout_jollycrd )
-GAMEL( 198?, jolyjokrc, jolyjokr, fw1stpal, funworld, funworld_state, 0, ROT0, "Apple Time", "Jolly Joker (Apple Time)", MACHINE_NOT_WORKING, layout_jollycrd ) // bad program ROM...
+GAMEL( 198?, jolyjokr, 0, fw1stpal, funworld, funworld_state, 0, ROT0, "Impera", "Jolly Joker (98bet, set 1)", 0, layout_jollycrd )
+GAMEL( 198?, jolyjokra, jolyjokr, fw1stpal, jolyjokra, funworld_state, 0, ROT0, "Impera", "Jolly Joker (98bet, set 2)", 0, layout_jollycrd )
+GAMEL( 198?, jolyjokrb, jolyjokr, fw1stpal, funworld, funworld_state, 0, ROT0, "Impera", "Jolly Joker (40bet, Croatian hack)", 0, layout_jollycrd )
+GAMEL( 198?, jolyjokrc, jolyjokr, fw1stpal, funworld, funworld_state, 0, ROT0, "Apple Time", "Jolly Joker (Apple Time)", MACHINE_NOT_WORKING, layout_jollycrd ) // bad program ROM...
// Encrypted games...
-GAME( 1992, multiwin, 0, fw1stpal, funworld, funworld_state, multiwin, ROT0, "Fun World", "Multi Win (Ver.0167, encrypted)", MACHINE_NOT_WORKING )
-GAME( 1993, powercrd, 0, fw2ndpal, funworld, funworld_state, 0, ROT0, "Fun World", "Power Card (Ver 0263, encrypted)", MACHINE_NOT_WORKING ) // clone of Bonus Card.
-GAME( 1993, megacard, 0, fw2ndpal, funworld, funworld_state, 0, ROT0, "Fun World", "Mega Card (Ver.0210, encrypted)", MACHINE_NOT_WORKING )
-GAME( 1993, jokercrd, 0, fw2ndpal, funworld, funworld_state, 0, ROT0, "Vesely Svet", "Joker Card (Ver.A267BC, encrypted)", MACHINE_NOT_WORKING )
-GAME( 198?, saloon, 0, saloon, saloon, funworld_state, saloon, ROT0, "<unknown>", "Saloon (French, encrypted)", MACHINE_NOT_WORKING )
+GAME( 1992, multiwin, 0, fw1stpal, funworld, funworld_state, multiwin, ROT0, "Fun World", "Multi Win (Ver.0167, encrypted)", MACHINE_NOT_WORKING )
+GAME( 1993, powercrd, 0, fw2ndpal, funworld, funworld_state, 0, ROT0, "Fun World", "Power Card (Ver 0263, encrypted)", MACHINE_NOT_WORKING ) // clone of Bonus Card.
+GAME( 1993, megacard, 0, fw2ndpal, funworld, funworld_state, 0, ROT0, "Fun World", "Mega Card (Ver.0210, encrypted)", MACHINE_NOT_WORKING )
+GAME( 1993, jokercrd, 0, fw2ndpal, funworld, funworld_state, 0, ROT0, "Vesely Svet", "Joker Card (Ver.A267BC, encrypted)", MACHINE_NOT_WORKING )
+GAME( 198?, saloon, 0, saloon, saloon, funworld_state, saloon, ROT0, "<unknown>", "Saloon (French, encrypted)", MACHINE_NOT_WORKING )
// Encrypted TAB blue PCB...
-GAMEL( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, funworld_state, tabblue, ROT0, "bootleg", "Jolly Card (Italian, blue TAB board, encrypted)", 0, layout_royalcrd )
-GAMEL( 1990, jolycdib, jollycrd, cuoreuno, jolycdib, funworld_state, tabblue, ROT0, "bootleg", "Jolly Card (Italian, encrypted bootleg, set 1)", 0, layout_jollycrd ) // not a real TAB blue PCB
-GAMEL( 1993, jolycdic, jollycrd, cuoreuno, jolycdic, funworld_state, tabblue, ROT0, "bootleg", "Jolly Card (Italian, encrypted bootleg, set 2)", 0, layout_jollycrd ) // not a real TAB blue PCB
+GAMEL( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, funworld_state, tabblue, ROT0, "bootleg", "Jolly Card (Italian, blue TAB board, encrypted)", 0, layout_royalcrd )
+GAMEL( 1990, jolycdib, jollycrd, cuoreuno, jolycdib, funworld_state, tabblue, ROT0, "bootleg", "Jolly Card (Italian, encrypted bootleg, set 1)", 0, layout_jollycrd ) // not a real TAB blue PCB
+GAMEL( 1993, jolycdic, jollycrd, cuoreuno, jolycdic, funworld_state, tabblue, ROT0, "bootleg", "Jolly Card (Italian, encrypted bootleg, set 2)", 0, layout_jollycrd ) // not a real TAB blue PCB
// Dino 4 encrypted hardware...
-GAMEL( 1997, pool10e, pool10, cuoreuno, cuoreuno, funworld_state, dino4, ROT0, "C.M.C.", "Pool 10 (Italian, Dino 4 hardware, encrypted)", 0, layout_jollycrd )
-GAME ( 1998, rcdino4, 0, rcdino4, rcdino4, funworld_state, rcdino4, ROT0, "<unknown>", "Royal Card (Italian, Dino 4 hardware, encrypted)",0 )
-GAMEL( 1998, chinatow, 0, chinatow, chinatow, funworld_state, rcdinch, ROT0, "<unknown>", "China Town (Ver 1B, Dino4 HW)", 0, layout_jollycrd )
+GAMEL( 1997, pool10e, pool10, cuoreuno, cuoreuno, funworld_state, dino4, ROT0, "C.M.C.", "Pool 10 (Italian, Dino 4 hardware, encrypted)", 0, layout_jollycrd )
+GAME ( 1998, rcdino4, 0, rcdino4, rcdino4, funworld_state, rcdino4, ROT0, "<unknown>", "Royal Card (Italian, Dino 4 hardware, encrypted)",0 )
+GAMEL( 1998, chinatow, 0, chinatow, chinatow, funworld_state, rcdinch, ROT0, "<unknown>", "China Town (Ver 1B, Dino4 HW)", 0, layout_jollycrd )
// MCU based games...
-GAME( 199?, mongolnw, 0, royalcd1, royalcrd, funworld_state, mongolnw, ROT0, "<unknown>", "Mongolfier New (Italian)", MACHINE_UNEMULATED_PROTECTION )
-GAME( 199?, soccernw, 0, royalcd1, royalcrd, funworld_state, soccernw, ROT0, "<unknown>", "Soccer New (Italian)", MACHINE_UNEMULATED_PROTECTION )
+GAME( 199?, mongolnw, 0, royalcd1, royalcrd, funworld_state, mongolnw, ROT0, "<unknown>", "Mongolfier New (Italian)", MACHINE_UNEMULATED_PROTECTION )
+GAME( 199?, soccernw, 0, royalcd1, royalcrd, funworld_state, soccernw, ROT0, "<unknown>", "Soccer New (Italian)", MACHINE_UNEMULATED_PROTECTION )
// Other games...
-GAME( 198?, funquiz, 0, funquiz, funquiz, funworld_state, 0, ROT0, "Fun World / Oehlinger", "Fun World Quiz (Austrian)", 0 )
-GAMEL( 1986, novoplay, 0, fw2ndpal, novoplay, funworld_state, 0, ROT0, "Admiral/Novomatic", "Novo Play Multi Card / Club Card", 0, layout_novoplay )
-GAME( 1991, intrgmes, 0, intrgmes, funworld, funworld_state, 0, ROT0, "Inter Games", "Unknown Inter Games poker", MACHINE_NOT_WORKING )
-GAMEL( 1985, fw_a7_11, 0, fw_a7_11, funworld, funworld_state, 0, ROT0, "Fun World", "Unknown Fun World A7-11 game 1", MACHINE_NOT_WORKING, layout_jollycrd )
-GAMEL( 1985, fw_a7_11a, fw_a7_11, fw_a7_11, funworld, funworld_state, 0, ROT0, "Fun World", "Unknown Fun World A7-11 game 2", MACHINE_NOT_WORKING, layout_jollycrd )
-GAMEL( 1991, fw_a0_1, 0, fw_a7_11, funworld, funworld_state, 0, ROT0, "Fun World", "Unknown Fun World A0-1 game", MACHINE_NOT_WORKING, layout_jollycrd )
+GAME( 198?, funquiz, 0, funquiz, funquiz, funworld_state, 0, ROT0, "Fun World / Oehlinger", "Fun World Quiz (Austrian)", 0 )
+GAMEL( 1986, novoplay, 0, fw2ndpal, novoplay, funworld_state, 0, ROT0, "Admiral/Novomatic", "Novo Play Multi Card / Club Card", 0, layout_novoplay )
+GAME( 1991, intrgmes, 0, intrgmes, funworld, funworld_state, 0, ROT0, "Inter Games", "Unknown Inter Games poker", MACHINE_NOT_WORKING )
+GAMEL( 1985, fw_a7_11, 0, fw_a7_11, funworld, funworld_state, 0, ROT0, "Fun World", "Unknown Fun World A7-11 game 1", MACHINE_NOT_WORKING, layout_jollycrd )
+GAMEL( 1985, fw_a7_11a, fw_a7_11, fw_a7_11, funworld, funworld_state, 0, ROT0, "Fun World", "Unknown Fun World A7-11 game 2", MACHINE_NOT_WORKING, layout_jollycrd )
+GAMEL( 1991, fw_a0_1, 0, fw_a7_11, funworld, funworld_state, 0, ROT0, "Fun World", "Unknown Fun World A0-1 game", MACHINE_NOT_WORKING, layout_jollycrd )
// These are 2-in-1 stealth boards, they can run the Poker game, or, using completely separate hardware on the same PCB, a NES / MSX Multigames!
-GAMEL( 1991, royalcrd_nes, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "bootleg", "Royal Card (stealth with NES multigame)", MACHINE_NOT_WORKING, layout_jollycrd )
-GAMEL( 1991, royalcrd_msx, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "bootleg", "Royal Card (stealth with MSX multigame)", MACHINE_NOT_WORKING, layout_jollycrd )
+GAMEL( 1991, royalcrd_nes, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "bootleg", "Royal Card (stealth with NES multigame)", MACHINE_NOT_WORKING, layout_jollycrd )
+GAMEL( 1991, royalcrd_msx, royalcrd, royalcd2, royalcrd, funworld_state, 0, ROT0, "bootleg", "Royal Card (stealth with MSX multigame)", MACHINE_NOT_WORKING, layout_jollycrd )
diff --git a/src/mame/drivers/gaelco2.cpp b/src/mame/drivers/gaelco2.cpp
index 560fe84e9dd..3d8ae93ebae 100644
--- a/src/mame/drivers/gaelco2.cpp
+++ b/src/mame/drivers/gaelco2.cpp
@@ -832,13 +832,47 @@ REF: 940411
*/
+/*
+ the byte at 0x1ff in the rom at u44 controls the language / region settings
+ and even allows for an alt. title of Lizard Hunt
+
+ bit 0x08 = title (0x00 = LIZARD HUNT, 0x08 = ALLIGATOR HUNT)
+ bit 0x04 = language (0x00 = SPANISH, 0x04 = ENGLISH)
+ bit 0x03 = region warning ( 0x00, 0x02 = USA, 0x01 = NOT USA, 0x03 = NO WARNING)
+*/
+
ROM_START( aligator )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_BYTE( "1.u45", 0x000000, 0x080000, CRC(61c47c56) SHA1(6dd3fc6fdab252e0fb43c0793eef70203c888d7f) )
+ ROM_LOAD16_BYTE( "2.u44", 0x000001, 0x080000, CRC(96bc77c2) SHA1(72975fa188598d8ed595cbba097b60efe14bd190) )
+
+ ROM_REGION( 0x8000, "gaelco_ds5002fp:sram", 0 ) /* DS5002FP code */
+ ROM_LOAD( "aligator_ds5002fp.bin", 0x00000, 0x8000, CRC(6558f215) SHA1(c961a9c81aa6b746294baf83ea5d1fcf7acab9db) )
+
+ ROM_REGION( 0x100, "gaelco_ds5002fp:mcu:internal", ROMREGION_ERASE00 )
+ /* these are the default states stored in NVRAM */
+ DS5002FP_SET_MON( 0x19 )
+ DS5002FP_SET_RPCTL( 0x00 )
+ DS5002FP_SET_CRCR( 0x80 )
+
+ ROM_REGION( 0x1400000, "gfx1", 0 ) /* GFX + Sound */
+ /* 0x0000000-0x0ffffff filled in in the DRIVER_INIT */
+ ROM_FILL( 0x1000000, 0x0400000, 0x00 ) /* to decode GFX as 5 bpp */
+
+ ROM_REGION( 0x1000000, "gfx2", 0 ) /* Temporary storage */
+ ROM_LOAD( "u48", 0x0000000, 0x0400000, CRC(19e03bf1) SHA1(2b3a4bb438b0aebf4f6a9fd26b071e5c9dd222b8) ) /* GFX only */
+ ROM_LOAD( "u47", 0x0400000, 0x0400000, CRC(74a5a29f) SHA1(8ea2aa1f8a80c5b88ca9222c5ecc3c4794e0a160) ) /* GFX + Sound */
+ ROM_LOAD( "u50", 0x0800000, 0x0400000, CRC(85daecf9) SHA1(824f6d2491075b1ef96ecd6667c5510409338a2f) ) /* GFX only */
+ ROM_LOAD( "u49", 0x0c00000, 0x0400000, CRC(70a4ee0b) SHA1(07b09916f0366d0c6eed94a905ec0b9d6ac9e7e1) ) /* GFX + Sound */
+ROM_END
+
+ROM_START( aligators )
+ ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_BYTE( "u45", 0x000000, 0x080000, CRC(61c47c56) SHA1(6dd3fc6fdab252e0fb43c0793eef70203c888d7f) )
- ROM_LOAD16_BYTE( "u44", 0x000001, 0x080000, CRC(f0be007a) SHA1(2112b2e5f020028b50c8f2c72c83c9fee7a78224) )
+ ROM_LOAD16_BYTE( "u44", 0x000001, 0x080000, CRC(f0be007a) SHA1(2112b2e5f020028b50c8f2c72c83c9fee7a78224) ) /* differs by 1 byte from above set, see note */
ROM_REGION( 0x8000, "gaelco_ds5002fp:sram", 0 ) /* DS5002FP code */
- ROM_LOAD( "aligator_ds5002fp.bin", 0x00000, 0x8000, NO_DUMP )
+ ROM_LOAD( "aligator_ds5002fp.bin", 0x00000, 0x8000, CRC(6558f215) SHA1(c961a9c81aa6b746294baf83ea5d1fcf7acab9db) )
ROM_REGION( 0x100, "gaelco_ds5002fp:mcu:internal", ROMREGION_ERASE00 )
/* these are the default states stored in NVRAM */
@@ -1726,7 +1760,8 @@ ROM_END
-GAME( 1994, aligator, 0, alighunt_d5002fp, alighunt, gaelco2_state, alighunt, ROT0, "Gaelco", "Alligator Hunt", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING )
+GAME( 1994, aligator, 0, alighunt_d5002fp, alighunt, gaelco2_state, alighunt, ROT0, "Gaelco", "Alligator Hunt (World, protected)", 0 )
+GAME( 1994, aligators, aligator,alighunt_d5002fp, alighunt, gaelco2_state, alighunt, ROT0, "Gaelco", "Alligator Hunt (Spain, protected)", 0 )
GAME( 1994, aligatorun, aligator,alighunt, alighunt, gaelco2_state, alighunt, ROT0, "Gaelco", "Alligator Hunt (unprotected, set 1)", 0 )
GAME( 1994, aligatoruna,aligator,alighunt, alighunt, gaelco2_state, alighunt, ROT0, "Gaelco", "Alligator Hunt (unprotected, set 2)", 0 ) // strange version, starts on space stages, but clearly a recompile not a trivial hack of the above, show version maybe?
diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp
index 6c09b4b3f9c..52a9b9d8149 100644
--- a/src/mame/drivers/gaiden.cpp
+++ b/src/mame/drivers/gaiden.cpp
@@ -154,11 +154,9 @@ WRITE8_MEMBER(gaiden_state::drgnbowl_irq_ack_w)
WRITE16_MEMBER(gaiden_state::gaiden_sound_command_w)
{
- if (ACCESSING_BITS_0_7)
- m_soundlatch->write(space, 0, data & 0xff); /* Ninja Gaiden */
- if (ACCESSING_BITS_8_15)
- m_soundlatch->write(space, 0, data >> 8); /* Tecmo Knight */
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ // Ninja Gaiden writes only to the lower byte; Tecmo Knight and Strato Fighter write to the upper byte instead.
+ // It's not clear which 8 data lines are actually used, but byte smearing is almost certainly involved.
+ m_soundlatch->write(space, 0, data & 0xff);
}
@@ -788,6 +786,7 @@ static MACHINE_CONFIG_START( shadoww )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ym1", YM2203, 4000000)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp
index 3cc3ef61875..caae5457a0d 100644
--- a/src/mame/drivers/galaxian.cpp
+++ b/src/mame/drivers/galaxian.cpp
@@ -5703,9 +5703,6 @@ static MACHINE_CONFIG_START( galaxian_base )
MCFG_SCREEN_UPDATE_DRIVER(galaxian_state, screen_update_galaxian)
- /* blinking frequency is determined by 555 counter with Ra=100k, Rb=10k, C=10uF */
- MCFG_TIMER_DRIVER_ADD_PERIODIC("stars", galaxian_state, galaxian_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001))
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("speaker")
MACHINE_CONFIG_END
@@ -5785,6 +5782,14 @@ static MACHINE_CONFIG_START( konami_sound_2x_ay8910 )
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( scramble_base, konami_base )
+ MCFG_FRAGMENT_ADD(konami_sound_2x_ay8910)
+
+ /* blinking frequency is determined by 555 counter with Ra=100k, Rb=10k, C=10uF */
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("stars", galaxian_state, scramble_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001))
+MACHINE_CONFIG_END
+
+
/*************************************
*
@@ -6048,43 +6053,24 @@ static MACHINE_CONFIG_DERIVED( turpins, turtles )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( theend, galaxian_base )
+static MACHINE_CONFIG_DERIVED( theend, konami_base )
MCFG_FRAGMENT_ADD(konami_sound_2x_ay8910)
/* alternate memory map */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(theend_map)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ MCFG_DEVICE_MODIFY("ppi8255_0")
MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, theend_coin_counter_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(galaxian_state, konami_sound_control_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN3"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, konami_portc_1_w))
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( scramble, galaxian_base )
- MCFG_FRAGMENT_ADD(konami_sound_2x_ay8910)
-
+static MACHINE_CONFIG_DERIVED( scramble, scramble_base )
/* alternate memory map */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(theend_map)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, konami_portc_0_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(galaxian_state, konami_sound_control_w))
+ MCFG_DEVICE_MODIFY("ppi8255_1")
MCFG_I8255_IN_PORTC_CB(READ8(galaxian_state, scramble_protection_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, scramble_protection_w))
MACHINE_CONFIG_END
@@ -6103,17 +6089,17 @@ static MACHINE_CONFIG_DERIVED( explorer, galaxian_base )
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- /* sound hardware */
- MCFG_SOUND_ADD("8910.0", AY8910, KONAMI_SOUND_CLOCK/8)
+ /* sound hardware is a pair of AY-3-8912 */
+ MCFG_SOUND_ADD("8910.0", AY8912, KONAMI_SOUND_CLOCK/8)
MCFG_AY8910_PORT_A_READ_CB(READ8(galaxian_state, explorer_sound_latch_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
- MCFG_SOUND_ADD("8910.1", AY8910, KONAMI_SOUND_CLOCK/8)
+ MCFG_SOUND_ADD("8910.1", AY8912, KONAMI_SOUND_CLOCK/8)
MCFG_AY8910_PORT_A_READ_CB(READ8(galaxian_state, konami_sound_timer_r))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( takeoff, explorer ) // takeoff shares the same main map as explorer, but uses only an AY8912 for sound.
+static MACHINE_CONFIG_DERIVED( takeoff, explorer ) // takeoff shares the same main map as explorer, but uses only one AY8912 for sound.
MCFG_SOUND_MODIFY("maincpu")
MCFG_DEVICE_CLOCK(XTAL_12MHz / 8) // XTAL verified, divider not verified
@@ -6133,20 +6119,12 @@ static MACHINE_CONFIG_DERIVED( takeoff, explorer ) // takeoff shares the same ma
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( scorpion, theend )
-
- MCFG_DEVICE_REMOVE("ppi8255_0")
- MCFG_DEVICE_REMOVE("ppi8255_1")
-
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, konami_portc_0_w))
+static MACHINE_CONFIG_DERIVED( scorpion, scramble_base )
+ /* alternate memory map */
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(theend_map)
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(galaxian_state, konami_sound_control_w))
+ MCFG_DEVICE_MODIFY("ppi8255_1")
MCFG_I8255_IN_PORTC_CB(READ8(galaxian_state, scorpion_protection_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, scorpion_protection_w))
@@ -6161,9 +6139,7 @@ static MACHINE_CONFIG_DERIVED( scorpion, theend )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( sfx, galaxian_base )
- MCFG_FRAGMENT_ADD(konami_sound_2x_ay8910)
-
+static MACHINE_CONFIG_DERIVED( sfx, scramble_base )
MCFG_DEVICE_REMOVE("watchdog")
/* alternate memory map */
@@ -6175,18 +6151,6 @@ static MACHINE_CONFIG_DERIVED( sfx, galaxian_base )
MCFG_CPU_PROGRAM_MAP(sfx_sample_map)
MCFG_CPU_IO_MAP(sfx_sample_portmap)
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, konami_portc_0_w))
-
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(galaxian_state, konami_sound_control_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN3"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, konami_portc_1_w))
-
MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(DEVREAD8("soundlatch2", generic_latch_8_device, read))
@@ -6210,11 +6174,9 @@ static MACHINE_CONFIG_DERIVED( monsterz, sfx )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(monsterz_map)
- MCFG_DEVICE_REMOVE("ppi8255_1")
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
+ MCFG_DEVICE_MODIFY("ppi8255_1")
MCFG_I8255_OUT_PORTA_CB(WRITE8(galaxian_state, monsterz_porta_1_w))
MCFG_I8255_OUT_PORTB_CB(WRITE8(galaxian_state, monsterz_portb_1_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN3"))
MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, monsterz_portc_1_w))
/* there are likely other differences too, but those can wait until after protection is sorted out */
@@ -6222,9 +6184,7 @@ static MACHINE_CONFIG_DERIVED( monsterz, sfx )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( scobra, konami_base )
- MCFG_FRAGMENT_ADD(konami_sound_2x_ay8910)
-
+static MACHINE_CONFIG_DERIVED( scobra, scramble_base )
/* alternate memory map */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(scobra_map)
@@ -6335,21 +6295,9 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( moonwar, scobra )
- MCFG_DEVICE_REMOVE("ppi8255_0")
- MCFG_DEVICE_REMOVE("ppi8255_1")
-
- MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0)
- MCFG_I8255_IN_PORTA_CB(IOPORT("IN0"))
- MCFG_I8255_IN_PORTB_CB(IOPORT("IN1"))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN2"))
+ MCFG_DEVICE_MODIFY("ppi8255_0")
MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, moonwar_port_select_w))
- MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0)
- MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("soundlatch", generic_latch_8_device, write))
- MCFG_I8255_OUT_PORTB_CB(WRITE8(galaxian_state, konami_sound_control_w))
- MCFG_I8255_IN_PORTC_CB(IOPORT("IN3"))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(galaxian_state, konami_portc_1_w))
-
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_INIT_OWNER(galaxian_state,moonwar) // bullets are less yellow
MACHINE_CONFIG_END
@@ -7210,6 +7158,12 @@ DRIVER_INIT_MEMBER(galaxian_state,scramble)
common_init(&galaxian_state::scramble_draw_bullet, &galaxian_state::scramble_draw_background, nullptr, nullptr);
}
+DRIVER_INIT_MEMBER(galaxian_state,explorer)
+{
+ // not sure how stars work here, but there is definitely no 555 timer
+ common_init(&galaxian_state::scramble_draw_bullet, &galaxian_state::galaxian_draw_background, nullptr, nullptr);
+}
+
DRIVER_INIT_MEMBER(galaxian_state,mandinga)
{
DRIVER_INIT_CALL(scramble);
@@ -12153,13 +12107,13 @@ GAME( 1982, mandinga, amidar, scramble, amidars, galaxian_state, mandi
/* The End/Scramble based hardware */
GAME( 1980, theend, 0, theend, theend, galaxian_state, theend, ROT90, "Konami", "The End", MACHINE_SUPPORTS_SAVE )
GAME( 1980, theends, theend, theend, theend, galaxian_state, theend, ROT90, "Konami (Stern Electronics license)", "The End (Stern Electronics)", MACHINE_SUPPORTS_SAVE )
-GAME( 1980, takeoff, theend, takeoff, explorer, galaxian_state, scramble, ROT90, "bootleg (Sidam)", "Take Off (bootleg of The End)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // tempo is way too fast
+GAME( 1980, takeoff, theend, takeoff, explorer, galaxian_state, explorer, ROT90, "bootleg (Sidam)", "Take Off (bootleg of The End)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // tempo is way too fast
GAME( 1981, scramble, 0, scramble, scramble, galaxian_state, scramble, ROT90, "Konami", "Scramble", MACHINE_SUPPORTS_SAVE )
GAME( 1981, scrambles, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, scrambles2, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "Konami (Stern Electronics license)", "Scramble (Stern Electronics set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, strfbomb, scramble, scramble, strfbomb, galaxian_state, scramble, ROT90, "bootleg (Omni)", "Strafe Bomb (bootleg of Scramble)", MACHINE_SUPPORTS_SAVE )
-GAME( 1981, explorer, scramble, explorer, explorer, galaxian_state, scramble, ROT90, "bootleg (Sidam)", "Explorer (bootleg of Scramble)", MACHINE_SUPPORTS_SAVE )
+GAME( 1981, explorer, scramble, explorer, explorer, galaxian_state, explorer, ROT90, "bootleg (Sidam)", "Explorer (bootleg of Scramble)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, scramblebf, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Karateco)", "Scramble (Karateco, French bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, scrambp, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Billport S.A.)", "Impacto (Billport S.A., Spanish bootleg of Scramble)", MACHINE_SUPPORTS_SAVE ) // similar to the Karateco set above
GAME( 1981, scramce, scramble, scramble, scramble, galaxian_state, scramble, ROT90, "bootleg (Centromatic S.A.)", "Scramble (Centromatic S.A., Spanish bootleg)", MACHINE_SUPPORTS_SAVE ) // similar to above
diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp
index 781e50ce6ee..5f9c3d843b8 100644
--- a/src/mame/drivers/gauntlet.cpp
+++ b/src/mame/drivers/gauntlet.cpp
@@ -124,6 +124,7 @@
#include "includes/gauntlet.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6502/m6502.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/tms5220.h"
#include "sound/ym2151.h"
@@ -279,7 +280,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, gauntlet_state )
/* MBUS */
AM_RANGE(0x800000, 0x801fff) AM_MIRROR(0x2fc000) AM_RAM
- AM_RANGE(0x802000, 0x802fff) AM_MIRROR(0x2fc000) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x802000, 0x802fff) AM_MIRROR(0x2fc000) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x803000, 0x803001) AM_MIRROR(0x2fcef0) AM_READ_PORT("803000")
AM_RANGE(0x803002, 0x803003) AM_MIRROR(0x2fcef0) AM_READ_PORT("803002")
AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ_PORT("803004")
@@ -289,7 +290,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, gauntlet_state )
AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
AM_RANGE(0x803140, 0x803141) AM_MIRROR(0x2fce8e) AM_WRITE(video_int_ack_w)
- AM_RANGE(0x803150, 0x803151) AM_MIRROR(0x2fce8e) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x803150, 0x803151) AM_MIRROR(0x2fce8e) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x803170, 0x803171) AM_MIRROR(0x2fce8e) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
/* VBUS */
@@ -498,7 +499,8 @@ static MACHINE_CONFIG_START( gauntlet_base )
MCFG_MACHINE_START_OVERRIDE(gauntlet_state,gauntlet)
MCFG_MACHINE_RESET_OVERRIDE(gauntlet_state,gauntlet)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp
index 0596c095117..51088aafaa4 100644
--- a/src/mame/drivers/gba.cpp
+++ b/src/mame/drivers/gba.cpp
@@ -2,7 +2,7 @@
// copyright-holders:R. Belmont,Ryan Holtz
/***************************************************************************
- gba.c
+ gba.cpp
Driver file to handle emulation of the Nintendo Game Boy Advance.
diff --git a/src/mame/drivers/gcpinbal.cpp b/src/mame/drivers/gcpinbal.cpp
index fbe9ee8e4c9..25c3c3f6bda 100644
--- a/src/mame/drivers/gcpinbal.cpp
+++ b/src/mame/drivers/gcpinbal.cpp
@@ -49,7 +49,7 @@ ES-9209B
| 6116 | | AS7C256 |
| 6116 +-------+ AS7C256 |
|J AS7C256 |
-|A AS7C256 AS7C256 |
+|A MB3773 AS7C256 AS7C256 |
|M TSW1* +-------+ U13* |
|M PAL 32MHz |ES-9303| U11 |
|A PAL 68000P-16 +-------+ |
@@ -147,6 +147,8 @@ WRITE8_MEMBER(gcpinbal_state::bank_w)
m_bg0_gfxset = (data & 0x04) ? 0x1000 : 0;
m_bg1_gfxset = (data & 0x08) ? 0x1000 : 0;
+ m_watchdog->write_line_ck(BIT(data, 7));
+
// machine().bookkeeping().coin_lockout_w(0, ~data & 0x01);
// machine().bookkeeping().coin_lockout_w(1, ~data & 0x02);
}
@@ -456,6 +458,8 @@ static MACHINE_CONFIG_START( gcpinbal )
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_DEVICE_ADD("watchdog", MB3773, 0)
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/grchamp.cpp b/src/mame/drivers/grchamp.cpp
index 70b2416ac8b..8b0a0a061e5 100644
--- a/src/mame/drivers/grchamp.cpp
+++ b/src/mame/drivers/grchamp.cpp
@@ -24,6 +24,17 @@
Note that a dipswitch setting allows score to be displayed
onscreen, but there's no equivalent for tachometer.
+ - TODO: the two sound callbacks could, under unusual circumstances,
+ conflict with one another, causing the newly written value to have
+ its bit 7 cleared before the sound cpu reads it.
+ The proper way to handle this is to use a single callback which
+ processes a timestamped event queue.
+
+ - TODO: merge the sound system with taitosj.cpp, as the sound system
+ is almost completely identical. Also import the taitosj.cpp dac/volume
+ system, as the system used in audio/grchamp.cpp for dac output is
+ incorrect.
+
Notes:
- The object of the game is to avoid the opposing cars.
@@ -41,6 +52,8 @@
- The Speech Feature enhances the game play.
+ - Schematics: https://ia800501.us.archive.org/16/items/ArcadeGameManualGrandchampion/grandchampion.pdf
+
***************************************************************************/
#include "emu.h"
@@ -82,6 +95,8 @@
void grchamp_state::machine_start()
{
+ m_soundlatch_data = 0x00;
+ m_soundlatch_flag = false;
save_item(NAME(m_cpu0_out));
save_item(NAME(m_cpu1_out));
save_item(NAME(m_comm_latch));
@@ -95,6 +110,7 @@ void grchamp_state::machine_start()
void grchamp_state::machine_reset()
{
+ m_soundnmi->in_w<0>(0); // disable sound nmi
/* if the coin system is 1 way, lock Coin B (Page 40) */
machine().bookkeeping().coin_lockout_w(1, (ioport("DSWB")->read() & 0x10) ? 1 : 0);
}
@@ -202,8 +218,7 @@ WRITE8_MEMBER(grchamp_state::cpu0_outputs_w)
case 0x0e: /* OUT14 */
/* O-21 connector */
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(grchamp_state::soundlatch_w_cb), this), data); // soundlatch write, needs to synchronize
break;
}
}
@@ -423,6 +438,41 @@ READ8_MEMBER(grchamp_state::main_to_sub_comm_r)
* Sound port handlers
*
*************************************/
+TIMER_CALLBACK_MEMBER(grchamp_state::soundlatch_w_cb)
+{
+ if (m_soundlatch_flag && (m_soundlatch_data != param))
+ logerror("Warning: soundlatch written before being read. Previous: %02x, new: %02x\n", m_soundlatch_data, param);
+ m_soundlatch_data = param;
+ m_soundlatch_flag = true;
+ m_soundnmi->in_w<1>(1);
+}
+
+TIMER_CALLBACK_MEMBER(grchamp_state::soundlatch_clear7_w_cb)
+{
+ if (m_soundlatch_flag)
+ logerror("Warning: soundlatch bit 7 cleared before being read. Previous: %02x, new: %02x\n", m_soundlatch_data, m_soundlatch_data&0x7f);
+ m_soundlatch_data &= 0x7F;
+}
+
+READ8_MEMBER(grchamp_state::soundlatch_r)
+{
+ if (!machine().side_effect_disabled())
+ {
+ m_soundlatch_flag = false;
+ m_soundnmi->in_w<1>(0);
+ }
+ return m_soundlatch_data;
+}
+
+WRITE8_MEMBER(grchamp_state::soundlatch_clear7_w)
+{
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(grchamp_state::soundlatch_clear7_w_cb), this), data);
+}
+
+READ8_MEMBER(grchamp_state::soundlatch_flags_r)
+{
+ return 0x03 | (m_soundlatch_flag?0x8:0);
+}
WRITE8_MEMBER(grchamp_state::portA_0_w)
{
@@ -436,12 +486,13 @@ WRITE8_MEMBER(grchamp_state::portB_0_w)
WRITE8_MEMBER(grchamp_state::portA_2_w)
{
- /* A0/A1 modify the output of AY8910 #2 */
- /* A7 contributes to the discrete logic hanging off of AY8910 #0 */
+ /* A0/A1 modify the output of AY8910 #2 with filter capacitors */
+ /* A7 contributes to the volume control for the discrete logic dac hanging off of AY8910 #0's i/o ports */
}
WRITE8_MEMBER(grchamp_state::portB_2_w)
{
- /* B0 connects elsewhere */
+ /* B0 is the sound nmi enable, active low */
+ m_soundnmi->in_w<0>((~data)&1);
}
@@ -535,9 +586,39 @@ static ADDRESS_MAP_START( sub_portmap, AS_IO, 8, grchamp_state )
ADDRESS_MAP_END
-/* complete memory map derived from schematics */
+/* complete memory map derived from schematics;
+ the grchamp sound system is almost identical to taitosj.cpp sound system
+*/
+/* Sound cpu address map ( * = used within this section; x = don't care )
+ | | |
+15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+ 0 * * * R 74LS138 @ 10B
+ 0 0 0 0 * * * * * * * * * * * * R ROM (7B)
+ 0 0 0 1 * * * * * * * * * * * * R ROM (6B)
+(0 0 1 0 * * * * * * * * * * * * R ROM (5B), not populated, OPEN BUS)
+(0 0 1 1 * * * * * * * * * * * * R ROM (4B), not populated, OPEN BUS)
+(0 1 * * x x x x x x x x x x x x R is also decoded by the 74LS138 @ 10B, but those four outputs are not connected anywhere and that region is occupied below)
+ 0 1 * * * RW 74LS138 @ 9C
+ 0 1 0 0 0 0 * * * * * * * * * * RW SRAMs (2x 2114 @ 5C, 4C)
+ 0 1 0 0 0 1 x x x x x x x x x x OPEN BUS
+ 0 1 0 0 1 RW /CS5 (AY chips, this area has a 2 clock waitstate penalty on any access)
+ 0 1 0 0 1 x x x x x x x x 0 0 0 W Address AY @ 3B (with dac/volume connected to ioa/iob)
+ 0 1 0 0 1 x x x x x x x x 0 0 1 RW Data AY @ 3B (with dac/volume connected to ioa/iob)
+ 0 1 0 0 1 x x x x x x x x 0 1 0 W Address AY @ 2B
+ 0 1 0 0 1 x x x x x x x x 0 1 1 RW Data AY @ 2B
+ 0 1 0 0 1 x x x x x x x x 1 x 0 W Address AY @ 1B (with filter caps on ioa1,ioa0, nmi enable on iob0, dac attenuate on ioa7)
+ 0 1 0 0 1 x x x x x x x x 1 x 1 RW Data AY @ 1B (with filter caps on ioa1,ioa0, nmi enable on iob0, dac attenuate on ioa7)
+ 0 1 0 1 0 RW /CS6 (soundlatch/semaphores/nmi state)
+ 0 1 0 1 0 x x x x x x x x x * * RW 74155 @ 6D
+ 0 1 0 1 0 x x x x x x x x x 0 0 R Read soundlatch, and clear main->sound semaphore
+ 0 1 0 1 0 x x x x x x x x x 0 0 W Clear bit 7 in soundlatch
+ 0 1 0 1 0 x x x x x x x x x 0 1 R Read main->sound semaphore state in bit 3, bit 2 is 0, bits 1 and 0 are both 1, remaining bits are open bus
+ 0 1 0 1 0 x x x x x x x x x 0 1 W OPEN BUS
+ 0 1 0 1 0 x x x x x x x x x 1 x RW OPEN BUS
+*/
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, grchamp_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
+ // 2000-3fff are empty rom sockets
AM_RANGE(0x4000, 0x43ff) AM_RAM
AM_RANGE(0x4800, 0x4801) AM_MIRROR(0x07f8) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0x4801, 0x4801) AM_MIRROR(0x07f8) AM_DEVREAD("ay1", ay8910_device, data_r)
@@ -545,7 +626,8 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, grchamp_state )
AM_RANGE(0x4803, 0x4803) AM_MIRROR(0x07f8) AM_DEVREAD("ay2", ay8910_device, data_r)
AM_RANGE(0x4804, 0x4805) AM_MIRROR(0x07fa) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
AM_RANGE(0x4805, 0x4805) AM_MIRROR(0x07fa) AM_DEVREAD("ay3", ay8910_device, data_r)
- AM_RANGE(0x5000, 0x5000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x07fc) AM_READ(soundlatch_r) AM_WRITE(soundlatch_clear7_w)
+ AM_RANGE(0x5001, 0x5001) AM_MIRROR(0x07fc) AM_READ(soundlatch_flags_r) AM_WRITENOP // writes here on taitosj reset the secondary semaphore, which doesn't exist on grchamp, but the code tries to reset it anyway!
ADDRESS_MAP_END
@@ -682,7 +764,8 @@ static MACHINE_CONFIG_START( grchamp )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ay1", AY8910, SOUND_CLOCK/4) /* 3B */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, portA_0_w))
diff --git a/src/mame/drivers/gstriker.cpp b/src/mame/drivers/gstriker.cpp
index 5a0c072bfec..7556e59d07b 100644
--- a/src/mame/drivers/gstriker.cpp
+++ b/src/mame/drivers/gstriker.cpp
@@ -26,10 +26,14 @@ Grand Striker has an IRQ2 which is probably network related.
DSWs need correctly mapping, they're just commented for the moment.
TODO:
-Finish hooking up the inputs
-Tilemap scrolling/rotation/zooming or whatever effect it needs
-Priorities are wrong. I suspect they need sprite orthogonality
-Missing mixer registers (mainly layer enable/disable)
+- Finish hooking up the inputs
+- Tilemap scrolling/rotation/zooming or whatever effect it needs
+- Priorities are wrong. I suspect they need sprite orthogonality
+- Missing mixer registers (mainly layer enable/disable)
+- Tecmo World Cup '94 has missing protection emulation for draw buy-in
+ (as seen by code snippet 0x42ee, referenced in other places as well)
+ It's unknown how the game logic should be at current stage.
+- Tecmo World Cup '94 also has no name entry whatsoever.
******************************************************************************/
@@ -147,7 +151,7 @@ X3: 14.31818
Note: Same hardware as Tecmo World Cup '94, minus one VS9209 chip.
-*** ROMSET: twrldc94
+*** ROMSET: twcup94
Tecmo World Cup 94
Tecmo 1994
@@ -185,6 +189,12 @@ Frequencies: 68k is XTAL_32MHZ/2
void gstriker_state::machine_start()
{
membank("soundbank")->configure_entries(0, 8, memregion("audiocpu")->base(), 0x8000);
+
+ if (m_acia.found())
+ {
+ m_acia->write_cts(0);
+ m_acia->write_dcd(0);
+ }
}
/*** SOUND RELATED ***********************************************************/
@@ -229,7 +239,6 @@ static GFXDECODE_START( gstriker )
GFXDECODE_ENTRY( "gfx1", 0, gs_8x8x4_layout, 0, 256 )
GFXDECODE_ENTRY( "gfx2", 0, gs_16x16x4_layout, 0, 256 )
GFXDECODE_ENTRY( "gfx3", 0, gs_16x16x4_layout, 0, 256 )
-
GFXDECODE_END
@@ -237,7 +246,7 @@ GFXDECODE_END
-static ADDRESS_MAP_START( gstriker_map, AS_PROGRAM, 16, gstriker_state )
+static ADDRESS_MAP_START( twcup94_map, AS_PROGRAM, 16, gstriker_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, vram_r, vram_w )
AM_RANGE(0x140000, 0x141fff) AM_RAM AM_SHARE("cg10103_m_vram")
@@ -246,14 +255,21 @@ static ADDRESS_MAP_START( gstriker_map, AS_PROGRAM, 16, gstriker_state )
AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_MIRROR(0x00f000)
AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, regs_r, regs_w )
- AM_RANGE(0x200040, 0x20005f) AM_RAM AM_SHARE("mixerregs1")
- AM_RANGE(0x200060, 0x20007f) AM_RAM AM_SHARE("mixerregs2")
+ AM_RANGE(0x200010, 0x200011) AM_WRITENOP
+ AM_RANGE(0x200020, 0x200021) AM_WRITENOP
+ AM_RANGE(0x200040, 0x20005f) AM_RAM AM_SHARE("mixerregs")
AM_RANGE(0x200080, 0x20009f) AM_DEVREADWRITE8("io", vs9209_device, read, write, 0x00ff)
AM_RANGE(0x2000a0, 0x2000a1) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0xffc000, 0xffffff) AM_RAM AM_SHARE("work_ram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( gstriker_map, AS_PROGRAM, 16, gstriker_state )
+ AM_RANGE(0x200060, 0x200061) AM_DEVREADWRITE8("acia", acia6850_device, status_r, control_w, 0x00ff)
+ AM_RANGE(0x200062, 0x200063) AM_DEVREADWRITE8("acia", acia6850_device, data_r, data_w, 0x00ff)
+ AM_IMPORT_FROM(twcup94_map)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gstriker_state )
AM_RANGE(0x0000, 0x77ff) AM_ROM
AM_RANGE(0x7800, 0x7fff) AM_RAM
@@ -354,9 +370,19 @@ static INPUT_PORTS_START( gstriker )
PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) // "Self Test Mode"
INPUT_PORTS_END
-static INPUT_PORTS_START( twrldc94 )
+static INPUT_PORTS_START( twcup94 )
PORT_INCLUDE( gstriker_generic )
+ PORT_MODIFY("P1")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Pass")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Shoot")
+ PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_MODIFY("P2")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Pass")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Shoot")
+ PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
+
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
@@ -413,7 +439,7 @@ static INPUT_PORTS_START( vgoalsoc )
PORT_INCLUDE( gstriker_generic )
PORT_START("DSW1")
- PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
+ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
@@ -423,7 +449,7 @@ static INPUT_PORTS_START( vgoalsoc )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
+ PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:4,5,6")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
@@ -433,33 +459,31 @@ static INPUT_PORTS_START( vgoalsoc )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_6C ) )
- PORT_DIPNAME( 0xc0, 0xc0, DEF_STR (Unknown) ) // Probably difficulty
+ PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWA:7,8")
PORT_DIPSETTING( 0x80, "A" )
PORT_DIPSETTING( 0xc0, "B" )
PORT_DIPSETTING( 0x40, "C" )
PORT_DIPSETTING( 0x00, "D" )
PORT_START("DSW2")
- PORT_DIPNAME( 0x03, 0x03, "Player VS CPU Time" ) // no coperative
+ PORT_DIPNAME( 0x03, 0x03, "Player VS CPU Time" ) PORT_DIPLOCATION("SWB:1,2") // no cooperative
PORT_DIPSETTING( 0x02, "1:00" )
PORT_DIPSETTING( 0x03, "1:30" )
PORT_DIPSETTING( 0x01, "2:00" )
PORT_DIPSETTING( 0x00, "2:30" )
- PORT_DIPNAME( 0x0c, 0x0c, "Player VS Player Time" )
+ PORT_DIPNAME( 0x0c, 0x0c, "Player VS Player Time" ) PORT_DIPLOCATION("SWB:3,4")
PORT_DIPSETTING( 0x08, "1:30" )
PORT_DIPSETTING( 0x0c, "2:00" )
PORT_DIPSETTING( 0x04, "2:30" )
PORT_DIPSETTING( 0x00, "3:00" )
- PORT_DIPNAME( 0x10, 0x10, "Countdown" )
+ PORT_DIPNAME( 0x10, 0x10, "Countdown" ) PORT_DIPLOCATION("SWB:5")
PORT_DIPSETTING( 0x10, "54 sec" )
PORT_DIPSETTING( 0x00, "60 sec" )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, "DWS2:6" ) // hangs at POST
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, "Start credit" )
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:6")
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( On ) )
+ PORT_SERVICE_DIPLOC( 0x40, IP_ACTIVE_LOW, "SWB:7" )
+ PORT_DIPNAME( 0x80, 0x80, "Start credit" ) PORT_DIPLOCATION("SWB:8")
PORT_DIPSETTING( 0x80, "1" )
PORT_DIPSETTING( 0x00, "2" )
INPUT_PORTS_END
@@ -486,6 +510,11 @@ static MACHINE_CONFIG_START( gstriker )
MCFG_DEVICE_ADD("watchdog", MB3773, 0)
+ MCFG_DEVICE_ADD("acia", ACIA6850, 0)
+ MCFG_ACIA6850_IRQ_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
+ //MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("link", rs232_port_device, write_txd))
+ //MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("link", rs232_port_device, write_rts))
+
MCFG_SCREEN_ADD("screen", RASTER)
// MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -493,6 +522,7 @@ static MACHINE_CONFIG_START( gstriker )
MCFG_SCREEN_SIZE(64*8, 64*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
MCFG_SCREEN_UPDATE_DRIVER(gstriker_state, screen_update)
+ MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(gstriker_state, screen_vblank))
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gstriker)
@@ -531,12 +561,14 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( twc94, gstriker )
MCFG_CPU_REPLACE("maincpu", M68000, 16000000)
- MCFG_CPU_PROGRAM_MAP(gstriker_map)
+ MCFG_CPU_PROGRAM_MAP(twcup94_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", gstriker_state, irq1_line_hold)
MCFG_DEVICE_MODIFY("io")
- MCFG_VS9209_OUT_PORTH_CB(WRITE8(gstriker_state, twrldc94_prot_reg_w))
+ MCFG_VS9209_OUT_PORTH_CB(WRITE8(gstriker_state, twcup94_prot_reg_w))
MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("watchdog", mb3773_device, write_line_ck)) MCFG_DEVCB_BIT(3)
+
+ MCFG_DEVICE_REMOVE("acia")
MACHINE_CONFIG_END
@@ -713,7 +745,7 @@ ROM_START( vgoalsca )
ROM_LOAD( "c13_u104.104", 0x000000, 0x200000, CRC(8437b6f8) SHA1(79f183dcbf3cde5c77e086e4fdd8341809396e37) )
ROM_END
-ROM_START( twrldc94 )
+ROM_START( twcup94 )
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_WORD_SWAP( "13.u37", 0x00000, 0x80000, CRC(42adb463) SHA1(ec7bcb684489b56f81ab851a9d8f42d54679363b) )
@@ -743,7 +775,7 @@ ROM_START( twrldc94 )
ROM_LOAD( "u104", 0x000000, 0x100000, CRC(df07d0af) SHA1(356560e164ff222bc9004fe202f829c93244a6c9) )
ROM_END
-ROM_START( twrldc94a )
+ROM_START( twcup94a )
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_WORD_SWAP( "twrdc94a_13.u37", 0x00000, 0x80000, CRC(08f314ee) SHA1(3fca5050f5bcd60533d3bd9dea81ba631a98bfd6) )
@@ -792,7 +824,7 @@ m_work_ram[0x000/2] = (_num_ & 0xffff0000) >> 16;\
m_work_ram[0x002/2] = (_num_ & 0x0000ffff) >> 0;
-WRITE8_MEMBER(gstriker_state::twrldc94_prot_reg_w)
+WRITE8_MEMBER(gstriker_state::twcup94_prot_reg_w)
{
m_prot_reg[1] = m_prot_reg[0];
m_prot_reg[0] = data;
@@ -800,16 +832,16 @@ WRITE8_MEMBER(gstriker_state::twrldc94_prot_reg_w)
// Command byte is also written to VS9209 port F, which is set for input only.
// Does the MCU somehow strobe it out of there?
uint8_t mcu_data = m_work_ram[0x00f/2] & 0x00ff;
-
+
if( ((m_prot_reg[1] & 4) == 0) && ((m_prot_reg[0] & 4) == 4) )
{
switch( m_gametype )
{
- case 1:
+ case TECMO_WCUP94_MCU:
switch (mcu_data)
{
#define NULL_SUB 0x0000828E
- case 0x53: PC(0x0000a4c); break; // boot -> main loop
+ case 0x53: PC(0x00000A4C); break; // boot -> main loop
/*
68 and 62 could be sprite or sound changes, or ?
@@ -824,12 +856,12 @@ WRITE8_MEMBER(gstriker_state::twrldc94_prot_reg_w)
}
*/
case 0x68: PC(NULL_SUB); break; // time up doesn't block long enough for pk shootout
- case 0x61: PC(0x0003AF4); break; // after time up, pk shootout???
- case 0x65: PC(0x0003F26); break;
+ case 0x61: PC(0x00003AF4); break; // after time up, pk shootout???
+ case 0x65: PC(0x00003F26); break;
// 62->72
case 0x62: PC(NULL_SUB); break; // after lose shootout, continue ???
- case 0x72: PC(0x000409E); break; // game over
+ case 0x72: PC(0x0000409E); break; // game over
/*
Attract mode is pre programmed loop called from main
@@ -851,14 +883,14 @@ WRITE8_MEMBER(gstriker_state::twrldc94_prot_reg_w)
0x0010DC8 unreachable code at end of attract loop with cases 6a,79,6f
*/
- case 0x6e: PC(0x0010E28); break; // loop
- case 0x6b: PC(0x0010EEC); break; // attract even
- case 0x69: PC(0x001120A); break; // attract odd
+ case 0x6e: PC(0x00010E28); break; // loop
+ case 0x6b: PC(0x00010EEC); break; // attract even
+ case 0x69: PC(0x0001120A); break; // attract odd
// In "continue" screen
// if( w@FFE078 & 80) 75
// *** after 75 beq
- case 0x75: PC(NULL_SUB); break;
+ case 0x75: PC(0x005088); break; // match adder, and check if limit is reached for ending
// unreachable code at end of attract loop 6a->79->6f
case 0x6a: PC(NULL_SUB); break;
@@ -866,26 +898,47 @@ WRITE8_MEMBER(gstriker_state::twrldc94_prot_reg_w)
case 0x6f: PC(NULL_SUB); break;
default:
- popmessage("Unknown MCU CMD %04x",m_mcu_data);
+ logerror("Unknown MCU CMD %04x\n",mcu_data);
PC(NULL_SUB);
break;
+
+ #undef NULL_SUB
}
break;
-
- case 2:
+
+ // same as above but with +0x10 displacement offsets
+ case TECMO_WCUP94A_MCU:
+
switch (mcu_data)
{
- case 0x53: PC(0x00000a5c); break; // POST
+ #define NULL_SUB 0x0000829E
+ case 0x53: PC(0x00000A5C); break; // POST
+
+ case 0x68: PC(NULL_SUB); break; // time up doesn't block long enough for pk shootout
+ case 0x61: PC(0x00003B04); break; // after time up, pk shootout???
+ case 0x65: PC(0x00003F36); break;
+ case 0x62: PC(NULL_SUB); break; // after lose shootout, continue ???
+ case 0x72: PC(0x000040AE); break; // game over
+
+ case 0x75: PC(0x005098); break; // match adder, and check if limit is reached for ending
+
+ // attract mode
+ case 0x6e: PC(0x00010E38); break; // loop
+ case 0x6b: PC(0x00010EFC); break; // attract even
+ case 0x69: PC(0x0001121A); break; // attract odd
+
default:
- popmessage("Unknown MCU CMD %04x",m_mcu_data);
+ logerror("Unknown MCU CMD %04x\n",mcu_data);
PC(NULL_SUB);
break;
+
+ #undef NULL_SUB
}
break;
- case 3:
+ case VGOAL_SOCCER_MCU:
switch (mcu_data)
{
case 0x33: PC(0x00063416); break; // *after game over, is this right?
@@ -899,7 +952,7 @@ WRITE8_MEMBER(gstriker_state::twrldc94_prot_reg_w)
case 0x79: PC(0x0006072E); break; // after select, start match
default:
- popmessage("Unknown MCU CMD %04x",m_mcu_data);
+ logerror("Unknown MCU CMD %04x\n",mcu_data);
PC(0x00000586); // rts
break;
}
@@ -959,27 +1012,24 @@ WRITE16_MEMBER(gstriker_state::vbl_toggle_w)
void gstriker_state::mcu_init()
{
- m_mcu_data = 0;
-
- save_item(NAME(m_mcu_data));
save_item(NAME(m_prot_reg));
}
-DRIVER_INIT_MEMBER(gstriker_state,twrldc94)
+DRIVER_INIT_MEMBER(gstriker_state,twcup94)
{
- m_gametype = 1;
+ m_gametype = TECMO_WCUP94_MCU;
mcu_init();
}
-DRIVER_INIT_MEMBER(gstriker_state,twrldc94a)
+DRIVER_INIT_MEMBER(gstriker_state,twcup94a)
{
- m_gametype = 2;
+ m_gametype = TECMO_WCUP94A_MCU;
mcu_init();
}
DRIVER_INIT_MEMBER(gstriker_state,vgoalsoc)
{
- m_gametype = 3;
+ m_gametype = VGOAL_SOCCER_MCU;
mcu_init();
m_maincpu->space(AS_PROGRAM).install_write_handler(0x200090, 0x200091, write16_delegate(FUNC(gstriker_state::vbl_toggle_w),this)); // vblank toggle
@@ -988,13 +1038,13 @@ DRIVER_INIT_MEMBER(gstriker_state,vgoalsoc)
/*** GAME DRIVERS ************************************************************/
-GAME( 1993, gstriker, 0, gstriker, gstriker, gstriker_state, 0, ROT0, "Human", "Grand Striker", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
+GAME( 1993, gstriker, 0, gstriker, gstriker, gstriker_state, 0, ROT0, "Human", "Grand Striker (Europe, Oceania)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1993, gstrikera, gstriker, gstriker, gstriker, gstriker_state, 0, ROT0, "Human", "Grand Striker (Americas)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1993, gstrikerj, gstriker, gstriker, gstriker, gstriker_state, 0, ROT0, "Human", "Grand Striker (Japan)", MACHINE_NOT_WORKING | MACHINE_NODEVICE_LAN | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
/* Similar, but not identical hardware, appear to be protected by an MCU :-( */
-GAME( 1994, vgoalsoc, 0, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (Europe)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // has ger/hol/arg/bra/ita/eng/spa/fra
-GAME( 1994, vgoalsca, vgoalsoc, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (US/Japan/Korea)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // has ger/hol/arg/bra/ita/kor/usa/jpn
-GAME( 1994, twrldc94, 0, twc94, twrldc94, gstriker_state, twrldc94, ROT0, "Tecmo", "Tecmo World Cup '94 (set 1)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
-GAME( 1994, twrldc94a,twrldc94, twc94, twrldc94, gstriker_state, twrldc94a, ROT0, "Tecmo", "Tecmo World Cup '94 (set 2)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
+GAME( 1994, vgoalsoc, 0, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (Europe)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // has ger/hol/arg/bra/ita/eng/spa/fra
+GAME( 1994, vgoalsca, vgoalsoc, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (US/Japan/Korea)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // has ger/hol/arg/bra/ita/kor/usa/jpn
+GAME( 1994, twcup94, 0, twc94, twcup94, gstriker_state, twcup94, ROT0, "Tecmo", "Tecmo World Cup '94 (set 1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
+GAME( 1994, twcup94a,twcup94, twc94, twcup94, gstriker_state, twcup94a, ROT0, "Tecmo", "Tecmo World Cup '94 (set 2)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp
index f6ea95ae474..a45a7a52b3d 100644
--- a/src/mame/drivers/hh_sm510.cpp
+++ b/src/mame/drivers/hh_sm510.cpp
@@ -2335,35 +2335,46 @@ ROM_START( tsjam )
ROM_END
+ROM_START( rzindy500 )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "10_22", 0x0000, 0x1000, CRC(99a746d0) SHA1(64264499d45a566fa9a0801c20e7fa27eac18da6) )
+
+ ROM_REGION( 533414, "svg", 0)
+ ROM_LOAD( "rzindy500.svg", 0, 533414, CRC(21c9bd2e) SHA1(549f079c5bd5883b21dc9b29b281a73728ed7827) )
+ROM_END
+
+
+
+// YEAR NAME PARENT COMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS
+CONS( 1989, kdribble, 0, 0, kdribble, kdribble, kdribble_state, 0, "Konami", "Double Dribble (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, ktopgun, 0, 0, ktopgun, ktopgun, ktopgun_state, 0, "Konami", "Top Gun (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, kcontra, 0, 0, kcontra, kcontra, kcontra_state, 0, "Konami", "Contra (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, ktmnt, 0, 0, ktmnt, ktmnt, ktmnt_state, 0, "Konami", "Teenage Mutant Ninja Turtles (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, kgradius, 0, 0, kgradius, kgradius, kgradius_state, 0, "Konami", "Gradius (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, kloneran, 0, 0, kloneran, kloneran, kloneran_state, 0, "Konami", "Lone Ranger (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, kblades, 0, 0, kblades, kblades, kblades_state, 0, "Konami", "Blades of Steel (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, knfl, 0, 0, knfl, knfl, knfl_state, 0, "Konami", "NFL Football (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, kbilly, 0, 0, kbilly, kbilly, kbilly_state, 0, "Konami", "The Adventures of Bayou Billy (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1991, kbucky, 0, 0, kbucky, kbucky, kbucky_state, 0, "Konami", "Bucky O'Hare (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1991, kgarfld, 0, 0, kgarfld, kgarfld, kgarfld_state, 0, "Konami", "Garfield (handheld)", MACHINE_SUPPORTS_SAVE )
+
+CONS( 1981, gnw_mc25, 0, 0, mc25, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Mickey Mouse", MACHINE_SUPPORTS_SAVE )
+CONS( 1981, gnw_eg26, gnw_mc25, 0, eg26, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Egg", MACHINE_SUPPORTS_SAVE )
+CONS( 1984, nupogodi, gnw_mc25, 0, nupogodi, mc25, mc25_state, 0, "Elektronika", "Nu, pogodi!", MACHINE_SUPPORTS_SAVE )
+CONS( 1989, exospace, gnw_mc25, 0, exospace, exospace, mc25_state, 0, "Elektronika", "Explorers of Space", MACHINE_SUPPORTS_SAVE )
+
+CONS( 1982, gnw_dm53, 0, 0, dm53, dm53, dm53_state, 0, "Nintendo", "Game & Watch: Mickey & Donald", MACHINE_SUPPORTS_SAVE )
+CONS( 1983, gnw_jr55, 0, 0, jr55, jr55, jr55_state, 0, "Nintendo", "Game & Watch: Donkey Kong II", MACHINE_SUPPORTS_SAVE )
+CONS( 1983, gnw_mw56, 0, 0, mw56, mw56, mw56_state, 0, "Nintendo", "Game & Watch: Mario Bros.", MACHINE_SUPPORTS_SAVE )
+
+CONS( 1982, gnw_dj101, 0, 0, dj101, dj101, dj101_state, 0, "Nintendo", "Game & Watch: Donkey Kong Jr. (new wide screen)", MACHINE_SUPPORTS_SAVE )
+CONS( 1983, gnw_ml102, 0, 0, ml102, ml102, ml102_state, 0, "Nintendo", "Game & Watch: Mario's Cement Factory (new wide screen)", MACHINE_SUPPORTS_SAVE )
+
+CONS( 1984, gnw_bx301, 0, 0, bx301, bx301, bx301_state, 0, "Nintendo", "Game & Watch: Boxing", MACHINE_SUPPORTS_SAVE )
+
+CONS( 1988, tgaunt, 0, 0, tgaunt, tgaunt, tgaunt_state, 0, "Tiger Electronics (licensed from Tengen)", "Gauntlet (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1988, tddragon, 0, 0, tddragon, tddragon, tddragon_state, 0, "Tiger Electronics (licensed from Tradewest/Technos)", "Double Dragon (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1991, tsonic, 0, 0, tsonic, tsonic, tsonic_state, 0, "Tiger Electronics (licensed from Sega)", "Sonic The Hedgehog (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1996, tsjam, 0, 0, tsjam, tsjam, tsjam_state, 0, "Tiger Electronics", "Space Jam (handheld)", MACHINE_SUPPORTS_SAVE )
-// YEAR NAME PARENT COMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS
-CONS( 1989, kdribble, 0, 0, kdribble, kdribble, kdribble_state, 0, "Konami", "Double Dribble (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, ktopgun, 0, 0, ktopgun, ktopgun, ktopgun_state, 0, "Konami", "Top Gun (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, kcontra, 0, 0, kcontra, kcontra, kcontra_state, 0, "Konami", "Contra (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, ktmnt, 0, 0, ktmnt, ktmnt, ktmnt_state, 0, "Konami", "Teenage Mutant Ninja Turtles (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, kgradius, 0, 0, kgradius, kgradius, kgradius_state, 0, "Konami", "Gradius (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, kloneran, 0, 0, kloneran, kloneran, kloneran_state, 0, "Konami", "Lone Ranger (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, kblades, 0, 0, kblades, kblades, kblades_state, 0, "Konami", "Blades of Steel (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, knfl, 0, 0, knfl, knfl, knfl_state, 0, "Konami", "NFL Football (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, kbilly, 0, 0, kbilly, kbilly, kbilly_state, 0, "Konami", "The Adventures of Bayou Billy (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1991, kbucky, 0, 0, kbucky, kbucky, kbucky_state, 0, "Konami", "Bucky O'Hare (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1991, kgarfld, 0, 0, kgarfld, kgarfld, kgarfld_state, 0, "Konami", "Garfield (handheld)", MACHINE_SUPPORTS_SAVE )
-
-CONS( 1981, gnw_mc25, 0, 0, mc25, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Mickey Mouse", MACHINE_SUPPORTS_SAVE )
-CONS( 1981, gnw_eg26, gnw_mc25, 0, eg26, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Egg", MACHINE_SUPPORTS_SAVE )
-CONS( 1984, nupogodi, gnw_mc25, 0, nupogodi, mc25, mc25_state, 0, "Elektronika", "Nu, pogodi!", MACHINE_SUPPORTS_SAVE )
-CONS( 1989, exospace, gnw_mc25, 0, exospace, exospace, mc25_state, 0, "Elektronika", "Explorers of Space", MACHINE_SUPPORTS_SAVE )
-
-CONS( 1982, gnw_dm53, 0, 0, dm53, dm53, dm53_state, 0, "Nintendo", "Game & Watch: Mickey & Donald", MACHINE_SUPPORTS_SAVE )
-CONS( 1983, gnw_jr55, 0, 0, jr55, jr55, jr55_state, 0, "Nintendo", "Game & Watch: Donkey Kong II", MACHINE_SUPPORTS_SAVE )
-CONS( 1983, gnw_mw56, 0, 0, mw56, mw56, mw56_state, 0, "Nintendo", "Game & Watch: Mario Bros.", MACHINE_SUPPORTS_SAVE )
-
-CONS( 1982, gnw_dj101, 0, 0, dj101, dj101, dj101_state, 0, "Nintendo", "Game & Watch: Donkey Kong Jr. (new wide screen)", MACHINE_SUPPORTS_SAVE )
-CONS( 1983, gnw_ml102, 0, 0, ml102, ml102, ml102_state, 0, "Nintendo", "Game & Watch: Mario's Cement Factory (new wide screen)", MACHINE_SUPPORTS_SAVE )
-
-CONS( 1984, gnw_bx301, 0, 0, bx301, bx301, bx301_state, 0, "Nintendo", "Game & Watch: Boxing", MACHINE_SUPPORTS_SAVE )
-
-CONS( 1988, tgaunt, 0, 0, tgaunt, tgaunt, tgaunt_state, 0, "Tiger Electronics (licensed from Tengen)", "Gauntlet (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1988, tddragon, 0, 0, tddragon, tddragon, tddragon_state, 0, "Tiger Electronics (licensed from Tradewest/Technos)", "Double Dragon (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1991, tsonic, 0, 0, tsonic, tsonic, tsonic_state, 0, "Tiger Electronics (licensed from Sega)", "Sonic The Hedgehog (handheld)", MACHINE_SUPPORTS_SAVE )
-CONS( 1996, tsjam, 0, 0, tsjam, tsjam, tsjam_state, 0, "Tiger Electronics", "Space Jam (handheld)", MACHINE_SUPPORTS_SAVE )
+CONS( 1996, rzindy500, 0, 0, tsjam, tsjam, tsjam_state, 0, "Tiger Electronics (licensed from Sega)", "R-Zone: Indy 500", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/hp80.cpp b/src/mame/drivers/hp80.cpp
index 5438720d12f..fd03e1688ca 100644
--- a/src/mame/drivers/hp80.cpp
+++ b/src/mame/drivers/hp80.cpp
@@ -15,6 +15,9 @@
#include "sound/dac.h"
#include "sound/volt_reg.h"
#include "machine/1ma6.h"
+#include "bus/hp80_optroms/hp80_optrom.h"
+#include "softlist.h"
+#include "machine/bankdev.h"
// Debugging
#define VERBOSE 1
@@ -114,12 +117,12 @@ protected:
required_device<timer_device> m_clk_busy_timer;
required_device<beep_device> m_beep;
required_device<dac_1bit_device> m_dac;
- required_region_ptr<uint8_t> m_rom00;
- required_memory_bank m_rombank;
required_ioport m_io_key0;
required_ioport m_io_key1;
required_ioport m_io_key2;
required_ioport m_io_modkeys;
+ required_device_array<hp80_optrom_slot_device , 6> m_rom_drawers;
+ required_device<address_map_bank_device> m_rombank;
// Character generator
required_region_ptr<uint8_t> m_chargen;
@@ -132,7 +135,6 @@ protected:
uint8_t m_crt_ctl;
uint8_t m_crt_read_byte;
uint8_t m_crt_write_byte;
- uint8_t m_empty_bank[ 0x2000 ];
bool m_global_int_en;
uint16_t m_int_req;
uint16_t m_int_serv;
@@ -183,12 +185,12 @@ hp85_state::hp85_state(const machine_config &mconfig, device_type type, const ch
m_clk_busy_timer(*this , "clk_busy_timer"),
m_beep(*this , "beeper"),
m_dac(*this , "dac"),
- m_rom00(*this , "rom00"),
- m_rombank(*this , "rombank"),
m_io_key0(*this , "KEY0"),
m_io_key1(*this , "KEY1"),
m_io_key2(*this , "KEY2"),
m_io_modkeys(*this, "MODKEYS"),
+ m_rom_drawers(*this , "drawer%u" , 1),
+ m_rombank(*this , "rombank"),
m_chargen(*this , "chargen")
{
}
@@ -197,14 +199,6 @@ void hp85_state::machine_start()
{
machine().first_screen()->register_screen_bitmap(m_bitmap);
m_video_mem.resize(VIDEO_MEM_SIZE);
-
- // ROM in bank 0 is always present (it's part of system ROMs)
- m_rombank->configure_entry(0 , m_rom00);
-
- memset(&m_empty_bank[ 0 ] , 0xff , sizeof(m_empty_bank));
-
- // All other entries in rombank (01-FF) not present for now
- m_rombank->configure_entries(1 , 255 , m_empty_bank , 0);
}
void hp85_state::machine_reset()
@@ -215,9 +209,6 @@ void hp85_state::machine_reset()
m_crt_ctl = BIT_MASK(CRT_CTL_POWERDN_BIT) | BIT_MASK(CRT_CTL_WIPEOUT_BIT);
m_crt_read_byte = 0;
m_crt_write_byte = 0;
- // Clear RSELEC
- m_rombank->set_entry(0xff);
-
m_int_req = 0;
m_int_serv = 0;
m_top_pending = NO_IRQ;
@@ -243,6 +234,16 @@ void hp85_state::machine_reset()
m_timer_idx = 0;
m_clk_busy = false;
update_irl();
+
+ // Load optional ROMs (if any)
+ // All entries in rombanks [01..FF] initially not present
+ m_rombank->space(AS_PROGRAM).unmap_read(HP80_OPTROM_SIZE * 1 , HP80_OPTROM_SIZE * 0x100 - 1);
+ for (auto& draw : m_rom_drawers) {
+ LOG("Loading opt ROM in drawer %s\n" , draw->tag());
+ draw->install_read_handler(m_rombank->space(AS_PROGRAM));
+ }
+ // Clear RSELEC
+ m_rombank->set_bank(0xff);
}
uint32_t hp85_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@@ -534,7 +535,7 @@ WRITE8_MEMBER(hp85_state::clkdat_w)
WRITE8_MEMBER(hp85_state::rselec_w)
{
- m_rombank->set_entry(data);
+ m_rombank->set_bank(data);
}
// Outer index: key position [0..79] = r * 8 + c
@@ -1011,7 +1012,7 @@ INPUT_PORTS_END
static ADDRESS_MAP_START(cpu_mem_map , AS_PROGRAM , 8 , hp85_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000 , 0x5fff) AM_ROM
- AM_RANGE(0x6000 , 0x7fff) AM_ROMBANK("rombank")
+ AM_RANGE(0x6000 , 0x7fff) AM_DEVICE("rombank" , address_map_bank_device , amap8)
AM_RANGE(0x8000 , 0xbfff) AM_RAM
AM_RANGE(0xff00 , 0xff00) AM_WRITE(ginten_w)
AM_RANGE(0xff01 , 0xff01) AM_WRITE(gintdis_w)
@@ -1024,11 +1025,24 @@ static ADDRESS_MAP_START(cpu_mem_map , AS_PROGRAM , 8 , hp85_state)
AM_RANGE(0xff18 , 0xff18) AM_WRITE(rselec_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START(rombank_mem_map , AS_PROGRAM , 8 , hp85_state)
+ ADDRESS_MAP_UNMAP_HIGH
+ // ROM in bank 0 is always present (it's part of system ROMs)
+ AM_RANGE(0x0000 , 0x1fff) AM_ROM
+ADDRESS_MAP_END
+
static MACHINE_CONFIG_START(hp85)
MCFG_CPU_ADD("cpu" , HP_CAPRICORN , MASTER_CLOCK / 16)
MCFG_CPU_PROGRAM_MAP(cpu_mem_map)
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(hp85_state , irq_callback)
+ MCFG_DEVICE_ADD("rombank", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(rombank_mem_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(21)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x2000)
+
MCFG_SCREEN_ADD("screen" , RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK / 2 , 312 , 0 , 256 , 256 , 0 , 192)
MCFG_SCREEN_UPDATE_DRIVER(hp85_state , screen_update)
@@ -1055,6 +1069,22 @@ static MACHINE_CONFIG_START(hp85)
// Tape drive
MCFG_DEVICE_ADD("tape" , HP_1MA6 , 0)
+
+ // Optional ROMs
+ MCFG_DEVICE_ADD("drawer1", HP80_OPTROM_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_device, NULL, false)
+ MCFG_DEVICE_ADD("drawer2", HP80_OPTROM_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_device, NULL, false)
+ MCFG_DEVICE_ADD("drawer3", HP80_OPTROM_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_device, NULL, false)
+ MCFG_DEVICE_ADD("drawer4", HP80_OPTROM_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_device, NULL, false)
+ MCFG_DEVICE_ADD("drawer5", HP80_OPTROM_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_device, NULL, false)
+ MCFG_DEVICE_ADD("drawer6", HP80_OPTROM_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(hp80_optrom_slot_device, NULL, false)
+
+ MCFG_SOFTWARE_LIST_ADD("optrom_list" , "hp85_rom")
MACHINE_CONFIG_END
ROM_START(hp85)
@@ -1063,7 +1093,7 @@ ROM_START(hp85)
ROM_LOAD("romsys2.bin" , 0x2000 , 0x2000 , CRC(50a85263) SHA1(3cf1d08749103ee245d572550ba1b053ffc7ef57))
ROM_LOAD("romsys3.bin" , 0x4000 , 0x2000 , CRC(0df385f0) SHA1(4c5ce5afd28f6d776f16cabbbbcc09769ff306b7))
- ROM_REGION(0x2000 , "rom00" , 0)
+ ROM_REGION(0x2000 , "rombank" , 0)
ROM_LOAD("rom000.bin" , 0 , 0x2000 , CRC(e13b8ae3) SHA1(2374618d25d1a000ddb534ae4f55ebd98ce0fff3))
ROM_REGION(0x400 , "chargen" , 0)
diff --git a/src/mame/drivers/hp9k_3xx.cpp b/src/mame/drivers/hp9k_3xx.cpp
index b5a26be8e8e..60ae893bd61 100644
--- a/src/mame/drivers/hp9k_3xx.cpp
+++ b/src/mame/drivers/hp9k_3xx.cpp
@@ -128,8 +128,6 @@ public:
private:
bool m_in_buserr;
- uint32_t m_last_buserr_pc;
-
bool m_hil_read;
uint8_t m_hil_data;
uint8_t m_latch_data;
@@ -165,11 +163,13 @@ static ADDRESS_MAP_START(hp9k3xx_common, AS_PROGRAM, 32, hp9k3xx_state)
AM_RANGE(0x00428000, 0x00428003) AM_DEVREADWRITE8(IOCPU_TAG, upi41_cpu_device, upi41_master_r, upi41_master_w, 0x00ff00ff)
- AM_RANGE(0x00500000, 0x0050000f) AM_RAM // this is sufficient to pass the DMA test for now
-
AM_RANGE(0x00510000, 0x00510003) AM_READWRITE(buserror_r, buserror_w) // no "Alpha display"
AM_RANGE(0x00538000, 0x00538003) AM_READWRITE(buserror_r, buserror_w) // no "Graphics"
AM_RANGE(0x005c0000, 0x005c0003) AM_READWRITE(buserror_r, buserror_w) // no add-on FP coprocessor
+
+ AM_RANGE(0x00600000, 0x007fffff) AM_READWRITE(buserror_r, buserror_w) // prevent reading invalid DIO slots
+ AM_RANGE(0x01000000, 0x1fffffff) AM_READWRITE(buserror_r, buserror_w) // prevent reading invalid DIO-II slots
+
AM_RANGE(0x005f8000, 0x005f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff00ff)
ADDRESS_MAP_END
@@ -184,7 +184,7 @@ static ADDRESS_MAP_START(hp9k310_map, AS_PROGRAM, 16, hp9k3xx_state)
AM_RANGE(0x5c0000, 0x5c0003) AM_READWRITE(buserror16_r, buserror16_w) // no add-on FP coprocessor
AM_RANGE(0x5f8000, 0x5f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff)
-
+ AM_RANGE(0x600000, 0x7ffffd) AM_READWRITE(buserror16_r, buserror16_w) // prevent reading invalid DIO slots
AM_RANGE(0x700000, 0x7fffff) AM_READWRITE(buserror16_r, buserror16_w)
AM_RANGE(0x800000, 0xffffff) AM_RAM
ADDRESS_MAP_END
@@ -260,76 +260,51 @@ INPUT_PORTS_END
void hp9k3xx_state::machine_reset()
{
m_in_buserr = false;
- m_last_buserr_pc = 0;
}
READ16_MEMBER(hp9k3xx_state::buserror16_r)
{
- if (m_last_buserr_pc == space.device().safe_pc())
- {
- return 0;
- }
-
if (!m_in_buserr)
{
m_in_buserr = true;
m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
m_in_buserr = false;
- m_last_buserr_pc = space.device().safe_pc();
}
return 0;
}
WRITE16_MEMBER(hp9k3xx_state::buserror16_w)
{
- if (m_last_buserr_pc == space.device().safe_pc())
- {
- return;
- }
-
if (!m_in_buserr)
{
m_in_buserr = true;
m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
m_in_buserr = false;
- m_last_buserr_pc = space.device().safe_pc();
}
}
READ32_MEMBER(hp9k3xx_state::buserror_r)
{
- if (m_last_buserr_pc == space.device().safe_pc())
- {
- return 0;
- }
-
if (!m_in_buserr)
{
m_in_buserr = true;
m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
m_in_buserr = false;
- m_last_buserr_pc = space.device().safe_pc();
}
return 0;
}
WRITE32_MEMBER(hp9k3xx_state::buserror_w)
{
- if (m_last_buserr_pc == space.device().safe_pc())
- {
- return;
- }
-
if (!m_in_buserr)
{
m_in_buserr = true;
m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
m_in_buserr = false;
- m_last_buserr_pc = space.device().safe_pc();
}
}
diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp
index 3dd8fb8f6c5..ab64e3d769f 100644
--- a/src/mame/drivers/hvyunit.cpp
+++ b/src/mame/drivers/hvyunit.cpp
@@ -89,6 +89,8 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
+ m_mermaidlatch(*this, "mermaidlatch"),
+ m_slavelatch(*this, "slavelatch"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram")
{ }
@@ -102,6 +104,8 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
+ required_device<generic_latch_8_device> m_mermaidlatch;
+ required_device<generic_latch_8_device> m_slavelatch;
/* Video */
required_shared_ptr<uint8_t> m_videoram;
@@ -112,17 +116,10 @@ public:
uint16_t m_port0_data;
/* Mermaid */
- uint8_t m_data_to_mermaid;
- uint8_t m_data_to_z80;
- uint8_t m_mermaid_to_z80_full;
- uint8_t m_z80_to_mermaid_full;
- uint8_t m_mermaid_int0_l;
uint8_t m_mermaid_p[4];
DECLARE_WRITE8_MEMBER(trigger_nmi_on_slave_cpu);
DECLARE_WRITE8_MEMBER(master_bankswitch_w);
- DECLARE_WRITE8_MEMBER(mermaid_data_w);
- DECLARE_READ8_MEMBER(mermaid_data_r);
DECLARE_READ8_MEMBER(mermaid_status_r);
DECLARE_WRITE8_MEMBER(trigger_nmi_on_sound_cpu2);
DECLARE_WRITE8_MEMBER(hu_videoram_w);
@@ -166,19 +163,11 @@ void hvyunit_state::machine_start()
membank("slave_bank")->configure_entries(0, 4, memregion("slave")->base(), 0x4000);
membank("sound_bank")->configure_entries(0, 4, memregion("soundcpu")->base(), 0x4000);
- save_item(NAME(m_data_to_mermaid));
- save_item(NAME(m_data_to_z80));
- save_item(NAME(m_mermaid_to_z80_full));
- save_item(NAME(m_z80_to_mermaid_full));
- save_item(NAME(m_mermaid_int0_l));
save_item(NAME(m_mermaid_p));
}
void hvyunit_state::machine_reset()
{
- m_mermaid_int0_l = 1;
- m_mermaid_to_z80_full = 0;
- m_z80_to_mermaid_full = 0;
}
@@ -246,23 +235,9 @@ WRITE8_MEMBER(hvyunit_state::master_bankswitch_w)
membank("master_bank")->set_entry(data & 7);
}
-WRITE8_MEMBER(hvyunit_state::mermaid_data_w)
-{
- m_data_to_mermaid = data;
- m_z80_to_mermaid_full = 1;
- m_mermaid_int0_l = 0;
- m_mermaid->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
-}
-
-READ8_MEMBER(hvyunit_state::mermaid_data_r)
-{
- m_mermaid_to_z80_full = 0;
- return m_data_to_z80;
-}
-
READ8_MEMBER(hvyunit_state::mermaid_status_r)
{
- return (!m_mermaid_to_z80_full << 2) | (m_z80_to_mermaid_full << 3);
+ return (!m_slavelatch->pending_r() << 2) | (m_mermaidlatch->pending_r() << 3);
}
@@ -340,33 +315,21 @@ READ8_MEMBER(hvyunit_state::mermaid_p0_r)
WRITE8_MEMBER(hvyunit_state::mermaid_p0_w)
{
if (!BIT(m_mermaid_p[0], 1) && BIT(data, 1))
- {
- m_mermaid_to_z80_full = 1;
- m_data_to_z80 = m_mermaid_p[1];
- }
+ m_slavelatch->write(space, 0, m_mermaid_p[1]);
- if (BIT(data, 0) == 1)
- m_z80_to_mermaid_full = 0;
+ if (BIT(data, 0) == 0)
+ m_mermaid_p[1] = m_mermaidlatch->read(space, 0);
m_mermaid_p[0] = data;
}
READ8_MEMBER(hvyunit_state::mermaid_p1_r)
{
- if (BIT(m_mermaid_p[0], 0) == 0)
- return m_data_to_mermaid;
- else
- return 0; // ?
+ return m_mermaid_p[1];
}
WRITE8_MEMBER(hvyunit_state::mermaid_p1_w)
{
- if (data == 0xff)
- {
- m_mermaid_int0_l = 1;
- m_mermaid->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
- }
-
m_mermaid_p[1] = data;
}
@@ -400,7 +363,7 @@ READ8_MEMBER(hvyunit_state::mermaid_p3_r)
case 3: dsw = (BIT(dsw2, 7) << 3) | (BIT(dsw2, 3) << 2) | (BIT(dsw1, 7) << 1) | BIT(dsw1, 3); break;
}
- return (dsw << 4) | (m_mermaid_int0_l << 2) | (m_mermaid_to_z80_full << 3);
+ return (dsw << 4) | (m_slavelatch->pending_r() << 3) | (!m_mermaidlatch->pending_r() << 2);
}
WRITE8_MEMBER(hvyunit_state::mermaid_p3_w)
@@ -447,7 +410,8 @@ static ADDRESS_MAP_START( slave_io, AS_IO, 8, hvyunit_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(slave_bankswitch_w)
AM_RANGE(0x02, 0x02) AM_WRITE(trigger_nmi_on_sound_cpu2)
- AM_RANGE(0x04, 0x04) AM_READWRITE(mermaid_data_r, mermaid_data_w)
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("slavelatch", generic_latch_8_device, read)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("mermaidlatch", generic_latch_8_device, write)
AM_RANGE(0x06, 0x06) AM_WRITE(hu_scrolly_w)
AM_RANGE(0x08, 0x08) AM_WRITE(hu_scrollx_w)
AM_RANGE(0x0c, 0x0c) AM_READ(mermaid_status_r)
@@ -664,6 +628,11 @@ static MACHINE_CONFIG_START( hvyunit )
MCFG_CPU_ADD("mermaid", I80C51, 6000000)
MCFG_CPU_IO_MAP(mcu_io)
+ MCFG_GENERIC_LATCH_8_ADD("mermaidlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("mermaid", INPUT_LINE_IRQ0))
+
+ MCFG_GENERIC_LATCH_8_ADD("slavelatch")
+
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/ibm6580.cpp b/src/mame/drivers/ibm6580.cpp
index b88d7feb381..ad5785c4e95 100644
--- a/src/mame/drivers/ibm6580.cpp
+++ b/src/mame/drivers/ibm6580.cpp
@@ -894,7 +894,8 @@ static MACHINE_CONFIG_START( ibm6580 )
MCFG_PALETTE_ADD("palette", 3)
MCFG_PALETTE_INIT_OWNER(ibm6580_state, ibm6580)
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
MCFG_I8255_IN_PORTA_CB(READ8(ibm6580_state, ppi_a_r))
diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp
index 5e211507869..ac5a3b14803 100644
--- a/src/mame/drivers/ibmpcjr.cpp
+++ b/src/mame/drivers/ibmpcjr.cpp
@@ -594,7 +594,8 @@ static MACHINE_CONFIG_START( ibmpcjr )
MCFG_PIT8253_CLK2(XTAL_14_31818MHz/12)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(pcjr_state, out2_changed))
- MCFG_PIC8259_ADD( "pic8259", WRITELINE(pcjr_state, pic8259_set_int_line), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(pcjr_state, pic8259_set_int_line))
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
MCFG_I8255_IN_PORTA_CB(CONSTANT(0xff))
diff --git a/src/mame/drivers/imds2.cpp b/src/mame/drivers/imds2.cpp
index 89d8e87dada..10ee69e7d4e 100644
--- a/src/mame/drivers/imds2.cpp
+++ b/src/mame/drivers/imds2.cpp
@@ -760,8 +760,13 @@ static MACHINE_CONFIG_START(imds2)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("ipcsyspic" , pic8259_device , inta_cb)
MCFG_QUANTUM_TIME(attotime::from_hz(100))
- MCFG_PIC8259_ADD("ipcsyspic" , WRITELINE(imds2_state , imds2_ipc_intr) , VCC, NOOP)
- MCFG_PIC8259_ADD("ipclocpic" , DEVWRITELINE("ipcsyspic" , pic8259_device , ir7_w) , VCC, NOOP)
+ MCFG_DEVICE_ADD("ipcsyspic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(imds2_state, imds2_ipc_intr))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+
+ MCFG_DEVICE_ADD("ipclocpic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("ipcsyspic", pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(VCC) // ???
MCFG_DEVICE_ADD("ipctimer" , PIT8253 , 0)
MCFG_PIT8253_CLK0(IPC_XTAL_Y1 / 16)
diff --git a/src/mame/drivers/iq151.cpp b/src/mame/drivers/iq151.cpp
index e1f76ff7d83..fdb244bb66a 100644
--- a/src/mame/drivers/iq151.cpp
+++ b/src/mame/drivers/iq151.cpp
@@ -404,7 +404,8 @@ static MACHINE_CONFIG_START( iq151 )
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
MCFG_I8255_IN_PORTA_CB(READ8(iq151_state, keyboard_row_r))
diff --git a/src/mame/drivers/irisha.cpp b/src/mame/drivers/irisha.cpp
index d39c175397d..2b6a456a4ab 100644
--- a/src/mame/drivers/irisha.cpp
+++ b/src/mame/drivers/irisha.cpp
@@ -417,7 +417,8 @@ static MACHINE_CONFIG_START( irisha )
MCFG_I8255_IN_PORTC_CB(READ8(irisha_state, irisha_8255_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(irisha_state, irisha_8255_portc_w))
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/isbc.cpp b/src/mame/drivers/isbc.cpp
index 5d16479b5ff..e994047fe66 100644
--- a/src/mame/drivers/isbc.cpp
+++ b/src/mame/drivers/isbc.cpp
@@ -333,7 +333,8 @@ static MACHINE_CONFIG_START( isbc86 )
MCFG_CPU_IO_MAP(isbc_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic_0", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("pic_0", INPUTLINE(":maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic_0", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("pit", PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL_22_1184MHz/18)
@@ -365,7 +366,8 @@ static MACHINE_CONFIG_START( rpc86 )
MCFG_CPU_IO_MAP(rpc86_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic_0", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("pic_0", INPUTLINE(":maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic_0", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("pit", PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL_22_1184MHz/18)
@@ -433,8 +435,14 @@ static MACHINE_CONFIG_START( isbc286 )
MCFG_CPU_IO_MAP(isbc286_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic_0", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("pic_0", INPUTLINE(":maincpu", 0), VCC, READ8(isbc_state, get_slave_ack))
- MCFG_PIC8259_ADD("pic_1", DEVWRITELINE("pic_0", pic8259_device, ir7_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic_0", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(isbc_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic_1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic_0", pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("pit", PIT8254, 0)
MCFG_PIT8253_CLK0(XTAL_22_1184MHz/18)
diff --git a/src/mame/drivers/isbc8030.cpp b/src/mame/drivers/isbc8030.cpp
index 0c4437fc8e5..82a817acef7 100644
--- a/src/mame/drivers/isbc8030.cpp
+++ b/src/mame/drivers/isbc8030.cpp
@@ -141,7 +141,8 @@ static MACHINE_CONFIG_START( isbc8030 )
MCFG_CPU_PROGRAM_MAP(isbc8030_mem)
MCFG_CPU_IO_MAP(isbc8030_io)
- MCFG_PIC8259_ADD(I8259A_TAG, INPUTLINE(":maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD(I8259A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL_22_1184MHz / 18)
diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp
index 36b56e79ee0..19eba35427a 100644
--- a/src/mame/drivers/karnov.cpp
+++ b/src/mame/drivers/karnov.cpp
@@ -367,7 +367,6 @@ WRITE16_MEMBER(karnov_state::karnov_control_w)
case 2: /* SONREQ (Sound CPU byte) */
m_soundlatch->write(space, 0, data & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
break;
case 4: /* DM (DMA to buffer spriteram) */
@@ -838,6 +837,7 @@ static MACHINE_CONFIG_START( karnov )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ym1", YM2203, 1500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/kdt6.cpp b/src/mame/drivers/kdt6.cpp
index f864b1f6834..5e5622578b7 100644
--- a/src/mame/drivers/kdt6.cpp
+++ b/src/mame/drivers/kdt6.cpp
@@ -92,6 +92,8 @@ public:
DECLARE_WRITE8_MEMBER(fdc_tc_w);
DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
+ void drive0_led_cb(floppy_image_device *floppy, int state);
+ void drive1_led_cb(floppy_image_device *floppy, int state);
MC6845_UPDATE_ROW(crtc_update_row);
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -214,7 +216,7 @@ INPUT_PORTS_END
//**************************************************************************
static SLOT_INTERFACE_START( kdt6_floppies )
- SLOT_INTERFACE("525qd", FLOPPY_525_QD)
+ SLOT_INTERFACE("fd55f", TEAC_FD_55F)
SLOT_INTERFACE_END
WRITE8_MEMBER( kdt6_state::fdc_tc_w )
@@ -229,6 +231,16 @@ WRITE_LINE_MEMBER( kdt6_state::fdc_drq_w )
m_dma->rdy_w(state);
}
+void kdt6_state::drive0_led_cb(floppy_image_device *floppy, int state)
+{
+ machine().output().set_value("drive0_led", state);
+}
+
+void kdt6_state::drive1_led_cb(floppy_image_device *floppy, int state)
+{
+ machine().output().set_value("drive1_led", state);
+}
+
//**************************************************************************
// VIDEO
@@ -556,6 +568,11 @@ void kdt6_state::machine_start()
m_fdc->set_rate(250000);
+ if (m_floppy0->get_device())
+ m_floppy0->get_device()->setup_led_cb(floppy_image_device::led_cb(&kdt6_state::drive0_led_cb, this));
+ if (m_floppy1->get_device())
+ m_floppy1->get_device()->setup_led_cb(floppy_image_device::led_cb(&kdt6_state::drive1_led_cb, this));
+
// register for save states
save_pointer(NAME(m_ram.get()), 0x40000);
save_pointer(NAME(m_vram.get()), 0x10000);
@@ -683,8 +700,8 @@ static MACHINE_CONFIG_START( psi98 )
MCFG_UPD765A_ADD("fdc", true, true)
MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("ctc1", z80ctc_device, trg0))
MCFG_UPD765_DRQ_CALLBACK(WRITELINE(kdt6_state, fdc_drq_w))
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", kdt6_floppies, "525qd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", kdt6_floppies, "525qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", kdt6_floppies, "fd55f", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", kdt6_floppies, "fd55f", floppy_image_device::default_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("floppy_list", "psi98")
diff --git a/src/mame/drivers/klax.cpp b/src/mame/drivers/klax.cpp
index 7446c8b27f3..c4c5665641a 100644
--- a/src/mame/drivers/klax.cpp
+++ b/src/mame/drivers/klax.cpp
@@ -24,6 +24,7 @@
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "sound/msm5205.h"
@@ -80,8 +81,8 @@ MACHINE_RESET_MEMBER(klax_state,klax)
static ADDRESS_MAP_START( klax_map, AS_PROGRAM, 16, klax_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
- AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
+ AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x260000, 0x260001) AM_READ_PORT("P1") AM_WRITE(klax_latch_w)
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("P2")
AM_RANGE(0x270000, 0x270001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
@@ -97,8 +98,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( klax2bl_map, AS_PROGRAM, 16, klax_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
- AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
+ AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x260000, 0x260001) AM_READ_PORT("P1") AM_WRITE(klax_latch_w)
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("P2")
// AM_RANGE(0x270000, 0x270001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // no OKI here
@@ -199,7 +200,8 @@ static MACHINE_CONFIG_START( klax )
MCFG_MACHINE_RESET_OVERRIDE(klax_state,klax)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/lemmings.cpp b/src/mame/drivers/lemmings.cpp
index e3e04e32afb..5155a9d853c 100644
--- a/src/mame/drivers/lemmings.cpp
+++ b/src/mame/drivers/lemmings.cpp
@@ -270,6 +270,9 @@ static MACHINE_CONFIG_START( lemmings )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(lemmings_state, lemmings_sound_cb)
diff --git a/src/mame/drivers/lkage.cpp b/src/mame/drivers/lkage.cpp
index 46a9b723d3b..62fbf1fdad2 100644
--- a/src/mame/drivers/lkage.cpp
+++ b/src/mame/drivers/lkage.cpp
@@ -101,34 +101,14 @@ TODO:
#define MCU_CLOCK (XTAL_12MHz/4)
-TIMER_CALLBACK_MEMBER(lkage_state::nmi_callback)
-{
- if (m_sound_nmi_enable)
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- else
- m_pending_nmi = 1;
-}
-
-WRITE8_MEMBER(lkage_state::lkage_sound_command_w)
-{
- m_soundlatch->write(space, offset, data);
- machine().scheduler().synchronize(timer_expired_delegate(FUNC(lkage_state::nmi_callback),this), data);
-}
-
WRITE8_MEMBER(lkage_state::lkage_sh_nmi_disable_w)
{
- m_sound_nmi_enable = 0;
+ m_soundnmi->in_w<1>(0);
}
WRITE8_MEMBER(lkage_state::lkage_sh_nmi_enable_w)
{
- m_sound_nmi_enable = 1;
- if (m_pending_nmi)
- {
- /* probably wrong but commands may go lost otherwise */
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- m_pending_nmi = 0;
- }
+ m_soundnmi->in_w<1>(1);
}
READ8_MEMBER(lkage_state::sound_status_r)
@@ -141,7 +121,7 @@ static ADDRESS_MAP_START( lkage_map, AS_PROGRAM, 8, lkage_state )
AM_RANGE(0xe000, 0xe7ff) AM_RAM /* work ram */
AM_RANGE(0xe800, 0xefff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xf000, 0xf003) AM_RAM AM_SHARE("vreg") /* video registers */
- AM_RANGE(0xf060, 0xf060) AM_WRITE(lkage_sound_command_w)
+ AM_RANGE(0xf060, 0xf060) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xf061, 0xf061) AM_WRITENOP AM_READ(sound_status_r)
AM_RANGE(0xf063, 0xf063) AM_WRITENOP /* pulsed; nmi on sound cpu? */
AM_RANGE(0xf080, 0xf080) AM_READ_PORT("DSW1")
@@ -490,8 +470,6 @@ void lkage_state::machine_start()
save_item(NAME(m_mcu_ready));
save_item(NAME(m_mcu_val));
- save_item(NAME(m_sound_nmi_enable));
- save_item(NAME(m_pending_nmi));
}
void lkage_state::machine_reset()
@@ -500,9 +478,8 @@ void lkage_state::machine_reset()
m_mcu_ready = 3;
m_mcu_val = 0;
- m_sound_nmi_enable = 0;
- m_pending_nmi = 0;
+ m_soundnmi->in_w<1>(0);
}
static MACHINE_CONFIG_START( lkage )
@@ -538,6 +515,10 @@ static MACHINE_CONFIG_START( lkage )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(DEVWRITELINE("soundnmi", input_merger_device, in_w<0>))
+
+ MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ym1", YM2203, AUDIO_CLOCK )
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -585,6 +566,10 @@ static MACHINE_CONFIG_START( lkageb )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(DEVWRITELINE("soundnmi", input_merger_device, in_w<0>))
+
+ MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ym1", YM2203, AUDIO_CLOCK)
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/m107.cpp b/src/mame/drivers/m107.cpp
index 7f0e6106e7d..32ba33967da 100644
--- a/src/mame/drivers/m107.cpp
+++ b/src/mame/drivers/m107.cpp
@@ -723,7 +723,8 @@ static MACHINE_CONFIG_START( firebarr )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_V25_CONFIG(rtypeleo_decryption_table)
- MCFG_PIC8259_ADD( "upd71059c", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("upd71059c", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m107_state, scanline_interrupt, "screen", 0, 1)
diff --git a/src/mame/drivers/m20.cpp b/src/mame/drivers/m20.cpp
index 5c39ecb5ade..d65ab8cb912 100644
--- a/src/mame/drivers/m20.cpp
+++ b/src/mame/drivers/m20.cpp
@@ -830,7 +830,8 @@ static MACHINE_CONFIG_START( m20 )
MCFG_PIT8253_CLK2(1230782)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(m20_state, timer_tick_w))
- MCFG_PIC8259_ADD("i8259", WRITELINE(m20_state, int_w), VCC, NOOP)
+ MCFG_DEVICE_ADD("i8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(m20_state, int_w))
MCFG_RS232_PORT_ADD("kbd", keyboard, "m20")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("i8251_1", i8251_device, write_rxd))
diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp
index 1cd77ee8f69..b79e7a58d90 100644
--- a/src/mame/drivers/m72.cpp
+++ b/src/mame/drivers/m72.cpp
@@ -1832,7 +1832,8 @@ static MACHINE_CONFIG_START( m72_base )
MCFG_CPU_PROGRAM_MAP(sound_ram_map)
MCFG_CPU_IO_MAP(sound_portmap)
- MCFG_PIC8259_ADD( "upd71059c", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("upd71059c", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", m72)
@@ -1945,7 +1946,8 @@ static MACHINE_CONFIG_START( rtype2 )
MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
/* IRQs are generated by main Z80 and YM2151 */
- MCFG_PIC8259_ADD( "upd71059c", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("upd71059c", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rtype2)
@@ -1973,14 +1975,12 @@ MACHINE_CONFIG_END
// M84
-// is the upd71059c present and unused, or has it been removed from the PCB? it isn't needed beacuse the V35 has it's own IRQ controller.
static MACHINE_CONFIG_START( cosmccop )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", V35,MASTER_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(kengo_map)
MCFG_CPU_IO_MAP(m84_v33_portmap)
-// MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
MCFG_CPU_ADD("soundcpu", Z80, SOUND_CLOCK)
MCFG_CPU_PROGRAM_MAP(sound_rom_map)
@@ -1988,11 +1988,11 @@ static MACHINE_CONFIG_START( cosmccop )
MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
/* IRQs are generated by main Z80 and YM2151 */
-// MCFG_PIC8259_ADD( "upd71059c", INPUTLINE("maincpu", 0), VCC, NOOP)
-
MCFG_MACHINE_START_OVERRIDE(m72_state,kengo)
MCFG_MACHINE_RESET_OVERRIDE(m72_state,kengo)
+ // upd71059c isn't needed beacuse the V35 has its own IRQ controller
+
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", rtype2)
MCFG_PALETTE_ADD("palette", 512)
@@ -2034,7 +2034,8 @@ static MACHINE_CONFIG_START( m82 )
MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, nmi_line_pulse, 128*55) /* clocked by V1? (Vigilante) */
/* IRQs are generated by main Z80 and YM2151 */
- MCFG_PIC8259_ADD( "upd71059c", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("upd71059c", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", "palette", majtitle)
@@ -2068,7 +2069,8 @@ static MACHINE_CONFIG_START( poundfor )
MCFG_CPU_PERIODIC_INT_DRIVER(m72_state, fake_nmi, 128*55) /* clocked by V1? (Vigilante) */
/* IRQs are generated by main Z80 and YM2151 */
- MCFG_PIC8259_ADD( "upd71059c", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("upd71059c", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("upd4701l", UPD4701A, 0)
MCFG_UPD4701_PORTX("TRACK0_X")
diff --git a/src/mame/drivers/m90.cpp b/src/mame/drivers/m90.cpp
index 0d8ce4ac891..2899f17ee40 100644
--- a/src/mame/drivers/m90.cpp
+++ b/src/mame/drivers/m90.cpp
@@ -58,15 +58,6 @@ WRITE16_MEMBER(m90_state::quizf1_bankswitch_w)
membank("bank1")->set_entry(data & 0xf);
}
-WRITE16_MEMBER(m90_state::dynablsb_sound_command_w)
-{
- if (ACCESSING_BITS_0_7)
- {
- m_soundlatch->write(space, offset, data);
- m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- }
-}
-
#ifdef UNUSED_FUNCTION
WRITE16_MEMBER(m90_state::unknown_w)
{
@@ -114,7 +105,7 @@ static ADDRESS_MAP_START( m90_main_cpu_io_map, AS_IO, 16, m90_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( dynablsb_main_cpu_io_map, AS_IO, 16, m90_state )
- AM_RANGE(0x00, 0x01) AM_WRITE(dynablsb_sound_command_w)
+ AM_RANGE(0x00, 0x01) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x00, 0x01) AM_READ_PORT("P1_P2")
AM_RANGE(0x02, 0x03) AM_WRITE(m90_coincounter_w)
AM_RANGE(0x02, 0x03) AM_READ_PORT("SYSTEM")
@@ -852,6 +843,9 @@ static MACHINE_CONFIG_DERIVED( dynablsb, m90 )
MCFG_DEVICE_REMOVE("m72")
+ MCFG_DEVICE_MODIFY("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+
MCFG_SOUND_MODIFY("ymsnd")
MCFG_YM2151_IRQ_HANDLER(NOOP) /* this bootleg polls the YM2151 instead of taking interrupts from it */
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp
index f0f217d9cfb..efef6ad81e6 100644
--- a/src/mame/drivers/m92.cpp
+++ b/src/mame/drivers/m92.cpp
@@ -933,14 +933,13 @@ static MACHINE_CONFIG_START( m92 )
MCFG_CPU_ADD("maincpu",V33,XTAL_18MHz/2)
MCFG_CPU_PROGRAM_MAP(m92_map)
MCFG_CPU_IO_MAP(m92_portmap)
-#ifndef USE_HACKED_IRQS
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("upd71059c", pic8259_device, inta_cb)
-#endif
MCFG_CPU_ADD("soundcpu" ,V35, XTAL_14_31818MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
- MCFG_PIC8259_ADD( "upd71059c", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("upd71059c", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_MACHINE_START_OVERRIDE(m92_state,m92)
MCFG_MACHINE_RESET_OVERRIDE(m92_state,m92)
diff --git a/src/mame/drivers/mainsnk.cpp b/src/mame/drivers/mainsnk.cpp
index 23646543f57..bc1551d5c59 100644
--- a/src/mame/drivers/mainsnk.cpp
+++ b/src/mame/drivers/mainsnk.cpp
@@ -118,29 +118,12 @@ cc_p14.j2 8192 0xedc6a1eb M5L2764k
#include "speaker.h"
-void mainsnk_state::machine_start()
-{
- save_item(NAME(m_sound_cpu_busy));
-}
-
-WRITE8_MEMBER(mainsnk_state::sound_command_w)
-{
- m_sound_cpu_busy = 1;
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
-}
-
READ8_MEMBER(mainsnk_state::sound_ack_r)
{
- m_sound_cpu_busy = 0;
+ m_audiocpu->set_input_line(0, CLEAR_LINE);
return 0xff;
}
-CUSTOM_INPUT_MEMBER(mainsnk_state::sound_r)
-{
- return (m_sound_cpu_busy) ? 0x01 : 0x00;
-}
-
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, mainsnk_state )
@@ -152,7 +135,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, mainsnk_state )
AM_RANGE(0xc400, 0xc400) AM_READ_PORT("DSW1")
AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW2")
AM_RANGE(0xc600, 0xc600) AM_WRITE(c600_w)
- AM_RANGE(0xc700, 0xc700) AM_WRITE(sound_command_w)
+ AM_RANGE(0xc700, 0xc700) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(bgram_w) AM_SHARE("bgram")
AM_RANGE(0xdc00, 0xe7ff) AM_RAM
AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("spriteram")
@@ -163,7 +146,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, mainsnk_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0xa000, 0xa000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0xc000, 0xc000) AM_READ(sound_ack_r)
+ AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, acknowledge_r)
AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0xe002, 0xe003) AM_WRITENOP // ? always FFFF, snkwave leftover?
AM_RANGE(0xe008, 0xe009) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
@@ -171,7 +154,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, mainsnk_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READNOP
+ AM_RANGE(0x00, 0x00) AM_READ(sound_ack_r)
ADDRESS_MAP_END
@@ -183,7 +166,7 @@ static INPUT_PORTS_START( mainsnk )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mainsnk_state, sound_r, nullptr) /* sound CPU status */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) /* sound CPU status */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE )
@@ -277,7 +260,7 @@ static INPUT_PORTS_START( canvas )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mainsnk_state, sound_r, nullptr) /* sound CPU status */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) /* sound CPU status */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE )
@@ -398,7 +381,7 @@ static MACHINE_CONFIG_START( mainsnk )
MCFG_CPU_ADD("audiocpu", Z80,4000000)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_portmap)
- MCFG_CPU_PERIODIC_INT_DRIVER(mainsnk_state, irq0_line_hold, 244)
+ MCFG_CPU_PERIODIC_INT_DRIVER(mainsnk_state, irq0_line_assert, 244)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -416,6 +399,8 @@ static MACHINE_CONFIG_START( mainsnk )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
MCFG_SOUND_ADD("ay1", AY8910, 2000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
diff --git a/src/mame/drivers/mastboy.cpp b/src/mame/drivers/mastboy.cpp
index dccdd914f9c..14927ca30f2 100644
--- a/src/mame/drivers/mastboy.cpp
+++ b/src/mame/drivers/mastboy.cpp
@@ -11,6 +11,8 @@
Notes:
Why does RAM-M fail on first boot, Charles mentioned it can (randomly?) fail on real HW too, is it buggy code?
+ The EAROM (28C16 parallel EEPROM) takes a long time to write out if RAM-M fails internal testing.
+
Are the correct/incorrect samples when you answer a question meant to loop as they do?
Video timing should be hooked up with MAME's new video timing system
@@ -18,8 +20,6 @@
having a different internal program, or is it just a (bad) hack?
This Can be converted to tilemaps very easily, but probably not worth it
-
- EEPROM enable / disable needs figuring out properly
*/
/*
@@ -475,16 +475,12 @@ public:
uint8_t* m_vram;
uint8_t m_bank;
int m_irq0_ack;
- int m_earom_enabled;
int m_m5205_next;
int m_m5205_part;
DECLARE_READ8_MEMBER(banked_ram_r);
DECLARE_WRITE8_MEMBER(banked_ram_w);
DECLARE_WRITE8_MEMBER(bank_w);
- DECLARE_READ8_MEMBER(earom_r);
- DECLARE_WRITE8_MEMBER(earom_w);
- DECLARE_WRITE_LINE_MEMBER(earom_enable_w);
DECLARE_WRITE8_MEMBER(msm5205_data_w);
DECLARE_WRITE_LINE_MEMBER(irq0_ack_w);
DECLARE_READ8_MEMBER(port_38_read);
@@ -626,32 +622,6 @@ WRITE8_MEMBER(mastboy_state::bank_w)
m_bank = data;
}
-// EAROM (28C16 parallel EEPROM) access
-
-READ8_MEMBER(mastboy_state::earom_r)
-{
- return m_earom->read(space, offset);
-}
-
-WRITE8_MEMBER(mastboy_state::earom_w)
-{
-// if (m_earom_enabled)
-// {
- m_earom->write(space, offset, data);
-// }
-// else
-// {
-// logerror("Write to EAROM when disabled! %04x, %02x\n", offset,data);
-// }
-}
-
-WRITE_LINE_MEMBER(mastboy_state::earom_enable_w)
-{
- /* This is some kind of enable / disable control for backup memory (see Charles's notes) but I'm not
- sure how it works in practice, if we use it then it writes a lot of data with it disabled */
- m_earom_enabled = state;
-}
-
/* MSM5205 Related */
WRITE8_MEMBER(mastboy_state::msm5205_data_w)
@@ -699,7 +669,7 @@ static ADDRESS_MAP_START( mastboy_map, AS_PROGRAM, 8, mastboy_state )
AM_RANGE(0xc000, 0xffff) AM_READWRITE(banked_ram_r,banked_ram_w) // mastboy bank area read / write
- AM_RANGE(0xff000, 0xff7ff) AM_READWRITE(earom_r, earom_w)
+ AM_RANGE(0xff000, 0xff7ff) AM_DEVREADWRITE("earom", eeprom_parallel_28xx_device, read, write)
AM_RANGE(0xff800, 0xff807) AM_READ_PORT("P1")
AM_RANGE(0xff808, 0xff80f) AM_READ_PORT("P2")
@@ -855,7 +825,6 @@ void mastboy_state::machine_start()
save_item(NAME(m_bank));
save_item(NAME(m_irq0_ack));
- save_item(NAME(m_earom_enabled));
save_item(NAME(m_m5205_next));
save_item(NAME(m_m5205_part));
}
@@ -884,7 +853,7 @@ static MACHINE_CONFIG_START( mastboy )
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(DEVWRITELINE("msm", msm5205_device, s2_w))
MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(DEVWRITELINE("msm", msm5205_device, s1_w))
MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(DEVWRITELINE("msm", msm5205_device, reset_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(mastboy_state, earom_enable_w))
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(DEVWRITELINE("earom", eeprom_parallel_28xx_device, oe_w))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/mazerbla.cpp b/src/mame/drivers/mazerbla.cpp
index d6d8534491b..a6f75987d5a 100644
--- a/src/mame/drivers/mazerbla.cpp
+++ b/src/mame/drivers/mazerbla.cpp
@@ -1051,12 +1051,13 @@ static INPUT_PORTS_START( mazerbla )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW0") /* Strobe 1: Dip Switches 28-35*/
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
- PORT_DIPSETTING( 0x03, "6" )
- PORT_DIPSETTING( 0x02, "5" )
- PORT_DIPSETTING( 0x01, "4" )
- PORT_DIPSETTING( 0x00, "3" )
- PORT_DIPNAME( 0x0c, 0x00, "Freeze Time" )
+ // TODO: these are for mazerblaa set, mazerbla differs significantly
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
+ PORT_DIPSETTING( 0x03, "3" )
+ PORT_DIPSETTING( 0x02, "4" )
+ PORT_DIPSETTING( 0x01, "5" )
+ PORT_DIPSETTING( 0x00, "6" )
+ PORT_DIPNAME( 0x0c, 0x0c, "Freeze Time" )
PORT_DIPSETTING( 0x0c, "1.5 seconds" )
PORT_DIPSETTING( 0x08, "2.0 seconds" )
PORT_DIPSETTING( 0x04, "2.5 seconds" )
@@ -1110,9 +1111,7 @@ static INPUT_PORTS_START( mazerbla )
PORT_DIPSETTING( 0x70, "1 Coin/14 Credits" )
PORT_START("DSW2") /* Strobe 3: Dip Switches 12-19*/
- PORT_DIPNAME( 0x01, 0x01, "Service Index" )
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_SERVICE( 0x01, IP_ACTIVE_LOW ) PORT_NAME("Service Index")
PORT_DIPNAME( 0x02, 0x02, "Switch Test" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1475,6 +1474,7 @@ static MACHINE_CONFIG_START( mazerbla )
MCFG_SCREEN_SIZE(40*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
MCFG_SCREEN_UPDATE_DRIVER(mazerbla_state, screen_update_mazerbla)
+ MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(mazerbla_state, screen_vblank))
MCFG_PALETTE_ADD("palette", 256+1)
MCFG_PALETTE_INIT_OWNER(mazerbla_state, mazerbla)
diff --git a/src/mame/drivers/mbc55x.cpp b/src/mame/drivers/mbc55x.cpp
index 7857eb5b514..38dd2683577 100644
--- a/src/mame/drivers/mbc55x.cpp
+++ b/src/mame/drivers/mbc55x.cpp
@@ -277,7 +277,8 @@ static MACHINE_CONFIG_START( mbc55x )
MCFG_PIT8253_CLK2(PIT_C2_CLOCK)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(mbc55x_state, pit8253_t2))
- MCFG_PIC8259_ADD( PIC8259_TAG, INPUTLINE(MAINCPU_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+ MCFG_DEVICE_ADD(PIC8259_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(PPI8255_TAG, I8255, 0)
MCFG_I8255_IN_PORTA_CB(READ8(mbc55x_state, mbc55x_ppi_porta_r))
diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp
index 354fd549fb2..dcb17a6c0cc 100644
--- a/src/mame/drivers/mc1502.cpp
+++ b/src/mame/drivers/mc1502.cpp
@@ -258,7 +258,8 @@ static MACHINE_CONFIG_START( mc1502 )
MCFG_PIT8253_CLK2(XTAL_16MHz/12) /* pio port c pin 4, and speaker polling enough */
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(mc1502_state, mc1502_pit8253_out2_changed))
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("ppi8255n1", I8255, 0)
MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("cent_data_out", output_latch_device, write))
diff --git a/src/mame/drivers/megaplay.cpp b/src/mame/drivers/megaplay.cpp
index 7981be137f2..0fd9a5f4ea8 100644
--- a/src/mame/drivers/megaplay.cpp
+++ b/src/mame/drivers/megaplay.cpp
@@ -792,7 +792,7 @@ ROM_START( mp_gslam ) /* Grand Slam */
ROM_END
-ROM_START( mp_twc ) /* Tecmo World Cup */
+ROM_START( mp_twcup ) /* Tecmo World Cup */
ROM_REGION( 0x400000, "maincpu", 0 )
ROM_LOAD16_BYTE( "ep15183.ic2", 0x000000, 0x040000, CRC(8b79b861) SHA1(c72af72840513b82f2562409eccdf13b031bf3c0) )
ROM_LOAD16_BYTE( "ep15182.ic1", 0x000001, 0x040000, CRC(eb8325c3) SHA1(bb21ac926c353e14184dd476222bc6a8714606e5) )
@@ -967,7 +967,7 @@ didn't have original Sega part numbers it's probably a converted TWC cart
/* 02 */ GAME( 1993, mp_gaxe2, megaplay, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play) (Rev B)" , 0 )
/* 02 */ GAME( 1993, mp_gaxe2a,mp_gaxe2, megaplay, mp_gaxe2, mplay_state, megaplay, ROT0, "Sega", "Golden Axe II (Mega Play)" , 0 )
/* 03 */ GAME( 1993, mp_gslam, megaplay, megaplay, mp_gslam, mplay_state, megaplay, ROT0, "Sega", "Grand Slam (Mega Play)",0 )
-/* 04 */ GAME( 1993, mp_twc, megaplay, megaplay, mp_twc, mplay_state, megaplay, ROT0, "Sega", "Tecmo World Cup (Mega Play)" , 0 )
+/* 04 */ GAME( 1993, mp_twcup, megaplay, megaplay, mp_twc, mplay_state, megaplay, ROT0, "Sega", "Tecmo World Cup (Mega Play)" , 0 )
/* 05 */ GAME( 1993, mp_sor2, megaplay, megaplay, mp_sor2, mplay_state, megaplay, ROT0, "Sega", "Streets of Rage II (Mega Play)" , 0 )
/* 06 */ GAME( 1993, mp_bio, megaplay, megaplay, mp_bio, mplay_state, megaplay, ROT0, "Sega", "Bio-hazard Battle (Mega Play)" , 0 )
/* 07 */ GAME( 1993, mp_soni2, megaplay, megaplay, mp_soni2, mplay_state, megaplay, ROT0, "Sega", "Sonic The Hedgehog 2 (Mega Play)" , 0 )
diff --git a/src/mame/drivers/midzeus.cpp b/src/mame/drivers/midzeus.cpp
index aaf7c032c7e..83aa7bde7f9 100644
--- a/src/mame/drivers/midzeus.cpp
+++ b/src/mame/drivers/midzeus.cpp
@@ -1229,7 +1229,7 @@ static INPUT_PORTS_START( thegrid )
PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) /* keypad 1 */
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) /* keypad 4 */
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) /* keypad 7 */
- PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad *") PORT_CODE(KEYCODE_MINUS_PAD) /* keypad * */
+ PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad *") PORT_CODE(KEYCODE_ASTERISK) /* keypad * */
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) /* keypad 2 */
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) /* keypad 5 */
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) /* keypad 8 */
diff --git a/src/mame/drivers/mrflea.cpp b/src/mame/drivers/mrflea.cpp
index c6ffb6fe8e9..a9acc38e4a3 100644
--- a/src/mame/drivers/mrflea.cpp
+++ b/src/mame/drivers/mrflea.cpp
@@ -277,7 +277,8 @@ static MACHINE_CONFIG_START( mrflea )
MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("pic", pic8259_device, ir0_w)) MCFG_DEVCB_BIT(3) // INTRA
MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("mainppi", i8255_device, pc2_w)) MCFG_DEVCB_BIT(1) // OBFB -> STBB
- MCFG_PIC8259_ADD("pic", INPUTLINE("subcpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("subcpu", 0))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/mugsmash.cpp b/src/mame/drivers/mugsmash.cpp
index 9a9cb0d0aba..4e0ce05237f 100644
--- a/src/mame/drivers/mugsmash.cpp
+++ b/src/mame/drivers/mugsmash.cpp
@@ -61,7 +61,6 @@ WRITE16_MEMBER(mugsmash_state::mugsmash_reg2_w)
{
case 1:
m_soundlatch->write(space, 1, data & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
break;
default:
@@ -424,6 +423,7 @@ static MACHINE_CONFIG_START( mugsmash )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_YM2151_ADD("ymsnd", 3579545)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/multi16.cpp b/src/mame/drivers/multi16.cpp
index 9bbce125c59..0e90f79d5da 100644
--- a/src/mame/drivers/multi16.cpp
+++ b/src/mame/drivers/multi16.cpp
@@ -153,7 +153,8 @@ static MACHINE_CONFIG_START( multi16 )
MCFG_MC6845_SHOW_BORDER_AREA(false)
MCFG_MC6845_CHAR_WIDTH(8)
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/munchmo.cpp b/src/mame/drivers/munchmo.cpp
index 407669ffd59..e1ed3d09a8d 100644
--- a/src/mame/drivers/munchmo.cpp
+++ b/src/mame/drivers/munchmo.cpp
@@ -29,6 +29,7 @@ Stephh's notes (based on the game Z80 code and some tests) :
#include "includes/munchmo.h"
#include "cpu/z80/z80.h"
+#include "machine/74259.h"
#include "sound/ay8910.h"
#include "screen.h"
#include "speaker.h"
@@ -40,9 +41,9 @@ Stephh's notes (based on the game Z80 code and some tests) :
*
*************************************/
-WRITE8_MEMBER(munchmo_state::nmi_enable_w)
+WRITE_LINE_MEMBER(munchmo_state::nmi_enable_w)
{
- m_nmi_enable = data;
+ m_nmi_enable = state;
}
/* trusted thru schematics, NMI and IRQ triggers at vblank, at the same time (!) */
@@ -103,14 +104,9 @@ static ADDRESS_MAP_START( mnchmobl_map, AS_PROGRAM, 8, munchmo_state )
AM_RANGE(0xbaba, 0xbaba) AM_WRITENOP /* ? */
AM_RANGE(0xbc00, 0xbc7f) AM_RAM AM_SHARE("status_vram")
AM_RANGE(0xbe00, 0xbe00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
- AM_RANGE(0xbe01, 0xbe01) AM_WRITE(palette_bank_w)
+ AM_RANGE(0xbe01, 0xbe01) AM_SELECT(0x0070) AM_DEVWRITE_MOD("mainlatch", ls259_device, write_d0, rshift<4>)
AM_RANGE(0xbe02, 0xbe02) AM_READ_PORT("DSW1")
AM_RANGE(0xbe03, 0xbe03) AM_READ_PORT("DSW2")
- AM_RANGE(0xbe11, 0xbe11) AM_WRITENOP /* ? */
- AM_RANGE(0xbe21, 0xbe21) AM_WRITENOP /* ? */
- AM_RANGE(0xbe31, 0xbe31) AM_WRITENOP /* ? */
- AM_RANGE(0xbe41, 0xbe41) AM_WRITE(flipscreen_w)
- AM_RANGE(0xbe61, 0xbe61) AM_WRITE(nmi_enable_w) // ENI 1-10C
AM_RANGE(0xbf00, 0xbf00) AM_WRITE(nmi_ack_w) // CNI 1-8C
AM_RANGE(0xbf01, 0xbf01) AM_READ_PORT("SYSTEM")
AM_RANGE(0xbf02, 0xbf02) AM_READ_PORT("P1")
@@ -317,13 +313,6 @@ void munchmo_state::machine_start()
save_item(NAME(m_nmi_enable));
}
-void munchmo_state::machine_reset()
-{
- m_palette_bank = 0;
- m_flipscreen = 0;
- m_nmi_enable = 0;
-}
-
static MACHINE_CONFIG_START( mnchmobl )
/* basic machine hardware */
@@ -335,6 +324,15 @@ static MACHINE_CONFIG_START( mnchmobl )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(munchmo_state, generic_irq_ack) // IORQ clears flip-flop at 1-7H
+ MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 12E
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(munchmo_state, palette_bank_0_w)) // BCL0 2-11E
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(munchmo_state, palette_bank_1_w)) // BCL1 2-11E
+ MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // CL2 2-11E
+ MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // CL3 2-11E
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(munchmo_state, flipscreen_w)) // INV
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP) // DISP
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(munchmo_state, nmi_enable_w)) // ENI 1-10C
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(57)
diff --git a/src/mame/drivers/nds.cpp b/src/mame/drivers/nds.cpp
new file mode 100644
index 00000000000..485d7c45a42
--- /dev/null
+++ b/src/mame/drivers/nds.cpp
@@ -0,0 +1,155 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+/***************************************************************************
+
+ ds.cpp
+
+ Skeleton driver for first-generation Nintendo DS.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "includes/nds.h"
+
+#define VERBOSE_LEVEL (0)
+
+static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...)
+{
+ if( VERBOSE_LEVEL >= n_level )
+ {
+ va_list v;
+ char buf[ 32768 ];
+ va_start( v, s_fmt );
+ vsprintf( buf, s_fmt, v );
+ va_end( v );
+ device.logerror( "%08x: %s", device.machine().describe_context(), buf );
+ }
+}
+
+READ32_MEMBER(nds_state::arm7_io_r)
+{
+ switch(offset)
+ {
+ case POSTFLG_OFFSET:
+ /* Bit Use
+ * 0 0=Booting, 1=Booted (set by BIOS/firmware)
+ */
+ return m_arm7_postflg;
+ default:
+ verboselog(*this, 0, "[ARM7] [IO] Unknown read: %08x (%08x)\n", offset*4, mem_mask);
+ break;
+ }
+
+ return 0;
+}
+
+WRITE32_MEMBER(nds_state::arm7_io_w)
+{
+ switch(offset)
+ {
+ case POSTFLG_OFFSET:
+ /* Bit Use
+ * 0 0=Booting, 1=Booted (set by BIOS/firmware)
+ */
+ if (!(m_arm7_postflg & POSTFLG_PBF_MASK) && m_arm7->pc() < 0x4000)
+ {
+ m_arm7_postflg &= ~POSTFLG_PBF_MASK;
+ m_arm7_postflg |= data & POSTFLG_PBF_MASK;
+ }
+ break;
+ default:
+ verboselog(*this, 0, "[ARM7] [IO] Unknown write: %08x = %08x (%08x)\n", offset*4, data, mem_mask);
+ break;
+ }
+}
+
+READ32_MEMBER(nds_state::arm9_io_r)
+{
+ switch(offset)
+ {
+ case POSTFLG_OFFSET:
+ /* Bit Use
+ * 0 0=Booting, 1=Booted (set by BIOS/firmware)
+ * 1 RAM
+ */
+ return m_arm9_postflg;
+ default:
+ verboselog(*this, 0, "[ARM9] [IO] Unknown read: %08x (%08x)\n", offset*4, mem_mask);
+ break;
+ }
+
+ return 0;
+}
+
+WRITE32_MEMBER(nds_state::arm9_io_w)
+{
+ switch(offset)
+ {
+ case POSTFLG_OFFSET:
+ /* Bit Use
+ * 0 0=Booting, 1=Booted (set by BIOS/firmware)
+ * 1 RAM
+ */
+ if (!(m_arm9_postflg & POSTFLG_PBF_MASK))
+ {
+ m_arm9_postflg &= ~POSTFLG_PBF_MASK;
+ m_arm9_postflg |= data & POSTFLG_PBF_MASK;
+ }
+ m_arm9_postflg &= ~POSTFLG_RAM_MASK;
+ m_arm9_postflg |= data & POSTFLG_RAM_MASK;
+ break;
+ default:
+ verboselog(*this, 0, "[ARM7] [IO] Unknown write: %08x = %08x (%08x)\n", offset*4, data, mem_mask);
+ break;
+ }
+}
+
+static ADDRESS_MAP_START( nds_arm7_map, AS_PROGRAM, 32, nds_state )
+ AM_RANGE(0x00000000, 0x00003fff) AM_ROM
+ AM_RANGE(0x02000000, 0x023fffff) AM_RAM AM_SHARE("mainram")
+ AM_RANGE(0x03800000, 0x0380ffff) AM_RAM
+ AM_RANGE(0x04000000, 0x0400ffff) AM_READWRITE(arm7_io_r, arm7_io_w)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( nds_arm9_map, AS_PROGRAM, 32, nds_state )
+ AM_RANGE(0x00000000, 0x00000fff) AM_ROM
+ AM_RANGE(0x02000000, 0x023fffff) AM_RAM AM_SHARE("mainram")
+ AM_RANGE(0x04000000, 0x0400ffff) AM_READWRITE(arm9_io_r, arm9_io_w)
+ADDRESS_MAP_END
+
+static INPUT_PORTS_START( nds )
+INPUT_PORTS_END
+
+
+void nds_state::machine_reset()
+{
+ m_arm7_postflg = 0;
+ m_arm9_postflg = 0;
+}
+
+void nds_state::machine_start()
+{
+}
+
+static MACHINE_CONFIG_START( nds )
+ MCFG_CPU_ADD("arm7", ARM7, XTAL_33_333MHz)
+ MCFG_CPU_PROGRAM_MAP(nds_arm7_map)
+
+ MCFG_CPU_ADD("arm9", ARM946ES, XTAL_66_6667MHz)
+ MCFG_CPU_PROGRAM_MAP(nds_arm9_map)
+MACHINE_CONFIG_END
+
+/* Help identifying the region and revisions of the set would be greatly appreciated! */
+ROM_START( nds )
+ ROM_REGION( 0x1000, "arm9", 0 )
+ ROM_LOAD( "biosnds9.rom", 0x0000, 0x1000, CRC(2ab23573) SHA1(bfaac75f101c135e32e2aaf541de6b1be4c8c62d) )
+
+ ROM_REGION( 0x4000, "arm7", 0 )
+ ROM_LOAD( "biosnds7.rom", 0x0000, 0x4000, CRC(1280f0d5) SHA1(24f67bdea115a2c847c8813a262502ee1607b7df) )
+
+ ROM_REGION32_LE( 0x40000, "firmware", 0 )
+ ROM_LOAD( "firmware.bin", 0x0000, 0x40000, CRC(945f9dc9) SHA1(cfe072921ee3fb93f688743f8beef89043c3e9ad) )
+ROM_END
+
+// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS
+CONS(2004, nds, 0, 0, nds, nds, nds_state, 0, "Nintendo", "DS", MACHINE_IS_SKELETON)
diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp
index 109d45ba652..b38bb656c90 100644
--- a/src/mame/drivers/neogeo.cpp
+++ b/src/mame/drivers/neogeo.cpp
@@ -5542,7 +5542,7 @@ ROM_END
NEO-MVS PROGBK1 / NEO-MVS CHA256B
****************************************/
-ROM_START( tws96 ) /* MVS ONLY RELEASE */
+ROM_START( twsoc96 ) /* MVS ONLY RELEASE */
ROM_REGION( 0x100000, "cslot1:maincpu", ROMREGION_BE|ROMREGION_16BIT )
ROM_LOAD16_WORD_SWAP( "086-p1.p1", 0x000000, 0x100000, CRC(03e20ab6) SHA1(3a0a5a54649178ce7a6158980cb4445084b40fb5) ) /* mask rom TC538200 */
@@ -11048,7 +11048,7 @@ GAME( 1995, gowcaizr, neogeo, neobase, neogeo, neogeo_state, neogeo, R
GAME( 1996, sdodgeb, neogeo, neobase, neogeo, neogeo_state, neogeo, ROT0, "Technos Japan", "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu", MACHINE_SUPPORTS_SAVE )
/* Tecmo */
-GAME( 1996, tws96, neogeo, neobase, neogeo, neogeo_state, neogeo, ROT0, "Tecmo", "Tecmo World Soccer '96", MACHINE_SUPPORTS_SAVE )
+GAME( 1996, twsoc96, neogeo, neobase, neogeo, neogeo_state, neogeo, ROT0, "Tecmo", "Tecmo World Soccer '96", MACHINE_SUPPORTS_SAVE )
/* Viccom */
GAME( 1994, fightfev, neogeo, neobase, neogeo, neogeo_state, neogeo, ROT0, "Viccom", "Fight Fever (set 1)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/ngen.cpp b/src/mame/drivers/ngen.cpp
index 974f1ccf8ad..0d76ea5176f 100644
--- a/src/mame/drivers/ngen.cpp
+++ b/src/mame/drivers/ngen.cpp
@@ -920,7 +920,8 @@ static MACHINE_CONFIG_START( ngen )
MCFG_80186_TMROUT0_HANDLER(WRITELINE(ngen_state, cpu_timer_w))
MCFG_80186_IRQ_SLAVE_ACK(READ8(ngen_state, irq_cb))
- MCFG_PIC8259_ADD( "pic", DEVWRITELINE("maincpu",i80186_cpu_device,int0_w), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("maincpu", i80186_cpu_device, int0_w))
MCFG_DEVICE_ADD("pit", PIT8254, 0)
MCFG_PIT8253_CLK0(78120/4) // 19.53kHz, /4 of the CPU timer output?
@@ -1030,7 +1031,8 @@ static MACHINE_CONFIG_START( ngen386 )
MCFG_CPU_IO_MAP(ngen386_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD( "pic", INPUTLINE("i386cpu",0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("i386cpu", 0))
MCFG_DEVICE_ADD("pit", PIT8254, 0)
MCFG_PIT8253_CLK0(78120/4) // 19.53kHz, /4 of the CPU timer output?
diff --git a/src/mame/drivers/ninjaw.cpp b/src/mame/drivers/ninjaw.cpp
index 27e91125712..a8cc0ba4eed 100644
--- a/src/mame/drivers/ninjaw.cpp
+++ b/src/mame/drivers/ninjaw.cpp
@@ -742,7 +742,11 @@ static MACHINE_CONFIG_START( ninjaw )
MCFG_CPU_PROGRAM_MAP(ninjaw_slave_map)
MCFG_CPU_VBLANK_INT_DRIVER("lscreen", ninjaw_state, irq4_line_hold)
- MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* CPU slices */
+ // TODO: if CPUs are unsynched then seldomly stages loads up with no enemies
+ // Let's use a better timer (was 6000 before) based off actual CPU timing.
+ // Might as well bump the divider in case the bug still occurs before resorting to perfect CPU.
+ MCFG_QUANTUM_TIME(attotime::from_hz(16000000/1024)) /* CPU slices */
+ //MCFG_QUANTUM_PERFECT_CPU("maincpu")
MCFG_DEVICE_ADD("tc0040ioc", TC0040IOC, 0)
MCFG_TC0040IOC_READ_0_CB(IOPORT("DSWA"))
@@ -863,7 +867,8 @@ static MACHINE_CONFIG_START( darius2 )
MCFG_CPU_PROGRAM_MAP(darius2_slave_map)
MCFG_CPU_VBLANK_INT_DRIVER("lscreen", ninjaw_state, irq4_line_hold)
- MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* CPU slices */
+ MCFG_QUANTUM_TIME(attotime::from_hz(16000000/1024)) /* CPU slices */
+ //MCFG_QUANTUM_PERFECT_CPU("maincpu")
MCFG_DEVICE_ADD("tc0040ioc", TC0040IOC, 0)
MCFG_TC0040IOC_READ_0_CB(IOPORT("DSWA"))
diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp
index 4d25e7411a1..526b420cf8e 100644
--- a/src/mame/drivers/notetaker.cpp
+++ b/src/mame/drivers/notetaker.cpp
@@ -800,14 +800,18 @@ static MACHINE_CONFIG_START( notetakr )
MCFG_CPU_PROGRAM_MAP(notetaker_iocpu_mem)
MCFG_CPU_IO_MAP(notetaker_iocpu_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("iopic8259", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("iopic8259", INPUTLINE("iocpu", 0), VCC, NOOP) // iP8259A-2 @ E6
+
+ MCFG_DEVICE_ADD("iopic8259", PIC8259, 0) // iP8259A-2 @ E6
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("iocpu", 0))
/* Emulator CPU: 8086@5MHz */
/*MCFG_CPU_ADD("emulatorcpu", I8086, XTAL_15MHz/3)
MCFG_CPU_PROGRAM_MAP(notetaker_emulatorcpu_mem)
MCFG_CPU_IO_MAP(notetaker_emulatorcpu_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("emulatorpic8259", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("emulatorpic8259", INPUTLINE("emulatorcpu", 0), VCC, NOOP) // iP8259A-2 @ E6
+
+ MCFG_DEVICE_ADD("emulatorpic8259", PIC8259, 0) // iP8259A-2 @ E6
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("emulatorcpu", 0))
*/
/* video hardware */
diff --git a/src/mame/drivers/octopus.cpp b/src/mame/drivers/octopus.cpp
index 44560cbbea2..c4074d67f5c 100644
--- a/src/mame/drivers/octopus.cpp
+++ b/src/mame/drivers/octopus.cpp
@@ -909,8 +909,14 @@ static MACHINE_CONFIG_START( octopus )
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(octopus_state, dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(octopus_state, dack7_w))
- MCFG_PIC8259_ADD("pic_master", INPUTLINE("maincpu",0), VCC, READ8(octopus_state,get_slave_ack))
- MCFG_PIC8259_ADD("pic_slave", DEVWRITELINE("pic_master",pic8259_device, ir7_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(octopus_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic_master", pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
// RTC (MC146818 via i8255 PPI)
MCFG_DEVICE_ADD("ppi", I8255, 0)
diff --git a/src/mame/drivers/offtwall.cpp b/src/mame/drivers/offtwall.cpp
index b6bef7c63df..40ee2b27cd0 100644
--- a/src/mame/drivers/offtwall.cpp
+++ b/src/mame/drivers/offtwall.cpp
@@ -23,6 +23,7 @@
#include "includes/offtwall.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "speaker.h"
@@ -237,7 +238,7 @@ READ16_MEMBER(offtwall_state::unknown_verify_r)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, offtwall_state )
AM_RANGE(0x000000, 0x037fff) AM_ROM
AM_RANGE(0x038000, 0x03ffff) AM_READ(bankrom_r) AM_REGION("maincpu", 0x38000) AM_SHARE("bankrom_base")
- AM_RANGE(0x120000, 0x120fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x120000, 0x120fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x260000, 0x260001) AM_READ_PORT("260000")
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("260002")
AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
@@ -248,7 +249,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, offtwall_state )
AM_RANGE(0x260030, 0x260031) AM_DEVREAD8("jsa", atari_jsa_iii_device, main_response_r, 0x00ff)
AM_RANGE(0x260040, 0x260041) AM_DEVWRITE8("jsa", atari_jsa_iii_device, main_command_w, 0x00ff)
AM_RANGE(0x260050, 0x260051) AM_WRITE(io_latch_w)
- AM_RANGE(0x260060, 0x260061) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x260060, 0x260061) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x2a0000, 0x2a0001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x3effc0, 0x3effff) AM_DEVREADWRITE("vad", atari_vad_device, control_read, control_write)
@@ -368,7 +369,8 @@ static MACHINE_CONFIG_START( offtwall )
MCFG_MACHINE_RESET_OVERRIDE(offtwall_state,offtwall)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -424,7 +426,7 @@ ROM_START( offtwall )
ROM_LOAD( "136090-1017.18p", 0x080000, 0x20000, CRC(7f7f8012) SHA1(1123ea3c6cd2c73617a87d6a5bbb26fca8941af3) )
ROM_LOAD( "136090-1019.18m", 0x0a0000, 0x20000, CRC(9efe511b) SHA1(db1f1d8792bf497bc9ad652b0b7d78c3abf0e817) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "offtwall-eeprom.17l", 0x0000, 0x800, CRC(5eaf2d5b) SHA1(934a76a23960e6ed2cc33c359f9735caee762145) )
ROM_REGION(0x022f, "jsa:plds", 0)
@@ -457,7 +459,7 @@ ROM_START( offtwallc )
ROM_LOAD( "090-1617.rom", 0x080000, 0x20000, CRC(15208a89) SHA1(124484ab54959a1e6d9022a4f3ee4288a79c768b) )
ROM_LOAD( "090-1619.rom", 0x0a0000, 0x20000, CRC(8a5d79b3) SHA1(0a202d20e6c86989ce2223e10eadf9009dd6ca8e) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "offtwall-eeprom.17l", 0x0000, 0x800, CRC(5eaf2d5b) SHA1(934a76a23960e6ed2cc33c359f9735caee762145) )
ROM_END
diff --git a/src/mame/drivers/onetwo.cpp b/src/mame/drivers/onetwo.cpp
index eba79c8557a..708c12d4f60 100644
--- a/src/mame/drivers/onetwo.cpp
+++ b/src/mame/drivers/onetwo.cpp
@@ -86,7 +86,6 @@ public:
DECLARE_WRITE8_MEMBER(onetwo_fgram_w);
DECLARE_WRITE8_MEMBER(onetwo_cpubank_w);
DECLARE_WRITE8_MEMBER(onetwo_coin_counters_w);
- DECLARE_WRITE8_MEMBER(onetwo_soundlatch_w);
DECLARE_WRITE8_MEMBER(palette1_w);
DECLARE_WRITE8_MEMBER(palette2_w);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
@@ -149,12 +148,6 @@ WRITE8_MEMBER(onetwo_state::onetwo_coin_counters_w)
machine().bookkeeping().coin_counter_w(1, BIT(data, 2));
}
-WRITE8_MEMBER(onetwo_state::onetwo_soundlatch_w)
-{
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
-}
-
void onetwo_state::set_color(int offset)
{
int r, g, b;
@@ -195,7 +188,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( main_cpu_io, AS_IO, 8, onetwo_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW1") AM_WRITE(onetwo_coin_counters_w)
- AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW2") AM_WRITE(onetwo_soundlatch_w)
+ AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW2") AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x02, 0x02) AM_READ_PORT("P1") AM_WRITE(onetwo_cpubank_w)
AM_RANGE(0x03, 0x03) AM_READ_PORT("P2")
AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM")
@@ -212,7 +205,7 @@ static ADDRESS_MAP_START( sound_cpu_io, AS_IO, 8, onetwo_state )
AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("ymsnd", ym3812_device, status_port_r, control_port_w)
AM_RANGE(0x20, 0x20) AM_DEVWRITE("ymsnd", ym3812_device, write_port_w)
AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0xc0, 0xc0) AM_DEVWRITE("soundlatch", generic_latch_8_device, clear_w)
+ AM_RANGE(0xc0, 0xc0) AM_DEVWRITE("soundlatch", generic_latch_8_device, acknowledge_w)
ADDRESS_MAP_END
/*************************************
@@ -386,6 +379,8 @@ static MACHINE_CONFIG_START( onetwo )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+ MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
MCFG_SOUND_ADD("ymsnd", YM3812, MASTER_CLOCK)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/paso1600.cpp b/src/mame/drivers/paso1600.cpp
index 91a196ab99c..1ffd41e6725 100644
--- a/src/mame/drivers/paso1600.cpp
+++ b/src/mame/drivers/paso1600.cpp
@@ -321,7 +321,8 @@ static MACHINE_CONFIG_START( paso1600 )
MCFG_MC6845_SHOW_BORDER_AREA(false)
MCFG_MC6845_CHAR_WIDTH(8)
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("8237dma", AM9517A, 16000000/4)
MCFG_I8237_IN_MEMR_CB(READ8(paso1600_state, pc_dma_read_byte))
diff --git a/src/mame/drivers/pc100.cpp b/src/mame/drivers/pc100.cpp
index a60f9ead634..fd25bfc9499 100644
--- a/src/mame/drivers/pc100.cpp
+++ b/src/mame/drivers/pc100.cpp
@@ -513,7 +513,9 @@ static MACHINE_CONFIG_START( pc100 )
MCFG_I8255_OUT_PORTB_CB(WRITE8(pc100_state, upper_mask_w))
MCFG_I8255_OUT_PORTC_CB(WRITE8(pc100_state, crtc_bank_w))
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(GND) // ???
MCFG_DEVICE_ADD("uart8251", I8251, 0)
//MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mame/drivers/pc1512.cpp b/src/mame/drivers/pc1512.cpp
index 6e9ac05eb9b..d471a377828 100644
--- a/src/mame/drivers/pc1512.cpp
+++ b/src/mame/drivers/pc1512.cpp
@@ -1222,7 +1222,9 @@ static MACHINE_CONFIG_START( pc1512 )
MCFG_I8237_OUT_DACK_1_CB(WRITELINE(pc1512_state, dack1_w))
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(pc1512_state, dack2_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(pc1512_state, dack3_w))
- MCFG_PIC8259_ADD(I8259A2_TAG, INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+
+ MCFG_DEVICE_ADD(I8259A2_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL_28_63636MHz/24)
@@ -1352,7 +1354,9 @@ static MACHINE_CONFIG_START( pc1640 )
MCFG_I8237_OUT_DACK_1_CB(WRITELINE(pc1512_state, dack1_w))
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(pc1512_state, dack2_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(pc1512_state, dack3_w))
- MCFG_PIC8259_ADD(I8259A2_TAG, INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+
+ MCFG_DEVICE_ADD(I8259A2_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0)
MCFG_PIT8253_CLK0(XTAL_28_63636MHz/24)
diff --git a/src/mame/drivers/pc88va.cpp b/src/mame/drivers/pc88va.cpp
index 894b6f370c9..57d5ebe0795 100644
--- a/src/mame/drivers/pc88va.cpp
+++ b/src/mame/drivers/pc88va.cpp
@@ -1825,9 +1825,14 @@ static MACHINE_CONFIG_START( pc88va )
MCFG_I8255_IN_PORTC_CB(READ8(pc88va_state, fdc_8255_c_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(pc88va_state, fdc_8255_c_w))
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(pc88va_state,get_slave_ack) )
-
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(pc88va_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("dmac", AM9517A, 8000000) /* ch2 is FDC, ch0/3 are "user". ch1 is unused */
MCFG_AM9517A_OUT_HREQ_CB(WRITELINE(pc88va_state, pc88va_hlda_w))
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index 3ca6653994a..be1e38219af 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -2286,8 +2286,15 @@ static MACHINE_CONFIG_START( pc9801_common )
MCFG_I8237_OUT_DACK_1_CB(WRITELINE(pc9801_state, dack1_w))
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(pc9801_state, dack2_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(pc9801_state, dack3_w))
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(pc9801_state,get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NOOP) // TODO: Check ir7_w
+
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(pc9801_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir7_w)) // TODO: Check ir7_w
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("ppi8255_sys", I8255, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2"))
diff --git a/src/mame/drivers/pcd.cpp b/src/mame/drivers/pcd.cpp
index bca2415c706..5a74bfffed8 100644
--- a/src/mame/drivers/pcd.cpp
+++ b/src/mame/drivers/pcd.cpp
@@ -495,8 +495,11 @@ static MACHINE_CONFIG_START( pcd )
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer0_tick", pcd_state, timer0_tick, attotime::from_hz(XTAL_16MHz / 24)) // adjusted to pass post
- MCFG_PIC8259_ADD("pic1", DEVWRITELINE("maincpu", i80186_cpu_device, int0_w), VCC, NOOP)
- MCFG_PIC8259_ADD("pic2", DEVWRITELINE("maincpu", i80186_cpu_device, int1_w), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("maincpu", i80186_cpu_device, int0_w))
+
+ MCFG_DEVICE_ADD("pic2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("maincpu", i80186_cpu_device, int1_w))
MCFG_DEVICE_ADD("video", PCD_VIDEO, 0)
diff --git a/src/mame/drivers/peoplepc.cpp b/src/mame/drivers/peoplepc.cpp
index ca42ce35356..79bc4ef2b05 100644
--- a/src/mame/drivers/peoplepc.cpp
+++ b/src/mame/drivers/peoplepc.cpp
@@ -248,8 +248,14 @@ static MACHINE_CONFIG_START( olypeopl )
MCFG_PIT8253_CLK2(XTAL_14_7456MHz/6)
MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pic8259_0", pic8259_device, ir0_w))
- MCFG_PIC8259_ADD("pic8259_0", INPUTLINE("maincpu", 0), VCC, READ8(peoplepc_state, get_slave_ack))
- MCFG_PIC8259_ADD("pic8259_1", DEVWRITELINE("pic8259_0", pic8259_device, ir7_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_0", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(peoplepc_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_0", pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
diff --git a/src/mame/drivers/pg685.cpp b/src/mame/drivers/pg685.cpp
index 8c2df754818..d6479960660 100644
--- a/src/mame/drivers/pg685.cpp
+++ b/src/mame/drivers/pg685.cpp
@@ -383,7 +383,8 @@ MC6845_UPDATE_ROW( pg685_state::crtc_update_row_oua12 )
static MACHINE_CONFIG_START(pg685_backplane)
MCFG_DEVICE_ADD("bppit", PIT8253, 0)
- MCFG_PIC8259_ADD("bppic", NOOP, VCC, NOOP) // ???
+ MCFG_DEVICE_ADD("bppic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(NOOP) // ???
MCFG_DEVICE_ADD("bpuart", MC2661, XTAL_4_9152MHz) // internal clock
MACHINE_CONFIG_END
@@ -407,7 +408,9 @@ static MACHINE_CONFIG_START( pg675 )
MCFG_CPU_PROGRAM_MAP(pg675_mem)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("mainpic", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("mainpic", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("mainpic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
// i/o cpu
@@ -454,7 +457,9 @@ static MACHINE_CONFIG_START( pg685 )
MCFG_CPU_PROGRAM_MAP(pg685_mem)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("mainpic", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("mainpic", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("mainpic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
// i/o cpu
@@ -503,7 +508,9 @@ static MACHINE_CONFIG_START( pg685oua12 )
MCFG_CPU_PROGRAM_MAP(pg685oua12_mem)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("mainpic", pic8259_device, inta_cb)
- MCFG_PIC8259_ADD("mainpic", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("mainpic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
// i/o cpu
diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp
index b4539581ced..d572a64de26 100644
--- a/src/mame/drivers/pk8020.cpp
+++ b/src/mame/drivers/pk8020.cpp
@@ -215,7 +215,9 @@ static MACHINE_CONFIG_START( pk8020 )
MCFG_PIT8253_CLK2((XTAL_20MHz / 8) / 164)
MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pic8259", pic8259_device, ir5_w))
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+
MCFG_DEVICE_ADD("rs232", I8251, 0)
MCFG_DEVICE_ADD("lan", I8251, 0)
diff --git a/src/mame/drivers/pktgaldx.cpp b/src/mame/drivers/pktgaldx.cpp
index 28be685e28e..fee476e519b 100644
--- a/src/mame/drivers/pktgaldx.cpp
+++ b/src/mame/drivers/pktgaldx.cpp
@@ -370,6 +370,9 @@ static MACHINE_CONFIG_START( pktgaldx )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE(8,9, 4,5,6,7 ,1,0,3,2) // hopefully this is correct, nothing else uses this arrangement!
/* sound hardware */
diff --git a/src/mame/drivers/poisk1.cpp b/src/mame/drivers/poisk1.cpp
index 57d9a25e7d2..e3bfb0e2ce7 100644
--- a/src/mame/drivers/poisk1.cpp
+++ b/src/mame/drivers/poisk1.cpp
@@ -649,7 +649,8 @@ static MACHINE_CONFIG_START( poisk1 )
MCFG_PIT8253_CLK2(XTAL_15MHz/12) /* pio port c pin 4, and speaker polling enough */
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(p1_state, p1_pit8253_out2_changed))
- MCFG_PIC8259_ADD( "pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("ppi8255n1", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(READ8(p1_state, p1_ppi_porta_r)) /*60H*/
diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp
index f2ae3dc94be..0ed3f064fd1 100644
--- a/src/mame/drivers/qx10.cpp
+++ b/src/mame/drivers/qx10.cpp
@@ -712,8 +712,14 @@ static MACHINE_CONFIG_START( qx10 )
MCFG_PIT8253_CLK2(MAIN_CLK / 8)
MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("upd7201", z80dart_device, rxtxcb_w))
- MCFG_PIC8259_ADD("pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(qx10_state, get_slave_ack))
- MCFG_PIC8259_ADD("pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(qx10_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir7_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_UPD7201_ADD("upd7201", MAIN_CLK/4, 0, 0, 0, 0) // channel b clock set by pit2 channel 2
// Channel A: Keyboard
diff --git a/src/mame/drivers/rampart.cpp b/src/mame/drivers/rampart.cpp
index e77fbbfb7d9..dfd97239377 100644
--- a/src/mame/drivers/rampart.cpp
+++ b/src/mame/drivers/rampart.cpp
@@ -28,6 +28,7 @@
#include "includes/rampart.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "sound/ym2413.h"
@@ -139,8 +140,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, rampart_state )
AM_RANGE(0x3e3f80, 0x3effff) AM_MIRROR(0x010000) AM_RAM
AM_RANGE(0x460000, 0x460001) AM_MIRROR(0x019ffe) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0xff00)
AM_RANGE(0x480000, 0x480003) AM_MIRROR(0x019ffc) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0xff00)
- AM_RANGE(0x500000, 0x500fff) AM_MIRROR(0x019000) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- AM_RANGE(0x5a6000, 0x5a6001) AM_MIRROR(0x019ffe) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x500000, 0x500fff) AM_MIRROR(0x019000) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
+ AM_RANGE(0x5a6000, 0x5a6001) AM_MIRROR(0x019ffe) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffe) AM_WRITE(latch_w)
AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffc) AM_READ_PORT("IN0")
AM_RANGE(0x640002, 0x640003) AM_MIRROR(0x019ffc) AM_READ_PORT("IN1")
@@ -346,7 +347,8 @@ static MACHINE_CONFIG_START( rampart )
MCFG_MACHINE_RESET_OVERRIDE(rampart_state,rampart)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
@@ -402,7 +404,7 @@ ROM_START( rampart )
ROM_LOAD( "136082-1007.2d", 0x00000, 0x20000, CRC(c96a0fc3) SHA1(6e7e242d0afa4714ca31d77ccbf8ee487bbdb1e4) )
ROM_LOAD( "136082-1008.1d", 0x20000, 0x20000, CRC(518218d9) SHA1(edf1b11579dcfa9a872fa4bd866dc2f95fac767d) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "rampart-eeprom.bin", 0x0000, 0x800, CRC(0be57615) SHA1(bd1f9eef410c78c091d2c925d6275427c77c7ecd) )
ROM_REGION( 0x0c00, "plds", 0 )
@@ -429,7 +431,7 @@ ROM_START( rampart2p )
ROM_LOAD( "136082-1007.2d", 0x00000, 0x20000, CRC(c96a0fc3) SHA1(6e7e242d0afa4714ca31d77ccbf8ee487bbdb1e4) )
ROM_LOAD( "136082-1008.1d", 0x20000, 0x20000, CRC(518218d9) SHA1(edf1b11579dcfa9a872fa4bd866dc2f95fac767d) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "rampart-eeprom.bin", 0x0000, 0x800, CRC(0be57615) SHA1(bd1f9eef410c78c091d2c925d6275427c77c7ecd) )
ROM_REGION( 0x0c00, "plds", 0 )
@@ -460,7 +462,7 @@ ROM_START( rampartj )
ROM_LOAD( "136082-1007.2d", 0x00000, 0x20000, CRC(c96a0fc3) SHA1(6e7e242d0afa4714ca31d77ccbf8ee487bbdb1e4) )
ROM_LOAD( "136082-1008.1d", 0x20000, 0x20000, CRC(518218d9) SHA1(edf1b11579dcfa9a872fa4bd866dc2f95fac767d) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "rampartj-eeprom.bin", 0x0000, 0x800, CRC(096cacdc) SHA1(48328a27ce1975a27d9a83ae05d068cee7556a90) )
ROM_REGION( 0x0c00, "plds", 0 )
diff --git a/src/mame/drivers/rc759.cpp b/src/mame/drivers/rc759.cpp
index 7e0c06c70e2..ed5da3f0d0c 100644
--- a/src/mame/drivers/rc759.cpp
+++ b/src/mame/drivers/rc759.cpp
@@ -533,7 +533,8 @@ static MACHINE_CONFIG_START( rc759 )
MCFG_80186_TMROUT1_HANDLER(WRITELINE(rc759_state, i186_timer1_w))
// interrupt controller
- MCFG_PIC8259_ADD("pic", DEVWRITELINE("maincpu", i80186_cpu_device, int0_w), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("maincpu", i80186_cpu_device, int0_w))
// nvram
MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", rc759_state, nvram_init)
diff --git a/src/mame/drivers/relief.cpp b/src/mame/drivers/relief.cpp
index 83d6e7c94cd..25f569d2017 100644
--- a/src/mame/drivers/relief.cpp
+++ b/src/mame/drivers/relief.cpp
@@ -23,8 +23,8 @@
#include "includes/relief.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
-#include "machine/atarigen.h"
#include "sound/okim6295.h"
#include "sound/ym2413.h"
#include "speaker.h"
@@ -127,8 +127,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, relief_state )
AM_RANGE(0x140010, 0x140011) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x140020, 0x140021) AM_WRITE(audio_volume_w)
AM_RANGE(0x140030, 0x140031) AM_WRITE(audio_control_w)
- AM_RANGE(0x180000, 0x180fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0xff00)
- AM_RANGE(0x1c0030, 0x1c0031) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x180000, 0x180fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0xff00)
+ AM_RANGE(0x1c0030, 0x1c0031) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x260000, 0x260001) AM_READ_PORT("260000")
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("260002")
AM_RANGE(0x260010, 0x260011) AM_READ(special_port2_r)
@@ -275,7 +275,8 @@ static MACHINE_CONFIG_START( relief )
MCFG_MACHINE_RESET_OVERRIDE(relief_state,relief)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
@@ -338,7 +339,7 @@ ROM_START( relief )
ROM_LOAD( "136093-0030a.9b", 0x000000, 0x80000, CRC(f4c567f5) SHA1(7e8c1d54d918b0b41625eacbaf6dcb5bd99d1949) )
ROM_LOAD( "136093-0031a.10b", 0x080000, 0x80000, CRC(ba908d73) SHA1(a83afd86f4c39394cf624b728a87b8d8b6de1944) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "relief-eeprom.bin", 0x0000, 0x800, CRC(66069f60) SHA1(fac3797888f7ffe972f642aca44c6ca7d208c814) )
ROM_REGION( 0x001000, "plds", 0 )
@@ -373,7 +374,7 @@ ROM_START( relief2 )
ROM_LOAD( "136093-0030a.9b", 0x000000, 0x80000, CRC(f4c567f5) SHA1(7e8c1d54d918b0b41625eacbaf6dcb5bd99d1949) )
ROM_LOAD( "136093-0031a.10b", 0x080000, 0x80000, CRC(ba908d73) SHA1(a83afd86f4c39394cf624b728a87b8d8b6de1944) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "relief2-eeprom.bin", 0x0000, 0x800, CRC(2131fc40) SHA1(72a9f5f6647fbc74e645b6639db2fdbfbe6456e2) )
ROM_REGION( 0x001000, "plds", 0 )
@@ -407,7 +408,7 @@ ROM_START( relief3 )
ROM_LOAD( "136093-0030a.9b", 0x000000, 0x80000, CRC(f4c567f5) SHA1(7e8c1d54d918b0b41625eacbaf6dcb5bd99d1949) )
ROM_LOAD( "136093-0031a.10b", 0x080000, 0x80000, CRC(ba908d73) SHA1(a83afd86f4c39394cf624b728a87b8d8b6de1944) )
- ROM_REGION( 0x800, "eeprom:eeprom", 0 )
+ ROM_REGION( 0x800, "eeprom", 0 )
ROM_LOAD( "relief3-eeprom.bin", 0x0000, 0x800, CRC(2131fc40) SHA1(72a9f5f6647fbc74e645b6639db2fdbfbe6456e2) )
ROM_REGION( 0x001000, "plds", 0 )
diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp
index 94c79876f0b..bf2fc6b2b9d 100644
--- a/src/mame/drivers/rohga.cpp
+++ b/src/mame/drivers/rohga.cpp
@@ -960,6 +960,9 @@ static MACHINE_CONFIG_START( rohga )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -1047,6 +1050,9 @@ static MACHINE_CONFIG_START( wizdfire )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
@@ -1139,6 +1145,9 @@ static MACHINE_CONFIG_START( nitrobal )
MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE
MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
@@ -1227,6 +1236,9 @@ static MACHINE_CONFIG_START( schmeisr )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO104_ADD("ioprot104")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/sage2.cpp b/src/mame/drivers/sage2.cpp
index ad6df892d7a..9b107799ccc 100644
--- a/src/mame/drivers/sage2.cpp
+++ b/src/mame/drivers/sage2.cpp
@@ -413,7 +413,8 @@ static MACHINE_CONFIG_START( sage2 )
MCFG_CPU_PROGRAM_MAP(sage2_mem)
// devices
- MCFG_PIC8259_ADD(I8259_TAG, INPUTLINE(M68000_TAG, M68K_IRQ_1), VCC, NOOP)
+ MCFG_DEVICE_ADD(I8259_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(M68000_TAG, M68K_IRQ_1))
MCFG_DEVICE_ADD(I8255A_0_TAG, I8255A, 0)
MCFG_I8255_IN_PORTA_CB(IOPORT("J7"))
diff --git a/src/mame/drivers/segajw.cpp b/src/mame/drivers/segajw.cpp
index 986c2fc6a99..6a2b15105e8 100644
--- a/src/mame/drivers/segajw.cpp
+++ b/src/mame/drivers/segajw.cpp
@@ -57,7 +57,6 @@ public:
DECLARE_WRITE8_MEMBER(lamps1_w);
DECLARE_WRITE8_MEMBER(lamps2_w);
DECLARE_WRITE8_MEMBER(coinlockout_w);
- DECLARE_WRITE8_MEMBER(audiocpu_cmd_w);
DECLARE_INPUT_CHANGED_MEMBER(coin_drop_start);
DECLARE_CUSTOM_INPUT_MEMBER(coin_sensors_r);
DECLARE_CUSTOM_INPUT_MEMBER(hopper_sensors_r);
@@ -113,12 +112,6 @@ WRITE8_MEMBER(segajw_state::coinlockout_w)
output().set_indexed_value("towerlamp", i, BIT(data, 3 + i));
}
-WRITE8_MEMBER(segajw_state::audiocpu_cmd_w)
-{
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
-}
-
INPUT_CHANGED_MEMBER( segajw_state::coin_drop_start )
{
if (newval && !m_coin_start_cycles)
@@ -174,7 +167,7 @@ static ADDRESS_MAP_START( segajw_map, AS_PROGRAM, 16, segajw_state )
AM_RANGE(0x080002, 0x080003) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
AM_RANGE(0x180000, 0x180001) AM_READ_PORT("DSW0")
- AM_RANGE(0x180004, 0x180005) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff) AM_WRITE8(audiocpu_cmd_w, 0x00ff)
+ AM_RANGE(0x180004, 0x180005) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x180008, 0x180009) AM_READ_PORT("DSW1")
AM_RANGE(0x18000a, 0x18000b) AM_READ_PORT("DSW3")
AM_RANGE(0x18000c, 0x18000d) AM_READ_PORT("DSW2")
@@ -402,6 +395,8 @@ static MACHINE_CONFIG_START( segajw )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ymsnd", YM3438, 8000000) // unknown clock
diff --git a/src/mame/drivers/segasp.cpp b/src/mame/drivers/segasp.cpp
index b3966880479..dc8d7d120db 100644
--- a/src/mame/drivers/segasp.cpp
+++ b/src/mame/drivers/segasp.cpp
@@ -35,34 +35,36 @@ G1 bus PIO or DMA, or directly via banked area 0x0100xxxx in SH4 address space.
todo: make this actually readable, we don't support unicode source files
- Title PCB ID REV CF ID Dumped Region PIC MAIN BD Serial
-Battle Police ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Beetle DASH!! ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Bingo Galaxy ???-????? no ???-????-???? AAFE-01E10924916, AAFE-01D67304905, Medal
-Bingo Parade ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
-Brick People / Block People 834-14881 ROM ALL 253-5508-0558 AAFE-01F67905202, AAFE-01F68275202
-Dinosaur King 834-14493-01 D ROM US 253-5508-0408 AAFE-01D1132xxxx, AAFE-01D15924816
-Dinosaur King - Operation: Dinosaur Rescue 837-14434-91 MDA-C0021? ROM US/EXP 253-5508-0408 AAFE-01A30164715, AAFE-01B92094811
-- 834-14662-01
-Dinosaur King 2 ???-????? no 253-5508-0408 AAFE-xxxxxxxxxxx
-Dinosaur King 2 Ver 2.5 834-14792-02 F MDA-C0047 CF EXP 253-5508-0408 AAFE-01D73384904
-Disney: Magical Dream Dance on Stage ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Future Police Patrol Chase ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Issyouni Turbo Drive ???-????? no ???-????-???? AAFE-01E91305101
-Issyouni Wan Wan ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-King of Beetle: Battle Terminal ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Love & Berry Ver 1.003 834-14661-02 ROM EXP 253-5508-0446 AAFE-01D84934906
-Love & Berry Ver 2.000 834-14661-02 ROM EXP 253-5508-0446 AAFE-01D8493xxxx
-Love & Berry 3 EXP Ver 1.002 834-14661-01 MDA-C0042 CF US/EXP 253-5508-0446 AAFE-01D64704904
-Marine & Marine ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Mirage World ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
-Monopoly: The Medal ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
-Monopoly: The Medal 2nd Edition ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
-Mushiking 2K6 2ND ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Mushiking 2K7 1ST ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
-Tetris Giant / Tetris Dekaris 834-14970 G MDA-C0076 CF ALL 253-5508-0604 AAFE-01G03025212
-Tetris Giant / Tetris Dekaris Ver.2.000 834-14970 G ROM ALL 253-5508-0604 AAFE-xxxxxxxxxxx
-Thomas: The Tank Engine ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+ Title PCB ID REV CFID Dumped Region PIC MAIN BD Serial
+Battle Police ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Beetle DASH!! ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Bingo Galaxy ???-????? no ???-????-???? AAFE-01E10924916, AAFE-01D67304905, Medal
+Bingo Parade ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
+Brick People / Block People 834-14881 ROM ANY 253-5508-0558 AAFE-01F67905202, AAFE-01F68275202
+Dinosaur King 834-14493-01 D ROM US 253-5508-0408 AAFE-01D1132xxxx, AAFE-01D15924816
+Dinosaur King - Operation: Dinosaur Rescue 837-14434-91 ROM US/EXP 253-5508-0408 AAFE-01A30164715, AAFE-01B92094811
+- // - 834-14662-01 MDA-C0021 CF AAFE-01B87574811
+Dinosaur King 2 ???-????? no 253-5508-0408 AAFE-xxxxxxxxxxx
+Dinosaur King 2 Ver 2.5 834-14792-02 F MDA-C0047 CF EXP 253-5508-0408 AAFE-01D73384904
+Disney: Magical Dream Dance on Stage ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Future Police Patrol Chase ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Issyouni Turbo Drive ???-????? no ???-????-???? AAFE-01E91305101
+Issyouni Wan Wan ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+King of Beetle: Battle Terminal ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Love & Berry Ver 1.003 834-14661-02 ROM EXP 253-5508-0446 AAFE-01D84934906
+Love & Berry Ver 2.000 834-14661-02 ROM EXP 253-5508-0446 AAFE-01D8493xxxx
+Love & Berry 3 EXP Ver 1.002 834-14661-01 MDA-C0042 CF US/EXP 253-5508-0446 AAFE-01D64704904
+Marine & Marine ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Medalink 837-14699 no
+Medalink 837-14700 no
+Mirage World ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
+Monopoly: The Medal ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
+Monopoly: The Medal 2nd Edition ???-????? no ???-????-???? AAFE-xxxxxxxxxxx, Medal
+Mushiking 2K6 2ND ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Mushiking 2K7 1ST ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
+Tetris Giant / Tetris Dekaris 834-14970 G MDA-C0076 CF ANY 253-5508-0604 AAFE-01G03025212
+Tetris Giant / Tetris Dekaris Ver.2.000 834-14970 G ROM ANY 253-5508-0604 AAFE-xxxxxxxxxxx
+Thomas: The Tank Engine ???-????? no ???-????-???? AAFE-xxxxxxxxxxx
REV PCB IC6s Flash AU1500
D 171-8278D 315-6370 8x 128Mbit AMD
@@ -400,27 +402,6 @@ ROM_START( dinoking )
ROM_LOAD( "317-0408-com.ic15", 0, 0x800, BAD_DUMP CRC(0e94daba) SHA1(4e9722333a29afd0dbadba78b16344b77a689610) )
ROM_END
-ROM_START( dinokior )
- SEGASP_BIOS
- SEGASP_US
- SEGASP_MISC
-
- ROM_REGION( 0x08000000, "rom_board", ROMREGION_ERASE)
- ROM_LOAD( "ic62", 0x00000000, 0x01000000, CRC(d3f37d05) SHA1(54c25ddca061acc092a357d958f180f523b86b65) )
- ROM_LOAD( "ic63", 0x01000000, 0x01000000, CRC(07a9491a) SHA1(24b4a6e2fb136dd02fd8ede3d07dc8e3cec36f3d) )
- ROM_LOAD( "ic64", 0x02000000, 0x01000000, CRC(d14a95f7) SHA1(b078ae9ca1b75a80dfd35227351b5aa6f4465cd2) )
- ROM_LOAD( "ic65", 0x03000000, 0x01000000, CRC(09bf6418) SHA1(6d833a82e1268548a837df7fb681940faee17096) )
- ROM_LOAD( "ic66s", 0x04000000, 0x01000000, CRC(014de6b8) SHA1(68c2f25bc91dee4e1e069b586314b2e1fe4bc1b2) )
- ROM_LOAD( "ic67s", 0x05000000, 0x01000000, CRC(7bf77663) SHA1(51a0c867290dce11dcc49f61c1af0d4ed42b02f1) )
- ROM_LOAD( "ic68s", 0x06000000, 0x01000000, CRC(ff5ed2b8) SHA1(d8d86b3ed976c8c8fc51d225ae661e5f237b6e1d) )
- ROM_LOAD( "ic69s", 0x07000000, 0x01000000, CRC(ab8ac4eb) SHA1(e6b3ce796ae4887011e2764261f3f437dc9939f9) )
-
- ROM_PARAMETER( ":rom_board:id", "5502" ) // actually 8x 128Mbit FlashROMs
-
- ROM_REGION( 0x800, "pic_readout", 0 )
- ROM_LOAD( "317-0408-com.ic15", 0, 0x800, BAD_DUMP CRC(0e94daba) SHA1(4e9722333a29afd0dbadba78b16344b77a689610) )
-ROM_END
-
ROM_START( lovebery )
SEGASP_BIOS
ROM_DEFAULT_BIOS( "v201" )
@@ -478,6 +459,22 @@ ROM_START( tetgiant )
ROM_END
+ROM_START( dinokior )
+ SEGASP_BIOS
+ SEGASP_US
+ SEGASP_MISC
+
+ ROM_REGION( 0x08000000, "rom_board", ROMREGION_ERASEFF)
+
+ DISK_REGION( "cflash" )
+ DISK_IMAGE( "mda-c0021", 0, SHA1(947c987fb93a32c5acf7839e0186de91b5a9facc) )
+
+ ROM_PARAMETER( ":rom_board:id", "5502" ) // actually 8x 128Mbit FlashROMs
+
+ ROM_REGION( 0x800, "pic_readout", 0 )
+ ROM_LOAD( "317-0408-com.ic15", 0, 0x800, BAD_DUMP CRC(0e94daba) SHA1(4e9722333a29afd0dbadba78b16344b77a689610) )
+ROM_END
+
ROM_START( dinoki25 )
SEGASP_BIOS
ROM_DEFAULT_BIOS( "v200" )
@@ -540,23 +537,14 @@ ROM_END
#define GAME_FLAGS (MACHINE_NO_SOUND|MACHINE_NOT_WORKING)
GAME( 2004, segasp, 0, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Sega System SP (Spider) BIOS", GAME_FLAGS | MACHINE_IS_BIOS_ROOT )
-
// These use ROMs
GAME( 2009, brickppl,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Brick People / Block PeePoo (Ver 1.002)", GAME_FLAGS )
-
GAME( 2005, dinoking,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Dinosaur King (USA)", GAME_FLAGS )
-
-GAME( 2006, dinokior,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Dinosaur King - Operation: Dinosaur Rescue (USA, Export)", GAME_FLAGS )
-
GAME( 2006, lovebery,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Love And Berry - 1st-2nd Collection (Export, Ver 2.000)", GAME_FLAGS )
GAME( 2006, lovebero,lovebery, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Love And Berry - 1st-2nd Collection (Export, Ver 1.003)", GAME_FLAGS )
-
GAME( 2009, tetgiant,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Tetris Giant / Tetris Dekaris (Ver.2.000)", GAME_FLAGS )
-
// These use a CF card
-
+GAME( 2006, dinokior,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Dinosaur King - Operation: Dinosaur Rescue (USA, Export) (MDA-C0021)", GAME_FLAGS )
GAME( 2008, dinoki25,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Dinosaur King - D-Team VS. the Alpha Fortress (Export, Ver 2.500) (MDA-C0047)", GAME_FLAGS )
-
GAME( 2007, loveber3,segasp, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Love And Berry - 3rd-5th Collection (USA, Export, Ver 1.002) (MDA-C0042)", GAME_FLAGS )
-
GAME( 2009, tetgiano,tetgiant, segasp, segasp, segasp_state, 0, ROT0, "Sega", "Tetris Giant / Tetris Dekaris (MDA-C0076)", GAME_FLAGS )
diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp
index e9dcb0a487b..b29c391c47a 100644
--- a/src/mame/drivers/seta.cpp
+++ b/src/mame/drivers/seta.cpp
@@ -1731,16 +1731,6 @@ ADDRESS_MAP_END
Caliber 50
***************************************************************************/
-WRITE16_MEMBER(seta_state::calibr50_soundlatch_w)
-{
- if (ACCESSING_BITS_0_7)
- {
- m_soundlatch->write(space, 0, data & 0xff);
- m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- space.device().execute().spin_until_time(attotime::from_usec(50)); // Allow the other cpu to reply
- }
-}
-
static ADDRESS_MAP_START( calibr50_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x000000, 0x09ffff) AM_ROM // ROM
AM_RANGE(0xff0000, 0xffffff) AM_RAM // RAM
@@ -1764,7 +1754,8 @@ static ADDRESS_MAP_START( calibr50_map, AS_PROGRAM, 16, seta_state )
/**/AM_RANGE(0xd00000, 0xd005ff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spriteylow_r16, spriteylow_w16) // Sprites Y
AM_RANGE(0xd00600, 0xd00607) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spritectrl_r16, spritectrl_w16)
AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spritecode_r16, spritecode_w16) // Sprites Code + X + Attr
- AM_RANGE(0xb00000, 0xb00001) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff) AM_WRITE(calibr50_soundlatch_w) // From Sub CPU
+ AM_RANGE(0xb00000, 0xb00001) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff) // From Sub CPU
+ AM_RANGE(0xb00000, 0xb00001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) // To Sub CPU
/**/AM_RANGE(0xc00000, 0xc00001) AM_RAM // ? $4000
ADDRESS_MAP_END
@@ -1840,7 +1831,7 @@ static ADDRESS_MAP_START( usclssic_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0xb40004, 0xb40007) AM_READ(usclssic_trackball_y_r) // TrackBall Y + Buttons
AM_RANGE(0xb4000a, 0xb4000b) AM_WRITE(ipl1_ack_w)
AM_RANGE(0xb40010, 0xb40011) AM_READ_PORT("COINS") // Coins
- AM_RANGE(0xb40010, 0xb40011) AM_WRITE(calibr50_soundlatch_w) // To Sub CPU
+ AM_RANGE(0xb40010, 0xb40011) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff) // To Sub CPU
AM_RANGE(0xb40018, 0xb4001f) AM_READ(usclssic_dsw_r) // 2 DSWs
AM_RANGE(0xb40018, 0xb40019) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0xb80000, 0xb80001) AM_READ(ipl2_ack_r)
@@ -2685,30 +2676,6 @@ ADDRESS_MAP_END
Krazy Bowl
***************************************************************************/
-READ16_MEMBER(seta_state::krzybowl_input_r)
-{
- // analog ports
- int dir1x = m_track1_x->read() & 0xfff;
- int dir1y = m_track1_y->read() & 0xfff;
- int dir2x = m_track2_x->read() & 0xfff;
- int dir2y = m_track2_y->read() & 0xfff;
-
- switch (offset)
- {
- case 0x0/2: return dir1x & 0xff;
- case 0x2/2: return dir1x >> 8;
- case 0x4/2: return dir1y & 0xff;
- case 0x6/2: return dir1y >> 8;
- case 0x8/2: return dir2x & 0xff;
- case 0xa/2: return dir2x >> 8;
- case 0xc/2: return dir2y & 0xff;
- case 0xe/2: return dir2y >> 8;
- default:
- logerror("PC %06X - Read input %02X !\n", space.device().safe_pc(), offset*2);
- return 0;
- }
-}
-
static ADDRESS_MAP_START( krzybowl_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0xf00000, 0xf0ffff) AM_RAM // RAM
@@ -2719,7 +2686,8 @@ static ADDRESS_MAP_START( krzybowl_map, AS_PROGRAM, 16, seta_state )
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins
- AM_RANGE(0x600000, 0x60000f) AM_READ(krzybowl_input_r) // P1
+ AM_RANGE(0x600000, 0x600007) AM_DEVREAD8("upd1", upd4701_device, read_xy, 0x00ff) // P1 trackball
+ AM_RANGE(0x600008, 0x60000f) AM_DEVREAD8("upd2", upd4701_device, read_xy, 0x00ff) // P2 trackball
AM_RANGE(0x8000f0, 0x8000f1) AM_RAM // NVRAM
AM_RANGE(0x800100, 0x8001ff) AM_RAM // NVRAM
AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound
@@ -3511,7 +3479,23 @@ ADDRESS_MAP_END
MACHINE_RESET_MEMBER(seta_state,calibr50)
{
address_space &space = m_maincpu->space(AS_PROGRAM);
- sub_bankswitch_w(space, 0, 0);
+ calibr50_sub_bankswitch_w(space, 0, 0);
+}
+
+WRITE8_MEMBER(seta_state::calibr50_sub_bankswitch_w)
+{
+ // Bits 7-4: BK3-BK0
+ sub_bankswitch_w(space, 0, data);
+
+ // Bit 3: NMICLR
+ if (!BIT(data, 3))
+ m_soundlatch->acknowledge_w(space, 0, 0);
+
+ // Bit 2: IRQCLR
+ if (!BIT(data, 2))
+ m_subcpu->set_input_line(0, CLEAR_LINE);
+
+ // Bit 1: PCMMUTE
}
WRITE8_MEMBER(seta_state::calibr50_soundlatch2_w)
@@ -3523,7 +3507,7 @@ WRITE8_MEMBER(seta_state::calibr50_soundlatch2_w)
static ADDRESS_MAP_START( calibr50_sub_map, AS_PROGRAM, 8, seta_state )
AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE("x1snd", x1_010_device, read ,write) // Sound
AM_RANGE(0x4000, 0x4000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) // From Main CPU
- AM_RANGE(0x4000, 0x4000) AM_WRITE(sub_bankswitch_w) // Bankswitching
+ AM_RANGE(0x4000, 0x4000) AM_WRITE(calibr50_sub_bankswitch_w) // Bankswitching
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") // Banked ROM
AM_RANGE(0xc000, 0xffff) AM_ROM // ROM
AM_RANGE(0xc000, 0xc000) AM_WRITE(calibr50_soundlatch2_w) // To Main CPU
@@ -4985,7 +4969,7 @@ INPUT_PORTS_END
***************************************************************************/
#define KRZYBOWL_TRACKBALL(_dir_, _n_ ) \
- PORT_BIT( 0x0fff, 0x0000, IPT_TRACKBALL_##_dir_ ) PORT_PLAYER(_n_) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_REVERSE
+ PORT_BIT( 0x0fff, 0x0000, IPT_TRACKBALL_##_dir_ ) PORT_PLAYER(_n_) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_REVERSE PORT_RESET
static INPUT_PORTS_START( krzybowl )
PORT_START("P1") //Player 1
@@ -7998,7 +7982,7 @@ static MACHINE_CONFIG_START( usclssic )
MCFG_CPU_ADD("sub", M65C02, 16000000/8) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state, irq0_line_hold) /* NMI caused by main cpu when writing to the sound latch */
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state, irq0_line_assert)
MCFG_MACHINE_RESET_OVERRIDE(seta_state,calibr50)
@@ -8027,6 +8011,8 @@ static MACHINE_CONFIG_START( usclssic )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
+ MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
MCFG_X1_010_ADDRESS(0x1000)
@@ -8053,8 +8039,7 @@ static MACHINE_CONFIG_START( calibr50 )
MCFG_CPU_ADD("sub", M65C02, XTAL_16MHz/8) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(seta_state, irq0_line_hold, 4*60) /* IRQ: 4/frame
- NMI: when the 68k writes the sound latch */
+ MCFG_CPU_PERIODIC_INT_DRIVER(seta_state, irq0_line_assert, 4*60) // IRQ: 4/frame
MCFG_DEVICE_ADD("upd4701", UPD4701A, 0)
MCFG_UPD4701_PORTX("ROT1")
@@ -8084,6 +8069,9 @@ static MACHINE_CONFIG_START( calibr50 )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("sub", INPUT_LINE_NMI))
+ MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
+
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
@@ -8930,6 +8918,14 @@ static MACHINE_CONFIG_START( krzybowl )
MCFG_CPU_PROGRAM_MAP(krzybowl_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
+ MCFG_DEVICE_ADD("upd1", UPD4701A, 0)
+ MCFG_UPD4701_PORTX("TRACK1_X")
+ MCFG_UPD4701_PORTY("TRACK1_Y")
+
+ MCFG_DEVICE_ADD("upd2", UPD4701A, 0)
+ MCFG_UPD4701_PORTX("TRACK2_X")
+ MCFG_UPD4701_PORTY("TRACK2_Y")
+
MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
MCFG_SETA001_SPRITE_GFXBANK_CB(seta_state, setac_gfxbank_callback)
diff --git a/src/mame/drivers/shadfrce.cpp b/src/mame/drivers/shadfrce.cpp
index 9de52d9c4bb..1e12b32a2e0 100644
--- a/src/mame/drivers/shadfrce.cpp
+++ b/src/mame/drivers/shadfrce.cpp
@@ -258,21 +258,12 @@ READ16_MEMBER(shadfrce_state::input_ports_r)
}
-WRITE16_MEMBER(shadfrce_state::sound_brt_w)
+WRITE8_MEMBER(shadfrce_state::screen_brt_w)
{
- if (ACCESSING_BITS_8_15)
- {
- m_soundlatch->write(space, 1, data >> 8);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
- }
- else
- {
- int i;
- double brt = (data & 0xff) / 255.0;
+ double brt = (data & 0xff) / 255.0;
- for (i = 0; i < 0x4000; i++)
- m_palette->set_pen_contrast(i, brt);
- }
+ for (int i = 0; i < 0x4000; i++)
+ m_palette->set_pen_contrast(i, brt);
}
WRITE16_MEMBER(shadfrce_state::irq_ack_w)
@@ -377,7 +368,8 @@ static ADDRESS_MAP_START( shadfrce_map, AS_PROGRAM, 16, shadfrce_state )
AM_RANGE(0x1d0000, 0x1d0005) AM_WRITE(irq_ack_w)
AM_RANGE(0x1d0006, 0x1d0007) AM_WRITE(irq_w)
AM_RANGE(0x1d0008, 0x1d0009) AM_WRITE(scanline_w)
- AM_RANGE(0x1d000c, 0x1d000d) AM_READNOP AM_WRITE(sound_brt_w) /* sound command + screen brightness */
+ AM_RANGE(0x1d000c, 0x1d000d) AM_READNOP AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0xff00)
+ AM_RANGE(0x1d000c, 0x1d000d) AM_WRITE8(screen_brt_w, 0x00ff)
AM_RANGE(0x1d0010, 0x1d0011) AM_WRITENOP /* ?? */
AM_RANGE(0x1d0012, 0x1d0013) AM_WRITENOP /* ?? */
AM_RANGE(0x1d0014, 0x1d0015) AM_WRITENOP /* ?? */
@@ -565,6 +557,7 @@ static MACHINE_CONFIG_START( shadfrce )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/shuuz.cpp b/src/mame/drivers/shuuz.cpp
index dca4dcd5c6d..07e150c8baa 100644
--- a/src/mame/drivers/shuuz.cpp
+++ b/src/mame/drivers/shuuz.cpp
@@ -23,6 +23,7 @@
#include "includes/shuuz.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "sound/okim6295.h"
#include "speaker.h"
@@ -111,8 +112,8 @@ READ16_MEMBER(shuuz_state::special_port0_r)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, shuuz_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
- AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- AM_RANGE(0x101000, 0x101fff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
+ AM_RANGE(0x101000, 0x101fff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x102000, 0x102001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x103000, 0x103003) AM_READ(leta_r)
AM_RANGE(0x105000, 0x105001) AM_READWRITE(special_port0_r, latch_w)
@@ -236,7 +237,8 @@ static MACHINE_CONFIG_START( shuuz )
MCFG_CPU_ADD("maincpu", M68000, ATARI_CLOCK_14MHz/2)
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/simpl156.cpp b/src/mame/drivers/simpl156.cpp
index c5ebeae8d31..b8229342162 100644
--- a/src/mame/drivers/simpl156.cpp
+++ b/src/mame/drivers/simpl156.cpp
@@ -132,6 +132,22 @@ static INPUT_PORTS_START( simpl156 )
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
+static INPUT_PORTS_START( magdrop )
+ PORT_INCLUDE(simpl156)
+
+ PORT_MODIFY("IN1")
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
+ PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_OPTIONAL // not used in gameplay
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_OPTIONAL // not used in gameplay
+INPUT_PORTS_END
+
WRITE32_MEMBER(simpl156_state::simpl156_eeprom_w)
{
@@ -1121,9 +1137,9 @@ DRIVER_INIT_MEMBER(simpl156_state,osman)
GAME( 1994, joemacr, 0, joemacr, simpl156, simpl156_state, joemacr, ROT0, "Data East", "Joe & Mac Returns (World, Version 1.1, 1994.05.27)", MACHINE_SUPPORTS_SAVE ) /* bootleg board with genuine DECO parts */
GAME( 1994, joemacra, joemacr, joemacr, simpl156, simpl156_state, joemacr, ROT0, "Data East", "Joe & Mac Returns (World, Version 1.0, 1994.05.19)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, joemacrj, joemacr, joemacr, simpl156, simpl156_state, joemacr, ROT0, "Data East", "Joe & Mac Returns (Japan, Version 1.2, 1994.06.06)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, chainrec, 0, chainrec, simpl156, simpl156_state, chainrec, ROT0, "Data East", "Chain Reaction (World, Version 2.2, 1995.09.25)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, magdrop, chainrec, magdrop, simpl156, simpl156_state, chainrec, ROT0, "Data East", "Magical Drop (Japan, Version 1.1, 1995.06.21)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, magdropp, chainrec, magdropp, simpl156, simpl156_state, chainrec, ROT0, "Data East", "Magical Drop Plus 1 (Japan, Version 2.1, 1995.09.12)", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, chainrec, 0, chainrec, magdrop, simpl156_state, chainrec, ROT0, "Data East", "Chain Reaction (World, Version 2.2, 1995.09.25)", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, magdrop, chainrec, magdrop, magdrop, simpl156_state, chainrec, ROT0, "Data East", "Magical Drop (Japan, Version 1.1, 1995.06.21)", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, magdropp, chainrec, magdropp, magdrop, simpl156_state, chainrec, ROT0, "Data East", "Magical Drop Plus 1 (Japan, Version 2.1, 1995.09.12)", MACHINE_SUPPORTS_SAVE )
/* Mitchell games running on the DEC-22VO / MT5601-0 PCB */
GAME( 1995, charlien, 0, mitchell156, simpl156, simpl156_state, charlien, ROT0, "Mitchell", "Charlie Ninja" , MACHINE_SUPPORTS_SAVE ) /* language in service mode */
diff --git a/src/mame/drivers/skullxbo.cpp b/src/mame/drivers/skullxbo.cpp
index 227ced02bd7..39924160154 100644
--- a/src/mame/drivers/skullxbo.cpp
+++ b/src/mame/drivers/skullxbo.cpp
@@ -23,6 +23,7 @@
#include "includes/skullxbo.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "speaker.h"
@@ -102,7 +103,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, skullxbo_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0xff0000, 0xff07ff) AM_WRITE(skullxbo_mobmsb_w)
AM_RANGE(0xff0800, 0xff0bff) AM_WRITE(skullxbo_halt_until_hblank_0_w)
- AM_RANGE(0xff0c00, 0xff0fff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0xff0c00, 0xff0fff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0xff1000, 0xff13ff) AM_WRITE(video_int_ack_w)
AM_RANGE(0xff1400, 0xff17ff) AM_DEVWRITE8("jsa", atari_jsa_ii_device, main_command_w, 0x00ff)
AM_RANGE(0xff1800, 0xff1bff) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
@@ -120,7 +121,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, skullxbo_state )
AM_RANGE(0xff5000, 0xff5001) AM_DEVREAD8("jsa", atari_jsa_ii_device, main_response_r, 0x00ff)
AM_RANGE(0xff5800, 0xff5801) AM_READ_PORT("FF5800")
AM_RANGE(0xff5802, 0xff5803) AM_READ_PORT("FF5802")
- AM_RANGE(0xff6000, 0xff6fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0xff6000, 0xff6fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0xff8000, 0xff9fff) AM_RAM_WRITE(playfield_latched_w) AM_SHARE("playfield")
AM_RANGE(0xffa000, 0xffbfff) AM_RAM_DEVWRITE("playfield", tilemap_device, write_ext) AM_SHARE("playfield_ext")
AM_RANGE(0xffc000, 0xffcf7f) AM_RAM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
@@ -234,7 +235,8 @@ static MACHINE_CONFIG_START( skullxbo )
MCFG_TIMER_DRIVER_ADD("scan_timer", skullxbo_state, scanline_timer)
MCFG_MACHINE_RESET_OVERRIDE(skullxbo_state,skullxbo)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/sm7238.cpp b/src/mame/drivers/sm7238.cpp
index d26b6206710..05b9fb1d65b 100644
--- a/src/mame/drivers/sm7238.cpp
+++ b/src/mame/drivers/sm7238.cpp
@@ -360,7 +360,8 @@ static MACHINE_CONFIG_START( sm7238 )
MCFG_PALETTE_INIT_OWNER(sm7238_state, sm7238)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", sm7238)
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
MCFG_DEVICE_ADD("t_hblank", PIT8253, 0)
MCFG_PIT8253_CLK1(XTAL_16_384MHz/9) // XXX workaround -- keyboard is slower and doesn't sync otherwise
diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp
index c97a170c87d..e5e65171cbb 100644
--- a/src/mame/drivers/snowbros.cpp
+++ b/src/mame/drivers/snowbros.cpp
@@ -182,29 +182,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
}
-
-/* Sound Routines */
-
-READ16_MEMBER(snowbros_state::snowbros_68000_sound_r)
-{
- return m_soundlatch->read(space,offset);
-}
-
-
-WRITE16_MEMBER(snowbros_state::snowbros_68000_sound_w)
-{
- if (ACCESSING_BITS_0_7)
- {
- m_soundlatch->write(space, offset, data & 0xff);
- m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- }
-}
-
-WRITE16_MEMBER(snowbros_state::semicom_soundcmd_w)
-{
- if (ACCESSING_BITS_0_7) m_soundlatch->write(space,0,data & 0xff);
-}
-
READ16_MEMBER(snowbros_state::toto_read)
{
int pc = space.device().safe_pc();
@@ -218,7 +195,8 @@ static ADDRESS_MAP_START( snowbros_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM
AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,snowbros_68000_sound_w)
+ AM_RANGE(0x300000, 0x300001) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff)
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x400000, 0x400001) AM_WRITE8(snowbros_flipscreen_w, 0xff00)
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
@@ -238,7 +216,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, snowbros_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write)
- AM_RANGE(0x04, 0x04) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write) /* goes back to the main CPU, checked during boot */
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x04, 0x04) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write) // goes back to the main CPU, checked during boot
ADDRESS_MAP_END
@@ -300,7 +279,8 @@ static ADDRESS_MAP_START( wintbob_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM
AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,snowbros_68000_sound_w)
+ AM_RANGE(0x300000, 0x300001) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff)
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x400000, 0x400001) AM_WRITE8(bootleg_flipscreen_w, 0xff00)
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
@@ -318,7 +298,7 @@ static ADDRESS_MAP_START( honeydol_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("hyperpac_ram")
AM_RANGE(0x200000, 0x200001) AM_WRITENOP /* ? */
- AM_RANGE(0x300000, 0x300001) AM_WRITE(snowbros_68000_sound_w) /* ? */
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x400000, 0x400001) AM_WRITE(snowbros_irq4_ack_w) /* IRQ 4 acknowledge */
AM_RANGE(0x500000, 0x500001) AM_WRITE(snowbros_irq3_ack_w) /* IRQ 3 acknowledge */
AM_RANGE(0x600000, 0x600001) AM_WRITE(snowbros_irq2_ack_w) /* IRQ 2 acknowledge */
@@ -339,25 +319,18 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( honeydol_sound_io_map, AS_IO, 8, snowbros_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) // not connected?
- AM_RANGE(0x04, 0x04) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write) /* goes back to the main CPU, checked during boot */
+ AM_RANGE(0x04, 0x04) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x04, 0x04) AM_WRITENOP // still written but never actually read by the main CPU
ADDRESS_MAP_END
/* Twin Adventure */
-WRITE16_MEMBER(snowbros_state::twinadv_68000_sound_w)
-{
- if (ACCESSING_BITS_0_7)
- {
- m_soundlatch->write(space, offset, data & 0xff);
- m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- }
-}
-
static ADDRESS_MAP_START( twinadv_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_RAM
AM_RANGE(0x200000, 0x200001) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0x300000, 0x300001) AM_READWRITE(snowbros_68000_sound_r,twinadv_68000_sound_w)
+ AM_RANGE(0x300000, 0x300001) AM_DEVREAD8("soundlatch2", generic_latch_8_device, read, 0x00ff)
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x400000, 0x400001) AM_WRITE8(bootleg_flipscreen_w, 0xff00)
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
@@ -381,7 +354,8 @@ WRITE8_MEMBER(snowbros_state::twinadv_oki_bank_w)
static ADDRESS_MAP_START( twinadv_sound_io_map, AS_IO, 8, snowbros_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("soundlatch", generic_latch_8_device, read, write) // back to 68k?
+ AM_RANGE(0x02, 0x02) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
+ AM_RANGE(0x02, 0x02) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write) // back to 68k?
AM_RANGE(0x04, 0x04) AM_WRITE(twinadv_oki_bank_w) // oki bank?
AM_RANGE(0x06, 0x06) AM_DEVREADWRITE("oki", okim6295_device, read, write)
ADDRESS_MAP_END
@@ -397,7 +371,7 @@ sound hardware is also different
static ADDRESS_MAP_START( hyperpac_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("hyperpac_ram")
- AM_RANGE(0x300000, 0x300001) AM_WRITE(semicom_soundcmd_w)
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
// AM_RANGE(0x400000, 0x400001) ???
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW2")
@@ -418,10 +392,6 @@ static ADDRESS_MAP_START( hyperpac_sound_map, AS_PROGRAM, 8, snowbros_state )
AM_RANGE(0xf008, 0xf008) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
ADDRESS_MAP_END
-static ADDRESS_MAP_START( hyperpac_sound_io_map, AS_IO, 8, snowbros_state )
- ADDRESS_MAP_GLOBAL_MASK(0xff)
-ADDRESS_MAP_END
-
/* Same volume used for all samples at the Moment, could be right, we have no
way of knowing .. */
READ16_MEMBER(snowbros_state::sb3_sound_r)
@@ -551,7 +521,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( finalttr_map, AS_PROGRAM, 16, snowbros_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM AM_SHARE("hyperpac_ram")
- AM_RANGE(0x300000, 0x300001) AM_WRITE(semicom_soundcmd_w)
+ AM_RANGE(0x300000, 0x300001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
// AM_RANGE(0x400000, 0x400001) ???
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW1")
@@ -1801,6 +1771,9 @@ static MACHINE_CONFIG_START( snowbros )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3 MHz - confirmed */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -1835,10 +1808,15 @@ static MACHINE_CONFIG_DERIVED( semicom, snowbros )
MCFG_CPU_MODIFY("soundcpu")
MCFG_CPU_CLOCK(XTAL_16MHz/4) /* 4MHz - Confirmed */
MCFG_CPU_PROGRAM_MAP(hyperpac_sound_map)
- MCFG_CPU_IO_MAP(hyperpac_sound_io_map)
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_IO)
MCFG_GFXDECODE_MODIFY("gfxdecode", hyperpac)
+ MCFG_DEVICE_MODIFY("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(NOOP)
+
+ MCFG_DEVICE_REMOVE("soundlatch2")
+
/* sound hardware */
MCFG_SOUND_REPLACE("ymsnd", YM2151, XTAL_16MHz/4) /* 4MHz - Confirmed */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -1893,6 +1871,7 @@ static MACHINE_CONFIG_START( honeydol )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3Mhz */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
@@ -1933,6 +1912,9 @@ static MACHINE_CONFIG_START( twinadv )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", INPUT_LINE_NMI))
+
+ MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
/* sound hardware */
MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, PIN7_HIGH) /* freq? */
diff --git a/src/mame/drivers/spartanxtec.cpp b/src/mame/drivers/spartanxtec.cpp
index 857fbfd1cc9..d118c30ae5b 100644
--- a/src/mame/drivers/spartanxtec.cpp
+++ b/src/mame/drivers/spartanxtec.cpp
@@ -65,7 +65,6 @@ public:
tilemap_t* m_bg_tilemap;
DECLARE_WRITE8_MEMBER(kungfum_tileram_w);
TILE_GET_INFO_MEMBER(get_kungfum_bg_tile_info);
- DECLARE_WRITE8_MEMBER(spartanxtec_soundlatch_w);
DECLARE_WRITE8_MEMBER(a801_w);
DECLARE_WRITE8_MEMBER(sound_irq_ack);
DECLARE_WRITE8_MEMBER(irq_ack);
@@ -163,12 +162,6 @@ uint32_t spartanxtec_state::screen_update_spartanxtec(screen_device &screen, bit
-WRITE8_MEMBER(spartanxtec_state::spartanxtec_soundlatch_w)
-{
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
-}
-
WRITE8_MEMBER(spartanxtec_state::a801_w)
{
if (data != 0xf0) printf("a801_w %02x\n", data);
@@ -184,7 +177,7 @@ static ADDRESS_MAP_START( spartanxtec_map, AS_PROGRAM, 8, spartanxtec_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x8000, 0x8000) AM_WRITE(spartanxtec_soundlatch_w)
+ AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0x8100, 0x8100) AM_READ_PORT("DSW1")
AM_RANGE(0x8101, 0x8101) AM_READ_PORT("DSW2")
@@ -388,6 +381,7 @@ static MACHINE_CONFIG_START( spartanxtec )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ay1", AY8912, 1000000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/spbactn.cpp b/src/mame/drivers/spbactn.cpp
index cdee5222e70..c07da26c7a0 100644
--- a/src/mame/drivers/spbactn.cpp
+++ b/src/mame/drivers/spbactn.cpp
@@ -141,15 +141,6 @@ cpu #0 (PC=00001A1A): unmapped memory word write to 00090030 = 00F7 & 00FF
#include "speaker.h"
-WRITE16_MEMBER(spbactn_state::soundcommand_w)
-{
- if (ACCESSING_BITS_0_7)
- {
- m_soundlatch->write(space, offset, data & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- }
-}
-
static ADDRESS_MAP_START( spbactn_map, AS_PROGRAM, 16, spbactn_state )
AM_RANGE(0x00000, 0x3ffff) AM_ROM
AM_RANGE(0x40000, 0x43fff) AM_RAM // main ram
@@ -165,8 +156,8 @@ static ADDRESS_MAP_START( spbactn_map, AS_PROGRAM, 16, spbactn_state )
/* this are an awful lot of unknowns */
AM_RANGE(0x90000, 0x90001) AM_WRITENOP
- AM_RANGE(0x90010, 0x90011) AM_WRITE(soundcommand_w)
-// AM_RANGE(0x90020, 0x90021) AM_WRITE(soundcommand_w)
+ AM_RANGE(0x90010, 0x90011) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
+// AM_RANGE(0x90020, 0x90021) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x90030, 0x90031) AM_WRITENOP
AM_RANGE(0x90080, 0x90081) AM_WRITENOP
@@ -441,6 +432,7 @@ static MACHINE_CONFIG_START( spbactn )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* Was 3.579545MHz, a common clock, but no way to generate via on PCB OSCs */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
@@ -494,6 +486,7 @@ static MACHINE_CONFIG_START( spbactnp )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/spyhuntertec.cpp b/src/mame/drivers/spyhuntertec.cpp
index 1327023a24b..8a417b408b5 100644
--- a/src/mame/drivers/spyhuntertec.cpp
+++ b/src/mame/drivers/spyhuntertec.cpp
@@ -83,7 +83,6 @@ public:
// DECLARE_VIDEO_START(spyhuntertec);
// uint32_t screen_update_spyhuntertec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER(spyhuntertec_port04_w);
- DECLARE_WRITE8_MEMBER(spyhuntertec_fd00_w);
DECLARE_WRITE8_MEMBER(spyhuntertec_portf0_w);
DECLARE_WRITE8_MEMBER(spyhunt_videoram_w);
@@ -337,16 +336,9 @@ uint32_t spyhuntertec_state::screen_update_spyhuntertec(screen_device &screen, b
-WRITE8_MEMBER(spyhuntertec_state::spyhuntertec_fd00_w)
-{
-// printf("%04x spyhuntertec_fd00_w %02x\n", space.device().safe_pc(), data);
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
-}
-
READ8_MEMBER(spyhuntertec_state::spyhuntertec_in2_r)
{
- // it writes 04 / 14 to the sound latch (spyhuntertec_fd00_w) before
+ // it writes 04 / 14 to the sound latch (at FD00) before
// reading bit 6 here a minimum of 32 times.
// seems to be how it reads the analog controls? probably via sound CPU??
@@ -444,7 +436,7 @@ static ADDRESS_MAP_START( spyhuntertec_map, AS_PROGRAM, 8, spyhuntertec_state )
AM_RANGE(0xfc02, 0xfc02) AM_READ(spyhuntertec_in2_r)
AM_RANGE(0xfc03, 0xfc03) AM_READ(spyhuntertec_in3_r)
- AM_RANGE(0xfd00, 0xfd00) AM_WRITE( spyhuntertec_fd00_w )
+ AM_RANGE(0xfd00, 0xfd00) AM_DEVWRITE("soundlatch", generic_latch_8_device, write)
AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE("spriteram2") // actual spriteram for this hw??
ADDRESS_MAP_END
@@ -701,6 +693,7 @@ static MACHINE_CONFIG_START( spyhuntertec )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ay1", AY8912, 3000000/2) // AY-3-8912
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
diff --git a/src/mame/drivers/sshangha.cpp b/src/mame/drivers/sshangha.cpp
index f6c3c2990d0..cf3769b8aa9 100644
--- a/src/mame/drivers/sshangha.cpp
+++ b/src/mame/drivers/sshangha.cpp
@@ -425,6 +425,9 @@ static MACHINE_CONFIG_START( sshangha )
MCFG_DECO_SPRITE_GFXDECODE("gfxdecode")
MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS"))
+ MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM"))
+ MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW"))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") /* sure it's stereo? */
diff --git a/src/mame/drivers/starwars.cpp b/src/mame/drivers/starwars.cpp
index c0cf987ad89..67ce17a2358 100644
--- a/src/mame/drivers/starwars.cpp
+++ b/src/mame/drivers/starwars.cpp
@@ -362,9 +362,11 @@ static MACHINE_CONFIG_START( starwars )
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_GENERIC_LATCH_DATA_PENDING_CB(DEVWRITELINE("riot", riot6532_device, pa7_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(starwars_state, boost_interleave_hack))
MCFG_GENERIC_LATCH_8_ADD("mainlatch")
MCFG_GENERIC_LATCH_DATA_PENDING_CB(DEVWRITELINE("riot", riot6532_device, pa6_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(starwars_state, boost_interleave_hack))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/sub.cpp b/src/mame/drivers/sub.cpp
index a43d54e3354..c03cf9d2685 100644
--- a/src/mame/drivers/sub.cpp
+++ b/src/mame/drivers/sub.cpp
@@ -110,7 +110,9 @@ PCB2 (Top board, CPU board)
#include "emu.h"
#include "cpu/z80/z80.h"
+#include "machine/74259.h"
#include "machine/gen_latch.h"
+#include "machine/watchdog.h"
#include "sound/ay8910.h"
#include "screen.h"
#include "speaker.h"
@@ -145,20 +147,23 @@ public:
required_shared_ptr<uint8_t> m_spriteram2;
required_shared_ptr<uint8_t> m_scrolly;
- uint8_t m_nmi_en;
+ bool m_int_en;
+ bool m_nmi_en;
- DECLARE_WRITE8_MEMBER(to_sound_w);
+ DECLARE_WRITE_LINE_MEMBER(int_mask_w);
DECLARE_WRITE8_MEMBER(nmi_mask_w);
virtual void machine_start() override;
DECLARE_PALETTE_INIT(sub);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(main_irq);
INTERRUPT_GEN_MEMBER(sound_irq);
};
void sub_state::machine_start()
{
+ save_item(NAME(m_int_en));
save_item(NAME(m_nmi_en));
}
@@ -244,6 +249,13 @@ uint32_t sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
return 0;
}
+WRITE_LINE_MEMBER(sub_state::int_mask_w)
+{
+ m_int_en = state;
+ if (!m_int_en)
+ m_maincpu->set_input_line(0, CLEAR_LINE);
+}
+
static ADDRESS_MAP_START( subm_map, AS_PROGRAM, 8, sub_state )
AM_RANGE(0x0000, 0xafff) AM_ROM
AM_RANGE(0xb000, 0xbfff) AM_RAM
@@ -253,12 +265,8 @@ static ADDRESS_MAP_START( subm_map, AS_PROGRAM, 8, sub_state )
AM_RANGE(0xd800, 0xd83f) AM_RAM AM_SHARE("spriteram2")
AM_RANGE(0xd840, 0xd85f) AM_RAM AM_SHARE("scrolly")
- AM_RANGE(0xe000, 0xe000) AM_NOP
- AM_RANGE(0xe800, 0xe800) AM_NOP
- AM_RANGE(0xe801, 0xe801) AM_NOP
- AM_RANGE(0xe802, 0xe802) AM_NOP
- AM_RANGE(0xe803, 0xe803) AM_NOP
- AM_RANGE(0xe805, 0xe805) AM_NOP
+ AM_RANGE(0xe000, 0xe000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
+ AM_RANGE(0xe800, 0xe807) AM_DEVWRITE("mainlatch", ls259_device, write_d0)
AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSW0") // DSW0?
AM_RANGE(0xf020, 0xf020) AM_READ_PORT("DSW1") // DSW1?
@@ -266,20 +274,16 @@ static ADDRESS_MAP_START( subm_map, AS_PROGRAM, 8, sub_state )
AM_RANGE(0xf060, 0xf060) AM_READ_PORT("IN0")
ADDRESS_MAP_END
-WRITE8_MEMBER(sub_state::to_sound_w)
-{
- m_soundlatch->write(space, 0, data & 0xff);
- m_soundcpu->set_input_line(0, HOLD_LINE);
-}
-
WRITE8_MEMBER(sub_state::nmi_mask_w)
{
m_nmi_en = data & 1;
+ if (!m_nmi_en)
+ m_soundcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
static ADDRESS_MAP_START( subm_io, AS_IO, 8, sub_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_WRITE(to_sound_w) // to/from sound CPU
+ AM_RANGE(0x00, 0x00) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // to/from sound CPU
ADDRESS_MAP_END
static ADDRESS_MAP_START( subm_sound_map, AS_PROGRAM, 8, sub_state )
@@ -436,10 +440,16 @@ PALETTE_INIT_MEMBER(sub_state, sub)
}
+INTERRUPT_GEN_MEMBER(sub_state::main_irq)
+{
+ if (m_int_en)
+ m_maincpu->set_input_line(0, ASSERT_LINE);
+}
+
INTERRUPT_GEN_MEMBER(sub_state::sound_irq)
{
- if(m_nmi_en)
- m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_nmi_en)
+ m_soundcpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
}
static MACHINE_CONFIG_START( sub )
@@ -448,13 +458,20 @@ static MACHINE_CONFIG_START( sub )
MCFG_CPU_ADD("maincpu", Z80,MASTER_CLOCK/6) /* ? MHz */
MCFG_CPU_PROGRAM_MAP(subm_map)
MCFG_CPU_IO_MAP(subm_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", sub_state, irq0_line_hold)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", sub_state, main_irq)
MCFG_CPU_ADD("soundcpu", Z80,MASTER_CLOCK/6) /* ? MHz */
MCFG_CPU_PROGRAM_MAP(subm_sound_map)
MCFG_CPU_IO_MAP(subm_sound_io)
MCFG_CPU_PERIODIC_INT_DRIVER(sub_state, sound_irq, 120) //???
+ MCFG_DEVICE_ADD("mainlatch", LS259, 0)
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(sub_state, int_mask_w))
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(NOOP)
+ MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(NOOP) // same as Q0?
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(NOOP)
+
+ MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -474,6 +491,8 @@ static MACHINE_CONFIG_START( sub )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("soundcpu", 0))
+
MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
MCFG_SOUND_ADD("ay1", AY8910, MASTER_CLOCK/6/2) /* ? Mhz */
diff --git a/src/mame/drivers/superslave.cpp b/src/mame/drivers/superslave.cpp
index 0800db8f20a..e47d166cbc6 100644
--- a/src/mame/drivers/superslave.cpp
+++ b/src/mame/drivers/superslave.cpp
@@ -333,7 +333,8 @@ static MACHINE_CONFIG_START( superslave )
MCFG_Z80_DAISY_CHAIN(superslave_daisy_chain)
// devices
- MCFG_PIC8259_ADD(AM9519_TAG, INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+ MCFG_DEVICE_ADD(AM9519_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL_8MHz/2)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
diff --git a/src/mame/drivers/taito_h.cpp b/src/mame/drivers/taito_h.cpp
index a988bf54203..ec05e8450d3 100644
--- a/src/mame/drivers/taito_h.cpp
+++ b/src/mame/drivers/taito_h.cpp
@@ -851,7 +851,75 @@ ROM_START( syvalion )
ROM_LOAD( "b51-17.bin", 0x00000, 0x80000, CRC(d85096aa) SHA1(dac39ed182e9eda06575f1667c4c1ff9a4a56599) )
ROM_END
+ROM_START( syvalionu )
+ ROM_REGION( 0x80000, "maincpu", 0 ) /* main cpu */
+ ROM_LOAD16_BYTE( "eng-20.bin", 0x00000, 0x20000, CRC(6c1db526) SHA1(663560d52aa85cd589eeecc58f9ce521f4a2f58e) )
+ ROM_LOAD16_BYTE( "eng-22.bin", 0x00001, 0x20000, CRC(d386b5dd) SHA1(b4b2ad65d972bee7cc47dd071fe76eb43f4f2fb4) )
+ ROM_LOAD16_BYTE( "eng-19.bin", 0x40000, 0x20000, CRC(57fa3905) SHA1(2738f15b78cf630448a100e21a9eba69e1152c01) )
+ ROM_LOAD16_BYTE( "usa-21.bin", 0x40001, 0x20000, CRC(ed27edf7) SHA1(9dc2a0b88c492d18ef78cd57bd273318ca76aaa3) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */
+ ROM_LOAD( "b51-23.bin", 0x00000, 0x10000, CRC(734662de) SHA1(0058d6de68f26cd58b9eb8859e15f3ced6bd3489) )
+
+ ROM_REGION( 0x400000, "gfx1", 0 )
+ ROM_LOAD16_BYTE( "b51-16.bin", 0x000000, 0x20000, CRC(c0fcf7a5) SHA1(4550ba6d822ba12ad39576bcbed09b5fa54279e8) )
+ ROM_LOAD16_BYTE( "b51-12.bin", 0x000001, 0x20000, CRC(6b36d358) SHA1(4101c110e99fe2ac1a989c84857f6438439b79a1) )
+ ROM_LOAD16_BYTE( "b51-15.bin", 0x040000, 0x20000, CRC(30b2ee02) SHA1(eacd179c8760ce9ba01e234dfd3f159773e4f2ab) )
+ ROM_LOAD16_BYTE( "b51-11.bin", 0x040001, 0x20000, CRC(ae9a9ac5) SHA1(f1f5216e51fea3173f5317e0dda404a29b2c45fe) )
+ ROM_LOAD16_BYTE( "b51-08.bin", 0x100000, 0x20000, CRC(9f6a535c) SHA1(40d52d3f572dd87b41d89707a2ec189760d806b0) )
+ ROM_LOAD16_BYTE( "b51-04.bin", 0x100001, 0x20000, CRC(03aea658) SHA1(439f08948e57c9a0f450d1319e3bc99c6fd4f82d) )
+ ROM_LOAD16_BYTE( "b51-07.bin", 0x140000, 0x20000, CRC(764d4dc8) SHA1(700de70134ade3901dad51d4bf14d91f92bc5381) )
+ ROM_LOAD16_BYTE( "b51-03.bin", 0x140001, 0x20000, CRC(8fd9b299) SHA1(3dc2a66678dfa13f2264bb4f5ca8a31477cc59ff) )
+ ROM_LOAD16_BYTE( "b51-14.bin", 0x200000, 0x20000, CRC(dea7216e) SHA1(b97d08b24a3dd9b061ef118fd6d8b3edfa3a3008) )
+ ROM_LOAD16_BYTE( "b51-10.bin", 0x200001, 0x20000, CRC(6aa97fbc) SHA1(d546dd5a276cce36e879bb7bfabbdd63d36c0f72) )
+ ROM_LOAD16_BYTE( "b51-13.bin", 0x240000, 0x20000, CRC(dab28958) SHA1(da7e7fdd1d1e5a4d72b5e7df235fc304f77fa2c9) )
+ ROM_LOAD16_BYTE( "b51-09.bin", 0x240001, 0x20000, CRC(cbb4f33d) SHA1(6c6560603f7fd5578a866b11031d8480bc4a9eee) )
+ ROM_LOAD16_BYTE( "b51-06.bin", 0x300000, 0x20000, CRC(81bef4f0) SHA1(83b3a762b6df6f6ca193e639116345a20f874636) )
+ ROM_LOAD16_BYTE( "b51-02.bin", 0x300001, 0x20000, CRC(906ba440) SHA1(9a1a147caf7eac534e739b8ad60f0c71514a64c7) )
+ ROM_LOAD16_BYTE( "b51-05.bin", 0x340000, 0x20000, CRC(47976ae9) SHA1(a2b19a39d8968b886412a85c082806917e02d9fd) )
+ ROM_LOAD16_BYTE( "b51-01.bin", 0x340001, 0x20000, CRC(8dab004a) SHA1(1772cdcb9d0ca5ebf429f371c041b9ae12fafcd0) )
+
+ ROM_REGION( 0x80000, "ymsnd.deltat", 0 ) /* samples */
+ ROM_LOAD( "b51-18.bin", 0x00000, 0x80000, CRC(8b23ac83) SHA1(340b9e7f09c1809a332b41d3fb579f5f8cd6367f) )
+
+ ROM_REGION( 0x80000, "ymsnd", 0 ) /* samples */
+ ROM_LOAD( "b51-17.bin", 0x00000, 0x80000, CRC(d85096aa) SHA1(dac39ed182e9eda06575f1667c4c1ff9a4a56599) )
+ROM_END
+ROM_START( syvalionw )
+ ROM_REGION( 0x80000, "maincpu", 0 ) /* main cpu */
+ ROM_LOAD16_BYTE( "eng-20.bin", 0x00000, 0x20000, CRC(6c1db526) SHA1(663560d52aa85cd589eeecc58f9ce521f4a2f58e) )
+ ROM_LOAD16_BYTE( "eng-22.bin", 0x00001, 0x20000, CRC(d386b5dd) SHA1(b4b2ad65d972bee7cc47dd071fe76eb43f4f2fb4) )
+ ROM_LOAD16_BYTE( "eng-19.bin", 0x40000, 0x20000, CRC(57fa3905) SHA1(2738f15b78cf630448a100e21a9eba69e1152c01) )
+ ROM_LOAD16_BYTE( "eur-21.bin", 0x40001, 0x20000, CRC(742ebc4d) SHA1(4c2a968febe0473dd47ac2b9d7eb2c049e743254) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */
+ ROM_LOAD( "b51-23.bin", 0x00000, 0x10000, CRC(734662de) SHA1(0058d6de68f26cd58b9eb8859e15f3ced6bd3489) )
+
+ ROM_REGION( 0x400000, "gfx1", 0 )
+ ROM_LOAD16_BYTE( "b51-16.bin", 0x000000, 0x20000, CRC(c0fcf7a5) SHA1(4550ba6d822ba12ad39576bcbed09b5fa54279e8) )
+ ROM_LOAD16_BYTE( "b51-12.bin", 0x000001, 0x20000, CRC(6b36d358) SHA1(4101c110e99fe2ac1a989c84857f6438439b79a1) )
+ ROM_LOAD16_BYTE( "b51-15.bin", 0x040000, 0x20000, CRC(30b2ee02) SHA1(eacd179c8760ce9ba01e234dfd3f159773e4f2ab) )
+ ROM_LOAD16_BYTE( "b51-11.bin", 0x040001, 0x20000, CRC(ae9a9ac5) SHA1(f1f5216e51fea3173f5317e0dda404a29b2c45fe) )
+ ROM_LOAD16_BYTE( "b51-08.bin", 0x100000, 0x20000, CRC(9f6a535c) SHA1(40d52d3f572dd87b41d89707a2ec189760d806b0) )
+ ROM_LOAD16_BYTE( "b51-04.bin", 0x100001, 0x20000, CRC(03aea658) SHA1(439f08948e57c9a0f450d1319e3bc99c6fd4f82d) )
+ ROM_LOAD16_BYTE( "b51-07.bin", 0x140000, 0x20000, CRC(764d4dc8) SHA1(700de70134ade3901dad51d4bf14d91f92bc5381) )
+ ROM_LOAD16_BYTE( "b51-03.bin", 0x140001, 0x20000, CRC(8fd9b299) SHA1(3dc2a66678dfa13f2264bb4f5ca8a31477cc59ff) )
+ ROM_LOAD16_BYTE( "b51-14.bin", 0x200000, 0x20000, CRC(dea7216e) SHA1(b97d08b24a3dd9b061ef118fd6d8b3edfa3a3008) )
+ ROM_LOAD16_BYTE( "b51-10.bin", 0x200001, 0x20000, CRC(6aa97fbc) SHA1(d546dd5a276cce36e879bb7bfabbdd63d36c0f72) )
+ ROM_LOAD16_BYTE( "b51-13.bin", 0x240000, 0x20000, CRC(dab28958) SHA1(da7e7fdd1d1e5a4d72b5e7df235fc304f77fa2c9) )
+ ROM_LOAD16_BYTE( "b51-09.bin", 0x240001, 0x20000, CRC(cbb4f33d) SHA1(6c6560603f7fd5578a866b11031d8480bc4a9eee) )
+ ROM_LOAD16_BYTE( "b51-06.bin", 0x300000, 0x20000, CRC(81bef4f0) SHA1(83b3a762b6df6f6ca193e639116345a20f874636) )
+ ROM_LOAD16_BYTE( "b51-02.bin", 0x300001, 0x20000, CRC(906ba440) SHA1(9a1a147caf7eac534e739b8ad60f0c71514a64c7) )
+ ROM_LOAD16_BYTE( "b51-05.bin", 0x340000, 0x20000, CRC(47976ae9) SHA1(a2b19a39d8968b886412a85c082806917e02d9fd) )
+ ROM_LOAD16_BYTE( "b51-01.bin", 0x340001, 0x20000, CRC(8dab004a) SHA1(1772cdcb9d0ca5ebf429f371c041b9ae12fafcd0) )
+
+ ROM_REGION( 0x80000, "ymsnd.deltat", 0 ) /* samples */
+ ROM_LOAD( "b51-18.bin", 0x00000, 0x80000, CRC(8b23ac83) SHA1(340b9e7f09c1809a332b41d3fb579f5f8cd6367f) )
+
+ ROM_REGION( 0x80000, "ymsnd", 0 ) /* samples */
+ ROM_LOAD( "b51-17.bin", 0x00000, 0x80000, CRC(d85096aa) SHA1(dac39ed182e9eda06575f1667c4c1ff9a4a56599) )
+ROM_END
ROM_START( syvalionp )
ROM_REGION( 0x80000, "maincpu", 0 ) /* main cpu */
@@ -1052,11 +1120,13 @@ ROM_START( dleaguej )
ROM_END
-// YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME FLAGS
-GAME( 1988, syvalion, 0, syvalion, syvalion, taitoh_state, 0, ROT0, "Taito Corporation", "Syvalion (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, syvalionp, syvalion, syvalion, syvalionp, taitoh_state, 0, ROT0, "Taito Corporation", "Syvalion (World, prototype)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, recordbr, 0, recordbr, recordbr, taitoh_state, 0, ROT0, "Taito Corporation Japan", "Recordbreaker (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, gogold, recordbr, recordbr, gogold, taitoh_state, 0, ROT0, "Taito Corporation", "Go For The Gold (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, tetristh, tetris, tetristh, tetristh, taitoh_state, 0, ROT0, "Sega", "Tetris (Japan, Taito H-System)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, dleague, 0, dleague, dleague, taitoh_state, 0, ROT0, "Taito America Corporation", "Dynamite League (US)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, dleaguej, dleague, dleague, dleaguej, taitoh_state, 0, ROT0, "Taito Corporation", "Dynamite League (Japan)", MACHINE_SUPPORTS_SAVE )
+// YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME FLAGS
+GAME( 1988, syvalion, 0, syvalion, syvalion, taitoh_state, 0, ROT0, "Taito Corporation", "Syvalion (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, syvalionp, syvalion, syvalion, syvalionp, taitoh_state, 0, ROT0, "Taito Corporation", "Syvalion (World, prototype)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, syvalionu, syvalion, syvalion, syvalion, taitoh_state, 0, ROT0, "Taito America Corporation", "Syvalion (US, PS2 Taito Legends 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, syvalionw, syvalion, syvalion, syvalion, taitoh_state, 0, ROT0, "Taito Corporation Japan", "Syvalion (World, PS2 Taito Legends 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, recordbr, 0, recordbr, recordbr, taitoh_state, 0, ROT0, "Taito Corporation Japan", "Recordbreaker (World)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, gogold, recordbr, recordbr, gogold, taitoh_state, 0, ROT0, "Taito Corporation", "Go For The Gold (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, tetristh, tetris, tetristh, tetristh, taitoh_state, 0, ROT0, "Sega", "Tetris (Japan, Taito H-System)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, dleague, 0, dleague, dleague, taitoh_state, 0, ROT0, "Taito America Corporation", "Dynamite League (US)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, dleaguej, dleague, dleague, dleaguej, taitoh_state, 0, ROT0, "Taito Corporation", "Dynamite League (Japan)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp
index b29e3dd5d3c..d3db46e4a63 100644
--- a/src/mame/drivers/taitosj.cpp
+++ b/src/mame/drivers/taitosj.cpp
@@ -175,21 +175,13 @@ TODO:
WRITE8_MEMBER(taitosj_state::taitosj_sndnmi_msk_w)
{
- m_sndnmi_disable = (data & 1);
- if ((m_sound_cmd_written && (!m_sndnmi_disable)) || m_sound_semaphore)
- m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- else
- m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ /* B0 is the sound nmi enable, active low */
+ m_soundnmi->in_w<0>((~data)&1);
}
-WRITE8_MEMBER(taitosj_state::sound_command_w)
+WRITE8_MEMBER(taitosj_state::soundlatch_w)
{
- m_sound_cmd_written = true;
- m_soundlatch->write(space,0,data);
- if ((m_sound_cmd_written && (!m_sndnmi_disable)) || m_sound_semaphore)
- m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- else
- m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::soundlatch_w_cb), this), data);
}
@@ -199,13 +191,9 @@ WRITE8_MEMBER(taitosj_state::input_port_4_f0_w)
}
// EPORT2
-WRITE8_MEMBER(taitosj_state::sound_semaphore_w)
+WRITE8_MEMBER(taitosj_state::sound_semaphore2_w)
{
- m_sound_semaphore = (data & 1);
- if ((m_sound_cmd_written && (!m_sndnmi_disable)) || m_sound_semaphore)
- m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- else
- m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::sound_semaphore2_w_cb), this), data);
}
CUSTOM_INPUT_MEMBER(taitosj_state::input_port_4_f0_r)
@@ -243,8 +231,8 @@ static ADDRESS_MAP_START( taitosj_main_nomcu_map, AS_PROGRAM, 8, taitosj_state )
AM_RANGE(0xd506, 0xd507) AM_MIRROR(0x00f0) AM_WRITEONLY AM_SHARE("colorbank")
AM_RANGE(0xd508, 0xd508) AM_MIRROR(0x00f0) AM_WRITE(taitosj_collision_reg_clear_w)
AM_RANGE(0xd509, 0xd50a) AM_MIRROR(0x00f0) AM_WRITEONLY AM_SHARE("gfxpointer")
- AM_RANGE(0xd50b, 0xd50b) AM_MIRROR(0x00f0) AM_WRITE(sound_command_w)
- AM_RANGE(0xd50c, 0xd50c) AM_MIRROR(0x00f0) AM_WRITE(sound_semaphore_w)
+ AM_RANGE(0xd50b, 0xd50b) AM_MIRROR(0x00f0) AM_WRITE(soundlatch_w)
+ AM_RANGE(0xd50c, 0xd50c) AM_MIRROR(0x00f0) AM_WRITE(sound_semaphore2_w)
AM_RANGE(0xd50d, 0xd50d) AM_MIRROR(0x00f0) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd50e, 0xd50e) AM_MIRROR(0x00f0) AM_WRITE(taitosj_bankswitch_w)
AM_RANGE(0xd50f, 0xd50f) AM_MIRROR(0x00f0) AM_WRITENOP
@@ -313,8 +301,8 @@ static ADDRESS_MAP_START( kikstart_main_map, AS_PROGRAM, 8, taitosj_state )
AM_RANGE(0xd40f, 0xd40f) AM_DEVREAD("ay1", ay8910_device, data_r) /* DSW2 and DSW3 */
AM_RANGE(0xd508, 0xd508) AM_WRITE(taitosj_collision_reg_clear_w)
AM_RANGE(0xd509, 0xd50a) AM_WRITEONLY AM_SHARE("gfxpointer")
- AM_RANGE(0xd50b, 0xd50b) AM_WRITE(sound_command_w)
- AM_RANGE(0xd50c, 0xd50c) AM_WRITE(sound_semaphore_w)
+ AM_RANGE(0xd50b, 0xd50b) AM_WRITE(soundlatch_w)
+ AM_RANGE(0xd50c, 0xd50c) AM_WRITE(sound_semaphore2_w)
AM_RANGE(0xd50d, 0xd50d) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w)
AM_RANGE(0xd50e, 0xd50e) AM_WRITE(taitosj_bankswitch_w)
AM_RANGE(0xd600, 0xd600) AM_WRITEONLY AM_SHARE("video_mode")
@@ -322,47 +310,75 @@ static ADDRESS_MAP_START( kikstart_main_map, AS_PROGRAM, 8, taitosj_state )
AM_RANGE(0xe000, 0xefff) AM_ROM
ADDRESS_MAP_END
+TIMER_CALLBACK_MEMBER(taitosj_state::soundlatch_w_cb)
+{
+ if (m_soundlatch_flag && (m_soundlatch_data != param))
+ logerror("Warning: soundlatch written before being read. Previous: %02x, new: %02x\n", m_soundlatch_data, param);
+ m_soundlatch_data = param;
+ m_soundlatch_flag = true;
+ m_soundnmi->in_w<1>(1);
+}
+
+TIMER_CALLBACK_MEMBER(taitosj_state::soundlatch_clear7_w_cb)
+{
+ if (m_soundlatch_flag)
+ logerror("Warning: soundlatch bit 7 cleared before being read. Previous: %02x, new: %02x\n", m_soundlatch_data, m_soundlatch_data&0x7f);
+ m_soundlatch_data &= 0x7F;
+}
+
+TIMER_CALLBACK_MEMBER(taitosj_state::sound_semaphore2_w_cb)
+{
+ m_sound_semaphore2 = (param&1);
+ m_soundnmi2->in_w<1>((param&1));
+}
+
+TIMER_CALLBACK_MEMBER(taitosj_state::sound_semaphore2_clear_w_cb)
+{
+ m_sound_semaphore2 = false;
+ m_soundnmi2->in_w<1>(0);
+}
+
// RD5000
-READ8_MEMBER(taitosj_state::sound_command_r)
+READ8_MEMBER(taitosj_state::soundlatch_r)
{
- m_sound_cmd_written = false;
- return m_soundlatch->read(space,0);
+ if (!machine().side_effect_disabled())
+ {
+ m_soundlatch_flag = false;
+ m_soundnmi->in_w<1>(0);
+ }
+ return m_soundlatch_data;
}
// RD5001
-READ8_MEMBER(taitosj_state::sound_status_r)
+READ8_MEMBER(taitosj_state::soundlatch_flags_r)
{
- return (m_sound_cmd_written == true ? 8 : 0) | (m_sound_semaphore == true ? 4 : 0) | 3;
+ return (m_soundlatch_flag?8:0) | (m_sound_semaphore2?4:0) | 3;
}
// WR5000
-WRITE8_MEMBER(taitosj_state::sound_command_ack_w)
+WRITE8_MEMBER(taitosj_state::soundlatch_clear7_w)
{
- m_soundlatch->write(space,0, m_soundlatch->read(space,0) & 0x7f);
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::soundlatch_clear7_w_cb), this), data);
}
// WR5001
-WRITE8_MEMBER(taitosj_state::sound_semaphore_clear_w)
+WRITE8_MEMBER(taitosj_state::sound_semaphore2_clear_w)
{
- m_sound_semaphore = false;
- if ((m_sound_cmd_written && (!m_sndnmi_disable)) || m_sound_semaphore)
- m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- else
- m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::sound_semaphore2_clear_w_cb), this), data);
}
static ADDRESS_MAP_START( taitosj_audio_map, AS_PROGRAM, 8, taitosj_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x43ff) AM_RAM
- AM_RANGE(0x4800, 0x4801) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
- AM_RANGE(0x4801, 0x4801) AM_DEVREAD("ay2", ay8910_device, data_r)
- AM_RANGE(0x4802, 0x4803) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
- AM_RANGE(0x4803, 0x4803) AM_DEVREAD("ay3", ay8910_device, data_r)
- AM_RANGE(0x4804, 0x4805) AM_DEVWRITE("ay4", ay8910_device, address_data_w)
- AM_RANGE(0x4805, 0x4805) AM_DEVREAD("ay4", ay8910_device, data_r)
- AM_RANGE(0x5000, 0x5000) AM_READWRITE(sound_command_r, sound_command_ack_w)
- AM_RANGE(0x5001, 0x5001) AM_READWRITE(sound_status_r, sound_semaphore_clear_w)
+ AM_RANGE(0x4800, 0x4801) AM_MIRROR(0x07f8) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
+ AM_RANGE(0x4801, 0x4801) AM_MIRROR(0x07f8) AM_DEVREAD("ay2", ay8910_device, data_r)
+ AM_RANGE(0x4802, 0x4803) AM_MIRROR(0x07f8) AM_DEVWRITE("ay3", ay8910_device, address_data_w)
+ AM_RANGE(0x4803, 0x4803) AM_MIRROR(0x07f8) AM_DEVREAD("ay3", ay8910_device, data_r)
+ AM_RANGE(0x4804, 0x4805) AM_MIRROR(0x07fa) AM_DEVWRITE("ay4", ay8910_device, address_data_w)
+ AM_RANGE(0x4805, 0x4805) AM_MIRROR(0x07fa) AM_DEVREAD("ay4", ay8910_device, data_r)
+ AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x07fc) AM_READWRITE(soundlatch_r, soundlatch_clear7_w)
+ AM_RANGE(0x5001, 0x5001) AM_MIRROR(0x07fc) AM_READWRITE(soundlatch_flags_r, sound_semaphore2_clear_w)
AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostic ROM */
ADDRESS_MAP_END
@@ -1768,7 +1784,11 @@ static MACHINE_CONFIG_START( nomcu )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(DEVWRITELINE("soundnmi2", input_merger_device, in_w<0>))
+
+ MCFG_INPUT_MERGER_ANY_HIGH("soundnmi2")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ay1", AY8910, XTAL_6MHz/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC53 (this is the only AY which uses proper mixing resistors, the 3 below have outputs tied together)
MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
@@ -2758,8 +2778,13 @@ ROM_END
void taitosj_state::reset_common()
{
- m_sndnmi_disable = false; // ay-3-8910 resets all registers to 0 on reset
- m_sound_semaphore = false;
+ m_sound_semaphore2 = false;
+ m_soundnmi2->in_w<1>(0);
+ m_soundlatch_data = 0xff;
+ m_soundlatch_flag = false;
+ m_soundnmi->in_w<1>(0);
+ m_soundnmi->in_w<0>(0);
+ m_sound_semaphore2 = false;
m_ay1->set_output_gain(0, 0.0); // 3 outputs for Ay1 since it doesn't use tied together outs
m_ay1->set_output_gain(1, 0.0);
m_ay1->set_output_gain(2, 0.0);
@@ -2775,9 +2800,9 @@ void taitosj_state::reset_common()
void taitosj_state::init_common()
{
- save_item(NAME(m_sndnmi_disable));
- save_item(NAME(m_sound_cmd_written));
- save_item(NAME(m_sound_semaphore));
+ save_item(NAME(m_soundlatch_data));
+ save_item(NAME(m_soundlatch_flag));
+ save_item(NAME(m_sound_semaphore2));
save_item(NAME(m_input_port_4_f0));
save_item(NAME(m_kikstart_gears));
diff --git a/src/mame/drivers/tandy2k.cpp b/src/mame/drivers/tandy2k.cpp
index 2e51022b2a3..5e2425a9190 100644
--- a/src/mame/drivers/tandy2k.cpp
+++ b/src/mame/drivers/tandy2k.cpp
@@ -841,9 +841,11 @@ static MACHINE_CONFIG_START( tandy2k )
//MCFG_PIT8253_CLK2(XTAL_16MHz/8)
//MCFG_PIT8253_OUT2_HANDLER(WRITELINE(tandy2k_state, rfrqpulse_w))
- MCFG_PIC8259_ADD(I8259A_0_TAG, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int0_w), VCC, NOOP)
+ MCFG_DEVICE_ADD(I8259A_0_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE(I80186_TAG, i80186_cpu_device, int0_w))
- MCFG_PIC8259_ADD(I8259A_1_TAG, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int1_w), VCC, NOOP)
+ MCFG_DEVICE_ADD(I8259A_1_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE(I80186_TAG, i80186_cpu_device, int1_w))
MCFG_I8272A_ADD(I8272A_TAG, true)
downcast<i8272a_device *>(device)->set_select_lines_connected(true);
diff --git a/src/mame/drivers/tdv2324.cpp b/src/mame/drivers/tdv2324.cpp
index 36be7f125da..9e51db08c53 100644
--- a/src/mame/drivers/tdv2324.cpp
+++ b/src/mame/drivers/tdv2324.cpp
@@ -283,7 +283,7 @@ static MACHINE_CONFIG_START( tdv2324 )
MCFG_TMS9927_CHAR_WIDTH(8)
// devices
- MCFG_PIC8259_ADD(P8259A_TAG, NOOP, VCC, NOOP)
+ MCFG_DEVICE_ADD(P8259A_TAG, PIC8259, 0)
MCFG_DEVICE_ADD(P8253_5_0_TAG, PIT8253, 0)
diff --git a/src/mame/drivers/tecmosys.cpp b/src/mame/drivers/tecmosys.cpp
index 4495702ce73..f78b64a049c 100644
--- a/src/mame/drivers/tecmosys.cpp
+++ b/src/mame/drivers/tecmosys.cpp
@@ -193,26 +193,15 @@ ae500w07.ad1 - M6295 Samples (23c4001)
#include "speaker.h"
-// It looks like this needs a synch between z80 and 68k ??? See z80:006A-0091
-READ16_MEMBER(tecmosys_state::sound_r)
+READ8_MEMBER(tecmosys_state::sound_command_pending_r)
{
- if (ACCESSING_BITS_0_7)
- {
- machine().scheduler().synchronize();
- return m_soundlatch2->read(space, 0);
- }
-
- return 0;
+ return m_soundlatch->pending_r();
}
-WRITE16_MEMBER(tecmosys_state::sound_w)
+WRITE8_MEMBER(tecmosys_state::sound_nmi_disable_w)
{
- if (ACCESSING_BITS_0_7)
- {
- machine().scheduler().synchronize();
- m_soundlatch->write(space, 0x00, data & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- }
+ // 00 and FF are the only values written here; the latter value is set during initialization and NMI processing
+ m_soundnmi->in_w<1>(data == 0);
}
/*
@@ -318,9 +307,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, tecmosys_state )
AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("P1")
AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("P2")
AM_RANGE(0xd80000, 0xd80001) AM_READ(eeprom_r)
- AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_w )
+ AM_RANGE(0xe00000, 0xe00001) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0xe80000, 0xe80001) AM_WRITE(prot_data_w)
- AM_RANGE(0xf00000, 0xf00001) AM_READ(sound_r)
+ AM_RANGE(0xf00000, 0xf00001) AM_READ8(sound_command_pending_r, 0x00ff)
AM_RANGE(0xf80000, 0xf80001) AM_READ(prot_data_r)
ADDRESS_MAP_END
@@ -353,7 +342,7 @@ static ADDRESS_MAP_START( io_map, AS_IO, 8, tecmosys_state )
AM_RANGE(0x20, 0x20) AM_WRITE(oki_bank_w)
AM_RANGE(0x30, 0x30) AM_WRITE(z80_bank_w)
AM_RANGE(0x40, 0x40) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
- AM_RANGE(0x50, 0x50) AM_DEVWRITE("soundlatch2", generic_latch_8_device, write)
+ AM_RANGE(0x50, 0x50) AM_WRITE(sound_nmi_disable_w)
AM_RANGE(0x60, 0x61) AM_DEVREADWRITE("ymz", ymz280b_device, read, write)
ADDRESS_MAP_END
@@ -477,7 +466,10 @@ static MACHINE_CONFIG_START( deroon )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_8_ADD("soundlatch2")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(DEVWRITELINE("soundnmi", input_merger_device, in_w<0>))
+
+ MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ymf", YMF262, XTAL_14_31818MHz)
MCFG_YMF262_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp
index 544f70eccfb..14ab56c8650 100644
--- a/src/mame/drivers/thedeep.cpp
+++ b/src/mame/drivers/thedeep.cpp
@@ -47,12 +47,8 @@ Notes:
WRITE8_MEMBER(thedeep_state::nmi_w)
{
m_nmi_enable = data;
-}
-
-WRITE8_MEMBER(thedeep_state::sound_w)
-{
- m_soundlatch->write(space, 0, data);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (!m_nmi_enable)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
void thedeep_state::machine_start()
@@ -161,7 +157,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, thedeep_state )
AM_RANGE(0xe009, 0xe009) AM_READ_PORT("e009") // P2
AM_RANGE(0xe00a, 0xe00a) AM_READ_PORT("e00a") // DSW1
AM_RANGE(0xe00b, 0xe00b) AM_READ_PORT("e00b") // DSW2
- AM_RANGE(0xe00c, 0xe00c) AM_WRITE(sound_w) // To Sound CPU
+ AM_RANGE(0xe00c, 0xe00c) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) // To Sound CPU
AM_RANGE(0xe100, 0xe100) AM_WRITE(e100_w) // ?
AM_RANGE(0xe210, 0xe213) AM_WRITEONLY AM_SHARE("scroll") // Scroll
AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE("spriteram") // Sprites
@@ -399,10 +395,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::interrupt)
else if(scanline == 0)
{
if (m_nmi_enable)
- {
m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
- }
}
}
@@ -451,6 +444,7 @@ static MACHINE_CONFIG_START( thedeep )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/4) /* verified on pcb */
MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/thunderj.cpp b/src/mame/drivers/thunderj.cpp
index 6e65c10fa94..af5da94b790 100644
--- a/src/mame/drivers/thunderj.cpp
+++ b/src/mame/drivers/thunderj.cpp
@@ -39,8 +39,8 @@
#include "emu.h"
#include "includes/thunderj.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
-#include "machine/atarigen.h"
#include "speaker.h"
@@ -118,9 +118,9 @@ WRITE16_MEMBER(thunderj_state::latch_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, thunderj_state )
AM_RANGE(0x000000, 0x09ffff) AM_ROM
- AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
@@ -259,7 +259,8 @@ static MACHINE_CONFIG_START( thunderj )
MCFG_MACHINE_START_OVERRIDE(thunderj_state,thunderj)
MCFG_MACHINE_RESET_OVERRIDE(thunderj_state,thunderj)
- MCFG_ATARI_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_2816_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp
index 89d19cd0f9d..a575a8995b2 100644
--- a/src/mame/drivers/tnzs.cpp
+++ b/src/mame/drivers/tnzs.cpp
@@ -1886,11 +1886,11 @@ ROM_END
ROM_START( extrmatnur )
ROM_REGION( 0x20000, "maincpu", 0 ) /* Region 0 - main cpu */
- ROM_LOAD( "b06_15", 0x00000, 0x10000, CRC(4b3ee597) SHA1(024964faebd0fa894ab4868a8e009267e828cbfb) )
- ROM_LOAD( "b06_16", 0x10000, 0x10000, CRC(86175ea4) SHA1(0f30cbb1a6a32355528543707799f752a1b9b75e) )
+ ROM_LOAD( "b06-15.11c", 0x00000, 0x10000, CRC(4b3ee597) SHA1(024964faebd0fa894ab4868a8e009267e828cbfb) )
+ ROM_LOAD( "b06-16.9c", 0x10000, 0x10000, CRC(86175ea4) SHA1(0f30cbb1a6a32355528543707799f752a1b9b75e) )
ROM_REGION( 0x10000, "sub", 0 ) /* Region 2 - sound cpu */
- ROM_LOAD( "b06_17", 0x00000, 0x10000, CRC(744f2c84) SHA1(7565c1594c2a3bae1ae45afcbf93363fe2b12d58) )
+ ROM_LOAD( "b06-17.4e", 0x00000, 0x10000, CRC(744f2c84) SHA1(7565c1594c2a3bae1ae45afcbf93363fe2b12d58) )
ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */
ROM_LOAD( "b06__14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */
@@ -2288,7 +2288,6 @@ Taito, 1988
This PCB comes in two variations: one which is on the older, color prom based P0-025-A PCB as used on extrmatn, drtoppel
and one which is a unique PCB sort of an 'older version of p0-051-a' which uses color ram like tnzs.
-The color prom version is not dumped yet.
The chukatai (p0-025-a) PCB has a sticker label which says "????????? // CHUKATAISEN"
The chukatai (p0-028-a) PCB has a sticker label which says "K1100??2A // CHUKATAISEN"
@@ -2335,17 +2334,16 @@ Notes:
6264: 8K x8 SRAM
6116: 2K x8 SRAM
-The undumped Chuka Taisen set has a daughterboard which plugs into the
+The P0-025-A Chuka Taisen set has a daughterboard which plugs into the
GFX ROM sockets and allows use of 27c1000d eproms instead of 23c1000 mask roms.
-The undumped set, unlike the two here, runs on an older drtoppel/extrmatn pcb
-and uses color proms!
+This set, unlike the two others, uses color proms!
*/
ROM_START( chukatai )
ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k + bankswitch areas for the first CPU */
- ROM_LOAD( "b44-10", 0x00000, 0x10000, CRC(8c69e008) SHA1(7825965f517f3562a508345b7c0d32b8a57bd38a) )
+ ROM_LOAD( "b44-10", 0x00000, 0x10000, CRC(8c69e008) SHA1(7825965f517f3562a508345b7c0d32b8a57bd38a) ) /* P0-028-A PCB set */
ROM_LOAD( "b44-11", 0x10000, 0x10000, CRC(32484094) SHA1(f320fea2910816b5085ca9aa37e30af665fb6be1) )
ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */
@@ -2373,7 +2371,7 @@ ROM_END
ROM_START( chukataiu )
ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k + bankswitch areas for the first CPU */
- ROM_LOAD( "b44-10", 0x00000, 0x10000, CRC(8c69e008) SHA1(7825965f517f3562a508345b7c0d32b8a57bd38a) )
+ ROM_LOAD( "b44-10", 0x00000, 0x10000, CRC(8c69e008) SHA1(7825965f517f3562a508345b7c0d32b8a57bd38a) ) /* P0-028-A PCB set */
ROM_LOAD( "b44-11", 0x10000, 0x10000, CRC(32484094) SHA1(f320fea2910816b5085ca9aa37e30af665fb6be1) )
ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */
@@ -2401,7 +2399,7 @@ ROM_END
ROM_START( chukataij )
ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k + bankswitch areas for the first CPU */
- ROM_LOAD( "b44-10", 0x00000, 0x10000, CRC(8c69e008) SHA1(7825965f517f3562a508345b7c0d32b8a57bd38a) )
+ ROM_LOAD( "b44-10", 0x00000, 0x10000, CRC(8c69e008) SHA1(7825965f517f3562a508345b7c0d32b8a57bd38a) ) /* P0-028-A PCB set */
ROM_LOAD( "b44-11", 0x10000, 0x10000, CRC(32484094) SHA1(f320fea2910816b5085ca9aa37e30af665fb6be1) )
ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */
@@ -2427,10 +2425,37 @@ ROM_START( chukataij )
ROM_LOAD( "b06-13.pal16l8a.c2.jed", 0x03000, 0x01000, NO_DUMP)
ROM_END
-/*An undumped set of chuka taisen exists with all roms in the b44-14
-thru b44-25 number range and 27c1000d gfx roms, AND COLOR PROMS, using the older p0-025-a pcb
-This set, unlike the others, does use the b06-10.pal16l8a.d9.jed "older" pal rather than the 'newer' b06-101.pal16l8a.d9.jed pal.
-*/
+ROM_START( chukataija )
+ ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k + bankswitch areas for the first CPU */
+ ROM_LOAD( "b44-31.11c", 0x00000, 0x10000, CRC(134d3c9e) SHA1(e686a75b9c267db9e8dad7f162c93f1992e395ec) ) /* P0-025-A PCB set */
+ ROM_LOAD( "b44-11.9c", 0x10000, 0x10000, CRC(32484094) SHA1(f320fea2910816b5085ca9aa37e30af665fb6be1) )
+
+ ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */
+ ROM_LOAD( "b44-32.4e", 0x00000, 0x10000, CRC(f52d2f90) SHA1(f040b16e29553ae510e50e1ed55344a36fdcc56d) )
+
+ ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8x42 internal ROM) */
+ ROM_LOAD( "b06__14.1g", 0x0000, 0x0800, CRC(28907072) SHA1(21c7017af8a8ceb8e43d7e798f48518b136fd45c) ) /* Labeled B06-14 and under printed label "Taito M-001, 128P, 720100", is a mask 8042 */
+
+ ROM_REGION( 0x100000, "gfx1", 0 )
+ ROM_LOAD( "b44-21.a13", 0x00000, 0x20000, CRC(aae7b3d5) SHA1(52809ea22d98811ece2fb27e80db6ddf4fbacb07) ) /* same data as B44-01 through B44-08 */
+ ROM_LOAD( "b44-22.a12", 0x20000, 0x20000, CRC(7f0b9568) SHA1(415d2638d1b0eb36b2e2f63219cbc0dbebe02dc6) )
+ ROM_LOAD( "b44-23.a10", 0x40000, 0x20000, CRC(5a54a3b9) SHA1(6b219f1c3570f16eb4a06221d7e527c735437bac) )
+ ROM_LOAD( "b44-24.a08", 0x60000, 0x20000, CRC(3c5f544b) SHA1(d3b0ee18f1027483a36ef02757b62f42a086a8e2) )
+ ROM_LOAD( "b44-25.a07", 0x80000, 0x20000, CRC(d1b7e314) SHA1(8b4181caa32955b4274614a4238bb24d67ecb729) )
+ ROM_LOAD( "b44-26.a05", 0xa0000, 0x20000, CRC(269978a8) SHA1(aef7b8d3d00dcc4201e0a1e28026f6f1bdafd0b7) )
+ ROM_LOAD( "b44-27.a04", 0xc0000, 0x20000, CRC(3e0e737e) SHA1(f8d62c7b69c79da9df7ef5ce454060d3645e5884) )
+ ROM_LOAD( "b44-28.a02", 0xe0000, 0x20000, CRC(6cb1e8fc) SHA1(4ab0c2cce1de2616044a9bfb9bf17f95a49baffd) )
+
+ ROM_REGION( 0x0400, "proms", 0 )
+ ROM_LOAD( "b44-30.15f", 0x00000, 0x200, CRC(b3de8312) SHA1(dac0d9bfb593d691fd7030e2b1b13be1218929a4) ) /* hi bytes, AM27S29 or compatible like MB7124 */
+ ROM_LOAD( "b44-29.17f", 0x00200, 0x200, CRC(ae44b8fb) SHA1(2bf5aca32bb301c0187deb05a3f4a482ac97f0ef) ) /* lo bytes, AM27S29 or compatible like MB7124 */
+
+ ROM_REGION( 0x10000, "pal", 0 ) /* these are shared with extermination */
+ ROM_LOAD( "b06-10.pal16l8a.d9.jed", 0x00000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-11.pal16l8a.d6.jed", 0x01000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-12.pal16l8a.c3.jed", 0x02000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-13.pal16l8a.c2.jed", 0x03000, 0x01000, NO_DUMP)
+ROM_END
/*
@@ -2832,30 +2857,31 @@ GAME( 1987, extrmatnur,extrmatn, extrmatn, extrmatn, extrmatn_state, 0, ROT270,
GAME( 1987, extrmatnj, extrmatn, extrmatn, extrmatn, extrmatn_state, 0, ROT270, "Taito Corporation", "Extermination (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, arknoid2, 0, arknoid2, arknoid2, arknoid2_state, 0, ROT270, "Taito Corporation Japan", "Arkanoid - Revenge of DOH (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, arknoid2u, arknoid2, arknoid2, arknid2u, arknoid2_state, 0, ROT270, "Taito America Corporation (Romstar license)", "Arkanoid - Revenge of DOH (US)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, arknoid2u, arknoid2, arknoid2, arknid2u, arknoid2_state, 0, ROT270, "Taito America Corporation (Romstar license)", "Arkanoid - Revenge of DOH (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, arknoid2j, arknoid2, arknoid2, arknid2u, arknoid2_state, 0, ROT270, "Taito Corporation", "Arkanoid - Revenge of DOH (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, arknoid2b, arknoid2, arknoid2, arknid2u, arknoid2_state, 0, ROT270, "bootleg", "Arkanoid - Revenge of DOH (Japan bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1987, drtoppel, 0, extrmatn, drtoppel, extrmatn_state, 0, ROT90, "Kaneko / Taito Corporation Japan", "Dr. Toppel's Adventure (World)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */
-GAME( 1987, drtoppelu, drtoppel, extrmatn, drtopplu, extrmatn_state, 0, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */
+GAME( 1987, drtoppelu, drtoppel, extrmatn, drtopplu, extrmatn_state, 0, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */
GAME( 1987, drtoppelj, drtoppel, extrmatn, drtopplu, extrmatn_state, 0, ROT90, "Kaneko / Taito Corporation", "Dr. Toppel's Tankentai (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, kageki, 0, kageki, kageki, kageki_state, 0, ROT90, "Kaneko / Taito Corporation", "Kageki (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, kagekiu, kageki, kageki, kagekiu, kageki_state, 0, ROT90, "Kaneko / Taito America Corporation (Romstar license)", "Kageki (US)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, kagekiu, kageki, kageki, kagekiu, kageki_state, 0, ROT90, "Kaneko / Taito America Corporation (Romstar license)", "Kageki (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, kagekij, kageki, kageki, kagekij, kageki_state, 0, ROT90, "Kaneko / Taito Corporation", "Kageki (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1992, kagekih, kageki, kageki, kageki, kageki_state, 0, ROT90, "hack", "Kageki (hack)", MACHINE_SUPPORTS_SAVE ) // date is hacked at least, might also be a Japan set hacked to show english
-
-GAME( 1988, chukatai, 0, tnzs, chukatai, tnzs_state, 0, ROT0, "Taito Corporation Japan", "Chuka Taisen (World)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */
-GAME( 1988, chukataiu, chukatai, tnzs, chukatau, tnzs_state, 0, ROT0, "Taito America Corporation", "Chuka Taisen (US)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */
-GAME( 1988, chukataij, chukatai, tnzs, chukatau, tnzs_state, 0, ROT0, "Taito Corporation", "Chuka Taisen (Japan)", MACHINE_SUPPORTS_SAVE )
-
-GAME( 1988, tnzs, 0, tnzsb, tnzs, tnzsb_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, new version) (newer PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, tnzsj, tnzs, tnzsb, tnzsj, tnzsb_state, 0, ROT0, "Taito Corporation", "The NewZealand Story (Japan, new version) (newer PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, tnzso, tnzs, tnzs, tnzsop, tnzs_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, old version) (older PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, tnzsjo, tnzs, tnzs, tnzsjo, tnzs_state, 0, ROT0, "Taito Corporation", "The NewZealand Story (Japan, old version) (older PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, tnzsuo, tnzs, tnzs, tnzsjo, tnzs_state, 0, ROT0, "Taito America Corporation", "The NewZealand Story (US, old version) (older PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, tnzsoa, tnzs, tnzs, tnzsop, tnzs_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, unknown version) (older PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, tnzsop, tnzs, tnzs, tnzsop, tnzs_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, prototype) (older PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1992, kagekih, kageki, kageki, kageki, kageki_state, 0, ROT90, "hack", "Kageki (hack)", MACHINE_SUPPORTS_SAVE ) // date is hacked at least, might also be a Japan set hacked to show english
+
+GAME( 1988, chukatai, 0, tnzs, chukatai, tnzs_state, 0, ROT0, "Taito Corporation Japan", "Chuka Taisen (World) (P0-028-A PCB)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */
+GAME( 1988, chukataiu, chukatai, tnzs, chukatau, tnzs_state, 0, ROT0, "Taito America Corporation", "Chuka Taisen (US) (P0-028-A PCB)", MACHINE_SUPPORTS_SAVE ) /* Possible region hack */
+GAME( 1988, chukataij, chukatai, tnzs, chukatau, tnzs_state, 0, ROT0, "Taito Corporation", "Chuka Taisen (Japan) (P0-028-A PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, chukataija,chukatai, extrmatn, chukatau, extrmatn_state, 0, ROT0, "Taito Corporation", "Chuka Taisen (Japan) (P0-025-A PCB)", MACHINE_SUPPORTS_SAVE ) /* Higher rom ID# but older PCB stock */
+
+GAME( 1988, tnzs, 0, tnzsb, tnzs, tnzsb_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, new version) (P0-043A PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, tnzsj, tnzs, tnzsb, tnzsj, tnzsb_state, 0, ROT0, "Taito Corporation", "The NewZealand Story (Japan, new version) (P0-043A PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, tnzso, tnzs, tnzs, tnzsop, tnzs_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, old version) (P0-041A PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, tnzsjo, tnzs, tnzs, tnzsjo, tnzs_state, 0, ROT0, "Taito Corporation", "The NewZealand Story (Japan, old version) (P0-041A PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, tnzsuo, tnzs, tnzs, tnzsjo, tnzs_state, 0, ROT0, "Taito America Corporation", "The NewZealand Story (US, old version) (P0-041A PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, tnzsoa, tnzs, tnzs, tnzsop, tnzs_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, unknown version) (P0-041A PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, tnzsop, tnzs, tnzs, tnzsop, tnzs_state, 0, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, prototype) (P0-041-1 PCB)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, kabukiz, 0, kabukiz, kabukiz, kabukiz_state, 0, ROT0, "Kaneko / Taito Corporation Japan", "Kabuki-Z (World)", MACHINE_SUPPORTS_SAVE )
GAME( 1988, kabukizj, kabukiz, kabukiz, kabukizj, kabukiz_state, 0, ROT0, "Kaneko / Taito Corporation", "Kabuki-Z (Japan)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/toobin.cpp b/src/mame/drivers/toobin.cpp
index cca681eaa97..41a2e70d39e 100644
--- a/src/mame/drivers/toobin.cpp
+++ b/src/mame/drivers/toobin.cpp
@@ -21,9 +21,10 @@
#include "emu.h"
#include "includes/toobin.h"
+
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
-#include "machine/atarigen.h"
#include "speaker.h"
#define MASTER_CLOCK XTAL_32MHz
@@ -95,13 +96,13 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, toobin_state )
AM_RANGE(0x828380, 0x828381) AM_MIRROR(0x45003e) AM_RAM_WRITE(slip_w) AM_SHARE("mob:slip")
AM_RANGE(0x8283c0, 0x8283c1) AM_MIRROR(0x45003e) AM_WRITE(scanline_int_ack_w)
AM_RANGE(0x828400, 0x828401) AM_MIRROR(0x4500fe) AM_DEVWRITE("jsa", atari_jsa_i_device, sound_reset_w)
- AM_RANGE(0x828500, 0x828501) AM_MIRROR(0x4500fe) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x828500, 0x828501) AM_MIRROR(0x4500fe) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x828600, 0x828601) AM_MIRROR(0x4500fe) AM_WRITE(xscroll_w) AM_SHARE("xscroll")
AM_RANGE(0x828700, 0x828701) AM_MIRROR(0x4500fe) AM_WRITE(yscroll_w) AM_SHARE("yscroll")
AM_RANGE(0x828800, 0x828801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800")
AM_RANGE(0x829000, 0x829001) AM_MIRROR(0x4507fe) AM_READ_PORT("FF9000")
AM_RANGE(0x829800, 0x829801) AM_MIRROR(0x4507fe) AM_DEVREAD8("jsa", atari_jsa_i_device, main_response_r, 0x00ff)
- AM_RANGE(0x82a000, 0x82afff) AM_MIRROR(0x451000) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x82a000, 0x82afff) AM_MIRROR(0x451000) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x82c000, 0x82ffff) AM_MIRROR(0x450000) AM_RAM
ADDRESS_MAP_END
@@ -203,7 +204,8 @@ static MACHINE_CONFIG_START( toobin )
MCFG_MACHINE_RESET_OVERRIDE(toobin_state,toobin)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
MCFG_WATCHDOG_VBLANK_INIT("screen", 8)
diff --git a/src/mame/drivers/triforce.cpp b/src/mame/drivers/triforce.cpp
index 46b4f891182..8b7048cc867 100644
--- a/src/mame/drivers/triforce.cpp
+++ b/src/mame/drivers/triforce.cpp
@@ -75,7 +75,6 @@ Games on this system include....
| | 2004 | The Key Of Avalon 2: Eutaxy Commandment (client) (Rev A) | Sega / Hitmaker | GDROM | GDT-0017A | 317-0403-JPN | 253-5508-0403J|
|*| 2004 | The Key Of Avalon 2: Eutaxy Commandment (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0017B | 317-0403-JPN | 253-5508-0403J|
| | 2004 | F-Zero AX - Monster Ride Cycraft Edition | Sega / Amusement Vision / Nintendo | GDROM | | | |
-| | 2005 | Donkey Kong Jungle Fever | Namco / Nintendo | Cart | | | |
|*| 2005 | Mario Kart Arcade GP (Japan, MKA1 Ver.A1) | Namco / Nintendo | Cart | 837-14343-4T1 | 317-5109-COM | 253-5509-5109 |
| | 2005 | The Key Of Avalon 2.5: War of the Key (server) | Sega / Hitmaker | GDROM | GDT-0018 | 317-0403-JPN | 253-5508-0403J|
| | 2005 | The Key Of Avalon 2.5: War of the Key (server) (Rev A) | Sega / Hitmaker | GDROM | GDT-0018A | 317-0403-JPN | 253-5508-0403J|
@@ -92,7 +91,6 @@ Games on this system include....
| | 2006 | Virtua Striker 4 Ver.2006 (Export) | Sega | CF | MDA-G00?? | 317-0433-EXP | 253-5508-0433E|
| | 2006 | Triforce Firmware Update for Compact Flash Box | Sega | GDROM | GDT-0022 | 317-0567-COM | |
|*| 2006 | Triforce Firmware Update for Compact Flash Box (Rev A) | Sega | GDROM | GDT-0022A | 317-0567-COM | |
-| | 2006 | Donkey Kong : Banana Kingdom | Namco / Nintendo | Cart? | | | |
|*| 2007 | Mario Kart Arcade GP 2 (Japan, MK21 Ver.A) | Namco / Nintendo | Cart | 837-14343-R4S0 | 317-5128-COM | 253-5509-5128 |
|*| 2007 | Mario Kart Arcade GP 2 (Japan, MK21 Ver.A, alt dump) | Namco / Nintendo | Cart | 837-14343-R4S0 | 317-5128-COM | 253-5509-5128 |
+-+------+-----------------------------------------------------------------+-------------------------------------+-------|----------------+--------------+---------------|
diff --git a/src/mame/drivers/trs80m2.cpp b/src/mame/drivers/trs80m2.cpp
index 4ef3b3b4c84..b94ce2a826e 100644
--- a/src/mame/drivers/trs80m2.cpp
+++ b/src/mame/drivers/trs80m2.cpp
@@ -851,7 +851,8 @@ static MACHINE_CONFIG_START( trs80m16 )
MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_8MHz/2, 0, 0, 0, 0)
MCFG_Z80DART_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_PIC8259_ADD(AM9519A_TAG, INPUTLINE(M68000_TAG, M68K_IRQ_5), VCC, NOOP)
+ MCFG_DEVICE_ADD(AM9519A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(M68000_TAG, M68K_IRQ_5))
MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_devices, "printer")
MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(Z80PIO_TAG, z80pio_device, strobe_b))
diff --git a/src/mame/drivers/tsispch.cpp b/src/mame/drivers/tsispch.cpp
index 850f6f35297..d118f933ae7 100644
--- a/src/mame/drivers/tsispch.cpp
+++ b/src/mame/drivers/tsispch.cpp
@@ -390,7 +390,8 @@ static MACHINE_CONFIG_START( prose2k )
MCFG_NECDSP_OUT_P1_CB(WRITELINE(tsispch_state, dsp_to_8086_p1_w))
/* PIC 8259 */
- MCFG_PIC8259_ADD("pic8259", INPUTLINE("maincpu", 0), VCC, NOOP)
+ MCFG_DEVICE_ADD("pic8259", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
/* uarts */
MCFG_DEVICE_ADD("i8251a_u15", I8251, 0)
diff --git a/src/mame/drivers/ultraman.cpp b/src/mame/drivers/ultraman.cpp
index 9dd01670230..2c34a614e9a 100644
--- a/src/mame/drivers/ultraman.cpp
+++ b/src/mame/drivers/ultraman.cpp
@@ -22,16 +22,9 @@
#include "speaker.h"
-WRITE16_MEMBER(ultraman_state::sound_cmd_w)
+WRITE8_MEMBER(ultraman_state::sound_nmi_enable_w)
{
- if (ACCESSING_BITS_0_7)
- m_soundlatch->write(space, 0, data & 0xff);
-}
-
-WRITE16_MEMBER(ultraman_state::sound_irq_trigger_w)
-{
- if (ACCESSING_BITS_0_7)
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_soundnmi->in_w<1>(BIT(data, 0));
}
@@ -45,8 +38,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, ultraman_state )
AM_RANGE(0x1c0006, 0x1c0007) AM_READ_PORT("DSW1")
AM_RANGE(0x1c0008, 0x1c0009) AM_READ_PORT("DSW2")
AM_RANGE(0x1c0018, 0x1c0019) AM_WRITE(ultraman_gfxctrl_w) /* counters + gfx ctrl */
- AM_RANGE(0x1c0020, 0x1c0021) AM_WRITE(sound_cmd_w)
- AM_RANGE(0x1c0028, 0x1c0029) AM_WRITE(sound_irq_trigger_w)
+ AM_RANGE(0x1c0020, 0x1c0021) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
+ AM_RANGE(0x1c0028, 0x1c0029) AM_DEVWRITE8("soundnmi", input_merger_device, in_set<0>, 0x00ff)
AM_RANGE(0x1c0030, 0x1c0031) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x204000, 0x204fff) AM_DEVREADWRITE8("k051316_1", k051316_device, read, write, 0x00ff) /* K051316 #0 RAM */
AM_RANGE(0x205000, 0x205fff) AM_DEVREADWRITE8("k051316_2", k051316_device, read, write, 0x00ff) /* K051316 #1 RAM */
@@ -62,14 +55,14 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, ultraman_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_RAM
AM_RANGE(0xc000, 0xc000) AM_DEVREAD("soundlatch", generic_latch_8_device, read)
-// AM_RANGE(0xd000, 0xd000) AM_WRITENOP /* ??? */
+ AM_RANGE(0xd000, 0xd000) AM_WRITE(sound_nmi_enable_w)
AM_RANGE(0xe000, 0xe000) AM_DEVREADWRITE("oki", okim6295_device, read, write) /* M6295 */
AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, ultraman_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
-// AM_RANGE(0x00, 0x00) AM_WRITENOP /* ??? */
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("soundnmi", input_merger_device, in_clear<0>)
ADDRESS_MAP_END
@@ -174,6 +167,8 @@ void ultraman_state::machine_reset()
m_bank0 = -1;
m_bank1 = -1;
m_bank2 = -1;
+
+ m_soundnmi->in_w<0>(0);
}
static MACHINE_CONFIG_START( ultraman )
@@ -187,6 +182,9 @@ static MACHINE_CONFIG_START( ultraman )
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_io_map)
+ MCFG_INPUT_MERGER_ALL_HIGH("soundnmi")
+ MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
+
MCFG_QUANTUM_TIME(attotime::from_hz(600))
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp
index 1d62e78d9f4..566f15d33d4 100644
--- a/src/mame/drivers/vegas.cpp
+++ b/src/mame/drivers/vegas.cpp
@@ -289,6 +289,9 @@
#include "machine/pci-ide.h"
#include "video/voodoo_pci.h"
#include "screen.h"
+#include "machine/ins8250.h"
+#include "bus/rs232/rs232.h"
+#include "machine/terminal.h"
#include "sf2049.lh"
@@ -308,7 +311,7 @@
*************************************/
#define PCI_ID_NILE ":pci:00.0"
-#define PCI_ID_VIDEO ":pci:04.0"
+#define PCI_ID_VIDEO ":pci:03.0"
#define PCI_ID_IDE ":pci:05.0"
class vegas_state : public driver_device
@@ -322,9 +325,13 @@ public:
m_ethernet(*this, "ethernet"),
m_dcs(*this, "dcs"),
m_ioasic(*this, "ioasic"),
+ m_uart0(*this, "uart0"),
+ m_uart1(*this, "uart1"),
+ m_uart2(*this, "uart2"),
m_io_analog(*this, "AN.%u", 0),
m_a2d_shift(0)
{ }
+ static constexpr unsigned SYSTEM_CLOCK = 100000000;
required_device<mips3_device> m_maincpu;
required_device<vrc5074_device> m_nile;
@@ -332,6 +339,9 @@ public:
required_device<smc91c94_device> m_ethernet;
required_device<dcs_audio_device> m_dcs;
required_device<midway_ioasic_device> m_ioasic;
+ optional_device<generic_terminal_device> m_uart0;
+ optional_device<ns16550_device> m_uart1;
+ optional_device<ns16550_device> m_uart2;
optional_ioport_array<8> m_io_analog;
int m_a2d_shift;
uint8_t m_vblank_state;
@@ -346,7 +356,10 @@ public:
uint8_t m_dcs_idma_cs;
uint32_t m_i40_data;
uint32_t m_keypad_select;
+ uint32_t m_gear;
+ DECLARE_WRITE_LINE_MEMBER(uart1_irq_cb);
+ DECLARE_WRITE_LINE_MEMBER(uart2_irq_cb);
DECLARE_WRITE_LINE_MEMBER(vblank_assert);
DECLARE_DRIVER_INIT(gauntleg);
DECLARE_DRIVER_INIT(cartfury);
@@ -388,9 +401,12 @@ public:
DECLARE_WRITE_LINE_MEMBER(ethernet_interrupt);
DECLARE_WRITE_LINE_MEMBER(ioasic_irq);
DECLARE_READ32_MEMBER(unknown_r);
+ DECLARE_READ8_MEMBER(parallel_r);
+ DECLARE_WRITE8_MEMBER(parallel_w);
DECLARE_WRITE32_MEMBER(i40_w);
DECLARE_CUSTOM_INPUT_MEMBER(i40_r);
DECLARE_CUSTOM_INPUT_MEMBER(keypad_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(gearshift_r);
DECLARE_WRITE32_MEMBER(wheel_board_w);
std::string sioIRQString(uint8_t data);
@@ -437,6 +453,7 @@ void vegas_state::machine_start()
save_item(NAME(m_cmos_unlocked));
save_item(NAME(m_i40_data));
save_item(NAME(m_keypad_select));
+ save_item(NAME(m_gear));
}
@@ -455,6 +472,7 @@ void vegas_state::machine_reset()
reset_sio();
m_i40_data = 0;
m_keypad_select = 0;
+ m_gear = 1;
}
/*************************************
@@ -463,13 +481,13 @@ void vegas_state::machine_reset()
#define WD_IRQ 0x1
WRITE_LINE_MEMBER(vegas_state::watchdog_irq)
{
- logerror("%s: vegas_state::watchdog_irq state = %i\n", machine().describe_context(), state);
if (state && !(m_sio_irq_state & WD_IRQ)) {
+ logerror("%s: vegas_state::watchdog_irq state = %i\n", machine().describe_context(), state);
m_sio_irq_state |= WD_IRQ;
update_sio_irqs();
}
else if (!state && (m_sio_irq_state & WD_IRQ)) {
- //logerror("%s: vegas_state::watchdog_irq state = %i\n", machine().describe_context(), state);
+ logerror("%s: vegas_state::watchdog_irq state = %i\n", machine().describe_context(), state);
m_sio_irq_state &= ~WD_IRQ;
update_sio_irqs();
}
@@ -481,7 +499,7 @@ WRITE_LINE_MEMBER(vegas_state::watchdog_irq)
WRITE_LINE_MEMBER(vegas_state::watchdog_reset)
{
if (state) {
- //printf("vegas_state::watchdog_reset!!!\n");
+ printf("vegas_state::watchdog_reset!!!\n");
logerror("vegas_state::watchdog_reset!!!\n");
machine().schedule_soft_reset();
}
@@ -563,6 +581,23 @@ void vegas_state::update_sio_irqs()
}
}
+WRITE_LINE_MEMBER(vegas_state::uart1_irq_cb)
+{
+ if (state)
+ m_sio_irq_state |= (1 << 4);
+ else
+ m_sio_irq_state &= ~(1 << 4);
+ update_sio_irqs();
+}
+
+WRITE_LINE_MEMBER(vegas_state::uart2_irq_cb)
+{
+ if (state)
+ m_sio_irq_state |= (1 << 4);
+ else
+ m_sio_irq_state &= ~(1 << 4);
+ update_sio_irqs();
+}
WRITE_LINE_MEMBER(vegas_state::vblank_assert)
{
@@ -881,7 +916,7 @@ READ32_MEMBER( vegas_state::ethernet_r )
result |= m_ethernet->read(space, offset * 2 + 0, mem_mask);
if (ACCESSING_BITS_16_31)
result |= m_ethernet->read(space, offset * 2 + 1, mem_mask >> 16) << 16;
- logerror("ethernet_r: offset %08x = %08x & %08x\n", offset, result, mem_mask);
+ //logerror("ethernet_r: offset %08x = %08x & %08x\n", offset, result, mem_mask);
return result;
}
@@ -892,7 +927,7 @@ WRITE32_MEMBER( vegas_state::ethernet_w )
m_ethernet->write(space, offset * 2 + 0, data, mem_mask);
if (ACCESSING_BITS_16_31)
m_ethernet->write(space, offset * 2 + 1, data >> 16, mem_mask >> 16);
- logerror("ethernet_w: offset %08x = %08x & %08x\n", offset, data, mem_mask);
+ //logerror("ethernet_w: offset %08x = %08x & %08x\n", offset, data, mem_mask);
}
@@ -910,6 +945,21 @@ READ32_MEMBER(vegas_state::unknown_r)
}
/*************************************
+* Parallel Port
+*************************************/
+READ8_MEMBER(vegas_state::parallel_r)
+{
+ uint8_t result = 0x3;
+ logerror("%06X: parallel_r %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, result);
+ return result;
+}
+
+WRITE8_MEMBER(vegas_state::parallel_w)
+{
+ logerror("%06X: parallel_w %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, data);
+}
+
+/*************************************
* Optical 49 Way Joystick I40 Board
*************************************/
WRITE32_MEMBER(vegas_state::i40_w)
@@ -1017,6 +1067,23 @@ CUSTOM_INPUT_MEMBER(vegas_state::keypad_r)
}
/*************************************
+*
+* Gearshift
+*
+*************************************/
+DECLARE_CUSTOM_INPUT_MEMBER(vegas_state::gearshift_r)
+{
+ // Check for gear change and save gear selection
+ uint32_t gear = ioport("GEAR")->read();
+ for (int i = 0; i < 4; i++)
+ {
+ if (gear & (1 << i))
+ m_gear = 1 << i;
+ }
+ return m_gear;
+}
+
+/*************************************
*
* Input ports
*
@@ -1316,7 +1383,9 @@ static INPUT_PORTS_START( nbashowt )
PORT_DIPSETTING( 0x0020, DEF_STR( French ) )
PORT_DIPSETTING( 0x0010, DEF_STR( German ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
- PORT_DIPUNUSED( 0x0040, 0x0000 )
+ PORT_DIPNAME( 0x0040, 0x0040, "Select Game" )
+ PORT_DIPSETTING( 0x0040, DEF_STR(Yes))
+ PORT_DIPSETTING( 0x0000, DEF_STR(No))
PORT_DIPNAME( 0x0080, 0x0080, "Game Powerup" )
PORT_DIPSETTING( 0x0080, "NBA Showtime" )
PORT_DIPSETTING( 0x0000, "NFL Blitz" )
@@ -1400,7 +1469,7 @@ static INPUT_PORTS_START( sf2049 )
PORT_DIPNAME( 0x0080, 0x0080, "PM Dump" )
PORT_DIPSETTING( 0x0080, "Watchdog resets only" )
PORT_DIPSETTING( 0x0000, "All resets" )
- PORT_DIPNAME( 0x0300, 0x0200, "Resolution" )
+ PORT_DIPNAME( 0x0300, 0x0000, "Resolution" )
PORT_DIPSETTING( 0x0300, "Standard Res 512x256" )
PORT_DIPSETTING( 0x0200, "Medium Res 512x384" )
PORT_DIPSETTING( 0x0000, "VGA Res 640x480" )
@@ -1415,10 +1484,13 @@ static INPUT_PORTS_START( sf2049 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("View 3") PORT_PLAYER(1) /* view 3 */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Music") PORT_PLAYER(1) /* music */
PORT_BIT( 0x0070, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegas_state, keypad_r, "KEYPAD" )
- PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("1st Gear") PORT_PLAYER(1) /* 1st gear */
- PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("2nd Gear") PORT_PLAYER(1) /* 2nd gear */
- PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("3rd Gear") PORT_PLAYER(1) /* 3rd gear */
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("4th Gear") PORT_PLAYER(1) /* 4th gear */
+ PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegas_state, gearshift_r, "GEAR" )
+
+ PORT_START("GEAR")
+ PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("1st Gear") PORT_PLAYER(1) /* 1st gear */
+ PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("2nd Gear") PORT_PLAYER(1) /* 2nd gear */
+ PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("3rd Gear") PORT_PLAYER(1) /* 3rd gear */
+ PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("4th Gear") PORT_PLAYER(1) /* 4th gear */
PORT_START("KEYPAD")
PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_CODE(KEYCODE_1_PAD) /* keypad 1 */
@@ -1435,23 +1507,26 @@ static INPUT_PORTS_START( sf2049 )
PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Keypad #") PORT_CODE(KEYCODE_PLUS_PAD) /* keypad + */
PORT_MODIFY("AN.2") /* Accel */
- PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(100)
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_PLAYER(1)
PORT_MODIFY("AN.3") /* Clutch */
- PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_PLAYER(1)
PORT_MODIFY("AN.6") /* Brake */
- PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_PLAYER(1)
PORT_MODIFY("AN.7") /* Steer */
- PORT_BIT(0xff, 0x80, IPT_PADDLE) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
+ PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
INPUT_PORTS_END
static INPUT_PORTS_START( sf2049se )
PORT_INCLUDE(sf2049)
PORT_MODIFY("DIPS")
- PORT_DIPUNUSED( 0x003e, 0x003e )
+ PORT_DIPUNUSED( 0x001e, 0x001e )
+ PORT_DIPNAME(0x0020, 0x0020, "Boot Message")
+ PORT_DIPSETTING( 0x0020, "Quiet")
+ PORT_DIPSETTING( 0x0000, "Squawk During Boot")
PORT_DIPNAME( 0x00c0, 0x00c0, "Test Mode" )
PORT_DIPSETTING( 0x00c0, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0080, "Disk-based Test" )
@@ -1463,8 +1538,8 @@ static INPUT_PORTS_START( sf2049se )
PORT_DIPUNUSED( 0x1f00, 0x1f00 )
PORT_DIPNAME( 0xc000, 0x8000, "Resolution" )
PORT_DIPSETTING( 0xc000, "Standard Res 512x256" )
- PORT_DIPSETTING( 0x8000, "Medium Res 512x384" )
- PORT_DIPSETTING( 0x0000, "VGA Res 640x480" )
+ PORT_DIPSETTING( 0x4000, "Medium Res 512x384" )
+ PORT_DIPSETTING( 0x8000, "VGA Res 640x480" )
PORT_DIPNAME( 0x2000, 0x2000, "Cabinet Type" )
PORT_DIPSETTING( 0x2000, "Sit down cabinet" )
PORT_DIPSETTING( 0x0000, "Upright cabinet" )
@@ -1474,15 +1549,51 @@ static INPUT_PORTS_START( cartfury )
PORT_INCLUDE(vegas_common)
PORT_MODIFY("DIPS")
+ PORT_DIPNAME( 0x0001, 0x0000, "Coinage Source" )
+ PORT_DIPSETTING( 0x0001, "Dipswitch" )
+ PORT_DIPSETTING( 0x0000, "CMOS" )
+ PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Coinage ) )
+ PORT_DIPSETTING( 0x000e, "Mode 1" )
+ PORT_DIPSETTING( 0x000c, "Mode 2" )
+ PORT_DIPSETTING( 0x000a, "Mode 3" )
+ PORT_DIPSETTING( 0x0008, "Mode 4" )
+ PORT_DIPSETTING( 0x0006, "Mode 5")
+ PORT_DIPSETTING( 0x0004, "Mode 6")
+ PORT_DIPSETTING( 0x0002, "Mode 7")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
+ PORT_DIPNAME( 0x0030, 0x0030, "Curency Type" )
+ PORT_DIPSETTING( 0x0030, DEF_STR( USA ) )
+ PORT_DIPSETTING( 0x0020, DEF_STR( French ) )
+ PORT_DIPSETTING( 0x0010, DEF_STR( German ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
+ PORT_DIPNAME( 0x2000, 0x2000, "Disable Brake" )
+ PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x8000, 0x8000, "Test Switch" )
+ PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+
+ PORT_MODIFY("IN1")
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("View 1") PORT_PLAYER(1) /* view 1 */
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("View 2") PORT_PLAYER(1) /* view 2 */
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("View 3") PORT_PLAYER(1) /* view 3 */
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("Music") PORT_PLAYER(1) /* music */
+ PORT_BIT( 0x0f00, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, vegas_state, gearshift_r, "GEAR" )
+
+ PORT_START("GEAR")
+ PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("1st Gear") PORT_PLAYER(1) /* 1st gear */
+ PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("2nd Gear") PORT_PLAYER(1) /* 2nd gear */
+ PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("3rd Gear") PORT_PLAYER(1) /* 3rd gear */
+ PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("4th Gear") PORT_PLAYER(1) /* 4th gear */
PORT_MODIFY("AN.0") /* Steer */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
PORT_MODIFY("AN.1") /* Accel */
- PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_PLAYER(1)
PORT_MODIFY("AN.2") /* Brake */
- PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(100)
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_PLAYER(1)
INPUT_PORTS_END
@@ -1524,6 +1635,12 @@ static ADDRESS_MAP_START(vegas_cs7_map, AS_PROGRAM, 32, vegas_state)
AM_RANGE(0x00007000, 0x00007003) AM_DEVREADWRITE("dcs", dcs_audio_device, dsio_idma_data_r, dsio_idma_data_w) // if (m_dcs_idma_cs == 7)
ADDRESS_MAP_END
+static ADDRESS_MAP_START(vegas_cs8_map, AS_PROGRAM, 32, vegas_state)
+ AM_RANGE(0x01000000, 0x0100001f) AM_DEVREADWRITE8("uart2", ns16550_device, ins8250_r, ins8250_w, 0xff) // Serial UART2 (TL16C552 CS0)
+ AM_RANGE(0x01400000, 0x0140001f) AM_DEVREADWRITE8("uart1", ns16550_device, ins8250_r, ins8250_w, 0xff) // Serial UART1 (TL16C552 CS1)
+ AM_RANGE(0x01800000, 0x0180001f) AM_READWRITE8(parallel_r, parallel_w, 0xff) // Parallel UART (TL16C552 CS2)
+ADDRESS_MAP_END
+
/*************************************
*
* Machine drivers
@@ -1533,10 +1650,10 @@ ADDRESS_MAP_END
static MACHINE_CONFIG_START( vegascore )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", R5000LE, vrc5074_device::SYSTEM_CLOCK*2)
+ MCFG_CPU_ADD("maincpu", R5000LE, vegas_state::SYSTEM_CLOCK*2)
MCFG_MIPS3_ICACHE_SIZE(16384)
MCFG_MIPS3_DCACHE_SIZE(16384)
- MCFG_MIPS3_SYSTEM_CLOCK(vrc5074_device::SYSTEM_CLOCK)
+ MCFG_MIPS3_SYSTEM_CLOCK(vegas_state::SYSTEM_CLOCK)
// PCI Bus Devices
MCFG_PCI_ROOT_ADD(":pci")
@@ -1584,19 +1701,21 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( vegas250, vegascore )
MCFG_CPU_MODIFY("maincpu")
- MCFG_CPU_CLOCK(vrc5074_device::SYSTEM_CLOCK*2.5)
+ MCFG_CPU_CLOCK(vegas_state::SYSTEM_CLOCK*2.5)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( vegas32m, vegascore )
+static MACHINE_CONFIG_DERIVED( vegas32m, vegas250)
MCFG_DEVICE_MODIFY(PCI_ID_NILE)
MCFG_VRC5074_SET_SDRAM(0, 0x02000000)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( vegasban, vegascore )
- MCFG_DEVICE_MODIFY(PCI_ID_NILE)
- MCFG_VRC5074_SET_SDRAM(0, 0x02000000)
+static MACHINE_CONFIG_DERIVED( vegasban, vegas32m)
+ // Short term hack to get nbashowt, nbanfl, nbagold to boot.
+ // Probably due to CRTC registers not used for timing in voodoo
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_REFRESH_RATE(120)
MCFG_DEVICE_REMOVE(PCI_ID_VIDEO)
MCFG_VOODOO_PCI_ADD(PCI_ID_VIDEO, TYPE_VOODOO_BANSHEE, ":maincpu")
@@ -1606,11 +1725,16 @@ static MACHINE_CONFIG_DERIVED( vegasban, vegascore )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( vegasv3, vegascore)
- MCFG_CPU_REPLACE("maincpu", RM7000LE, vrc5074_device::SYSTEM_CLOCK*2.5)
+static MACHINE_CONFIG_DERIVED( vegasv3, vegas32m)
+ MCFG_CPU_REPLACE("maincpu", RM7000LE, vegas_state::SYSTEM_CLOCK*2.5)
MCFG_MIPS3_ICACHE_SIZE(16384)
MCFG_MIPS3_DCACHE_SIZE(16384)
- MCFG_MIPS3_SYSTEM_CLOCK(vrc5074_device::SYSTEM_CLOCK)
+ MCFG_MIPS3_SYSTEM_CLOCK(vegas_state::SYSTEM_CLOCK)
+
+ // Short term hack to get cartfury to boot.
+ // Probably due to CRTC registers not used for timing in voodoo
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_REFRESH_RATE(120)
MCFG_DEVICE_REMOVE(PCI_ID_VIDEO)
MCFG_VOODOO_PCI_ADD(PCI_ID_VIDEO, TYPE_VOODOO_3, ":maincpu")
@@ -1621,18 +1745,48 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( denver, vegascore )
- MCFG_CPU_REPLACE("maincpu", RM7000LE, vrc5074_device::SYSTEM_CLOCK*2.5)
+ MCFG_CPU_REPLACE("maincpu", RM7000LE, vegas_state::SYSTEM_CLOCK*2.5)
MCFG_MIPS3_ICACHE_SIZE(16384)
MCFG_MIPS3_DCACHE_SIZE(16384)
- MCFG_MIPS3_SYSTEM_CLOCK(vrc5074_device::SYSTEM_CLOCK)
+ MCFG_MIPS3_SYSTEM_CLOCK(vegas_state::SYSTEM_CLOCK)
+
MCFG_DEVICE_MODIFY(PCI_ID_NILE)
MCFG_VRC5074_SET_SDRAM(0, 0x02000000)
+ MCFG_VRC5074_SET_CS(8, vegas_cs8_map)
MCFG_DEVICE_REMOVE(PCI_ID_VIDEO)
MCFG_VOODOO_PCI_ADD(PCI_ID_VIDEO, TYPE_VOODOO_3, ":maincpu")
MCFG_VOODOO_PCI_FBMEM(16)
MCFG_DEVICE_MODIFY(PCI_ID_VIDEO":voodoo")
MCFG_VOODOO_VBLANK_CB(DEVWRITELINE(":", vegas_state, vblank_assert))
+
+ // TL16C552 UART
+ MCFG_DEVICE_ADD("uart1", NS16550, vegas_state::SYSTEM_CLOCK / 12)
+ MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("com1", rs232_port_device, write_txd))
+ MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("com1", rs232_port_device, write_dtr))
+ MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("com1", rs232_port_device, write_rts))
+ MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(":", vegas_state, uart1_irq_cb))
+
+ MCFG_DEVICE_ADD("uart2", NS16550, vegas_state::SYSTEM_CLOCK / 12)
+ MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("com2", rs232_port_device, write_txd))
+ MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("com2", rs232_port_device, write_dtr))
+ MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("com2", rs232_port_device, write_rts))
+ MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(":", vegas_state, uart2_irq_cb))
+
+ MCFG_RS232_PORT_ADD("com1", default_rs232_devices, nullptr)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart1", ins8250_uart_device, rx_w))
+ MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart1", ins8250_uart_device, dcd_w))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart1", ins8250_uart_device, dsr_w))
+ MCFG_RS232_RI_HANDLER(DEVWRITELINE("uart1", ins8250_uart_device, ri_w))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart1", ins8250_uart_device, cts_w))
+
+ MCFG_RS232_PORT_ADD("com2", default_rs232_devices, nullptr)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart2", ins8250_uart_device, rx_w))
+ MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart2", ins8250_uart_device, dcd_w))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart2", ins8250_uart_device, dsr_w))
+ MCFG_RS232_RI_HANDLER(DEVWRITELINE("uart2", ins8250_uart_device, ri_w))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart2", ins8250_uart_device, cts_w))
+
MACHINE_CONFIG_END
// Per driver configs
@@ -1763,7 +1917,7 @@ static MACHINE_CONFIG_DERIVED( sf2049se, denver )
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_SFRUSHRK)
- MCFG_MIDWAY_IOASIC_UPPER(336/* others? */)
+ MCFG_MIDWAY_IOASIC_UPPER(352/*352 336 others? */)
MCFG_MIDWAY_IOASIC_YEAR_OFFS(80)
MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(WRITELINE(vegas_state, ioasic_irq))
MCFG_MIDWAY_IOASIC_AUTO_ACK(1)
@@ -1776,7 +1930,7 @@ static MACHINE_CONFIG_DERIVED( sf2049te, denver )
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_SFRUSHRK)
- MCFG_MIDWAY_IOASIC_UPPER(348/* others? */)
+ MCFG_MIDWAY_IOASIC_UPPER(348/* 348 others? */)
MCFG_MIDWAY_IOASIC_YEAR_OFFS(80)
MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(WRITELINE(vegas_state, ioasic_irq))
MCFG_MIDWAY_IOASIC_AUTO_ACK(1)
@@ -1789,10 +1943,11 @@ static MACHINE_CONFIG_DERIVED( cartfury, vegasv3 )
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_CARNEVIL)
- MCFG_MIDWAY_IOASIC_UPPER(433/* 495 others? */)
+ // 433, 495 Development PIC
+ MCFG_MIDWAY_IOASIC_UPPER(495/*433, 495 others? */)
MCFG_MIDWAY_IOASIC_YEAR_OFFS(80)
MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(WRITELINE(vegas_state, ioasic_irq))
- MCFG_MIDWAY_IOASIC_AUTO_ACK(1)
+ //MCFG_MIDWAY_IOASIC_AUTO_ACK(1)
MACHINE_CONFIG_END
@@ -2215,7 +2370,7 @@ GAME( 2000, nbagold , 0, nbagold, nbashowt, vegas_state, nbanfl, ROT
/* Durango + Denver SIO + Voodoo 3 */
GAMEL( 1998, sf2049, 0, sf2049, sf2049, vegas_state, sf2049, ROT0, "Atari Games", "San Francisco Rush 2049", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_sf2049 )
GAMEL( 1998, sf2049se, sf2049, sf2049se, sf2049se, vegas_state, sf2049se, ROT0, "Atari Games", "San Francisco Rush 2049: Special Edition", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_sf2049 )
-GAMEL( 1998, sf2049te, sf2049, sf2049te, sf2049, vegas_state, sf2049te, ROT0, "Atari Games", "San Francisco Rush 2049: Tournament Edition", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_sf2049 )
+GAMEL( 1998, sf2049te, sf2049, sf2049te, sf2049se, vegas_state, sf2049te, ROT0, "Atari Games", "San Francisco Rush 2049: Tournament Edition", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_sf2049 )
/* Durango + Vegas SIO + Voodoo 3 */
GAME( 2000, cartfury, 0, cartfury, cartfury, vegas_state, cartfury, ROT0, "Midway Games", "Cart Fury", MACHINE_NO_SOUND | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/victor9k.cpp b/src/mame/drivers/victor9k.cpp
index 616a8129095..2087f0f1a72 100644
--- a/src/mame/drivers/victor9k.cpp
+++ b/src/mame/drivers/victor9k.cpp
@@ -713,7 +713,8 @@ static MACHINE_CONFIG_START( victor9k )
MCFG_IEEE488_NRFD_CALLBACK(WRITELINE(victor9k_state, write_nfrd))
MCFG_IEEE488_NDAC_CALLBACK(WRITELINE(victor9k_state, write_ndac))
- MCFG_PIC8259_ADD(I8259A_TAG, INPUTLINE(I8088_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+ MCFG_DEVICE_ADD(I8259A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(I8088_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0)
MCFG_PIT8253_CLK0(2500000)
diff --git a/src/mame/drivers/vindictr.cpp b/src/mame/drivers/vindictr.cpp
index b757fe65406..bf9191291ae 100644
--- a/src/mame/drivers/vindictr.cpp
+++ b/src/mame/drivers/vindictr.cpp
@@ -23,6 +23,7 @@
#include "includes/vindictr.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
#include "speaker.h"
@@ -74,8 +75,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, vindictr_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0x3fffff)
AM_RANGE(0x000000, 0x05ffff) AM_ROM
- AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x0e0000, 0x0e0fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
+ AM_RANGE(0x1f0000, 0x1fffff) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
AM_RANGE(0x260010, 0x26001f) AM_READ(port1_r)
AM_RANGE(0x260020, 0x26002f) AM_READ_PORT("260020")
@@ -189,7 +190,8 @@ static MACHINE_CONFIG_START( vindictr )
MCFG_MACHINE_RESET_OVERRIDE(vindictr_state,vindictr)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/wallc.cpp b/src/mame/drivers/wallc.cpp
index ecb67e8a73c..b3c42a1d9d3 100644
--- a/src/mame/drivers/wallc.cpp
+++ b/src/mame/drivers/wallc.cpp
@@ -66,22 +66,34 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_videoram(*this, "videoram") { }
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
-
- required_shared_ptr<uint8_t> m_videoram;
+ DECLARE_WRITE8_MEMBER(videoram_w);
+ DECLARE_WRITE8_MEMBER(wallc_coin_counter_w);
+ DECLARE_WRITE8_MEMBER(unkitpkr_out0_w);
+ DECLARE_WRITE8_MEMBER(unkitpkr_out1_w);
+ DECLARE_WRITE8_MEMBER(unkitpkr_out2_w);
- tilemap_t *m_bg_tilemap;
+ TILE_GET_INFO_MEMBER(get_bg_tile_info);
+ TILE_GET_INFO_MEMBER(get_bg_tile_info_unkitpkr);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE8_MEMBER(wallc_videoram_w);
- DECLARE_WRITE8_MEMBER(wallc_coin_counter_w);
+ DECLARE_PALETTE_INIT(wallc);
+ DECLARE_PALETTE_INIT(unkitpkr);
+ DECLARE_VIDEO_START(unkitpkr);
DECLARE_DRIVER_INIT(wallc);
DECLARE_DRIVER_INIT(wallca);
DECLARE_DRIVER_INIT(sidam);
- TILE_GET_INFO_MEMBER(get_bg_tile_info);
+ DECLARE_DRIVER_INIT(unkitpkr);
+
+protected:
virtual void video_start() override;
- DECLARE_PALETTE_INIT(wallc);
- uint32_t screen_update_wallc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+
+ required_shared_ptr<uint8_t> m_videoram;
+
+ tilemap_t *m_bg_tilemap;
};
@@ -148,7 +160,46 @@ PALETTE_INIT_MEMBER(wallc_state, wallc)
}
}
-WRITE8_MEMBER(wallc_state::wallc_videoram_w)
+PALETTE_INIT_MEMBER(wallc_state, unkitpkr)
+{
+// this pcb has 470 ohms resistors instead of the expected 330 ohms.
+ const uint8_t *color_prom = memregion("proms")->base();
+ int i;
+
+ static const int resistances_rg[2] = { 470, 220 };
+ static const int resistances_b[3] = { 655, 470, 220 };
+ double weights_r[2], weights_g[2], weights_b[3];
+
+ compute_resistor_weights(0, 255, -1.0,
+ 2, resistances_rg, weights_r, 470, 0,
+ 2, resistances_rg, weights_g, 470, 0,
+ 3, resistances_b, weights_b, 470, 655+220);
+
+ for (i = 0;i < palette.entries();i++)
+ {
+ int bit0,bit1,bit7,r,g,b;
+
+ /* red component */
+ bit0 = (color_prom[i] >> 5) & 0x01;
+ bit1 = (color_prom[i] >> 6) & 0x01;
+ r = combine_2_weights(weights_r, bit1, bit0);
+
+ /* green component */
+ bit0 = (color_prom[i] >> 2) & 0x01;
+ bit1 = (color_prom[i] >> 3) & 0x01;
+ g = combine_2_weights(weights_g, bit1, bit0);
+
+ /* blue component */
+ bit0 = (color_prom[i] >> 0) & 0x01;
+ bit1 = (color_prom[i] >> 1) & 0x01;
+ bit7 = (color_prom[i] >> 7) & 0x01;
+ b = combine_3_weights(weights_b, bit7, bit1, bit0);
+
+ palette.set_pen_color(i,rgb_t(r,g,b));
+ }
+}
+
+WRITE8_MEMBER(wallc_state::videoram_w)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
@@ -156,28 +207,59 @@ WRITE8_MEMBER(wallc_state::wallc_videoram_w)
TILE_GET_INFO_MEMBER(wallc_state::get_bg_tile_info)
{
- SET_TILE_INFO_MEMBER(0, m_videoram[tile_index] + 0x100, 1, 0);
+ SET_TILE_INFO_MEMBER(0, m_videoram[tile_index] | 0x100, 1, 0);
+}
+
+TILE_GET_INFO_MEMBER(wallc_state::get_bg_tile_info_unkitpkr)
+{
+ int code = m_videoram[tile_index];
+
+ // hack to display cards (TODO: what determines tile banking?)
+ if ((tile_index & 0x1f) < 0x08 || (tile_index & 0x1f) >= 0x10)
+ code |= 0x100;
+
+ SET_TILE_INFO_MEMBER(0, code, 1, 0);
}
void wallc_state::video_start()
{
- m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wallc_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32);
+ m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wallc_state::get_bg_tile_info), this), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32);
}
-uint32_t wallc_state::screen_update_wallc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+VIDEO_START_MEMBER(wallc_state, unkitpkr)
+{
+ m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wallc_state::get_bg_tile_info_unkitpkr), this), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32);
+}
+
+uint32_t wallc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
+
WRITE8_MEMBER(wallc_state::wallc_coin_counter_w)
{
- machine().bookkeeping().coin_counter_w(0,data & 2);
+ machine().bookkeeping().coin_counter_w(0, data & 2);
+}
+
+
+WRITE8_MEMBER(wallc_state::unkitpkr_out0_w)
+{
+}
+
+WRITE8_MEMBER(wallc_state::unkitpkr_out1_w)
+{
+ machine().bookkeeping().coin_counter_w(0, BIT(data, 4));
+}
+
+WRITE8_MEMBER(wallc_state::unkitpkr_out2_w)
+{
}
static ADDRESS_MAP_START( wallc_map, AS_PROGRAM, 8, wallc_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(wallc_videoram_w) AM_MIRROR(0xc00) AM_SHARE("videoram") /* 2114, 2114 */
+ AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(videoram_w) AM_MIRROR(0xc00) AM_SHARE("videoram") /* 2114, 2114 */
AM_RANGE(0xa000, 0xa3ff) AM_RAM /* 2114, 2114 */
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1")
@@ -192,6 +274,24 @@ static ADDRESS_MAP_START( wallc_map, AS_PROGRAM, 8, wallc_state )
AM_RANGE(0xb600, 0xb600) AM_DEVWRITE("aysnd", ay8912_device, data_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( unkitpkr_map, AS_PROGRAM, 8, wallc_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM
+ AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(videoram_w) AM_MIRROR(0xc00) AM_SHARE("videoram") /* 2114, 2114 */
+ AM_RANGE(0xa000, 0xa3ff) AM_RAM /* 2114, 2114 */
+
+ AM_RANGE(0xb000, 0xb000) AM_READ_PORT("IN0")
+ AM_RANGE(0xb100, 0xb100) AM_READ_PORT("IN1")
+ AM_RANGE(0xb200, 0xb200) AM_READ_PORT("IN2")
+ AM_RANGE(0xb300, 0xb300) AM_READ_PORT("IN3")
+ AM_RANGE(0xb500, 0xb5ff) AM_READNOP // read by memory test routine. left over from some other game
+
+ AM_RANGE(0xb000, 0xb000) AM_WRITE(unkitpkr_out0_w)
+ AM_RANGE(0xb100, 0xb100) AM_WRITE(unkitpkr_out1_w)
+ AM_RANGE(0xb200, 0xb200) AM_WRITE(unkitpkr_out2_w)
+ AM_RANGE(0xb500, 0xb500) AM_DEVWRITE("aysnd", ay8912_device, address_w)
+ AM_RANGE(0xb600, 0xb600) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) // Port A = DSW
+ADDRESS_MAP_END
+
static INPUT_PORTS_START( wallc )
PORT_START("SYSTEM") /* b200 */
@@ -250,6 +350,66 @@ static INPUT_PORTS_START( wallc )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) /* Shown as "Unused" in the manual */
INPUT_PORTS_END
+static INPUT_PORTS_START( unkitpkr )
+ PORT_START("IN0") /* b000 */
+ 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("IN1") /* b100 */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // coin out
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 )
+
+ PORT_START("IN2") /* b200 */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )
+
+ PORT_START("IN3") /* b300 */
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_CANCEL )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) // ok?
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
+
+ PORT_START("DSW") /* b600 */
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2") // ok
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_5C ) )
+ PORT_DIPSETTING( 0x03, "1 Coin/10 Credits" )
+ PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:3,4") // ok
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
+ PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
+ PORT_DIPNAME( 0x30, 0x00, "Coin C" ) PORT_DIPLOCATION("SW2:5,6") // ok
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_5C ) )
+ PORT_DIPSETTING( 0x30, "1 Coin/10 Credits" )
+ PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" )
+ PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
+INPUT_PORTS_END
static const gfx_layout charlayout =
@@ -267,7 +427,8 @@ static GFXDECODE_START( wallc )
GFXDECODE_ENTRY( "gfx1", 0 , charlayout, 0, 4 )
GFXDECODE_END
-DRIVER_INIT_MEMBER(wallc_state,wallc)
+
+DRIVER_INIT_MEMBER(wallc_state, wallc)
{
uint8_t c;
uint32_t i;
@@ -282,7 +443,7 @@ DRIVER_INIT_MEMBER(wallc_state,wallc)
}
}
-DRIVER_INIT_MEMBER(wallc_state,wallca)
+DRIVER_INIT_MEMBER(wallc_state, wallca)
{
uint8_t c;
uint32_t i;
@@ -307,12 +468,11 @@ DRIVER_INIT_MEMBER(wallc_state,wallca)
}
-
static MACHINE_CONFIG_START( wallc )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 12288000 / 4) /* 3.072 MHz ? */
MCFG_CPU_PROGRAM_MAP(wallc_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", wallc_state, irq0_line_hold)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", wallc_state, irq0_line_hold)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -320,7 +480,7 @@ static MACHINE_CONFIG_START( wallc )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(wallc_state, screen_update_wallc)
+ MCFG_SCREEN_UPDATE_DRIVER(wallc_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", wallc)
@@ -333,6 +493,23 @@ static MACHINE_CONFIG_START( wallc )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( unkitpkr, wallc )
+
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(unkitpkr_map)
+
+ MCFG_VIDEO_START_OVERRIDE(wallc_state, unkitpkr)
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(wallc_state, unkitpkr)
+
+ /* sound hardware */
+ MCFG_SOUND_MODIFY("aysnd")
+ MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW"))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+MACHINE_CONFIG_END
+
+
/***************************************************************************
Game driver(s)
@@ -382,7 +559,6 @@ ROM_START( brkblast )
ROM_END
-
/*
It use a epoxy brick like wallc
@@ -401,7 +577,7 @@ Inside the brick there are:
-negate A15 to feed 74245 /EN ALWAYS
-The 74245 let pass the data unmodifyed if A15 is high (like wallc)
+The 74245 let pass the data unmodified if A15 is high (like wallc)
If A15 is low a Pal16r4 kick in
this chip can modify D2,D3,D4,D5,D6,D7
@@ -445,7 +621,7 @@ ROM_START( sidampkr )
ROM_LOAD( "11607-74.288", 0x0000, 0x0020, CRC(e14bf545) SHA1(5e8c5a9ea6e4842f27a47c1d7224ed294bbaa40b) )
ROM_END
-DRIVER_INIT_MEMBER(wallc_state,sidam)
+DRIVER_INIT_MEMBER(wallc_state, sidam)
{
uint8_t c;
uint32_t i;
@@ -488,12 +664,79 @@ DRIVER_INIT_MEMBER(wallc_state,sidam)
c = ROM[ i ] ^ 0x0f;
ROM[ i ] = c;
}
+}
+
+/*
+ Unknown Italian Poker
+ Seems a brute hack of an unknown game.
+
+ The "conforme alla legge n." string is overwritting the hands table:
+
+ "CONFORME" = Royal Flush
+ (blank line) = Straight Flush
+ "ALLA LEGGE" = Four of a Kind
+ (blank line) = Full House
+ "N.904 DEL" = Flush
+ (blank line) = Straight
+ "17.12.1986" = Three of a Kind
+ (blank line) = Double Pair
+ "........." = Simple Pair
+
+ Also the code is hacked/patched to avoid some jumps:
+
+ 00cb: ld a,(hl)
+ 00cc: cp c
+ 00cd: nop
+ 00ce: nop
+ 00cf: nop
+
+ 00d2: ld a,(hl)
+ 00d3: cp c
+ 00d4: nop
+ 00d5: nop
+ 00d6: nop
+
+ 1866: pop af
+ 1867: cp $46
+ 1869: nop
+ 186a: nop
+ 186b: nop
+*/
+ROM_START( unkitpkr )
+ ROM_REGION( 0x8000, "maincpu", 0 )
+ ROM_LOAD( "1", 0x0000, 0x2000, CRC(82dacf83) SHA1(d2bd4664737aeb968e9e34da74c2654e556c8567) )
+ ROM_REGION( 0x3000, "gfx1", 0 )
+ ROM_LOAD( "2", 0x0000, 0x1000, CRC(a359b7aa) SHA1(832a0dfd0689f76381f34d2d8419a7f09a6c403a) )
+ ROM_CONTINUE( 0x0000, 0x1000 ) // first half is empty
+ ROM_LOAD( "3", 0x1000, 0x1000, CRC(f7d7d48b) SHA1(d9787dcbbfdb5f8f8434d8e688c1ee1e0566969d) )
+ ROM_CONTINUE( 0x1000, 0x1000 ) // first half is empty
+ ROM_LOAD( "5", 0x2000, 0x1000, CRC(b3084b49) SHA1(21b2fa41492faf95e66c5765acfdae1685ee8784) )
+ ROM_CONTINUE( 0x2000, 0x1000 ) // first half is empty
+
+ ROM_REGION( 0x0020, "proms", 0 )
+ ROM_LOAD( "74s288.c2", 0x0000, 0x0020, CRC(83e3e293) SHA1(a98c5e63b688de8d175adb6539e0cdc668f313fd) ) // dumped; matches the wallc bp
+ROM_END
+
+DRIVER_INIT_MEMBER(wallc_state, unkitpkr)
+{
+ // line swapping is too annoying to handle with ROM_LOAD macros
+ uint8_t buffer[0x400];
+ for (int b = 0; b < 0x3000; b += 0x400)
+ {
+ uint8_t *gfxrom = memregion("gfx1")->base() + b;
+ for (int a = 0; a < 0x400; a++)
+ buffer[a] = gfxrom[(a & 0x03f) | (a & 0x280) >> 1 | (a & 0x140) << 1];
+ memcpy(gfxrom, &buffer[0], 0x400);
+ }
}
-GAME( 1984, wallc, 0, wallc, wallc, wallc_state, wallc, ROT0, "Midcoin", "Wall Crash (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, wallca, wallc, wallc, wallc, wallc_state, wallca, ROT0, "Midcoin", "Wall Crash (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, brkblast, wallc, wallc, wallc, wallc_state, wallca, ROT0, "bootleg (Fadesa)", "Brick Blast (bootleg of Wall Crash)", MACHINE_SUPPORTS_SAVE ) // Spanish bootleg board, Fadesa stickers / text on various components
-GAME( 1984, sidampkr, 0, wallc, wallc, wallc_state, sidam, ROT270, "Sidam", "unknown Sidam Poker", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
+// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS
+GAME( 1984, wallc, 0, wallc, wallc, wallc_state, wallc, ROT0, "Midcoin", "Wall Crash (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, wallca, wallc, wallc, wallc, wallc_state, wallca, ROT0, "Midcoin", "Wall Crash (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, brkblast, wallc, wallc, wallc, wallc_state, wallca, ROT0, "bootleg (Fadesa)", "Brick Blast (bootleg of Wall Crash)", MACHINE_SUPPORTS_SAVE ) // Spanish bootleg board, Fadesa stickers / text on various components
+
+GAME( 1984, sidampkr, 0, wallc, wallc, wallc_state, sidam, ROT270, "Sidam", "unknown Sidam Poker", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
+GAME( 198?, unkitpkr, 0, unkitpkr, unkitpkr, wallc_state, unkitpkr, ROT0, "<unknown>", "unknown Italian poker game", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/wangpc.cpp b/src/mame/drivers/wangpc.cpp
index 200cb8cba00..1cdd9ce91af 100644
--- a/src/mame/drivers/wangpc.cpp
+++ b/src/mame/drivers/wangpc.cpp
@@ -1289,7 +1289,8 @@ static MACHINE_CONFIG_START( wangpc )
MCFG_AM9517A_OUT_DACK_2_CB(WRITELINE(wangpc_state, dack2_w))
MCFG_AM9517A_OUT_DACK_3_CB(WRITELINE(wangpc_state, dack3_w))
- MCFG_PIC8259_ADD(I8259A_TAG, INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0), VCC, NOOP)
+ MCFG_DEVICE_ADD(I8259A_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD(I8255A_TAG, I8255A, 0)
MCFG_I8255_IN_PORTA_CB(READ8(wangpc_state, ppi_pa_r))
diff --git a/src/mame/drivers/wc90.cpp b/src/mame/drivers/wc90.cpp
index a66e4ce30e3..5116d20b951 100644
--- a/src/mame/drivers/wc90.cpp
+++ b/src/mame/drivers/wc90.cpp
@@ -399,7 +399,7 @@ static MACHINE_CONFIG_DERIVED( pac90, wc90 )
MACHINE_CONFIG_END
-ROM_START( wc90 )
+ROM_START( twcup90 )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "ic87_01.bin", 0x00000, 0x08000, CRC(4a1affbc) SHA1(bc531e97ca31c66fdac194e2d79d5c6ba1300556) ) /* c000-ffff is not used */
ROM_LOAD( "ic95_02.bin", 0x10000, 0x10000, CRC(847d439c) SHA1(eade31050da9e84feb4406e327d050a7496871b7) ) /* banked at f000-f7ff */
@@ -433,7 +433,7 @@ ROM_START( wc90 )
ROM_END
-ROM_START( wc90a )
+ROM_START( twcup90a )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "wc90-1.bin", 0x00000, 0x08000, CRC(d1804e1a) SHA1(eec7374f4d23c89843f38fffff436635adb43b63) ) /* c000-ffff is not used */
ROM_LOAD( "ic95_02.bin", 0x10000, 0x10000, CRC(847d439c) SHA1(eade31050da9e84feb4406e327d050a7496871b7) ) /* banked at f000-f7ff */
@@ -466,7 +466,7 @@ ROM_START( wc90a )
ROM_LOAD( "ic82_06.bin", 0x00000, 0x20000, CRC(2fd692ed) SHA1(0273dc39181504320bec0187d074b2f86c821508) )
ROM_END
-ROM_START( wc90b )
+ROM_START( twcup90b )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "ic87-1b.bin", 0x00000, 0x08000, CRC(d024a971) SHA1(856c6ab7abc1cd6db42703f70930b84e3da69db0) ) /* c000-ffff is not used */
ROM_LOAD( "ic95_02.bin", 0x10000, 0x10000, CRC(847d439c) SHA1(eade31050da9e84feb4406e327d050a7496871b7) ) /* banked at f000-f7ff */
@@ -499,7 +499,7 @@ ROM_START( wc90b )
ROM_LOAD( "ic82_06.bin", 0x00000, 0x20000, CRC(2fd692ed) SHA1(0273dc39181504320bec0187d074b2f86c821508) )
ROM_END
-ROM_START( wc90t )
+ROM_START( twcup90t )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "wc90a-1.bin", 0x00000, 0x08000, CRC(b6f51a68) SHA1(e0263dee35bf99cb4288a1df825bbbca17c85d36) ) /* c000-ffff is not used */
ROM_LOAD( "wc90a-2.bin", 0x10000, 0x10000, CRC(c50f2a98) SHA1(0fbeabadebfa75515d5e35bfcc565ecfa4d6e693) ) /* banked at f000-f7ff */
@@ -563,9 +563,9 @@ ROM_START( pac90 )
ROM_END
-GAME( 1989, wc90, 0, wc90, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (World)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1989, wc90a, wc90, wc90, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (Euro set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1989, wc90b, wc90, wc90, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (Euro set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1989, wc90t, wc90, wc90t, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (trackball set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, twcup90, 0, wc90, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (World)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, twcup90a, twcup90, wc90, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (Euro set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, twcup90b, twcup90, wc90, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (Euro set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, twcup90t, twcup90, wc90t, wc90, wc90_state, 0, ROT0, "Tecmo", "Tecmo World Cup '90 (trackball set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 199?, pac90, puckman, pac90, pac90, wc90_state, 0, ROT90, "bootleg (Macro)", "Pac-Man (bootleg on World Cup '90 hardware)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // made by Mike Coates etc.
diff --git a/src/mame/drivers/wc90b.cpp b/src/mame/drivers/wc90b.cpp
index 0b8da2877bc..826d18ee438 100644
--- a/src/mame/drivers/wc90b.cpp
+++ b/src/mame/drivers/wc90b.cpp
@@ -396,7 +396,7 @@ static MACHINE_CONFIG_START( wc90b )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
MACHINE_CONFIG_END
-ROM_START( wc90b1 )
+ROM_START( twcup90b1 )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "a02.bin", 0x00000, 0x10000, CRC(192a03dd) SHA1(ab98d370bba5437f956631b0199b173be55f1c27) ) /* c000-ffff is not used */
ROM_LOAD( "a03.bin", 0x10000, 0x10000, CRC(f54ff17a) SHA1(a19850fc28a5a0da20795a5cc6b56d9c16554bce) ) /* banked at f000-f7ff */
@@ -438,7 +438,7 @@ ROM_START( wc90b1 )
ROM_LOAD( "el_ic143_gal16v8_4.bin", 0x0800, 0x0117, NO_DUMP SHA1(fbe632437eac2418da7a3c3e947cfd36f6211407) )
ROM_END
-ROM_START( wc90b2 )
+ROM_START( twcup90b2 )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "a02", 0x00000, 0x10000, CRC(1e6e94c9) SHA1(1731e3e3b5d17ba676a7e42638d7206212a0080d) ) /* c000-ffff is not used */
ROM_LOAD( "a03.bin", 0x10000, 0x10000, CRC(f54ff17a) SHA1(a19850fc28a5a0da20795a5cc6b56d9c16554bce) ) /* banked at f000-f7ff */
@@ -491,7 +491,7 @@ ROM_END
00000590: 0F 0B
00000591: FF FA
*/
-ROM_START( wc90ba )
+ROM_START( twcup90ba )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "a02.bin", 0x00000, 0x10000, CRC(192a03dd) SHA1(ab98d370bba5437f956631b0199b173be55f1c27) ) /* c000-ffff is not used */
ROM_LOAD( "a03.bin", 0x10000, 0x10000, CRC(f54ff17a) SHA1(a19850fc28a5a0da20795a5cc6b56d9c16554bce) ) /* banked at f000-f7ff */
@@ -534,6 +534,6 @@ ROM_START( wc90ba )
ROM_END
-GAME( 1989, wc90b1, wc90, wc90b, wc90b, wc90b_state, 0, ROT0, "bootleg", "Euro League (Italian hack of Tecmo World Cup '90)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1989, wc90b2, wc90, wc90b, wc90b, wc90b_state, 0, ROT0, "bootleg", "Worldcup '90", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1989, wc90ba, wc90, wc90b, wc90b, wc90b_state, 0, ROT0, "bootleg", "Euro League (Italian hack of Tecmo World Cup '90 - alt version)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, twcup90b1, twcup90, wc90b, wc90b, wc90b_state, 0, ROT0, "bootleg", "Euro League (Italian hack of Tecmo World Cup '90)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, twcup90b2, twcup90, wc90b, wc90b, wc90b_state, 0, ROT0, "bootleg", "Worldcup '90", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+GAME( 1989, twcup90ba, twcup90, wc90b, wc90b, wc90b_state, 0, ROT0, "bootleg", "Euro League (Italian hack of Tecmo World Cup '90 - alt version)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/wwfsstar.cpp b/src/mame/drivers/wwfsstar.cpp
index 490341efb27..f2b8274669e 100644
--- a/src/mame/drivers/wwfsstar.cpp
+++ b/src/mame/drivers/wwfsstar.cpp
@@ -187,7 +187,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, wwfsstar_state )
AM_RANGE(0x180004, 0x180007) AM_WRITE(scroll_w)
AM_RANGE(0x180006, 0x180007) AM_READ_PORT("P2")
AM_RANGE(0x180008, 0x180009) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x180008, 0x180009) AM_WRITE(sound_w)
+ AM_RANGE(0x180008, 0x180009) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
AM_RANGE(0x18000a, 0x18000b) AM_WRITE(flipscreen_w)
AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* Work Ram */
ADDRESS_MAP_END
@@ -220,12 +220,6 @@ WRITE16_MEMBER(wwfsstar_state::scroll_w)
}
}
-WRITE16_MEMBER(wwfsstar_state::sound_w)
-{
- m_soundlatch->write(space, 1, data & 0xff);
- m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
-}
-
WRITE16_MEMBER(wwfsstar_state::flipscreen_w)
{
flip_screen_set(data & 1);
@@ -441,6 +435,7 @@ static MACHINE_CONFIG_START( wwfsstar )
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_GENERIC_LATCH_8_ADD("soundlatch")
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", INPUT_LINE_NMI))
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
diff --git a/src/mame/drivers/xybots.cpp b/src/mame/drivers/xybots.cpp
index 70b3ce57cf4..971fd419a48 100644
--- a/src/mame/drivers/xybots.cpp
+++ b/src/mame/drivers/xybots.cpp
@@ -23,8 +23,8 @@
#include "includes/xybots.h"
#include "cpu/m68000/m68000.h"
+#include "machine/eeprompar.h"
#include "machine/watchdog.h"
-#include "machine/atarigen.h"
#include "speaker.h"
@@ -81,11 +81,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xybots_state )
AM_RANGE(0x802e00, 0x802fff) AM_MIRROR(0x7f8000) AM_RAM AM_SHARE("mob")
AM_RANGE(0x803000, 0x803fff) AM_MIRROR(0x7f8000) AM_RAM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0x804000, 0x8047ff) AM_MIRROR(0x7f8800) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x805000, 0x805fff) AM_MIRROR(0x7f8000) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x805000, 0x805fff) AM_MIRROR(0x7f8000) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
AM_RANGE(0x806000, 0x8060ff) AM_MIRROR(0x7f8000) AM_DEVREAD8("jsa", atari_jsa_i_device, main_response_r, 0x00ff)
AM_RANGE(0x806100, 0x8061ff) AM_MIRROR(0x7f8000) AM_READ_PORT("FFE100")
AM_RANGE(0x806200, 0x8062ff) AM_MIRROR(0x7f8000) AM_READ(special_port1_r)
- AM_RANGE(0x806800, 0x8068ff) AM_MIRROR(0x7f8000) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x806800, 0x8068ff) AM_MIRROR(0x7f8000) AM_DEVWRITE("eeprom", eeprom_parallel_28xx_device, unlock_write)
AM_RANGE(0x806900, 0x8069ff) AM_MIRROR(0x7f8000) AM_DEVWRITE8("jsa", atari_jsa_i_device, main_command_w, 0x00ff)
AM_RANGE(0x806a00, 0x806aff) AM_MIRROR(0x7f8000) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x806b00, 0x806bff) AM_MIRROR(0x7f8000) AM_WRITE(video_int_ack_w)
@@ -191,7 +191,8 @@ static MACHINE_CONFIG_START( xybots )
MCFG_MACHINE_RESET_OVERRIDE(xybots_state,xybots)
- MCFG_ATARI_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_2804_ADD("eeprom")
+ MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(true)
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/z100.cpp b/src/mame/drivers/z100.cpp
index bdcf92bdbfe..f873c6d7ef3 100644
--- a/src/mame/drivers/z100.cpp
+++ b/src/mame/drivers/z100.cpp
@@ -687,8 +687,14 @@ static MACHINE_CONFIG_START( z100 )
MCFG_MC6845_SHOW_BORDER_AREA(false)
MCFG_MC6845_CHAR_WIDTH(8)
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(z100_state, get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir3_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(z100_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir3_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("pia0", PIA6821, 0)
MCFG_PIA_WRITEPA_HANDLER(WRITE8(z100_state, video_pia_A_w))
diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp
index ea4fae00fbb..927d0f42ead 100644
--- a/src/mame/drivers/zn.cpp
+++ b/src/mame/drivers/zn.cpp
@@ -4021,7 +4021,7 @@ ROM_START( glpracr3j )
ROM_LOAD( "mg08", 0x000000, 0x000008, CRC(679367fe) SHA1(495b03e1cdad9d6aaf509b73d837340e2b1bb23b) )
ROM_END
-ROM_START( tecmowcm )
+ROM_START( twcupmil )
TPS_BIOS
ROM_REGION32_LE( 0x02800000, "bankedroms", 0 )
@@ -5073,11 +5073,11 @@ ROM_START( jdredd )
AC_BIOS
ROM_REGION32_LE( 0x200000, "roms", 0 )
- ROM_LOAD16_BYTE( "j-dread.u36", 0x000001, 0x020000, CRC(37addbf9) SHA1(a4061a1ba9e230f080f0bfea69bf77efe9264a92) )
- ROM_LOAD16_BYTE( "j-dread.u35", 0x000000, 0x020000, CRC(c1e17191) SHA1(82901439b1a51b9aadb4df4b9d944f26697a1460) )
+ ROM_LOAD16_BYTE( "9e54_01-16-98_1566_u_36.u36", 0x000001, 0x020000, CRC(37addbf9) SHA1(a4061a1ba9e230f080f0bfea69bf77efe9264a92) ) /* known to have other dates like 11-21-97 - still same checksum of 9E54 */
+ ROM_LOAD16_BYTE( "79d3_01-16-98_1565_u_35.u35", 0x000000, 0x020000, CRC(c1e17191) SHA1(82901439b1a51b9aadb4df4b9d944f26697a1460) ) /* known to have other dates like 11-21-97 - still same checksum of 79D3 */
DISK_REGION( "ata:0:hdd:image" )
- DISK_IMAGE( "jdreddc", 0, SHA1(eee205f83e5f590f8baf36452c873d7063156bd0) )
+ DISK_IMAGE( "jdreddc", 0, SHA1(eee205f83e5f590f8baf36452c873d7063156bd0) ) /* label on drive reads: 1576 Rev.C */
ROM_REGION( 0x8, "cat702_2", 0 )
ROM_LOAD( "ac02", 0x000000, 0x000008, CRC(1412d475) SHA1(c2f62232a261870f58353d09dc0d6ce2ad17a729) )
@@ -5087,11 +5087,11 @@ ROM_START( jdreddb )
AC_BIOS
ROM_REGION32_LE( 0x200000, "roms", 0 )
- ROM_LOAD16_BYTE( "j-dread.u36", 0x000001, 0x020000, CRC(37addbf9) SHA1(a4061a1ba9e230f080f0bfea69bf77efe9264a92) )
- ROM_LOAD16_BYTE( "j-dread.u35", 0x000000, 0x020000, CRC(c1e17191) SHA1(82901439b1a51b9aadb4df4b9d944f26697a1460) )
+ ROM_LOAD16_BYTE( "9e54_01-16-98_1566_u_36.u36", 0x000001, 0x020000, CRC(37addbf9) SHA1(a4061a1ba9e230f080f0bfea69bf77efe9264a92) ) /* known to have other dates like 11-21-97 - still same checksum of 9E54 */
+ ROM_LOAD16_BYTE( "79d3_01-16-98_1565_u_35.u35", 0x000000, 0x020000, CRC(c1e17191) SHA1(82901439b1a51b9aadb4df4b9d944f26697a1460) ) /* known to have other dates like 11-21-97 - still same checksum of 79D3 */
DISK_REGION( "ata:0:hdd:image" )
- DISK_IMAGE( "jdreddb", 0, SHA1(20f696fa6e1fbf97793bac2a794631c5dd4fb39a) )
+ DISK_IMAGE( "jdreddb", 0, SHA1(20f696fa6e1fbf97793bac2a794631c5dd4fb39a) ) /* label on drive reads: 1576 Rev.B */
ROM_REGION( 0x8, "cat702_2", 0 )
ROM_LOAD( "ac02", 0x000000, 0x000008, CRC(1412d475) SHA1(c2f62232a261870f58353d09dc0d6ce2ad17a729) )
@@ -5211,7 +5211,7 @@ GAME( 1999, flamegunj, flamegun, coh1002m, zn, zn_state, 0, ROT0, "Gaps
GAME( 1999, lpadv, coh1002m, coh1002m, zn, zn_state, 0, ROT0, "Amuse World", "Logic Pro Adventure (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 2000, tblkkuzu, coh1002m, coh1002m, zn, zn_state, 0, ROT0, "Tamsoft / D3 Publisher", "The Block Kuzushi (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 2000, 1on1gov, coh1002m, coh1002m, zn, zn_state, 0, ROT0, "Tecmo", "1 on 1 Government (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
-GAME( 2000, tecmowcm, coh1002m, coh1002m, zn, zn_state, 0, ROT0, "Tecmo", "Tecmo World Cup Millennium (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
+GAME( 2000, twcupmil, coh1002m, coh1002m, zn, zn_state, 0, ROT0, "Tecmo", "Tecmo World Cup Millennium (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
GAME( 2001, mfjump, coh1002m, coh1002m, zn, zn_state, 0, ROT0, "Tecmo", "Monster Farm Jump (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
/* Video System */
diff --git a/src/mame/includes/airbustr.h b/src/mame/includes/airbustr.h
index b946a944ba2..94b97f5deaa 100644
--- a/src/mame/includes/airbustr.h
+++ b/src/mame/includes/airbustr.h
@@ -50,10 +50,6 @@ public:
int m_fg_scrolly;
int m_highbits;
- /* misc */
- int m_soundlatch_status;
- int m_soundlatch2_status;
-
/* devices */
required_device<cpu_device> m_master;
required_device<cpu_device> m_slave;
@@ -72,10 +68,6 @@ public:
DECLARE_WRITE8_MEMBER(slave_bankswitch_w);
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
DECLARE_READ8_MEMBER(soundcommand_status_r);
- DECLARE_READ8_MEMBER(soundcommand_r);
- DECLARE_READ8_MEMBER(soundcommand2_r);
- DECLARE_WRITE8_MEMBER(soundcommand_w);
- DECLARE_WRITE8_MEMBER(soundcommand2_w);
DECLARE_WRITE8_MEMBER(coin_counter_w);
DECLARE_WRITE8_MEMBER(videoram_w);
DECLARE_WRITE8_MEMBER(colorram_w);
diff --git a/src/mame/includes/aquarium.h b/src/mame/includes/aquarium.h
index 84f6bbf8d63..e7ae1823942 100644
--- a/src/mame/includes/aquarium.h
+++ b/src/mame/includes/aquarium.h
@@ -2,6 +2,7 @@
// copyright-holders:David Haywood
#include "machine/gen_latch.h"
+#include "machine/mb3773.h"
#include "sound/okim6295.h"
#include "video/excellent_spr.h"
#include "screen.h"
@@ -22,7 +23,8 @@ public:
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
m_screen(*this, "screen"),
- m_soundlatch(*this, "soundlatch")
+ m_soundlatch(*this, "soundlatch"),
+ m_watchdog(*this, "watchdog")
{ }
/* memory pointers */
@@ -36,9 +38,6 @@ public:
tilemap_t *m_mid_tilemap;
tilemap_t *m_bak_tilemap;
- /* misc */
- int m_aquarium_snd_ack;
-
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@@ -48,10 +47,9 @@ public:
required_device<excellent_spr_device> m_sprgen;
required_device<screen_device> m_screen;
required_device<generic_latch_8_device> m_soundlatch;
+ required_device<mb3773_device> m_watchdog;
- DECLARE_READ16_MEMBER(aquarium_coins_r);
- DECLARE_WRITE8_MEMBER(aquarium_snd_ack_w);
- DECLARE_WRITE16_MEMBER(aquarium_sound_w);
+ DECLARE_WRITE8_MEMBER(aquarium_watchdog_w);
DECLARE_WRITE8_MEMBER(aquarium_z80_bank_w);
DECLARE_READ8_MEMBER(aquarium_oki_r);
DECLARE_WRITE8_MEMBER(aquarium_oki_w);
@@ -62,8 +60,6 @@ public:
TILE_GET_INFO_MEMBER(get_aquarium_txt_tile_info);
TILE_GET_INFO_MEMBER(get_aquarium_mid_tile_info);
TILE_GET_INFO_MEMBER(get_aquarium_bak_tile_info);
- virtual void machine_start() override;
- virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_aquarium(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint8_t aquarium_snd_bitswap( uint8_t scrambled_data );
diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h
index 4e5a8a48cb3..e30d142960c 100644
--- a/src/mame/includes/astrocde.h
+++ b/src/mame/includes/astrocde.h
@@ -152,7 +152,6 @@ public:
DECLARE_WRITE8_MEMBER(demndrgn_banksw_w);
DECLARE_READ8_MEMBER(demndrgn_io_r);
DECLARE_WRITE8_MEMBER(demndrgn_sound_w);
- DECLARE_WRITE8_MEMBER(tenpindx_sound_w);
DECLARE_WRITE8_MEMBER(tenpindx_lamp_w);
DECLARE_WRITE8_MEMBER(tenpindx_counter_w);
DECLARE_WRITE8_MEMBER(tenpindx_lights_w);
diff --git a/src/mame/includes/bking.h b/src/mame/includes/bking.h
index 44a7c521589..c3483ec7ece 100644
--- a/src/mame/includes/bking.h
+++ b/src/mame/includes/bking.h
@@ -3,6 +3,7 @@
#include "machine/taito68705interface.h"
#include "machine/gen_latch.h"
+#include "machine/input_merger.h"
#include "screen.h"
class bking_state : public driver_device
@@ -16,7 +17,8 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch")
+ m_soundlatch(*this, "soundlatch"),
+ m_soundnmi(*this, "soundnmi")
{
}
@@ -43,10 +45,6 @@ public:
int m_controller;
int m_hit;
- /* sound-related */
- int m_sound_nmi_enable;
- int m_pending_nmi;
-
/* misc */
int m_addr_h;
int m_addr_l;
@@ -58,6 +56,7 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
+ required_device<input_merger_device> m_soundnmi;
DECLARE_READ8_MEMBER(bking_sndnmi_disable_r);
DECLARE_WRITE8_MEMBER(bking_sndnmi_enable_w);
diff --git a/src/mame/includes/buggychl.h b/src/mame/includes/buggychl.h
index 57e53ba0a69..2b517543e80 100644
--- a/src/mame/includes/buggychl.h
+++ b/src/mame/includes/buggychl.h
@@ -62,8 +62,6 @@ public:
required_device<generic_latch_8_device> m_soundlatch2;
DECLARE_WRITE8_MEMBER(bankswitch_w);
- DECLARE_WRITE8_MEMBER(nmi_disable_w);
- DECLARE_WRITE8_MEMBER(nmi_enable_w);
DECLARE_WRITE8_MEMBER(sound_enable_w);
DECLARE_READ8_MEMBER(mcu_status_r);
DECLARE_READ8_MEMBER(sound_status_main_r);
diff --git a/src/mame/includes/cninja.h b/src/mame/includes/cninja.h
index affa7c3b395..53654a06cb9 100644
--- a/src/mame/includes/cninja.h
+++ b/src/mame/includes/cninja.h
@@ -43,7 +43,8 @@ public:
m_pf2_rowscroll(*this, "pf2_rowscroll"),
m_pf3_rowscroll(*this, "pf3_rowscroll"),
m_pf4_rowscroll(*this, "pf4_rowscroll"),
- m_ram(*this, "ram")
+ m_ram(*this, "ram"),
+ m_okibank(*this, "okibank")
{ }
/* devices */
@@ -72,6 +73,7 @@ public:
required_shared_ptr<uint16_t> m_pf3_rowscroll;
required_shared_ptr<uint16_t> m_pf4_rowscroll;
optional_shared_ptr<uint16_t> m_ram;
+ optional_memory_bank m_okibank;
/* misc */
int m_scanline;
@@ -84,6 +86,7 @@ public:
DECLARE_WRITE16_MEMBER(cninja_pf12_control_w);
DECLARE_WRITE16_MEMBER(cninja_pf34_control_w);
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(cninjabl2_oki_bank_w);
DECLARE_DRIVER_INIT(stoneage);
DECLARE_DRIVER_INIT(mutantf);
DECLARE_DRIVER_INIT(cninja);
diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h
index 994b2194d78..b506b960e18 100644
--- a/src/mame/includes/ddragon3.h
+++ b/src/mame/includes/ddragon3.h
@@ -54,7 +54,6 @@ public:
uint16_t m_bg1_dx[2];
/* misc */
- uint16_t m_io_reg[8];
uint8_t m_pri;
/* devices */
@@ -66,7 +65,9 @@ public:
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
- DECLARE_WRITE16_MEMBER(ddragon3_io_w);
+ DECLARE_WRITE16_MEMBER(ddragon3_vreg_w);
+ DECLARE_WRITE16_MEMBER(irq6_ack_w);
+ DECLARE_WRITE16_MEMBER(irq5_ack_w);
DECLARE_WRITE16_MEMBER(ddragon3_scroll_w);
DECLARE_READ16_MEMBER(ddragon3_scroll_r);
DECLARE_WRITE16_MEMBER(ddragon3_bg_videoram_w);
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index 089aeb0eac5..6e18fb28411 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -176,14 +176,10 @@ public:
void updateAceRam();
void mixDualAlphaSprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx0, gfx_element *gfx1, int mixAlphaTilemap);
- uint16_t port_a_fghthist(int unused);
- uint16_t port_b_fghthist(int unused);
- uint16_t port_c_fghthist(int unused);
void deco32_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask );
- uint16_t port_b_nslasher(int unused);
void nslasher_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask );
- uint16_t port_b_tattass(int unused);
+ DECLARE_READ16_MEMBER(port_b_tattass);
void tattass_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask );
void deco32_set_audio_output(uint8_t raw_data);
void update_irq_state(uint8_t irq_cause, bool assert_state);
diff --git a/src/mame/includes/deniam.h b/src/mame/includes/deniam.h
index a9922b81e82..81997468938 100644
--- a/src/mame/includes/deniam.h
+++ b/src/mame/includes/deniam.h
@@ -52,7 +52,6 @@ public:
uint16_t m_coinctrl;
/* devices */
- DECLARE_WRITE16_MEMBER(sound_command_w);
DECLARE_WRITE16_MEMBER(deniam_irq_ack_w);
DECLARE_WRITE16_MEMBER(deniam_videoram_w);
DECLARE_WRITE16_MEMBER(deniam_textram_w);
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index 534c1c33511..ade4a991688 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -243,6 +243,7 @@ public:
DECLARE_DRIVER_INIT(thepitm);
DECLARE_DRIVER_INIT(theend);
DECLARE_DRIVER_INIT(scramble);
+ DECLARE_DRIVER_INIT(explorer);
DECLARE_DRIVER_INIT(mandinga);
DECLARE_DRIVER_INIT(sfx);
DECLARE_DRIVER_INIT(atlantis);
@@ -275,7 +276,7 @@ public:
INTERRUPT_GEN_MEMBER(interrupt_gen);
INTERRUPT_GEN_MEMBER(fakechange_interrupt_gen);
TIMER_DEVICE_CALLBACK_MEMBER(checkmaj_irq0_gen);
- TIMER_DEVICE_CALLBACK_MEMBER(galaxian_stars_blink_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(scramble_stars_blink_timer);
TIMER_DEVICE_CALLBACK_MEMBER(timefgtr_scanline);
void state_save_register();
void sprites_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, const uint8_t *spritebase);
diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h
index ce557b289a6..84b9a1b96cf 100644
--- a/src/mame/includes/gcpinbal.h
+++ b/src/mame/includes/gcpinbal.h
@@ -3,6 +3,7 @@
#include "machine/74157.h"
#include "machine/eepromser.h"
+#include "machine/mb3773.h"
#include "sound/okim6295.h"
#include "sound/msm5205.h"
#include "video/excellent_spr.h"
@@ -19,6 +20,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_eeprom(*this, "eeprom"),
+ m_watchdog(*this, "watchdog"),
m_oki(*this, "oki"),
m_msm(*this, "msm"),
m_adpcm_select(*this, "adpcm_select"),
@@ -33,6 +35,7 @@ public:
/* devices */
required_device<cpu_device> m_maincpu;
required_device<eeprom_serial_93cxx_device> m_eeprom;
+ required_device<mb3773_device> m_watchdog;
required_device<okim6295_device> m_oki;
required_device<msm6585_device> m_msm;
required_device<hct157_device> m_adpcm_select;
diff --git a/src/mame/includes/grchamp.h b/src/mame/includes/grchamp.h
index 32790312286..c721b302e6d 100644
--- a/src/mame/includes/grchamp.h
+++ b/src/mame/includes/grchamp.h
@@ -6,7 +6,7 @@
*************************************************************************/
-#include "machine/gen_latch.h"
+#include "machine/input_merger.h"
#include "machine/watchdog.h"
#include "sound/discrete.h"
#include "screen.h"
@@ -24,7 +24,7 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_screen(*this, "screen"),
- m_soundlatch(*this, "soundlatch"),
+ m_soundnmi(*this, "soundnmi"),
m_radarram(*this, "radarram"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
@@ -40,7 +40,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
- required_device<generic_latch_8_device> m_soundlatch;
+ required_device<input_merger_device> m_soundnmi;
required_shared_ptr<uint8_t> m_radarram;
required_shared_ptr<uint8_t> m_videoram;
@@ -59,6 +59,9 @@ public:
uint8_t m_ledaddr;
uint16_t m_ledram[8];
+ uint8_t m_soundlatch_data;
+ bool m_soundlatch_flag;
+
uint16_t m_collide;
uint8_t m_collmode;
@@ -82,6 +85,11 @@ public:
DECLARE_WRITE8_MEMBER(left_w);
DECLARE_WRITE8_MEMBER(center_w);
DECLARE_WRITE8_MEMBER(right_w);
+ TIMER_CALLBACK_MEMBER(soundlatch_w_cb);
+ TIMER_CALLBACK_MEMBER(soundlatch_clear7_w_cb);
+ DECLARE_READ8_MEMBER(soundlatch_r);
+ DECLARE_WRITE8_MEMBER(soundlatch_clear7_w);
+ DECLARE_READ8_MEMBER(soundlatch_flags_r);
DECLARE_WRITE8_MEMBER(portA_0_w);
DECLARE_WRITE8_MEMBER(portB_0_w);
DECLARE_WRITE8_MEMBER(portA_2_w);
diff --git a/src/mame/includes/gstriker.h b/src/mame/includes/gstriker.h
index 95bb6de33f2..a154e075250 100644
--- a/src/mame/includes/gstriker.h
+++ b/src/mame/includes/gstriker.h
@@ -4,6 +4,7 @@
#ifndef __GSTRIKER_H
#define __GSTRIKER_H
+#include "machine/6850acia.h"
#include "machine/gen_latch.h"
#include "machine/mb3773.h"
#include "video/vsystem_spr.h"
@@ -28,10 +29,10 @@ public:
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
m_watchdog(*this, "watchdog"),
+ m_acia(*this, "acia"),
m_CG10103_m_vram(*this, "cg10103_m_vram"),
m_work_ram(*this, "work_ram"),
- m_mixerregs1(*this, "mixerregs1"),
- m_mixerregs2(*this, "mixerregs2")
+ m_mixerregs(*this, "mixerregs")
{ }
required_device<cpu_device> m_maincpu;
@@ -44,21 +45,27 @@ public:
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
required_device<mb3773_device> m_watchdog;
+ optional_device<acia6850_device> m_acia;
required_shared_ptr<uint16_t> m_CG10103_m_vram;
+ std::unique_ptr<uint16_t[]> m_buffered_spriteram;
+ std::unique_ptr<uint16_t[]> m_buffered_spriteram2;
required_shared_ptr<uint16_t> m_work_ram;
- required_shared_ptr<uint16_t> m_mixerregs1;
- required_shared_ptr<uint16_t> m_mixerregs2;
+ required_shared_ptr<uint16_t> m_mixerregs;
+ enum {
+ TECMO_WCUP94_MCU = 1,
+ TECMO_WCUP94A_MCU,
+ VGOAL_SOCCER_MCU
+ }m_mcutype;
int m_gametype;
- uint16_t m_mcu_data;
uint16_t m_prot_reg[2];
// common
DECLARE_WRITE8_MEMBER(sh_bankswitch_w);
// vgoalsoc and twrldc
- DECLARE_WRITE8_MEMBER(twrldc94_prot_reg_w);
+ DECLARE_WRITE8_MEMBER(twcup94_prot_reg_w);
// vgoalsoc only
DECLARE_READ16_MEMBER(vbl_toggle_r);
@@ -66,11 +73,12 @@ public:
virtual void machine_start() override;
virtual void video_start() override;
- DECLARE_DRIVER_INIT(twrldc94a);
+ DECLARE_DRIVER_INIT(twcup94a);
DECLARE_DRIVER_INIT(vgoalsoc);
- DECLARE_DRIVER_INIT(twrldc94);
+ DECLARE_DRIVER_INIT(twcup94);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(screen_vblank);
void mcu_init();
};
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index 742726eb690..7f4d2db4970 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -22,6 +22,7 @@
#include "machine/74259.h"
#include "machine/asic65.h"
+#include "machine/eeprompar.h"
#include "machine/mc68681.h"
#include "machine/timekpr.h"
diff --git a/src/mame/includes/lkage.h b/src/mame/includes/lkage.h
index 2dacf312d04..c0291989da9 100644
--- a/src/mame/includes/lkage.h
+++ b/src/mame/includes/lkage.h
@@ -2,6 +2,7 @@
// copyright-holders:Phil Stroffolino
#include "machine/gen_latch.h"
+#include "machine/input_merger.h"
#include "machine/taito68705interface.h"
class lkage_state : public driver_device
@@ -18,7 +19,8 @@ public:
m_bmcu(*this, "bmcu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch") { }
+ m_soundlatch(*this, "soundlatch"),
+ m_soundnmi(*this, "soundnmi") { }
required_shared_ptr<uint8_t> m_vreg;
required_shared_ptr<uint8_t> m_scroll;
@@ -35,10 +37,6 @@ public:
int m_sprite_dx;
- /* misc */
- int m_sound_nmi_enable;
- int m_pending_nmi;
-
/* lkageb fake mcu */
uint8_t m_mcu_val;
int m_mcu_ready; /* cpu data/mcu ready status */
@@ -50,8 +48,8 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
+ required_device<input_merger_device> m_soundnmi;
- DECLARE_WRITE8_MEMBER(lkage_sound_command_w);
DECLARE_WRITE8_MEMBER(lkage_sh_nmi_disable_w);
DECLARE_WRITE8_MEMBER(lkage_sh_nmi_enable_w);
DECLARE_READ8_MEMBER(sound_status_r);
@@ -71,6 +69,5 @@ public:
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_lkage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_CALLBACK_MEMBER(nmi_callback);
void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/m90.h b/src/mame/includes/m90.h
index 35706a30e25..3e60a5a56b1 100644
--- a/src/mame/includes/m90.h
+++ b/src/mame/includes/m90.h
@@ -35,7 +35,6 @@ public:
uint8_t m_last_pf2;
DECLARE_WRITE16_MEMBER(m90_coincounter_w);
DECLARE_WRITE16_MEMBER(quizf1_bankswitch_w);
- DECLARE_WRITE16_MEMBER(dynablsb_sound_command_w);
DECLARE_WRITE16_MEMBER(m90_video_control_w);
DECLARE_WRITE16_MEMBER(m90_video_w);
DECLARE_DRIVER_INIT(bomblord);
diff --git a/src/mame/includes/mainsnk.h b/src/mame/includes/mainsnk.h
index 760115aba78..68217553926 100644
--- a/src/mame/includes/mainsnk.h
+++ b/src/mame/includes/mainsnk.h
@@ -32,19 +32,15 @@ public:
int m_sound_cpu_busy;
uint32_t m_bg_tile_offset;
- DECLARE_WRITE8_MEMBER(sound_command_w);
DECLARE_READ8_MEMBER(sound_ack_r);
DECLARE_WRITE8_MEMBER(c600_w);
DECLARE_WRITE8_MEMBER(fgram_w);
DECLARE_WRITE8_MEMBER(bgram_w);
- DECLARE_CUSTOM_INPUT_MEMBER(sound_r);
-
TILEMAP_MAPPER_MEMBER(marvins_tx_scan_cols);
TILE_GET_INFO_MEMBER(get_tx_tile_info);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
- virtual void machine_start() override;
virtual void video_start() override;
DECLARE_PALETTE_INIT(mainsnk);
diff --git a/src/mame/includes/munchmo.h b/src/mame/includes/munchmo.h
index 42db82cfece..e9a66cf6cf0 100644
--- a/src/mame/includes/munchmo.h
+++ b/src/mame/includes/munchmo.h
@@ -48,15 +48,15 @@ public:
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
- DECLARE_WRITE8_MEMBER(nmi_enable_w);
+ DECLARE_WRITE_LINE_MEMBER(nmi_enable_w);
DECLARE_WRITE8_MEMBER(nmi_ack_w);
DECLARE_WRITE8_MEMBER(sound_nmi_ack_w);
- DECLARE_WRITE8_MEMBER(palette_bank_w);
- DECLARE_WRITE8_MEMBER(flipscreen_w);
+ DECLARE_WRITE_LINE_MEMBER(palette_bank_0_w);
+ DECLARE_WRITE_LINE_MEMBER(palette_bank_1_w);
+ DECLARE_WRITE_LINE_MEMBER(flipscreen_w);
DECLARE_READ8_MEMBER(ay1reset_r);
DECLARE_READ8_MEMBER(ay2reset_r);
virtual void machine_start() override;
- virtual void machine_reset() override;
virtual void video_start() override;
DECLARE_PALETTE_INIT(munchmo);
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/includes/nds.h b/src/mame/includes/nds.h
new file mode 100644
index 00000000000..6f2a2f1d44b
--- /dev/null
+++ b/src/mame/includes/nds.h
@@ -0,0 +1,48 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+#ifndef INCLUDES_NDS_H
+#define INCLUDES_NDS_H
+
+#include "cpu/arm7/arm7.h"
+#include "cpu/arm7/arm7core.h"
+
+class nds_state : public driver_device
+{
+public:
+ nds_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_arm7(*this, "arm7"),
+ m_arm9(*this, "arm9"),
+ m_firmware(*this, "firmware")
+ { }
+
+ void machine_start() override;
+ void machine_reset() override;
+
+ // ARM7
+ DECLARE_READ32_MEMBER(arm7_io_r);
+ DECLARE_WRITE32_MEMBER(arm7_io_w);
+
+ // ARM9
+ DECLARE_READ32_MEMBER(arm9_io_r);
+ DECLARE_WRITE32_MEMBER(arm9_io_w);
+
+protected:
+ required_device<arm7_cpu_device> m_arm7;
+ required_device<arm946es_cpu_device> m_arm9;
+
+ required_region_ptr<uint32_t> m_firmware;
+
+ enum {
+ POSTFLG_OFFSET = 0x300/4,
+ POSTFLG_PBF_SHIFT = 0,
+ POSTFLG_RAM_SHIFT = 1,
+ POSTFLG_PBF_MASK = (1 << POSTFLG_PBF_SHIFT),
+ POSTFLG_RAM_MASK = (1 << POSTFLG_RAM_SHIFT),
+ };
+
+ uint32_t m_arm7_postflg;
+ uint32_t m_arm9_postflg;
+};
+
+#endif // INCLUDES_NDS_H
diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h
index c56481aa641..b22749e7fb1 100644
--- a/src/mame/includes/seta.h
+++ b/src/mame/includes/seta.h
@@ -144,7 +144,6 @@ public:
DECLARE_WRITE16_MEMBER(sharedram_68000_w);
DECLARE_WRITE16_MEMBER(sub_ctrl_w);
DECLARE_READ16_MEMBER(seta_dsw_r);
- DECLARE_WRITE16_MEMBER(calibr50_soundlatch_w);
DECLARE_READ16_MEMBER(usclssic_dsw_r);
DECLARE_READ16_MEMBER(usclssic_trackball_x_r);
DECLARE_READ16_MEMBER(usclssic_trackball_y_r);
@@ -156,7 +155,6 @@ public:
DECLARE_READ16_MEMBER(keroppi_protection_init_r);
DECLARE_READ16_MEMBER(keroppi_coin_r);
DECLARE_WRITE16_MEMBER(keroppi_prize_w);
- DECLARE_READ16_MEMBER(krzybowl_input_r);
DECLARE_WRITE16_MEMBER(msgundam_vregs_w);
DECLARE_READ16_MEMBER(kiwame_nvram_r);
DECLARE_WRITE16_MEMBER(kiwame_nvram_w);
@@ -172,6 +170,7 @@ public:
DECLARE_WRITE8_MEMBER(sub_bankswitch_lockout_w);
DECLARE_READ8_MEMBER(ff_r);
DECLARE_READ8_MEMBER(downtown_ip_r);
+ DECLARE_WRITE8_MEMBER(calibr50_sub_bankswitch_w);
DECLARE_WRITE8_MEMBER(calibr50_soundlatch2_w);
DECLARE_READ16_MEMBER(twineagl_debug_r);
DECLARE_READ16_MEMBER(twineagl_200100_r);
diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h
index 4d95658e050..0148460b72b 100644
--- a/src/mame/includes/shadfrce.h
+++ b/src/mame/includes/shadfrce.h
@@ -65,7 +65,7 @@ public:
DECLARE_WRITE16_MEMBER(flip_screen);
DECLARE_READ16_MEMBER(input_ports_r);
- DECLARE_WRITE16_MEMBER(sound_brt_w);
+ DECLARE_WRITE8_MEMBER(screen_brt_w);
DECLARE_WRITE16_MEMBER(irq_ack_w);
DECLARE_WRITE16_MEMBER(irq_w);
DECLARE_WRITE16_MEMBER(scanline_w);
diff --git a/src/mame/includes/snowbros.h b/src/mame/includes/snowbros.h
index cb884052484..d51287491fe 100644
--- a/src/mame/includes/snowbros.h
+++ b/src/mame/includes/snowbros.h
@@ -41,12 +41,8 @@ public:
DECLARE_WRITE16_MEMBER(snowbros_irq4_ack_w);
DECLARE_WRITE16_MEMBER(snowbros_irq3_ack_w);
DECLARE_WRITE16_MEMBER(snowbros_irq2_ack_w);
- DECLARE_READ16_MEMBER(snowbros_68000_sound_r);
- DECLARE_WRITE16_MEMBER(snowbros_68000_sound_w);
- DECLARE_WRITE16_MEMBER(semicom_soundcmd_w);
DECLARE_READ8_MEMBER(prot_io_r);
DECLARE_WRITE8_MEMBER(prot_io_w);
- DECLARE_WRITE16_MEMBER(twinadv_68000_sound_w);
DECLARE_READ16_MEMBER(sb3_sound_r);
DECLARE_READ16_MEMBER(_4in1_02_read);
DECLARE_READ16_MEMBER(_3in1_read);
diff --git a/src/mame/includes/spbactn.h b/src/mame/includes/spbactn.h
index e594665dca5..7c3a5b54eb9 100644
--- a/src/mame/includes/spbactn.h
+++ b/src/mame/includes/spbactn.h
@@ -61,8 +61,6 @@ public:
bitmap_ind16 m_sprite_bitmap;
- DECLARE_WRITE16_MEMBER(soundcommand_w);
-
DECLARE_WRITE16_MEMBER( spbatnp_90002_w );
DECLARE_WRITE16_MEMBER( spbatnp_90006_w );
DECLARE_WRITE16_MEMBER( spbatnp_9000a_w );
diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h
index 2f4989243dd..dd7cf5cee58 100644
--- a/src/mame/includes/starwars.h
+++ b/src/mame/includes/starwars.h
@@ -71,6 +71,7 @@ public:
DECLARE_WRITE8_MEMBER(starwars_math_w);
DECLARE_CUSTOM_INPUT_MEMBER(matrix_flag_r);
DECLARE_READ8_MEMBER(starwars_main_ready_flag_r);
+ DECLARE_WRITE_LINE_MEMBER(boost_interleave_hack);
DECLARE_WRITE8_MEMBER(starwars_soundrst_w);
DECLARE_WRITE8_MEMBER(quad_pokeyn_w);
DECLARE_DRIVER_INIT(esb);
diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h
index 2cda1bba793..f6ffb80fefa 100644
--- a/src/mame/includes/taitosj.h
+++ b/src/mame/includes/taitosj.h
@@ -3,6 +3,7 @@
#include "machine/taitosjsec.h"
+#include "machine/input_merger.h"
#include "machine/gen_latch.h"
#include "sound/dac.h"
@@ -34,6 +35,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_mcu(*this, "bmcu"),
+ m_soundnmi(*this, "soundnmi"),
+ m_soundnmi2(*this, "soundnmi2"),
m_dac(*this, "dac"),
m_dacvol(*this, "dacvol"),
m_ay1(*this, "ay1"),
@@ -42,13 +45,8 @@ public:
m_ay4(*this, "ay4"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch") { }
+ m_palette(*this, "palette") { }
- typedef void (taitosj_state::*copy_layer_func_t)(bitmap_ind16 &,
- const rectangle &, int, int *, rectangle *);
- uint8_t m_input_port_4_f0;
- uint8_t m_kikstart_gears[2];
required_shared_ptr<uint8_t> m_videoram_1;
required_shared_ptr<uint8_t> m_videoram_2;
required_shared_ptr<uint8_t> m_videoram_3;
@@ -63,24 +61,49 @@ public:
required_shared_ptr<uint8_t> m_video_priority;
required_shared_ptr<uint8_t> m_collision_reg;
optional_shared_ptr<uint8_t> m_kikstart_scrollram;
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ optional_device<taito_sj_security_mcu_device> m_mcu;
+ required_device<input_merger_device> m_soundnmi;
+ required_device<input_merger_device> m_soundnmi2;
+ required_device<dac_8bit_r2r_device> m_dac;
+ required_device<discrete_device> m_dacvol;
+ required_device<ay8910_device> m_ay1;
+ required_device<ay8910_device> m_ay2;
+ required_device<ay8910_device> m_ay3;
+ required_device<ay8910_device> m_ay4;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+
+ typedef void (taitosj_state::*copy_layer_func_t)(bitmap_ind16 &,
+ const rectangle &, int, int *, rectangle *);
+ uint8_t m_input_port_4_f0;
+ uint8_t m_kikstart_gears[2];
+
uint8_t m_spacecr_prot_value;
uint8_t m_protection_value;
uint32_t m_address;
- bool m_sndnmi_disable; // AKA "CIOB0" on schematic, bit 0 of AY-3-8910 @ IC50 Port B
- bool m_sound_cmd_written; // 74ls74 1/2 @ GAME BOARD IC42
- bool m_sound_semaphore; // 74ls74 2/2 @ GAME BOARD IC42
+ uint8_t m_soundlatch_data;
+ bool m_soundlatch_flag; // 74ls74 1/2 @ GAME BOARD IC42
+ bool m_sound_semaphore2; // 74ls74 2/2 @ GAME BOARD IC42
bitmap_ind16 m_layer_bitmap[3];
bitmap_ind16 m_sprite_sprite_collbitmap1;
bitmap_ind16 m_sprite_sprite_collbitmap2;
bitmap_ind16 m_sprite_layer_collbitmap1;
bitmap_ind16 m_sprite_layer_collbitmap2[3];
int m_draw_order[32][4];
- DECLARE_WRITE8_MEMBER(sound_command_ack_w);
- DECLARE_WRITE8_MEMBER(sound_command_w);
- DECLARE_READ8_MEMBER(sound_command_r);
- DECLARE_READ8_MEMBER(sound_status_r);
- DECLARE_WRITE8_MEMBER(sound_semaphore_w);
- DECLARE_WRITE8_MEMBER(sound_semaphore_clear_w);
+ DECLARE_WRITE8_MEMBER(soundlatch_w);
+ DECLARE_WRITE8_MEMBER(sound_semaphore2_w);
+ TIMER_CALLBACK_MEMBER(soundlatch_w_cb);
+ TIMER_CALLBACK_MEMBER(soundlatch_clear7_w_cb);
+ TIMER_CALLBACK_MEMBER(sound_semaphore2_w_cb);
+ TIMER_CALLBACK_MEMBER(sound_semaphore2_clear_w_cb);
+ DECLARE_READ8_MEMBER(soundlatch_r);
+ DECLARE_WRITE8_MEMBER(soundlatch_clear7_w);
+ DECLARE_READ8_MEMBER(soundlatch_flags_r);
+ DECLARE_WRITE8_MEMBER(sound_semaphore2_clear_w);
DECLARE_WRITE8_MEMBER(taitosj_bankswitch_w);
DECLARE_READ8_MEMBER(taitosj_fake_data_r);
DECLARE_WRITE8_MEMBER(taitosj_fake_data_w);
@@ -131,17 +154,4 @@ public:
void copy_layer(bitmap_ind16 &bitmap, const rectangle &cliprect,copy_layer_func_t copy_layer_func, int which, int *sprites_on, rectangle *sprite_areas);
void copy_layers(bitmap_ind16 &bitmap, const rectangle &cliprect,copy_layer_func_t copy_layer_func, int *sprites_on, rectangle *sprite_areas);
int video_update_common(bitmap_ind16 &bitmap, const rectangle &cliprect, copy_layer_func_t copy_layer_func);
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
- optional_device<taito_sj_security_mcu_device> m_mcu;
- required_device<dac_8bit_r2r_device> m_dac;
- required_device<discrete_device> m_dacvol;
- required_device<ay8910_device> m_ay1;
- required_device<ay8910_device> m_ay2;
- required_device<ay8910_device> m_ay3;
- required_device<ay8910_device> m_ay4;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
- required_device<generic_latch_8_device> m_soundlatch;
};
diff --git a/src/mame/includes/tecmosys.h b/src/mame/includes/tecmosys.h
index 1343b48a63d..2eff7e99122 100644
--- a/src/mame/includes/tecmosys.h
+++ b/src/mame/includes/tecmosys.h
@@ -8,6 +8,7 @@
#include "machine/eepromser.h"
#include "machine/gen_latch.h"
+#include "machine/input_merger.h"
#include "machine/watchdog.h"
#include "screen.h"
@@ -24,7 +25,7 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
- m_soundlatch2(*this, "soundlatch2"),
+ m_soundnmi(*this, "soundnmi"),
m_spriteram(*this, "spriteram"),
m_tilemap_paletteram16(*this, "tmap_palette"),
m_bg2tilemap_ram(*this, "bg2tilemap_ram"),
@@ -48,7 +49,7 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
- required_device<generic_latch_8_device> m_soundlatch2;
+ required_device<input_merger_device> m_soundnmi;
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_tilemap_paletteram16;
@@ -78,8 +79,8 @@ public:
const struct prot_data* m_device_data;
uint8_t m_device_value;
- DECLARE_READ16_MEMBER(sound_r);
- DECLARE_WRITE16_MEMBER(sound_w);
+ DECLARE_READ8_MEMBER(sound_command_pending_r);
+ DECLARE_WRITE8_MEMBER(sound_nmi_disable_w);
DECLARE_WRITE16_MEMBER(unk880000_w);
DECLARE_READ16_MEMBER(unk880000_r);
DECLARE_WRITE8_MEMBER(z80_bank_w);
diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h
index 1a80666308b..f1401f5d27c 100644
--- a/src/mame/includes/thedeep.h
+++ b/src/mame/includes/thedeep.h
@@ -48,7 +48,6 @@ public:
uint8_t m_mcu_p3_reg;
DECLARE_WRITE8_MEMBER(nmi_w);
- DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_WRITE8_MEMBER(protection_w);
DECLARE_READ8_MEMBER(e004_r);
DECLARE_READ8_MEMBER(protection_r);
diff --git a/src/mame/includes/ultraman.h b/src/mame/includes/ultraman.h
index 4ad0d2a89df..74879dc72ca 100644
--- a/src/mame/includes/ultraman.h
+++ b/src/mame/includes/ultraman.h
@@ -7,6 +7,7 @@
*************************************************************************/
#include "machine/gen_latch.h"
+#include "machine/input_merger.h"
#include "video/k051960.h"
#include "video/k051316.h"
#include "video/konami_helper.h"
@@ -22,7 +23,8 @@ public:
m_k051316_2(*this, "k051316_2"),
m_k051316_3(*this, "k051316_3"),
m_k051960(*this, "k051960"),
- m_soundlatch(*this, "soundlatch") { }
+ m_soundlatch(*this, "soundlatch"),
+ m_soundnmi(*this, "soundnmi") { }
int m_bank0;
int m_bank1;
@@ -36,9 +38,9 @@ public:
required_device<k051316_device> m_k051316_3;
required_device<k051960_device> m_k051960;
required_device<generic_latch_8_device> m_soundlatch;
+ required_device<input_merger_device> m_soundnmi;
- DECLARE_WRITE16_MEMBER(sound_cmd_w);
- DECLARE_WRITE16_MEMBER(sound_irq_trigger_w);
+ DECLARE_WRITE8_MEMBER(sound_nmi_enable_w);
DECLARE_WRITE16_MEMBER(ultraman_gfxctrl_w);
virtual void machine_start() override;
virtual void machine_reset() override;
diff --git a/src/mame/includes/wwfsstar.h b/src/mame/includes/wwfsstar.h
index 78c1c5a3161..064ac366849 100644
--- a/src/mame/includes/wwfsstar.h
+++ b/src/mame/includes/wwfsstar.h
@@ -37,7 +37,6 @@ public:
tilemap_t *m_bg0_tilemap;
DECLARE_WRITE16_MEMBER(scroll_w);
- DECLARE_WRITE16_MEMBER(sound_w);
DECLARE_WRITE16_MEMBER(flipscreen_w);
DECLARE_WRITE16_MEMBER(irqack_w);
DECLARE_WRITE16_MEMBER(fg0_videoram_w);
diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp
index cb04e939cfb..61a635e0f1e 100644
--- a/src/mame/machine/apollo.cpp
+++ b/src/mame/machine/apollo.cpp
@@ -1097,8 +1097,15 @@ MACHINE_CONFIG_START( common )
MCFG_I8237_OUT_DACK_1_CB(WRITELINE(apollo_state, pc_dack5_w))
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(apollo_state, pc_dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(apollo_state, pc_dack7_w))
- MCFG_PIC8259_ADD( APOLLO_PIC1_TAG, WRITELINE(apollo_state,apollo_pic8259_master_set_int_line), VCC, READ8(apollo_state, apollo_pic8259_get_slave_ack))
- MCFG_PIC8259_ADD( APOLLO_PIC2_TAG, WRITELINE(apollo_state,apollo_pic8259_slave_set_int_line), GND, NOOP)
+
+ MCFG_DEVICE_ADD(APOLLO_PIC1_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(apollo_state, apollo_pic8259_master_set_int_line))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(apollo_state, apollo_pic8259_get_slave_ack))
+
+ MCFG_DEVICE_ADD(APOLLO_PIC2_TAG, PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(apollo_state, apollo_pic8259_slave_set_int_line))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD(APOLLO_PTM_TAG, PTM6840, 0)
MCFG_PTM6840_EXTERNAL_CLOCKS(250000, 125000, 62500)
diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp
index 607fcb9eb8d..a7a3255aa02 100644
--- a/src/mame/machine/at.cpp
+++ b/src/mame/machine/at.cpp
@@ -93,8 +93,14 @@ MACHINE_CONFIG_MEMBER( at_mb_device::device_add_mconfig )
MCFG_I8237_OUT_DACK_2_CB(WRITELINE(at_mb_device, dack6_w))
MCFG_I8237_OUT_DACK_3_CB(WRITELINE(at_mb_device, dack7_w))
- MCFG_PIC8259_ADD( "pic8259_master", INPUTLINE(":maincpu", 0), VCC, READ8(at_mb_device, get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir2_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_master", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE(":maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(at_mb_device, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_slave", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_master", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("isabus", ISA16, 0)
MCFG_ISA16_CPU(":maincpu")
diff --git a/src/mame/machine/atarigen.cpp b/src/mame/machine/atarigen.cpp
index 65b2b5a84b7..9678655a743 100644
--- a/src/mame/machine/atarigen.cpp
+++ b/src/mame/machine/atarigen.cpp
@@ -814,119 +814,6 @@ void atari_vad_device::eof_update(emu_timer &timer)
-//**************************************************************************
-// EEPROM INTERFACE DEVICE
-//**************************************************************************
-
-// device type definition
-DEFINE_DEVICE_TYPE(ATARI_EEPROM_2804, atari_eeprom_2804_device, "atari2804", "Atari EEPROM Interface (2804)")
-DEFINE_DEVICE_TYPE(ATARI_EEPROM_2816, atari_eeprom_2816_device, "atari2816", "Atari EEPROM Interface (2816)")
-
-//-------------------------------------------------
-// atari_eeprom_device - constructor
-//-------------------------------------------------
-
-atari_eeprom_device::atari_eeprom_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner)
- : device_t(mconfig, devtype, tag, owner, 0),
- m_eeprom(*this, "eeprom"),
- m_unlocked(false)
-{
-}
-
-
-//-------------------------------------------------
-// unlock_read/unlock_write - unlock read/write
-// handlers
-//-------------------------------------------------
-
-READ8_MEMBER(atari_eeprom_device::unlock_read) { m_unlocked = true; return space.unmap(); }
-WRITE8_MEMBER(atari_eeprom_device::unlock_write) { m_unlocked = true; }
-READ16_MEMBER(atari_eeprom_device::unlock_read) { m_unlocked = true; return space.unmap(); }
-WRITE16_MEMBER(atari_eeprom_device::unlock_write) { m_unlocked = true; }
-READ32_MEMBER(atari_eeprom_device::unlock_read) { m_unlocked = true; return space.unmap(); }
-WRITE32_MEMBER(atari_eeprom_device::unlock_write) { m_unlocked = true; }
-
-
-//-------------------------------------------------
-// read/write - data read/write handlers
-//-------------------------------------------------
-
-READ8_MEMBER(atari_eeprom_device::read)
-{
- return m_eeprom->read(space, offset);
-}
-
-WRITE8_MEMBER(atari_eeprom_device::write)
-{
- if (m_unlocked)
- m_eeprom->write(space, offset, data, mem_mask);
- else
- logerror("%s: Attemptedt to write to EEPROM while not unlocked\n", machine().describe_context());
- m_unlocked = false;
-}
-
-
-//-------------------------------------------------
-// device_start: Start up the device
-//-------------------------------------------------
-
-void atari_eeprom_device::device_start()
-{
- // register for save states
- save_item(NAME(m_unlocked));
-}
-
-
-//-------------------------------------------------
-// device_reset: Handle a device reset by
-// clearing the interrupt lines and states
-//-------------------------------------------------
-
-void atari_eeprom_device::device_reset()
-{
- // reset unlocked state
- m_unlocked = false;
-}
-
-
-//-------------------------------------------------
-// atari_eeprom_2804_device - constructor
-//-------------------------------------------------
-
-atari_eeprom_2804_device::atari_eeprom_2804_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : atari_eeprom_device(mconfig, ATARI_EEPROM_2804, tag, owner)
-{
-}
-
-
-//-------------------------------------------------
-// device_add_mconfig - add device configuration
-//-------------------------------------------------
-
-MACHINE_CONFIG_MEMBER(atari_eeprom_2804_device::device_add_mconfig)
- MCFG_EEPROM_2804_ADD("eeprom")
-MACHINE_CONFIG_END
-
-
-//-------------------------------------------------
-// atari_eeprom_2816_device - constructor
-//-------------------------------------------------
-
-atari_eeprom_2816_device::atari_eeprom_2816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : atari_eeprom_device(mconfig, ATARI_EEPROM_2816, tag, owner)
-{
-}
-
-
-//-------------------------------------------------
-// device_add_mconfig - add device configuration
-//-------------------------------------------------
-
-MACHINE_CONFIG_MEMBER(atari_eeprom_2816_device::device_add_mconfig)
- MCFG_EEPROM_2816_ADD("eeprom")
-MACHINE_CONFIG_END
-
-
/***************************************************************************
OVERALL INIT
***************************************************************************/
diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h
index c6c6baa5896..759fa003fac 100644
--- a/src/mame/machine/atarigen.h
+++ b/src/mame/machine/atarigen.h
@@ -13,7 +13,6 @@
#include "includes/slapstic.h"
#include "cpu/m6502/m6502.h"
-#include "machine/eeprompar.h"
#include "video/atarimo.h"
#include "screen.h"
@@ -81,14 +80,6 @@
-#define MCFG_ATARI_EEPROM_2804_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, ATARI_EEPROM_2804, 0)
-
-#define MCFG_ATARI_EEPROM_2816_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, ATARI_EEPROM_2816, 0)
-
-
-
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
@@ -253,67 +244,6 @@ private:
};
-// ======================> atari_eeprom_device
-
-// device type definition
-DECLARE_DEVICE_TYPE(ATARI_EEPROM_2804, atari_eeprom_2804_device)
-DECLARE_DEVICE_TYPE(ATARI_EEPROM_2816, atari_eeprom_2816_device)
-
-class atari_eeprom_device : public device_t
-{
-protected:
- // construction/destruction
- atari_eeprom_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner);
-
-public:
- // unlock controls
- DECLARE_READ8_MEMBER(unlock_read);
- DECLARE_WRITE8_MEMBER(unlock_write);
- DECLARE_READ16_MEMBER(unlock_read);
- DECLARE_WRITE16_MEMBER(unlock_write);
- DECLARE_READ32_MEMBER(unlock_read);
- DECLARE_WRITE32_MEMBER(unlock_write);
-
- // EEPROM read/write
- DECLARE_READ8_MEMBER(read);
- DECLARE_WRITE8_MEMBER(write);
-
-protected:
- // device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
-
- // internal state
- required_device<eeprom_parallel_28xx_device> m_eeprom;
-
- // live state
- bool m_unlocked;
-};
-
-class atari_eeprom_2804_device : public atari_eeprom_device
-{
-public:
- // construction/destruction
- atari_eeprom_2804_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
-protected:
- // device-level overrides
- virtual void device_add_mconfig(machine_config &config) override;
-};
-
-class atari_eeprom_2816_device : public atari_eeprom_device
-{
-public:
- // construction/destruction
- atari_eeprom_2816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
-protected:
- // device-level overrides
- virtual void device_add_mconfig(machine_config &config) override;
-};
-
-
-
/***************************************************************************
TYPES & STRUCTURES
***************************************************************************/
diff --git a/src/mame/machine/deco146.cpp b/src/mame/machine/deco146.cpp
index 089217af218..a7f7d7e1bbe 100644
--- a/src/mame/machine/deco146.cpp
+++ b/src/mame/machine/deco146.cpp
@@ -1252,7 +1252,6 @@ void deco_146_base_device::write_protport(address_space &space, uint16_t address
else if ((address&0xff) == m_soundlatch_port)
{
logerror("LOAD SOUND LATCH %04x %04x\n", data, mem_mask);
- COMBINE_DATA(&m_soundlatch);
m_soundlatch_w(space, data, mem_mask);
}
@@ -1315,11 +1314,11 @@ uint16_t deco_146_base_device::read_data(uint16_t address, uint16_t mem_mask, ui
deco_146_base_device::deco_146_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock),
+ m_port_a_r(*this),
+ m_port_b_r(*this),
+ m_port_c_r(*this),
m_sound_latch(*this, ":soundlatch")
{
- m_port_a_r = deco146_port_read_cb(FUNC(deco_146_base_device::port_a_default), this);
- m_port_b_r = deco146_port_read_cb(FUNC(deco_146_base_device::port_b_default), this);
- m_port_c_r = deco146_port_read_cb(FUNC(deco_146_base_device::port_c_default), this);
m_soundlatch_w = deco146_port_write_cb(FUNC(deco_146_base_device::soundlatch_default), this);
m_external_addrswap[0] = 0;
@@ -1336,30 +1335,6 @@ deco_146_base_device::deco_146_base_device(const machine_config &mconfig, device
-uint16_t deco_146_base_device::port_dummy_cb(int unused)
-{
- return 0x00;
-}
-
-void deco_146_base_device::soundlatch_dummy(address_space &space, uint16_t data, uint16_t mem_mask)
-{
-}
-
-uint16_t deco_146_base_device::port_a_default(int unused)
-{
- return ioport(":INPUTS")->read();
-}
-
-uint16_t deco_146_base_device::port_b_default(int unused)
-{
- return ioport(":SYSTEM")->read();
-}
-
-uint16_t deco_146_base_device::port_c_default(int unused)
-{
- return ioport(":DSW")->read();
-}
-
void deco_146_base_device::soundlatch_default(address_space &space, uint16_t data, uint16_t mem_mask)
{
if (m_sound_latch != nullptr)
@@ -1371,9 +1346,6 @@ void deco_146_base_device::soundlatch_default(address_space &space, uint16_t dat
-void deco_146_base_device::set_port_a_cb(device_t &device,deco146_port_read_cb port_cb) { deco_146_base_device &dev = downcast<deco_146_base_device &>(device); dev.m_port_a_r = port_cb; }
-void deco_146_base_device::set_port_b_cb(device_t &device,deco146_port_read_cb port_cb) { deco_146_base_device &dev = downcast<deco_146_base_device &>(device); dev.m_port_b_r = port_cb; }
-void deco_146_base_device::set_port_c_cb(device_t &device,deco146_port_read_cb port_cb) { deco_146_base_device &dev = downcast<deco_146_base_device &>(device); dev.m_port_c_r = port_cb; }
void deco_146_base_device::set_soundlatch_cb(device_t &device,deco146_port_write_cb port_cb) { deco_146_base_device &dev = downcast<deco_146_base_device &>(device); dev.m_soundlatch_w = port_cb; }
void deco_146_base_device::set_interface_scramble(device_t &device,uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0)
{
@@ -1406,15 +1378,14 @@ void deco_146_base_device::device_start()
// bind our handler
- m_port_a_r.bind_relative_to(*owner());
- m_port_b_r.bind_relative_to(*owner());
- m_port_c_r.bind_relative_to(*owner());
+ m_port_a_r.resolve_safe(0xffff);
+ m_port_b_r.resolve_safe(0xffff);
+ m_port_c_r.resolve_safe(0xffff);
m_soundlatch_w.bind_relative_to(*owner());
save_item(NAME(m_xor));
save_item(NAME(m_nand));
- save_item(NAME(m_soundlatch));
save_item(NAME(m_rambank0));
save_item(NAME(m_rambank1));
@@ -1440,8 +1411,6 @@ void deco_146_base_device::device_reset()
m_current_rambank = 0;
- m_soundlatch = 0x0000;
-
m_latchaddr = 0xffff;
m_latchdata = 0x0000;
m_latchflag = 0;
diff --git a/src/mame/machine/deco146.h b/src/mame/machine/deco146.h
index 1ef7ab87082..c9d97f32083 100644
--- a/src/mame/machine/deco146.h
+++ b/src/mame/machine/deco146.h
@@ -7,18 +7,17 @@
#include "machine/gen_latch.h"
-typedef device_delegate<uint16_t (int unused)> deco146_port_read_cb;
typedef device_delegate<void (address_space &space, uint16_t data, uint16_t mem_mask)> deco146_port_write_cb;
-#define MCFG_DECO146_SET_PORTA_CALLBACK( _class, _method) \
- deco_146_base_device::set_port_a_cb(*device, deco146_port_read_cb(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
+#define MCFG_DECO146_IN_PORTA_CB(_devcb) \
+ devcb = &deco_146_base_device::set_port_a_cb(*device, DEVCB_##_devcb);
-#define MCFG_DECO146_SET_PORTB_CALLBACK( _class, _method) \
- deco_146_base_device::set_port_b_cb(*device, deco146_port_read_cb(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
+#define MCFG_DECO146_IN_PORTB_CB(_devcb) \
+ devcb = &deco_146_base_device::set_port_b_cb(*device, DEVCB_##_devcb);
-#define MCFG_DECO146_SET_PORTC_CALLBACK( _class, _method) \
- deco_146_base_device::set_port_c_cb(*device, deco146_port_read_cb(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
+#define MCFG_DECO146_IN_PORTC_CB(_devcb) \
+ devcb = &deco_146_base_device::set_port_c_cb(*device, DEVCB_##_devcb);
#define MCFG_DECO146_SET_SOUNDLATCH_CALLBACK( _class, _method) \
deco_146_base_device::set_soundlatch_cb(*device, deco146_port_write_cb(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr));
@@ -86,9 +85,9 @@ public:
void write_data(address_space &space, uint16_t address, uint16_t data, uint16_t mem_mask, uint8_t &csflags);
uint16_t read_data(uint16_t address, uint16_t mem_mask, uint8_t &csflags);
- static void set_port_a_cb(device_t &device,deco146_port_read_cb port_cb);
- static void set_port_b_cb(device_t &device,deco146_port_read_cb port_cb);
- static void set_port_c_cb(device_t &device,deco146_port_read_cb port_cb);
+ template<class Object> static devcb_base &set_port_a_cb(device_t &device, Object &&object) { return downcast<deco_146_base_device &>(device).m_port_a_r.set_callback(std::forward<Object>(object)); }
+ template<class Object> static devcb_base &set_port_b_cb(device_t &device, Object &&object) { return downcast<deco_146_base_device &>(device).m_port_b_r.set_callback(std::forward<Object>(object)); }
+ template<class Object> static devcb_base &set_port_c_cb(device_t &device, Object &&object) { return downcast<deco_146_base_device &>(device).m_port_c_r.set_callback(std::forward<Object>(object)); }
static void set_soundlatch_cb(device_t &device,deco146_port_write_cb port_cb);
static void set_interface_scramble(device_t &device,uint8_t a9, uint8_t a8, uint8_t a7, uint8_t a6, uint8_t a5, uint8_t a4, uint8_t a3,uint8_t a2,uint8_t a1,uint8_t a0);
static void set_use_magic_read_address_xor(device_t &device, int use_xor);
@@ -97,17 +96,12 @@ public:
- deco146_port_read_cb m_port_a_r;
- deco146_port_read_cb m_port_b_r;
- deco146_port_read_cb m_port_c_r;
+ devcb_read16 m_port_a_r;
+ devcb_read16 m_port_b_r;
+ devcb_read16 m_port_c_r;
deco146_port_write_cb m_soundlatch_w;
- uint16_t port_a_default(int unused);
- uint16_t port_b_default(int unused);
- uint16_t port_c_default(int unused);
- uint16_t port_dummy_cb(int unused);
void soundlatch_default(address_space &space, uint16_t data, uint16_t mem_mask);
- void soundlatch_dummy(address_space &space, uint16_t data, uint16_t mem_mask);
uint8_t m_bankswitch_swap_read_address;
uint16_t m_magic_read_address_xor;
@@ -139,7 +133,6 @@ protected:
uint16_t m_nand;
uint16_t m_xor;
- uint16_t m_soundlatch;
uint16_t m_latchaddr;
uint16_t m_latchdata;
diff --git a/src/mame/machine/pcshare.cpp b/src/mame/machine/pcshare.cpp
index c3dbd67e46c..8f7e34f4d8e 100644
--- a/src/mame/machine/pcshare.cpp
+++ b/src/mame/machine/pcshare.cpp
@@ -136,8 +136,15 @@ ADDRESS_MAP_START( pcat32_io_common, AS_IO, 32, pcat_base_state )
ADDRESS_MAP_END
MACHINE_CONFIG_START(pcat_common)
- MCFG_PIC8259_ADD( "pic8259_1", INPUTLINE("maincpu", 0), VCC, READ8(pcat_base_state, get_slave_ack) )
- MCFG_PIC8259_ADD( "pic8259_2", DEVWRITELINE("pic8259_1", pic8259_device, ir2_w), GND, NOOP)
+ MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", 0))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(pcat_base_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
+
MCFG_DEVICE_ADD( "dma8237_1", AM9517A, XTAL_14_31818MHz/3 )
MCFG_I8237_OUT_HREQ_CB(WRITELINE(pcat_base_state, pc_dma_hrq_changed))
MCFG_I8237_IN_MEMR_CB(READ8(pcat_base_state, pc_dma_read_byte))
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index 0a59d8dff8d..24b8b526102 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -887,8 +887,15 @@ MACHINE_CONFIG_START(xbox_base)
MCFG_PCI_DEVICE_ADD(":pci:1e.0:00.0", NV2A_GPU, 0x10de02a0, 0, 0, 0)
MCFG_MCPX_NV2A_GPU_CPU("maincpu")
MCFG_MCPX_NV2A_GPU_INTERRUPT_HANDLER(DEVWRITELINE(":", xbox_base_state, xbox_nv2a_interrupt_changed))
- MCFG_PIC8259_ADD("pic8259_1", WRITELINE(xbox_base_state, xbox_pic8259_1_set_int_line), VCC, READ8(xbox_base_state, get_slave_ack))
- MCFG_PIC8259_ADD("pic8259_2", DEVWRITELINE("pic8259_1", pic8259_device, ir2_w), GND, NOOP)
+
+ MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(WRITELINE(xbox_base_state, xbox_pic8259_1_set_int_line))
+ MCFG_PIC8259_IN_SP_CB(VCC)
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(xbox_base_state, get_slave_ack))
+
+ MCFG_DEVICE_ADD("pic8259_2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir2_w))
+ MCFG_PIC8259_IN_SP_CB(GND)
MCFG_DEVICE_ADD("pit8254", PIT8254, 0)
MCFG_PIT8253_CLK0(1125000) /* heartbeat IRQ */
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 1efcf4e2769..2b258610c44 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -12829,6 +12829,7 @@ royalcrdg // (c) 1991 TAB-Austria
royalcrdh // (c) 1991 TAB-Austria
royalcrdp // (c) 1993 Digital Dreams
royalcrdt // (c) 1991 TAB-Austria orig
+royaljp // (c) 1991 TAB / Video Klein
saloon // 199? unknown
sjcd2kx3 // (c) 1985 M.P.
soccernw // 199? bootleg
@@ -12872,6 +12873,7 @@ thoop // (c) 1992 - Ref 922804/1
@source:gaelco2.cpp
aligator // (c) 1994 - Ref 940411
+aligators // (c) 1994 - Ref 940411
aligatorun // (c) 1994 - Ref 940411 (unprotected)
aligatoruna // (c) 1994 - Ref 940411 (unprotected)
bang // (c) 1998 - Ref ???
@@ -14134,8 +14136,8 @@ x2222o // (c) 2000, Oriental Soft
gstriker // (c) [1993] Human
gstrikera // (c) [1993] Human
gstrikerj // (c) [1993] Human
-twrldc94 // (c) 1994 Tecmo
-twrldc94a // (c) 1994 Tecmo
+twcup94 // (c) 1994 Tecmo
+twcup94a // (c) 1994 Tecmo
vgoalsca // (c) 199? Tecmo
vgoalsoc // (c) 199? Tecmo
@@ -14618,6 +14620,7 @@ knfl // Konami
ktmnt // Konami
ktopgun // Konami
nupogodi // Elektronika
+rzindy500 // Tiger
tddragon // Tiger
tgaunt // Tiger
tsjam // Tiger
@@ -20292,7 +20295,7 @@ mp_shnb3 // 09
mp_soni2 // 07
mp_sonic // 01
mp_sor2 // 05
-mp_twc // 04
+mp_twcup // 04
@source:megasys1.cpp
64street // (c) 1991
@@ -29145,6 +29148,9 @@ nc100 // 1992 NC100
nc150 // 1992 NC150
nc200 // 1993 NC200
+@source:nds.cpp
+nds // 2004 Nintendo
+
@source:nemesis.cpp
blkpnthr // GX604 (c) 1987 (Japan)
bubsys //
@@ -29418,7 +29424,7 @@ tpgolf // 0003 (c) 1990 SNK
trally // 0038 (c) 1991 Alpha Denshi Co.
turfmast // 0200 (c) 1996 Nazca
twinspri // 0224 (c) 1996 ADK
-tws96 // 0086 (c) 1996 Tecmo
+twsoc96 // 0086 (c) 1996 Tecmo
viewpoin // 0051 (c) 1992 Sammy
vliner //
vlinero //
@@ -35727,6 +35733,8 @@ gogold // B56 (c) 1988 Taito Corporation (Japan)
recordbr // B56 (c) 1988 Taito Corporation Japan (World)
syvalion // B51 (c) 1988 Taito Corporation (Japan)
syvalionp //
+syvalionu
+syvalionw
tetristh // C26 (c) 1988 Sega Enterprises,Ltd. (Japan)
@source:taito_l.cpp
@@ -36500,6 +36508,7 @@ arknoid2j // B08 (c) 1987 Taito Corporation (Japan)
arknoid2u // B08 (c) 1987 Taito America Corporation + Romstar license (US)
chukatai // B44 (c) 1988 Taito Corporation Japan (World)
chukataij // B44 (c) 1988 Taito Corporation (Japan)
+chukataija // B44 (c) 1988 Taito Corporation (Japan)
chukataiu // B44 (c) 1988 Taito Corporation (US)
drtoppel // B19 (c) 1987 Taito Corporation Japan (World)
drtoppelj // B19 (c) 1987 Taito Corporation (Japan)
@@ -37527,6 +37536,7 @@ wackygtr // Wacky Gator
@source:wallc.cpp
brkblast // bootleg (Fadesa)
sidampkr //
+unkitpkr //
wallc // (c) 1984 Midcoin
wallca // (c) 1984 Midcoin
@@ -37563,15 +37573,15 @@ warriorb // D24 (c) 1991 Taito Corporation (Japan)
@source:wc90.cpp
pac90 // bootleg
-wc90 // (c) 1989 Tecmo
-wc90a // (c) 1989 Tecmo
-wc90b // (c) 1989 Tecmo
-wc90t // (c) 1989 Tecmo
+twcup90 // (c) 1989 Tecmo
+twcup90a // (c) 1989 Tecmo
+twcup90b // (c) 1989 Tecmo
+twcup90t // (c) 1989 Tecmo
@source:wc90b.cpp
-wc90b1 // bootleg
-wc90b2 // bootleg
-wc90ba // bootleg
+twcup90b1 // bootleg
+twcup90b2 // bootleg
+twcup90ba // bootleg
@source:wecleman.cpp
hotchase // GX763 (c) 1988
@@ -38702,7 +38712,7 @@ strider2a // Strider 2 (ASIA 991213)
tblkkuzu // The Block Kuzushi (JAPAN)
techromn // Tech Romancer (EURO 980914)
techromnu // Tech Romancer (USA 980914)
-tecmowcm // Tecmo World Cup Millennium (JAPAN)
+twcupmil // Tecmo World Cup Millennium (JAPAN)
tgmj // Tetris The Grand Master (JAPAN 980710)
tondemo // Tondemo Crisis (JAPAN)
ts2 // Battle Arena Toshinden 2 (USA 951124)
diff --git a/src/mame/mess.flt b/src/mame/mess.flt
index 086851887dc..1a36b138160 100644
--- a/src/mame/mess.flt
+++ b/src/mame/mess.flt
@@ -414,6 +414,7 @@ nakajies.cpp
nanos.cpp
nascom1.cpp
nc.cpp
+nds.cpp
neogeocd.cpp
nes.cpp
nes_vt.cpp
diff --git a/src/mame/video/galaxian.cpp b/src/mame/video/galaxian.cpp
index 898d21ebf9b..aad8d84ea1e 100644
--- a/src/mame/video/galaxian.cpp
+++ b/src/mame/video/galaxian.cpp
@@ -846,7 +846,7 @@ void galaxian_state::stars_update_origin()
*
*************************************/
-TIMER_DEVICE_CALLBACK_MEMBER(galaxian_state::galaxian_stars_blink_timer)
+TIMER_DEVICE_CALLBACK_MEMBER(galaxian_state::scramble_stars_blink_timer)
{
m_stars_blink_state++;
}
diff --git a/src/mame/video/gstriker.cpp b/src/mame/video/gstriker.cpp
index 4b6bab05a61..c1919f10727 100644
--- a/src/mame/video/gstriker.cpp
+++ b/src/mame/video/gstriker.cpp
@@ -7,38 +7,56 @@
/*** VIDEO UPDATE/START **********************************************/
+void gstriker_state::video_start()
+{
+ // Initialize the chip for the score plane
+ m_tx->set_transparent_pen(0xf);
+ // Initialize the chip for the screen plane
+ m_bg->set_transparent_pen(0xf);
+
+ m_buffered_spriteram = std::make_unique<uint16_t[]>(0x2000);
+ m_buffered_spriteram2 = std::make_unique<uint16_t[]>(0x2000);
+ save_pointer(NAME(m_buffered_spriteram.get()), 0x2000);
+ save_pointer(NAME(m_buffered_spriteram2.get()), 0x2000);
+}
-uint32_t gstriker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+WRITE_LINE_MEMBER(gstriker_state::screen_vblank)
{
- bitmap.fill(m_mixerregs1[8]&0x07ff, cliprect); // complete guess, causes green behind test grid in twc94 and blue behind title screen on gstriker
+ // sprites are two frames ahead
+ // TODO: probably all Video System games are (Aero Fighters definitely desyncs wrt background)
+ if(state)
+ {
+ memcpy(m_buffered_spriteram.get(), m_CG10103_m_vram, 0x2000);
+ memcpy(m_buffered_spriteram2.get(), m_buffered_spriteram.get(), 0x2000);
+ }
+}
- popmessage("%04x %04x %04x %04x %04x %04x %04x %04x | %04x %04x %04x %04x %04x %04x %04x %04x", m_mixerregs1[0],m_mixerregs1[1],m_mixerregs1[2],m_mixerregs1[3],m_mixerregs1[4],m_mixerregs1[5],m_mixerregs1[6],m_mixerregs1[7], m_mixerregs1[8],m_mixerregs1[9],m_mixerregs1[10],m_mixerregs1[11],m_mixerregs1[12],m_mixerregs1[13],m_mixerregs1[14],m_mixerregs1[15] );
-// popmessage("%04x %04x %04x %04x %04x %04x %04x %04x | %04x %04x %04x %04x %04x %04x %04x %04x", m_mixerregs2[0],m_mixerregs2[1],m_mixerregs2[2],m_mixerregs2[3],m_mixerregs2[4],m_mixerregs2[5],m_mixerregs2[6],m_mixerregs2[7], m_mixerregs2[8],m_mixerregs2[9],m_mixerregs2[10],m_mixerregs2[11],m_mixerregs2[12],m_mixerregs2[13],m_mixerregs2[14],m_mixerregs2[15] );
- m_spr->set_pal_base( (m_mixerregs1[0]&0xf000)>>8 );
- m_bg->set_pal_base( (m_mixerregs1[1]&0xf000)>>8 );
- m_tx->set_pal_base( (m_mixerregs1[2]&0xf000)>>8 );
+uint32_t gstriker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ bitmap.fill(m_mixerregs[8]&0x07ff, cliprect); // complete guess, causes green behind test grid in twc94 and blue behind title screen on gstriker
+
+ /*
+ [4] AAAA BBBB ---- ---- sprite priority number A/B?
+ [5] xxxx ---- ---- ---- background layer priority number?
+ [6] xxxx ---- ---- ---- foreground layer priority number?
+ */
+// popmessage("%04x %04x %04x %04x %04x %04x %04x %04x | %04x %04x %04x %04x %04x %04x %04x %04x", m_mixerregs[0],m_mixerregs[1],m_mixerregs[2],m_mixerregs[3],m_mixerregs[4],m_mixerregs[5],m_mixerregs[6],m_mixerregs[7], m_mixerregs[8],m_mixerregs[9],m_mixerregs[10],m_mixerregs[11],m_mixerregs[12],m_mixerregs[13],m_mixerregs[14],m_mixerregs[15] );
+ m_spr->set_pal_base( (m_mixerregs[0]&0xf000)>>8 );
+ m_bg->set_pal_base( (m_mixerregs[1]&0xf000)>>8 );
+ m_tx->set_pal_base( (m_mixerregs[2]&0xf000)>>8 );
- // Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably
- // needs sprite orthogonality
+
+ // Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably needs sprite orthogonality
m_bg->draw( screen, bitmap,cliprect, 0);
- m_spr->draw_sprites(m_CG10103_m_vram, 0x2000, screen, bitmap, cliprect, 0x2, 0x0);
+ m_spr->draw_sprites(m_buffered_spriteram2.get(), 0x2000, screen, bitmap, cliprect, 0x2, 0x0);
m_tx->draw(screen, bitmap, cliprect, 0);
- m_spr->draw_sprites(m_CG10103_m_vram, 0x2000, screen, bitmap, cliprect, 0x2, 0x2);
+ m_spr->draw_sprites(m_buffered_spriteram2.get(), 0x2000, screen, bitmap, cliprect, 0x2, 0x2);
return 0;
}
-
-void gstriker_state::video_start()
-{
- // Initialize the chip for the score plane
- m_tx->set_transparent_pen(0xf);
-
- // Initialize the chip for the screen plane
- m_bg->set_transparent_pen(0xf);
-}
diff --git a/src/mame/video/k007420.cpp b/src/mame/video/k007420.cpp
index 235ee5c222c..ae702212c26 100644
--- a/src/mame/video/k007420.cpp
+++ b/src/mame/video/k007420.cpp
@@ -5,6 +5,9 @@ Konami 007420
------
Sprite generator. 8 bytes per sprite with zoom. It uses 0x200 bytes of RAM,
and a variable amount of ROM. Nothing is known about its external interface.
+
+TODO:
+- sprite X wraparound? (Rock N Rage sprites disappears on left edge of screen)
*/
#include "emu.h"
diff --git a/src/mame/video/mb60553.cpp b/src/mame/video/mb60553.cpp
index 9178227b0e4..f24c8de2864 100644
--- a/src/mame/video/mb60553.cpp
+++ b/src/mame/video/mb60553.cpp
@@ -5,7 +5,12 @@
the actual line scroll / zoom is not properly understood
interestingly the chip seems to require doubled up ROMs (2 copies of each ROM) to draw just the single layer.
-
+
+*/
+/*
+ Tecmo World Cup '94 "service mode" has an item for testing zooming, this is:
+ 0xffdf12 target zoom code
+ 0xffdf16 current zoom code
*/
#include "emu.h"
@@ -257,33 +262,40 @@ void mb60553_zooming_tilemap_device::draw( screen_device &screen, bitmap_ind16&
{
int line;
rectangle clip;
-
+
clip.min_x = screen.visible_area().min_x;
clip.max_x = screen.visible_area().max_x;
- for (line = 0; line < 224;line++)
+ for (line = screen.visible_area().min_y; line < screen.visible_area().max_y;line++)
{
// int scrollx;
// int scrolly;
-
uint32_t startx,starty;
-
- uint32_t incxx,incyy;
-
- startx = m_regs[0];
+ int32_t incxx,incyy;
+ int32_t incxy,incyx;
+ float xoffset;
+
+ // confirmed on how ROZ is used
+ incyy = ((int16_t)m_lineram[(line)*8+0])<<4;
+ incxx = ((int16_t)m_lineram[(line)*8+3])<<4;
+
+ // startx has an offset based off current x zoom value
+ // This is confirmed by Tecmo World Cup '94 startx being 0xff40 (-192) when showing footballer pics on attract mode (incxx is 0x800)
+ // TODO: slightly offset?
+ xoffset = ((float)incyy/(float)0x10000) * 384.0;
+
+ startx = m_regs[0] + (int32_t)xoffset;
starty = m_regs[1];
- startx += (24<<4); // maybe not..
-
- startx -= m_lineram[(line)*8+7]/2;
-
- incxx = m_lineram[(line)*8+0]<<4;
- incyy = m_lineram[(line)*8+3]<<4;
-
+ // TODO: what's this? Used by Grand Striker playfield
+ incyx = ((int16_t)m_lineram[(line)*8+7])<<4;
+ // V Goal Soccer rotation
+ incxy = ((int16_t)m_lineram[(line)*8+4])<<4;
+
clip.min_y = clip.max_y = line;
draw_roz_core(screen, bitmap, clip, startx<<12,starty<<12,
- incxx,0,0,incyy,
+ incxx,incxy,-incyx,incyy,
1
);
diff --git a/src/mame/video/munchmo.cpp b/src/mame/video/munchmo.cpp
index 972d23373b6..652c63a0682 100644
--- a/src/mame/video/munchmo.cpp
+++ b/src/mame/video/munchmo.cpp
@@ -32,14 +32,19 @@ PALETTE_INIT_MEMBER(munchmo_state, munchmo)
}
}
-WRITE8_MEMBER(munchmo_state::palette_bank_w)
+WRITE_LINE_MEMBER(munchmo_state::palette_bank_0_w)
{
- m_palette_bank = data & 0x3;
+ m_palette_bank = (state ? 1 : 0) | (m_palette_bank & 2);
}
-WRITE8_MEMBER(munchmo_state::flipscreen_w)
+WRITE_LINE_MEMBER(munchmo_state::palette_bank_1_w)
{
- m_flipscreen = data;
+ m_palette_bank = (state ? 2 : 0) | (m_palette_bank & 1);
+}
+
+WRITE_LINE_MEMBER(munchmo_state::flipscreen_w)
+{
+ m_flipscreen = state;
}
diff --git a/src/mame/video/rockrage.cpp b/src/mame/video/rockrage.cpp
index 3c66a16a2b4..8b1b26209a1 100644
--- a/src/mame/video/rockrage.cpp
+++ b/src/mame/video/rockrage.cpp
@@ -27,7 +27,7 @@ PALETTE_INIT_MEMBER(rockrage_state, rockrage)
K007342_CALLBACK_MEMBER(rockrage_state::rockrage_tile_callback)
{
if (layer == 1)
- *code |= ((*color & 0x40) << 2) | ((bank & 0x01) << 9);
+ *code |= ((*color & 0x40) << 2) | ((m_vreg & 0x04) << 7); // doesn't use bank here (Tutankhamen eyes blinking)
else
*code |= ((*color & 0x40) << 2) | ((bank & 0x03) << 10) | ((m_vreg & 0x04) << 7) | ((m_vreg & 0x08) << 9);
*color = layer * 16 + (*color & 0x0f);
@@ -70,10 +70,12 @@ uint32_t rockrage_state::screen_update_rockrage(screen_device &screen, bitmap_in
{
m_k007342->tilemap_update();
+ bitmap.fill(rgb_t::black(), cliprect);
m_k007342->tilemap_draw(screen, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
- m_k007420->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(1));
- m_k007342->tilemap_draw(screen, bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE, 0);
+ // Tutankhamen eyes go below sprites
m_k007342->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0);
+ m_k007420->sprites_draw(bitmap, cliprect, m_gfxdecode->gfx(1));
+ m_k007342->tilemap_draw(screen, bitmap, cliprect, 0, 1, 0);
m_k007342->tilemap_draw(screen, bitmap, cliprect, 1, 1, 0);
return 0;
}