summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Olivier Galibert <galibert@pobox.com>2017-06-07 15:09:03 +0200
committerGravatarGravatar Olivier Galibert <galibert@pobox.com>2017-07-04 15:13:49 +0200
commite0303c683a6e500344c3151770a4801de0e314ce (patch) (github)
tree4048d0ef6bc4dd70a8284426e425de089f347f36
parent6951a706ba71e67724b4b29f705f9abdea1b74d5 (diff)
downloadmame-konami.tar.bz2
mame-konami.zip
konami rendering overhaul [O. Galibert, P.J.Bennett]konami
-rw-r--r--scripts/src/emu.lua4
-rw-r--r--scripts/target/mame/arcade.lua41
-rw-r--r--src/devices/machine/k053252.cpp577
-rw-r--r--src/devices/machine/k053252.h145
-rw-r--r--src/emu/addrmap.cpp2
-rw-r--r--src/emu/difr.cpp356
-rw-r--r--src/emu/difr.h212
-rw-r--r--src/emu/ksnotifier.cpp83
-rw-r--r--src/emu/ksnotifier.h76
-rw-r--r--src/emu/mconfig.h6
-rw-r--r--src/emu/save.h7
-rw-r--r--src/emu/screen.cpp114
-rw-r--r--src/emu/screen.h26
-rw-r--r--src/frontend/mame/ui/ui.cpp2
-rw-r--r--src/lib/util/bitmap.h6
-rw-r--r--src/mame/drivers/88games.cpp136
-rw-r--r--src/mame/drivers/ajax.cpp343
-rw-r--r--src/mame/drivers/asterix.cpp240
-rw-r--r--src/mame/drivers/bishi.cpp176
-rw-r--r--src/mame/drivers/bottom9.cpp130
-rw-r--r--src/mame/drivers/chqflag.cpp135
-rw-r--r--src/mame/drivers/dbz.cpp71
-rw-r--r--src/mame/drivers/divebomb.cpp274
-rw-r--r--src/mame/drivers/djmain.cpp29
-rw-r--r--src/mame/drivers/einstein.cpp4
-rw-r--r--src/mame/drivers/firebeat.cpp4
-rw-r--r--src/mame/drivers/giclassic.cpp95
-rw-r--r--src/mame/drivers/gijoe.cpp244
-rw-r--r--src/mame/drivers/hexion.cpp10
-rw-r--r--src/mame/drivers/konamigx.cpp1780
-rw-r--r--src/mame/drivers/konmedal.cpp40
-rw-r--r--src/mame/drivers/lethal.cpp75
-rw-r--r--src/mame/drivers/moo.cpp271
-rw-r--r--src/mame/drivers/mystwarr.cpp1511
-rw-r--r--src/mame/drivers/overdriv.cpp369
-rw-r--r--src/mame/drivers/parodius.cpp4
-rw-r--r--src/mame/drivers/piratesh.cpp356
-rw-r--r--src/mame/drivers/qdrmfgp.cpp89
-rw-r--r--src/mame/drivers/rollerg.cpp97
-rw-r--r--src/mame/drivers/rungun.cpp106
-rw-r--r--src/mame/drivers/simpsons.cpp68
-rw-r--r--src/mame/drivers/surpratk.cpp4
-rw-r--r--src/mame/drivers/tail2nos.cpp216
-rw-r--r--src/mame/drivers/tasman.cpp63
-rw-r--r--src/mame/drivers/tmnt.cpp59
-rw-r--r--src/mame/drivers/ultraman.cpp133
-rw-r--r--src/mame/drivers/vendetta.cpp56
-rw-r--r--src/mame/drivers/wecleman.cpp1264
-rw-r--r--src/mame/drivers/xexex.cpp601
-rw-r--r--src/mame/drivers/xmen.cpp58
-rw-r--r--src/mame/drivers/zr107.cpp33
-rw-r--r--src/mame/includes/88games.h68
-rw-r--r--src/mame/includes/ajax.h63
-rw-r--r--src/mame/includes/asterix.h63
-rw-r--r--src/mame/includes/bishi.h61
-rw-r--r--src/mame/includes/bottom9.h64
-rw-r--r--src/mame/includes/chqflag.h72
-rw-r--r--src/mame/includes/dbz.h22
-rw-r--r--src/mame/includes/djmain.h9
-rw-r--r--src/mame/includes/gijoe.h55
-rw-r--r--src/mame/includes/hexion.h4
-rw-r--r--src/mame/includes/konamigx.h162
-rw-r--r--src/mame/includes/lethal.h11
-rw-r--r--src/mame/includes/moo.h31
-rw-r--r--src/mame/includes/mystwarr.h106
-rw-r--r--src/mame/includes/overdriv.h71
-rw-r--r--src/mame/includes/qdrmfgp.h12
-rw-r--r--src/mame/includes/rollerg.h55
-rw-r--r--src/mame/includes/rungun.h20
-rw-r--r--src/mame/includes/simpsons.h10
-rw-r--r--src/mame/includes/tail2nos.h64
-rw-r--r--src/mame/includes/tmnt.h5
-rw-r--r--src/mame/includes/ultraman.h50
-rw-r--r--src/mame/includes/vendetta.h22
-rw-r--r--src/mame/includes/wecleman.h138
-rw-r--r--src/mame/includes/xexex.h101
-rw-r--r--src/mame/includes/xmen.h18
-rw-r--r--src/mame/machine/ajax.cpp214
-rw-r--r--src/mame/machine/konamigx.cpp271
-rw-r--r--src/mame/machine/simpsons.cpp2
-rw-r--r--src/mame/video/88games.cpp82
-rw-r--r--src/mame/video/ajax.cpp98
-rw-r--r--src/mame/video/asterix.cpp108
-rw-r--r--src/mame/video/bishi.cpp72
-rw-r--r--src/mame/video/bottom9.cpp80
-rw-r--r--src/mame/video/chqflag.cpp67
-rw-r--r--src/mame/video/dbz.cpp155
-rw-r--r--src/mame/video/djmain.cpp20
-rw-r--r--src/mame/video/gijoe.cpp168
-rw-r--r--src/mame/video/k051316.cpp437
-rw-r--r--src/mame/video/k051316.h106
-rw-r--r--src/mame/video/k053246_k053247_k055673.cpp1750
-rw-r--r--src/mame/video/k053246_k053247_k055673.h614
-rw-r--r--src/mame/video/k053250.cpp594
-rw-r--r--src/mame/video/k053250.h104
-rw-r--r--src/mame/video/k053250_ps.cpp597
-rw-r--r--src/mame/video/k053250_ps.h82
-rw-r--r--src/mame/video/k053251.cpp449
-rw-r--r--src/mame/video/k053251.h60
-rw-r--r--src/mame/video/k053936.cpp203
-rw-r--r--src/mame/video/k053936.h24
-rw-r--r--src/mame/video/k054156_k054157_k056832.cpp3688
-rw-r--r--src/mame/video/k054156_k054157_k056832.h426
-rw-r--r--src/mame/video/k054338.cpp433
-rw-r--r--src/mame/video/k054338.h113
-rw-r--r--src/mame/video/k055555.cpp1117
-rw-r--r--src/mame/video/k055555.h165
-rw-r--r--src/mame/video/konamigx.cpp1631
-rw-r--r--src/mame/video/kvideodac.cpp132
-rw-r--r--src/mame/video/kvideodac.h57
-rw-r--r--src/mame/video/lethal.cpp114
-rw-r--r--src/mame/video/moo.cpp135
-rw-r--r--src/mame/video/mystwarr.cpp487
-rw-r--r--src/mame/video/overdriv.cpp66
-rw-r--r--src/mame/video/parodius.cpp16
-rw-r--r--src/mame/video/qdrmfgp.cpp8
-rw-r--r--src/mame/video/rollerg.cpp55
-rw-r--r--src/mame/video/rungun.cpp178
-rw-r--r--src/mame/video/simpsons.cpp121
-rw-r--r--src/mame/video/surpratk.cpp16
-rw-r--r--src/mame/video/tail2nos.cpp177
-rw-r--r--src/mame/video/tmnt.cpp72
-rw-r--r--src/mame/video/ultraman.cpp118
-rw-r--r--src/mame/video/vendetta.cpp80
-rw-r--r--src/mame/video/vlatency.cpp57
-rw-r--r--src/mame/video/vlatency.h47
-rw-r--r--src/mame/video/wecleman.cpp1134
-rw-r--r--src/mame/video/xexex.cpp106
-rw-r--r--src/mame/video/xmen.cpp222
129 files changed, 12870 insertions, 16616 deletions
diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua
index 5718b938030..2e663178ed8 100644
--- a/scripts/src/emu.lua
+++ b/scripts/src/emu.lua
@@ -71,6 +71,8 @@ files {
MAME_DIR .. "src/emu/didisasm.h",
MAME_DIR .. "src/emu/diexec.cpp",
MAME_DIR .. "src/emu/diexec.h",
+ MAME_DIR .. "src/emu/difr.cpp",
+ MAME_DIR .. "src/emu/difr.h",
MAME_DIR .. "src/emu/digfx.cpp",
MAME_DIR .. "src/emu/digfx.h",
MAME_DIR .. "src/emu/diimage.cpp",
@@ -134,6 +136,8 @@ files {
MAME_DIR .. "src/emu/ioport.h",
MAME_DIR .. "src/emu/inpttype.h",
MAME_DIR .. "src/emu/logmacro.h",
+ MAME_DIR .. "src/emu/ksnotifier.h",
+ MAME_DIR .. "src/emu/ksnotifier.cpp",
MAME_DIR .. "src/emu/machine.cpp",
MAME_DIR .. "src/emu/machine.h",
MAME_DIR .. "src/emu/mconfig.cpp",
diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua
index f0d33963f02..bf63385243b 100644
--- a/scripts/target/mame/arcade.lua
+++ b/scripts/target/mame/arcade.lua
@@ -2168,34 +2168,22 @@ files {
createMAMEProjects(_target, _subtarget, "konami")
files {
MAME_DIR .. "src/mame/drivers/88games.cpp",
- MAME_DIR .. "src/mame/includes/88games.h",
- MAME_DIR .. "src/mame/video/88games.cpp",
MAME_DIR .. "src/mame/drivers/ajax.cpp",
- MAME_DIR .. "src/mame/includes/ajax.h",
- MAME_DIR .. "src/mame/machine/ajax.cpp",
- MAME_DIR .. "src/mame/video/ajax.cpp",
MAME_DIR .. "src/mame/drivers/aliens.cpp",
MAME_DIR .. "src/mame/includes/aliens.h",
MAME_DIR .. "src/mame/video/aliens.cpp",
MAME_DIR .. "src/mame/drivers/asterix.cpp",
MAME_DIR .. "src/mame/includes/asterix.h",
- MAME_DIR .. "src/mame/video/asterix.cpp",
MAME_DIR .. "src/mame/drivers/battlnts.cpp",
MAME_DIR .. "src/mame/includes/battlnts.h",
MAME_DIR .. "src/mame/video/battlnts.cpp",
MAME_DIR .. "src/mame/drivers/bishi.cpp",
- MAME_DIR .. "src/mame/includes/bishi.h",
- MAME_DIR .. "src/mame/video/bishi.cpp",
MAME_DIR .. "src/mame/drivers/bladestl.cpp",
MAME_DIR .. "src/mame/includes/bladestl.h",
MAME_DIR .. "src/mame/video/bladestl.cpp",
MAME_DIR .. "src/mame/drivers/blockhl.cpp",
MAME_DIR .. "src/mame/drivers/bottom9.cpp",
- MAME_DIR .. "src/mame/includes/bottom9.h",
- MAME_DIR .. "src/mame/video/bottom9.cpp",
MAME_DIR .. "src/mame/drivers/chqflag.cpp",
- MAME_DIR .. "src/mame/includes/chqflag.h",
- MAME_DIR .. "src/mame/video/chqflag.cpp",
MAME_DIR .. "src/mame/drivers/circusc.cpp",
MAME_DIR .. "src/mame/includes/circusc.h",
MAME_DIR .. "src/mame/video/circusc.cpp",
@@ -2211,13 +2199,10 @@ files {
MAME_DIR .. "src/mame/video/crimfght.cpp",
MAME_DIR .. "src/mame/drivers/dbz.cpp",
MAME_DIR .. "src/mame/includes/dbz.h",
- MAME_DIR .. "src/mame/video/dbz.cpp",
MAME_DIR .. "src/mame/drivers/ddribble.cpp",
MAME_DIR .. "src/mame/includes/ddribble.h",
MAME_DIR .. "src/mame/video/ddribble.cpp",
MAME_DIR .. "src/mame/drivers/divebomb.cpp",
- MAME_DIR .. "src/mame/includes/divebomb.h",
- MAME_DIR .. "src/mame/video/divebomb.cpp",
MAME_DIR .. "src/mame/drivers/djmain.cpp",
MAME_DIR .. "src/mame/includes/djmain.h",
MAME_DIR .. "src/mame/video/djmain.cpp",
@@ -2242,7 +2227,6 @@ files {
MAME_DIR .. "src/mame/drivers/giclassic.cpp",
MAME_DIR .. "src/mame/drivers/gijoe.cpp",
MAME_DIR .. "src/mame/includes/gijoe.h",
- MAME_DIR .. "src/mame/video/gijoe.cpp",
MAME_DIR .. "src/mame/drivers/gradius3.cpp",
MAME_DIR .. "src/mame/includes/gradius3.h",
MAME_DIR .. "src/mame/video/gradius3.cpp",
@@ -2279,7 +2263,6 @@ files {
MAME_DIR .. "src/mame/drivers/konamigx.cpp",
MAME_DIR .. "src/mame/includes/konamigx.h",
MAME_DIR .. "src/mame/machine/konamigx.cpp",
- MAME_DIR .. "src/mame/video/konamigx.cpp",
MAME_DIR .. "src/mame/drivers/konamim2.cpp",
MAME_DIR .. "src/mame/drivers/konmedal.cpp",
MAME_DIR .. "src/mame/drivers/kontest.cpp",
@@ -2302,7 +2285,6 @@ files {
MAME_DIR .. "src/mame/video/labyrunr.cpp",
MAME_DIR .. "src/mame/drivers/lethal.cpp",
MAME_DIR .. "src/mame/includes/lethal.h",
- MAME_DIR .. "src/mame/video/lethal.cpp",
MAME_DIR .. "src/mame/drivers/mainevt.cpp",
MAME_DIR .. "src/mame/includes/mainevt.h",
MAME_DIR .. "src/mame/video/mainevt.cpp",
@@ -2315,10 +2297,8 @@ files {
MAME_DIR .. "src/mame/drivers/mogura.cpp",
MAME_DIR .. "src/mame/drivers/moo.cpp",
MAME_DIR .. "src/mame/includes/moo.h",
- MAME_DIR .. "src/mame/video/moo.cpp",
MAME_DIR .. "src/mame/drivers/mystwarr.cpp",
MAME_DIR .. "src/mame/includes/mystwarr.h",
- MAME_DIR .. "src/mame/video/mystwarr.cpp",
MAME_DIR .. "src/mame/drivers/nemesis.cpp",
MAME_DIR .. "src/mame/includes/nemesis.h",
MAME_DIR .. "src/mame/video/nemesis.cpp",
@@ -2326,7 +2306,6 @@ files {
MAME_DIR .. "src/mame/drivers/otomedius.cpp",
MAME_DIR .. "src/mame/drivers/overdriv.cpp",
MAME_DIR .. "src/mame/includes/overdriv.h",
- MAME_DIR .. "src/mame/video/overdriv.cpp",
MAME_DIR .. "src/mame/drivers/pandoras.cpp",
MAME_DIR .. "src/mame/includes/pandoras.h",
MAME_DIR .. "src/mame/video/pandoras.cpp",
@@ -2354,11 +2333,8 @@ files {
MAME_DIR .. "src/mame/includes/rocnrope.h",
MAME_DIR .. "src/mame/video/rocnrope.cpp",
MAME_DIR .. "src/mame/drivers/rollerg.cpp",
- MAME_DIR .. "src/mame/includes/rollerg.h",
- MAME_DIR .. "src/mame/video/rollerg.cpp",
MAME_DIR .. "src/mame/drivers/rungun.cpp",
MAME_DIR .. "src/mame/includes/rungun.h",
- MAME_DIR .. "src/mame/video/rungun.cpp",
MAME_DIR .. "src/mame/drivers/sbasketb.cpp",
MAME_DIR .. "src/mame/includes/sbasketb.h",
MAME_DIR .. "src/mame/video/sbasketb.cpp",
@@ -2376,7 +2352,6 @@ files {
MAME_DIR .. "src/mame/drivers/simpsons.cpp",
MAME_DIR .. "src/mame/includes/simpsons.h",
MAME_DIR .. "src/mame/machine/simpsons.cpp",
- MAME_DIR .. "src/mame/video/simpsons.cpp",
MAME_DIR .. "src/mame/drivers/spy.cpp",
MAME_DIR .. "src/mame/includes/spy.h",
MAME_DIR .. "src/mame/video/spy.cpp",
@@ -2415,21 +2390,13 @@ files {
MAME_DIR .. "src/mame/drivers/twinkle.cpp",
MAME_DIR .. "src/mame/drivers/ultrsprt.cpp",
MAME_DIR .. "src/mame/drivers/ultraman.cpp",
- MAME_DIR .. "src/mame/includes/ultraman.h",
- MAME_DIR .. "src/mame/video/ultraman.cpp",
MAME_DIR .. "src/mame/drivers/vendetta.cpp",
MAME_DIR .. "src/mame/includes/vendetta.h",
- MAME_DIR .. "src/mame/video/vendetta.cpp",
MAME_DIR .. "src/mame/drivers/viper.cpp",
MAME_DIR .. "src/mame/drivers/wecleman.cpp",
- MAME_DIR .. "src/mame/includes/wecleman.h",
- MAME_DIR .. "src/mame/video/wecleman.cpp",
MAME_DIR .. "src/mame/drivers/xexex.cpp",
- MAME_DIR .. "src/mame/includes/xexex.h",
- MAME_DIR .. "src/mame/video/xexex.cpp",
MAME_DIR .. "src/mame/drivers/xmen.cpp",
MAME_DIR .. "src/mame/includes/xmen.h",
- MAME_DIR .. "src/mame/video/xmen.cpp",
MAME_DIR .. "src/mame/drivers/yiear.cpp",
MAME_DIR .. "src/mame/includes/yiear.h",
MAME_DIR .. "src/mame/video/yiear.cpp",
@@ -2455,8 +2422,6 @@ files {
MAME_DIR .. "src/mame/video/k052109.h",
MAME_DIR .. "src/mame/video/k053250.cpp",
MAME_DIR .. "src/mame/video/k053250.h",
- MAME_DIR .. "src/mame/video/k053250_ps.cpp",
- MAME_DIR .. "src/mame/video/k053250_ps.h",
MAME_DIR .. "src/mame/video/k053251.cpp",
MAME_DIR .. "src/mame/video/k053251.h",
MAME_DIR .. "src/mame/video/k054156_k054157_k056832.cpp",
@@ -2481,6 +2446,10 @@ files {
MAME_DIR .. "src/mame/video/k001604.h",
MAME_DIR .. "src/mame/video/k057714.cpp",
MAME_DIR .. "src/mame/video/k057714.h",
+ MAME_DIR .. "src/mame/video/kvideodac.cpp",
+ MAME_DIR .. "src/mame/video/kvideodac.h",
+ MAME_DIR .. "src/mame/video/vlatency.cpp",
+ MAME_DIR .. "src/mame/video/vlatency.h",
}
createMAMEProjects(_target, _subtarget, "matic")
@@ -4189,8 +4158,6 @@ files {
MAME_DIR .. "src/mame/includes/suprslam.h",
MAME_DIR .. "src/mame/video/suprslam.cpp",
MAME_DIR .. "src/mame/drivers/tail2nos.cpp",
- MAME_DIR .. "src/mame/includes/tail2nos.h",
- MAME_DIR .. "src/mame/video/tail2nos.cpp",
MAME_DIR .. "src/mame/drivers/taotaido.cpp",
MAME_DIR .. "src/mame/includes/taotaido.h",
MAME_DIR .. "src/mame/video/taotaido.cpp",
diff --git a/src/devices/machine/k053252.cpp b/src/devices/machine/k053252.cpp
index f4ef1d3280d..4a81d09d3a1 100644
--- a/src/devices/machine/k053252.cpp
+++ b/src/devices/machine/k053252.cpp
@@ -8,37 +8,18 @@
============================================================================================================================
-left res = current in game, right res = computed
-
-hexion: 02 FF 00 4D 00 73 00 00 01 1F 05 0E B7 7C 00 00 512x256 ~ 512x256 <- writes to e and f regs, in an irq ack fashion
-overdriv: 01 7F 00 22 00 0D 00 03 01 07 10 0F 73 00 00 00 304x256 ~ 305x224
-esckids: 01 7F 00 12 00 0D 00 01 01 07 08 07 73 00 00 00 304x224 ~ 321x240
-rollerg: 01 7F 00 23 00 1D 02 00 01 07 10 0F 73 00 02 00 288x224 ~ 288x224 <- writes to 6 and e regs, in an irq ack fashion
-gaiapols: 01 FB 00 19 00 37 00 00 01 06 10 0E 75 00 D1 00 376x224 ~ 380x224
-mmaulers: 01 7F 00 19 00 27 00 00 01 07 10 0F 73 00 00 00 288x224 ~ 288x224
-mystwarr: 01 7F 00 12 00 2E 00 00 01 07 11 0E 73 00 00 00 288x224 ~ 288x224
-metamrph: 01 7F 00 11 00 27 01 00 01 07 10 0F 74 00 00 00 288x224 ~ 288x224
-viostorm: 01 FF 00 16 00 39 00 00 01 07 11 0E 75 00 00 00 384x224 ~ 385x224
-mtlchamp: 01 FF 00 21 00 37 00 00 01 07 11 0E 74 00 00 00 384x224 ~ 384x224
-dbz: 01 FF 00 21 00 37 00 00 01 20 0C 0E 54 00 00 00 384x256 ~ 384x256
-dbz2: 01 FF 00 21 00 37 00 00 01 20 0C 0E 54 00 00 00 384x256 ~ 384x256
-xexex: 01 FF 00 21 00 37 01 00 00 20 0C 0E 54 00 00 00 384x256 ~ 384x256 (*)
-(all konamigx, cowboys of moo mesa, run & gun, dj main)
-
-(*) hcount total 512 (0x200), hdisp 384 (0x180), vcount total 289 (0x121), vdisp 256 (0x100)
-
- Definitions from GX, look similar, all values big-endian, write-only:
-
- 0-1: bits 9-0: HC - Total horizontal count (-1) Hres ~ (HC+1) - HFP - HBP - 8*(HSW+1)
- 2-3: bits 8-0: HFP - HBlank front porch
- 4-5: bits 8-0: HBP - HBlank back porch
+ Names from GX, look similar, all values big-endian, write-only:
+
+ 0-1: bits 9-0: HC - Total horizontal count (-1) Hres ~ (HC+1) - (HFP-1) - (HBP+1) - 8*(HSW+1)
+ 2-3: bits 8-0: HFP - HBlank front porch (+1)
+ 4-5: bits 8-0: HBP - HBlank back porch (-1)
6 : bits 7-0: INT1EN
7 : bits 7-0: INT2EN
8-9: bits 8-0: VC - Total vertical count (-1) Vres ~ (VC+1) - VFP - (VBP+1) - (VSW+1)
a : bits 7-0: VFP - VBlank front porch
- b : bits 7-0: VBP - VBlank back porch (-1) (?)
- c : bits 7-4: VSW - V-Sync Width
- c : bits 3-0: HSW - H-Sync Width
+ b : bits 7-0: VBP - VBlank back porch (-1)
+ c : bits 7-4: VSW - V-Sync Width (-1)
+ c : bits 3-0: HSW - H-Sync Width (/8-1)
d : bits 7-0: INT-TIME
e : bits 7-0: INT1ACK
f : bits 7-0: INT2ACK
@@ -46,39 +27,174 @@ xexex: 01 FF 00 21 00 37 01 00 00 20 0C 0E 54 00 00 00 384x256 ~ 384x256 (*)
Read-only:
e-f: bits 8-0: VCT
-TODO:
-- xexex sets up 0x20 as the VC? default value?
-- xexex layers are offsetted if you try to use the CCU
-- according to p.14-15 both HBP and VBP have +1 added, but to get correct visible areas you have to add it only to VBP
-- understand how to interpret the back / front porch values, and remove the offset x/y hack
-- dual screen support (for Konami GX types 3/4)
-- viostorm and dbz reads the VCT port, but their usage is a side effect to send an irq ack thru the same port:
- i.e. first one uses move.b $26001d.l, $26001d.l, second one clr.b
-- le2 sets int-time but never ever enables hblank irq?
+Signal inventory:
+ NVSY, NHSY: sync signals, active on 0
+ NVBK, NHBK: blank signals, active on 0
+ FCNT: frame count? Synced with vsync start, toggles every two syncs (4-frame cycle)
+
+Beware, all line-level signals (vblank, vsync, irq) are synchronized
+with hblank start, not hsync.
***************************************************************************************************************************/
-#include "emu.h"
#include "k053252.h"
DEFINE_DEVICE_TYPE(K053252, k053252_device, "k053252", "K053252 Timing/Interrupt Controller")
+DEVICE_ADDRESS_MAP_START(map, 8, k053252_device)
+ AM_RANGE(0x00, 0x00) AM_WRITE(hch_w)
+ AM_RANGE(0x01, 0x01) AM_WRITE(hcl_w)
+ AM_RANGE(0x02, 0x02) AM_WRITE(hfph_w)
+ AM_RANGE(0x03, 0x03) AM_WRITE(hfpl_w)
+ AM_RANGE(0x04, 0x04) AM_WRITE(hbph_w)
+ AM_RANGE(0x05, 0x05) AM_WRITE(hbpl_w)
+ AM_RANGE(0x06, 0x06) AM_WRITE(irq1_en_w)
+ AM_RANGE(0x07, 0x07) AM_WRITE(irq2_en_w)
+ AM_RANGE(0x08, 0x08) AM_WRITE(vch_w)
+ AM_RANGE(0x09, 0x09) AM_WRITE(vcl_w)
+ AM_RANGE(0x0a, 0x0a) AM_WRITE(vfp_w)
+ AM_RANGE(0x0b, 0x0b) AM_WRITE(vbp_w)
+ AM_RANGE(0x0c, 0x0c) AM_WRITE(sw_w)
+ AM_RANGE(0x0d, 0x0d) AM_WRITE(tm_w)
+ AM_RANGE(0x0e, 0x0e) AM_READWRITE(vcth_r, irq1_ack_w)
+ AM_RANGE(0x0f, 0x0f) AM_READWRITE(vctl_r, irq2_ack_w)
+ADDRESS_MAP_END
+
+
+
k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, K053252, tag, owner, clock)
- , device_video_interface(mconfig, *this)
- , m_int1_en_cb(*this)
- , m_int2_en_cb(*this)
- , m_int1_ack_cb(*this)
- , m_int2_ack_cb(*this)
- //, m_int_time_cb(*this)
- , m_offsx(0)
- , m_offsy(0)
- , m_slave_screen(*this, finder_base::DUMMY_TAG) // ugly, needed to work with the rungun etc. video demux board
+ : device_t(mconfig, K053252, tag, owner, clock),
+ device_video_interface(mconfig, *this, false),
+ m_int1_cb(*this),
+ m_int2_cb(*this),
+ m_vblank_cb(*this),
+ m_vsync_cb(*this),
+ m_fcnt_cb(*this),
+ m_ksnotifier_cb(*this)
+{
+}
+
+READ8_MEMBER(k053252_device::vcth_r)
+{
+ return (m_vct & 0xfe) | ((m_vct >> 8) & 1);
+}
+
+READ8_MEMBER(k053252_device::vctl_r)
+{
+ return m_vct;
+}
+
+WRITE8_MEMBER(k053252_device::hch_w)
+{
+ m_hc = (m_hc & 0x00ff) | (data << 8);
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::hcl_w)
+{
+ m_hc = (m_hc & 0xff00) | data;
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::hfph_w)
+{
+ m_hfp = (m_hfp & 0x00ff) | (data << 8);
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::hfpl_w)
+{
+ m_hfp = (m_hfp & 0xff00) | data;
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::hbph_w)
{
+ m_hbp = (m_hbp & 0x00ff) | (data << 8);
+ update_screen();
}
+WRITE8_MEMBER(k053252_device::hbpl_w)
+{
+ m_hbp = (m_hbp & 0xff00) | data;
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::irq1_en_w)
+{
+ if(m_int1_on && !data) {
+ m_int1_on = false;
+ m_int1_cb(CLEAR_LINE);
+ }
+ m_int1_en = data;
+ logerror("irq 1 enable %02x\n", data);
+}
+
+WRITE8_MEMBER(k053252_device::irq2_en_w)
+{
+ if(m_int2_on && !data) {
+ m_int2_on = false;
+ m_int2_cb(CLEAR_LINE);
+ }
+ m_int2_en = data;
+ logerror("irq 2 enable %02x\n", data);
+}
+
+WRITE8_MEMBER(k053252_device::vch_w)
+{
+ m_vc = (m_vc & 0x00ff) | (data << 8);
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::vcl_w)
+{
+ m_vc = (m_vc & 0xff00) | data;
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::vfp_w)
+{
+ m_vfp = data;
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::vbp_w)
+{
+ m_vbp = data;
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::sw_w)
+{
+ m_sw = data;
+ update_screen();
+}
+
+WRITE8_MEMBER(k053252_device::tm_w)
+{
+ m_tm = data;
+ logerror("tm %02x\n", data);
+}
+
+WRITE8_MEMBER(k053252_device::irq1_ack_w)
+{
+ if(m_int1_on) {
+ m_int1_on = false;
+ m_int1_cb(CLEAR_LINE);
+ }
+}
+
+WRITE8_MEMBER(k053252_device::irq2_ack_w)
+{
+ if(m_int2_on) {
+ m_int2_on = false;
+ m_int2_cb(CLEAR_LINE);
+ }
+}
+
+
//-------------------------------------------------
// device_start - device-specific startup
@@ -86,21 +202,49 @@ k053252_device::k053252_device(const machine_config &mconfig, const char *tag, d
void k053252_device::device_start()
{
- m_int1_en_cb.resolve_safe();
- m_int2_en_cb.resolve_safe();
- m_int1_ack_cb.resolve_safe();
- m_int2_ack_cb.resolve_safe();
- //m_int_time_cb.resolve_safe();
+ m_int1_cb.resolve_safe();
+ m_int2_cb.resolve_safe();
+ m_vblank_cb.resolve_safe();
+ m_vsync_cb.resolve_safe();
+ m_fcnt_cb.resolve_safe();
+ m_ksnotifier_cb.resolve();
+
+ m_timer_frame = timer_alloc(TIMER_FRAME);
+ m_timer_htimer = timer_alloc(TIMER_HTIMER);
+ m_timer_source_vblank = timer_alloc(TIMER_SOURCE_VBLANK);
+
+ save_item(NAME(m_vct));
- save_item(NAME(m_regs));
save_item(NAME(m_hc));
save_item(NAME(m_hfp));
save_item(NAME(m_hbp));
save_item(NAME(m_vc));
save_item(NAME(m_vfp));
save_item(NAME(m_vbp));
- save_item(NAME(m_vsw));
- save_item(NAME(m_hsw));
+ save_item(NAME(m_sw));
+ save_item(NAME(m_tm));
+
+ save_item(NAME(m_int1_en));
+ save_item(NAME(m_int1_on));
+ save_item(NAME(m_int2_en));
+ save_item(NAME(m_int2_on));
+
+ save_item(NAME(m_line_duration));
+ save_item(NAME(m_frame));
+ save_item(NAME(m_vblank_in_to_vsync_in));
+ save_item(NAME(m_vsync_in_to_vsync_out));
+ save_item(NAME(m_vsync_out_to_vblank_out));
+ save_item(NAME(m_hblank_in_to_hsync_in));
+ save_item(NAME(m_hsync_in_to_hblank_in));
+ save_item(NAME(m_timer_frame_state));
+ save_item(NAME(m_timer_htimer_state));
+
+ m_hc = m_vc = 0;
+ m_timer_frame_state = FT_WAIT_VBLANK_IN;
+ m_timer_htimer_state = HT_WAIT_HBLANK_IN;
+
+ if(m_screen)
+ m_screen->register_vblank_callback(vblank_state_delegate(&k053252_device::screen_vblank, this));
}
//-------------------------------------------------
@@ -109,150 +253,225 @@ void k053252_device::device_start()
void k053252_device::device_reset()
{
- int i;
+ // Default to the standard 288x224 layout
+ m_hc = 0x17f;
+ m_hfp = 0x010;
+ m_hbp = 0x030;
+ m_vc = 0x107;
+ m_vfp = 0x11;
+ m_vbp = 0x0e;
+ m_sw = 0x73;
+ m_tm = 0xff;
+
+ m_vct = 0x000;
+
+ m_int1_on = false;
+ m_int1_en = true;
+ m_int2_on = false;
+ m_int2_en = true;
- for (i = 0; i < 16; i++)
- m_regs[i] = 0;
+ m_timer_frame_state = FT_WAIT_VBLANK_IN;
+ m_timer_htimer_state = HT_WAIT_HBLANK_IN;
- m_regs[0x08] = 1; // Xexex apparently does a wrong assignment for VC (sets up the INT enable register instead)
+ m_fcnt = 0;
- reset_internal_state();
+ update_screen();
}
-void k053252_device::reset_internal_state()
+void k053252_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- m_hc=0;
- m_hfp=0;
- m_hbp=0;
- m_vc=0;
- m_vfp=0;
- m_vbp=0;
- m_vsw=0;
- m_hsw=0;
+ switch(id) {
+ case TIMER_FRAME:
+ frame_transition();
+ break;
+ case TIMER_HTIMER:
+ htimer_transition();
+ break;
+ case TIMER_SOURCE_VBLANK:
+ if(m_timer_frame_state == FT_WAIT_VBLANK_IN)
+ frame_transition();
+ break;
+ }
}
-/*****************************************************************************
- DEVICE HANDLERS
-*****************************************************************************/
+void k053252_device::device_clock_changed()
+{
+ update_screen();
+}
+
+void k053252_device::screen_vblank(screen_device &src, bool state)
+{
+ if(state && m_timer_frame_state == FT_WAIT_VBLANK_IN)
+ frame_transition();
+}
-READ8_MEMBER( k053252_device::read )
+void k053252_device::update_screen()
{
- //TODO: debugger_access()
- switch(offset)
- {
- /* VCT read-back */
- // TODO: correct?
- case 0x0e:
- return ((m_screen->vpos()-m_vc) >> 8) & 1;
- case 0x0f:
- return (m_screen->vpos()-m_vc) & 0xff;
- default:
- //popmessage("Warning: k053252 read %02x, contact MAMEdev",offset);
- break;
+ // Beware, it's called before reset through device_clock_changed()
+ if(!m_hc || !m_vc)
+ return;
+
+ int hc = (m_hc & 0x3ff) + 1;
+ int hfp = (m_hfp & 0x1ff) - 1;
+ int hbp = (m_hbp & 0x1ff) + 1;
+ int hsw = ((m_sw & 0xf) + 1)*8;
+
+ int vc = (m_vc & 0x1ff) + 1;
+ int vfp = (m_vfp & 0xff);
+ int vbp = (m_vbp & 0xff) + 1;
+ int vsw = ((m_sw >> 4) & 0xf) + 1;
+
+ int width = hc - hfp - hsw - hbp;
+ int height = vc - vfp - vsw - vbp;
+
+ // We put the origin at (0, 0)
+ rectangle visarea;
+ visarea.min_x = 0;
+ visarea.min_y = 0;
+ visarea.max_x = width - 1;
+ visarea.max_y = height - 1;
+
+ // Line 0 is just after end of vblank
+ // Column 0 is just after end of hblank
+ // Everything line-based is synchronized with start of hblank
+
+ // Screen vblank happens at coordinates (width, height-1) and ends at (width, vc-1)
+ // Vsync happens at (width, height+vfp) and ends at (width, vc-vbp)
+ // Hsync happens at (width + hfp, line) and ends at (hc - vfp, line)
+ // Hblank happens at (width, line) and ends at (hc - 1, line)
+ m_line_duration = attotime::from_ticks(hc, clock());
+ m_frame = m_line_duration * vc;
+ m_vblank_in_to_vsync_in = m_line_duration * vfp;
+ m_vsync_in_to_vsync_out = m_line_duration * vsw;
+ m_vsync_out_to_vblank_out = m_line_duration * vbp;
+ m_hblank_in_to_hsync_in = attotime::from_ticks(hfp, clock());
+ m_hsync_in_to_hblank_in = attotime::from_ticks(hc - hfp, clock());
+
+ switch(m_timer_frame_state) {
+ case FT_WAIT_VBLANK_IN: break;
+ case FT_WAIT_VSYNC_IN: m_vblank_cb(CLEAR_LINE); break;
+ case FT_WAIT_VSYNC_OUT: m_vblank_cb(CLEAR_LINE); m_vsync_cb(ASSERT_LINE); break;
+ case FT_WAIT_VBLANK_OUT: m_vblank_cb(CLEAR_LINE); break;
}
- return m_regs[offset];
+ m_timer_frame->adjust(attotime::never);
+ m_timer_frame_state = FT_WAIT_VBLANK_IN;
+ m_timer_htimer->adjust(attotime::never);
+ m_timer_htimer_state = HT_WAIT_HBLANK_IN;
+
+ if(0) {
+ visarea.min_x = 0;
+ visarea.min_y = 0;
+ visarea.max_x = hc-1;
+ visarea.max_y = vc-1;
+ }
+
+ logerror("screen: %dMHz %d (%d - %d - %d - %d) %d (%d - %d - %d - %d) vbl %gHz\n",
+ clock()/1000000,
+ hc, width, hfp, hsw, hbp,
+ vc, height, vfp, vsw, vbp,
+ 1/m_frame.as_double());
+
+ logerror("MCFG_SCREEN_RAW_PARAMS(%d, %d, %d, %d, %d, %d, %d)\n",
+ clock(),
+ hc, 0, width,
+ vc, 0, height);
+
+ // If there's a screen, use it. Otherwise, setup a timer for a
+ // vblank similar to what the screen would have done.
+ if(m_screen)
+ m_screen->configure(hc, vc, visarea, m_frame.as_attoseconds());
+ else
+ // Run the timer in half a frame then every frame
+ m_timer_source_vblank->adjust(m_frame/2, 0, m_frame);
+
+ m_ksnotifier_cb(clock(), width, hfp, hsw, hbp, height, vfp, vsw, vbp);
}
-void k053252_device::res_change()
+void k053252_device::device_post_load()
{
- if(m_hc && m_vc &&
- m_hbp && m_hfp &&
- m_vbp && m_vfp &&
- m_hsw && m_vsw) //safety checks
- {
- rectangle visarea;
- //(HC+1) - HFP - HBP - 8*(HSW+1)
- //VC - VFP - VBP - (VSW+1)
- attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock()) * (m_hc) * m_vc;
-
- visarea.min_x = m_offsx;
- visarea.min_y = m_offsy;
- visarea.max_x = m_offsx + m_hc - m_hfp - m_hbp - 8*(m_hsw) - 1;
- visarea.max_y = m_offsy + m_vc - m_vfp - m_vbp - (m_vsw) - 1;
-
- m_screen->configure(m_hc, m_vc, visarea, refresh);
-
- if (m_slave_screen.found())
- m_slave_screen->configure(m_hc, m_vc, visarea, refresh);
-
-#if 0
- attoseconds_t hsync = HZ_TO_ATTOSECONDS(clock()) * (m_hc);
- printf("H %d HFP %d HSW %d HBP %d\n",m_hc,m_hfp,m_hsw*8,m_hbp);
- printf("V %d VFP %d VSW %d VBP %d\n",m_vc,m_vfp,m_vsw,m_vbp);
- // L stands for Legacy ...
- printf("L %d %d\n",m_offsx,m_offsy);
- printf("Screen params: Clock: %u V-Sync %.2f H-Sync %.f\n",clock(),ATTOSECONDS_TO_HZ(refresh),ATTOSECONDS_TO_HZ(hsync));
- printf("visible screen area: %d x %d\n\n",(visarea.max_x - visarea.min_x) + 1,(visarea.max_y - visarea.min_y) + 1);
-#endif
- }
+ int hc = (m_hc & 0x3ff) + 1;
+ int hfp = (m_hfp & 0x1ff);
+ int hbp = (m_hbp & 0x1ff);
+ int hsw = ((m_sw & 0xf) + 1)*8;
+
+ int vc = (m_vc & 0x1ff) + 1;
+ int vfp = (m_vfp & 0xff);
+ int vbp = (m_vbp & 0xff) + 1;
+ int vsw = ((m_sw >> 4) & 0xf) + 1;
+
+ int width = hc - hfp - hsw - hbp;
+ int height = vc - vfp - vsw - vbp;
+
+ m_ksnotifier_cb(clock(), width, hfp, hsw, hbp, height, vfp, vsw, vbp);
}
-WRITE8_MEMBER( k053252_device::write )
+void k053252_device::frame_transition()
{
- m_regs[offset] = data;
-
- switch(offset)
- {
- case 0x00:
- case 0x01:
- m_hc = (m_regs[1]&0xff);
- m_hc |= ((m_regs[0]&0x03)<<8);
- m_hc++;
- logerror("%d (%04x) HC set\n",m_hc,m_hc);
- res_change();
- break;
- case 0x02:
- case 0x03:
- m_hfp = (m_regs[3]&0xff);
- m_hfp |= ((m_regs[2]&0x01)<<8);
- logerror("%d (%04x) HFP set\n",m_hfp,m_hfp);
- res_change();
- break;
- case 0x04:
- case 0x05:
- m_hbp = (m_regs[5]&0xff);
- m_hbp |= ((m_regs[4]&0x01)<<8);
- logerror("%d (%04x) HBP set\n",m_hbp,m_hbp);
- res_change();
- break;
- case 0x06: m_int1_en_cb(data); break;
- case 0x07: m_int2_en_cb(data); break;
- case 0x08:
- case 0x09:
- m_vc = (m_regs[9]&0xff);
- m_vc |= ((m_regs[8]&0x01)<<8);
- m_vc++;
- logerror("%d (%04x) VC set\n",m_vc,m_vc);
- res_change();
- break;
- case 0x0a:
- m_vfp = (m_regs[0x0a]&0xff);
- logerror("%d (%04x) VFP set\n",m_vfp,m_vfp);
- res_change();
- break;
- case 0x0b:
- m_vbp = (m_regs[0x0b]&0xff);
- m_vbp++;
- logerror("%d (%04x) VBP set\n",m_vbp,m_vbp);
- res_change();
- break;
- case 0x0c:
- m_vsw = ((m_regs[0x0c]&0xf0) >> 4) + 1;
- m_hsw = ((m_regs[0x0c]&0x0f) >> 0) + 1;
- logerror("%02x VSW / %02x HSW set\n",m_vsw,m_hsw);
- res_change();
- break;
-
- //case 0x0d: m_int_time(data); break;
- case 0x0e: m_int1_ack_cb(1); break;
- case 0x0f: m_int2_ack_cb(1); break;
+ switch(m_timer_frame_state) {
+ case FT_WAIT_VBLANK_IN:
+ m_timer_frame->adjust(m_vblank_in_to_vsync_in);
+ m_timer_frame_state = FT_WAIT_VSYNC_IN;
+ if(m_int1_en && !m_int1_on) {
+ m_int1_on = true;
+ m_int1_cb(ASSERT_LINE);
+ }
+ m_vblank_cb(ASSERT_LINE);
+ break;
+ case FT_WAIT_VSYNC_IN:
+ m_timer_frame->adjust(m_vsync_in_to_vsync_out);
+ m_timer_frame_state = FT_WAIT_VSYNC_OUT;
+ m_timer_htimer->adjust(m_line_duration);
+ m_timer_htimer_state = HT_WAIT_HBLANK_IN;
+ m_vct = (m_vc & 0x3ff) ^ 0x3ff;
+ m_vsync_cb(ASSERT_LINE);
+ m_fcnt++;
+ if((m_fcnt & 3) == 0)
+ m_fcnt_cb(ASSERT_LINE);
+ else if((m_fcnt & 3) == 2)
+ m_fcnt_cb(CLEAR_LINE);
+ break;
+ case FT_WAIT_VSYNC_OUT:
+ m_timer_frame->adjust(m_vsync_out_to_vblank_out);
+ m_timer_frame_state = FT_WAIT_VBLANK_OUT;
+ m_vsync_cb(CLEAR_LINE);
+ break;
+ case FT_WAIT_VBLANK_OUT:
+ m_timer_frame->adjust(attotime::never);
+ m_timer_frame_state = FT_WAIT_VBLANK_IN;
+ m_vblank_cb(CLEAR_LINE);
+ // dragoona locks up if there's an int1 pending when it's turned on
+ // (the irq handler waits for the objdma ending but the objdma is enabled just after turning the int1 enable on)
+ if(m_int1_on) {
+ m_int1_on = false;
+ m_int1_cb(CLEAR_LINE);
+ }
+ break;
}
}
-
-void k053252_device::static_set_slave_screen(device_t &device, const char *tag)
+void k053252_device::htimer_transition()
{
- k053252_device &dev = downcast<k053252_device &>(device);
- dev.m_slave_screen.set_tag(tag);
+ switch(m_timer_htimer_state) {
+ case HT_WAIT_HBLANK_IN:
+ if(m_int2_en && (m_vct ^ 0x3ff) - (m_vc & 0x1ff) == m_tm) {
+ if(!m_int2_on) {
+ m_int2_on = true;
+ m_int2_cb(ASSERT_LINE);
+ }
+ m_timer_htimer->adjust(m_hblank_in_to_hsync_in);
+ m_timer_htimer_state = HT_WAIT_HSYNC_IN;
+ } else
+ m_timer_htimer->adjust(m_line_duration);
+ m_vct++;
+ break;
+ case HT_WAIT_HSYNC_IN:
+ m_timer_htimer->adjust(m_hsync_in_to_hblank_in);
+ m_timer_htimer_state = HT_WAIT_HBLANK_IN;
+ if(m_int2_on) {
+ m_int2_on = false;
+ m_int2_cb(CLEAR_LINE);
+ }
+ break;
+ }
}
diff --git a/src/devices/machine/k053252.h b/src/devices/machine/k053252.h
index de2426114f6..7e1fb3c17e3 100644
--- a/src/devices/machine/k053252.h
+++ b/src/devices/machine/k053252.h
@@ -7,73 +7,114 @@
#pragma once
-
+#include "ksnotifier.h"
#include "screen.h"
-#define MCFG_K053252_INT1_EN_CB(_devcb) \
- devcb = &k053252_device::set_int1_en_callback(*device, DEVCB_##_devcb);
-
-#define MCFG_K053252_INT2_EN_CB(_devcb) \
- devcb = &k053252_device::set_int2_en_callback(*device, DEVCB_##_devcb);
+#define MCFG_K053252_INT1_CB(_devcb) \
+ devcb = &k053252_device::set_int1_cb(*device, DEVCB_##_devcb);
-#define MCFG_K053252_INT1_ACK_CB(_devcb) \
- devcb = &k053252_device::set_int1_ack_callback(*device, DEVCB_##_devcb);
+#define MCFG_K053252_INT2_CB(_devcb) \
+ devcb = &k053252_device::set_int2_cb(*device, DEVCB_##_devcb);
-#define MCFG_K053252_INT2_ACK_CB(_devcb) \
- devcb = &k053252_device::set_int2_ack_callback(*device, DEVCB_##_devcb);
+#define MCFG_K053252_VSYNC_CB(_devcb) \
+ devcb = &k053252_device::set_vsync_cb(*device, DEVCB_##_devcb);
-/*#define MCFG_K053252_INT_TIME_CB(_devcb) \
- devcb = &k053252_device::set_int_time_callback(*device, DEVCB_##_devcb); */
+#define MCFG_K053252_VBLANK_CB(_devcb) \
+ devcb = &k053252_device::set_vblank_cb(*device, DEVCB_##_devcb);
-#define MCFG_K053252_OFFSETS(_offsx, _offsy) \
- k053252_device::set_offsets(*device, _offsx, _offsy);
+#define MCFG_K053252_FCNT_CB(_devcb) \
+ devcb = &k053252_device::set_fcnt_cb(*device, DEVCB_##_devcb);
-#define MCFG_K053252_SET_SLAVE_SCREEN(_tag) \
- k053252_device::static_set_slave_screen(*device, "^" _tag);
+#define MCFG_K053252_KSNOTIFIER_CB(_cb) \
+ ksnotifier = &k053252_device::set_ksnotifier_cb(*device, _cb);
-
-class k053252_device : public device_t, public device_video_interface
+class k053252_device : public device_t,
+ public device_video_interface
{
public:
- k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- template <class Object> static devcb_base &set_int1_en_callback(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_int1_en_cb.set_callback(std::forward<Object>(obj)); }
- template <class Object> static devcb_base &set_int2_en_callback(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_int2_en_cb.set_callback(std::forward<Object>(obj)); }
- template <class Object> static devcb_base &set_int1_ack_callback(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_int1_ack_cb.set_callback(std::forward<Object>(obj)); }
- template <class Object> static devcb_base &set_int2_ack_callback(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_int2_ack_cb.set_callback(std::forward<Object>(obj)); }
- //template <class Object> static devcb_base &set_int_time_callback(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_int_time_cb.set_callback(std::forward<Object>(obj)); }
- static void set_offsets(device_t &device, int offsx, int offsy) { downcast<k053252_device &>(device).m_offsx = offsx; downcast<k053252_device &>(device).m_offsy = offsy; }
-
- DECLARE_READ8_MEMBER( read ); // CCU registers
- DECLARE_WRITE8_MEMBER( write );
-
- void res_change();
-
- static void static_set_slave_screen(device_t &device, const char *tag);
+ k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ template <class Object> static devcb_base &set_int1_cb(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_int1_cb.set_callback(std::forward<Object>(obj)); }
+ template <class Object> static devcb_base &set_int2_cb(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_int2_cb.set_callback(std::forward<Object>(obj)); }
+ template <class Object> static devcb_base &set_vsync_cb(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_vsync_cb.set_callback(std::forward<Object>(obj)); }
+ template <class Object> static devcb_base &set_vblank_cb(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_vblank_cb.set_callback(std::forward<Object>(obj)); }
+ template <class Object> static devcb_base &set_fcnt_cb(device_t &device, Object &&obj) { return downcast<k053252_device &>(device).m_fcnt_cb.set_callback(std::forward<Object>(obj)); }
+ template <class Object> static ksnotifier_t &set_ksnotifier_cb(device_t &device, Object &&object) { return downcast<k053252_device &>(device).m_ksnotifier_cb.set_callback(std::forward<Object>(object)); }
+
+ DECLARE_ADDRESS_MAP(map, 8);
+
+ DECLARE_WRITE8_MEMBER(hch_w);
+ DECLARE_WRITE8_MEMBER(hcl_w);
+ DECLARE_WRITE8_MEMBER(hfph_w);
+ DECLARE_WRITE8_MEMBER(hfpl_w);
+ DECLARE_WRITE8_MEMBER(hbph_w);
+ DECLARE_WRITE8_MEMBER(hbpl_w);
+ DECLARE_WRITE8_MEMBER(irq1_en_w);
+ DECLARE_WRITE8_MEMBER(irq2_en_w);
+ DECLARE_WRITE8_MEMBER(vch_w);
+ DECLARE_WRITE8_MEMBER(vcl_w);
+ DECLARE_WRITE8_MEMBER(vfp_w);
+ DECLARE_WRITE8_MEMBER(vbp_w);
+ DECLARE_WRITE8_MEMBER(sw_w);
+ DECLARE_WRITE8_MEMBER(tm_w);
+ DECLARE_WRITE8_MEMBER(irq1_ack_w);
+ DECLARE_WRITE8_MEMBER(irq2_ack_w);
+
+ DECLARE_READ8_MEMBER(vcth_r);
+ DECLARE_READ8_MEMBER(vctl_r);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
- virtual void device_clock_changed() override { reset_internal_state(); }
- void reset_internal_state();
-
- private:
- // internal state
- uint8_t m_regs[16];
- uint16_t m_hc,m_hfp,m_hbp;
- uint16_t m_vc,m_vfp,m_vbp;
- uint8_t m_vsw,m_hsw;
-
- devcb_write_line m_int1_en_cb;
- devcb_write_line m_int2_en_cb;
- devcb_write_line m_int1_ack_cb;
- devcb_write_line m_int2_ack_cb;
-// devcb_write8 m_int_time_cb;
- int m_offsx;
- int m_offsy;
-
- optional_device<screen_device> m_slave_screen;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+ virtual void device_clock_changed() override;
+ virtual void device_post_load() override;
+
+private:
+ enum {
+ TIMER_FRAME,
+ TIMER_HTIMER,
+ TIMER_SOURCE_VBLANK
+ };
+
+ enum {
+ FT_WAIT_VBLANK_IN,
+ FT_WAIT_VSYNC_IN,
+ FT_WAIT_VSYNC_OUT,
+ FT_WAIT_VBLANK_OUT
+ };
+
+ enum {
+ HT_WAIT_HBLANK_IN,
+ HT_WAIT_HSYNC_IN
+ };
+
+ devcb_write_line m_int1_cb;
+ devcb_write_line m_int2_cb;
+ devcb_write_line m_vblank_cb;
+ devcb_write_line m_vsync_cb;
+ devcb_write_line m_fcnt_cb;
+ ksnotifier_t m_ksnotifier_cb;
+
+ u16 m_vct;
+ u16 m_hc, m_hfp, m_hbp, m_vc;
+ u8 m_vfp, m_vbp, m_sw, m_tm;
+
+ bool m_int1_on, m_int1_en, m_int2_on, m_int2_en;
+
+ attotime m_line_duration, m_frame, m_vblank_in_to_vsync_in, m_vsync_in_to_vsync_out;
+ attotime m_vsync_out_to_vblank_out, m_hblank_in_to_hsync_in, m_hsync_in_to_hblank_in;
+ int m_timer_frame_state;
+ int m_timer_htimer_state;
+ u32 m_fcnt;
+
+ emu_timer *m_timer_frame, *m_timer_htimer, *m_timer_source_vblank;
+
+ void frame_transition();
+ void htimer_transition();
+ void screen_vblank(screen_device &scr, bool state);
+ void update_screen();
};
DECLARE_DEVICE_TYPE(K053252, k053252_device)
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp
index 0616947af03..b995273cd41 100644
--- a/src/emu/addrmap.cpp
+++ b/src/emu/addrmap.cpp
@@ -489,7 +489,7 @@ void address_map::uplift_submaps(running_machine &machine, device_t &owner, endi
entry_bits = m_databits;
if (submap.m_databits != entry_bits)
- throw emu_fatalerror("AM_DEVICE wants a %d bits large address map and got a %d bits large one instead.\n", entry_bits, submap.m_databits);
+ throw emu_fatalerror("AM_DEVICE wants a %d bits large address map and got a %d bits large one instead (mapping device '%s' into device '%s').\n", entry_bits, submap.m_databits, tag.c_str(), m_device->basetag());
int entry_bytes = entry_bits / 8;
int databytes = m_databits / 8;
diff --git a/src/emu/difr.cpp b/src/emu/difr.cpp
new file mode 100644
index 00000000000..565f10c92de
--- /dev/null
+++ b/src/emu/difr.cpp
@@ -0,0 +1,356 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+/***************************************************************************
+
+ Device flow rendering interfaces.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "difr.h"
+
+flow_render::input::input(std::string name, renderer *rend) : m_name(name), m_renderer(rend)
+{
+}
+
+flow_render::input::~input()
+{
+}
+
+flow_render::input_sb_u16::input_sb_u16(std::string name, renderer *rend) : input(name, rend)
+{
+}
+
+std::string flow_render::input_sb_u16::description()
+{
+ return "screen-sized u16 bitmap";
+}
+
+flow_render::input_sb_rgb::input_sb_rgb(std::string name, renderer *rend) : input(name, rend)
+{
+}
+
+std::string flow_render::input_sb_rgb::description()
+{
+ return "screen-sized RGB bitmap";
+}
+
+flow_render::output::output(std::string name, renderer *rend) : m_name(name), m_renderer(rend)
+{
+}
+
+flow_render::output::~output()
+{
+}
+
+flow_render::output_sb_u16::output_sb_u16(std::string name, renderer *rend) : output(name, rend)
+{
+}
+
+std::string flow_render::output_sb_u16::description()
+{
+ return "screen-sized u16 bitmap";
+}
+
+bool flow_render::output_sb_u16::is_compatible(const input *inp) const
+{
+ return dynamic_cast<const input_sb_u16 *>(inp);
+}
+
+flow_render::output_sb_rgb::output_sb_rgb(std::string name, renderer *rend) : output(name, rend)
+{
+}
+
+bool flow_render::output_sb_rgb::is_compatible(const input *inp) const
+{
+ return dynamic_cast<const input_sb_rgb *>(inp);
+}
+
+std::string flow_render::output_sb_rgb::description()
+{
+ return "screen-sized RGB bitmap";
+}
+
+flow_render::renderer::renderer(std::function<void (const rectangle &)> render_cb, std::string name, interface *intf) : m_render_cb(render_cb), m_name(name), m_intf(intf), m_target(false)
+{
+}
+
+void flow_render::renderer::set_target()
+{
+ m_target = true;
+}
+
+template<typename IO, typename IOL> IOL *flow_render::renderer::check_and_add(std::unordered_map<std::string, std::unique_ptr<IO>> &map,
+ std::unique_ptr<IOL> &&io, const char *type)
+{
+ IOL *res = io.get();
+ std::string name = io->get_name();
+ if(map.find(name) != map.end())
+ fatalerror("Duplicate %s %s in renderer %s of device %s\n", type, name.c_str(), get_name().c_str(), m_intf->device().tag());
+
+ map.emplace(name, std::move(io));
+ return res;
+}
+
+flow_render::input_sb_u16 *flow_render::renderer::create_input_sb_u16(std::string name)
+{
+ return check_and_add(m_inputs, std::make_unique<input_sb_u16>(name, this), "input");
+}
+
+flow_render::input_sb_rgb *flow_render::renderer::create_input_sb_rgb(std::string name)
+{
+ return check_and_add(m_inputs, std::make_unique<input_sb_rgb>(name, this), "input");
+}
+
+flow_render::output_sb_u16 *flow_render::renderer::create_output_sb_u16(std::string name)
+{
+ return check_and_add(m_outputs, std::make_unique<output_sb_u16>(name, this), "output");
+}
+
+flow_render::output_sb_rgb *flow_render::renderer::create_output_sb_rgb(std::string name)
+{
+ return check_and_add(m_outputs, std::make_unique<output_sb_rgb>(name, this), "output");
+}
+
+flow_render::input *flow_render::renderer::inp(std::string name) const
+{
+ auto i = m_inputs.find(name);
+ if(i == m_inputs.end())
+ fatalerror("Requesting non-existing input %s in renderer %s of device %s\n", name.c_str(), get_name().c_str(), m_intf->device().tag());
+ return i->second.get();
+}
+
+flow_render::output *flow_render::renderer::out(std::string name) const
+{
+ auto i = m_outputs.find(name);
+ if(i == m_outputs.end())
+ fatalerror("Requesting non-existing output %s in renderer %s of device %s\n", name.c_str(), get_name().c_str(), m_intf->device().tag());
+ return i->second.get();
+}
+
+std::vector<flow_render::input *> flow_render::renderer::all_inputs() const
+{
+ std::vector<input *> res;
+ for(const auto &i : m_inputs)
+ res.push_back(i.second.get());
+ return res;
+}
+
+std::vector<flow_render::output *> flow_render::renderer::all_outputs() const
+{
+ std::vector<output *> res;
+ for(const auto &i : m_outputs)
+ res.push_back(i.second.get());
+ return res;
+}
+
+flow_render::interface::interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "flow_render")
+{
+}
+
+flow_render::interface::~interface()
+{
+}
+
+flow_render::renderer *flow_render::interface::flow_render_create_renderer(std::function<void (const rectangle &)> render_cb, std::string name)
+{
+ if(m_renderers.find(name) != m_renderers.end())
+ fatalerror("Duplicate renderer %s in device %s\n", name.c_str(), device().tag());
+
+ return m_renderers.emplace(name, std::make_unique<renderer>(render_cb, name, this)).first->second.get();
+}
+
+const flow_render::renderer *flow_render::interface::flow_render_get_renderer(std::string name) const
+{
+ auto i = m_renderers.find(name);
+ if(i == m_renderers.end())
+ fatalerror("Requesting non-existing renderer %s of device %s\n", name.c_str(), device().tag());
+ return i->second.get();
+}
+
+void flow_render::interface::flow_render_append_renderers(std::vector<renderer *> &renderers) const
+{
+ for(const auto &r : m_renderers)
+ renderers.push_back(r.second.get());
+}
+
+void flow_render::interface::flow_render_do_render(int width, int height, const rectangle &cliprect)
+{
+ m_manager->do_render(width, height, cliprect);
+}
+
+flow_render::manager::manager(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, FLOW_RENDER_MANAGER, tag, owner, clock)
+{
+}
+
+void flow_render::manager::device_config_complete()
+{
+ for(auto &fri : device_interface_iterator<flow_render::interface>(mconfig().root_device()))
+ m_fri.push_back(&fri);
+
+ for(auto fri : m_fri) {
+ fri->flow_render_set_manager(this);
+ fri->flow_render_register_renderers();
+ fri->flow_render_append_renderers(m_rend);
+ }
+}
+
+void flow_render::manager::device_start()
+{
+ m_setup_cb.bind_relative_to(*owner());
+ m_setup_cb(this);
+
+ std::unordered_set<renderer *> needed_renderers;
+ std::unordered_set<input *> needed_inputs;
+ std::unordered_set<output *> known_outputs;
+
+ for(auto frd : m_rend)
+ if(frd->is_target()) {
+ needed_renderers.insert(frd);
+ for(auto inp : frd->all_inputs())
+ needed_inputs.insert(inp);
+ }
+
+ while(!needed_inputs.empty()) {
+ std::unordered_set<output *> needed_outputs;
+ for(auto inp : needed_inputs) {
+ if(m_input_constants_u32.find(inp) != m_input_constants_u32.end())
+ continue;
+ auto i = m_input_to_output.find(inp);
+ if(i == m_input_to_output.end())
+ fatalerror("Nothing connected to required input %s of renderer %s in device %s\n", inp->get_name().c_str(), inp->get_renderer()->get_name().c_str(), inp->get_renderer()->get_interface()->device().tag());
+ output *out = i->second;
+ if(known_outputs.find(out) == known_outputs.end())
+ needed_outputs.insert(out);
+ }
+ needed_inputs.clear();
+ for(auto out : needed_outputs) {
+ renderer *rend = out->get_renderer();
+ needed_renderers.insert(rend);
+ for(auto inp : rend->all_inputs())
+ needed_inputs.insert(inp);
+ for(auto out2 : rend->all_outputs())
+ known_outputs.insert(out2);
+ }
+ }
+
+ std::unordered_set<output *> generated_outputs;
+ while(!needed_renderers.empty()) {
+ bool changed = false;
+ for(auto i = needed_renderers.begin(); i != needed_renderers.end();) {
+ bool complete = true;
+ renderer *rend = *i;
+ for(auto inp : rend->all_inputs()) {
+ if(m_input_constants_u32.find(inp) != m_input_constants_u32.end())
+ continue;
+ output *out = m_input_to_output[inp];
+ if(generated_outputs.find(out) == generated_outputs.end()) {
+ complete = false;
+ break;
+ }
+ }
+ if(complete) {
+ m_ordered_renderers.push_back(rend);
+ i = needed_renderers.erase(i);
+ changed = true;
+ for(auto out : rend->all_outputs())
+ generated_outputs.insert(out);
+ } else
+ i++;
+ }
+ if(!changed)
+ fatalerror("Couldn't topologically sort the renderers\n");
+ }
+ fprintf(stderr, "Rendering order:\n");
+ for(auto rend : m_ordered_renderers)
+ fprintf(stderr, "- %s in device %s\n", rend->get_name().c_str(), rend->get_interface()->device().tag());
+
+ std::unordered_map<output *, unsigned int> ibitmap;
+ for(auto rend : m_ordered_renderers) {
+ for(auto out : rend->all_outputs()) {
+ std::unique_ptr<bitmap_t> bitmap_storage;
+ if(dynamic_cast<output_sb_u16 *>(out)) {
+ auto b = std::make_unique<bitmap_ind16>();
+ dynamic_cast<output_sb_u16 *>(out)->set_bitmap(b.get());
+ bitmap_storage = std::move(b);
+ } else {
+ auto b = std::make_unique<bitmap_rgb32>();
+ dynamic_cast<output_sb_rgb *>(out)->set_bitmap(b.get());
+ bitmap_storage = std::move(b);
+ }
+ unsigned int id = m_intermediate_bitmaps.size();
+ m_intermediate_bitmaps.emplace_back(std::make_unique<intermediate_bitmap>(std::move(bitmap_storage)));
+ ibitmap[out] = id;
+ m_intermediate_bitmaps[id]->out = out;
+ }
+ }
+
+ for(auto rend : m_ordered_renderers) {
+ for(auto inp : rend->all_inputs()) {
+ auto i = m_input_to_output.find(inp);
+ if(i != m_input_to_output.end()) {
+ auto bitmap = m_intermediate_bitmaps[ibitmap[i->second]]->bitmap.get();
+ if(dynamic_cast<input_sb_u16 *>(inp))
+ dynamic_cast<input_sb_u16 *>(inp)->set_bitmap(dynamic_cast<bitmap_ind16 *>(bitmap));
+ else
+ dynamic_cast<input_sb_rgb *>(inp)->set_bitmap(dynamic_cast<bitmap_rgb32 *>(bitmap));
+ m_intermediate_bitmaps[ibitmap[i->second]]->inp.push_back(inp);
+
+ } else {
+ std::unique_ptr<bitmap_t> bitmap_storage;
+ if(dynamic_cast<input_sb_u16 *>(inp)) {
+ auto b = std::make_unique<bitmap_ind16>();
+ dynamic_cast<input_sb_u16 *>(inp)->set_bitmap(b.get());
+ bitmap_storage = std::move(b);
+ } else {
+ auto b = std::make_unique<bitmap_rgb32>();
+ dynamic_cast<input_sb_rgb *>(inp)->set_bitmap(b.get());
+ bitmap_storage = std::move(b);
+ }
+ m_intermediate_bitmaps.emplace_back(std::make_unique<intermediate_bitmap>(std::move(bitmap_storage)));
+ m_intermediate_bitmaps.back()->inp.push_back(inp);
+ m_intermediate_bitmaps.back()->fixed_value = true;
+ m_intermediate_bitmaps.back()->value = m_input_constants_u32[inp];
+ }
+ }
+ }
+}
+
+void flow_render::manager::do_render(int width, int height, const rectangle &cliprect)
+{
+ if(m_intermediate_bitmaps.empty())
+ return;
+
+ if(m_intermediate_bitmaps[0]->bitmap->width() != width || m_intermediate_bitmaps[0]->bitmap->height() != height) {
+ for(const auto &p : m_intermediate_bitmaps) {
+ p->bitmap->resize(width, height);
+ p->bitmap->fill(p->value);
+ }
+ }
+
+ for(auto rend : m_ordered_renderers)
+ rend->run_render(cliprect);
+}
+
+void flow_render::manager::connect(flow_render::output *out, flow_render::input *inp)
+{
+ auto i = m_input_to_output.find(inp);
+ if(i != m_input_to_output.end())
+ fatalerror("Duplicate connection to input %s of renderer %s in device %s\n", inp->get_name().c_str(), inp->get_renderer()->get_name().c_str(), inp->get_renderer()->get_interface()->device().tag());
+
+ if(!out->is_compatible(inp))
+ fatalerror("Can't connect output %s of renderer %s in device %s (%s) to input %s of renderer %s in device %s (%s)\n",
+ out->get_name().c_str(), out->get_renderer()->get_name().c_str(), out->get_renderer()->get_interface()->device().tag(), out->description().c_str(),
+ inp->get_name().c_str(), inp->get_renderer()->get_name().c_str(), inp->get_renderer()->get_interface()->device().tag(), inp->description().c_str());
+
+ m_input_to_output[inp] = out;
+}
+
+void flow_render::manager::set_constant(flow_render::input *inp, u32 value)
+{
+ m_input_constants_u32[inp] = value;
+}
+
+DEFINE_DEVICE_TYPE_NS(FLOW_RENDER_MANAGER, flow_render, manager, "fr_manager", "Video Flow Rendering Manager")
diff --git a/src/emu/difr.h b/src/emu/difr.h
new file mode 100644
index 00000000000..bfbc28c060b
--- /dev/null
+++ b/src/emu/difr.h
@@ -0,0 +1,212 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+/***************************************************************************
+
+ Device flow rendering interfaces.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef MAME_EMU_DIFR_H
+#define MAME_EMU_DIFR_H
+
+#define MCFG_FLOW_RENDER_MANAGER_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, FLOW_RENDER_MANAGER, 0)
+
+#define MCFG_FLOW_RENDER_MANAGER_SETUP(_tag, _class, _method) \
+ downcast<flow_render::manager *>(device)->set_setup(flow_render::setup_delegate(&_class::_method, #_class "::" #_method, _tag, (_class *)nullptr));
+
+namespace flow_render {
+ class renderer;
+ class interface;
+ class manager;
+
+ using setup_delegate = device_delegate<void (manager *)>;
+
+ class input {
+ public:
+ input(std::string name, renderer *rend);
+ virtual ~input();
+
+ std::string get_name() const { return m_name; }
+ renderer *get_renderer() const { return m_renderer; }
+
+ virtual std::string description() = 0;
+
+ private:
+ std::string m_name;
+ renderer *m_renderer;
+ };
+
+ class input_sb_u16 : public input {
+ public:
+ input_sb_u16(std::string name, renderer *rend);
+ virtual std::string description() override;
+
+ bitmap_ind16 &bitmap() const { return *m_bitmap; }
+ void set_bitmap(bitmap_ind16 *bitmap) { m_bitmap = bitmap; }
+
+ private:
+ bitmap_ind16 *m_bitmap;
+ };
+
+ class input_sb_rgb : public input {
+ public:
+ input_sb_rgb(std::string name, renderer *rend);
+ virtual std::string description() override;
+
+ bitmap_rgb32 &bitmap() const { return *m_bitmap; }
+ void set_bitmap(bitmap_rgb32 *bitmap) { m_bitmap = bitmap; }
+
+ private:
+ bitmap_rgb32 *m_bitmap;
+ };
+
+ class output {
+ public:
+ output(std::string name, renderer *rend);
+ virtual ~output();
+
+ std::string get_name() const { return m_name; }
+ renderer *get_renderer() const { return m_renderer; }
+
+ virtual std::string description() = 0;
+ virtual bool is_compatible(const input *inp) const = 0;
+
+ private:
+ std::string m_name;
+ renderer *m_renderer;
+ };
+
+ class output_sb_u16 : public output {
+ public:
+ output_sb_u16(std::string name, renderer *rend);
+ virtual std::string description() override;
+ bool is_compatible(const input *inp) const override;
+
+ bitmap_ind16 &bitmap() const { return *m_bitmap; }
+ void set_bitmap(bitmap_ind16 *bitmap) { m_bitmap = bitmap; }
+
+ private:
+ bitmap_ind16 *m_bitmap;
+ };
+
+ class output_sb_rgb : public output {
+ public:
+ output_sb_rgb(std::string name, renderer *rend);
+ virtual std::string description() override;
+ bool is_compatible(const input *inp) const override;
+
+ bitmap_rgb32 &bitmap() const { return *m_bitmap; }
+ void set_bitmap(bitmap_rgb32 *bitmap) { m_bitmap = bitmap; }
+
+ private:
+ bitmap_rgb32 *m_bitmap;
+ };
+
+ class uniform {
+ public:
+ uniform();
+ };
+
+ class renderer {
+ public:
+ renderer(std::function<void (const rectangle &)> render_cb, std::string name, interface *intf);
+
+ input_sb_u16 *create_input_sb_u16(std::string name = "default");
+ output_sb_u16 *create_output_sb_u16(std::string name = "default");
+ input_sb_rgb *create_input_sb_rgb(std::string name = "default");
+ output_sb_rgb *create_output_sb_rgb(std::string name = "default");
+
+ input *inp(std::string name = "default") const;
+ output *out(std::string name = "default") const;
+
+ std::vector<input *> all_inputs() const;
+ std::vector<output *> all_outputs() const;
+
+ std::string get_name() const { return m_name; }
+ interface *get_interface() const { return m_intf; }
+
+ void set_target();
+ bool is_target() { return m_target; }
+
+ void run_render(const rectangle &cliprect) { m_render_cb(cliprect); }
+
+ private:
+ std::function<void (const rectangle &)> m_render_cb;
+ std::string m_name;
+ interface *m_intf;
+ bool m_target;
+
+ std::unordered_map<std::string, std::unique_ptr<input>> m_inputs;
+ std::unordered_map<std::string, std::unique_ptr<output>> m_outputs;
+
+ template<typename IO, typename IOL> IOL *check_and_add(std::unordered_map<std::string, std::unique_ptr<IO>> &map, std::unique_ptr<IOL> &&io, const char *type);
+ };
+
+ class interface : public device_interface
+ {
+ public:
+ friend manager;
+ interface(const machine_config &mconfig, device_t &device);
+ virtual ~interface();
+
+ const renderer *flow_render_get_renderer(std::string name = "default") const;
+
+ void flow_render_do_render(int width, int height, const rectangle &cliprect);
+
+ protected:
+ virtual void flow_render_register_renderers() = 0;
+
+ renderer *flow_render_create_renderer(std::function<void (const rectangle &)> render_cb, std::string name = "default");
+
+ private:
+ manager *m_manager;
+ std::unordered_map<std::string, std::unique_ptr<renderer>> m_renderers;
+
+ void flow_render_set_manager(manager *m) { m_manager = m; }
+ void flow_render_append_renderers(std::vector<renderer *> &renderers) const;
+ };
+
+ class manager : public device_t
+ {
+ public:
+ manager(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ void set_setup(setup_delegate _cb) { m_setup_cb = _cb; }
+ void connect(output *out, input *inp);
+ void set_constant(input *inp, u32 value);
+ void do_render(int width, int height, const rectangle &cliprect);
+
+ protected:
+ void device_config_complete() override;
+ void device_start() override;
+
+ private:
+ struct intermediate_bitmap {
+ std::unique_ptr<bitmap_t> bitmap;
+ output *out;
+ std::vector<input *> inp;
+ bool fixed_value;
+ u32 value;
+
+ intermediate_bitmap(std::unique_ptr<bitmap_t> b) : bitmap(std::move(b)), out(nullptr), fixed_value(false), value(0) {}
+ };
+
+ setup_delegate m_setup_cb;
+
+ std::vector<flow_render::interface *> m_fri;
+ std::vector<flow_render::renderer *> m_rend;
+
+ std::unordered_map<flow_render::input *, flow_render::output *> m_input_to_output;
+ std::unordered_map<flow_render::input *, u32> m_input_constants_u32;
+
+ std::vector<renderer *> m_ordered_renderers;
+ std::vector<std::unique_ptr<intermediate_bitmap>> m_intermediate_bitmaps;
+ };
+}
+
+DECLARE_DEVICE_TYPE_NS(FLOW_RENDER_MANAGER, flow_render, manager)
+
+#endif /* MAME_EMU_DIFR_H */
diff --git a/src/emu/ksnotifier.cpp b/src/emu/ksnotifier.cpp
new file mode 100644
index 00000000000..6e4f4f6542a
--- /dev/null
+++ b/src/emu/ksnotifier.cpp
@@ -0,0 +1,83 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+/***************************************************************************
+
+ Screen timings notifier (aka Konami Screen change Notifier)
+
+***************************************************************************/
+
+#include "emu.h"
+#include "ksnotifier.h"
+
+ksnotifier_t::ksnotifier_t(device_t &device)
+ : m_device(device),
+ m_type(CALLBACK_NONE),
+ m_target_tag(nullptr),
+ m_adapter(&ksnotifier_t::unresolved_adapter)
+{
+}
+
+void ksnotifier_t::reset(callback_type type)
+{
+ m_type = type;
+ m_target_tag = nullptr;
+ m_notifier = ksnotifier_delegate();
+ m_adapter = &ksnotifier_t::unresolved_adapter;
+ m_chain = nullptr;
+}
+
+ksnotifier_t &ksnotifier_t::chain_alloc()
+{
+ // set up the chained callback pointer
+ m_chain.reset(new ksnotifier_t(m_device));
+ return *m_chain;
+}
+
+void ksnotifier_t::resolve()
+{
+ const char *name = "unknown";
+ try
+ {
+ switch (m_type)
+ {
+ case CALLBACK_NONE:
+ m_adapter = &ksnotifier_t::noop_adapter;
+ break;
+
+ case CALLBACK_NOTIFIER:
+ name = m_notifier.name();
+ m_notifier.bind_relative_to(*m_device.owner());
+ m_adapter = m_notifier.isnull() ? &ksnotifier_t::noop_adapter : &ksnotifier_t::notifier_adapter;
+ break;
+ }
+ }
+ catch (binding_type_exception &binderr)
+ {
+ throw emu_fatalerror("ksnotifier: Error performing a late bind of type %s to %s (name=%s)\n", binderr.m_actual_type.name(), binderr.m_target_type.name(), name);
+ }
+
+ // resolve callback chain recursively
+ if (m_chain)
+ m_chain->resolve();
+}
+
+void ksnotifier_t::unresolved_adapter(int, int, int, int, int, int, int, int, int)
+{
+ throw emu_fatalerror("Attempted to notify through an unresolved ksnotifier");
+}
+
+void ksnotifier_t::noop_adapter(int, int, int, int, int, int, int, int, int)
+{
+}
+
+void ksnotifier_t::notifier_adapter(int clk, int hbp, int hv, int hfp, int hs, int vbp, int vv, int vfp, int vs)
+{
+ m_notifier(clk, hbp, hv, hfp, hs, vbp, vv, vfp, vs);
+}
+
+void ksnotifier_t::operator()(int clk, int hbp, int hv, int hfp, int hs, int vbp, int vv, int vfp, int vs)
+{
+ (this->*m_adapter)(clk, hbp, hv, hfp, hs, vbp, vv, vfp, vs);
+ if (m_chain)
+ (*m_chain)(clk, hbp, hv, hfp, hs, vbp, vv, vfp, vs);
+}
diff --git a/src/emu/ksnotifier.h b/src/emu/ksnotifier.h
new file mode 100644
index 00000000000..1dab78f7704
--- /dev/null
+++ b/src/emu/ksnotifier.h
@@ -0,0 +1,76 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+/***************************************************************************
+
+ Screen timings notifier (aka Konami Screen change Notifier)
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef MAME_KSNOTIFY_H
+#define MAME_KSNOTIFY_H
+
+#define KSNOTIFIER(_class, _func) ksnotifier_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr)
+#define DEVKSNOTIFIER(tag, _class, _func) ksnotifier_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr)
+
+// machine config helpers for chaining callbacks
+#define MCFG_KSNOTIFIER_CHAIN(_desc) ksnotifier = &(*ksnotifier).chain_alloc().set_callback(_desc);
+
+// pixel clock
+// horizontal back porch, visible, front porch, sync (in pixel clocks)
+// vertical back porch, visible, front porch, sync (in lines)
+
+using ksnotifier_delegate = device_delegate<void (int, int, int, int, int, int, int, int, int)>;
+
+class ksnotifier_t
+{
+protected:
+ enum callback_type
+ {
+ CALLBACK_NONE,
+ CALLBACK_NOTIFIER
+ };
+
+public:
+ ksnotifier_t(device_t &device);
+
+ bool isnull() const { return (m_type == CALLBACK_NONE); }
+
+ class null_desc
+ {
+ public:
+ null_desc() { }
+ };
+
+ ksnotifier_t &set_callback(null_desc null) { reset(CALLBACK_NONE); return *this; }
+ ksnotifier_t &set_callback(ksnotifier_delegate func) { reset(CALLBACK_NOTIFIER); m_notifier = func; return *this; }
+ void reset() { reset(CALLBACK_NONE); }
+
+ ksnotifier_t &chain_alloc();
+
+ void resolve();
+ void resolve_safe();
+
+ void operator()(int clk, int hbp, int hv, int hfp, int hs, int vbp, int vv, int vfp, int vs);
+
+private:
+ using adapter_func = void (ksnotifier_t::*)(int, int, int, int, int, int, int, int, int);
+
+ void noop_adapter(int, int, int, int, int, int, int, int, int);
+ void notifier_adapter(int, int, int, int, int, int, int, int, int);
+ void unresolved_adapter(int, int, int, int, int, int, int, int, int);
+
+ void reset(callback_type type);
+
+ // configuration
+ device_t & m_device; // reference to our owning device
+ callback_type m_type; // type of callback registered
+ const char * m_target_tag; // tag of target object
+ ksnotifier_delegate m_notifier; // copy of registered notifier
+ adapter_func m_adapter; // actual callback to invoke
+ std::unique_ptr<ksnotifier_t> m_chain; // next callback for chained output
+
+};
+
+#endif /* MAME_KSNOTIFIER_H */
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index 2ff22fd1960..01733a05ecb 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -107,6 +107,8 @@ ATTR_COLD void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owne
{ \
devcb_base *devcb = nullptr; \
(void)devcb; \
+ class ksnotifier_t *ksnotifier = nullptr; \
+ (void)ksnotifier; \
assert(owner != nullptr);
/**
@@ -121,6 +123,8 @@ ATTR_COLD void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owne
{ \
devcb_base *devcb = nullptr; \
(void)devcb; \
+ class ksnotifier_t *ksnotifier = nullptr; \
+ (void)ksnotifier; \
assert(owner != nullptr); \
MACHINE_CONFIG_NAME(_base)(config, owner, device);
@@ -137,9 +141,11 @@ ATTR_COLD void _name(machine_config &config) \
device_t *const owner = this; \
device_t *device = nullptr; \
devcb_base *devcb = nullptr; \
+ class ksnotifier_t *ksnotifier = nullptr; \
(void)owner; \
(void)device; \
(void)devcb; \
+ (void)ksnotifier;
/**
@def MACHINE_CONFIG_END
diff --git a/src/emu/save.h b/src/emu/save.h
index 4f112796eaf..80a2c6938ba 100644
--- a/src/emu/save.h
+++ b/src/emu/save.h
@@ -126,6 +126,13 @@ public:
save_memory(device, module, tag, index, valname, &value[0], sizeof(value[0]), N);
}
+ template<typename _ItemType, std::size_t N>
+ void save_item(device_t *device, const char *module, const char *tag, int index, std::array<_ItemType, N> &value, const char *valname)
+ {
+ if (!type_checker<_ItemType>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!");
+ save_memory(device, module, tag, index, valname, &value[0], sizeof(value[0]), N);
+ }
+
// templatized wrapper for 2-dimensional arrays
template<typename _ItemType, std::size_t M, std::size_t N>
void save_item(device_t *device, const char *module, const char *tag, int index, _ItemType (&value)[M][N], const char *valname)
diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp
index 1284ad35b53..483fc6ff202 100644
--- a/src/emu/screen.cpp
+++ b/src/emu/screen.cpp
@@ -546,6 +546,7 @@ void screen_device::svg_renderer::rebuild_cache()
screen_device::screen_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, SCREEN, tag, owner, clock),
+ flow_render::interface(mconfig, *this),
m_type(SCREEN_TYPE_RASTER),
m_oldstyle_vblank_supplied(false),
m_refresh(0),
@@ -559,6 +560,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev
m_palette_tag(nullptr),
m_video_attributes(0),
m_svg_region(nullptr),
+ m_flow_render_mode(FLOW_RENDER_DISABLED),
m_container(nullptr),
m_width(100),
m_height(100),
@@ -616,6 +618,12 @@ void screen_device::static_set_svg_region(device_t &device, const char *region)
}
+void screen_device::set_flow_render_mode(int flow_render_mode)
+{
+ m_flow_render_mode = flow_render_mode;
+}
+
+
//-------------------------------------------------
// static_set_raw - configuration helper
// to set the raw screen parameters
@@ -770,7 +778,7 @@ void screen_device::device_validity_check(validity_checker &valid) const
osd_printf_error("Invalid display area\n");
// sanity check screen formats
- if (m_screen_update_ind16.isnull() && m_screen_update_rgb32.isnull())
+ if (m_screen_update_ind16.isnull() && m_screen_update_rgb32.isnull() && m_flow_render_mode == FLOW_RENDER_DISABLED)
osd_printf_error("Missing SCREEN_UPDATE function\n");
}
@@ -782,7 +790,7 @@ void screen_device::device_validity_check(validity_checker &valid) const
if (m_refresh == 0)
osd_printf_error("Invalid (zero) refresh rate\n");
- texture_format texformat = !m_screen_update_ind16.isnull() ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32;
+ texture_format texformat = !m_screen_update_ind16.isnull() || m_flow_render_mode == FLOW_RENDER_U16 ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32;
if (m_palette_tag != nullptr)
{
if (texformat == TEXFORMAT_RGB32)
@@ -1183,7 +1191,16 @@ bool screen_device::update_partial(int scanline)
g_profiler.start(PROFILER_VIDEO);
u32 flags;
- if (m_type != SCREEN_TYPE_SVG)
+ if (m_flow_render_mode != FLOW_RENDER_DISABLED)
+ {
+ switch (m_flow_render_mode)
+ {
+ case FLOW_RENDER_U16: flow_render_do_render(m_bitmap[m_curbitmap].width(), m_bitmap[m_curbitmap].height(), clip); break;
+ case FLOW_RENDER_RGB: flow_render_do_render(m_bitmap[m_curbitmap].width(), m_bitmap[m_curbitmap].height(), clip); break;
+ }
+ flags = 0;
+ }
+ else if (m_type != SCREEN_TYPE_SVG)
{
screen_bitmap &curbitmap = m_bitmap[m_curbitmap];
switch (curbitmap.format())
@@ -1270,12 +1287,23 @@ void screen_device::update_now()
{
g_profiler.start(PROFILER_VIDEO);
- screen_bitmap &curbitmap = m_bitmap[m_curbitmap];
- switch (curbitmap.format())
+ if (m_flow_render_mode != FLOW_RENDER_DISABLED)
{
- default:
- case BITMAP_FORMAT_IND16: m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break;
- case BITMAP_FORMAT_RGB32: m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break;
+ switch (m_flow_render_mode)
+ {
+ case FLOW_RENDER_U16: flow_render_do_render(m_bitmap[m_curbitmap].width(), m_bitmap[m_curbitmap].height(), clip); break;
+ case FLOW_RENDER_RGB: flow_render_do_render(m_bitmap[m_curbitmap].width(), m_bitmap[m_curbitmap].height(), clip); break;
+ }
+ }
+ else
+ {
+ screen_bitmap &curbitmap = m_bitmap[m_curbitmap];
+ switch (curbitmap.format())
+ {
+ default:
+ case BITMAP_FORMAT_IND16: m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break;
+ case BITMAP_FORMAT_RGB32: m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break;
+ }
}
m_partial_updates_this_frame++;
@@ -1310,12 +1338,24 @@ void screen_device::update_now()
LOG_PARTIAL_UPDATES(("doing scanline partial draw: Y %d X %d-%d\n", clip.max_y, clip.min_x, clip.max_x));
u32 flags;
- screen_bitmap &curbitmap = m_bitmap[m_curbitmap];
- switch (curbitmap.format())
+ if (m_flow_render_mode != FLOW_RENDER_DISABLED)
{
- default:
- case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break;
- case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break;
+ switch (m_flow_render_mode)
+ {
+ case FLOW_RENDER_U16: flow_render_do_render(m_bitmap[m_curbitmap].width(), m_bitmap[m_curbitmap].height(), clip); break;
+ case FLOW_RENDER_RGB: flow_render_do_render(m_bitmap[m_curbitmap].width(), m_bitmap[m_curbitmap].height(), clip); break;
+ }
+ flags = 0;
+ }
+ else
+ {
+ screen_bitmap &curbitmap = m_bitmap[m_curbitmap];
+ switch (curbitmap.format())
+ {
+ default:
+ case BITMAP_FORMAT_IND16: flags = m_screen_update_ind16(*this, curbitmap.as_ind16(), clip); break;
+ case BITMAP_FORMAT_RGB32: flags = m_screen_update_rgb32(*this, curbitmap.as_rgb32(), clip); break;
+ }
}
m_partial_updates_this_frame++;
@@ -1759,3 +1799,51 @@ void screen_device::load_effect_overlay(const char *filename)
else
osd_printf_warning("Unable to load effect PNG file '%s'\n", fullname.c_str());
}
+
+
+//-------------------------------------------------
+// flow_render_register_renderers - endpoint for raster screens
+//-------------------------------------------------
+
+void screen_device::flow_render_register_renderers()
+{
+ if(m_type != SCREEN_TYPE_RASTER || m_flow_render_mode == FLOW_RENDER_DISABLED) {
+ m_renderer = nullptr;
+ m_renderer_input_rgb = nullptr;
+ m_renderer_input_u16 = nullptr;
+ return;
+ }
+
+ if (m_flow_render_mode == FLOW_RENDER_RGB)
+ {
+ m_renderer = flow_render_create_renderer([this](const rectangle &cliprect){ render_rgb(cliprect); });
+ m_renderer_input_rgb = m_renderer->create_input_sb_rgb();
+ m_renderer_input_u16 = nullptr;
+ }
+ else
+ {
+ m_renderer = flow_render_create_renderer([this](const rectangle &cliprect){ render_u16(cliprect); });
+ m_renderer_input_u16 = m_renderer->create_input_sb_u16();
+ m_renderer_input_rgb = nullptr;
+ }
+
+ m_renderer->set_target();
+}
+
+void screen_device::render_u16(const rectangle &cliprect)
+{
+ for(int y = cliprect.min_y; y <= cliprect.max_y; y++) {
+ const u16 *fi = &m_renderer_input_u16->bitmap().pix16(y, cliprect.min_x);
+ u16 *fo = &m_bitmap[m_curbitmap].as_ind16().pix16(y, cliprect.min_x);
+ memcpy(fo, fi, (cliprect.max_x - cliprect.min_x + 1)*2);
+ }
+}
+
+void screen_device::render_rgb(const rectangle &cliprect)
+{
+ for(int y = cliprect.min_y; y <= cliprect.max_y; y++) {
+ const u32 *fi = &m_renderer_input_rgb->bitmap().pix32(y, cliprect.min_x);
+ u32 *fo = &m_bitmap[m_curbitmap].as_rgb32().pix32(y, cliprect.min_x);
+ memcpy(fo, fi, (cliprect.max_x - cliprect.min_x + 1)*4);
+ }
+}
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 3da146bac1d..f9ecdf26953 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -14,6 +14,8 @@
#include <utility>
+#include "difr.h"
+
//**************************************************************************
// CONSTANTS
@@ -161,11 +163,17 @@ typedef device_delegate<u32 (screen_device &, bitmap_rgb32 &, const rectangle &)
// ======================> screen_device
-class screen_device : public device_t
+class screen_device : public device_t, public flow_render::interface
{
friend class render_manager;
public:
+ enum {
+ FLOW_RENDER_DISABLED,
+ FLOW_RENDER_U16,
+ FLOW_RENDER_RGB
+ };
+
// construction/destruction
screen_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
~screen_device();
@@ -201,6 +209,7 @@ public:
static void static_set_video_attributes(device_t &device, u32 flags);
static void static_set_color(device_t &device, rgb_t color);
static void static_set_svg_region(device_t &device, const char *region);
+ void set_flow_render_mode(int flow_render_mode);
// information getters
render_container &container() const { assert(m_container != nullptr); return *m_container; }
@@ -249,6 +258,9 @@ public:
static constexpr int DEFAULT_FRAME_RATE = 60;
static const attotime DEFAULT_FRAME_PERIOD;
+protected:
+ void flow_render_register_renderers() override;
+
private:
class svg_renderer;
@@ -276,6 +288,8 @@ private:
void vblank_end();
void finalize_burnin();
void load_effect_overlay(const char *filename);
+ void render_u16(const rectangle &cliprect);
+ void render_rgb(const rectangle &cliprect);
// inline configuration data
screen_type_enum m_type; // type of screen
@@ -291,10 +305,15 @@ private:
const char * m_palette_tag; // configured tag for palette device
u32 m_video_attributes; // flags describing the video system
const char * m_svg_region; // the region in which the svg data is in
+ int m_flow_render_mode; // flow rendering mode (not used / output as ind16 / output as rgb32)
// internal state
render_container * m_container; // pointer to our container
std::unique_ptr<svg_renderer> m_svg; // the svg renderer
+ flow_render::renderer *m_renderer;
+ flow_render::input_sb_rgb *m_renderer_input_rgb;
+ flow_render::input_sb_u16 *m_renderer_input_u16;
+
// dimensions
int m_width; // current width (HTOTAL)
int m_height; // current height (VTOTAL)
@@ -496,7 +515,10 @@ typedef device_type_iterator<screen_device> screen_device_iterator;
screen_device::static_set_video_attributes(*device, _flags);
#define MCFG_SCREEN_COLOR(_color) \
screen_device::static_set_color(*device, _color);
-
+#define MCFG_SCREEN_FLOW_RENDER_U16() \
+ downcast<screen_device *>(device)->set_flow_render_mode(screen_device::FLOW_RENDER_U16);
+#define MCFG_SCREEN_FLOW_RENDER_RGB() \
+ downcast<screen_device *>(device)->set_flow_render_mode(screen_device::FLOW_RENDER_RGB);
//**************************************************************************
// INLINE HELPERS
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index b98922ab193..b6db0b0ae23 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -288,7 +288,7 @@ void mame_ui_manager::display_startup_screens(bool first_time)
const int maxstate = 3;
int str = machine().options().seconds_to_run();
bool show_gameinfo = !machine().options().skip_gameinfo();
- bool show_warnings = true, show_mandatory_fileman = true;
+ bool show_warnings = false, show_mandatory_fileman = true;
int state;
// disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,
diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h
index 7b0fc34610f..c75ba825ab1 100644
--- a/src/lib/util/bitmap.h
+++ b/src/lib/util/bitmap.h
@@ -119,19 +119,21 @@ public:
class bitmap_t
{
protected:
- // construction/destruction -- subclasses only to ensure type correctness
+ // construction -- subclasses only to ensure type correctness
bitmap_t(const bitmap_t &) = delete;
bitmap_t(bitmap_t &&that);
bitmap_t(bitmap_format format, uint8_t bpp, int width = 0, int height = 0, int xslop = 0, int yslop = 0);
bitmap_t(bitmap_format format, uint8_t bpp, void *base, int width, int height, int rowpixels);
bitmap_t(bitmap_format format, uint8_t bpp, bitmap_t &source, const rectangle &subrect);
- virtual ~bitmap_t();
// prevent implicit copying
bitmap_t &operator=(const bitmap_t &) = delete;
bitmap_t &operator=(bitmap_t &&that);
public:
+ // destruction
+ virtual ~bitmap_t();
+
// allocation/deallocation
void reset();
diff --git a/src/mame/drivers/88games.cpp b/src/mame/drivers/88games.cpp
index 870915b813d..0205a4fde5f 100644
--- a/src/mame/drivers/88games.cpp
+++ b/src/mame/drivers/88games.cpp
@@ -7,18 +7,138 @@
***************************************************************************/
#include "emu.h"
-#include "includes/88games.h"
#include "cpu/m6809/konami.h"
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/nvram.h"
#include "machine/watchdog.h"
-#include "sound/ym2151.h"
-
#include "screen.h"
+#include "sound/upd7759.h"
+#include "sound/ym2151.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/k051960.h"
+#include "video/k052109.h"
+#include "video/konami_helper.h"
+
+class _88games_state : public driver_device
+{
+public:
+ _88games_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_k052109(*this, "k052109"),
+ m_k051960(*this, "k051960"),
+ m_k051316(*this, "k051316"),
+ m_upd7759_1(*this, "upd1"),
+ m_upd7759_2(*this, "upd2"),
+ m_bank0000(*this, "bank0000"),
+ m_bank1000(*this, "bank1000"),
+ m_ram(*this, "ram") { }
+
+ /* video-related */
+ int m_k88games_priority;
+ int m_videobank;
+ int m_zoomreadroms;
+ int m_speech_chip;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k052109_device> m_k052109;
+ required_device<k051960_device> m_k051960;
+ required_device<k051316_device> m_k051316;
+ required_device<upd7759_device> m_upd7759_1;
+ required_device<upd7759_device> m_upd7759_2;
+
+ /* memory banks */
+ required_memory_bank m_bank0000;
+ required_memory_bank m_bank1000;
+
+ /* memory pointers */
+ required_shared_ptr<uint8_t> m_ram;
+
+ DECLARE_READ8_MEMBER(bankedram_r);
+ DECLARE_WRITE8_MEMBER(bankedram_w);
+ DECLARE_WRITE8_MEMBER(k88games_5f84_w);
+ DECLARE_WRITE8_MEMBER(k88games_sh_irqtrigger_w);
+ DECLARE_WRITE8_MEMBER(speech_control_w);
+ DECLARE_WRITE8_MEMBER(speech_msg_w);
+ DECLARE_READ8_MEMBER(k052109_051960_r);
+ DECLARE_WRITE8_MEMBER(k052109_051960_w);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ uint32_t screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(k88games_interrupt);
+ // K051316_CB_MEMBER(zoom_callback);
+ K052109_CB_MEMBER(tile_callback);
+ K051960_CB_MEMBER(sprite_callback);
+ DECLARE_WRITE8_MEMBER(banking_callback);
+};
+
+/***************************************************************************
+
+ Callbacks for the K052109
+
+***************************************************************************/
+
+K052109_CB_MEMBER(_88games_state::tile_callback)
+{
+ static const int layer_colorbase[] = { 1024 / 16, 0 / 16, 256 / 16 };
+
+ *code |= ((*color & 0x0f) << 8) | (bank << 12);
+ *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4);
+}
+
+
+/***************************************************************************
+
+ Callbacks for the K051960
+
+***************************************************************************/
+K051960_CB_MEMBER(_88games_state::sprite_callback)
+{
+ enum { sprite_colorbase = 512 / 16 };
+
+ *priority = (*color & 0x20) >> 5; /* ??? */
+ *color = sprite_colorbase + (*color & 0x0f);
+}
+
+
+/***************************************************************************
+
+ Display refresh
+
+***************************************************************************/
+
+uint32_t _88games_state::screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ m_k052109->tilemap_update();
+
+ if (m_k88games_priority)
+ {
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); // tile 0
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0); // tile 2
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); // tile 1
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0);
+ // m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 0);
+ }
+ else
+ {
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 0); // tile 2
+ // m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 0);
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); // tile 1
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); // tile 0
+ }
+
+ return 0;
+}
/*************************************
*
@@ -41,7 +161,7 @@ READ8_MEMBER(_88games_state::bankedram_r)
if (m_zoomreadroms)
return m_k051316->rom_r(space, offset);
else
- return m_k051316->read(space, offset);
+ return m_k051316->vram_r(space, offset);
}
}
@@ -50,7 +170,7 @@ WRITE8_MEMBER(_88games_state::bankedram_w)
if (m_videobank)
m_ram[offset] = data;
else
- m_k051316->write(space, offset, data);
+ m_k051316->vram_w(space, offset, data);
}
WRITE8_MEMBER(_88games_state::k88games_5f84_w)
@@ -137,7 +257,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, _88games_state )
AM_RANGE(0x5f96, 0x5f96) AM_READ_PORT("IN2")
AM_RANGE(0x5f97, 0x5f97) AM_READ_PORT("DSW1")
AM_RANGE(0x5f9b, 0x5f9b) AM_READ_PORT("DSW2")
- AM_RANGE(0x5fc0, 0x5fcf) AM_DEVWRITE("k051316", k051316_device, ctrl_w)
+ AM_RANGE(0x5fc0, 0x5fcf) AM_DEVICE("k051316", k051316_device, map)
AM_RANGE(0x4000, 0x7fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -339,9 +459,7 @@ static MACHINE_CONFIG_START( 88games )
MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(_88games_state, sprite_callback)
- MCFG_DEVICE_ADD("k051316", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_CB(_88games_state, zoom_callback)
+ MCFG_K051316_ADD("roz", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x07ffff; color = ((address & 0x800000) >> 16) | ((address & 0x380000) >> 15); })
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/ajax.cpp b/src/mame/drivers/ajax.cpp
index bd4db94f2be..9e1ea62fea5 100644
--- a/src/mame/drivers/ajax.cpp
+++ b/src/mame/drivers/ajax.cpp
@@ -13,15 +13,339 @@
***************************************************************************/
#include "emu.h"
-#include "includes/ajax.h"
-#include "includes/konamipt.h"
-#include "cpu/z80/z80.h"
-#include "cpu/m6809/m6809.h"
#include "cpu/m6809/konami.h"
+#include "cpu/m6809/m6809.h"
+#include "cpu/z80/z80.h"
+#include "includes/konamipt.h"
+#include "machine/gen_latch.h"
+#include "machine/watchdog.h"
+#include "sound/k007232.h"
#include "sound/ym2151.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/k051960.h"
+#include "video/k052109.h"
+#include "video/konami_helper.h"
+
+class ajax_state : public driver_device
+{
+public:
+ ajax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_subcpu(*this, "sub"),
+ m_watchdog(*this, "watchdog"),
+ m_k007232_1(*this, "k007232_1"),
+ m_k007232_2(*this, "k007232_2"),
+ m_k052109(*this, "k052109"),
+ m_k051960(*this, "k051960"),
+ m_roz(*this, "roz"),
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
+
+ /* video-related */
+ uint8_t m_priority;
+
+ /* misc */
+ int m_firq_enable;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<cpu_device> m_subcpu;
+ required_device<watchdog_timer_device> m_watchdog;
+ required_device<k007232_device> m_k007232_1;
+ required_device<k007232_device> m_k007232_2;
+ required_device<k052109_device> m_k052109;
+ required_device<k051960_device> m_k051960;
+ required_device<k051316_device> m_roz;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
+ DECLARE_WRITE8_MEMBER(sound_bank_w);
+ DECLARE_READ8_MEMBER(ls138_f10_r);
+ DECLARE_WRITE8_MEMBER(ls138_f10_w);
+ DECLARE_WRITE8_MEMBER(bankswitch_2_w);
+ DECLARE_WRITE8_MEMBER(bankswitch_w);
+ DECLARE_WRITE8_MEMBER(lamps_w);
+ DECLARE_WRITE8_MEMBER(k007232_extvol_w);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE8_MEMBER(volume_callback0);
+ DECLARE_WRITE8_MEMBER(volume_callback1);
+ K052109_CB_MEMBER(tile_callback);
+ K051960_CB_MEMBER(sprite_callback);
+};
+
+
+/***************************************************************************
+
+ Callbacks for the K052109
+
+***************************************************************************/
+
+K052109_CB_MEMBER(ajax_state::tile_callback)
+{
+ static const int layer_colorbase[] = { 1024 / 16, 0 / 16, 512 / 16 };
+
+ *code |= ((*color & 0x0f) << 8) | (bank << 12);
+ *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4);
+}
+
+
+/***************************************************************************
+
+ Callbacks for the K051960
+
+***************************************************************************/
+
+K051960_CB_MEMBER(ajax_state::sprite_callback)
+{
+ enum { sprite_colorbase = 256 / 16 };
+
+ /* priority bits:
+ 4 over zoom (0 = have priority)
+ 5 over B (0 = have priority)
+ 6 over A (1 = have priority)
+ never over F
+ */
+ *priority = 0;
+ if ( *color & 0x10) *priority |= GFX_PMASK_4; /* Z = 4 */
+ if (~*color & 0x40) *priority |= GFX_PMASK_2; /* A = 2 */
+ if ( *color & 0x20) *priority |= GFX_PMASK_1; /* B = 1 */
+ *color = sprite_colorbase + (*color & 0x0f);
+}
+
+/* bankswitch_w:
+ Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at H11:
+
+ Bit Description
+ --- -----------
+ 7 MRB3 Selects ROM N11/N12
+ 6 CCOUNT2 Coin Counter 2 (*)
+ 5 CCOUNT1 Coin Counter 1 (*)
+ 4 SRESET Slave CPU Reset?
+ 3 PRI0 Layer Priority Selector
+ 2 MRB2 \
+ 1 MRB1 | ROM Bank Select
+ 0 MRB0 /
+
+ (*) The Coin Counters are handled by the Konami Custom 051550
+*/
+
+WRITE8_MEMBER(ajax_state::bankswitch_w)
+{
+ int bank = 0;
+
+ /* rom select */
+ if (!(data & 0x80))
+ bank += 4;
+
+ /* coin counters */
+ machine().bookkeeping().coin_counter_w(0, data & 0x20);
+ machine().bookkeeping().coin_counter_w(1, data & 0x40);
+
+ /* priority */
+ m_priority = data & 0x08;
+
+ /* bank # (ROMS N11 and N12) */
+ bank += (data & 0x07);
+ membank("mainbank")->set_entry(bank);
+}
+
+/* lamps_w:
+ Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at B9:
+
+ Bit Description
+ --- -----------
+ 7 LAMP7 & LAMP8 - Game over lamps (*)
+ 6 LAMP3 & LAMP4 - Game over lamps (*)
+ 5 LAMP1 - Start lamp (*)
+ 4 Control panel quaking (**)
+ 3 Joystick vibration (**)
+ 2 LAMP5 & LAMP6 - Power up lamps (*)
+ 1 LAMP2 - Super weapon lamp (*)
+ 0 unused
+
+ (*) The Lamps are handled by the M54585P
+ (**)Vibration/Quaking handled by these chips:
+ Chip Location Description
+ ---- -------- -----------
+ PS2401-4 B21 ???
+ UPA1452H B22 ???
+ LS74 H2 Dual +ve edge trigger D-type Flip-flop with SET and RESET
+ LS393 C20 Dual -ve edge trigger 4-bit Binary Ripple Counter with Resets
+*/
+
+WRITE8_MEMBER(ajax_state::lamps_w)
+{
+ output().set_led_value(1, data & 0x02); /* super weapon lamp */
+ output().set_led_value(2, data & 0x04); /* power up lamps */
+ output().set_led_value(5, data & 0x04); /* power up lamps */
+ output().set_led_value(0, data & 0x20); /* start lamp */
+ output().set_led_value(3, data & 0x40); /* game over lamps */
+ output().set_led_value(6, data & 0x40); /* game over lamps */
+ output().set_led_value(4, data & 0x80); /* game over lamps */
+ output().set_led_value(7, data & 0x80); /* game over lamps */
+}
+
+/* ajax_ls138_f10:
+ The LS138 1-of-8 Decoder/Demultiplexer at F10 selects what to do:
+
+ Address R/W Description
+ ------- --- -----------
+ 0x0000 (r) ??? I think this read is because a CPU core bug
+ (w) 0x0000 NSFIRQ Trigger FIRQ on the M6809
+ 0x0020 AFR Watchdog reset (handled by the 051550)
+ 0x0040 (w) SOUND Cause interrupt on the Z80
+ 0x0080 (w) SOUNDDATA Sound code number
+ 0x00c0 (w) MBL1 Enables the LS273 at H11 (Banking + Coin counters)
+ 0x0100 (r) MBL2 Enables 2P Inputs reading
+ 0x0140 (w) MBL3 Enables the LS273 at B9 (Lamps + Vibration)
+ 0x0180 (r) MIO1 Enables 1P Inputs + DIPSW #1 & #2 reading
+ 0x01c0 (r) MIO2 Enables DIPSW #3 reading
+*/
+
+READ8_MEMBER(ajax_state::ls138_f10_r)
+{
+ int data = 0, index;
+ static const char *const portnames[] = { "SYSTEM", "P1", "DSW1", "DSW2" };
+
+ switch ((offset & 0x01c0) >> 6)
+ {
+ case 0x00: /* ??? */
+ data = machine().rand();
+ break;
+ case 0x04: /* 2P inputs */
+ data = ioport("P2")->read();
+ break;
+ case 0x06: /* 1P inputs + DIPSW #1 & #2 */
+ index = offset & 0x01;
+ data = ioport((offset & 0x02) ? portnames[2 + index] : portnames[index])->read();
+ break;
+ case 0x07: /* DIPSW #3 */
+ data = ioport("DSW3")->read();
+ break;
+
+ default:
+ logerror("%04x: (ls138_f10) read from an unknown address %02x\n",space.device().safe_pc(), offset);
+ }
+
+ return data;
+}
+
+WRITE8_MEMBER(ajax_state::ls138_f10_w)
+{
+ switch ((offset & 0x01c0) >> 6)
+ {
+ case 0x00: /* NSFIRQ + AFR */
+ if (offset)
+ m_watchdog->reset_w(space, 0, data);
+ else{
+ if (m_firq_enable) /* Cause interrupt on slave CPU */
+ m_subcpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
+ }
+ break;
+ case 0x01: /* Cause interrupt on audio CPU */
+ m_audiocpu->set_input_line(0, HOLD_LINE);
+ break;
+ case 0x02: /* Sound command number */
+ m_soundlatch->write(space, offset, data);
+ break;
+ case 0x03: /* Bankswitch + coin counters + priority*/
+ bankswitch_w(space, 0, data);
+ break;
+ case 0x05: /* Lamps + Joystick vibration + Control panel quaking */
+ lamps_w(space, 0, data);
+ break;
+
+ default:
+ logerror("%04x: (ls138_f10) write %02x to an unknown address %02x\n", space.device().safe_pc(), data, offset);
+ }
+}
+
+/* bankswitch_w_2:
+ Handled by the LS273 Octal +ve edge trigger D-type Flip-flop with Reset at K14:
+
+ Bit Description
+ --- -----------
+ 7 unused
+ 6 RMRD Enable char ROM reading through the video RAM
+ 5 RVO enables 051316 wraparound
+ 4 FIRQST FIRQ control
+ 3 SRB3 \
+ 2 SRB2 |
+ 1 SRB1 | ROM Bank Select
+ 0 SRB0 /
+*/
+
+WRITE8_MEMBER(ajax_state::bankswitch_2_w)
+{
+ /* enable char ROM reading through the video RAM */
+ m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
+ /* bit 5 enables 051316 wraparound */
+ m_roz->set_wrap(data & 0x20);
+
+ /* FIRQ control */
+ m_firq_enable = data & 0x10;
+
+ /* bank # (ROMS G16 and I16) */
+ membank("subbank")->set_entry(data & 0x0f);
+}
+
+void ajax_state::machine_start()
+{
+ uint8_t *MAIN = memregion("maincpu")->base();
+ uint8_t *SUB = memregion("sub")->base();
+
+ membank("mainbank")->configure_entries(0, 4, &MAIN[0x00000], 0x2000);
+ membank("mainbank")->configure_entries(4, 8, &MAIN[0x10000], 0x2000);
+ membank("subbank")->configure_entries(0, 9, &SUB[0x00000], 0x2000);
+
+ save_item(NAME(m_priority));
+ save_item(NAME(m_firq_enable));
+}
+
+void ajax_state::machine_reset()
+{
+ m_priority = 0;
+ m_firq_enable = 0;
+}
+
+/***************************************************************************
+
+ Display Refresh
+
+***************************************************************************/
+
+uint32_t ajax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ m_k052109->tilemap_update();
+
+ screen.priority().fill(0, cliprect);
+
+ bitmap.fill(m_palette->black_pen(), cliprect);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 1);
+ if (m_priority)
+ {
+ /* basic layer order is B, zoom, A, F */
+ // m_roz->zoom_draw(screen, bitmap, cliprect, 0, 4);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2);
+ }
+ else
+ {
+ /* basic layer order is B, A, zoom, F */
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2);
+ // m_roz->zoom_draw(screen, bitmap, cliprect, 0, 4);
+ }
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
+ return 0;
+}
static ADDRESS_MAP_START( ajax_main_map, AS_PROGRAM, 8, ajax_state )
AM_RANGE(0x0000, 0x01c0) AM_READWRITE(ls138_f10_r, ls138_f10_w) /* bankswitch + sound command + FIRQ command */
@@ -35,9 +359,9 @@ static ADDRESS_MAP_START( ajax_main_map, AS_PROGRAM, 8, ajax_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( ajax_sub_map, AS_PROGRAM, 8, ajax_state )
- AM_RANGE(0x0000, 0x07ff) AM_DEVREADWRITE("k051316", k051316_device, read, write) /* 051316 zoom/rotation layer */
- AM_RANGE(0x0800, 0x080f) AM_DEVWRITE("k051316", k051316_device, ctrl_w) /* 051316 control registers */
- AM_RANGE(0x1000, 0x17ff) AM_DEVREAD("k051316", k051316_device, rom_r) /* 051316 (ROM test) */
+ AM_RANGE(0x0000, 0x07ff) AM_DEVREADWRITE("roz", k051316_device, vram_r, vram_w)
+ AM_RANGE(0x0800, 0x080f) AM_DEVICE("roz", k051316_device, map)
+ AM_RANGE(0x1000, 0x17ff) AM_DEVREAD("roz", k051316_device, rom_r)
AM_RANGE(0x1800, 0x1800) AM_WRITE(bankswitch_2_w) /* bankswitch control */
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("share1") /* shared RAM with the 052001 */
AM_RANGE(0x4000, 0x7fff) AM_DEVREADWRITE("k052109", k052109_device, read, write) /* video RAM + color RAM + video registers */
@@ -205,10 +529,7 @@ static MACHINE_CONFIG_START( ajax )
MCFG_K051960_CB(ajax_state, sprite_callback)
MCFG_K051960_IRQ_HANDLER(INPUTLINE("maincpu", KONAMI_IRQ_LINE))
- MCFG_DEVICE_ADD("k051316", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_BPP(7)
- MCFG_K051316_CB(ajax_state, zoom_callback)
+ MCFG_K051316_ADD("roz", 7, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x07ffff; color = (address & 0x080000) >> 12; })
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/asterix.cpp b/src/mame/drivers/asterix.cpp
index 44591ecad2d..0f1494fbd23 100644
--- a/src/mame/drivers/asterix.cpp
+++ b/src/mame/drivers/asterix.cpp
@@ -13,17 +13,93 @@ TODO:
***************************************************************************/
#include "emu.h"
-#include "includes/asterix.h"
-#include "includes/konamipt.h"
-
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "includes/konamipt.h"
#include "machine/eepromser.h"
-#include "sound/ym2151.h"
-#include "sound/k053260.h"
#include "screen.h"
+#include "sound/k053260.h"
+#include "sound/ym2151.h"
#include "speaker.h"
+#include "video/k053244_k053245.h"
+#include "video/k053251.h"
+#include "video/k054156_k054157_k056832.h"
+#include "video/kvideodac.h"
+
+class asterix_state : public driver_device
+{
+public:
+ enum
+ {
+ TIMER_NMI
+ };
+
+ asterix_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_tilemap(*this, "tilemap"),
+ m_sprites(*this, "sprites"),
+ m_mixer(*this, "mixer"),
+ m_videodac(*this, "videodac"),
+ m_screen(*this, "screen")
+ { }
+
+ /* video-related */
+ u16 m_spritebank;
+ int m_spritebanks[4];
+
+ /* misc */
+ u8 m_cur_control2;
+ u16 m_prot[2];
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k054156_054157_device> m_tilemap;
+ required_device<k05324x_device> m_sprites;
+ required_device<k053251_device> m_mixer;
+ required_device<kvideodac_device> m_videodac;
+ required_device<screen_device> m_screen;
+
+ DECLARE_WRITE16_MEMBER(control2_w);
+ DECLARE_WRITE8_MEMBER(sound_arm_nmi_w);
+ DECLARE_WRITE16_MEMBER(sound_irq_w);
+ DECLARE_WRITE16_MEMBER(protection_w);
+ DECLARE_WRITE16_MEMBER(asterix_spritebank_w);
+ DECLARE_DRIVER_INIT(asterix);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ INTERRUPT_GEN_MEMBER(asterix_interrupt);
+ void reset_spritebank();
+
+ void fr_setup(flow_render::manager *manager);
+
+protected:
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+};
+
+void asterix_state::fr_setup(flow_render::manager *manager)
+{
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rv = m_videodac->flow_render_get_renderer();
+
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), rm->inp("0 color"));
+ manager->set_constant(rm->inp("0 attr"), 0x3f);
+ manager->set_constant(rm->inp("1 color"), 0);
+ manager->set_constant(rm->inp("1 attr"), 0x3f);
+
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), rm->inp("2 color"));
+ manager->set_constant(rm->inp("2 attr"), 0x3f);
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm->inp("3 color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm->inp("4 color"));
+
+ manager->connect(rm->out("color"), rv->inp("color"));
+ manager->connect(rm->out("attr"), rv->inp("attr"));
+
+ manager->connect(rv->out(), m_screen->flow_render_get_renderer()->inp());
+}
#if 0
READ16_MEMBER(asterix_state::control2_r)
@@ -43,23 +119,15 @@ WRITE16_MEMBER(asterix_state::control2_w)
ioport("EEPROMOUT")->write(data, 0xff);
/* bit 5 is select tile bank */
- m_k056832->set_tile_bank((data & 0x20) >> 5);
- // TODO: looks like 0xffff is used from time to time for chip selection/reset something, not unlike Jackal
- if((data & 0xff) != 0xff)
- {
- machine().bookkeeping().coin_counter_w(0, data & 0x08);
- machine().bookkeeping().coin_counter_w(1, data & 0x10);
- machine().bookkeeping().coin_lockout_w(0, data & 0x40);
- machine().bookkeeping().coin_lockout_w(1, data & 0x80);
- }
+ //*// m_tilemap->set_tile_bank((data & 0x20) >> 5);
}
}
INTERRUPT_GEN_MEMBER(asterix_state::asterix_interrupt)
{
// global interrupt masking
- if (!m_k056832->is_irq_enabled(0))
- return;
+ //*// if (!m_tilemap->is_irq_enabled(0))
+ //*// return;
device.execute().set_input_line(5, HOLD_LINE); /* ??? All irqs have the same vector, and the mask used is 0 or 7 */
}
@@ -90,44 +158,6 @@ WRITE16_MEMBER(asterix_state::sound_irq_w)
// Check the routine at 7f30 in the ead version.
// You're not supposed to laugh.
// This emulation is grossly overkill but hey, I'm having fun.
-#if 0
-WRITE16_MEMBER(asterix_state::protection_w)
-{
- COMBINE_DATA(m_prot + offset);
-
- if (offset == 1)
- {
- uint32_t cmd = (m_prot[0] << 16) | m_prot[1];
- switch (cmd >> 24)
- {
- case 0x64:
- {
- uint32_t param1 = (read_word(cmd & 0xffffff) << 16) | read_word((cmd & 0xffffff) + 2);
- uint32_t param2 = (read_word((cmd & 0xffffff) + 4) << 16) | read_word((cmd & 0xffffff) + 6);
-
- switch (param1 >> 24)
- {
- case 0x22:
- {
- int size = param2 >> 24;
- param1 &= 0xffffff;
- param2 &= 0xffffff;
- while(size >= 0)
- {
- write_word(param2, read_word(param1));
- param1 += 2;
- param2 += 2;
- size--;
- }
- break;
- }
- }
- break;
- }
- }
- }
-}
-#endif
WRITE16_MEMBER(asterix_state::protection_w)
{
@@ -171,24 +201,24 @@ WRITE16_MEMBER(asterix_state::protection_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, asterix_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x107fff) AM_RAM
- AM_RANGE(0x180000, 0x1807ff) AM_DEVREADWRITE("k053244", k05324x_device, k053245_word_r, k053245_word_w)
+ AM_RANGE(0x180000, 0x1807ff) AM_DEVREADWRITE("sprites", k05324x_device, k053245_word_r, k053245_word_w)
AM_RANGE(0x180800, 0x180fff) AM_RAM // extra RAM, or mirror for the above?
- AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("k053244", k05324x_device, k053244_word_r, k053244_word_w)
+ AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("sprites", k05324x_device, k053244_word_r, k053244_word_w)
AM_RANGE(0x280000, 0x280fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x300000, 0x30001f) AM_DEVREADWRITE("k053244", k05324x_device, k053244_lsb_r, k053244_lsb_w)
+ AM_RANGE(0x300000, 0x30001f) AM_DEVREADWRITE("sprites", k05324x_device, k053244_lsb_r, k053244_lsb_w)
AM_RANGE(0x380000, 0x380001) AM_READ_PORT("IN0")
AM_RANGE(0x380002, 0x380003) AM_READ_PORT("IN1")
AM_RANGE(0x380100, 0x380101) AM_WRITE(control2_w)
AM_RANGE(0x380200, 0x380203) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x380300, 0x380301) AM_WRITE(sound_irq_w)
- AM_RANGE(0x380400, 0x380401) AM_WRITE(asterix_spritebank_w)
- AM_RANGE(0x380500, 0x38051f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+// AM_RANGE(0x380400, 0x380401) AM_WRITE(asterix_spritebank_w)
+ AM_RANGE(0x380500, 0x38051f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x380600, 0x380601) AM_NOP // Watchdog
- AM_RANGE(0x380700, 0x380707) AM_DEVWRITE("k056832", k056832_device, b_word_w)
+ AM_RANGE(0x380700, 0x380707) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
AM_RANGE(0x380800, 0x380803) AM_WRITE(protection_w)
- AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE("k056832", k056832_device, ram_half_word_r, ram_half_word_w)
- AM_RANGE(0x420000, 0x421fff) AM_DEVREAD("k056832", k056832_device, old_rom_word_r) // Passthrough to tile roms
- AM_RANGE(0x440000, 0x44003f) AM_DEVWRITE("k056832", k056832_device, word_w)
+ AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x420000, 0x421fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
+ AM_RANGE(0x440000, 0x44003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, asterix_state )
@@ -229,11 +259,7 @@ void asterix_state::machine_start()
save_item(NAME(m_cur_control2));
save_item(NAME(m_prot));
- save_item(NAME(m_sprite_colorbase));
save_item(NAME(m_spritebank));
- save_item(NAME(m_layerpri));
- save_item(NAME(m_layer_colorbase));
- save_item(NAME(m_tilebanks));
save_item(NAME(m_spritebanks));
}
@@ -243,16 +269,9 @@ void asterix_state::machine_reset()
m_prot[0] = 0;
m_prot[1] = 0;
- m_sprite_colorbase = 0;
m_spritebank = 0;
- m_layerpri[0] = 0;
- m_layerpri[1] = 0;
- m_layerpri[2] = 0;
-
for (int i = 0; i < 4; i++)
{
- m_layer_colorbase[i] = 0;
- m_tilebanks[i] = 0;
m_spritebanks[i] = 0;
}
}
@@ -262,7 +281,6 @@ static MACHINE_CONFIG_START( asterix )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) // 12MHz
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", asterix_state, asterix_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_32MHz/4) // 8MHz Z80E ??
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -270,29 +288,29 @@ static MACHINE_CONFIG_START( asterix )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
/* video hardware */
+ MCFG_FLOW_RENDER_MANAGER_ADD("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", asterix_state, fr_setup)
+
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
- MCFG_SCREEN_UPDATE_DRIVER(asterix_state, screen_update_asterix)
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 384, 48, 48+288, 264, 15, 15+224)
+ MCFG_SCREEN_FLOW_RENDER_RGB()
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(asterix_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
- MCFG_DEVICE_ADD("k053244", K053244, 0)
+ MCFG_K054156_054157_ADD("tilemap", XTAL_24MHz/4, 2, 2, 16)
+ MCFG_K054156_054157_VBLANK_CB(INPUTLINE("maincpu", 5)) // Actual line unknown, all have the same vector and mask is 0 or 7
+
+ MCFG_DEVICE_ADD("sprites", K053244, 0)
MCFG_GFX_PALETTE("palette")
MCFG_K05324X_OFFSETS(-3, -1)
- MCFG_K05324X_CB(asterix_state, sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("mixer", 1)
+
+ MCFG_KVIDEODAC_ADD("videodac", "palette", 0x3, 0.6, 0, 1.0)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -317,11 +335,11 @@ ROM_START( asterix )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "068_a05.5f", 0x000000, 0x010000, CRC(d3d0d77b) SHA1(bfa77a8bf651dc27f481e96a2d63242084cc214c) )
- ROM_REGION( 0x100000, "gfx1", 0 )
- ROM_LOAD32_WORD( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
- ROM_LOAD32_WORD( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
+ ROM_REGION( 0x100000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
+ ROM_LOAD32_WORD_SWAP( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
- ROM_REGION( 0x400000, "k053244", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD32_WORD( "068a08.7k", 0x000000, 0x200000, CRC(c41278fe) SHA1(58e5f67a67ae97e0b264489828cd7e74662c5ed5) )
ROM_LOAD32_WORD( "068a07.3k", 0x000002, 0x200000, CRC(32efdbc4) SHA1(b7e8610aa22249176d82b750e2549d1eea6abe4f) )
@@ -342,11 +360,11 @@ ROM_START( asterixeac )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "068_a05.5f", 0x000000, 0x010000, CRC(d3d0d77b) SHA1(bfa77a8bf651dc27f481e96a2d63242084cc214c) )
- ROM_REGION( 0x100000, "gfx1", 0 )
- ROM_LOAD32_WORD( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
- ROM_LOAD32_WORD( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
+ ROM_REGION( 0x100000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
+ ROM_LOAD32_WORD_SWAP( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
- ROM_REGION( 0x400000, "k053244", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD32_WORD( "068a08.7k", 0x000000, 0x200000, CRC(c41278fe) SHA1(58e5f67a67ae97e0b264489828cd7e74662c5ed5) )
ROM_LOAD32_WORD( "068a07.3k", 0x000002, 0x200000, CRC(32efdbc4) SHA1(b7e8610aa22249176d82b750e2549d1eea6abe4f) )
@@ -367,11 +385,11 @@ ROM_START( asterixeaa )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "068_a05.5f", 0x000000, 0x010000, CRC(d3d0d77b) SHA1(bfa77a8bf651dc27f481e96a2d63242084cc214c) )
- ROM_REGION( 0x100000, "gfx1", 0 )
- ROM_LOAD32_WORD( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
- ROM_LOAD32_WORD( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
+ ROM_REGION( 0x100000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
+ ROM_LOAD32_WORD_SWAP( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
- ROM_REGION( 0x400000, "k053244", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD32_WORD( "068a08.7k", 0x000000, 0x200000, CRC(c41278fe) SHA1(58e5f67a67ae97e0b264489828cd7e74662c5ed5) )
ROM_LOAD32_WORD( "068a07.3k", 0x000002, 0x200000, CRC(32efdbc4) SHA1(b7e8610aa22249176d82b750e2549d1eea6abe4f) )
@@ -392,11 +410,11 @@ ROM_START( asterixaad )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "068_a05.5f", 0x000000, 0x010000, CRC(d3d0d77b) SHA1(bfa77a8bf651dc27f481e96a2d63242084cc214c) )
- ROM_REGION( 0x100000, "gfx1", 0 )
- ROM_LOAD32_WORD( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
- ROM_LOAD32_WORD( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
+ ROM_REGION( 0x100000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
+ ROM_LOAD32_WORD_SWAP( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
- ROM_REGION( 0x400000, "k053244", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD32_WORD( "068a08.7k", 0x000000, 0x200000, CRC(c41278fe) SHA1(58e5f67a67ae97e0b264489828cd7e74662c5ed5) )
ROM_LOAD32_WORD( "068a07.3k", 0x000002, 0x200000, CRC(32efdbc4) SHA1(b7e8610aa22249176d82b750e2549d1eea6abe4f) )
@@ -417,11 +435,11 @@ ROM_START( asterixj )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "068_a05.5f", 0x000000, 0x010000, CRC(d3d0d77b) SHA1(bfa77a8bf651dc27f481e96a2d63242084cc214c) )
- ROM_REGION( 0x100000, "gfx1", 0 )
- ROM_LOAD32_WORD( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
- ROM_LOAD32_WORD( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
+ ROM_REGION( 0x100000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "068a12.16k", 0x000000, 0x080000, CRC(b9da8e9c) SHA1(a46878916833923e421da0667e37620ae0b77744) )
+ ROM_LOAD32_WORD_SWAP( "068a11.12k", 0x000002, 0x080000, CRC(7eb07a81) SHA1(672c0c60834df7816d33d88643e4575b8ca9bcc1) )
- ROM_REGION( 0x400000, "k053244", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD32_WORD( "068a08.7k", 0x000000, 0x200000, CRC(c41278fe) SHA1(58e5f67a67ae97e0b264489828cd7e74662c5ed5) )
ROM_LOAD32_WORD( "068a07.3k", 0x000002, 0x200000, CRC(32efdbc4) SHA1(b7e8610aa22249176d82b750e2549d1eea6abe4f) )
@@ -435,9 +453,9 @@ ROM_END
DRIVER_INIT_MEMBER(asterix_state,asterix)
{
-#if 0
- *(uint16_t *)(memregion("maincpu")->base() + 0x07f34) = 0x602a;
- *(uint16_t *)(memregion("maincpu")->base() + 0x00008) = 0x0400;
+#if 1
+ *(u16 *)(memregion("maincpu")->base() + 0x07f34) = 0x602a;
+ *(u16 *)(memregion("maincpu")->base() + 0x00008) = 0x0400;
#endif
}
diff --git a/src/mame/drivers/bishi.cpp b/src/mame/drivers/bishi.cpp
index dd8cffbb047..40ac3b5c6ea 100644
--- a/src/mame/drivers/bishi.cpp
+++ b/src/mame/drivers/bishi.cpp
@@ -56,12 +56,13 @@ Notes:
675KAA07 to 10 - 27C240 EPROMs
Konami Custom ICs -
- 056143 (QFP160)
- 056832 (QFP144)
- 055555 (QFP240)
+ 058143 (QFP160) tilemap
+ 056832 (QFP144) tilemap
+ 055555 (QFP240) mixer
056879 (QFP144)
056232 (ceramic SIL14)
- 056820 (ceramic SIL13)
+ 056766 rgbi dac
+ 056820 (ceramic SIL13) analog level conditioner
Daughterboard
@@ -86,11 +87,88 @@ Notes:
***************************************************************************/
#include "emu.h"
-#include "includes/bishi.h"
#include "cpu/m68000/m68000.h"
+#include "screen.h"
#include "sound/ymz280b.h"
#include "speaker.h"
+#include "video/k054156_k054157_k056832.h"
+#include "video/k054338.h"
+#include "video/k055555.h"
+#include "video/konami_helper.h"
+
+#define CPU_CLOCK (XTAL_24MHz / 2) /* 68000 clock */
+#define SOUND_CLOCK XTAL_16_9344MHz /* YMZ280 clock */
+
+class bishi_state : public driver_device
+{
+public:
+ bishi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_tilemap(*this, "tilemap"),
+ m_blender(*this, "blender"),
+ m_mixer(*this, "mixer"),
+ m_palette(*this, "palette"),
+ m_screen(*this, "screen") { }
+
+ /* memory pointers */
+ uint8_t * m_ram;
+
+ /* misc */
+ uint16_t m_cur_control;
+ uint16_t m_cur_control2;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_audiocpu;
+ required_device<k058143_056832_device> m_tilemap;
+ required_device<k054338_device> m_blender;
+ required_device<k055555_device> m_mixer;
+ required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
+ DECLARE_READ16_MEMBER(control_r);
+ DECLARE_WRITE16_MEMBER(control_w);
+ DECLARE_WRITE16_MEMBER(control2_w);
+ DECLARE_READ16_MEMBER(bishi_mirror_r);
+ DECLARE_READ16_MEMBER(bishi_K056832_rom_r);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ TIMER_DEVICE_CALLBACK_MEMBER(bishi_scanline);
+
+ void fr_setup(flow_render::manager *manager);
+};
+
+
+void bishi_state::fr_setup(flow_render::manager *manager)
+{
+ auto rb = m_blender->flow_render_get_renderer();
+ auto rm = m_mixer ->flow_render_get_renderer();
+
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), rm->inp("a color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), rm->inp("b color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm->inp("c color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm->inp("d color"));
+
+ manager->set_constant(rm->inp("o color"), 0);
+ manager->set_constant(rm->inp("o attr"), 0);
+ manager->set_constant(rm->inp("s1 color"), 0);
+ manager->set_constant(rm->inp("s2 color"), 0);
+ manager->set_constant(rm->inp("s3 color"), 0);
+ manager->set_constant(rm->inp("s1 attr"), 0);
+ manager->set_constant(rm->inp("s2 attr"), 0);
+ manager->set_constant(rm->inp("s3 attr"), 0);
+
+ manager->connect(rm->out("0 color"), rb->inp("0 color"));
+ manager->connect(rm->out("1 color"), rb->inp("1 color"));
+
+ manager->connect(rm->out("0 attr"), rb->inp("0 attr"));
+ manager->connect(rm->out("1 attr"), rb->inp("1 attr"));
+
+ manager->connect(rb->out(), m_screen->flow_render_get_renderer()->inp());
+}
READ16_MEMBER(bishi_state::control_r)
@@ -102,12 +180,14 @@ WRITE16_MEMBER(bishi_state::control_w)
{
// bit 8 = interrupt gate
COMBINE_DATA(&m_cur_control);
+ logerror("ctrl1 %04x\n", m_cur_control);
}
WRITE16_MEMBER(bishi_state::control2_w)
{
// bit 12 = part of the banking calculation for the K056832 ROM readback
COMBINE_DATA(&m_cur_control2);
+ logerror("ctrl2 %04x\n", m_cur_control2);
}
TIMER_DEVICE_CALLBACK_MEMBER(bishi_state::bishi_scanline)
@@ -132,6 +212,7 @@ READ16_MEMBER(bishi_state::bishi_mirror_r)
READ16_MEMBER(bishi_state::bishi_K056832_rom_r)
{
+#if 0
uint16_t ouroffs;
ouroffs = (offset >> 1) * 8;
@@ -142,6 +223,8 @@ READ16_MEMBER(bishi_state::bishi_K056832_rom_r)
ouroffs += 4;
return m_k056832->bishi_rom_word_r(space, ouroffs, mem_mask);
+#endif
+ return 0;
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state )
@@ -153,15 +236,15 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, bishi_state )
AM_RANGE(0x800008, 0x800009) AM_READ_PORT("INPUTS")
AM_RANGE(0x810000, 0x810003) AM_WRITE(control2_w) // bank switch for K056832 character ROM test
AM_RANGE(0x820000, 0x820001) AM_WRITENOP // lamps (see lamp test in service menu)
- AM_RANGE(0x830000, 0x83003f) AM_DEVWRITE("k056832", k056832_device, word_w)
- AM_RANGE(0x840000, 0x840007) AM_DEVWRITE("k056832", k056832_device, b_word_w) // VSCCS
- AM_RANGE(0x850000, 0x85001f) AM_DEVWRITE("k054338", k054338_device, word_w) // CLTC
- AM_RANGE(0x870000, 0x8700ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w) // PCU2
+ AM_RANGE(0x830000, 0x83003f) AM_DEVICE("tilemap", k058143_056832_device, vacset)
+ AM_RANGE(0x840000, 0x840007) AM_DEVICE("tilemap", k058143_056832_device, vsccs)
+ AM_RANGE(0x850000, 0x85001f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x870000, 0x8700ff) AM_DEVICE8("mixer", k055555_device, map, 0x00ff)
AM_RANGE(0x880000, 0x880003) AM_DEVREADWRITE8("ymz", ymz280b_device, read, write, 0xff00)
- AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) // Graphic planes
+ AM_RANGE(0xa00000, 0xa07fff) AM_DEVREADWRITE("tilemap", k058143_056832_device, vram16_r, vram16_w)
AM_RANGE(0xb00000, 0xb03fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xb04000, 0xb047ff) AM_READ(bishi_mirror_r) // bug in the ram/rom test?
- AM_RANGE(0xc00000, 0xc01fff) AM_READ(bishi_K056832_rom_r)
+ AM_RANGE(0xc00000, 0xc01fff) AM_DEVREAD("tilemap", k058143_056832_device, rom16_r)
ADDRESS_MAP_END
static INPUT_PORTS_START( bishi )
@@ -388,22 +471,21 @@ static MACHINE_CONFIG_START( bishi )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1200))
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(29, 29+288-1, 16, 16+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(bishi_state, screen_update_bishi)
+ MCFG_SCREEN_FLOW_RENDER_RGB()
MCFG_PALETTE_ADD("palette", 4096)
MCFG_PALETTE_FORMAT(XBGR)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(bishi_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_FLOW_RENDER_MANAGER_ADD("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", bishi_state, fr_setup)
- MCFG_DEVICE_ADD("k054338", K054338, 0)
- // FP 201404: any reason why this is not connected to the k055555 below?
+ MCFG_K058143_056832_ADD("tilemap", XTAL_24MHz/4, 4, 1, 24)
+ MCFG_K058143_056832_DISABLE_VRC2()
- MCFG_K055555_ADD("k055555")
+ MCFG_DEVICE_ADD("blender", K054338, 0)
+ MCFG_K054338_PALETTE("palette")
+
+ MCFG_K055555_ADD("mixer")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -422,14 +504,11 @@ ROM_START( bishi )
ROM_LOAD16_WORD_SWAP( "575jaa05.12e", 0x000000, 0x80000, CRC(7d354567) SHA1(7fc11585693c91c0ef7a8e00df4f2f01b356210f) )
ROM_LOAD16_WORD_SWAP( "575jaa06.15e", 0x080000, 0x80000, CRC(9b2f7fbb) SHA1(26c828085c44a9c4d4e713e8fcc0bc8fc973d107) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD16_BYTE( "575jaa07.14n", 0x000000, 0x080000, CRC(37bbf387) SHA1(dcf7b151b865d251f3122611b6339dd84eb1f990) )
- ROM_LOAD16_BYTE( "575jaa08.17n", 0x000001, 0x080000, CRC(47ecd559) SHA1(7baac23557d40cccc21b93f181606563924244b0) )
- ROM_LOAD16_BYTE( "575jaa09.19n", 0x100000, 0x080000, CRC(c1db6e68) SHA1(e951661e3b39a83db21aed484764e032adcf3c2a) )
- ROM_LOAD16_BYTE( "575jaa10.22n", 0x100001, 0x080000, BAD_DUMP CRC(c8b145d6) SHA1(15cb3e4bebb999f1791fafa7a2ce3875a56991ff) ) // both halves identical (bad)
-
- // dummy region (game has no sprites, but we want to use the GX mixer)
- ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD( "575jaa07.14n", 0x000000, 0x080000, CRC(37bbf387) SHA1(dcf7b151b865d251f3122611b6339dd84eb1f990) )
+ ROM_LOAD32_WORD( "575jaa08.17n", 0x000002, 0x080000, CRC(47ecd559) SHA1(7baac23557d40cccc21b93f181606563924244b0) )
+ ROM_LOAD32_WORD( "575jaa09.19n", 0x100000, 0x080000, CRC(c1db6e68) SHA1(e951661e3b39a83db21aed484764e032adcf3c2a) )
+ ROM_LOAD32_WORD( "575jaa10.22n", 0x100002, 0x080000, BAD_DUMP CRC(c8b145d6) SHA1(15cb3e4bebb999f1791fafa7a2ce3875a56991ff) ) // both halves identical (bad)
ROM_REGION( 0x200000, "ymz", 0 )
ROM_LOAD( "575jaa01.2f", 0x000000, 0x080000, CRC(e1e9f7b2) SHA1(4da93e384a6018d829cbb02cfde98fc3662c5267) )
@@ -443,14 +522,11 @@ ROM_START( sbishi )
ROM_LOAD16_WORD_SWAP( "675jaa05.12e", 0x000000, 0x80000, CRC(28a09c01) SHA1(627f6c9b9e88434ff3198c778ae5c57d9cda82c5) )
ROM_LOAD16_WORD_SWAP( "675jaa06.15e", 0x080000, 0x80000, CRC(e4998b33) SHA1(3012f7661542b38b1a113c5c10e2729c6a37e709) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD16_BYTE( "675jaa07.14n", 0x000000, 0x080000, CRC(6fe7c658) SHA1(a786a417053a5fc62f967bdd564e8d3bdc89f958) )
- ROM_LOAD16_BYTE( "675jaa08.17n", 0x000001, 0x080000, CRC(c230afc9) SHA1(f23c64ed08e77960beb0f8db2605622a3887e5f8) )
- ROM_LOAD16_BYTE( "675jaa09.19n", 0x100000, 0x080000, CRC(63fe85a5) SHA1(e5ef1f3fc634264260d5fc3a669646abf1601b23) )
- ROM_LOAD16_BYTE( "675jaa10.22n", 0x100001, 0x080000, CRC(703ac462) SHA1(6dd05b2a78517a46b9ae8322c6b94bddbe91e848) )
-
- // dummy region (game has no sprites, but we want to use the GX mixer)
- ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD( "675jaa07.14n", 0x000000, 0x080000, CRC(6fe7c658) SHA1(a786a417053a5fc62f967bdd564e8d3bdc89f958) )
+ ROM_LOAD32_WORD( "675jaa08.17n", 0x000002, 0x080000, CRC(c230afc9) SHA1(f23c64ed08e77960beb0f8db2605622a3887e5f8) )
+ ROM_LOAD32_WORD( "675jaa09.19n", 0x100000, 0x080000, CRC(63fe85a5) SHA1(e5ef1f3fc634264260d5fc3a669646abf1601b23) )
+ ROM_LOAD32_WORD( "675jaa10.22n", 0x100002, 0x080000, CRC(703ac462) SHA1(6dd05b2a78517a46b9ae8322c6b94bddbe91e848) )
ROM_REGION( 0x200000, "ymz", 0 )
ROM_LOAD( "675jaa01.2f", 0x000000, 0x080000, CRC(67910b15) SHA1(6566e2344ebe9d61c584a1ab9ecbc8e7dd0a9a5b) )
@@ -464,14 +540,11 @@ ROM_START( sbishik )
ROM_LOAD16_WORD_SWAP( "kab05.12e", 0x000000, 0x80000, CRC(749063ca) SHA1(ef551132410248ef0b858fb8bcf6f8dd1115ad71) )
ROM_LOAD16_WORD_SWAP( "kab06.15e", 0x080000, 0x80000, CRC(089e0f37) SHA1(9cd64ebfab716bbaf0ba420ad8168a33601699a9) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD16_BYTE( "675kaa07.14n", 0x000000, 0x080000, CRC(1177c1f8) SHA1(42c6f3c3a6bd0adb7d927386fd99f1497e5df30c) )
- ROM_LOAD16_BYTE( "675kaa08.17n", 0x000001, 0x080000, CRC(7117e9cd) SHA1(5a9b4b7427edcc10725d5936869927874fef6463) )
- ROM_LOAD16_BYTE( "675kaa09.19n", 0x100000, 0x080000, CRC(8d49c765) SHA1(7921f8f3671fbbc3d5ea529234268a1e23ea622c) )
- ROM_LOAD16_BYTE( "675kaa10.22n", 0x100001, 0x080000, CRC(c16acf32) SHA1(df3eeb5ab3bab8e707eaa79ffc500e1dc2332a82) )
-
- // dummy region (game has no sprites, but we want to use the GX mixer)
- ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD( "675kaa07.14n", 0x000000, 0x080000, CRC(1177c1f8) SHA1(42c6f3c3a6bd0adb7d927386fd99f1497e5df30c) )
+ ROM_LOAD32_WORD( "675kaa08.17n", 0x000002, 0x080000, CRC(7117e9cd) SHA1(5a9b4b7427edcc10725d5936869927874fef6463) )
+ ROM_LOAD32_WORD( "675kaa09.19n", 0x100000, 0x080000, CRC(8d49c765) SHA1(7921f8f3671fbbc3d5ea529234268a1e23ea622c) )
+ ROM_LOAD32_WORD( "675kaa10.22n", 0x100002, 0x080000, CRC(c16acf32) SHA1(df3eeb5ab3bab8e707eaa79ffc500e1dc2332a82) )
ROM_REGION( 0x200000, "ymz", 0 )
ROM_LOAD( "675kaa01.2f", 0x000000, 0x080000, CRC(73ac6ae6) SHA1(37e4722647a13275c5f51d2bfa50df3e12ea1ebf) )
@@ -486,14 +559,11 @@ ROM_START( sbishika )
ROM_LOAD16_WORD_SWAP( "675kaa05.12e", 0x000000, 0x80000, CRC(23600e1d) SHA1(b3224c84e41e3077425a60232bb91775107f37a8) )
ROM_LOAD16_WORD_SWAP( "675kaa06.15e", 0x080000, 0x80000, CRC(bd1091f5) SHA1(29872abc49fe8209d0f414ca40a34fc494ff9b96) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD16_BYTE( "675kaa07.14n", 0x000000, 0x080000, CRC(1177c1f8) SHA1(42c6f3c3a6bd0adb7d927386fd99f1497e5df30c) )
- ROM_LOAD16_BYTE( "675kaa08.17n", 0x000001, 0x080000, CRC(7117e9cd) SHA1(5a9b4b7427edcc10725d5936869927874fef6463) )
- ROM_LOAD16_BYTE( "675kaa09.19n", 0x100000, 0x080000, CRC(8d49c765) SHA1(7921f8f3671fbbc3d5ea529234268a1e23ea622c) )
- ROM_LOAD16_BYTE( "675kaa10.22n", 0x100001, 0x080000, CRC(c16acf32) SHA1(df3eeb5ab3bab8e707eaa79ffc500e1dc2332a82) )
-
- // dummy region (game has no sprites, but we want to use the GX mixer)
- ROM_REGION( 0x80000, "gfx2", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD( "675kaa07.14n", 0x000000, 0x080000, CRC(1177c1f8) SHA1(42c6f3c3a6bd0adb7d927386fd99f1497e5df30c) )
+ ROM_LOAD32_WORD( "675kaa08.17n", 0x000002, 0x080000, CRC(7117e9cd) SHA1(5a9b4b7427edcc10725d5936869927874fef6463) )
+ ROM_LOAD32_WORD( "675kaa09.19n", 0x100000, 0x080000, CRC(8d49c765) SHA1(7921f8f3671fbbc3d5ea529234268a1e23ea622c) )
+ ROM_LOAD32_WORD( "675kaa10.22n", 0x100002, 0x080000, CRC(c16acf32) SHA1(df3eeb5ab3bab8e707eaa79ffc500e1dc2332a82) )
ROM_REGION( 0x200000, "ymz", 0 )
ROM_LOAD( "675kaa01.2f", 0x000000, 0x080000, CRC(73ac6ae6) SHA1(37e4722647a13275c5f51d2bfa50df3e12ea1ebf) )
diff --git a/src/mame/drivers/bottom9.cpp b/src/mame/drivers/bottom9.cpp
index 2979c91f8a2..4e55d29161f 100644
--- a/src/mame/drivers/bottom9.cpp
+++ b/src/mame/drivers/bottom9.cpp
@@ -15,15 +15,127 @@
***************************************************************************/
#include "emu.h"
-#include "includes/bottom9.h"
-#include "includes/konamipt.h"
-#include "cpu/z80/z80.h"
#include "cpu/m6809/m6809.h"
+#include "cpu/z80/z80.h"
+#include "includes/konamipt.h"
#include "machine/gen_latch.h"
#include "machine/watchdog.h"
+#include "sound/k007232.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/k051960.h"
+#include "video/k052109.h"
+#include "video/konami_helper.h"
+
+class bottom9_state : public driver_device
+{
+public:
+ bottom9_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_k007232_1(*this, "k007232_1"),
+ m_k007232_2(*this, "k007232_2"),
+ m_k052109(*this, "k052109"),
+ m_k051960(*this, "k051960"),
+ m_roz(*this, "roz"),
+ m_palette(*this, "palette") { }
+
+ /* misc */
+ int m_video_enable;
+ int m_zoomreadroms;
+ int m_k052109_selected;
+ int m_nmienable;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k007232_device> m_k007232_1;
+ required_device<k007232_device> m_k007232_2;
+ required_device<k052109_device> m_k052109;
+ required_device<k051960_device> m_k051960;
+ required_device<k051316_device> m_roz;
+ required_device<palette_device> m_palette;
+ DECLARE_READ8_MEMBER(k052109_051960_r);
+ DECLARE_WRITE8_MEMBER(k052109_051960_w);
+ DECLARE_READ8_MEMBER(bottom9_bankedram1_r);
+ DECLARE_WRITE8_MEMBER(bottom9_bankedram1_w);
+ DECLARE_READ8_MEMBER(bottom9_bankedram2_r);
+ DECLARE_WRITE8_MEMBER(bottom9_bankedram2_w);
+ DECLARE_WRITE8_MEMBER(bankswitch_w);
+ DECLARE_WRITE8_MEMBER(bottom9_1f90_w);
+ DECLARE_WRITE8_MEMBER(bottom9_sh_irqtrigger_w);
+ DECLARE_WRITE8_MEMBER(nmi_enable_w);
+ DECLARE_WRITE8_MEMBER(sound_bank_w);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ uint32_t screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(bottom9_interrupt);
+ INTERRUPT_GEN_MEMBER(bottom9_sound_interrupt);
+ DECLARE_WRITE8_MEMBER(volume_callback0);
+ DECLARE_WRITE8_MEMBER(volume_callback1);
+ K052109_CB_MEMBER(tile_callback);
+ K051960_CB_MEMBER(sprite_callback);
+};
+
+/***************************************************************************
+
+ Callbacks for the K052109
+
+***************************************************************************/
+
+static const int layer_colorbase[] = { 0 / 16, 0 / 16, 256 / 16 };
+
+K052109_CB_MEMBER(bottom9_state::tile_callback)
+{
+ *code |= (*color & 0x3f) << 8;
+ *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6);
+}
+
+
+/***************************************************************************
+
+ Callbacks for the K051960
+***************************************************************************/
+
+K051960_CB_MEMBER(bottom9_state::sprite_callback)
+{
+ enum { sprite_colorbase = 512 / 16 };
+
+ /* bit 4 = priority over zoom (0 = have priority) */
+ /* bit 5 = priority over B (1 = have priority) */
+ *priority = 0;
+ if ( *color & 0x10) *priority |= GFX_PMASK_1;
+ if (~*color & 0x20) *priority |= GFX_PMASK_2;
+
+ *color = sprite_colorbase + (*color & 0x0f);
+}
+
+/***************************************************************************
+
+ Display refresh
+
+***************************************************************************/
+
+uint32_t bottom9_state::screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ m_k052109->tilemap_update();
+
+ /* note: FIX layer is not used */
+ bitmap.fill(layer_colorbase[1], cliprect);
+ screen.priority().fill(0, cliprect);
+
+// if (m_video_enable)
+ {
+ // m_roz->zoom_draw(screen, bitmap, cliprect, 0, 1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0);
+ }
+ return 0;
+}
INTERRUPT_GEN_MEMBER(bottom9_state::bottom9_interrupt)
{
@@ -63,9 +175,9 @@ READ8_MEMBER(bottom9_state::bottom9_bankedram1_r)
else
{
if (m_zoomreadroms)
- return m_k051316->rom_r(space, offset);
+ return m_roz->rom_r(space, offset);
else
- return m_k051316->read(space, offset);
+ return m_roz->vram_r(space, offset);
}
}
@@ -74,7 +186,7 @@ WRITE8_MEMBER(bottom9_state::bottom9_bankedram1_w)
if (m_k052109_selected)
k052109_051960_w(space, offset, data);
else
- m_k051316->write(space, offset, data);
+ m_roz->vram_w(space, offset, data);
}
READ8_MEMBER(bottom9_state::bottom9_bankedram2_r)
@@ -171,7 +283,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, bottom9_state )
AM_RANGE(0x1fd2, 0x1fd2) AM_READ_PORT("P2")
AM_RANGE(0x1fd3, 0x1fd3) AM_READ_PORT("DSW1")
AM_RANGE(0x1fe0, 0x1fe0) AM_READ_PORT("DSW2")
- AM_RANGE(0x1ff0, 0x1fff) AM_DEVWRITE("k051316", k051316_device, ctrl_w)
+ AM_RANGE(0x1ff0, 0x1fff) AM_DEVICE("roz", k051316_device, map)
AM_RANGE(0x2000, 0x27ff) AM_READWRITE(bottom9_bankedram2_r, bottom9_bankedram2_w) AM_SHARE("palette")
AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w)
AM_RANGE(0x4000, 0x5fff) AM_RAM
@@ -333,9 +445,7 @@ static MACHINE_CONFIG_START( bottom9 )
MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(bottom9_state, sprite_callback)
- MCFG_DEVICE_ADD("k051316", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_CB(bottom9_state, zoom_callback)
+ MCFG_K051316_ADD("roz", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = (address & 0x3c0000) >> 14; })
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/chqflag.cpp b/src/mame/drivers/chqflag.cpp
index e5197879165..832ee5b4cca 100644
--- a/src/mame/drivers/chqflag.cpp
+++ b/src/mame/drivers/chqflag.cpp
@@ -15,33 +15,119 @@
***************************************************************************/
#include "emu.h"
-#include "includes/chqflag.h"
-#include "includes/konamipt.h"
-#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h"
+#include "cpu/z80/z80.h"
+#include "includes/konamipt.h"
+#include "machine/bankdev.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
+#include "sound/k007232.h"
#include "sound/ym2151.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/k051733.h"
+#include "video/k051960.h"
+#include "video/konami_helper.h"
#include "chqflag.lh"
+class chqflag_state : public driver_device
+{
+public:
+ chqflag_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_bank1000(*this, "bank1000"),
+ m_k007232_1(*this, "k007232_1"),
+ m_k007232_2(*this, "k007232_2"),
+ m_k051960(*this, "k051960"),
+ m_roz_1(*this, "k051316_1"),
+ m_roz_2(*this, "k051316_2"),
+ m_palette(*this, "palette"),
+ m_soundlatch2(*this, "soundlatch2"),
+ m_rombank(*this, "rombank") { }
+
+ /* misc */
+ int m_roz_readroms;
+ int m_last_vreg;
+ int m_analog_ctrl;
+ int m_accel;
+ int m_wheel;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<address_map_bank_device> m_bank1000;
+ required_device<k007232_device> m_k007232_1;
+ required_device<k007232_device> m_k007232_2;
+ required_device<k051960_device> m_k051960;
+ required_device<k051316_device> m_roz_1;
+ required_device<k051316_device> m_roz_2;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch2;
+
+ /* memory pointers */
+ required_memory_bank m_rombank;
+
+ DECLARE_READ8_MEMBER(roz_1_ramrom_r);
+ DECLARE_READ8_MEMBER(roz_2_ramrom_r);
+ DECLARE_WRITE8_MEMBER(chqflag_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(chqflag_vreg_w);
+ DECLARE_WRITE8_MEMBER(select_analog_ctrl_w);
+ DECLARE_READ8_MEMBER(analog_read_r);
+ DECLARE_WRITE8_MEMBER(chqflag_sh_irqtrigger_w);
+ DECLARE_WRITE8_MEMBER(k007232_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(k007232_extvolume_w);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ uint32_t screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE8_MEMBER(volume_callback0);
+ DECLARE_WRITE8_MEMBER(volume_callback1);
+ K051960_CB_MEMBER(sprite_callback);
+};
+
+/***************************************************************************
+
+ Callbacks for the K051960
+
+***************************************************************************/
+
+K051960_CB_MEMBER(chqflag_state::sprite_callback)
+{
+ enum { sprite_colorbase = 0 };
+
+ *priority = (*color & 0x10) ? 0 : GFX_PMASK_1;
+ *color = sprite_colorbase + (*color & 0x0f);
+}
+
+uint32_t chqflag_state::screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ screen.priority().fill(0, cliprect);
+
+ // m_roz_2->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
+ // m_roz_2->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1);
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
+ // m_roz_1->zoom_draw(screen, bitmap, cliprect, 0, 0);
+ return 0;
+}
/* these trampolines are less confusing than nested address_map_bank_devices */
-READ8_MEMBER(chqflag_state::k051316_1_ramrom_r)
+READ8_MEMBER(chqflag_state::roz_1_ramrom_r)
{
- if (m_k051316_readroms)
- return m_k051316_1->rom_r(space, offset);
+ if (m_roz_readroms)
+ return m_roz_1->rom_r(space, offset);
else
- return m_k051316_1->read(space, offset);
+ return m_roz_1->vram_r(space, offset);
}
-READ8_MEMBER(chqflag_state::k051316_2_ramrom_r)
+READ8_MEMBER(chqflag_state::roz_2_ramrom_r)
{
- if (m_k051316_readroms)
- return m_k051316_2->rom_r(space, offset);
+ if (m_roz_readroms)
+ return m_roz_2->rom_r(space, offset);
else
- return m_k051316_2->read(space, offset);
+ return m_roz_2->vram_r(space, offset);
}
WRITE8_MEMBER(chqflag_state::chqflag_bankswitch_w)
@@ -64,7 +150,7 @@ WRITE8_MEMBER(chqflag_state::chqflag_vreg_w)
machine().bookkeeping().coin_counter_w(0, data & 0x02);
/* bit 4 = enable rom reading through K051316 #1 & #2 */
- m_k051316_readroms = (data & 0x10);
+ m_roz_readroms = (data & 0x10);
/* Bits 3-7 probably control palette dimming in a similar way to TMNT2/Sunset Riders, */
/* however I don't have enough evidence to determine the exact behaviour. */
@@ -127,7 +213,7 @@ static ADDRESS_MAP_START( chqflag_map, AS_PROGRAM, 8, chqflag_state )
AM_RANGE(0x1000, 0x1fff) AM_DEVICE("bank1000", address_map_bank_device, amap8)
AM_RANGE(0x2000, 0x2007) AM_DEVREADWRITE("k051960", k051960_device, k051937_r, k051937_w) /* Sprite control registers */
AM_RANGE(0x2400, 0x27ff) AM_DEVREADWRITE("k051960", k051960_device, k051960_r, k051960_w) /* Sprite RAM */
- AM_RANGE(0x2800, 0x2fff) AM_READ(k051316_2_ramrom_r) AM_DEVWRITE("k051316_2", k051316_device, write) /* 051316 zoom/rotation (chip 2) */
+ AM_RANGE(0x2800, 0x2fff) AM_READ(roz_2_ramrom_r) AM_DEVWRITE("k051316_2", k051316_device, vram_w) /* 051316 zoom/rotation (chip 2) */
AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("soundlatch", generic_latch_8_device, write) /* sound code # */
AM_RANGE(0x3001, 0x3001) AM_WRITE(chqflag_sh_irqtrigger_w) /* cause interrupt on audio CPU */
AM_RANGE(0x3002, 0x3002) AM_WRITE(chqflag_bankswitch_w) /* bankswitch control */
@@ -138,8 +224,8 @@ static ADDRESS_MAP_START( chqflag_map, AS_PROGRAM, 8, chqflag_state )
AM_RANGE(0x3203, 0x3203) AM_READ_PORT("DSW2") /* DIPSW #2 */
AM_RANGE(0x3300, 0x3300) AM_DEVWRITE("watchdog", watchdog_timer_device, reset_w) /* watchdog timer */
AM_RANGE(0x3400, 0x341f) AM_DEVREADWRITE("k051733", k051733_device, read, write) /* 051733 (protection) */
- AM_RANGE(0x3500, 0x350f) AM_DEVWRITE("k051316_1", k051316_device, ctrl_w) /* 051316 control registers (chip 1) */
- AM_RANGE(0x3600, 0x360f) AM_DEVWRITE("k051316_2", k051316_device, ctrl_w) /* 051316 control registers (chip 2) */
+ AM_RANGE(0x3500, 0x350f) AM_DEVICE("roz_1", k051316_device, map) /* 051316 control registers (chip 1) */
+ AM_RANGE(0x3600, 0x360f) AM_DEVICE("roz_2", k051316_device, map) /* 051316 control registers (chip 2) */
AM_RANGE(0x3700, 0x3700) AM_WRITE(select_analog_ctrl_w) /* select accelerator/wheel */
AM_RANGE(0x3701, 0x3701) AM_READ_PORT("IN2") /* Brake + Shift + ? */
AM_RANGE(0x3702, 0x3702) AM_READWRITE(analog_read_r, select_analog_ctrl_w) /* accelerator/wheel */
@@ -149,7 +235,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bank1000_map, AS_PROGRAM, 8, chqflag_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
- AM_RANGE(0x1000, 0x17ff) AM_READ(k051316_1_ramrom_r) AM_DEVWRITE("k051316_1", k051316_device, write)
+ AM_RANGE(0x1000, 0x17ff) AM_READ(roz_1_ramrom_r) AM_DEVWRITE("roz_1", k051316_device, vram_w)
AM_RANGE(0x1800, 0x1fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END
@@ -272,7 +358,7 @@ void chqflag_state::machine_start()
{
m_rombank->configure_entries(0, 0x50000 / 0x4000, memregion("maincpu")->base(), 0x4000);
- save_item(NAME(m_k051316_readroms));
+ save_item(NAME(m_roz_readroms));
save_item(NAME(m_last_vreg));
save_item(NAME(m_analog_ctrl));
save_item(NAME(m_accel));
@@ -281,7 +367,7 @@ void chqflag_state::machine_start()
void chqflag_state::machine_reset()
{
- m_k051316_readroms = 0;
+ m_roz_readroms = 0;
m_last_vreg = 0;
m_analog_ctrl = 0;
m_accel = 0;
@@ -327,17 +413,8 @@ static MACHINE_CONFIG_START( chqflag )
MCFG_K051960_IRQ_HANDLER(INPUTLINE("maincpu", KONAMI_IRQ_LINE))
MCFG_K051960_NMI_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
- MCFG_DEVICE_ADD("k051316_1", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(7, 0)
- MCFG_K051316_CB(chqflag_state, zoom_callback_1)
-
- MCFG_DEVICE_ADD("k051316_2", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_BPP(8)
- MCFG_K051316_LAYER_MASK(0xc0)
- MCFG_K051316_WRAP(1)
- MCFG_K051316_CB(chqflag_state, zoom_callback_2)
+ MCFG_K051316_ADD("roz_1", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = (address & 0x3c0000) >> 14; })
+ MCFG_K051316_ADD("roz_2", 8, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x0fffff; color = (address & 0x100000) >> 12; })
MCFG_K051733_ADD("k051733")
diff --git a/src/mame/drivers/dbz.cpp b/src/mame/drivers/dbz.cpp
index e51979e3d70..3df0b23f867 100644
--- a/src/mame/drivers/dbz.cpp
+++ b/src/mame/drivers/dbz.cpp
@@ -61,7 +61,7 @@ Notes:
#include "sound/okim6295.h"
#include "speaker.h"
-
+#if 0
TIMER_DEVICE_CALLBACK_MEMBER(dbz_state::dbz_scanline)
{
int scanline = param;
@@ -73,7 +73,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(dbz_state::dbz_scanline)
m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); //auto-acks apparently
}
-#if 0
READ16_MEMBER(dbz_state::dbzcontrol_r)
{
return m_control;
@@ -86,10 +85,7 @@ WRITE16_MEMBER(dbz_state::dbzcontrol_w)
COMBINE_DATA(&m_control);
- if (data & 0x400)
- m_k053246->k053246_set_objcha_line( ASSERT_LINE);
- else
- m_k053246->k053246_set_objcha_line( CLEAR_LINE);
+ m_sprites->set_objcha(data & 0x400);
machine().bookkeeping().coin_counter_w(0, data & 1);
machine().bookkeeping().coin_counter_w(1, data & 2);
@@ -105,21 +101,30 @@ WRITE16_MEMBER(dbz_state::dbz_sound_cause_nmi)
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
+WRITE16_MEMBER(dbz_state::dbz_bg2_videoram_w)
+{
+ COMBINE_DATA(&m_bg2_videoram[offset]);
+ m_bg2_tilemap->mark_tile_dirty(offset / 2);
+}
+
+WRITE16_MEMBER(dbz_state::dbz_bg1_videoram_w)
+{
+ COMBINE_DATA(&m_bg1_videoram[offset]);
+ m_bg1_tilemap->mark_tile_dirty(offset / 2);
+}
static ADDRESS_MAP_START( dbz_map, AS_PROGRAM, 16, dbz_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x480000, 0x48ffff) AM_RAM
- AM_RANGE(0x490000, 0x491fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) // '157 RAM is mirrored twice
- AM_RANGE(0x492000, 0x493fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w)
- AM_RANGE(0x498000, 0x49ffff) AM_DEVREAD("k056832", k056832_device, rom_word_8000_r) // code near a60 in dbz2, subroutine at 730 in dbz
- AM_RANGE(0x4a0000, 0x4a0fff) AM_DEVREADWRITE("k053246", k053247_device, k053247_word_r, k053247_word_w)
+ AM_RANGE(0x490000, 0x491fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x498000, 0x49ffff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r) // code near a60 in dbz2, subroutine at 730 in dbz
+ AM_RANGE(0x4a0000, 0x4a0fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x4a1000, 0x4a3fff) AM_RAM
AM_RANGE(0x4a8000, 0x4abfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // palette
- AM_RANGE(0x4c0000, 0x4c0001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
- AM_RANGE(0x4c0000, 0x4c0007) AM_DEVWRITE("k053246", k053247_device, k053246_word_w)
- AM_RANGE(0x4c4000, 0x4c4007) AM_DEVWRITE("k053246", k053247_device, k053246_word_w)
- AM_RANGE(0x4c8000, 0x4c8007) AM_DEVWRITE("k056832", k056832_device, b_word_w)
- AM_RANGE(0x4cc000, 0x4cc03f) AM_DEVWRITE("k056832", k056832_device, word_w)
+ AM_RANGE(0x4c0000, 0x4c0001) AM_DEVREAD("sprites", k053246_053247_device, rom16_r)
+ AM_RANGE(0x4c0000, 0x4c0007) AM_MIRROR(0x4000) AM_DEVICE("sprites", k053246_053247_device, objset1)
+ AM_RANGE(0x4c8000, 0x4c8007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
+ AM_RANGE(0x4cc000, 0x4cc03f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
AM_RANGE(0x4d0000, 0x4d001f) AM_DEVWRITE("k053936_1", k053936_device, ctrl_w)
AM_RANGE(0x4d4000, 0x4d401f) AM_DEVWRITE("k053936_2", k053936_device, ctrl_w)
AM_RANGE(0x4e0000, 0x4e0001) AM_READ_PORT("P1_P2")
@@ -129,8 +134,8 @@ static ADDRESS_MAP_START( dbz_map, AS_PROGRAM, 16, dbz_state )
AM_RANGE(0x4ec000, 0x4ec001) AM_WRITE(dbzcontrol_w)
AM_RANGE(0x4f0000, 0x4f0001) AM_WRITE(dbz_sound_command_w)
AM_RANGE(0x4f4000, 0x4f4001) AM_WRITE(dbz_sound_cause_nmi)
- AM_RANGE(0x4f8000, 0x4f801f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0xff00) // 251 #1
- AM_RANGE(0x4fc000, 0x4fc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w) // 251 #2
+ AM_RANGE(0x4f8000, 0x4f801f) AM_DEVICE8("video_timings", k053252_device, map, 0xff00)
+ AM_RANGE(0x4fc000, 0x4fc01f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(dbz_bg2_videoram_w) AM_SHARE("bg2_videoram")
AM_RANGE(0x508000, 0x509fff) AM_RAM_WRITE(dbz_bg1_videoram_w) AM_SHARE("bg1_videoram")
@@ -325,7 +330,7 @@ static MACHINE_CONFIG_START( dbz )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000)
MCFG_CPU_PROGRAM_MAP(dbz_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dbz_state, dbz_scanline, "screen", 0, 1)
+// MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dbz_state, dbz_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(dbz_sound_map)
@@ -337,7 +342,7 @@ static MACHINE_CONFIG_START( dbz )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 40*8)
MCFG_SCREEN_VISIBLE_AREA(0, 48*8-1, 0, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(dbz_state, screen_update_dbz)
+// MCFG_SCREEN_UPDATE_DRIVER(dbz_state, screen_update_dbz)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", dbz)
@@ -346,17 +351,11 @@ static MACHINE_CONFIG_START( dbz )
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(dbz_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 1, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_K054156_054157_ADD("tilemap", 8000000, 8, 8, 24)
- MCFG_DEVICE_ADD("k053246", K053246, 0)
- MCFG_K053246_CB(dbz_state, sprite_callback)
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -87, 32) // or -52, 16?
- MCFG_K053246_PALETTE("palette")
+ MCFG_K053246_053247_ADD("sprites", 8000000, "spriteram")
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("mixer", 0)
MCFG_DEVICE_ADD("k053936_1", K053936, 0)
MCFG_K053936_WRAP(1)
@@ -366,8 +365,8 @@ static MACHINE_CONFIG_START( dbz )
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(-46, -16)
- MCFG_DEVICE_ADD("k053252", K053252, 16000000/2)
- MCFG_K053252_INT1_ACK_CB(WRITELINE(dbz_state, dbz_irq2_ack_w))
+ MCFG_DEVICE_ADD("video_timings", K053252, 16000000/2)
+// MCFG_K053252_INT1_ACK_CB(WRITELINE(dbz_state, dbz_irq2_ack_w))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -397,12 +396,12 @@ ROM_START( dbz )
ROM_LOAD("222a10.5e", 0x000000, 0x08000, CRC(1c93e30a) SHA1(8545a0ac5126b3c855e1901b186f57820699895d) )
/* tiles */
- ROM_REGION( 0x400000, "gfx1", 0)
+ ROM_REGION( 0x400000, "tilemap", 0)
ROM_LOAD32_WORD( "222a01.27c", 0x000000, 0x200000, CRC(9fce4ed4) SHA1(81e19375b351ee247f066434dd595149333d73c5) )
ROM_LOAD32_WORD( "222a02.27e", 0x000002, 0x200000, CRC(651acaa5) SHA1(33942a90fb294b5da6a48e5bfb741b31babca188) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "222a04.3j", 0x000000, 0x200000, CRC(2533b95a) SHA1(35910836b6030130d742eae6c4bf1cdf1ff43fa4) )
ROM_LOAD64_WORD( "222a05.1j", 0x000002, 0x200000, CRC(731b7f93) SHA1(b676fff2ede5aa72c49fe12736cd60766462fe0b) )
ROM_LOAD64_WORD( "222a06.3l", 0x000004, 0x200000, CRC(97b767d3) SHA1(3d879c431586da2f88c632ab1a531b4a5ec96939) )
@@ -432,12 +431,12 @@ ROM_START( dbza )
ROM_LOAD("222a10.5e", 0x000000, 0x08000, CRC(1c93e30a) SHA1(8545a0ac5126b3c855e1901b186f57820699895d) )
/* tiles */
- ROM_REGION( 0x400000, "gfx1", 0)
+ ROM_REGION( 0x400000, "tilemap", 0)
ROM_LOAD32_WORD( "222a01.27c", 0x000000, 0x200000, CRC(9fce4ed4) SHA1(81e19375b351ee247f066434dd595149333d73c5) )
ROM_LOAD32_WORD( "222a02.27e", 0x000002, 0x200000, CRC(651acaa5) SHA1(33942a90fb294b5da6a48e5bfb741b31babca188) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "222a04.3j", 0x000000, 0x200000, CRC(2533b95a) SHA1(35910836b6030130d742eae6c4bf1cdf1ff43fa4) )
ROM_LOAD64_WORD( "222a05.1j", 0x000002, 0x200000, CRC(731b7f93) SHA1(b676fff2ede5aa72c49fe12736cd60766462fe0b) )
ROM_LOAD64_WORD( "222a06.3l", 0x000004, 0x200000, CRC(97b767d3) SHA1(3d879c431586da2f88c632ab1a531b4a5ec96939) )
@@ -467,12 +466,12 @@ ROM_START( dbz2 )
ROM_LOAD("s-001.5e", 0x000000, 0x08000, CRC(154e6d03) SHA1(db15c20982692271f40a733dfc3f2486221cd604) )
/* tiles */
- ROM_REGION( 0x400000, "gfx1", 0)
+ ROM_REGION( 0x400000, "tilemap", 0)
ROM_LOAD32_WORD( "ds-b01.27c", 0x000000, 0x200000, CRC(8dc39972) SHA1(c6e3d4e0ff069e08bdb68e2b0ad24cc7314e4e93) )
ROM_LOAD32_WORD( "ds-b02.27e", 0x000002, 0x200000, CRC(7552f8cd) SHA1(1f3beffe9733b1a18d44b5e8880ff1cc97e7a8ab) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "ds-o01.3j", 0x000000, 0x200000, CRC(d018531f) SHA1(d4082fe28e9f1f3f35aa75b4be650cadf1cef192) )
ROM_LOAD64_WORD( "ds-o02.1j", 0x000002, 0x200000, CRC(5a0f1ebe) SHA1(3bb9e1389299dc046a24740ef1a1c543e44b5c37) )
ROM_LOAD64_WORD( "ds-o03.3l", 0x000004, 0x200000, CRC(ddc3bef1) SHA1(69638ef53f627a238a12b6c206d57faadf894893) )
diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp
index bb1bcfd65e1..64b6cdcc2ca 100644
--- a/src/mame/drivers/divebomb.cpp
+++ b/src/mame/drivers/divebomb.cpp
@@ -91,9 +91,258 @@ To verify against original HW:
****************************************************************************/
#include "emu.h"
-#include "includes/divebomb.h"
+
+#include "cpu/z80/z80.h"
#include "screen.h"
+#include "sound/sn76496.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/resnet.h"
+
+#define XTAL1 XTAL_24MHz
+
+class divebomb_state : public driver_device
+{
+public:
+ divebomb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_spritecpu(*this, "spritecpu"),
+ m_fgcpu(*this, "fgcpu"),
+ m_rozcpucpu(*this, "rozcpu"),
+ m_bank1(*this, "bank1"),
+ m_fgram(*this, "fgram"),
+ m_spriteram(*this, "spriteram"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
+ m_roz_1(*this, "roz_1"),
+ m_roz_2(*this, "roz_2")
+ { }
+
+ required_device<cpu_device> m_spritecpu;
+ required_device<cpu_device> m_fgcpu;
+ required_device<cpu_device> m_rozcpucpu;
+ required_memory_bank m_bank1;
+ required_shared_ptr<uint8_t> m_fgram;
+ required_shared_ptr<uint8_t> m_spriteram;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<k051316_device> m_roz_1;
+ required_device<k051316_device> m_roz_2;
+
+ tilemap_t *m_fg_tilemap;
+ uint8_t to_spritecpu;
+ uint8_t to_rozcpu;
+ uint8_t from_sprite;
+ uint8_t from_roz;
+ bool has_fromsprite;
+ bool has_fromroz;
+
+ uint8_t roz_pal;
+ bool roz1_enable;
+ bool roz2_enable;
+ bool roz1_wrap;
+ bool roz2_wrap;
+
+ DECLARE_MACHINE_RESET(divebomb);
+ DECLARE_MACHINE_START(divebomb);
+ DECLARE_VIDEO_START(divebomb);
+ DECLARE_PALETTE_INIT(divebomb);
+
+ void update_irqs();
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void decode_proms(const uint8_t* rgn, int size, int index, bool inv);
+ uint32_t screen_update_divebomb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ TILE_GET_INFO_MEMBER(get_fg_tile_info);
+
+ DECLARE_READ8_MEMBER(fgcpu_roz_comm_r);
+ DECLARE_WRITE8_MEMBER(fgcpu_roz_comm_w);
+ DECLARE_READ8_MEMBER(fgcpu_spr_comm_r);
+ DECLARE_WRITE8_MEMBER(fgcpu_spr_comm_w);
+ DECLARE_READ8_MEMBER(fgcpu_comm_flags_r);
+ DECLARE_WRITE8_MEMBER(fgram_w);
+
+ DECLARE_WRITE8_MEMBER(spritecpu_port00_w);
+ DECLARE_READ8_MEMBER(spritecpu_comm_r);
+ DECLARE_WRITE8_MEMBER(spritecpu_comm_w);
+
+ DECLARE_WRITE8_MEMBER(rozcpu_bank_w);
+ DECLARE_WRITE8_MEMBER(rozcpu_wrap1_enable_w);
+ DECLARE_WRITE8_MEMBER(rozcpu_enable1_w);
+ DECLARE_WRITE8_MEMBER(rozcpu_enable2_w);
+ DECLARE_WRITE8_MEMBER(rozcpu_wrap2_enable_w);
+ DECLARE_READ8_MEMBER(rozcpu_comm_r);
+ DECLARE_WRITE8_MEMBER(rozcpu_comm_w);
+ DECLARE_WRITE8_MEMBER(rozcpu_pal_w);
+};
+
+
+/*************************************
+ *
+ * Tilemap callbacks
+ *
+ *************************************/
+
+TILE_GET_INFO_MEMBER(divebomb_state::get_fg_tile_info)
+{
+ uint32_t code = m_fgram[tile_index + 0x000];
+ uint32_t attr = m_fgram[tile_index + 0x400];
+ uint32_t colour = attr >> 4;
+
+ code |= (attr & 0x3) << 8;
+
+ SET_TILE_INFO_MEMBER(0, code, colour, 0);
+}
+
+WRITE8_MEMBER(divebomb_state::fgram_w)
+{
+ m_fgram[offset] = data;
+ m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
+}
+
+
+WRITE8_MEMBER(divebomb_state::rozcpu_wrap1_enable_w)
+{
+ roz1_wrap = !(data & 1);
+
+}
+
+
+WRITE8_MEMBER(divebomb_state::rozcpu_enable1_w)
+{
+ roz1_enable = !(data & 1);
+}
+
+
+WRITE8_MEMBER(divebomb_state::rozcpu_enable2_w)
+{
+ roz2_enable = !(data & 1);
+}
+
+
+WRITE8_MEMBER(divebomb_state::rozcpu_wrap2_enable_w)
+{
+ roz2_wrap = !(data & 1);
+}
+
+
+WRITE8_MEMBER(divebomb_state::rozcpu_pal_w)
+{
+ //.... ..xx K051316 1 palette select
+ //..xx .... K051316 2 palette select
+
+ roz_pal = data;
+
+ if (data & 0xcc)
+ logerror("rozcpu_port50_w %02x\n", data);
+}
+
+
+
+/*************************************
+ *
+ * Video hardware init
+ *
+ *************************************/
+
+void divebomb_state::decode_proms(const uint8_t * rgn, int size, int index, bool inv)
+{
+ static const int resistances[4] = { 2000, 1000, 470, 220 };
+
+ double rweights[4], gweights[4], bweights[4];
+
+ /* compute the color output resistor weights */
+ compute_resistor_weights(0, 255, -1.0,
+ 4, resistances, rweights, 0, 0,
+ 4, resistances, gweights, 0, 0,
+ 4, resistances, bweights, 0, 0);
+
+ /* create a lookup table for the palette */
+ for (uint32_t i = 0; i < size; ++i)
+ {
+ uint32_t rdata = rgn[i + size*2] & 0x0f;
+ uint32_t r = combine_4_weights(rweights, BIT(rdata, 0), BIT(rdata, 1), BIT(rdata, 2), BIT(rdata, 3));
+
+ uint32_t gdata = rgn[i + size] & 0x0f;
+ uint32_t g = combine_4_weights(gweights, BIT(gdata, 0), BIT(gdata, 1), BIT(gdata, 2), BIT(gdata, 3));
+
+ uint32_t bdata = rgn[i] & 0x0f;
+ uint32_t b = combine_4_weights(bweights, BIT(bdata, 0), BIT(bdata, 1), BIT(bdata, 2), BIT(bdata, 3));
+
+ if (!inv)
+ m_palette->set_pen_color(index + i, rgb_t(r, g, b));
+ else
+ m_palette->set_pen_color(index + (i ^ 0xff), rgb_t(r, g, b));
+ }
+}
+
+
+PALETTE_INIT_MEMBER(divebomb_state, divebomb)
+{
+ decode_proms(memregion("spr_proms")->base(), 0x100, 0x400 + 0x400 + 0x400, false);
+ decode_proms(memregion("fg_proms")->base(), 0x400, 0x400 + 0x400, false);
+ decode_proms(memregion("k051316_1_pr")->base(), 0x400, 0, true);
+ decode_proms(memregion("k051316_2_pr")->base(), 0x400, 0x400, true);
+}
+
+
+VIDEO_START_MEMBER(divebomb_state,divebomb)
+{
+ m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(divebomb_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_scrolly(0, 16);
+}
+
+
+
+/*************************************
+ *
+ * Main update
+ *
+ *************************************/
+
+void divebomb_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ const uint8_t *spriteram = m_spriteram;
+
+ for (uint32_t i = 0; i < m_spriteram.bytes(); i += 4)
+ {
+ uint32_t sy = spriteram[i + 3];
+ uint32_t sx = spriteram[i + 0];
+ uint32_t code = spriteram[i + 2];
+ uint32_t attr = spriteram[i + 1];
+
+ code += (attr & 0x0f) << 8;
+
+ uint32_t colour = attr >> 4;
+
+ m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, colour, 0, 0, sx, sy, 0);
+ m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, colour, 0, 0, sx, sy-256, 0);
+ }
+}
+
+
+uint32_t divebomb_state::screen_update_divebomb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ m_roz_1->set_wrap(roz1_wrap);
+ m_roz_2->set_wrap(roz2_wrap);
+
+ bitmap.fill(m_palette->black_pen(), cliprect);
+
+#if 0
+ if (roz2_enable)
+ m_k051316_2->zoom_draw(screen, bitmap, cliprect, 0, 0);
+
+ if (roz1_enable)
+ m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 0);
+#endif
+
+ draw_sprites(bitmap, cliprect);
+
+ m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+
+ return 0;
+}
@@ -229,8 +478,8 @@ WRITE8_MEMBER(divebomb_state::spritecpu_port00_w)
static ADDRESS_MAP_START( divebomb_rozcpu_map, AS_PROGRAM, 8, divebomb_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
- AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_DEVREADWRITE("k051316_1", k051316_device, read, write)
- AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_DEVREADWRITE("k051316_2", k051316_device, read, write)
+ AM_RANGE(0xc000, 0xc7ff) AM_DEVREADWRITE("roz_1", k051316_device, vram_r, vram_w)
+ AM_RANGE(0xd000, 0xd7ff) AM_DEVREADWRITE("roz_2", k051316_device, vram_r, vram_w)
AM_RANGE(0xe000, 0xffff) AM_RAM
ADDRESS_MAP_END
@@ -242,8 +491,8 @@ static ADDRESS_MAP_START( divebomb_rozcpu_iomap, AS_IO, 8, divebomb_state )
AM_RANGE(0x12, 0x12) AM_WRITE(rozcpu_enable1_w)
AM_RANGE(0x13, 0x13) AM_WRITE(rozcpu_enable2_w)
AM_RANGE(0x14, 0x14) AM_WRITE(rozcpu_wrap1_enable_w)
- AM_RANGE(0x20, 0x2f) AM_DEVWRITE("k051316_1", k051316_device, ctrl_w)
- AM_RANGE(0x30, 0x3f) AM_DEVWRITE("k051316_2", k051316_device, ctrl_w)
+ AM_RANGE(0x20, 0x2f) AM_DEVICE("roz_1", k051316_device, map)
+ AM_RANGE(0x30, 0x3f) AM_DEVICE("roz_2", k051316_device, map)
AM_RANGE(0x40, 0x40) AM_READWRITE(rozcpu_comm_r, rozcpu_comm_w)
AM_RANGE(0x50, 0x50) AM_WRITE(rozcpu_pal_w)
ADDRESS_MAP_END
@@ -464,19 +713,8 @@ static MACHINE_CONFIG_START( divebomb )
MCFG_QUANTUM_PERFECT_CPU("fgcpu")
- MCFG_DEVICE_ADD("k051316_1", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_BPP(8)
- MCFG_K051316_WRAP(0)
- MCFG_K051316_OFFSETS(-88, -16)
- MCFG_K051316_CB(divebomb_state, zoom_callback_1)
-
- MCFG_DEVICE_ADD("k051316_2", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_BPP(8)
- MCFG_K051316_WRAP(0)
- MCFG_K051316_OFFSETS(-88, -16)
- MCFG_K051316_CB(divebomb_state, zoom_callback_2)
+ MCFG_K051316_ADD("roz_1", 8, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = 0; })
+ MCFG_K051316_ADD("roz_2", 8, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = 0; })
MCFG_MACHINE_START_OVERRIDE(divebomb_state, divebomb)
MCFG_MACHINE_RESET_OVERRIDE(divebomb_state, divebomb)
diff --git a/src/mame/drivers/djmain.cpp b/src/mame/drivers/djmain.cpp
index 37a23b46f93..b5cd4034238 100644
--- a/src/mame/drivers/djmain.cpp
+++ b/src/mame/drivers/djmain.cpp
@@ -31,7 +31,7 @@
* 18d: 055555 (priority encoder)
* 5f: 056766 (sprites)
* 18f: 056832 (tiles)
- * 22f: 058143 = 054156 (tiles)
+ * 22f: 058143 (tiles)
* 12j: 058141 = 054539 (x2) (2 sound chips in one)
*
* TODO:
@@ -193,7 +193,7 @@ WRITE32_MEMBER(djmain_state::v_ctrl_w)
READ32_MEMBER(djmain_state::v_rom_r)
{
uint8_t *mem8 = memregion("gfx2")->base();
- int bank = m_k056832->word_r(space, 0x34/2, 0xffff);
+ int bank = m_tilemap->rom16_r(space, 0x34/2, 0xffff);
offset *= 2;
@@ -316,11 +316,6 @@ WRITE32_MEMBER(djmain_state::light_ctrl_2_w)
// unknown ports :-(
-WRITE32_MEMBER(djmain_state::unknown590000_w)
-{
- //logerror("%08X: unknown 590000 write %08X: %08X & %08X\n", space.device().safe_pcbase(), offset, data, mem_mask);
-}
-
WRITE32_MEMBER(djmain_state::unknown802000_w)
{
//logerror("%08X: unknown 802000 write %08X: %08X & %08X\n", space.device().safe_pcbase(), offset, data, mem_mask);
@@ -382,9 +377,9 @@ static ADDRESS_MAP_START( maincpu_djmain, AS_PROGRAM, 32, djmain_state )
AM_RANGE(0x400000, 0x40ffff) AM_RAM // WORK RAM
AM_RANGE(0x480000, 0x48443f) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // COLOR RAM
AM_RANGE(0x500000, 0x57ffff) AM_READWRITE(sndram_r, sndram_w) // SOUND RAM
- AM_RANGE(0x580000, 0x58003f) AM_DEVREADWRITE("k056832", k056832_device, long_r, long_w) // VIDEO REG (tilemap)
- AM_RANGE(0x590000, 0x590007) AM_WRITE(unknown590000_w) // ??
- AM_RANGE(0x5a0000, 0x5a005f) AM_DEVWRITE("k055555", k055555_device, K055555_long_w) // 055555: priority encoder
+ AM_RANGE(0x580000, 0x58003f) AM_DEVICE16("tilemap", k058143_056832_device, vacset, 0xffffffff)
+ AM_RANGE(0x590000, 0x590007) AM_DEVICE16("tilemap", k058143_056832_device, vsccs, 0xffffffff)
+ AM_RANGE(0x5a0000, 0x5a005f) AM_DEVICE8("mixer", k055555_device, map, 0xff00ff00)
AM_RANGE(0x5b0000, 0x5b04ff) AM_DEVREADWRITE8("k054539_1", k054539_device, read, write, 0xff00ff00)
AM_RANGE(0x5b0000, 0x5b04ff) AM_DEVREADWRITE8("k054539_2", k054539_device, read, write, 0x00ff00ff)
AM_RANGE(0x5c0000, 0x5c0003) AM_READ8(inp1_r, 0xffffffff) // DSW3,BTN3,BTN2,BTN1 // input port control (buttons and DIP switches)
@@ -404,7 +399,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START(maincpu_djmainj, AS_PROGRAM, 32, djmain_state)
AM_IMPORT_FROM(maincpu_djmain)
- AM_RANGE(0xc00000, 0xc01fff) AM_DEVREADWRITE("k056832", k056832_device, ram_long_r, ram_long_w) // VIDEO RAM (tilemap) (beatmania)
+ AM_RANGE(0xc00000, 0xc01fff) AM_DEVREADWRITE("tilemap", k058143_056832_device, vram32_r, vram32_w)
AM_RANGE(0xc02000, 0xc02047) AM_WRITE(unknownc02000_w) // ??
AM_RANGE(0xf00000, 0xf0000f) AM_DEVREADWRITE16("ata", ata_interface_device, read_cs0, write_cs0, 0xffffffff) // IDE control regs (beatmania)
AM_RANGE(0xf40000, 0xf4000f) AM_DEVREADWRITE16("ata", ata_interface_device, read_cs1, write_cs1, 0xffffffff) // IDE status control reg (beatmania)
@@ -415,7 +410,7 @@ static ADDRESS_MAP_START(maincpu_djmainu, AS_PROGRAM, 32, djmain_state)
AM_RANGE(0xd00000, 0xd0000f) AM_DEVREADWRITE16("ata", ata_interface_device, read_cs0, write_cs0, 0xffffffff) // IDE control regs (hiphopmania)
AM_RANGE(0xd40000, 0xd4000f) AM_DEVREADWRITE16("ata", ata_interface_device, read_cs1, write_cs1, 0xffffffff) // IDE status control reg (hiphopmania)
- AM_RANGE(0xe00000, 0xe01fff) AM_DEVREADWRITE("k056832", k056832_device, ram_long_r, ram_long_w) // VIDEO RAM (tilemap) (hiphopmania)
+ AM_RANGE(0xe00000, 0xe01fff) AM_DEVREADWRITE("tilemap", k058143_056832_device, vram32_r, vram32_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START(maincpu_djmaina, AS_PROGRAM, 32, djmain_state)
@@ -423,7 +418,7 @@ static ADDRESS_MAP_START(maincpu_djmaina, AS_PROGRAM, 32, djmain_state)
AM_RANGE(0xc00000, 0xc0000f) AM_DEVREADWRITE16("ata", ata_interface_device, read_cs0, write_cs0, 0xffffffff) // IDE control regs
AM_RANGE(0xc40000, 0xc4000f) AM_DEVREADWRITE16("ata", ata_interface_device, read_cs1, write_cs1, 0xffffffff) // IDE status control reg
- AM_RANGE(0xf00000, 0xf01fff) AM_DEVREADWRITE("k056832", k056832_device, ram_long_r, ram_long_w) // VIDEO RAM (tilemap)
+ AM_RANGE(0xf00000, 0xf01fff) AM_DEVREADWRITE("tilemap", k058143_056832_device, vram32_r, vram32_w)
ADDRESS_MAP_END
@@ -1400,12 +1395,8 @@ static MACHINE_CONFIG_START( djmainj )
MCFG_PALETTE_FORMAT(XBGR)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", djmain)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(djmain_state, tile_callback)
- MCFG_K056832_CONFIG("gfx2", K056832_BPP_4dj, 1, 1, "none")
- MCFG_K056832_PALETTE("palette")
-
- MCFG_K055555_ADD("k055555")
+ MCFG_K058143_056832_ADD("tilemap", 12000000, 8, 8, 24)
+ MCFG_K055555_ADD("mixer")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp
index ef45136d2cb..3c4f3dd7924 100644
--- a/src/mame/drivers/einstein.cpp
+++ b/src/mame/drivers/einstein.cpp
@@ -67,7 +67,7 @@
#include "speaker.h"
-#define VERBOSE_KEYBOARD 0
+#define VERBOSE_KEYBOARD 1
#define VERBOSE_DISK 0
/***************************************************************************
@@ -344,7 +344,7 @@ WRITE8_MEMBER(einstein_state::einstein_kybintmsk_w)
if (data & 0x01)
{
logerror("key int is disabled\n");
- m_interrupt_mask &= ~EINSTEIN_KEY_INT;
+ // m_interrupt_mask &= ~EINSTEIN_KEY_INT;
}
else
{
diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp
index d540e573892..51e093ae82f 100644
--- a/src/mame/drivers/firebeat.cpp
+++ b/src/mame/drivers/firebeat.cpp
@@ -123,8 +123,8 @@ Keyboard Mania 2nd Mix - dongle, program CD, audio CD
sets the size, 20-2E may set the minimum x and y coordinates but I haven't seen
them set to something other than 0 yet. One context is set as the one the RAMDAC
outputs to the monitor (not sure how this is selected yet, probably the lower
- bits of register 12). Thestartup test in the popn BIOS checks all of VRAM, so
- it moves the currentdisplay address around so you don't see crazy colors, which
+ bits of register 12). The startup test in the popn BIOS checks all of VRAM, so
+ it moves the current display address around so you don't see crazy colors, which
is very helpful in figuring out how this part works.
The other new part is that there are two VRAM write ports, managed by registers
diff --git a/src/mame/drivers/giclassic.cpp b/src/mame/drivers/giclassic.cpp
index 137c7eb5f01..9f43f488f1e 100644
--- a/src/mame/drivers/giclassic.cpp
+++ b/src/mame/drivers/giclassic.cpp
@@ -59,12 +59,12 @@ public:
giclassic_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_k056832(*this, "k056832"),
+ m_tilemap(*this, "tilemap"),
m_palette(*this, "palette")
{ }
required_device<cpu_device> m_maincpu;
- required_device<k056832_device> m_k056832;
+ required_device<k058143_056832_device> m_tilemap;
required_device<palette_device> m_palette;
DECLARE_PALETTE_INIT(giclassic);
@@ -75,7 +75,7 @@ public:
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_giclassic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- K056832_CB_MEMBER(tile_callback);
+ // K056832_CB_MEMBER(tile_callback);
DECLARE_WRITE16_MEMBER(control_w);
DECLARE_READ16_MEMBER(vrom_r);
@@ -88,10 +88,12 @@ private:
// Client portion
// --------------------------------------------------------------------------------------------------------------
+#if 0
K056832_CB_MEMBER(giclassic_state::tile_callback)
{
*color = (*color & 0xf);
}
+#endif
void giclassic_state::video_start()
{
@@ -102,10 +104,10 @@ uint32_t giclassic_state::screen_update_giclassic(screen_device &screen, bitmap_
bitmap.fill(0, cliprect);
screen.priority().fill(0, cliprect);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 1);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, 0, 4);
-// m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, 0, 8);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 1);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, 0, 4);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, 0, 8);
return 0;
}
@@ -133,24 +135,27 @@ WRITE16_MEMBER(giclassic_state::control_w)
READ16_MEMBER(giclassic_state::vrom_r)
{
+#if 0
if (m_control & 8)
{
return m_k056832->piratesh_rom_r(space, offset + 0x1000);
}
return m_k056832->piratesh_rom_r(space, offset);
+#endif
+ return 0;
}
static ADDRESS_MAP_START( satellite_main, AS_PROGRAM, 16, giclassic_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM AM_REGION("maincpu", 0)
AM_RANGE(0x100000, 0x103fff) AM_RAM
AM_RANGE(0x200000, 0x200fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x800000, 0x801fff) AM_RAM AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w)
- AM_RANGE(0x900000, 0x90003f) AM_DEVREADWRITE("k056832", k056832_device, word_r, word_w)
+// AM_RANGE(0x800000, 0x801fff) AM_RAM AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w)
+// AM_RANGE(0x900000, 0x90003f) AM_DEVREADWRITE("k056832", k056832_device, word_r, word_w)
AM_RANGE(0xb00000, 0xb01fff) AM_READ(vrom_r)
AM_RANGE(0xc00000, 0xc00001) AM_WRITE(control_w)
AM_RANGE(0xd00000, 0xd0003f) AM_RAM // these must read/write or 26S (LCD controller) fails
- AM_RANGE(0xe00000, 0xe0001f) AM_DEVWRITE8("k056832", k056832_device, b_w, 0xff00)
+// AM_RANGE(0xe00000, 0xe0001f) AM_DEVWRITE8("k056832", k056832_device, b_w, 0xff00)
AM_RANGE(0xf00000, 0xf00001) AM_NOP AM_WRITENOP // watchdog reset
ADDRESS_MAP_END
@@ -175,23 +180,23 @@ public:
giclassicsvr_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_k056832(*this, "k056832"),
- m_k055673(*this, "k055673"),
+ m_tilemap(*this, "tilemap"),
+ m_sprites(*this, "sprites"),
m_palette(*this, "palette")
{ }
required_device<cpu_device> m_maincpu;
- required_device<k056832_device> m_k056832;
- required_device<k055673_device> m_k055673;
+ required_device<k058143_056832_device> m_tilemap;
+ required_device<k053246_055673_device> m_sprites;
required_device<palette_device> m_palette;
INTERRUPT_GEN_MEMBER(giclassicsvr_interrupt);
virtual void machine_start() override;
virtual void machine_reset() override;
- uint32_t screen_update_giclassicsvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- K056832_CB_MEMBER(tile_callback);
- K055673_CB_MEMBER(sprite_callback);
+ uint32_t screen_update_giclassicsvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);//
+ // K056832_CB_MEMBER(tile_callback);
+ // K055673_CB_MEMBER(sprite_callback);
DECLARE_WRITE16_MEMBER(control_w);
DECLARE_READ16_MEMBER(control_r);
@@ -218,7 +223,7 @@ INTERRUPT_GEN_MEMBER(giclassicsvr_state::giclassicsvr_interrupt)
m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
}
}
-
+#if 0
K056832_CB_MEMBER(giclassicsvr_state::tile_callback)
{
}
@@ -245,17 +250,17 @@ K055673_CB_MEMBER(giclassicsvr_state::sprite_callback)
// 1100 1100
// 1010 1010
}
-
+#endif
uint32_t giclassicsvr_state::screen_update_giclassicsvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0, cliprect);
screen.priority().fill(0, cliprect);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 1);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, 0, 4);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, 0, 8);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 1);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, 0, 4);
+ // m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, 0, 8);
return 0;
}
@@ -266,12 +271,12 @@ static ADDRESS_MAP_START( server_main, AS_PROGRAM, 16, giclassicsvr_state )
AM_RANGE(0x090000, 0x093fff) AM_RAM
AM_RANGE(0x100000, 0x107fff) AM_RAM AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x180000, 0x183fff) AM_RAM
- AM_RANGE(0x280000, 0x281fff) AM_RAM AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w)
- AM_RANGE(0x300000, 0x300007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w) // SPRITES
- AM_RANGE(0x300060, 0x30006f) AM_DEVREAD("k055673", k055673_device, k055673_ps_rom_word_r) // SPRITES
- AM_RANGE(0x308000, 0x30803f) AM_DEVREADWRITE("k056832", k056832_device, word_r, word_w)
- AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252a", k053252_device, read, write, 0x00ff) // CRTC 1
- AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252b", k053252_device, read, write, 0xff00) // CRTC 2
+// AM_RANGE(0x280000, 0x281fff) AM_RAM AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w)
+// AM_RANGE(0x300000, 0x300007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w) // SPRITES
+// AM_RANGE(0x300060, 0x30006f) AM_DEVREAD("k055673", k055673_device, k055673_ps_rom_word_r) // SPRITES
+// AM_RANGE(0x308000, 0x30803f) AM_DEVREADWRITE("k056832", k056832_device, word_r, word_w)
+// AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252a", k053252_device, read, write, 0x00ff) // CRTC 1
+// AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252b", k053252_device, read, write, 0xff00) // CRTC 2
AM_RANGE(0x380000, 0x380001) AM_WRITENOP // watchdog reset
AM_RANGE(0x398000, 0x398001) AM_READWRITE(control_r, control_w)
AM_RANGE(0x400000, 0x41ffff) AM_RAM
@@ -308,10 +313,10 @@ static MACHINE_CONFIG_START( giclassic )
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(giclassic_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+// MCFG_DEVICE_ADD("k056832", K056832, 0)
+// MCFG_K056832_CB(giclassic_state, tile_callback)
+// MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0, "none")
+// MCFG_K056832_PALETTE("palette")
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( giclassvr )
@@ -334,21 +339,21 @@ static MACHINE_CONFIG_START( giclassvr )
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(giclassicsvr_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 0, 0, "none")
- MCFG_K056832_PALETTE("palette")
+// MCFG_DEVICE_ADD("k056832", K056832, 0)
+// MCFG_K056832_CB(giclassicsvr_state, tile_callback)
+// MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 0, 0, "none")
+// MCFG_K056832_PALETTE("palette")
- MCFG_DEVICE_ADD("k055673", K055673, 0)
- MCFG_K055673_CB(giclassicsvr_state, sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_PS, -60, 24)
- MCFG_K055673_PALETTE("palette")
+// MCFG_DEVICE_ADD("k055673", K055673, 0)
+// MCFG_K055673_CB(giclassicsvr_state, sprite_callback)
+// MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_PS, -60, 24)
+// MCFG_K055673_PALETTE("palette")
- MCFG_DEVICE_ADD("k053252a", K053252, XTAL_32MHz/4)
- MCFG_K053252_OFFSETS(40, 16) // TODO
+// MCFG_DEVICE_ADD("k053252a", K053252, XTAL_32MHz/4)
+// MCFG_K053252_OFFSETS(40, 16) // TODO
- MCFG_DEVICE_ADD("k053252b", K053252, XTAL_32MHz/4)
- MCFG_K053252_OFFSETS(40, 16) // TODO
+// MCFG_DEVICE_ADD("k053252b", K053252, XTAL_32MHz/4)
+// MCFG_K053252_OFFSETS(40, 16) // TODO
MACHINE_CONFIG_END
ROM_START( giclasex )
diff --git a/src/mame/drivers/gijoe.cpp b/src/mame/drivers/gijoe.cpp
index b02c9d9172c..3147ba58a0d 100644
--- a/src/mame/drivers/gijoe.cpp
+++ b/src/mame/drivers/gijoe.cpp
@@ -105,19 +105,94 @@ Known Issues
***************************************************************************/
#include "emu.h"
-#include "includes/gijoe.h"
-#include "includes/konamipt.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "includes/konamipt.h"
#include "machine/eepromser.h"
+#include "machine/k054321.h"
+#include "sound/k054539.h"
#include "sound/k054539.h"
#include "speaker.h"
+#include "video/k053246_k053247_k055673.h"
+#include "video/k053251.h"
+#include "video/k054156_k054157_k056832.h"
+#include "video/kvideodac.h"
+class gijoe_state : public driver_device
+{
+public:
+ gijoe_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_k054539(*this, "k054539"),
+ m_tilemap(*this, "tilemap"),
+ m_sprites(*this, "sprites"),
+ m_mixer(*this, "mixer"),
+ m_videodac(*this, "videodac"),
+ m_palette(*this, "palette"),
+ m_screen(*this, "screen"),
+ m_soundctrl(*this, "soundctrl") { }
+
+ /* misc */
+ uint16_t m_cur_control2;
+ int m_cur_vblankirq;
+ int m_cur_objdmairq;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k054539_device> m_k054539;
+ required_device<k054156_054157_device> m_tilemap;
+ required_device<k053246_053247_device> m_sprites;
+ required_device<k053251_device> m_mixer;
+ required_device<kvideodac_device> m_videodac;
+ required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
+ required_device<k054321_device> m_soundctrl;
+
+ DECLARE_WRITE_LINE_MEMBER(vblankirq_w);
+ DECLARE_WRITE_LINE_MEMBER(objdmairq_w);
+
+ DECLARE_READ16_MEMBER(control2_r);
+ DECLARE_WRITE16_MEMBER(control2_w);
+ DECLARE_WRITE16_MEMBER(sound_irq_w);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ void sprites_wiring(uint32_t output, uint16_t &color, uint16_t &attr);
+ void fr_setup(flow_render::manager *manager);
+};
+
+// Out of 14 bits, 9 are wired to color and the last 5 to the top bits
+// of priority. Shadow is directly connected.
+void gijoe_state::sprites_wiring(uint32_t output, uint16_t &color, uint16_t &attr)
+{
+ color = output & 0x1ff;
+ attr = ((output & 0xc000) >> 6) | ((output >> 8) & 0x3e);
+}
-#define JOE_DEBUG 0
-#define JOE_DMADELAY (attotime::from_nsec(42700 + 341300))
-
+void gijoe_state::fr_setup(flow_render::manager *manager)
+{
+ auto rs = m_sprites ->flow_render_get_renderer();
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rv = m_videodac->flow_render_get_renderer();
+
+ manager->connect(rs ->out("color"), rm->inp("0 color"));
+ manager->connect(rs ->out("attr"), rm->inp("0 attr"));
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), rm->inp("1 color"));
+ manager->set_constant(rm->inp("1 attr"), 0x3f);
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), rm->inp("2 color"));
+ manager->set_constant(rm->inp("2 attr"), 0x3f);
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm->inp("3 color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm->inp("4 color"));
+
+ manager->connect(rm->out("color"), rv->inp("color"));
+ manager->connect(rm->out("attr"), rv->inp("attr"));
+
+ manager->connect(rv->out(), m_screen->flow_render_get_renderer()->inp());
+}
READ16_MEMBER(gijoe_state::control2_r)
{
@@ -138,58 +213,25 @@ WRITE16_MEMBER(gijoe_state::control2_w)
m_cur_control2 = data;
+ m_maincpu->set_input_line(6, (m_cur_control2 & 0x20) && m_cur_objdmairq ? ASSERT_LINE : CLEAR_LINE);
+ m_maincpu->set_input_line(5, (m_cur_control2 & 0x80) && m_cur_vblankirq ? ASSERT_LINE : CLEAR_LINE);
+
/* bit 6 = enable sprite ROM reading */
- m_k053246->k053246_set_objcha_line( (data & 0x0040) ? ASSERT_LINE : CLEAR_LINE);
+ m_sprites->set_objcha(data & 0x0040);
}
}
-void gijoe_state::gijoe_objdma( )
+WRITE_LINE_MEMBER(gijoe_state::vblankirq_w)
{
- uint16_t *src_head, *src_tail, *dst_head, *dst_tail;
-
- src_head = m_spriteram;
- src_tail = m_spriteram + 255 * 8;
- m_k053246->k053247_get_ram( &dst_head);
- dst_tail = dst_head + 255 * 8;
-
- for (; src_head <= src_tail; src_head += 8)
- {
- if (*src_head & 0x8000)
- {
- memcpy(dst_head, src_head, 0x10);
- dst_head += 8;
- }
- else
- {
- *dst_tail = 0;
- dst_tail -= 8;
- }
- }
+ m_cur_vblankirq = state;
+ m_maincpu->set_input_line(5, (m_cur_control2 & 0x80) && m_cur_vblankirq ? ASSERT_LINE : CLEAR_LINE);
}
-TIMER_CALLBACK_MEMBER(gijoe_state::dmaend_callback)
-{
- if (m_cur_control2 & 0x0020)
- m_maincpu->set_input_line(6, HOLD_LINE);
-}
-INTERRUPT_GEN_MEMBER(gijoe_state::gijoe_interrupt)
+WRITE_LINE_MEMBER(gijoe_state::objdmairq_w)
{
- // global interrupt masking (*this game only)
- if (!m_k056832->is_irq_enabled(0))
- return;
-
- if (m_k053246->k053246_is_irq_enabled())
- {
- gijoe_objdma();
-
- // 42.7us(clr) + 341.3us(xfer) delay at 6Mhz dotclock
- m_dmadelay_timer->adjust(JOE_DMADELAY);
- }
-
- // trigger V-blank interrupt
- if (m_cur_control2 & 0x0080)
- device.execute().set_input_line(5, HOLD_LINE);
+ m_cur_objdmairq = state;
+ m_maincpu->set_input_line(6, (m_cur_control2 & 0x20) && m_cur_objdmairq ? ASSERT_LINE : CLEAR_LINE);
}
WRITE16_MEMBER(gijoe_state::sound_irq_w)
@@ -200,36 +242,29 @@ WRITE16_MEMBER(gijoe_state::sound_irq_w)
static ADDRESS_MAP_START( gijoe_map, AS_PROGRAM, 16, gijoe_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x100fff) AM_RAM AM_SHARE("spriteram") // Sprites
- AM_RANGE(0x110000, 0x110007) AM_DEVWRITE("k053246", k053247_device, k053246_word_w)
- AM_RANGE(0x120000, 0x121fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) // Graphic planes
- AM_RANGE(0x122000, 0x123fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) // Graphic planes mirror read
- AM_RANGE(0x130000, 0x131fff) AM_DEVREAD("k056832", k056832_device, rom_word_r) // Passthrough to tile roms
- AM_RANGE(0x160000, 0x160007) AM_DEVWRITE("k056832", k056832_device, b_word_w) // VSCCS (board dependent)
+ AM_RANGE(0x110000, 0x110007) AM_DEVICE("sprites", k053246_053247_device, objset1)
+ AM_RANGE(0x120000, 0x121fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x130000, 0x131fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
+ AM_RANGE(0x160000, 0x160007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
AM_RANGE(0x170000, 0x170001) AM_WRITENOP // Watchdog
AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("workram") // Main RAM. Spec. 180000-1803ff, 180400-187fff
AM_RANGE(0x190000, 0x190fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x1a0000, 0x1a001f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
- AM_RANGE(0x1b0000, 0x1b003f) AM_DEVWRITE("k056832", k056832_device, word_w)
- AM_RANGE(0x1c0000, 0x1c001f) AM_DEVICE8("k054321", k054321_device, main_map, 0x00ff)
+ AM_RANGE(0x1a0000, 0x1a001f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
+ AM_RANGE(0x1b0000, 0x1b003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
+ AM_RANGE(0x1c0000, 0x1c001f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0x00ff)
AM_RANGE(0x1d0000, 0x1d0001) AM_WRITE(sound_irq_w)
AM_RANGE(0x1e0000, 0x1e0001) AM_READ_PORT("P1_P2")
AM_RANGE(0x1e0002, 0x1e0003) AM_READ_PORT("P3_P4")
AM_RANGE(0x1e4000, 0x1e4001) AM_READ_PORT("SYSTEM")
AM_RANGE(0x1e4002, 0x1e4003) AM_READ_PORT("START")
AM_RANGE(0x1e8000, 0x1e8001) AM_READWRITE(control2_r, control2_w)
- AM_RANGE(0x1f0000, 0x1f0001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
-#if JOE_DEBUG
- AM_RANGE(0x110000, 0x110007) AM_DEVREAD("k053246", k053247_device, k053246_reg_word_r)
- AM_RANGE(0x160000, 0x160007) AM_DEVREAD("k056832", k056832_device, b_word_r)
- AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREAD("k053251", k053251_device, lsb_r)
- AM_RANGE(0x1b0000, 0x1b003f) AM_DEVREAD("k056832", k056832_device, word_r)
-#endif
+ AM_RANGE(0x1f0000, 0x1f0001) AM_DEVREAD("sprites", k053246_053247_device, rom16_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gijoe_state )
AM_RANGE(0xf000, 0xf7ff) AM_RAM
AM_RANGE(0xf800, 0xfa2f) AM_DEVREADWRITE("k054539", k054539_device, read, write)
- AM_RANGE(0xfc00, 0xfc03) AM_DEVICE("k054321", k054321_device, sound_map)
+ AM_RANGE(0xfc00, 0xfc03) AM_DEVICE("soundctrl", k054321_device, sound_map)
AM_RANGE(0x0000, 0xefff) AM_ROM
ADDRESS_MAP_END
@@ -279,8 +314,6 @@ INPUT_PORTS_END
void gijoe_state::machine_start()
{
- m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gijoe_state::dmaend_callback),this));
-
save_item(NAME(m_cur_control2));
}
@@ -294,7 +327,6 @@ static MACHINE_CONFIG_START( gijoe )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2) /* 16MHz Confirmed */
MCFG_CPU_PROGRAM_MAP(gijoe_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", gijoe_state, gijoe_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_32MHz/4) /* Amuse & confirmed. Z80E at 8MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
@@ -302,35 +334,37 @@ static MACHINE_CONFIG_START( gijoe )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
/* video hardware */
+ MCFG_FLOW_RENDER_MANAGER_ADD("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", gijoe_state, fr_setup)
+
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 16, 16+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(gijoe_state, screen_update_gijoe)
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_RAW_PARAMS(6000000, 384, 0, 288, 264, 0, 224)
+ MCFG_SCREEN_FLOW_RENDER_RGB()
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(gijoe_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_K054156_054157_ADD("tilemap", 6000000, 2, 2, 24)
+ MCFG_K054156_054157_INT1_CB(WRITELINE(gijoe_state, vblankirq_w))
+ MCFG_K054156_054157_VBLANK_CB(DEVWRITELINE(":sprites", k053246_053247_device, vblank_w))
+ MCFG_K054156_054157_KSNOTIFIER_CB(DEVKSNOTIFIER(":sprites", k053246_053247_device, ksnotifier_w))
+ MCFG_VIDEO_SET_SCREEN("screen")
+ MCFG_VLATENCY_NEXT("mixer")
- MCFG_DEVICE_ADD("k053246", K053246, 0)
- MCFG_K053246_CB(gijoe_state, sprite_callback)
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -37, 20)
- MCFG_K053246_PALETTE("palette")
+ MCFG_K053246_053247_ADD("sprites", 6000000, "spriteram")
+ MCFG_K053246_053247_WIRING_CB(gijoe_state, sprites_wiring)
+ MCFG_K053246_053247_DMAIRQ_CB(WRITELINE(gijoe_state, objdmairq_w))
+ MCFG_VLATENCY_NEXT("mixer")
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("mixer", 0)
+ MCFG_VLATENCY_POST(1) // Guess, it's the usual TTL palette delay
+
+ MCFG_KVIDEODAC_ADD("videodac", "palette", 0x300, 0.6, 0, 1.0)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_K054321_ADD("k054321", ":lspeaker", ":rspeaker")
+ MCFG_K054321_ADD("soundctrl", ":lspeaker", ":rspeaker")
MCFG_DEVICE_ADD("k054539", K054539, XTAL_18_432MHz)
MCFG_K054539_TIMER_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI))
@@ -349,15 +383,15 @@ ROM_START( gijoe )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
- ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
+ ROM_LOAD32_WORD_SWAP( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
- ROM_REGION( 0x400000, "gfx2", 0 )
- ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
- ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
- ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
- ROM_LOAD64_WORD( "069a06.2h", 0x000006, 0x100000, CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
+ ROM_REGION( 0x400000, "sprites", 0 )
+ ROM_LOAD64_WORD_SWAP( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
+ ROM_LOAD64_WORD_SWAP( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
+ ROM_LOAD64_WORD_SWAP( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
+ ROM_LOAD64_WORD_SWAP( "069a06.2h", 0x000006, 0x100000, CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
ROM_REGION( 0x200000, "k054539", 0 )
ROM_LOAD( "069a04.1e", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
@@ -382,11 +416,11 @@ ROM_START( gijoea )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
- ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
+ ROM_LOAD32_WORD_SWAP( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
- ROM_REGION( 0x400000, "gfx2", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
@@ -409,11 +443,11 @@ ROM_START( gijoeu )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
- ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
+ ROM_LOAD32_WORD_SWAP( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
- ROM_REGION( 0x400000, "gfx2", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
@@ -436,11 +470,11 @@ ROM_START( gijoej )
ROM_REGION( 0x010000, "audiocpu", 0 )
ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
- ROM_REGION( 0x200000, "gfx1", 0 )
- ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
- ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
+ ROM_REGION( 0x200000, "tilemap", 0 )
+ ROM_LOAD32_WORD_SWAP( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
+ ROM_LOAD32_WORD_SWAP( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
- ROM_REGION( 0x400000, "gfx2", 0 )
+ ROM_REGION( 0x400000, "sprites", 0 )
ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
diff --git a/src/mame/drivers/hexion.cpp b/src/mame/drivers/hexion.cpp
index b25592522e8..deedf4009ea 100644
--- a/src/mame/drivers/hexion.cpp
+++ b/src/mame/drivers/hexion.cpp
@@ -127,7 +127,7 @@ static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0xe88a, 0xe88e) AM_DEVWRITE("k051649", k051649_device, k051649_volume_w)
AM_RANGE(0xe88f, 0xe88f) AM_DEVWRITE("k051649", k051649_device, k051649_keyonoff_w)
AM_RANGE(0xe8e0, 0xe8ff) AM_DEVREADWRITE("k051649", k051649_device, k051649_test_r, k051649_test_w)
- AM_RANGE(0xf000, 0xf00f) AM_DEVREADWRITE("k053252", k053252_device, read, write)
+ AM_RANGE(0xf000, 0xf00f) AM_DEVICE("video_timings", k053252_device, map)
AM_RANGE(0xf200, 0xf200) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0xf400, 0xf400) AM_READ_PORT("DSW1")
AM_RANGE(0xf401, 0xf401) AM_READ_PORT("DSW2")
@@ -153,7 +153,7 @@ static ADDRESS_MAP_START( hexionb_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0xe88a, 0xe88e) AM_NOP
AM_RANGE(0xe88f, 0xe88f) AM_NOP
AM_RANGE(0xe8e0, 0xe8ff) AM_NOP
- AM_RANGE(0xf000, 0xf00f) AM_DEVREADWRITE("k053252", k053252_device, read, write)
+ AM_RANGE(0xf000, 0xf00f) AM_DEVICE("video_timings", k053252_device, map)
AM_RANGE(0xf200, 0xf200) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0xf400, 0xf400) AM_READ_PORT("DSW1")
AM_RANGE(0xf401, 0xf401) AM_READ_PORT("DSW2")
@@ -247,9 +247,9 @@ static MACHINE_CONFIG_START( hexion )
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hexion_state, scanline, "screen", 0, 1)
MCFG_WATCHDOG_ADD("watchdog")
- MCFG_DEVICE_ADD("k053252", K053252, XTAL_24MHz/2) /* K053252, X0-010(?) @8D, xtal verified, divider not verified */
- MCFG_K053252_INT1_ACK_CB(WRITELINE(hexion_state, irq_ack_w))
- MCFG_K053252_INT2_ACK_CB(WRITELINE(hexion_state, nmi_ack_w))
+ MCFG_DEVICE_ADD("video_timings", K053252, XTAL_24MHz/2) /* K053252, X0-010(?) @8D, xtal verified, divider not verified */
+// MCFG_K053252_INT1_ACK_CB(WRITELINE(hexion_state, irq_ack_w))
+// MCFG_K053252_INT2_ACK_CB(WRITELINE(hexion_state, nmi_ack_w))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp
index ffcc045a8b8..dec220bffa5 100644
--- a/src/mame/drivers/konamigx.cpp
+++ b/src/mame/drivers/konamigx.cpp
@@ -12,7 +12,7 @@
*
* Tilemaps are handled by the old familiar K054156 with a new partner K056832.
* This combination is mostly compatible with the 156/157 combo but now sports
- * up to 8 bits per pixel as well as larger 128x64 tile planes.
+ * up to 8 bits per pixel.
*
* Sprites are handled by a K053246 combined with a K055673. This combo was
* actually used on some 16 bit Konami games as well. It appears identical
@@ -98,20 +98,226 @@
#include "emu.h"
#include "includes/konamigx.h"
-
-#include "cpu/m68000/m68000.h"
-#include "cpu/tms57002/tms57002.h"
-#include "cpu/z80/z80.h"
-#include "machine/eepromser.h"
-#include "sound/k054539.h"
-#include "sound/k056800.h"
#include "rendlay.h"
#include "speaker.h"
-// TODO: check on PCB
-#define MASTER_CLOCK XTAL_24MHz
-#define SUB_CLOCK XTAL_16MHz
+// PCB has two oscillators, one at 48MHz and one dual 32MHz/18.432MHz
+// The 48MHz one is divised to generate 24, 12 and 6MHz
+// The 32MHz output is divised to generate 16 and 8MHz
+
+#define CLK_24M XTAL_48MHz/2
+#define CLK_12M XTAL_48MHz/4
+#define CLK_6M XTAL_48MHz/8
+#define CLK_16M XTAL_32MHz/2
+#define CLK_8M XTAL_32MHz/4
+#define CLK_18M432 XTAL_18_432MHz
+
+const int konamigx_state::irq_to_level[] = { 5, 4, 4, 3, 3, 3, 3, 2, 1 };
+
+void konamigx_state::set_irq_level(int irq, int level)
+{
+ if(level)
+ m_irqin |= 1 << irq;
+ else
+ m_irqin &= ~(1 << irq);
+ update_irqs();
+}
+
+void konamigx_state::update_irqs()
+{
+ int irq = 0;
+ if(m_port1 & 0x80) {
+ uint32_t airq = m_irqmask & m_irqin;
+ if(airq) {
+ for(int i=0; i<IRQ_COUNT; i++)
+ if(airq & (1<<i)) {
+ irq = irq_to_level[i];
+ break;
+ }
+ }
+ }
+ if(m_cur_irq != irq) {
+ if(m_cur_irq)
+ m_maincpu->set_input_line(m_cur_irq, CLEAR_LINE);
+ if(irq)
+ m_maincpu->set_input_line(irq, ASSERT_LINE);
+ m_cur_irq = irq;
+ }
+}
+
+WRITE_LINE_MEMBER(konamigx_state::objdmaact_w)
+{
+ m_objdma = state;
+}
+
+WRITE_LINE_MEMBER(konamigx_state::objdmairq_w)
+{
+ set_irq_level(IRQ_OBJDMA, state);
+}
+
+WRITE_LINE_MEMBER(konamigx_state::vblankirq_w)
+{
+ set_irq_level(IRQ_VBLANK, state);
+}
+
+WRITE_LINE_MEMBER(konamigx_state::htimerirq_w)
+{
+ set_irq_level(IRQ_TIMER, state);
+}
+
+// Out of 18 bits, 8 go to color and 6 to priority. Out of the
+// remaining four two may be connected to the two top bits of
+// priority, depending on the port2 latch.
+// Shadow/brightness/mix are directly connected.
+
+// Note that the mixer chip can internally redirect some of the
+// priority bits to color palette.
+
+void konamigx_state::sprites_wiring(uint32_t output, uint16_t &color, uint16_t &attr)
+{
+ color = output & 0xff;
+ attr = ((output & 0xfc0000) >> 10) | ((output >> 8) & 0x3f);
+ if(!(m_port2 & 4)) {
+ if(m_port2 & 8)
+ attr |= (output >> 8) & 0xc0;
+ else
+ attr |= (output >> 10) & 0xc0;
+ }
+}
+
+void konamigx_state::flow_render_register_renderers()
+{
+ m_renderer_force_bgcolor = flow_render_create_renderer([this](const rectangle &cliprect){ render(cliprect); });
+ m_renderer_force_bgcolor_input[0] = m_renderer_force_bgcolor->create_input_sb_u16("f");
+ m_renderer_force_bgcolor_input[1] = m_renderer_force_bgcolor->create_input_sb_u16("b");
+ m_renderer_force_bgcolor_output[0] = m_renderer_force_bgcolor->create_output_sb_u16("f");
+ m_renderer_force_bgcolor_output[1] = m_renderer_force_bgcolor->create_output_sb_u16("b");
+}
+
+void konamigx_state::render(const rectangle &cliprect)
+{
+ if(m_port1 & 0x2000) {
+ // To select the 55555 background color, tell the blender that every pixel is present.
+ // Otherwise, the 54338 background color will be used.
+ for(int y = cliprect.min_y; y <= cliprect.max_y; y++) {
+ const uint16_t *fai = &m_renderer_force_bgcolor_input[0]->bitmap().pix16(y, cliprect.min_x);
+ const uint16_t *bai = &m_renderer_force_bgcolor_input[1]->bitmap().pix16(y, cliprect.min_x);
+ uint16_t *fao = &m_renderer_force_bgcolor_output[0]->bitmap().pix16(y, cliprect.min_x);
+ uint16_t *bao = &m_renderer_force_bgcolor_output[1]->bitmap().pix16(y, cliprect.min_x);
+ for(int x = cliprect.min_x; x <= cliprect.max_x; x++) {
+ *fao++ = *fai++ | 0x8000;
+ *bao++ = *bai++ | 0x8000;
+ }
+ }
+ } else {
+ for(int y = cliprect.min_y; y <= cliprect.max_y; y++) {
+ const uint16_t *fai = &m_renderer_force_bgcolor_input[0]->bitmap().pix16(y, cliprect.min_x);
+ const uint16_t *bai = &m_renderer_force_bgcolor_input[1]->bitmap().pix16(y, cliprect.min_x);
+ uint16_t *fao = &m_renderer_force_bgcolor_output[0]->bitmap().pix16(y, cliprect.min_x);
+ uint16_t *bao = &m_renderer_force_bgcolor_output[1]->bitmap().pix16(y, cliprect.min_x);
+ memcpy(fao, fai, (cliprect.max_x - cliprect.min_x + 1)*2);
+ memcpy(bao, bai, (cliprect.max_x - cliprect.min_x + 1)*2);
+ }
+ }
+}
+
+void konamigx_state::fr_setup_single_screen_no_sub(flow_render::manager *manager)
+{
+ auto rb = m_blender->flow_render_get_renderer();
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rs = m_sprites->flow_render_get_renderer();
+
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), rm->inp("a color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), rm->inp("b color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm->inp("c color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm->inp("d color"));
+
+ manager->connect(rs->out("color"), rm->inp("o color"));
+ manager->connect(rs->out("attr"), rm->inp("o attr"));
+
+ manager->set_constant(rm->inp("s1 color"), 0);
+ manager->set_constant(rm->inp("s2 color"), 0);
+ manager->set_constant(rm->inp("s3 color"), 0);
+ manager->set_constant(rm->inp("s1 attr"), 0);
+ manager->set_constant(rm->inp("s2 attr"), 0);
+ manager->set_constant(rm->inp("s3 attr"), 0);
+
+ manager->connect(rm->out("0 color"), rb->inp("0 color"));
+ manager->connect(rm->out("1 color"), rb->inp("1 color"));
+
+ manager->connect(rm->out("0 attr"), m_renderer_force_bgcolor_input[0]);
+ manager->connect(rm->out("1 attr"), m_renderer_force_bgcolor_input[1]);
+ manager->connect(m_renderer_force_bgcolor_output[0], rb->inp("0 attr"));
+ manager->connect(m_renderer_force_bgcolor_output[1], rb->inp("1 attr"));
+
+ manager->connect(rb->out(), m_screen->flow_render_get_renderer()->inp());
+}
+
+void konamigx_state::fr_setup_single_screen_voxels(flow_render::manager *manager)
+{
+ auto rb = m_blender->flow_render_get_renderer();
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rs = m_sprites->flow_render_get_renderer();
+
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), rm->inp("a color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), rm->inp("b color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm->inp("c color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm->inp("d color"));
+
+ manager->connect(rs->out("color"), rm->inp("o color"));
+ manager->connect(rs->out("attr"), rm->inp("o attr"));
+
+ manager->set_constant(rm->inp("s1 color"), 0);
+ manager->set_constant(rm->inp("s2 color"), 0);
+ manager->set_constant(rm->inp("s3 color"), 0);
+ manager->set_constant(rm->inp("s1 attr"), 0);
+ manager->set_constant(rm->inp("s2 attr"), 0);
+ manager->set_constant(rm->inp("s3 attr"), 0);
+
+ manager->connect(rm->out("0 color"), rb->inp("0 color"));
+ manager->connect(rm->out("1 color"), rb->inp("1 color"));
+
+ manager->connect(rm->out("0 attr"), m_renderer_force_bgcolor_input[0]);
+ manager->connect(rm->out("1 attr"), m_renderer_force_bgcolor_input[1]);
+ manager->connect(m_renderer_force_bgcolor_output[0], rb->inp("0 attr"));
+ manager->connect(m_renderer_force_bgcolor_output[1], rb->inp("1 attr"));
+
+ manager->connect(rb->out(), m_screen->flow_render_get_renderer()->inp());
+}
+
+WRITE32_MEMBER(konamigx_state::konamigx_type3_psac2_bank_w)
+{
+ // other bits are used for something...
+
+ COMBINE_DATA(&m_konamigx_type3_psac2_bank[offset]);
+ m_konamigx_type3_psac2_actual_bank = (m_konamigx_type3_psac2_bank[0] & 0x10000000) >> 28;
+
+ /* handle this by creating 2 roz tilemaps instead, otherwise performance dies completely on dual screen mode
+ if (m_konamigx_type3_psac2_actual_bank!=m_konamigx_type3_psac2_actual_last_bank)
+ {
+ m_gx_psac_tilemap->mark_all_dirty();
+ m_konamigx_type3_psac2_actual_last_bank = m_konamigx_type3_psac2_actual_bank;
+ }
+ */
+}
+
+// type 1 RAM-based PSAC tilemap
+WRITE32_MEMBER(konamigx_state::konamigx_t1_psacmap_w)
+{
+ COMBINE_DATA(&m_psacram[offset]);
+ // m_gx_psac_tilemap->mark_tile_dirty(offset/2);
+ // m_gx_psac_tilemap2->mark_tile_dirty(offset/2);
+}
+
+// type 4 RAM-based PSAC tilemap
+WRITE32_MEMBER(konamigx_state::konamigx_t4_psacmap_w)
+{
+ COMBINE_DATA(&m_psacram[offset]);
+
+ // m_gx_psac_tilemap->mark_tile_dirty(offset*2);
+ // m_gx_psac_tilemap->mark_tile_dirty((offset*2)+1);
+}
/**********************************************************************************/
/*
@@ -188,7 +394,7 @@ static struct sprite_entry {
uint32_t adr;
} sprites[0x100];
-void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32_t spr, int count)
+void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32_t spr, int count, int prislot, int xoff)
{
int scount = 0;
int ecount = 0;
@@ -198,7 +404,7 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
int pri;
if(!space.read_word(adr+2))
continue;
- pri = space.read_word(adr+28);
+ pri = space.read_word(adr+prislot);
if(pri < 256) {
sprites[ecount].pri = pri;
@@ -212,7 +418,7 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
uint32_t adr = sprites[i].adr;
if(adr) {
uint32_t set =(space.read_word(adr) << 16)|space.read_word(adr+2);
- uint16_t glob_x = space.read_word(adr+4);
+ uint16_t glob_x = space.read_word(adr+4) + xoff;
uint16_t glob_y = space.read_word(adr+8);
uint16_t flip_x = space.read_word(adr+12) ? 0x1000 : 0x0000;
uint16_t flip_y = space.read_word(adr+14) ? 0x2000 : 0x0000;
@@ -225,24 +431,28 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
uint16_t color_rotate = 0x0000;
uint16_t v;
+ // Shadow mode bits
v = space.read_word(adr+24);
if(v & 0x8000) {
color_mask = 0xf3ff;
color_val |= (v & 3) << 10;
}
+ // Mix/brightness selection bits
v = space.read_word(adr+26);
if(v & 0x8000) {
color_mask &= 0xfcff;
color_val |= (v & 3) << 8;
}
+ // Priority
v = space.read_word(adr+18);
if(v & 0x8000) {
color_mask &= 0xff1f;
color_val |= v & 0xe0;
}
+ // Palette
v = space.read_word(adr+16);
if(v & 0x8000)
color_set = v & 0x1f;
@@ -299,7 +509,7 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
if(color_rotate)
col = (col & 0xffe0) | ((col + color_rotate) & 0x1f);
- space.write_word(spr , (flip ^ glob_f) | sprites[i].pri);
+ space.write_word(spr , (flip ^ glob_f) | i);
space.write_word(spr+ 2, idx);
space.write_word(spr+ 4, y);
space.write_word(spr+ 6, x);
@@ -349,17 +559,17 @@ void konamigx_state::sexyparo_esc(address_space &space, uint32_t p1, uint32_t p2
logerror("sexyparo_esc P1 param: %02x\n", p1);
}
#endif
- generate_sprites(space, 0xc00604, 0xd20000, 0xfc);
+ generate_sprites(space, 0xc00604, 0xd20000, 0xfc, 0x1c /*0x30*/, 4);
}
void konamigx_state::tbyahhoo_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4)
{
- generate_sprites(space, 0xc00000, 0xd20000, 0x100);
+ generate_sprites(space, 0xc00000, 0xd20000, 0x100, 0x1c, 0x14);
}
void konamigx_state::daiskiss_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4)
{
- generate_sprites(space, 0xc00000, 0xd20000, 0x100);
+ generate_sprites(space, 0xc00000, 0xd20000, 0x100, 0x1c, 0);
}
WRITE32_MEMBER(konamigx_state::esc_w)
@@ -370,6 +580,7 @@ WRITE32_MEMBER(konamigx_state::esc_w)
/* ignore nullptr writes to the ESC (these appear to be "keepalives" on the real hardware) */
if (!data)
{
+ set_irq_level(IRQ_ESC, CLEAR_LINE);
return;
}
@@ -423,12 +634,7 @@ WRITE32_MEMBER(konamigx_state::esc_w)
break;
}
space.write_byte(data+9, ESTATE_END);
-
- if (m_gx_wrport1_1 & 0x10)
- {
- m_gx_rdport1_3 &= ~8;
- m_maincpu->set_input_line(4, HOLD_LINE);
- }
+ set_irq_level(IRQ_ESC, ASSERT_LINE);
}
else
{
@@ -445,114 +651,6 @@ WRITE32_MEMBER(konamigx_state::esc_w)
}
/**********************************************************************************/
-/* EEPROM handlers */
-
-CUSTOM_INPUT_MEMBER(konamigx_state::gx_rdport1_3_r)
-{
- return (m_gx_rdport1_3 >> 1);
-}
-
-WRITE32_MEMBER(konamigx_state::eeprom_w)
-{
- uint32_t odata;
-
- if (ACCESSING_BITS_24_31)
- {
- odata = data >> 24;
- /*
- bit 7: afr, a watchdog timer bit
- bit 6: objscan
- bit 5: background color select: 0 = 338 solid color, 1 = 5^5 gradient
- bit 4: coin counter 2
- bit 3: coin counter 1
- bit 2: eeprom clock
- bit 1: eeprom chip select
- bit 0: eeprom data
- */
-
- m_eepromout->write(odata, 0xff);
-
- machine().bookkeeping().coin_counter_w(0, odata & 0x08);
- machine().bookkeeping().coin_counter_w(1, odata & 0x10);
-
- m_gx_wrport1_0 = odata;
- }
-
- if (ACCESSING_BITS_16_23)
- {
- /*
- bit 7 = mask all IRQ
- bit 6 = LAN IRQ enable
- bit 5 = CCU2 IRQ enable
- bit 4 = ESC IRQ enable
- bit 3 = EXCPU IRQ enable
- bit 2 = OBJ IRQ enable
- bit 1 = CCU1-INT2 enable
- bit 0 = CCU1-INT1 enable
- */
-
- m_gx_wrport1_1 = (data>>16)&0xff;
-// logerror("write %x to IRQ register (PC=%x)\n", m_gx_wrport1_1, space.device().safe_pc());
-
- // m_gx_syncen is to ensure each IRQ is triggered at least once after being enabled
- if (m_gx_wrport1_1 & 0x80)
- m_gx_syncen |= m_gx_wrport1_1 & 0x1f;
- }
-}
-
-WRITE32_MEMBER(konamigx_state::control_w)
-{
- // TODO: derive from reported PCB XTALs
- const uint32_t pixclock[4] = { XTAL_6MHz, XTAL_8MHz, XTAL_12MHz, XTAL_16MHz};
- //logerror("write %x to control register (mask=%x)\n", data, mem_mask);
-
- // known controls:
- // bit 23 = reset graphics chips
- // bit 22 = 0 to halt 68000, 1 to let it run (SOUNDRESET)
- // bit 21 = VRAM-CHARD 0=VRAM, 1=ROM
- // bit 20 = OBJCHA line for '246
- // bit 19 = select top 2 sprite priority bits to be 14/15 or 16/17 of the
- // spritelist "color" word.
- // bit 18 = if 0, the top 2 sprite priority bits are "11" else use bit 19's
- // results.
- // bit 17 = DOTSEL1 : 0 = 6M, 1=8M, 2=12M, 3=16M
- // bit 16 = DOTSEL0
- if (ACCESSING_BITS_16_23)
- {
- if (data & 0x400000)
- {
- // Enable sound CPU and DSP
- m_soundcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
- m_soundcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
-
- if (m_sound_ctrl & 0x10)
- m_dasp->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
- }
- else
- {
- m_sound_ctrl = 0;
-
- // Reset sound CPU and DSP
- m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
- m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
- m_dasp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
- m_k056832->reset();
- }
-
- m_k055673->k053246_set_objcha_line((data&0x100000) ? ASSERT_LINE : CLEAR_LINE);
-
- m_gx_wrport2 = (data>>16)&0xff;
-
- if(m_prev_pixel_clock != (m_gx_wrport2 & 3))
- {
- m_k053252->set_unscaled_clock(pixclock[m_gx_wrport2 & 3]);
- m_prev_pixel_clock = m_gx_wrport2 & 3;
- }
- }
-}
-
-
-/**********************************************************************************/
/* IRQ controllers */
TIMER_CALLBACK_MEMBER(konamigx_state::boothack_callback)
@@ -561,159 +659,6 @@ TIMER_CALLBACK_MEMBER(konamigx_state::boothack_callback)
m_maincpu->set_clock_scale(1.0f);
}
-/*
- GX object DMA timings:
-
- 6Mhz dotclock: 42.7us(clear) / 341.3us(transfer)
- 8Mhz dotclock: 32.0us(clear) / 256.0us(transfer)
- 12Mhz dotclock: 42.7us(clear) / 341.3us(transfer)
-*/
-
-TIMER_CALLBACK_MEMBER(konamigx_state::dmaend_callback)
-{
- // foul-proof (CPU0 could be deactivated while we wait)
- if (m_resume_trigger && m_suspension_active)
- {
- m_suspension_active = 0;
- machine().scheduler().trigger(m_resume_trigger);
- }
-
- // DMA busy flag must be cleared before triggering IRQ 3
- m_gx_rdport1_3 &= ~2;
-
- // IRQ 3 is the "object DMA end" IRQ also happens during vblank
- if ((m_gx_wrport1_1 & 0x84) == 0x84 || (m_gx_syncen & 4))
- {
- m_gx_syncen &= ~4;
-
- // lower OBJINT-REQ flag and trigger interrupt
- m_gx_rdport1_3 &= ~0x80;
- m_maincpu->set_input_line(3, HOLD_LINE);
- }
-}
-
-void konamigx_state::dmastart_callback(int data)
-{
- int sprite_timing;
-
- // raise the DMA busy flag
- // TODO: is it supposed to raise even if DMA is disabled?
- m_gx_rdport1_3 |= 2;
-
- // begin transfer if DMAEN(bit4 of OBJSET1) is set (see p.48)
- if (m_k055673->k053246_read_register(5) & 0x10)
- {
- // disabled by default since it doesn't work too well in MAME
- konamigx_objdma();
- }
-
- // simulate DMA delay
- // TODO: Rushing Heroes doesn't like reported sprite timings, probably due of sprite protection being issued istantly or requires the double buffering ...
- if(m_gx_rushingheroes_hack == 1)
- sprite_timing = 64;
- else
- sprite_timing = m_gx_wrport2 & 1 ? (256+32) : (342+42);
- m_dmadelay_timer->adjust(attotime::from_usec(sprite_timing));
-}
-
-
-INTERRUPT_GEN_MEMBER(konamigx_state::konamigx_type2_vblank_irq)
-{
- // lift idle suspension
- if (m_resume_trigger && m_suspension_active)
- {
- m_suspension_active = 0;
- machine().scheduler().trigger(m_resume_trigger);
- }
-
- // IRQ 1 is the main 60hz vblank interrupt
- if (m_gx_syncen & 0x20)
- {
- m_gx_syncen &= ~0x20;
-
- if ((m_gx_wrport1_1 & 0x81) == 0x81 || (m_gx_syncen & 1))
- {
- m_gx_syncen &= ~1;
- // TODO: enabling ASSERT_LINE breaks opengolf, annoying.
- device.execute().set_input_line(1, HOLD_LINE);
- }
- }
-
- dmastart_callback(0);
-}
-
-TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_type2_scanline)
-{
- int scanline = param;
-
- if(scanline == 48)
- {
- if (m_gx_syncen & 0x40)
- {
- m_gx_syncen &= ~0x40;
-
- if ((m_gx_wrport1_1 & 0x82) == 0x82 || (m_gx_syncen & 2))
- {
- popmessage("HBlank IRQ enabled, contact MAMEdev");
- m_gx_syncen &= ~2;
- m_maincpu->set_input_line(2, HOLD_LINE);
- }
- }
-
- }
-}
-
-TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_type4_scanline)
-{
- int scanline = param;
-
- if (scanline == 240)
- {
- // lift idle suspension
- if (m_resume_trigger && m_suspension_active)
- {
- m_suspension_active = 0;
- machine().scheduler().trigger(m_resume_trigger);
- }
-
- // IRQ 1 is the main 60hz vblank interrupt
- // the m_gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board
- // generates the timing in those cases. With this change, rushing heroes and rng2 boot :)
-
- // maybe this interrupt should only be every 30fps, or maybe there are flags to prevent the game running too fast
- // the real hardware should output the display for each screen on alternate frames
- // if(device->m_screen->frame_number() & 1)
- if (1) // m_gx_syncen & 0x20)
- {
- m_gx_syncen &= ~0x20;
-
- if ((m_gx_wrport1_1 & 0x81) == 0x81 || (m_gx_syncen & 1))
- {
- m_gx_syncen &= ~1;
- m_maincpu->set_input_line(1, HOLD_LINE);
-
- }
- }
-
- dmastart_callback(0);
- }
- else if(scanline < 240) // hblank
- {
- // IRQ 2 is a programmable interrupt with scanline resolution
- if (m_gx_syncen & 0x40)
- {
- m_gx_syncen &= ~0x40;
-
- if ((m_gx_wrport1_1 & 0x82) == 0x82 || (m_gx_syncen & 2))
- {
- m_gx_syncen &= ~2;
- m_maincpu->set_input_line(2, HOLD_LINE);
- }
- }
- }
-}
-
-
/**********************************************************************************/
/* input handlers */
@@ -981,6 +926,140 @@ WRITE32_MEMBER(konamigx_state::type1_cablamps_w)
output().set_led_value(0, (data>>24)&1);
}
+CUSTOM_INPUT_MEMBER(konamigx_state::rdport1_r)
+{
+ uint8_t res = 0x00;
+ if(!(m_irqin & (1 << IRQ_OBJDMA)))
+ res |= 0x80;
+ if(!(m_irqin & (1 << IRQ_EXTIO)))
+ res |= 0x40;
+ if(!(m_irqin & (1 << IRQ_TRACKBALL)))
+ res |= 0x20;
+ if(!(m_irqin & (1 << IRQ_EXTGR)))
+ res |= 0x10;
+ if(!(m_irqin & (1 << IRQ_ESC)))
+ res |= 0x08;
+ if(!(m_irqin & (1 << IRQ_SUBCPU)))
+ res |= 0x04;
+ if(m_objdma)
+ res |= 0x02;
+ if(m_eeprom->do_read())
+ res |= 0x01;
+ return res;
+}
+
+WRITE16_MEMBER(konamigx_state::port1_w)
+{
+ uint16_t old = m_port1;
+ COMBINE_DATA(&m_port1);
+ old ^= m_port1;
+ if(old & 0x1000)
+ machine().bookkeeping().coin_counter_w(1, m_port1 & 0x1000);
+ if(old & 0x0800)
+ machine().bookkeeping().coin_counter_w(0, m_port1 & 0x0800);
+ if(old & 0x0400)
+ m_eeprom->clk_write(!!(m_port1 & 0x0400));
+ if(old & 0x0200)
+ m_eeprom->cs_write(!!(m_port1 & 0x0200));
+ if(old & 0x0100)
+ m_eeprom->di_write(!!(m_port1 & 0x0100));
+ if(old & 0x0080)
+ update_irqs();
+ if(old & 0x0010) {
+ if(m_port1 & 0x0010)
+ m_irqmask |= 1 << IRQ_ESC;
+ else {
+ m_irqmask &= ~(1 << IRQ_ESC);
+ m_irqin &= ~(1 << IRQ_ESC);
+ }
+ update_irqs();
+ }
+ if(old & 0x0008) {
+ if(m_port1 & 0x0008)
+ m_irqmask |= 1 << IRQ_SUBCPU;
+ else {
+ m_irqmask &= ~(1 << IRQ_SUBCPU);
+ m_irqin &= ~(1 << IRQ_SUBCPU);
+ }
+ update_irqs();
+ }
+ if(old & 0x0004) {
+ if(m_port1 & 0x0004)
+ m_irqmask |= 1 << IRQ_OBJDMA;
+ else {
+ m_irqmask &= ~(1 << IRQ_OBJDMA);
+ m_irqin &= ~(1 << IRQ_OBJDMA);
+ }
+ update_irqs();
+ }
+ if(old & 0x0002) {
+ if(m_port1 & 0x0002)
+ m_irqmask |= 1 << IRQ_TIMER;
+ else {
+ m_irqmask &= ~(1 << IRQ_TIMER);
+ m_irqin &= ~(1 << IRQ_TIMER);
+ }
+ update_irqs();
+ }
+ if(old & 0x0001) {
+ if(m_port1 & 0x0001)
+ m_irqmask |= 1 << IRQ_VBLANK;
+ else {
+ m_irqmask &= ~(1 << IRQ_VBLANK);
+ m_irqin &= ~(1 << IRQ_VBLANK);
+ }
+ update_irqs();
+ }
+}
+
+WRITE16_MEMBER(konamigx_state::port2_w)
+{
+ logerror("port2_w %04x@%04x [%04x]\n", data, mem_mask, m_port2);
+ const uint32_t pixclock[4] = { XTAL_48MHz/8, XTAL_32MHz/4, XTAL_48MHz/4, XTAL_32MHz/2};
+ uint16_t old = m_port2;
+ COMBINE_DATA(&m_port2);
+ old ^= m_port2;
+
+ if(old & 0x0040) {
+ if(m_port2 & 0x0040) {
+ // Enable sound CPU and DSP
+ m_soundcpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
+ m_soundcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+
+ if (m_sound_ctrl & 0x10)
+ m_dasp->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+ }
+ else
+ {
+ m_sound_ctrl = 0;
+
+ // Reset sound CPU and DSP
+ m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+ m_soundcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+ m_dasp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+ }
+ }
+
+ m_sprites->set_objcha(m_port2 & 0x10);
+
+ // bits 2-3 are related to the sprite-mixer connection, see
+ // sprites_wiring
+
+ if(old & 3) {
+ uint32_t clock = pixclock[m_port2 & 3];
+ m_video_timings->set_unscaled_clock(clock);
+ m_tilemap->set_unscaled_clock(clock);
+ m_sprites->set_unscaled_clock(pixclock[m_port2 & 1]);
+ }
+}
+
+
+WRITE16_MEMBER(konamigx_state::roz_banking_w)
+{
+ logerror("roz banking bbk(color)=%x cbk(romrb)=%02x hbk(romrb)=%02x\n",
+ data >> 12, (data >> 6) & 0x1f, data & 0x1f);
+}
+
/**********************************************************************************/
/* 68EC020 memory handlers */
/**********************************************************************************/
@@ -990,27 +1069,24 @@ static ADDRESS_MAP_START( gx_base_memmap, AS_PROGRAM, 32, konamigx_state )
AM_RANGE(0x200000, 0x3fffff) AM_ROM // main program ROM
AM_RANGE(0x400000, 0x7fffff) AM_ROM // data ROM
AM_RANGE(0xc00000, 0xc1ffff) AM_RAM AM_SHARE("workram")
- AM_RANGE(0xd00000, 0xd01fff) AM_DEVREAD("k056832", k056832_device, k_5bpp_rom_long_r)
- AM_RANGE(0xd20000, 0xd20fff) AM_DEVREADWRITE16("k055673", k055673_device, k053247_word_r, k053247_word_w, 0xffffffff)
- AM_RANGE(0xd21000, 0xd21fff) AM_RAM // second bank of sprite RAM, accessed thru ESC
- AM_RANGE(0xd22000, 0xd23fff) AM_RAM // extra bank checked at least by sexyparo, pending further investigation.
- AM_RANGE(0xd40000, 0xd4003f) AM_DEVWRITE("k056832", k056832_device, long_w)
- AM_RANGE(0xd44000, 0xd4400f) AM_WRITE(konamigx_tilebank_w)
- AM_RANGE(0xd48000, 0xd48007) AM_DEVWRITE16("k055673", k055673_device, k053246_word_w, 0xffffffff)
- AM_RANGE(0xd4a000, 0xd4a00f) AM_DEVREAD16("k055673", k055673_device, k055673_rom_word_r, 0xffffffff)
- AM_RANGE(0xd4a010, 0xd4a01f) AM_DEVWRITE16("k055673", k055673_device, k055673_reg_word_w, 0xffffffff)
- AM_RANGE(0xd4c000, 0xd4c01f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0xff00ff00)
+ AM_RANGE(0xd00000, 0xd01fff) AM_DEVREAD("tilemap", k054156_056832_device, rom32_r)
+ AM_RANGE(0xd20000, 0xd23fff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0xd40000, 0xd4003f) AM_DEVICE16("tilemap", k054156_056832_device, vacset, 0xffffffff)
+ AM_RANGE(0xd44000, 0xd44007) AM_DEVICE16("tilemap", k054156_056832_device, vsccs, 0xffffffff)
+ AM_RANGE(0xd48000, 0xd48007) AM_DEVICE16("sprites", k053246_055673_device, objset1, 0xffffffff)
+ AM_RANGE(0xd4a000, 0xd4a00f) AM_DEVREAD("sprites", k053246_055673_device, rom32_r)
+ AM_RANGE(0xd4a010, 0xd4a01f) AM_DEVICE16("sprites", k053246_055673_device, objset2, 0xffffffff)
+ AM_RANGE(0xd4c000, 0xd4c01f) AM_DEVICE8("video_timings", k053252_device, map, 0xff00ff00)
AM_RANGE(0xd4e000, 0xd4e01f) AM_WRITENOP // left-over for "secondary" CCU, apparently (used by type 3/4 for slave screen?)
- AM_RANGE(0xd50000, 0xd500ff) AM_DEVWRITE("k055555", k055555_device, K055555_long_w)
+ AM_RANGE(0xd50000, 0xd500ff) AM_DEVICE8("mixer", k055555_device, map, 0xff00ff00)
AM_RANGE(0xd52000, 0xd5201f) AM_DEVREADWRITE8("k056800", k056800_device, host_r, host_w, 0xff00ff00)
- AM_RANGE(0xd56000, 0xd56003) AM_WRITE(eeprom_w)
- AM_RANGE(0xd58000, 0xd58003) AM_WRITE(control_w)
+ AM_RANGE(0xd56000, 0xd56003) AM_WRITE16(port1_w, 0xffff0000)
+ AM_RANGE(0xd58000, 0xd58003) AM_WRITE16(port2_w, 0xffff0000)
AM_RANGE(0xd5a000, 0xd5a003) AM_READ_PORT("SYSTEM_DSW")
AM_RANGE(0xd5c000, 0xd5c003) AM_READ_PORT("INPUTS")
AM_RANGE(0xd5e000, 0xd5e003) AM_READ_PORT("SERVICE")
- AM_RANGE(0xd80000, 0xd8001f) AM_DEVWRITE("k054338", k054338_device, long_w)
- AM_RANGE(0xda0000, 0xda1fff) AM_DEVREADWRITE("k056832", k056832_device, ram_long_r, ram_long_w)
- AM_RANGE(0xda2000, 0xda3fff) AM_DEVREADWRITE("k056832", k056832_device, ram_long_r, ram_long_w)
+ AM_RANGE(0xd80000, 0xd8001f) AM_DEVICE16("blender", k054338_device, map, 0xffffffff)
+ AM_RANGE(0xda0000, 0xda1fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_056832_device, vram32_r, vram32_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( gx_type1_map, AS_PROGRAM, 32, konamigx_state )
@@ -1020,15 +1096,15 @@ static ADDRESS_MAP_START( gx_type1_map, AS_PROGRAM, 32, konamigx_state )
AM_RANGE(0xdda000, 0xddafff) AM_WRITE_PORT("ADC-WRPORT")
AM_RANGE(0xddc000, 0xddcfff) AM_READ_PORT("ADC-RDPORT")
AM_RANGE(0xdde000, 0xdde003) AM_WRITE(type1_cablamps_w)
- AM_RANGE(0xe00000, 0xe0001f) AM_RAM AM_SHARE("k053936_0_ctrl")
- AM_RANGE(0xe20000, 0xe2000f) AM_WRITENOP
- AM_RANGE(0xe40000, 0xe40003) AM_WRITENOP
- AM_RANGE(0xe80000, 0xe81fff) AM_RAM AM_SHARE("k053936_0_line") // chips 21L+19L / S
- AM_RANGE(0xec0000, 0xedffff) AM_RAM_WRITE(konamigx_t1_psacmap_w) AM_SHARE("psacram") // chips 20J+23J+18J / S
- AM_RANGE(0xf00000, 0xf3ffff) AM_READ(type1_roz_r1) // ROM readback
- AM_RANGE(0xf40000, 0xf7ffff) AM_READ(type1_roz_r2) // ROM readback
- AM_RANGE(0xf80000, 0xf80fff) AM_RAM // chip 21Q / S
- AM_RANGE(0xfc0000, 0xfc00ff) AM_RAM // chip 22N / S
+ AM_RANGE(0xe00000, 0xe0001f) AM_DEVICE16("roz", k053936_device, map, 0xffffffff) // psac4/pasc2/adcrdcs/adcwrcs/lanciocs/lancramcs
+// AM_RANGE(0xe20000, 0xe2000f) AM_WRITENOP //
+ AM_RANGE(0xe40000, 0xe40003) AM_WRITE16(roz_banking_w, 0xffff0000)
+ AM_RANGE(0xe80000, 0xe81fff) AM_RAM AM_SHARE("rozram") // chips 21L+19L / S lram2cs
+ AM_RANGE(0xec0000, 0xedffff) AM_RAM_WRITE(konamigx_t1_psacmap_w) AM_SHARE("psacram") // chips 20J+23J+18J / S yramcs
+ AM_RANGE(0xf00000, 0xf3ffff) AM_READ(type1_roz_r1) // ROM readback // hromcs
+ AM_RANGE(0xf40000, 0xf7ffff) AM_READ(type1_roz_r2) // ROM readback // cromcs
+ AM_RANGE(0xf80000, 0xf80fff) AM_RAM // chip 21Q / S // lram4cs
+ AM_RANGE(0xfc0000, 0xfc00ff) AM_RAM // chip 22N / S // bramcs
AM_IMPORT_FROM(gx_base_memmap)
ADDRESS_MAP_END
@@ -1190,8 +1266,7 @@ static INPUT_PORTS_START( common )
// excpuint stat, objdma stat, eeprom do
// note: racin' force expects bit 1 of the eeprom port to toggle
- PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
- PORT_BIT( 0x000000fe, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, konamigx_state, gx_rdport1_3_r, nullptr)
+ PORT_BIT( 0x000000ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, konamigx_state, rdport1_r, NULL)
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1201,11 +1276,6 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED ) /* DIP#1 & DIP#2 */
-
- PORT_START( "EEPROMOUT" )
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, di_write)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, clk_write)
INPUT_PORTS_END
@@ -1605,66 +1675,52 @@ WRITE_LINE_MEMBER(konamigx_state::hblank_irq_ack_w)
static MACHINE_CONFIG_START( konamigx )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68EC020, MASTER_CLOCK)
+ MCFG_CPU_ADD("maincpu", M68EC020, CLK_24M)
MCFG_CPU_PROGRAM_MAP(gx_type2_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", konamigx_state, konamigx_type2_vblank_irq)
- MCFG_CPU_ADD("soundcpu", M68000, SUB_CLOCK/2)
+ MCFG_CPU_ADD("soundcpu", M68000, CLK_8M)
MCFG_CPU_PROGRAM_MAP(gxsndmap)
- MCFG_CPU_ADD("dasp", TMS57002, MASTER_CLOCK/2)
+ MCFG_CPU_ADD("dasp", TMS57002, CLK_24M)
MCFG_CPU_DATA_MAP(gxtmsmap)
- MCFG_DEVICE_ADD("k053252", K053252, MASTER_CLOCK/4)
- MCFG_K053252_OFFSETS(24, 16)
- MCFG_K053252_INT1_ACK_CB(WRITELINE(konamigx_state, vblank_irq_ack_w))
- MCFG_K053252_INT2_ACK_CB(WRITELINE(konamigx_state, hblank_irq_ack_w))
- MCFG_VIDEO_SET_SCREEN("screen")
-
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
+ MCFG_DEVICE_ADD("video_timings", K053252, CLK_6M)
+ MCFG_K053252_INT1_CB(WRITELINE(konamigx_state, vblankirq_w))
+ MCFG_K053252_INT2_CB(WRITELINE(konamigx_state, htimerirq_w))
+ MCFG_K053252_VSYNC_CB(DEVWRITELINE(":tilemap", k054156_056832_device, vsync_w))
+ MCFG_K053252_VBLANK_CB(DEVWRITELINE(":sprites", k053246_055673_device, vblank_w))
+ MCFG_K053252_KSNOTIFIER_CB(DEVKSNOTIFIER(":tilemap", k054156_056832_device, ksnotifier_w))
+ MCFG_KSNOTIFIER_CHAIN(DEVKSNOTIFIER(":sprites", k053246_055673_device, ksnotifier_w))
+ MCFG_VIDEO_SET_SCREEN("screen")
+
MCFG_MACHINE_START_OVERRIDE(konamigx_state,konamigx)
MCFG_MACHINE_RESET_OVERRIDE(konamigx_state,konamigx)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
/* video hardware */
+ MCFG_FLOW_RENDER_MANAGER_ADD("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", konamigx_state, fr_setup_single_screen_no_sub)
+
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223)
- /* These parameters are actual value written to the CCU.
- tbyahhoo attract mode desync is caused by another matter. */
-
- //MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
- // TODO: WTF, without these most games crashes? Some legacy call in video code???
- MCFG_SCREEN_SIZE(1024, 1024)
- MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 16, 16+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(konamigx_state, screen_update_konamigx)
+ MCFG_SCREEN_FLOW_RENDER_RGB()
MCFG_PALETTE_ADD("palette", 8192)
MCFG_PALETTE_FORMAT(XRGB)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
-
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(konamigx_state, type2_tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "none")
- MCFG_K056832_PALETTE("palette")
- MCFG_K055555_ADD("k055555")
+ MCFG_K054156_056832_ADD("tilemap", CLK_6M, 4, 4, 24)
- MCFG_DEVICE_ADD("k054338", K054338, 0)
- MCFG_K054338_MIXER("k055555")
- MCFG_K054338_SET_SCREEN("screen")
- MCFG_K054338_ALPHAINV(1)
+ MCFG_K053246_055673_ADD("sprites", CLK_6M, "spriteram")
+ MCFG_K053246_055673_WIRING_CB(konamigx_state, sprites_wiring)
+ MCFG_K053246_055673_DMAACT_CB(WRITELINE(konamigx_state, objdmaact_w))
+ MCFG_K053246_055673_DMAIRQ_CB(WRITELINE(konamigx_state, objdmairq_w))
- MCFG_DEVICE_ADD("k055673", K055673, 0)
- MCFG_K055673_CB(konamigx_state, type2_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -26, -23)
- MCFG_K055673_SET_SCREEN("screen")
- MCFG_K055673_PALETTE("palette")
+ MCFG_K055555_ADD("mixer")
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_5bpp)
+ MCFG_K054338_ADD("blender", "palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -1673,10 +1729,10 @@ static MACHINE_CONFIG_START( konamigx )
MCFG_SOUND_ROUTE(0, "lspeaker", 0.3)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.3)
- MCFG_K056800_ADD("k056800", XTAL_18_432MHz)
+ MCFG_K056800_ADD("k056800", CLK_18M432)
MCFG_K056800_INT_HANDLER(INPUTLINE("soundcpu", M68K_IRQ_1))
- MCFG_DEVICE_ADD("k054539_1", K054539, XTAL_18_432MHz)
+ MCFG_DEVICE_ADD("k054539_1", K054539, CLK_18M432)
MCFG_K054539_REGION_OVERRRIDE("shared")
MCFG_K054539_TIMER_HANDLER(WRITELINE(konamigx_state, k054539_irq_gen))
MCFG_SOUND_ROUTE_EX(0, "dasp", 0.5, 0)
@@ -1684,7 +1740,7 @@ static MACHINE_CONFIG_START( konamigx )
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
- MCFG_DEVICE_ADD("k054539_2", K054539, XTAL_18_432MHz)
+ MCFG_DEVICE_ADD("k054539_2", K054539, CLK_18M432)
MCFG_K054539_REGION_OVERRRIDE("shared")
MCFG_SOUND_ROUTE_EX(0, "dasp", 0.5, 2)
MCFG_SOUND_ROUTE_EX(1, "dasp", 0.5, 3)
@@ -1692,113 +1748,49 @@ static MACHINE_CONFIG_START( konamigx )
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( konamigx_bios, konamigx )
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 0, 0, "k055555")
-MACHINE_CONFIG_END
-
-static MACHINE_CONFIG_DERIVED( gokuparo, konamigx )
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23)
-MACHINE_CONFIG_END
+// Config for the "standard" 6/8MHz screen configurations, so that
+// Mame chooses correct window sizes at startup. Not required
+// otherwise, but gives a better user experience.
-static MACHINE_CONFIG_DERIVED( sexyparo, konamigx )
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CB(konamigx_state, alpha_tile_callback)
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -42, -23)
-MACHINE_CONFIG_END
-
-static MACHINE_CONFIG_DERIVED( tbyahhoo, konamigx )
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "k055555")
-MACHINE_CONFIG_END
-
-static MACHINE_CONFIG_DERIVED( dragoonj, konamigx )
+static MACHINE_CONFIG_DERIVED( kgx_288x224, konamigx )
MCFG_SCREEN_MODIFY("screen")
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, dragoonj)
-
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(24+16, 16)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 1, 0, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(konamigx_state, dragoonj_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -53, -23)
-MACHINE_CONFIG_END
-
-static MACHINE_CONFIG_DERIVED( le2, konamigx )
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, le2)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type2_scanline, "screen", 0, 1)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 1, 0, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(konamigx_state, le2_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -46, -23)
+ MCFG_SCREEN_RAW_PARAMS(CLK_6M, 384, 49, 49+288, 264, 15, 15+224)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( konamigx_6bpp, konamigx )
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_6bpp)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -46, -23)
+static MACHINE_CONFIG_DERIVED( kgx_384x224, konamigx )
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_RAW_PARAMS(CLK_8M, 512, 64, 64+384, 264, 15, 15+224)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( salmndr2, konamigx )
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 1, 0, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(konamigx_state, salmndr2_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -48, -23)
+static MACHINE_CONFIG_DERIVED( kgx_384x256, konamigx )
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_RAW_PARAMS(CLK_8M, 512, 64, 64+384, 289, 15, 15+256)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( opengolf, konamigx )
+static MACHINE_CONFIG_DERIVED( kgx_576x252, konamigx )
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223)
- MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
-
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", opengolf)
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, opengolf)
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -53, -23)
+ MCFG_SCREEN_RAW_PARAMS(CLK_12M, 768, 78, 78+576, 285, 15, 15+252)
+MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( opengolf, kgx_384x224 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(gx_type1_map)
+ MCFG_K053936_ADD("roz", "rozram")
+
MCFG_DEVICE_ADD("adc0834", ADC0834, 0)
MCFG_ADC083X_INPUT_CB(konamigx_state, adc0834_callback)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( racinfrc, konamigx )
- MCFG_SCREEN_MODIFY("screen")
- //MCFG_SCREEN_RAW_PARAMS(6000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223)
- //MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1)
-
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", racinfrc)
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, racinfrc)
-
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(24-8+16, 0)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 0, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -53, -23)
-
+static MACHINE_CONFIG_DERIVED( racinfrc, kgx_384x256 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(gx_type1_map)
+ MCFG_K053936_ADD("roz", "rozram")
+
+ MCFG_DEVICE_MODIFY("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", konamigx_state, fr_setup_single_screen_voxels)
+
MCFG_DEVICE_ADD("adc0834", ADC0834, 0)
MCFG_ADC083X_INPUT_CB(konamigx_state, adc0834_callback)
MACHINE_CONFIG_END
@@ -1807,81 +1799,61 @@ static MACHINE_CONFIG_DERIVED( gxtype3, konamigx )
MCFG_DEVICE_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(gx_type3_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type4_scanline, "screen", 0, 1)
+// MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type4_scanline, "screen", 0, 1)
MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", type3)
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type3)
-
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(0, 16)
- MCFG_K053252_SET_SLAVE_SCREEN("screen2")
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_6, 0, 2, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23)
+// MCFG_DEVICE_MODIFY("video_timings")
+// MCFG_K053252_OFFSETS(0, 16)
+// MCFG_K053252_SET_SLAVE_SCREEN("screen2")
MCFG_DEVICE_REMOVE("palette")
MCFG_PALETTE_ADD("palette", 16384)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_RAW_PARAMS(XTAL_32MHz*3/16, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
MCFG_SCREEN_SIZE(1024, 1024)
MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
- MCFG_SCREEN_UPDATE_DRIVER(konamigx_state, screen_update_konamigx_left)
MCFG_SCREEN_ADD("screen2", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
- MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
+ MCFG_SCREEN_RAW_PARAMS(XTAL_32MHz*3/16, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
MCFG_SCREEN_SIZE(1024, 1024)
MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
- MCFG_SCREEN_UPDATE_DRIVER(konamigx_state, screen_update_konamigx_right)
+
+// MCFG_GFXDECODE_MODIFY("gfxdecode", type34)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gxtype4, konamigx )
MCFG_DEVICE_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(gx_type4_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type4_scanline, "screen", 0, 1)
+// MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_type4_scanline, "screen", 0, 1)
MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
+ MCFG_SCREEN_RAW_PARAMS(XTAL_32MHz*3/16, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
//MCFG_SCREEN_SIZE(128*8, 264)
//MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16)
- MCFG_SCREEN_UPDATE_DRIVER(konamigx_state, screen_update_konamigx_left)
MCFG_SCREEN_ADD("screen2", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
- MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
+ MCFG_SCREEN_RAW_PARAMS(XTAL_32MHz*3/16, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
MCFG_SCREEN_SIZE(1024, 1024)
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 16, 32*8-1-16)
- MCFG_SCREEN_UPDATE_DRIVER(konamigx_state, screen_update_konamigx_right)
MCFG_DEVICE_REMOVE("palette")
MCFG_PALETTE_ADD("palette", 8192)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
-
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", type4)
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4)
-
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(0, 16)
- MCFG_K053252_SET_SLAVE_SCREEN("screen2")
+// MCFG_GFXDECODE_MODIFY("gfxdecode", type4)
+// MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4)
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 0, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro
+// MCFG_DEVICE_MODIFY("video_timings")
+// MCFG_K053252_OFFSETS(0, 16)
+// MCFG_K053252_SET_SLAVE_SCREEN("screen2")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 )
@@ -1891,43 +1863,12 @@ static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 )
//MCFG_SCREEN_SIZE(128*8, 32*8)
//MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(0, 16)
-
-
MCFG_SCREEN_MODIFY("screen2")
MCFG_SCREEN_SIZE(1024, 1024)
MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16)
-
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_vsn)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2, "none") // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -132, -23)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gxtype4sd2, gxtype4 )
- MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_sd2)
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX6, -81, -23)
-MACHINE_CONFIG_END
-
-static MACHINE_CONFIG_DERIVED( winspike, konamigx )
- //MCFG_SCREEN_MODIFY("screen")
- //MCFG_SCREEN_VISIBLE_AREA(38, 38+384-1, 16, 16+224-1)
-
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(24+15, 16)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CB(konamigx_state, alpha_tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_8, 0, 2, "none")
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -53, -23)
MACHINE_CONFIG_END
@@ -1951,27 +1892,23 @@ ROM_START(konamigx)
ROM_FILL( 0x101, 1, 0xfe )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASEFF )
+ ROM_REGION( 0x100000, "tilemap", ROMREGION_ERASEFF )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASEFF )
+ ROM_REGION( 0x100000, "sprites", ROMREGION_ERASEFF )
/* sound samples */
ROM_REGION( 0x400000, "shared", ROMREGION_ERASE00 )
ROM_END
-#define SPR_WOR_DROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(5))
-#define SPR_5TH_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(5))
-
-#define TILE_WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPDWORD | ROM_SKIP(1))
-#define TILE_BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(4))
+#define TILE_2WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(2))
+#define TILE_1BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(7)) ROM_RELOAD(offset+4, length)
+#define TILE_2BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(3))
-#define TILE_WORDS2_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPDWORD | ROM_SKIP(2))
-#define TILE_BYTES2_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(4))
+#define SPR_WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(6))
+#define SPR_BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(7))
#define T1_PSAC6_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(2))
#define T1_PSAC8_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(3))
-#define _48_WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(4))
-
/* Gokujou Parodius version JAD (Japan) */
ROM_START( gokuparo )
@@ -1987,15 +1924,15 @@ ROM_START( gokuparo )
ROM_LOAD16_BYTE("321b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
- TILE_BYTE_ROM_LOAD( "321b12.13g", 0x000004, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
+ TILE_1BYTE_ROM_LOAD( "321b12.13g", 0x000002, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
- ROM_LOAD32_WORD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
- ROM_LOAD( "321b09.30g", 0x400000, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
+ SPR_WORD_ROM_LOAD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
+ SPR_BYTE_ROM_LOAD( "321b09.30g", 0x000004, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2020,15 +1957,15 @@ ROM_START( fantjour )
ROM_LOAD16_BYTE("321b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
- TILE_BYTE_ROM_LOAD( "321b12.13g", 0x000004, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
+ TILE_1BYTE_ROM_LOAD( "321b12.13g", 0x000002, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
- ROM_LOAD32_WORD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
- ROM_LOAD( "321b09.30g", 0x400000, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
+ SPR_WORD_ROM_LOAD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
+ SPR_BYTE_ROM_LOAD( "321b09.30g", 0x000004, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2053,15 +1990,15 @@ ROM_START( fantjoura )
ROM_LOAD16_BYTE("321b07.7c", 0x000001, 128*1024, CRC(c47634c0) SHA1(20e4105df5bbc33edd01894e78f74ed5f173576e) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
- TILE_BYTE_ROM_LOAD( "321b12.13g", 0x000004, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "321b14.17h", 0x000000, 2*1024*1024, CRC(437d0057) SHA1(30c449200e0510dc664289b527bade6e10dbe57a) )
+ TILE_1BYTE_ROM_LOAD( "321b12.13g", 0x000002, 512*1024, CRC(5f9edfa0) SHA1(36d54c5fe498a4d0fa64757cef11c56c67518258) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
- ROM_LOAD32_WORD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
- ROM_LOAD( "321b09.30g", 0x400000, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "321b11.25g", 0x000000, 2*1024*1024, CRC(c6e2e74d) SHA1(3875a50923e46e2986dbe2573453af5c7fa726f7) )
+ SPR_WORD_ROM_LOAD( "321b10.28g", 0x000002, 2*1024*1024, CRC(ea9f8c48) SHA1(b5e880015887308a5f1c1c623011d9b0903e848f) )
+ SPR_BYTE_ROM_LOAD( "321b09.30g", 0x000004, 1*1024*1024, CRC(94add237) SHA1(9a6d0a9727e7fa02d91ece220b145074a6741a95) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2086,16 +2023,16 @@ ROM_START( salmndr2 )
ROM_LOAD16_BYTE("521-a05.7c", 0x000001, 64*1024, CRC(51a3af2c) SHA1(94d220ae619d53747bd3e762000ed59cf1b4d305) )
/* tiles */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD("521-a09.17h", 0x000000, 2*1024*1024, CRC(fb9e2f5e) SHA1(acb41616625d6976ad50e184787ab74e29f86039) )
- TILE_WORDS2_ROM_LOAD("521-a11.15h", 0x300000, 1*1024*1024, CRC(25e0a6e5) SHA1(592e9f183f077e9272a4f0ead441b5bfd8029816) )
- TILE_BYTES2_ROM_LOAD("521-a13.13c", 0x000004, 2*1024*1024, CRC(3ed7441b) SHA1(57e3e8035c056cf46a383d228c76a7da7def134f) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD("521-a09.17h", 0x000000, 2*1024*1024, CRC(fb9e2f5e) SHA1(acb41616625d6976ad50e184787ab74e29f86039) )
+ TILE_2WORD_ROM_LOAD("521-a11.15h", 0x400000, 1*1024*1024, CRC(25e0a6e5) SHA1(592e9f183f077e9272a4f0ead441b5bfd8029816) )
+ TILE_2BYTE_ROM_LOAD("521-a13.13c", 0x000002, 2*1024*1024, CRC(3ed7441b) SHA1(57e3e8035c056cf46a383d228c76a7da7def134f) )
/* sprites */
- ROM_REGION( 0x600000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "521-a08.25g", 0x000000, 2*1024*1024, CRC(f24f76bd) SHA1(823f614d436901241743c923206cb61d8bbb5c58) )
- _48_WORD_ROM_LOAD( "521-a07.28g", 0x000002, 2*1024*1024, CRC(50ef9b7a) SHA1(104eac2bce43e99d4adc208145afe7be9156628e) )
- _48_WORD_ROM_LOAD( "521-a06.30g", 0x000004, 2*1024*1024, CRC(cba5db2c) SHA1(505efdf8571ae28d8788dcafbfffcfb67e3189ce) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "521-a08.25g", 0x000000, 2*1024*1024, CRC(f24f76bd) SHA1(823f614d436901241743c923206cb61d8bbb5c58) )
+ SPR_WORD_ROM_LOAD( "521-a07.28g", 0x000002, 2*1024*1024, CRC(50ef9b7a) SHA1(104eac2bce43e99d4adc208145afe7be9156628e) )
+ SPR_WORD_ROM_LOAD( "521-a06.30g", 0x000004, 2*1024*1024, CRC(cba5db2c) SHA1(505efdf8571ae28d8788dcafbfffcfb67e3189ce) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2120,16 +2057,16 @@ ROM_START( salmndr2a )
ROM_LOAD16_BYTE("521-a05.7c", 0x000001, 64*1024, CRC(51a3af2c) SHA1(94d220ae619d53747bd3e762000ed59cf1b4d305) )
/* tiles */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD("521-a09.17h", 0x000000, 2*1024*1024, CRC(fb9e2f5e) SHA1(acb41616625d6976ad50e184787ab74e29f86039) )
- TILE_WORDS2_ROM_LOAD("521-a11.15h", 0x300000, 1*1024*1024, CRC(25e0a6e5) SHA1(592e9f183f077e9272a4f0ead441b5bfd8029816) )
- TILE_BYTES2_ROM_LOAD("521-a13.13c", 0x000004, 2*1024*1024, CRC(3ed7441b) SHA1(57e3e8035c056cf46a383d228c76a7da7def134f) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD("521-a09.17h", 0x000000, 2*1024*1024, CRC(fb9e2f5e) SHA1(acb41616625d6976ad50e184787ab74e29f86039) )
+ TILE_2WORD_ROM_LOAD("521-a11.15h", 0x400000, 1*1024*1024, CRC(25e0a6e5) SHA1(592e9f183f077e9272a4f0ead441b5bfd8029816) )
+ TILE_2BYTE_ROM_LOAD("521-a13.13c", 0x000002, 2*1024*1024, CRC(3ed7441b) SHA1(57e3e8035c056cf46a383d228c76a7da7def134f) )
/* sprites */
- ROM_REGION( 0x600000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "521-a08.25g", 0x000000, 2*1024*1024, CRC(f24f76bd) SHA1(823f614d436901241743c923206cb61d8bbb5c58) )
- _48_WORD_ROM_LOAD( "521-a07.28g", 0x000002, 2*1024*1024, CRC(50ef9b7a) SHA1(104eac2bce43e99d4adc208145afe7be9156628e) )
- _48_WORD_ROM_LOAD( "521-a06.30g", 0x000004, 2*1024*1024, CRC(cba5db2c) SHA1(505efdf8571ae28d8788dcafbfffcfb67e3189ce) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "521-a08.25g", 0x000000, 2*1024*1024, CRC(f24f76bd) SHA1(823f614d436901241743c923206cb61d8bbb5c58) )
+ SPR_WORD_ROM_LOAD( "521-a07.28g", 0x000002, 2*1024*1024, CRC(50ef9b7a) SHA1(104eac2bce43e99d4adc208145afe7be9156628e) )
+ SPR_WORD_ROM_LOAD( "521-a06.30g", 0x000004, 2*1024*1024, CRC(cba5db2c) SHA1(505efdf8571ae28d8788dcafbfffcfb67e3189ce) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2154,15 +2091,15 @@ ROM_START( tbyahhoo )
ROM_LOAD16_BYTE("424a07.7c", 0x000001, 128*1024, CRC(fa90d7e2) SHA1(6b6dee29643309005834416bdfdb18d74f34cb1b) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "424a14.17h", 0x000000, 2*1024*1024, CRC(b1d9fce8) SHA1(143ed2f03ac10a0f18d878c0ee0509a5714e4664) )
- TILE_BYTE_ROM_LOAD( "424a12.13g", 0x000004, 512*1024, CRC(7f9cb8b1) SHA1(f5e18d70fcb572bb85f9b064995fc0ab0bb581e8) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "424a14.17h", 0x000000, 2*1024*1024, CRC(b1d9fce8) SHA1(143ed2f03ac10a0f18d878c0ee0509a5714e4664) )
+ TILE_1BYTE_ROM_LOAD( "424a12.13g", 0x000002, 512*1024, CRC(7f9cb8b1) SHA1(f5e18d70fcb572bb85f9b064995fc0ab0bb581e8) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "424a11.25g", 0x000000, 2*1024*1024, CRC(29592688) SHA1(a4b44e9153988a510915af83116e3c18dd15642f) )
- ROM_LOAD32_WORD( "424a10.28g", 0x000002, 2*1024*1024, CRC(cf24e5e3) SHA1(095bf2ae4f47c6e4768515ae5e22c982fbc660a5) )
- ROM_LOAD( "424a09.30g", 0x400000, 1*1024*1024, CRC(daa07224) SHA1(198cafa3d0ead2aa2593be066c6f372e66c11c44) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "424a11.25g", 0x000000, 2*1024*1024, CRC(29592688) SHA1(a4b44e9153988a510915af83116e3c18dd15642f) )
+ SPR_WORD_ROM_LOAD( "424a10.28g", 0x000002, 2*1024*1024, CRC(cf24e5e3) SHA1(095bf2ae4f47c6e4768515ae5e22c982fbc660a5) )
+ SPR_BYTE_ROM_LOAD( "424a09.30g", 0x000004, 1*1024*1024, CRC(daa07224) SHA1(198cafa3d0ead2aa2593be066c6f372e66c11c44) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2187,15 +2124,15 @@ ROM_START( daiskiss )
ROM_LOAD16_BYTE("535a09.7c", 0x000001, 128*1024, CRC(8ec57ab4) SHA1(bd8e12c796d42d2cb27c1e47dc6253bfb74a2887) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "535a19.17h", 0x000000, 2*1024*1024, CRC(fa1c59d1) SHA1(7344afab2b8101f979c35ff9ec8d9c18475bb821) )
- TILE_BYTE_ROM_LOAD( "535a18.13g", 0x000004, 512*1024, CRC(d02e5103) SHA1(43c63a718a034636bad29d2def054d8b48f071e3) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "535a19.17h", 0x000000, 2*1024*1024, CRC(fa1c59d1) SHA1(7344afab2b8101f979c35ff9ec8d9c18475bb821) )
+ TILE_1BYTE_ROM_LOAD( "535a18.13g", 0x000002, 512*1024, CRC(d02e5103) SHA1(43c63a718a034636bad29d2def054d8b48f071e3) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "535a17.25g", 0x000000, 1*1024*1024, CRC(b12070e2) SHA1(51a763bf0e2c1d5c2b9983fcd4304d74c7fe6dd1) )
- ROM_LOAD32_WORD( "535a13.28g", 0x000002, 1*1024*1024, CRC(10cf9d05) SHA1(6c6e51082ce340643d381863fec9b220e3d0ac53) )
- ROM_LOAD( "535a11.30g", 0x400000, 512*1024, CRC(2b176b0f) SHA1(ecf4114d95a308be8f96a5c602c0f5ed5ffc8f29) )
+ ROM_REGION( 0x400000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "535a17.25g", 0x000000, 1*1024*1024, CRC(b12070e2) SHA1(51a763bf0e2c1d5c2b9983fcd4304d74c7fe6dd1) )
+ SPR_WORD_ROM_LOAD( "535a13.28g", 0x000002, 1*1024*1024, CRC(10cf9d05) SHA1(6c6e51082ce340643d381863fec9b220e3d0ac53) )
+ SPR_BYTE_ROM_LOAD( "535a11.30g", 0x000004, 512*1024, CRC(2b176b0f) SHA1(ecf4114d95a308be8f96a5c602c0f5ed5ffc8f29) )
/* sound data */
ROM_REGION( 0x200000, "shared", 0 )
@@ -2216,15 +2153,15 @@ ROM_START( sexyparo )
ROM_LOAD16_BYTE("533a09.7c", 0x000001, 128*1024, CRC(a93c6f0b) SHA1(bee1abab985c7163212cad1a4bc0a427804dfed3) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "533a19.17h", 0x000000, 2*1024*1024, CRC(3ec1843e) SHA1(5d2c37f1eb299c846daa63f35ccd5334a516a1f5) )
- TILE_BYTE_ROM_LOAD( "533a18.13g", 0x000004, 512*1024, CRC(d3e0d058) SHA1(c50bdb3493501bfbbe092d01f5d4c38bfa3412f8) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "533a19.17h", 0x000000, 2*1024*1024, CRC(3ec1843e) SHA1(5d2c37f1eb299c846daa63f35ccd5334a516a1f5) )
+ TILE_1BYTE_ROM_LOAD( "533a18.13g", 0x000002, 512*1024, CRC(d3e0d058) SHA1(c50bdb3493501bfbbe092d01f5d4c38bfa3412f8) )
/* sprites */
- ROM_REGION( 0x600000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "533a17.25g", 0x000000, 2*1024*1024, CRC(9947af57) SHA1(a8f67cb49cf55e8402de352bb530c7c90c643144) )
- ROM_LOAD32_WORD( "533a13.28g", 0x000002, 2*1024*1024, CRC(58f1fc38) SHA1(9662b4fb036ffe90f294ee36fa52a0c1e1dbd116) )
- ROM_LOAD( "533a11.30g", 0x400000, 2*1024*1024, CRC(983105e1) SHA1(c688f6f73fab16107f01523081558a2e02a5311c) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "533a17.25g", 0x000000, 2*1024*1024, CRC(9947af57) SHA1(a8f67cb49cf55e8402de352bb530c7c90c643144) )
+ SPR_WORD_ROM_LOAD( "533a13.28g", 0x000002, 2*1024*1024, CRC(58f1fc38) SHA1(9662b4fb036ffe90f294ee36fa52a0c1e1dbd116) )
+ SPR_BYTE_ROM_LOAD( "533a11.30g", 0x000004, 1024*1024, CRC(39bca8e0) SHA1(a1d21491ee4080bbc99c7d858e3d91abc75bf607) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2246,15 +2183,15 @@ ROM_START( sexyparoa )
ROM_LOAD16_BYTE("533aaa09.7c", 0x000001, 128*1024, CRC(49086451) SHA1(8fdbeb5889e476dfd3f31619d5b5280a0494de69) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "533a19.17h", 0x000000, 2*1024*1024, CRC(3ec1843e) SHA1(5d2c37f1eb299c846daa63f35ccd5334a516a1f5) )
- TILE_BYTE_ROM_LOAD( "533a18.13g", 0x000004, 512*1024, CRC(d3e0d058) SHA1(c50bdb3493501bfbbe092d01f5d4c38bfa3412f8) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "533a19.17h", 0x000000, 2*1024*1024, CRC(3ec1843e) SHA1(5d2c37f1eb299c846daa63f35ccd5334a516a1f5) )
+ TILE_1BYTE_ROM_LOAD( "533a18.13g", 0x000002, 512*1024, CRC(d3e0d058) SHA1(c50bdb3493501bfbbe092d01f5d4c38bfa3412f8) )
/* sprites */
- ROM_REGION( 0x600000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "533a17.25g", 0x000000, 2*1024*1024, CRC(9947af57) SHA1(a8f67cb49cf55e8402de352bb530c7c90c643144) )
- ROM_LOAD32_WORD( "533a13.28g", 0x000002, 2*1024*1024, CRC(58f1fc38) SHA1(9662b4fb036ffe90f294ee36fa52a0c1e1dbd116) )
- ROM_LOAD( "533a11.30g", 0x400000, 2*1024*1024, CRC(983105e1) SHA1(c688f6f73fab16107f01523081558a2e02a5311c) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "533a17.25g", 0x000000, 2*1024*1024, CRC(9947af57) SHA1(a8f67cb49cf55e8402de352bb530c7c90c643144) )
+ SPR_WORD_ROM_LOAD( "533a13.28g", 0x000002, 2*1024*1024, CRC(58f1fc38) SHA1(9662b4fb036ffe90f294ee36fa52a0c1e1dbd116) )
+ SPR_BYTE_ROM_LOAD( "533a11.30g", 0x000004, 1024*1024, CRC(39bca8e0) SHA1(a1d21491ee4080bbc99c7d858e3d91abc75bf607) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2279,24 +2216,24 @@ ROM_START( rungun2 )
ROM_LOAD16_BYTE("505a07.7m", 0x000001, 128*1024, CRC(5641c603) SHA1(1af1f92032e7f870e1668e8d720742fb53c4d0e2) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "505a21.11r", 0x000000, 1024*1024, CRC(03fda175) SHA1(4fdf7cfaa0d4024a2c40bba1f229c41e0627b8c8) )
- ROM_LOAD16_BYTE( "505a20.11m", 0x000001, 1024*1024, CRC(a6a300fb) SHA1(290d97c6ec36e3cab8e6fcd5310030e00fb0ce07) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "505a21.11r", 0x000000, 1024*1024, CRC(03fda175) SHA1(4fdf7cfaa0d4024a2c40bba1f229c41e0627b8c8) )
+ TILE_2WORD_ROM_LOAD( "505a20.11m", 0x000002, 1024*1024, CRC(a6a300fb) SHA1(290d97c6ec36e3cab8e6fcd5310030e00fb0ce07) )
/* sprites */
- ROM_REGION( 0x1800000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "505a19.14r", 0x0000000, 2*1024*1024, CRC(ffde4f17) SHA1(df93853f7bd3c775a15836b0ca9042f75eb65630) )
- _48_WORD_ROM_LOAD( "505a15.18r", 0x0000002, 2*1024*1024, CRC(d9ab1e6c) SHA1(748a61d939bd335c1b50f440e819303552b3d5a1) )
- _48_WORD_ROM_LOAD( "505a11.23r", 0x0000004, 2*1024*1024, CRC(75c13df0) SHA1(6680f75a67ca510fac29b65bce32fef64e844695) )
- _48_WORD_ROM_LOAD( "505a17.16r", 0x0600000, 2*1024*1024, CRC(8176f2f5) SHA1(d7944314b35bcd5301bbfba8a5b1ed6b35b9b888) )
- _48_WORD_ROM_LOAD( "505a13.21r", 0x0600002, 2*1024*1024, CRC(e60c5191) SHA1(02a8af81682838800489aa1123a453045d70acd8) )
- _48_WORD_ROM_LOAD( "505a09.25r", 0x0600004, 2*1024*1024, CRC(3e1d5a15) SHA1(ec4d46c2f2cc57e6193865357ffb3d62a9eecd4f) )
- _48_WORD_ROM_LOAD( "505a18.18m", 0x0c00000, 2*1024*1024, CRC(c12bacfe) SHA1(5b5f4dd9a51c7a305dd4de1354cd1df2ce75c932) )
- _48_WORD_ROM_LOAD( "505a14.14m", 0x0c00002, 2*1024*1024, CRC(356a75b0) SHA1(5f8b7a9d06d4207f19ed0f7c89513226488afde1) )
- _48_WORD_ROM_LOAD( "505a10.23m", 0x0c00004, 2*1024*1024, CRC(fc315ee0) SHA1(4dab661e0bd8e5386e52d514a1511ceba6e5b7bd) )
- _48_WORD_ROM_LOAD( "505a16.16m", 0x1200000, 2*1024*1024, CRC(ca9c2193) SHA1(cc3fb558b834e0b7914879ab47c3750170d257f4) )
- _48_WORD_ROM_LOAD( "505a12.21m", 0x1200002, 2*1024*1024, CRC(421d5034) SHA1(f7a85b7e41f3ddf9ddbdc6f8b6d3dbf8ba40d61b) )
- _48_WORD_ROM_LOAD( "505a08.25m", 0x1200004, 2*1024*1024, CRC(442ed3ec) SHA1(d44e1c4e9f8c63a8f754f8d20064cec15ae0b6d6) )
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "505a19.14r", 0x0000000, 2*1024*1024, CRC(ffde4f17) SHA1(df93853f7bd3c775a15836b0ca9042f75eb65630) )
+ SPR_WORD_ROM_LOAD( "505a15.18r", 0x0000002, 2*1024*1024, CRC(d9ab1e6c) SHA1(748a61d939bd335c1b50f440e819303552b3d5a1) )
+ SPR_WORD_ROM_LOAD( "505a11.23r", 0x0000004, 2*1024*1024, CRC(75c13df0) SHA1(6680f75a67ca510fac29b65bce32fef64e844695) )
+ SPR_WORD_ROM_LOAD( "505a17.16r", 0x0800000, 2*1024*1024, CRC(8176f2f5) SHA1(d7944314b35bcd5301bbfba8a5b1ed6b35b9b888) )
+ SPR_WORD_ROM_LOAD( "505a13.21r", 0x0800002, 2*1024*1024, CRC(e60c5191) SHA1(02a8af81682838800489aa1123a453045d70acd8) )
+ SPR_WORD_ROM_LOAD( "505a09.25r", 0x0800004, 2*1024*1024, CRC(3e1d5a15) SHA1(ec4d46c2f2cc57e6193865357ffb3d62a9eecd4f) )
+ SPR_WORD_ROM_LOAD( "505a18.18m", 0x1000002, 2*1024*1024, CRC(c12bacfe) SHA1(5b5f4dd9a51c7a305dd4de1354cd1df2ce75c932) )
+ SPR_WORD_ROM_LOAD( "505a14.14m", 0x1000000, 2*1024*1024, CRC(356a75b0) SHA1(5f8b7a9d06d4207f19ed0f7c89513226488afde1) )
+ SPR_WORD_ROM_LOAD( "505a10.23m", 0x1000004, 2*1024*1024, CRC(fc315ee0) SHA1(4dab661e0bd8e5386e52d514a1511ceba6e5b7bd) )
+ SPR_WORD_ROM_LOAD( "505a16.16m", 0x1800000, 2*1024*1024, CRC(ca9c2193) SHA1(cc3fb558b834e0b7914879ab47c3750170d257f4) )
+ SPR_WORD_ROM_LOAD( "505a12.21m", 0x1800002, 2*1024*1024, CRC(421d5034) SHA1(f7a85b7e41f3ddf9ddbdc6f8b6d3dbf8ba40d61b) )
+ SPR_WORD_ROM_LOAD( "505a08.25m", 0x1800004, 2*1024*1024, CRC(442ed3ec) SHA1(d44e1c4e9f8c63a8f754f8d20064cec15ae0b6d6) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", 0 )
@@ -2326,25 +2263,24 @@ ROM_START( slamdnk2 )
ROM_LOAD16_BYTE("505a07.7m", 0x000001, 128*1024, CRC(5641c603) SHA1(1af1f92032e7f870e1668e8d720742fb53c4d0e2) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "505a21.11r", 0x000000, 1024*1024, CRC(03fda175) SHA1(4fdf7cfaa0d4024a2c40bba1f229c41e0627b8c8) )
- ROM_LOAD16_BYTE( "505a20.11m", 0x000001, 1024*1024, CRC(a6a300fb) SHA1(290d97c6ec36e3cab8e6fcd5310030e00fb0ce07) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "505a21.11r", 0x000000, 1024*1024, CRC(03fda175) SHA1(4fdf7cfaa0d4024a2c40bba1f229c41e0627b8c8) )
+ TILE_2WORD_ROM_LOAD( "505a20.11m", 0x000002, 1024*1024, CRC(a6a300fb) SHA1(290d97c6ec36e3cab8e6fcd5310030e00fb0ce07) )
/* sprites */
- ROM_REGION( 0x1800000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "505a19.14r", 0x0000000, 2*1024*1024, CRC(ffde4f17) SHA1(df93853f7bd3c775a15836b0ca9042f75eb65630) )
- _48_WORD_ROM_LOAD( "505a15.18r", 0x0000002, 2*1024*1024, CRC(d9ab1e6c) SHA1(748a61d939bd335c1b50f440e819303552b3d5a1) )
- _48_WORD_ROM_LOAD( "505a11.23r", 0x0000004, 2*1024*1024, CRC(75c13df0) SHA1(6680f75a67ca510fac29b65bce32fef64e844695) )
- _48_WORD_ROM_LOAD( "505a17.16r", 0x0600000, 2*1024*1024, CRC(8176f2f5) SHA1(d7944314b35bcd5301bbfba8a5b1ed6b35b9b888) )
- _48_WORD_ROM_LOAD( "505a13.21r", 0x0600002, 2*1024*1024, CRC(e60c5191) SHA1(02a8af81682838800489aa1123a453045d70acd8) )
- _48_WORD_ROM_LOAD( "505a09.25r", 0x0600004, 2*1024*1024, CRC(3e1d5a15) SHA1(ec4d46c2f2cc57e6193865357ffb3d62a9eecd4f) )
- _48_WORD_ROM_LOAD( "505a18.18m", 0x0c00000, 2*1024*1024, CRC(c12bacfe) SHA1(5b5f4dd9a51c7a305dd4de1354cd1df2ce75c932) )
- _48_WORD_ROM_LOAD( "505a14.14m", 0x0c00002, 2*1024*1024, CRC(356a75b0) SHA1(5f8b7a9d06d4207f19ed0f7c89513226488afde1) )
- _48_WORD_ROM_LOAD( "505a10.23m", 0x0c00004, 2*1024*1024, CRC(fc315ee0) SHA1(4dab661e0bd8e5386e52d514a1511ceba6e5b7bd) )
- _48_WORD_ROM_LOAD( "505a16.16m", 0x1200000, 2*1024*1024, CRC(ca9c2193) SHA1(cc3fb558b834e0b7914879ab47c3750170d257f4) )
- _48_WORD_ROM_LOAD( "505a12.21m", 0x1200002, 2*1024*1024, CRC(421d5034) SHA1(f7a85b7e41f3ddf9ddbdc6f8b6d3dbf8ba40d61b) )
- _48_WORD_ROM_LOAD( "505a08.25m", 0x1200004, 2*1024*1024, CRC(442ed3ec) SHA1(d44e1c4e9f8c63a8f754f8d20064cec15ae0b6d6) )
-
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "505a19.14r", 0x0000000, 2*1024*1024, CRC(ffde4f17) SHA1(df93853f7bd3c775a15836b0ca9042f75eb65630) )
+ SPR_WORD_ROM_LOAD( "505a15.18r", 0x0000002, 2*1024*1024, CRC(d9ab1e6c) SHA1(748a61d939bd335c1b50f440e819303552b3d5a1) )
+ SPR_WORD_ROM_LOAD( "505a11.23r", 0x0000004, 2*1024*1024, CRC(75c13df0) SHA1(6680f75a67ca510fac29b65bce32fef64e844695) )
+ SPR_WORD_ROM_LOAD( "505a17.16r", 0x0800000, 2*1024*1024, CRC(8176f2f5) SHA1(d7944314b35bcd5301bbfba8a5b1ed6b35b9b888) )
+ SPR_WORD_ROM_LOAD( "505a13.21r", 0x0800002, 2*1024*1024, CRC(e60c5191) SHA1(02a8af81682838800489aa1123a453045d70acd8) )
+ SPR_WORD_ROM_LOAD( "505a09.25r", 0x0800004, 2*1024*1024, CRC(3e1d5a15) SHA1(ec4d46c2f2cc57e6193865357ffb3d62a9eecd4f) )
+ SPR_WORD_ROM_LOAD( "505a18.18m", 0x1000002, 2*1024*1024, CRC(c12bacfe) SHA1(5b5f4dd9a51c7a305dd4de1354cd1df2ce75c932) )
+ SPR_WORD_ROM_LOAD( "505a14.14m", 0x1000000, 2*1024*1024, CRC(356a75b0) SHA1(5f8b7a9d06d4207f19ed0f7c89513226488afde1) )
+ SPR_WORD_ROM_LOAD( "505a10.23m", 0x1000004, 2*1024*1024, CRC(fc315ee0) SHA1(4dab661e0bd8e5386e52d514a1511ceba6e5b7bd) )
+ SPR_WORD_ROM_LOAD( "505a16.16m", 0x1800000, 2*1024*1024, CRC(ca9c2193) SHA1(cc3fb558b834e0b7914879ab47c3750170d257f4) )
+ SPR_WORD_ROM_LOAD( "505a12.21m", 0x1800002, 2*1024*1024, CRC(421d5034) SHA1(f7a85b7e41f3ddf9ddbdc6f8b6d3dbf8ba40d61b) )
+ SPR_WORD_ROM_LOAD( "505a08.25m", 0x1800004, 2*1024*1024, CRC(442ed3ec) SHA1(d44e1c4e9f8c63a8f754f8d20064cec15ae0b6d6) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", 0 )
@@ -2374,24 +2310,24 @@ ROM_START( rushhero )
ROM_LOAD16_BYTE("605a07.7m", 0x000001, 128*1024, CRC(3116a8b0) SHA1(f0899d7027464d9aad45ffa6a464288a51a80dc1) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "605a21.11r", 0x000000, 1024*1024, CRC(0e5add29) SHA1(f80d81ff8110825ba19ebc3cf50480b8cf275571) )
- ROM_LOAD16_BYTE( "605a20.11m", 0x000001, 1024*1024, CRC(a8fb4288) SHA1(b0ee6c2add5a8063f771ac8bbdfd78c0382a5036) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "605a21.11r", 0x000000, 1024*1024, CRC(0e5add29) SHA1(f80d81ff8110825ba19ebc3cf50480b8cf275571) )
+ TILE_2WORD_ROM_LOAD( "605a20.11m", 0x000002, 1024*1024, CRC(a8fb4288) SHA1(b0ee6c2add5a8063f771ac8bbdfd78c0382a5036) )
/* sprites */
- ROM_REGION( 0x3000000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "605a19.14r", 0x0000000, 4*1024*1024, CRC(293427d0) SHA1(c31f93797bda09ea7e990100a5556eb0fde64968) )
- _48_WORD_ROM_LOAD( "605a15.18r", 0x0000002, 4*1024*1024, CRC(19e6e356) SHA1(b2568e14d6fb9a9792f95aafcf694dbf00c0d2c8) )
- _48_WORD_ROM_LOAD( "605a11.23r", 0x0000004, 4*1024*1024, CRC(bc61339c) SHA1(77a5737501bf8ffd7ae4192a6e5924c479eb6655) )
- _48_WORD_ROM_LOAD( "605a17.16r", 0x0c00000, 4*1024*1024, CRC(7a8f1cf9) SHA1(4c07f846915bded61c40876a10f5457e8895ad58) )
- _48_WORD_ROM_LOAD( "605a13.21r", 0x0c00002, 4*1024*1024, CRC(9a6dff6d) SHA1(cbc200bde5933098e768db8d3021f77bdfe454b8) )
- _48_WORD_ROM_LOAD( "605a09.25r", 0x0c00004, 4*1024*1024, CRC(624fd486) SHA1(edd81d5487f8239ffa89b931430cf41f06a17cf6) )
- _48_WORD_ROM_LOAD( "605a18.14m", 0x1800000, 4*1024*1024, CRC(4d4dbecb) SHA1(7c3cb2739d6b729d855d652b1991c7af6cd79d1c) )
- _48_WORD_ROM_LOAD( "605a14.18m", 0x1800002, 4*1024*1024, CRC(b5115d76) SHA1(48c3119afb649c58d4df36806fe5530ddd379782) )
- _48_WORD_ROM_LOAD( "605a10.23m", 0x1800004, 4*1024*1024, CRC(4f47d434) SHA1(c4503993c738e1b8df6f045f5a82504363682db7) )
- _48_WORD_ROM_LOAD( "605a16.16m", 0x2400000, 4*1024*1024, CRC(aab542ca) SHA1(9728b028f48768236f47a7a9bddb27944297b583) )
- _48_WORD_ROM_LOAD( "605a12.21m", 0x2400002, 4*1024*1024, CRC(194ffad0) SHA1(1c56f4e89bfe72b435793b907e7ca3e62ecddf4b) )
- _48_WORD_ROM_LOAD( "605a08.25m", 0x2400004, 4*1024*1024, CRC(ea80ddfd) SHA1(4be61af09bcc80c97505196a6f43797753d14f85) )
+ ROM_REGION( 0x4000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "605a19.14r", 0x0000000, 4*1024*1024, CRC(293427d0) SHA1(c31f93797bda09ea7e990100a5556eb0fde64968) )
+ SPR_WORD_ROM_LOAD( "605a15.18r", 0x0000002, 4*1024*1024, CRC(19e6e356) SHA1(b2568e14d6fb9a9792f95aafcf694dbf00c0d2c8) )
+ SPR_WORD_ROM_LOAD( "605a11.23r", 0x0000004, 4*1024*1024, CRC(bc61339c) SHA1(77a5737501bf8ffd7ae4192a6e5924c479eb6655) )
+ SPR_WORD_ROM_LOAD( "605a17.16r", 0x1000000, 4*1024*1024, CRC(7a8f1cf9) SHA1(4c07f846915bded61c40876a10f5457e8895ad58) )
+ SPR_WORD_ROM_LOAD( "605a13.21r", 0x1000002, 4*1024*1024, CRC(9a6dff6d) SHA1(cbc200bde5933098e768db8d3021f77bdfe454b8) )
+ SPR_WORD_ROM_LOAD( "605a09.25r", 0x1000004, 4*1024*1024, CRC(624fd486) SHA1(edd81d5487f8239ffa89b931430cf41f06a17cf6) )
+ SPR_WORD_ROM_LOAD( "605a18.14m", 0x2000000, 4*1024*1024, CRC(4d4dbecb) SHA1(7c3cb2739d6b729d855d652b1991c7af6cd79d1c) )
+ SPR_WORD_ROM_LOAD( "605a14.18m", 0x2000002, 4*1024*1024, CRC(b5115d76) SHA1(48c3119afb649c58d4df36806fe5530ddd379782) )
+ SPR_WORD_ROM_LOAD( "605a10.23m", 0x2000004, 4*1024*1024, CRC(4f47d434) SHA1(c4503993c738e1b8df6f045f5a82504363682db7) )
+ SPR_WORD_ROM_LOAD( "605a16.16m", 0x3000000, 4*1024*1024, CRC(aab542ca) SHA1(9728b028f48768236f47a7a9bddb27944297b583) )
+ SPR_WORD_ROM_LOAD( "605a12.21m", 0x3000002, 4*1024*1024, CRC(194ffad0) SHA1(1c56f4e89bfe72b435793b907e7ca3e62ecddf4b) )
+ SPR_WORD_ROM_LOAD( "605a08.25m", 0x3000004, 4*1024*1024, CRC(ea80ddfd) SHA1(4be61af09bcc80c97505196a6f43797753d14f85) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", 0 )
@@ -2416,18 +2352,17 @@ ROM_START( tokkae )
ROM_LOAD16_BYTE("615a09.7c", 0x000001, 128*1024, CRC(c61f954c) SHA1(5242a2872db1db9ab4edd9951c2ac2d872f06dc7) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "615a19.17h", 0x000000, 1*1024*1024, CRC(07749e1e) SHA1(79a5f979b1dc7fa92ae37af03447edf4885ecdf8) )
- TILE_BYTES2_ROM_LOAD( "615a20.13c", 0x000004, 512*1024, CRC(9911b5a1) SHA1(7dc9348fd23331ca7614db27dc5f280610f87a20) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "615a19.17h", 0x000000, 1*1024*1024, CRC(07749e1e) SHA1(79a5f979b1dc7fa92ae37af03447edf4885ecdf8) )
+ TILE_2BYTE_ROM_LOAD( "615a20.13c", 0x000002, 512*1024, CRC(9911b5a1) SHA1(7dc9348fd23331ca7614db27dc5f280610f87a20) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "615a17.25g", 0x000000, 2*1024*1024, CRC(b864654b) SHA1(bbd74c992ba3c3c629520e68687d7c8f3c26d0b9) )
- ROM_LOAD32_WORD( "615a13.28g", 0x000002, 2*1024*1024, CRC(4e8afa1a) SHA1(d980104ddf9670e689236f381db3345471aff6fd) )
- ROM_LOAD32_WORD( "615a16.18h", 0x400000, 2*1024*1024, CRC(dfa0f0fe) SHA1(4f68767f8329f6348055a472d923557e7dec3154) )
- ROM_LOAD32_WORD( "615a12.27g", 0x400002, 2*1024*1024, CRC(fbc563fd) SHA1(19a6544297e0eade09e69741b9e3d8b32c7e2794) )
-
- ROM_LOAD( "615a11.30g", 0x800000, 2*1024*1024, CRC(f25946e4) SHA1(e7744cdbeccc7325fdb31e134fed71d4cf8f9b0a) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "615a17.25g", 0x000000, 2*1024*1024, CRC(b864654b) SHA1(bbd74c992ba3c3c629520e68687d7c8f3c26d0b9) )
+ SPR_WORD_ROM_LOAD( "615a13.28g", 0x000002, 2*1024*1024, CRC(4e8afa1a) SHA1(d980104ddf9670e689236f381db3345471aff6fd) )
+ SPR_BYTE_ROM_LOAD( "615a11.30g", 0x000004, 2*1024*1024, CRC(f25946e4) SHA1(e7744cdbeccc7325fdb31e134fed71d4cf8f9b0a) )
+ SPR_WORD_ROM_LOAD( "615a16.18h", 0x800000, 2*1024*1024, CRC(dfa0f0fe) SHA1(4f68767f8329f6348055a472d923557e7dec3154) )
+ SPR_WORD_ROM_LOAD( "615a12.27g", 0x800002, 2*1024*1024, CRC(fbc563fd) SHA1(19a6544297e0eade09e69741b9e3d8b32c7e2794) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2452,17 +2387,17 @@ ROM_START( tkmmpzdm )
ROM_LOAD16_BYTE("515a05.7c", 0x000001, 128*1024, CRC(dea4ca2f) SHA1(5d11469a93293381228233baad6896e098994d9b) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "515a11.17h", 0x000000, 1024*1024, CRC(8689852d) SHA1(42ba16a9dfba47132fe07c6b1d044c5b32753220) )
- TILE_BYTES2_ROM_LOAD( "515a12.13c", 0x000004, 512*1024, CRC(6936f94a) SHA1(e2c7fc327638ee39eef6109c4f164eaf98972f00) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "515a11.17h", 0x000000, 1024*1024, CRC(8689852d) SHA1(42ba16a9dfba47132fe07c6b1d044c5b32753220) )
+ TILE_2BYTE_ROM_LOAD( "515a12.13c", 0x000002, 512*1024, CRC(6936f94a) SHA1(e2c7fc327638ee39eef6109c4f164eaf98972f00) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "515a10.25g", 0x000000, 2*1024*1024, CRC(e6e7ab7e) SHA1(3f7ddab4b814673264b542d2a8761c56f82f2180) )
- ROM_LOAD32_WORD( "515a08.28g", 0x000002, 2*1024*1024, CRC(5613daea) SHA1(43480c8104582cc27d8ab6920ec113e660de5ae7) )
- ROM_LOAD32_WORD( "515a09.18h", 0x400000, 2*1024*1024, CRC(28ffdb48) SHA1(8511def7bb151f912755c2bbcb0cae1a2e52f405) )
- ROM_LOAD32_WORD( "515a07.27g", 0x400002, 2*1024*1024, CRC(246e6cb1) SHA1(a320e0820895717c765d07f80cf7983b502af8f0) )
- ROM_LOAD( "515a06.30g", 0x800000, 2*1024*1024, CRC(13b7b953) SHA1(4393c5b3515f3ded9db3ac5d59308f99f40f2b76) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "515a10.25g", 0x000000, 2*1024*1024, CRC(e6e7ab7e) SHA1(3f7ddab4b814673264b542d2a8761c56f82f2180) )
+ SPR_WORD_ROM_LOAD( "515a08.28g", 0x000002, 2*1024*1024, CRC(5613daea) SHA1(43480c8104582cc27d8ab6920ec113e660de5ae7) )
+ SPR_BYTE_ROM_LOAD( "515a06.30g", 0x000004, 2*1024*1024, CRC(13b7b953) SHA1(4393c5b3515f3ded9db3ac5d59308f99f40f2b76) )
+ SPR_WORD_ROM_LOAD( "515a09.18h", 0x800000, 2*1024*1024, CRC(28ffdb48) SHA1(8511def7bb151f912755c2bbcb0cae1a2e52f405) )
+ SPR_WORD_ROM_LOAD( "515a07.27g", 0x800002, 2*1024*1024, CRC(246e6cb1) SHA1(a320e0820895717c765d07f80cf7983b502af8f0) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2488,16 +2423,16 @@ ROM_START( winspike )
/* tiles: length of 1 meg each is TRUSTED by the internal checksum code */
/* do NOT change these to the 4 meg dumps again, those are WRONG!!!!!!! */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
- ROM_LOAD16_BYTE( "705a18.22h", 0x000001, 0x100000, CRC(eb97fb5f) SHA1(13de0ad060fd6f1312fa10edde1fef6481e8df64) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
+ TILE_2WORD_ROM_LOAD( "705a18.22h", 0x000002, 0x100000, CRC(eb97fb5f) SHA1(13de0ad060fd6f1312fa10edde1fef6481e8df64) )
/* sprites */
- ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "705a17.25g", 0x000000, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
- ROM_LOAD64_WORD( "705a13.28g", 0x000002, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
- ROM_LOAD64_WORD( "705a11.30g", 0x000004, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
- ROM_LOAD64_WORD( "705a10.33g", 0x000006, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "705a17.25g", 0x000000, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
+ SPR_WORD_ROM_LOAD( "705a13.28g", 0x000002, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
+ SPR_WORD_ROM_LOAD( "705a11.30g", 0x000004, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
+ SPR_WORD_ROM_LOAD( "705a10.33g", 0x000006, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2547,16 +2482,16 @@ ROM_START( winspikej )
/* tiles: length of 1 meg each is TRUSTED by the internal checksum code */
/* do NOT change these to the 4 meg dumps again, those are WRONG!!!!!!! */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
- ROM_LOAD16_BYTE( "705a18.22h", 0x000001, 0x100000, CRC(eb97fb5f) SHA1(13de0ad060fd6f1312fa10edde1fef6481e8df64) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
+ TILE_2WORD_ROM_LOAD( "705a18.22h", 0x000002, 0x100000, CRC(eb97fb5f) SHA1(13de0ad060fd6f1312fa10edde1fef6481e8df64) )
/* sprites */
- ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "705a17.25g", 0x000000, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
- ROM_LOAD64_WORD( "705a13.28g", 0x000002, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
- ROM_LOAD64_WORD( "705a11.30g", 0x000004, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
- ROM_LOAD64_WORD( "705a10.33g", 0x000006, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "705a17.25g", 0x000000, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
+ SPR_WORD_ROM_LOAD( "705a13.28g", 0x000002, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
+ SPR_WORD_ROM_LOAD( "705a11.30g", 0x000004, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
+ SPR_WORD_ROM_LOAD( "705a10.33g", 0x000006, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2577,15 +2512,15 @@ ROM_START( crzcross )
ROM_LOAD16_BYTE("315a07.7c", 0x000001, 128*1024, CRC(431c58f3) SHA1(4888e305875d56cca5e1d792bdf27e57b3e42b03) )
/* tiles */
- ROM_REGION( 0xa00000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "315a14.17h", 0x000000, 512*1024, CRC(0ab731e0) SHA1(1f7d6ce40e689e1dddfee656bb46bd044012c2d6) )
- TILE_BYTE_ROM_LOAD( "315a12.13g", 0x000004, 2*1024*1024, CRC(3047b8d2) SHA1(99fa4d20ee5aae89b9093ceb581f187bc9acc0ae) )
+ ROM_REGION( 0x100000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "315a14.17h", 0x000000, 512*1024, CRC(0ab731e0) SHA1(1f7d6ce40e689e1dddfee656bb46bd044012c2d6) )
+ TILE_1BYTE_ROM_LOAD( "315a12.13g", 0x000002, 128*1024, CRC(a309d65c) SHA1(2293314bf778d1b9cf42242180d08c84e0605d4d) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "315a11.25g", 0x000000, 2*1024*1024, CRC(b8a99c29) SHA1(60086f663aa6cbfc3fb378caeb2509c65637564e) )
- ROM_LOAD32_WORD( "315a10.28g", 0x000002, 2*1024*1024, CRC(77d175dc) SHA1(73506df30db5ce38a9a21a1dce3e8b4cc1dfa7be) )
- ROM_LOAD( "315a09.30g", 0x400000, 1*1024*1024, CRC(82580329) SHA1(99749a67f1843dfd0fe93cc6bbcbc126b7bb7fb4) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "315a11.25g", 0x000000, 2*1024*1024, CRC(b8a99c29) SHA1(60086f663aa6cbfc3fb378caeb2509c65637564e) )
+ SPR_WORD_ROM_LOAD( "315a10.28g", 0x000002, 2*1024*1024, CRC(77d175dc) SHA1(73506df30db5ce38a9a21a1dce3e8b4cc1dfa7be) )
+ SPR_BYTE_ROM_LOAD( "315a09.30g", 0x000004, 1*1024*1024, CRC(82580329) SHA1(99749a67f1843dfd0fe93cc6bbcbc126b7bb7fb4) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2610,15 +2545,15 @@ ROM_START( puzldama )
ROM_LOAD16_BYTE("315a07.7c", 0x000001, 128*1024, CRC(431c58f3) SHA1(4888e305875d56cca5e1d792bdf27e57b3e42b03) )
/* tiles */
- ROM_REGION( 0xa00000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "315a14.17h", 0x000000, 512*1024, CRC(0ab731e0) SHA1(1f7d6ce40e689e1dddfee656bb46bd044012c2d6) )
- TILE_BYTE_ROM_LOAD( "315a12.13g", 0x000004, 2*1024*1024, CRC(3047b8d2) SHA1(99fa4d20ee5aae89b9093ceb581f187bc9acc0ae) )
+ ROM_REGION( 0xa00000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "315a14.17h", 0x000000, 512*1024, CRC(0ab731e0) SHA1(1f7d6ce40e689e1dddfee656bb46bd044012c2d6) )
+ TILE_1BYTE_ROM_LOAD( "315a12.13g", 0x000002, 128*1024, CRC(a309d65c) SHA1(2293314bf778d1b9cf42242180d08c84e0605d4d) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "315a11.25g", 0x000000, 2*1024*1024, CRC(b8a99c29) SHA1(60086f663aa6cbfc3fb378caeb2509c65637564e) )
- ROM_LOAD32_WORD( "315a10.28g", 0x000002, 2*1024*1024, CRC(77d175dc) SHA1(73506df30db5ce38a9a21a1dce3e8b4cc1dfa7be) )
- ROM_LOAD( "315a09.30g", 0x400000, 1*1024*1024, CRC(82580329) SHA1(99749a67f1843dfd0fe93cc6bbcbc126b7bb7fb4) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "315a11.25g", 0x000000, 2*1024*1024, CRC(b8a99c29) SHA1(60086f663aa6cbfc3fb378caeb2509c65637564e) )
+ SPR_WORD_ROM_LOAD( "315a10.28g", 0x000002, 2*1024*1024, CRC(77d175dc) SHA1(73506df30db5ce38a9a21a1dce3e8b4cc1dfa7be) )
+ SPR_BYTE_ROM_LOAD( "315a09.30g", 0x000004, 1*1024*1024, CRC(82580329) SHA1(99749a67f1843dfd0fe93cc6bbcbc126b7bb7fb4) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2647,19 +2582,19 @@ ROM_START( dragoonj )
ROM_LOAD16_BYTE("417a07.7c", 0x000001, 128*1024, CRC(c1fd7584) SHA1(1b204165ef07b6b53f47adc16eed69d11dab53b2) )
/* tiles */
- ROM_REGION( 0x400000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "417a16.17h", 0x000000, 2*1024*1024, CRC(88b2213b) SHA1(ac4ac57618cf98d7486b147f5494e6943bff1a4d) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "417a16.17h", 0x000000, 2*1024*1024, CRC(88b2213b) SHA1(ac4ac57618cf98d7486b147f5494e6943bff1a4d) )
/* sprites */
- ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "417a15.25g", 0x000000, 2*1024*1024, CRC(83bccd01) SHA1(c0e65c43115164c3f64ac14a449c65c4e3e3c4cf) )
- ROM_LOAD32_WORD( "417a11.28g", 0x000002, 2*1024*1024, CRC(624a7c4c) SHA1(5fda37cd02b4dcb328b80b29041214c685c77a78) )
- ROM_LOAD32_WORD( "417a14.18h", 0x400000, 2*1024*1024, CRC(fbf551f1) SHA1(871c5804aba9845aa04596db51def3ba3b8bae30) )
- ROM_LOAD32_WORD( "417a10.27g", 0x400002, 2*1024*1024, CRC(18fde49f) SHA1(f85b2981172be2cddc5d691bb803f0133a36cb1a) )
- ROM_LOAD32_WORD( "417a13.20h", 0x800000, 2*1024*1024, CRC(d2e3959d) SHA1(efe516e6b84c67c0a154726a0f7f7054ee866738) )
- ROM_LOAD32_WORD( "417a09.30g", 0x800002, 2*1024*1024, CRC(b5653e24) SHA1(ffa44d6b65feef298fa4dcc064ebd173c7cc22aa) )
- ROM_LOAD32_WORD( "417a12.23h", 0xc00000, 2*1024*1024, CRC(25496115) SHA1(e53164f8ad95187011059c465a67fff1d18ba888) )
- ROM_LOAD32_WORD( "417a08.33g", 0xc00002, 2*1024*1024, CRC(801e9d93) SHA1(9364d802b4ca03e652b25304c8298be8de8936b4) )
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "417a15.25g", 0x0000000, 2*1024*1024, CRC(83bccd01) SHA1(c0e65c43115164c3f64ac14a449c65c4e3e3c4cf) )
+ SPR_WORD_ROM_LOAD( "417a11.28g", 0x0000002, 2*1024*1024, CRC(624a7c4c) SHA1(5fda37cd02b4dcb328b80b29041214c685c77a78) )
+ SPR_WORD_ROM_LOAD( "417a14.18h", 0x0800000, 2*1024*1024, CRC(fbf551f1) SHA1(871c5804aba9845aa04596db51def3ba3b8bae30) )
+ SPR_WORD_ROM_LOAD( "417a10.27g", 0x0800002, 2*1024*1024, CRC(18fde49f) SHA1(f85b2981172be2cddc5d691bb803f0133a36cb1a) )
+ SPR_WORD_ROM_LOAD( "417a13.20h", 0x1000000, 2*1024*1024, CRC(d2e3959d) SHA1(efe516e6b84c67c0a154726a0f7f7054ee866738) )
+ SPR_WORD_ROM_LOAD( "417a09.30g", 0x1000002, 2*1024*1024, CRC(b5653e24) SHA1(ffa44d6b65feef298fa4dcc064ebd173c7cc22aa) )
+ SPR_WORD_ROM_LOAD( "417a12.23h", 0x1800000, 2*1024*1024, CRC(25496115) SHA1(e53164f8ad95187011059c465a67fff1d18ba888) )
+ SPR_WORD_ROM_LOAD( "417a08.33g", 0x1800002, 2*1024*1024, CRC(801e9d93) SHA1(9364d802b4ca03e652b25304c8298be8de8936b4) )
/* sound data */
ROM_REGION( 0x200000, "shared", 0 )
@@ -2687,19 +2622,19 @@ ROM_START( dragoona )
ROM_LOAD16_BYTE("417a07.7c", 0x000001, 128*1024, CRC(c1fd7584) SHA1(1b204165ef07b6b53f47adc16eed69d11dab53b2) )
/* tiles */
- ROM_REGION( 0x400000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "417a16.17h", 0x000000, 2*1024*1024, CRC(88b2213b) SHA1(ac4ac57618cf98d7486b147f5494e6943bff1a4d) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "417a16.17h", 0x000000, 2*1024*1024, CRC(88b2213b) SHA1(ac4ac57618cf98d7486b147f5494e6943bff1a4d) )
/* sprites */
- ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "417a15.25g", 0x000000, 2*1024*1024, CRC(83bccd01) SHA1(c0e65c43115164c3f64ac14a449c65c4e3e3c4cf) )
- ROM_LOAD32_WORD( "417a11.28g", 0x000002, 2*1024*1024, CRC(624a7c4c) SHA1(5fda37cd02b4dcb328b80b29041214c685c77a78) )
- ROM_LOAD32_WORD( "417a14.18h", 0x400000, 2*1024*1024, CRC(fbf551f1) SHA1(871c5804aba9845aa04596db51def3ba3b8bae30) )
- ROM_LOAD32_WORD( "417a10.27g", 0x400002, 2*1024*1024, CRC(18fde49f) SHA1(f85b2981172be2cddc5d691bb803f0133a36cb1a) )
- ROM_LOAD32_WORD( "417a13.20h", 0x800000, 2*1024*1024, CRC(d2e3959d) SHA1(efe516e6b84c67c0a154726a0f7f7054ee866738) )
- ROM_LOAD32_WORD( "417a09.30g", 0x800002, 2*1024*1024, CRC(b5653e24) SHA1(ffa44d6b65feef298fa4dcc064ebd173c7cc22aa) )
- ROM_LOAD32_WORD( "417a12.23h", 0xc00000, 2*1024*1024, CRC(25496115) SHA1(e53164f8ad95187011059c465a67fff1d18ba888) )
- ROM_LOAD32_WORD( "417a08.33g", 0xc00002, 2*1024*1024, CRC(801e9d93) SHA1(9364d802b4ca03e652b25304c8298be8de8936b4) )
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "417a15.25g", 0x0000000, 2*1024*1024, CRC(83bccd01) SHA1(c0e65c43115164c3f64ac14a449c65c4e3e3c4cf) )
+ SPR_WORD_ROM_LOAD( "417a11.28g", 0x0000002, 2*1024*1024, CRC(624a7c4c) SHA1(5fda37cd02b4dcb328b80b29041214c685c77a78) )
+ SPR_WORD_ROM_LOAD( "417a14.18h", 0x0800000, 2*1024*1024, CRC(fbf551f1) SHA1(871c5804aba9845aa04596db51def3ba3b8bae30) )
+ SPR_WORD_ROM_LOAD( "417a10.27g", 0x0800002, 2*1024*1024, CRC(18fde49f) SHA1(f85b2981172be2cddc5d691bb803f0133a36cb1a) )
+ SPR_WORD_ROM_LOAD( "417a13.20h", 0x1000000, 2*1024*1024, CRC(d2e3959d) SHA1(efe516e6b84c67c0a154726a0f7f7054ee866738) )
+ SPR_WORD_ROM_LOAD( "417a09.30g", 0x1000002, 2*1024*1024, CRC(b5653e24) SHA1(ffa44d6b65feef298fa4dcc064ebd173c7cc22aa) )
+ SPR_WORD_ROM_LOAD( "417a12.23h", 0x1800000, 2*1024*1024, CRC(25496115) SHA1(e53164f8ad95187011059c465a67fff1d18ba888) )
+ SPR_WORD_ROM_LOAD( "417a08.33g", 0x1800002, 2*1024*1024, CRC(801e9d93) SHA1(9364d802b4ca03e652b25304c8298be8de8936b4) )
/* sound data */
ROM_REGION( 0x200000, "shared", 0 )
@@ -2727,18 +2662,18 @@ ROM_START( soccerss )
ROM_LOAD16_BYTE("427a06.9m", 0x000001, 128*1024, CRC(979df65d) SHA1(7499e9a27aa562692bd3a296789696492a6254bc) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
- TILE_BYTES2_ROM_LOAD( "427a14.143", 0x000004, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
+ TILE_2BYTE_ROM_LOAD( "427a14.143", 0x000002, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
/* sprites */
- ROM_REGION( 0xc00000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
- _48_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
- _48_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
- _48_WORD_ROM_LOAD( "427a12.21r", 0x600000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
- _48_WORD_ROM_LOAD( "427a10.25r", 0x600002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
- _48_WORD_ROM_LOAD( "427a08.140", 0x600004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
+ SPR_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
+ SPR_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
+ SPR_WORD_ROM_LOAD( "427a12.21r", 0x800000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
+ SPR_WORD_ROM_LOAD( "427a10.25r", 0x800002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
+ SPR_WORD_ROM_LOAD( "427a08.140", 0x800004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
/* PSAC2 tiles */
ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 )
@@ -2786,18 +2721,18 @@ ROM_START( soccerssu )
ROM_LOAD16_BYTE("427a06.9m", 0x000001, 128*1024, CRC(979df65d) SHA1(7499e9a27aa562692bd3a296789696492a6254bc) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
- TILE_BYTES2_ROM_LOAD( "427a14.143", 0x000004, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
+ TILE_2BYTE_ROM_LOAD( "427a14.143", 0x000002, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
/* sprites */
- ROM_REGION( 0xc00000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
- _48_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
- _48_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
- _48_WORD_ROM_LOAD( "427a12.21r", 0x600000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
- _48_WORD_ROM_LOAD( "427a10.25r", 0x600002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
- _48_WORD_ROM_LOAD( "427a08.140", 0x600004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
+ SPR_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
+ SPR_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
+ SPR_WORD_ROM_LOAD( "427a12.21r", 0x800000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
+ SPR_WORD_ROM_LOAD( "427a10.25r", 0x800002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
+ SPR_WORD_ROM_LOAD( "427a08.140", 0x800004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
/* PSAC2 tiles */
ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 )
@@ -2845,18 +2780,18 @@ ROM_START( soccerssj )
ROM_LOAD16_BYTE("427a06.9m", 0x000001, 128*1024, CRC(979df65d) SHA1(7499e9a27aa562692bd3a296789696492a6254bc) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
- TILE_BYTES2_ROM_LOAD( "427a14.143", 0x000004, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
+ TILE_2BYTE_ROM_LOAD( "427a14.143", 0x000002, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
/* sprites */
- ROM_REGION( 0xc00000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
- _48_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
- _48_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
- _48_WORD_ROM_LOAD( "427a12.21r", 0x600000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
- _48_WORD_ROM_LOAD( "427a10.25r", 0x600002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
- _48_WORD_ROM_LOAD( "427a08.140", 0x600004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
+ SPR_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
+ SPR_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
+ SPR_WORD_ROM_LOAD( "427a12.21r", 0x800000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
+ SPR_WORD_ROM_LOAD( "427a10.25r", 0x800002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
+ SPR_WORD_ROM_LOAD( "427a08.140", 0x800004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
/* PSAC2 tiles */
ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 )
@@ -2892,18 +2827,18 @@ ROM_START( soccerssja )
ROM_LOAD16_BYTE("427a06.9m", 0x000001, 128*1024, CRC(979df65d) SHA1(7499e9a27aa562692bd3a296789696492a6254bc) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
- TILE_BYTES2_ROM_LOAD( "427a14.143", 0x000004, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
+ TILE_2BYTE_ROM_LOAD( "427a14.143", 0x000002, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
/* sprites */
- ROM_REGION( 0xc00000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
- _48_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
- _48_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
- _48_WORD_ROM_LOAD( "427a12.21r", 0x600000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
- _48_WORD_ROM_LOAD( "427a10.25r", 0x600002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
- _48_WORD_ROM_LOAD( "427a08.140", 0x600004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
+ ROM_REGION( 0xc00000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
+ SPR_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
+ SPR_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
+ SPR_WORD_ROM_LOAD( "427a12.21r", 0x600000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
+ SPR_WORD_ROM_LOAD( "427a10.25r", 0x600002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
+ SPR_WORD_ROM_LOAD( "427a08.140", 0x600004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
/* PSAC2 tiles */
ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 )
@@ -2939,18 +2874,18 @@ ROM_START( soccerssa )
ROM_LOAD16_BYTE("427a06.9m", 0x000001, 128*1024, CRC(979df65d) SHA1(7499e9a27aa562692bd3a296789696492a6254bc) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
- TILE_BYTES2_ROM_LOAD( "427a14.143", 0x000004, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
+ ROM_REGION( 0x500000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "427a15.11r", 0x000000, 0x100000, CRC(33ce2b8e) SHA1(b0936386cdc7c41f33b1d7b4f5ce25fe618d1286) )
+ TILE_2BYTE_ROM_LOAD( "427a14.143", 0x000002, 0x080000, CRC(7575a0ed) SHA1(92fda2747ac090f93e60cff8478af6721b949dc2) )
/* sprites */
- ROM_REGION( 0xc00000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
- _48_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
- _48_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
- _48_WORD_ROM_LOAD( "427a12.21r", 0x600000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
- _48_WORD_ROM_LOAD( "427a10.25r", 0x600002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
- _48_WORD_ROM_LOAD( "427a08.140", 0x600004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "427a13.18r", 0x000000, 2*1024*1024, CRC(815a9b87) SHA1(7d9d5932fff7dd7aa4cbccf0c8d3784dc8042e70) )
+ SPR_WORD_ROM_LOAD( "427a11.23r", 0x000002, 2*1024*1024, CRC(c1ca74c1) SHA1(b7286df8e59f8f1939ebf17aaf9345a857b0b100) )
+ SPR_WORD_ROM_LOAD( "427a09.137", 0x000004, 2*1024*1024, CRC(56bdd480) SHA1(01d164aedc77f71f6310cfd739c00b33289a2e7e) )
+ SPR_WORD_ROM_LOAD( "427a12.21r", 0x800000, 2*1024*1024, CRC(97d6fd38) SHA1(8d2895850cafdea95db08c84e7eeea90a1921515) )
+ SPR_WORD_ROM_LOAD( "427a10.25r", 0x800002, 2*1024*1024, CRC(6b3ccb41) SHA1(b246ef350a430e60f0afd1b80ff48139c325e926) )
+ SPR_WORD_ROM_LOAD( "427a08.140", 0x800004, 2*1024*1024, CRC(221250af) SHA1(fd24e7f0e3024df5aa08506523953c5e35d2267b) )
/* PSAC2 tiles */
ROM_REGION( 0x100000, "gfx3", ROMREGION_ERASE00 )
@@ -2987,17 +2922,17 @@ ROM_START( vsnetscr )
ROM_LOAD16_BYTE("627b07.7m", 0x000001, 128*1024, CRC(d7d92579) SHA1(929b8e90cfef2ef14d84173267b637e4efdb6867) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
- ROM_LOAD16_BYTE( "627a20.11m", 0x000001, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
-
- ROM_REGION( 0x1800000, "gfx2", ROMREGION_ERASEFF )
- _48_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
- _48_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
- _48_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
- _48_WORD_ROM_LOAD( "627a17.16r", 0x0c00000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
- _48_WORD_ROM_LOAD( "627a13.21r", 0x0c00002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
- _48_WORD_ROM_LOAD( "627a09.25r", 0x0c00004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
+ TILE_2WORD_ROM_LOAD( "627a20.11m", 0x000002, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
+
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASEFF )
+ SPR_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
+ SPR_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
+ SPR_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
+ SPR_WORD_ROM_LOAD( "627a17.16r", 0x1000000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
+ SPR_WORD_ROM_LOAD( "627a13.21r", 0x1000002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
+ SPR_WORD_ROM_LOAD( "627a09.25r", 0x1000004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00)
@@ -3025,17 +2960,17 @@ ROM_START( vsnetscreb )
ROM_LOAD16_BYTE("627b07.7m", 0x000001, 128*1024, CRC(d7d92579) SHA1(929b8e90cfef2ef14d84173267b637e4efdb6867) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
- ROM_LOAD16_BYTE( "627a20.11m", 0x000001, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
-
- ROM_REGION( 0x1800000, "gfx2", ROMREGION_ERASEFF )
- _48_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
- _48_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
- _48_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
- _48_WORD_ROM_LOAD( "627a17.16r", 0x0c00000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
- _48_WORD_ROM_LOAD( "627a13.21r", 0x0c00002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
- _48_WORD_ROM_LOAD( "627a09.25r", 0x0c00004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
+ TILE_2WORD_ROM_LOAD( "627a20.11m", 0x000002, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
+
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASEFF )
+ SPR_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
+ SPR_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
+ SPR_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
+ SPR_WORD_ROM_LOAD( "627a17.16r", 0x1000000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
+ SPR_WORD_ROM_LOAD( "627a13.21r", 0x1000002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
+ SPR_WORD_ROM_LOAD( "627a09.25r", 0x1000004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00)
@@ -3063,17 +2998,17 @@ ROM_START( vsnetscru )
ROM_LOAD16_BYTE("627b07.7m", 0x000001, 128*1024, CRC(d7d92579) SHA1(929b8e90cfef2ef14d84173267b637e4efdb6867) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
- ROM_LOAD16_BYTE( "627a20.11m", 0x000001, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
-
- ROM_REGION( 0x1800000, "gfx2", ROMREGION_ERASEFF )
- _48_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
- _48_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
- _48_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
- _48_WORD_ROM_LOAD( "627a17.16r", 0x0c00000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
- _48_WORD_ROM_LOAD( "627a13.21r", 0x0c00002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
- _48_WORD_ROM_LOAD( "627a09.25r", 0x0c00004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
+ TILE_2WORD_ROM_LOAD( "627a20.11m", 0x000002, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
+
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASEFF )
+ SPR_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
+ SPR_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
+ SPR_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
+ SPR_WORD_ROM_LOAD( "627a17.16r", 0x1000000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
+ SPR_WORD_ROM_LOAD( "627a13.21r", 0x1000002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
+ SPR_WORD_ROM_LOAD( "627a09.25r", 0x1000004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00)
@@ -3227,17 +3162,17 @@ ROM_START( vsnetscrj )
ROM_LOAD16_BYTE("627b07.7m", 0x000001, 128*1024, CRC(d7d92579) SHA1(929b8e90cfef2ef14d84173267b637e4efdb6867) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
- ROM_LOAD16_BYTE( "627a20.11m", 0x000001, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
-
- ROM_REGION( 0x1800000, "gfx2", ROMREGION_ERASEFF )
- _48_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
- _48_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
- _48_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
- _48_WORD_ROM_LOAD( "627a17.16r", 0x0c00000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
- _48_WORD_ROM_LOAD( "627a13.21r", 0x0c00002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
- _48_WORD_ROM_LOAD( "627a09.25r", 0x0c00004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
+ ROM_REGION( 0x500000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
+ TILE_2WORD_ROM_LOAD( "627a20.11m", 0x000001, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
+
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASEFF )
+ SPR_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
+ SPR_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
+ SPR_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
+ SPR_WORD_ROM_LOAD( "627a17.16r", 0x1000000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
+ SPR_WORD_ROM_LOAD( "627a13.21r", 0x1000002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
+ SPR_WORD_ROM_LOAD( "627a09.25r", 0x1000004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00)
@@ -3265,17 +3200,17 @@ ROM_START( vsnetscra )
ROM_LOAD16_BYTE("627b07.7m", 0x000001, 128*1024, CRC(d7d92579) SHA1(929b8e90cfef2ef14d84173267b637e4efdb6867) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOAD16_BYTE( "627a21.11r", 0x000000, 1024*1024, CRC(d0755fb8) SHA1(de37ea2a7969a97b6f2abccb7dc2a58950482bf0) )
- ROM_LOAD16_BYTE( "627a20.11m", 0x000001, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
+ ROM_LOAD16_BYTE( "627a20.11m", 0x000002, 1024*1024, CRC(f68b28f2) SHA1(1463717ed581494fcab77a80dc6ffd3ab82ab1fa) )
- ROM_REGION( 0x1800000, "gfx2", ROMREGION_ERASEFF )
- _48_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
- _48_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
- _48_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
- _48_WORD_ROM_LOAD( "627a17.16r", 0x0c00000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
- _48_WORD_ROM_LOAD( "627a13.21r", 0x0c00002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
- _48_WORD_ROM_LOAD( "627a09.25r", 0x0c00004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
+ ROM_REGION( 0x2000000, "sprites", ROMREGION_ERASEFF )
+ SPR_WORD_ROM_LOAD( "627a19.14r", 0x0000000, 4*1024*1024, CRC(39989087) SHA1(9a1da422cc71c2e9512361511b8482a33ada6396) )
+ SPR_WORD_ROM_LOAD( "627a15.18r", 0x0000002, 4*1024*1024, CRC(94c557e9) SHA1(3eb2b47d4143b1caeaaf529b5843d6cb0b517eb2) )
+ SPR_WORD_ROM_LOAD( "627a11.23r", 0x0000004, 4*1024*1024, CRC(8185b19f) SHA1(4a8cc3613e743b2de786663f4f7097e7236a8b74) )
+ SPR_WORD_ROM_LOAD( "627a17.16r", 0x1000000, 4*1024*1024, CRC(5c79a0a5) SHA1(a96740d9c5901f2533415985fc83a05c6b562727) )
+ SPR_WORD_ROM_LOAD( "627a13.21r", 0x1000002, 4*1024*1024, CRC(934c758b) SHA1(f33f0c337038e50386ea2dbaa0e0b1480c413720) )
+ SPR_WORD_ROM_LOAD( "627a09.25r", 0x1000004, 4*1024*1024, CRC(980b0f87) SHA1(137cc79d75881ddbabb90f0a1622bda9caf475ca) )
/* PSAC2 tiles */
ROM_REGION( 0x200000, "gfx3", ROMREGION_ERASE00)
@@ -3302,14 +3237,14 @@ ROM_START( le2 )
ROM_LOAD16_BYTE("312b07.7c", 0x000001, 128*1024, CRC(1aa19c41) SHA1(5b879fb17ac514f266e63db6af50f2f4af7da32c) )
/* tiles */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "312a14.17h", 0x000000, 2*1024*1024, CRC(dc862f19) SHA1(8ec9f8715b622462fb8c79a48162c161eb9fe13b) )
- ROM_LOAD16_BYTE( "312a12.22h", 0x000001, 2*1024*1024, CRC(98c04ddd) SHA1(7bc7af21625466e75003da9fd950437249e75b78) )
- ROM_LOAD16_BYTE( "312a15.15h", 0x400000, 2*1024*1024, CRC(516f2941) SHA1(07415fec2d96fe6b707f801a9e9e963186d83d6a) )
- ROM_LOAD16_BYTE( "312a13.20h", 0x400001, 2*1024*1024, CRC(16e5fdaa) SHA1(f04e09ee4207eb2bd67533997d36f4b3cf42a439) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "312a14.17h", 0x000000, 2*1024*1024, CRC(dc862f19) SHA1(8ec9f8715b622462fb8c79a48162c161eb9fe13b) )
+ TILE_2WORD_ROM_LOAD( "312a12.22h", 0x000002, 2*1024*1024, CRC(98c04ddd) SHA1(7bc7af21625466e75003da9fd950437249e75b78) )
+ TILE_2WORD_ROM_LOAD( "312a15.15h", 0x400000, 2*1024*1024, CRC(516f2941) SHA1(07415fec2d96fe6b707f801a9e9e963186d83d6a) )
+ TILE_2WORD_ROM_LOAD( "312a13.20h", 0x400002, 2*1024*1024, CRC(16e5fdaa) SHA1(f04e09ee4207eb2bd67533997d36f4b3cf42a439) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD64_WORD( "312a11.25g", 0x000000, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
ROM_LOAD64_WORD( "312a10.28g", 0x000002, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
ROM_LOAD64_WORD( "312a09.30g", 0x000004, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
@@ -3340,14 +3275,14 @@ ROM_START( le2u )
ROM_LOAD16_BYTE("312a07.7c", 0x000001, 128*1024, CRC(3d31e989) SHA1(1fdf205b0f9c21093bc6147aaacdf178aa628508) )
/* tiles */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "312a14.17h", 0x000000, 2*1024*1024, CRC(dc862f19) SHA1(8ec9f8715b622462fb8c79a48162c161eb9fe13b) )
- ROM_LOAD16_BYTE( "312a12.22h", 0x000001, 2*1024*1024, CRC(98c04ddd) SHA1(7bc7af21625466e75003da9fd950437249e75b78) )
- ROM_LOAD16_BYTE( "312a15.15h", 0x400000, 2*1024*1024, CRC(516f2941) SHA1(07415fec2d96fe6b707f801a9e9e963186d83d6a) )
- ROM_LOAD16_BYTE( "312a13.20h", 0x400001, 2*1024*1024, CRC(16e5fdaa) SHA1(f04e09ee4207eb2bd67533997d36f4b3cf42a439) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "312a14.17h", 0x000000, 2*1024*1024, CRC(dc862f19) SHA1(8ec9f8715b622462fb8c79a48162c161eb9fe13b) )
+ TILE_2WORD_ROM_LOAD( "312a12.22h", 0x000002, 2*1024*1024, CRC(98c04ddd) SHA1(7bc7af21625466e75003da9fd950437249e75b78) )
+ TILE_2WORD_ROM_LOAD( "312a15.15h", 0x400000, 2*1024*1024, CRC(516f2941) SHA1(07415fec2d96fe6b707f801a9e9e963186d83d6a) )
+ TILE_2WORD_ROM_LOAD( "312a13.20h", 0x400002, 2*1024*1024, CRC(16e5fdaa) SHA1(f04e09ee4207eb2bd67533997d36f4b3cf42a439) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD64_WORD( "312a11.25g", 0x000000, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
ROM_LOAD64_WORD( "312a10.28g", 0x000002, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
ROM_LOAD64_WORD( "312a09.30g", 0x000004, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
@@ -3379,14 +3314,14 @@ ROM_START( le2j )
ROM_LOAD16_BYTE("312b07.7c", 0x000001, 128*1024, CRC(1aa19c41) SHA1(5b879fb17ac514f266e63db6af50f2f4af7da32c) )
/* tiles */
- ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOAD16_BYTE( "312a14.17h", 0x000000, 2*1024*1024, CRC(dc862f19) SHA1(8ec9f8715b622462fb8c79a48162c161eb9fe13b) )
- ROM_LOAD16_BYTE( "312a12.22h", 0x000001, 2*1024*1024, CRC(98c04ddd) SHA1(7bc7af21625466e75003da9fd950437249e75b78) )
- ROM_LOAD16_BYTE( "312a15.15h", 0x400000, 2*1024*1024, CRC(516f2941) SHA1(07415fec2d96fe6b707f801a9e9e963186d83d6a) )
- ROM_LOAD16_BYTE( "312a13.20h", 0x400001, 2*1024*1024, CRC(16e5fdaa) SHA1(f04e09ee4207eb2bd67533997d36f4b3cf42a439) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "312a14.17h", 0x000000, 2*1024*1024, CRC(dc862f19) SHA1(8ec9f8715b622462fb8c79a48162c161eb9fe13b) )
+ TILE_2WORD_ROM_LOAD( "312a12.22h", 0x000002, 2*1024*1024, CRC(98c04ddd) SHA1(7bc7af21625466e75003da9fd950437249e75b78) )
+ TILE_2WORD_ROM_LOAD( "312a15.15h", 0x400000, 2*1024*1024, CRC(516f2941) SHA1(07415fec2d96fe6b707f801a9e9e963186d83d6a) )
+ TILE_2WORD_ROM_LOAD( "312a13.20h", 0x400002, 2*1024*1024, CRC(16e5fdaa) SHA1(f04e09ee4207eb2bd67533997d36f4b3cf42a439) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
ROM_LOAD64_WORD( "312a11.25g", 0x000000, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
ROM_LOAD64_WORD( "312a10.28g", 0x000002, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
ROM_LOAD64_WORD( "312a09.30g", 0x000004, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
@@ -3419,17 +3354,17 @@ ROM_START( racinfrc )
ROM_LOAD16_BYTE("250a07.6p", 0x000001, 128*1024, CRC(612b670a) SHA1(255515fa5096fcc4681b32defa0ae855286d8ed1) )
/* tiles */
- ROM_REGION( 0x300000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "250a15.19y", 0x000000, 0x100000, CRC(60abc472) SHA1(ff360d81222e2d8cd55b907ca5a9947f958aaaab) )
- TILE_BYTES2_ROM_LOAD( "250a14.21y", 0x000004, 0x080000, CRC(d14abf98) SHA1(14827a01deb659c96fd38a5c76f1c9cead5f83c7) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "250a15.19y", 0x000000, 0x100000, CRC(60abc472) SHA1(ff360d81222e2d8cd55b907ca5a9947f958aaaab) )
+ TILE_2BYTE_ROM_LOAD( "250a14.21y", 0x000002, 0x080000, CRC(d14abf98) SHA1(14827a01deb659c96fd38a5c76f1c9cead5f83c7) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "250a12.26y", 0x000000, 0x200000, CRC(e4ca3cff) SHA1(5dfddda4b5257e98a53fb8669714004ae3aeb3a7) )
- ROM_LOAD32_WORD( "250a10.31y", 0x000002, 0x200000, CRC(75c02d12) SHA1(3ca471d887b92261b1c3f50777903df13f07b1a9) )
- ROM_LOAD32_WORD( "250a13.24y", 0x400000, 0x200000, CRC(7aeef929) SHA1(9f656e2ede27aea7d51f0f0a3a91a8f2c2d250c0) )
- ROM_LOAD32_WORD( "250a11.28y", 0x400002, 0x200000, CRC(dfbce309) SHA1(831444e7a7588833ffc9b712412f7aef34a7fa2e) )
- ROM_LOAD( "250a08.36y", 0x800000, 0x200000, CRC(25ff6414) SHA1(0af4ef7fe00d7da5fcb5dd0770d470a556c62d61) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "250a12.26y", 0x000000, 0x200000, CRC(e4ca3cff) SHA1(5dfddda4b5257e98a53fb8669714004ae3aeb3a7) )
+ SPR_WORD_ROM_LOAD( "250a10.31y", 0x000002, 0x200000, CRC(75c02d12) SHA1(3ca471d887b92261b1c3f50777903df13f07b1a9) )
+ SPR_BYTE_ROM_LOAD( "250a08.36y", 0x000004, 0x200000, CRC(25ff6414) SHA1(0af4ef7fe00d7da5fcb5dd0770d470a556c62d61) )
+ SPR_WORD_ROM_LOAD( "250a13.24y", 0x800000, 0x200000, CRC(7aeef929) SHA1(9f656e2ede27aea7d51f0f0a3a91a8f2c2d250c0) )
+ SPR_WORD_ROM_LOAD( "250a11.28y", 0x800002, 0x200000, CRC(dfbce309) SHA1(831444e7a7588833ffc9b712412f7aef34a7fa2e) )
/* K053936 tiles (CROM and HROM from the schematics) */
ROM_REGION( 0x300000, "gfx3", ROMREGION_ERASE00 )
@@ -3471,17 +3406,17 @@ ROM_START( racinfrcu )
ROM_LOAD16_BYTE("250a07.6p", 0x000001, 128*1024, CRC(612b670a) SHA1(255515fa5096fcc4681b32defa0ae855286d8ed1) )
/* tiles */
- ROM_REGION( 0x300000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORDS2_ROM_LOAD( "250a15.19y", 0x000000, 0x100000, CRC(60abc472) SHA1(ff360d81222e2d8cd55b907ca5a9947f958aaaab) )
- TILE_BYTES2_ROM_LOAD( "250a14.21y", 0x000004, 0x080000, CRC(d14abf98) SHA1(14827a01deb659c96fd38a5c76f1c9cead5f83c7) )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "250a15.19y", 0x000000, 0x100000, CRC(60abc472) SHA1(ff360d81222e2d8cd55b907ca5a9947f958aaaab) )
+ TILE_2BYTE_ROM_LOAD( "250a14.21y", 0x000002, 0x080000, CRC(d14abf98) SHA1(14827a01deb659c96fd38a5c76f1c9cead5f83c7) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD32_WORD( "250a12.26y", 0x000000, 0x200000, CRC(e4ca3cff) SHA1(5dfddda4b5257e98a53fb8669714004ae3aeb3a7) )
- ROM_LOAD32_WORD( "250a10.31y", 0x000002, 0x200000, CRC(75c02d12) SHA1(3ca471d887b92261b1c3f50777903df13f07b1a9) )
- ROM_LOAD32_WORD( "250a13.24y", 0x400000, 0x200000, CRC(7aeef929) SHA1(9f656e2ede27aea7d51f0f0a3a91a8f2c2d250c0) )
- ROM_LOAD32_WORD( "250a11.28y", 0x400002, 0x200000, CRC(dfbce309) SHA1(831444e7a7588833ffc9b712412f7aef34a7fa2e) )
- ROM_LOAD( "250a08.36y", 0x800000, 0x200000, CRC(25ff6414) SHA1(0af4ef7fe00d7da5fcb5dd0770d470a556c62d61) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "250a12.26y", 0x000000, 0x200000, CRC(e4ca3cff) SHA1(5dfddda4b5257e98a53fb8669714004ae3aeb3a7) )
+ SPR_WORD_ROM_LOAD( "250a10.31y", 0x000002, 0x200000, CRC(75c02d12) SHA1(3ca471d887b92261b1c3f50777903df13f07b1a9) )
+ SPR_BYTE_ROM_LOAD( "250a08.36y", 0x000004, 0x200000, CRC(25ff6414) SHA1(0af4ef7fe00d7da5fcb5dd0770d470a556c62d61) )
+ SPR_WORD_ROM_LOAD( "250a13.24y", 0x800000, 0x200000, CRC(7aeef929) SHA1(9f656e2ede27aea7d51f0f0a3a91a8f2c2d250c0) )
+ SPR_WORD_ROM_LOAD( "250a11.28y", 0x800002, 0x200000, CRC(dfbce309) SHA1(831444e7a7588833ffc9b712412f7aef34a7fa2e) )
/* K053936 tiles (CROM and HROM from the schematics) */
ROM_REGION( 0x300000, "gfx3", ROMREGION_ERASE00 )
@@ -3555,19 +3490,19 @@ ROM_START( opengolf )
ROM_LOAD16_BYTE("218a07.6p", 0x000001, 128*1024, CRC(221e5293) SHA1(44b0b4fa37da4c19c29d4d2e5b93b94fbec03633) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "218a15.19y", 0x000000, 2*1024*1024, CRC(78ddc8af) SHA1(24313881dbf7e1b06da008080b0143c3ca5e15b1) )
- TILE_WORD_ROM_LOAD( "218a16.16y", 0x280000, 512*1024, CRC(a41a3ec8) SHA1(dfef4c3e4d6d4e453a4958f2bd52788497c64093) )
- TILE_BYTE_ROM_LOAD( "218a14.22y", 0x000004, 1*1024*1024, CRC(508cd75e) SHA1(adfaac92bc55f60b178a5817c48774a664d8980d) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "218a15.19y", 0x000000, 2*1024*1024, CRC(78ddc8af) SHA1(24313881dbf7e1b06da008080b0143c3ca5e15b1) )
+ TILE_2WORD_ROM_LOAD( "218a16.16y", 0x400000, 512*1024, CRC(a41a3ec8) SHA1(dfef4c3e4d6d4e453a4958f2bd52788497c64093) )
+ TILE_1BYTE_ROM_LOAD( "218a14.22y", 0x000002, 1*1024*1024, CRC(508cd75e) SHA1(adfaac92bc55f60b178a5817c48774a664d8980d) )
/* sprites */
- ROM_REGION( 0x900000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "218a12.26y", 0x000000, 2*1024*1024, CRC(83158653) SHA1(b7e43d63f12a793b18ce9fc9cc2c38352d211905) )
- _48_WORD_ROM_LOAD( "218a10.31y", 0x000002, 2*1024*1024, CRC(059bfee3) SHA1(e7f4621313b7f9a6cad81d455700172654bc7404) )
- _48_WORD_ROM_LOAD( "218a08.35y", 0x000004, 2*1024*1024, CRC(5b7098f3) SHA1(91bedf731e94d1554f9a8f86f79425a2c58bbaf9) )
- _48_WORD_ROM_LOAD( "218a13.24y", 0x600000, 1*1024*1024, CRC(b9ffd12a) SHA1(f8a689957b8ff966a38f999a679cdbf18a6dfc77) )
- _48_WORD_ROM_LOAD( "218a11.28y", 0x600002, 1*1024*1024, CRC(b57231e5) SHA1(e1cd1854e909ca53dc2c32b27e5f9bb2217b0e4c) )
- _48_WORD_ROM_LOAD( "218a09.33y", 0x600004, 1*1024*1024, CRC(13627443) SHA1(b51758e19ed7d6bb1e313f7c8a509ad1aad8b22c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "218a12.26y", 0x000000, 2*1024*1024, CRC(83158653) SHA1(b7e43d63f12a793b18ce9fc9cc2c38352d211905) )
+ SPR_WORD_ROM_LOAD( "218a10.31y", 0x000002, 2*1024*1024, CRC(059bfee3) SHA1(e7f4621313b7f9a6cad81d455700172654bc7404) )
+ SPR_WORD_ROM_LOAD( "218a08.35y", 0x000004, 2*1024*1024, CRC(5b7098f3) SHA1(91bedf731e94d1554f9a8f86f79425a2c58bbaf9) )
+ SPR_WORD_ROM_LOAD( "218a13.24y", 0x800000, 1*1024*1024, CRC(b9ffd12a) SHA1(f8a689957b8ff966a38f999a679cdbf18a6dfc77) )
+ SPR_WORD_ROM_LOAD( "218a11.28y", 0x800002, 1*1024*1024, CRC(b57231e5) SHA1(e1cd1854e909ca53dc2c32b27e5f9bb2217b0e4c) )
+ SPR_WORD_ROM_LOAD( "218a09.33y", 0x800004, 1*1024*1024, CRC(13627443) SHA1(b51758e19ed7d6bb1e313f7c8a509ad1aad8b22c) )
/* K053936 tiles (CROM and HROM from the schematics) */
ROM_REGION( 0x800000, "gfx3", ROMREGION_ERASE00 )
@@ -3610,19 +3545,19 @@ ROM_START( opengolf2 )
ROM_LOAD16_BYTE("218a07.6p", 0x000001, 128*1024, CRC(221e5293) SHA1(44b0b4fa37da4c19c29d4d2e5b93b94fbec03633) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "218a15.19y", 0x000000, 2*1024*1024, CRC(78ddc8af) SHA1(24313881dbf7e1b06da008080b0143c3ca5e15b1) )
- TILE_WORD_ROM_LOAD( "218a16.16y", 0x280000, 512*1024, CRC(a41a3ec8) SHA1(dfef4c3e4d6d4e453a4958f2bd52788497c64093) )
- TILE_BYTE_ROM_LOAD( "218a14.22y", 0x000004, 1*1024*1024, CRC(508cd75e) SHA1(adfaac92bc55f60b178a5817c48774a664d8980d) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "218a15.19y", 0x000000, 2*1024*1024, CRC(78ddc8af) SHA1(24313881dbf7e1b06da008080b0143c3ca5e15b1) )
+ TILE_2WORD_ROM_LOAD( "218a16.16y", 0x400000, 512*1024, CRC(a41a3ec8) SHA1(dfef4c3e4d6d4e453a4958f2bd52788497c64093) )
+ TILE_1BYTE_ROM_LOAD( "218a14.22y", 0x000002, 1*1024*1024, CRC(508cd75e) SHA1(adfaac92bc55f60b178a5817c48774a664d8980d) )
/* sprites */
- ROM_REGION( 0x900000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "218a12.26y", 0x000000, 2*1024*1024, CRC(83158653) SHA1(b7e43d63f12a793b18ce9fc9cc2c38352d211905) )
- _48_WORD_ROM_LOAD( "218a10.31y", 0x000002, 2*1024*1024, CRC(059bfee3) SHA1(e7f4621313b7f9a6cad81d455700172654bc7404) )
- _48_WORD_ROM_LOAD( "218a08.35y", 0x000004, 2*1024*1024, CRC(5b7098f3) SHA1(91bedf731e94d1554f9a8f86f79425a2c58bbaf9) )
- _48_WORD_ROM_LOAD( "218a13.24y", 0x600000, 1*1024*1024, CRC(b9ffd12a) SHA1(f8a689957b8ff966a38f999a679cdbf18a6dfc77) )
- _48_WORD_ROM_LOAD( "218a11.28y", 0x600002, 1*1024*1024, CRC(b57231e5) SHA1(e1cd1854e909ca53dc2c32b27e5f9bb2217b0e4c) )
- _48_WORD_ROM_LOAD( "218a09.33y", 0x600004, 1*1024*1024, CRC(13627443) SHA1(b51758e19ed7d6bb1e313f7c8a509ad1aad8b22c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "218a12.26y", 0x000000, 2*1024*1024, CRC(83158653) SHA1(b7e43d63f12a793b18ce9fc9cc2c38352d211905) )
+ SPR_WORD_ROM_LOAD( "218a10.31y", 0x000002, 2*1024*1024, CRC(059bfee3) SHA1(e7f4621313b7f9a6cad81d455700172654bc7404) )
+ SPR_WORD_ROM_LOAD( "218a08.35y", 0x000004, 2*1024*1024, CRC(5b7098f3) SHA1(91bedf731e94d1554f9a8f86f79425a2c58bbaf9) )
+ SPR_WORD_ROM_LOAD( "218a13.24y", 0x800000, 1*1024*1024, CRC(b9ffd12a) SHA1(f8a689957b8ff966a38f999a679cdbf18a6dfc77) )
+ SPR_WORD_ROM_LOAD( "218a11.28y", 0x800002, 1*1024*1024, CRC(b57231e5) SHA1(e1cd1854e909ca53dc2c32b27e5f9bb2217b0e4c) )
+ SPR_WORD_ROM_LOAD( "218a09.33y", 0x800004, 1*1024*1024, CRC(13627443) SHA1(b51758e19ed7d6bb1e313f7c8a509ad1aad8b22c) )
/* K053936 tiles (CROM and HROM from the schematics) */
ROM_REGION( 0x800000, "gfx3", ROMREGION_ERASE00 )
@@ -3664,19 +3599,19 @@ ROM_START( ggreats2 )
ROM_LOAD16_BYTE("218a07.6p", 0x000001, 128*1024, CRC(221e5293) SHA1(44b0b4fa37da4c19c29d4d2e5b93b94fbec03633) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- TILE_WORD_ROM_LOAD( "218a15.19y", 0x000000, 2*1024*1024, CRC(78ddc8af) SHA1(24313881dbf7e1b06da008080b0143c3ca5e15b1) )
- TILE_WORD_ROM_LOAD( "218a16.16y", 0x280000, 512*1024, CRC(a41a3ec8) SHA1(dfef4c3e4d6d4e453a4958f2bd52788497c64093) )
- TILE_BYTE_ROM_LOAD( "218a14.22y", 0x000004, 1*1024*1024, CRC(508cd75e) SHA1(adfaac92bc55f60b178a5817c48774a664d8980d) )
+ ROM_REGION( 0x800000, "tilemap", ROMREGION_ERASE00 )
+ TILE_2WORD_ROM_LOAD( "218a15.19y", 0x000000, 2*1024*1024, CRC(78ddc8af) SHA1(24313881dbf7e1b06da008080b0143c3ca5e15b1) )
+ TILE_2WORD_ROM_LOAD( "218a16.16y", 0x400000, 512*1024, CRC(a41a3ec8) SHA1(dfef4c3e4d6d4e453a4958f2bd52788497c64093) )
+ TILE_1BYTE_ROM_LOAD( "218a14.22y", 0x000002, 1*1024*1024, CRC(508cd75e) SHA1(adfaac92bc55f60b178a5817c48774a664d8980d) )
/* sprites */
- ROM_REGION( 0x900000, "gfx2", ROMREGION_ERASE00 )
- _48_WORD_ROM_LOAD( "218a12.26y", 0x000000, 2*1024*1024, CRC(83158653) SHA1(b7e43d63f12a793b18ce9fc9cc2c38352d211905) )
- _48_WORD_ROM_LOAD( "218a10.31y", 0x000002, 2*1024*1024, CRC(059bfee3) SHA1(e7f4621313b7f9a6cad81d455700172654bc7404) )
- _48_WORD_ROM_LOAD( "218a08.35y", 0x000004, 2*1024*1024, CRC(5b7098f3) SHA1(91bedf731e94d1554f9a8f86f79425a2c58bbaf9) )
- _48_WORD_ROM_LOAD( "218a13.24y", 0x600000, 1*1024*1024, CRC(b9ffd12a) SHA1(f8a689957b8ff966a38f999a679cdbf18a6dfc77) )
- _48_WORD_ROM_LOAD( "218a11.28y", 0x600002, 1*1024*1024, CRC(b57231e5) SHA1(e1cd1854e909ca53dc2c32b27e5f9bb2217b0e4c) )
- _48_WORD_ROM_LOAD( "218a09.33y", 0x600004, 1*1024*1024, CRC(13627443) SHA1(b51758e19ed7d6bb1e313f7c8a509ad1aad8b22c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_WORD_ROM_LOAD( "218a12.26y", 0x000000, 2*1024*1024, CRC(83158653) SHA1(b7e43d63f12a793b18ce9fc9cc2c38352d211905) )
+ SPR_WORD_ROM_LOAD( "218a10.31y", 0x000002, 2*1024*1024, CRC(059bfee3) SHA1(e7f4621313b7f9a6cad81d455700172654bc7404) )
+ SPR_WORD_ROM_LOAD( "218a08.35y", 0x000004, 2*1024*1024, CRC(5b7098f3) SHA1(91bedf731e94d1554f9a8f86f79425a2c58bbaf9) )
+ SPR_WORD_ROM_LOAD( "218a13.24y", 0x800000, 1*1024*1024, CRC(b9ffd12a) SHA1(f8a689957b8ff966a38f999a679cdbf18a6dfc77) )
+ SPR_WORD_ROM_LOAD( "218a11.28y", 0x800002, 1*1024*1024, CRC(b57231e5) SHA1(e1cd1854e909ca53dc2c32b27e5f9bb2217b0e4c) )
+ SPR_WORD_ROM_LOAD( "218a09.33y", 0x800004, 1*1024*1024, CRC(13627443) SHA1(b51758e19ed7d6bb1e313f7c8a509ad1aad8b22c) )
/* K053936 tiles (CROM and HROM from the schematics) */
ROM_REGION( 0x800000, "gfx3", ROMREGION_ERASE00 )
@@ -3704,21 +3639,20 @@ ROM_END
MACHINE_START_MEMBER(konamigx_state,konamigx)
{
- save_item(NAME(m_sound_ctrl));
- save_item(NAME(m_sound_intck));
-
- save_item(NAME(m_gx_wrport1_0));
- save_item(NAME(m_gx_wrport1_1));
- save_item(NAME(m_gx_wrport2));
-
- save_item(NAME(m_gx_rdport1_3));
- save_item(NAME(m_gx_syncen));
- save_item(NAME(m_suspension_active));
- save_item(NAME(m_prev_pixel_clock));
+ save_item(NAME(m_port1));
+ save_item(NAME(m_port2));
+ save_item(NAME(m_irqin));
+ save_item(NAME(m_irqmask));
}
MACHINE_RESET_MEMBER(konamigx_state,konamigx)
{
+ m_port1 = 0;
+ m_port2 = 0;
+ m_irqin = 0;
+ m_irqmask = 0;
+
+
m_gx_wrport1_0 = m_gx_wrport1_1 = 0;
m_gx_wrport2 = 0;
@@ -3754,7 +3688,7 @@ MACHINE_RESET_MEMBER(konamigx_state,konamigx)
}
}
- const char *setname = machine().system().name;
+ // const char *setname = machine().system().name;
if (m_use_68020_post_clock_hack)
{
@@ -3768,10 +3702,10 @@ MACHINE_RESET_MEMBER(konamigx_state,konamigx)
m_boothack_timer->adjust(attotime::from_seconds(12));
}
- if (!strcmp(setname, "le2") ||
- !strcmp(setname, "le2u")||
- !strcmp(setname, "le2j"))
- m_k055555->K055555_write_reg(K55_INPUT_ENABLES, 1); // it doesn't turn on the video output at first for the test screens, maybe it should default to ON for all games
+ // if (!strcmp(setname, "le2") ||
+ // !strcmp(setname, "le2u")||
+ // !strcmp(setname, "le2j"))
+ // m_mixer->K055555_write_reg(K55_INPUT_ENABLES, 1); // it doesn't turn on the video output at first for the test screens, maybe it should default to ON for all games
}
@@ -3831,15 +3765,10 @@ static const GXGameInfoT gameDefs[] =
{ "", 0xff,0xff,0xff },
};
-READ32_MEMBER( konamigx_state::k_6bpp_rom_long_r )
-{
- return m_k056832->k_6bpp_rom_long_r(space,offset,mem_mask);
-}
-
DRIVER_INIT_MEMBER(konamigx_state,konamigx)
{
int i, match;
- int readback = 0;
+ // int readback = 0;
m_gx_cfgport = -1;
m_last_prot_op = -1;
@@ -3848,7 +3777,6 @@ DRIVER_INIT_MEMBER(konamigx_state,konamigx)
m_esc_cb = nullptr;
m_resume_trigger = 0;
- m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(konamigx_state::dmaend_callback),this));
m_boothack_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(konamigx_state::boothack_callback),this));
i = match = 0;
@@ -3858,7 +3786,7 @@ DRIVER_INIT_MEMBER(konamigx_state,konamigx)
{
match = 1;
m_gx_cfgport = gameDefs[i].cfgport;
- readback = gameDefs[i].readback;
+ // readback = gameDefs[i].readback;
switch (gameDefs[i].special)
{
@@ -3915,8 +3843,8 @@ DRIVER_INIT_MEMBER(konamigx_state,konamigx)
i++;
}
- if (readback == BPP66)
- m_maincpu->space(AS_PROGRAM).install_read_handler(0xd00000, 0xd01fff, read32_delegate(FUNC(konamigx_state::k_6bpp_rom_long_r), this));
+ // if (readback == BPP66)
+ // m_maincpu->space(AS_PROGRAM).install_read_handler(0xd00000, 0xd01fff, read32_delegate(FUNC(konamigx_state::k_6bpp_rom_long_r), this));
#undef BPP5
@@ -3935,7 +3863,7 @@ DRIVER_INIT_MEMBER(konamigx_state,posthack)
/* year ROM parent machine inp init */
/* dummy parent for the BIOS */
-GAME( 1994, konamigx, 0, konamigx_bios, konamigx, konamigx_state, konamigx, ROT0, "Konami", "System GX", MACHINE_IS_BIOS_ROOT )
+GAME( 1994, konamigx, 0, kgx_576x252, konamigx, konamigx_state, konamigx, ROT0, "Konami", "System GX", MACHINE_IS_BIOS_ROOT )
/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Type 1: standard with an add-on 53936 on the ROM board, analog inputs, */
@@ -3955,38 +3883,38 @@ GAME( 1994, ggreats2, opengolf, opengolf, racinfrc, konamigx_state, posthack, R
/* these games work and are playable with minor graphics glitches */
/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
-GAME( 1994, le2, konamigx, le2, le2, konamigx_state, konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, le2u, le2, le2, le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, le2j, le2, le2, le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: The Western (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, le2, konamigx, kgx_288x224, le2, konamigx_state, konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, le2u, le2, kgx_288x224, le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, le2j, le2, kgx_288x224, le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: The Western (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, fantjour, konamigx, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, fantjoura,fantjour, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, gokuparo, fantjour, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, fantjour, konamigx, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, fantjoura,fantjour, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, gokuparo, fantjour, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, crzcross, konamigx, gokuparo, puzldama, konamigx_state, posthack, ROT0, "Konami", "Crazy Cross (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1994, puzldama, crzcross, gokuparo, puzldama, konamigx_state, posthack, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, crzcross, konamigx, kgx_288x224, puzldama, konamigx_state, posthack, ROT0, "Konami", "Crazy Cross (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1994, puzldama, crzcross, kgx_288x224, puzldama, konamigx_state, posthack, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1995, tbyahhoo, konamigx, tbyahhoo, gokuparo, konamigx_state, posthack, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1995, tbyahhoo, konamigx, kgx_288x224, gokuparo, konamigx_state, posthack, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1995, tkmmpzdm, konamigx, konamigx_6bpp, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1995, tkmmpzdm, konamigx, kgx_288x224, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1995, dragoona, konamigx, dragoonj, dragoonj, konamigx_state, posthack, ROT0, "Konami", "Dragoon Might (ver AAB)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1995, dragoonj, dragoona, dragoonj, dragoonj, konamigx_state, posthack, ROT0, "Konami", "Dragoon Might (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1995, dragoona, konamigx, kgx_384x224, dragoonj, konamigx_state, posthack, ROT0, "Konami", "Dragoon Might (ver AAB)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1995, dragoonj, dragoona, kgx_384x224, dragoonj, konamigx_state, posthack, ROT0, "Konami", "Dragoon Might (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1996, sexyparo, konamigx, sexyparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1996, sexyparoa,sexyparo, sexyparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1996, sexyparo, konamigx, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1996, sexyparoa,sexyparo, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1996, daiskiss, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Daisu-Kiss (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1996, daiskiss, konamigx, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Daisu-Kiss (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1996, tokkae, konamigx, konamigx_6bpp, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Tokkae-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1996, tokkae, konamigx, kgx_288x224, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Tokkae-dama (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
/* protection controls player ship direction in attract mode - doesn't impact playability */
-GAME( 1996, salmndr2, konamigx, salmndr2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_UNEMULATED_PROTECTION )
-GAME( 1996, salmndr2a,salmndr2, salmndr2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_UNEMULATED_PROTECTION )
+GAME( 1996, salmndr2, konamigx, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_UNEMULATED_PROTECTION )
+GAME( 1996, salmndr2a,salmndr2, kgx_288x224, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", MACHINE_IMPERFECT_GRAPHICS|MACHINE_UNEMULATED_PROTECTION )
/* bad sprite colours, part of tilemap gets blanked out when a game starts (might be more protection) */
-GAME( 1997, winspike, konamigx, winspike, konamigx, konamigx_state, konamigx, ROT0, "Konami", "Winning Spike (ver EAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1997, winspikej,winspike, winspike, konamigx, konamigx_state, konamigx, ROT0, "Konami", "Winning Spike (ver JAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1997, winspike, konamigx, kgx_384x224, konamigx, konamigx_state, konamigx, ROT0, "Konami", "Winning Spike (ver EAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1997, winspikej,winspike, kgx_384x224, konamigx, konamigx_state, konamigx, ROT0, "Konami", "Winning Spike (ver JAA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS )
/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Type 3: dual monitor output and 53936 on the ROM board, external palette RAM */
diff --git a/src/mame/drivers/konmedal.cpp b/src/mame/drivers/konmedal.cpp
index 0b6dbb22163..1c273f57a9f 100644
--- a/src/mame/drivers/konmedal.cpp
+++ b/src/mame/drivers/konmedal.cpp
@@ -38,13 +38,13 @@ public:
konmedal_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_k056832(*this, "k056832"),
+ // m_k056832(*this, "k056832"),
m_palette(*this, "palette"),
m_ymz(*this, "ymz")
{ }
required_device<cpu_device> m_maincpu;
- required_device<k056832_device> m_k056832;
+// required_device<k056832_device> m_k056832;
required_device<palette_device> m_palette;
required_device<ymz280b_device> m_ymz;
@@ -69,7 +69,7 @@ public:
virtual void video_start() override;
uint32_t screen_update_konmedal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(konmedal_interrupt);
- K056832_CB_MEMBER(tile_callback);
+// K056832_CB_MEMBER(tile_callback);
};
WRITE8_MEMBER(konmedal_state::control2_w)
@@ -80,6 +80,7 @@ WRITE8_MEMBER(konmedal_state::control2_w)
READ8_MEMBER(konmedal_state::vram_r)
{
+#if 0
if (!(m_control2 & 0x80))
{
if (offset & 1)
@@ -95,7 +96,8 @@ READ8_MEMBER(konmedal_state::vram_r)
{
return m_k056832->konmedal_rom_r(space, offset);
}
-
+#endif
+
return 0;
}
@@ -106,11 +108,11 @@ WRITE8_MEMBER(konmedal_state::vram_w)
if (offset & 1)
{
- m_k056832->ram_code_hi_w(space, offset>>1, data);
+ // m_k056832->ram_code_hi_w(space, offset>>1, data);
return;
}
-
- m_k056832->ram_code_lo_w(space, offset>>1, data);
+
+ // m_k056832->ram_code_lo_w(space, offset>>1, data);
}
READ8_MEMBER(konmedal_state::magic_r)
@@ -118,6 +120,7 @@ READ8_MEMBER(konmedal_state::magic_r)
return 0xc1; // checked at 60f before reading a page of the VROM
}
+#if 0
K056832_CB_MEMBER(konmedal_state::tile_callback)
{
int codebits = *code;
@@ -132,6 +135,7 @@ K056832_CB_MEMBER(konmedal_state::tile_callback)
bank = (data >> bankshifts[bs]) & 0xf;
*code = (codebits & 0x3ff) | (bank << 10);
}
+#endif
void konmedal_state::video_start()
{
@@ -143,8 +147,12 @@ uint32_t konmedal_state::screen_update_konmedal(screen_device &screen, bitmap_in
bitmap.fill(0, cliprect);
screen.priority().fill(0, cliprect);
- // game only draws on this layer, apparently
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 1);
+// m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 1);
+// m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
+// m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, 0, 4);
+
+ // force "A" layer over top of everything
+// m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
return 0;
}
@@ -166,7 +174,7 @@ PALETTE_INIT_MEMBER(konmedal_state, konmedal)
INTERRUPT_GEN_MEMBER(konmedal_state::konmedal_interrupt)
{
m_maincpu->set_input_line(0, HOLD_LINE);
- m_k056832->mark_plane_dirty(3);
+ // m_k056832->mark_plane_dirty(3);
}
WRITE8_MEMBER(konmedal_state::bankswitch_w)
@@ -181,12 +189,12 @@ static ADDRESS_MAP_START( medal_main, AS_PROGRAM, 8, konmedal_state )
AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1")
AM_RANGE(0xa000, 0xafff) AM_RAM // work RAM?
AM_RANGE(0xb800, 0xbfff) AM_RAM // stack goes here
- AM_RANGE(0xc000, 0xc03f) AM_DEVWRITE("k056832", k056832_device, write)
+// AM_RANGE(0xc000, 0xc03f) AM_DEVWRITE("k056832", k056832_device, write)
AM_RANGE(0xc100, 0xc100) AM_WRITE(control2_w)
AM_RANGE(0xc400, 0xc400) AM_WRITE(bankswitch_w)
AM_RANGE(0xc500, 0xc500) AM_NOP // read to reset watchdog
AM_RANGE(0xc702, 0xc703) AM_READ(inputs_r)
- AM_RANGE(0xc800, 0xc80f) AM_DEVWRITE("k056832", k056832_device, b_w)
+// AM_RANGE(0xc800, 0xc80f) AM_DEVWRITE("k056832", k056832_device, b_w)
AM_RANGE(0xc80f, 0xc80f) AM_READ(magic_r)
AM_RANGE(0xd000, 0xd001) AM_DEVREADWRITE("ymz", ymz280b_device, read, write)
AM_RANGE(0xe000, 0xffff) AM_READWRITE(vram_r, vram_w)
@@ -227,10 +235,10 @@ static MACHINE_CONFIG_START( konmedal )
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
MCFG_PALETTE_INIT_OWNER(konmedal_state, konmedal)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(konmedal_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+// MCFG_DEVICE_ADD("k056832", K056832, 0)
+// MCFG_K056832_CB(konmedal_state, tile_callback)
+// MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none")
+// MCFG_K056832_PALETTE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/lethal.cpp b/src/mame/drivers/lethal.cpp
index 08cbdccc65f..77c008abacb 100644
--- a/src/mame/drivers/lethal.cpp
+++ b/src/mame/drivers/lethal.cpp
@@ -285,9 +285,60 @@ WRITE8_MEMBER(lethal_state::control2_w)
ioport("EEPROMOUT")->write(m_cur_control2, 0xff);
}
+WRITE8_MEMBER(lethal_state::lethalen_palette_control)
+{
+ switch (offset)
+ {
+ case 0: // 40c8 - PCU1 from schematics
+ m_layer_colorbase[0] = (data & 0x7) * 1024 / 16;
+ m_layer_colorbase[1] = ((data >> 4) & 0x7) * 1024 / 16;
+ break;
+
+ case 4: // 40cc - PCU2 from schematics
+ m_layer_colorbase[2] = (data & 0x7) * 1024 / 16;
+ m_layer_colorbase[3] = ((data >> 4) & 0x7) * 1024 / 16;
+ break;
+
+ case 8: // 40d0 - PCU3 from schematics
+ m_sprite_colorbase = (data & 0x7) * 1024 / 64;
+ m_back_colorbase = ((data >> 4) & 0x7) * 1024 + 1023;
+ break;
+ }
+}
+
+K05324X_CB_MEMBER(lethal_state::sprite_callback)
+{
+ int pri = (*color & 0xfff0);
+ *color = *color & 0x000f;
+ *color += m_sprite_colorbase;
+
+ /* this isn't ideal.. shouldn't need to hardcode it? not 100% sure about it anyway*/
+ if (pri == 0x10)
+ *priority = 0xf0; // guys on first level
+ else if (pri == 0x90)
+ *priority = 0xf0; // car doors
+ else if (pri == 0x20)
+ *priority = 0xf0 | 0xcc; // people behind glass on 1st level
+ else if (pri == 0xa0)
+ *priority = 0xf0 | 0xcc; // glass on 1st/2nd level
+ else if (pri == 0x40)
+ *priority = 0; // blood splats?
+ else if (pri == 0x00)
+ *priority = 0; // gunshots etc
+ else if (pri == 0x30)
+ *priority = 0xf0 | 0xcc | 0xaa; // mask sprites (always in a bad colour, used to do special effects i think
+ else
+ {
+ popmessage("unknown pri %04x\n", pri);
+ *priority = 0;
+ }
+
+ *code = (*code & 0x3fff); // | spritebanks[(*code >> 12) & 3];
+}
+
INTERRUPT_GEN_MEMBER(lethal_state::lethalen_interrupt)
{
- if (m_k056832->is_irq_enabled(0))
+ //*// if (m_tilemap->is_irq_enabled(0))
device.execute().set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
}
@@ -343,8 +394,8 @@ READ8_MEMBER(lethal_state::gunsaux_r)
static ADDRESS_MAP_START( le_main, AS_PROGRAM, 8, lethal_state )
AM_RANGE(0x0000, 0x1fff) AM_ROMBANK("bank1")
AM_RANGE(0x2000, 0x3fff) AM_RAM // work RAM
- AM_RANGE(0x4000, 0x403f) AM_DEVWRITE("k056832", k056832_device, write)
- AM_RANGE(0x4040, 0x404f) AM_DEVWRITE("k056832", k056832_device, b_w)
+ AM_RANGE(0x4000, 0x403f) AM_DEVICE("tilemap", k054156_054157_device, vacset8)
+ AM_RANGE(0x4040, 0x404f) AM_DEVICE("tilemap", k054156_054157_device, vsccs8)
AM_RANGE(0x4080, 0x4080) AM_READNOP // watchdog
AM_RANGE(0x4090, 0x4090) AM_READWRITE(sound_irq_r, sound_irq_w)
AM_RANGE(0x40a0, 0x40a0) AM_READNOP
@@ -364,14 +415,11 @@ static ADDRESS_MAP_START( bank4000_map, AS_PROGRAM, 8, lethal_state )
// VRD = 0 or 1, CBNK = 0
AM_RANGE(0x0840, 0x084f) AM_MIRROR(0x8000) AM_DEVREADWRITE("k053244", k05324x_device, k053244_r, k053244_w)
AM_RANGE(0x0880, 0x089f) AM_MIRROR(0x8000) AM_DEVREADWRITE("k054000", k054000_device, read, write)
- AM_RANGE(0x08c0, 0x08cf) AM_DEVICE("k054321", k054321_device, main_map)
+ AM_RANGE(0x08c0, 0x08cf) AM_DEVICE("soundctrl", k054321_device, main_map)
AM_RANGE(0x1000, 0x17ff) AM_MIRROR(0x8000) AM_DEVREADWRITE("k053244", k05324x_device, k053245_r, k053245_w)
// VRD = 0, CBNK = 0
- AM_RANGE(0x2000, 0x27ff) AM_DEVREADWRITE("k056832", k056832_device, ram_code_lo_r, ram_code_lo_w)
- AM_RANGE(0x2800, 0x2fff) AM_DEVREADWRITE("k056832", k056832_device, ram_code_hi_r, ram_code_hi_w)
- AM_RANGE(0x3000, 0x37ff) AM_DEVREADWRITE("k056832", k056832_device, ram_attr_lo_r, ram_attr_lo_w)
- AM_RANGE(0x3800, 0x3fff) AM_DEVREADWRITE("k056832", k056832_device, ram_attr_hi_r, ram_attr_hi_w)
+ AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram8_r, vram8_w)
// VRD = 1, CBNK = 0 or 1
AM_RANGE(0xa000, 0xbfff) AM_MIRROR(0x4000) AM_UNMAP // AM_DEVREAD("k056832", k056832_device, rom_byte_r)
@@ -384,7 +432,7 @@ static ADDRESS_MAP_START( le_sound, AS_PROGRAM, 8, lethal_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
AM_RANGE(0xf000, 0xf7ff) AM_RAM
AM_RANGE(0xf800, 0xfa2f) AM_DEVREADWRITE("k054539", k054539_device, read, write)
- AM_RANGE(0xfc00, 0xfc03) AM_DEVICE("k054321", k054321_device, sound_map)
+ AM_RANGE(0xfc00, 0xfc03) AM_DEVICE("soundctrl", k054321_device, sound_map)
ADDRESS_MAP_END
static INPUT_PORTS_START( lethalen )
@@ -511,17 +559,12 @@ static MACHINE_CONFIG_START( lethalen )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(216, 504-1, 16, 240-1)
- MCFG_SCREEN_UPDATE_DRIVER(lethal_state, screen_update_lethalen)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 8192)
- MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(lethal_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_8LE, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_K054156_DUAL_054157_ADD("tilemap", MAIN_CLOCK/4, 8, 8, 24)
MCFG_DEVICE_ADD("k053244", K053244, 0)
MCFG_GFX_PALETTE("palette")
@@ -534,7 +577,7 @@ static MACHINE_CONFIG_START( lethalen )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_K054321_ADD("k054321", ":lspeaker", ":rspeaker")
+ MCFG_K054321_ADD("soundctrl", ":lspeaker", ":rspeaker")
MCFG_DEVICE_ADD("k054539", K054539, XTAL_18_432MHz)
MCFG_K054539_TIMER_HANDLER(INPUTLINE("soundcpu", INPUT_LINE_NMI))
diff --git a/src/mame/drivers/moo.cpp b/src/mame/drivers/moo.cpp
index 6e02c558fc1..7442c83669a 100644
--- a/src/mame/drivers/moo.cpp
+++ b/src/mame/drivers/moo.cpp
@@ -60,7 +60,7 @@ Notes:
Custom Chips
------------
- 053990 - ? (Connected to 68000, main program ROMs and 2018 RAM)
+ 053990 - Security chip (Connected to 68000, main program ROMs and 2018 RAM)
053251 - Priority encoder
053252 - Timing/Interrupt controller. Clock input 32MHz
054157 \
@@ -127,8 +127,6 @@ Bucky:
#include "speaker.h"
#define MOO_DEBUG 0
-#define MOO_DMADELAY (100)
-
READ16_MEMBER(moo_state::control2_r)
{
@@ -140,71 +138,22 @@ WRITE16_MEMBER(moo_state::control2_w)
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- /* bit 5 is enable irq 5 (unconfirmed) */
+ /* bit 5 is enable sprite dma (irq 5) */
/* bit 8 is enable sprite ROM reading */
/* bit 10 is watchdog */
- /* bit 11 is enable irq 4 (unconfirmed) */
+ /* bit 11 is mute */
COMBINE_DATA(&m_cur_control2);
ioport("EEPROMOUT")->write(m_cur_control2, 0xff);
- if (data & 0x100)
- m_k053246->k053246_set_objcha_line( ASSERT_LINE);
- else
- m_k053246->k053246_set_objcha_line( CLEAR_LINE);
+ m_sprites->set_objcha(data & 0x100);
}
-void moo_state::moo_objdma()
-{
- int num_inactive;
- uint16_t *src, *dst;
- int counter = m_k053246->k053247_get_dy();
-
- m_k053246->k053247_get_ram( &dst);
- src = m_spriteram;
- num_inactive = counter = 256;
-
- do
- {
- if ((*src & 0x8000) && (*src & m_zmask))
- {
- memcpy(dst, src, 0x10);
- dst += 8;
- num_inactive--;
- }
- src += 0x80;
- }
- while (--counter);
-
- if (num_inactive)
- {
- do
- {
- *dst = 0;
- dst += 8;
- }
- while (--num_inactive);
- }
-}
-
-TIMER_CALLBACK_MEMBER(moo_state::dmaend_callback)
-{
- if (m_cur_control2 & 0x800)
- m_maincpu->set_input_line(4, HOLD_LINE);
-}
INTERRUPT_GEN_MEMBER(moo_state::moo_interrupt)
{
- if (m_k053246->k053246_is_irq_enabled())
- {
- moo_objdma();
-
- // schedule DMA end interrupt (delay shortened to catch up with V-blank)
- m_dmaend_timer->adjust(attotime::from_usec(MOO_DMADELAY));
- }
-
// trigger V-blank interrupt
if (m_cur_control2 & 0x20)
device.execute().set_input_line(5, HOLD_LINE);
@@ -212,11 +161,6 @@ INTERRUPT_GEN_MEMBER(moo_state::moo_interrupt)
INTERRUPT_GEN_MEMBER(moo_state::moobl_interrupt)
{
- moo_objdma();
-
- // schedule DMA end interrupt (delay shortened to catch up with V-blank)
- m_dmaend_timer->adjust(attotime::from_usec(MOO_DMADELAY));
-
// trigger V-blank interrupt
device.execute().set_input_line(5, HOLD_LINE);
}
@@ -232,36 +176,6 @@ WRITE8_MEMBER(moo_state::sound_bankswitch_w)
}
-#if 0 // (for reference; do not remove)
-
-/* the interface with the 053247 is weird. The chip can address only 0x1000 bytes */
-/* of RAM, but they put 0x10000 there. The CPU can access them all. */
-READ16_MEMBER(moo_state::k053247_scattered_word_r)
-{
- if (offset & 0x0078)
- return m_spriteram[offset];
- else
- {
- offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4);
- return k053247_word_r(m_k053246, offset, mem_mask);
- }
-}
-
-WRITE16_MEMBER(moo_state::k053247_scattered_word_w)
-{
- if (offset & 0x0078)
- COMBINE_DATA(m_spriteram + offset);
- else
- {
- offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4);
-
- k053247_word_w(m_k053246, offset, data, mem_mask);
- }
-}
-
-#endif
-
-
WRITE16_MEMBER(moo_state::moo_prot_w)
{
uint32_t src1, src2, dst, length, a, b, res;
@@ -301,17 +215,16 @@ WRITE16_MEMBER(moo_state::moobl_oki_bank_w)
static ADDRESS_MAP_START( moo_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
- AM_RANGE(0x0c0000, 0x0c003f) AM_DEVWRITE("k056832", k056832_device, word_w)
- AM_RANGE(0x0c2000, 0x0c2007) AM_DEVWRITE("k053246", k053247_device, k053246_word_w)
-
- AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
- AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_device, word_w) /* K054338 alpha blending engine */
- AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x0c0000, 0x0c003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
+ AM_RANGE(0x0c2000, 0x0c2007) AM_DEVICE("sprites", k053246_053247_device, objset1)
+ AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD("sprites", k053246_053247_device, rom16_r)
+ AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x0ce000, 0x0ce01f) AM_WRITE(moo_prot_w)
- AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) /* CCU regs (ignored) */
+ AM_RANGE(0x0d0000, 0x0d001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w)
- AM_RANGE(0x0d6000, 0x0d601f) AM_DEVICE8("k054321", k054321_device, main_map, 0x00ff)
- AM_RANGE(0x0d8000, 0x0d8007) AM_DEVWRITE("k056832", k056832_device, b_word_w) /* VSCCS regs */
+ AM_RANGE(0x0d6000, 0x0d601f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0x00ff)
+ AM_RANGE(0x0d8000, 0x0d8007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
AM_RANGE(0x0da000, 0x0da001) AM_READ_PORT("P1_P3")
AM_RANGE(0x0da002, 0x0da003) AM_READ_PORT("P2_P4")
AM_RANGE(0x0dc000, 0x0dc001) AM_READ_PORT("IN0")
@@ -320,31 +233,23 @@ static ADDRESS_MAP_START( moo_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x100000, 0x17ffff) AM_ROM
AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("workram") /* Work RAM */
AM_RANGE(0x190000, 0x19ffff) AM_RAM AM_SHARE("spriteram") /* Sprite RAM */
- AM_RANGE(0x1a0000, 0x1a1fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* Graphic planes */
- AM_RANGE(0x1a2000, 0x1a3fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* Graphic planes mirror */
- AM_RANGE(0x1b0000, 0x1b1fff) AM_DEVREAD("k056832", k056832_device, rom_word_r) /* Passthrough to tile roms */
+ AM_RANGE(0x1a0000, 0x1a1fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x1b0000, 0x1b1fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
AM_RANGE(0x1c0000, 0x1c1fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
-#if MOO_DEBUG
- AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD("k056832", k056832_device, word_r)
- AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD("k053246", k053247_device, k053246_reg_word_r)
- AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_device, word_r)
- AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_device, lsb_r)
- AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_device, b_word_r)
-#endif
ADDRESS_MAP_END
static ADDRESS_MAP_START( moobl_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
- AM_RANGE(0x0c0000, 0x0c003f) AM_DEVWRITE("k056832", k056832_device, word_w)
- AM_RANGE(0x0c2000, 0x0c2007) AM_DEVWRITE("k053246", k053247_device, k053246_word_w)
+ AM_RANGE(0x0c0000, 0x0c003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
+ AM_RANGE(0x0c2000, 0x0c2007) AM_DEVICE("sprites", k053246_053247_device, objset1)
AM_RANGE(0x0c2f00, 0x0c2f01) AM_READNOP /* heck if I know, but it's polled constantly */
- AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
- AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_device, word_w) /* K054338 alpha blending engine */
- AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
- AM_RANGE(0x0d0000, 0x0d001f) AM_WRITEONLY /* CCU regs (ignored) */
+ AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD("sprites", k053246_053247_device, rom16_r)
+ AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
+ AM_RANGE(0x0d0000, 0x0d001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
AM_RANGE(0x0d6ffc, 0x0d6ffd) AM_WRITE(moobl_oki_bank_w)
AM_RANGE(0x0d6ffe, 0x0d6fff) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
- AM_RANGE(0x0d8000, 0x0d8007) AM_DEVWRITE("k056832", k056832_device, b_word_w) /* VSCCS regs */
+ AM_RANGE(0x0d8000, 0x0d8007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
AM_RANGE(0x0da000, 0x0da001) AM_READ_PORT("P1_P3")
AM_RANGE(0x0da002, 0x0da003) AM_READ_PORT("P2_P4")
AM_RANGE(0x0dc000, 0x0dc001) AM_READ_PORT("IN0")
@@ -353,9 +258,8 @@ static ADDRESS_MAP_START( moobl_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x100000, 0x17ffff) AM_ROM
AM_RANGE(0x180000, 0x18ffff) AM_RAM AM_SHARE("workram") /* Work RAM */
AM_RANGE(0x190000, 0x19ffff) AM_RAM AM_SHARE("spriteram") /* Sprite RAM */
- AM_RANGE(0x1a0000, 0x1a1fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* Graphic planes */
- AM_RANGE(0x1a2000, 0x1a3fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* Graphic planes mirror */
- AM_RANGE(0x1b0000, 0x1b1fff) AM_DEVREAD("k056832", k056832_device, rom_word_r) /* Passthrough to tile roms */
+ AM_RANGE(0x1a0000, 0x1a1fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x1b0000, 0x1b1fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
AM_RANGE(0x1c0000, 0x1c1fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END
@@ -364,33 +268,32 @@ static ADDRESS_MAP_START( bucky_map, AS_PROGRAM, 16, moo_state )
AM_RANGE(0x080000, 0x08ffff) AM_RAM
AM_RANGE(0x090000, 0x09ffff) AM_RAM AM_SHARE("spriteram") /* Sprite RAM */
AM_RANGE(0x0a0000, 0x0affff) AM_RAM /* extra sprite RAM? */
- AM_RANGE(0x0c0000, 0x0c003f) AM_DEVWRITE("k056832", k056832_device, word_w)
- AM_RANGE(0x0c2000, 0x0c2007) AM_DEVWRITE("k053246", k053247_device, k053246_word_w)
- AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
- AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_device, word_w) /* K054338 alpha blending engine */
- AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x0c0000, 0x0c003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
+ AM_RANGE(0x0c2000, 0x0c2007) AM_DEVICE("sprites", k053246_053247_device, objset1)
+ AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD("sprites", k053246_053247_device, rom16_r)
+ AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x0ce000, 0x0ce01f) AM_WRITE(moo_prot_w)
- AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) /* CCU regs (ignored) */
+ AM_RANGE(0x0d0000, 0x0d001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
AM_RANGE(0x0d2000, 0x0d20ff) AM_DEVREADWRITE("k054000", k054000_device, lsb_r, lsb_w)
AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w)
- AM_RANGE(0x0d6000, 0x0d601f) AM_DEVICE8("k054321", k054321_device, main_map, 0x00ff)
- AM_RANGE(0x0d8000, 0x0d8007) AM_DEVWRITE("k056832", k056832_device, b_word_w) /* VSCCS regs */
+ AM_RANGE(0x0d6000, 0x0d601f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0x00ff)
+ AM_RANGE(0x0d8000, 0x0d8007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
AM_RANGE(0x0da000, 0x0da001) AM_READ_PORT("P1_P3")
AM_RANGE(0x0da002, 0x0da003) AM_READ_PORT("P2_P4")
AM_RANGE(0x0dc000, 0x0dc001) AM_READ_PORT("IN0")
AM_RANGE(0x0dc002, 0x0dc003) AM_READ_PORT("IN1")
AM_RANGE(0x0de000, 0x0de001) AM_READWRITE(control2_r, control2_w)
- AM_RANGE(0x180000, 0x181fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* Graphic planes */
- AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* Graphic planes mirror */
+ AM_RANGE(0x180000, 0x181fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
AM_RANGE(0x184000, 0x187fff) AM_RAM /* extra tile RAM? */
- AM_RANGE(0x190000, 0x191fff) AM_DEVREAD("k056832", k056832_device, rom_word_r) /* Passthrough to tile roms */
+ AM_RANGE(0x190000, 0x191fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
AM_RANGE(0x1b0000, 0x1b3fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x200000, 0x23ffff) AM_ROM /* data */
#if MOO_DEBUG
AM_RANGE(0x0c0000, 0x0c003f) AM_DEVREAD("k056832", k056832_device, word_r)
- AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD("k053246", k053247_device, k053246_reg_word_r)
+ AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD("sprites", k053247_device, k053246_reg_word_r)
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_device, word_r)
- AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_device, lsb_r)
+ AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("mixer", k053251_device, lsb_r)
AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_device, b_word_r)
#endif
ADDRESS_MAP_END
@@ -401,7 +304,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, moo_state )
AM_RANGE(0xc000, 0xdfff) AM_RAM
AM_RANGE(0xe000, 0xe22f) AM_DEVREADWRITE("k054539", k054539_device, read, write)
AM_RANGE(0xec00, 0xec01) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
- AM_RANGE(0xf000, 0xf003) AM_DEVICE("k054321", k054321_device, sound_map)
+ AM_RANGE(0xf000, 0xf003) AM_DEVICE("soundctrl", k054321_device, sound_map)
AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_bankswitch_w)
ADDRESS_MAP_END
@@ -464,12 +367,7 @@ MACHINE_START_MEMBER(moo_state,moo)
{
save_item(NAME(m_cur_control2));
save_item(NAME(m_alpha_enabled));
- save_item(NAME(m_sprite_colorbase));
- save_item(NAME(m_layer_colorbase));
- save_item(NAME(m_layerpri));
save_item(NAME(m_protram));
-
- m_dmaend_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(moo_state::dmaend_callback),this));
}
MACHINE_RESET_MEMBER(moo_state,moo)
@@ -478,16 +376,6 @@ MACHINE_RESET_MEMBER(moo_state,moo)
for (i = 0; i < 16; i++)
m_protram[i] = 0;
-
- for (i = 0; i < 4; i++)
- m_layer_colorbase[i] = 0;
-
- for (i = 0; i < 3; i++)
- m_layerpri[i] = 0;
-
- m_cur_control2 = 0;
- m_alpha_enabled = 0;
- m_sprite_colorbase = 0;
}
static MACHINE_CONFIG_START( moo )
@@ -505,8 +393,8 @@ static MACHINE_CONFIG_START( moo )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
- MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4) // 8MHz
- MCFG_K053252_OFFSETS(40, 16)
+ MCFG_DEVICE_ADD("video_timings", K053252, XTAL_32MHz/4) // 8MHz
+// MCFG_K053252_OFFSETS(40, 16)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -515,33 +403,24 @@ static MACHINE_CONFIG_START( moo )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1200)) // should give IRQ4 sufficient time to update scroll registers
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(moo_state, screen_update_moo)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(XRGB)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
- MCFG_VIDEO_START_OVERRIDE(moo_state,moo)
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
- MCFG_DEVICE_ADD("k053246", K053246, 0)
- MCFG_K053246_CB(moo_state, sprite_callback)
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23)
- MCFG_K053246_PALETTE("palette")
+ MCFG_K054156_054157_ADD("tilemap", XTAL_32MHz/4, 8, 8, 24)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(moo_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_K053246_053247_ADD("sprites", XTAL_32MHz/4, "spriteram")
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("mixer", 0)
- MCFG_DEVICE_ADD("k054338", K054338, 0)
+ MCFG_DEVICE_ADD("blender", K054338, 0)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_K054321_ADD("k054321", ":lspeaker", ":rspeaker")
+ MCFG_K054321_ADD("soundctrl", ":lspeaker", ":rspeaker")
MCFG_YM2151_ADD("ymsnd", XTAL_32MHz/8) // 4MHz verified
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
@@ -571,28 +450,19 @@ static MACHINE_CONFIG_START( moobl )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1200)) // should give IRQ4 sufficient time to update scroll registers
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(moo_state, screen_update_moo)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(XRGB)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
- MCFG_VIDEO_START_OVERRIDE(moo_state,moo)
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
- MCFG_DEVICE_ADD("k053246", K053246, 0)
- MCFG_K053246_CB(moo_state, sprite_callback)
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23)
- MCFG_K053246_PALETTE("palette")
+ MCFG_K054156_054157_ADD("tilemap", 8000000, 8, 8, 24)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(moo_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_K053246_053247_ADD("sprites", 8000000, "spriteram")
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("mixer", 0)
- MCFG_DEVICE_ADD("k054338", K054338, 0)
+ MCFG_K054338_ADD("blender", "palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -609,17 +479,10 @@ static MACHINE_CONFIG_DERIVED( bucky, moo )
MCFG_K054000_ADD("k054000")
- MCFG_DEVICE_MODIFY("k053246")
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48, 23)
-
/* video hardware */
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_ENTRIES(4096)
MCFG_PALETTE_FORMAT(XRGB)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
-
- MCFG_VIDEO_START_OVERRIDE(moo_state,bucky)
MACHINE_CONFIG_END
@@ -638,12 +501,12 @@ ROM_START( moomesa ) /* Version EA */
ROM_LOAD( "151a07.f5", 0x000000, 0x040000, CRC(cde247fc) SHA1(cdee0228db55d53ae43d7cd2d9001dadd20c2c61) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "151a05.t8", 0x000000, 0x100000, CRC(bc616249) SHA1(58c1f1a03ce9bead8f79d12ce4b2d342432b24b5) )
ROM_LOAD32_WORD( "151a06.t10", 0x000002, 0x100000, CRC(38dbcac1) SHA1(c357779733921695b20ac586db5b475f5b2b8f4c) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "151a10.b8", 0x000000, 0x200000, CRC(376c64f1) SHA1(eb69c5a27f9795e28f04a503955132f0a9e4de12) )
ROM_LOAD64_WORD( "151a11.a8", 0x000002, 0x200000, CRC(e7f49225) SHA1(1255b214f29b6507540dad5892c60a7ae2aafc5c) )
@@ -673,12 +536,12 @@ ROM_START( moomesauac ) /* Version UA */
ROM_LOAD( "151a07.f5", 0x000000, 0x040000, CRC(cde247fc) SHA1(cdee0228db55d53ae43d7cd2d9001dadd20c2c61) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "151a05.t8", 0x000000, 0x100000, CRC(bc616249) SHA1(58c1f1a03ce9bead8f79d12ce4b2d342432b24b5) )
ROM_LOAD32_WORD( "151a06.t10", 0x000002, 0x100000, CRC(38dbcac1) SHA1(c357779733921695b20ac586db5b475f5b2b8f4c) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "151a10.b8", 0x000000, 0x200000, CRC(376c64f1) SHA1(eb69c5a27f9795e28f04a503955132f0a9e4de12) )
ROM_LOAD64_WORD( "151a11.a8", 0x000002, 0x200000, CRC(e7f49225) SHA1(1255b214f29b6507540dad5892c60a7ae2aafc5c) )
@@ -708,12 +571,12 @@ ROM_START( moomesauab ) /* Version UA */
ROM_LOAD( "151a07.f5", 0x000000, 0x040000, CRC(cde247fc) SHA1(cdee0228db55d53ae43d7cd2d9001dadd20c2c61) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "151a05.t8", 0x000000, 0x100000, CRC(bc616249) SHA1(58c1f1a03ce9bead8f79d12ce4b2d342432b24b5) )
ROM_LOAD32_WORD( "151a06.t10", 0x000002, 0x100000, CRC(38dbcac1) SHA1(c357779733921695b20ac586db5b475f5b2b8f4c) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "151a10.b8", 0x000000, 0x200000, CRC(376c64f1) SHA1(eb69c5a27f9795e28f04a503955132f0a9e4de12) )
ROM_LOAD64_WORD( "151a11.a8", 0x000002, 0x200000, CRC(e7f49225) SHA1(1255b214f29b6507540dad5892c60a7ae2aafc5c) )
@@ -743,12 +606,12 @@ ROM_START( moomesaaab ) /* Version AA */
ROM_LOAD( "151a07.f5", 0x000000, 0x040000, CRC(cde247fc) SHA1(cdee0228db55d53ae43d7cd2d9001dadd20c2c61) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "151a05.t8", 0x000000, 0x100000, CRC(bc616249) SHA1(58c1f1a03ce9bead8f79d12ce4b2d342432b24b5) )
ROM_LOAD32_WORD( "151a06.t10", 0x000002, 0x100000, CRC(38dbcac1) SHA1(c357779733921695b20ac586db5b475f5b2b8f4c) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "151a10.b8", 0x000000, 0x200000, CRC(376c64f1) SHA1(eb69c5a27f9795e28f04a503955132f0a9e4de12) )
ROM_LOAD64_WORD( "151a11.a8", 0x000002, 0x200000, CRC(e7f49225) SHA1(1255b214f29b6507540dad5892c60a7ae2aafc5c) )
@@ -778,12 +641,12 @@ ROM_START( bucky ) /* Version EA */
ROM_LOAD( "173a07.f5", 0x000000, 0x040000, CRC(4cdaee71) SHA1(bdc05d4475415f6fac65d7cdbc48df398e57845e) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "173a05.t8", 0x000000, 0x100000, CRC(d14333b4) SHA1(d1a15ead2d156e1fceca0bf202ab3962411caf11) )
ROM_LOAD32_WORD( "173a06.t10", 0x000002, 0x100000, CRC(6541a34f) SHA1(15cf481498e3b7e0b2f7bfe5434121cc3bd65662) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "173a10.b8", 0x000000, 0x200000, CRC(42fb0a0c) SHA1(d68c932cfabdec7896698b433525fe47ef4698d0) )
ROM_LOAD64_WORD( "173a11.a8", 0x000002, 0x200000, CRC(b0d747c4) SHA1(0cf1ee1b9a35ded31a81c321df2a076f7b588971) )
@@ -814,12 +677,12 @@ ROM_START( buckyea ) /* Version EA */
ROM_LOAD( "173a07.f5", 0x000000, 0x040000, CRC(4cdaee71) SHA1(bdc05d4475415f6fac65d7cdbc48df398e57845e) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "173a05.t8", 0x000000, 0x100000, CRC(d14333b4) SHA1(d1a15ead2d156e1fceca0bf202ab3962411caf11) )
ROM_LOAD32_WORD( "173a06.t10", 0x000002, 0x100000, CRC(6541a34f) SHA1(15cf481498e3b7e0b2f7bfe5434121cc3bd65662) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "173a10.b8", 0x000000, 0x200000, CRC(42fb0a0c) SHA1(d68c932cfabdec7896698b433525fe47ef4698d0) )
ROM_LOAD64_WORD( "173a11.a8", 0x000002, 0x200000, CRC(b0d747c4) SHA1(0cf1ee1b9a35ded31a81c321df2a076f7b588971) )
@@ -886,12 +749,12 @@ ROM_START( buckyuab ) /* Version UA */
ROM_LOAD( "173a07.f5", 0x000000, 0x040000, CRC(4cdaee71) SHA1(bdc05d4475415f6fac65d7cdbc48df398e57845e) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "173a05.t8", 0x000000, 0x100000, CRC(d14333b4) SHA1(d1a15ead2d156e1fceca0bf202ab3962411caf11) )
ROM_LOAD32_WORD( "173a06.t10", 0x000002, 0x100000, CRC(6541a34f) SHA1(15cf481498e3b7e0b2f7bfe5434121cc3bd65662) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "173a10.b8", 0x000000, 0x200000, CRC(42fb0a0c) SHA1(d68c932cfabdec7896698b433525fe47ef4698d0) )
ROM_LOAD64_WORD( "173a11.a8", 0x000002, 0x200000, CRC(b0d747c4) SHA1(0cf1ee1b9a35ded31a81c321df2a076f7b588971) )
@@ -922,12 +785,12 @@ ROM_START( buckyaab ) /* Version AA */
ROM_LOAD( "173a07.f5", 0x000000, 0x040000, CRC(4cdaee71) SHA1(bdc05d4475415f6fac65d7cdbc48df398e57845e) )
ROM_RELOAD( 0x010000, 0x040000 )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
/* tilemaps */
ROM_LOAD32_WORD( "173a05.t8", 0x000000, 0x100000, CRC(d14333b4) SHA1(d1a15ead2d156e1fceca0bf202ab3962411caf11) )
ROM_LOAD32_WORD( "173a06.t10", 0x000002, 0x100000, CRC(6541a34f) SHA1(15cf481498e3b7e0b2f7bfe5434121cc3bd65662) )
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
/* sprites */
ROM_LOAD64_WORD( "173a10.b8", 0x000000, 0x200000, CRC(42fb0a0c) SHA1(d68c932cfabdec7896698b433525fe47ef4698d0) )
ROM_LOAD64_WORD( "173a11.a8", 0x000002, 0x200000, CRC(b0d747c4) SHA1(0cf1ee1b9a35ded31a81c321df2a076f7b588971) )
@@ -953,14 +816,14 @@ ROM_START( moomesabl )
ROM_LOAD16_WORD_SWAP( "moo03.rom", 0x000000, 0x80000, CRC(fed6a1cb) SHA1(be58e266973930d643b5e15dcc974a82e1a3ae35) )
ROM_LOAD16_WORD_SWAP( "moo04.rom", 0x080000, 0x80000, CRC(ec45892a) SHA1(594330cbbfbca87e61ddf519e565018b6eaf5a20) )
- ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_REGION( 0x200000, "tilemap", 0 )
ROM_LOAD32_WORD( "moo05.rom", 0x000000, 0x080000, CRC(8c045f9c) SHA1(cde81a722a4bc2efac09a26d7e300664059ec7bb) )
ROM_LOAD32_WORD( "moo07.rom", 0x000002, 0x080000, CRC(b9e29f50) SHA1(c2af095df0af45064d49210085370425b319b82b) )
ROM_LOAD32_WORD( "moo06.rom", 0x100000, 0x080000, CRC(1261aa89) SHA1(b600916911bc0d8b6348e2ad4a16ed1a1c528261) )
ROM_LOAD32_WORD( "moo08.rom", 0x100002, 0x080000, CRC(e6937229) SHA1(089b3d4af33e8d8fbc1f3abb81e047a7a590567c) )
// sprites from bootleg not included in dump, taken from original game
- ROM_REGION( 0x800000, "gfx2", 0 )
+ ROM_REGION( 0x800000, "sprites", 0 )
ROM_LOAD64_WORD( "151a10", 0x000000, 0x200000, CRC(376c64f1) SHA1(eb69c5a27f9795e28f04a503955132f0a9e4de12) )
ROM_LOAD64_WORD( "151a11", 0x000002, 0x200000, CRC(e7f49225) SHA1(1255b214f29b6507540dad5892c60a7ae2aafc5c) )
ROM_LOAD64_WORD( "151a12", 0x000004, 0x200000, CRC(4978555f) SHA1(d9871f21d0c8a512b408e137e2e80e9392c2bf6f) )
diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp
index 737243746d3..2bd63aeefc2 100644
--- a/src/mame/drivers/mystwarr.cpp
+++ b/src/mame/drivers/mystwarr.cpp
@@ -130,21 +130,312 @@ So I would bet one is a bug fix to the other because someone forgot what each bi
There's no way a bad dump could be that precise and logical. However without further investigation/tracing
we have no way of knowing which is the later/corrected version.
+Extra note: These values, once added, are rom checksums. So the bits
+indicate which roms are correct.
+
**************************************************************************/
#include "emu.h"
-#include "includes/mystwarr.h"
-#include "includes/konamigx.h"
-#include "includes/konamipt.h"
-#include "video/k053250.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
+#include "includes/konamipt.h"
#include "machine/eepromser.h"
+#include "machine/k053252.h"
+#include "machine/k054321.h"
#include "sound/k054539.h"
#include "speaker.h"
+#include "video/k053246_k053247_k055673.h"
+#include "video/k053250.h"
+#include "video/k053936.h"
+#include "video/k054000.h"
+#include "video/k054156_k054157_k056832.h"
+#include "video/k054338.h"
+#include "video/k055555.h"
+
+class mystwarr_state : public driver_device
+{
+public:
+ mystwarr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this,"maincpu"),
+ m_soundcpu(*this,"soundcpu"),
+ m_screen(*this, "screen"),
+ m_video_timings(*this, "video_timings"),
+ m_tilemap(*this, "tilemap"),
+ m_sprites(*this, "sprites"),
+ m_lvc(*this, "lvc"),
+ m_mixer(*this, "mixer"),
+ m_blender(*this, "blender"),
+ m_k054539_1(*this,"k054539_1"),
+ m_k054539_2(*this,"k054539_2"),
+ m_workram(*this,"workram"),
+ m_spriteram(*this,"spriteram"),
+ m_soundctrl(*this, "soundctrl")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_soundcpu;
+ required_device<screen_device> m_screen;
+ required_device<k053252_device> m_video_timings;
+ required_device<k054156_054157_device> m_tilemap;
+ required_device<k053246_055673_device> m_sprites;
+ optional_device<k053250_device> m_lvc;
+ required_device<k055555_device> m_mixer;
+ required_device<k054338_device> m_blender;
+ required_device<k054539_device> m_k054539_1;
+ required_device<k054539_device> m_k054539_2;
+ required_shared_ptr<uint16_t> m_workram;
+ required_shared_ptr<uint16_t> m_spriteram;
+ required_device<k054321_device> m_soundctrl;
+ std::unique_ptr<uint8_t[]> m_decoded;
+
+ uint8_t m_mw_irq_control;
+ int m_cur_sound_region;
+ int m_layer_colorbase[6];
+ int m_oinprion;
+ int m_cbparam;
+ int m_sprite_colorbase;
+ int m_sub1_colorbase;
+ int m_last_psac_colorbase;
+ int m_gametype;
+ int m_roz_enable;
+ int m_roz_rombank;
+ tilemap_t *m_ult_936_tilemap;
+ uint16_t m_clip;
+
+ uint16_t m_prot_data[0x20];
+
+ uint8_t m_sound_ctrl;
+ uint8_t m_sound_nmi_clk;
+
+ DECLARE_WRITE_LINE_MEMBER(objdmairq_w);
+ DECLARE_WRITE_LINE_MEMBER(objdmaact_w);
+ DECLARE_WRITE_LINE_MEMBER(vblankirq_w);
+ DECLARE_READ16_MEMBER(eeprom_r);
+ DECLARE_WRITE16_MEMBER(mweeprom_w);
+ DECLARE_READ16_MEMBER(dddeeprom_r);
+ DECLARE_WRITE16_MEMBER(mmeeprom_w);
+ DECLARE_WRITE16_MEMBER(sound_irq_w);
+ DECLARE_WRITE16_MEMBER(irq_ack_w);
+ DECLARE_READ16_MEMBER(k053247_scattered_word_r);
+ DECLARE_WRITE16_MEMBER(k053247_scattered_word_w);
+ DECLARE_READ16_MEMBER(k053247_martchmp_word_r);
+ DECLARE_WRITE16_MEMBER(k053247_martchmp_word_w);
+ DECLARE_READ16_MEMBER(mccontrol_r);
+ DECLARE_WRITE16_MEMBER(mccontrol_w);
+ DECLARE_WRITE8_MEMBER(sound_ctrl_w);
+
+ DECLARE_WRITE16_MEMBER(K053990_martchmp_word_w);
+
+ DECLARE_READ16_MEMBER(K055550_word_r);
+ DECLARE_WRITE16_MEMBER(K055550_word_w);
+
+ DECLARE_WRITE16_MEMBER(ddd_053936_enable_w);
+ DECLARE_WRITE16_MEMBER(ddd_053936_clip_w);
+ DECLARE_READ16_MEMBER(gai_053936_tilerom_0_r);
+ DECLARE_READ16_MEMBER(ddd_053936_tilerom_0_r);
+ DECLARE_READ16_MEMBER(ddd_053936_tilerom_1_r);
+ DECLARE_READ16_MEMBER(gai_053936_tilerom_2_r);
+ DECLARE_READ16_MEMBER(ddd_053936_tilerom_2_r);
+ TILE_GET_INFO_MEMBER(get_gai_936_tile_info);
+ TILE_GET_INFO_MEMBER(get_ult_936_tile_info);
+ DECLARE_MACHINE_START(mystwarr);
+ DECLARE_MACHINE_RESET(mystwarr);
+ DECLARE_MACHINE_RESET(viostorm);
+ DECLARE_MACHINE_RESET(metamrph);
+ DECLARE_MACHINE_RESET(dadandrn);
+ DECLARE_MACHINE_RESET(gaiapols);
+ DECLARE_MACHINE_RESET(martchmp);
+ INTERRUPT_GEN_MEMBER(ddd_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen);
+ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(metamrph_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(mchamp_interrupt);
+
+ void sprites_wiring(uint32_t output, uint16_t &color, uint16_t &attr);
+ void gaiapolis_sprites_wiring(uint32_t output, uint16_t &color, uint16_t &attr);
+ offs_t sprites_remap(offs_t offset);
+ void fr_setup_common(flow_render::manager *manager);
+ void fr_setup(flow_render::manager *manager);
+ void fr_setup_lvc(flow_render::manager *manager);
+};
+
+void mystwarr_state::fr_setup_common(flow_render::manager *manager)
+{
+ auto rb = m_blender->flow_render_get_renderer();
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rs = m_sprites->flow_render_get_renderer();
+
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), rm->inp("a color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), rm->inp("b color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm->inp("c color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm->inp("d color"));
+
+ manager->connect(rs->out("color"), rm->inp("o color"));
+ manager->connect(rs->out("attr"), rm->inp("o attr"));
+
+ manager->set_constant(rm->inp("s2 color"), 0);
+ manager->set_constant(rm->inp("s3 color"), 0);
+ manager->set_constant(rm->inp("s2 attr"), 0);
+ manager->set_constant(rm->inp("s3 attr"), 0);
+
+ manager->connect(rm->out("0 color"), rb->inp("0 color"));
+ manager->connect(rm->out("0 attr"), rb->inp("0 attr"));
+ manager->connect(rm->out("1 color"), rb->inp("1 color"));
+ manager->connect(rm->out("1 attr"), rb->inp("1 attr"));
+
+ manager->connect(rb->out(), m_screen->flow_render_get_renderer()->inp());
+}
+
+void mystwarr_state::fr_setup(flow_render::manager *manager)
+{
+ fr_setup_common(manager);
+ auto rm = m_mixer ->flow_render_get_renderer();
+ manager->set_constant(rm->inp("s1 color"), 0);
+ manager->set_constant(rm->inp("s1 attr"), 0);
+}
+
+void mystwarr_state::fr_setup_lvc(flow_render::manager *manager)
+{
+ fr_setup_common(manager);
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rl = m_lvc ->flow_render_get_renderer();
+
+ manager->connect(rl->out("color"), rm->inp("s1 color"));
+ manager->connect(rl->out("attr"), rm->inp("s1 attr"));
+}
+
+WRITE16_MEMBER(mystwarr_state::ddd_053936_enable_w)
+{
+ if (ACCESSING_BITS_8_15) {
+ m_roz_enable = data & 0x0100;
+ m_roz_rombank = (data & 0xc000)>>14;
+ }
+}
+
+WRITE16_MEMBER(mystwarr_state::ddd_053936_clip_w)
+{
+ int old, clip_x, clip_y, size_x, size_y;
+ int minx, maxx, miny, maxy;
+
+ if (offset == 1) {
+ if (ACCESSING_BITS_8_15) K053936GP_clip_enable(0, data & 0x0100);
+ } else {
+ old = m_clip;
+ COMBINE_DATA(&m_clip);
+ if (m_clip != old)
+ {
+ clip_x = (m_clip & 0x003f) >> 0;
+ clip_y = (m_clip & 0x0fc0) >> 6;
+ size_x = (m_clip & 0x3000) >> 12;
+ size_y = (m_clip & 0xc000) >> 14;
+
+ switch (size_x)
+ {
+ case 0x3: size_x = 1; break;
+ case 0x2: size_x = 2; break;
+ default: size_x = 4; break;
+ }
+
+ switch (size_y)
+ {
+ case 0x3: size_y = 1; break;
+ case 0x2: size_y = 2; break;
+ default: size_y = 4; break;
+ }
+
+ minx = clip_x << 7;
+ maxx = ((clip_x + size_x) << 7) - 1;
+ miny = clip_y << 7;
+ maxy = ((clip_y + size_y) << 7) - 1;
+
+ K053936GP_set_cliprect(0, minx, maxx, miny, maxy);
+ }
+ }
+}
+
+TILE_GET_INFO_MEMBER(mystwarr_state::get_gai_936_tile_info)
+{
+ int tileno, colour;
+ uint8_t *ROM = memregion("gfx4")->base();
+ uint8_t *dat1 = ROM, *dat2 = ROM + 0x20000, *dat3 = ROM + 0x60000;
+
+ tileno = dat3[tile_index] | ((dat2[tile_index]&0x3f)<<8);
+
+ if (tile_index & 1)
+ colour = (dat1[tile_index>>1]&0xf);
+ else
+ colour = ((dat1[tile_index>>1]>>4)&0xf);
+
+ if (dat2[tile_index] & 0x80) colour |= 0x10;
+
+ colour |= m_sub1_colorbase << 4;
+
+ SET_TILE_INFO_MEMBER(0, tileno, colour, 0);
+}
+
+TILE_GET_INFO_MEMBER(mystwarr_state::get_ult_936_tile_info)
+{
+ int tileno, colour;
+ uint8_t *ROM = memregion("gfx4")->base();
+ uint8_t *dat1 = ROM, *dat2 = ROM + 0x40000;
+
+ tileno = dat2[tile_index] | ((dat1[tile_index]&0x1f)<<8);
+ colour = m_sub1_colorbase;
+ SET_TILE_INFO_MEMBER(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0);
+}
+
+// reference: 223e5c in gaiapolis (ROMs 34j and 36m)
+READ16_MEMBER(mystwarr_state::gai_053936_tilerom_0_r)
+{
+ uint8_t *ROM1 = (uint8_t *)memregion("gfx4")->base();
+ uint8_t *ROM2 = (uint8_t *)memregion("gfx4")->base();
+
+ ROM1 += 0x20000;
+ ROM2 += 0x20000+0x40000;
+
+ return ((ROM1[offset]<<8) | ROM2[offset]);
+}
+
+READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_0_r)
+{
+ uint8_t *ROM1 = (uint8_t *)memregion("gfx4")->base();
+ uint8_t *ROM2 = (uint8_t *)memregion("gfx4")->base();
+
+ ROM2 += 0x40000;
+
+ return ((ROM1[offset]<<8) | ROM2[offset]);
+}
+
+// reference: 223e1a in gaiapolis (ROM 36j)
+READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_1_r)
+{
+ uint8_t *ROM = (uint8_t *)memregion("gfx4")->base();
+
+ return ROM[offset/2];
+}
+
+// reference: 223db0 in gaiapolis (ROMs 32n, 29n, 26n)
+READ16_MEMBER(mystwarr_state::gai_053936_tilerom_2_r)
+{
+ uint8_t *ROM = (uint8_t *)memregion("gfx3")->base();
+
+ offset += (m_roz_rombank * 0x100000);
+
+ return ROM[offset/2]<<8;
+}
+
+READ16_MEMBER(mystwarr_state::ddd_053936_tilerom_2_r)
+{
+ uint8_t *ROM = (uint8_t *)memregion("gfx3")->base();
+
+ offset += (m_roz_rombank * 0x100000);
+
+ return ROM[offset]<<8;
+}
READ16_MEMBER(mystwarr_state::eeprom_r)
{
@@ -188,8 +479,52 @@ WRITE16_MEMBER(mystwarr_state::mmeeprom_w)
}
+
/**********************************************************************************/
/* IRQ controllers */
+// mystwarr:
+// level 2 - vblank - cleared on vacset.7.0
+// level 4 - ? - cleared on vacset.7.1 (no real code, vblank too?)
+// level 6 - ? - cleared on mweeprom.5 (no real code)
+//
+// metamrph:
+// level 3 - dmaend - ?
+// level 4 - lvcdma - cleared on mweeprom.5 and disabled on 53250.0.1
+// level 5 - objdma - cleared on mweeprom.5 and sprite.dma and 53250.9.1
+// level 6 - 53252.int1 - cleared on k053252.1d
+
+// metamrph eeprom_w:
+// 0 - eeprom data
+// 1 - eeprom enable
+// 2 - eeprom clock
+// 3 - coin counter 1
+// 4 - coin counter 2
+// 5 - objdmaen
+// 6 - lvcdmaen
+// 7 - lvcrot
+// 8 - ochara
+// 9 - nc
+// 10 - afe?
+// 11 - mute
+
+void mystwarr_state::sprites_wiring(uint32_t output, uint16_t &color, uint16_t &attr)
+{
+ color = output & 0xff;
+ attr = (output >> 6) & 0x3fc;
+}
+
+
+void mystwarr_state::gaiapolis_sprites_wiring(uint32_t output, uint16_t &color, uint16_t &attr)
+{
+ color = output & 0xff;
+ attr = (output >> 6) & 0xfc;
+}
+
+offs_t mystwarr_state::sprites_remap(offs_t offset)
+{
+ return (offset & 0x00e) | ((offset & 0xff0) << 4);
+
+}
TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mystwarr_interrupt)
{
@@ -217,8 +552,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::metamrph_interrupt)
if(scanline == 24)
m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
- if(scanline == 248)
- if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
+ // if(scanline == 248)
+ // if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
}
TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mchamp_interrupt)
@@ -227,10 +562,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mchamp_interrupt)
if (!(m_mw_irq_control & 0x02)) return;
- if(scanline == 247)
- {
- if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
- }
+ // if(scanline == 247)
+ // {
+ // if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
+ // }
if(scanline == 23)
m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
@@ -251,7 +586,7 @@ WRITE16_MEMBER(mystwarr_state::sound_irq_w)
WRITE16_MEMBER(mystwarr_state::irq_ack_w)
{
- m_k056832->b_word_w(space, offset, data, mem_mask);
+ // m_k056832->b_word_w(space, offset, data, mem_mask);
if (offset == 3 && ACCESSING_BITS_0_7)
{
@@ -262,31 +597,244 @@ WRITE16_MEMBER(mystwarr_state::irq_ack_w)
}
}
-/* the interface with the 053247 is weird. The chip can address only 0x1000 bytes */
-/* of RAM, but they put 0x10000 there. The CPU can access them all. */
-READ16_MEMBER(mystwarr_state::k053247_scattered_word_r)
+/*
+K055550
+-------
+
+Protection chip which performs a memset() operation.
+
+Used in Violent Storm and Ultimate Battler to clear VRAM between scenes, among
+other things. May also perform other functions since Violent Storm still isn't
+happy...
+
+Has word-wide registers as follows:
+
+0: Count of units to transfer. The write here triggers the transfer.
+1-6: Unknown
+7: Destination address, MSW
+8: Destination address, LSW
+9: Unknown
+10: Size of transfer units, MSW
+11: Size of transfer units, LSW
+12: Unknown
+13: Value to fill destination region with
+14-15: Unknown
+
+*/
+
+
+READ16_MEMBER(mystwarr_state::K055550_word_r)
{
- if (offset & 0x0078)
- return m_spriteram[offset];
- else
- {
- offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4);
- return m_k055673->k053247_word_r(space,offset,mem_mask);
- }
+ return(m_prot_data[offset]);
}
-WRITE16_MEMBER(mystwarr_state::k053247_scattered_word_w)
+WRITE16_MEMBER(mystwarr_state::K055550_word_w)
{
- if (offset & 0x0078)
+ uint32_t adr, bsize, count, i, lim;
+ int src, tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2;
+ int dx, dy, angle;
+
+ COMBINE_DATA(m_prot_data+offset);
+
+ if (offset == 0 && ACCESSING_BITS_8_15)
{
-// osd_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, space.device().safe_pc());
- COMBINE_DATA(m_spriteram+offset);
+ data >>= 8;
+ switch (data)
+ {
+ case 0x97: // memset() (Dadandarn at 0x639dc)
+ case 0x9f: // memset() (Violent Storm at 0x989c)
+ adr = (m_prot_data[7] << 16) | m_prot_data[8];
+ bsize = (m_prot_data[10] << 16) | m_prot_data[11];
+ count = (m_prot_data[0] & 0xff) + 1;
+
+ lim = adr+bsize*count;
+ for(i=adr; i<lim; i+=2)
+ space.write_word(i, m_prot_data[0x1a/2]);
+ break;
+
+ // WARNING: The following cases are speculation based with questionable accuracy!(AAT)
+
+ case 0x87: // unknown memory write (Violent Storm at 0x00b6ea)
+ // Violent Storm writes the following data to the 55550 in mode 0x87.
+ // All values are hardcoded and the write happens each frame during
+ // gameplay. It refers to a 32x8-word list at 0x210e00 and seems to
+ // be tied with another 13x128-byte table at 0x205080.
+ // Both tables appear "check-only" and have little effect on gameplay.
+ count =(m_prot_data[0] & 0xff) + 1; // unknown ( byte 0x00)
+ i = m_prot_data[1]; // unknown ( byte 0x1f)
+ adr = m_prot_data[7]<<16 | m_prot_data[8]; // address (dword 0x210e00)
+ lim = m_prot_data[9]; // unknown ( word 0x0010)
+ src = m_prot_data[10]<<16 | m_prot_data[11]; // unknown (dword zero)
+ tgt = m_prot_data[12]<<16 | m_prot_data[13]; // unknown (dword zero)
+ break;
+
+ case 0xa0: // update collision detection table (Violent Storm at 0x018b42)
+ count = m_prot_data[0] & 0xff; // number of objects - 1
+ skip = m_prot_data[1]>>(8-1); // words to skip in each entry to reach the "hit list"
+ adr = m_prot_data[2]<<16 | m_prot_data[3]; // where the table is located
+ bsize = m_prot_data[5]<<16 | m_prot_data[6]; // object entry size in bytes
+
+ srcend = adr + bsize * count;
+ tgtend = srcend + bsize;
+
+ // let's hope GCC will inline the mem24bew calls
+ for (src=adr; src<srcend; src+=bsize)
+ {
+ cx1 = (short)space.read_word(src);
+ sx1 = (short)space.read_word(src + 2);
+ wx1 = (short)space.read_word(src + 4);
+
+ cy1 = (short)space.read_word(src + 6);
+ sy1 = (short)space.read_word(src + 8);
+ wy1 = (short)space.read_word(src +10);
+
+ cz1 = (short)space.read_word(src +12);
+ sz1 = (short)space.read_word(src +14);
+ wz1 = (short)space.read_word(src +16);
+
+ count = i = src + skip;
+ tgt = src + bsize;
+
+ for (; count<tgt; count++) space.write_byte(count, 0);
+
+ for (; tgt<tgtend; i++, tgt+=bsize)
+ {
+ c2 = (short)space.read_word(tgt);
+ s2 = (short)space.read_word(tgt + 2);
+ w2 = (short)space.read_word(tgt + 4);
+ if (abs((cx1+sx1)-(c2+s2))>=wx1+w2) continue; // X rejection
+
+ c2 = (short)space.read_word(tgt + 6);
+ s2 = (short)space.read_word(tgt + 8);
+ w2 = (short)space.read_word(tgt +10);
+ if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection
+
+ c2 = (short)space.read_word(tgt +12);
+ s2 = (short)space.read_word(tgt +14);
+ w2 = (short)space.read_word(tgt +16);
+ if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection
+
+ space.write_byte(i, 0x80); // collision confirmed
+ }
+ }
+ break;
+
+ case 0xc0: // calculate object "homes-in" vector (Violent Storm at 0x03da9e)
+ dx = (short)m_prot_data[0xc];
+ dy = (short)m_prot_data[0xd];
+
+ // it's not necessary to use lookup tables because Violent Storm
+ // only calls the service once per enemy per frame.
+ if (dx)
+ {
+ if (dy)
+ {
+ angle = (atan((double)dy / dx) * 128.0) / M_PI;
+ if (dx < 0) angle += 128;
+ i = (angle - 0x40) & 0xff;
+ }
+ else
+ i = (dx > 0) ? 0xc0 : 0x40;
+ }
+ else
+ if (dy > 0) i = 0;
+ else
+ if (dy < 0) i = 0x80;
+ else
+ i = machine().rand() & 0xff; // vector direction indeterminate
+
+ m_prot_data[0x10] = i;
+ break;
+
+ default:
+// logerror("%06x: unknown K055550 command %02x\n", space.device().safe_pc(), data);
+ break;
+ }
}
- else
+}
+
+WRITE16_MEMBER(mystwarr_state::K053990_martchmp_word_w)
+{
+ int src_addr, src_count, src_skip;
+ int dst_addr, /*dst_count,*/ dst_skip;
+ int mod_addr, mod_count, mod_skip, mod_offs;
+ int mode, i, element_size = 1;
+ uint16_t mod_val, mod_data;
+
+ COMBINE_DATA(m_prot_data+offset);
+
+ if (offset == 0x0c && ACCESSING_BITS_8_15)
{
- offset = (offset & 0x0007) | ((offset & 0x7f80) >> 4);
+ mode = (m_prot_data[0x0d]<<8 & 0xff00) | (m_prot_data[0x0f] & 0xff);
- m_k055673->k053247_word_w(space,offset,data,mem_mask);
+ switch (mode)
+ {
+ case 0xffff: // word copy
+ element_size = 2;
+ case 0xff00: // byte copy
+ src_addr = m_prot_data[0x0];
+ src_addr |= m_prot_data[0x1]<<16 & 0xff0000;
+ dst_addr = m_prot_data[0x2];
+ dst_addr |= m_prot_data[0x3]<<16 & 0xff0000;
+ src_count = m_prot_data[0x8]>>8;
+ //dst_count = m_prot_data[0x9]>>8;
+ src_skip = m_prot_data[0xa] & 0xff;
+ dst_skip = m_prot_data[0xb] & 0xff;
+
+ if ((m_prot_data[0x8] & 0xff) == 2) src_count <<= 1;
+ src_skip += element_size;
+ dst_skip += element_size;
+
+ if (element_size == 1)
+ for (i=src_count; i; i--)
+ {
+ space.write_byte(dst_addr, space.read_byte(src_addr));
+ src_addr += src_skip;
+ dst_addr += dst_skip;
+ }
+ else for (i=src_count; i; i--)
+ {
+ space.write_word(dst_addr, space.read_word(src_addr));
+ src_addr += src_skip;
+ dst_addr += dst_skip;
+ }
+ break;
+
+ case 0x00ff: // sprite list modifier
+ src_addr = m_prot_data[0x0];
+ src_addr |= m_prot_data[0x1]<<16 & 0xff0000;
+ src_skip = m_prot_data[0x1]>>8;
+ dst_addr = m_prot_data[0x2];
+ dst_addr |= m_prot_data[0x3]<<16 & 0xff0000;
+ dst_skip = m_prot_data[0x3]>>8;
+ mod_addr = m_prot_data[0x4];
+ mod_addr |= m_prot_data[0x5]<<16 & 0xff0000;
+ mod_skip = m_prot_data[0x5]>>8;
+ mod_offs = m_prot_data[0x8] & 0xff;
+ mod_offs<<= 1;
+ mod_count = 0x100;
+
+ src_addr += mod_offs;
+ dst_addr += mod_offs;
+
+ for (i=mod_count; i; i--)
+ {
+ mod_val = space.read_word(mod_addr);
+ mod_addr += mod_skip;
+
+ mod_data = space.read_word(src_addr);
+ src_addr += src_skip;
+
+ mod_data += mod_val;
+
+ space.write_word(dst_addr, mod_data);
+ dst_addr += dst_skip;
+ }
+ break;
+
+ default:
+ break;
+ }
}
}
@@ -294,119 +842,89 @@ WRITE16_MEMBER(mystwarr_state::k053247_scattered_word_w)
/* Mystic Warriors */
static ADDRESS_MAP_START( mystwarr_map, AS_PROGRAM, 16, mystwarr_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // main program
- AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("gx_workram")
- AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(k053247_scattered_word_r,k053247_scattered_word_w) AM_SHARE("spriteram")
- AM_RANGE(0x480000, 0x4800ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)
- AM_RANGE(0x482000, 0x48200f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
- AM_RANGE(0x482010, 0x48201f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
- AM_RANGE(0x484000, 0x484007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
- AM_RANGE(0x48a000, 0x48a01f) AM_DEVWRITE("k054338", k054338_device, word_w)
- AM_RANGE(0x48c000, 0x48c03f) AM_DEVWRITE("k056832", k056832_device,word_w)
+ AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("workram")
+ AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0x480000, 0x4800ff) AM_DEVICE8("mixer", k055555_device, map, 0xff00)
+ AM_RANGE(0x482000, 0x48200f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r)
+ AM_RANGE(0x482010, 0x48201f) AM_DEVICE("sprites", k053246_055673_device, objset2)
+ AM_RANGE(0x484000, 0x484007) AM_DEVICE("sprites", k053246_055673_device, objset1)
+ AM_RANGE(0x48a000, 0x48a01f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x48c000, 0x48c03f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
AM_RANGE(0x490000, 0x490001) AM_WRITE(mweeprom_w)
AM_RANGE(0x492000, 0x492001) AM_NOP // watchdog
AM_RANGE(0x494000, 0x494001) AM_READ_PORT("P1_P2")
AM_RANGE(0x494002, 0x494003) AM_READ_PORT("P3_P4")
AM_RANGE(0x496000, 0x496001) AM_READ_PORT("IN0")
AM_RANGE(0x496002, 0x496003) AM_READ(eeprom_r)
- AM_RANGE(0x498000, 0x49801f) AM_DEVICE8("k054321", k054321_device, main_map, 0x00ff)
+ AM_RANGE(0x498000, 0x49801f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0x00ff)
AM_RANGE(0x49a000, 0x49a001) AM_WRITE(sound_irq_w)
- AM_RANGE(0x49c000, 0x49c01f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff)
- AM_RANGE(0x49e000, 0x49e007) AM_WRITE(irq_ack_w) // VSCCS (custom)
- AM_RANGE(0x600000, 0x601fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w)
- AM_RANGE(0x602000, 0x603fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read(essential)
- AM_RANGE(0x680000, 0x683fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
+ AM_RANGE(0x49c000, 0x49c01f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
+ AM_RANGE(0x49e000, 0x49e007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
+ AM_RANGE(0x600000, 0x601fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x680000, 0x683fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
AM_RANGE(0x700000, 0x701fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END
/* Metamorphic Force */
static ADDRESS_MAP_START( metamrph_map, AS_PROGRAM, 16, mystwarr_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // main program
- AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("gx_workram")
- AM_RANGE(0x210000, 0x210fff) AM_DEVREADWRITE("k055673", k055673_device,k053247_word_r,k053247_word_w)
- AM_RANGE(0x211000, 0x21ffff) AM_RAM
- AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
- AM_RANGE(0x244000, 0x24400f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
- AM_RANGE(0x244010, 0x24401f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
- AM_RANGE(0x24c000, 0x24ffff) AM_DEVREADWRITE("k053250_1", k053250_device, ram_r, ram_w)
- AM_RANGE(0x250000, 0x25000f) AM_DEVREADWRITE("k053250_1", k053250_device, reg_r, reg_w)
- AM_RANGE(0x254000, 0x25401f) AM_DEVWRITE("k054338", k054338_device, word_w)
- AM_RANGE(0x258000, 0x2580ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)
- AM_RANGE(0x260000, 0x26001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff)
+ AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("workram")
+ AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0x240000, 0x240007) AM_DEVICE("sprites", k053246_055673_device, objset1)
+ AM_RANGE(0x244000, 0x24400f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r)
+ AM_RANGE(0x244010, 0x24401f) AM_DEVICE("sprites", k053246_055673_device, objset2)
+ AM_RANGE(0x24c000, 0x24ffff) AM_RAM AM_SHARE("lvcram")
+ AM_RANGE(0x250000, 0x25000f) AM_DEVICE8("lvc", k053250_device, map, 0x00ff)
+ AM_RANGE(0x254000, 0x25401f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x258000, 0x2580ff) AM_DEVICE8("mixer", k055555_device, map, 0x00ff)
+ AM_RANGE(0x260000, 0x26001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
AM_RANGE(0x264000, 0x264001) AM_WRITE(sound_irq_w)
- AM_RANGE(0x268000, 0x26801f) AM_DEVICE8("k054321", k054321_device, main_map, 0x00ff)
- AM_RANGE(0x26c000, 0x26c007) AM_DEVWRITE("k056832", k056832_device,b_word_w)
- AM_RANGE(0x270000, 0x27003f) AM_DEVWRITE("k056832", k056832_device,word_w)
+ AM_RANGE(0x268000, 0x26801f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0x00ff)
+ AM_RANGE(0x26c000, 0x26c007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
+ AM_RANGE(0x270000, 0x27003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
AM_RANGE(0x274000, 0x274001) AM_READ_PORT("P1_P3")
AM_RANGE(0x274002, 0x274003) AM_READ_PORT("P2_P4")
AM_RANGE(0x278000, 0x278001) AM_READ_PORT("IN0")
AM_RANGE(0x278002, 0x278003) AM_READ(eeprom_r)
AM_RANGE(0x27c000, 0x27c001) AM_READNOP // watchdog lives here
AM_RANGE(0x27c000, 0x27c001) AM_WRITE(mmeeprom_w)
- AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w)
- AM_RANGE(0x302000, 0x303fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read/write (essential)
- AM_RANGE(0x310000, 0x311fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
- AM_RANGE(0x320000, 0x321fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
+ AM_RANGE(0x300000, 0x301fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x310000, 0x311fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
+ AM_RANGE(0x320000, 0x321fff) AM_DEVREAD("lvc", k053250_device, rom_r)
AM_RANGE(0x330000, 0x331fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END
/* Violent Storm */
static ADDRESS_MAP_START( viostorm_map, AS_PROGRAM, 16, mystwarr_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // main program
- AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("gx_workram")
- AM_RANGE(0x210000, 0x210fff) AM_DEVREADWRITE("k055673", k055673_device, k053247_word_r,k053247_word_w)
+ AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_SHARE("workram")
+ AM_RANGE(0x210000, 0x210fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x211000, 0x21ffff) AM_RAM
- AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
- AM_RANGE(0x244000, 0x24400f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
- AM_RANGE(0x244010, 0x24401f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
+ AM_RANGE(0x240000, 0x240007) AM_DEVICE("sprites", k053246_055673_device, objset1)
+ AM_RANGE(0x244000, 0x24400f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r)
+ AM_RANGE(0x244010, 0x24401f) AM_DEVICE("sprites", k053246_055673_device, objset2)
AM_RANGE(0x24c000, 0x24ffff) AM_RAM // K053250 ram
AM_RANGE(0x250000, 0x25000f) AM_RAM // K053250 reg
- AM_RANGE(0x254000, 0x25401f) AM_DEVWRITE("k054338", k054338_device, word_w)
- AM_RANGE(0x258000, 0x2580ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)
- AM_RANGE(0x25c000, 0x25c03f) AM_READWRITE(K055550_word_r,K055550_word_w)
- AM_RANGE(0x260000, 0x26001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff)
+ AM_RANGE(0x254000, 0x25401f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x258000, 0x2580ff) AM_DEVICE8("mixer", k055555_device, map, 0x00ff)
+ AM_RANGE(0x25c000, 0x25c03f) AM_READWRITE(K055550_word_r, K055550_word_w)
+ AM_RANGE(0x260000, 0x26001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
AM_RANGE(0x264000, 0x264001) AM_WRITE(sound_irq_w)
- AM_RANGE(0x268000, 0x26801f) AM_DEVICE8("k054321", k054321_device, main_map, 0x00ff)
- AM_RANGE(0x26c000, 0x26c007) AM_DEVWRITE("k056832", k056832_device,b_word_w)
- AM_RANGE(0x270000, 0x27003f) AM_DEVWRITE("k056832", k056832_device,word_w)
+ AM_RANGE(0x268000, 0x26801f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0x00ff)
+ AM_RANGE(0x26c000, 0x26c007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
+ AM_RANGE(0x270000, 0x27003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
AM_RANGE(0x274000, 0x274001) AM_READ_PORT("P1_P3")
AM_RANGE(0x274002, 0x274003) AM_READ_PORT("P2_P4")
AM_RANGE(0x278000, 0x278001) AM_READ_PORT("IN0")
AM_RANGE(0x278002, 0x278003) AM_READ(eeprom_r)
AM_RANGE(0x27c000, 0x27c001) AM_READNOP // watchdog lives here
AM_RANGE(0x27c000, 0x27c001) AM_WRITE(mmeeprom_w)
- AM_RANGE(0x300000, 0x301fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w)
- AM_RANGE(0x302000, 0x303fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read(essential)
+ AM_RANGE(0x300000, 0x301fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
AM_RANGE(0x304000, 0x3041ff) AM_RAM
- AM_RANGE(0x310000, 0x311fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
+ AM_RANGE(0x310000, 0x311fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
AM_RANGE(0x330000, 0x331fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END
-// Martial Champion specific interfaces
-READ16_MEMBER(mystwarr_state::k053247_martchmp_word_r)
-{
- if (offset & 0x0018)
- return m_spriteram[offset];
- else
- {
- offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2);
- return m_k055673->k053247_word_r(space,offset,mem_mask);
- }
-}
-
-WRITE16_MEMBER(mystwarr_state::k053247_martchmp_word_w)
-{
- if (offset & 0x0018)
- {
- COMBINE_DATA(m_spriteram+offset);
- }
- else
- {
- offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2);
-
- m_k055673->k053247_word_w(space,offset,data,mem_mask);
- }
-}
-
READ16_MEMBER(mystwarr_state::mccontrol_r)
{
return m_mw_irq_control<<8;
@@ -421,7 +939,7 @@ WRITE16_MEMBER(mystwarr_state::mccontrol_w)
// bit 1 = IRQ enable
// bit 2 = OBJCHA
- m_k055673->k053246_set_objcha_line((data&0x04) ? ASSERT_LINE : CLEAR_LINE);
+ m_sprites->set_objcha(data&0x04);
// if (data & 0xf8) logerror("Unk write %x to mccontrol\n", data);
@@ -434,14 +952,14 @@ WRITE16_MEMBER(mystwarr_state::mccontrol_w)
/* Martial Champion */
static ADDRESS_MAP_START( martchmp_map, AS_PROGRAM, 16, mystwarr_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM // main program
- AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("gx_workram") // work RAM
+ AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("workram") // work RAM
AM_RANGE(0x300000, 0x3fffff) AM_ROM // data ROM
- AM_RANGE(0x400000, 0x4000ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w) // PCU2
- AM_RANGE(0x402000, 0x40200f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r) // sprite ROM readback
- AM_RANGE(0x402010, 0x40201f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w) // OBJSET2
- AM_RANGE(0x404000, 0x404007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w) // OBJSET1
- AM_RANGE(0x40a000, 0x40a01f) AM_DEVWRITE("k054338", k054338_device, word_w) // CLTC
- AM_RANGE(0x40c000, 0x40c03f) AM_DEVWRITE("k056832", k056832_device,word_w) // VACSET
+ AM_RANGE(0x400000, 0x4000ff) AM_DEVICE8("mixer", k055555_device, map, 0xff00)
+ AM_RANGE(0x402000, 0x40200f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r)
+ AM_RANGE(0x402010, 0x40201f) AM_DEVICE("sprites", k053246_055673_device, objset2)
+ AM_RANGE(0x404000, 0x404007) AM_DEVICE("sprites", k053246_055673_device, objset1)
+ AM_RANGE(0x40a000, 0x40a01f) AM_DEVICE("blender", k054338_device, map)
+ AM_RANGE(0x40c000, 0x40c03f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
AM_RANGE(0x40e000, 0x40e03f) AM_WRITE(K053990_martchmp_word_w) // protection
AM_RANGE(0x410000, 0x410001) AM_WRITE(mweeprom_w)
AM_RANGE(0x412000, 0x412001) AM_READWRITE(mccontrol_r,mccontrol_w)
@@ -449,40 +967,38 @@ static ADDRESS_MAP_START( martchmp_map, AS_PROGRAM, 16, mystwarr_state )
AM_RANGE(0x414002, 0x414003) AM_READ_PORT("P3_P4")
AM_RANGE(0x416000, 0x416001) AM_READ_PORT("IN0")
AM_RANGE(0x416002, 0x416003) AM_READ(eeprom_r) // eeprom read
- AM_RANGE(0x418000, 0x41801f) AM_DEVICE8("k054321", k054321_device, main_map, 0x00ff)
+ AM_RANGE(0x418000, 0x41801f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0x00ff)
AM_RANGE(0x41a000, 0x41a001) AM_WRITE(sound_irq_w)
- AM_RANGE(0x41c000, 0x41c01f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) // CCU
- AM_RANGE(0x41e000, 0x41e007) AM_DEVWRITE("k056832", k056832_device,b_word_w) // VSCCS
- AM_RANGE(0x480000, 0x483fff) AM_READWRITE(k053247_martchmp_word_r,k053247_martchmp_word_w) AM_SHARE("spriteram") // sprite RAM
+ AM_RANGE(0x41c000, 0x41c01f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
+ AM_RANGE(0x41e000, 0x41e007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
+ AM_RANGE(0x480000, 0x483fff) AM_RAM AM_SHARE("spriteram") // sprite RAM
AM_RANGE(0x600000, 0x601fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // palette RAM
- AM_RANGE(0x680000, 0x681fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM
- AM_RANGE(0x682000, 0x683fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read/write (essential)
- AM_RANGE(0x700000, 0x703fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r) // tile ROM readback
+ AM_RANGE(0x680000, 0x681fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
+ AM_RANGE(0x700000, 0x703fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
ADDRESS_MAP_END
/* Ultimate Battler Dadandarn */
static ADDRESS_MAP_START( dadandrn_map, AS_PROGRAM, 16, mystwarr_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // main program and data ROM
- AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(k053247_scattered_word_r,k053247_scattered_word_w) AM_SHARE("spriteram")
- AM_RANGE(0x410000, 0x411fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM
- AM_RANGE(0x412000, 0x413fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read/write (essential)
+ AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0x410000, 0x411fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
AM_RANGE(0x420000, 0x421fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x430000, 0x430007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
- AM_RANGE(0x440000, 0x443fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
- AM_RANGE(0x450000, 0x45000f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
- AM_RANGE(0x450010, 0x45001f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
+ AM_RANGE(0x430000, 0x430007) AM_DEVICE("sprites", k053246_055673_device, objset1)
+ AM_RANGE(0x440000, 0x443fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
+ AM_RANGE(0x450000, 0x45000f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r)
+ AM_RANGE(0x450010, 0x45001f) AM_DEVICE("sprites", k053246_055673_device, objset2)
AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_SHARE("k053936_0_ct16")
AM_RANGE(0x470000, 0x470fff) AM_RAM AM_SHARE("k053936_0_li16")
- AM_RANGE(0x480000, 0x48003f) AM_DEVWRITE("k056832", k056832_device,word_w) // VACSET
- AM_RANGE(0x482000, 0x482007) AM_DEVWRITE("k056832", k056832_device,b_word_w) // VSCCS
+ AM_RANGE(0x480000, 0x48003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
+ AM_RANGE(0x482000, 0x482007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
AM_RANGE(0x484000, 0x484003) AM_WRITE(ddd_053936_clip_w)
- AM_RANGE(0x486000, 0x48601f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff)
- AM_RANGE(0x488000, 0x4880ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)
- AM_RANGE(0x48a000, 0x48a01f) AM_DEVICE8("k054321", k054321_device, main_map, 0xff00)
- AM_RANGE(0x48c000, 0x48c01f) AM_DEVWRITE("k054338", k054338_device, word_w)
+ AM_RANGE(0x486000, 0x48601f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
+ AM_RANGE(0x488000, 0x4880ff) AM_DEVICE8("mixer", k055555_device, map, 0x00ff)
+ AM_RANGE(0x48a000, 0x48a01f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0xff00)
+ AM_RANGE(0x48c000, 0x48c01f) AM_DEVICE("blender", k054338_device, map)
AM_RANGE(0x48e000, 0x48e001) AM_READ_PORT("IN0_P1") // bit 3 (0x8) is test switch
AM_RANGE(0x48e020, 0x48e021) AM_READ(dddeeprom_r)
- AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("gx_workram")
+ AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("workram")
AM_RANGE(0x680000, 0x68003f) AM_READWRITE(K055550_word_r,K055550_word_w)
AM_RANGE(0x6a0000, 0x6a0001) AM_WRITE(mmeeprom_w)
AM_RANGE(0x6c0000, 0x6c0001) AM_WRITE(ddd_053936_enable_w)
@@ -499,26 +1015,25 @@ ADDRESS_MAP_END
// c00000 = 936 tiles (7fffff window)
static ADDRESS_MAP_START( gaiapols_map, AS_PROGRAM, 16, mystwarr_state )
AM_RANGE(0x000000, 0x2fffff) AM_ROM // main program
- AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(k053247_scattered_word_r,k053247_scattered_word_w) AM_SHARE("spriteram")
- AM_RANGE(0x410000, 0x411fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM
- AM_RANGE(0x412000, 0x413fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read / write (essential)
+ AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0x410000, 0x411fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_054157_device, vram16_r, vram16_w)
AM_RANGE(0x420000, 0x421fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x430000, 0x430007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
- AM_RANGE(0x440000, 0x441fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
- AM_RANGE(0x450000, 0x45000f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
- AM_RANGE(0x450010, 0x45001f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
+ AM_RANGE(0x430000, 0x430007) AM_DEVICE("sprites", k053246_055673_device, objset1)
+ AM_RANGE(0x440000, 0x441fff) AM_DEVREAD("tilemap", k054156_054157_device, rom16_r)
+ AM_RANGE(0x450000, 0x45000f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r)
+ AM_RANGE(0x450010, 0x45001f) AM_DEVICE("sprites", k053246_055673_device, objset2)
AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_SHARE("k053936_0_ct16")
AM_RANGE(0x470000, 0x470fff) AM_RAM AM_SHARE("k053936_0_li16")
- AM_RANGE(0x480000, 0x48003f) AM_DEVWRITE("k056832", k056832_device,word_w) // VACSET
- AM_RANGE(0x482000, 0x482007) AM_DEVWRITE("k056832", k056832_device,b_word_w) // VSCCS
+ AM_RANGE(0x480000, 0x48003f) AM_DEVICE("tilemap", k054156_054157_device, vacset)
+ AM_RANGE(0x482000, 0x482007) AM_DEVICE("tilemap", k054156_054157_device, vsccs)
AM_RANGE(0x484000, 0x484003) AM_WRITE(ddd_053936_clip_w)
- AM_RANGE(0x486000, 0x48601f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff)
- AM_RANGE(0x488000, 0x4880ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)
- AM_RANGE(0x48a000, 0x48a01f) AM_DEVICE8("k054321", k054321_device, main_map, 0xff00)
- AM_RANGE(0x48c000, 0x48c01f) AM_DEVWRITE("k054338", k054338_device, word_w)
+ AM_RANGE(0x486000, 0x48601f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
+ AM_RANGE(0x488000, 0x4880ff) AM_DEVICE8("mixer", k055555_device, map, 0x00ff)
+ AM_RANGE(0x48a000, 0x48a01f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0xff00)
+ AM_RANGE(0x48c000, 0x48c01f) AM_DEVICE("blender", k054338_device, map)
AM_RANGE(0x48e000, 0x48e001) AM_READ_PORT("IN0_P1") // bit 3 (0x8) is test switch
AM_RANGE(0x48e020, 0x48e021) AM_READ(dddeeprom_r)
- AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("gx_workram")
+ AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("workram")
AM_RANGE(0x660000, 0x6600ff) AM_DEVREADWRITE("k054000", k054000_device, lsb_r, lsb_w)
AM_RANGE(0x6a0000, 0x6a0001) AM_WRITE(mmeeprom_w)
AM_RANGE(0x6c0000, 0x6c0001) AM_WRITE(ddd_053936_enable_w)
@@ -557,7 +1072,7 @@ static ADDRESS_MAP_START( mystwarr_sound_map, AS_PROGRAM, 8, mystwarr_state )
AM_RANGE(0xe230, 0xe3ff) AM_RAM
AM_RANGE(0xe400, 0xe62f) AM_DEVREADWRITE("k054539_2", k054539_device, read, write)
AM_RANGE(0xe630, 0xe7ff) AM_RAM
- AM_RANGE(0xf000, 0xf003) AM_DEVICE("k054321", k054321_device, sound_map)
+ AM_RANGE(0xf000, 0xf003) AM_DEVICE("soundctrl", k054321_device, sound_map)
AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_ctrl_w)
AM_RANGE(0xfff0, 0xfff3) AM_WRITENOP // unknown write
ADDRESS_MAP_END
@@ -826,9 +1341,6 @@ MACHINE_START_MEMBER(mystwarr_state,mystwarr)
m_mw_irq_control = 0;
- /* konamigx_mixer uses this, so better initialize it */
- m_gx_wrport1_0 = 0;
-
save_item(NAME(m_mw_irq_control));
save_item(NAME(m_sound_ctrl));
save_item(NAME(m_sound_nmi_clk));
@@ -903,7 +1415,6 @@ static MACHINE_CONFIG_START( mystwarr )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz (confirmed) */
MCFG_CPU_PROGRAM_MAP(mystwarr_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mystwarr_state, mystwarr_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("soundcpu", Z80, 8000000)
MCFG_CPU_PROGRAM_MAP(mystwarr_sound_map)
@@ -912,49 +1423,48 @@ static MACHINE_CONFIG_START( mystwarr )
MCFG_EEPROM_SERIAL_ER5911_8BIT_ADD("eeprom")
- MCFG_DEVICE_ADD("k053252", K053252, 6000000) // 6 MHz?
- MCFG_K053252_OFFSETS(24, 16)
+ MCFG_DEVICE_ADD("video_timings", K053252, 6000000) // 6 MHz?
+ MCFG_K053252_VSYNC_CB(DEVWRITELINE(":tilemap", k054156_056832_device, vsync_w))
+ MCFG_K053252_VBLANK_CB(DEVWRITELINE(":sprites", k053246_055673_device, vblank_w))
+ MCFG_K053252_KSNOTIFIER_CB(DEVKSNOTIFIER(":tilemap", k054156_056832_device, ksnotifier_w))
+ MCFG_KSNOTIFIER_CHAIN(DEVKSNOTIFIER(":sprites", k053246_055673_device, ksnotifier_w))
+ MCFG_VIDEO_SET_SCREEN("screen")
MCFG_MACHINE_START_OVERRIDE(mystwarr_state,mystwarr)
MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state,mystwarr)
/* video hardware */
+ MCFG_FLOW_RENDER_MANAGER_ADD("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", mystwarr_state, fr_setup)
+
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
-// MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 16, 16+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_mystwarr)
+ MCFG_SCREEN_RAW_PARAMS(6000000, 384, 46, 46+288, 264, 15, 15+224)
+ MCFG_SCREEN_FLOW_RENDER_RGB()
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(XRGB)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
-
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(mystwarr_state, mystwarr_tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_5, 0, 0, "none")
- MCFG_K056832_PALETTE("palette")
- MCFG_K055555_ADD("k055555")
+ MCFG_K054156_054157_5BPP_ADD("tilemap", 6000000, 4, 4, 24)
+ MCFG_K054156_054157_INT1_CB(INPUTLINE("maincpu", 2))
+ MCFG_K054156_054157_INT2_CB(INPUTLINE("maincpu", 4))
- MCFG_DEVICE_ADD("k055673", K055673, 0)
- MCFG_K055673_CB(mystwarr_state, mystwarr_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -48, -24)
- MCFG_K055673_PALETTE("palette")
+ MCFG_K053246_055673_ADD("sprites", 6000000, "spriteram")
+ MCFG_K053246_055673_DISABLE_VRCBK()
+ MCFG_K053246_055673_DMA_REMAP_CB(mystwarr_state, sprites_remap)
+ MCFG_K053246_055673_WIRING_CB(mystwarr_state, sprites_wiring)
+// Activating this irq breaks the attract mode
+// MCFG_K053246_055673_DMAIRQ_CB(INPUTLINE("maincpu", 6))
- MCFG_DEVICE_ADD("k054338", K054338, 0)
- MCFG_K054338_ALPHAINV(1)
- MCFG_K054338_MIXER("k055555")
+ MCFG_K055555_ADD("mixer")
- MCFG_VIDEO_START_OVERRIDE(mystwarr_state, mystwarr)
+ MCFG_K054338_ADD("blender", "palette")
+ MCFG_K054338_SKIPPED_BITS(2)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_K054321_ADD("k054321", ":lspeaker", ":rspeaker")
+ MCFG_K054321_ADD("soundctrl", ":lspeaker", ":rspeaker")
MCFG_DEVICE_ADD("k054539_1", K054539, XTAL_18_432MHz)
MCFG_K054539_REGION_OVERRRIDE("shared")
@@ -969,67 +1479,50 @@ static MACHINE_CONFIG_START( mystwarr )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( viostorm, mystwarr )
-
- MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state,viostorm)
-
- MCFG_DEVICE_REPLACE("k053252", K053252, 16000000/2)
- MCFG_K053252_OFFSETS(40, 16)
+ MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state, viostorm)
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(viostorm_map)
- MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt)
- /* video hardware */
- MCFG_VIDEO_START_OVERRIDE(mystwarr_state, viostorm)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_metamrph)
+ MCFG_DEVICE_REMOVE("tilemap")
+ MCFG_K054156_054157_ADD("tilemap", 6000000, 4, 4, 24)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(900))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1)
+ MCFG_DEVICE_REPLACE("video_timings", K053252, 16000000/2)
+ MCFG_K053252_INT1_CB(INPUTLINE("maincpu", 6))
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
+ MCFG_DEVICE_MODIFY("sprites")
+ MCFG_K053246_055673_DMAIRQ_CB(INPUTLINE("maincpu", 5))
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -62, -23)
+ /* video hardware */
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_RAW_PARAMS(8000000, 512, 57, 57+385, 264, 15, 15+224)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( metamrph, mystwarr )
-
- MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state,metamrph)
+ MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state, metamrph)
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(metamrph_map)
- MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt)
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(24, 15)
+ MCFG_DEVICE_MODIFY("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", mystwarr_state, fr_setup_lvc)
- MCFG_K053250_ADD("k053250_1", "palette", "screen", -7, 0)
+ MCFG_DEVICE_REMOVE("tilemap")
+ MCFG_K054156_054157_ADD("tilemap", 6000000, 4, 4, 24)
- /* video hardware */
- MCFG_VIDEO_START_OVERRIDE(mystwarr_state, metamrph)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_metamrph)
+ MCFG_DEVICE_MODIFY("video_timings")
+ MCFG_K053252_INT1_CB(INPUTLINE("maincpu", 6))
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(900))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 15, 15+224-1)
+ MCFG_DEVICE_MODIFY("sprites")
+ MCFG_K053246_055673_DMAIRQ_CB(INPUTLINE("maincpu", 5))
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
+ MCFG_K053250_ADD("lvc", 6000000, ":lvcram")
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -51, -24)
+ /* video hardware */
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_RAW_PARAMS(6000000, 384, 48, 48+288, 264, 15, 15+224)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr )
@@ -1040,106 +1533,72 @@ static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(dadandrn_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mystwarr_state, ddd_interrupt)
- MCFG_DEVICE_REMOVE("scantimer")
+// MCFG_DEVICE_REMOVE("scantimer")
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(24, 16+1)
+ MCFG_DEVICE_MODIFY("video_timings")
+// MCFG_K053252_OFFSETS(24, 16+1)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", dadandrn)
/* video hardware */
- MCFG_VIDEO_START_OVERRIDE(mystwarr_state, dadandrn)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_dadandrn)
-
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 17, 17+224-1)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback)
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -42, -22)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr )
- MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state,gaiapols)
+ MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state, gaiapols)
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(gaiapols_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mystwarr_state, ddd_interrupt)
- MCFG_DEVICE_REMOVE("scantimer")
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_OFFSETS(40, 16)
+ MCFG_DEVICE_REMOVE("tilemap")
+ MCFG_K054156_054157_ADD("tilemap", 6000000, 4, 4, 24)
- MCFG_K054000_ADD("k054000")
+ MCFG_DEVICE_MODIFY("sprites")
+ MCFG_K053246_055673_WIRING_CB(mystwarr_state, gaiapolis_sprites_wiring)
- MCFG_GFXDECODE_ADD("gfxdecode", "palette", gaiapols)
+ MCFG_K054000_ADD("k054000")
/* video hardware */
- MCFG_VIDEO_START_OVERRIDE(mystwarr_state, gaiapols)
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_dadandrn)
-
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(40, 40+376-1, 16, 16+224-1)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback)
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -61, -22) // stage2 brick walls
+ MCFG_SCREEN_RAW_PARAMS(6000000, 384, 0, 288, 264, 0, 224)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( martchmp, mystwarr )
-
MCFG_MACHINE_RESET_OVERRIDE(mystwarr_state,martchmp)
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(martchmp_map)
- MCFG_TIMER_MODIFY("scantimer")
- MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, mchamp_interrupt)
- MCFG_DEVICE_REPLACE("k053252", K053252, 16000000/2)
- MCFG_K053252_OFFSETS(32, 24-1)
+ MCFG_DEVICE_REPLACE("video_timings", K053252, 16000000/2)
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_FORMAT(XRGB)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
-
- MCFG_VIDEO_START_OVERRIDE(mystwarr_state, martchmp)
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
- MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_martchmp)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1)
-
- MCFG_DEVICE_MODIFY("k056832")
- MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback)
-
- MCFG_DEVICE_MODIFY("k055673")
- MCFG_K055673_CB(mystwarr_state, martchmp_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_GX, -58, -23)
+ MCFG_SCREEN_RAW_PARAMS(8000000, 512, 55, 55+384, 264, 15, 15+224)
MACHINE_CONFIG_END
/**********************************************************************************/
-#define ROM_LOADTILE_WORD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(3) | ROM_REVERSE)
-#define ROM_LOADTILE_BYTE(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(4))
+#define ROM_LOADTILE_WORD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(2) | ROM_REVERSE)
+#define ROM_LOADTILE_BYTE(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(3))
+
+#define TILE_1WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(6) | ROM_REVERSE)
+#define TILE_2WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(2) | ROM_REVERSE)
+#define TILE_1BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(7)) ROM_RELOAD(offset+4, length)
+#define TILE_2BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(3))
+
+#define SPR_1WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(14))
+#define SPR_1BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(15))
+
+#define ROM_LOAD64_BYTE(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPBYTE | ROM_SKIP(7))
ROM_START( mystwarr )
/* main program */
@@ -1155,19 +1614,19 @@ ROM_START( mystwarr )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
- ROM_LOADTILE_WORD( "128a09.1k", 0x000002, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
- ROM_LOADTILE_BYTE( "128a10.3h", 0x000004, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
+ TILE_1WORD_ROM_LOAD( "128a09.1k", 0x000004, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
+ TILE_1BYTE_ROM_LOAD( "128a10.3h", 0x000002, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
- ROM_LOAD64_WORD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
- ROM_LOAD64_WORD( "128a14.19k", 0x000004, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
- ROM_LOAD64_WORD( "128a13.17k", 0x000006, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
- ROM_LOAD16_BYTE( "128a12.12k", 0x400000, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
- ROM_LOAD16_BYTE( "128a11.10k", 0x400001, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
+ SPR_1WORD_ROM_LOAD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
+ SPR_1BYTE_ROM_LOAD( "128a12.12k", 0x000004, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
+ SPR_1WORD_ROM_LOAD( "128a14.19k", 0x000008, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
+ SPR_1WORD_ROM_LOAD( "128a13.17k", 0x00000a, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
+ SPR_1BYTE_ROM_LOAD( "128a11.10k", 0x00000c, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
@@ -1195,19 +1654,19 @@ ROM_START( mystwarru )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
- ROM_LOADTILE_WORD( "128a09.1k", 0x000002, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
- ROM_LOADTILE_BYTE( "128a10.3h", 0x000004, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
+ TILE_1WORD_ROM_LOAD( "128a09.1k", 0x000004, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
+ TILE_1BYTE_ROM_LOAD( "128a10.3h", 0x000002, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
- ROM_LOAD64_WORD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
- ROM_LOAD64_WORD( "128a14.19k", 0x000004, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
- ROM_LOAD64_WORD( "128a13.17k", 0x000006, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
- ROM_LOAD16_BYTE( "128a12.12k", 0x400000, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
- ROM_LOAD16_BYTE( "128a11.10k", 0x400001, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
+ SPR_1WORD_ROM_LOAD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
+ SPR_1BYTE_ROM_LOAD( "128a12.12k", 0x000004, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
+ SPR_1WORD_ROM_LOAD( "128a14.19k", 0x000008, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
+ SPR_1WORD_ROM_LOAD( "128a13.17k", 0x00000a, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
+ SPR_1BYTE_ROM_LOAD( "128a11.10k", 0x00000c, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
@@ -1235,19 +1694,19 @@ ROM_START( mystwarrj )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
- ROM_LOADTILE_WORD( "128a09.1k", 0x000002, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
- ROM_LOADTILE_BYTE( "128a10.3h", 0x000004, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
+ TILE_1WORD_ROM_LOAD( "128a09.1k", 0x000004, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
+ TILE_1BYTE_ROM_LOAD( "128a10.3h", 0x000002, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
- ROM_LOAD64_WORD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
- ROM_LOAD64_WORD( "128a14.19k", 0x000004, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
- ROM_LOAD64_WORD( "128a13.17k", 0x000006, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
- ROM_LOAD16_BYTE( "128a12.12k", 0x400000, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
- ROM_LOAD16_BYTE( "128a11.10k", 0x400001, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
+ SPR_1WORD_ROM_LOAD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
+ SPR_1BYTE_ROM_LOAD( "128a12.12k", 0x000004, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
+ SPR_1WORD_ROM_LOAD( "128a14.19k", 0x000008, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
+ SPR_1WORD_ROM_LOAD( "128a13.17k", 0x00000a, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
+ SPR_1BYTE_ROM_LOAD( "128a11.10k", 0x00000c, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
@@ -1275,19 +1734,19 @@ ROM_START( mystwarra )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
- ROM_LOADTILE_WORD( "128a09.1k", 0x000002, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
- ROM_LOADTILE_BYTE( "128a10.3h", 0x000004, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
+ TILE_1WORD_ROM_LOAD( "128a09.1k", 0x000004, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
+ TILE_1BYTE_ROM_LOAD( "128a10.3h", 0x000002, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
- ROM_LOAD64_WORD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
- ROM_LOAD64_WORD( "128a14.19k", 0x000004, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
- ROM_LOAD64_WORD( "128a13.17k", 0x000006, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
- ROM_LOAD16_BYTE( "128a12.12k", 0x400000, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
- ROM_LOAD16_BYTE( "128a11.10k", 0x400001, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
+ ROM_REGION( 0x800000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
+ SPR_1WORD_ROM_LOAD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
+ SPR_1BYTE_ROM_LOAD( "128a12.12k", 0x000004, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
+ SPR_1WORD_ROM_LOAD( "128a14.19k", 0x000008, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
+ SPR_1WORD_ROM_LOAD( "128a13.17k", 0x00000a, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
+ SPR_1BYTE_ROM_LOAD( "128a11.10k", 0x00000c, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
@@ -1315,22 +1774,19 @@ ROM_START( mystwarraa )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
- ROM_LOADTILE_WORD( "128a09.1k", 0x000002, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
- ROM_LOADTILE_BYTE( "128a10.3h", 0x000004, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
+ TILE_1WORD_ROM_LOAD( "128a09.1k", 0x000004, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
+ TILE_1BYTE_ROM_LOAD( "128a10.3h", 0x000002, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
/* sprites */
- ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
- ROM_LOAD64_WORD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
- ROM_LOAD64_WORD( "128a14.19k", 0x000004, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
- ROM_LOAD64_WORD( "128a13.17k", 0x000006, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
- ROM_LOAD16_BYTE( "128a12.12k", 0x400000, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
- ROM_LOAD16_BYTE( "128a11.10k", 0x400001, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
-
- /* road generator */
- ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
+ ROM_REGION( 0x500000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
+ SPR_1WORD_ROM_LOAD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
+ SPR_1BYTE_ROM_LOAD( "128a12.12k", 0x000004, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
+ SPR_1WORD_ROM_LOAD( "128a14.19k", 0x000008, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
+ SPR_1WORD_ROM_LOAD( "128a13.17k", 0x00000a, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
+ SPR_1BYTE_ROM_LOAD( "128a11.10k", 0x00000c, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1353,16 +1809,16 @@ ROM_START( viostorm )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00)
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "168a09.1h", 0x000000, 2*1024*1024, CRC(1b34a881) SHA1(5de20f7ee7f90d4f6dea349ca5000bfcf74253b1) )
ROM_LOADTILE_WORD( "168a08.1k", 0x000002, 2*1024*1024, CRC(db0ce743) SHA1(dfe24a1e3e72da188a92668928e79afd6c5d22ee) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00)
- ROM_LOAD64_WORD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
- ROM_LOAD64_WORD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
- ROM_LOAD64_WORD( "168a12.20k", 0x000004, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
- ROM_LOAD64_WORD( "168a13.17k", 0x000006, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
+ SPR_1WORD_ROM_LOAD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
+ SPR_1WORD_ROM_LOAD( "168a12.20k", 0x000008, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
+ SPR_1WORD_ROM_LOAD( "168a13.17k", 0x00000a, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00)
@@ -1388,16 +1844,16 @@ ROM_START( viostormeb )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00)
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "168a09.1h", 0x000000, 2*1024*1024, CRC(1b34a881) SHA1(5de20f7ee7f90d4f6dea349ca5000bfcf74253b1) )
ROM_LOADTILE_WORD( "168a08.1k", 0x000002, 2*1024*1024, CRC(db0ce743) SHA1(dfe24a1e3e72da188a92668928e79afd6c5d22ee) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00)
- ROM_LOAD64_WORD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
- ROM_LOAD64_WORD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
- ROM_LOAD64_WORD( "168a12.20k", 0x000004, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
- ROM_LOAD64_WORD( "168a13.17k", 0x000006, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
+ SPR_1WORD_ROM_LOAD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
+ SPR_1WORD_ROM_LOAD( "168a12.20k", 0x000008, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
+ SPR_1WORD_ROM_LOAD( "168a13.17k", 0x00000a, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00)
@@ -1423,16 +1879,16 @@ ROM_START( viostormu )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00)
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "168a09.1h", 0x000000, 2*1024*1024, CRC(1b34a881) SHA1(5de20f7ee7f90d4f6dea349ca5000bfcf74253b1) )
ROM_LOADTILE_WORD( "168a08.1k", 0x000002, 2*1024*1024, CRC(db0ce743) SHA1(dfe24a1e3e72da188a92668928e79afd6c5d22ee) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00)
- ROM_LOAD64_WORD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
- ROM_LOAD64_WORD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
- ROM_LOAD64_WORD( "168a12.20k", 0x000004, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
- ROM_LOAD64_WORD( "168a13.17k", 0x000006, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
+ SPR_1WORD_ROM_LOAD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
+ SPR_1WORD_ROM_LOAD( "168a12.20k", 0x000008, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
+ SPR_1WORD_ROM_LOAD( "168a13.17k", 0x00000a, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00)
@@ -1458,16 +1914,16 @@ ROM_START( viostormub )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00)
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "168a09.1h", 0x000000, 2*1024*1024, CRC(1b34a881) SHA1(5de20f7ee7f90d4f6dea349ca5000bfcf74253b1) )
ROM_LOADTILE_WORD( "168a08.1k", 0x000002, 2*1024*1024, CRC(db0ce743) SHA1(dfe24a1e3e72da188a92668928e79afd6c5d22ee) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00)
- ROM_LOAD64_WORD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
- ROM_LOAD64_WORD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
- ROM_LOAD64_WORD( "168a12.20k", 0x000004, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
- ROM_LOAD64_WORD( "168a13.17k", 0x000006, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
+ SPR_1WORD_ROM_LOAD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
+ SPR_1WORD_ROM_LOAD( "168a12.20k", 0x000008, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
+ SPR_1WORD_ROM_LOAD( "168a13.17k", 0x00000a, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
/* road generator */
ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00)
@@ -1493,19 +1949,16 @@ ROM_START( viostorma )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "168a09.1h", 0x000000, 2*1024*1024, CRC(1b34a881) SHA1(5de20f7ee7f90d4f6dea349ca5000bfcf74253b1) )
ROM_LOADTILE_WORD( "168a08.1k", 0x000002, 2*1024*1024, CRC(db0ce743) SHA1(dfe24a1e3e72da188a92668928e79afd6c5d22ee) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
- ROM_LOAD64_WORD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
- ROM_LOAD64_WORD( "168a12.20k", 0x000004, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
- ROM_LOAD64_WORD( "168a13.17k", 0x000006, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
-
- /* road generator */
- ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
+ SPR_1WORD_ROM_LOAD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
+ SPR_1WORD_ROM_LOAD( "168a12.20k", 0x000008, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
+ SPR_1WORD_ROM_LOAD( "168a13.17k", 0x00000a, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1528,19 +1981,16 @@ ROM_START( viostormab )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "168a09.1h", 0x000000, 2*1024*1024, CRC(1b34a881) SHA1(5de20f7ee7f90d4f6dea349ca5000bfcf74253b1) )
ROM_LOADTILE_WORD( "168a08.1k", 0x000002, 2*1024*1024, CRC(db0ce743) SHA1(dfe24a1e3e72da188a92668928e79afd6c5d22ee) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
- ROM_LOAD64_WORD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
- ROM_LOAD64_WORD( "168a12.20k", 0x000004, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
- ROM_LOAD64_WORD( "168a13.17k", 0x000006, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
-
- /* road generator */
- ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
+ SPR_1WORD_ROM_LOAD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
+ SPR_1WORD_ROM_LOAD( "168a12.20k", 0x000008, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
+ SPR_1WORD_ROM_LOAD( "168a13.17k", 0x00000a, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1564,19 +2014,16 @@ ROM_START( viostormj )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "168a09.1h", 0x000000, 2*1024*1024, CRC(1b34a881) SHA1(5de20f7ee7f90d4f6dea349ca5000bfcf74253b1) )
ROM_LOADTILE_WORD( "168a08.1k", 0x000002, 2*1024*1024, CRC(db0ce743) SHA1(dfe24a1e3e72da188a92668928e79afd6c5d22ee) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
- ROM_LOAD64_WORD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
- ROM_LOAD64_WORD( "168a12.20k", 0x000004, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
- ROM_LOAD64_WORD( "168a13.17k", 0x000006, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
-
- /* road generator */
- ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "168a10.22k", 0x000000, 2*1024*1024, CRC(bd2bbdea) SHA1(54faf2ded16e66d675bbbec4ebd42b4708edfaef) )
+ SPR_1WORD_ROM_LOAD( "168a11.19k", 0x000002, 2*1024*1024, CRC(7a57c9e7) SHA1(8763c310f7b515aef52d4e007bc949e8803690f4) )
+ SPR_1WORD_ROM_LOAD( "168a12.20k", 0x000008, 2*1024*1024, CRC(b6b1c4ef) SHA1(064ab4db884c8f98ab9e631b7034996d4b92ab7b) )
+ SPR_1WORD_ROM_LOAD( "168a13.17k", 0x00000a, 2*1024*1024, CRC(cdec3650) SHA1(949bc06bb38a2d5315ee4f6db19e043655b90e6e) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1600,19 +2047,19 @@ ROM_START( metamrph )
ROM_LOAD("224a05", 0x000000, 0x40000, CRC(4b4c985c) SHA1(c83cce05355023be9cd55b4aa595c61f8236269c) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "224a09", 0x000000, 1*1024*1024, CRC(1931afce) SHA1(78838c0fd2a9c80f130db1fcf6c88b14f7363639) )
ROM_LOADTILE_WORD( "224a08", 0x000002, 1*1024*1024, CRC(dc94d53a) SHA1(91e16371a335f078a81c06a1045759653080aba0) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
- ROM_LOAD64_WORD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
- ROM_LOAD64_WORD( "224a12", 0x000004, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
- ROM_LOAD64_WORD( "224a13", 0x000006, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
+ SPR_1WORD_ROM_LOAD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
+ SPR_1WORD_ROM_LOAD( "224a12", 0x000008, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
+ SPR_1WORD_ROM_LOAD( "224a13", 0x00000a, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
/* K053250 linescroll/zoom thingy */
- ROM_REGION( 0x40000, "k053250_1", 0 )
+ ROM_REGION( 0x40000, "lvc", 0 )
ROM_LOAD( "224a14", 0x000000, 0x40000, CRC(3c79b404) SHA1(7c6bb4cbf050f314ea0cd3e8bc6e1947d0573084) )
/* sound data */
@@ -1637,19 +2084,19 @@ ROM_START( metamrphe ) /* alternate set - possibly a bugfix version. Only 2 adju
ROM_LOAD("224a05", 0x000000, 0x40000, CRC(4b4c985c) SHA1(c83cce05355023be9cd55b4aa595c61f8236269c) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "224a09", 0x000000, 1*1024*1024, CRC(1931afce) SHA1(78838c0fd2a9c80f130db1fcf6c88b14f7363639) )
ROM_LOADTILE_WORD( "224a08", 0x000002, 1*1024*1024, CRC(dc94d53a) SHA1(91e16371a335f078a81c06a1045759653080aba0) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
- ROM_LOAD64_WORD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
- ROM_LOAD64_WORD( "224a12", 0x000004, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
- ROM_LOAD64_WORD( "224a13", 0x000006, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
+ SPR_1WORD_ROM_LOAD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
+ SPR_1WORD_ROM_LOAD( "224a12", 0x000008, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
+ SPR_1WORD_ROM_LOAD( "224a13", 0x00000a, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
/* K053250 linescroll/zoom thingy */
- ROM_REGION( 0x40000, "k053250_1", 0 )
+ ROM_REGION( 0x40000, "lvc", 0 )
ROM_LOAD( "224a14", 0x000000, 0x40000, CRC(3c79b404) SHA1(7c6bb4cbf050f314ea0cd3e8bc6e1947d0573084) )
/* sound data */
@@ -1674,19 +2121,19 @@ ROM_START( metamrpha )
ROM_LOAD("224a05", 0x000000, 0x40000, CRC(4b4c985c) SHA1(c83cce05355023be9cd55b4aa595c61f8236269c) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "224a09", 0x000000, 1*1024*1024, CRC(1931afce) SHA1(78838c0fd2a9c80f130db1fcf6c88b14f7363639) )
ROM_LOADTILE_WORD( "224a08", 0x000002, 1*1024*1024, CRC(dc94d53a) SHA1(91e16371a335f078a81c06a1045759653080aba0) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
- ROM_LOAD64_WORD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
- ROM_LOAD64_WORD( "224a12", 0x000004, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
- ROM_LOAD64_WORD( "224a13", 0x000006, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
+ SPR_1WORD_ROM_LOAD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
+ SPR_1WORD_ROM_LOAD( "224a12", 0x000008, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
+ SPR_1WORD_ROM_LOAD( "224a13", 0x00000a, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
/* K053250 linescroll/zoom thingy */
- ROM_REGION( 0x40000, "k053250_1", 0 )
+ ROM_REGION( 0x40000, "lvc", 0 )
ROM_LOAD( "224a14", 0x000000, 0x40000, CRC(3c79b404) SHA1(7c6bb4cbf050f314ea0cd3e8bc6e1947d0573084) )
/* sound data */
@@ -1711,19 +2158,19 @@ ROM_START( metamrphu )
ROM_LOAD("224a05", 0x000000, 0x40000, CRC(4b4c985c) SHA1(c83cce05355023be9cd55b4aa595c61f8236269c) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "224a09", 0x000000, 1*1024*1024, CRC(1931afce) SHA1(78838c0fd2a9c80f130db1fcf6c88b14f7363639) )
ROM_LOADTILE_WORD( "224a08", 0x000002, 1*1024*1024, CRC(dc94d53a) SHA1(91e16371a335f078a81c06a1045759653080aba0) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
- ROM_LOAD64_WORD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
- ROM_LOAD64_WORD( "224a12", 0x000004, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
- ROM_LOAD64_WORD( "224a13", 0x000006, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
+ SPR_1WORD_ROM_LOAD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
+ SPR_1WORD_ROM_LOAD( "224a12", 0x000008, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
+ SPR_1WORD_ROM_LOAD( "224a13", 0x00000a, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
/* K053250 linescroll/zoom thingy */
- ROM_REGION( 0x40000, "k053250_1", 0 )
+ ROM_REGION( 0x40000, "lvc", 0 )
ROM_LOAD( "224a14", 0x000000, 0x40000, CRC(3c79b404) SHA1(7c6bb4cbf050f314ea0cd3e8bc6e1947d0573084) )
/* sound data */
@@ -1748,19 +2195,19 @@ ROM_START( metamrphj )
ROM_LOAD("224a05", 0x000000, 0x40000, CRC(4b4c985c) SHA1(c83cce05355023be9cd55b4aa595c61f8236269c) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "224a09", 0x000000, 1*1024*1024, CRC(1931afce) SHA1(78838c0fd2a9c80f130db1fcf6c88b14f7363639) )
ROM_LOADTILE_WORD( "224a08", 0x000002, 1*1024*1024, CRC(dc94d53a) SHA1(91e16371a335f078a81c06a1045759653080aba0) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
- ROM_LOAD64_WORD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
- ROM_LOAD64_WORD( "224a12", 0x000004, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
- ROM_LOAD64_WORD( "224a13", 0x000006, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
+ SPR_1WORD_ROM_LOAD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
+ SPR_1WORD_ROM_LOAD( "224a12", 0x000008, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
+ SPR_1WORD_ROM_LOAD( "224a13", 0x00000a, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
/* K053250 linescroll/zoom thingy */
- ROM_REGION( 0x40000, "k053250_1", 0 )
+ ROM_REGION( 0x40000, "lvc", 0 )
ROM_LOAD( "224a14", 0x000000, 0x40000, CRC(3c79b404) SHA1(7c6bb4cbf050f314ea0cd3e8bc6e1947d0573084) )
/* sound data */
@@ -1786,19 +2233,19 @@ ROM_START( mtlchamp )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
- ROM_LOADTILE_WORD( "234a09.1k", 0x000002, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
- ROM_LOADTILE_BYTE( "234a10.3h", 0x000004, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
+ TILE_1WORD_ROM_LOAD( "234a09.1k", 0x000004, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
+ TILE_1BYTE_ROM_LOAD( "234a10.3h", 0x000002, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
- ROM_LOAD64_WORD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
- ROM_LOAD64_WORD( "234a14.19k", 0x000004, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
- ROM_LOAD64_WORD( "234a13.17k", 0x000006, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
- ROM_LOAD16_BYTE( "234a12.12k", 0x800000, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
- ROM_LOAD16_BYTE( "234a11.10k", 0x800001, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
+ SPR_1WORD_ROM_LOAD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
+ SPR_1BYTE_ROM_LOAD( "234a12.12k", 0x000004, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
+ SPR_1WORD_ROM_LOAD( "234a14.19k", 0x000008, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
+ SPR_1WORD_ROM_LOAD( "234a13.17k", 0x00000a, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
+ SPR_1BYTE_ROM_LOAD( "234a11.10k", 0x00000c, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1823,19 +2270,19 @@ ROM_START( mtlchamp1 )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
- ROM_LOADTILE_WORD( "234a09.1k", 0x000002, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
- ROM_LOADTILE_BYTE( "234a10.3h", 0x000004, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
+ TILE_1WORD_ROM_LOAD( "234a09.1k", 0x000004, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
+ TILE_1BYTE_ROM_LOAD( "234a10.3h", 0x000002, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
- ROM_LOAD64_WORD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
- ROM_LOAD64_WORD( "234a14.19k", 0x000004, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
- ROM_LOAD64_WORD( "234a13.17k", 0x000006, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
- ROM_LOAD16_BYTE( "234a12.12k", 0x800000, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
- ROM_LOAD16_BYTE( "234a11.10k", 0x800001, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
+ SPR_1WORD_ROM_LOAD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
+ SPR_1BYTE_ROM_LOAD( "234a12.12k", 0x000004, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
+ SPR_1WORD_ROM_LOAD( "234a14.19k", 0x000008, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
+ SPR_1WORD_ROM_LOAD( "234a13.17k", 0x00000a, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
+ SPR_1BYTE_ROM_LOAD( "234a11.10k", 0x00000c, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1860,19 +2307,19 @@ ROM_START( mtlchampa )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
- ROM_LOADTILE_WORD( "234a09.1k", 0x000002, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
- ROM_LOADTILE_BYTE( "234a10.3h", 0x000004, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
+ TILE_1WORD_ROM_LOAD( "234a09.1k", 0x000004, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
+ TILE_1BYTE_ROM_LOAD( "234a10.3h", 0x000002, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
- ROM_LOAD64_WORD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
- ROM_LOAD64_WORD( "234a14.19k", 0x000004, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
- ROM_LOAD64_WORD( "234a13.17k", 0x000006, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
- ROM_LOAD16_BYTE( "234a12.12k", 0x800000, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
- ROM_LOAD16_BYTE( "234a11.10k", 0x800001, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
+ SPR_1WORD_ROM_LOAD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
+ SPR_1BYTE_ROM_LOAD( "234a12.12k", 0x000004, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
+ SPR_1WORD_ROM_LOAD( "234a14.19k", 0x000008, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
+ SPR_1WORD_ROM_LOAD( "234a13.17k", 0x00000a, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
+ SPR_1BYTE_ROM_LOAD( "234a11.10k", 0x00000c, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1897,19 +2344,19 @@ ROM_START( mtlchampj )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
- ROM_LOADTILE_WORD( "234a09.1k", 0x000002, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
- ROM_LOADTILE_BYTE( "234a10.3h", 0x000004, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
+ TILE_1WORD_ROM_LOAD( "234a09.1k", 0x000004, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
+ TILE_1BYTE_ROM_LOAD( "234a10.3h", 0x000002, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
- ROM_LOAD64_WORD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
- ROM_LOAD64_WORD( "234a14.19k", 0x000004, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
- ROM_LOAD64_WORD( "234a13.17k", 0x000006, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
- ROM_LOAD16_BYTE( "234a12.12k", 0x800000, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
- ROM_LOAD16_BYTE( "234a11.10k", 0x800001, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
+ SPR_1WORD_ROM_LOAD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
+ SPR_1BYTE_ROM_LOAD( "234a12.12k", 0x000004, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
+ SPR_1WORD_ROM_LOAD( "234a14.19k", 0x000008, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
+ SPR_1WORD_ROM_LOAD( "234a13.17k", 0x00000a, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
+ SPR_1BYTE_ROM_LOAD( "234a11.10k", 0x00000c, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1934,19 +2381,19 @@ ROM_START( mtlchampu )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
- ROM_LOADTILE_WORD( "234a09.1k", 0x000002, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
- ROM_LOADTILE_BYTE( "234a10.3h", 0x000004, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
+ TILE_1WORD_ROM_LOAD( "234a09.1k", 0x000004, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
+ TILE_1BYTE_ROM_LOAD( "234a10.3h", 0x000002, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
- ROM_LOAD64_WORD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
- ROM_LOAD64_WORD( "234a14.19k", 0x000004, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
- ROM_LOAD64_WORD( "234a13.17k", 0x000006, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
- ROM_LOAD16_BYTE( "234a12.12k", 0x800000, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
- ROM_LOAD16_BYTE( "234a11.10k", 0x800001, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
+ SPR_1WORD_ROM_LOAD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
+ SPR_1BYTE_ROM_LOAD( "234a12.12k", 0x000004, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
+ SPR_1WORD_ROM_LOAD( "234a14.19k", 0x000008, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
+ SPR_1WORD_ROM_LOAD( "234a13.17k", 0x00000a, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
+ SPR_1BYTE_ROM_LOAD( "234a11.10k", 0x00000c, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -1971,19 +2418,19 @@ ROM_START( mtlchampu1 )
ROM_RELOAD( 0x20000, 0x20000 )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
- ROM_LOADTILE_WORD( "234a09.1k", 0x000002, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
- ROM_LOADTILE_BYTE( "234a10.3h", 0x000004, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "234a08.1h", 0x000000, 1*1024*1024, CRC(27e94288) SHA1(a92b03adf7beea6a1ceb74f659c87c628a7ab8e4) )
+ TILE_1WORD_ROM_LOAD( "234a09.1k", 0x000004, 1*1024*1024, CRC(03aad28f) SHA1(e7d9d788822ac9666e089b58288e3fcdba1b89da) )
+ TILE_1BYTE_ROM_LOAD( "234a10.3h", 0x000002, 512*1024, CRC(51f50fe2) SHA1(164fc975feff442d93f1917727c159051dcd3a55) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
- ROM_LOAD64_WORD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
- ROM_LOAD64_WORD( "234a14.19k", 0x000004, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
- ROM_LOAD64_WORD( "234a13.17k", 0x000006, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
- ROM_LOAD16_BYTE( "234a12.12k", 0x800000, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
- ROM_LOAD16_BYTE( "234a11.10k", 0x800001, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "234a16.22k", 0x000000, 2*1024*1024, CRC(14d909a5) SHA1(15da356852fc0c63ecd924ac37ebe24bf3ba0760) )
+ SPR_1WORD_ROM_LOAD( "234a15.20k", 0x000002, 2*1024*1024, CRC(a5028418) SHA1(ec6fc7b38fb1d27490a5a9310ecac2d1049e197c) )
+ SPR_1BYTE_ROM_LOAD( "234a12.12k", 0x000004, 1024*1024, CRC(c7f2b099) SHA1(b72b80feb52560a5a42a1db39b059ac8bca27c10) )
+ SPR_1WORD_ROM_LOAD( "234a14.19k", 0x000008, 2*1024*1024, CRC(d7921f47) SHA1(3fc97b308ad2ca25a376373ddfe08c8a375c424e) )
+ SPR_1WORD_ROM_LOAD( "234a13.17k", 0x00000a, 2*1024*1024, CRC(5974392e) SHA1(7c380419244439804797a9510846d273ebe99d02) )
+ SPR_1BYTE_ROM_LOAD( "234a11.10k", 0x00000c, 1024*1024, CRC(82923713) SHA1(a36cd3b2c9d36e93a3c25ba1d4e162f3d92e06ae) )
/* sound data */
ROM_REGION( 0x400000, "shared", 0 )
@@ -2009,25 +2456,25 @@ ROM_START( gaiapols )
ROM_LOAD("123e13.9c", 0x00000, 0x40000, CRC(e772f822) SHA1(2a5cdfc0aacad56cbef8bdbe8319e7ff4ab71eee) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "123e16.2t", 0x000000, 1*1024*1024, CRC(a3238200) SHA1(9ea073f7611b5c0b328c707c97ef174634c303bc) )
ROM_LOADTILE_WORD( "123e17.2x", 0x000002, 1*1024*1024, CRC(bd0b9fb9) SHA1(1714c19d2123b8fd4cfedb66d13bdcee6fc77576) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "123e19.34u", 0x000000, 2*1024*1024, CRC(219a7c26) SHA1(0f24873523f91379862e0d4317fc42b8a10d412e) )
- ROM_LOAD64_WORD( "123e21.34y", 0x000002, 2*1024*1024, CRC(1888947b) SHA1(41a046cbcd2406add2ff48cb82a1353d9ac5fa3c) )
- ROM_LOAD64_WORD( "123e18.36u", 0x000004, 2*1024*1024, CRC(3719b6d4) SHA1(25ef6e8c3c7f151f1cee063356bdd56c713356ea) )
- ROM_LOAD64_WORD( "123e20.36y", 0x000006, 2*1024*1024, CRC(490a6f64) SHA1(81b1acc74ce834399005a748eae50b3d633fa469) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "123e19.34u", 0x000000, 2*1024*1024, CRC(219a7c26) SHA1(0f24873523f91379862e0d4317fc42b8a10d412e) )
+ SPR_1WORD_ROM_LOAD( "123e21.34y", 0x000002, 2*1024*1024, CRC(1888947b) SHA1(41a046cbcd2406add2ff48cb82a1353d9ac5fa3c) )
+ SPR_1WORD_ROM_LOAD( "123e18.36u", 0x000008, 2*1024*1024, CRC(3719b6d4) SHA1(25ef6e8c3c7f151f1cee063356bdd56c713356ea) )
+ SPR_1WORD_ROM_LOAD( "123e20.36y", 0x00000a, 2*1024*1024, CRC(490a6f64) SHA1(81b1acc74ce834399005a748eae50b3d633fa469) )
/* K053536 roz tiles */
- ROM_REGION( 0x180000, "gfx3", 0 )
+ ROM_REGION( 0x180000, "roz_tiles", 0 )
ROM_LOAD( "123e04.32n", 0x000000, 0x080000, CRC(0d4d5b8b) SHA1(d3fb0c77ad46ee9b9c704be6f174258aa051aa71) )
ROM_LOAD( "123e05.29n", 0x080000, 0x080000, CRC(7d123f3e) SHA1(f9752e96515dc965aae04e01dfa813fcc4cbccd6) )
ROM_LOAD( "123e06.26n", 0x100000, 0x080000, CRC(fa50121e) SHA1(4596a9b0a6cc67f259182098d3976234b6ed8cb6) )
/* K053936 map data */
- ROM_REGION( 0xa0000, "gfx4", 0 )
+ ROM_REGION( 0xa0000, "roz_map", 0 )
ROM_LOAD( "123e01.36j", 0x000000, 0x20000, CRC(9dbc9678) SHA1(4183eb833d0d1cd710fac32071df7ebcb7a9c812) )
ROM_LOAD( "123e02.34j", 0x020000, 0x40000, CRC(b8e3f500) SHA1(254c665b7aa534990e899fe8f54c3f24e8126fba) )
ROM_LOAD( "123e03.36m", 0x060000, 0x40000, CRC(fde4749f) SHA1(7f9c09d11dcb16d72046c7605570c3a29e279fa9) )
@@ -2056,25 +2503,25 @@ ROM_START( gaiapolsu )
ROM_LOAD("123e13.9c", 0x00000, 0x40000, CRC(e772f822) SHA1(2a5cdfc0aacad56cbef8bdbe8319e7ff4ab71eee) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "123e16.2t", 0x000000, 1*1024*1024, CRC(a3238200) SHA1(9ea073f7611b5c0b328c707c97ef174634c303bc) )
ROM_LOADTILE_WORD( "123e17.2x", 0x000002, 1*1024*1024, CRC(bd0b9fb9) SHA1(1714c19d2123b8fd4cfedb66d13bdcee6fc77576) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "123e19.34u", 0x000000, 2*1024*1024, CRC(219a7c26) SHA1(0f24873523f91379862e0d4317fc42b8a10d412e) )
- ROM_LOAD64_WORD( "123e21.34y", 0x000002, 2*1024*1024, CRC(1888947b) SHA1(41a046cbcd2406add2ff48cb82a1353d9ac5fa3c) )
- ROM_LOAD64_WORD( "123e18.36u", 0x000004, 2*1024*1024, CRC(3719b6d4) SHA1(25ef6e8c3c7f151f1cee063356bdd56c713356ea) )
- ROM_LOAD64_WORD( "123e20.36y", 0x000006, 2*1024*1024, CRC(490a6f64) SHA1(81b1acc74ce834399005a748eae50b3d633fa469) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "123e19.34u", 0x000000, 2*1024*1024, CRC(219a7c26) SHA1(0f24873523f91379862e0d4317fc42b8a10d412e) )
+ SPR_1WORD_ROM_LOAD( "123e21.34y", 0x000002, 2*1024*1024, CRC(1888947b) SHA1(41a046cbcd2406add2ff48cb82a1353d9ac5fa3c) )
+ SPR_1WORD_ROM_LOAD( "123e18.36u", 0x000008, 2*1024*1024, CRC(3719b6d4) SHA1(25ef6e8c3c7f151f1cee063356bdd56c713356ea) )
+ SPR_1WORD_ROM_LOAD( "123e20.36y", 0x00000a, 2*1024*1024, CRC(490a6f64) SHA1(81b1acc74ce834399005a748eae50b3d633fa469) )
/* K053536 roz tiles */
- ROM_REGION( 0x180000, "gfx3", 0 )
+ ROM_REGION( 0x180000, "roz_tiles", 0 )
ROM_LOAD( "123e04.32n", 0x000000, 0x080000, CRC(0d4d5b8b) SHA1(d3fb0c77ad46ee9b9c704be6f174258aa051aa71) )
ROM_LOAD( "123e05.29n", 0x080000, 0x080000, CRC(7d123f3e) SHA1(f9752e96515dc965aae04e01dfa813fcc4cbccd6) )
ROM_LOAD( "123e06.26n", 0x100000, 0x080000, CRC(fa50121e) SHA1(4596a9b0a6cc67f259182098d3976234b6ed8cb6) )
/* K053936 map data */
- ROM_REGION( 0xa0000, "gfx4", 0 )
+ ROM_REGION( 0xa0000, "roz_map", 0 )
ROM_LOAD( "123e01.36j", 0x000000, 0x20000, CRC(9dbc9678) SHA1(4183eb833d0d1cd710fac32071df7ebcb7a9c812) )
ROM_LOAD( "123e02.34j", 0x020000, 0x40000, CRC(b8e3f500) SHA1(254c665b7aa534990e899fe8f54c3f24e8126fba) )
ROM_LOAD( "123e03.36m", 0x060000, 0x40000, CRC(fde4749f) SHA1(7f9c09d11dcb16d72046c7605570c3a29e279fa9) )
@@ -2103,25 +2550,25 @@ ROM_START( gaiapolsj )
ROM_LOAD("123e13.9c", 0x00000, 0x40000, CRC(e772f822) SHA1(2a5cdfc0aacad56cbef8bdbe8319e7ff4ab71eee) )
/* tiles */
- ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_REGION( 0x200000, "tilemap", ROMREGION_ERASE00 )
ROM_LOADTILE_WORD( "123e16.2t", 0x000000, 1*1024*1024, CRC(a3238200) SHA1(9ea073f7611b5c0b328c707c97ef174634c303bc) )
ROM_LOADTILE_WORD( "123e17.2x", 0x000002, 1*1024*1024, CRC(bd0b9fb9) SHA1(1714c19d2123b8fd4cfedb66d13bdcee6fc77576) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "123e19.34u", 0x000000, 2*1024*1024, CRC(219a7c26) SHA1(0f24873523f91379862e0d4317fc42b8a10d412e) )
- ROM_LOAD64_WORD( "123e21.34y", 0x000002, 2*1024*1024, CRC(1888947b) SHA1(41a046cbcd2406add2ff48cb82a1353d9ac5fa3c) )
- ROM_LOAD64_WORD( "123e18.36u", 0x000004, 2*1024*1024, CRC(3719b6d4) SHA1(25ef6e8c3c7f151f1cee063356bdd56c713356ea) )
- ROM_LOAD64_WORD( "123e20.36y", 0x000006, 2*1024*1024, CRC(490a6f64) SHA1(81b1acc74ce834399005a748eae50b3d633fa469) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "123e19.34u", 0x000000, 2*1024*1024, CRC(219a7c26) SHA1(0f24873523f91379862e0d4317fc42b8a10d412e) )
+ SPR_1WORD_ROM_LOAD( "123e21.34y", 0x000002, 2*1024*1024, CRC(1888947b) SHA1(41a046cbcd2406add2ff48cb82a1353d9ac5fa3c) )
+ SPR_1WORD_ROM_LOAD( "123e18.36u", 0x000008, 2*1024*1024, CRC(3719b6d4) SHA1(25ef6e8c3c7f151f1cee063356bdd56c713356ea) )
+ SPR_1WORD_ROM_LOAD( "123e20.36y", 0x00000a, 2*1024*1024, CRC(490a6f64) SHA1(81b1acc74ce834399005a748eae50b3d633fa469) )
/* K053536 roz tiles */
- ROM_REGION( 0x180000, "gfx3", 0 )
+ ROM_REGION( 0x180000, "roz_tiles", 0 )
ROM_LOAD( "123e04.32n", 0x000000, 0x080000, CRC(0d4d5b8b) SHA1(d3fb0c77ad46ee9b9c704be6f174258aa051aa71) )
ROM_LOAD( "123e05.29n", 0x080000, 0x080000, CRC(7d123f3e) SHA1(f9752e96515dc965aae04e01dfa813fcc4cbccd6) )
ROM_LOAD( "123e06.26n", 0x100000, 0x080000, CRC(fa50121e) SHA1(4596a9b0a6cc67f259182098d3976234b6ed8cb6) )
/* K053936 map data */
- ROM_REGION( 0xa0000, "gfx4", 0 )
+ ROM_REGION( 0xa0000, "roz_map", 0 )
ROM_LOAD( "123e01.36j", 0x000000, 0x20000, CRC(9dbc9678) SHA1(4183eb833d0d1cd710fac32071df7ebcb7a9c812) )
ROM_LOAD( "123e02.34j", 0x020000, 0x40000, CRC(b8e3f500) SHA1(254c665b7aa534990e899fe8f54c3f24e8126fba) )
ROM_LOAD( "123e03.36m", 0x060000, 0x40000, CRC(fde4749f) SHA1(7f9c09d11dcb16d72046c7605570c3a29e279fa9) )
@@ -2148,28 +2595,28 @@ ROM_START( mmaulers )
ROM_LOAD("170a13.9c", 0x00000, 0x40000, CRC(2ebf4d1c) SHA1(33a3f4153dfdc46cc223d216a17ef9428c09129d) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "170a16.2t", 0x000000, 1*1024*1024, CRC(41fee912) SHA1(73cf167ac9fc42cb8048a87b6c6d1c3c0ae3c2e2) )
- ROM_LOADTILE_WORD( "170a17.2x", 0x000002, 1*1024*1024, CRC(96957c91) SHA1(b12d356f8a015ec0984bdb86da9c569eb0c67880) )
- ROM_LOADTILE_BYTE( "170a24.5r", 0x000004, 512*1024, CRC(562ad4bd) SHA1(f55b29142ea39f090244f0945a56760bab25c7a7) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "170a16.2t", 0x000000, 1*1024*1024, CRC(41fee912) SHA1(73cf167ac9fc42cb8048a87b6c6d1c3c0ae3c2e2) )
+ TILE_1WORD_ROM_LOAD( "170a17.2x", 0x000004, 1*1024*1024, CRC(96957c91) SHA1(b12d356f8a015ec0984bdb86da9c569eb0c67880) )
+ TILE_1BYTE_ROM_LOAD( "170a24.5r", 0x000002, 512*1024, CRC(562ad4bd) SHA1(f55b29142ea39f090244f0945a56760bab25c7a7) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "170a19.34u", 0x000000, 2*1024*1024, CRC(be835141) SHA1(b76e1da45bf602dd9eb30fb8b7181cea2e820c3d) )
- ROM_LOAD64_WORD( "170a21.34y", 0x000002, 2*1024*1024, CRC(bcb68136) SHA1(1d453f59d832b8ea99cf0a60a917edce5c1c90a0) )
- ROM_LOAD64_WORD( "170a18.36u", 0x000004, 2*1024*1024, CRC(e1e3c8d2) SHA1(2c94fcedd1dcef3d3332af358ae8a67dea507216) )
- ROM_LOAD64_WORD( "170a20.36y", 0x000006, 2*1024*1024, CRC(ccb4d88c) SHA1(064b4dab0ca6e5a1fa2fc2e9bbb19c7499830ee1) )
- ROM_LOAD16_BYTE( "170a23.29y", 0x800000, 1024*1024, CRC(6b5390e4) SHA1(0c5066bc86e782db4b64c2a604aed89ae99af005) )
- ROM_LOAD16_BYTE( "170a22.32y", 0x800001, 1024*1024, CRC(21628106) SHA1(1e025ff53caa5cbbf7695f8a77736d59f8a8af1b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "170a19.34u", 0x000000, 2*1024*1024, CRC(be835141) SHA1(b76e1da45bf602dd9eb30fb8b7181cea2e820c3d) )
+ SPR_1WORD_ROM_LOAD( "170a21.34y", 0x000002, 2*1024*1024, CRC(bcb68136) SHA1(1d453f59d832b8ea99cf0a60a917edce5c1c90a0) )
+ SPR_1BYTE_ROM_LOAD( "170a23.29y", 0x000004, 1024*1024, CRC(6b5390e4) SHA1(0c5066bc86e782db4b64c2a604aed89ae99af005) )
+ SPR_1WORD_ROM_LOAD( "170a18.36u", 0x000008, 2*1024*1024, CRC(e1e3c8d2) SHA1(2c94fcedd1dcef3d3332af358ae8a67dea507216) )
+ SPR_1WORD_ROM_LOAD( "170a20.36y", 0x00000a, 2*1024*1024, CRC(ccb4d88c) SHA1(064b4dab0ca6e5a1fa2fc2e9bbb19c7499830ee1) )
+ SPR_1BYTE_ROM_LOAD( "170a22.32y", 0x00000c, 1024*1024, CRC(21628106) SHA1(1e025ff53caa5cbbf7695f8a77736d59f8a8af1b) )
/* K053536 roz plane */
- ROM_REGION( 0x180000, "gfx3", 0 )
+ ROM_REGION( 0x180000, "roz_tiles", 0 )
ROM_LOAD( "170a04.33n", 0x000000, 0x80000, CRC(64b9a73b) SHA1(8b984bfd8bdf6d93ad223fca46a4f958a0edb2be) )
ROM_LOAD( "170a05.30n", 0x080000, 0x80000, CRC(f2c101d0) SHA1(d80045c9a02db08ea6c851bdc12826862e11c381) )
ROM_LOAD( "170a06.27n", 0x100000, 0x80000, CRC(b032e59b) SHA1(482300c683db20c2b2fc6e007b8f7e35373e3c00) )
/* K053936 tilemap data */
- ROM_REGION( 0x80000, "gfx4", 0 )
+ ROM_REGION( 0x80000, "roz_map", 0 )
ROM_LOAD( "170a02.34j", 0x000000, 0x40000, CRC(b040cebf) SHA1(4d1ba4ee60fd7caf678837ec6f4d68fcbce1ccf2) )
ROM_LOAD( "170a03.36m", 0x040000, 0x40000, CRC(7fb412b2) SHA1(f603a8f0becf88e345f4b7a68cf018962a255a1e) )
@@ -2195,28 +2642,28 @@ ROM_START( dadandrn )
ROM_LOAD("170a13.9c", 0x00000, 0x40000, CRC(2ebf4d1c) SHA1(33a3f4153dfdc46cc223d216a17ef9428c09129d) )
/* tiles */
- ROM_REGION( 0x600000, "gfx1", ROMREGION_ERASE00 )
- ROM_LOADTILE_WORD( "170a16.2t", 0x000000, 1*1024*1024, CRC(41fee912) SHA1(73cf167ac9fc42cb8048a87b6c6d1c3c0ae3c2e2) )
- ROM_LOADTILE_WORD( "170a17.2x", 0x000002, 1*1024*1024, CRC(96957c91) SHA1(b12d356f8a015ec0984bdb86da9c569eb0c67880) )
- ROM_LOADTILE_BYTE( "170a24.5r", 0x000004, 512*1024, CRC(562ad4bd) SHA1(f55b29142ea39f090244f0945a56760bab25c7a7) )
+ ROM_REGION( 0x400000, "tilemap", ROMREGION_ERASE00 )
+ TILE_1WORD_ROM_LOAD( "170a16.2t", 0x000000, 1*1024*1024, CRC(41fee912) SHA1(73cf167ac9fc42cb8048a87b6c6d1c3c0ae3c2e2) )
+ TILE_1WORD_ROM_LOAD( "170a17.2x", 0x000004, 1*1024*1024, CRC(96957c91) SHA1(b12d356f8a015ec0984bdb86da9c569eb0c67880) )
+ TILE_1BYTE_ROM_LOAD( "170a24.5r", 0x000002, 512*1024, CRC(562ad4bd) SHA1(f55b29142ea39f090244f0945a56760bab25c7a7) )
/* sprites */
- ROM_REGION( 0xa00000, "gfx2", ROMREGION_ERASE00 )
- ROM_LOAD64_WORD( "170a19.34u", 0x000000, 2*1024*1024, CRC(be835141) SHA1(b76e1da45bf602dd9eb30fb8b7181cea2e820c3d) )
- ROM_LOAD64_WORD( "170a21.34y", 0x000002, 2*1024*1024, CRC(bcb68136) SHA1(1d453f59d832b8ea99cf0a60a917edce5c1c90a0) )
- ROM_LOAD64_WORD( "170a18.36u", 0x000004, 2*1024*1024, CRC(e1e3c8d2) SHA1(2c94fcedd1dcef3d3332af358ae8a67dea507216) )
- ROM_LOAD64_WORD( "170a20.36y", 0x000006, 2*1024*1024, CRC(ccb4d88c) SHA1(064b4dab0ca6e5a1fa2fc2e9bbb19c7499830ee1) )
- ROM_LOAD16_BYTE( "170a23.29y", 0x800000, 1024*1024, CRC(6b5390e4) SHA1(0c5066bc86e782db4b64c2a604aed89ae99af005) )
- ROM_LOAD16_BYTE( "170a22.32y", 0x800001, 1024*1024, CRC(21628106) SHA1(1e025ff53caa5cbbf7695f8a77736d59f8a8af1b) )
+ ROM_REGION( 0x1000000, "sprites", ROMREGION_ERASE00 )
+ SPR_1WORD_ROM_LOAD( "170a19.34u", 0x000000, 2*1024*1024, CRC(be835141) SHA1(b76e1da45bf602dd9eb30fb8b7181cea2e820c3d) )
+ SPR_1WORD_ROM_LOAD( "170a21.34y", 0x000002, 2*1024*1024, CRC(bcb68136) SHA1(1d453f59d832b8ea99cf0a60a917edce5c1c90a0) )
+ SPR_1BYTE_ROM_LOAD( "170a23.29y", 0x000004, 1024*1024, CRC(6b5390e4) SHA1(0c5066bc86e782db4b64c2a604aed89ae99af005) )
+ SPR_1WORD_ROM_LOAD( "170a18.36u", 0x000008, 2*1024*1024, CRC(e1e3c8d2) SHA1(2c94fcedd1dcef3d3332af358ae8a67dea507216) )
+ SPR_1WORD_ROM_LOAD( "170a20.36y", 0x00000a, 2*1024*1024, CRC(ccb4d88c) SHA1(064b4dab0ca6e5a1fa2fc2e9bbb19c7499830ee1) )
+ SPR_1BYTE_ROM_LOAD( "170a22.32y", 0x00000c, 1024*1024, CRC(21628106) SHA1(1e025ff53caa5cbbf7695f8a77736d59f8a8af1b) )
/* K053536 roz plane */
- ROM_REGION( 0x180000, "gfx3", 0 )
+ ROM_REGION( 0x180000, "roz_tiles", 0 )
ROM_LOAD( "170a04.33n", 0x000000, 0x80000, CRC(64b9a73b) SHA1(8b984bfd8bdf6d93ad223fca46a4f958a0edb2be) )
ROM_LOAD( "170a05.30n", 0x080000, 0x80000, CRC(f2c101d0) SHA1(d80045c9a02db08ea6c851bdc12826862e11c381) )
ROM_LOAD( "170a06.27n", 0x100000, 0x80000, CRC(b032e59b) SHA1(482300c683db20c2b2fc6e007b8f7e35373e3c00) )
/* K053936 tilemap data */
- ROM_REGION( 0x80000, "gfx4", 0 )
+ ROM_REGION( 0x80000, "roz_map", 0 )
ROM_LOAD( "170a02.34j", 0x000000, 0x40000, CRC(b040cebf) SHA1(4d1ba4ee60fd7caf678837ec6f4d68fcbce1ccf2) )
ROM_LOAD( "170a03.36m", 0x040000, 0x40000, CRC(7fb412b2) SHA1(f603a8f0becf88e345f4b7a68cf018962a255a1e) )
diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp
index 29d8c152187..6cb65694b0a 100644
--- a/src/mame/drivers/overdriv.cpp
+++ b/src/mame/drivers/overdriv.cpp
@@ -6,44 +6,92 @@
driver by Nicola Salmoria
- Notes:
- - irq source for main CPU aren't understood, needs HW tests.
- - Missing road (two unemulated K053250)
- - Visible area and relative placement of sprites and tiles is most likely wrong.
- - Test mode doesn't work well with 3 IRQ5 per frame, the ROM check doesn't work
- and the coin A setting isn't shown. It's OK with 1 IRQ5 per frame.
- - The "Continue?" sprites are not visible until you press start
- - priorities
-
-
- The issues below are both IRQ timing, and relate to when the sprites get
- copied across by the DMA
- - Some flickering sprites, this might be an interrupt/timing issue
- - The screen is cluttered with sprites which aren't supposed to be visible,
- increasing the coordinate mask in k053247_sprites_draw() from 0x3ff to 0xfff
- fixes this but breaks other games (e.g. Vendetta).
-
+ IRQ notes:
+ - both 68000 use irq levels 4, 5 and 6
+ - both have a circuit that triggers the interrupt on a edge, and
+ release it automatically when the interrupt is taken on the cpu.
+ E.g., it's a real, hardware implementation of HOLD with priority
+ management.
+ - primary 68000 irqs are:
+ - level 6 : secondary 68000
+ - level 5 : vblank
+ - level 4 : fcnt from 53252
+ - secondary 68000 irqs are:
+ - level 6 : primary 68000 irq #1
+ - level 5 : primary 68000 irq #2
+ - level 4 : vsync
***************************************************************************/
#include "emu.h"
-#include "includes/overdriv.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6809/m6809.h"
#include "machine/eepromser.h"
+#include "machine/k053252.h"
+#include "screen.h"
#include "sound/k053260.h"
#include "sound/ym2151.h"
-#include "video/k053250.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/k053246_k053247_k055673.h"
+#include "video/k053250.h"
+#include "video/k053251.h"
+#include "video/konami_helper.h"
+#include "video/kvideodac.h"
#include "overdriv.lh"
-/***************************************************************************
-
- EEPROM
-
-***************************************************************************/
+class overdriv_state : public driver_device
+{
+public:
+ overdriv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_subcpu(*this, "sub"),
+ m_audiocpu(*this, "audiocpu"),
+ m_roz_1(*this, "roz_1"),
+ m_roz_2(*this, "roz_2"),
+ m_sprites(*this, "sprites"),
+ m_lvc_1(*this, "lvc_1"),
+ m_lvc_2(*this, "lvc_2"),
+ m_mixer(*this, "mixer"),
+ m_video_timings(*this, "video_timings"),
+ m_videodac(*this, "videodac"),
+ m_screen(*this, "screen")
+ { }
+
+ /* misc */
+ uint16_t m_cpuB_ctrl;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k051316_device> m_roz_1;
+ required_device<k051316_device> m_roz_2;
+ required_device<k053246_053247_device> m_sprites;
+ required_device<k053250_device> m_lvc_1;
+ required_device<k053250_device> m_lvc_2;
+ required_device<k053251_device> m_mixer;
+ required_device<k053252_device> m_video_timings;
+ required_device<kvideodac_device> m_videodac;
+ required_device<screen_device> m_screen;
+ DECLARE_WRITE16_MEMBER(eeprom_w);
+ DECLARE_WRITE16_MEMBER(cpuA_ctrl_w);
+ DECLARE_READ16_MEMBER(cpuB_ctrl_r);
+ DECLARE_WRITE16_MEMBER(cpuB_ctrl_w);
+ DECLARE_WRITE16_MEMBER(overdriv_soundirq_w);
+ DECLARE_WRITE8_MEMBER(sound_ack_w);
+ DECLARE_WRITE16_MEMBER(hostint_1_w);
+ DECLARE_WRITE16_MEMBER(hostint_2_w);
+ DECLARE_WRITE16_MEMBER(crtint_w);
+
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ void sprites_wiring(u32 output, u16 &color, u16 &attr);
+ void fr_setup(flow_render::manager *manager);
+};
static const uint16_t overdriv_default_eeprom[64] =
{
@@ -70,34 +118,35 @@ WRITE16_MEMBER(overdriv_state::eeprom_w)
}
}
-TIMER_DEVICE_CALLBACK_MEMBER(overdriv_state::overdriv_cpuA_scanline)
+void overdriv_state::sprites_wiring(u32 output, u16 &color, u16 &attr)
{
- const int timer_threshold = 168; // fwiw matches 0 on mask ROM check, so IF it's a timer irq then should be close ...
- int scanline = param;
-
- m_fake_timer ++;
-
- // TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?)
- // this is a temporary solution to get rid of deprecat lib and the crashes, but also makes the game timer to be too slow.
- // Update: gameplay is actually too fast compared to timer, first attract mode shouldn't even surpass first blue car on right.
- if(scanline == 256) // vblank-out irq
- {
- // m_screen->frame_number() & 1
- m_maincpu->set_input_line(4, HOLD_LINE);
- }
- else if(m_fake_timer >= timer_threshold) // timer irq
- {
- m_fake_timer -= timer_threshold;
- m_maincpu->set_input_line(5, HOLD_LINE);
- }
+ color = output & 0x1ff;
+ attr = ((output & 0x8000) >> 7) | ((output & 0x7e00) >> 9);
}
-#ifdef UNUSED_FUNCTION
-INTERRUPT_GEN_MEMBER(overdriv_state::cpuB_interrupt)
+void overdriv_state::fr_setup(flow_render::manager *manager)
{
- // this doesn't get turned on until the irq has happened? wrong irq?
+ auto rv = m_videodac->flow_render_get_renderer();
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rs = m_sprites ->flow_render_get_renderer();
+ auto rl1 = m_lvc_1 ->flow_render_get_renderer();
+ auto rl2 = m_lvc_2 ->flow_render_get_renderer();
+
+ manager->connect(rs ->out("color"), rm->inp("0 color"));
+ manager->connect(rs ->out("attr"), rm->inp("0 attr"));
+ manager->connect(rl1->out("color"), rm->inp("1 color"));
+ manager->connect(rl1->out("attr"), rm->inp("1 attr"));
+ manager->connect(rl2->out("color"), rm->inp("2 color"));
+ manager->connect(rl2->out("attr"), rm->inp("2 attr"));
+
+ manager->connect(m_roz_2->flow_render_get_renderer()->out(), rm->inp("3 color"));
+ manager->connect(m_roz_1->flow_render_get_renderer()->out(), rm->inp("4 color"));
+
+ manager->connect(rm->out("color"), rv->inp("color"));
+ manager->connect(rm->out("attr"), rv->inp("attr"));
+
+ manager->connect(rv->out(), m_screen->flow_render_get_renderer()->inp());
}
-#endif
WRITE16_MEMBER(overdriv_state::cpuA_ctrl_w)
{
@@ -128,7 +177,7 @@ WRITE16_MEMBER(overdriv_state::cpuB_ctrl_w)
if (ACCESSING_BITS_0_7)
{
/* bit 0 = enable sprite ROM reading */
- m_k053246->k053246_set_objcha_line( (data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
+ m_sprites->set_objcha(data & 0x01);
/* bit 1 used but unknown (irq enable?) */
@@ -141,102 +190,66 @@ WRITE16_MEMBER(overdriv_state::overdriv_soundirq_w)
m_audiocpu->set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
}
-
-
-
-WRITE16_MEMBER(overdriv_state::slave_irq4_assert_w)
+WRITE16_MEMBER(overdriv_state::hostint_1_w)
{
- // used in-game
- m_subcpu->set_input_line(4, HOLD_LINE);
+ m_subcpu->set_input_line(6, HOLD_LINE);
}
-WRITE16_MEMBER(overdriv_state::slave_irq5_assert_w)
+WRITE16_MEMBER(overdriv_state::hostint_2_w)
{
- // tests GFX ROMs with this irq (indeed enabled only in test mode)
m_subcpu->set_input_line(5, HOLD_LINE);
}
+WRITE16_MEMBER(overdriv_state::crtint_w)
+{
+ m_maincpu->set_input_line(6, HOLD_LINE);
+}
+
static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x040000, 0x043fff) AM_RAM /* work RAM */
AM_RANGE(0x080000, 0x080fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("INPUTS")
+ AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("INPUTS") //swrd
AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x0e0000, 0x0e0001) AM_WRITENOP /* unknown (always 0x30) */
- AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) /* 053252? (LSB) */
- AM_RANGE(0x140000, 0x140001) AM_WRITENOP //watchdog reset?
+// d0000 = radiosw
+ AM_RANGE(0x0e0000, 0x0e0001) AM_WRITENOP /* unknown (always 0x30) mdcs1 */
+// f0000 = mdcs2
+ AM_RANGE(0x100000, 0x10001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
+ AM_RANGE(0x140000, 0x140001) AM_WRITENOP //watchdog reset? afr
AM_RANGE(0x180000, 0x180001) AM_READ_PORT("PADDLE") AM_WRITENOP // writes 0 at POST and expect that motor busy flag is off, then checks if paddle is at center otherwise throws a "VOLUME ERROR".
- AM_RANGE(0x1c0000, 0x1c001f) AM_DEVWRITE8("k051316_1", k051316_device, ctrl_w, 0xff00)
- AM_RANGE(0x1c8000, 0x1c801f) AM_DEVWRITE8("k051316_2", k051316_device, ctrl_w, 0xff00)
- AM_RANGE(0x1d0000, 0x1d001f) AM_DEVWRITE("k053251", k053251_device, msb_w)
+ AM_RANGE(0x1c0000, 0x1c001f) AM_DEVICE8("roz_1", k051316_device, map, 0xff00)
+ AM_RANGE(0x1c8000, 0x1c801f) AM_DEVICE8("roz_2", k051316_device, map, 0xff00)
+ AM_RANGE(0x1d0000, 0x1d001f) AM_DEVICE8("mixer", k053251_device, map, 0xff00)
AM_RANGE(0x1d8000, 0x1d8003) AM_DEVREADWRITE8("k053260_1", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x1e0000, 0x1e0003) AM_DEVREADWRITE8("k053260_2", k053260_device, main_read, main_write, 0x00ff)
- AM_RANGE(0x1e8000, 0x1e8001) AM_WRITE(overdriv_soundirq_w)
- AM_RANGE(0x1f0000, 0x1f0001) AM_WRITE(cpuA_ctrl_w) /* halt cpu B, coin counter, start lamp, other? */
- AM_RANGE(0x1f8000, 0x1f8001) AM_WRITE(eeprom_w)
- AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x210000, 0x210fff) AM_DEVREADWRITE8("k051316_1", k051316_device, read, write, 0xff00)
- AM_RANGE(0x218000, 0x218fff) AM_DEVREADWRITE8("k051316_2", k051316_device, read, write, 0xff00)
- AM_RANGE(0x220000, 0x220fff) AM_DEVREAD8("k051316_1", k051316_device, rom_r, 0xff00)
- AM_RANGE(0x228000, 0x228fff) AM_DEVREAD8("k051316_2", k051316_device, rom_r, 0xff00)
- AM_RANGE(0x230000, 0x230001) AM_WRITE(slave_irq4_assert_w)
- AM_RANGE(0x238000, 0x238001) AM_WRITE(slave_irq5_assert_w)
+ AM_RANGE(0x1e8000, 0x1e8001) AM_WRITE(overdriv_soundirq_w) // soundon
+ AM_RANGE(0x1f0000, 0x1f0001) AM_WRITE(cpuA_ctrl_w) /* port1, halt cpu B, coin counter, start lamp, other? */
+ AM_RANGE(0x1f8000, 0x1f8001) AM_WRITE(eeprom_w) /* port2 */
+ AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1") // hcomcs
+ AM_RANGE(0x210000, 0x210fff) AM_DEVREADWRITE8("roz_1", k051316_device, vram_r, vram_w, 0xff00)
+ AM_RANGE(0x218000, 0x218fff) AM_DEVREADWRITE8("roz_2", k051316_device, vram_r, vram_w, 0xff00)
+ AM_RANGE(0x220000, 0x220fff) AM_DEVREAD8("roz_1", k051316_device, rom_r, 0xff00)
+ AM_RANGE(0x228000, 0x228fff) AM_DEVREAD8("roz_2", k051316_device, rom_r, 0xff00)
+ AM_RANGE(0x230000, 0x230001) AM_WRITE(hostint_1_w)
+ AM_RANGE(0x238000, 0x238001) AM_WRITE(hostint_2_w)
ADDRESS_MAP_END
-#ifdef UNUSED_FUNCTION
-WRITE16_MEMBER( overdriv_state::overdriv_k053246_word_w )
-{
- m_k053246->k053246_word_w(space,offset,data,mem_mask);
-
- uint16_t *src, *dst;
-
- m_k053246->k053247_get_ram(&dst);
-
- src = m_sprram;
-
- // this should be the sprite dma/irq bit...
- // but it is already turned off by the time overdriv_state::cpuB_interrupt is executed?
- // even now it rarely gets set, I imagine because the communication / irq is actually
- // worse than we thought. (drive very slowly and things update..)
- if (m_k053246->k053246_is_irq_enabled())
- {
- memcpy(dst,src,0x1000);
- }
-
- //printf("%02x %04x %04x\n", offset, data, mem_mask);
-
-}
-#endif
-
-TIMER_CALLBACK_MEMBER(overdriv_state::objdma_end_cb )
-{
- m_subcpu->set_input_line(6, HOLD_LINE);
-}
-
-WRITE16_MEMBER(overdriv_state::objdma_w)
-{
- if(data & 0x10)
- m_objdma_end_timer->adjust(attotime::from_usec(100));
-
- m_k053246->k053246_w(space,5,data,mem_mask);
-}
-
static ADDRESS_MAP_START( overdriv_slave_map, AS_PROGRAM, 16, overdriv_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x080000, 0x083fff) AM_RAM /* work RAM */
- AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM //AM_DEVREADWRITE("k053250_1", k053250_device, ram_r, ram_w)
- AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE("k053250_1", k053250_device, reg_r, reg_w)
- AM_RANGE(0x108000, 0x10800f) AM_DEVREADWRITE("k053250_2", k053250_device, reg_r, reg_w)
- AM_RANGE(0x118000, 0x118fff) AM_DEVREADWRITE("k053246", k053247_device, k053247_word_r, k053247_word_w) // data gets copied to sprite chip with DMA..
- AM_RANGE(0x120000, 0x120001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
+ AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM AM_SHARE("lvcram")
+ AM_RANGE(0x100000, 0x10000f) AM_DEVICE8("lvc_1", k053250_device, map, 0x00ff)
+ AM_RANGE(0x108000, 0x10800f) AM_DEVICE8("lvc_2", k053250_device, map, 0x00ff)
+ AM_RANGE(0x110000, 0x110001) AM_WRITE(crtint_w)
+ AM_RANGE(0x118000, 0x118fff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0x120000, 0x120001) AM_DEVREAD("sprites", k053246_053247_device, rom16_r)
AM_RANGE(0x128000, 0x128001) AM_READWRITE(cpuB_ctrl_r, cpuB_ctrl_w) /* enable K053247 ROM reading, plus something else */
- AM_RANGE(0x130004, 0x130005) AM_WRITE(objdma_w)
- AM_RANGE(0x130000, 0x130007) AM_DEVREADWRITE8("k053246", k053247_device, k053246_r,k053246_w,0xffff)
+ AM_RANGE(0x130000, 0x130007) AM_DEVICE("sprites", k053246_053247_device, objset1)
//AM_RANGE(0x140000, 0x140001) used in later stages, set after writes at 0x208000-0x20bfff range
AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
AM_RANGE(0x208000, 0x20bfff) AM_RAM // sprite indirect table?
- AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
- AM_RANGE(0x220000, 0x221fff) AM_DEVREAD("k053250_2", k053250_device, rom_r)
+ AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("lvc_1", k053250_device, rom_r)
+ AM_RANGE(0x220000, 0x221fff) AM_DEVREAD("lvc_2", k053250_device, rom_r)
ADDRESS_MAP_END
WRITE8_MEMBER(overdriv_state::sound_ack_w)
@@ -296,23 +309,12 @@ INPUT_PORTS_END
void overdriv_state::machine_start()
{
- m_objdma_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(overdriv_state::objdma_end_cb), this));
-
save_item(NAME(m_cpuB_ctrl));
- save_item(NAME(m_sprite_colorbase));
- save_item(NAME(m_zoom_colorbase));
- save_item(NAME(m_road_colorbase));
- save_item(NAME(m_fake_timer));
}
void overdriv_state::machine_reset()
{
m_cpuB_ctrl = 0;
- m_sprite_colorbase = 0;
- m_zoom_colorbase[0] = 0;
- m_zoom_colorbase[1] = 0;
- m_road_colorbase[0] = 0;
- m_road_colorbase[1] = 0;
/* start with cpu B halted */
m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
@@ -324,18 +326,16 @@ static MACHINE_CONFIG_START( overdriv )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) /* 12 MHz */
MCFG_CPU_PROGRAM_MAP(overdriv_master_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", overdriv_state, overdriv_cpuA_scanline, "screen", 0, 1)
MCFG_CPU_ADD("sub", M68000, XTAL_24MHz/2) /* 12 MHz */
MCFG_CPU_PROGRAM_MAP(overdriv_slave_map)
- //MCFG_CPU_VBLANK_INT_DRIVER("screen", overdriv_state, cpuB_interrupt)
- /* IRQ 5 and 6 are generated by the main CPU. */
- /* IRQ 5 is used only in test mode, to request the checksums of the gfx ROMs. */
MCFG_CPU_ADD("audiocpu", M6809, XTAL_3_579545MHz) /* 1.789 MHz?? This might be the right speed, but ROM testing */
MCFG_CPU_PROGRAM_MAP(overdriv_sound_map) /* takes a little too much (the counter wraps from 0000 to 9999). */
/* This might just mean that the video refresh rate is less than */
/* 60 fps, that's how I fixed it for now. */
+ /* 053352-derived refresh rate is 59.2Hz, so it's ok */
+
MCFG_QUANTUM_TIME(attotime::from_hz(12000))
@@ -343,37 +343,52 @@ static MACHINE_CONFIG_START( overdriv )
MCFG_EEPROM_SERIAL_DATA(overdriv_default_eeprom, 128)
/* video hardware */
+ MCFG_FLOW_RENDER_MANAGER_ADD("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", overdriv_state, fr_setup)
+
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4,384,0,305,264,0,224)
- MCFG_SCREEN_UPDATE_DRIVER(overdriv_state, screen_update_overdriv)
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_RAW_PARAMS(6000000, 384, 0, 305, 264, 0, 224)
+ MCFG_SCREEN_FLOW_RENDER_RGB()
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_DEVICE_ADD("k053246", K053246, 0)
- MCFG_K053246_CB(overdriv_state, sprite_callback)
- MCFG_K053246_CONFIG("gfx1", NORMAL_PLANE_ORDER, 77, 22)
- MCFG_K053246_PALETTE("palette")
+ MCFG_KVIDEODAC_ADD("videodac", "palette", 0, 0.6, 0, 1.0)
+
+ MCFG_K053251_ADD("mixer", 0)
+ MCFG_VLATENCY_POST(1) // Post mixer TTL palette has one latch on the path per schematics
- MCFG_DEVICE_ADD("k051316_1", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(14, -1)
- MCFG_K051316_WRAP(1)
- MCFG_K051316_CB(overdriv_state, zoom_callback_1)
+ MCFG_K053246_053247_ADD("sprites", XTAL_24MHz/4, "spriteram")
+ MCFG_VLATENCY_NEXT("mixer")
+ MCFG_K053246_053247_WIRING_CB(overdriv_state, sprites_wiring)
- MCFG_DEVICE_ADD("k051316_2", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(15, 1)
- MCFG_K051316_CB(overdriv_state, zoom_callback_2)
+ MCFG_K051316_ADD("roz_1", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = (address & 0x3c0000) >> 14; })
+ MCFG_VLATENCY_NEXT("mixer")
+ MCFG_VLATENCY_PRE(1) // Sync signals are gated on a latch
- MCFG_K053251_ADD("k053251")
- MCFG_K053250_ADD("k053250_1", "palette", "screen", 0, 0)
- MCFG_K053250_ADD("k053250_2", "palette", "screen", 0, 0)
+ MCFG_K051316_ADD("roz_2", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = (address & 0x3c0000) >> 14; })
+ MCFG_VLATENCY_NEXT("mixer")
+ MCFG_VLATENCY_PRE(1) // Sync signals are gated on a latch
- MCFG_DEVICE_ADD("k053252", K053252, XTAL_24MHz/4)
- MCFG_K053252_OFFSETS(13*8, 2*8)
+ MCFG_K053250_ADD("lvc_1", XTAL_24MHz/4, ":lvcram")
+ MCFG_VLATENCY_NEXT("mixer")
+ MCFG_K053250_PAGE(1)
+
+ MCFG_K053250_ADD("lvc_2", XTAL_24MHz/4, ":lvcram")
+ MCFG_VLATENCY_NEXT("mixer")
+
+ MCFG_DEVICE_ADD("video_timings", K053252, XTAL_24MHz/4)
+ MCFG_K053252_VBLANK_CB(DEVWRITELINE(":sprites", k053246_053247_device, vblank_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(":lvc_1", k053250_device, vblank_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(":lvc_2", k053250_device, vblank_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(HOLDLINE(":maincpu", 5))
+ MCFG_K053252_VSYNC_CB(HOLDLINE(":sub", 4))
+ MCFG_K053252_FCNT_CB(HOLDLINE(":maincpu", 4))
+ MCFG_K053252_KSNOTIFIER_CB(DEVKSNOTIFIER(":sprites", k053246_053247_device, ksnotifier_w))
+ MCFG_KSNOTIFIER_CHAIN(DEVKSNOTIFIER(":lvc_1", k053250_device, ksnotifier_w))
+ MCFG_KSNOTIFIER_CHAIN(DEVKSNOTIFIER(":lvc_2", k053250_device, ksnotifier_w))
+ MCFG_KSNOTIFIER_CHAIN(DEVKSNOTIFIER(":roz_1", k051316_device, ksnotifier_w))
+ MCFG_KSNOTIFIER_CHAIN(DEVKSNOTIFIER(":roz_2", k051316_device, ksnotifier_w))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -413,24 +428,24 @@ ROM_START( overdriv )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "789_e01.e4", 0x00000, 0x10000, CRC(1085f069) SHA1(27228cedb357ff2e130a4bd6d8aa01cf537e034f) ) /* also found labeled as "5" */
- ROM_REGION( 0x400000, "gfx1", 0 ) /* graphics (addressable by the CPU) */
- ROM_LOAD64_WORD( "789e12.r1", 0x000000, 0x100000, CRC(14a10fb2) SHA1(03fb9c15514c5ecc2d9ae4a53961c4bbb49cec73) ) /* sprites */
- ROM_LOAD64_WORD( "789e13.r4", 0x000002, 0x100000, CRC(6314a628) SHA1(f8a8918998c266109348c77427a7696b503daeb3) )
- ROM_LOAD64_WORD( "789e14.r10", 0x000004, 0x100000, CRC(b5eca14b) SHA1(a1c5f5e9cd8bbcfc875e2acb33be024724da63aa) )
- ROM_LOAD64_WORD( "789e15.r15", 0x000006, 0x100000, CRC(5d93e0c3) SHA1(d5cb7666c0c28fd465c860c7f9dbb18a7f739a93) )
+ ROM_REGION( 0x400000, "sprites", 0 ) /* graphics (addressable by the CPU) */
+ ROM_LOAD64_WORD_SWAP( "789e12.r1", 0x000000, 0x100000, CRC(14a10fb2) SHA1(03fb9c15514c5ecc2d9ae4a53961c4bbb49cec73) ) /* sprites */
+ ROM_LOAD64_WORD_SWAP( "789e13.r4", 0x000002, 0x100000, CRC(6314a628) SHA1(f8a8918998c266109348c77427a7696b503daeb3) )
+ ROM_LOAD64_WORD_SWAP( "789e14.r10", 0x000004, 0x100000, CRC(b5eca14b) SHA1(a1c5f5e9cd8bbcfc875e2acb33be024724da63aa) )
+ ROM_LOAD64_WORD_SWAP( "789e15.r15", 0x000006, 0x100000, CRC(5d93e0c3) SHA1(d5cb7666c0c28fd465c860c7f9dbb18a7f739a93) )
- ROM_REGION( 0x020000, "k051316_1", 0 )
+ ROM_REGION( 0x020000, "roz_1", 0 )
ROM_LOAD( "789e06.a21", 0x000000, 0x020000, CRC(14a085e6) SHA1(86dad6f223e13ff8af7075c3d99bb0a83784c384) ) /* zoom/rotate */
- ROM_REGION( 0x020000, "k051316_2", 0 )
+ ROM_REGION( 0x020000, "roz_2", 0 )
ROM_LOAD( "789e07.c23", 0x000000, 0x020000, CRC(8a6ceab9) SHA1(1a52b7361f71a6126cd648a76af00223d5b25c7a) ) /* zoom/rotate */
- ROM_REGION( 0x0c0000, "k053250_1", 0 )
+ ROM_REGION( 0x100000, "lvc_1", ROMREGION_ERASE00 )
ROM_LOAD( "789e18.p22", 0x000000, 0x040000, CRC(985a4a75) SHA1(b726166c295be6fbec38a9d11098cc4a4a5de456) )
ROM_LOAD( "789e19.r22", 0x040000, 0x040000, CRC(15c54ea2) SHA1(5b10bd28e48e51613359820ba8c75d4a91c2d322) )
ROM_LOAD( "789e20.s22", 0x080000, 0x040000, CRC(ea204acd) SHA1(52b8c30234eaefcba1074496028a4ac2bca48e95) )
- ROM_REGION( 0x080000, "k053250_2", 0 )
+ ROM_REGION( 0x080000, "lvc_2", 0 )
ROM_LOAD( "789e17.p17", 0x000000, 0x040000, CRC(04c07248) SHA1(873445002cbf90c9fc5a35bf4a8f6c43193ee342) )
ROM_LOAD( "789e16.p12", 0x040000, 0x040000, CRC(9348dee1) SHA1(367193373e28962b5b0e54cc15d68ed88ab83f12) )
@@ -451,24 +466,24 @@ ROM_START( overdriva )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "789_e01.e4", 0x00000, 0x10000, CRC(1085f069) SHA1(27228cedb357ff2e130a4bd6d8aa01cf537e034f) ) /* also found labeled as "5" */
- ROM_REGION( 0x400000, "gfx1", 0 ) /* graphics (addressable by the CPU) */
+ ROM_REGION( 0x400000, "sprites", 0 ) /* graphics (addressable by the CPU) */
ROM_LOAD64_WORD( "789e12.r1", 0x000000, 0x100000, CRC(14a10fb2) SHA1(03fb9c15514c5ecc2d9ae4a53961c4bbb49cec73) ) /* sprites */
ROM_LOAD64_WORD( "789e13.r4", 0x000002, 0x100000, CRC(6314a628) SHA1(f8a8918998c266109348c77427a7696b503daeb3) )
ROM_LOAD64_WORD( "789e14.r10", 0x000004, 0x100000, CRC(b5eca14b) SHA1(a1c5f5e9cd8bbcfc875e2acb33be024724da63aa) )
ROM_LOAD64_WORD( "789e15.r15", 0x000006, 0x100000, CRC(5d93e0c3) SHA1(d5cb7666c0c28fd465c860c7f9dbb18a7f739a93) )
- ROM_REGION( 0x020000, "k051316_1", 0 )
+ ROM_REGION( 0x020000, "roz_1", 0 )
ROM_LOAD( "789e06.a21", 0x000000, 0x020000, CRC(14a085e6) SHA1(86dad6f223e13ff8af7075c3d99bb0a83784c384) ) /* zoom/rotate */
- ROM_REGION( 0x020000, "k051316_2", 0 )
+ ROM_REGION( 0x020000, "roz_2", 0 )
ROM_LOAD( "789e07.c23", 0x000000, 0x020000, CRC(8a6ceab9) SHA1(1a52b7361f71a6126cd648a76af00223d5b25c7a) ) /* zoom/rotate */
- ROM_REGION( 0x0c0000, "k053250_1", 0 )
+ ROM_REGION( 0x100000, "lvc_1", ROMREGION_ERASE00 )
ROM_LOAD( "789e18.p22", 0x000000, 0x040000, CRC(985a4a75) SHA1(b726166c295be6fbec38a9d11098cc4a4a5de456) )
ROM_LOAD( "789e19.r22", 0x040000, 0x040000, CRC(15c54ea2) SHA1(5b10bd28e48e51613359820ba8c75d4a91c2d322) )
ROM_LOAD( "789e20.s22", 0x080000, 0x040000, CRC(ea204acd) SHA1(52b8c30234eaefcba1074496028a4ac2bca48e95) )
- ROM_REGION( 0x080000, "k053250_2", 0 )
+ ROM_REGION( 0x080000, "lvc_2", 0 )
ROM_LOAD( "789e17.p17", 0x000000, 0x040000, CRC(04c07248) SHA1(873445002cbf90c9fc5a35bf4a8f6c43193ee342) )
ROM_LOAD( "789e16.p12", 0x040000, 0x040000, CRC(9348dee1) SHA1(367193373e28962b5b0e54cc15d68ed88ab83f12) )
@@ -489,24 +504,24 @@ ROM_START( overdrivb )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "789_e01.e4", 0x00000, 0x10000, CRC(1085f069) SHA1(27228cedb357ff2e130a4bd6d8aa01cf537e034f) ) /* also found labeled as "5" */
- ROM_REGION( 0x400000, "gfx1", 0 ) /* graphics (addressable by the CPU) */
+ ROM_REGION( 0x400000, "sprites", 0 ) /* graphics (addressable by the CPU) */
ROM_LOAD64_WORD( "789e12.r1", 0x000000, 0x100000, CRC(14a10fb2) SHA1(03fb9c15514c5ecc2d9ae4a53961c4bbb49cec73) ) /* sprites */
ROM_LOAD64_WORD( "789e13.r4", 0x000002, 0x100000, CRC(6314a628) SHA1(f8a8918998c266109348c77427a7696b503daeb3) )
ROM_LOAD64_WORD( "789e14.r10", 0x000004, 0x100000, CRC(b5eca14b) SHA1(a1c5f5e9cd8bbcfc875e2acb33be024724da63aa) )
ROM_LOAD64_WORD( "789e15.r15", 0x000006, 0x100000, CRC(5d93e0c3) SHA1(d5cb7666c0c28fd465c860c7f9dbb18a7f739a93) )
- ROM_REGION( 0x020000, "k051316_1", 0 )
+ ROM_REGION( 0x020000, "roz_1", 0 )
ROM_LOAD( "789e06.a21", 0x000000, 0x020000, CRC(14a085e6) SHA1(86dad6f223e13ff8af7075c3d99bb0a83784c384) ) /* zoom/rotate */
- ROM_REGION( 0x020000, "k051316_2", 0 )
+ ROM_REGION( 0x020000, "roz_2", 0 )
ROM_LOAD( "789e07.c23", 0x000000, 0x020000, CRC(8a6ceab9) SHA1(1a52b7361f71a6126cd648a76af00223d5b25c7a) ) /* zoom/rotate */
- ROM_REGION( 0x0c0000, "k053250_1", 0 )
+ ROM_REGION( 0x100000, "lvc_1", ROMREGION_ERASE00 )
ROM_LOAD( "789e18.p22", 0x000000, 0x040000, CRC(985a4a75) SHA1(b726166c295be6fbec38a9d11098cc4a4a5de456) )
ROM_LOAD( "789e19.r22", 0x040000, 0x040000, CRC(15c54ea2) SHA1(5b10bd28e48e51613359820ba8c75d4a91c2d322) )
ROM_LOAD( "789e20.s22", 0x080000, 0x040000, CRC(ea204acd) SHA1(52b8c30234eaefcba1074496028a4ac2bca48e95) )
- ROM_REGION( 0x080000, "k053250_2", 0 )
+ ROM_REGION( 0x080000, "lvc_2", 0 )
ROM_LOAD( "789e17.p17", 0x000000, 0x040000, CRC(04c07248) SHA1(873445002cbf90c9fc5a35bf4a8f6c43193ee342) )
ROM_LOAD( "789e16.p12", 0x040000, 0x040000, CRC(9348dee1) SHA1(367193373e28962b5b0e54cc15d68ed88ab83f12) )
@@ -515,6 +530,6 @@ ROM_START( overdrivb )
ROM_LOAD( "789e02.f1", 0x100000, 0x100000, CRC(bdd3b5c6) SHA1(412332d64052c0a3714f4002c944b0e7d32980a4) )
ROM_END
-GAMEL( 1990, overdriv, 0, overdriv, overdriv, overdriv_state, 0, ROT90, "Konami", "Over Drive (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_overdriv ) // US version
+GAME( 1990, overdriv, 0, overdriv, overdriv, overdriv_state, 0, ROT90, "Konami", "Over Drive (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE)//, layout_overdriv ) // US version
GAMEL( 1990, overdriva, overdriv, overdriv, overdriv, overdriv_state, 0, ROT90, "Konami", "Over Drive (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_overdriv ) // Overseas?
GAMEL( 1990, overdrivb, overdriv, overdriv, overdriv, overdriv_state, 0, ROT90, "Konami", "Over Drive (set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE, layout_overdriv ) // Overseas?
diff --git a/src/mame/drivers/parodius.cpp b/src/mame/drivers/parodius.cpp
index ecc6bea5fa7..1d83a55681b 100644
--- a/src/mame/drivers/parodius.cpp
+++ b/src/mame/drivers/parodius.cpp
@@ -101,7 +101,7 @@ static ADDRESS_MAP_START( parodius_map, AS_PROGRAM, 8, parodius_state )
AM_RANGE(0x3f8f, 0x3f8f) AM_READ_PORT("DSW1")
AM_RANGE(0x3f90, 0x3f90) AM_READ_PORT("DSW2")
AM_RANGE(0x3fa0, 0x3faf) AM_DEVREADWRITE("k053245", k05324x_device, k053244_r, k053244_w)
- AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE("k053251", k053251_device, write)
+ AM_RANGE(0x3fb0, 0x3fbf) AM_DEVICE("k053251", k053251_device, map)
AM_RANGE(0x3fc0, 0x3fc0) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(parodius_3fc0_w)
AM_RANGE(0x3fc4, 0x3fc4) AM_WRITE(parodius_videobank_w)
AM_RANGE(0x3fc8, 0x3fc8) AM_WRITE(parodius_sh_irqtrigger_w)
@@ -273,7 +273,7 @@ static MACHINE_CONFIG_START( parodius )
MCFG_K05324X_OFFSETS(0, 0)
MCFG_K05324X_CB(parodius_state, sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/piratesh.cpp b/src/mame/drivers/piratesh.cpp
index cb828399489..84d7d5bb9e6 100644
--- a/src/mame/drivers/piratesh.cpp
+++ b/src/mame/drivers/piratesh.cpp
@@ -29,18 +29,18 @@
#include "emu.h"
#include "speaker.h"
-#include "video/k053250_ps.h"
-#include "machine/nvram.h"
#include "cpu/m68000/m68000.h"
-#include "sound/k054539.h"
-#include "includes/konamigx.h" // TODO: WHY?
-#include "video/konami_helper.h"
-#include "machine/ticket.h"
#include "machine/gen_latch.h"
#include "machine/k053252.h"
-#include "video/k055555.h"
-#include "video/k054000.h"
+#include "machine/nvram.h"
+#include "machine/ticket.h"
+#include "sound/k054539.h"
#include "video/k053246_k053247_k055673.h"
+#include "video/k053250.h"
+#include "video/k054000.h"
+#include "video/k054156_k054157_k056832.h"
+#include "video/k055555.h"
+#include "video/kvideodac.h"
class piratesh_state : public driver_device
{
@@ -48,62 +48,81 @@ public:
piratesh_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
- m_k053250(*this, "k053250"),
- m_k053252(*this, "k053252"),
- m_k056832(*this, "k056832"),
- m_k055673(*this, "k055673"),
- m_k055555(*this, "k055555"),
-// m_k053246(*this, "k053246"),
+ m_lvc(*this, "lvc"),
+ m_video_timings(*this, "video_timings"),
+ m_tilemap(*this, "tilemap"),
+ m_sprites(*this, "sprites"),
+ m_mixer(*this, "mixer"),
m_k054539(*this, "k054539"),
- m_spriteram(*this,"spriteram")
+ m_videodac(*this, "videodac"),
+ m_screen(*this, "screen")
{ }
required_device<cpu_device> m_maincpu;
- required_device<k053250ps_device> m_k053250;
- required_device<k053252_device> m_k053252;
- required_device<k056832_device> m_k056832;
- required_device<k055673_device> m_k055673;
- required_device<k055555_device> m_k055555;
+ required_device<k053250_device> m_lvc;
+ required_device<k053252_device> m_video_timings;
+ required_device<k054156_056832_device> m_tilemap;
+ required_device<k053246_055673_device> m_sprites;
+ required_device<k055555_device> m_mixer;
required_device<k054539_device> m_k054539;
-// required_device<k053247_device> m_k053246;
-
- optional_shared_ptr<uint16_t> m_spriteram;
-
- int m_layer_colorbase[6];
- int m_sprite_colorbase;
- int m_lvc_colorbase;
+ required_device<kvideodac_device> m_videodac;
+ required_device<screen_device> m_screen;
uint8_t m_int_enable;
uint8_t m_int_status;
- uint8_t m_sound_ctrl;
- uint8_t m_sound_nmi_clk;
uint16_t m_control;
void update_interrupts();
- DECLARE_READ16_MEMBER(K056832_rom_r);
+ DECLARE_WRITE_LINE_MEMBER(vblankirq_w);
+
DECLARE_WRITE16_MEMBER(control1_w);
DECLARE_WRITE16_MEMBER(control2_w);
DECLARE_WRITE16_MEMBER(control3_w);
DECLARE_WRITE16_MEMBER(irq_ack_w);
- DECLARE_READ16_MEMBER(k053247_scattered_word_r);
- DECLARE_WRITE16_MEMBER(k053247_scattered_word_w);
- DECLARE_READ16_MEMBER(k053247_martchmp_word_r);
- DECLARE_WRITE16_MEMBER(k053247_martchmp_word_w);
DECLARE_CUSTOM_INPUT_MEMBER(helm_r);
DECLARE_CUSTOM_INPUT_MEMBER(battery_r);
+ DECLARE_WRITE16_MEMBER(k055555_disp_hack_w);
+
DECLARE_MACHINE_START(piratesh);
DECLARE_MACHINE_RESET(piratesh);
DECLARE_VIDEO_START(piratesh);
- uint32_t screen_update_piratesh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen);
TIMER_DEVICE_CALLBACK_MEMBER(piratesh_interrupt);
- K056832_CB_MEMBER(piratesh_tile_callback);
- K055673_CB_MEMBER(piratesh_sprite_callback);
+
+ void fr_setup(flow_render::manager *manager);
};
+void piratesh_state::fr_setup(flow_render::manager *manager)
+{
+ auto rv = m_videodac->flow_render_get_renderer();
+ auto rm = m_mixer ->flow_render_get_renderer();
+ auto rs = m_sprites ->flow_render_get_renderer();
+ auto rl = m_lvc ->flow_render_get_renderer();
+
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), rm->inp("a color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), rm->inp("b color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm->inp("c color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm->inp("d color"));
+
+ manager->connect(rs->out("color"), rm->inp("s2 color"));
+ manager->connect(rs->out("attr"), rm->inp("s2 attr"));
+
+ manager->connect(rl->out("color"), rm->inp("s3 color"));
+ manager->connect(rl->out("attr"), rm->inp("s3 attr"));
+
+ manager->set_constant(rm->inp("s1 color"), 0);
+ manager->set_constant(rm->inp("s1 attr"), 0);
+ manager->set_constant(rm->inp("o color"), 0);
+ manager->set_constant(rm->inp("o attr"), 0);
+
+ manager->connect(rm->out("0 color"), rv->inp("color"));
+ manager->connect(rm->out("0 attr"), rv->inp("attr"));
+
+ manager->connect(rv->out(), m_screen->flow_render_get_renderer()->inp());
+}
void piratesh_state::update_interrupts()
{
@@ -112,6 +131,15 @@ void piratesh_state::update_interrupts()
m_maincpu->set_input_line(M68K_IRQ_5, m_int_status & 4 ? ASSERT_LINE : CLEAR_LINE);
}
+WRITE_LINE_MEMBER(piratesh_state::vblankirq_w)
+{
+ if((m_int_enable & 2) && state)
+ m_int_status |= 2;
+ else
+ m_int_status &= ~2;
+ update_interrupts();
+}
+
/*
Priority issues:
@@ -120,7 +148,7 @@ void piratesh_state::update_interrupts()
3.
*/
-
+#if 0
K056832_CB_MEMBER(piratesh_state::piratesh_tile_callback)
{
// Layer
@@ -175,117 +203,9 @@ K055673_CB_MEMBER(piratesh_state::piratesh_sprite_callback)
// 1100 1100
// 1010 1010
}
-
-
-
-VIDEO_START_MEMBER(piratesh_state, piratesh)
-{
- // TODO: These come from the 055555
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 2;
- m_layer_colorbase[2] = 4;
- m_layer_colorbase[3] = 6;
- m_sprite_colorbase = 1;
- m_lvc_colorbase = 3;
-#if 0
- konamigx_mixer_init(*m_screen, 0);
-
- m_k056832->set_layer_offs(0, -2+2-1, 0-1);
- m_k056832->set_layer_offs(1, 0+2, 0);
- m_k056832->set_layer_offs(2, 2+2, 0);
- m_k056832->set_layer_offs(3, 3+2, 0);
#endif
-}
-
-uint32_t piratesh_state::screen_update_piratesh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- bitmap.fill(0, cliprect);
#if 1
-
- int layers[4], layerpri[4];
- static const int pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 };
- static const int enables[4] = { K55_INP_VRAM_A, K55_INP_VRAM_B, K55_INP_VRAM_C, K55_INP_VRAM_D };
-
- for (uint32_t i = 0; i < 4; i++)
- {
- layers[i] = i;
- layerpri[i] = m_k055555->K055555_read_register(pris[i]);
- }
-
- konami_sortlayers4(layers, layerpri);
-
- screen.priority().fill(0, cliprect);
-
- const uint32_t input_enables = m_k055555->K055555_read_register(K55_INPUT_ENABLES);
-
- // TODO: FIX COLORBASES
- if (input_enables & K55_INP_SUB3)
- m_k053250->draw(bitmap, cliprect, 0x20, 0, screen.priority(), 2);
- for (uint32_t i = 0; i < 4; i++)
- {
- if (input_enables & enables[layers[i]])
- {
- m_k056832->tilemap_draw(screen, bitmap, cliprect, layers[i], 0, 1 << i);
- }
- }
-
- if (input_enables & K55_INP_SUB2)
- m_k055673->k053247_sprites_draw(bitmap, cliprect);
-
-#if 0
-#define K55_INP_VRAM_A 0x01
-#define K55_INP_VRAM_B 0x02
-#define K55_INP_VRAM_C 0x04
-#define K55_INP_VRAM_D 0x08
-#define K55_INP_OBJ 0x10
-#define K55_INP_SUB1 0x20
-#define K55_INP_SUB2 0x40
-#define K55_INP_SUB3 0x80
-#endif
-
- //055555: 4 to reg 7 (A PRI 0)
- //055555: 0 to reg 8 (A PRI 1)
- //055555: 0 to reg 9 (A COLPRI)
- //055555: 6 to reg a (B PRI 0)
- //055555: 0 to reg b (B PRI 1)
- //055555: 0 to reg c (B COLPRI)
- //055555: 16 to reg d (C PRI)
- //055555: 18 to reg e (D PRI)
- //055555: 0 to reg 11 (SUB2 PRI)
- //055555: 0 to reg 12 (SUB3 PRI)
-
- //055555: 0 to reg 17 (A PAL)
- //055555: 2 to reg 18 (B PAL)
- //055555: 4 to reg 19 (C PAL)
- //055555: 6 to reg 1a (D PAL)
- //055555: 3 to reg 1d (SUB2 PAL)
- //055555: 1 to reg 1e (SUB3 PAL)
-
-
-#else
- // LAYER, FLAGS, PRIORITY
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, K056832_DRAW_FLAG_MIRROR, 1);
-
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2);
-
- // TODO: Fix priority
- m_k053250->draw(bitmap, cliprect, 0x20, 0, screen.priority(), 8);
-
- m_k055673->k053247_sprites_draw(bitmap, cliprect);
-
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, K056832_DRAW_FLAG_MIRROR, 4);
- m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, K056832_DRAW_FLAG_MIRROR, 0);
-#endif
- return 0;
-}
-
-
-
-
-/**********************************************************************************/
-/* IRQ controllers */
-
TIMER_DEVICE_CALLBACK_MEMBER(piratesh_state::piratesh_interrupt)
{
int scanline = param;
@@ -296,7 +216,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(piratesh_state::piratesh_interrupt)
if (scanline == 240)
{
- m_k053250->vblank_w(1);
+ // m_k053250->vblank_w(1);
if (m_int_enable & 2)
{
@@ -307,7 +227,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(piratesh_state::piratesh_interrupt)
if (scanline == 0)
{
- m_k053250->vblank_w(0);
+ // m_k053250->vblank_w(0);
if (m_int_enable & 4)
{
@@ -316,18 +236,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(piratesh_state::piratesh_interrupt)
}
}
}
-
-
-
-READ16_MEMBER(piratesh_state::K056832_rom_r)
-{
- uint16_t offs;
-
- offs = (m_control & 2 ? 0x1000 : 0) + offset;
- return m_k056832->piratesh_rom_r(space, offs, mem_mask);
-}
-
-
+#endif
WRITE16_MEMBER(piratesh_state::control1_w)
{
@@ -369,30 +278,36 @@ WRITE16_MEMBER(piratesh_state::control3_w)
// .... .... ..x. .... - Hopper enable (active high)
// .... ...x .... .... - Unknown (always 1?)
+ COMBINE_DATA(&m_control);
+
if ((data & ~0x0133) || (~data & 0x100))
printf("CTRL1 W: %x %x %x\n", offset, data, mem_mask);
// printf("CTRL 1: %x\n", data & 0x0010);
- machine().device<ticket_dispenser_device>("ticket")->motor_w(data & 0x0010 ? 1 : 0);
- machine().device<ticket_dispenser_device>("hopper")->motor_w(data & 0x0020 ? 1 : 0);
+ machine().device<ticket_dispenser_device>("ticket")->motor_w(m_control & 0x0010 ? 1 : 0);
+ machine().device<ticket_dispenser_device>("hopper")->motor_w(m_control & 0x0020 ? 1 : 0);
- m_control = data;
+ m_tilemap->set_banking(m_control & 2 ? 0x80000 : 0);
}
+WRITE16_MEMBER(piratesh_state::k055555_disp_hack_w)
+{
+ m_mixer->disp_w(space, 0, data);
+}
static ADDRESS_MAP_START( piratesh_map, AS_PROGRAM, 16, piratesh_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0x080000, 0x083fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x084000, 0x087fff) AM_RAM
- AM_RANGE(0x100000, 0x10001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) // CRTC
- AM_RANGE(0x180000, 0x18003f) AM_DEVWRITE("k056832", k056832_device, word_w) // TILEMAP
- AM_RANGE(0x280000, 0x280007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w) // SPRITES
- AM_RANGE(0x290000, 0x29000f) AM_DEVREAD("k055673", k055673_device, k055673_ps_rom_word_r) // SPRITES
- AM_RANGE(0x290010, 0x29001f) AM_DEVWRITE("k055673", k055673_device, k055673_reg_word_w) // SPRITES
- AM_RANGE(0x2a0000, 0x2a0fff) AM_DEVREADWRITE("k055673", k055673_device, k053247_word_r, k053247_word_w) // SPRITES
- AM_RANGE(0x2a1000, 0x2a3fff) AM_WRITENOP
- AM_RANGE(0x2b0000, 0x2b000f) AM_DEVREADWRITE("k053250", k053250ps_device, reg_r, reg_w) // LVC
- AM_RANGE(0x300000, 0x3000ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)
+ AM_RANGE(0x100000, 0x10001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
+ AM_RANGE(0x180000, 0x18003f) AM_DEVICE("tilemap", k054156_056832_device, vacset)
+ AM_RANGE(0x280000, 0x280007) AM_DEVICE("sprites", k053246_055673_device, objset1)
+ AM_RANGE(0x290000, 0x29000f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r)
+ AM_RANGE(0x290010, 0x29001f) AM_DEVICE("sprites", k053246_055673_device, objset2)
+ AM_RANGE(0x2a0000, 0x2a3fff) AM_RAM AM_SHARE("spriteram") // SPRITES
+ AM_RANGE(0x2b0000, 0x2b000f) AM_DEVICE8("lvc", k053250_device, map, 0x00ff)
+ AM_RANGE(0x30005a, 0x30005b) AM_WRITE(k055555_disp_hack_w)
+ AM_RANGE(0x300000, 0x3000ff) AM_DEVICE8("mixer", k055555_device, map, 0x00ff)
AM_RANGE(0x380000, 0x381fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x400000, 0x400001) AM_READ_PORT("IN0")
AM_RANGE(0x400002, 0x400003) AM_READ_PORT("IN1")
@@ -402,11 +317,11 @@ static ADDRESS_MAP_START( piratesh_map, AS_PROGRAM, 16, piratesh_state )
AM_RANGE(0x40000c, 0x40000d) AM_WRITE(control1_w)
AM_RANGE(0x400010, 0x400011) AM_WRITE(control2_w)
AM_RANGE(0x400014, 0x400015) AM_WRITE(control3_w)
- AM_RANGE(0x500000, 0x50ffff) AM_READ(K056832_rom_r) // VRAM ROM
- AM_RANGE(0x580000, 0x581fff) AM_DEVREAD("k053250", k053250ps_device, rom_r) // LVC ROM access
+ AM_RANGE(0x500000, 0x501fff) AM_DEVREAD("tilemap", k054156_056832_device, rom16_r)
+ AM_RANGE(0x580000, 0x581fff) AM_DEVREAD("lvc", k053250_device, rom_r)
AM_RANGE(0x600000, 0x6004ff) AM_DEVREADWRITE8("k054539", k054539_device, read, write, 0xff00) // SOUND
- AM_RANGE(0x680000, 0x681fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) // TILEMAP
- AM_RANGE(0x700000, 0x703fff) AM_DEVREADWRITE("k053250", k053250ps_device, ram_r, ram_w) // LVC
+ AM_RANGE(0x680000, 0x681fff) AM_DEVREADWRITE("tilemap", k054156_056832_device, vram16_r, vram16_w)
+ AM_RANGE(0x700000, 0x703fff) AM_RAM AM_SHARE("lvcram")
ADDRESS_MAP_END
@@ -469,8 +384,8 @@ static INPUT_PORTS_START( piratesh )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
PORT_START("SPECIAL")
- PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("k053250", k053250ps_device, dmairq_r)
- PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // FIXME: NCPU from 053246 (DMA)
+// PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("k053250", k053250ps_device, dmairq_r)
+ PORT_BIT( 0x0300, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // FIXME: NCPU from 053246 (DMA)
PORT_BIT( 0x0c00, IP_ACTIVE_HIGH, IPT_SPECIAL )PORT_CUSTOM_MEMBER(DEVICE_SELF, piratesh_state, battery_r, nullptr)
PORT_START("HELM")
@@ -549,27 +464,19 @@ INPUT_PORTS_END
MACHINE_START_MEMBER(piratesh_state, piratesh)
{
-#if 0
- m_sound_ctrl = 2;
- m_mw_irq_control = 0;
-
- /* konamigx_mixer uses this, so better initialize it */
- m_gx_wrport1_0 = 0;
-
- save_item(NAME(m_mw_irq_control));
- save_item(NAME(m_sound_ctrl));
- save_item(NAME(m_sound_nmi_clk));
-#endif
+ save_item(NAME(m_int_status));
+ save_item(NAME(m_int_enable));
+ save_item(NAME(m_control));
}
MACHINE_RESET_MEMBER(piratesh_state,piratesh)
{
m_int_status = 0;
-
- int i;
+ m_int_enable = 0;
+ m_control = 0;
// soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7)
- for (i=0; i<=7; i++)
+ for (int i=0; i<=7; i++)
{
// m_k054539->set_gain(i, 0.5);
}
@@ -584,12 +491,17 @@ static MACHINE_CONFIG_START( piratesh )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2)
MCFG_CPU_PROGRAM_MAP(piratesh_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", piratesh_state, piratesh_interrupt, "screen", 0, 1)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4)
- MCFG_K053252_OFFSETS(40, 16) // TODO
+ MCFG_DEVICE_ADD("video_timings", K053252, XTAL_32MHz/4)
+ MCFG_K053252_INT1_CB(WRITELINE(piratesh_state, vblankirq_w))
+// MCFG_K053252_INT2_CB(WRITELINE(piratesh_state, ccuint2_w))
+ MCFG_K053252_KSNOTIFIER_CB(DEVKSNOTIFIER(":tilemap", k054156_056832_device, ksnotifier_w))
+ MCFG_KSNOTIFIER_CHAIN(DEVKSNOTIFIER(":sprites", k053246_055673_device, ksnotifier_w))
+ MCFG_VIDEO_SET_SCREEN("screen")
+
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", piratesh_state, piratesh_interrupt, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(piratesh_state, piratesh)
MCFG_MACHINE_RESET_OVERRIDE(piratesh_state, piratesh)
@@ -598,45 +510,29 @@ static MACHINE_CONFIG_START( piratesh )
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
/* video hardware */
+ MCFG_FLOW_RENDER_MANAGER_ADD("fr_manager")
+ MCFG_FLOW_RENDER_MANAGER_SETUP(":", piratesh_state, fr_setup)
+
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
-// MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_RAW_PARAMS(6000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223) // TODO
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 16, 16+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(piratesh_state, screen_update_piratesh)
+ MCFG_SCREEN_FLOW_RENDER_RGB()
+ MCFG_SCREEN_RAW_PARAMS(8000000, 512, 58, 58+385, 264, 16, 16+224)
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(BGRX)
- MCFG_PALETTE_ENABLE_SHADOWS()
- MCFG_PALETTE_ENABLE_HILIGHTS()
-
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(piratesh_state, piratesh_tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4PIRATESH, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
-
- MCFG_K055555_ADD("k055555")
- MCFG_K053250PS_ADD("k053250", "palette", "screen", -16, 0)
+ MCFG_KVIDEODAC_ADD("videodac", "palette", 0x300, 0.6, 0, 1.0)
+ MCFG_KVIDEODAC_SKIPPED_BITS(2)
- MCFG_DEVICE_ADD("k055673", K055673, 0)
- MCFG_K055673_CB(piratesh_state, piratesh_sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_PS, -60, 24)
- MCFG_K055673_PALETTE("palette")
+ MCFG_K054156_056832_ADD("tilemap", XTAL_32MHz/4, 4, 4, 24)
+ MCFG_K054156_056832_DISABLE_VRC2()
+ MCFG_K054156_056832_SET_COLOR_BITS_ROTATION(true)
- // ????
- //MCFG_DEVICE_ADD("k053246", K053246, 0)
- //MCFG_K053246_CB(moo_state, sprite_callback)
- //MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, -48+1, 23)
- //MCFG_K053246_PALETTE("palette")
+ MCFG_K053246_055673_ADD("sprites", XTAL_32MHz/4, "spriteram")
- MCFG_DEVICE_ADD("k054338", K054338, 0)
- MCFG_K054338_ALPHAINV(1)
- MCFG_K054338_MIXER("k055555")
+ MCFG_K055555_ADD("mixer")
- MCFG_VIDEO_START_OVERRIDE(piratesh_state, piratesh)
+ MCFG_K053250_ADD("lvc", XTAL_32MHz/4, ":lvcram")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -654,16 +550,16 @@ ROM_START( piratesh )
ROM_LOAD16_WORD_SWAP( "360ua-c04.4p", 0x000000, 0x80000, CRC(6d69dd90) SHA1(ccbdbfea406d9cbc3f242211290ba82ccbbe3795) )
/* tiles */
- ROM_REGION( 0x80000, "gfx1", ROMREGION_ERASE00 ) // 27C4096
- ROM_LOAD( "360ua-a01.17g", 0x000000, 0x80000, CRC(e39153f5) SHA1(5da9132a2c24a15b55c3f65c26e2ad0467411a88) )
+ ROM_REGION( 0x100000, "tilemap", ROMREGION_ERASE00 ) // 27C4096
+ ROM_LOAD32_WORD_SWAP( "360ua-a01.17g", 0x000000, 0x80000, CRC(e39153f5) SHA1(5da9132a2c24a15b55c3f65c26e2ad0467411a88) )
/* sprites */
- ROM_REGION( 0x80000*8, "gfx2", ROMREGION_ERASE00 ) // 27C4096
- ROM_LOAD16_BYTE( "360ua-a02.21l", 0x000000, 0x80000, CRC(82207997) SHA1(fe143285a12fab5227e883113d798acad7bf4c97) )
- ROM_LOAD16_BYTE( "360ua-a03.23l", 0x000001, 0x80000, CRC(a9e36d51) SHA1(1a8de8d8d2abfee5ac0f0822e203846f7f5f1767) )
+ ROM_REGION( 0x200000, "sprites", ROMREGION_ERASE00 ) // 27C4096
+ ROM_LOAD64_WORD_SWAP( "360ua-a02.21l", 0x000000, 0x80000, CRC(82207997) SHA1(fe143285a12fab5227e883113d798acad7bf4c97) )
+ ROM_LOAD64_WORD_SWAP( "360ua-a03.23l", 0x000002, 0x80000, CRC(a9e36d51) SHA1(1a8de8d8d2abfee5ac0f0822e203846f7f5f1767) )
/* road generator */
- ROM_REGION( 0x080000, "k053250", ROMREGION_ERASE00 ) // 27C040
+ ROM_REGION( 0x080000, "lvc", ROMREGION_ERASE00 ) // 27C040
ROM_LOAD( "360ua-a05.26p", 0x000000, 0x80000, CRC(dab7f439) SHA1(2372612c0b04c77a85ccbadc100cb741b85f0481) )
/* sound data */
diff --git a/src/mame/drivers/qdrmfgp.cpp b/src/mame/drivers/qdrmfgp.cpp
index d71cdd035e0..2eca4b61f02 100644
--- a/src/mame/drivers/qdrmfgp.cpp
+++ b/src/mame/drivers/qdrmfgp.cpp
@@ -136,54 +136,6 @@ WRITE16_MEMBER(qdrmfgp_state::gp2_control_w)
}
}
-
-READ16_MEMBER(qdrmfgp_state::v_rom_r)
-{
- uint8_t *mem8 = memregion("gfx1")->base();
- int bank = m_k056832->word_r(space, 0x34/2, 0xffff);
-
- offset += bank * 0x800 * 4;
-
- if (m_control & 0x8000)
- offset += 0x800 * 2;
-
- return (mem8[offset + 1] << 8) + mem8[offset];
-}
-
-
-READ16_MEMBER(qdrmfgp_state::gp2_vram_r)
-{
- if (offset < 0x1000 / 2)
- return m_k056832->ram_word_r(space, offset * 2 + 1, mem_mask);
- else
- return m_k056832->ram_word_r(space, (offset - 0x1000 / 2) * 2, mem_mask);
-}
-
-READ16_MEMBER(qdrmfgp_state::gp2_vram_mirror_r)
-{
- if (offset < 0x1000 / 2)
- return m_k056832->ram_word_r(space, offset * 2, mem_mask);
- else
- return m_k056832->ram_word_r(space, (offset - 0x1000 / 2) * 2 + 1, mem_mask);
-}
-
-WRITE16_MEMBER(qdrmfgp_state::gp2_vram_w)
-{
- if (offset < 0x1000 / 2)
- m_k056832->ram_word_w(space, offset * 2 + 1, data, mem_mask);
- else
- m_k056832->ram_word_w(space, (offset - 0x1000 / 2) * 2, data, mem_mask);
-}
-
-WRITE16_MEMBER(qdrmfgp_state::gp2_vram_mirror_w)
-{
- if (offset < 0x1000 / 2)
- m_k056832->ram_word_w(space, offset * 2, data, mem_mask);
- else
- m_k056832->ram_word_w(space, (offset - 0x1000 / 2) * 2 + 1, data, mem_mask);
-}
-
-
/*************/
READ16_MEMBER(qdrmfgp_state::sndram_r)
@@ -306,8 +258,8 @@ static ADDRESS_MAP_START( qdrmfgp_map, AS_PROGRAM, 16, qdrmfgp_state )
AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_SHARE("workram") /* work ram */
AM_RANGE(0x180000, 0x183fff) AM_RAM AM_SHARE("nvram") /* backup ram */
AM_RANGE(0x280000, 0x280fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x300000, 0x30003f) AM_DEVWRITE("k056832", k056832_device, word_w) /* video reg */
- AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) /* ccu */
+ AM_RANGE(0x300000, 0x30003f) AM_DEVICE("tilemap", k054156_056832_device, vacset)
+ AM_RANGE(0x320000, 0x32001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
AM_RANGE(0x330000, 0x330001) AM_READ_PORT("SENSOR") /* battery power & service sw */
AM_RANGE(0x340000, 0x340001) AM_READ(inputs_r) /* inputport */
AM_RANGE(0x350000, 0x350001) AM_WRITENOP /* unknown */
@@ -315,9 +267,8 @@ static ADDRESS_MAP_START( qdrmfgp_map, AS_PROGRAM, 16, qdrmfgp_state )
AM_RANGE(0x370000, 0x370001) AM_WRITE(gp_control_w) /* control reg */
AM_RANGE(0x380000, 0x380001) AM_WRITENOP /* Watchdog */
AM_RANGE(0x800000, 0x80045f) AM_DEVREADWRITE8("k054539", k054539_device, read, write, 0x00ff) /* sound regs */
- AM_RANGE(0x880000, 0x881fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* vram */
- AM_RANGE(0x882000, 0x883fff) AM_DEVREADWRITE("k056832", k056832_device, ram_word_r, ram_word_w) /* vram (mirror) */
- AM_RANGE(0x900000, 0x901fff) AM_READ(v_rom_r) /* gfxrom through */
+ AM_RANGE(0x880000, 0x881fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("tilemap", k054156_056832_device, vram16_r, vram16_w)
+ AM_RANGE(0x900000, 0x901fff) AM_DEVREAD("tilemap", k054156_056832_device, rom16_r)
AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE("ata", ata_interface_device, read_cs0, write_cs0) /* IDE control regs */
AM_RANGE(0xa40000, 0xa4000f) AM_DEVREADWRITE("ata", ata_interface_device, read_cs1, write_cs1) /* IDE status control reg */
AM_RANGE(0xc00000, 0xcbffff) AM_READWRITE(sndram_r, sndram_w) /* sound ram */
@@ -329,8 +280,8 @@ static ADDRESS_MAP_START( qdrmfgp2_map, AS_PROGRAM, 16, qdrmfgp_state )
AM_RANGE(0x100000, 0x110fff) AM_RAM AM_SHARE("workram") /* work ram */
AM_RANGE(0x180000, 0x183fff) AM_RAM AM_SHARE("nvram") /* backup ram */
AM_RANGE(0x280000, 0x280fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x300000, 0x30003f) AM_DEVWRITE("k056832", k056832_device, word_w) /* video reg */
- AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0xff00) /* ccu */
+ AM_RANGE(0x300000, 0x30003f) AM_DEVICE("tilemap", k054156_056832_device, vacset)
+ AM_RANGE(0x320000, 0x32001f) AM_DEVICE8("video_timings", k053252_device, map, 0xff00)
AM_RANGE(0x330000, 0x330001) AM_READ_PORT("SENSOR") /* battery power & service */
AM_RANGE(0x340000, 0x340001) AM_READ(inputs_r) /* inputport */
AM_RANGE(0x350000, 0x350001) AM_WRITENOP /* unknown */
@@ -338,9 +289,9 @@ static ADDRESS_MAP_START( qdrmfgp2_map, AS_PROGRAM, 16, qdrmfgp_state )
AM_RANGE(0x370000, 0x370001) AM_WRITE(gp2_control_w) /* control reg */
AM_RANGE(0x380000, 0x380001) AM_WRITENOP /* Watchdog */
AM_RANGE(0x800000, 0x80045f) AM_DEVREADWRITE8("k054539", k054539_device, read, write, 0x00ff) /* sound regs */
- AM_RANGE(0x880000, 0x881fff) AM_READWRITE(gp2_vram_r, gp2_vram_w) /* vram */
- AM_RANGE(0x89f000, 0x8a0fff) AM_READWRITE(gp2_vram_mirror_r, gp2_vram_mirror_w) /* vram (mirror) */
- AM_RANGE(0x900000, 0x901fff) AM_READ(v_rom_r) /* gfxrom through */
+// AM_RANGE(0x880000, 0x881fff) AM_READWRITE(gp2_vram_r, gp2_vram_w) /* vram */
+// AM_RANGE(0x89f000, 0x8a0fff) AM_READWRITE(gp2_vram_mirror_r, gp2_vram_mirror_w) /* vram (mirror) */
+// AM_RANGE(0x900000, 0x901fff) AM_READ(v_rom_r) /* gfxrom through */
#if IDE_HACK
AM_RANGE(0xa00000, 0xa0000f) AM_READ(gp2_ide_std_r) AM_DEVWRITE("ata", ata_interface_device, write_cs0) /* IDE control regs */
#else
@@ -601,13 +552,12 @@ static MACHINE_CONFIG_START( qdrmfgp )
MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(qdrmfgp_state, qdrmfgp_tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
- MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4)
- MCFG_K053252_OFFSETS(40, 16)
+ MCFG_K054156_056832_ADD("tilemap", XTAL_32MHz/4, 8, 8, 24)
+
+ MCFG_DEVICE_ADD("video_timings", K053252, XTAL_32MHz/4)
+// MCFG_K053252_OFFSETS(40, 16)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -645,13 +595,12 @@ static MACHINE_CONFIG_START( qdrmfgp2 )
MCFG_VIDEO_START_OVERRIDE(qdrmfgp_state,qdrmfgp2)
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(qdrmfgp_state, qdrmfgp2_tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_4dj, 1, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
+
+ MCFG_K058143_056832_ADD("tilemap", XTAL_32MHz/4, 8, 8, 24)
- MCFG_DEVICE_ADD("k053252", K053252, XTAL_32MHz/4)
- MCFG_K053252_OFFSETS(40, 16)
+ MCFG_DEVICE_ADD("video_timings", K053252, XTAL_32MHz/4)
+// MCFG_K053252_OFFSETS(40, 16)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/rollerg.cpp b/src/mame/drivers/rollerg.cpp
index 18411cb6195..7c6ece48d8e 100644
--- a/src/mame/drivers/rollerg.cpp
+++ b/src/mame/drivers/rollerg.cpp
@@ -13,16 +13,86 @@
***************************************************************************/
#include "emu.h"
-#include "includes/rollerg.h"
-#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
+#include "cpu/z80/z80.h"
+#include "machine/k053252.h"
#include "machine/watchdog.h"
#include "sound/3812intf.h"
#include "sound/k053260.h"
+#include "video/k051316.h"
+#include "video/k053244_k053245.h"
+#include "video/konami_helper.h"
#include "speaker.h"
+class rollerg_state : public driver_device
+{
+public:
+ enum
+ {
+ TIMER_NMI
+ };
+
+ rollerg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_k053244(*this, "k053244"),
+ m_roz(*this, "roz"),
+ m_video_timings(*this, "video_timings")
+ { }
+
+ /* misc */
+ int m_readzoomroms;
+ emu_timer *m_nmi_timer;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k05324x_device> m_k053244;
+ required_device<k051316_device> m_roz;
+ required_device<k053252_device> m_video_timings;
+ DECLARE_WRITE8_MEMBER(rollerg_0010_w);
+ DECLARE_READ8_MEMBER(rollerg_k051316_r);
+ DECLARE_WRITE8_MEMBER(soundirq_w);
+ DECLARE_WRITE8_MEMBER(sound_arm_nmi_w);
+ DECLARE_READ8_MEMBER(pip_r);
+ DECLARE_WRITE_LINE_MEMBER(rollerg_irq_ack_w);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ uint32_t screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ K05324X_CB_MEMBER(sprite_callback);
+ DECLARE_WRITE8_MEMBER(banking_callback);
+
+protected:
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+};
+
+
+K05324X_CB_MEMBER(rollerg_state::sprite_callback)
+{
+ enum { sprite_colorbase = 256 / 16 };
+#if 0
+ if (machine().input().code_pressed(KEYCODE_Q) && (*color & 0x80)) *color = machine().rand();
+ if (machine().input().code_pressed(KEYCODE_W) && (*color & 0x40)) *color = machine().rand();
+ if (machine().input().code_pressed(KEYCODE_E) && (*color & 0x20)) *color = machine().rand();
+ if (machine().input().code_pressed(KEYCODE_R) && (*color & 0x10)) *color = machine().rand();
+#endif
+ *priority = (*color & 0x10) ? 0 : 0x02;
+ *color = sprite_colorbase + (*color & 0x0f);
+}
+
+uint32_t rollerg_state::screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ int bg_colorbase = 16;
+
+ screen.priority().fill(0, cliprect);
+ bitmap.fill(16 * bg_colorbase, cliprect);
+ // m_roz->zoom_draw(screen, bitmap, cliprect, 0, 1);
+ m_k053244->sprites_draw(bitmap, cliprect, screen.priority());
+ return 0;
+}
WRITE8_MEMBER(rollerg_state::rollerg_0010_w)
{
@@ -36,7 +106,7 @@ WRITE8_MEMBER(rollerg_state::rollerg_0010_w)
m_readzoomroms = data & 0x04;
/* bit 5 enables 051316 wraparound */
- m_k051316->wraparound_enable(data & 0x20);
+ m_roz->set_wrap(data & 0x20);
/* other bits unknown */
}
@@ -44,9 +114,9 @@ WRITE8_MEMBER(rollerg_state::rollerg_0010_w)
READ8_MEMBER(rollerg_state::rollerg_k051316_r)
{
if (m_readzoomroms)
- return m_k051316->rom_r(space, offset);
+ return m_roz->rom_r(space, offset);
else
- return m_k051316->read(space, offset);
+ return m_roz->vram_r(space, offset);
}
WRITE8_MEMBER(rollerg_state::soundirq_w)
@@ -88,10 +158,10 @@ static ADDRESS_MAP_START( rollerg_map, AS_PROGRAM, 8, rollerg_state )
AM_RANGE(0x0053, 0x0053) AM_READ_PORT("DSW1")
AM_RANGE(0x0060, 0x0060) AM_READ_PORT("DSW2")
AM_RANGE(0x0061, 0x0061) AM_READ(pip_r) /* ????? */
- AM_RANGE(0x0100, 0x010f) AM_DEVREADWRITE("k053252", k053252_device, read, write) /* 053252? */
- AM_RANGE(0x0200, 0x020f) AM_DEVWRITE("k051316", k051316_device, ctrl_w)
+ AM_RANGE(0x0100, 0x010f) AM_DEVICE("video_timings", k053252_device, map)
+ AM_RANGE(0x0200, 0x020f) AM_DEVICE("k051316", k051316_device, map)
AM_RANGE(0x0300, 0x030f) AM_DEVREADWRITE("k053244", k05324x_device, k053244_r, k053244_w)
- AM_RANGE(0x0800, 0x0fff) AM_READ(rollerg_k051316_r) AM_DEVWRITE("k051316", k051316_device, write)
+ AM_RANGE(0x0800, 0x0fff) AM_READ(rollerg_k051316_r) AM_DEVWRITE("k051316", k051316_device, vram_w)
AM_RANGE(0x1000, 0x17ff) AM_DEVREADWRITE("k053244", k05324x_device, k053245_r, k053245_w)
AM_RANGE(0x1800, 0x1fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x2000, 0x3aff) AM_RAM
@@ -273,14 +343,11 @@ static MACHINE_CONFIG_START( rollerg )
MCFG_K05324X_OFFSETS(-3, -1)
MCFG_K05324X_CB(rollerg_state, sprite_callback)
- MCFG_DEVICE_ADD("k051316", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(22, 1)
- MCFG_K051316_CB(rollerg_state, zoom_callback)
+ MCFG_K051316_ADD("roz", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x0fffff; color = (address & 0x300000) >> 16; })
- MCFG_DEVICE_ADD("k053252", K053252, 3000000*2)
- MCFG_K053252_INT1_ACK_CB(WRITELINE(rollerg_state,rollerg_irq_ack_w))
- MCFG_K053252_OFFSETS(14*8, 2*8)
+ MCFG_DEVICE_ADD("video_timings", K053252, 3000000*2)
+// MCFG_K053252_INT1_ACK_CB(WRITELINE(rollerg_state,rollerg_irq_ack_w))
+// MCFG_K053252_OFFSETS(14*8, 2*8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp
index 737defe7ff4..4edc3300b45 100644
--- a/src/mame/drivers/rungun.cpp
+++ b/src/mame/drivers/rungun.cpp
@@ -48,6 +48,53 @@
#include "rungun_dual.lh"
+/* TTL text plane stuff */
+TILE_GET_INFO_MEMBER(rungun_state::ttl_get_tile_info)
+{
+ uint32_t base_addr = (uintptr_t)tilemap.user_data();
+ uint8_t *lvram = (uint8_t *)m_ttl_vram.get() + base_addr;
+ int attr, code;
+
+ attr = (lvram[BYTE_XOR_LE(tile_index<<2)] & 0xf0) >> 4;
+ code = ((lvram[BYTE_XOR_LE(tile_index<<2)] & 0x0f) << 8) | (lvram[BYTE_XOR_LE((tile_index<<2)+2)]);
+
+ SET_TILE_INFO_MEMBER(m_ttl_gfx_index, code, attr, 0);
+}
+
+READ16_MEMBER(rungun_state::rng_ttl_ram_r)
+{
+ return m_ttl_vram[offset+(m_video_mux_bank*0x1000)];
+}
+
+WRITE16_MEMBER(rungun_state::rng_ttl_ram_w)
+{
+ COMBINE_DATA(&m_ttl_vram[offset+(m_video_mux_bank*0x1000)]);
+ m_ttl_tilemap[m_video_mux_bank]->mark_tile_dirty(offset / 2);
+}
+
+/* 53936 (PSAC2) rotation/zoom plane */
+READ16_MEMBER(rungun_state::rng_psac2_videoram_r)
+{
+ return m_psac2_vram[offset+(m_video_mux_bank*0x80000)];
+}
+
+WRITE16_MEMBER(rungun_state::rng_psac2_videoram_w)
+{
+ COMBINE_DATA(&m_psac2_vram[offset+(m_video_mux_bank*0x80000)]);
+ m_936_tilemap[m_video_mux_bank]->mark_tile_dirty(offset / 2);
+}
+
+TILE_GET_INFO_MEMBER(rungun_state::get_rng_936_tile_info)
+{
+ uint32_t base_addr = (uintptr_t)tilemap.user_data();
+ int tileno, colour, flipx;
+
+ tileno = m_psac2_vram[tile_index * 2 + 1 + base_addr] & 0x3fff;
+ flipx = (m_psac2_vram[tile_index * 2 + 1 + base_addr] & 0xc000) >> 14;
+ colour = 0x10 + (m_psac2_vram[tile_index * 2 + base_addr] & 0x000f);
+
+ SET_TILE_INFO_MEMBER(0, tileno, colour, TILE_FLIPYX(flipx));
+}
READ16_MEMBER(rungun_state::rng_sysregs_r)
{
@@ -126,7 +173,7 @@ WRITE16_MEMBER(rungun_state::rng_sysregs_w)
bit 3 : enable IRQ 5
bit 7-4: base address for 53936 ROM readback.
*/
- m_k055673->k053246_set_objcha_line((data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
+ m_sprites->set_objcha(data & 0x04);
m_roz_rombase = (data & 0xf0) >> 4;
break;
}
@@ -142,7 +189,6 @@ INTERRUPT_GEN_MEMBER(rungun_state::rng_interrupt)
{
// send to sprite device current state (i.e. bread & butter sprite DMA)
// TODO: firing this in screen update causes sprites to desync badly ...
- sprite_dma_trigger();
if (m_sysreg[0x0c / 2] & 0x09)
device.execute().set_input_line(M68K_IRQ_5, ASSERT_LINE);
@@ -182,13 +228,13 @@ static ADDRESS_MAP_START( rungun_map, AS_PROGRAM, 16, rungun_state )
AM_RANGE(0x380000, 0x39ffff) AM_RAM // work RAM
AM_RANGE(0x400000, 0x43ffff) AM_READ8(rng_53936_rom_r,0x00ff) // '936 ROM readback window
AM_RANGE(0x480000, 0x48001f) AM_READWRITE(rng_sysregs_r, rng_sysregs_w) AM_SHARE("sysreg")
- AM_RANGE(0x4c0000, 0x4c001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0x00ff) // CCU (for scanline and vblank polling)
+ AM_RANGE(0x4c0000, 0x4c001f) AM_DEVICE8("video_timings", k053252_device, map, 0x00ff)
AM_RANGE(0x540000, 0x540001) AM_WRITE(sound_irq_w)
- AM_RANGE(0x580000, 0x58001f) AM_DEVICE8("k054321", k054321_device, main_map, 0xff00)
- AM_RANGE(0x5c0000, 0x5c000f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r) // 246A ROM readback window
- AM_RANGE(0x5c0010, 0x5c001f) AM_DEVWRITE("k055673", k055673_device, k055673_reg_word_w)
+ AM_RANGE(0x580000, 0x58001f) AM_DEVICE8("soundctrl", k054321_device, main_map, 0xff00)
+ AM_RANGE(0x5c0000, 0x5c000f) AM_DEVREAD("sprites", k053246_055673_device, rom16_r) // 246A ROM readback window
+ AM_RANGE(0x5c0010, 0x5c001f) AM_DEVICE("sprites", k053246_055673_device, objset1)
AM_RANGE(0x600000, 0x601fff) AM_RAMBANK("spriteram_bank") // OBJ RAM
- AM_RANGE(0x640000, 0x640007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w) // '246A registers
+ AM_RANGE(0x640000, 0x640007) AM_DEVICE("sprites", k053246_055673_device, objset2) // '246A registers
AM_RANGE(0x680000, 0x68001f) AM_DEVWRITE("k053936", k053936_device, ctrl_w) // '936 registers
AM_RANGE(0x6c0000, 0x6cffff) AM_READWRITE(rng_psac2_videoram_r,rng_psac2_videoram_w) // PSAC2 ('936) RAM (34v + 35v)
AM_RANGE(0x700000, 0x7007ff) AM_DEVREADWRITE("k053936", k053936_device, linectrl_r, linectrl_w) // PSAC "Line RAM"
@@ -244,7 +290,7 @@ static ADDRESS_MAP_START( rungun_sound_map, AS_PROGRAM, 8, rungun_state )
AM_RANGE(0xe230, 0xe3ff) AM_RAM
AM_RANGE(0xe400, 0xe62f) AM_DEVREADWRITE("k054539_2", k054539_device, read, write)
AM_RANGE(0xe630, 0xe7ff) AM_RAM
- AM_RANGE(0xf000, 0xf003) AM_DEVICE("k054321", k054321_device, sound_map)
+ AM_RANGE(0xf000, 0xf003) AM_DEVICE("soundctrl", k054321_device, sound_map)
AM_RANGE(0xf800, 0xf800) AM_WRITE(sound_ctrl_w)
AM_RANGE(0xfff0, 0xfff3) AM_WRITENOP
ADDRESS_MAP_END
@@ -407,7 +453,7 @@ static MACHINE_CONFIG_START( rng )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(88, 88+416-1, 24, 24+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(rungun_state, screen_update_rng)
+// MCFG_SCREEN_UPDATE_DRIVER(rungun_state, screen_update_rng)
MCFG_SCREEN_PALETTE("palette")
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
@@ -419,14 +465,10 @@ static MACHINE_CONFIG_START( rng )
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_OFFSETS(34, 9)
- MCFG_DEVICE_ADD("k055673", K055673, 0)
- MCFG_K055673_CB(rungun_state, sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_RNG, -8, 15)
- MCFG_K055673_PALETTE("palette")
- MCFG_K055673_SET_SCREEN("screen")
+ MCFG_K053246_055673_ADD("sprites", 8000000, "spriteram")
- MCFG_DEVICE_ADD("k053252", K053252, 16000000/2)
- MCFG_K053252_OFFSETS(9*8, 24)
+ MCFG_DEVICE_ADD("video_timings", K053252, 16000000/2)
+// MCFG_K053252_OFFSETS(9*8, 24)
MCFG_VIDEO_SET_SCREEN("screen")
MCFG_PALETTE_ADD("palette2", 1024)
@@ -437,7 +479,7 @@ static MACHINE_CONFIG_START( rng )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
- MCFG_K054321_ADD("k054321", ":lspeaker", ":rspeaker")
+ MCFG_K054321_ADD("soundctrl", ":lspeaker", ":rspeaker")
MCFG_DEVICE_ADD("k054539_1", K054539, XTAL_18_432MHz)
MCFG_K054539_REGION_OVERRRIDE("shared")
@@ -456,7 +498,7 @@ MACHINE_CONFIG_END
// screen only gets an update every other frame.
static MACHINE_CONFIG_DERIVED( rng_dual, rng )
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(rungun_state, screen_update_rng_dual_left)
+// MCFG_SCREEN_UPDATE_DRIVER(rungun_state, screen_update_rng_dual_left)
MCFG_SCREEN_ADD("demultiplex2", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
@@ -464,12 +506,12 @@ static MACHINE_CONFIG_DERIVED( rng_dual, rng )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(88, 88+416-1, 24, 24+224-1)
- MCFG_SCREEN_UPDATE_DRIVER(rungun_state, screen_update_rng_dual_right)
+// MCFG_SCREEN_UPDATE_DRIVER(rungun_state, screen_update_rng_dual_right)
MCFG_SCREEN_PALETTE("palette2")
- MCFG_DEVICE_MODIFY("k053252")
- MCFG_K053252_SET_SLAVE_SCREEN("demultiplex2")
+ MCFG_DEVICE_MODIFY("video_timings")
+// MCFG_K053252_SET_SLAVE_SCREEN("demultiplex2")
MACHINE_CONFIG_END
@@ -499,7 +541,7 @@ ROM_START( rungun )
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -541,7 +583,7 @@ ROM_START( rungund ) // same as above set, but with demux adapter connected
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -583,7 +625,7 @@ ROM_START( runguna )
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -626,7 +668,7 @@ ROM_START( rungunad ) // same as above set, but with demux adapter connected
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -673,7 +715,7 @@ ROM_START( rungunb )
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -716,7 +758,7 @@ ROM_START( rungunbd ) // same as above set, but with demux adapter connected
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -757,7 +799,7 @@ ROM_START( rungunua )
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -799,7 +841,7 @@ ROM_START( rungunuad ) // same as above set, but with demux adapter connected
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -841,7 +883,7 @@ ROM_START( slmdunkj )
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -883,7 +925,7 @@ ROM_START( slmdunkjd ) // same as above set, but with demux adapter connected
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
@@ -924,7 +966,7 @@ ROM_START( rungunud ) // dual cabinet setup ONLY
ROM_LOAD( "247a13", 0x000000, 0x200000, CRC(c5a8ef29) SHA1(23938b8093bc0b9eef91f6d38127ca7acbdc06a6) )
/* sprites */
- ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_REGION( 0x800000, "sprites", 0)
ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp
index 52fbcf9506b..a197c37839b 100644
--- a/src/mame/drivers/simpsons.cpp
+++ b/src/mame/drivers/simpsons.cpp
@@ -123,13 +123,13 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, simpsons_state )
AM_RANGE(0x1f91, 0x1f91) AM_READ_PORT("P2")
AM_RANGE(0x1f92, 0x1f92) AM_READ_PORT("P3")
AM_RANGE(0x1f93, 0x1f93) AM_READ_PORT("P4")
- AM_RANGE(0x1fa0, 0x1fa7) AM_DEVWRITE("k053246", k053247_device, k053246_w)
- AM_RANGE(0x1fb0, 0x1fbf) AM_DEVWRITE("k053251", k053251_device, write)
+ AM_RANGE(0x1fa0, 0x1fa7) AM_DEVICE("sprites", k053246_053247_device, objset1_8)
+ AM_RANGE(0x1fb0, 0x1fbf) AM_DEVICE("mixer", k053251_device, map)
AM_RANGE(0x1fc0, 0x1fc0) AM_WRITE(simpsons_coin_counter_w)
AM_RANGE(0x1fc2, 0x1fc2) AM_WRITE(simpsons_eeprom_w)
AM_RANGE(0x1fc4, 0x1fc4) AM_READ(simpsons_sound_interrupt_r)
AM_RANGE(0x1fc6, 0x1fc7) AM_DEVREADWRITE("k053260", k053260_device, main_read, main_write)
- AM_RANGE(0x1fc8, 0x1fc9) AM_DEVREAD("k053246", k053247_device, k053246_r)
+ AM_RANGE(0x1fc8, 0x1fc9) AM_DEVREAD("sprites", k053246_053247_device, rom8_r)
AM_RANGE(0x1fca, 0x1fca) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE("k052109", k052109_device, read, write)
AM_RANGE(0x2000, 0x3fff) AM_DEVICE("bank2000", address_map_bank_device, amap8)
@@ -145,7 +145,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bank2000_map, AS_PROGRAM, 8, simpsons_state )
AM_RANGE(0x0000, 0x1fff) AM_READWRITE(simpsons_k052109_r, simpsons_k052109_w)
- AM_RANGE(0x2000, 0x2fff) AM_READWRITE(simpsons_k053247_r, simpsons_k053247_w)
+ AM_RANGE(0x2000, 0x2fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x3000, 0x3fff) AM_RAM
ADDRESS_MAP_END
@@ -162,6 +162,27 @@ void simpsons_state::sound_nmi_callback( int param )
}
#endif
+K052109_CB_MEMBER(simpsons_state::tile_callback)
+{
+ *code |= ((*color & 0x3f) << 8) | (bank << 14);
+ *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6);
+}
+
+READ8_MEMBER(simpsons_state::simpsons_k052109_r)
+{
+ return m_k052109->read(space, offset + 0x2000);
+}
+
+WRITE8_MEMBER(simpsons_state::simpsons_k052109_w)
+{
+ m_k052109->write(space, offset + 0x2000, data);
+}
+
+void simpsons_state::simpsons_video_banking( int bank )
+{
+ m_bank0000->set_bank(bank & 1);
+ m_bank2000->set_bank((bank >> 1) & 1);
+}
void simpsons_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
@@ -280,39 +301,8 @@ INPUT_PORTS_END
***************************************************************************/
-void simpsons_state::simpsons_objdma( )
-{
- int counter, num_inactive;
- uint16_t *src, *dst;
-
- m_k053246->k053247_get_ram(&dst);
-
- src = m_spriteram.get();
- num_inactive = counter = 256;
-
- do {
- if ((*src & 0x8000) && (*src & 0xff))
- {
- memcpy(dst, src, 0x10);
- dst += 8;
- num_inactive--;
- }
- src += 8;
- }
- while (--counter);
-
- if (num_inactive) do { *dst = 0; dst += 8; } while (--num_inactive);
-}
-
INTERRUPT_GEN_MEMBER(simpsons_state::simpsons_irq)
{
- if (m_k053246->k053246_is_irq_enabled())
- {
- simpsons_objdma();
- // 32+256us delay at 8MHz dotclock; artificially shortened since actual V-blank length is unknown
- timer_set(attotime::from_usec(30), TIMER_DMAEND);
- }
-
if (m_k052109->is_irq_enabled())
device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
}
@@ -352,7 +342,6 @@ static MACHINE_CONFIG_START( simpsons )
// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
// MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_UPDATE_DRIVER(simpsons_state, screen_update_simpsons)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 2048)
@@ -364,12 +353,9 @@ static MACHINE_CONFIG_START( simpsons )
MCFG_GFX_PALETTE("palette")
MCFG_K052109_CB(simpsons_state, tile_callback)
- MCFG_DEVICE_ADD("k053246", K053246, 0)
- MCFG_K053246_CB(simpsons_state, sprite_callback)
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, 23)
- MCFG_K053246_PALETTE("palette")
+ MCFG_K053246_053247_ADD("sprites", 6000000, "spriteram")
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", k053251_device::LAYER1_ATTR)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/surpratk.cpp b/src/mame/drivers/surpratk.cpp
index d9bbb1f316a..0860bf1ad52 100644
--- a/src/mame/drivers/surpratk.cpp
+++ b/src/mame/drivers/surpratk.cpp
@@ -68,7 +68,7 @@ static ADDRESS_MAP_START( surpratk_map, AS_PROGRAM, 8, surpratk_state )
AM_RANGE(0x5f8f, 0x5f8f) AM_READ_PORT("DSW1")
AM_RANGE(0x5f90, 0x5f90) AM_READ_PORT("DSW2")
AM_RANGE(0x5fa0, 0x5faf) AM_DEVREADWRITE("k053244", k05324x_device, k053244_r, k053244_w)
- AM_RANGE(0x5fb0, 0x5fbf) AM_DEVWRITE("k053251", k053251_device, write)
+ AM_RANGE(0x5fb0, 0x5fbf) AM_DEVICE("k053251", k053251_device, map)
AM_RANGE(0x5fc0, 0x5fc0) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r) AM_WRITE(surpratk_5fc0_w)
AM_RANGE(0x5fd0, 0x5fd1) AM_DEVWRITE("ymsnd", ym2151_device, write)
AM_RANGE(0x5fc4, 0x5fc4) AM_WRITE(surpratk_videobank_w)
@@ -205,7 +205,7 @@ static MACHINE_CONFIG_START( surpratk )
MCFG_K05324X_OFFSETS(0, 0)
MCFG_K05324X_CB(surpratk_state, sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/tail2nos.cpp b/src/mame/drivers/tail2nos.cpp
index d6f6753ae2d..89aae4c9e7f 100644
--- a/src/mame/drivers/tail2nos.cpp
+++ b/src/mame/drivers/tail2nos.cpp
@@ -15,14 +15,212 @@
***************************************************************************/
#include "emu.h"
-#include "includes/tail2nos.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "sound/2608intf.h"
-#include "video/vsystem_gga.h"
+#include "machine/gen_latch.h"
#include "screen.h"
+#include "sound/2608intf.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/vsystem_gga.h"
+
+class tail2nos_state : public driver_device
+{
+public:
+ tail2nos_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_txvideoram(*this, "txvideoram"),
+ m_spriteram(*this, "spriteram"),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_roz(*this, "roz"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
+ m_soundlatch(*this, "soundlatch") { }
+
+ /* memory pointers */
+ required_shared_ptr<uint16_t> m_txvideoram;
+ required_shared_ptr<uint16_t> m_spriteram;
+
+ /* video-related */
+ tilemap_t *m_tx_tilemap;
+ int m_txbank;
+ int m_txpalette;
+ bool m_video_enable;
+ bool m_flip_screen;
+ uint8_t m_pending_command;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k051316_device> m_roz;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
+
+ DECLARE_CUSTOM_INPUT_MEMBER(analog_in_r);
+ DECLARE_WRITE16_MEMBER(tail2nos_txvideoram_w);
+ DECLARE_WRITE8_MEMBER(tail2nos_gfxbank_w);
+ DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
+ DECLARE_READ8_MEMBER(sound_semaphore_r);
+ TILE_GET_INFO_MEMBER(get_tile_info);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+ uint32_t screen_update_tail2nos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void tail2nos_postload();
+ void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
+};
+
+#define TOTAL_CHARS 0x400
+
+/***************************************************************************
+
+ Callbacks for the TileMap code
+
+***************************************************************************/
+
+TILE_GET_INFO_MEMBER(tail2nos_state::get_tile_info)
+{
+ uint16_t code = m_txvideoram[tile_index];
+ SET_TILE_INFO_MEMBER(0,
+ (code & 0x1fff) + (m_txbank << 13),
+ ((code & 0xe000) >> 13) + m_txpalette * 16,
+ 0);
+}
+
+
+/***************************************************************************
+
+ Start the video hardware emulation.
+
+***************************************************************************/
+
+void tail2nos_state::tail2nos_postload()
+{
+ m_tx_tilemap->mark_all_dirty();
+}
+
+void tail2nos_state::video_start()
+{
+ m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tail2nos_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
+
+ m_tx_tilemap->set_transparent_pen(15);
+
+ machine().save().register_postload(save_prepost_delegate(FUNC(tail2nos_state::tail2nos_postload), this));
+}
+
+
+
+/***************************************************************************
+
+ Memory handlers
+
+***************************************************************************/
+
+WRITE16_MEMBER(tail2nos_state::tail2nos_txvideoram_w)
+{
+ COMBINE_DATA(&m_txvideoram[offset]);
+ m_tx_tilemap->mark_tile_dirty(offset);
+}
+
+WRITE8_MEMBER(tail2nos_state::tail2nos_gfxbank_w)
+{
+ // -------- --pe-b-b
+ // p = palette bank
+ // b = tile bank
+ // e = video enable
+
+ // bits 0 and 2 select char bank
+ int bank = 0;
+ if (data & 0x04) bank |= 2;
+ if (data & 0x01) bank |= 1;
+
+ if (m_txbank != bank)
+ {
+ m_txbank = bank;
+ m_tx_tilemap->mark_all_dirty();
+ }
+
+ // bit 5 seems to select palette bank (used on startup)
+ if (data & 0x20)
+ bank = 7;
+ else
+ bank = 3;
+
+ if (m_txpalette != bank)
+ {
+ m_txpalette = bank;
+ m_tx_tilemap->mark_all_dirty();
+ }
+
+ // bit 4 seems to be video enable
+ m_video_enable = BIT(data, 4);
+
+ // bit 7 is flip screen
+ m_flip_screen = BIT(data, 7);
+ m_tx_tilemap->set_flip(m_flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ m_tx_tilemap->set_scrolly(m_flip_screen ? -8 : 0);
+}
+
+
+/***************************************************************************
+
+ Display Refresh
+
+***************************************************************************/
+
+void tail2nos_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
+{
+ uint16_t *spriteram = m_spriteram;
+ int offs;
+
+
+ for (offs = 0; offs < m_spriteram.bytes() / 2; offs += 4)
+ {
+ int sx, sy, flipx, flipy, code, color;
+
+ sx = spriteram[offs + 1];
+ if (sx >= 0x8000)
+ sx -= 0x10000;
+ sy = 0x10000 - spriteram[offs + 0];
+ if (sy >= 0x8000)
+ sy -= 0x10000;
+ code = spriteram[offs + 2] & 0x07ff;
+ color = (spriteram[offs + 2] & 0xe000) >> 13;
+ flipx = spriteram[offs + 2] & 0x1000;
+ flipy = spriteram[offs + 2] & 0x0800;
+ if (m_flip_screen)
+ {
+ flipx = !flipx;
+ flipy = !flipy;
+ sx = 302 - sx;
+ sy = 216 - sy;
+ }
+
+ m_gfxdecode->gfx(1)->transpen(bitmap,/* placement relative to zoom layer verified on the real thing */
+ cliprect,
+ code,
+ 40 + color,
+ flipx,flipy,
+ sx+3,sy+1,15);
+ }
+}
+
+uint32_t tail2nos_state::screen_update_tail2nos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ if (m_video_enable)
+ {
+ // m_k051316->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
+ draw_sprites(bitmap, cliprect);
+ m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+ }
+ else
+ bitmap.fill(0, cliprect);
+
+ return 0;
+}
READ8_MEMBER(tail2nos_state::sound_semaphore_r)
@@ -39,9 +237,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, tail2nos_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("user1", 0) /* extra ROM */
AM_RANGE(0x2c0000, 0x2dffff) AM_ROM AM_REGION("user2", 0)
- AM_RANGE(0x400000, 0x41ffff) AM_RAM_WRITE(tail2nos_zoomdata_w) AM_SHARE("k051316")
- AM_RANGE(0x500000, 0x500fff) AM_DEVREADWRITE8("k051316", k051316_device, read, write, 0x00ff)
- AM_RANGE(0x510000, 0x51001f) AM_DEVWRITE8("k051316", k051316_device, ctrl_w, 0x00ff)
+ AM_RANGE(0x400000, 0x41ffff) AM_RAM AM_SHARE("zoom")
+ AM_RANGE(0x500000, 0x500fff) AM_DEVREADWRITE8("k051316", k051316_device, vram_r, vram_w, 0x00ff)
+ AM_RANGE(0x510000, 0x51001f) AM_DEVICE8("k051316", k051316_device, map, 0x00ff)
AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* work RAM */
AM_RANGE(0xffc000, 0xffc2ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xffc300, 0xffcfff) AM_RAM
@@ -259,12 +457,8 @@ static MACHINE_CONFIG_START( tail2nos )
MCFG_PALETTE_ADD("palette", 2048)
MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
- MCFG_DEVICE_ADD("k051316", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_BPP(-4)
- MCFG_K051316_OFFSETS(-89, -14)
+ MCFG_K051316_ADD("roz", 4, true, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = (address & 0x380000) >> 15; })
MCFG_K051316_WRAP(1)
- MCFG_K051316_CB(tail2nos_state, zoom_callback)
MCFG_DEVICE_ADD("gga", VSYSTEM_GGA, 0)
diff --git a/src/mame/drivers/tasman.cpp b/src/mame/drivers/tasman.cpp
index 4f1dc486140..ad44df5f854 100644
--- a/src/mame/drivers/tasman.cpp
+++ b/src/mame/drivers/tasman.cpp
@@ -53,9 +53,9 @@ public:
required_device<cpu_device> m_maincpu;
required_device<k053252_device> m_k053252;
- required_device<k055673_device> m_k055673;
+ required_device<k053246_055673_device> m_k055673;
required_device<k055555_device> m_k055555;
- required_device<k056832_device> m_k056832;
+ required_device<k058143_056832_device> m_k056832;
#if CUSTOM_DRAW
required_device<gfxdecode_device> m_gfxdecode;
#endif
@@ -74,16 +74,13 @@ public:
virtual void machine_reset() override { m_irq_mask = 0; };
uint32_t screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- WRITE_LINE_MEMBER(vblank_irq_ack_w);
- WRITE_LINE_MEMBER(hblank_irq_ack_w);
TIMER_DEVICE_CALLBACK_MEMBER(kongambl_vblank);
- K056832_CB_MEMBER(tile_callback);
- K053246_CB_MEMBER(sprite_callback);
};
VIDEO_START_MEMBER(kongambl_state,kongambl)
{
+#if 0
#if CUSTOM_DRAW
#else
@@ -93,10 +90,12 @@ VIDEO_START_MEMBER(kongambl_state,kongambl)
m_k056832->set_layer_offs(2, 4, 0);
m_k056832->set_layer_offs(3, 6, 0);
#endif
+#endif
}
uint32_t kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
+#if 0
#if CUSTOM_DRAW
gfx_element *gfx = m_gfxdecode->gfx(0);
uint32_t count;
@@ -141,6 +140,7 @@ uint32_t kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_in
m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0);
m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
#endif
+#endif
return 0;
}
@@ -219,9 +219,9 @@ static ADDRESS_MAP_START( kongambl_map, AS_PROGRAM, 32, kongambl_state )
//0x400000 0x400001 "13M" even addresses
//0x400002,0x400003 "13J" odd addresses
- AM_RANGE(0x400000, 0x401fff) AM_DEVREAD("k056832", k056832_device, rom_long_r)
- AM_RANGE(0x420000, 0x43ffff) AM_DEVREADWRITE("k056832", k056832_device, unpaged_ram_long_r, unpaged_ram_long_w)
- AM_RANGE(0x480000, 0x48003f) AM_DEVWRITE("k056832", k056832_device, long_w)
+ AM_RANGE(0x400000, 0x401fff) AM_DEVREAD("tilemap", k058143_056832_device, rom32_r)
+ AM_RANGE(0x420000, 0x43ffff) AM_DEVREADWRITE("tilemap", k058143_056832_device, vram32_r, vram32_w)
+ AM_RANGE(0x480000, 0x48003f) AM_DEVICE16("tilemap", k058143_056832_device, vacset, 0xffffffff)
@@ -229,15 +229,15 @@ static ADDRESS_MAP_START( kongambl_map, AS_PROGRAM, 32, kongambl_state )
AM_RANGE(0x460000, 0x47ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x4b0000, 0x4b001f) AM_DEVREADWRITE8("k053252", k053252_device, read, write, 0xff00ff00)
+ AM_RANGE(0x4b0000, 0x4b001f) AM_DEVICE8("video_timings", k053252_device, map, 0xff00ff00)
- AM_RANGE(0x4c0000, 0x4c0007) AM_DEVWRITE16("k055673", k055673_device, k053246_word_w, 0xffffffff)
+ AM_RANGE(0x4c0000, 0x4c0007) AM_DEVICE16("sprites", k053246_055673_device, objset1, 0xffffffff)
//AM_RANGE(0x4c4000, 0x4c4003) AM_WRITENOP
//AM_RANGE(0x4c4004, 0x4c4007) AM_WRITENOP
//AM_RANGE(0x4c801c, 0x4c801f) AM_WRITENOP
//AM_RANGE(0x4cc01c, 0x4cc01f) AM_WRITENOP
- AM_RANGE(0x4cc000, 0x4cc00f) AM_DEVREAD16("k055673", k055673_device, k055673_rom_word_r, 0xffffffff)
+ AM_RANGE(0x4cc000, 0x4cc00f) AM_DEVREAD("sprites", k053246_055673_device, rom32_r)
AM_RANGE(0x4d0000, 0x4d0003) AM_WRITE8(kongambl_ff_w,0xff000000)
@@ -578,15 +578,6 @@ static INPUT_PORTS_START( kongambl )
INPUT_PORTS_END
-K053246_CB_MEMBER(kongambl_state::sprite_callback)
-{
-}
-
-K056832_CB_MEMBER(kongambl_state::tile_callback)
-{
-}
-
-
static const gfx_layout charlayout8_tasman =
{
8,8,
@@ -604,16 +595,6 @@ static GFXDECODE_START( tasman )
GFXDECODE_END
-WRITE_LINE_MEMBER(kongambl_state::vblank_irq_ack_w)
-{
- m_maincpu->set_input_line(1, CLEAR_LINE);
-}
-
-WRITE_LINE_MEMBER(kongambl_state::hblank_irq_ack_w)
-{
- m_maincpu->set_input_line(2, CLEAR_LINE);
-}
-
TIMER_DEVICE_CALLBACK_MEMBER(kongambl_state::kongambl_vblank)
{
int scanline = param;
@@ -642,10 +623,10 @@ static MACHINE_CONFIG_START( kongambl )
MCFG_CPU_PROGRAM_MAP(kongamaud_map)
MCFG_CPU_PERIODIC_INT_DRIVER(kongambl_state, irq2_line_hold, 480)
- MCFG_DEVICE_ADD("k053252", K053252, 25000000)
- MCFG_K053252_OFFSETS(0, 16) // TBD
- MCFG_K053252_INT1_ACK_CB(WRITELINE(kongambl_state, vblank_irq_ack_w))
- MCFG_K053252_INT2_ACK_CB(WRITELINE(kongambl_state, hblank_irq_ack_w))
+ MCFG_DEVICE_ADD("video_timings", K053252, 25000000)
+// MCFG_K053252_OFFSETS(0, 16) // TBD
+// MCFG_K053252_INT1_ACK_CB(WRITELINE(konamigx_state, vblank_irq_ack_w))
+// MCFG_K053252_INT2_ACK_CB(WRITELINE(konamigx_state, hblank_irq_ack_w))
MCFG_VIDEO_SET_SCREEN("screen")
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -660,21 +641,15 @@ static MACHINE_CONFIG_START( kongambl )
MCFG_VIDEO_START_OVERRIDE(kongambl_state,kongambl)
- MCFG_K055555_ADD("k055555")
+ MCFG_K055555_ADD("mixer")
- MCFG_DEVICE_ADD("k055673", K055673, 0)
- MCFG_K055673_CB(kongambl_state, sprite_callback)
- MCFG_K055673_CONFIG("gfx2", K055673_LAYOUT_LE2, -48+1, -23)
- MCFG_K055673_PALETTE("palette")
+ MCFG_K053246_055673_ADD("sprites", 6000000, "spriteram")
#if CUSTOM_DRAW
MCFG_GFXDECODE_ADD("gfxdecode", "palette", tasman)
#endif
- MCFG_DEVICE_ADD("k056832", K056832, 0)
- MCFG_K056832_CB(kongambl_state, tile_callback)
- MCFG_K056832_CONFIG("gfx1", K056832_BPP_8TASMAN, 0, 0, "none")
- MCFG_K056832_PALETTE("palette")
+ MCFG_K058143_056832_ADD("tilemap", 12000000, 8, 8, 24)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp
index e351f646682..8faa9c5a84b 100644
--- a/src/mame/drivers/tmnt.cpp
+++ b/src/mame/drivers/tmnt.cpp
@@ -542,7 +542,7 @@ static ADDRESS_MAP_START( punkshot_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0006, 0x0a0007) AM_READ_PORT("P1/P2")
AM_RANGE(0x0a0020, 0x0a0021) AM_WRITE(punkshot_0a0020_w)
AM_RANGE(0x0a0040, 0x0a0043) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
- AM_RANGE(0x0a0060, 0x0a007f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x0a0060, 0x0a007f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x0a0080, 0x0a0081) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x100000, 0x107fff) AM_READWRITE(k052109_word_noA12_r, punkshot_k052109_word_noA12_w)
AM_RANGE(0x110000, 0x110007) AM_DEVREADWRITE8("k051960", k051960_device, k051937_r, k051937_w, 0xffff)
@@ -565,7 +565,7 @@ static ADDRESS_MAP_START( lgtnfght_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0028, 0x0a0029) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
AM_RANGE(0x0b0000, 0x0b3fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_SHARE("spriteram")
AM_RANGE(0x0c0000, 0x0c001f) AM_READWRITE(k053244_word_noA1_r, k053244_word_noA1_w)
- AM_RANGE(0x0e0000, 0x0e001f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x0e0000, 0x0e001f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x100000, 0x107fff) AM_READWRITE(k052109_word_noA12_r, k052109_word_noA12_w)
ADDRESS_MAP_END
@@ -592,30 +592,9 @@ static ADDRESS_MAP_START( blswhstl_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x700400, 0x700401) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0x780600, 0x780603) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x780604, 0x780605) AM_WRITE(ssriders_soundkludge_w)
- AM_RANGE(0x780700, 0x78071f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x780700, 0x78071f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
ADDRESS_MAP_END
-WRITE16_MEMBER(tmnt_state::k053251_glfgreat_w)
-{
- int i;
-
- if (ACCESSING_BITS_8_15)
- {
- m_k053251->write(space, offset, (data >> 8) & 0xff);
-
- /* FIXME: in the old code k052109 tilemaps were tilemaps 2,3,4 for k053251
- and got marked as dirty in the write above... how was the original hardware working?!? */
- for (i = 0; i < 3; i++)
- {
- if (m_k053251->get_tmap_dirty(2 + i))
- {
- m_k052109->tilemap_mark_dirty(i);
- m_k053251->set_tmap_dirty(2 + i, 0);
- }
- }
- }
-}
-
static ADDRESS_MAP_START( glfgreat_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */
@@ -625,8 +604,7 @@ static ADDRESS_MAP_START( glfgreat_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x110000, 0x11001f) AM_WRITE(k053244_word_noA1_w) /* duplicate! */
AM_RANGE(0x114000, 0x11401f) AM_DEVREADWRITE("k053245", k05324x_device, k053244_lsb_r, k053244_lsb_w) /* duplicate! */
AM_RANGE(0x118000, 0x11801f) AM_DEVWRITE("k053936", k053936_device, ctrl_w)
- AM_RANGE(0x11c000, 0x11c01f) AM_DEVWRITE("k053251", k053251_device, msb_w)
- AM_RANGE(0x11c000, 0x11c01f) AM_WRITE(k053251_glfgreat_w)
+ AM_RANGE(0x11c000, 0x11c01f) AM_DEVICE8("mixer", k053251_device, map, 0xff00)
AM_RANGE(0x120000, 0x120001) AM_READ_PORT("P1/P2")
AM_RANGE(0x120002, 0x120003) AM_READ_PORT("P3/P4")
AM_RANGE(0x120004, 0x120005) AM_READ_PORT("COINS/DSW3")
@@ -648,8 +626,7 @@ static ADDRESS_MAP_START( prmrsocr_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x110000, 0x11001f) AM_WRITE(k053244_word_noA1_w) /* duplicate! */
AM_RANGE(0x114000, 0x11401f) AM_DEVREADWRITE("k053245", k05324x_device, k053244_lsb_r, k053244_lsb_w) /* duplicate! */
AM_RANGE(0x118000, 0x11801f) AM_DEVWRITE("k053936", k053936_device, ctrl_w)
- AM_RANGE(0x11c000, 0x11c01f) AM_DEVWRITE("k053251", k053251_device, msb_w)
- AM_RANGE(0x11c000, 0x11c01f) AM_WRITE(k053251_glfgreat_w)
+ AM_RANGE(0x11c000, 0x11c01f) AM_DEVICE8("mixer", k053251_device, map, 0xff00)
AM_RANGE(0x120000, 0x120001) AM_READ_PORT("P1/COINS")
AM_RANGE(0x120002, 0x120003) AM_READ_PORT("P2/EEPROM")
AM_RANGE(0x12100c, 0x12100d) AM_DEVWRITE8("soundlatch", generic_latch_8_device, write, 0x00ff)
@@ -919,7 +896,7 @@ static ADDRESS_MAP_START( tmnt2_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x5a0000, 0x5a001f) AM_READWRITE(k053244_word_noA1_r, k053244_word_noA1_w)
AM_RANGE(0x5c0600, 0x5c0603) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x5c0604, 0x5c0605) AM_WRITE(ssriders_soundkludge_w)
- AM_RANGE(0x5c0700, 0x5c071f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x5c0700, 0x5c071f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x600000, 0x603fff) AM_DEVREADWRITE("k052109", k052109_device, word_r, word_w)
ADDRESS_MAP_END
@@ -943,7 +920,7 @@ static ADDRESS_MAP_START( ssriders_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x5a0000, 0x5a001f) AM_READWRITE(k053244_word_noA1_r, k053244_word_noA1_w)
AM_RANGE(0x5c0600, 0x5c0603) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x5c0604, 0x5c0605) AM_WRITE(ssriders_soundkludge_w)
- AM_RANGE(0x5c0700, 0x5c071f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x5c0700, 0x5c071f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x600000, 0x603fff) AM_DEVREADWRITE("k052109", k052109_device, word_r, word_w)
ADDRESS_MAP_END
@@ -951,7 +928,7 @@ static ADDRESS_MAP_START( sunsetbl_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x000000, 0x0bffff) AM_ROM
AM_RANGE(0x104000, 0x107fff) AM_RAM /* main RAM */
AM_RANGE(0x14c000, 0x14cfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x14e700, 0x14e71f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x14e700, 0x14e71f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x180000, 0x183fff) AM_READWRITE(k053245_scattered_word_r, k053245_scattered_word_w) AM_SHARE("spriteram")
AM_RANGE(0x184000, 0x18ffff) AM_RAM
AM_RANGE(0x1c0300, 0x1c0301) AM_WRITE(ssriders_1c0300_w)
@@ -977,7 +954,7 @@ static ADDRESS_MAP_START( thndrx2_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x100000, 0x103fff) AM_RAM /* main RAM */
AM_RANGE(0x200000, 0x200fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x300000, 0x30001f) AM_DEVWRITE("k053251", k053251_device, lsb_w)
+ AM_RANGE(0x300000, 0x30001f) AM_DEVICE8("mixer", k053251_device, map, 0x00ff)
AM_RANGE(0x400000, 0x400003) AM_DEVREADWRITE8("k053260", k053260_device, main_read, main_write, 0x00ff)
AM_RANGE(0x500000, 0x50003f) AM_DEVREADWRITE("k054000", k054000_device, lsb_r, lsb_w)
AM_RANGE(0x500100, 0x500101) AM_WRITE(thndrx2_eeprom_w)
@@ -2116,7 +2093,7 @@ static MACHINE_CONFIG_START( punkshot )
MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(tmnt_state, punkshot_sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -2171,7 +2148,7 @@ static MACHINE_CONFIG_START( lgtnfght )
MCFG_K05324X_OFFSETS(0, 0)
MCFG_K05324X_CB(tmnt_state, lgtnfght_sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2231,7 +2208,7 @@ static MACHINE_CONFIG_START( blswhstl )
MCFG_K05324X_OFFSETS(0, 0)
MCFG_K05324X_CB(tmnt_state, blswhstl_sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
MCFG_K054000_ADD("k054000")
/* sound hardware */
@@ -2312,7 +2289,7 @@ static MACHINE_CONFIG_START( glfgreat )
MCFG_K053936_WRAP(1)
MCFG_K053936_OFFSETS(85, 0)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2379,7 +2356,7 @@ static MACHINE_CONFIG_START( prmrsocr )
MCFG_DEVICE_ADD("k053936", K053936, 0)
MCFG_K053936_OFFSETS(85, 1)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2443,7 +2420,7 @@ static MACHINE_CONFIG_START( tmnt2 )
MCFG_K05324X_OFFSETS(0, 0)
MCFG_K05324X_CB(tmnt_state, lgtnfght_sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2502,7 +2479,7 @@ static MACHINE_CONFIG_START( ssriders )
MCFG_K05324X_OFFSETS(0, 0)
MCFG_K05324X_CB(tmnt_state, lgtnfght_sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2553,7 +2530,7 @@ static MACHINE_CONFIG_START( sunsetbl )
MCFG_K05324X_OFFSETS(0, 0)
MCFG_K05324X_CB(tmnt_state, lgtnfght_sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2602,7 +2579,7 @@ static MACHINE_CONFIG_START( thndrx2 )
MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(tmnt_state, thndrx2_sprite_callback)
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("k053251", 1)
MCFG_K054000_ADD("k054000")
diff --git a/src/mame/drivers/ultraman.cpp b/src/mame/drivers/ultraman.cpp
index 9dd01670230..61214e1cb8f 100644
--- a/src/mame/drivers/ultraman.cpp
+++ b/src/mame/drivers/ultraman.cpp
@@ -12,15 +12,113 @@
***************************************************************************/
#include "emu.h"
-#include "includes/ultraman.h"
-#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
+#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
#include "machine/watchdog.h"
-#include "sound/ym2151.h"
#include "sound/okim6295.h"
+#include "sound/ym2151.h"
#include "speaker.h"
+#include "video/k051316.h"
+#include "video/k051960.h"
+#include "video/konami_helper.h"
+
+class ultraman_state : public driver_device
+{
+public:
+ ultraman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_roz_1(*this, "roz_1"),
+ m_roz_2(*this, "roz_2"),
+ m_roz_3(*this, "roz_3"),
+ m_k051960(*this, "k051960"),
+ m_soundlatch(*this, "soundlatch") { }
+
+ int m_bank0;
+ int m_bank1;
+ int m_bank2;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k051316_device> m_roz_1;
+ required_device<k051316_device> m_roz_2;
+ required_device<k051316_device> m_roz_3;
+ required_device<k051960_device> m_k051960;
+ required_device<generic_latch_8_device> m_soundlatch;
+
+ DECLARE_WRITE16_MEMBER(sound_cmd_w);
+ DECLARE_WRITE16_MEMBER(sound_irq_trigger_w);
+ DECLARE_WRITE16_MEMBER(ultraman_gfxctrl_w);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ uint32_t screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ K051960_CB_MEMBER(sprite_callback);
+};
+
+K051960_CB_MEMBER(ultraman_state::sprite_callback)
+{
+ enum { sprite_colorbase = 3072 / 16 };
+
+ *priority = (*color & 0x80) ? 0 : GFX_PMASK_1;
+ *color = sprite_colorbase + ((*color & 0x7e) >> 1);
+ *shadow = 0;
+}
+/***************************************************************************
+
+ Memory handlers
+
+***************************************************************************/
+
+WRITE16_MEMBER(ultraman_state::ultraman_gfxctrl_w)
+{
+ if (ACCESSING_BITS_0_7)
+ {
+ /* bit 0: enable wraparound for scr #1
+ bit 1: msb of code for scr #1
+ bit 2: enable wraparound for scr #2
+ bit 3: msb of code for scr #2
+ bit 4: enable wraparound for scr #3
+ bit 5: msb of code for scr #3
+ bit 6: coin counter 1
+ bit 7: coin counter 2 */
+
+ m_roz_1->set_wrap(data & 0x01);
+ m_bank0 = (data & 0x02) >> 1;
+
+ m_roz_2->set_wrap(data & 0x04);
+ m_bank1 = (data & 0x08) >> 3;
+
+ m_roz_3->set_wrap(data & 0x10);
+ m_bank2 = (data & 0x20) >> 5;
+
+ machine().bookkeeping().coin_counter_w(0, data & 0x40);
+ machine().bookkeeping().coin_counter_w(1, data & 0x80);
+ }
+}
+
+
+
+/***************************************************************************
+
+ Display Refresh
+
+***************************************************************************/
+
+uint32_t ultraman_state::screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ screen.priority().fill(0, cliprect);
+
+ // m_roz_3->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
+ // m_roz_2->zoom_draw(screen, bitmap, cliprect, 0, 0);
+ // m_roz_1->zoom_draw(screen, bitmap, cliprect, 0, 1);
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
+ return 0;
+}
WRITE16_MEMBER(ultraman_state::sound_cmd_w)
{
@@ -48,12 +146,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, ultraman_state )
AM_RANGE(0x1c0020, 0x1c0021) AM_WRITE(sound_cmd_w)
AM_RANGE(0x1c0028, 0x1c0029) AM_WRITE(sound_irq_trigger_w)
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 */
- AM_RANGE(0x206000, 0x206fff) AM_DEVREADWRITE8("k051316_3", k051316_device, read, write, 0x00ff) /* K051316 #2 RAM */
- AM_RANGE(0x207f80, 0x207f9f) AM_DEVWRITE8("k051316_1", k051316_device, ctrl_w, 0x00ff) /* K051316 #0 registers */
- AM_RANGE(0x207fa0, 0x207fbf) AM_DEVWRITE8("k051316_2", k051316_device, ctrl_w, 0x00ff) /* K051316 #1 registers */
- AM_RANGE(0x207fc0, 0x207fdf) AM_DEVWRITE8("k051316_3", k051316_device, ctrl_w, 0x00ff) /* K051316 #2 registers */
+ AM_RANGE(0x204000, 0x204fff) AM_DEVREADWRITE8("roz_1", k051316_device, vram_r, vram_w, 0x00ff) /* K051316 #0 RAM */
+ AM_RANGE(0x205000, 0x205fff) AM_DEVREADWRITE8("roz_2", k051316_device, vram_r, vram_w, 0x00ff) /* K051316 #1 RAM */
+ AM_RANGE(0x206000, 0x206fff) AM_DEVREADWRITE8("roz_3", k051316_device, vram_r, vram_w, 0x00ff) /* K051316 #2 RAM */
+ AM_RANGE(0x207f80, 0x207f9f) AM_DEVICE8("roz_1", k051316_device, map, 0x00ff) /* K051316 #0 registers */
+ AM_RANGE(0x207fa0, 0x207fbf) AM_DEVICE8("roz_2", k051316_device, map, 0x00ff) /* K051316 #1 registers */
+ AM_RANGE(0x207fc0, 0x207fdf) AM_DEVICE8("roz_3", k051316_device, map, 0x00ff) /* K051316 #2 registers */
AM_RANGE(0x304000, 0x30400f) AM_DEVREADWRITE8("k051960", k051960_device, k051937_r, k051937_w, 0x00ff) /* Sprite control */
AM_RANGE(0x304800, 0x304fff) AM_DEVREADWRITE8("k051960", k051960_device, k051960_r, k051960_w, 0x00ff) /* Sprite RAM */
ADDRESS_MAP_END
@@ -209,20 +307,9 @@ static MACHINE_CONFIG_START( ultraman )
MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(ultraman_state, sprite_callback)
- MCFG_DEVICE_ADD("k051316_1", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(8, 0)
- MCFG_K051316_CB(ultraman_state, zoom_callback_1)
-
- MCFG_DEVICE_ADD("k051316_2", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(8, 0)
- MCFG_K051316_CB(ultraman_state, zoom_callback_2)
-
- MCFG_DEVICE_ADD("k051316_3", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(8, 0)
- MCFG_K051316_CB(ultraman_state, zoom_callback_3)
+ MCFG_K051316_ADD("roz_1", 4, false, [owner](u32 address, u32 &code, u16 &color) { code = (static_cast<ultraman_state *>(owner)->m_bank0 << 23) | (address & 0x07ffff); color = (address & 0xf80000) >> 15; })
+ MCFG_K051316_ADD("roz_2", 4, false, [owner](u32 address, u32 &code, u16 &color) { code = (static_cast<ultraman_state *>(owner)->m_bank1 << 23) | (address & 0x07ffff); color = (address & 0xf80000) >> 15; })
+ MCFG_K051316_ADD("roz_3", 4, false, [owner](u32 address, u32 &code, u16 &color) { code = (static_cast<ultraman_state *>(owner)->m_bank2 << 23) | (address & 0x07ffff); color = (address & 0xf80000) >> 15; })
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/vendetta.cpp b/src/mame/drivers/vendetta.cpp
index f8e05ee86f9..0f3a90e4f08 100644
--- a/src/mame/drivers/vendetta.cpp
+++ b/src/mame/drivers/vendetta.cpp
@@ -149,6 +149,17 @@ WRITE8_MEMBER(vendetta_state::K052109_w)
m_k052109->write(space, offset + 0x2000, data);
}
+K052109_CB_MEMBER(vendetta_state::vendetta_tile_callback)
+{
+ *code |= ((*color & 0x03) << 8) | ((*color & 0x30) << 6) | ((*color & 0x0c) << 10) | (bank << 14);
+ *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6);
+}
+
+K052109_CB_MEMBER(vendetta_state::esckids_tile_callback)
+{
+ *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
+ *color = m_layer_colorbase[layer] + ((*color & 0xe0) >> 5);
+}
WRITE8_MEMBER(vendetta_state::_5fe0_w)
{
@@ -164,7 +175,7 @@ WRITE8_MEMBER(vendetta_state::_5fe0_w)
/* bit 4 = INIT ?? */
/* bit 5 = enable sprite ROM reading */
- m_k053246->k053246_set_objcha_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
+ m_sprites->set_objcha(data & 0x20);
}
void vendetta_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@@ -203,8 +214,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, vendetta_state )
AM_RANGE(0x0000, 0x1fff) AM_ROMBANK("bank1")
AM_RANGE(0x2000, 0x3fff) AM_RAM
AM_RANGE(0x5f80, 0x5f9f) AM_DEVREADWRITE("k054000", k054000_device, read, write)
- AM_RANGE(0x5fa0, 0x5faf) AM_DEVWRITE("k053251", k053251_device, write)
- AM_RANGE(0x5fb0, 0x5fb7) AM_DEVWRITE("k053246", k053247_device, k053246_w)
+ AM_RANGE(0x5fa0, 0x5faf) AM_DEVICE("mixer", k053251_device, map)
+ AM_RANGE(0x5fb0, 0x5fb7) AM_DEVICE("sprites", k053246_053247_device, objset1_8)
AM_RANGE(0x5fc0, 0x5fc0) AM_READ_PORT("P1")
AM_RANGE(0x5fc1, 0x5fc1) AM_READ_PORT("P2")
AM_RANGE(0x5fc2, 0x5fc2) AM_READ_PORT("P3")
@@ -215,7 +226,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, vendetta_state )
AM_RANGE(0x5fe2, 0x5fe2) AM_WRITE(eeprom_w)
AM_RANGE(0x5fe4, 0x5fe4) AM_READWRITE(z80_irq_r, z80_irq_w)
AM_RANGE(0x5fe6, 0x5fe7) AM_DEVREADWRITE("k053260", k053260_device, main_read, main_write)
- AM_RANGE(0x5fe8, 0x5fe9) AM_DEVREAD("k053246", k053247_device, k053246_r)
+ AM_RANGE(0x5fe8, 0x5fe9) AM_DEVREAD("sprites", k053246_053247_device, rom8_r)
AM_RANGE(0x5fea, 0x5fea) AM_DEVREAD("watchdog", watchdog_timer_device, reset_r)
/* what is the desired effect of overlapping these memory regions anyway? */
AM_RANGE(0x4000, 0x4fff) AM_DEVICE("videobank0", address_map_bank_device, amap8)
@@ -232,14 +243,14 @@ static ADDRESS_MAP_START( esckids_map, AS_PROGRAM, 8, vendetta_state )
AM_RANGE(0x3f83, 0x3f83) AM_READ_PORT("P4") // ??? (But not used)
AM_RANGE(0x3f92, 0x3f92) AM_READ_PORT("EEPROM")
AM_RANGE(0x3f93, 0x3f93) AM_READ_PORT("SERVICE")
- AM_RANGE(0x3fa0, 0x3fa7) AM_DEVWRITE("k053246", k053247_device, k053246_w) // 053246 (Sprite)
- AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE("k053251", k053251_device, write) // 053251 (Priority Encoder)
- AM_RANGE(0x3fc0, 0x3fcf) AM_DEVREADWRITE("k053252", k053252_device, read, write) // Not Emulated (053252 ???)
+ AM_RANGE(0x3fa0, 0x3fa7) AM_DEVICE("sprites", k053246_053247_device, objset1) // 053246 (Sprite)
+ AM_RANGE(0x3fb0, 0x3fbf) AM_DEVICE("mixer", k053251_device, map) // 053251 (Priority Encoder)
+ AM_RANGE(0x3fc0, 0x3fcf) AM_DEVICE("video_timings", k053252_device, map)
AM_RANGE(0x3fd0, 0x3fd0) AM_WRITE(_5fe0_w) // Coin Counter, 052109 RMRD, 053246 OBJCHA
AM_RANGE(0x3fd2, 0x3fd2) AM_WRITE(eeprom_w) // EEPROM, Video banking
AM_RANGE(0x3fd4, 0x3fd4) AM_READWRITE(z80_irq_r, z80_irq_w) // Sound
AM_RANGE(0x3fd6, 0x3fd7) AM_DEVREADWRITE("k053260", k053260_device, main_read, main_write) // Sound
- AM_RANGE(0x3fd8, 0x3fd9) AM_DEVREAD("k053246", k053247_device, k053246_r) // 053246 (Sprite)
+ AM_RANGE(0x3fd8, 0x3fd9) AM_DEVREAD("sprites", k053246_053247_device, rom8_r) // 053246 (Sprite)
AM_RANGE(0x3fda, 0x3fda) AM_WRITENOP // Not Emulated (Watchdog ???)
/* what is the desired effect of overlapping these memory regions anyway? */
AM_RANGE(0x2000, 0x2fff) AM_DEVICE("videobank0", address_map_bank_device, amap8) // 052109 (Tilemap) 0x0000-0x0fff - 052109 (Tilemap)
@@ -251,7 +262,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( videobank0_map, AS_PROGRAM, 8, vendetta_state )
AM_RANGE(0x0000, 0x0fff) AM_DEVREADWRITE("k052109", k052109_device, read, write)
- AM_RANGE(0x1000, 0x1fff) AM_DEVREADWRITE("k053246", k053247_device, k053247_r, k053247_w)
+ AM_RANGE(0x1000, 0x1fff) AM_RAM AM_SHARE("spriteram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( videobank1_map, AS_PROGRAM, 8, vendetta_state )
@@ -381,15 +392,11 @@ INPUT_PORTS_END
***************************************************************************/
-INTERRUPT_GEN_MEMBER(vendetta_state::irq)
-{
- if (m_irq_enabled)
- device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
-}
-
void vendetta_state::machine_start()
{
- membank("bank1")->configure_entries(0, 28, memregion("maincpu")->base(), 0x2000);
+ uint8_t *ROM = memregion("maincpu")->base();
+
+ membank("bank1")->configure_entries(0, 28, &ROM[0x10000], 0x2000);
membank("bank1")->set_entry(0);
save_item(NAME(m_irq_enabled));
@@ -423,7 +430,6 @@ static MACHINE_CONFIG_START( vendetta )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) /* 052001 (verified on pcb) */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", vendetta_state, irq)
MCFG_KONAMICPU_LINE_CB(WRITE8(vendetta_state, banking_callback))
MCFG_DEVICE_ADD("videobank0", ADDRESS_MAP_BANK, 0)
@@ -454,7 +460,7 @@ static MACHINE_CONFIG_START( vendetta )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 )
- MCFG_SCREEN_UPDATE_DRIVER(vendetta_state, screen_update)
+// MCFG_SCREEN_UPDATE_DRIVER(vendetta_state, screen_update_vendetta)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 2048)
@@ -465,12 +471,9 @@ static MACHINE_CONFIG_START( vendetta )
MCFG_GFX_PALETTE("palette")
MCFG_K052109_CB(vendetta_state, vendetta_tile_callback)
- MCFG_DEVICE_ADD("k053246", K053246, 0)
- MCFG_K053246_CB(vendetta_state, sprite_callback)
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 53, 6)
- MCFG_K053246_PALETTE("palette")
+ MCFG_K053246_053247_ADD("sprites", 8000000, "spriteram")
- MCFG_K053251_ADD("k053251")
+ MCFG_K053251_ADD("mixer", 1)
MCFG_K054000_ADD("k054000")
@@ -504,11 +507,8 @@ static MACHINE_CONFIG_DERIVED( esckids, vendetta )
MCFG_GFX_PALETTE("palette")
MCFG_K052109_CB(vendetta_state, esckids_tile_callback)
- MCFG_DEVICE_MODIFY("k053246")
- MCFG_K053246_CONFIG("gfx2", NORMAL_PLANE_ORDER, 101, 6)
-
- MCFG_DEVICE_ADD("k053252", K053252, 6000000)
- MCFG_K053252_OFFSETS(12*8, 1*8)
+ MCFG_DEVICE_ADD("video_timings", K053252, 6000000)
+// MCFG_K053252_OFFSETS(12*8, 1*8)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/wecleman.cpp b/src/mame/drivers/wecleman.cpp
index b16c15053ed..e011563bc6d 100644
--- a/src/mame/drivers/wecleman.cpp
+++ b/src/mame/drivers/wecleman.cpp
@@ -262,17 +262,1261 @@ TODO:
***************************************************************************/
#include "emu.h"
-#include "includes/wecleman.h"
#include "cpu/m68000/m68000.h"
#include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h"
+#include "machine/gen_latch.h"
+#include "screen.h"
+#include "sound/k007232.h"
#include "sound/ym2151.h"
#include "speaker.h"
+#include "video/k051316.h"
#include "wecleman.lh"
+class wecleman_state : public driver_device
+{
+public:
+ wecleman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_videostatus(*this, "videostatus"),
+ m_protection_ram(*this, "protection_ram"),
+ m_blitter_regs(*this, "blitter_regs"),
+ m_pageram(*this, "pageram"),
+ m_txtram(*this, "txtram"),
+ m_spriteram(*this, "spriteram"),
+ m_roadram(*this, "roadram"),
+ m_generic_paletteram_16(*this, "paletteram"),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_subcpu(*this, "sub"),
+ m_roz_1(*this, "roz_1"),
+ m_roz_2(*this, "roz_2"),
+ m_k007232(*this, "k007232"),
+ m_k007232_1(*this, "k007232_1"),
+ m_k007232_2(*this, "k007232_2"),
+ m_k007232_3(*this, "k007232_3"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
+ m_screen(*this, "screen"),
+ m_soundlatch(*this, "soundlatch") { }
+
+ optional_shared_ptr<uint16_t> m_videostatus;
+ optional_shared_ptr<uint16_t> m_protection_ram;
+ required_shared_ptr<uint16_t> m_blitter_regs;
+ optional_shared_ptr<uint16_t> m_pageram;
+ optional_shared_ptr<uint16_t> m_txtram;
+ required_shared_ptr<uint16_t> m_spriteram;
+ required_shared_ptr<uint16_t> m_roadram;
+ required_shared_ptr<uint16_t> m_generic_paletteram_16;
+
+ int m_multiply_reg[2];
+ int m_spr_color_offs;
+ int m_prot_state;
+ int m_selected_ip;
+ int m_irqctrl;
+ int m_bgpage[4];
+ int m_fgpage[4];
+ const int *m_gfx_bank;
+ tilemap_t *m_bg_tilemap;
+ tilemap_t *m_fg_tilemap;
+ tilemap_t *m_txt_tilemap;
+ int *m_spr_idx_list;
+ int *m_spr_pri_list;
+ int *m_t32x32pm;
+ int m_gameid;
+ int m_spr_offsx;
+ int m_spr_offsy;
+ int m_spr_count;
+ uint16_t *m_rgb_half;
+ int m_cloud_blend;
+ int m_cloud_ds;
+ int m_cloud_visible;
+ int m_sound_hw_type;
+ bool m_hotchase_sound_hs;
+ pen_t m_black_pen;
+ struct sprite *m_sprite_list;
+ struct sprite **m_spr_ptr_list;
+ DECLARE_READ16_MEMBER(wecleman_protection_r);
+ DECLARE_WRITE16_MEMBER(wecleman_protection_w);
+ DECLARE_WRITE16_MEMBER(irqctrl_w);
+ DECLARE_WRITE16_MEMBER(selected_ip_w);
+ DECLARE_READ16_MEMBER(selected_ip_r);
+ DECLARE_WRITE16_MEMBER(blitter_w);
+ DECLARE_READ8_MEMBER(multiply_r);
+ DECLARE_WRITE8_MEMBER(multiply_w);
+ DECLARE_WRITE16_MEMBER(hotchase_soundlatch_w);
+ DECLARE_WRITE8_MEMBER(hotchase_sound_control_w);
+ DECLARE_WRITE16_MEMBER(wecleman_soundlatch_w);
+ DECLARE_WRITE16_MEMBER(wecleman_txtram_w);
+ DECLARE_WRITE16_MEMBER(wecleman_pageram_w);
+ DECLARE_WRITE16_MEMBER(wecleman_videostatus_w);
+ DECLARE_WRITE16_MEMBER(hotchase_paletteram16_SBGRBBBBGGGGRRRR_word_w);
+ DECLARE_WRITE16_MEMBER(wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w);
+ DECLARE_WRITE8_MEMBER(wecleman_K00723216_bank_w);
+ DECLARE_WRITE8_MEMBER(wecleman_volume_callback);
+ DECLARE_READ8_MEMBER(hotchase_1_k007232_r);
+ DECLARE_WRITE8_MEMBER(hotchase_1_k007232_w);
+ DECLARE_READ8_MEMBER(hotchase_2_k007232_r);
+ DECLARE_WRITE8_MEMBER(hotchase_2_k007232_w);
+ DECLARE_READ8_MEMBER(hotchase_3_k007232_r);
+ DECLARE_WRITE8_MEMBER(hotchase_3_k007232_w);
+ DECLARE_DRIVER_INIT(wecleman);
+ DECLARE_DRIVER_INIT(hotchase);
+ TILE_GET_INFO_MEMBER(wecleman_get_txt_tile_info);
+ TILE_GET_INFO_MEMBER(wecleman_get_bg_tile_info);
+ TILE_GET_INFO_MEMBER(wecleman_get_fg_tile_info);
+ DECLARE_MACHINE_RESET(wecleman);
+ DECLARE_VIDEO_START(wecleman);
+ DECLARE_MACHINE_RESET(hotchase);
+ DECLARE_VIDEO_START(hotchase);
+ uint32_t screen_update_wecleman(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_hotchase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(hotchase_sound_timer);
+ TIMER_DEVICE_CALLBACK_MEMBER(wecleman_scanline);
+ TIMER_DEVICE_CALLBACK_MEMBER(hotchase_scanline);
+ void draw_cloud(bitmap_rgb32 &bitmap,gfx_element *gfx,uint16_t *tm_base,int x0,int y0,int xcount,int ycount,int scrollx,int scrolly,int tmw_l2,int tmh_l2,int alpha,int pal_offset);
+ void wecleman_unpack_sprites();
+ void bitswap(uint8_t *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0);
+ void hotchase_sprite_decode( int num16_banks, int bank_size );
+ void get_sprite_info();
+ void sortsprite(int *idx_array, int *key_array, int size);
+ template<class _BitmapClass> void do_blit_zoom32(_BitmapClass &bitmap, const rectangle &cliprect, struct sprite *sprite);
+ template<class _BitmapClass> void sprite_draw(_BitmapClass &bitmap, const rectangle &cliprect);
+ void wecleman_draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect, int priority);
+ void hotchase_draw_road(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_CUSTOM_INPUT_MEMBER(hotchase_sound_status_r);
+ DECLARE_WRITE8_MEMBER(hotchase_sound_hs_w);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<cpu_device> m_subcpu;
+ optional_device<k051316_device> m_roz_1;
+ optional_device<k051316_device> m_roz_2;
+ optional_device<k007232_device> m_k007232;
+ optional_device<k007232_device> m_k007232_1;
+ optional_device<k007232_device> m_k007232_2;
+ optional_device<k007232_device> m_k007232_3;
+ 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;
+};
+
+#define BMP_PAD 8
+#define BLEND_STEPS 16
+#define BLEND_MIN 0
+#define BLEND_MAX (BLEND_STEPS*0x20-1)
+#define BLEND_INC 1
+#define BLEND_DEC -8
+
+#define SPRITE_FLIPX 0x01
+#define SPRITE_FLIPY 0x02
+#define NUM_SPRITES 256
+
+struct sprite
+{
+ uint8_t *pen_data; /* points to top left corner of tile data */
+ int line_offset;
+
+ const pen_t *pal_data;
+ rgb_t pal_base;
+
+ int x_offset, y_offset;
+ int tile_width, tile_height;
+ int total_width, total_height; /* in screen coordinates */
+ int x, y;
+ int shadow_mode, flags;
+};
+
+
+/***************************************************************************
+
+ Sprite Description and Routines
+ -------------------------------
+
+ Sprites: 256 entries, 16 bytes each, first ten bytes used (and tested)
+
+ Offset Bits Meaning
+
+ 00.w fedc ba98 ---- ---- Screen Y stop
+ ---- ---- 7654 3210 Screen Y start
+
+ 02.w fedc ba-- ---- ---- High bits of sprite "address"
+ ---- --9- ---- ---- Flip Y ?
+ ---- ---8 7654 3210 Screen X start
+
+ 04.w fedc ba98 ---- ---- Color
+ ---- ---- 7654 3210 Source Width / 8
+
+ 06.w f--- ---- ---- ---- Flip X
+ -edc ba98 7654 3210 Low bits of sprite "address"
+
+ 08.w --dc ba98 ---- ---- Y? Shrink Factor
+ ---- ---- --54 3210 X? Shrink Factor
+
+ Sprite "address" is the index of the pixel the hardware has to start
+ fetching data from, divided by 8. Only the on-screen height and source data
+ width are provided, along with two shrinking factors. So on screen width
+ and source height are calculated by the hardware using the shrink factors.
+ The factors are in the range 0 (no shrinking) - 3F (half size).
+
+ Hot Chase: shadow of trees is pen 0x0a
+
+***************************************************************************/
+
+void wecleman_state::get_sprite_info()
+{
+ const pen_t *base_pal = m_palette->pens();
+ uint8_t *base_gfx = memregion("gfx1")->base();
+ int gfx_max = memregion("gfx1")->bytes();
+
+ uint16_t *source = m_spriteram;
+
+ struct sprite *sprite = m_sprite_list;
+ struct sprite *finish = m_sprite_list + NUM_SPRITES;
+
+ int bank, code, gfx, zoom;
+
+ for (m_spr_count=0; sprite<finish; source+=0x10/2, sprite++)
+ {
+ if (source[0x00/2] == 0xffff) break;
+
+ sprite->y = source[0x00/2] & 0xff;
+ sprite->total_height = (source[0x00/2] >> 8) - sprite->y;
+ if (sprite->total_height < 1) continue;
+
+ sprite->x = source[0x02/2] & 0x1ff;
+ bank = source[0x02/2] >> 10;
+ if (bank == 0x3f) continue;
+
+ sprite->tile_width = source[0x04/2] & 0xff;
+ if (sprite->tile_width < 1) continue;
+
+ sprite->shadow_mode = source[0x04/2] & 0x4000;
+
+ code = source[0x06/2];
+ zoom = source[0x08/2];
+
+ sprite->pal_base = (source[0x0e/2] & 0xff) << 4;
+ sprite->pal_data = base_pal + sprite->pal_base;
+
+ gfx = (m_gfx_bank[bank] << 15) + (code & 0x7fff);
+
+ sprite->flags = 0;
+ if (code & 0x8000) { sprite->flags |= SPRITE_FLIPX; gfx += 1-sprite->tile_width; }
+ if (source[0x02/2] & 0x0200) sprite->flags |= SPRITE_FLIPY;
+
+ gfx <<= 3;
+ sprite->tile_width <<= 3;
+ sprite->tile_height = (sprite->total_height * 0x80) / (0x80 - (zoom >> 8)); // needs work
+
+ if ((gfx + sprite->tile_width * sprite->tile_height - 1) >= gfx_max) continue;
+
+ sprite->pen_data = base_gfx + gfx;
+ sprite->line_offset = sprite->tile_width;
+ sprite->total_width = sprite->tile_width - (sprite->tile_width * (zoom & 0xff)) / 0x80;
+ sprite->total_height += 1;
+ sprite->x += m_spr_offsx;
+ sprite->y += m_spr_offsy;
+
+ if (m_gameid == 0)
+ {
+ m_spr_idx_list[m_spr_count] = m_spr_count;
+ m_spr_pri_list[m_spr_count] = source[0x0e/2] >> 8;
+ }
+
+ m_spr_ptr_list[m_spr_count] = sprite;
+ m_spr_count++;
+ }
+}
+
+// priority sorting, silly but good for smaller arrays
+void wecleman_state::sortsprite(int *idx_array, int *key_array, int size)
+{
+ int i, j, tgt_val, low_val, low_pos, src_idx, tgt_idx, hi_idx;
+
+ idx_array += size;
+
+ for (j=-size; j<-1; j++)
+ {
+ src_idx = idx_array[j];
+ low_pos = j;
+ low_val = key_array[src_idx];
+ hi_idx = src_idx;
+ for (i=j+1; i; i++)
+ {
+ tgt_idx = idx_array[i];
+ tgt_val = key_array[tgt_idx];
+ if (low_val > tgt_val)
+ { low_val = tgt_val; low_pos = i; }
+ else if ((low_val == tgt_val) && (hi_idx <= tgt_idx))
+ { hi_idx = tgt_idx; low_pos = i; }
+ }
+ low_val = idx_array[low_pos];
+ idx_array[low_pos] = src_idx;
+ idx_array[j] = low_val;
+ }
+}
+
+// draws a 8bpp palette sprites on a 16bpp direct RGB target (sub-par implementation)
+template<class _BitmapClass>
+void wecleman_state::do_blit_zoom32(_BitmapClass &bitmap, const rectangle &cliprect, struct sprite *sprite)
+{
+#define PRECISION_X 20
+#define PRECISION_Y 20
+#define FPY_HALF (1<<(PRECISION_Y-1))
+
+ const pen_t *pal_base;
+ int src_f0y, src_fdy, src_f0x, src_fdx, src_fpx;
+ int x1, x2, y1, y2, dx, dy, sx, sy;
+ int xcount0=0, ycount0=0;
+
+ if (sprite->flags & SPRITE_FLIPX)
+ {
+ x2 = sprite->x;
+ x1 = x2 + sprite->total_width;
+ dx = -1;
+ if (x2 < cliprect.min_x) x2 = cliprect.min_x;
+ if (x1 > cliprect.max_x )
+ {
+ xcount0 = x1 - cliprect.max_x;
+ x1 = cliprect.max_x;
+ }
+ if (x2 >= x1) return;
+ x1--; x2--;
+ }
+ else
+ {
+ x1 = sprite->x;
+ x2 = x1 + sprite->total_width;
+ dx = 1;
+ if (x1 < cliprect.min_x )
+ {
+ xcount0 = cliprect.min_x - x1;
+ x1 = cliprect.min_x;
+ }
+ if (x2 > cliprect.max_x ) x2 = cliprect.max_x;
+ if (x1 >= x2) return;
+ }
+
+ if (sprite->flags & SPRITE_FLIPY)
+ {
+ y2 = sprite->y;
+ y1 = y2 + sprite->total_height;
+ dy = -1;
+ if (y2 < cliprect.min_y ) y2 = cliprect.min_y;
+ if (y1 > cliprect.max_y )
+ {
+ ycount0 = cliprect.max_y;
+ y1 = cliprect.max_y;
+ }
+ if (y2 >= y1) return;
+ y1--; y2--;
+ }
+ else
+ {
+ y1 = sprite->y;
+ y2 = y1 + sprite->total_height;
+ dy = 1;
+ if (y1 < cliprect.min_y )
+ {
+ ycount0 = cliprect.min_y - y1;
+ y1 = cliprect.min_y;
+ }
+ if (y2 > cliprect.max_y) y2 = cliprect.max_y;
+ if (y1 >= y2) return;
+ }
+
+ // calculate entry point decimals
+ src_fdy = (sprite->tile_height<<PRECISION_Y) / sprite->total_height;
+ src_f0y = src_fdy * ycount0 + FPY_HALF;
+
+ src_fdx = (sprite->tile_width<<PRECISION_X) / sprite->total_width;
+ src_f0x = src_fdx * xcount0;
+
+ // pre-loop assignments and adjustments
+ pal_base = sprite->pal_data;
+
+ if (x1 > cliprect.min_x)
+ {
+ x1 -= dx;
+ x2 -= dx;
+ }
+
+ for (sy = y1; sy != y2; sy += dy)
+ {
+ uint8_t *row_base = sprite->pen_data + (src_f0y>>PRECISION_Y) * sprite->line_offset;
+ src_fpx = src_f0x;
+ typename _BitmapClass::pixel_t *dst_ptr = &bitmap.pix(sy);
+
+ if (bitmap.format() == BITMAP_FORMAT_RGB32) // Wec Le Mans
+ {
+ if (!sprite->shadow_mode)
+ {
+ for (sx = x1; sx != x2; sx += dx)
+ {
+ int pix = row_base[src_fpx >> PRECISION_X];
+ if (pix & 0x80) break;
+ if (pix)
+ dst_ptr[sx] = pal_base[pix];
+ src_fpx += src_fdx;
+ }
+ }
+ else
+ {
+ for (sx = x1; sx != x2; sx += dx)
+ {
+ int pix = row_base[src_fpx >> PRECISION_X];
+ if (pix & 0x80) break;
+ if (pix)
+ {
+ if (pix != 0xa)
+ dst_ptr[sx] = pal_base[pix];
+ else
+ dst_ptr[sx] = (dst_ptr[sx] >> 1) & rgb_t(0x7f,0x7f,0x7f);
+ }
+ src_fpx += src_fdx;
+ }
+ }
+ }
+ else // Hot Chase
+ {
+ pen_t base = sprite->pal_base;
+
+ if (!sprite->shadow_mode)
+ {
+ for (sx = x1; sx != x2; sx += dx)
+ {
+ int pix = row_base[src_fpx >> PRECISION_X];
+ if (pix & 0x80) break;
+ if (pix)
+ dst_ptr[sx] = base + pix;
+ src_fpx += src_fdx;
+ }
+ }
+ else
+ {
+ for (sx = x1; sx != x2; sx += dx)
+ {
+ int pix = row_base[src_fpx >> PRECISION_X];
+ if (pix & 0x80) break;
+ if (pix)
+ {
+ if (pix != 0xa)
+ dst_ptr[sx] = base + pix;
+ else
+ {
+ if (dst_ptr[sx] != m_black_pen)
+ dst_ptr[sx] |= 0x800;
+ }
+ }
+ src_fpx += src_fdx;
+ }
+ }
+ }
+
+ src_f0y += src_fdy;
+ }
+}
+
+template<class _BitmapClass>
+void wecleman_state::sprite_draw(_BitmapClass &bitmap, const rectangle &cliprect)
+{
+ int i;
+
+ if (m_gameid == 0) // Wec Le Mans
+ {
+ sortsprite(m_spr_idx_list, m_spr_pri_list, m_spr_count);
+
+ for (i=0; i<m_spr_count; i++) do_blit_zoom32(bitmap, cliprect, m_spr_ptr_list[m_spr_idx_list[i]]);
+ }
+ else // Hot Chase
+ {
+ for (i=0; i<m_spr_count; i++) do_blit_zoom32(bitmap, cliprect, m_spr_ptr_list[i]);
+ }
+}
+
+
+/***************************************************************************
+
+ Background Description and Routines
+ -----------------------------------
+
+ [WEC Le Mans 24]
+
+[ 2 Scrolling Layers ]
+ [Background]
+ [Foreground]
+ Tile Size: 8x8
+
+ Tile Format: see wecleman_get_bg_tile_info()
+
+ Layer Size: 4 Pages - Page0 Page1 Page2 Page3
+ each page is 512 x 256 (64 x 32 tiles)
+
+ Page Selection Reg.: 108efe [Bg]
+ 108efc [Fg]
+ 4 pages to choose from
+
+ Scrolling Columns: 1
+ Scrolling Columns Reg.: 108f26 [Bg]
+ 108f24 [Fg]
+
+ Scrolling Rows: 224 / 8 (Screen-wise scrolling)
+ Scrolling Rows Reg.: 108f82/4/6.. [Bg]
+ 108f80/2/4.. [Fg]
+
+[ 1 Text Layer ]
+ Tile Size: 8x8
+
+ Tile Format: see wecleman_get_txt_tile_info()
+
+ Layer Size: 1 Page: 512 x 256 (64 x 32 tiles)
+
+ Scrolling: -
+
+[ 1 Road Layer ]
+
+[ 256 Sprites ]
+ Zooming Sprites, see below
+
+
+ [Hot Chase]
+
+[ 3 Zooming Layers ]
+ [Background]
+ [Foreground (text)]
+ [Road]
+
+[ 256 Sprites ]
+ Zooming Sprites, see below
+
+***************************************************************************/
+
+/***************************************************************************
+ WEC Le Mans 24
+***************************************************************************/
+
+#define PAGE_GFX (0)
+#define PAGE_NX (0x40)
+#define PAGE_NY (0x20)
+#define TILEMAP_DIMY (PAGE_NY * 2 * 8)
+
+/*------------------------------------------------------------------------
+ [ Frontmost (text) layer + video registers ]
+------------------------------------------------------------------------*/
+
+TILE_GET_INFO_MEMBER(wecleman_state::wecleman_get_txt_tile_info)
+{
+ int code = m_txtram[tile_index];
+ SET_TILE_INFO_MEMBER(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0);
+}
+
+WRITE16_MEMBER(wecleman_state::wecleman_txtram_w)
+{
+ uint16_t old_data = m_txtram[offset];
+ uint16_t new_data = COMBINE_DATA(&m_txtram[offset]);
+
+ if ( old_data != new_data )
+ {
+ if (offset >= 0xE00/2 ) /* Video registers */
+ {
+ /* pages selector for the background */
+ if (offset == 0xEFE/2)
+ {
+ m_bgpage[0] = (new_data >> 0x4) & 3;
+ m_bgpage[1] = (new_data >> 0x0) & 3;
+ m_bgpage[2] = (new_data >> 0xc) & 3;
+ m_bgpage[3] = (new_data >> 0x8) & 3;
+ m_bg_tilemap->mark_all_dirty();
+ }
+
+ /* pages selector for the foreground */
+ if (offset == 0xEFC/2)
+ {
+ m_fgpage[0] = (new_data >> 0x4) & 3;
+ m_fgpage[1] = (new_data >> 0x0) & 3;
+ m_fgpage[2] = (new_data >> 0xc) & 3;
+ m_fgpage[3] = (new_data >> 0x8) & 3;
+ m_fg_tilemap->mark_all_dirty();
+ }
+
+ /* Parallactic horizontal scroll registers follow */
+ }
+ else
+ m_txt_tilemap->mark_tile_dirty(offset);
+ }
+}
+
+/*------------------------------------------------------------------------
+ [ Background ]
+------------------------------------------------------------------------*/
+
+TILE_GET_INFO_MEMBER(wecleman_state::wecleman_get_bg_tile_info)
+{
+ int page = m_bgpage[((tile_index&0x7f)>>6) + ((tile_index>>12)<<1)];
+ int code = m_pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)];
+
+ SET_TILE_INFO_MEMBER(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0);
+}
+
+/*------------------------------------------------------------------------
+ [ Foreground ]
+------------------------------------------------------------------------*/
+
+TILE_GET_INFO_MEMBER(wecleman_state::wecleman_get_fg_tile_info)
+{
+ int page = m_fgpage[((tile_index&0x7f)>>6) + ((tile_index>>12)<<1)];
+ int code = m_pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)];
+
+ if (!code || code==0xffff) code = 0x20;
+ SET_TILE_INFO_MEMBER(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0);
+}
+
+/*------------------------------------------------------------------------
+ [ Pages (Background & Foreground) ]
+------------------------------------------------------------------------*/
+
+/* Pages that compose both the background and the foreground */
+WRITE16_MEMBER(wecleman_state::wecleman_pageram_w)
+{
+ COMBINE_DATA(&m_pageram[offset]);
+
+ {
+ int page,col,row;
+
+ page = ( offset ) / (PAGE_NX * PAGE_NY);
+ col = ( offset ) % PAGE_NX;
+ row = ( offset / PAGE_NX ) % PAGE_NY;
+
+ /* background */
+ if (m_bgpage[0] == page) m_bg_tilemap->mark_tile_dirty((col+PAGE_NX*0) + (row+PAGE_NY*0)*PAGE_NX*2 );
+ if (m_bgpage[1] == page) m_bg_tilemap->mark_tile_dirty((col+PAGE_NX*1) + (row+PAGE_NY*0)*PAGE_NX*2 );
+ if (m_bgpage[2] == page) m_bg_tilemap->mark_tile_dirty((col+PAGE_NX*0) + (row+PAGE_NY*1)*PAGE_NX*2 );
+ if (m_bgpage[3] == page) m_bg_tilemap->mark_tile_dirty((col+PAGE_NX*1) + (row+PAGE_NY*1)*PAGE_NX*2 );
+
+ /* foreground */
+ if (m_fgpage[0] == page) m_fg_tilemap->mark_tile_dirty((col+PAGE_NX*0) + (row+PAGE_NY*0)*PAGE_NX*2 );
+ if (m_fgpage[1] == page) m_fg_tilemap->mark_tile_dirty((col+PAGE_NX*1) + (row+PAGE_NY*0)*PAGE_NX*2 );
+ if (m_fgpage[2] == page) m_fg_tilemap->mark_tile_dirty((col+PAGE_NX*0) + (row+PAGE_NY*1)*PAGE_NX*2 );
+ if (m_fgpage[3] == page) m_fg_tilemap->mark_tile_dirty((col+PAGE_NX*1) + (row+PAGE_NY*1)*PAGE_NX*2 );
+ }
+}
+
+/*------------------------------------------------------------------------
+ Road Drawing
+
+ This layer is composed of horizontal lines gfx elements
+ There are 256 lines in ROM, each is 512 pixels wide
+
+ Offset: Elements: Data:
+ 0000-01ff 100 Words Code
+
+ fedcba98-------- Priority?
+ --------76543210 Line Number
+
+ 0200-03ff 100 Words Horizontal Scroll
+ 0400-05ff 100 Words Color
+ 0600-07ff 100 Words ??
+
+ We draw each line using a bunch of 64x1 tiles
+
+------------------------------------------------------------------------*/
+
+void wecleman_state::wecleman_draw_road(bitmap_rgb32 &bitmap, const rectangle &cliprect, int priority)
+{
+// must be powers of 2
+#define XSIZE 512
+#define YSIZE 256
+
+#define YMASK (YSIZE-1)
+
+#define DST_WIDTH 320
+#define DST_HEIGHT 224
+
+#define MIDCURB_DY 5
+#define TOPCURB_DY 7
+
+ static const pen_t road_color[48] =
+ {
+ 0x3f1,0x3f3,0x3f5,0x3fd,0x3fd,0x3fb,0x3fd,0x7ff, // road color 0
+ 0x3f0,0x3f2,0x3f4,0x3fc,0x3fc,0x3fb,0x3fc,0x7fe, // road color 1
+ 0, 0, 0,0x3f9,0x3f9, 0, 0, 0, // midcurb color 0
+ 0, 0, 0,0x3f8,0x3f8, 0, 0, 0, // midcurb color 1
+ 0, 0, 0,0x3f7, 0, 0, 0, 0, // topcurb color 0
+ 0, 0, 0,0x3f6, 0, 0, 0, 0 // topcutb color 1
+ };
+
+
+ const uint8_t *src_ptr;
+ const pen_t *pal_ptr, *rgb_ptr;
+
+ int scrollx, sy, sx;
+ int mdy, tdy, i;
+
+ rgb_ptr = m_palette->pens();
+
+ if (priority == 0x02)
+ {
+ // draw sky; each scanline is assumed to be dword aligned
+ for (sy=cliprect.min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
+ {
+ uint32_t *dst = &bitmap.pix32(sy+BMP_PAD, BMP_PAD);
+ uint32_t pix;
+ uint16_t road;
+
+ road = m_roadram[sy];
+ if ((road>>8) != 0x02) continue;
+
+ pix = rgb_ptr[(m_roadram[sy+(YSIZE*2)] & 0xf) + 0x7f0];
+
+ for (sx = 0; sx < DST_WIDTH; sx++)
+ dst[sx] = pix;
+ }
+ }
+ else if (priority == 0x04)
+ {
+ // draw road
+ pen_t road_rgb[48];
+
+ for (i=0; i<48; i++)
+ {
+ int color = road_color[i];
+ road_rgb[i] = color ? rgb_ptr[color] : 0xffffffff;
+ }
+
+ for (sy=cliprect.min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
+ {
+ uint32_t *dst = &bitmap.pix32(sy+BMP_PAD, BMP_PAD);
+ uint32_t pix;
+ uint16_t road;
+
+ road = m_roadram[sy];
+ if ((road>>8) != 0x04) continue;
+ road &= YMASK;
+
+ src_ptr = m_gfxdecode->gfx(1)->get_data((road << 3));
+ m_gfxdecode->gfx(1)->get_data((road << 3) + 1);
+ m_gfxdecode->gfx(1)->get_data((road << 3) + 2);
+ m_gfxdecode->gfx(1)->get_data((road << 3) + 3);
+ m_gfxdecode->gfx(1)->get_data((road << 3) + 4);
+ m_gfxdecode->gfx(1)->get_data((road << 3) + 5);
+ m_gfxdecode->gfx(1)->get_data((road << 3) + 6);
+ m_gfxdecode->gfx(1)->get_data((road << 3) + 7);
+ mdy = ((road * MIDCURB_DY) >> 8) * bitmap.rowpixels();
+ tdy = ((road * TOPCURB_DY) >> 8) * bitmap.rowpixels();
+
+ scrollx = m_roadram[sy+YSIZE] + (0x18 - 0xe00);
+
+ pal_ptr = road_rgb + ((m_roadram[sy+(YSIZE*2)]<<3) & 8);
+
+ for (sx = 0; sx < DST_WIDTH; sx++, scrollx++)
+ {
+ if (scrollx >= 0 && scrollx < XSIZE)
+ {
+ pen_t temp;
+
+ pix = src_ptr[scrollx];
+ dst[sx] = pal_ptr[pix];
+
+ temp = pal_ptr[pix + 16];
+ if (temp != 0xffffffff) dst[sx - mdy] = temp;
+
+ temp = pal_ptr[pix + 32];
+ if (temp != 0xffffffff) dst[sx - tdy] = temp;
+ }
+ else
+ dst[sx] = pal_ptr[7];
+ }
+ }
+ }
+
+#undef YSIZE
+#undef XSIZE
+}
+
+/*------------------------------------------------------------------------
+ Sky Drawing
+------------------------------------------------------------------------*/
+
+// blends two 8x8x16bpp direct RGB tilemaps
+void wecleman_state::draw_cloud(bitmap_rgb32 &bitmap,
+ gfx_element *gfx,
+ uint16_t *tm_base,
+ int x0, int y0, // target coordinate
+ int xcount, int ycount, // number of tiles to draw in x and y
+ int scrollx, int scrolly, // tilemap scroll position
+ int tmw_l2, int tmh_l2, // tilemap width and height in log(2)
+ int alpha, int pal_offset ) // alpha(0-3f), # of color codes to shift
+{
+ const uint8_t *src_ptr;
+ uint16_t *tmap_ptr;
+ uint32_t *dst_base, *dst_ptr;
+ const pen_t *pal_base, *pal_ptr;
+
+ int tilew, tileh;
+ int tmskipx, tmskipy, tmscanx, tmmaskx, tmmasky;
+ int dx, dy;
+ int i, j, tx, ty;
+
+ if (alpha > 0x1f) return;
+
+ tilew = gfx->width();
+ tileh = gfx->height();
+
+ tmmaskx = (1<<tmw_l2) - 1;
+ tmmasky = (1<<tmh_l2) - 1;
+
+ scrollx &= ((tilew<<tmw_l2) - 1);
+ scrolly &= ((tileh<<tmh_l2) - 1);
+
+ tmskipx = scrollx / tilew;
+ dx = -(scrollx & (tilew-1));
+ tmskipy = scrolly / tileh;
+ dy = -(scrolly & (tileh-1));
+
+ dst_base = &bitmap.pix32(y0+dy, x0+dx);
+
+ pal_base = m_palette->pens() + pal_offset * gfx->granularity();
+
+ alpha <<= 6;
+
+ dst_base += 8;
+ for (i = 0; i < ycount; i++)
+ {
+ tmap_ptr = tm_base + ((tmskipy++ & tmmasky)<<tmw_l2);
+ tmscanx = tmskipx;
+
+ for (j = 0; j < xcount; j++)
+ {
+ uint16_t tiledata = tmap_ptr[tmscanx++ & tmmaskx];
+
+ // Wec Le Mans specific: decodes tile index in EBX
+ uint16_t tile_index = tiledata & 0xfff;
+
+ // Wec Le Mans specific: decodes tile color in EAX
+ uint16_t tile_color = ((tiledata >> 5) & 0x78) + (tiledata >> 12);
+
+ src_ptr = gfx->get_data(tile_index);
+ pal_ptr = pal_base + tile_color * gfx->granularity();
+ dst_ptr = dst_base + j * tilew;
+
+ /* alpha case */
+ if (alpha > 0)
+ {
+ for (ty = 0; ty < tileh; ty++)
+ {
+ for (tx = 0; tx < tilew; tx++)
+ {
+ uint8_t srcpix = *src_ptr++;
+ pen_t srcrgb = pal_ptr[srcpix];
+ uint32_t dstrgb = dst_ptr[tx];
+ int sr, sg, sb, dr, dg, db;
+
+ sr = (srcrgb >> 3) & 0x1f;
+ sg = (srcrgb >> 11) & 0x1f;
+ sb = (srcrgb >> 19) & 0x1f;
+
+ dr = (dstrgb >> 3) & 0x1f;
+ dg = (dstrgb >> 11) & 0x1f;
+ db = (dstrgb >> 19) & 0x1f;
+
+ dr = (m_t32x32pm[dr - sr + alpha] >> 5) + dr;
+ dg = (m_t32x32pm[dg - sg + alpha] >> 5) + dg;
+ db = (m_t32x32pm[db - sb + alpha] >> 5) + db;
+
+ dst_ptr[tx] = rgb_t(pal5bit(db), pal5bit(dg), pal5bit(dr));
+ }
+ dst_ptr += bitmap.rowpixels();
+ }
+ }
+
+ /* non-alpha case */
+ else
+ {
+ for (ty = 0; ty < tileh; ty++)
+ {
+ for (tx = 0; tx < tilew; tx++)
+ dst_ptr[tx] = pal_ptr[*src_ptr++];
+ dst_ptr += bitmap.rowpixels();
+ }
+ }
+ }
+
+ dst_base += bitmap.rowpixels() * tileh;
+ }
+}
+
+/***************************************************************************
+ Hot Chase
+***************************************************************************/
+
+/*------------------------------------------------------------------------
+ Road Drawing
+
+ This layer is composed of horizontal lines gfx elements
+ There are 512 lines in ROM, each is 512 pixels wide
+
+ Offset: Elements: Data:
+ 0000-03ff 00-FF Code (4 bytes)
+
+ Code:
+ 00.w
+ fedc ba98 ---- ---- Unused?
+ ---- ---- 7654 ---- color
+ ---- ---- ---- 3210 scroll x
+ 02.w
+ fedc ba-- ---- ---- scroll x
+ ---- --9- ---- ---- ?
+ ---- ---8 7654 3210 code
+
+ We draw each line using a bunch of 64x1 tiles
+
+------------------------------------------------------------------------*/
+
+void wecleman_state::hotchase_draw_road(bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+/* Referred to what's in the ROMs */
+#define XSIZE 512
+#define YSIZE 512
+
+ int sx, sy;
+ const rectangle &visarea = m_screen->visible_area();
+
+ /* Let's draw from the top to the bottom of the visible screen */
+ for (sy = visarea.min_y;sy <= visarea.max_y;sy++)
+ {
+ int code = m_roadram[sy*4/2+2/2] + (m_roadram[sy*4/2+0/2] << 16);
+ int color = ((code & 0x00f00000) >> 20) + 0x70;
+ int scrollx = ((code & 0x0007fc00) >> 10) * 2;
+
+ /* convert line number in gfx element number: */
+ /* code is the tile code of the start of this line */
+ code &= 0x1ff;
+ code *= XSIZE / 32;
+
+ for (sx=0; sx<2*XSIZE; sx+=64)
+ {
+ m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
+ code++,
+ color,
+ 0,0,
+ ((sx-scrollx)&0x3ff)-(384-32),sy,0);
+ }
+ }
+
+#undef XSIZE
+#undef YSIZE
+}
+
+
+/***************************************************************************
+ Palette Routines
+***************************************************************************/
+
+// new video and palette code
+// TODO: remove me.
+WRITE16_MEMBER(wecleman_state::wecleman_videostatus_w)
+{
+ COMBINE_DATA(m_videostatus);
+
+ // bit0-6: background transition, 0=off, 1=on
+ // bit7: palette being changed, 0=no, 1=yes
+ if (ACCESSING_BITS_0_7)
+ {
+ if ((data & 0x7f) == 0 && !m_cloud_ds)
+ m_cloud_ds = BLEND_INC;
+ else
+ if ((data & 0x7f) == 1 && !m_cloud_visible)
+ {
+ data ^= 1;
+ m_cloud_ds = BLEND_DEC;
+ m_cloud_visible = 1;
+ }
+ }
+}
+
+WRITE16_MEMBER(wecleman_state::hotchase_paletteram16_SBGRBBBBGGGGRRRR_word_w)
+{
+ int newword, r, g, b;
+
+ newword = COMBINE_DATA(&m_generic_paletteram_16[offset]);
+
+ r = ((newword << 1) & 0x1E ) | ((newword >> 12) & 0x01);
+ g = ((newword >> 3) & 0x1E ) | ((newword >> 13) & 0x01);
+ b = ((newword >> 7) & 0x1E ) | ((newword >> 14) & 0x01);
+
+ m_palette->set_pen_color(offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ r>>=1; g>>=1; b>>=1;
+ m_palette->set_pen_color(offset+0x800, pal5bit(r)/2, pal5bit(g)/2, pal5bit(b)/2);
+}
+
+WRITE16_MEMBER(wecleman_state::wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w)
+{
+ int newword = COMBINE_DATA(&m_generic_paletteram_16[offset]);
+
+ // the highest nibble has some unknown functions
+// if (newword & 0xf000) logerror("MSN set on color %03x: %1x\n", offset, newword>>12);
+ m_palette->set_pen_color(offset, pal4bit(newword >> 0), pal4bit(newword >> 4), pal4bit(newword >> 8));
+}
+
+
+/***************************************************************************
+ Initializations
+***************************************************************************/
+
+VIDEO_START_MEMBER(wecleman_state,wecleman)
+{
+ /*
+ Sprite banking - each bank is 0x20000 bytes (we support 0x40 bank codes)
+ This game has ROMs for 16 banks
+ */
+ static const int bank[0x40] =
+ {
+ 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,
+ 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,
+ 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,
+ 8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15
+ };
+
+ uint8_t *buffer;
+ int i, j;
+
+ assert(m_screen->format() == BITMAP_FORMAT_RGB32);
+ buffer = auto_alloc_array(machine(), uint8_t, 0x12c00); // working buffer for sprite operations
+
+ m_gameid = 0;
+ m_gfx_bank = bank;
+ m_spr_offsx = -0xbc + BMP_PAD;
+ m_spr_offsy = 1 + BMP_PAD;
+ m_cloud_blend = BLEND_MAX;
+ m_cloud_ds = 0;
+ m_cloud_visible = 0;
+ m_black_pen = m_palette->black_pen();
+
+ m_rgb_half = (uint16_t*)(buffer + 0x00000);
+ m_t32x32pm = (int*)(buffer + 0x10020);
+ m_spr_ptr_list = (struct sprite **)(buffer + 0x12000);
+ m_spr_idx_list = (int *)(buffer + 0x12400);
+ m_spr_pri_list = (int *)(buffer + 0x12800);
+
+ for (i=0; i<0x8000; i++)
+ {
+ j = i>>1;
+ m_rgb_half[i] = (j&0xf) | (j&0x1e0) | (j&0x3c00);
+ }
+
+ for (j=0; j<0x20; j++)
+ {
+ for (i=-0x1f; i<0x20; i++)
+ {
+ *(m_t32x32pm + (j<<6) + i) = i * j;
+ }
+ }
+
+ m_sprite_list = auto_alloc_array_clear(machine(), struct sprite, NUM_SPRITES);
+
+ m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_bg_tile_info),this),
+ TILEMAP_SCAN_ROWS,
+ /* We draw part of the road below */
+ 8,8,
+ PAGE_NX * 2, PAGE_NY * 2 );
+
+ m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_fg_tile_info),this),
+ TILEMAP_SCAN_ROWS,
+
+ 8,8,
+ PAGE_NX * 2, PAGE_NY * 2);
+
+ m_txt_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wecleman_state::wecleman_get_txt_tile_info),this),
+ TILEMAP_SCAN_ROWS,
+
+ 8,8,
+ PAGE_NX * 1, PAGE_NY * 1);
+
+ m_bg_tilemap->set_scroll_rows(TILEMAP_DIMY); /* Screen-wise scrolling */
+ m_bg_tilemap->set_scroll_cols(1);
+ m_bg_tilemap->set_transparent_pen(0);
+
+ m_fg_tilemap->set_scroll_rows(TILEMAP_DIMY); /* Screen-wise scrolling */
+ m_fg_tilemap->set_scroll_cols(1);
+ m_fg_tilemap->set_transparent_pen(0);
+
+ m_txt_tilemap->set_scroll_rows(1);
+ m_txt_tilemap->set_scroll_cols(1);
+ m_txt_tilemap->set_transparent_pen(0);
+
+ m_txt_tilemap->set_scrollx(0, 512-320-16 -BMP_PAD);
+ m_txt_tilemap->set_scrolly(0, -BMP_PAD );
+
+ // patches out a mysterious pixel floating in the sky (tile decoding bug?)
+ *const_cast<uint8_t *>(m_gfxdecode->gfx(0)->get_data(0xaca)+7) = 0;
+}
+
+VIDEO_START_MEMBER(wecleman_state,hotchase)
+{
+ /*
+ Sprite banking - each bank is 0x20000 bytes (we support 0x40 bank codes)
+ This game has ROMs for 0x30 banks
+ */
+ static const int bank[0x40] =
+ {
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
+ 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
+ };
+
+ uint8_t *buffer;
+
+ buffer = auto_alloc_array(machine(), uint8_t, 0x400); // reserve 1k for sprite list
+
+ m_gameid = 1;
+ m_gfx_bank = bank;
+ m_spr_offsx = -0xc0;
+ m_spr_offsy = 0;
+ m_black_pen = m_palette->black_pen();
+
+ m_spr_ptr_list = (struct sprite **)buffer;
+
+ m_sprite_list = auto_alloc_array_clear(machine(), struct sprite, NUM_SPRITES);
+}
+
+
+/***************************************************************************
+ Video Updates
+***************************************************************************/
+
+uint32_t wecleman_state::screen_update_wecleman(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+{
+ const pen_t *mrct;
+ int video_on;
+ int fg_x, bg_x, fg_y, bg_y;
+ int cloud_sx, cloud_sy;
+ int i, j, k;
+
+ mrct = m_palette->pens();
+
+ video_on = m_irqctrl & 0x40;
+
+ output().set_led_value(0, m_selected_ip & 0x04); // Start lamp
+
+ fg_y = (m_txtram[0x0f24>>1] & (TILEMAP_DIMY - 1));
+ bg_y = (m_txtram[0x0f26>>1] & (TILEMAP_DIMY - 1));
+
+ cloud_sx = m_txtram[0xfee>>1] + 0xb0;
+ cloud_sy = bg_y;
+
+ m_bg_tilemap->set_scrolly(0, bg_y -BMP_PAD);
+ m_fg_tilemap->set_scrolly(0, fg_y -BMP_PAD);
+
+ for (i=0; i<(28<<2); i+=4)
+ {
+ fg_x = m_txtram[(i+0xf80)>>1] + (0xb0 -BMP_PAD);
+ bg_x = m_txtram[(i+0xf82)>>1] + (0xb0 -BMP_PAD);
+
+ k = i<<1;
+ for (j=0; j<8; j++)
+ {
+ m_fg_tilemap->set_scrollx((fg_y + k + j) & (TILEMAP_DIMY - 1), fg_x);
+ m_bg_tilemap->set_scrollx((bg_y + k + j) & (TILEMAP_DIMY - 1), bg_x);
+ }
+ }
+
+ // temporary fix for ranking screen tile masking
+ /* palette hacks! */
+ ((pen_t *)mrct)[0x27] = mrct[0x24];
+
+ get_sprite_info();
+
+ bitmap.fill(m_black_pen, cliprect);
+
+ /* Draw the road (lines which have priority 0x02) */
+ if (video_on) wecleman_draw_road(bitmap, cliprect, 0x02);
+
+ /* Draw the background */
+ if (video_on) m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+
+ // draws the cloud layer; needs work
+ if (m_cloud_visible)
+ {
+ /* palette hacks! */
+ ((pen_t *)mrct)[0] = ((pen_t *)mrct)[0x40] = ((pen_t *)mrct)[0x200] = ((pen_t *)mrct)[0x205];
+
+ if (video_on)
+ draw_cloud(bitmap,
+ m_gfxdecode->gfx(0),
+ m_pageram+0x1800,
+ BMP_PAD, BMP_PAD,
+ 41, 20,
+ cloud_sx, cloud_sy,
+ 6, 5,
+ m_cloud_blend/BLEND_STEPS, 0);
+
+ m_cloud_blend += m_cloud_ds;
+
+ if (m_cloud_blend < BLEND_MIN)
+ { m_cloud_blend = BLEND_MIN; m_cloud_ds = 0; *m_videostatus |= 1; }
+ else if (m_cloud_blend > BLEND_MAX)
+ { m_cloud_blend = BLEND_MAX; m_cloud_ds = 0; m_cloud_visible = 0; }
+ }
+
+ /* Draw the foreground */
+ if (video_on) m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+
+ /* Draw the road (lines which have priority 0x04) */
+ if (video_on) wecleman_draw_road(bitmap,cliprect, 0x04);
+
+ /* Draw the sprites */
+ if (video_on) sprite_draw(bitmap,cliprect);
+
+ /* Draw the text layer */
+ if (video_on) m_txt_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+ return 0;
+}
+
+/***************************************************************************
+ Hot Chase
+***************************************************************************/
+
+uint32_t wecleman_state::screen_update_hotchase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ int video_on;
+
+ video_on = m_irqctrl & 0x40;
+
+ output().set_led_value(0, m_selected_ip & 0x04); // Start lamp
+
+ get_sprite_info();
+
+ bitmap.fill(m_black_pen, cliprect);
+
+ /* Draw the background */
+#if 0
+ if (video_on)
+ m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 0);
+#endif
+
+ /* Draw the road */
+ if (video_on)
+ hotchase_draw_road(bitmap, cliprect);
+
+ /* Draw the sprites */
+ if (video_on)
+ sprite_draw(bitmap,cliprect);
+
+ /* Draw the foreground (text) */
+#if 0
+ if (video_on)
+ m_k051316_2->zoom_draw(screen, bitmap, cliprect, 0, 0);
+#endif
+ return 0;
+}
+
+
/***************************************************************************
Common Routines
***************************************************************************/
@@ -543,10 +1787,10 @@ static ADDRESS_MAP_START( hotchase_map, AS_PROGRAM, 16, wecleman_state )
AM_RANGE(0x040000, 0x041fff) AM_RAM // RAM
AM_RANGE(0x060000, 0x063fff) AM_RAM // RAM
AM_RANGE(0x080000, 0x080011) AM_RAM_WRITE(blitter_w) AM_SHARE("blitter_regs") // Blitter
- AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE8("k051316_1", k051316_device, read, write, 0x00ff) // Background
- AM_RANGE(0x101000, 0x10101f) AM_DEVWRITE8("k051316_1", k051316_device, ctrl_w, 0x00ff) // Background Ctrl
- AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE8("k051316_2", k051316_device, read, write, 0x00ff) // Foreground
- AM_RANGE(0x103000, 0x10301f) AM_DEVWRITE8("k051316_2", k051316_device, ctrl_w, 0x00ff) // Foreground Ctrl
+ AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE8("roz_1", k051316_device, vram_r, vram_w, 0x00ff) // Background
+ AM_RANGE(0x101000, 0x10101f) AM_DEVICE8("roz_1", k051316_device, map, 0x00ff) // Background Ctrl
+ AM_RANGE(0x102000, 0x102fff) AM_DEVREADWRITE8("roz_2", k051316_device, vram_r, vram_w, 0x00ff) // Foreground
+ AM_RANGE(0x103000, 0x10301f) AM_DEVICE8("roz_2", k051316_device, map, 0x00ff) // Foreground Ctrl
AM_RANGE(0x110000, 0x111fff) AM_RAM_WRITE(hotchase_paletteram16_SBGRBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x120000, 0x123fff) AM_RAM AM_SHARE("share1") // Shared with sub CPU
AM_RANGE(0x130000, 0x130fff) AM_RAM AM_SHARE("spriteram") // Sprites
@@ -1172,16 +2416,10 @@ static MACHINE_CONFIG_START( hotchase )
MCFG_VIDEO_START_OVERRIDE(wecleman_state, hotchase)
- MCFG_DEVICE_ADD("k051316_1", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(-0xb0 / 2, -16)
+ MCFG_K051316_ADD("roz_1", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x03ffff; color = (address & 0xfc0000) >> 14; })
MCFG_K051316_WRAP(1)
- MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_1)
- MCFG_DEVICE_ADD("k051316_2", K051316, 0)
- MCFG_GFX_PALETTE("palette")
- MCFG_K051316_OFFSETS(-0xb0 / 2, -16)
- MCFG_K051316_CB(wecleman_state, hotchase_zoom_callback_2)
+ MCFG_K051316_ADD("roz_2", 4, false, [](u32 address, u32 &code, u16 &color) { code = address & 0x007fff; color = (address & 0x3f8000) >> 11; })
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp
index 4757bfbaf6b..e2c952e55d1 100644
--- a/src/mame/drivers/xexex.cpp
+++ b/src/mame/drivers/xexex.cpp
@@ -77,32 +77,11 @@ Notes:
****************************************************************************
-Change Log
-----------
-
-(ATXXXX03)
-
-Hooked up missing memory handler, emulated object DMA, revised IRQ,
-rewrote the K053250(LVC) effect generator, ported tilemaps to use the
-K056832 emulation(the K054157 is a complete subset of the K056832),
-corrected a few K054539 PCM chip misbehaviors, etc.
-
-
The following bugs appear to be fixed:
General:
- game doesn't slow down like the arcade
- IRQ 5 is the "OBJDMA end interrupt" and shouldn't be triggered
- if DMA didn't complete within the frame.
-
- * game speed may not be 100% correct but close to that on the
- Gamest video especially in stage 6. Xexex is 384x256 which suggests
- an 8Mhz horizontal dotclock and DMA delay can range up to 32.0us(clear)
- + 256.0us(transfer). Increase XE_DMADELAY if emulation runs faster
- than the original or use cheat to overclock CPU 0 if you prefer faster
- gameplay.
-
- sprite lag, dithering, flicking (DMA)
- line effects go out of sync (K053250 also does DMA)
- inconsistent reverb (maths bug)
@@ -132,123 +111,269 @@ Unresolved Issues:
***************************************************************************/
#include "emu.h"
-#include "includes/xexex.h"
#include "includes/konamipt.h"
-
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
#include "machine/eepromser.h"
#include "machine/k053252.h"
+#include "machine/k054321.h"
#include "sound/flt_vol.h"
#include "sound/k054539.h"
#include "sound/ym2151.h"
+#include "video/k053246_k053247_k055673.h"
+#include "video/k053250.h"
+#include "video/k053251.h"
+#include "video/k054156_k054157_k056832.h"
+#include "video/k054338.h"
#include "speaker.h"
+class xexex_state : public driver_device, public flow_render::interface
+{
+public:
+ xexex_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ flow_render::interface(mconfig, *this),
+ m_workram(*this, "workram"),
+ m_spriteram(*this, "spriteram"),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_k054539(*this, "k054539"),
+ m_filter1l(*this, "filter1l"),
+ m_filter1r(*this, "filter1r"),
+ m_filter2l(*this, "filter2l"),
+ m_filter2r(*this, "filter2r"),
+ m_tilemap(*this, "tilemap"),
+ m_sprites(*this, "sprites"),
+ m_lvc(*this, "lvc"),
+ m_mixer(*this, "mixer"),
+ m_video_timings(*this, "video_timings"),
+ m_blender(*this, "blender"),
+ m_palette(*this, "palette"),
+ m_screen(*this, "screen"),
+ m_soundctrl(*this, "soundctrl") { }
+
+ /* memory pointers */
+ required_shared_ptr<u16> m_workram;
+ required_shared_ptr<u16> m_spriteram;
+
+ /* video-related */
+ bool m_chenmix;
+ flow_render::renderer *m_renderer_prefilter[2], *m_renderer_postfilter;
+ flow_render::input_sb_u16 *m_renderer_input_prefilter[2];
+ flow_render::input_sb_u16 *m_renderer_input_postfilter[5];
+ flow_render::output_sb_u16 *m_renderer_output_prefilter[2];
+ flow_render::output_sb_u16 *m_renderer_output_postfilter[4];
+
+ /* misc */
+ u16 m_cur_control2;
+ u16 m_cur_interrupt;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<k054539_device> m_k054539;
+ required_device<filter_volume_device> m_filter1l;
+ required_device<filter_volume_device> m_filter1r;
+ required_device<filter_volume_device> m_filter2l;
+ required_device<filter_volume_device> m_filter2r;
+ required_device<k054156_054157_device> m_tilemap;
+ required_device<k053246_053247_device> m_sprites;
+ required_device<k053250_device> m_lvc;
+ required_device<k053251_device> m_mixer;
+ required_device<k053252_device> m_video_timings;
+ required_device<k054338_device> m_blender;
+ required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
+ required_device<k054321_device> m_soundctrl;
+
+ DECLARE_WRITE_LINE_MEMBER(objdma_w);
+ DECLARE_WRITE_LINE_MEMBER(whatever_w);
+
+ DECLARE_READ16_MEMBER(control2_r);
+ DECLARE_WRITE16_MEMBER(control2_w);
+ DECLARE_WRITE16_MEMBER(sound_irq_w);
+ DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
+ DECLARE_DRIVER_INIT(xexex);
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ K054539_CB_MEMBER(ym_set_mixing);
+
+ void flow_render_register_renderers() override;
+ void update_irq();
+ void sprites_wiring(u32 output, u16 &color, u16 &attr);
+ offs_t sprites_remap(offs_t offset);
+ void fr_setup(flow_render::manager *manager);
+ void render_prefilter(bool render_front, const rectangle &cliprect);
+ void render_postfilter(const rectangle &cliprect);
+};
+
+void xexex_state::fr_setup(flow_render::manager *manager)
+{
+ auto rb = m_blender->flow_render_get_renderer();
+ auto rm1 = m_mixer ->flow_render_get_renderer();
+ auto rm2 = m_mixer ->flow_render_get_renderer("secondary");
+ auto rs = m_sprites->flow_render_get_renderer();
+ auto rl = m_lvc ->flow_render_get_renderer();
+
+ manager->connect(rs->out("color"), rm1->inp("0 color"));
+ manager->connect(rs->out("color"), rm2->inp("0 color"));
+ manager->connect(rs->out("attr"), rm1->inp("0 attr"));
+ manager->connect(rs->out("attr"), rm2->inp("0 attr"));
+ manager->connect(rl->out("color"), rm1->inp("1 color"));
+ manager->connect(rl->out("color"), rm2->inp("1 color"));
+ manager->connect(rl->out("attr"), rm1->inp("1 attr"));
+ manager->connect(rl->out("attr"), rm2->inp("1 attr"));
+
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), m_renderer_input_prefilter[0]);
+ manager->connect(m_tilemap->flow_render_get_renderer("b")->out(), m_renderer_input_prefilter[1]);
+ manager->connect(m_renderer_output_prefilter[0], rm1->inp("2 color"));
+ manager->connect(m_renderer_output_prefilter[1], rm2->inp("2 color"));
+
+ manager->set_constant(rm1->inp("2 attr"), 0);
+ manager->set_constant(rm2->inp("2 attr"), 0);
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm1->inp("3 color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("c")->out(), rm2->inp("3 color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm1->inp("4 color"));
+ manager->connect(m_tilemap->flow_render_get_renderer("d")->out(), rm2->inp("4 color"));
+
+ manager->connect(rm1->out("color"), m_renderer_input_postfilter[0]);
+ manager->connect(rm1->out("attr"), m_renderer_input_postfilter[1]);
+ manager->connect(rm2->out("color"), m_renderer_input_postfilter[2]);
+ manager->connect(rm2->out("attr"), m_renderer_input_postfilter[3]);
+ manager->connect(m_tilemap->flow_render_get_renderer("a")->out(), m_renderer_input_postfilter[4]);
+
+ manager->connect(m_renderer_output_postfilter[0], rb->inp("0 color"));
+ manager->connect(m_renderer_output_postfilter[1], rb->inp("0 attr"));
+ manager->connect(m_renderer_output_postfilter[2], rb->inp("1 color"));
+ manager->connect(m_renderer_output_postfilter[3], rb->inp("1 attr"));
+
+ manager->connect(rb->out(), m_screen->flow_render_get_renderer()->inp());
+}
-#define XE_DEBUG 0
-#define XE_SKIPIDLE 1
-#define XE_DMADELAY attotime::from_usec(256)
-
-#if 0 // (for reference; do not remove)
-
-/* the interface with the 053247 is weird. The chip can address only 0x1000 bytes */
-/* of RAM, but they put 0x8000 there. The CPU can access them all. Address lines */
-/* A1, A5 and A6 don't go to the 053247. */
-READ16_MEMBER(xexex_state::k053247_scattered_word_r)