summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/source/advanced/bgfx.rst4
-rw-r--r--hash/bbc_rom.xml252
-rw-r--r--hash/bbcm_cart.xml164
-rw-r--r--hash/gamegear.xml634
-rw-r--r--hash/gameking.xml309
-rw-r--r--hash/gameking3.xml17
-rw-r--r--hash/sms.xml128
-rw-r--r--nl_examples/ne555_astable.c12
-rw-r--r--scripts/src/bus.lua110
-rw-r--r--scripts/target/mame/mess.lua14
-rw-r--r--src/devices/bus/bbc/1mhzbus/1mhzbus.cpp2
-rw-r--r--src/devices/bus/bbc/analogue/analogue.cpp2
-rw-r--r--src/devices/bus/bbc/cart/click.cpp113
-rw-r--r--src/devices/bus/bbc/cart/click.h47
-rw-r--r--src/devices/bus/bbc/cart/mega256.cpp97
-rw-r--r--src/devices/bus/bbc/cart/mega256.h47
-rw-r--r--src/devices/bus/bbc/cart/mr8000.cpp102
-rw-r--r--src/devices/bus/bbc/cart/mr8000.h46
-rw-r--r--src/devices/bus/bbc/cart/msc.cpp104
-rw-r--r--src/devices/bus/bbc/cart/msc.h48
-rw-r--r--src/devices/bus/bbc/cart/slot.cpp79
-rw-r--r--src/devices/bus/bbc/cart/slot.h161
-rw-r--r--src/devices/bus/bbc/exp/autocue.cpp100
-rw-r--r--src/devices/bus/bbc/exp/autocue.h51
-rw-r--r--src/devices/bus/bbc/exp/exp.cpp6
-rw-r--r--src/devices/bus/bbc/internal/aries.cpp337
-rw-r--r--src/devices/bus/bbc/internal/aries.h117
-rw-r--r--src/devices/bus/bbc/internal/atpl.cpp250
-rw-r--r--src/devices/bus/bbc/internal/atpl.h85
-rw-r--r--src/devices/bus/bbc/internal/cumana68k.cpp330
-rw-r--r--src/devices/bus/bbc/internal/cumana68k.h91
-rw-r--r--src/devices/bus/bbc/internal/integrab.cpp342
-rw-r--r--src/devices/bus/bbc/internal/integrab.h67
-rw-r--r--src/devices/bus/bbc/internal/internal.cpp214
-rw-r--r--src/devices/bus/bbc/internal/internal.h113
-rw-r--r--src/devices/bus/bbc/internal/morleyaa.cpp307
-rw-r--r--src/devices/bus/bbc/internal/morleyaa.h54
-rw-r--r--src/devices/bus/bbc/internal/overlay.cpp224
-rw-r--r--src/devices/bus/bbc/internal/overlay.h57
-rw-r--r--src/devices/bus/bbc/internal/peartree.cpp295
-rw-r--r--src/devices/bus/bbc/internal/peartree.h116
-rw-r--r--src/devices/bus/bbc/internal/ramamp.cpp155
-rw-r--r--src/devices/bus/bbc/internal/ramamp.h55
-rw-r--r--src/devices/bus/bbc/internal/raven20.cpp112
-rw-r--r--src/devices/bus/bbc/internal/raven20.h52
-rw-r--r--src/devices/bus/bbc/internal/romex.cpp134
-rw-r--r--src/devices/bus/bbc/internal/romex.h53
-rw-r--r--src/devices/bus/bbc/internal/stl2m128.cpp248
-rw-r--r--src/devices/bus/bbc/internal/stl2m128.h59
-rw-r--r--src/devices/bus/bbc/internal/stl4m32.cpp303
-rw-r--r--src/devices/bus/bbc/internal/stl4m32.h67
-rw-r--r--src/devices/bus/bbc/internal/stlswr.cpp192
-rw-r--r--src/devices/bus/bbc/internal/stlswr.h108
-rw-r--r--src/devices/bus/bbc/internal/we32kram.cpp142
-rw-r--r--src/devices/bus/bbc/internal/we32kram.h55
-rw-r--r--src/devices/bus/bbc/internal/werom.cpp260
-rw-r--r--src/devices/bus/bbc/internal/werom.h90
-rw-r--r--src/devices/bus/bbc/internal/weromram.cpp133
-rw-r--r--src/devices/bus/bbc/internal/weromram.h58
-rw-r--r--src/devices/bus/bbc/rom/nvram.cpp58
-rw-r--r--src/devices/bus/bbc/rom/nvram.h42
-rw-r--r--src/devices/bus/bbc/rom/ram.cpp1
-rw-r--r--src/devices/bus/bbc/rom/rom.cpp4
-rw-r--r--src/devices/bus/bbc/rom/slot.cpp5
-rw-r--r--src/devices/bus/bbc/rom/slot.h8
-rw-r--r--src/devices/bus/bbc/tube/tube.cpp10
-rw-r--r--src/devices/bus/bbc/tube/tube_80186.cpp53
-rw-r--r--src/devices/bus/bbc/tube/tube_80186.h21
-rw-r--r--src/devices/bus/bbc/userport/userport.cpp9
-rw-r--r--src/devices/bus/bbc/userport/voicebox.cpp91
-rw-r--r--src/devices/bus/bbc/userport/voicebox.h52
-rw-r--r--src/devices/bus/electron/cart/slot.cpp9
-rw-r--r--src/devices/bus/electron/cart/slot.h4
-rw-r--r--src/devices/bus/electron/exp.cpp4
-rw-r--r--src/devices/bus/electron/sidewndr.cpp189
-rw-r--r--src/devices/bus/electron/sidewndr.h60
-rw-r--r--src/devices/bus/hp80_optroms/hp80_optrom.cpp125
-rw-r--r--src/devices/bus/hp80_optroms/hp80_optrom.h91
-rw-r--r--src/devices/bus/hp_optroms/hp_optrom.cpp139
-rw-r--r--src/devices/bus/hp_optroms/hp_optrom.h78
-rw-r--r--src/devices/bus/spectrum/kempjoy.cpp2
-rw-r--r--src/devices/bus/spectrum/melodik.cpp4
-rw-r--r--src/devices/bus/spectrum/mikroplus.cpp2
-rw-r--r--src/devices/bus/ss50/dc5.cpp117
-rw-r--r--src/devices/bus/ss50/mps.cpp30
-rw-r--r--src/devices/bus/ss50/mps2.cpp48
-rw-r--r--src/devices/bus/ss50/mpt.cpp10
-rw-r--r--src/devices/bus/ss50/piaide.cpp8
-rw-r--r--src/devices/cpu/i86/i86.cpp1
-rw-r--r--src/devices/cpu/m6502/st2204.cpp407
-rw-r--r--src/devices/cpu/m6502/st2204.h102
-rw-r--r--src/devices/cpu/m6502/st2205u.cpp295
-rw-r--r--src/devices/cpu/m6502/st2205u.h64
-rw-r--r--src/devices/cpu/m6502/st2xxx.cpp550
-rw-r--r--src/devices/cpu/m6502/st2xxx.h148
-rw-r--r--src/devices/cpu/sh/sh2.cpp2
-rw-r--r--src/devices/cpu/sh/sh2.h4
-rw-r--r--src/devices/cpu/sh/sh2comn.cpp53
-rw-r--r--src/devices/cpu/superfx/superfx.cpp4
-rw-r--r--src/devices/cpu/superfx/superfx.h4
-rw-r--r--src/devices/machine/spg2xx_video.cpp52
-rw-r--r--src/devices/machine/spg2xx_video.h1
-rw-r--r--src/devices/machine/wd1000.cpp53
-rw-r--r--src/devices/machine/wd1000.h7
-rw-r--r--src/devices/video/mc6845.cpp10
-rw-r--r--src/devices/video/mc6845.h4
-rw-r--r--src/devices/video/ppu2c0x_vt.cpp22
-rw-r--r--src/devices/video/ppu2c0x_vt.h9
-rw-r--r--src/devices/video/snes_ppu.cpp1020
-rw-r--r--src/devices/video/snes_ppu.h33
-rw-r--r--src/emu/screen.cpp41
-rw-r--r--src/lib/netlist/analog/nld_bjt.cpp8
-rw-r--r--src/lib/netlist/analog/nld_mosfet.cpp30
-rw-r--r--src/lib/netlist/analog/nld_opamps.cpp8
-rw-r--r--src/lib/netlist/build/doxygen.conf9
-rw-r--r--src/lib/netlist/build/makefile10
-rwxr-xr-xsrc/lib/netlist/buildVS/netlistlib.vcxproj43
-rwxr-xr-xsrc/lib/netlist/buildVS/netlistlib.vcxproj.filters90
-rwxr-xr-xsrc/lib/netlist/buildVS/nltool.vcxproj15
-rw-r--r--src/lib/netlist/devices/nld_7493.cpp64
-rw-r--r--src/lib/netlist/devices/nld_ne555.cpp95
-rw-r--r--src/lib/netlist/devices/nld_system.cpp57
-rw-r--r--src/lib/netlist/devices/nlid_system.h70
-rw-r--r--src/lib/netlist/documentation/primer_1.dox.h4
-rw-r--r--src/lib/netlist/documentation/structure.dox.h34
-rw-r--r--src/lib/netlist/macro/nlm_base.h3
-rw-r--r--src/lib/netlist/macro/nlm_cd4xxx.h3
-rw-r--r--src/lib/netlist/netlist.cppcheck26
-rw-r--r--src/lib/netlist/nl_base.cpp28
-rw-r--r--src/lib/netlist/nl_base.h550
-rw-r--r--src/lib/netlist/nl_config.h154
-rw-r--r--src/lib/netlist/nl_errstr.h13
-rw-r--r--src/lib/netlist/nl_factory.cpp9
-rw-r--r--src/lib/netlist/nl_factory.h19
-rw-r--r--src/lib/netlist/nl_parser.cpp4
-rw-r--r--src/lib/netlist/nl_parser.h13
-rw-r--r--src/lib/netlist/nl_setup.cpp40
-rw-r--r--src/lib/netlist/nl_setup.h79
-rw-r--r--src/lib/netlist/nltypes.h83
-rw-r--r--src/lib/netlist/prg/nltool.cpp186
-rw-r--r--src/mame/audio/elan_eu3a05.cpp149
-rw-r--r--src/mame/audio/elan_eu3a05.h33
-rw-r--r--src/mame/drivers/apple2e.cpp8
-rw-r--r--src/mame/drivers/bbc.cpp380
-rw-r--r--src/mame/drivers/coolridr.cpp63
-rw-r--r--src/mame/drivers/einstein.cpp7
-rw-r--r--src/mame/drivers/elan_eu3a05.cpp43
-rw-r--r--src/mame/drivers/elan_eu3a14.cpp867
-rw-r--r--src/mame/drivers/gameking.cpp102
-rw-r--r--src/mame/drivers/goodejan.cpp2
-rw-r--r--src/mame/drivers/hp80.cpp16
-rw-r--r--src/mame/drivers/hp9825.cpp6
-rw-r--r--src/mame/drivers/hp9845.cpp18
-rw-r--r--src/mame/drivers/inteladv.cpp4
-rw-r--r--src/mame/drivers/mekd1.cpp18
-rw-r--r--src/mame/drivers/mekd3.cpp217
-rw-r--r--src/mame/drivers/mekd4.cpp156
-rw-r--r--src/mame/drivers/mekd5.cpp16
-rw-r--r--src/mame/drivers/mtx.cpp11
-rw-r--r--src/mame/drivers/nes_vt.cpp298
-rw-r--r--src/mame/drivers/psikyo.cpp60
-rw-r--r--src/mame/drivers/raiden.cpp6
-rw-r--r--src/mame/drivers/rainbow.cpp612
-rw-r--r--src/mame/drivers/ramtek.cpp4
-rw-r--r--src/mame/drivers/rcm32p.cpp562
-rw-r--r--src/mame/drivers/rmt32.cpp4
-rw-r--r--src/mame/drivers/sengokmj.cpp2
-rw-r--r--src/mame/drivers/shisen.cpp2
-rw-r--r--src/mame/drivers/spdheat.cpp6
-rw-r--r--src/mame/drivers/swtpc.cpp21
-rw-r--r--src/mame/drivers/swtpc09.cpp34
-rw-r--r--src/mame/drivers/uchroma68.cpp14
-rw-r--r--src/mame/drivers/vii.cpp190
-rw-r--r--src/mame/includes/bbc.h52
-rw-r--r--src/mame/includes/bloodbro.h2
-rw-r--r--src/mame/includes/dcon.h2
-rw-r--r--src/mame/includes/legionna.h2
-rw-r--r--src/mame/includes/mtx.h1
-rw-r--r--src/mame/includes/nes.h4
-rw-r--r--src/mame/includes/nmk16.h2
-rw-r--r--src/mame/includes/raiden.h5
-rw-r--r--src/mame/includes/swtpc09.h20
-rw-r--r--src/mame/machine/315_5649.cpp30
-rw-r--r--src/mame/machine/315_5649.h4
-rw-r--r--src/mame/machine/bbc.cpp495
-rw-r--r--src/mame/machine/hp80_optrom.cpp89
-rw-r--r--src/mame/machine/hp80_optrom.h60
-rw-r--r--src/mame/machine/hp9825_optrom.cpp (renamed from src/devices/bus/hp9825_optroms/hp9825_optrom.cpp)66
-rw-r--r--src/mame/machine/hp9825_optrom.h (renamed from src/devices/bus/hp9825_optroms/hp9825_optrom.h)43
-rw-r--r--src/mame/machine/hp9845_optrom.cpp99
-rw-r--r--src/mame/machine/hp9845_optrom.h51
-rw-r--r--src/mame/machine/swtpc09.cpp132
-rw-r--r--src/mame/mame.lst6
-rw-r--r--src/mame/mess.flt1
-rw-r--r--src/mame/video/bbc.cpp10
-rw-r--r--src/mame/video/elan_eu3a14vid.cpp766
-rw-r--r--src/mame/video/elan_eu3a14vid.h90
-rw-r--r--src/mame/video/raiden.cpp18
198 files changed, 14895 insertions, 4917 deletions
diff --git a/docs/source/advanced/bgfx.rst b/docs/source/advanced/bgfx.rst
index 72a61f6a546..06b35521ace 100644
--- a/docs/source/advanced/bgfx.rst
+++ b/docs/source/advanced/bgfx.rst
@@ -46,12 +46,14 @@ Configuration Settings
|
| **bgfx_backend**
|
-| Selects a rendering backend for BGFX to use. Possible choices include ``d3d9``, ``d3d11``, ``opengl``, and ``metal``. The default is ``**auto**``, which will let MAME choose the best selection for you.
+| Selects a rendering backend for BGFX to use. Possible choices include ``d3d9``, ``d3d11``, ``d3d12``, ``opengl``, ``metal``, and ```vulkan``. The default is ``**auto**``, which will let MAME choose the best selection for you.
|
| ``d3d9`` -- Direct3D 9.0 Renderer (Requires Windows XP or higher)
| ``d3d11`` -- Direct3D 11.0 Renderer (Requires Windows Vista with D3D11 update or Windows 7 or higher)
+| ``d3d12`` -- Direct3D 12.0 Renderer (Requires Windows 10)
| ``opengl`` -- OpenGL Renderer (Requires OpenGL drivers, may work better on some poorly designed video cards, supported on Linux/Mac OS X)
| ``metal`` -- Metal Apple Graphics API (Requires OS X 10.11 El Capitan or newer)
+| ``vulkan`` -- Vulkan Renderer
|
| **bgfx_debug**
|
diff --git a/hash/bbc_rom.xml b/hash/bbc_rom.xml
index dda4b5b40c5..aa7d173583a 100644
--- a/hash/bbc_rom.xml
+++ b/hash/bbc_rom.xml
@@ -1089,6 +1089,45 @@
</part>
</software>
+ <software name="ariesb2022" cloneof="ariesb20">
+ <description>Aries-B20 2.2</description>
+ <year>1984</year>
+ <publisher>Aries</publisher>
+ <info name="usage" value="Requires Aries-B20" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Aries-B20-2.2.rom" size="8192" crc="c2f334a9" sha1="d04bfd332d63f6f23dca2ef81a1d2074e3d88ee9"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ariesb20">
+ <description>Aries-B20 2.4</description>
+ <year>1984</year>
+ <publisher>Aries</publisher>
+ <info name="usage" value="Requires Aries-B20" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Aries-B20-2.4.rom" size="8192" crc="47a43a03" sha1="2590596e0864b97b30050c33b21aa89bb8956204"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ariesb32">
+ <description>Aries-B32 1.0</description>
+ <year>1985</year>
+ <publisher>Aries</publisher>
+ <info name="usage" value="Requires Aries-B32" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="Aries-B32-1.0.rom" size="16384" crc="2cb3443d" sha1="466e3b68f1a8e0287ae095cb3c16dac6afc89dcb"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="artist">
<description>Artist</description>
<year>1986</year>
@@ -3018,7 +3057,7 @@
<publisher>Clwyd Technics</publisher>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="16384">
- <rom name="Edword-2.00E.rom" size="16384" crc="6e912b4c" sha1="0eaf6e8cd9c6b558ef0d2ff346d00537734eaf04"/>
+ <rom name="Edword2-2.00E.rom" size="16384" crc="6e912b4c" sha1="0eaf6e8cd9c6b558ef0d2ff346d00537734eaf04"/>
</dataarea>
</part>
</software>
@@ -3690,6 +3729,39 @@
</part>
</software>
+ <software name="gommc072" cloneof="gommc" supported="no">
+ <description>GoMMC Tools 0.72</description>
+ <year>2005</year>
+ <publisher>John Kortink</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="GoMMCTools-0.72.rom" size="16384" crc="f34a9e00" sha1="6b65aa2c9f366df1c0384aa67ae37d96cc13d3dc"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="gommc080" cloneof="gommc" supported="no">
+ <description>GoMMC Tools 0.80</description>
+ <year>2005</year>
+ <publisher>John Kortink</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="GoMMCTools-0.80.rom" size="16384" crc="b8a2b9e6" sha1="9e9d20dde136468bb0df110084898d7443209c96"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="gommc" supported="no">
+ <description>GoMMC Tools 1.03</description>
+ <year>2007</year>
+ <publisher>John Kortink</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="GoMMCTools-1.03.rom" size="16384" crc="0e040c84" sha1="8e6377916bd6a9c68c87932bf47369234c56101c"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="grafpad2">
<description>GrafPad 2</description>
<year>1986</year>
@@ -5254,6 +5326,17 @@
</part>
</software>
+ <software name="nfs334b" cloneof="nfs334">
+ <description>Acorn NFS 3.34B</description>
+ <year>198?</year>
+ <publisher>Acorn</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Acorn-NFS-3.34B.rom" size="8192" crc="9ddc1456" sha1="212cb90ba5e7c96457718ae9d818fb8ece5cc32a"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="nfs360">
<description>Acorn NFS 3.60</description>
<year>198?</year>
@@ -5657,6 +5740,17 @@
</part>
</software>
+ <software name="prestelt471" cloneof="prestel" supported="no">
+ <description>Prestel Trial 4.71r</description>
+ <year>1984</year>
+ <publisher>Acorn</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="PrestelTrial-4.71r.rom" size="8192" crc="c6067294" sha1="5702b0b895cfabb30ffdcf9fe2718de2276315ef"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="prestel" supported="no">
<description>Prestel 4.8n</description>
<year>1984</year>
@@ -5668,8 +5762,8 @@
</part>
</software>
- <software name="prestelt">
- <description>Prestel Terminal</description>
+ <software name="prestelt10" cloneof="prestelt">
+ <description>Prestel Terminal 1.00</description>
<year>1984</year>
<publisher>Watford Electronics</publisher>
<part name="rom1" interface="bbc_rom">
@@ -5679,6 +5773,17 @@
</part>
</software>
+ <software name="prestelt">
+ <description>Prestel Terminal 1.10</description>
+ <year>1984</year>
+ <publisher>Watford Electronics</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="PrestelTerminal-1.10.rom" size="8192" crc="2e9d6b6e" sha1="a45597eed6c1f992312445da1031027d398abd4b"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="printbox">
<description>PrintBox 1.22</description>
<year>1989</year>
@@ -5872,7 +5977,7 @@
<software name="pperform21" cloneof="pperform" supported="no">
<description>Pro-Performer 2.1</description>
<year>1988</year>
- <publisher>EMR</publisher>
+ <publisher>Electromusic Research</publisher>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="32768">
<rom name="Pro-Performer-2.1.rom" size="32768" crc="34a7c0b1" sha1="2c1d46aab4cdaa200d21c276369203a882fd5832"/>
@@ -5883,7 +5988,7 @@
<software name="pperform" supported="no">
<description>Pro-Performer 2.2</description>
<year>1990</year>
- <publisher>EMR</publisher>
+ <publisher>Electromusic Research</publisher>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="16384">
<rom name="Pro-Performer-2.2.rom" size="16384" crc="f0faf02d" sha1="514b43bdd2e7af12b6a0498deb077f1cf02aed47"/>
@@ -6040,10 +6145,37 @@
</part>
</software>
+ <software name="raven20100" cloneof="raven20">
+ <description>Raven-20 1.00</description>
+ <year>1984</year>
+ <publisher>Raven Micro Products</publisher>
+ <info name="usage" value="Requires Raven-20" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Raven-20-1.00.rom" size="8192" crc="e8c8f9d5" sha1="e4f2acc07969e10c082355c82d8d1cbc1c08ee2e"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="raven20">
+ <description>Raven-20 1.06</description>
+ <year>1984</year>
+ <publisher>Raven Micro Products</publisher>
+ <info name="usage" value="Requires Raven-20" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Raven-20-1.06.rom" size="8192" crc="7efb0ab3" sha1="d395199ef8f51579fe74e3d7d8dab1de6e0b30e2"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="replay1770" supported="no">
<description>Replay System WD1770 1.01</description>
<year>1985</year>
<publisher>Vine Micros</publisher>
+ <info name="usage" value="Requires Opus D-DOS(B) 1770 FDC" />
<sharedfeat name="compatibility" value="B"/>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="8192">
@@ -6056,6 +6188,7 @@
<description>Replay System WD1770A 1.17</description>
<year>1985</year>
<publisher>Vine Micros</publisher>
+ <info name="usage" value="Requires Acorn 1770 FDC" />
<sharedfeat name="compatibility" value="B"/>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="8192">
@@ -6068,6 +6201,7 @@
<description>Replay System 8271 1.00</description>
<year>1985</year>
<publisher>Vine Micros</publisher>
+ <info name="usage" value="Requires Acorn 8271 FDC" />
<sharedfeat name="compatibility" value="B"/>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="8192">
@@ -6080,6 +6214,7 @@
<description>Replay System 8271 1.10</description>
<year>1985</year>
<publisher>Vine Micros</publisher>
+ <info name="usage" value="Requires Acorn 8271 FDC" />
<sharedfeat name="compatibility" value="B"/>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="8192">
@@ -6092,6 +6227,7 @@
<description>Replay System Mk2 2.00</description>
<year>1988</year>
<publisher>Vine Micros</publisher>
+ <info name="usage" value="Requires any 1770 FDC" />
<sharedfeat name="compatibility" value="B"/>
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="16384">
@@ -6108,7 +6244,7 @@
<!-- This is not a normal ROM, it's paged into the MOS region using an Overlay board. -->
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="16384">
- <rom name="MasterReplay.rom" size="16384" crc="a9619a78" sha1="2c6a18366568b139f2ec8ba6b31315a921b88c29"/>
+ <rom name="MasterReplay-1.02.rom" size="16384" crc="a9619a78" sha1="2c6a18366568b139f2ec8ba6b31315a921b88c29"/>
</dataarea>
</part>
</software>
@@ -6458,9 +6594,10 @@
<description>SideAid128</description>
<year>1988</year>
<publisher>Computer and Technical Services</publisher>
+ <info name="usage" value="Requires Solidisk TwoMeg128" />
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="16384">
- <rom name="SideAid128-1.03.rom" size="16384" crc="48d1035c" sha1="9fc1952e856f0b08c8623e8502d8560ebecfb0ed"/>
+ <rom name="SideAid128-1.03.rom" size="16384" crc="48d1035c" sha1="9fc1952e856f0b08c8623e8502d8560ebecfb0ed" status="baddump"/>
</dataarea>
</part>
</software>
@@ -6469,6 +6606,7 @@
<description>SideAid256</description>
<year>1988</year>
<publisher>Computer and Technical Services</publisher>
+ <info name="usage" value="Requires Solidisk FourMeg256" />
<part name="rom1" interface="bbc_rom">
<dataarea name="rom" size="32768">
<rom name="SideAid256-1.05.rom" size="32768" crc="4d0b29b9" sha1="6ebfc135586db38090f83e47a158d14c8d5a5f79"/>
@@ -7376,6 +7514,17 @@
</part>
</software>
+ <software name="suprmmc" supported="no">
+ <description>Super MMC</description>
+ <year>2008</year>
+ <publisher>Martin Mather</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="SuperMMC.rom" size="16384" crc="952dfe1e" sha1="8d20afb7e2cbc0094dd02da88b25212e1ca7f254"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="suprutil">
<description>Super Utility</description>
<year>198?</year>
@@ -7609,6 +7758,17 @@
</part>
</software>
+ <software name="tfs031" cloneof="tfs">
+ <description>Acorn TFS 0.31</description>
+ <year>1982</year>
+ <publisher>Acorn</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="TFS-0.31.rom" size="16384" crc="eb6b9097" sha1="07c54e8afc5fe686a8f86c33d15220327d6c9cc8"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="tfs100" cloneof="tfs">
<description>Acorn TFS 1.00</description>
<year>1982</year>
@@ -7909,6 +8069,17 @@
</part>
</software>
+ <software name="turbommc" supported="no">
+ <description>Turbo MMC 0.A1</description>
+ <year>2009</year>
+ <publisher>IFEL</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="TurboMMC-0.A1.rom" size="16384" crc="a82be1bb" sha1="07aec1e9b351a77f6fb75bbf812dc745892bf22f"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="turbprom">
<description>Turbo-PROM</description>
<year>1984</year>
@@ -7942,6 +8113,23 @@
</part>
</software>
+ <software name="umi2b" supported="no">
+ <description>UMI-2B 5.01</description>
+ <year>1986</year>
+ <publisher>Umusic</publisher>
+ <info name="usage" value="Requires UMI-2B MIDI Sequencer" />
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="UMI-2B-5.01_1.rom" size="16384" crc="37a845f0" sha1="4f3095c163c5811fdb12a12eb3ebbffefc71e2b9"/>
+ </dataarea>
+ </part>
+ <part name="rom2" interface="bbc_rom">
+ <dataarea name="rom" size="16384">
+ <rom name="UMI-2B-5.01_2.rom" size="16384" crc="10dc5dc9" sha1="26c35f321853813df074e815c5b9f691a8920777"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="uniterm">
<description>Uniterm</description>
<year>1983</year>
@@ -8609,6 +8797,45 @@
</part>
</software>
+ <software name="weram100" cloneof="weram">
+ <description>Watford Electronics 32K RAM 1.00</description>
+ <year>1984</year>
+ <publisher>Watford Electronics</publisher>
+ <info name="usage" value="Requires Watford 32K Shadow RAM" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Watford_32K_RAM-1.00.rom" size="8192" crc="7962b5db" sha1="1b59a3354cfc704ad8aa60b0ed16e4cd2d815031"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="weram200" cloneof="weram">
+ <description>Watford Electronics 32K RAM 2.00</description>
+ <year>1985</year>
+ <publisher>Watford Electronics</publisher>
+ <info name="usage" value="Requires Watford 32K Shadow RAM" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Watford_32K_RAM-2.00.rom" size="8192" crc="1eff9b23" sha1="98a3084b20c92427c2e9def58ade96f42659e20a"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="weram">
+ <description>Watford Electronics 32K RAM 2.40</description>
+ <year>1985</year>
+ <publisher>Watford Electronics</publisher>
+ <info name="usage" value="Requires Watford 32K Shadow RAM" />
+ <sharedfeat name="compatibility" value="B"/>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Watford_32K_RAM-2.40.rom" size="8192" crc="db9c3a1a" sha1="0a5efb084eb1ae353b9c79c026e9e26cd7695293"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="window25" cloneof="window">
<description>Window 1025</description>
<year>1985</year>
@@ -8824,6 +9051,17 @@
</part>
</software>
+ <software name="workstat10" cloneof="workstat">
+ <description>Workstation 100</description>
+ <year>1984</year>
+ <publisher>University of Sussex Computing Centre</publisher>
+ <part name="rom1" interface="bbc_rom">
+ <dataarea name="rom" size="8192">
+ <rom name="Workstation-1.0.rom" size="8192" crc="7a44ffef" sha1="60de43339019d633ad378c2c6b338f47d3885492"/>
+ </dataarea>
+ </part>
+ </software>
+
<software name="workstat">
<description>Workstation 1.4</description>
<year>1983</year>
diff --git a/hash/bbcm_cart.xml b/hash/bbcm_cart.xml
index 32da365bfbd..df4facb61a2 100644
--- a/hash/bbcm_cart.xml
+++ b/hash/bbcm_cart.xml
@@ -10,20 +10,167 @@
<softwarelist name="bbcm_cart" description="Acorn BBC Master cartridges">
+ <software name="abr">
+ <description>Advanced Battery-Backed RAM v1.10</description>
+ <year>1987</year>
+ <publisher>Advanced Computer Products</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="abr" />
+ <dataarea name="nvram" size="32768">
+ <rom name="PRES-ABR-Utils-1.10.rom" size="16360" crc="e5aec5c1" sha1="b0066d9ee83a9144eb5942f106776174ae5df0d9" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="abr104" cloneof="abr">
+ <description>Advanced Battery-Backed RAM v1.04</description>
+ <year>1987</year>
+ <publisher>Advanced Computer Products</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="abr" />
+ <dataarea name="nvram" size="32768">
+ <rom name="PRES-ABR-Utils-1.04.rom" size="16384" crc="2c009b06" sha1="be245a32bba1f18614963587a61bcb622f404c95" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="aqr">
+ <description>Advanced Quarter Meg RAM</description>
+ <year>1987</year>
+ <publisher>Advanced Computer Products</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="aqr" />
+ <dataarea name="ram" size="262144" />
+ </part>
+ </software>
+
+ <software name="click100" cloneof="click">
+ <description>Click v1.00</description>
+ <year>1990</year>
+ <publisher>Slogger</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="click" />
+ <dataarea name="rom" size="16384">
+ <rom name="Click_M128-1.00.rom" size="16384" crc="8c633300" sha1="e7223334fd5cb5b3ed715421aa278b96b3ea39af"/>
+ </dataarea>
+ <dataarea name="nvram" size="8192">
+ <rom value="0x00" size="8192" loadflag="fill" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="click">
+ <description>Click v1.01</description>
+ <year>1990</year>
+ <publisher>Slogger</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="click" />
+ <dataarea name="rom" size="16384">
+ <rom name="Click_M128-1.01.rom" size="16384" crc="bab5539c" sha1="39732aad5fbb22c4ef3ac85d00e50a7f231d03bb"/>
+ </dataarea>
+ <dataarea name="nvram" size="8192">
+ <rom value="0x00" size="8192" loadflag="fill" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="demo">
<description>BBC Master Demonstration Cartridge</description>
<year>1986</year>
<publisher>Acorn</publisher>
<part name="cart" interface="bbcm_cart">
- <dataarea name="uprom" size="16384">
+ <dataarea name="lorom" size="16384">
<rom name="bbcmasterdemonstrationcartridge_1.rom" size="16384" crc="fc40c0e8" sha1="970ff4721e707f3c843f4fb09ce7f03e7ab265ae" />
</dataarea>
- <dataarea name="lorom" size="16384">
+ <dataarea name="uprom" size="16384">
<rom name="bbcmasterdemonstrationcartridge_2.rom" size="16384" crc="2e73522d" sha1="ff39620d93b18fd36a4718474495211a46ef8184" />
</dataarea>
</part>
</software>
+ <software name="isopascal">
+ <description>ISO-Pascal</description>
+ <year>1986</year>
+ <publisher>Acornsoft</publisher>
+ <info name="release" value="SQL18" />
+ <part name="cart" interface="bbcm_cart">
+ <dataarea name="lorom" size="16384">
+ <rom name="ISO-Pascal1-1.1.rom" size="16384" crc="ed1a7497" sha1="44cfe2d7fb0895a6c8858f09aaf5a96bcdcc3767" />
+ </dataarea>
+ <dataarea name="uprom" size="16384">
+ <rom name="ISO-Pascal2-1.1.rom" size="16384" crc="73455b67" sha1="0e2354e8d93d9858dbd9d24dfa0aa96a206b0b25" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="lisp">
+ <description>LISP</description>
+ <year>1986</year>
+ <publisher>Acornsoft</publisher>
+ <info name="release" value="SQL14" />
+ <part name="cart" interface="bbcm_cart">
+ <dataarea name="lorom" size="16384">
+ <rom name="Lisp_1.rom" size="16384" crc="fda4c546" sha1="24c7062fc3666cd6814d72e417146e32eb995b04" />
+ </dataarea>
+ <dataarea name="uprom" size="16384">
+ <rom name="Lisp_2.rom" size="16384" crc="2eb56fc0" sha1="bdf09e553578d27a0cc202d409484dd8c2c3c085" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mega256">
+ <description>Master Mega 256</description>
+ <year>1987</year>
+ <publisher>Solidisk</publisher>
+ <info name="usage" value="Use only in slot cart2." />
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="mega256" />
+ <dataarea name="rom" size="8192">
+ <rom name="Mega256-1.00.rom" size="8192" crc="4b8a1a44" sha1="d19b29fd849182901ec5755e9578e23382b4f479"/>
+ </dataarea>
+ <dataarea name="ram" size="262144">
+ <rom value="0x00" size="262144" loadflag="fill" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mr8000">
+ <description>MR8000 Master RAM Cartridge</description>
+ <year>1987</year>
+ <publisher>Peartree Computers</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="mr8000" />
+ <dataarea name="nvram" size="65536">
+ <rom name="MR8000_1.1.rom" size="16384" crc="796085ac" sha1="0128c978754ae3ba723e98e230e5c36a84f5f03e" offset="0x4000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mr8000a" cloneof="mr8000">
+ <description>MR8000 Master RAM Cartridge (alt)</description>
+ <year>1987</year>
+ <publisher>Peartree Computers</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="mr8000" />
+ <dataarea name="nvram" size="65536">
+ <rom name="MR8000_1.1_alt.rom" size="16384" crc="28b4e469" sha1="5a259291551c9fc3708ea6585092450a7cc6ccd4" offset="0x4000"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="msc">
+ <description>Master Smart Cartridge</description>
+ <year>1987</year>
+ <publisher>Care Electronics</publisher>
+ <part name="cart" interface="bbcm_cart">
+ <feature name="slot" value="msc" />
+ <dataarea name="rom" size="16384">
+ <rom name="smart_v2.rom" size="16384" crc="e9a8139e" sha1="26d6bbfe4b43f76be1f0cb2d96143112d3503840" />
+ </dataarea>
+ <dataarea name="ram" size="2048" />
+ </part>
+ </software>
+
<software name="overview">
<description>OverView</description>
<year>1985</year>
@@ -39,13 +186,16 @@
</part>
</software>
- <software name="smart" supported="no">
- <description>Smart Cartridge</description>
- <year>1987</year>
- <publisher>Care Electronics</publisher>
+ <software name="techcad">
+ <description>TechnoCAD</description>
+ <year>1988</year>
+ <publisher>Technomatic</publisher>
<part name="cart" interface="bbcm_cart">
<dataarea name="lorom" size="16384">
- <rom name="smart_v2.rom" size="16384" crc="e9a8139e" sha1="26d6bbfe4b43f76be1f0cb2d96143112d3503840" />
+ <rom name="TechnoCAD-R1-1.00.rom" size="16384" crc="662a4f28" sha1="3a8a9c5c72212aeadf0c1f2ba8b3ff7f4a08ea2a" />
+ </dataarea>
+ <dataarea name="uprom" size="16384">
+ <rom name="TechnoCAD-R2-1.00.rom" size="16384" crc="19fd969a" sha1="845f73dad31635a307db2d16a61b20ca4561f659" />
</dataarea>
</part>
</software>
diff --git a/hash/gamegear.xml b/hash/gamegear.xml
index 185ca4ee83a..41f1085c233 100644
--- a/hash/gamegear.xml
+++ b/hash/gamegear.xml
@@ -79,7 +79,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp8" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950427)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950427)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -90,7 +90,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp7" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950429-A)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950429-A)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -101,7 +101,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp6" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950430)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950430)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -112,7 +112,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp5" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950502)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950502)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -123,7 +123,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp4" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950504)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950504)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -134,7 +134,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp3" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950506-B)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950506-B)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -145,7 +145,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp2" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950506)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950506)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -156,7 +156,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="advbatmrp1" cloneof="advbatmr">
- <description>The Adventures of Batman &amp; Robin (Prototype, 19950507)</description>
+ <description>The Adventures of Batman &amp; Robin (prototype, 19950507)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -230,7 +230,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="aladdinp3" cloneof="aladdin">
- <description>Disney's Aladdin (Prototype, 19931229)</description>
+ <description>Disney's Aladdin (prototype, 19931229)</description>
<year>1993</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -241,7 +241,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="aladdinp2" cloneof="aladdin">
- <description>Disney's Aladdin (Prototype, 19940111)</description>
+ <description>Disney's Aladdin (prototype, 19940111)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -252,7 +252,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="aladdinp1" cloneof="aladdin">
- <description>Disney's Aladdin (Prototype, 19940113)</description>
+ <description>Disney's Aladdin (prototype, 19940113)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -264,7 +264,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
<!-- same as jan 13 proto. was a mistake by drx? -->
<!--software name="aladdinp1a" cloneof="aladdin">
- <description>Disney's Aladdin (Prototype WITH, 19940123)</description>
+ <description>Disney's Aladdin (prototype WITH, 19940123)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -276,7 +276,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
<!-- Alt. Title: Alex Kido (on the boxart) -->
<software name="alexkidd">
- <description>Alex Kidd in Miracle World (Tw, SMS Mode)</description>
+ <description>Alex Kidd in Miracle World (Tw, SMS mode)</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
<info name="serial" value="HG 101-10"/>
@@ -456,7 +456,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="astergrep5" cloneof="astergre">
- <description>Astérix and the Great Rescue (Prototype, 19940216)</description>
+ <description>Astérix and the Great Rescue (prototype, 19940216)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -467,7 +467,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="astergrep4" cloneof="astergre">
- <description>Astérix and the Great Rescue (Prototype, 19940222)</description>
+ <description>Astérix and the Great Rescue (prototype, 19940222)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -478,7 +478,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="astergrep3" cloneof="astergre">
- <description>Astérix and the Great Rescue (Prototype, 19940125)</description>
+ <description>Astérix and the Great Rescue (prototype, 19940125)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -489,7 +489,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="astergrep2" cloneof="astergre">
- <description>Astérix and the Great Rescue (Prototype, 19940313)</description>
+ <description>Astérix and the Great Rescue (prototype, 19940313)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -500,7 +500,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="astergrep1" cloneof="astergre">
- <description>Astérix and the Great Rescue (Prototype, 19940315)</description>
+ <description>Astérix and the Great Rescue (prototype, 19940315)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -535,7 +535,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="axbattlrp" cloneof="axbattlr">
- <description>Ax Battler - A Legend of Golden Axe (Euro, USA, Prototype v2.0)</description>
+ <description>Ax Battler - A Legend of Golden Axe (Euro, USA, prototype v2.0)</description>
<year>1991</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -594,7 +594,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="smgp2p" cloneof="smgp2">
- <description>Ayrton Senna's Super Monaco GP II (Euro, USA, Prototype)</description>
+ <description>Ayrton Senna's Super Monaco GP II (Euro, USA, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -649,7 +649,7 @@ A few games have been listed as rumored, but they might very well be fake (pleas
</software>
<software name="barbiesm">
- <description>Barbie Super Model (Prototype)</description>
+ <description>Barbie Super Model (prototype)</description>
<year>1993</year>
<publisher>Hi Tech Expressions</publisher>
<part name="cart" interface="gamegear_cart">
@@ -772,7 +772,7 @@ on the pause screen, some messages are not displayed ("Sorry boys, no tickets, n
to explain why it is not possible to progress beyond a certain point in the game without
a certain item) -->
<software name="beavisp" cloneof="beavis">
- <description>Beavis and Butt-head (Prototype?)</description>
+ <description>Beavis and Butt-head (prototype?)</description>
<year>1994</year>
<publisher>Viacom New Media</publisher>
<part name="cart" interface="gamegear_cart">
@@ -795,7 +795,7 @@ a certain item) -->
</software>
<software name="berensp12" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940801)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940801)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -806,7 +806,7 @@ a certain item) -->
</software>
<software name="berensp11" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940811-A)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940811-A)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -817,7 +817,7 @@ a certain item) -->
</software>
<software name="berensp10" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940811)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940811)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -828,7 +828,7 @@ a certain item) -->
</software>
<software name="berensp09" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940812)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940812)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -839,7 +839,7 @@ a certain item) -->
</software>
<software name="berensp08" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940813)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940813)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -850,7 +850,7 @@ a certain item) -->
</software>
<software name="berensp07" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940814)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940814)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -861,7 +861,7 @@ a certain item) -->
</software>
<software name="berensp06" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940819)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940819)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -872,7 +872,7 @@ a certain item) -->
</software>
<software name="berensp05" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940820)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940820)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -883,7 +883,7 @@ a certain item) -->
</software>
<software name="berensp04" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940824)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940824)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -894,7 +894,7 @@ a certain item) -->
</software>
<software name="berensp03" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940825-B)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940825-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -905,7 +905,7 @@ a certain item) -->
</software>
<software name="berensp02" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940826-B)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940826-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -916,7 +916,7 @@ a certain item) -->
</software>
<software name="berensp01" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940826)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940826)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -927,7 +927,7 @@ a certain item) -->
</software>
<software name="berensp16" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940715-B)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940715-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -938,7 +938,7 @@ a certain item) -->
</software>
<software name="berensp15" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940721)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940721)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -949,7 +949,7 @@ a certain item) -->
</software>
<software name="berensp14" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940722)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940722)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -960,7 +960,7 @@ a certain item) -->
</software>
<software name="berensp13" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940727)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940727)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -971,7 +971,7 @@ a certain item) -->
</software>
<software name="berensp17" cloneof="berens">
- <description>The Berenstain Bears' Camping Adventure (Prototype, 19940628)</description>
+ <description>The Berenstain Bears' Camping Adventure (prototype, 19940628)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1026,7 +1026,7 @@ a certain item) -->
</software>
<software name="bonkersp07" cloneof="bonkers">
- <description>Disneys Bonkers Wax Up! (Prototype, 19941203)</description>
+ <description>Disneys Bonkers Wax Up! (prototype, 19941203)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1037,7 +1037,7 @@ a certain item) -->
</software>
<software name="bonkersp06" cloneof="bonkers">
- <description>Disneys Bonkers Wax Up! (Prototype, 19941205)</description>
+ <description>Disneys Bonkers Wax Up! (prototype, 19941205)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1048,7 +1048,7 @@ a certain item) -->
</software>
<software name="bonkersp05" cloneof="bonkers">
- <description>Disney's Bonkers Wax Up! (Prototype, 19941207-C)</description>
+ <description>Disney's Bonkers Wax Up! (prototype, 19941207-C)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1059,7 +1059,7 @@ a certain item) -->
</software>
<software name="bonkersp04" cloneof="bonkers">
- <description>Disney's Bonkers Wax Up! (Prototype, 19941208-B)</description>
+ <description>Disney's Bonkers Wax Up! (prototype, 19941208-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1070,7 +1070,7 @@ a certain item) -->
</software>
<software name="bonkersp03" cloneof="bonkers">
- <description>Disney's Bonkers Wax Up! (Prototype, 19941208-C)</description>
+ <description>Disney's Bonkers Wax Up! (prototype, 19941208-C)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1081,7 +1081,7 @@ a certain item) -->
</software>
<software name="bonkersp02" cloneof="bonkers">
- <description>Disney's Bonkers Wax Up! (Prototype, 19941211)</description>
+ <description>Disney's Bonkers Wax Up! (prototype, 19941211)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1093,7 +1093,7 @@ a certain item) -->
<!-- same as dec 11 proto. was a mistake by drx? -->
<!-- software name="bonkersp02a" cloneof="bonkers">
- <description>Disney's Bonkers Wax Up! (Prototype, 19941212-B)</description>
+ <description>Disney's Bonkers Wax Up! (prototype, 19941212-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1104,7 +1104,7 @@ a certain item) -->
</software-->
<software name="bonkersp01" cloneof="bonkers">
- <description>Disney's Bonkers Wax Up! (Prototype, 19941212-D)</description>
+ <description>Disney's Bonkers Wax Up! (prototype, 19941212-D)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1115,7 +1115,7 @@ a certain item) -->
</software>
<software name="bonkersp12" cloneof="bonkers">
- <description>Bonkers Wax Up! (Prototype, 19941115)</description>
+ <description>Bonkers Wax Up! (prototype, 19941115)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1126,7 +1126,7 @@ a certain item) -->
</software>
<software name="bonkersp11" cloneof="bonkers">
- <description>Bonkers Wax Up! (Prototype, 19941121)</description>
+ <description>Bonkers Wax Up! (prototype, 19941121)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1137,7 +1137,7 @@ a certain item) -->
</software>
<software name="bonkersp10" cloneof="bonkers">
- <description>Bonkers Wax Up! (Prototype, 19941123)</description>
+ <description>Bonkers Wax Up! (prototype, 19941123)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1148,7 +1148,7 @@ a certain item) -->
</software>
<software name="bonkersp09" cloneof="bonkers">
- <description>Bonkers Wax Up! (Prototype, 19941126)</description>
+ <description>Bonkers Wax Up! (prototype, 19941126)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1159,7 +1159,7 @@ a certain item) -->
</software>
<software name="bonkersp08" cloneof="bonkers">
- <description>Bonkers Wax Up! (Prototype, 19941129)</description>
+ <description>Bonkers Wax Up! (prototype, 19941129)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1170,7 +1170,7 @@ a certain item) -->
</software>
<software name="bonkersp13" cloneof="bonkers">
- <description>Bonkers Wax Up! (Prototype, 19941031)</description>
+ <description>Bonkers Wax Up! (prototype, 19941031)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1318,7 +1318,7 @@ a certain item) -->
</software>
<software name="castlill">
- <description>Castle of Illusion Starring Mickey Mouse (Euro, USA, SMS Mode)</description>
+ <description>Castle of Illusion Starring Mickey Mouse (Euro, USA, SMS mode)</description>
<year>1991</year>
<publisher>Sega</publisher>
<info name="serial" value="2401"/>
@@ -1397,7 +1397,7 @@ a certain item) -->
</software>
<software name="chicagop09" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950703)</description>
+ <description>Chicago Syndicate (prototype, 19950703)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1408,7 +1408,7 @@ a certain item) -->
</software>
<software name="chicagop08" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950705)</description>
+ <description>Chicago Syndicate (prototype, 19950705)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1419,7 +1419,7 @@ a certain item) -->
</software>
<software name="chicagop07" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950707)</description>
+ <description>Chicago Syndicate (prototype, 19950707)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1430,7 +1430,7 @@ a certain item) -->
</software>
<software name="chicagop06" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950710)</description>
+ <description>Chicago Syndicate (prototype, 19950710)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1441,7 +1441,7 @@ a certain item) -->
</software>
<software name="chicagop05" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950711)</description>
+ <description>Chicago Syndicate (prototype, 19950711)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1452,7 +1452,7 @@ a certain item) -->
</software>
<software name="chicagop04" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950719)</description>
+ <description>Chicago Syndicate (prototype, 19950719)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1463,7 +1463,7 @@ a certain item) -->
</software>
<software name="chicagop03" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950720)</description>
+ <description>Chicago Syndicate (prototype, 19950720)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1474,7 +1474,7 @@ a certain item) -->
</software>
<software name="chicagop02" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950721-B)</description>
+ <description>Chicago Syndicate (prototype, 19950721-B)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1485,7 +1485,7 @@ a certain item) -->
</software>
<software name="chicagop01" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950721)</description>
+ <description>Chicago Syndicate (prototype, 19950721)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1496,7 +1496,7 @@ a certain item) -->
</software>
<software name="chicagop23" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950601)</description>
+ <description>Chicago Syndicate (prototype, 19950601)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1507,7 +1507,7 @@ a certain item) -->
</software>
<software name="chicagop22" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950605)</description>
+ <description>Chicago Syndicate (prototype, 19950605)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1518,7 +1518,7 @@ a certain item) -->
</software>
<software name="chicagop21" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950607)</description>
+ <description>Chicago Syndicate (prototype, 19950607)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1529,7 +1529,7 @@ a certain item) -->
</software>
<software name="chicagop20" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950608)</description>
+ <description>Chicago Syndicate (prototype, 19950608)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1540,7 +1540,7 @@ a certain item) -->
</software>
<software name="chicagop19" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950612)</description>
+ <description>Chicago Syndicate (prototype, 19950612)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1551,7 +1551,7 @@ a certain item) -->
</software>
<software name="chicagop18" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950614)</description>
+ <description>Chicago Syndicate (prototype, 19950614)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1562,7 +1562,7 @@ a certain item) -->
</software>
<software name="chicagop17" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950619)</description>
+ <description>Chicago Syndicate (prototype, 19950619)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1573,7 +1573,7 @@ a certain item) -->
</software>
<software name="chicagop16" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950620)</description>
+ <description>Chicago Syndicate (prototype, 19950620)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1584,7 +1584,7 @@ a certain item) -->
</software>
<software name="chicagop15" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950622)</description>
+ <description>Chicago Syndicate (prototype, 19950622)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1595,7 +1595,7 @@ a certain item) -->
</software>
<software name="chicagop14" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950626)</description>
+ <description>Chicago Syndicate (prototype, 19950626)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1606,7 +1606,7 @@ a certain item) -->
</software>
<software name="chicagop13" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950628)</description>
+ <description>Chicago Syndicate (prototype, 19950628)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1617,7 +1617,7 @@ a certain item) -->
</software>
<software name="chicagop12" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950629-B)</description>
+ <description>Chicago Syndicate (prototype, 19950629-B)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1628,7 +1628,7 @@ a certain item) -->
</software>
<software name="chicagop11" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950629)</description>
+ <description>Chicago Syndicate (prototype, 19950629)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1639,7 +1639,7 @@ a certain item) -->
</software>
<software name="chicagop10" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950630-B)</description>
+ <description>Chicago Syndicate (prototype, 19950630-B)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1650,7 +1650,7 @@ a certain item) -->
</software>
<software name="chicagop24" cloneof="chicago">
- <description>Chicago Syndicate (Prototype, 19950505)</description>
+ <description>Chicago Syndicate (prototype, 19950505)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1690,7 +1690,7 @@ a certain item) -->
</software>
<software name="chuckrckp" cloneof="chuckrck">
- <description>Chuck Rock (World, Prototype)</description>
+ <description>Chuck Rock (World, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1776,7 +1776,7 @@ a certain item) -->
<!-- Developers: Sega -->
<software name="columnsj1" cloneof="columns">
- <description>Columns (Jpn, Older)</description>
+ <description>Columns (Jpn, older)</description>
<year>1990</year>
<publisher>Sega</publisher>
<info name="serial" value="G-3101, G-3104 (Meisaku Collection)"/>
@@ -1874,7 +1874,7 @@ a certain item) -->
</software>
<software name="crazyfac">
- <description>Crazy Faces (Euro, Prototype)</description>
+ <description>Crazy Faces (Euro, prototype)</description>
<year>1993</year>
<publisher>Domark</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1917,7 +1917,7 @@ a certain item) -->
</software>
<software name="cutthrp" cloneof="cutthr">
- <description>Cutthroat Island (Prototype 19950916)</description>
+ <description>Cutthroat Island (prototype 19950916)</description>
<year>1995</year>
<publisher>Acclaim Entertainment</publisher>
<part name="cart" interface="gamegear_cart">
@@ -1989,7 +1989,7 @@ a certain item) -->
</software>
<software name="defoasisp" cloneof="defoasis">
- <description>Defenders of Oasis (Euro, USA, Prototype)</description>
+ <description>Defenders of Oasis (Euro, USA, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2154,7 +2154,7 @@ a certain item) -->
</software>
<software name="ddragonp" cloneof="ddragon">
- <description>Double Dragon (Euro, USA, Prototype)</description>
+ <description>Double Dragon (Euro, USA, prototype)</description>
<year>1993</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2192,7 +2192,7 @@ a certain item) -->
</software>
<software name="drfrankn">
- <description>Dr. Franken (Prototype Demo)</description>
+ <description>Dr. Franken (prototype demo)</description>
<year>1993</year>
<publisher>Elite</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2319,7 +2319,7 @@ a certain item) -->
</software>
<software name="dheadp2" cloneof="dhead">
- <description>Dynamite Headdy (Prototype, 19940701)</description>
+ <description>Dynamite Headdy (prototype, 19940701)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2330,7 +2330,7 @@ a certain item) -->
</software>
<software name="dheadp1" cloneof="dhead">
- <description>Dynamite Headdy (Prototype, 19940705)</description>
+ <description>Dynamite Headdy (prototype, 19940705)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2341,7 +2341,7 @@ a certain item) -->
</software>
<software name="dheadp3" cloneof="dhead">
- <description>Dynamite Headdy (Prototype, 19940615)</description>
+ <description>Dynamite Headdy (prototype, 19940615)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2478,7 +2478,7 @@ a certain item) -->
</software>
<software name="excdizzy">
- <description>The Excellent Dizzy Collection (Euro, SMS Mode)</description>
+ <description>The Excellent Dizzy Collection (Euro, SMS mode)</description>
<year>1995</year>
<publisher>Codemasters</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2491,7 +2491,7 @@ a certain item) -->
</software>
<software name="excdizzyp" cloneof="excdizzy">
- <description>The Excellent Dizzy Collection (Prototype, SMS Mode)</description>
+ <description>The Excellent Dizzy Collection (prototype, SMS mode)</description>
<year>1995</year>
<publisher>Codemasters</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2568,7 +2568,7 @@ a certain item) -->
</software>
<software name="fantdizz">
- <description>Fantastic Dizzy (Euro, SMS Mode)</description>
+ <description>Fantastic Dizzy (Euro, SMS mode)</description>
<year>1993</year>
<publisher>Codemasters</publisher>
<part name="cart" interface="gamegear_cart">
@@ -2738,7 +2738,7 @@ a certain item) -->
</software>
<software name="frogger">
- <description>Frogger (USA, Prototype)</description>
+ <description>Frogger (USA, prototype)</description>
<year>1991</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3071,7 +3071,7 @@ a certain item) -->
</software>
<software name="gpriderp" cloneof="gprider">
- <description>GP Rider (Prototype, 19940104)</description>
+ <description>GP Rider (prototype, 19940104)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3481,7 +3481,7 @@ a certain item) -->
</software>
<software name="jangpun2">
- <description>Jang Pung II (Kor, SMS Mode)</description>
+ <description>Jang Pung II (Kor, SMS mode)</description>
<year>1993</year>
<publisher>Sieco</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3494,7 +3494,7 @@ a certain item) -->
</software>
<software name="strtbatl" cloneof="jangpun2">
- <description>Street Battle (US, SMS Mode, prototype)</description>
+ <description>Street Battle (US, SMS mode, prototype)</description>
<year>1993</year>
<publisher>Innovation Tech</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3862,7 +3862,7 @@ a certain item) -->
</software>
<software name="legndillp3" cloneof="legndill">
- <description>Legend of Illusion Starring Mickey Mouse (Prototype, 19941011)</description>
+ <description>Legend of Illusion Starring Mickey Mouse (prototype, 19941011)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3873,7 +3873,7 @@ a certain item) -->
</software>
<software name="legndillp2" cloneof="legndill">
- <description>Legend of Illusion Starring Mickey Mouse (Prototype, 19941014)</description>
+ <description>Legend of Illusion Starring Mickey Mouse (prototype, 19941014)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3884,7 +3884,7 @@ a certain item) -->
</software>
<software name="legndillp1" cloneof="legndill">
- <description>Legend of Illusion Starring Mickey Mouse (Prototype, 19941017)</description>
+ <description>Legend of Illusion Starring Mickey Mouse (prototype, 19941017)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3895,7 +3895,7 @@ a certain item) -->
</software>
<software name="legndillp6" cloneof="legndill">
- <description>Legend of Illusion Starring Mickey Mouse (Prototype, 19940922)</description>
+ <description>Legend of Illusion Starring Mickey Mouse (prototype, 19940922)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3906,7 +3906,7 @@ a certain item) -->
</software>
<software name="legndillp5" cloneof="legndill">
- <description>Legend of Illusion Starring Mickey Mouse (Prototype, 19940930-SEL)</description>
+ <description>Legend of Illusion Starring Mickey Mouse (prototype, 19940930-SEL)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3917,7 +3917,7 @@ a certain item) -->
</software>
<software name="legndillp4" cloneof="legndill">
- <description>Legend of Illusion Starring Mickey Mouse (Prototype, 19940930)</description>
+ <description>Legend of Illusion Starring Mickey Mouse (prototype, 19940930)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3928,7 +3928,7 @@ a certain item) -->
</software>
<software name="lemmingsp" cloneof="lemmings">
- <description>Lemmings (World, Prototype)</description>
+ <description>Lemmings (World, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -3953,7 +3953,7 @@ a certain item) -->
</software>
<software name="lemming2">
- <description>Lemmings 2 - The Tribes (Euro, Prototype)</description>
+ <description>Lemmings 2 - The Tribes (Euro, prototype)</description>
<year>1994</year>
<publisher>Psygnosis</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4009,7 +4009,7 @@ a certain item) -->
</software>
<software name="lionkingp9" cloneof="lionking">
- <description>Disney's The Lion King (Prototype, 19940803)</description>
+ <description>Disney's The Lion King (prototype, 19940803)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4020,7 +4020,7 @@ a certain item) -->
</software>
<software name="lionkingp8" cloneof="lionking">
- <description>Disney's The Lion King (Prototype, 19940811)</description>
+ <description>Disney's The Lion King (prototype, 19940811)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4031,7 +4031,7 @@ a certain item) -->
</software>
<software name="lionkingp7" cloneof="lionking">
- <description>Disney's The Lion King (Prototype, 19940812)</description>
+ <description>Disney's The Lion King (prototype, 19940812)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4042,7 +4042,7 @@ a certain item) -->
</software>
<software name="lionkingp6" cloneof="lionking">
- <description>Disney's The Lion King (Prototype, 19940813)</description>
+ <description>Disney's The Lion King (prototype, 19940813)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4053,7 +4053,7 @@ a certain item) -->
</software>
<software name="lionkingp5" cloneof="lionking">
- <description>Disney's The Lion King (Prototype, 19940814)</description>
+ <description>Disney's The Lion King (prototype, 19940814)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4065,7 +4065,7 @@ a certain item) -->
<!-- same as aug 14 proto. was a mistake by drx? -->
<!--software name="lionkingp5b" cloneof="lionking">
- <description>Disney's The Lion King (Prototype, 19940815)</description>
+ <description>Disney's The Lion King (prototype, 19940815)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4076,7 +4076,7 @@ a certain item) -->
</software-->
<software name="lionkingp4" cloneof="lionking">
- <description>Disney's The Lion King (Prototype, 19940816)</description>
+ <description>Disney's The Lion King (prototype, 19940816)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4087,7 +4087,7 @@ a certain item) -->
</software>
<software name="lionkingp3" cloneof="lionking">
- <description>The Lion King (Prototype, 19940817-2)</description>
+ <description>The Lion King (prototype, 19940817-2)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4098,7 +4098,7 @@ a certain item) -->
</software>
<software name="lionkingp2" cloneof="lionking">
- <description>The Lion King (Prototype, 19940817)</description>
+ <description>The Lion King (prototype, 19940817)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4109,7 +4109,7 @@ a certain item) -->
</software>
<software name="lionkingp1" cloneof="lionking">
- <description>The Lion King (Prototype, 19940820)</description>
+ <description>The Lion King (prototype, 19940820)</description>
<year>1994</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4494,7 +4494,7 @@ a certain item) -->
</software>
<software name="castlillj" cloneof="castlill">
- <description>Mickey Mouse no Castle Illusion (Jpn, SMS Mode)</description>
+ <description>Mickey Mouse no Castle Illusion (Jpn, SMS mode)</description>
<year>1991</year>
<publisher>Sega</publisher>
<info name="serial" value="G-3301"/>
@@ -4559,7 +4559,7 @@ a certain item) -->
</software>
<software name="mmprp" cloneof="mmpr">
- <description>Mighty Morphin Power Rangers (Prototype, 19940716)</description>
+ <description>Mighty Morphin Power Rangers (prototype, 19940716)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4582,7 +4582,7 @@ a certain item) -->
</software>
<software name="mmprtmp" cloneof="mmprtm">
- <description>Mighty Morphin Power Rangers - The Movie (Prototype, 19950530)</description>
+ <description>Mighty Morphin Power Rangers - The Movie (prototype, 19950530)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4769,7 +4769,7 @@ a certain item) -->
</software>
<software name="nazpyoarp" cloneof="nazpyoar">
- <description>Nazo Puyo Arle no Roux (Jpn, Prototype)</description>
+ <description>Nazo Puyo Arle no Roux (Jpn, prototype)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4897,7 +4897,7 @@ a certain item) -->
</software>
<software name="nbaactp23" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940202)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940202)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4908,7 +4908,7 @@ a certain item) -->
</software>
<software name="nbaactp22" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940203)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940203)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4919,7 +4919,7 @@ a certain item) -->
</software>
<software name="nbaactp21" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940206)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940206)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4930,7 +4930,7 @@ a certain item) -->
</software>
<software name="nbaactp20" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940208)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940208)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4941,7 +4941,7 @@ a certain item) -->
</software>
<software name="nbaactp19" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940212)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940212)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4952,7 +4952,7 @@ a certain item) -->
</software>
<software name="nbaactp18" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19941215)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19941215)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4963,7 +4963,7 @@ a certain item) -->
</software>
<software name="nbaactp17" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940217)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940217)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4974,7 +4974,7 @@ a certain item) -->
</software>
<software name="nbaactp16" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940220)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940220)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4985,7 +4985,7 @@ a certain item) -->
</software>
<software name="nbaactp15" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940221)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940221)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -4996,7 +4996,7 @@ a certain item) -->
</software>
<software name="nbaactp14" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940224)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940224)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5007,7 +5007,7 @@ a certain item) -->
</software>
<software name="nbaactp13" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940225-B)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940225-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5018,7 +5018,7 @@ a certain item) -->
</software>
<software name="nbaactp12" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940225)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940225)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5029,7 +5029,7 @@ a certain item) -->
</software>
<software name="nbaactp11" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940226)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940226)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5040,7 +5040,7 @@ a certain item) -->
</software>
<software name="nbaactp10" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940227)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940227)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5051,7 +5051,7 @@ a certain item) -->
</software>
<software name="nbaactp09" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940228)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940228)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5062,7 +5062,7 @@ a certain item) -->
</software>
<software name="nbaactp28" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940104)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940104)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5073,7 +5073,7 @@ a certain item) -->
</software>
<software name="nbaactp27" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940106)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940106)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5084,7 +5084,7 @@ a certain item) -->
</software>
<software name="nbaactp26" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940110)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940110)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5095,7 +5095,7 @@ a certain item) -->
</software>
<software name="nbaactp25" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940124)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940124)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5106,7 +5106,7 @@ a certain item) -->
</software>
<software name="nbaactp24" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19940129)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19940129)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5117,7 +5117,7 @@ a certain item) -->
</software>
<software name="nbaactp29" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19931201)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19931201)</description>
<year>1993</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5128,7 +5128,7 @@ a certain item) -->
</software>
<software name="nbaactp30" cloneof="nbaact">
- <description>NBA Action Starring David Robinson (Prototype, 19931128)</description>
+ <description>NBA Action Starring David Robinson (prototype, 19931128)</description>
<year>1993</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5225,7 +5225,7 @@ a certain item) -->
</software>
<software name="nfl95p13" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940808)</description>
+ <description>NFL '95 (prototype, 19940808)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5236,7 +5236,7 @@ a certain item) -->
</software>
<software name="nfl95p12" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940825-A)</description>
+ <description>NFL '95 (prototype, 19940825-A)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5248,7 +5248,7 @@ a certain item) -->
<!-- same as aug 25 proto. was a mistake by drx? -->
<!--software name="nfl95p11a" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940825-B)</description>
+ <description>NFL '95 (prototype, 19940825-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5259,7 +5259,7 @@ a certain item) -->
</software-->
<software name="nfl95p11" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940825)</description>
+ <description>NFL '95 (prototype, 19940825)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5270,7 +5270,7 @@ a certain item) -->
</software>
<software name="nfl95p10" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940826)</description>
+ <description>NFL '95 (prototype, 19940826)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5281,7 +5281,7 @@ a certain item) -->
</software>
<software name="nfl95p09" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940831)</description>
+ <description>NFL '95 (prototype, 19940831)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5292,7 +5292,7 @@ a certain item) -->
</software>
<software name="nfl95p08" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940902)</description>
+ <description>NFL '95 (prototype, 19940902)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5303,7 +5303,7 @@ a certain item) -->
</software>
<software name="nfl95p07" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940908)</description>
+ <description>NFL '95 (prototype, 19940908)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5314,7 +5314,7 @@ a certain item) -->
</software>
<software name="nfl95p06" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940910)</description>
+ <description>NFL '95 (prototype, 19940910)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5325,7 +5325,7 @@ a certain item) -->
</software>
<software name="nfl95p05" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940911-B)</description>
+ <description>NFL '95 (prototype, 19940911-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5336,7 +5336,7 @@ a certain item) -->
</software>
<software name="nfl95p04" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940911-C)</description>
+ <description>NFL '95 (prototype, 19940911-C)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5347,7 +5347,7 @@ a certain item) -->
</software>
<software name="nfl95p03" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940912)</description>
+ <description>NFL '95 (prototype, 19940912)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5358,7 +5358,7 @@ a certain item) -->
</software>
<software name="nfl95p02" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940914-F)</description>
+ <description>NFL '95 (prototype, 19940914-F)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5369,7 +5369,7 @@ a certain item) -->
</software>
<software name="nfl95p01" cloneof="nfl95">
- <description>NFL '95 (Prototype, 19940914)</description>
+ <description>NFL '95 (prototype, 19940914)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5417,7 +5417,7 @@ a certain item) -->
</software>
<software name="nhlasp17" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19941215)</description>
+ <description>NHL All-Star Hockey (prototype, 19941215)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5428,7 +5428,7 @@ a certain item) -->
</software>
<software name="nhlasp16" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19941222)</description>
+ <description>NHL All-Star Hockey (prototype, 19941222)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5439,7 +5439,7 @@ a certain item) -->
</software>
<software name="nhlasp15" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19941229)</description>
+ <description>NHL All-Star Hockey (prototype, 19941229)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5450,7 +5450,7 @@ a certain item) -->
</software>
<software name="nhlasp14" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19941231)</description>
+ <description>NHL All-Star Hockey (prototype, 19941231)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5461,7 +5461,7 @@ a certain item) -->
</software>
<software name="nhlasp13" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950102)</description>
+ <description>NHL All-Star Hockey (prototype, 19950102)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5472,7 +5472,7 @@ a certain item) -->
</software>
<software name="nhlasp12" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950103)</description>
+ <description>NHL All-Star Hockey (prototype, 19950103)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5483,7 +5483,7 @@ a certain item) -->
</software>
<software name="nhlasp11" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950107)</description>
+ <description>NHL All-Star Hockey (prototype, 19950107)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5494,7 +5494,7 @@ a certain item) -->
</software>
<software name="nhlasp10" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950111)</description>
+ <description>NHL All-Star Hockey (prototype, 19950111)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5505,7 +5505,7 @@ a certain item) -->
</software>
<software name="nhlasp09" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950113)</description>
+ <description>NHL All-Star Hockey (prototype, 19950113)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5516,7 +5516,7 @@ a certain item) -->
</software>
<software name="nhlasp08" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950116)</description>
+ <description>NHL All-Star Hockey (prototype, 19950116)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5527,7 +5527,7 @@ a certain item) -->
</software>
<software name="nhlasp07" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950120)</description>
+ <description>NHL All-Star Hockey (prototype, 19950120)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5538,7 +5538,7 @@ a certain item) -->
</software>
<software name="nhlasp06" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950121)</description>
+ <description>NHL All-Star Hockey (prototype, 19950121)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5549,7 +5549,7 @@ a certain item) -->
</software>
<software name="nhlasp05" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950124-A)</description>
+ <description>NHL All-Star Hockey (prototype, 19950124-A)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5560,7 +5560,7 @@ a certain item) -->
</software>
<software name="nhlasp04" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950124-B)</description>
+ <description>NHL All-Star Hockey (prototype, 19950124-B)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5571,7 +5571,7 @@ a certain item) -->
</software>
<software name="nhlasp03" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950124-C)</description>
+ <description>NHL All-Star Hockey (prototype, 19950124-C)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5582,7 +5582,7 @@ a certain item) -->
</software>
<software name="nhlasp02" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950124)</description>
+ <description>NHL All-Star Hockey (prototype, 19950124)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5593,7 +5593,7 @@ a certain item) -->
</software>
<software name="nhlasp01" cloneof="nhlas">
- <description>NHL All-Star Hockey (Prototype, 19950125)</description>
+ <description>NHL All-Star Hockey (prototype, 19950125)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5728,7 +5728,7 @@ a certain item) -->
</software>
<software name="olympgld">
- <description>Olympic Gold (Euro, v1, SMS Mode)</description>
+ <description>Olympic Gold (Euro, v1, SMS mode)</description>
<year>1992</year>
<publisher>U.S. Gold</publisher>
<info name="serial" value="79018-50, 79018-05, 79018-18"/>
@@ -5744,7 +5744,7 @@ a certain item) -->
</software>
<software name="olympglda" cloneof="olympgld">
- <description>Olympic Gold (Jpn, USA, v0, SMS Mode)</description>
+ <description>Olympic Gold (Jpn, USA, v0, SMS mode)</description>
<year>1992</year>
<publisher>U.S. Gold</publisher>
<info name="serial" value="G-3316 (JPN), T-79018"/>
@@ -5797,7 +5797,7 @@ a certain item) -->
</software>
<software name="outrneur">
- <description>Out Run Europa (Euro, Bra, SMS Mode)</description>
+ <description>Out Run Europa (Euro, Bra, SMS mode)</description>
<year>1992</year>
<publisher>U.S. Gold</publisher>
<info name="serial" value="T-79038-50, 016.870"/>
@@ -5810,7 +5810,7 @@ a certain item) -->
</software>
<software name="outrneuru" cloneof="outrneur">
- <description>Out Run Europa (USA, SMS Mode)</description>
+ <description>Out Run Europa (USA, SMS mode)</description>
<year>1992</year>
<publisher>U.S. Gold</publisher>
<info name="serial" value="T-79038"/>
@@ -5834,7 +5834,7 @@ a certain item) -->
</software>
<software name="pacintim">
- <description>Pac-In-Time (Prototype)</description>
+ <description>Pac-In-Time (prototype)</description>
<year>1994</year>
<publisher>Namco</publisher>
<part name="cart" interface="gamegear_cart">
@@ -5911,7 +5911,7 @@ a certain item) -->
</software>
<software name="paperbo2p" cloneof="paperbo2">
- <description>Paperboy II (Prototype)</description>
+ <description>Paperboy II (prototype)</description>
<year>1992</year>
<publisher>Tengen</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6203,7 +6203,7 @@ a certain item) -->
</software>
<software name="predatr2">
- <description>Predator 2 (Euro, USA, SMS Mode)</description>
+ <description>Predator 2 (Euro, USA, SMS mode)</description>
<year>1992</year>
<publisher>Arena</publisher>
<info name="serial" value="T-81068, T-81068-50"/>
@@ -6231,7 +6231,7 @@ a certain item) -->
</software>
<software name="ppersia">
- <description>Prince of Persia (Euro, SMS Mode)</description>
+ <description>Prince of Persia (Euro, SMS mode)</description>
<year>1992</year>
<publisher>Domark</publisher>
<info name="serial" value="T-88018-50"/>
@@ -6244,7 +6244,7 @@ a certain item) -->
</software>
<software name="ppersiau" cloneof="ppersia">
- <description>Prince of Persia (USA, SMS Mode)</description>
+ <description>Prince of Persia (USA, SMS mode)</description>
<year>1992</year>
<publisher>Domark</publisher>
<info name="serial" value="T-48098 301053-0161"/>
@@ -6466,7 +6466,7 @@ a certain item) -->
</software>
<software name="rcgp">
- <description>R.C. Grand Prix (USA, SMS Mode)</description>
+ <description>R.C. Grand Prix (USA, SMS mode)</description>
<year>1992</year>
<publisher>Absolute Entertainment</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6478,7 +6478,7 @@ a certain item) -->
</software>
<software name="rastan">
- <description>Rastan Saga (Jpn, SMS Mode)</description>
+ <description>Rastan Saga (Jpn, SMS mode)</description>
<year>1991</year>
<publisher>Taito</publisher>
<info name="serial" value="T-11037"/>
@@ -6559,7 +6559,7 @@ a certain item) -->
</software>
<software name="ristarp2" cloneof="ristar">
- <description>Ristar - The Shooting Star (Prototype, 19941101)</description>
+ <description>Ristar - The Shooting Star (prototype, 19941101)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6570,7 +6570,7 @@ a certain item) -->
</software>
<software name="ristarp1" cloneof="ristar">
- <description>Ristar - The Shooting Star (Prototype, 19941102)</description>
+ <description>Ristar - The Shooting Star (prototype, 19941102)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6581,7 +6581,7 @@ a certain item) -->
</software>
<software name="ristarp4" cloneof="ristar">
- <description>Ristar - The Shooting Star (Prototype, 19941019)</description>
+ <description>Ristar - The Shooting Star (prototype, 19941019)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6592,7 +6592,7 @@ a certain item) -->
</software>
<software name="ristarp3" cloneof="ristar">
- <description>Ristar - The Shooting Star (Prototype, 19941026)</description>
+ <description>Ristar - The Shooting Star (prototype, 19941026)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6603,7 +6603,7 @@ a certain item) -->
</software>
<software name="ristarp5" cloneof="ristar">
- <description>Ristar - The Shooting Star (Prototype, 19940909)</description>
+ <description>Ristar - The Shooting Star (prototype, 19940909)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6804,7 +6804,7 @@ a certain item) -->
</software>
<software name="sega4in1p" cloneof="sega4in1">
- <description>Sega Game Pack 4 in 1 (Euro, Prototype)</description>
+ <description>Sega Game Pack 4 in 1 (Euro, prototype)</description>
<year>1991</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6976,7 +6976,7 @@ a certain item) -->
</software>
<software name="shinfrc2p4" cloneof="shinfrc2">
- <description>Shining Force II - The Sword of Hajya (Prototype, 19940427)</description>
+ <description>Shining Force II - The Sword of Hajya (prototype, 19940427)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -6991,7 +6991,7 @@ a certain item) -->
</software>
<software name="shinfrc2p1" cloneof="shinfrc2">
- <description>Shining Force II - The Sword of Hajya (Prototype, 19940708)</description>
+ <description>Shining Force II - The Sword of Hajya (prototype, 19940708)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7006,7 +7006,7 @@ a certain item) -->
</software>
<software name="shinfrc2p2" cloneof="shinfrc2">
- <description>Shining Force II - The Sword of Hajya (Prototype, 19940627)</description>
+ <description>Shining Force II - The Sword of Hajya (prototype, 19940627)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7021,7 +7021,7 @@ a certain item) -->
</software>
<software name="shinfrc2p3" cloneof="shinfrc2">
- <description>Shining Force II - The Sword of Hajya (Prototype, 19940530)</description>
+ <description>Shining Force II - The Sword of Hajya (prototype, 19940530)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7232,7 +7232,7 @@ a certain item) -->
</software>
<software name="sonicblsp6" cloneof="sonicbls">
- <description>Sonic Blast (Prototype 611, 19960531, 13.49)</description>
+ <description>Sonic Blast (prototype 611, 19960531, 13.49)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7243,7 +7243,7 @@ a certain item) -->
</software>
<software name="sonicblsp5" cloneof="sonicbls">
- <description>Sonic Blast (Prototype 74, 19960717, 09.11)</description>
+ <description>Sonic Blast (prototype 74, 19960717, 09.11)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7254,7 +7254,7 @@ a certain item) -->
</software>
<software name="sonicblsp4" cloneof="sonicbls">
- <description>Sonic Blast (Prototype 806, 19960806, 18.37)</description>
+ <description>Sonic Blast (prototype 806, 19960806, 18.37)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7265,7 +7265,7 @@ a certain item) -->
</software>
<software name="sonicblsp3" cloneof="sonicbls">
- <description>Sonic Blast (Prototype 821, 19960822, 09.38)</description>
+ <description>Sonic Blast (prototype 821, 19960822, 09.38)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7276,7 +7276,7 @@ a certain item) -->
</software>
<software name="sonicblsp2" cloneof="sonicbls">
- <description>Sonic Blast (Prototype 827, 19960828, 11.13)</description>
+ <description>Sonic Blast (prototype 827, 19960828, 11.13)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7287,7 +7287,7 @@ a certain item) -->
</software>
<software name="sonicblsp1" cloneof="sonicbls">
- <description>Sonic Blast (Prototype 94, 19960902, 17.47)</description>
+ <description>Sonic Blast (prototype 94, 19960902, 17.47)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7314,7 +7314,7 @@ a certain item) -->
<!-- Notes: Sega Europe labels; internal version not ideal for reference -->
<software name="sonicc517" cloneof="sonicc">
- <description>Sonic the Hedgehog Chaos (Euro, Prototype 19930517)</description>
+ <description>Sonic the Hedgehog Chaos (Euro, prototype 19930517)</description>
<year>1993</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7404,7 +7404,7 @@ a certain item) -->
</software>
<software name="sspinp20" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0307, 19940307, 05.24)</description>
+ <description>Sonic Spinball (prototype 0307, 19940307, 05.24)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7415,7 +7415,7 @@ a certain item) -->
</software>
<software name="sspinp19" cloneof="sspin">
- <description>Sonic Spinball (Prototype 031094, 19940310, 17.41)</description>
+ <description>Sonic Spinball (prototype 031094, 19940310, 17.41)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7426,7 +7426,7 @@ a certain item) -->
</software>
<software name="sspinp18" cloneof="sspin">
- <description>Sonic Spinball (Prototype 031194, 19940311, 12.09)</description>
+ <description>Sonic Spinball (prototype 031194, 19940311, 12.09)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7437,7 +7437,7 @@ a certain item) -->
</software>
<software name="sspinp17" cloneof="sspin">
- <description>Sonic Spinball (Prototype 032194, 19940321, 07.12)</description>
+ <description>Sonic Spinball (prototype 032194, 19940321, 07.12)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7448,7 +7448,7 @@ a certain item) -->
</software>
<software name="sspinp16" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0328, 19940328, 06.54)</description>
+ <description>Sonic Spinball (prototype 0328, 19940328, 06.54)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7459,7 +7459,7 @@ a certain item) -->
</software>
<software name="sspinp15" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0329, 19940329, 07.35)</description>
+ <description>Sonic Spinball (prototype 0329, 19940329, 07.35)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7470,7 +7470,7 @@ a certain item) -->
</software>
<software name="sspinp14" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0330, 19940330, 06.54)</description>
+ <description>Sonic Spinball (prototype 0330, 19940330, 06.54)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7481,7 +7481,7 @@ a certain item) -->
</software>
<software name="sspinp13" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0405, 19940405, 18.07)</description>
+ <description>Sonic Spinball (prototype 0405, 19940405, 18.07)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7492,7 +7492,7 @@ a certain item) -->
</software>
<software name="sspinp12" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0412, 19940412, 07.26)</description>
+ <description>Sonic Spinball (prototype 0412, 19940412, 07.26)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7503,7 +7503,7 @@ a certain item) -->
</software>
<software name="sspinp11" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0413, 19940413, 02.54)</description>
+ <description>Sonic Spinball (prototype 0413, 19940413, 02.54)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7514,7 +7514,7 @@ a certain item) -->
</software>
<software name="sspinp10" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0415, 19940415, 17.33)</description>
+ <description>Sonic Spinball (prototype 0415, 19940415, 17.33)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7525,7 +7525,7 @@ a certain item) -->
</software>
<software name="sspinp09" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0421, 19940421, 05.30)</description>
+ <description>Sonic Spinball (prototype 0421, 19940421, 05.30)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7536,7 +7536,7 @@ a certain item) -->
</software>
<software name="sspinp08" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0427, 19940427, 04.51)</description>
+ <description>Sonic Spinball (prototype 0427, 19940427, 04.51)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7547,7 +7547,7 @@ a certain item) -->
</software>
<software name="sspinp07" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0429, 19940429, 06.01)</description>
+ <description>Sonic Spinball (prototype 0429, 19940429, 06.01)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7558,7 +7558,7 @@ a certain item) -->
</software>
<software name="sspinp06" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0430, 19940429, 21.48)</description>
+ <description>Sonic Spinball (prototype 0430, 19940429, 21.48)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7569,7 +7569,7 @@ a certain item) -->
</software>
<software name="sspinp05" cloneof="sspin">
- <description>Sonic Spinball (Prototype 503B, 19940503, 19.27)</description>
+ <description>Sonic Spinball (prototype 503B, 19940503, 19.27)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7580,7 +7580,7 @@ a certain item) -->
</software>
<software name="sspinp04" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0505, 19940505, 04.47)</description>
+ <description>Sonic Spinball (prototype 0505, 19940505, 04.47)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7591,7 +7591,7 @@ a certain item) -->
</software>
<software name="sspinp03" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0506, 19940506, 13.04)</description>
+ <description>Sonic Spinball (prototype 0506, 19940506, 13.04)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7602,7 +7602,7 @@ a certain item) -->
</software>
<software name="sspinp02" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0525, 19940525, 13.24)</description>
+ <description>Sonic Spinball (prototype 0525, 19940525, 13.24)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7613,7 +7613,7 @@ a certain item) -->
</software>
<software name="sspinp01" cloneof="sspin">
- <description>Sonic Spinball (Prototype 0530, 19940530, 23.25)</description>
+ <description>Sonic Spinball (prototype 0530, 19940530, 23.25)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7655,7 +7655,7 @@ a certain item) -->
</software>
<software name="sonicp" cloneof="sonic">
- <description>Sonic The Hedgehog (World, Prototype)</description>
+ <description>Sonic The Hedgehog (World, prototype)</description>
<year>1991</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7720,7 +7720,7 @@ a certain item) -->
</software>
<software name="sonictrip" cloneof="sonictri">
- <description>Sonic The Hedgehog - Triple Trouble (Prototype 0808, 19940808, 18.05)</description>
+ <description>Sonic The Hedgehog - Triple Trouble (prototype 0808, 19940808, 18.05)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7811,7 +7811,7 @@ a certain item) -->
</software>
<software name="spirou">
- <description>Spirou (Euro, Prototype)</description>
+ <description>Spirou (Euro, prototype)</description>
<year>1996</year>
<publisher>Infogrames</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7847,7 +7847,7 @@ a certain item) -->
<!-- Apparently, the development of both Sports Trivia and Sports Trivia CE went on in parallel... hard to say which
version the QTEST/ALOGTEST/etc. protos were for (more info are needed on these, or some code analysis/comparison) -->
<software name="sporttrvp12" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950308)</description>
+ <description>Sports Trivia (prototype, 19950308)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7858,7 +7858,7 @@ a certain item) -->
</software>
<software name="sporttrvp11" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950309)</description>
+ <description>Sports Trivia (prototype, 19950309)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7869,7 +7869,7 @@ a certain item) -->
</software>
<software name="sporttrvp10" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950313)</description>
+ <description>Sports Trivia (prototype, 19950313)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7880,7 +7880,7 @@ a certain item) -->
</software>
<software name="sporttrvp09" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950316-1MEG)</description>
+ <description>Sports Trivia (prototype, 19950316-1MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7891,7 +7891,7 @@ a certain item) -->
</software>
<software name="sporttrvp08" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950316-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950316-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7902,7 +7902,7 @@ a certain item) -->
</software>
<software name="sporttrvp07" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950317-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950317-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7913,7 +7913,7 @@ a certain item) -->
</software>
<software name="sporttrvp06" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950320-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950320-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7924,7 +7924,7 @@ a certain item) -->
</software>
<software name="sporttrvp05" cloneof="sporttrv">
- <description>Sports Trivia (Prototype, 19950320-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950320-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7935,7 +7935,7 @@ a certain item) -->
</software>
<software name="sporttrvp04" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950425-1MEG)</description>
+ <description>Sports Trivia (prototype, 19950425-1MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7946,7 +7946,7 @@ a certain item) -->
</software>
<software name="sporttrvp03" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950425-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950425-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7957,7 +7957,7 @@ a certain item) -->
</software>
<software name="sporttrvp02" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950427-1MEG)</description>
+ <description>Sports Trivia (prototype, 19950427-1MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7968,7 +7968,7 @@ a certain item) -->
</software>
<software name="sporttrvp01" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950504-1MEG)</description>
+ <description>Sports Trivia (prototype, 19950504-1MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -7990,7 +7990,7 @@ a certain item) -->
</software>
<software name="sprtrvcep01" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950502-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950502-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8001,7 +8001,7 @@ a certain item) -->
</software>
<software name="sprtrvcep13" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950403-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950403-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8012,7 +8012,7 @@ a certain item) -->
</software>
<software name="sprtrvcep12" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950403-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950403-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8023,7 +8023,7 @@ a certain item) -->
</software>
<software name="sprtrvcep11" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950404-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950404-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8034,7 +8034,7 @@ a certain item) -->
</software>
<software name="sprtrvcep10" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950405-2MEG-B)</description>
+ <description>Sports Trivia (prototype, 19950405-2MEG-B)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8045,7 +8045,7 @@ a certain item) -->
</software>
<software name="sprtrvcep09" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950405-2MEG-C)</description>
+ <description>Sports Trivia (prototype, 19950405-2MEG-C)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8056,7 +8056,7 @@ a certain item) -->
</software>
<software name="sprtrvcep08" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950405-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950405-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8067,7 +8067,7 @@ a certain item) -->
</software>
<software name="sprtrvcep07" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950406-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950406-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8078,7 +8078,7 @@ a certain item) -->
</software>
<software name="sprtrvcep06" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950407-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950407-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8089,7 +8089,7 @@ a certain item) -->
</software>
<software name="sprtrvcep05" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950407-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950407-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8100,7 +8100,7 @@ a certain item) -->
</software>
<software name="sprtrvcep04" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950411-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950411-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8111,7 +8111,7 @@ a certain item) -->
</software>
<software name="sprtrvcep03" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950412-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950412-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8122,7 +8122,7 @@ a certain item) -->
</software>
<software name="sprtrvcep02" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950428-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950428-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8133,7 +8133,7 @@ a certain item) -->
</software>
<software name="sprtrvcep24" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950321-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950321-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8144,7 +8144,7 @@ a certain item) -->
</software>
<software name="sprtrvcep23" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950323-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950323-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8155,7 +8155,7 @@ a certain item) -->
</software>
<software name="sprtrvcep22" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950323-ALGOTEST)</description>
+ <description>Sports Trivia (prototype, 19950323-ALGOTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8166,7 +8166,7 @@ a certain item) -->
</software>
<software name="sprtrvcep21" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950323-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950323-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8177,7 +8177,7 @@ a certain item) -->
</software>
<software name="sprtrvcep20" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950327-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950327-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8188,7 +8188,7 @@ a certain item) -->
</software>
<software name="sprtrvcep19" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950327-ALGOTEST)</description>
+ <description>Sports Trivia (prototype, 19950327-ALGOTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8199,7 +8199,7 @@ a certain item) -->
</software>
<software name="sprtrvcep18" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950329-2MEG)</description>
+ <description>Sports Trivia (prototype, 19950329-2MEG)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8210,7 +8210,7 @@ a certain item) -->
</software>
<software name="sprtrvcep17" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950329-ALGOTEST)</description>
+ <description>Sports Trivia (prototype, 19950329-ALGOTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8221,7 +8221,7 @@ a certain item) -->
</software>
<software name="sprtrvcep16" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950329-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950329-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8232,7 +8232,7 @@ a certain item) -->
</software>
<software name="sprtrvcep15" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950330-2MEG-D)</description>
+ <description>Sports Trivia (prototype, 19950330-2MEG-D)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8243,7 +8243,7 @@ a certain item) -->
</software>
<software name="sprtrvcep14" cloneof="sprtrvce">
- <description>Sports Trivia (Prototype, 19950330-QTEST)</description>
+ <description>Sports Trivia (prototype, 19950330-QTEST)</description>
<year>1995</year>
<publisher>Sega?</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8316,7 +8316,7 @@ a certain item) -->
</software>
<software name="shero">
- <description>Street Hero (USA, Prototype, SMS Mode)</description>
+ <description>Street Hero (USA, prototype, SMS mode)</description>
<year>1993</year>
<publisher>Innovation Tech</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8329,7 +8329,7 @@ a certain item) -->
</software>
<software name="sheroa" cloneof="shero">
- <description>Street Hero (USA, Prototype Alt, SMS Mode)</description>
+ <description>Street Hero (USA, prototype Alt, SMS mode)</description>
<year>1993</year>
<publisher>Innovation Tech</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8427,7 +8427,7 @@ a certain item) -->
</software>
<software name="supercolp6" cloneof="supercol">
- <description>Super Columns (Prototype, 19941201)</description>
+ <description>Super Columns (prototype, 19941201)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8438,7 +8438,7 @@ a certain item) -->
</software>
<software name="supercolp5" cloneof="supercol">
- <description>Super Columns (Prototype, 19941215)</description>
+ <description>Super Columns (prototype, 19941215)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8449,7 +8449,7 @@ a certain item) -->
</software>
<software name="supercolp4" cloneof="supercol">
- <description>Super Columns (Prototype, 19941221)</description>
+ <description>Super Columns (prototype, 19941221)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8460,7 +8460,7 @@ a certain item) -->
</software>
<software name="supercolp3" cloneof="supercol">
- <description>Super Columns (Prototype, 19941226)</description>
+ <description>Super Columns (prototype, 19941226)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8471,7 +8471,7 @@ a certain item) -->
</software>
<software name="supercolp2" cloneof="supercol">
- <description>Super Columns (Prototype, 19941228)</description>
+ <description>Super Columns (prototype, 19941228)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8482,7 +8482,7 @@ a certain item) -->
</software>
<software name="supercolp1" cloneof="supercol">
- <description>Super Columns (Prototype, 19950106)</description>
+ <description>Super Columns (prototype, 19950106)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8493,7 +8493,7 @@ a certain item) -->
</software>
<software name="supercolp7" cloneof="supercol">
- <description>Super Columns (Prototype, 19941111)</description>
+ <description>Super Columns (prototype, 19941111)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8529,7 +8529,7 @@ a certain item) -->
</software>
<software name="skickoff">
- <description>Super Kick Off (Euro, SMS Mode)</description>
+ <description>Super Kick Off (Euro, SMS mode)</description>
<year>1991</year>
<publisher>Sega</publisher>
<info name="serial" value="2415"/>
@@ -8652,7 +8652,7 @@ a certain item) -->
</software>
<software name="stetris">
- <description>Super Tetris (Kor, SMS Mode?)</description>
+ <description>Super Tetris (Kor, SMS mode?)</description>
<year>199?</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8679,7 +8679,7 @@ a certain item) -->
</software>
<software name="supermanp" cloneof="superman">
- <description>Superman - The Man of Steel (Euro, Prototype)</description>
+ <description>Superman - The Man of Steel (Euro, prototype)</description>
<year>1993</year>
<publisher>Virgin Interactive</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8826,7 +8826,7 @@ a certain item) -->
</software>
<software name="chasehqj" cloneof="chasehq">
- <description>Taito Chase H.Q. (Jpn, SMS Mode)</description>
+ <description>Taito Chase H.Q. (Jpn, SMS mode)</description>
<year>1991</year>
<publisher>Taito</publisher>
<info name="serial" value="T-11017"/>
@@ -8841,7 +8841,7 @@ a certain item) -->
</software>
<software name="chasehq">
- <description>Taito Chase H.Q. (USA, SMS Mode)</description>
+ <description>Taito Chase H.Q. (USA, SMS mode)</description>
<year>1991</year>
<publisher>Taito</publisher>
<info name="serial" value="T-11018"/>
@@ -8932,7 +8932,7 @@ a certain item) -->
</software>
<software name="tazmarsp13" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940810)</description>
+ <description>Taz in Escape from Mars (prototype, 19940810)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8943,7 +8943,7 @@ a certain item) -->
</software>
<software name="tazmarsp12" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940812)</description>
+ <description>Taz in Escape from Mars (prototype, 19940812)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8954,7 +8954,7 @@ a certain item) -->
</software>
<software name="tazmarsp11" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940814)</description>
+ <description>Taz in Escape from Mars (prototype, 19940814)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8966,7 +8966,7 @@ a certain item) -->
<!-- same as aug 14 proto. was a mistake by drx? -->
<!--software name="tazmarsp11a" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940815)</description>
+ <description>Taz in Escape from Mars (prototype, 19940815)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8977,7 +8977,7 @@ a certain item) -->
</software-->
<software name="tazmarsp10" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940819)</description>
+ <description>Taz in Escape from Mars (prototype, 19940819)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8988,7 +8988,7 @@ a certain item) -->
</software>
<software name="tazmarsp09" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940823)</description>
+ <description>Taz in Escape from Mars (prototype, 19940823)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -8999,7 +8999,7 @@ a certain item) -->
</software>
<software name="tazmarsp08" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940829-B)</description>
+ <description>Taz in Escape from Mars (prototype, 19940829-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9010,7 +9010,7 @@ a certain item) -->
</software>
<software name="tazmarsp07" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940830)</description>
+ <description>Taz in Escape from Mars (prototype, 19940830)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9021,7 +9021,7 @@ a certain item) -->
</software>
<software name="tazmarsp14" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940511)</description>
+ <description>Taz in Escape from Mars (prototype, 19940511)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9032,7 +9032,7 @@ a certain item) -->
</software>
<software name="tazmarsp06" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940902)</description>
+ <description>Taz in Escape from Mars (prototype, 19940902)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9043,7 +9043,7 @@ a certain item) -->
</software>
<software name="tazmarsp05" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940905-B)</description>
+ <description>Taz in Escape from Mars (prototype, 19940905-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9054,7 +9054,7 @@ a certain item) -->
</software>
<software name="tazmarsp04" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940905-C)</description>
+ <description>Taz in Escape from Mars (prototype, 19940905-C)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9065,7 +9065,7 @@ a certain item) -->
</software>
<software name="tazmarsp03" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940906-D)</description>
+ <description>Taz in Escape from Mars (prototype, 19940906-D)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9076,7 +9076,7 @@ a certain item) -->
</software>
<software name="tazmarsp02" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940909-B)</description>
+ <description>Taz in Escape from Mars (prototype, 19940909-B)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9087,7 +9087,7 @@ a certain item) -->
</software>
<software name="tazmarsp01" cloneof="tazmars">
- <description>Taz in Escape from Mars (Prototype, 19940910)</description>
+ <description>Taz in Escape from Mars (prototype, 19940910)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9130,7 +9130,7 @@ a certain item) -->
</software>
<software name="tempojrp8" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19941205)</description>
+ <description>Tempo Jr. (prototype, 19941205)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9141,7 +9141,7 @@ a certain item) -->
</software>
<software name="tempojrp7" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19941212)</description>
+ <description>Tempo Jr. (prototype, 19941212)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9152,7 +9152,7 @@ a certain item) -->
</software>
<software name="tempojrp6" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19941226)</description>
+ <description>Tempo Jr. (prototype, 19941226)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9163,7 +9163,7 @@ a certain item) -->
</software>
<software name="tempojrp2" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19950206)</description>
+ <description>Tempo Jr. (prototype, 19950206)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9174,7 +9174,7 @@ a certain item) -->
</software>
<software name="tempojrp1" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19950215)</description>
+ <description>Tempo Jr. (prototype, 19950215)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9185,7 +9185,7 @@ a certain item) -->
</software>
<software name="tempojrp5" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19950117)</description>
+ <description>Tempo Jr. (prototype, 19950117)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9196,7 +9196,7 @@ a certain item) -->
</software>
<software name="tempojrp4" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19950120)</description>
+ <description>Tempo Jr. (prototype, 19950120)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9207,7 +9207,7 @@ a certain item) -->
</software>
<software name="tempojrp3" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19950131)</description>
+ <description>Tempo Jr. (prototype, 19950131)</description>
<year>1995</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9218,7 +9218,7 @@ a certain item) -->
</software>
<software name="tempojrp9" cloneof="tempojr">
- <description>Tempo Jr. (Prototype, 19941128)</description>
+ <description>Tempo Jr. (prototype, 19941128)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9478,7 +9478,7 @@ a certain item) -->
</software>
<software name="wildsnak">
- <description>WildSnake (Prototype)</description>
+ <description>WildSnake (prototype)</description>
<year>1994</year>
<publisher>Bullet-Proof Software</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9606,7 +9606,7 @@ a certain item) -->
</software>
<software name="wboydtrpp" cloneof="wboydtrp">
- <description>Wonder Boy III - The Dragon's Trap (Euro, Prototype)</description>
+ <description>Wonder Boy III - The Dragon's Trap (Euro, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9695,7 +9695,7 @@ a certain item) -->
</software>
<software name="wsb95p5" cloneof="wsb95">
- <description>World Series Baseball '95 (Prototype, 19940709)</description>
+ <description>World Series Baseball '95 (prototype, 19940709)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9706,7 +9706,7 @@ a certain item) -->
</software>
<software name="wsb95p4" cloneof="wsb95">
- <description>World Series Baseball '95 (Prototype, 19940719)</description>
+ <description>World Series Baseball '95 (prototype, 19940719)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9717,7 +9717,7 @@ a certain item) -->
</software>
<software name="wsb95p3" cloneof="wsb95">
- <description>World Series Baseball '95 (Prototype, 19940722)</description>
+ <description>World Series Baseball '95 (prototype, 19940722)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9728,7 +9728,7 @@ a certain item) -->
</software>
<software name="wsb95p2" cloneof="wsb95">
- <description>World Series Baseball '95 (Prototype, 19940728)</description>
+ <description>World Series Baseball '95 (prototype, 19940728)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9739,7 +9739,7 @@ a certain item) -->
</software>
<software name="wsb95p1" cloneof="wsb95">
- <description>World Series Baseball '95 (Prototype, 19940729)</description>
+ <description>World Series Baseball '95 (prototype, 19940729)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9750,7 +9750,7 @@ a certain item) -->
</software>
<software name="wsb95p6" cloneof="wsb95">
- <description>World Series Baseball '95 (Prototype, 19940629)</description>
+ <description>World Series Baseball '95 (prototype, 19940629)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9797,7 +9797,7 @@ a certain item) -->
</software>
<software name="wwfsteel">
- <description>WWF Wrestlemania Steel Cage Challenge (Euro, SMS Mode)</description>
+ <description>WWF Wrestlemania Steel Cage Challenge (Euro, SMS mode)</description>
<year>1993</year>
<publisher>Flying Edge</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9833,7 +9833,7 @@ a certain item) -->
</software>
<software name="xmenglp3" cloneof="xmengl">
- <description>X-Men - Gamemaster's Legacy (Prototype, 19940810)</description>
+ <description>X-Men - Gamemaster's Legacy (prototype, 19940810)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9845,7 +9845,7 @@ a certain item) -->
<!-- same as aug 10 proto. was a mistake by drx? -->
<!--software name="xmenglp3a" cloneof="xmengl">
- <description>X-Men - Gamemaster's Legacy (Prototype, 19940815)</description>
+ <description>X-Men - Gamemaster's Legacy (prototype, 19940815)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9856,7 +9856,7 @@ a certain item) -->
</software-->
<software name="xmenglp2" cloneof="xmengl">
- <description>X-Men - Gamemaster's Legacy (Prototype 36, 19940831)</description>
+ <description>X-Men - Gamemaster's Legacy (prototype 36, 19940831)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9867,7 +9867,7 @@ a certain item) -->
</software>
<software name="xmenglp1" cloneof="xmengl">
- <description>X-Men - Gamemaster's Legacy (Prototype 51, 19940906)</description>
+ <description>X-Men - Gamemaster's Legacy (prototype 51, 19940906)</description>
<year>1994</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9889,7 +9889,7 @@ a certain item) -->
</software>
<software name="xmenmojop7" cloneof="xmenmojo">
- <description>X-Men - Mojo World (Prototype, 19960605)</description>
+ <description>X-Men - Mojo World (prototype, 19960605)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9900,7 +9900,7 @@ a certain item) -->
</software>
<software name="xmenmojop6" cloneof="xmenmojo">
- <description>X-Men - Mojo World (Prototype, 19960613)</description>
+ <description>X-Men - Mojo World (prototype, 19960613)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9911,7 +9911,7 @@ a certain item) -->
</software>
<software name="xmenmojop5" cloneof="xmenmojo">
- <description>X-Men - Mojo World (Prototype, 19960624)</description>
+ <description>X-Men - Mojo World (prototype, 19960624)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9922,7 +9922,7 @@ a certain item) -->
</software>
<software name="xmenmojop4" cloneof="xmenmojo">
- <description>X-Men - Mojo World (Prototype, 19960625)</description>
+ <description>X-Men - Mojo World (prototype, 19960625)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9933,7 +9933,7 @@ a certain item) -->
</software>
<software name="xmenmojop3" cloneof="xmenmojo">
- <description>X-Men - Mojo World (Prototype, 19960627)</description>
+ <description>X-Men - Mojo World (prototype, 19960627)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9944,7 +9944,7 @@ a certain item) -->
</software>
<software name="xmenmojop2" cloneof="xmenmojo">
- <description>X-Men - Mojo World (Prototype, 19960628)</description>
+ <description>X-Men - Mojo World (prototype, 19960628)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9955,7 +9955,7 @@ a certain item) -->
</software>
<software name="xmenmojop1" cloneof="xmenmojo">
- <description>X-Men - Mojo World (Prototype, 19960629)</description>
+ <description>X-Men - Mojo World (prototype, 19960629)</description>
<year>1996</year>
<publisher>Sega</publisher>
<part name="cart" interface="gamegear_cart">
@@ -9966,7 +9966,7 @@ a certain item) -->
</software>
<software name="yogibear">
- <description>Yogi Bear in Yogi Bear's Goldrush (Prototype)</description>
+ <description>Yogi Bear in Yogi Bear's Goldrush (prototype)</description>
<year>1994</year>
<publisher>GameTek</publisher>
<part name="cart" interface="gamegear_cart">
@@ -10061,7 +10061,7 @@ a certain item) -->
</software>
<software name="zoopp" cloneof="zoop">
- <description>Zoop (USA, Prototype)</description>
+ <description>Zoop (USA, prototype)</description>
<year>1995</year>
<publisher>Viacom New Media</publisher>
<part name="cart" interface="gamegear_cart">
diff --git a/hash/gameking.xml b/hash/gameking.xml
index a1a63db19c9..fc90eb8edd2 100644
--- a/hash/gameking.xml
+++ b/hash/gameking.xml
@@ -1,361 +1,382 @@
<?xml version="1.0"?>
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
-<!--
+<!-- see https://www.obsoleteworlds.com/gameking.html for some images of GameKing carts running on both an original unit, and a GameKing 3 with added colour -->
+
+<!-- Cartridge Pinout
+
+ _______
+ VCC = |01 31| = GND
+ NC - |02 32| - NC
+ NC - |03 33| - NC
+ NC - |04 34| - NC
+ NC - |05 35| - NC
+ NC - |06 36| - NC
+ NC - |07 37| - NC
+ NC - |08 38| - NC
+ NC - |09 39| - NC
+ S1 = |10 40| = GND
+ D7 = |11 41| = D6
+ D5 = |12 42| = D4
+ D3 = |13 43| = D2
+ D1 = |14 44| = D0
+ S2 = |15 45| - NC
+ NC - |16 46| = S3
+ NC - |17 47| - NC
+ /CE = |18 48| - NC
+ NC - |19 49| - NC
+ A19 - |20 50| - A18
+ A17 - |21 51| = A16
+ A15 = |22 52| = A14
+ A13 = |23 53| = A12
+ A11 = |24 54| = A10
+ A9 = |25 55| = A8
+ A7 = |26 56| = A6
+ A5 = |27 57| = A4
+ A3 = |28 58| = A2
+ A1 = |29 59| = A0
+ GND = |30 60| = VCC
+ _______
+
+For Dumping:
+S2: to VCC (most likely WE)
+S3: to GND (most likely OE)
+S1: is on some carts directly connected to VCC
- Dumps are not yet verified as good, although most have been confirmed to run on a flash cart
-
- the 3-in-1 internal ROM of the system is not yet dumped: it contains the games
-
- * 2003
- * Drifter
- * Miner
-->
<softwarelist name="gameking" description="TimeTop GameKing cartridges">
-<!-- Single-game carts -->
+ <!-- Single-game carts -->
- <software name="2004" supported="no">
+ <software name="2004" supported="partial">
<description>2004</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="2004.bin" size="131072" crc="ff4a99e2" sha1="b5dea250829224ce8cf18ec310ad503cb928667f"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="2004.bin" size="0x020000" crc="ff4a99e2" sha1="b5dea250829224ce8cf18ec310ad503cb928667f"/>
</dataarea>
</part>
</software>
- <software name="alcarlo" supported="no">
+ <software name="alcarlo" supported="partial">
<description>Adventure Legend Carlo</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="adventure legend carlo.bin" size="131072" crc="7d61d215" sha1="741684b5379d4be732a98beace5d09f37ff19bbf"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="adventure legend carlo.bin" size="0x020000" crc="7d61d215" sha1="741684b5379d4be732a98beace5d09f37ff19bbf"/>
</dataarea>
</part>
</software>
- <software name="aries" supported="no">
+ <software name="aries" supported="partial">
<description>Aries</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="aries.bin" size="131072" crc="b854f1f2" sha1="1ad7a325aba2cf3593165b53e7ae3973388335f7"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="aries.bin" size="0x020000" crc="b854f1f2" sha1="1ad7a325aba2cf3593165b53e7ae3973388335f7"/>
</dataarea>
</part>
</software>
- <software name="dinoadv" supported="no">
+ <software name="dinoadv" supported="partial">
<description>Dino Adventure Legend</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="dino adventure legend.bin" size="131072" status="baddump" crc="2df0c1e6" sha1="df4b5dc80a758d9e3c9b00384e3099ad8331faad"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="dino adventure legend.bin" size="0x020000" crc="bd06a31c" sha1="c2ea6cb2976d02a90f382f289aa8ddd4339bad98"/>
</dataarea>
</part>
</software>
- <software name="dinoadva" cloneof="dinoadv" supported="no">
- <description>Dino Adventure Legend (Alt Revision)</description>
- <year>200?</year>
- <publisher>TimeTop</publisher>
- <part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="dino adventure legend (alt).bin" size="131072" crc="bd06a31c" sha1="c2ea6cb2976d02a90f382f289aa8ddd4339bad98"/>
- </dataarea>
- </part>
- </software>
-
- <software name="duckman" supported="no">
+ <software name="duckman" supported="partial">
<description>Duck Man</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="duck man.bin" size="131072" crc="9d12950a" sha1="376606097f66105d1a9e97e9793362f6f1e3b1a7"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="duck man.bin" size="0x020000" crc="9d12950a" sha1="376606097f66105d1a9e97e9793362f6f1e3b1a7"/>
</dataarea>
</part>
</software>
- <software name="f1_2k4" supported="no">
+ <software name="f1_2k4" supported="partial">
<description>F1-2004 Racing</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="f1-2004 racing.bin" size="131072" crc="dae3a18d" sha1="939931d1eed8a353fb0cd065612479b52ee36242"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="f1-2004 racing.bin" size="0x020000" crc="dae3a18d" sha1="939931d1eed8a353fb0cd065612479b52ee36242"/>
</dataarea>
</part>
</software>
- <software name="feichun7" supported="no">
+ <software name="feichun7" supported="partial">
<description>Feichuan VII</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="feichuan vii.bin" size="131072" crc="f94715f1" sha1="98b1cd7d3d1fe1b1341bef0b2f7d4ae0052fdb01"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="feichuan vii.bin" size="0x020000" crc="f94715f1" sha1="98b1cd7d3d1fe1b1341bef0b2f7d4ae0052fdb01"/>
</dataarea>
</part>
</software>
- <software name="happybal" supported="no">
+ <software name="happybal" supported="partial">
<description>Happy Ball</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="happy ball.bin" size="131072" crc="79d4e738" sha1="fc14712260ed6e3d6313055046546d37b7c838d2"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="happy ball.bin" size="0x020000" crc="79d4e738" sha1="fc14712260ed6e3d6313055046546d37b7c838d2"/>
</dataarea>
</part>
</software>
- <software name="happykil" supported="no">
+ <software name="happykil" supported="partial">
<description>Happy Killer</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="happy killer.bin" size="131072" crc="9fd7ec65" sha1="705309829ee87689793c15be1f781d52471908d6"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="happy killer.bin" size="0x020000" crc="9fd7ec65" sha1="705309829ee87689793c15be1f781d52471908d6"/>
</dataarea>
</part>
</software>
- <software name="lanner" supported="no">
+ <software name="lanner" supported="partial">
<description>Lanneret</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="lanneret.bin" size="131072" crc="249df6a5" sha1="bcf92ab85cc97ffe94d6a363a87b0b5de62c3c66"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="lanneret.bin" size="0x020000" crc="249df6a5" sha1="bcf92ab85cc97ffe94d6a363a87b0b5de62c3c66"/>
</dataarea>
</part>
</software>
- <software name="penguin" supported="no">
+ <software name="penguin" supported="partial">
<description>Penguin</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="penguin.bin" size="131072" crc="8c7b81c9" sha1="2f253b6ab6f6b9fc114ffca120d13df2e1e5f860"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="penguin.bin" size="0x020000" crc="8c7b81c9" sha1="2f253b6ab6f6b9fc114ffca120d13df2e1e5f860"/>
</dataarea>
</part>
</software>
- <software name="popper" supported="no">
+ <software name="popper" supported="partial">
<description>Popper</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="popper.bin" size="131072" crc="a704617b" sha1="314931548578303e5e80a2bcb03c92472cb014d9"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="popper.bin" size="0x020000" crc="a704617b" sha1="314931548578303e5e80a2bcb03c92472cb014d9"/>
</dataarea>
</part>
</software>
- <software name="seatrcel" supported="no">
+ <software name="seatrcel" supported="partial">
<description>Seatercel</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="seatercel.bin" size="131072" crc="e6e1a381" sha1="a31e8361baad16bf0ad02fa809421e3a8f8607f7"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="seatercel.bin" size="0x020000" crc="e6e1a381" sha1="a31e8361baad16bf0ad02fa809421e3a8f8607f7"/>
</dataarea>
</part>
</software>
- <software name="soldier" supported="no">
+ <software name="soldier" supported="partial">
<description>Soldier</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="soldier.bin" size="131072" crc="0a1ac0ed" sha1="590e2ed2b72ad2e3a8c1d6b115c7c9acabf9aa63"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="soldier.bin" size="0x020000" crc="0a1ac0ed" sha1="590e2ed2b72ad2e3a8c1d6b115c7c9acabf9aa63"/>
</dataarea>
</part>
</software>
- <software name="shero" supported="no">
+ <software name="shero" supported="partial">
<description>Street Hero</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="street hero.bin" size="131072" crc="9e0fe489" sha1="2c442126999e4b112a48e42a82dfa9ad9d6efa22"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="street hero.bin" size="0x020000" crc="9e0fe489" sha1="2c442126999e4b112a48e42a82dfa9ad9d6efa22"/>
</dataarea>
</part>
</software>
- <software name="smotor" supported="no">
+ <software name="smotor" supported="partial">
<description>Supermotor</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="supermotor.bin" size="131072" crc="6290b94b" sha1="0c3011da35170241637907bb23d79355db38f343"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="supermotor.bin" size="0x020000" crc="6290b94b" sha1="0c3011da35170241637907bb23d79355db38f343"/>
</dataarea>
</part>
</software>
- <software name="trojanl" supported="no">
+ <software name="trojanl" supported="partial">
<description>Trojan Legend</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="131072">
- <rom name="trojan legend.bin" size="131072" crc="b832db4f" sha1="5a152bfb2ba2150cff9dc66729ceadc0b47d4f17"/>
+ <dataarea name="rom" size="0x020000">
+ <rom name="trojan legend.bin" size="0x020000" crc="b832db4f" sha1="5a152bfb2ba2150cff9dc66729ceadc0b47d4f17"/>
</dataarea>
</part>
</software>
-
-<!-- Multi-game carts -->
+ <!-- Multi-game carts -->
<software name="mc_4v01" supported="no">
<description>4 in 1 - AirWar + DeadShot + Challenge + Speedboat</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_airwar_deadshot_challenge_speedboat.bin" size="524288" status="baddump" crc="b366be5d" sha1="66e565640eb86a50c5a0fc8b8c62deea3e99b3a7"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_airwar_deadshot_challenge_speedboat.bin" size="0x080000" status="baddump" crc="b366be5d" sha1="66e565640eb86a50c5a0fc8b8c62deea3e99b3a7"/> <!-- half size -->
</dataarea>
</part>
</software>
- <software name="mc_4v02" supported="no">
+ <software name="mc_4v02" supported="partial">
<description>4 in 1 - Chaser + Blaster + StarWars + Nagual</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_chaser_blaster_starwars_nagual.bin" size="524288" crc="8a49e7ca" sha1="5c40c158564932184b14a5f481f7053aa00811e0"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_chaser_blaster_starwars_nagual.bin" size="0x080000" crc="8a49e7ca" sha1="5c40c158564932184b14a5f481f7053aa00811e0"/>
</dataarea>
</part>
</software>
- <software name="mc_4v03" supported="no">
- <description>4 in 1 - DraculaZone + Hero + PocketTank + StarChazi</description>
+ <software name="mc_4v03" supported="partial">
+ <description>4 in 1 - DraculaZone (Surf Eidolon) + Hero + PocketTank + Star Ghazi</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_draculazone_hero_pockettank_starchazi.bin" size="524288" crc="5e0dac04" sha1="87fc1a06f00a313e8a49e06170d741e57df991f4"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_draculazone_hero_pockettank_starchazi.bin" size="0x080000" crc="5e0dac04" sha1="87fc1a06f00a313e8a49e06170d741e57df991f4"/>
</dataarea>
</part>
</software>
<software name="mc_4v04" supported="no">
- <description>4 in 1 - Farer + Sortie + PhantomFighter + Seabedwar</description>
+ <description>4 in 1 - Farer + Sortie + PhantomFighter + SeaBed War</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_farer_sortie_phantomfighter_seabedwar.bin" size="524288" status="baddump" crc="bcbfb7d3" sha1="2f37e0e9cca23bb9e06f339030eaa6e357ed17eb"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_farer_sortie_phantomfighter_seabedwar.bin" size="0x080000" status="baddump" crc="bcbfb7d3" sha1="2f37e0e9cca23bb9e06f339030eaa6e357ed17eb"/> <!-- half size -->
</dataarea>
</part>
</software>
- <software name="mc_4v05" supported="no">
+ <software name="mc_4v05" supported="partial">
<description>4 in 1 - SeaGuard + Whirlybird + Spectask + Captain</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_seaguard_whirlybird_spectask_captain.bin" size="524288" crc="465ad7c1" sha1="fde6bf47e1b88c8a73755ef98eee74b964e7fed5"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_seaguard_whirlybird_spectask_captain.bin" size="0x080000" crc="465ad7c1" sha1="fde6bf47e1b88c8a73755ef98eee74b964e7fed5"/>
</dataarea>
</part>
</software>
- <software name="mc_4v06" supported="no">
- <description>4 in 1 - ThreeBattles + Lightswort + MetalDefor IV</description>
+ <software name="mc_4v06" supported="partial">
+ <description>4 in 1 - Three Battles + Light Sword + Risker + Metal Deform</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_threebattles_lightswort_metaldefor iv.bin" size="524288" crc="eb9399df" sha1="2f698fc716b3006f968d2b89a28424ca75ad2741"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_threebattles_lightswort_metaldefor iv.bin" size="0x080000" crc="eb9399df" sha1="2f698fc716b3006f968d2b89a28424ca75ad2741"/>
</dataarea>
</part>
</software>
<software name="mc_4v07" supported="no">
- <description>4 in 1 - TrojanLegend + HappyBall + Supermotor + Lanneret</description>
+ <description>4 in 1 - TrojanLegend (Trojan) + HappyBall + Supermotor (Motor) + Lanneret (Hawk)</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_trojanlegend_happyball_supermotor_lanneret.bin" size="524288" status="baddump" crc="cbd8df6a" sha1="63fbda84375a748721c41492610ae5e2f8910f08"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_trojanlegend_happyball_supermotor_lanneret.bin" size="0x080000" status="baddump" crc="cbd8df6a" sha1="63fbda84375a748721c41492610ae5e2f8910f08"/> <!-- half size -->
</dataarea>
</part>
</software>
- <software name="mc_4v08" supported="no">
- <description>4 in 1 Vol. 8</description>
+ <software name="mc_4v08" supported="partial">
+ <description>4 in 1 Vol. 8 - 2004 + Dragon + StreetHero + Penguin</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1_vol8.bin" size="524288" status="baddump" crc="6741847e" sha1="b561ca1b52e3492f86e7558722c8c8956e845bc5"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_v8.bin" size="0x080000" crc="ad1a74b3" sha1="8789e0badbf6da1030561b86ba18f34749ee0796"/>
</dataarea>
</part>
</software>
<software name="mc_4v09" supported="no">
- <description>4 in 1 Vol. 9</description>
+ <description>4 in 1 Vol. 9 - Duckman + Ares + HappyKiller + Cycloneact</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_vol9.bin" size="524288" status="baddump" crc="02fbc6ef" sha1="84bea568b4c9a50184f15709066e73f3ce09e184"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_vol9.bin" size="0x080000" status="baddump" crc="02fbc6ef" sha1="84bea568b4c9a50184f15709066e73f3ce09e184"/> <!-- half size -->
</dataarea>
</part>
</software>
- <software name="mc_4v10" supported="no">
- <description>4 in 1 Vol. 10</description>
+ <software name="mc_4v10" supported="partial">
+ <description>4 in 1 Vol. 10 - Soldier + Seatercel + General + Seafight</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1no10.bin" size="524288" crc="b25b1080" sha1="24bc65a9e49ba6f0ffc19b3b858d6c576a3196f7"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1no10.bin" size="0x080000" crc="b25b1080" sha1="24bc65a9e49ba6f0ffc19b3b858d6c576a3196f7"/>
</dataarea>
</part>
</software>
- <software name="mc_4v11" supported="no">
- <description>4 in 1 Vol. 11</description>
+ <software name="mc_4v11" supported="partial">
+ <description>4 in 1 Vol. 11 - Explorer + Magician + AirHero + HappyGarden</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_vol11.bin" size="524288" crc="1bd50766" sha1="628b3b9b4f37f881f0aa19f30debb1bca06e0879"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_vol11.bin" size="0x080000" crc="1bd50766" sha1="628b3b9b4f37f881f0aa19f30debb1bca06e0879"/>
</dataarea>
</part>
</software>
- <software name="mc_4v12" supported="no">
- <description>4 in 1 Vol. 12</description>
+ <software name="mc_4v12" supported="partial">
+ <description>4 in 1 Vol. 12 - Pet + Arrow + Fighter + Airforce</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_vol12.bin" size="524288" crc="504eea37" sha1="06a45e4aaf8b225d9863a112c910a864c4edf116"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_vol12.bin" size="0x080000" crc="504eea37" sha1="06a45e4aaf8b225d9863a112c910a864c4edf116"/>
</dataarea>
</part>
</software>
- <software name="mc_4v13" supported="no">
- <description>4 in 1 Vol. 13</description>
+ <software name="mc_4v13" supported="partial">
+ <description>4 in 1 Vol. 13 - Might + Brains + Catman + Armada</description>
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="gk_4in1_vol13.bin" size="524288" crc="1dfb2741" sha1="334a54ebc22f70bacfc87b2f5228f0649970d599"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="gk_4in1_vol13.bin" size="0x080000" crc="1dfb2741" sha1="334a54ebc22f70bacfc87b2f5228f0649970d599"/>
</dataarea>
</part>
</software>
@@ -366,8 +387,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1 - cs-i, soldier, sea war, thunderbird.bin" size="524288" crc="8ec18345" sha1="35b53171d6d1fbfd0dfe0879ce0af15b7f3cde84"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1 - cs-i, soldier, sea war, thunderbird.bin" status="baddump" size="0x080000" crc="8ec18345" sha1="35b53171d6d1fbfd0dfe0879ce0af15b7f3cde84"/> <!-- half size -->
</dataarea>
</part>
</software>
@@ -377,8 +398,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1 - elfin, chariot, searcher, peace havass.bin" size="524288" crc="de570f79" sha1="77d6c19f00cbcea5b661b689cff7fac3790032aa"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1 - elfin, chariot, searcher, peace havass.bin" status="baddump" size="0x080000" crc="de570f79" sha1="77d6c19f00cbcea5b661b689cff7fac3790032aa"/> <!-- half size -->
</dataarea>
</part>
</software>
@@ -388,8 +409,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1 - manhunt, bobby, tantivy, racing car.bin" size="524288" crc="890d9270" sha1="5e4c90885d243d526418a76ee2525a8c2af4e0ae"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1 - manhunt, bobby, tantivy, racing car.bin" status="baddump" size="0x080000" crc="890d9270" sha1="5e4c90885d243d526418a76ee2525a8c2af4e0ae"/> <!-- half size -->
</dataarea>
</part>
</software>
@@ -399,8 +420,8 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1 - nagual, revenger, terminator, black jack.bin" size="524288" crc="3e1c0eeb" sha1="319057078315d982cef9c55eaac5d4c8609a57cc"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1 - nagual, revenger, terminator, black jack.bin" status="baddump" size="0x080000" crc="3e1c0eeb" sha1="319057078315d982cef9c55eaac5d4c8609a57cc"/> <!-- half size -->
</dataarea>
</part>
</software>
@@ -410,21 +431,43 @@
<year>200?</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1 - nobody, bad boy, air wrestle, motherlove.bin" size="524288" crc="13557220" sha1="a6a1aeddac8e95337d1e25051f7730fba28d43e4"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1 - nobody, bad boy, air wrestle, motherlove.bin" status="baddump" size="0x080000" crc="13557220" sha1="a6a1aeddac8e95337d1e25051f7730fba28d43e4"/> <!-- half size -->
</dataarea>
</part>
</software>
- <software name="mc_4v19" supported="no">
- <description>4 in 1 - Warrior + Cleverhawk + Valiant + MetalDeform</description>
- <year>200?</year>
+ <software name="mc_4v19" supported="partial">
+ <description>4 in 1 - Warrior + Cleverhawk + Valiant + MetalDeform ('APR 23 05', 512KB cartridge)</description>
+ <year>2005</year>
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
- <dataarea name="rom" size="524288">
- <rom name="4in1 - warrior, cleverhawk, valiant, metaldeform.bin" size="524288" crc="18fe216b" sha1="f9c0215b031120d1868d7e825e3774898e452ba9"/>
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1 - warrior, cleverhawk, valiant, metaldeform (apr 23 05).bin" size="0x080000" crc="1a673940" sha1="564941836fe82baa4e1534dd373b169a47a62a06"/>
</dataarea>
</part>
</software>
+ <software name="mc_4v19a" cloneof="mc_4v19" supported="no">
+ <description>4 in 1 - Warrior + Cleverhawk + Valiant + MetalDeform ('JUN 16 05', 1MB cartridge)</description>
+ <year>2005</year>
+ <publisher>TimeTop</publisher>
+ <part name="cart" interface="gameking_cart">
+ <dataarea name="rom" size="0x080000">
+ <rom name="4in1 - warrior, cleverhawk, valiant, metaldeform (jun 16 05).bin" status="baddump" size="0x080000" crc="18fe216b" sha1="f9c0215b031120d1868d7e825e3774898e452ba9"/> <!-- half size -->
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mc_4szlh" supported="partial"> <!-- no specific Volume # marked -->
+ <description>4 in 1 - S.Z.L.H + Colo + F1-2004 + Popper</description>
+ <year>200?</year>
+ <publisher>TimeTop</publisher>
+ <part name="cart" interface="gameking_cart">
+ <dataarea name="rom" size="0x100000">
+ <rom name="4in1 - szlh, colo, f12004, popper.bin" size="0x100000" crc="0316eb98" sha1="71a3a4f2fc49c4e19c016d036aba63d8437489a0"/>
+ </dataarea>
+ </part>
+ </software>
+
</softwarelist>
diff --git a/hash/gameking3.xml b/hash/gameking3.xml
index ba1a0698bda..52b14f5dad7 100644
--- a/hash/gameking3.xml
+++ b/hash/gameking3.xml
@@ -11,7 +11,7 @@
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="524288">
- <rom name="urgenaction.bin" size="524288" crc="dcf935f8" sha1="9c1375c622caab9e328ee66434087a18a16ea036"/>
+ <rom name="urgenaction.gk3" size="524288" crc="dcf935f8" sha1="9c1375c622caab9e328ee66434087a18a16ea036"/>
</dataarea>
</part>
</software>
@@ -22,7 +22,7 @@
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="524288">
- <rom name="adventure.bin" size="524288" crc="70082274" sha1="83b164719b2c2d5c133ca05c9fac0102b0d88e4c"/>
+ <rom name="adventure.gk3" size="524288" crc="70082274" sha1="83b164719b2c2d5c133ca05c9fac0102b0d88e4c"/>
</dataarea>
</part>
</software>
@@ -33,7 +33,18 @@
<publisher>TimeTop</publisher>
<part name="cart" interface="gameking_cart">
<dataarea name="rom" size="524288">
- <rom name="fly_cab.bin" size="524288" crc="da314211" sha1="ea901fe7a7aea203afe6fe0d33e374163cec0262"/>
+ <rom name="fly_cab.gk3" size="524288" crc="da314211" sha1="ea901fe7a7aea203afe6fe0d33e374163cec0262"/>
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="panzer" supported="no">
+ <description>Panzer</description>
+ <year>200?</year>
+ <publisher>TimeTop</publisher>
+ <part name="cart" interface="gameking_cart">
+ <dataarea name="rom" size="524288">
+ <rom name="panzer.gk3" size="524288" crc="54c7389e" sha1="1fe26d743ad02b466d045aa53706b13c8be2fe2e"/>
</dataarea>
</part>
</software>
diff --git a/hash/sms.xml b/hash/sms.xml
index 9c97b63c2d1..1d2399789dc 100644
--- a/hash/sms.xml
+++ b/hash/sms.xml
@@ -124,7 +124,7 @@
<!-- Notes: optional SK-1100 keyboard support -->
<software name="actionfg0" cloneof="actionfg">
- <description>Action Fighter (v0, Prototype)</description>
+ <description>Action Fighter (v0, prototype)</description>
<year>1986</year>
<publisher>Sega</publisher>
<info name="alt_title" value="アクションファイター" />
@@ -736,7 +736,7 @@
<!-- Notes: FM support -->
<software name="aliensynp" cloneof="aliensyn">
- <description>Alien Syndrome (Prototype)</description>
+ <description>Alien Syndrome (prototype)</description>
<year>1987</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1075,7 +1075,7 @@
<!-- Notes: 3D glasses support -->
<software name="bladeag1" cloneof="bladeag">
- <description>Blade Eagle (USA, Prototype)</description>
+ <description>Blade Eagle (USA, prototype)</description>
<year>1988</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1156,7 +1156,7 @@
<!-- Notes: FM support -->
<software name="borgmanp" cloneof="cyborgh">
- <description>Chouon Senshi Borgman (Jpn, Prototype)</description>
+ <description>Chouon Senshi Borgman (Jpn, prototype)</description>
<year>1988</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1505,7 +1505,7 @@
<!-- Notes: optional SK-1100 keyboard support -->
<software name="chopliftj" cloneof="choplift">
- <description>Choplifter (Jpn, Prototype)</description>
+ <description>Choplifter (Jpn, prototype)</description>
<year>1986</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1517,7 +1517,7 @@
<!-- Notes: optional SK-1100 keyboard support -->
<software name="chopliftp" cloneof="choplift">
- <description>Choplifter (USA, Prototype)</description>
+ <description>Choplifter (USA, prototype)</description>
<year>1986</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1619,7 +1619,7 @@
</software>
<software name="columnsp" cloneof="columns">
- <description>Columns (Prototype)</description>
+ <description>Columns (prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1707,7 +1707,7 @@
</software>
<software name="cybersp" cloneof="cybers">
- <description>The Cyber Shinobi (Prototype)</description>
+ <description>The Cyber Shinobi (prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1868,7 +1868,7 @@
</software>
<software name="dinobash">
- <description>Dinobasher Starring Bignose the Caveman (Euro, Prototype)</description>
+ <description>Dinobasher Starring Bignose the Caveman (Euro, prototype)</description>
<year>19??</year>
<publisher>Codemasters</publisher>
<part name="cart" interface="sms_cart">
@@ -1910,7 +1910,7 @@
<!-- Notes: FM support -->
<software name="dokidokip" cloneof="pengland">
- <description>Doki Doki Penguin Land - Uchuu Daibouken (Jpn, Prototype)</description>
+ <description>Doki Doki Penguin Land - Uchuu Daibouken (Jpn, prototype)</description>
<year>1987</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -1936,7 +1936,7 @@
</software>
<software name="doublhwkp" cloneof="doublhwk">
- <description>Double Hawk (Euro, Prototype)</description>
+ <description>Double Hawk (Euro, prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -2223,7 +2223,7 @@
<!-- Notes: Requires an extra-height video mode absent on the 315-5124 VDP -->
<software name="excdizzy" supported="no">
- <description>The Excellent Dizzy Collection (Euro, USA, Prototype)</description>
+ <description>The Excellent Dizzy Collection (Euro, USA, prototype)</description>
<year>19??</year>
<publisher>Codemasters</publisher>
<info name="usage" value="Video mode is correct only on SMS 2 drivers, e.g. smspal" />
@@ -2405,7 +2405,7 @@
<!-- Notes: optional SK-1100 keyboard support -->
<software name="fantzone1" cloneof="fantzone">
- <description>Fantasy Zone (World, v1, Prototype)</description>
+ <description>Fantasy Zone (World, v1, prototype)</description>
<year>1986</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -2624,7 +2624,7 @@
</software>
<software name="ggroundp" cloneof="gground">
- <description>Gain Ground (Euro, Prototype)</description>
+ <description>Gain Ground (Euro, prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<info name="serial" value="7045"/>
@@ -2904,7 +2904,7 @@
<!-- Notes: FM support -->
<software name="globaldp" cloneof="globald">
- <description>Global Defense (Euro, USA, Prototype)</description>
+ <description>Global Defense (Euro, USA, prototype)</description>
<year>1987</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -2949,7 +2949,7 @@
<!-- Notes: FM support -->
<software name="golfamanp" cloneof="golfaman">
- <description>Golfamania (Prototype)</description>
+ <description>Golfamania (prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3083,7 +3083,7 @@
<!-- Notes: FM support -->
<software name="greatglfp" cloneof="greatglf">
- <description>Great Golf (Prototype)</description>
+ <description>Great Golf (prototype)</description>
<year>1987</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3263,7 +3263,7 @@
</software>
<software name="hangonshp" cloneof="hangonsh">
- <description>Hang-On &amp; Safari Hunt (USA, Prototype)</description>
+ <description>Hang-On &amp; Safari Hunt (USA, prototype)</description>
<year>1986</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3365,7 +3365,7 @@
</software>
<software name="hook">
- <description>Hook (Euro, Prototype)</description>
+ <description>Hook (Euro, prototype)</description>
<year>19??</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3419,7 +3419,7 @@
</software>
<software name="impmissp" cloneof="impmiss">
- <description>Impossible Mission (Euro, Prototype)</description>
+ <description>Impossible Mission (Euro, prototype)</description>
<year>1990</year>
<publisher>U.S. Gold</publisher>
<part name="cart" interface="sms_cart">
@@ -3469,7 +3469,7 @@
</software>
<software name="indycrusp" cloneof="indycrus">
- <description>Indiana Jones and the Last Crusade (Euro, Prototype)</description>
+ <description>Indiana Jones and the Last Crusade (Euro, prototype)</description>
<year>1990</year>
<publisher>U.S. Gold</publisher>
<part name="cart" interface="sms_cart">
@@ -3492,7 +3492,7 @@
</software>
<software name="jbdougkop" cloneof="heavyw">
- <description>James 'Buster' Douglas Knockout Boxing (USA, Prototype)</description>
+ <description>James 'Buster' Douglas Knockout Boxing (USA, prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3653,7 +3653,7 @@
</software>
<software name="kingqstp" cloneof="kingqst">
- <description>King's Quest - Quest for the Crown (USA, Prototype)</description>
+ <description>King's Quest - Quest for the Crown (USA, prototype)</description>
<year>1989</year>
<publisher>Parker Brothers</publisher>
<part name="cart" interface="sms_cart">
@@ -3801,7 +3801,7 @@
</software>
<software name="lemmingsp" cloneof="lemmings">
- <description>Lemmings (Euro, Prototype)</description>
+ <description>Lemmings (Euro, prototype)</description>
<year>1991</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3812,7 +3812,7 @@
</software>
<software name="lemming2">
- <description>Lemmings 2 - The Tribes (Euro, Prototype)</description>
+ <description>Lemmings 2 - The Tribes (Euro, prototype)</description>
<year>1994</year>
<publisher>Psygnosis</publisher>
<part name="cart" interface="sms_cart">
@@ -3913,7 +3913,7 @@
</software>
<software name="luckydimp" cloneof="luckydim">
- <description>The Lucky Dime Caper Starring Donald Duck (Euro, Prototype)</description>
+ <description>The Lucky Dime Caper Starring Donald Duck (Euro, prototype)</description>
<year>1991</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3941,7 +3941,7 @@
</software>
<software name="mjsengokp" cloneof="mjsengok">
- <description>Mahjong Sengoku Jidai (Jpn, Prototype)</description>
+ <description>Mahjong Sengoku Jidai (Jpn, prototype)</description>
<year>1987</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -3986,7 +3986,7 @@
<!-- Notes: FM support -->
<software name="maougolvp" cloneof="golvell">
- <description>Maou Golvellius (Jpn, Prototype)</description>
+ <description>Maou Golvellius (Jpn, prototype)</description>
<year>1988</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -4174,7 +4174,7 @@
</software>
<software name="sdmilhao">
- <description>Show do Milhão (Bra, Prototype)</description>
+ <description>Show do Milhão (Bra, prototype)</description>
<year>2003</year>
<publisher>Tec Toy</publisher>
<part name="cart" interface="sms_cart">
@@ -4202,7 +4202,7 @@
<!-- Notes: FM support -->
<software name="miraclep" cloneof="miracle">
- <description>Miracle Warriors - Seal of the Dark Lord (Prototype)</description>
+ <description>Miracle Warriors - Seal of the Dark Lord (prototype)</description>
<year>1987</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -4313,7 +4313,7 @@
</software>
<software name="monopolyp" cloneof="monopoly">
- <description>Monopoly (USA, Prototype)</description>
+ <description>Monopoly (USA, prototype)</description>
<year>1988</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -4342,7 +4342,7 @@
</software>
<software name="montezump" cloneof="montezum">
- <description>Montezuma's Revenge Featuring Panama Joe (USA, Prototype)</description>
+ <description>Montezuma's Revenge Featuring Panama Joe (USA, prototype)</description>
<year>1989</year>
<publisher>Parker Brothers</publisher>
<part name="cart" interface="sms_cart">
@@ -4389,7 +4389,7 @@
</software>
<software name="mwalkp" cloneof="mwalk">
- <description>Michael Jackson's Moonwalker (USA, Prototype)</description>
+ <description>Michael Jackson's Moonwalker (USA, prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -4425,7 +4425,7 @@
</software>
<software name="nbajam">
- <description>NBA Jam (Euro, Prototype)</description>
+ <description>NBA Jam (Euro, prototype)</description>
<year>1994</year>
<publisher>Acclaim</publisher>
<info name="usage" value="Only runs with certain drivers, e.g. smsj - others show SOFTWARE ERROR" />
@@ -4438,7 +4438,7 @@
<!-- Notes: FM support -->
<software name="supgolf" cloneof="golfaman">
- <description>Super Golf (Prototype)</description>
+ <description>Super Golf (prototype)</description>
<year>1989</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -4545,7 +4545,7 @@
</software>
<software name="ngaidenp" cloneof="ngaiden">
- <description>Ninja Gaiden (Euro, Prototype)</description>
+ <description>Ninja Gaiden (Euro, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -4725,7 +4725,7 @@
</software>
<software name="patriley">
- <description>Pat Riley Basketball (USA, Prototype)</description>
+ <description>Pat Riley Basketball (USA, prototype)</description>
<year>19??</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5087,7 +5087,7 @@
</software>
<software name="puttputtp" cloneof="puttputt">
- <description>Putt &amp; Putter (Euro, Prototype)</description>
+ <description>Putt &amp; Putter (Euro, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5247,7 +5247,7 @@
</software>
<software name="rcgpp" cloneof="rcgp">
- <description>R.C. Grand Prix (Prototype)</description>
+ <description>R.C. Grand Prix (prototype)</description>
<year>1989</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5396,7 +5396,7 @@
<!-- Notes: FM support -->
<software name="rtypep" cloneof="rtype">
- <description>R-Type (Prototype)</description>
+ <description>R-Type (prototype)</description>
<year>1988</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5509,7 +5509,7 @@
</software>
<software name="smurfs2p" cloneof="smurfs2">
- <description>The Smurfs 2 (Euro, Prototype)</description>
+ <description>The Smurfs 2 (Euro, prototype)</description>
<year>1996</year>
<publisher>Infogrames</publisher>
<part name="cart" interface="sms_cart">
@@ -5532,7 +5532,7 @@
</software>
<software name="scip" cloneof="sci">
- <description>Special Criminal Investigation (Euro, Prototype)</description>
+ <description>Special Criminal Investigation (Euro, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5597,7 +5597,7 @@
</software>
<software name="segagfx">
- <description>Sega Graphic Board (Jpn, Prototype v2.0)</description>
+ <description>Sega Graphic Board (Jpn, prototype v2.0)</description>
<year>1987</year>
<publisher>Sega</publisher>
<sharedfeat name="ctrl1_default" value="graphic" />
@@ -5720,7 +5720,7 @@
<!-- Notes: FM support -->
<software name="shanghaip" cloneof="shanghai">
- <description>Shanghai (Prototype)</description>
+ <description>Shanghai (prototype)</description>
<year>1988</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5892,7 +5892,7 @@
</software>
<software name="slapshotp" cloneof="slapshot">
- <description>Slap Shoot (Prototype)</description>
+ <description>Slap Shoot (prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5943,7 +5943,7 @@
</software>
<software name="smgpp1" cloneof="smgp">
- <description>Super Monaco GP (Euro, Prototype)</description>
+ <description>Super Monaco GP (Euro, prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -5954,7 +5954,7 @@
</software>
<software name="smgpp2" cloneof="smgp">
- <description>Super Monaco GP (Euro, Older Prototype)</description>
+ <description>Super Monaco GP (Euro, older prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6078,7 +6078,7 @@
<!-- Notes: Sega of Japan labels, unfortunately crashes after title screen -->
<software name="sonicc630" cloneof="sonicc" supported="no">
- <description>Sonic the Hedgehog Chaos (Euro, "Ver 0.20", Prototype 19930630)</description>
+ <description>Sonic the Hedgehog Chaos (Euro, "Ver 0.20", prototype 19930630)</description>
<year>1993</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6093,7 +6093,7 @@
<!-- Notes: Sega UK labels, mistakenly marked GG; internal version has not changed since sonicc630 and therefore is not ideal for reference -->
<software name="sonicc713" cloneof="sonicc">
- <description>Sonic the Hedgehog Chaos (Euro, Prototype 19930713)</description>
+ <description>Sonic the Hedgehog Chaos (Euro, prototype 19930713)</description>
<year>1993</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6107,7 +6107,7 @@
</software>
<software name="sonicedu">
- <description>Sonic's Edusoft (Prototype)</description>
+ <description>Sonic's Edusoft (prototype)</description>
<year>19??</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6496,7 +6496,7 @@
<!-- Notes: FM support -->
<software name="sumgamesp" cloneof="sumgames">
- <description>Summer Games (Euro, Prototype)</description>
+ <description>Summer Games (Euro, prototype)</description>
<year>1991</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6698,7 +6698,7 @@
</software>
<software name="tazmaniap" cloneof="tazmania">
- <description>Taz-Mania (Euro, Prototype)</description>
+ <description>Taz-Mania (Euro, prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6721,7 +6721,7 @@
</software>
<software name="tecmow92">
- <description>Tecmo World Cup '92 (Euro, Prototype)</description>
+ <description>Tecmo World Cup '92 (Euro, prototype)</description>
<year>19??</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6766,7 +6766,7 @@
The cartridge contains three 16kB EPROM chips, the last chip seems to have
only 48 bytes of metadata used by the machine and the rest is all $ff. -->
<software name="teddyboyjp" cloneof="teddyboy">
- <description>Teddy Boy Blues (Jpn, Ep-MyCard, Prototype)</description>
+ <description>Teddy Boy Blues (Jpn, Ep-MyCard, prototype)</description>
<year>1985</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6934,7 +6934,7 @@
</software>
<software name="tomjerry" cloneof="tomjermv">
- <description>Tom &amp; Jerry (Prototype)</description>
+ <description>Tom &amp; Jerry (prototype)</description>
<year>1992</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -6974,7 +6974,7 @@
<!-- Notes: optional SK-1100 keyboard support -->
<software name="transbotp" cloneof="transbot">
- <description>TransBot (USA, Prototype)</description>
+ <description>TransBot (USA, prototype)</description>
<year>1985</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -7060,7 +7060,7 @@
<!-- Notes: FM support -->
<software name="ultima4p" cloneof="ultima4">
- <description>Ultima IV - Quest of the Avatar (Euro, Prototype)</description>
+ <description>Ultima IV - Quest of the Avatar (Euro, prototype)</description>
<year>1990</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -7086,7 +7086,7 @@
</software>
<software name="vampire" cloneof="mastdark">
- <description>Vampire (Euro, Prototype)</description>
+ <description>Vampire (Euro, prototype)</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
<part name="cart" interface="sms_cart">
@@ -7213,7 +7213,7 @@
<!-- Notes: FM support -->
<software name="wboymlndp" cloneof="wboymlnd">
- <description>Wonder Boy in Monster Land (Prototype)</description>
+ <description>Wonder Boy in Monster Land (prototype)</description>
<year>1988</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -7268,7 +7268,7 @@
</software>
<software name="wboymwldp" cloneof="wboymwld">
- <description>Wonder Boy in Monster World (Euro, Prototype)</description>
+ <description>Wonder Boy in Monster World (Euro, prototype)</description>
<year>1993</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -7420,7 +7420,7 @@
</software>
<software name="wldgamesp" cloneof="wldgames">
- <description>World Games (Euro, Prototype)</description>
+ <description>World Games (Euro, prototype)</description>
<year>1989</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -7464,7 +7464,7 @@
<!-- Notes: optional SK-1100 keyboard support -->
<software name="worldgpp" cloneof="worldgp">
- <description>World Grand Prix (USA, Prototype)</description>
+ <description>World Grand Prix (USA, prototype)</description>
<year>1986</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -7647,7 +7647,7 @@
<!-- Notes: 3D glasses support -->
<software name="zaxxon3dp" cloneof="zaxxon3d">
- <description>Zaxxon 3-D (World, Prototype)</description>
+ <description>Zaxxon 3-D (World, prototype)</description>
<year>1987</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_cart">
@@ -7902,7 +7902,7 @@
<!-- Notes: optional SK-1100 keyboard support -->
<software name="ghosthcp" cloneof="ghosth">
- <description>Ghost House (Sega Card, Prototype)</description>
+ <description>Ghost House (Sega Card, prototype)</description>
<year>1986</year>
<publisher>Sega</publisher>
<part name="cart" interface="sms_card">
diff --git a/nl_examples/ne555_astable.c b/nl_examples/ne555_astable.c
index b782f9c6f3e..0348d3ae4d3 100644
--- a/nl_examples/ne555_astable.c
+++ b/nl_examples/ne555_astable.c
@@ -1,12 +1,12 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-//! [ne555 example]
/*
* ne555_astable.c
*
*/
+//! [ne555_example]
#include "netlist/devices/net_lib.h"
NETLIST_START(ne555_astable)
@@ -16,14 +16,6 @@ NETLIST_START(ne555_astable)
*
*/
- /*!
- *
- * abc | def
- * ghj | ddd
- * iop | xyz
- *
- *
- */
/* Standard stuff */
SOLVER(Solver, 48000)
@@ -58,4 +50,4 @@ NETLIST_START(ne555_astable)
LOG(log3, 555.OUT)
NETLIST_END()
-//! [ne555 example]
+//! [ne555_example]
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index f97b1b4fea5..d88de2b64ba 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -360,6 +360,72 @@ end
---------------------------------------------------
--
+--@src/devices/bus/bbc/cart/slot.h,BUSES["BBC_CART"] = true
+---------------------------------------------------
+
+if (BUSES["BBC_CART"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/bus/bbc/cart/slot.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/cart/slot.h",
+ MAME_DIR .. "src/devices/bus/bbc/cart/click.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/cart/click.h",
+ MAME_DIR .. "src/devices/bus/bbc/cart/mega256.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/cart/mega256.h",
+ MAME_DIR .. "src/devices/bus/bbc/cart/mr8000.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/cart/mr8000.h",
+ MAME_DIR .. "src/devices/bus/bbc/cart/msc.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/cart/msc.h",
+ }
+end
+
+
+---------------------------------------------------
+--
+--@src/devices/bus/bbc/internal/internal.h,BUSES["BBC_INTERNAL"] = true
+---------------------------------------------------
+
+if (BUSES["BBC_INTERNAL"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/bus/bbc/internal/internal.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/internal.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/aries.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/aries.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/atpl.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/atpl.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/cumana68k.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/cumana68k.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/integrab.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/integrab.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/morleyaa.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/morleyaa.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/overlay.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/overlay.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/peartree.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/peartree.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/ramamp.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/ramamp.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/raven20.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/raven20.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/romex.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/romex.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/stlswr.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/stlswr.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/stl2m128.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/stl2m128.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/stl4m32.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/stl4m32.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/werom.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/werom.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/weromram.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/weromram.h",
+ MAME_DIR .. "src/devices/bus/bbc/internal/we32kram.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/internal/we32kram.h",
+ }
+end
+
+
+---------------------------------------------------
+--
--@src/devices/bus/bbc/exp/exp.h,BUSES["BBC_EXP"] = true
---------------------------------------------------
@@ -367,6 +433,8 @@ if (BUSES["BBC_EXP"]~=null) then
files {
MAME_DIR .. "src/devices/bus/bbc/exp/exp.cpp",
MAME_DIR .. "src/devices/bus/bbc/exp/exp.h",
+ MAME_DIR .. "src/devices/bus/bbc/exp/autocue.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/exp/autocue.h",
MAME_DIR .. "src/devices/bus/bbc/exp/mertec.cpp",
MAME_DIR .. "src/devices/bus/bbc/exp/mertec.h",
}
@@ -430,6 +498,8 @@ if (BUSES["BBC_ROM"]~=null) then
MAME_DIR .. "src/devices/bus/bbc/rom/rom.h",
MAME_DIR .. "src/devices/bus/bbc/rom/ram.cpp",
MAME_DIR .. "src/devices/bus/bbc/rom/ram.h",
+ MAME_DIR .. "src/devices/bus/bbc/rom/nvram.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/rom/nvram.h",
MAME_DIR .. "src/devices/bus/bbc/rom/dfs.cpp",
MAME_DIR .. "src/devices/bus/bbc/rom/dfs.h",
MAME_DIR .. "src/devices/bus/bbc/rom/genie.cpp",
@@ -488,6 +558,8 @@ if (BUSES["BBC_USERPORT"]~=null) then
MAME_DIR .. "src/devices/bus/bbc/userport/pointer.h",
MAME_DIR .. "src/devices/bus/bbc/userport/usersplit.cpp",
MAME_DIR .. "src/devices/bus/bbc/userport/usersplit.h",
+ MAME_DIR .. "src/devices/bus/bbc/userport/voicebox.cpp",
+ MAME_DIR .. "src/devices/bus/bbc/userport/voicebox.h",
MAME_DIR .. "src/devices/bus/bbc/userport/cfa3000kbd.cpp",
MAME_DIR .. "src/devices/bus/bbc/userport/cfa3000kbd.h",
}
@@ -920,6 +992,8 @@ if (BUSES["ELECTRON"]~=null) then
MAME_DIR .. "src/devices/bus/electron/rombox.h",
MAME_DIR .. "src/devices/bus/electron/romboxp.cpp",
MAME_DIR .. "src/devices/bus/electron/romboxp.h",
+ MAME_DIR .. "src/devices/bus/electron/sidewndr.cpp",
+ MAME_DIR .. "src/devices/bus/electron/sidewndr.h",
MAME_DIR .. "src/devices/bus/electron/m2105.cpp",
MAME_DIR .. "src/devices/bus/electron/m2105.h",
}
@@ -3804,30 +3878,6 @@ end
---------------------------------------------------
--
---@src/devices/bus/hp_optroms/hp_optrom.h,BUSES["HP_OPTROM"] = true
----------------------------------------------------
-
-if (BUSES["HP_OPTROM"]~=null) then
- files {
- MAME_DIR .. "src/devices/bus/hp_optroms/hp_optrom.cpp",
- MAME_DIR .. "src/devices/bus/hp_optroms/hp_optrom.h",
- }
-end
-
----------------------------------------------------
---
---@src/devices/bus/hp80_optroms/hp80_optrom.h,BUSES["HP80_OPTROM"] = true
----------------------------------------------------
-
-if (BUSES["HP80_OPTROM"]~=null) then
- files {
- MAME_DIR .. "src/devices/bus/hp80_optroms/hp80_optrom.cpp",
- MAME_DIR .. "src/devices/bus/hp80_optroms/hp80_optrom.h",
- }
-end
-
----------------------------------------------------
---
--@src/devices/bus/hp80_io/hp80_io.h,BUSES["HP80_IO"] = true
---------------------------------------------------
@@ -3842,18 +3892,6 @@ end
---------------------------------------------------
--
---@src/devices/bus/hp9825_optroms/hp9825_optrom.h,BUSES["HP9825_OPTROM"] = true
----------------------------------------------------
-
-if (BUSES["HP9825_OPTROM"]~=null) then
- files {
- MAME_DIR .. "src/devices/bus/hp9825_optroms/hp9825_optrom.cpp",
- MAME_DIR .. "src/devices/bus/hp9825_optroms/hp9825_optrom.h",
- }
-end
-
----------------------------------------------------
---
--@src/devices/bus/hp9845_io/hp9845_io.h,BUSES["HP9845_IO"] = true
---------------------------------------------------
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index ab0883acec4..75f4b36ca91 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -752,7 +752,9 @@ BUSES["ASTROCADE"] = true
BUSES["ATA"] = true
BUSES["BBC_FDC"] = true
BUSES["BBC_ANALOGUE"] = true
+BUSES["BBC_CART"] = true
BUSES["BBC_EXP"] = true
+BUSES["BBC_INTERNAL"] = true
BUSES["BBC_JOYPORT"] = true
BUSES["BBC_1MHZBUS"] = true
BUSES["BBC_TUBE"] = true
@@ -806,10 +808,7 @@ BUSES["IQ151"] = true
BUSES["ISA"] = true
BUSES["ISBX"] = true
BUSES["JAKKS_GAMEKEY"] = true
-BUSES["HP_OPTROM"] = true
-BUSES["HP80_OPTROM"] = true
BUSES["HP80_IO"] = true
-BUSES["HP9825_OPTROM"] = true
BUSES["HP9845_IO"] = true
BUSES["KC"] = true
BUSES["LPCI"] = true
@@ -2400,8 +2399,14 @@ files {
MAME_DIR .. "src/mame/machine/hp48.cpp",
MAME_DIR .. "src/mame/machine/hp48_port.cpp",
MAME_DIR .. "src/mame/machine/hp48_port.h",
+ MAME_DIR .. "src/mame/machine/hp80_optrom.cpp",
+ MAME_DIR .. "src/mame/machine/hp80_optrom.h",
+ MAME_DIR .. "src/mame/machine/hp9825_optrom.cpp",
+ MAME_DIR .. "src/mame/machine/hp9825_optrom.h",
MAME_DIR .. "src/mame/machine/hp9825_tape.cpp",
MAME_DIR .. "src/mame/machine/hp9825_tape.h",
+ MAME_DIR .. "src/mame/machine/hp9845_optrom.cpp",
+ MAME_DIR .. "src/mame/machine/hp9845_optrom.h",
MAME_DIR .. "src/mame/machine/hp9845_printer.cpp",
MAME_DIR .. "src/mame/machine/hp9845_printer.h",
MAME_DIR .. "src/mame/machine/hp98x5_io_sys.cpp",
@@ -3117,6 +3122,7 @@ files {
createMESSProjects(_target, _subtarget, "roland")
files {
MAME_DIR .. "src/mame/drivers/rmt32.cpp",
+ MAME_DIR .. "src/mame/drivers/rcm32p.cpp",
MAME_DIR .. "src/mame/drivers/rd110.cpp",
MAME_DIR .. "src/mame/drivers/rsc55.cpp",
MAME_DIR .. "src/mame/drivers/tb303.cpp",
@@ -3705,6 +3711,8 @@ files {
MAME_DIR .. "src/mame/video/elan_eu3a05commonvid.h",
MAME_DIR .. "src/mame/video/elan_eu3a05vid.cpp",
MAME_DIR .. "src/mame/video/elan_eu3a05vid.h",
+ MAME_DIR .. "src/mame/video/elan_eu3a14vid.cpp",
+ MAME_DIR .. "src/mame/video/elan_eu3a14vid.h",
MAME_DIR .. "src/mame/drivers/trkfldch.cpp",
MAME_DIR .. "src/mame/drivers/tvgame.cpp",
MAME_DIR .. "src/mame/drivers/spg110.cpp",
diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
index 59969850649..65b7b265bde 100644
--- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
+++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp
@@ -170,5 +170,5 @@ void bbcm_1mhzbus_devices(device_slot_interface &device)
device.option_add("beebsid", BBC_BEEBSID); /* BeebSID */
//device.option_add("prisma3", BBC_PRISMA3); /* PRISMA-3 - Millipede 1989 */
device.option_add("sprite", BBC_SPRITE); /* Logotron Sprite Board */
- device.option_add("cfa3000opt", CFA3000_OPT); /* Henson CFA 3000 Option Board */
+ device.option_add_internal("cfa3000opt", CFA3000_OPT);/* Henson CFA 3000 Option Board */
}
diff --git a/src/devices/bus/bbc/analogue/analogue.cpp b/src/devices/bus/bbc/analogue/analogue.cpp
index 7a5059dd3b4..e1eb5e3419e 100644
--- a/src/devices/bus/bbc/analogue/analogue.cpp
+++ b/src/devices/bus/bbc/analogue/analogue.cpp
@@ -102,5 +102,5 @@ void bbc_analogue_devices(device_slot_interface &device)
//device.option_add("micromike", BBC_MICROMIKE); /* Micro Mike */
device.option_add("voltmace3b", BBC_VOLTMACE3B); /* Voltmace Delta 3b "Twin" Joysticks */
//device.option_add("quinkey", BBC_QUINKEY); /* Microwriter Quinkey */
- device.option_add("cfa3000a", CFA3000_ANLG); /* Hanson CFA 3000 Analogue */
+ device.option_add_internal("cfa3000a", CFA3000_ANLG); /* Hanson CFA 3000 Analogue */
}
diff --git a/src/devices/bus/bbc/cart/click.cpp b/src/devices/bus/bbc/cart/click.cpp
new file mode 100644
index 00000000000..175de5eeae3
--- /dev/null
+++ b/src/devices/bus/bbc/cart/click.cpp
@@ -0,0 +1,113 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Slogger Click cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Slogger_Click.html
+
+ The Master version of the Click cartridge differs from the Electron
+ version:
+ Master 128 Electron
+ ROM 16K 32K
+ RAM (battery) 8K 32K
+
+ The data lines D1 and D2 are swapped between edge connector and ROM/RAM.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "click.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_CLICK, bbc_click_device, "bbc_click", "Slogger Click (Master 128) cartridge")
+
+
+//-------------------------------------------------
+// INPUT_PORTS( clickm )
+//-------------------------------------------------
+
+INPUT_PORTS_START(clickm)
+ PORT_START("BUTTON")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Click") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, bbc_click_device, click_button, 0)
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_click_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(clickm);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_click_device - constructor
+//-------------------------------------------------
+
+bbc_click_device::bbc_click_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_CLICK, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_click_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_click_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0xff;
+
+ if (oe)
+ {
+ if (offset & 0x2000)
+ {
+ data = m_nvram[offset & 0x1fff];
+ }
+ else
+ {
+ data = m_rom[(offset & 0x1fff) | (romqa << 13)];
+ }
+ }
+
+ return bitswap<8>(data, 7, 6, 5, 4, 3, 1, 2, 0);
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_click_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ if (oe)
+ {
+ if (offset & 0x2000)
+ {
+ m_nvram[offset & 0x1fff] = bitswap<8>(data, 7, 6, 5, 4, 3, 1, 2, 0);
+ }
+ }
+}
+
+INPUT_CHANGED_MEMBER(bbc_click_device::click_button)
+{
+ m_slot->irq_w(!newval);
+}
diff --git a/src/devices/bus/bbc/cart/click.h b/src/devices/bus/bbc/cart/click.h
new file mode 100644
index 00000000000..9f6691c4356
--- /dev/null
+++ b/src/devices/bus/bbc/cart/click.h
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Slogger Click cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Slogger_Click.html
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_CLICK_H
+#define MAME_BUS_BBC_CART_CLICK_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_click_device
+
+class bbc_click_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_click_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ DECLARE_INPUT_CHANGED_MEMBER(click_button);
+
+protected:
+ // device-level overrides
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual void device_start() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_CLICK, bbc_click_device)
+
+#endif // MAME_BUS_BBC_CART_CLICK_H
diff --git a/src/devices/bus/bbc/cart/mega256.cpp b/src/devices/bus/bbc/cart/mega256.cpp
new file mode 100644
index 00000000000..f0348df2e74
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mega256.cpp
@@ -0,0 +1,97 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Solidisk Mega 256 cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_Mega256.html
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mega256.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MEGA256, bbc_mega256_device, "bbc_mega256", "Solidisk Mega 256 cartridge")
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_mega256_device - constructor
+//-------------------------------------------------
+
+bbc_mega256_device::bbc_mega256_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MEGA256, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+ , m_page(0)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_mega256_device::device_start()
+{
+ // register for save states
+ save_item(NAME(m_page));
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void bbc_mega256_device::device_reset()
+{
+ m_page = 0x00;
+}
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_mega256_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0xff;
+
+ if (oe)
+ {
+ if (romqa)
+ {
+ data = m_rom[offset & 0x1fff];
+ }
+ else
+ {
+ data = m_ram[(offset & 0x3fff) | (m_page << 14)];
+ }
+ }
+
+ return data;
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_mega256_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ if (oe)
+ {
+ if (romqa)
+ {
+ // Not known whether this latch is fully decoded.
+ if (offset == 0x3fff) m_page = data & 0x0f;
+ }
+ else
+ {
+ m_ram[(offset & 0x3fff) | (m_page << 14)] = data;
+ }
+ }
+}
diff --git a/src/devices/bus/bbc/cart/mega256.h b/src/devices/bus/bbc/cart/mega256.h
new file mode 100644
index 00000000000..b6f211b694a
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mega256.h
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Solidisk Mega 256 cartridge emulation
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_Mega256.html
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_MEGA256_H
+#define MAME_BUS_BBC_CART_MEGA256_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_mega256_device
+
+class bbc_mega256_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_mega256_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+
+private:
+ uint8_t m_page;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MEGA256, bbc_mega256_device)
+
+#endif // MAME_BUS_BBC_CART_MEGA256_H
diff --git a/src/devices/bus/bbc/cart/mr8000.cpp b/src/devices/bus/bbc/cart/mr8000.cpp
new file mode 100644
index 00000000000..a039936f23a
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mr8000.cpp
@@ -0,0 +1,102 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ MR8000 Master RAM Cartridge emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mr8000.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MR8000, bbc_mr8000_device, "bbc_mr8000", "MR8000 Master RAM Cartridge")
+
+
+//-------------------------------------------------
+// INPUT_PORTS( mr8000 )
+//-------------------------------------------------
+
+INPUT_PORTS_START(mr8000)
+ PORT_START("SWITCH")
+ PORT_CONFNAME(0x03, 0x00, "ROM Choice")
+ PORT_CONFSETTING(0x00, "A (lower banks)")
+ PORT_CONFSETTING(0x01, "B (upper banks)")
+ PORT_CONFSETTING(0x02, "Off (disabled)")
+
+ PORT_CONFNAME(0x04, 0x00, "Write Protect")
+ PORT_CONFSETTING(0x00, "On (read only")
+ PORT_CONFSETTING(0x04, "Off (read and write)")
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_mr8000_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(mr8000);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_mr8000_device - constructor
+//-------------------------------------------------
+
+bbc_mr8000_device::bbc_mr8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MR8000, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+ , m_switch(*this, "SWITCH")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_mr8000_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_mr8000_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0x00;
+ int bank = BIT(m_switch->read(), 0);
+
+ if (oe && !BIT(m_switch->read(), 1))
+ {
+ data = m_nvram[offset | (bank << 15) | (romqa << 14)];
+ }
+
+ return data;
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_mr8000_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ int bank = BIT(m_switch->read(), 0);
+
+ if (oe && !BIT(m_switch->read(), 1))
+ {
+ if (BIT(m_switch->read(), 2))
+ {
+ m_nvram[offset | (bank << 15) | (romqa << 14)] = data;
+ }
+ }
+}
diff --git a/src/devices/bus/bbc/cart/mr8000.h b/src/devices/bus/bbc/cart/mr8000.h
new file mode 100644
index 00000000000..ccf79e4508e
--- /dev/null
+++ b/src/devices/bus/bbc/cart/mr8000.h
@@ -0,0 +1,46 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ MR8000 Master RAM Cartridge emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_MR8000_H
+#define MAME_BUS_BBC_CART_MR8000_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_mr8000_device
+
+class bbc_mr8000_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_mr8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual void device_start() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+
+private:
+ required_ioport m_switch;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MR8000, bbc_mr8000_device)
+
+#endif // MAME_BUS_BBC_CART_MR8000_H
diff --git a/src/devices/bus/bbc/cart/msc.cpp b/src/devices/bus/bbc/cart/msc.cpp
new file mode 100644
index 00000000000..05a3284e83d
--- /dev/null
+++ b/src/devices/bus/bbc/cart/msc.cpp
@@ -0,0 +1,104 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Master Smart Cartridge emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "msc.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MSC, bbc_msc_device, "bbc_msc", "Master Smart Cartridge")
+
+
+//-------------------------------------------------
+// INPUT_PORTS( msc )
+//-------------------------------------------------
+
+INPUT_PORTS_START(msc)
+ PORT_START("BUTTON")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Activate") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, bbc_msc_device, activate, 0)
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_msc_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(msc);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_msc_device - constructor
+//-------------------------------------------------
+
+bbc_msc_device::bbc_msc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MSC, tag, owner, clock)
+ , device_bbc_cart_interface(mconfig, *this)
+ , m_button(*this, "BUTTON")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_msc_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - cartridge data read
+//-------------------------------------------------
+
+uint8_t bbc_msc_device::read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2)
+{
+ uint8_t data = 0xff;
+
+ if (oe & !romqa)
+ {
+ if (offset & 0x2000)
+ {
+ data = m_ram[offset & 0x7ff];
+ }
+ else
+ {
+ data = m_rom[(offset & 0x1fff) | (m_button->read() << 13)];
+ }
+ }
+
+ return data;
+}
+
+//-------------------------------------------------
+// write - cartridge data write
+//-------------------------------------------------
+
+void bbc_msc_device::write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2)
+{
+ if (oe & !romqa)
+ {
+ if (offset & 0x2000)
+ {
+ m_ram[offset & 0x7ff] = data;
+ }
+ }
+}
+
+INPUT_CHANGED_MEMBER(bbc_msc_device::activate)
+{
+ m_slot->irq_w(!newval);
+}
diff --git a/src/devices/bus/bbc/cart/msc.h b/src/devices/bus/bbc/cart/msc.h
new file mode 100644
index 00000000000..4bde2113047
--- /dev/null
+++ b/src/devices/bus/bbc/cart/msc.h
@@ -0,0 +1,48 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ Master Smart Cartridge emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_CART_MSC_H
+#define MAME_BUS_BBC_CART_MSC_H
+
+#pragma once
+
+#include "slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_msc_device
+
+class bbc_msc_device : public device_t, public device_bbc_cart_interface
+{
+public:
+ // construction/destruction
+ bbc_msc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ DECLARE_INPUT_CHANGED_MEMBER(activate);
+
+protected:
+ // device-level overrides
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual void device_start() override;
+
+ // bbc_cart_interface overrides
+ virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2) override;
+ virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2) override;
+
+private:
+ required_ioport m_button;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MSC, bbc_msc_device)
+
+#endif // MAME_BUS_BBC_CART_MSC_H
diff --git a/src/devices/bus/bbc/cart/slot.cpp b/src/devices/bus/bbc/cart/slot.cpp
new file mode 100644
index 00000000000..d67924503ea
--- /dev/null
+++ b/src/devices/bus/bbc/cart/slot.cpp
@@ -0,0 +1,79 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***********************************************************************************************************
+
+ BBC Master Cartridge slot emulation
+
+ ***********************************************************************************************************/
+
+
+#include "emu.h"
+#include "slot.h"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBCM_CARTSLOT, bbc_cartslot_device, "bbc_cartslot", "BBC Master Cartridge Slot")
+
+
+//**************************************************************************
+// DEVICE ELECTRON_CARTSLOT CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_bbc_cart_interface - constructor
+//-------------------------------------------------
+
+device_bbc_cart_interface::device_bbc_cart_interface(const machine_config &mconfig, device_t &device)
+ : device_electron_cart_interface(mconfig, device)
+{
+ m_slot = dynamic_cast<bbc_cartslot_device *>(device.owner());
+}
+
+
+//-------------------------------------------------
+// ~device_bbc_cart_interface - destructor
+//-------------------------------------------------
+
+device_bbc_cart_interface::~device_bbc_cart_interface()
+{
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_cartslot_device - constructor
+//-------------------------------------------------
+bbc_cartslot_device::bbc_cartslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ electron_cartslot_device(mconfig, BBCM_CARTSLOT, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// SLOT_INTERFACE( bbcm_cart )
+//-------------------------------------------------
+
+#include "bus/electron/cart/std.h"
+#include "bus/electron/cart/abr.h"
+#include "bus/electron/cart/aqr.h"
+#include "click.h"
+#include "mega256.h"
+#include "mr8000.h"
+#include "msc.h"
+
+
+void bbcm_cart(device_slot_interface &device)
+{
+ device.option_add_internal("std", ELECTRON_STDCART);
+ device.option_add_internal("abr", ELECTRON_ABR);
+ device.option_add_internal("aqr", ELECTRON_AQR);
+ device.option_add_internal("click", BBC_CLICK);
+ device.option_add_internal("mega256", BBC_MEGA256);
+ device.option_add_internal("mr8000", BBC_MR8000);
+ device.option_add_internal("msc", BBC_MSC);
+}
diff --git a/src/devices/bus/bbc/cart/slot.h b/src/devices/bus/bbc/cart/slot.h
new file mode 100644
index 00000000000..b24a6fa1a8c
--- /dev/null
+++ b/src/devices/bus/bbc/cart/slot.h
@@ -0,0 +1,161 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ BBC Master Cartridge slot emulation
+
+**********************************************************************
+
+ Pinout:
+ A B
+ +5V 1 1 +5
+ nOE 2 2 A10
+ nRST 3 3 D3
+ CSRW 4 4 A11
+ A8 5 5 A9
+ A13 6 6 D7
+ A12 7 7 D6
+ PHI2 8 8 D5
+ -5V 9 9 D4
+CSYNC/MADET 10 10 LPSTB
+ R/W 11 11 BA7
+ nNMI 12 12 BA6
+ nIRQ 13 13 BA5
+ nINFC 14 14 BA4
+ nINFD 15 15 BA3
+ ROMQA 16 16 BA2
+ Clock 17 17 BA1
+ nCRTCRST 18 18 BA0
+ ADOUT 19 19 D0
+ AGND 20 20 D2
+ NC 21 21 D1
+ 0V 22 22 0V
+
+ Signal Definitions:
+
+ SIDE 'A'
+ 1 +5V - Power supply. This is the system logic supply rail.
+ 2 n0E - Output Enable : Input with CMOS levels. This is an active low signal during the PH12
+ period of the system clock.
+ 3 nRST - System Reset : Input with CMOS levels. This signal is active low during system reset.
+ 4 CSRW - Changes function according to the memory region that the CPU is addressing.
+ During accesses to &FC00 through &FEFF it is equivalent to the CPU Read/Write line
+ during nPH12. For all other accesses it is an Active High chip select for memory devices.
+ 5 A8 - Address line 8 : Input with TTL levels
+ 6 A13 - Address line 13 : Input with TTL levels
+ 7 A12 - Address line 12 : Input with TTL levels
+ 8 PH12 - CPU clock : Input with CMOS levels
+ This input is the host computer PH12out.
+ 9 -5V - The negative supply voltage.
+ 10 MADET - There are two functions dependent upon link 12 in the computer:
+ E/nB - the default function. It enables cartridges to know which machine they are plugged
+ into. It is connected to 0V in the Master.
+ CSYNC - Composite Sync. Input from TTL levels.
+ System Vertical & Horizontal sync is made available for Genlock use.
+ 11 R/W - Data Direction Control. Input from TTL levels
+ 12 nNMI - Non maskable interrupt : Open collector output
+ This signal is connected to the system NMI line. It is active low.
+ 13 nIRQ - Interrupt request : Open collector output
+ This signal is connected to the system IRQ line. It is active low.
+ 14 nINFC - Internal Page &FC : When bit IFJ in the Master ACCON register (via &FE34) is set, all accesses to
+ &FC00 through &FCFF will cause this select to become active. : TTL active low
+ 15 nINFD - Internal page &FD : When bit IFJ in the Master ACCON register (via &FE34) is set, all accesses to
+ &FD00 through &FDFF will cause this select to become active. : TTL active low
+ 16 ROMQA - Memory paging select : Input with TTL levels
+ This is the least significant bit of the ROM select latch located at &FE30 in the Master.
+ 17 Clock - Links on the computer select one of two functions:
+ a) 16Mhz Output to computer (Link DB only).
+ b) 8 Mhz Input to cartridge (Link CD in addition to AB).
+ 18 nCRTCRST - nCRTCRST is an Active Low Output signal of the system CRTC reset input. It is
+ provided for Genlock use.
+ 19 ADOUT - System audio output
+ 20 AGND - Audio Ground
+ 21 ADIN - Cartridge audio output
+ 22 0V - Zero volts
+
+ SIDE 'B'
+ 1 +5V - Power supply. This is the system logic supply rail.
+ 2 A10 - Address line 10 : Input with TTL levels
+ 3 D3 - Data bus line 3 : Input/Output with TTL levels
+ 4 A11 - Address line 11 : Input with TTL levels
+ 5 A9 - Address line 9 : Input with TTL levels
+ 6 D7 - Most significant data bus line : Input/Output with TTL levels
+ 7 D6 - Data bus line 6 : Input/Output with TTL levels
+ 8 D5 - Data bus line 5 : Input/Output with TTL levels
+ 9 D4 - Data bus line 4 : Input/Output with TTL levels
+ 10 LPSTB - With link 21 removed in the computer, this pin provides a connection between the
+ two cartridges. With the link in place, the pin forms a connection to a pull-up resistor in the
+ computer to +5V. The connection is also made to the CRTC Light-Pen Strobe and interrupt
+ structure
+ 11 BA7 - Buffered address line 7 : Input with TTL levels
+ 12 BA6 - Buffered address line 6 : Input with TTL levels
+ 13 BA5 - Buffered address line 5 : Input with TTL levels
+ 14 BA4 - Buffered address line 4 : Input with TTL levels
+ 15 BA3 - Buffered address line 3 : Input with TTL levels
+ 16 BA2 - Buffered address line 2 : Input with TTL levels
+ 17 BA1 - Buffered address line 1 : Input with TTL levels
+ 18 BA0 - Buffered address line 0 : Input with TTL levels
+ 19 D0 - Data bus line 0 : Input/Output with TTL levels
+ 20 D2 - Data bus line 2 : Input/Output with TTL levels
+ 21 D1 - Data bus line 1 : Input/Output with TTL levels
+ 22 0V - Zero volts.
+
+**********************************************************************/
+#ifndef MAME_BUS_BBC_CARTSLOT_H
+#define MAME_BUS_BBC_CARTSLOT_H
+
+#pragma once
+
+#include "bus/electron/cart/slot.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_cartslot_device
+
+class device_bbc_cart_interface;
+
+class bbc_cartslot_device : public electron_cartslot_device
+{
+public:
+ // construction/destruction
+ template <typename T>
+ bbc_cartslot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&slot_options, const char *default_option)
+ : electron_cartslot_device(mconfig, tag, owner, clock)
+ {
+ option_reset();
+ slot_options(*this);
+ set_default_option(default_option);
+ set_fixed(false);
+ }
+
+ bbc_cartslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ virtual const char *image_interface() const override { return "bbcm_cart"; }
+ virtual const char *file_extensions() const override { return "rom,bin"; }
+};
+
+
+// ======================> device_bbc_cart_interface
+
+class device_bbc_cart_interface : public device_electron_cart_interface
+{
+public:
+ // construction/destruction
+ virtual ~device_bbc_cart_interface();
+
+protected:
+ device_bbc_cart_interface(const machine_config &mconfig, device_t &device);
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBCM_CARTSLOT, bbc_cartslot_device)
+
+void bbcm_cart(device_slot_interface &device);
+
+
+#endif // MAME_BUS_BBC_CARTSLOT_H
diff --git a/src/devices/bus/bbc/exp/autocue.cpp b/src/devices/bus/bbc/exp/autocue.cpp
new file mode 100644
index 00000000000..929f4eb2eaa
--- /dev/null
+++ b/src/devices/bus/bbc/exp/autocue.cpp
@@ -0,0 +1,100 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Autocue RAM Disc
+
+ The RAM is accessible through JIM (page &FD). One page is visible in JIM at a time.
+ The selected page is controlled by the two paging registers:
+
+ &FCFE Paging register MSB
+ &FCFF Paging register LSB
+
+ 256K board has 1024 pages &000 to &3FF
+ 512K board has 2048 pages &000 to &7FF
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "autocue.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_AUTOCUE, bbc_autocue_device, "bbc_autocue", "Autocue RAM Disc");
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_autocue_device::device_add_mconfig(machine_config &config)
+{
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_autocue_device - constructor
+//-------------------------------------------------
+
+bbc_autocue_device::bbc_autocue_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_AUTOCUE, tag, owner, clock)
+ , device_bbc_exp_interface(mconfig, *this)
+ , m_nvram(*this, "nvram")
+ , m_ram_page(0)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_autocue_device::device_start()
+{
+ /* ram disk - board with 8 x HM62256LFP-12 - 256K expandable to 512K */
+ m_ram = make_unique_clear<uint8_t[]>(0x40000);
+ m_nvram->set_base(m_ram.get(), 0x40000);
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+void bbc_autocue_device::fred_w(offs_t offset, uint8_t data)
+{
+ switch (offset)
+ {
+ case 0xff: m_ram_page = (m_ram_page & 0x00ff) | (data << 8); break;
+ case 0xfe: m_ram_page = (m_ram_page & 0xff00) | (data << 0); break;
+ }
+ //logerror("Write ram_page=%04x\n", m_ram_page);
+}
+
+uint8_t bbc_autocue_device::jim_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_ram_page < 0x400)
+ {
+ data = m_ram[(m_ram_page << 8) | offset];
+ }
+ //logerror("Read %04x -> %02x\n", offset | 0xfd00, data);
+ return data;
+}
+
+void bbc_autocue_device::jim_w(offs_t offset, uint8_t data)
+{
+ //logerror("Write %04x <- %02x\n", offset | 0xfd00, data);
+ if (m_ram_page < 0x400)
+ {
+ m_ram[(m_ram_page << 8) | offset] = data;
+ }
+} \ No newline at end of file
diff --git a/src/devices/bus/bbc/exp/autocue.h b/src/devices/bus/bbc/exp/autocue.h
new file mode 100644
index 00000000000..0151e94e9bf
--- /dev/null
+++ b/src/devices/bus/bbc/exp/autocue.h
@@ -0,0 +1,51 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Autocue RAM Disc
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_EXP_AUTOCUE_H
+#define MAME_BUS_BBC_EXP_AUTOCUE_H
+
+#include "exp.h"
+#include "machine/nvram.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_autocue_device :
+ public device_t,
+ public device_bbc_exp_interface
+{
+public:
+ // construction/destruction
+ bbc_autocue_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual void fred_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t jim_r(offs_t offset) override;
+ virtual void jim_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_device<nvram_device> m_nvram;
+ std::unique_ptr<uint8_t[]> m_ram;
+
+ uint16_t m_ram_page;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_AUTOCUE, bbc_autocue_device);
+
+
+#endif /* MAME_BUS_BBC_EXP_AUTOCUE_H */
diff --git a/src/devices/bus/bbc/exp/exp.cpp b/src/devices/bus/bbc/exp/exp.cpp
index 8bbc78889d7..4209249a0f9 100644
--- a/src/devices/bus/bbc/exp/exp.cpp
+++ b/src/devices/bus/bbc/exp/exp.cpp
@@ -149,12 +149,12 @@ void bbc_exp_slot_device::pb_w(uint8_t data)
// slot devices
-//#include "autocue.h"
+#include "autocue.h"
#include "mertec.h"
void bbc_exp_devices(device_slot_interface &device)
{
- //device.option_add("autocue", BBC_AUTOCUE); /* Autocue RAM disk board */
- device.option_add("mertec", BBC_MERTEC); /* Mertec Compact Companion */
+ device.option_add_internal("autocue", BBC_AUTOCUE); /* Autocue RAM disk board */
+ device.option_add("mertec", BBC_MERTEC); /* Mertec Compact Companion */
}
diff --git a/src/devices/bus/bbc/internal/aries.cpp b/src/devices/bus/bbc/internal/aries.cpp
new file mode 100644
index 00000000000..6bda361d7bd
--- /dev/null
+++ b/src/devices/bus/bbc/internal/aries.cpp
@@ -0,0 +1,337 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Aries B12 Sideways ROM Expansion
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Aries_B12.html
+
+ Aries B20 20K RAM expansion
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Aries_B20.html
+
+ Aries-B32 32K RAM expansion
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Aries_B32.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "aries.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_ARIESB12, bbc_ariesb12_device, "bbc_ariesb12", "Aries-B12 ROM Expansion");
+DEFINE_DEVICE_TYPE(BBC_ARIESB20, bbc_ariesb20_device, "bbc_ariesb20", "Aries-B20 RAM expansion (w/ Aries-B12)");
+DEFINE_DEVICE_TYPE(BBC_ARIESB32, bbc_ariesb32_device, "bbc_ariesb32", "Aries-B32 RAM expansion (w/ Aries-B12)");
+
+
+//-------------------------------------------------
+// ROM( aries )
+//-------------------------------------------------
+
+ROM_START(ariesb20)
+ ROM_REGION(0x4000, "exp_rom", 0)
+ ROM_SYSTEM_BIOS(0, "24", "v2.4")
+ ROMX_LOAD("aries-b20_v2.4.rom", 0x0000, 0x2000, CRC(47a43a03) SHA1(2590596e0864b97b30050c33b21aa89bb8956204), ROM_BIOS(0))
+ ROM_SYSTEM_BIOS(1, "22", "v2.2")
+ ROMX_LOAD("aries-b20_v2.2.rom", 0x0000, 0x2000, CRC(c2f334a9) SHA1(d04bfd332d63f6f23dca2ef81a1d2074e3d88ee9), ROM_BIOS(1))
+ROM_END
+
+ROM_START(ariesb32)
+ ROM_REGION(0x4000, "aries_rom", 0)
+ ROM_SYSTEM_BIOS(0, "22", "v2.2")
+ ROMX_LOAD("aries-b32_v2.2.rom", 0x0000, 0x4000, CRC(2cb3443d) SHA1(466e3b68f1a8e0287ae095cb3c16dac6afc89dcb), ROM_BIOS(0))
+ROM_END
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_ariesb12_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot0-3 are unavailable when board is fitted, replaced by sockets on board */;
+ //config.device_remove(":romslot0");
+ //config.device_remove(":romslot1");
+ //config.device_remove(":romslot2");
+ //config.device_remove(":romslot3");
+
+ /* rom/ram sockets */
+ BBC_ROMSLOT16(config, m_rom[0], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[1], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[3], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+}
+
+void bbc_ariesb32_device::device_add_mconfig(machine_config &config)
+{
+ bbc_ariesb12_device::device_add_mconfig(config);
+
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, nullptr);
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_ariesb20_device::device_rom_region() const
+{
+ return ROM_NAME(ariesb20);
+}
+
+const tiny_rom_entry *bbc_ariesb32_device::device_rom_region() const
+{
+ return ROM_NAME(ariesb32);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_aries_device - constructor
+//-------------------------------------------------
+
+bbc_ariesb12_device::bbc_ariesb12_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+bbc_ariesb12_device::bbc_ariesb12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_ariesb12_device(mconfig, BBC_ARIESB12, tag, owner, clock)
+{
+}
+
+bbc_ariesb20_device::bbc_ariesb20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_ariesb12_device(mconfig, BBC_ARIESB20, tag, owner, clock)
+{
+}
+
+bbc_ariesb32_device::bbc_ariesb32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_ariesb12_device(mconfig, BBC_ARIESB32, tag, owner, clock)
+ , m_aries_rom(*this, "aries_rom")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_ariesb12_device::device_start()
+{
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x24000, m_region_swr->base(), 0x10000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+void bbc_ariesb20_device::device_start()
+{
+ bbc_ariesb12_device::device_start();
+
+ m_shadow = false;
+ m_ram = std::make_unique<uint8_t[]>(0x5000);
+
+ /* register for save states */
+ save_item(NAME(m_shadow));
+ save_pointer(NAME(m_ram), 0x5000);
+}
+
+void bbc_ariesb32_device::device_start()
+{
+ bbc_ariesb12_device::device_start();
+
+ m_shadow = false;
+ m_ram = std::make_unique<uint8_t[]>(0x8000);
+
+ /* move internal roms to board */
+ memcpy(m_region_swr->base() + 0x3c000, m_aries_rom->base(), 0x4000);
+
+ /* register for save states */
+ save_item(NAME(m_ramsel));
+ save_item(NAME(m_shadow));
+ save_pointer(NAME(m_ram), 0x8000);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void bbc_ariesb20_device::device_reset()
+{
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ program.install_write_handler(0xfffe, 0xffff, write8sm_delegate(*this, FUNC(bbc_ariesb20_device::control_w)));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_ariesb12_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+
+ return data;
+}
+
+void bbc_ariesb12_device::paged_w(offs_t offset, uint8_t data)
+{
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+
+ /* always write to sideways ram */
+ m_rom[0x00]->write(offset, data);
+}
+
+
+void bbc_ariesb20_device::control_w(offs_t offset, uint8_t data)
+{
+ switch (offset)
+ {
+ case 0:
+ /* &fffe - select BBC ram */
+ m_shadow = false;
+ break;
+ case 1:
+ /* &ffff - select Aries ram */
+ m_shadow = true;
+ break;
+ }
+}
+
+uint8_t bbc_ariesb20_device::ram_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_shadow && offset >= 0x3000)
+ data = m_ram[offset - 0x3000];
+ else
+ data = m_mb_ram->pointer()[offset];
+
+ return data;
+}
+
+void bbc_ariesb20_device::ram_w(offs_t offset, uint8_t data)
+{
+ if (m_shadow && offset >= 0x3000)
+ m_ram[offset - 0x3000] = data;
+ else
+ m_mb_ram->pointer()[offset] = data;
+}
+
+
+void bbc_ariesb32_device::romsel_w(offs_t offset, uint8_t data)
+{
+ //logerror("romsel_w: %04x = %02x\n", offset | 0xfe30, data);
+
+ switch (offset)
+ {
+ case 0x00:
+ m_romsel = data & 0x0f;
+ break;
+ case 0x02:
+ m_ramsel = data & 0x0f;
+ break;
+ case 0x04:
+ break;
+ case 0x06:
+ // switch
+ break;
+ case 0x08:
+ break;
+ case 0x0a:
+ // switch
+ break;
+ case 0x0e:
+ m_shadow = false;
+ break;
+ case 0x0f:
+ m_shadow = true;
+ break;
+ }
+}
+
+uint8_t bbc_ariesb32_device::ram_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_shadow && offset >= 0x3000)
+ data = m_ram[offset - 0x3000];
+ else
+ data = m_mb_ram->pointer()[offset];
+
+ return data;
+}
+
+void bbc_ariesb32_device::ram_w(offs_t offset, uint8_t data)
+{
+ //if ((offset & 0xff) == 0x00)
+ // logerror("ram_w: %04x = %02x\n", offset, data);
+ if (m_shadow && offset >= 0x3000)
+ m_ram[offset - 0x3000] = data;
+ else
+ m_mb_ram->pointer()[offset] = data;
+}
+
+uint8_t bbc_ariesb32_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else if (m_romsel == 13 || m_romsel == 14)
+ {
+ data = m_ram[offset | (m_romsel & 0x02) << 13];
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+
+ return data;
+}
+
+void bbc_ariesb32_device::paged_w(offs_t offset, uint8_t data)
+{
+ //if ((offset & 0xff) == 0x00)
+ // logerror("paged_w: %04x = %02x\n", offset | 0x8000, data);
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+
+ if (m_ramsel == 13 || m_ramsel == 14)
+ {
+ m_ram[offset | (m_ramsel & 0x02) << 13] = data;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/aries.h b/src/devices/bus/bbc/internal/aries.h
new file mode 100644
index 00000000000..9dc7383ff21
--- /dev/null
+++ b/src/devices/bus/bbc/internal/aries.h
@@ -0,0 +1,117 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Aries B12 Sideways ROM Expansion
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Aries_B12.html
+
+ Aries B20 20K RAM expansion
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Aries_B20.html
+
+ Aries-B32 32K RAM expansion
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Aries_B32.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_ARIES_H
+#define MAME_BUS_BBC_INTERNAL_ARIES_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_ariesb12_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_ariesb12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ bbc_ariesb12_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ uint8_t m_romsel;
+};
+
+
+class bbc_ariesb20_device : public bbc_ariesb12_device
+{
+public:
+ // construction/destruction
+ bbc_ariesb20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_ram() override { return true; }
+ virtual uint8_t ram_r(offs_t offset) override;
+ virtual void ram_w(offs_t offset, uint8_t data) override;
+
+private:
+ void control_w(offs_t offset, uint8_t data);
+
+ bool m_shadow;
+ std::unique_ptr<uint8_t[]> m_ram;
+};
+
+
+class bbc_ariesb32_device : public bbc_ariesb12_device
+{
+public:
+ // construction/destruction
+ bbc_ariesb32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_ram() override { return true; }
+ virtual uint8_t ram_r(offs_t offset) override;
+ virtual void ram_w(offs_t offset, uint8_t data) override;
+ virtual void romsel_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_memory_region m_aries_rom;
+
+ bool m_shadow;
+ std::unique_ptr<uint8_t[]> m_ram;
+ uint8_t m_ramsel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_ARIESB12, bbc_ariesb12_device);
+DECLARE_DEVICE_TYPE(BBC_ARIESB20, bbc_ariesb20_device);
+DECLARE_DEVICE_TYPE(BBC_ARIESB32, bbc_ariesb32_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_ARIES_H */
diff --git a/src/devices/bus/bbc/internal/atpl.cpp b/src/devices/bus/bbc/internal/atpl.cpp
new file mode 100644
index 00000000000..94c5f8459b0
--- /dev/null
+++ b/src/devices/bus/bbc/internal/atpl.cpp
@@ -0,0 +1,250 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ ATPL Sidewise ROM/RAM Expansion board
+ https://www.retro-kit.co.uk/page.cfm/content/ATPL-Sidewise-Sideways-ROM-board/
+
+ ATPL Sidewise+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/ATPL_Sidewise+.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "atpl.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_ATPLSW, bbc_atplsw_device, "bbc_atplsw", "ATPL Sidewise ROM/RAM Expansion");
+DEFINE_DEVICE_TYPE(BBC_ATPLSWP, bbc_atplswp_device, "bbc_atplswp", "ATPL Sidewise+ ROM Expansion");
+
+
+//-------------------------------------------------
+// INPUT_PORTS( atplsw )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(atplsw)
+ PORT_START("wp")
+ PORT_CONFNAME(0x01, 0x00, "Write Protect Sideways RAM")
+ PORT_CONFSETTING(0x00, DEF_STR(No))
+ PORT_CONFSETTING(0x01, DEF_STR(Yes))
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_atplsw_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(atplsw);
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_atplsw_device::device_add_mconfig(machine_config &config)
+{
+ /* 12 rom sockets, 16K static ram (battery backed) */
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "nvram").set_fixed_ram(true);
+}
+
+void bbc_atplswp_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot2-10 are unavailable when board is fitted, replaced by sockets on board */
+ //config.device_remove(":romslot2");
+ //config.device_remove(":romslot4");
+ //config.device_remove(":romslot6");
+ //config.device_remove(":romslot8");
+ //config.device_remove(":romslot10");
+
+ /* 10 rom sockets */
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[3], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_atplsw_device - constructor
+//-------------------------------------------------
+
+bbc_atplsw_device::bbc_atplsw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_ATPLSW, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+ , m_wp(*this, "wp")
+{
+}
+
+bbc_atplswp_device::bbc_atplswp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_ATPLSWP, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_atplsw_device::device_start()
+{
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x2c000, m_region_swr->base(), 0x10000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+void bbc_atplswp_device::device_start()
+{
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_atplsw_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_atplsw_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14:
+ /* expansion board sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+
+ /* sideways ram (if not write protected) */
+ if (!m_wp->read())
+ {
+ m_rom[15]->write(offset, data);
+ }
+}
+
+
+uint8_t bbc_atplswp_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 12: case 13:
+ /* motherboard ram sockets */
+ if (m_mb_rom[m_romsel & 0x0e] && m_mb_rom[m_romsel & 0x0e]->present())
+ {
+ data = m_mb_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_atplswp_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 12: case 13:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel & 0x0e])
+ {
+ m_mb_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/atpl.h b/src/devices/bus/bbc/internal/atpl.h
new file mode 100644
index 00000000000..fe10ebb3a76
--- /dev/null
+++ b/src/devices/bus/bbc/internal/atpl.h
@@ -0,0 +1,85 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ ATPL Sidewise ROM/RAM Expansion board
+ https://www.retro-kit.co.uk/page.cfm/content/ATPL-Sidewise-Sideways-ROM-board/
+
+ ATPL Sidewise+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/ATPL_Sidewise+.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_ATPL_H
+#define MAME_BUS_BBC_INTERNAL_ATPL_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_atplsw_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_atplsw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+ required_ioport m_wp;
+
+ uint8_t m_romsel;
+};
+
+
+class bbc_atplswp_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_atplswp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ uint8_t m_romsel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_ATPLSW, bbc_atplsw_device);
+DECLARE_DEVICE_TYPE(BBC_ATPLSWP, bbc_atplswp_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_ATPL_H */
diff --git a/src/devices/bus/bbc/internal/cumana68k.cpp b/src/devices/bus/bbc/internal/cumana68k.cpp
new file mode 100644
index 00000000000..376f9b136df
--- /dev/null
+++ b/src/devices/bus/bbc/internal/cumana68k.cpp
@@ -0,0 +1,330 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Cumana 68008 2nd processor
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Cumana_680082ndProcessor.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "cumana68k.h"
+#include "bus/scsi/scsihd.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_CUMANA68K, bbc_cumana68k_device, "bbc_cumana68k", "Cumana 68008 2nd Processor")
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( cumana68k_mem )
+//-------------------------------------------------
+
+void bbc_cumana68k_device::cumana68k_mem(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x000000, 0x00ffff).rw(FUNC(bbc_cumana68k_device::dma_r), FUNC(bbc_cumana68k_device::dma_w));
+ map(0x010000, 0x0fffff).ram();
+}
+
+//-------------------------------------------------
+// SLOT_INTERFACE( os9_floppies )
+//-------------------------------------------------
+
+static void os9_floppies(device_slot_interface &device)
+{
+ device.option_add("525qd", FLOPPY_525_QD);
+}
+
+//-------------------------------------------------
+// ROM( cumana68k )
+//-------------------------------------------------
+
+ROM_START(cumana68k)
+ ROM_REGION(0x4000, "exp_rom", 0)
+ ROM_LOAD("os9boot.rom", 0x0000, 0x4000, CRC(9b7d6754) SHA1(1cb54119bf13b39d598573d8d6a7e9f70d88b50d))
+ROM_END
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_cumana68k_device::device_add_mconfig(machine_config &config)
+{
+ /* basic machine hardware */
+ M68008(config, m_m68008, 16_MHz_XTAL / 2);
+ m_m68008->set_addrmap(AS_PROGRAM, &bbc_cumana68k_device::cumana68k_mem);
+ //m_m68008->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(bbc_cumana68k_device::irq_callback), this));
+
+ /* fdc */
+ WD2797(config, m_fdc, 16_MHz_XTAL / 16);
+ m_fdc->intrq_wr_callback().set(m_pia_rtc, FUNC(pia6821_device::cb1_w));
+ m_fdc->drq_wr_callback().set(FUNC(bbc_cumana68k_device::drq_w));
+ m_fdc->set_force_ready(true);
+
+ FLOPPY_CONNECTOR(config, m_floppy0, os9_floppies, "525qd", floppy_image_device::default_floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy1, os9_floppies, "525qd", floppy_image_device::default_floppy_formats).enable_sound(true);
+
+ /* scsi */
+ //MCFG_DEVICE_ADD("sasi", SCSI_PORT, 0)
+ //MCFG_SCSI_DATA_INPUT_BUFFER("scsi_data_in")
+ //MCFG_SCSI_SEL_HANDLER(WRITELINE(*this, bbc_cumana68k_device, write_sasi_sel))
+ //MCFG_SCSI_IO_HANDLER(WRITELINE(*this, bbc_cumana68k_device, write_sasi_io))
+ //MCFG_SCSI_BSY_HANDLER(WRITELINE(*this, bbc_cumana68k_device, write_sasi_bsy))
+ //MCFG_SCSI_CD_HANDLER(WRITELINE(*this, bbc_cumana68k_device, write_sasi_cd))
+ //MCFG_SCSI_MSG_HANDLER(WRITELINE(*this, bbc_cumana68k_device, write_sasi_msg))
+ //MCFG_SCSI_REQ_HANDLER(WRITELINE(*this, bbc_cumana68k_device, write_sasi_req))
+ //MCFG_SCSI_ACK_HANDLER(WRITELINE("pia_sasi", pia6821_device, ca2_w))
+ //MCFG_SCSIDEV_ADD("sasi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_0)
+
+ //MCFG_SCSI_OUTPUT_LATCH_ADD("scsi_data_out", "sasi")
+ //MCFG_DEVICE_ADD("scsi_data_in", INPUT_BUFFER, 0)
+
+ PIA6821(config, m_pia_sasi, 0);
+ m_pia_sasi->readpa_handler().set(FUNC(bbc_cumana68k_device::pia_sasi_pa_r));
+ m_pia_sasi->readpb_handler().set(FUNC(bbc_cumana68k_device::pia_sasi_pb_r));
+ m_pia_sasi->readcb1_handler().set(FUNC(bbc_cumana68k_device::pia_sasi_cb1_r));
+ //m_pia_sasi->cb2_handler().set(m_scsibus, FUNC(scsi_port_device::write_rst));
+ m_pia_sasi->irqa_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>));
+ m_pia_sasi->irqb_handler().set(m_irqs, FUNC(input_merger_device::in_w<1>));
+
+ PIA6821(config, m_pia_rtc, 0);
+ m_pia_rtc->readpa_handler().set(m_rtc, FUNC(mc146818_device::read));
+ m_pia_rtc->writepa_handler().set(m_rtc, FUNC(mc146818_device::write));
+ m_pia_rtc->writepb_handler().set(FUNC(bbc_cumana68k_device::pia_rtc_pb_w));
+ //m_pia_rtc->cb2_handler().set(m_scsibus, FUNC(scsi_port_device::write_rst));
+ m_pia_rtc->irqa_handler().set(m_irqs, FUNC(input_merger_device::in_w<2>));
+ m_pia_rtc->irqb_handler().set(m_irqs, FUNC(input_merger_device::in_w<3>));
+
+ INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set(FUNC(bbc_cumana68k_device::intrq_w));
+
+ /* rtc */
+ MC146818(config, m_rtc, 32.768_kHz_XTAL);
+ m_rtc->irq().set(m_pia_rtc, FUNC(pia6821_device::ca1_w));
+
+ /* software lists */
+ //SOFTWARE_LIST(config, "flop_ls_68008").set_original("bbc_flop_68008");
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_cumana68k_device::device_rom_region() const
+{
+ return ROM_NAME( cumana68k );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_cumana68k_device - constructor
+//-------------------------------------------------
+
+bbc_cumana68k_device::bbc_cumana68k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_CUMANA68K, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_maincpu(*this, ":maincpu")
+ , m_m68008(*this, "m68008")
+ , m_pia_sasi(*this, "pia_sasi")
+ , m_pia_rtc(*this, "pia_rtc")
+ , m_irqs(*this, "irqs")
+ , m_rtc(*this, "rtc")
+ , m_fdc(*this, "wd2797")
+ , m_floppy0(*this, "wd2797:0")
+ , m_floppy1(*this, "wd2797:1")
+ //, m_scsibus(*this, "sasi")
+ //, m_scsi_data_out(*this, "scsi_data_out")
+ //, m_scsi_data_in(*this, "scsi_data_in")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_cumana68k_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void bbc_cumana68k_device::device_reset()
+{
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ program.install_readwrite_handler(0xfc40, 0xfc43, read8sm_delegate(*m_pia_sasi, FUNC(pia6821_device::read)), write8sm_delegate(*m_pia_sasi, FUNC(pia6821_device::write)));
+ program.install_readwrite_handler(0xfc44, 0xfc47, read8sm_delegate(*m_pia_rtc, FUNC(pia6821_device::read)), write8sm_delegate(*m_pia_rtc, FUNC(pia6821_device::write)));
+ program.install_readwrite_handler(0xfc48, 0xfc4b, read8sm_delegate(*m_fdc, FUNC(wd2797_device::read)), write8sm_delegate(*m_fdc, FUNC(wd2797_device::write)));
+}
+
+void bbc_cumana68k_device::device_reset_after_children()
+{
+ m_bEnabled = false;
+
+ // Pull up resistor R12 makes CB2 high when it's configured as an input, so set CB2 as output and high to compensate
+ m_pia_rtc->write(0x03, 0x3c);
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::reset68008_w)
+{
+ if (!state) m_bEnabled = true;
+
+ m_m68008->set_input_line(INPUT_LINE_HALT, state);
+ m_m68008->set_input_line(INPUT_LINE_RESET, state);
+}
+
+
+READ8_MEMBER(bbc_cumana68k_device::dma_r)
+{
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ if (m_bEnabled)
+ {
+ if (offset < 0x1000)
+ return program.read_byte(offset + 0x2000);
+ else if (offset > 0x1fff && offset < 0x3000)
+ return program.read_byte(offset - 0x2000);
+ else
+ return program.read_byte(offset);
+ }
+ return 0xff;
+}
+
+WRITE8_MEMBER(bbc_cumana68k_device::dma_w)
+{
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ if (m_bEnabled)
+ {
+ if (offset < 0x1000)
+ program.write_byte(offset + 0x2000, data);
+ else if (offset > 0x1fff && offset < 0x3000)
+ program.write_byte(offset - 0x2000, data);
+ else
+ program.write_byte(offset, data);
+ }
+}
+
+
+WRITE8_MEMBER(bbc_cumana68k_device::pia_rtc_pb_w)
+{
+ floppy_image_device *floppy = nullptr;
+ logerror("pia1_pb_w %02x\n", data);
+ // bit 0, 1: drive select
+ switch (data & 0x03)
+ {
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
+ }
+ m_fdc->set_floppy(floppy);
+
+ // bit 2: motor enable
+ if (floppy)
+ floppy->mon_w(BIT(data, 2));
+
+ // bit 3: density
+ m_fdc->dden_w(BIT(data, 3));
+
+ // bit 4: enable precomp
+}
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::intrq_w)
+{
+ //m_m68008->set_input_line_and_vector(M68K_IRQ_2, state ? ASSERT_LINE : CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
+ m_m68008->set_input_line(M68K_IRQ_2, state);
+ m_slot->irq_w(state);
+}
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::drq_w)
+{
+ m_pia_sasi_pb &= ~0x40;
+ m_pia_sasi_pb |= state << 6;
+
+ //m_m68008->set_input_line(M68K_IRQ_7, state);
+ m_slot->nmi_w(!state);
+}
+
+
+IRQ_CALLBACK_MEMBER(bbc_cumana68k_device::irq_callback)
+{
+ //m_m68008->set_input_line(M68K_IRQ_2, CLEAR_LINE);
+ // see https://github.com/mamedev/mame/commit/e39802db90860d6628c35265f7c78ce3534f5a53
+ return 0; //M68K_INT_ACK_AUTOVECTOR;
+}
+
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::write_sasi_sel)
+{
+ m_pia_sasi_pb &= ~0x02;
+ m_pia_sasi_pb |= state << 1;
+}
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::write_sasi_io)
+{
+ m_pia_sasi_pb &= ~0x04;
+ m_pia_sasi_pb |= state << 2;
+}
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::write_sasi_bsy)
+{
+ m_pia_sasi_pb &= ~0x08;
+ m_pia_sasi_pb |= state << 3;
+}
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::write_sasi_cd)
+{
+ m_pia_sasi_pb &= ~0x10;
+ m_pia_sasi_pb |= state << 4;
+}
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::write_sasi_msg)
+{
+ m_pia_sasi_pb &= ~0x20;
+ m_pia_sasi_pb |= state << 5;
+}
+
+WRITE_LINE_MEMBER(bbc_cumana68k_device::write_sasi_req)
+{
+ m_pia_sasi_pb &= ~0x40;
+ m_pia_sasi_pb |= state << 6;
+
+ m_pia_sasi->ca1_w(state);
+}
+
+
+READ8_MEMBER(bbc_cumana68k_device::pia_sasi_pa_r)
+{
+ return 0; // m_scsi_data_in->read();
+}
+
+WRITE8_MEMBER(bbc_cumana68k_device::pia_sasi_pa_w)
+{
+ //m_scsi_data_out->write(data);
+}
+
+
+READ8_MEMBER(bbc_cumana68k_device::pia_sasi_pb_r)
+{
+ return m_pia_sasi_pb;
+}
+
+READ_LINE_MEMBER(bbc_cumana68k_device::pia_sasi_cb1_r)
+{
+ // CB1 is tied to +5V
+ return 1;
+}
diff --git a/src/devices/bus/bbc/internal/cumana68k.h b/src/devices/bus/bbc/internal/cumana68k.h
new file mode 100644
index 00000000000..e27f14bc4d8
--- /dev/null
+++ b/src/devices/bus/bbc/internal/cumana68k.h
@@ -0,0 +1,91 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Cumana 68008 2nd processor
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Cumana_680082ndProcessor.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_CUMANA68K_H
+#define MAME_BUS_BBC_INTERNAL_CUMANA68K_H
+
+#include "internal.h"
+#include "cpu/m68000/m68000.h"
+#include "machine/6821pia.h"
+#include "machine/input_merger.h"
+#include "machine/mc146818.h"
+#include "imagedev/floppy.h"
+#include "machine/wd_fdc.h"
+#include "bus/scsi/scsi.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_cumana68k_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_cumana68k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ DECLARE_WRITE_LINE_MEMBER(write_sasi_sel);
+ DECLARE_WRITE_LINE_MEMBER(write_sasi_msg);
+ DECLARE_WRITE_LINE_MEMBER(write_sasi_bsy);
+ DECLARE_WRITE_LINE_MEMBER(write_sasi_req);
+ DECLARE_WRITE_LINE_MEMBER(write_sasi_io);
+ DECLARE_WRITE_LINE_MEMBER(write_sasi_cd);
+ DECLARE_READ8_MEMBER(pia_sasi_pa_r);
+ DECLARE_WRITE8_MEMBER(pia_sasi_pa_w);
+ DECLARE_READ8_MEMBER(pia_sasi_pb_r);
+ DECLARE_READ_LINE_MEMBER(pia_sasi_cb1_r);
+ DECLARE_WRITE8_MEMBER(pia_rtc_pb_w);
+
+ DECLARE_READ8_MEMBER(dma_r);
+ DECLARE_WRITE8_MEMBER(dma_w);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+ virtual void device_reset_after_children() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+private:
+ DECLARE_WRITE_LINE_MEMBER(intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(drq_w);
+ DECLARE_WRITE_LINE_MEMBER(reset68008_w);
+ IRQ_CALLBACK_MEMBER(irq_callback);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<m68000_base_device> m_m68008;
+ required_device<pia6821_device> m_pia_sasi;
+ required_device<pia6821_device> m_pia_rtc;
+ required_device<input_merger_device> m_irqs;
+ required_device<mc146818_device> m_rtc;
+ required_device<wd2797_device> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ optional_device<floppy_connector> m_floppy1;
+ //required_device<scsi_port_device> m_scsibus;
+ //required_device<output_latch_device> m_scsi_data_out;
+ //required_device<input_buffer_device> m_scsi_data_in;
+
+ void cumana68k_mem(address_map &map);
+
+ bool m_bEnabled;
+ uint8_t m_pia_sasi_pb;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_CUMANA68K, bbc_cumana68k_device)
+
+
+#endif // MAME_BUS_BBC_INTERNAL_CUMANA68K_H
diff --git a/src/devices/bus/bbc/internal/integrab.cpp b/src/devices/bus/bbc/internal/integrab.cpp
new file mode 100644
index 00000000000..0bba0add02c
--- /dev/null
+++ b/src/devices/bus/bbc/internal/integrab.cpp
@@ -0,0 +1,342 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Computech Integra-B expansion board
+
+ Usage:
+ To enable the computer to acknowledge the INTEGRA-β Expansion on the
+ first switch-on you must hold down the '@' key whilst switching on
+ the computer, or CTRL-@-BREAK to reset.
+
+ If default language has not been configured then reset the board and:
+ *CONFIGURE LANG 14
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "integrab.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_INTEGRAB, bbc_integrab_device, "bbc_integrab", "Computech Integra-\xCE\xB2")
+
+
+//-------------------------------------------------
+// INPUT_PORTS( integrab )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(integrab)
+ PORT_START("wp")
+ PORT_CONFNAME(0x01, 0x00, "Write Protect Sideways RAM Banks 4/5")
+ PORT_CONFSETTING(0x00, DEF_STR(No))
+ PORT_CONFSETTING(0x01, DEF_STR(Yes))
+ PORT_CONFNAME(0x02, 0x00, "Write Protect Sideways RAM Bank 6/7")
+ PORT_CONFSETTING(0x00, DEF_STR(No))
+ PORT_CONFSETTING(0x02, DEF_STR(Yes))
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_integrab_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(integrab);
+}
+
+//-------------------------------------------------
+// ROM( integrab )
+//-------------------------------------------------
+
+ROM_START(integrab)
+ ROM_REGION(0x4000, "ibos", 0)
+ ROM_SYSTEM_BIOS(0, "120p", "IBOS 1.20 (Y2K patched)")
+ ROMX_LOAD("ibos120p.rom", 0x0000, 0x4000, CRC(21e7a2c2) SHA1(d5ff79da2243aabd363ee26a1e7ad546657fdeb5), ROM_BIOS(0))
+ ROM_SYSTEM_BIOS(1, "120", "IBOS 1.20")
+ ROMX_LOAD("ibos120.rom", 0x0000, 0x4000, CRC(52b1b8c4) SHA1(0f5b2a5bee23808b34eab2f027f7c1e77395c782), ROM_BIOS(1))
+ROM_END
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_integrab_device::device_add_mconfig(machine_config &config)
+{
+ /* rtc */
+ MC146818(config, m_rtc, 32.768_kHz_XTAL); // CDP6818
+ m_rtc->irq().set(DEVICE_SELF_OWNER, FUNC(bbc_internal_slot_device::irq_w));
+
+ /* rom/ram sockets */
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, nullptr);
+
+ /* battery-backed ram */
+ NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_integrab_device::device_rom_region() const
+{
+ return ROM_NAME( integrab );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_integrab_device - constructor
+//-------------------------------------------------
+
+bbc_integrab_device::bbc_integrab_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_INTEGRAB, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_ibos(*this, "ibos")
+ , m_rom(*this, "romslot%u", 0U)
+ , m_nvram(*this, "nvram")
+ , m_rtc(*this, "rtc")
+ , m_wp(*this, "wp")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_integrab_device::device_start()
+{
+ m_shadow = false;
+ m_ram = std::make_unique<uint8_t[]>(0x8000);
+ m_nvram->set_base(m_ram.get(), 0x8000);
+
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x2c000, m_region_swr->base(), 0x10000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+ memcpy(m_region_swr->base() + 0x3c000, m_ibos->base(), 0x4000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+ save_item(NAME(m_ramsel));
+ save_item(NAME(m_shadow));
+ save_pointer(NAME(m_ram), 0x8000);
+}
+
+void bbc_integrab_device::device_reset()
+{
+ m_romsel = 0;
+ m_ramsel = 0;
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_integrab_device::romsel_r(offs_t offset)
+{
+ uint8_t data = 0xfe;
+
+ switch (offset & 0x0c)
+ {
+ case 0x08:
+ data = m_rtc->read(0);
+ break;
+ case 0x0c:
+ data = m_rtc->read(1);
+ break;
+ }
+
+ return data;
+}
+
+void bbc_integrab_device::romsel_w(offs_t offset, uint8_t data)
+{
+ /*
+ ROMSEL & ROMID
+ Bits 0,3 ROMNUM Sideways ROM/RAM select bits
+ Bits 4,5 Not used
+ Bit 6 PRVEN Private RAM enable
+ Bit 7 MEMSEL Shadow/Main RAM toggle
+
+ RAMSEL & RAMID
+ Bits 0,1 AUX0,1 Not used but must be preserved
+ Bits 2,3 Not used
+ Bit 4 PRVS8 Private RAM 8K area select (&9000-&AFFF)
+ Bit 5 PRVS4 Private RAM 4K area select (&8000-&8FFF)
+ Bit 6 PRVS1 Private RAM 1K area select (&8000-&83FF)
+ Bit 7 SHEN Shadow RAM enable bit
+ */
+ switch (offset & 0x0c)
+ {
+ case 0x00:
+ m_romsel = data;
+ break;
+ case 0x04:
+ m_ramsel = data;
+ break;
+ case 0x08:
+ m_rtc->write(0, data);
+ break;
+ case 0x0c:
+ m_rtc->write(1, data);
+ break;
+ }
+
+ m_shadow = BIT(m_ramsel, 7) && !BIT(m_romsel, 7);
+}
+
+uint8_t bbc_integrab_device::ram_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_shadow && offset >= 0x3000)
+ data = m_ram[offset];
+ else
+ data = m_mb_ram->pointer()[offset];
+
+ return data;
+}
+
+void bbc_integrab_device::ram_w(offs_t offset, uint8_t data)
+{
+ if (m_shadow && offset >= 0x3000)
+ m_ram[offset] = data;
+ else
+ m_mb_ram->pointer()[offset] = data;
+}
+
+uint8_t bbc_integrab_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+ uint8_t romsel = m_romsel & 0x0f;
+
+ switch (romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[romsel] && m_mb_rom[romsel]->present())
+ {
+ data = m_mb_rom[romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (romsel << 14)];
+ }
+ break;
+ case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
+ /* expansion board sockets */
+ if (m_rom[romsel] && m_rom[romsel]->present())
+ {
+ data = m_rom[romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (romsel << 14)];
+ }
+ break;
+ }
+
+ /* private ram */
+ if (BIT(m_romsel, 6))
+ {
+ switch (offset & 0x3c00)
+ {
+ case 0x0000:
+ /* PRVS1 */
+ if (m_ramsel & 0x60)
+ data = m_ram[offset];
+ break;
+ case 0x0400: case 0x0800: case 0x0c00:
+ /* PRVS4 */
+ if (m_ramsel & 0x20)
+ data = m_ram[offset];
+ break;
+ case 0x1000: case 0x1400: case 0x1800: case 0x1c00: case 0x2000: case 0x2400: case 0x2800: case 0x2c00:
+ /* PRVS8 */
+ if (m_ramsel & 0x10)
+ data = m_ram[offset];
+ break;
+ }
+ }
+
+ return data;
+}
+
+void bbc_integrab_device::paged_w(offs_t offset, uint8_t data)
+{
+ uint8_t romsel = m_romsel & 0x0f;
+
+ /* private ram */
+ if (BIT(m_romsel, 6))
+ {
+ switch (offset & 0x3c00)
+ {
+ case 0x0000:
+ /* PRVS1 */
+ if (m_ramsel & 0x60)
+ m_ram[offset] = data;
+ break;
+ case 0x0400: case 0x0800: case 0x0c00:
+ /* PRVS4 */
+ if (m_ramsel & 0x20)
+ m_ram[offset] = data;
+ break;
+ case 0x1000: case 0x1400: case 0x1800: case 0x1c00: case 0x2000: case 0x2400: case 0x2800: case 0x2c00:
+ /* PRVS8 */
+ if (m_ramsel & 0x10)
+ m_ram[offset] = data;
+ break;
+ }
+ }
+ else
+ {
+ switch (romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[romsel])
+ {
+ m_mb_rom[romsel]->write(offset, data);
+ }
+ break;
+ case 4: case 5:
+ /* expansion board sockets */
+ if (m_rom[romsel] && !BIT(m_wp->read(), 0))
+ {
+ m_rom[romsel]->write(offset, data);
+ }
+ break;
+ case 6: case 7:
+ /* expansion board sockets */
+ if (m_rom[romsel] && !BIT(m_wp->read(), 1))
+ {
+ m_rom[romsel]->write(offset, data);
+ }
+ break;
+ case 8: case 9: case 10: case 11: case 12: case 13: case 14:
+ /* expansion board sockets */
+ if (m_rom[romsel])
+ {
+ m_rom[romsel]->write(offset, data);
+ }
+ break;
+ }
+ }
+}
diff --git a/src/devices/bus/bbc/internal/integrab.h b/src/devices/bus/bbc/internal/integrab.h
new file mode 100644
index 00000000000..679bdc44526
--- /dev/null
+++ b/src/devices/bus/bbc/internal/integrab.h
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Computech Integra-B expansion board
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_INTEGRAB_H
+#define MAME_BUS_BBC_INTERNAL_INTEGRAB_H
+
+#include "internal.h"
+#include "machine/mc146818.h"
+#include "machine/nvram.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_integrab_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_integrab_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual bool overrides_ram() override { return true; }
+ virtual uint8_t ram_r(offs_t offset) override;
+ virtual void ram_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t romsel_r(offs_t offset) override;
+ virtual void romsel_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_memory_region m_ibos;
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+ required_device<nvram_device> m_nvram;
+ required_device<mc146818_device> m_rtc;
+ required_ioport m_wp;
+
+ std::unique_ptr<uint8_t[]> m_ram;
+ bool m_shadow;
+ uint8_t m_romsel;
+ uint8_t m_ramsel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_INTEGRAB, bbc_integrab_device)
+
+
+#endif // MAME_BUS_BBC_INTERNAL_INTEGRAB_H
diff --git a/src/devices/bus/bbc/internal/internal.cpp b/src/devices/bus/bbc/internal/internal.cpp
new file mode 100644
index 00000000000..98651b23e31
--- /dev/null
+++ b/src/devices/bus/bbc/internal/internal.cpp
@@ -0,0 +1,214 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ BBC Micro internal expansion boards
+
+ These boards usually add shadow RAM and/or additional ROM sockets.
+ They don't have a fixed interface, some use the 6502 socket and move
+ the CPU to the board, others will move other IC's to the board and
+ flying leads will be connected to various points to pick up control
+ lines and writes to latches.
+
+**********************************************************************/
+
+#include "emu.h"
+#include "internal.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_INTERNAL_SLOT, bbc_internal_slot_device, "bbc_internal_slot", "BBC Micro internal boards")
+
+
+
+//**************************************************************************
+// DEVICE BBC_INTERNAL PORT INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_bbc_internal_interface - constructor
+//-------------------------------------------------
+
+device_bbc_internal_interface::device_bbc_internal_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "bbcinternal")
+ , m_maincpu(*this, ":maincpu")
+ , m_mb_ram(*this, ":ram")
+ , m_mb_rom(*this, ":romslot%u", 0U)
+ , m_region_swr(*this, ":swr")
+ , m_region_mos(*this, ":mos")
+{
+ m_slot = dynamic_cast<bbc_internal_slot_device *>(device.owner());
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_internal_slot_device - constructor
+//-------------------------------------------------
+
+bbc_internal_slot_device::bbc_internal_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_INTERNAL_SLOT, tag, owner, clock)
+ , device_single_card_slot_interface<device_bbc_internal_interface>(mconfig, *this)
+ , m_irq_handler(*this)
+ , m_nmi_handler(*this)
+ , m_card(nullptr)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_internal_slot_device::device_start()
+{
+ m_card = get_card_device();
+
+ // resolve callbacks
+ m_irq_handler.resolve_safe();
+ m_nmi_handler.resolve_safe();
+}
+
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+uint8_t bbc_internal_slot_device::ram_r(offs_t offset)
+{
+ if (m_card)
+ return m_card->ram_r(offset);
+ else
+ return 0xff;
+}
+
+uint8_t bbc_internal_slot_device::romsel_r(offs_t offset)
+{
+ if (m_card)
+ return m_card->romsel_r(offset);
+ else
+ return 0xfe;
+}
+
+uint8_t bbc_internal_slot_device::paged_r(offs_t offset)
+{
+ if (m_card)
+ return m_card->paged_r(offset);
+ else
+ return 0xff;
+}
+
+uint8_t bbc_internal_slot_device::mos_r(offs_t offset)
+{
+ if (m_card)
+ return m_card->mos_r(offset);
+ else
+ return 0xff;
+}
+
+//-------------------------------------------------
+// write
+//-------------------------------------------------
+
+void bbc_internal_slot_device::ram_w(offs_t offset, uint8_t data)
+{
+ if (m_card)
+ m_card->ram_w(offset, data);
+}
+
+void bbc_internal_slot_device::romsel_w(offs_t offset, uint8_t data)
+{
+ if (m_card)
+ m_card->romsel_w(offset, data);
+}
+
+void bbc_internal_slot_device::paged_w(offs_t offset, uint8_t data)
+{
+ if (m_card)
+ m_card->paged_w(offset, data);
+}
+
+void bbc_internal_slot_device::mos_w(offs_t offset, uint8_t data)
+{
+ if (m_card)
+ m_card->mos_w(offset, data);
+}
+
+void bbc_internal_slot_device::latch_fe60_w(uint8_t data)
+{
+ if (m_card)
+ m_card->latch_fe60_w(data);
+}
+
+
+//-------------------------------------------------
+// SLOT_INTERFACE( bbc_internal_devices )
+//-------------------------------------------------
+
+
+// slot devices
+#include "aries.h"
+#include "atpl.h"
+#include "cumana68k.h"
+#include "integrab.h"
+#include "morleyaa.h"
+#include "overlay.h"
+#include "peartree.h"
+#include "ramamp.h"
+#include "raven20.h"
+//#include "replaym.h"
+#include "romex.h"
+#include "stlswr.h"
+#include "stl2m128.h"
+#include "stl4m32.h"
+//#include "stl4m256.h"
+#include "werom.h"
+#include "weromram.h"
+#include "we32kram.h"
+
+
+void bbcb_internal_devices(device_slot_interface &device)
+{
+ device.option_add("ariesb12", BBC_ARIESB12); /* Aries-B12 ROM expansion */
+ device.option_add("ariesb20", BBC_ARIESB20); /* Aries-B20 RAM expansion */
+ device.option_add("ariesb32", BBC_ARIESB32); /* Aries-B32 RAM expansion */
+ device.option_add("atplsw", BBC_ATPLSW); /* ATPL Sidewise ROM/RAM expansion */
+ device.option_add("cumana68k", BBC_CUMANA68K); /* Cumana 68008 2nd Processor */
+ device.option_add("integrab", BBC_INTEGRAB); /* Computech Integra-B */
+ device.option_add("mr3000", BBC_MR3000); /* Peartree MR3000 ROM board */
+ device.option_add("mr4200", BBC_MR4200); /* Peartree MR4200 RAM board */
+ device.option_add("mr4300", BBC_MR4300); /* Peartree MR4300 ROM/RAM board */
+ device.option_add("mr4800", BBC_MR4800); /* Peartree MR4800 RAM board */
+ device.option_add("ramamp", BBC_RAMAMP); /* Ramamp Sideways RAM/ROM board */
+ device.option_add("raven20", BBC_RAVEN20); /* Raven-20 RAM expansion */
+ device.option_add("romex13", BBC_ROMEX13); /* GCC Romex13 ROM expansion */
+ device.option_add("swr16", BBC_STLSWR16); /* Solidisk SWR16 */
+ device.option_add("swr32", BBC_STLSWR32); /* Solidisk SWR32 */
+ device.option_add("swr64", BBC_STLSWR64); /* Solidisk SWR64 */
+ device.option_add("swr128", BBC_STLSWR128); /* Solidisk SWR128 */
+ device.option_add("2m128", BBC_STL2M128); /* Solidisk Twomeg 128 */
+ device.option_add("4m32", BBC_STL4M32); /* Solidisk Fourmeg 32 */
+ //device.option_add("4m256", BBC_STL4M256); /* Solidisk Fourmeg 256 */
+ device.option_add("we12rom", BBC_WE12ROM); /* Watford Electronics 12 ROM board */
+ device.option_add("we13rom", BBC_WE13ROM); /* Watford Electronics 13 ROM board */
+ device.option_add("weromram", BBC_WEROMRAM); /* Watford Electronics RAM/ROM board */
+ device.option_add("we32kram", BBC_WE32KRAM); /* Watford Electronics 32K Shadow RAM */
+}
+
+void bbcbp_internal_devices(device_slot_interface &device)
+{
+ device.option_add("atplswp", BBC_ATPLSWP); /* ATPL Sidewise+ ROM expansion */
+}
+
+void bbcm_internal_devices(device_slot_interface &device)
+{
+ device.option_add("morleyaa", BBC_MORLEYAA); /* Morley Master Board 'AA' */
+ device.option_add("overlay", BBC_OVERLAY); /* Vine Micros OS Overlay Board */
+ //device.option_add("replaym", BBC_REPLAYM); /* Vine Micros Master Replay */
+}
diff --git a/src/devices/bus/bbc/internal/internal.h b/src/devices/bus/bbc/internal/internal.h
new file mode 100644
index 00000000000..4adc7d2c615
--- /dev/null
+++ b/src/devices/bus/bbc/internal/internal.h
@@ -0,0 +1,113 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ BBC Micro internal expansion boards
+
+**********************************************************************/
+
+#ifndef MAME_BUS_BBC_INTERNAL_INTERNAL_H
+#define MAME_BUS_BBC_INTERNAL_INTERNAL_H
+
+#pragma once
+
+#include "machine/ram.h"
+#include "bus/bbc/rom/slot.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_internal_slot_device;
+
+// ======================> device_bbc_internal_interface
+
+class device_bbc_internal_interface : public device_interface
+{
+public:
+ virtual bool overrides_ram() { return false; }
+ virtual bool overrides_rom() { return false; }
+ virtual bool overrides_mos() { return false; }
+ virtual uint8_t ram_r(offs_t offset) { return 0xff; }
+ virtual void ram_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t romsel_r(offs_t offset) { return 0xfe; }
+ virtual void romsel_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t paged_r(offs_t offset) { return 0xff; }
+ virtual void paged_w(offs_t offset, uint8_t data) { }
+ virtual uint8_t mos_r(offs_t offset) { return 0xff; }
+ virtual void mos_w(offs_t offset, uint8_t data) { }
+ virtual void latch_fe60_w(uint8_t data) { }
+
+protected:
+ device_bbc_internal_interface(const machine_config &mconfig, device_t &device);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_mb_ram;
+ optional_device_array<bbc_romslot_device, 16> m_mb_rom;
+ required_memory_region m_region_swr;
+ required_memory_region m_region_mos;
+
+ bbc_internal_slot_device *m_slot;
+};
+
+// ======================> bbc_internal_slot_device
+
+class bbc_internal_slot_device : public device_t, public device_single_card_slot_interface<device_bbc_internal_interface>
+{
+public:
+ // construction/destruction
+ template <typename T>
+ bbc_internal_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock, T &&slot_options, const char *default_option)
+ : bbc_internal_slot_device(mconfig, tag, owner, clock)
+ {
+ option_reset();
+ slot_options(*this);
+ set_default_option(default_option);
+ set_fixed(false);
+ }
+
+ bbc_internal_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ // inline configuration
+ auto irq_handler() { return m_irq_handler.bind(); }
+ auto nmi_handler() { return m_nmi_handler.bind(); }
+
+ DECLARE_WRITE_LINE_MEMBER(irq_w) { m_irq_handler(state); }
+ DECLARE_WRITE_LINE_MEMBER(nmi_w) { m_nmi_handler(state); }
+
+ virtual bool overrides_ram() { return m_card ? m_card->overrides_ram() : false; }
+ virtual bool overrides_rom() { return m_card ? m_card->overrides_rom() : false; }
+ virtual bool overrides_mos() { return m_card ? m_card->overrides_mos() : false; }
+ virtual uint8_t ram_r(offs_t offset);
+ virtual void ram_w(offs_t offset, uint8_t data);
+ virtual uint8_t romsel_r(offs_t offset);
+ virtual void romsel_w(offs_t offset, uint8_t data);
+ virtual uint8_t paged_r(offs_t offset);
+ virtual void paged_w(offs_t offset, uint8_t data);
+ virtual uint8_t mos_r(offs_t offset);
+ virtual void mos_w(offs_t offset, uint8_t data);
+ virtual void latch_fe60_w(uint8_t data);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ devcb_write_line m_irq_handler;
+ devcb_write_line m_nmi_handler;
+
+ uint8_t m_romsel_fe30;
+ uint8_t m_romsel_fe62;
+
+ device_bbc_internal_interface *m_card;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_INTERNAL_SLOT, bbc_internal_slot_device)
+
+void bbcb_internal_devices(device_slot_interface &device);
+void bbcbp_internal_devices(device_slot_interface &device);
+void bbcm_internal_devices(device_slot_interface &device);
+
+
+#endif // MAME_BUS_BBC_INTERNAL_INTERNAL_H
diff --git a/src/devices/bus/bbc/internal/morleyaa.cpp b/src/devices/bus/bbc/internal/morleyaa.cpp
new file mode 100644
index 00000000000..e01336c3b5c
--- /dev/null
+++ b/src/devices/bus/bbc/internal/morleyaa.cpp
@@ -0,0 +1,307 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Morley Electronics 'AA' Master ROM Expansion Board
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "morleyaa.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MORLEYAA, bbc_morleyaa_device, "bbc_morleyaa", "Morley Electronics 'AA' Master ROM Expansion Board");
+
+
+//-------------------------------------------------
+// ROM( morleyaa )
+//-------------------------------------------------
+
+ROM_START(morleyaa)
+ ROM_REGION(0x4000, "aa_rom", 0)
+ ROM_LOAD("masterboard_200.rom", 0x0000, 0x4000, CRC(d93738ec) SHA1(c80f47e3f661b1636d21ff542c7a39a586008098))
+ROM_END
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_morleyaa_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot0-3 are unavailable when board is fitted, replaced by sockets on board */;
+ //config.device_remove(":romslot8");
+
+ /* 8 x 16K rom sockets */
+ BBC_ROMSLOT16(config, m_rom[0], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[1], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[3], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, nullptr);
+ /* 4 x 32K rom sockets */
+ BBC_ROMSLOT32(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT32(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT32(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT32(config, m_rom[11], bbc_rom_devices, nullptr);
+}
+
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_morleyaa_device::device_rom_region() const
+{
+ return ROM_NAME(morleyaa);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_morleyaa_device - constructor
+//-------------------------------------------------
+
+bbc_morleyaa_device::bbc_morleyaa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_MORLEYAA, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_aa_rom(*this, "aa_rom")
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_morleyaa_device::device_start()
+{
+ /* move internal roms to board */
+ memcpy(m_region_swr->base() + 0x20000, m_aa_rom->base(), 0x4000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+ save_item(NAME(m_banksel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_morleyaa_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 8:
+ data = m_aa_rom->base()[offset];
+ break;
+ case 4:
+ if (m_banksel & 0x20)
+ {
+ /* motherboard ram selected */
+ data = m_mb_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ switch (m_banksel & 0x07)
+ {
+ case 2:
+ data = m_rom[0]->read(offset);
+ break;
+ case 4:
+ data = m_rom[2]->read(offset);
+ break;
+ case 0:
+ data = m_rom[4]->read(offset);
+ break;
+ case 6:
+ data = m_rom[6]->read(offset);
+ break;
+ case 7:
+ data = m_rom[8]->read(offset);
+ break;
+ case 3:
+ data = m_rom[9]->read(offset);
+ break;
+ case 5:
+ data = m_rom[10]->read(offset);
+ break;
+ case 1:
+ data = m_rom[11]->read(offset);
+ break;
+ }
+ }
+ break;
+ case 5:
+ if (m_banksel & 0x20)
+ {
+ /* motherboard ram selected */
+ data = m_mb_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ switch (m_banksel & 0x07)
+ {
+ case 2:
+ data = m_rom[1]->read(offset);
+ break;
+ case 4:
+ data = m_rom[3]->read(offset);
+ break;
+ case 0:
+ data = m_rom[5]->read(offset);
+ break;
+ case 6:
+ data = m_rom[7]->read(offset);
+ break;
+ case 7:
+ data = m_rom[8]->read(offset | 0x4000);
+ break;
+ case 3:
+ data = m_rom[9]->read(offset | 0x4000);
+ break;
+ case 5:
+ data = m_rom[10]->read(offset | 0x4000);
+ break;
+ case 1:
+ data = m_rom[11]->read(offset | 0x4000);
+ break;
+ }
+ }
+ break;
+ case 6:
+ if (m_banksel & 0x40)
+ {
+ /* motherboard ram selected */
+ data = m_mb_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ switch (bitswap<8>(m_banksel, 2, 6, 5, 0, 1, 7, 3, 4) & 0x07)
+ {
+ case 2:
+ data = m_rom[0]->read(offset);
+ break;
+ case 4:
+ data = m_rom[2]->read(offset);
+ break;
+ case 0:
+ data = m_rom[4]->read(offset);
+ break;
+ case 6:
+ data = m_rom[6]->read(offset);
+ break;
+ case 7:
+ data = m_rom[8]->read(offset);
+ break;
+ case 3:
+ data = m_rom[9]->read(offset);
+ break;
+ case 5:
+ data = m_rom[10]->read(offset);
+ break;
+ case 1:
+ data = m_rom[11]->read(offset);
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (m_banksel & 0x40)
+ {
+ /* motherboard ram selected */
+ data = m_mb_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ switch (bitswap<8>(m_banksel, 2, 6, 5, 0, 1, 7, 3, 4) & 0x07)
+ {
+ case 2:
+ data = m_rom[1]->read(offset);
+ break;
+ case 4:
+ data = m_rom[3]->read(offset);
+ break;
+ case 0:
+ data = m_rom[5]->read(offset);
+ break;
+ case 6:
+ data = m_rom[7]->read(offset);
+ break;
+ case 7:
+ data = m_rom[8]->read(offset | 0x4000);
+ break;
+ case 3:
+ data = m_rom[9]->read(offset | 0x4000);
+ break;
+ case 5:
+ data = m_rom[10]->read(offset | 0x4000);
+ break;
+ case 1:
+ data = m_rom[11]->read(offset | 0x4000);
+ break;
+ }
+ }
+ break;
+ default:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_morleyaa_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 8:
+ if (offset == 0x3f00)
+ {
+ /* bank latch at &BF00 */
+ m_banksel = data;
+ }
+ break;
+ case 4: case 5:
+ if (m_banksel & 0x20)
+ {
+ /* motherboard ram selected */
+ m_mb_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
+ break;
+ case 6: case 7:
+ if (m_banksel & 0x40)
+ {
+ /* motherboard ram selected */
+ m_mb_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
+ break;
+ default:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/morleyaa.h b/src/devices/bus/bbc/internal/morleyaa.h
new file mode 100644
index 00000000000..f2debcff982
--- /dev/null
+++ b/src/devices/bus/bbc/internal/morleyaa.h
@@ -0,0 +1,54 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Morley Electronics 'AA' Master ROM Expansion Board
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_MORLEY_H
+#define MAME_BUS_BBC_INTERNAL_MORLEY_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_morleyaa_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_morleyaa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_memory_region m_aa_rom;
+ required_device_array<bbc_romslot_device, 12> m_rom;
+
+ uint8_t m_romsel;
+ uint8_t m_banksel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MORLEYAA, bbc_morleyaa_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_MORLEY_H */
diff --git a/src/devices/bus/bbc/internal/overlay.cpp b/src/devices/bus/bbc/internal/overlay.cpp
new file mode 100644
index 00000000000..c46a280a316
--- /dev/null
+++ b/src/devices/bus/bbc/internal/overlay.cpp
@@ -0,0 +1,224 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Vine Micros Romboard '3' (Master OS Overlay Board)
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Vine_MasterOSoverlay.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "overlay.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_OVERLAY, bbc_overlay_device, "bbc_overlay", "Vine Micros Romboard '3' (Master OS Overlay)");
+
+
+//-------------------------------------------------
+// INPUT_PORTS( overlay )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(overlay)
+ PORT_START("link_rom1")
+ PORT_CONFNAME(0x1f, 0x0a, "ROM 1")
+ PORT_CONFSETTING(0x10, "Operating System (reserved)")
+ PORT_CONFSETTING(0x09, "1770 DFS")
+ PORT_CONFSETTING(0x0a, "Viewsheet")
+ PORT_CONFSETTING(0x0b, "Edit")
+ PORT_CONFSETTING(0x0c, "BASIC")
+ PORT_CONFSETTING(0x0d, "ADFS")
+ PORT_CONFSETTING(0x0e, "View (and some GXR)")
+ PORT_CONFSETTING(0x0f, "Terminal and Operating System (reserved)")
+ PORT_START("link_rom2")
+ PORT_CONFNAME(0x1f, 0x0b, "ROM 2")
+ PORT_CONFSETTING(0x10, "Operating System (reserved)")
+ PORT_CONFSETTING(0x09, "1770 DFS")
+ PORT_CONFSETTING(0x0a, "Viewsheet")
+ PORT_CONFSETTING(0x0b, "Edit")
+ PORT_CONFSETTING(0x0c, "BASIC")
+ PORT_CONFSETTING(0x0d, "ADFS")
+ PORT_CONFSETTING(0x0e, "View (and some GXR)")
+ PORT_CONFSETTING(0x0f, "Terminal and Operating System (reserved)")
+ PORT_START("link_rom3")
+ PORT_CONFNAME(0x1f, 0x0e, "ROM 3")
+ PORT_CONFSETTING(0x10, "Operating System (reserved)")
+ PORT_CONFSETTING(0x09, "1770 DFS")
+ PORT_CONFSETTING(0x0a, "Viewsheet")
+ PORT_CONFSETTING(0x0b, "Edit")
+ PORT_CONFSETTING(0x0c, "BASIC")
+ PORT_CONFSETTING(0x0d, "ADFS")
+ PORT_CONFSETTING(0x0e, "View (and some GXR)")
+ PORT_CONFSETTING(0x0f, "Terminal and Operating System (reserved)")
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_overlay_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(overlay);
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_overlay_device::device_add_mconfig(machine_config &config)
+{
+ /* 3 x 16K rom sockets */
+ BBC_ROMSLOT16(config, m_rom[0], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[1], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, nullptr);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_overlay_device - constructor
+//-------------------------------------------------
+
+bbc_overlay_device::bbc_overlay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_OVERLAY, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+ , m_link_rom(*this, "link_rom%u", 1U)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_overlay_device::device_start()
+{
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_overlay_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 9: case 10: case 11: case 12: case 13: case 14: case 15:
+ /* overlay banks */
+ if (m_link_rom[0]->read() == m_romsel && m_rom[0]->present())
+ {
+ data = m_rom[0]->read(offset);
+ }
+ else if (m_link_rom[1]->read() == m_romsel && m_rom[1]->present())
+ {
+ data = m_rom[1]->read(offset);
+ }
+ else if (m_link_rom[2]->read() == m_romsel && m_rom[2]->present())
+ {
+ data = m_rom[2]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ case 4: case 5: case 6: case 7:
+ /* motherboard ram selected */
+ if (m_mb_rom[m_romsel & 0x0e] && m_mb_rom[m_romsel & 0x0e]->present())
+ {
+ data = m_mb_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_overlay_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 9: case 10: case 11: case 12: case 13: case 14: case 15:
+ /* overlay banks */
+ if (m_link_rom[0]->read() == m_romsel && m_rom[0]->present())
+ {
+ m_rom[0]->write(offset, data);
+ }
+ else if (m_link_rom[1]->read() == m_romsel && m_rom[1]->present())
+ {
+ m_rom[1]->write(offset, data);
+ }
+ else if (m_link_rom[2]->read() == m_romsel && m_rom[2]->present())
+ {
+ m_rom[2]->write(offset, data);
+ }
+ break;
+ case 4: case 5: case 6: case 7:
+ /* motherboard ram selected */
+ if (m_mb_rom[m_romsel & 0x0e])
+ {
+ m_mb_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
+ break;
+ default:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
+
+
+uint8_t bbc_overlay_device::mos_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_link_rom[0]->read() == 0x10 && m_rom[0]->present())
+ {
+ data = m_rom[0]->read(offset);
+ }
+ else if (m_link_rom[1]->read() == 0x10 && m_rom[1]->present())
+ {
+ data = m_rom[1]->read(offset);
+ }
+ else if (m_link_rom[2]->read() == 0x10 && m_rom[2]->present())
+ {
+ data = m_rom[2]->read(offset);
+ }
+ else
+ {
+ data = m_region_mos->base()[offset];
+ }
+
+ return data;
+}
diff --git a/src/devices/bus/bbc/internal/overlay.h b/src/devices/bus/bbc/internal/overlay.h
new file mode 100644
index 00000000000..3800687f5ac
--- /dev/null
+++ b/src/devices/bus/bbc/internal/overlay.h
@@ -0,0 +1,57 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Vine Micros Romboard '3' (Master OS Overlay Board)
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Vine_MasterOSoverlay.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_OVERLAY_H
+#define MAME_BUS_BBC_INTERNAL_OVERLAY_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_overlay_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_overlay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual bool overrides_mos() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t mos_r(offs_t offset) override;
+
+private:
+ required_device_array<bbc_romslot_device, 3> m_rom;
+ required_ioport_array<3> m_link_rom;
+
+ uint8_t m_romsel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_OVERLAY, bbc_overlay_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_OVERLAY_H */
diff --git a/src/devices/bus/bbc/internal/peartree.cpp b/src/devices/bus/bbc/internal/peartree.cpp
new file mode 100644
index 00000000000..49281731097
--- /dev/null
+++ b/src/devices/bus/bbc/internal/peartree.cpp
@@ -0,0 +1,295 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Peartree MRxx00 ROM/RAM Boards
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Peartree_ROMExpansion.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "peartree.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_MR3000, bbc_mr3000_device, "bbc_mr3000", "Peartree MR3000 ROM Board");
+DEFINE_DEVICE_TYPE(BBC_MR4200, bbc_mr4200_device, "bbc_mr4200", "Peartree MR4200 RAM Board");
+DEFINE_DEVICE_TYPE(BBC_MR4300, bbc_mr4300_device, "bbc_mr4300", "Peartree MR4300 ROM/RAM Board");
+DEFINE_DEVICE_TYPE(BBC_MR4800, bbc_mr4800_device, "bbc_mr4800", "Peartree MR4800 RAM Board");
+
+
+//-------------------------------------------------
+// INPUT_PORTS( peartree )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(peartree)
+ PORT_START("wp")
+ PORT_CONFNAME(0x01, 0x00, "Write Protect Sideways RAM")
+ PORT_CONFSETTING(0x00, DEF_STR(No))
+ PORT_CONFSETTING(0x01, DEF_STR(Yes))
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_mr4200_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(peartree);
+}
+
+ioport_constructor bbc_mr4300_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(peartree);
+}
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_mr3000_device::device_add_mconfig(machine_config &config)
+{
+ /* 4 rom sockets */
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, nullptr);
+}
+
+void bbc_mr4200_device::device_add_mconfig(machine_config &config)
+{
+ /* 32K static ram */
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+void bbc_mr4300_device::device_add_mconfig(machine_config &config)
+{
+ /* 3 rom sockets, 32K static ram */
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+void bbc_mr4800_device::device_add_mconfig(machine_config &config)
+{
+ /* 128K static ram (battery backed) */
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "nvram").set_fixed_ram(true);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_mr3000_device - constructor
+//-------------------------------------------------
+
+bbc_mr3000_device::bbc_mr3000_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+bbc_mr3000_device::bbc_mr3000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_mr3000_device(mconfig, BBC_MR3000, tag, owner, clock)
+{
+}
+
+bbc_mr4200_device::bbc_mr4200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_mr3000_device(mconfig, BBC_MR4200, tag, owner, clock)
+ , m_wp(*this, "wp")
+{
+}
+
+//-------------------------------------------------
+// bbc_mr4300_device - constructor
+//-------------------------------------------------
+
+bbc_mr4300_device::bbc_mr4300_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+ , m_wp(*this, "wp")
+{
+}
+
+bbc_mr4300_device::bbc_mr4300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_mr4300_device(mconfig, BBC_MR4300, tag, owner, clock)
+{
+}
+
+bbc_mr4800_device::bbc_mr4800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_mr4300_device(mconfig, BBC_MR4800, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_mr3000_device::device_start()
+{
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+void bbc_mr4300_device::device_start()
+{
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_mr3000_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 8: case 9: case 10: case 11:
+ /* motherboard rom sockets 0-3 are re-assigned to 8-11 */
+ if (m_mb_rom[m_romsel & 0x03] && m_mb_rom[m_romsel & 0x03]->present())
+ {
+ data = m_mb_rom[m_romsel & 0x03]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14) - 0x20000];
+ }
+ break;
+ case 12: case 13: case 14: case 15:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_mr3000_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 8: case 9: case 10: case 11:
+ /* motherboard rom sockets 0-3 are re-assigned to 8-11 */
+ if (m_mb_rom[m_romsel & 0x03])
+ {
+ m_mb_rom[m_romsel & 0x03]->write(offset, data);
+ }
+ break;
+ case 12: case 13: case 14: case 15:
+ /* expansion board sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
+
+
+void bbc_mr4200_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 8: case 9: case 10: case 11:
+ /* motherboard rom sockets 0-3 are re-assigned to 8-11 */
+ if (m_mb_rom[m_romsel & 0x03])
+ {
+ m_mb_rom[m_romsel & 0x03]->write(offset, data);
+ }
+ break;
+ case 12: case 13: case 14: case 15:
+ /* expansion board sockets (if not write protected) */
+ if (m_rom[m_romsel] && !m_wp->read())
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
+
+
+uint8_t bbc_mr4300_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 4: case 5: case 6: case 7:
+ /* motherboard rom sockets 0-3 are re-assigned to 4-7 */
+ if (m_mb_rom[m_romsel & 0x03] && m_mb_rom[m_romsel & 0x03]->present())
+ {
+ data = m_mb_rom[m_romsel & 0x03]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14) - 0x10000];
+ }
+ break;
+ case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_mr4300_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 4: case 5: case 6: case 7:
+ /* motherboard rom sockets 0-3 are re-assigned to 4-7 */
+ if (m_mb_rom[m_romsel & 0x03])
+ {
+ m_mb_rom[m_romsel & 0x03]->write(offset, data);
+ }
+ break;
+ case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
+ /* expansion board sockets (if not write protected) */
+ if (m_rom[m_romsel] && !m_wp->read())
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/peartree.h b/src/devices/bus/bbc/internal/peartree.h
new file mode 100644
index 00000000000..9f9ed683396
--- /dev/null
+++ b/src/devices/bus/bbc/internal/peartree.h
@@ -0,0 +1,116 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Peartree MRxx00 ROM/RAM Boards
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Peartree_ROMExpansion.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_PEARTREE_H
+#define MAME_BUS_BBC_INTERNAL_PEARTREE_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_mr3000_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_mr3000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ bbc_mr3000_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+ uint8_t m_romsel;
+};
+
+
+class bbc_mr4200_device : public bbc_mr3000_device
+{
+public:
+ // construction/destruction
+ bbc_mr4200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ required_ioport m_wp;
+
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+};
+
+
+class bbc_mr4300_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_mr4300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ bbc_mr4300_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+ required_ioport m_wp;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+ uint8_t m_romsel;
+};
+
+
+class bbc_mr4800_device : public bbc_mr4300_device
+{
+public:
+ // construction/destruction
+ bbc_mr4800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_MR3000, bbc_mr3000_device);
+DECLARE_DEVICE_TYPE(BBC_MR4200, bbc_mr4200_device);
+DECLARE_DEVICE_TYPE(BBC_MR4300, bbc_mr4300_device);
+DECLARE_DEVICE_TYPE(BBC_MR4800, bbc_mr4800_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_PEARTREE_H */
diff --git a/src/devices/bus/bbc/internal/ramamp.cpp b/src/devices/bus/bbc/internal/ramamp.cpp
new file mode 100644
index 00000000000..586159377aa
--- /dev/null
+++ b/src/devices/bus/bbc/internal/ramamp.cpp
@@ -0,0 +1,155 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Ramamp Computers Sideways RAM/ROM Board
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/RAMAMP_SidewaysRAMROM.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "ramamp.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_RAMAMP, bbc_ramamp_device, "bbc_ramamp", "Ramamp Sideways RAM/ROM Board");
+
+
+//-------------------------------------------------
+// INPUT_PORTS( ramamp )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(ramamp)
+ PORT_START("wp")
+ PORT_CONFNAME(0x01, 0x00, "Write Protect Sideways RAM")
+ PORT_CONFSETTING(0x00, DEF_STR(No))
+ PORT_CONFSETTING(0x01, DEF_STR(Yes))
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_ramamp_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(ramamp);
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_ramamp_device::device_add_mconfig(machine_config &config)
+{
+ /* 6 rom sockets, 32K dynamic ram */
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, nullptr);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_ramamp_device - constructor
+//-------------------------------------------------
+
+bbc_ramamp_device::bbc_ramamp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_RAMAMP, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+ , m_wp(*this, "wp")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_ramamp_device::device_start()
+{
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x2c000, m_region_swr->base(), 0x8000);
+ memmove(m_region_swr->base() + 0x38000, m_region_swr->base() + 0x8000, 0x8000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_ramamp_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_ramamp_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ case 10: case 13:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && !m_wp->read())
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/ramamp.h b/src/devices/bus/bbc/internal/ramamp.h
new file mode 100644
index 00000000000..d8f9b62408b
--- /dev/null
+++ b/src/devices/bus/bbc/internal/ramamp.h
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Ramamp Computers Sideways RAM/ROM Board
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/RAMAMP_SidewaysRAMROM.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_RAMAMP_H
+#define MAME_BUS_BBC_INTERNAL_RAMAMP_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_ramamp_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_ramamp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+ required_ioport m_wp;
+
+ uint8_t m_romsel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_RAMAMP, bbc_ramamp_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_RAMAMP_H */
diff --git a/src/devices/bus/bbc/internal/raven20.cpp b/src/devices/bus/bbc/internal/raven20.cpp
new file mode 100644
index 00000000000..f6bb3efdb4b
--- /dev/null
+++ b/src/devices/bus/bbc/internal/raven20.cpp
@@ -0,0 +1,112 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Raven-20 RAM expansion board
+
+ TODO:
+ - Verify behaviour of RAVEN-20 1.00, seems buggy or incomplete emulation.
+ - FAST mode (*FRON) is not understood.
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "raven20.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_RAVEN20, bbc_raven20_device, "bbc_raven20", "Raven-20 RAM expansion")
+
+
+//-------------------------------------------------
+// ROM( raven20 )
+//-------------------------------------------------
+
+ROM_START(raven20)
+ ROM_REGION(0x2000, "exp_rom", 0)
+ ROM_SYSTEM_BIOS(0, "106", "Raven-20 1.06")
+ ROMX_LOAD("raven20_1.06.rom", 0x0000, 0x2000, CRC(7efb0ab3) SHA1(d395199ef8f51579fe74e3d7d8dab1de6e0b30e2), ROM_BIOS(0))
+ ROM_SYSTEM_BIOS(1, "100", "Raven-20 1.00")
+ ROMX_LOAD("raven20_1.00.rom", 0x0000, 0x2000, CRC(e8c8f9d5) SHA1(e4f2acc07969e10c082355c82d8d1cbc1c08ee2e), ROM_BIOS(1))
+ROM_END
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_raven20_device::device_rom_region() const
+{
+ return ROM_NAME( raven20 );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_raven20_device - constructor
+//-------------------------------------------------
+
+bbc_raven20_device::bbc_raven20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_RAVEN20, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_raven20_device::device_start()
+{
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ program.install_write_handler(0xd000, 0xd000, write8sm_delegate(*this, FUNC(bbc_raven20_device::enable_w)));
+ program.install_write_handler(0xc000, 0xc000, write8sm_delegate(*this, FUNC(bbc_raven20_device::disable_w)));
+
+ m_shadow = false;
+ m_ram = std::make_unique<uint8_t[]>(0x5000);
+
+ /* register for save states */
+ save_item(NAME(m_shadow));
+ save_pointer(NAME(m_ram), 0x5000);
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+void bbc_raven20_device::enable_w(offs_t offset, uint8_t data)
+{
+ m_shadow = true;
+}
+
+void bbc_raven20_device::disable_w(offs_t offset, uint8_t data)
+{
+ m_shadow = false;
+}
+
+uint8_t bbc_raven20_device::ram_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (m_shadow && offset >= 0x3000)
+ data = m_ram[offset - 0x3000];
+ else
+ data = m_mb_ram->pointer()[offset];
+
+ return data;
+}
+
+void bbc_raven20_device::ram_w(offs_t offset, uint8_t data)
+{
+ if (m_shadow && offset >= 0x3000)
+ m_ram[offset - 0x3000] = data;
+ else
+ m_mb_ram->pointer()[offset] = data;
+}
diff --git a/src/devices/bus/bbc/internal/raven20.h b/src/devices/bus/bbc/internal/raven20.h
new file mode 100644
index 00000000000..0e04137afa6
--- /dev/null
+++ b/src/devices/bus/bbc/internal/raven20.h
@@ -0,0 +1,52 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Raven-20 RAM expansion board
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_RAVEN20_H
+#define MAME_BUS_BBC_INTERNAL_RAVEN20_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_raven20_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_raven20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_ram() override { return true; }
+ virtual uint8_t ram_r(offs_t offset) override;
+ virtual void ram_w(offs_t offset, uint8_t data) override;
+
+private:
+ void enable_w(offs_t offset, uint8_t data);
+ void disable_w(offs_t offset, uint8_t data);
+
+ bool m_shadow;
+ std::unique_ptr<uint8_t[]> m_ram;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_RAVEN20, bbc_raven20_device)
+
+
+#endif // MAME_BUS_BBC_INTERNAL_RAVEN20_H
diff --git a/src/devices/bus/bbc/internal/romex.cpp b/src/devices/bus/bbc/internal/romex.cpp
new file mode 100644
index 00000000000..9d7932db81f
--- /dev/null
+++ b/src/devices/bus/bbc/internal/romex.cpp
@@ -0,0 +1,134 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ GCC (Cambridge) Romex 13
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/GCC_Romex13.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "romex.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_ROMEX13, bbc_romex13_device, "bbc_romex13", "GCC Romex13 ROM Expansion");
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_romex13_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot2 is unavailable when board is fitted, replaced by socket on board */
+ //config.device_remove(":romslot2");
+
+ /* 13 rom sockets */
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, nullptr);
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_romex13_device - constructor
+//-------------------------------------------------
+
+bbc_romex13_device::bbc_romex13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_ROMEX13, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_romex13_device::device_start()
+{
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x30000, m_region_swr->base(), 0x10000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_romex13_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_romex13_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/romex.h b/src/devices/bus/bbc/internal/romex.h
new file mode 100644
index 00000000000..b9542937ebf
--- /dev/null
+++ b/src/devices/bus/bbc/internal/romex.h
@@ -0,0 +1,53 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ GCC (Cambridge) Romex 13
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/GCC_Romex13.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_ROMEX_H
+#define MAME_BUS_BBC_INTERNAL_ROMEX_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_romex13_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_romex13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ uint8_t m_romsel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_ROMEX13, bbc_romex13_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_ROMEX_H */
diff --git a/src/devices/bus/bbc/internal/stl2m128.cpp b/src/devices/bus/bbc/internal/stl2m128.cpp
new file mode 100644
index 00000000000..46b595aedfa
--- /dev/null
+++ b/src/devices/bus/bbc/internal/stl2m128.cpp
@@ -0,0 +1,248 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Solidisk Twomeg 128K Shadow and Sideways ROM/RAM board
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "stl2m128.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_STL2M128, bbc_stl2m128_device, "bbc_stl2m128", "Solidisk Twomeg 128K RAM/ROM Expansion");
+
+
+//-------------------------------------------------
+// INPUT_PORTS( stl2m128 )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(stl2m128)
+ PORT_START("wp")
+ PORT_CONFNAME(0x01, 0x00, "Write Protect Sideways RAM")
+ PORT_CONFSETTING(0x00, DEF_STR(No))
+ PORT_CONFSETTING(0x01, DEF_STR(Yes))
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_stl2m128_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(stl2m128);
+}
+
+//-------------------------------------------------
+// ROM( stl2m128 )
+//-------------------------------------------------
+
+ROM_START(stl2m128)
+ ROM_REGION(0x4000, "rom", ROMREGION_ERASEFF)
+ // ROM image usually distributed on floppy, to load into RAM
+ ROM_LOAD("manger128-1.00.rom", 0x0000, 0x102a, CRC(dbe84acb) SHA1(d170632b88d0ab276a919b0076dca305094a39b2))
+ROM_END
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_stl2m128_device::device_add_mconfig(machine_config &config)
+{
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_stl2m128_device::device_rom_region() const
+{
+ return ROM_NAME(stl2m128);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_stl2m128_device - constructor
+//-------------------------------------------------
+
+bbc_stl2m128_device::bbc_stl2m128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_STL2M128, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+ , m_wp(*this, "wp")
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_stl2m128_device::device_start()
+{
+ m_ram = std::make_unique<uint8_t[]>(0x20000);
+
+ /* copy rom image into ram bank c */
+ memcpy(&m_ram[0x10000], memregion("rom")->base(), 0x4000);
+
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x20000, m_region_swr->base(), 0x10000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_pointer(NAME(m_ram), 0x20000);
+ save_item(NAME(m_romsel));
+ save_item(NAME(m_shadow));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+void bbc_stl2m128_device::romsel_w(offs_t offset, uint8_t data)
+{
+ switch (offset & 0x0c)
+ {
+ case 0x00:
+ m_romsel = data & 0x0f;
+ break;
+ case 0x04:
+ m_shadow = data;
+ break;
+ }
+}
+
+uint8_t bbc_stl2m128_device::ram_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (BIT(m_shadow, 7) && offset >= 0x2000)
+ {
+ if (BIT(m_shadow, 1))
+ {
+ /* banks E/F */
+ data = m_ram[offset | 0x18000];
+ }
+ else
+ {
+ /* banks C/D */
+ data = m_ram[offset | 0x10000];
+ }
+ }
+ else
+ {
+ data = m_mb_ram->pointer()[offset];
+ }
+
+ return data;
+}
+
+void bbc_stl2m128_device::ram_w(offs_t offset, uint8_t data)
+{
+ if (BIT(m_shadow, 7) && offset >= 0x2000)
+ {
+ if (BIT(m_shadow, 1))
+ {
+ /* banks E/F */
+ m_ram[offset | 0x18000] = data;
+ }
+ else
+ {
+ /* banks C/D */
+ m_ram[offset | 0x10000] = data;
+ }
+ }
+ else
+ {
+ m_mb_ram->pointer()[offset] = data;
+ }
+}
+
+uint8_t bbc_stl2m128_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ case 8: case 9: case 10: case 11:
+ /* expansion board rom sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ case 4: case 5: case 6: case 7: case 12: case 13: case 14: case 15:
+ /* expansion board ram sockets */
+ data = m_ram[offset | ((m_romsel & 0x03) << 14) | ((m_romsel & 0x08) << 13)];
+ break;
+ }
+
+
+ return data;
+}
+
+void bbc_stl2m128_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ case 8: case 9: case 10: case 11:
+ /* expansion board rom sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ case 4: case 5: case 6: case 7: case 12: case 13: case 14: case 15:
+ /* expansion board ram sockets */
+ if (!m_wp->read())
+ {
+ m_ram[offset | ((m_romsel & 0x03) << 14) | ((m_romsel & 0x08) << 13)] = data;
+ }
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/stl2m128.h b/src/devices/bus/bbc/internal/stl2m128.h
new file mode 100644
index 00000000000..2c5f327ab19
--- /dev/null
+++ b/src/devices/bus/bbc/internal/stl2m128.h
@@ -0,0 +1,59 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Solidisk Twomeg 128K Shadow and Sideways ROM/RAM board
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_STL2M128_H
+#define MAME_BUS_BBC_INTERNAL_STL2M128_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_stl2m128_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_stl2m128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual bool overrides_ram() override { return true; }
+ virtual uint8_t ram_r(offs_t offset) override;
+ virtual void ram_w(offs_t offset, uint8_t data) override;
+ virtual void romsel_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+ required_ioport m_wp;
+
+ std::unique_ptr<uint8_t[]> m_ram;
+
+ uint8_t m_romsel;
+ uint8_t m_shadow;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_STL2M128, bbc_stl2m128_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_STL2M128_H */
diff --git a/src/devices/bus/bbc/internal/stl4m32.cpp b/src/devices/bus/bbc/internal/stl4m32.cpp
new file mode 100644
index 00000000000..bd5e3e0d40e
--- /dev/null
+++ b/src/devices/bus/bbc/internal/stl4m32.cpp
@@ -0,0 +1,303 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Solidisk Fourmeg RAM/ROM Expansions
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_4Meg.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "stl4m32.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_STL4M32, bbc_stl4m32_device, "bbc_stl4m32", "Solidisk Fourmeg 32K RAM/ROM Expansion");
+
+
+//-------------------------------------------------
+// INPUT_PORTS( stl4m )
+//-------------------------------------------------
+
+INPUT_PORTS_START(stl4m32)
+ PORT_START("stl4m_clock")
+ PORT_CONFNAME(0x01, 0x01, "4MHz Clock") PORT_CHANGED_MEMBER(DEVICE_SELF, bbc_stl4m32_device, clock_switch, 0)
+ PORT_CONFSETTING(0x00, "2MHz")
+ PORT_CONFSETTING(0x01, "4MHz")
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_stl4m32_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(stl4m32);
+}
+
+
+//-------------------------------------------------
+// ROM( stl4m32 )
+//-------------------------------------------------
+
+ROM_START(stl4m32)
+ ROM_REGION(0x4000, "rom", 0)
+ ROM_SYSTEM_BIOS(0, "30", "Manager 3.00 (16.6.86)")
+ ROMX_LOAD("manager_4meg32k-16.6.86.rom", 0x0000, 0x4000, CRC(2024cd0d) SHA1(cf45217ac88480a6963cbf75e8cf684cd81c7b09), ROM_BIOS(0))
+ROM_END
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_stl4m32_device::device_add_mconfig(machine_config &config)
+{
+ //M65SC02(config.replace(), m_maincpu, DERIVED_CLOCK(1, 4));
+
+ /* 5 x 32K rom sockets */
+ BBC_ROMSLOT32(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT32(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT32(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT32(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT32(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+
+const tiny_rom_entry *bbc_stl4m32_device::device_rom_region() const
+{
+ return ROM_NAME(stl4m32);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_stl4m32_device - constructor
+//-------------------------------------------------
+
+bbc_stl4m32_device::bbc_stl4m32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_STL4M32, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_stl4m32_device::device_start()
+{
+ m_ram = std::make_unique<uint8_t[]>(0x8000);
+
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x30000, m_region_swr->base() + 0xc000, 0x4000);
+ memcpy(m_region_swr->base() + 0x28000, memregion("rom")->base(), 0x4000);
+ memset(m_region_swr->base() + 0x0c000, 0xff, 0x4000);
+
+ /* register for save states */
+ save_pointer(NAME(m_ram), 0x8000);
+ save_item(NAME(m_romsel));
+ save_item(NAME(m_ramsel));
+ save_item(NAME(m_shadow));
+}
+
+
+//-------------------------------------------------
+// device_reset_after_children - reset after child devices
+//-------------------------------------------------
+
+void bbc_stl4m32_device::device_reset() //_after_children()
+{
+ /* set cpu clock to 4mhz */
+ //m_maincpu->set_clock(DERIVED_CLOCK(1, 4));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+INPUT_CHANGED_MEMBER(bbc_stl4m32_device::clock_switch)
+{
+ switch (newval)
+ {
+ case 0:
+ //m_maincpu->set_clock(DERIVED_CLOCK(1, 8));
+ break;
+ case 1:
+ //m_maincpu->set_clock(DERIVED_CLOCK(1, 4));
+ break;
+ }
+}
+
+void bbc_stl4m32_device::romsel_w(offs_t offset, uint8_t data)
+{
+ logerror("romsel_w: %04x = %02x\n", offset | 0xfe30, data);
+
+ switch (offset & 0x0e)
+ {
+ case 0x00:
+ m_romsel = data & 0x0f;
+ break;
+ case 0x02:
+ m_ramsel = data;
+ break;
+ case 0x04:
+ m_shadow = data;
+ break;
+ }
+}
+
+uint8_t bbc_stl4m32_device::ram_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (BIT(m_shadow, 7) && offset >= 0x2000)
+ {
+ data = m_ram[offset];
+ }
+ else
+ {
+ data = m_mb_ram->pointer()[offset];
+ }
+
+ return data;
+}
+
+void bbc_stl4m32_device::ram_w(offs_t offset, uint8_t data)
+{
+ if ((offset & 0xff) == 0x00)
+ logerror("ram_w: %04x = %02x\n", offset, data);
+
+ if (BIT(m_romsel, 7) && offset >= 0x2000)
+ {
+ m_ram[offset] = data;
+ }
+ else
+ {
+ m_mb_ram->pointer()[offset] = data;
+ }
+}
+
+
+uint8_t bbc_stl4m32_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ if (BIT(m_romsel, 7) && offset < 0x2000)
+ {
+ data = m_ram[offset];
+ }
+ else
+ {
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13:
+ /* expansion board rom sockets */
+ if (m_rom[m_romsel & 0x0e] && m_rom[m_romsel & 0x0e]->present())
+ {
+ data = m_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ case 14: case 15:
+ /* expansion board ram sockets */
+ data = m_ram[offset | ((m_romsel & 0x01) << 14)];
+ break;
+ }
+ }
+
+ return data;
+}
+
+void bbc_stl4m32_device::paged_w(offs_t offset, uint8_t data)
+{
+ if ((offset & 0xff) == 0x00)
+ logerror("paged_w: %04x = %02x\n", offset | 0x8000, data);
+
+ if (BIT(m_romsel, 7) && offset < 0x2000)
+ {
+ m_ram[offset] = data;
+ }
+ else
+ {
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13:
+ /* expansion board rom sockets */
+ if (m_rom[m_romsel & 0x0e])
+ {
+ m_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
+ break;
+ }
+
+ if (m_ramsel == 14 || m_ramsel == 15)
+ {
+ /* expansion board ram sockets */
+ m_ram[offset | ((m_ramsel & 0x01) << 14)] = data;
+ }
+ }
+}
+
+
+uint8_t bbc_stl4m32_device::mos_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ //if (BIT(m_shadow, 7) && offset >= 0x2000)
+ //{
+ // data = m_ram[offset];
+ //}
+ //else
+ //{
+ data = m_region_mos->base()[offset];
+ //}
+
+ return data;
+}
+
+void bbc_stl4m32_device::mos_w(offs_t offset, uint8_t data)
+{
+ if ((offset & 0xff) == 0x00)
+ logerror("mos_w: %04x = %02x\n", offset | 0xc000, data);
+
+ //if (BIT(m_romsel, 7) && offset >= 0x2000)
+ //{
+ // m_ram[offset] = data;
+ //}
+} \ No newline at end of file
diff --git a/src/devices/bus/bbc/internal/stl4m32.h b/src/devices/bus/bbc/internal/stl4m32.h
new file mode 100644
index 00000000000..ac939d6d4ff
--- /dev/null
+++ b/src/devices/bus/bbc/internal/stl4m32.h
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Solidisk Fourmeg RAM/ROM Expansions
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_4Meg.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_STL4M32_H
+#define MAME_BUS_BBC_INTERNAL_STL4M32_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_stl4m32_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_stl4m32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ DECLARE_INPUT_CHANGED_MEMBER(clock_switch);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual bool overrides_ram() override { return true; }
+ virtual bool overrides_mos() override { return true; }
+ virtual uint8_t ram_r(offs_t offset) override;
+ virtual void ram_w(offs_t offset, uint8_t data) override;
+ virtual void romsel_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+ virtual uint8_t mos_r(offs_t offset) override;
+ virtual void mos_w(offs_t offset, uint8_t data) override;
+
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ std::unique_ptr<uint8_t[]> m_ram;
+
+ uint8_t m_romsel;
+ uint8_t m_ramsel;
+ uint8_t m_shadow;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_STL4M32, bbc_stl4m32_device);
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_STL4M32_H */
diff --git a/src/devices/bus/bbc/internal/stlswr.cpp b/src/devices/bus/bbc/internal/stlswr.cpp
new file mode 100644
index 00000000000..f4992197453
--- /dev/null
+++ b/src/devices/bus/bbc/internal/stlswr.cpp
@@ -0,0 +1,192 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Solidisk Sideways RAM
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_128KSWE.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "stlswr.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_STLSWR16, bbc_stlswr16_device, "bbc_stlswr16", "Solidisk SWR16 - 16K Sideways RAM");
+DEFINE_DEVICE_TYPE(BBC_STLSWR32, bbc_stlswr32_device, "bbc_stlswr32", "Solidisk SWR32 - 32K Sideways RAM");
+DEFINE_DEVICE_TYPE(BBC_STLSWR64, bbc_stlswr64_device, "bbc_stlswr64", "Solidisk SWR64 - 64K Sideways RAM");
+DEFINE_DEVICE_TYPE(BBC_STLSWR128, bbc_stlswr128_device, "bbc_stlswr128", "Solidisk SWR128 - 128K Sideways RAM");
+
+
+//-------------------------------------------------
+// ROM( stlswr )
+//-------------------------------------------------
+
+ROM_START(stlswr)
+ ROM_REGION(0x4000, "exp_rom", 0)
+ ROM_SYSTEM_BIOS(0, "13", "Toolkit 1.3 03/03/86")
+ ROMX_LOAD("toolkit-1.3-16k-128k-03-03-86.rom", 0x0000, 0x4000, CRC(a1745d10) SHA1(1821e74feca60b95766ead06df20f6db22e2b4bb), ROM_BIOS(0))
+ROM_END
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_stlswr16_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot3 is unavailable when board is fitted */
+ //config.device_remove(":romslot3");
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+void bbc_stlswr32_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot3 is unavailable when board is fitted */
+ //config.device_remove(":romslot3");
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+void bbc_stlswr64_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot3 is unavailable when board is fitted */
+ //config.device_remove(":romslot3");
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+void bbc_stlswr128_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot3 is unavailable when board is fitted */
+ //config.device_remove(":romslot3");
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_stlswr_device::device_rom_region() const
+{
+ return ROM_NAME(stlswr);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_stlswr_device - constructor
+//-------------------------------------------------
+
+bbc_stlswr_device::bbc_stlswr_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+bbc_stlswr16_device::bbc_stlswr16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_stlswr_device(mconfig, BBC_STLSWR16, tag, owner, clock)
+{
+}
+
+bbc_stlswr32_device::bbc_stlswr32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_stlswr_device(mconfig, BBC_STLSWR32, tag, owner, clock)
+{
+}
+
+bbc_stlswr64_device::bbc_stlswr64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_stlswr_device(mconfig, BBC_STLSWR64, tag, owner, clock)
+{
+}
+
+bbc_stlswr128_device::bbc_stlswr128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_stlswr_device(mconfig, BBC_STLSWR128, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_stlswr_device::device_start()
+{
+ /* register for save states */
+ save_item(NAME(m_romsel));
+ save_item(NAME(m_ramsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_stlswr_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_stlswr_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+
+ /* expansion board sockets */
+ if (m_rom[m_ramsel])
+ {
+ m_rom[m_ramsel]->write(offset, data);
+ }
+}
diff --git a/src/devices/bus/bbc/internal/stlswr.h b/src/devices/bus/bbc/internal/stlswr.h
new file mode 100644
index 00000000000..db7e263ce28
--- /dev/null
+++ b/src/devices/bus/bbc/internal/stlswr.h
@@ -0,0 +1,108 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Solidisk Sideways RAM
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_128KSWE.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_STLSWR_H
+#define MAME_BUS_BBC_INTERNAL_STLSWR_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_stlswr_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_stlswr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ bbc_stlswr_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+ virtual void latch_fe60_w(uint8_t data) override { m_ramsel = (data & 0x07) | 0x08; }
+
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ uint8_t m_romsel;
+ uint8_t m_ramsel;
+};
+
+
+class bbc_stlswr16_device : public bbc_stlswr_device
+{
+public:
+ // construction/destruction
+ bbc_stlswr16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+
+class bbc_stlswr32_device : public bbc_stlswr_device
+{
+public:
+ // construction/destruction
+ bbc_stlswr32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+
+class bbc_stlswr64_device : public bbc_stlswr_device
+{
+public:
+ // construction/destruction
+ bbc_stlswr64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+
+class bbc_stlswr128_device : public bbc_stlswr_device
+{
+public:
+ // construction/destruction
+ bbc_stlswr128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_STLSWR16, bbc_stlswr16_device);
+DECLARE_DEVICE_TYPE(BBC_STLSWR32, bbc_stlswr32_device);
+DECLARE_DEVICE_TYPE(BBC_STLSWR64, bbc_stlswr64_device);
+DECLARE_DEVICE_TYPE(BBC_STLSWR128, bbc_stlswr128_device);
+
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_STLSWR_H */
diff --git a/src/devices/bus/bbc/internal/we32kram.cpp b/src/devices/bus/bbc/internal/we32kram.cpp
new file mode 100644
index 00000000000..ec21a7efb9d
--- /dev/null
+++ b/src/devices/bus/bbc/internal/we32kram.cpp
@@ -0,0 +1,142 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Watford Electronics 32K RAM card
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_32KRAMcard.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "we32kram.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_WE32KRAM, bbc_we32kram_device, "bbc_we32kram", "Watford Electronics 32K Shadow RAM");
+
+
+//-------------------------------------------------
+// ROM( we32kram )
+//-------------------------------------------------
+
+ROM_START(we32kram)
+ ROM_REGION(0x4000, "exp_rom", 0)
+ ROM_SYSTEM_BIOS(0, "240", "v2.40")
+ ROMX_LOAD("we32kram_v2.40.rom", 0x0000, 0x2000, CRC(db9c3a1a) SHA1(0a5efb084eb1ae353b9c79c026e9e26cd7695293), ROM_BIOS(0))
+ ROM_SYSTEM_BIOS(1, "200", "v2.00")
+ ROMX_LOAD("we32kram_v2.00.rom", 0x0000, 0x2000, CRC(1eff9b23) SHA1(98a3084b20c92427c2e9def58ade96f42659e20a), ROM_BIOS(1))
+ ROM_SYSTEM_BIOS(2, "100", "v1.00")
+ ROMX_LOAD("we32kram_v1.00.rom", 0x0000, 0x2000, CRC(7962b5db) SHA1(1b59a3354cfc704ad8aa60b0ed16e4cd2d815031), ROM_BIOS(2))
+ROM_END
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_we32kram_device::device_rom_region() const
+{
+ return ROM_NAME(we32kram);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_we32kram_device - constructor
+//-------------------------------------------------
+
+bbc_we32kram_device::bbc_we32kram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_WE32KRAM, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_we32kram_device::device_start()
+{
+ m_shadow = 2;
+ m_ram = std::make_unique<uint8_t[]>(0x8000);
+
+ /* register for save states */
+ save_item(NAME(m_shadow));
+ save_pointer(NAME(m_ram), 0x8000);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void bbc_we32kram_device::device_reset()
+{
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ program.install_write_handler(0xfffc, 0xffff, write8sm_delegate(*this, FUNC(bbc_we32kram_device::control_w)));
+}
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+void bbc_we32kram_device::control_w(offs_t offset, uint8_t data)
+{
+ m_shadow = offset;
+}
+
+uint8_t bbc_we32kram_device::ram_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_shadow)
+ {
+ case 0:
+ /* &fffc - swap whole memory */
+ data = m_ram[offset];
+ break;
+ case 2:
+ /* &fffe - select BBC ram */
+ data = m_mb_ram->pointer()[offset];
+ break;
+ case 3:
+ /* &ffff - select Watford ram */
+ if (offset >= 0x3000)
+ data = m_ram[offset];
+ else
+ data = m_mb_ram->pointer()[offset];
+ break;
+ }
+
+ return data;
+}
+
+void bbc_we32kram_device::ram_w(offs_t offset, uint8_t data)
+{
+ switch (m_shadow)
+ {
+ case 0:
+ /* &fffc - swap whole memory */
+ m_ram[offset] = data;
+ break;
+ case 2:
+ /* &fffe - select BBC ram */
+ m_mb_ram->pointer()[offset] = data;
+ break;
+ case 3:
+ /* &ffff - select Watford ram */
+ if (offset >= 0x3000)
+ m_ram[offset] = data;
+ else
+ m_mb_ram->pointer()[offset] = data;
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/we32kram.h b/src/devices/bus/bbc/internal/we32kram.h
new file mode 100644
index 00000000000..aa10005292b
--- /dev/null
+++ b/src/devices/bus/bbc/internal/we32kram.h
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Watford Electronics 32K RAM card
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_32KRAMcard.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_WE32KRAM_H
+#define MAME_BUS_BBC_INTERNAL_WE32KRAM_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_we32kram_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_we32kram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual bool overrides_ram() override { return true; }
+ virtual uint8_t ram_r(offs_t offset) override;
+ virtual void ram_w(offs_t offset, uint8_t data) override;
+
+private:
+ void control_w(offs_t offset, uint8_t data);
+
+ uint8_t m_shadow;
+ std::unique_ptr<uint8_t[]> m_ram;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_WE32KRAM, bbc_we32kram_device);
+
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_WE32KRAM_H */
diff --git a/src/devices/bus/bbc/internal/werom.cpp b/src/devices/bus/bbc/internal/werom.cpp
new file mode 100644
index 00000000000..bc38500dee8
--- /dev/null
+++ b/src/devices/bus/bbc/internal/werom.cpp
@@ -0,0 +1,260 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Watford Electronics 12 ROM Board
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_12ROMboard.html
+
+ Watford Electronics 13 ROM Board
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_13ROMBoard.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "werom.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_WE12ROM, bbc_we12rom_device, "bbc_we12rom", "Watford Electronics 12 ROM Board");
+DEFINE_DEVICE_TYPE(BBC_WE13ROM, bbc_we13rom_device, "bbc_we13rom", "Watford Electronics 13 ROM Board");
+
+
+//-------------------------------------------------
+// INPUT_PORTS( werom )
+//-------------------------------------------------
+
+static INPUT_PORTS_START(werom)
+ PORT_START("wp")
+ PORT_CONFNAME(0x01, 0x00, "Write Protect Sideways RAM")
+ PORT_CONFSETTING(0x00, DEF_STR(No))
+ PORT_CONFSETTING(0x01, DEF_STR(Yes))
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor bbc_we12rom_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(werom);
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_we12rom_device::device_add_mconfig(machine_config &config)
+{
+ /* 12 rom sockets, 16K static ram (battery backed) */
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, nullptr);
+}
+
+void bbc_we13rom_device::device_add_mconfig(machine_config &config)
+{
+ /* TODO: romslot2 is unavailable when board is fitted, replaced by socket on board */
+ //config.device_remove(":romslot2");
+
+ /* 13 rom sockets, 16K static ram (battery backed) */
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "nvram").set_fixed_ram(true);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_werom_device - constructor
+//-------------------------------------------------
+
+bbc_werom_device::bbc_werom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+bbc_we12rom_device::bbc_we12rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_werom_device(mconfig, BBC_WE12ROM, tag, owner, clock)
+ , m_wp(*this, "wp")
+{
+}
+
+bbc_we13rom_device::bbc_we13rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_werom_device(mconfig, BBC_WE13ROM, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_we12rom_device::device_start()
+{
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x2c000, m_region_swr->base(), 0xc000);
+ memmove(m_region_swr->base() + 0x3c000, m_region_swr->base() + 0xc000, 0x4000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+void bbc_we13rom_device::device_start()
+{
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x2c000, m_region_swr->base(), 0x10000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_we12rom_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_we12rom_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 2: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ /* sideways ram (if not write protected) */
+ if (!m_wp->read())
+ {
+ m_rom[14]->write(offset, data);
+ }
+ break;
+ }
+}
+
+
+uint8_t bbc_we13rom_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 0: case 1: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
+ {
+ data = m_mb_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_we13rom_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 0: case 1: case 3:
+ /* motherboard rom sockets */
+ if (m_mb_rom[m_romsel])
+ {
+ m_mb_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ /* sideways ram */
+ m_rom[15]->write(offset, data);
+ break;
+ }
+}
diff --git a/src/devices/bus/bbc/internal/werom.h b/src/devices/bus/bbc/internal/werom.h
new file mode 100644
index 00000000000..4e95ba120d8
--- /dev/null
+++ b/src/devices/bus/bbc/internal/werom.h
@@ -0,0 +1,90 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Watford Electronics 12 ROM Board
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_12ROMboard.html
+
+ Watford Electronics 13 ROM Board
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_13ROMBoard.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_WEROM_H
+#define MAME_BUS_BBC_INTERNAL_WEROM_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_werom_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_werom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ bbc_werom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+
+ uint8_t m_romsel;
+};
+
+
+class bbc_we12rom_device : public bbc_werom_device
+{
+public:
+ // construction/destruction
+ bbc_we12rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ required_ioport m_wp;
+};
+
+
+class bbc_we13rom_device : public bbc_werom_device
+{
+public:
+ // construction/destruction
+ bbc_we13rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_WE12ROM, bbc_we12rom_device);
+DECLARE_DEVICE_TYPE(BBC_WE13ROM, bbc_we13rom_device);
+
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_WEROM_H */
diff --git a/src/devices/bus/bbc/internal/weromram.cpp b/src/devices/bus/bbc/internal/weromram.cpp
new file mode 100644
index 00000000000..ceb8be3e270
--- /dev/null
+++ b/src/devices/bus/bbc/internal/weromram.cpp
@@ -0,0 +1,133 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Watford Electronics ROM/RAM Board
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_RAMROMBoard.html
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "weromram.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_WEROMRAM, bbc_weromram_device, "bbc_weromram", "Watford Electronics ROM/RAM Board");
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_weromram_device::device_add_mconfig(machine_config &config)
+{
+ /* 3 rom sockets, 64K dynamic ram, 16K static ram (battery backed) */
+ BBC_ROMSLOT16(config, m_rom[0], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[1], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[3], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[4], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[5], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[6], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[7], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, nullptr);
+ BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "nvram").set_fixed_ram(true);
+ BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, nullptr);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_weromram_device - constructor
+//-------------------------------------------------
+
+bbc_weromram_device::bbc_weromram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_WEROMRAM, tag, owner, clock)
+ , device_bbc_internal_interface(mconfig, *this)
+ , m_rom(*this, "romslot%u", 0U)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_weromram_device::device_start()
+{
+ /* move internal roms to board */
+ memmove(m_region_swr->base() + 0x2c000, m_region_swr->base(), 0xc000);
+ memmove(m_region_swr->base() + 0x3c000, m_region_swr->base() + 0xc000, 0x4000);
+ memset(m_region_swr->base(), 0xff, 0x10000);
+
+ /* register for save states */
+ save_item(NAME(m_romsel));
+ save_item(NAME(m_ramsel));
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+uint8_t bbc_weromram_device::paged_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (m_romsel)
+ {
+ case 8: case 9: case 10: case 11:
+ /* motherboard rom sockets 0-3 are re-assigned to 8-11 */
+ if (m_mb_rom[m_romsel & 0x03] && m_mb_rom[m_romsel & 0x03]->present())
+ {
+ data = m_mb_rom[m_romsel & 0x03]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14) - 0x20000];
+ }
+ break;
+ default:
+ /* expansion board sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+
+ return data;
+}
+
+void bbc_weromram_device::paged_w(offs_t offset, uint8_t data)
+{
+ switch (m_romsel)
+ {
+ case 8: case 9: case 10: case 11:
+ /* motherboard rom sockets 0-3 are re-assigned to 8-11 */
+ if (m_mb_rom[m_romsel & 0x03])
+ {
+ m_mb_rom[m_romsel & 0x03]->write(offset, data);
+ }
+ break;
+ }
+
+ /* expansion board sockets */
+ if (m_rom[m_ramsel])
+ {
+ m_rom[m_ramsel]->write(offset, data);
+ }
+}
diff --git a/src/devices/bus/bbc/internal/weromram.h b/src/devices/bus/bbc/internal/weromram.h
new file mode 100644
index 00000000000..b85c9d031ab
--- /dev/null
+++ b/src/devices/bus/bbc/internal/weromram.h
@@ -0,0 +1,58 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Watford Electronics ROM/RAM Board
+
+ http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/WE_RAMROMBoard.html
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_BBC_INTERNAL_WEROMRAM_H
+#define MAME_BUS_BBC_INTERNAL_WEROMRAM_H
+
+#include "internal.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class bbc_weromram_device :
+ public device_t,
+ public device_bbc_internal_interface
+{
+public:
+ // construction/destruction
+ bbc_weromram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ virtual bool overrides_rom() override { return true; }
+ virtual void romsel_w(offs_t offset, uint8_t data) override { m_romsel = data & 0x0f; }
+ virtual uint8_t paged_r(offs_t offset) override;
+ virtual void paged_w(offs_t offset, uint8_t data) override;
+
+private:
+ optional_device_array<bbc_romslot_device, 16> m_rom;
+
+ void ramsel_w(offs_t offset, uint8_t data);
+
+ uint8_t m_romsel;
+ uint8_t m_ramsel;
+};
+
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_WEROMRAM, bbc_weromram_device);
+
+
+
+#endif /* MAME_BUS_BBC_INTERNAL_WEROMRAM_H */
diff --git a/src/devices/bus/bbc/rom/nvram.cpp b/src/devices/bus/bbc/rom/nvram.cpp
new file mode 100644
index 00000000000..0d24f30c8bd
--- /dev/null
+++ b/src/devices/bus/bbc/rom/nvram.cpp
@@ -0,0 +1,58 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro Sideways RAM (Battery Backup) emulation
+
+***************************************************************************/
+
+#include "emu.h"
+#include "nvram.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_NVRAM, bbc_nvram_device, "bbc_nvram", "BBC Micro Sideways RAM (Battery Backup)")
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_nvram_device - constructor
+//-------------------------------------------------
+
+bbc_nvram_device::bbc_nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_NVRAM, tag, owner, clock)
+ , device_bbc_rom_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_nvram_device::device_start()
+{
+ nvram_alloc(0x4000);
+}
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+uint8_t bbc_nvram_device::read(offs_t offset)
+{
+ return get_nvram_base()[offset & (get_nvram_size() - 1)];
+}
+
+//-------------------------------------------------
+// write
+//-------------------------------------------------
+
+void bbc_nvram_device::write(offs_t offset, uint8_t data)
+{
+ get_nvram_base()[offset & (get_nvram_size() - 1)] = data;
+}
diff --git a/src/devices/bus/bbc/rom/nvram.h b/src/devices/bus/bbc/rom/nvram.h
new file mode 100644
index 00000000000..d10025c6acd
--- /dev/null
+++ b/src/devices/bus/bbc/rom/nvram.h
@@ -0,0 +1,42 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro Sideways RAM (Battery Backup) emulation
+
+***************************************************************************/
+
+#ifndef MAME_BUS_BBC_ROM_NVRAM_H
+#define MAME_BUS_BBC_ROM_NVRAM_H
+
+#pragma once
+
+#include "slot.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_nvram_device
+
+class bbc_nvram_device : public device_t,
+ public device_bbc_rom_interface
+{
+public:
+ // construction/destruction
+ bbc_nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // device_bbc_rom_interface overrides
+ virtual uint8_t read(offs_t offset) override;
+ virtual void write(offs_t offset, uint8_t data) override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_NVRAM, bbc_nvram_device)
+
+#endif // MAME_BUS_BBC_ROM_NVRAM_H
diff --git a/src/devices/bus/bbc/rom/ram.cpp b/src/devices/bus/bbc/rom/ram.cpp
index 0d626955812..bbe5d956006 100644
--- a/src/devices/bus/bbc/rom/ram.cpp
+++ b/src/devices/bus/bbc/rom/ram.cpp
@@ -36,6 +36,7 @@ bbc_ram_device::bbc_ram_device(const machine_config &mconfig, const char *tag, d
void bbc_ram_device::device_start()
{
+ ram_alloc(0x8000);
}
//-------------------------------------------------
diff --git a/src/devices/bus/bbc/rom/rom.cpp b/src/devices/bus/bbc/rom/rom.cpp
index f798de11c6a..f419998510b 100644
--- a/src/devices/bus/bbc/rom/rom.cpp
+++ b/src/devices/bus/bbc/rom/rom.cpp
@@ -44,7 +44,5 @@ void bbc_rom_device::device_start()
uint8_t bbc_rom_device::read(offs_t offset)
{
- uint32_t size = std::min((int32_t)get_rom_size(), 0x4000);
-
- return get_rom_base()[offset & (size - 1)];
+ return get_rom_base()[offset & (get_rom_size() - 1)];
}
diff --git a/src/devices/bus/bbc/rom/slot.cpp b/src/devices/bus/bbc/rom/slot.cpp
index 4a284661155..65b80730a18 100644
--- a/src/devices/bus/bbc/rom/slot.cpp
+++ b/src/devices/bus/bbc/rom/slot.cpp
@@ -72,6 +72,7 @@ void device_bbc_rom_interface::ram_alloc(uint32_t size)
void device_bbc_rom_interface::nvram_alloc(uint32_t size)
{
m_nvram.resize(size);
+ device().save_item(NAME(m_nvram));
}
//**************************************************************************
@@ -206,10 +207,10 @@ void bbc_romslot_device::write(offs_t offset, uint8_t data)
#include "rom.h"
#include "ram.h"
+#include "nvram.h"
#include "dfs.h"
#include "genie.h"
#include "pal.h"
-//#include "replay.h"
#include "rtc.h"
@@ -217,6 +218,7 @@ void bbc_rom_devices(device_slot_interface &device)
{
device.option_add_internal("rom", BBC_ROM);
device.option_add_internal("ram", BBC_RAM);
+ device.option_add_internal("nvram", BBC_NVRAM);
device.option_add_internal("cciword", BBC_CCIWORD);
device.option_add_internal("ccibase", BBC_CCIBASE);
device.option_add_internal("ccispell", BBC_CCISPELL);
@@ -228,7 +230,6 @@ void bbc_rom_devices(device_slot_interface &device)
device.option_add_internal("palmo2", BBC_PALMO2);
device.option_add_internal("genie", BBC_PMSGENIE);
device.option_add_internal("mrme00", BBC_MRME00);
- //device.option_add_internal("replay", BBC_REPLAY);
device.option_add_internal("stlrtc", BBC_STLRTC);
device.option_add_internal("pmsrtc", BBC_PMSRTC);
}
diff --git a/src/devices/bus/bbc/rom/slot.h b/src/devices/bus/bbc/rom/slot.h
index 0dfa2980a9e..7f33205327b 100644
--- a/src/devices/bus/bbc/rom/slot.h
+++ b/src/devices/bus/bbc/rom/slot.h
@@ -29,7 +29,7 @@ class bbc_romslot_device : public device_t,
public device_single_card_slot_interface<device_bbc_rom_interface>
{
public:
- // image-level overrides
+ // image-level overrides
virtual image_init_result call_load() override;
virtual void call_unload() override;
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
@@ -39,7 +39,7 @@ public:
virtual bool is_writeable() const override { return 0; }
virtual bool is_creatable() const override { return 0; }
virtual bool must_be_loaded() const override { return 0; }
- virtual bool is_reset_on_load() const override { return 1; }
+ virtual bool is_reset_on_load() const override { return 0; }
virtual const char *image_interface() const override { return "bbc_rom"; }
virtual const char *file_extensions() const override { return "rom,bin"; }
@@ -50,6 +50,10 @@ public:
uint8_t read(offs_t offset);
void write(offs_t offset, uint8_t data);
+ void set_fixed_ram(bool fixed) { this->set_fixed(fixed); this->set_user_loadable(!fixed); }
+
+ virtual bool present() { return is_loaded() || loaded_through_softlist() || !user_loadable(); }
+
uint32_t get_rom_size();
uint32_t get_slot_size() const { return m_slot_size; }
diff --git a/src/devices/bus/bbc/tube/tube.cpp b/src/devices/bus/bbc/tube/tube.cpp
index 6fa9dc700f6..2665398959e 100644
--- a/src/devices/bus/bbc/tube/tube.cpp
+++ b/src/devices/bus/bbc/tube/tube.cpp
@@ -110,17 +110,18 @@ void bbc_tube_devices(device_slot_interface &device)
{
device.option_add("6502", BBC_TUBE_6502); /* Acorn ANC01 6502 2nd processor */
device.option_add("z80", BBC_TUBE_Z80); /* Acorn ANC04 Z80 2nd processor */
- device.option_add("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */
+ device.option_add("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */
device.option_add("arm", BBC_TUBE_ARM); /* Acorn ANC13 ARM Evaluation System */
device.option_add("80286", BBC_TUBE_80286); /* Acorn 80286 2nd Processor */
//device.option_add("a500", BBC_TUBE_A500); /* Acorn A500 2nd Processor */
device.option_add("casper", BBC_TUBE_CASPER); /* Casper 68000 2nd Processor */
//device.option_add("pmsb2p", BBC_TUBE_PMSB2P); /* PMS B2P-6502 */
- //device.option_add("hdp68k", BBC_TUBE_HDP68K); /* Torch Unicorn (HDP68K) */
+ device.option_add("pcplus", BBC_TUBE_PCPLUS); /* Solidisk PC-Plus co-processor */
//device.option_add("x25", BBC_TUBE_X25); /* Econet X25 Gateway */
device.option_add("zep100", BBC_TUBE_ZEP100); /* Torch Z80 Communicator (ZEP100) (Torch) */
//device.option_add("zep100l", BBC_TUBE_ZEP100L); /* Torch Z80 Communicator (ZEP100) (Model B) */
//device.option_add("zep100w", BBC_TUBE_ZEP100W); /* Torch Z80 Communicator (ZEP100) (Model B+) */
+
/* Acorn ANC21 Universal 2nd Processor Unit */
device.option_add("65c102", BBC_TUBE_65C102); /* Acorn ADC06 65C102 co-processor */
device.option_add("80186", BBC_TUBE_80186); /* Acorn ADC08 80186 co-processor */
@@ -137,12 +138,14 @@ void bbc_extube_devices(device_slot_interface &device)
{
device.option_add("6502", BBC_TUBE_6502); /* Acorn ANC01 6502 2nd processor */
device.option_add("z80", BBC_TUBE_Z80); /* Acorn ANC04 Z80 2nd processor */
- device.option_add("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */
+ device.option_add("32016", BBC_TUBE_32016); /* Acorn ANC05 32016 2nd processor */
device.option_add("arm", BBC_TUBE_ARM); /* Acorn ANC13 ARM Evaluation System */
device.option_add("80286", BBC_TUBE_80286); /* Acorn 80286 2nd Processor */
+ device.option_add("pcplus", BBC_TUBE_PCPLUS); /* Solidisk PC-Plus co-processor */
//device.option_add("a500", BBC_TUBE_A500); /* Acorn A500 2nd Processor */
//device.option_add("pmsb2p", BBC_TUBE_PMSB2P); /* PMS B2P-6502 */
//device.option_add("zep100m", BBC_TUBE_ZEP100M); /* Torch Z80 Communicator (ZEP100) (Master) */
+
/* Acorn ANC21 Universal 2nd Processor Unit */
device.option_add("65c102", BBC_TUBE_65C102); /* Acorn ADC06 65C102 co-processor */
device.option_add("80186", BBC_TUBE_80186); /* Acorn ADC08 80186 co-processor */
@@ -177,6 +180,7 @@ void electron_tube_devices(device_slot_interface &device)
device.option_add("arm", BBC_TUBE_ARM); /* Acorn ANC13 ARM Evaluation System */
device.option_add("65c102", BBC_TUBE_65C102); /* Acorn ADC06 65C102 co-processor */
device.option_add("80186", BBC_TUBE_80186); /* Acorn ADC08 80186 co-processor */
+ device.option_add("pcplus", BBC_TUBE_PCPLUS); /* Solidisk PC-Plus co-processor */
device.option_add("rc6502", BBC_TUBE_RC6502); /* ReCo6502 (6502) */
device.option_add("rc65816", BBC_TUBE_RC65816); /* ReCo6502 (65816) */
}
diff --git a/src/devices/bus/bbc/tube/tube_80186.cpp b/src/devices/bus/bbc/tube/tube_80186.cpp
index 85331ab1b2a..9621110e7ca 100644
--- a/src/devices/bus/bbc/tube/tube_80186.cpp
+++ b/src/devices/bus/bbc/tube/tube_80186.cpp
@@ -19,6 +19,7 @@
//**************************************************************************
DEFINE_DEVICE_TYPE(BBC_TUBE_80186, bbc_tube_80186_device, "bbc_tube_80186", "Acorn 80186 Co-Processor")
+DEFINE_DEVICE_TYPE(BBC_TUBE_PCPLUS, bbc_tube_pcplus_device, "bbc_tube_pcplus", "Solidisk PC-Plus Co-Processor")
//-------------------------------------------------
@@ -50,6 +51,16 @@ ROM_START( tube_80186 )
ROM_END
//-------------------------------------------------
+// ROM( tube_pcplus )
+//-------------------------------------------------
+
+ROM_START( tube_pcplus )
+ ROM_REGION(0x4000, "bootstrap", 0)
+ ROM_LOAD16_BYTE("pcplus_ic31.rom", 0x0000, 0x2000, CRC(5149417b) SHA1(a905c8570d70597bb2b2fca47a1a47783956af9c))
+ ROM_LOAD16_BYTE("pcplus_ic32.rom", 0x0001, 0x2000, CRC(e47f10b2) SHA1(45dc8d7e7936afbec6de423569d9005a1c350316))
+ROM_END
+
+//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
@@ -72,6 +83,14 @@ void bbc_tube_80186_device::device_add_mconfig(machine_config &config)
SOFTWARE_LIST(config, "flop_ls_80186").set_original("bbc_flop_80186");
}
+void bbc_tube_pcplus_device::device_add_mconfig(machine_config &config)
+{
+ bbc_tube_80186_device::device_add_mconfig(config);
+
+ /* internal ram */
+ m_ram->set_default_size("1M");
+}
+
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
@@ -81,6 +100,11 @@ const tiny_rom_entry *bbc_tube_80186_device::device_rom_region() const
return ROM_NAME( tube_80186 );
}
+const tiny_rom_entry *bbc_tube_pcplus_device::device_rom_region() const
+{
+ return ROM_NAME( tube_pcplus );
+}
+
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -89,13 +113,23 @@ const tiny_rom_entry *bbc_tube_80186_device::device_rom_region() const
// bbc_tube_80186_device - constructor
//-------------------------------------------------
+bbc_tube_80186_device::bbc_tube_80186_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_bbc_tube_interface(mconfig, *this)
+ , m_i80186(*this, "i80186")
+ , m_ula(*this, "ula")
+ , m_ram(*this, "ram")
+ , m_bootstrap(*this, "bootstrap")
+{
+}
+
bbc_tube_80186_device::bbc_tube_80186_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, BBC_TUBE_80186, tag, owner, clock),
- device_bbc_tube_interface(mconfig, *this),
- m_i80186(*this, "i80186"),
- m_ula(*this, "ula"),
- m_ram(*this, "ram"),
- m_bootstrap(*this, "bootstrap")
+ : bbc_tube_80186_device(mconfig, BBC_TUBE_80186, tag, owner, clock)
+{
+}
+
+bbc_tube_pcplus_device::bbc_tube_pcplus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : bbc_tube_80186_device(mconfig, BBC_TUBE_PCPLUS, tag, owner, clock)
{
}
@@ -121,6 +155,13 @@ void bbc_tube_80186_device::device_reset()
program.install_rom(0xc0000, 0xc3fff, 0x3c000, m_bootstrap->base());
}
+void bbc_tube_pcplus_device::device_reset()
+{
+ address_space &program = m_i80186->space(AS_PROGRAM);
+
+ program.install_ram(0x00000, 0xfffff, m_ram->pointer());
+ program.install_rom(0xf0000, 0xf3fff, 0x0c000, m_bootstrap->base());
+}
//**************************************************************************
// IMPLEMENTATION
diff --git a/src/devices/bus/bbc/tube/tube_80186.h b/src/devices/bus/bbc/tube/tube_80186.h
index 42f757e75e4..a3df8d72743 100644
--- a/src/devices/bus/bbc/tube/tube_80186.h
+++ b/src/devices/bus/bbc/tube/tube_80186.h
@@ -32,6 +32,8 @@ public:
bbc_tube_80186_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ bbc_tube_80186_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
@@ -43,7 +45,6 @@ protected:
virtual uint8_t host_r(offs_t offset) override;
virtual void host_w(offs_t offset, uint8_t data) override;
-private:
required_device<i80186_cpu_device> m_i80186;
required_device<tube_device> m_ula;
required_device<ram_device> m_ram;
@@ -54,8 +55,24 @@ private:
};
+class bbc_tube_pcplus_device : public bbc_tube_80186_device
+{
+public:
+ bbc_tube_pcplus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+};
+
+
// device type definition
DECLARE_DEVICE_TYPE(BBC_TUBE_80186, bbc_tube_80186_device)
+DECLARE_DEVICE_TYPE(BBC_TUBE_PCPLUS, bbc_tube_pcplus_device)
-#endif /* MAME_BUS_BBC_TUBE_80x86_H */
+#endif /* MAME_BUS_BBC_TUBE_80186_H */
diff --git a/src/devices/bus/bbc/userport/userport.cpp b/src/devices/bus/bbc/userport/userport.cpp
index 2e6c8184c14..9e22ce28cd2 100644
--- a/src/devices/bus/bbc/userport/userport.cpp
+++ b/src/devices/bus/bbc/userport/userport.cpp
@@ -108,8 +108,11 @@ void bbc_userport_slot_device::pb_w(uint8_t data)
// slot devices
#include "beebspch.h"
//#include "digitiser.h"
+//#include "ev1.h"
#include "pointer.h"
#include "usersplit.h"
+//#include "vci.h"
+#include "voicebox.h"
#include "cfa3000kbd.h"
@@ -119,9 +122,13 @@ void bbc_userport_devices(device_slot_interface &device)
//device.option_add("atr", BBC_ATR); /* Advanced Teletext Receiver (GIS) */
device.option_add("beebspch", BBC_BEEBSPCH); /* Beeb Speech Synthesiser (Watford Electronics) */
//device.option_add("beebvdig", BBC_BEEBVDIG); /* Beeb Video Digitiser (Watford Electronics) */
+ //device.option_add("ev1", BBC_EV1); /* Micro-Robotics EV1 */
+ //device.option_add("hobbit", BBC_HOBBIT); /* Hobbit Floppy Tape System (Ikon) */
device.option_add("m512mouse", BBC_M512MOUSE); /* Acorn Mouse (provided with Master 512) */
device.option_add("tracker", BBC_TRACKER); /* Marconi RB2 Tracker Ball / Acorn Tracker Ball */
device.option_add("usersplit", BBC_USERSPLIT); /*User Port Splitter (Watford Electronics) */
+ //device.option_add("vci", BBC_VCI); /* Video Camera Interface (Data Harvest) */
+ device.option_add("voicebox", BBC_VOICEBOX); /* Robin Voice Box */
//device.option_add("music4000", BBC_MUSIC4000); /* Hybrid Music 4000 Keyboard */
- device.option_add("cfa3000kbd", CFA3000_KBD); /* Henson CFA 3000 Keyboard */
+ device.option_add_internal("cfa3000kbd", CFA3000_KBD);/* Henson CFA 3000 Keyboard */
}
diff --git a/src/devices/bus/bbc/userport/voicebox.cpp b/src/devices/bus/bbc/userport/voicebox.cpp
new file mode 100644
index 00000000000..650fca4aa61
--- /dev/null
+++ b/src/devices/bus/bbc/userport/voicebox.cpp
@@ -0,0 +1,91 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Robin Voice Box - The Educational Software Company
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "voicebox.h"
+#include "speaker.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(BBC_VOICEBOX, bbc_voicebox_device, "bbc_voicebox", "Robin Voice Box")
+
+
+ROM_START(voicebox)
+ ROM_REGION(0x10000, "sp0256", 0)
+ ROM_LOAD("sp0256a-al2.bin", 0x1000, 0x0800, CRC(b504ac15) SHA1(e60fcb5fa16ff3f3b69d36c7a6e955744d3feafc))
+ROM_END
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const tiny_rom_entry *bbc_voicebox_device::device_rom_region() const
+{
+ return ROM_NAME(voicebox);
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void bbc_voicebox_device::device_add_mconfig(machine_config &config)
+{
+ SPEAKER(config, "mono").front_center();
+ SP0256(config, m_nsp, 3120000); // TODO: unknown crystal
+ m_nsp->data_request_callback().set(FUNC(bbc_voicebox_device::cb1_w));
+ m_nsp->standby_callback().set(FUNC(bbc_voicebox_device::cb2_w));
+ m_nsp->add_route(ALL_OUTPUTS, "mono", 1.0);
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// bbc_voicebox_device - constructor
+//-------------------------------------------------
+
+bbc_voicebox_device::bbc_voicebox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, BBC_VOICEBOX, tag, owner, clock)
+ , device_bbc_userport_interface(mconfig, *this)
+ , m_nsp(*this, "sp0256")
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void bbc_voicebox_device::device_start()
+{
+}
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+void bbc_voicebox_device::pb_w(uint8_t data)
+{
+ m_nsp->ald_w(data & 0x3f);
+}
+
+WRITE_LINE_MEMBER(bbc_voicebox_device::cb1_w)
+{
+ m_slot->cb1_w(state);
+}
+
+WRITE_LINE_MEMBER(bbc_voicebox_device::cb2_w)
+{
+ m_slot->cb2_w(state);
+}
diff --git a/src/devices/bus/bbc/userport/voicebox.h b/src/devices/bus/bbc/userport/voicebox.h
new file mode 100644
index 00000000000..b48290e2a2a
--- /dev/null
+++ b/src/devices/bus/bbc/userport/voicebox.h
@@ -0,0 +1,52 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Robin Voice Box - The Educational Software Company
+
+**********************************************************************/
+
+#ifndef MAME_BUS_BBC_USERPORT_VOICEBOX_H
+#define MAME_BUS_BBC_USERPORT_VOICEBOX_H
+
+#include "userport.h"
+#include "sound/sp0256.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> bbc_voicebox_device
+
+class bbc_voicebox_device :
+ public device_t,
+ public device_bbc_userport_interface
+{
+public:
+ // construction/destruction
+ bbc_voicebox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ DECLARE_WRITE_LINE_MEMBER(cb1_w);
+ DECLARE_WRITE_LINE_MEMBER(cb2_w);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+
+ virtual void pb_w(uint8_t data) override;
+
+private:
+ required_device<sp0256_device> m_nsp;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(BBC_VOICEBOX, bbc_voicebox_device)
+
+
+#endif // MAME_BUS_BBC_USERPORT_VOICEBOX_H
diff --git a/src/devices/bus/electron/cart/slot.cpp b/src/devices/bus/electron/cart/slot.cpp
index 5cc48bad238..dfb915db375 100644
--- a/src/devices/bus/electron/cart/slot.cpp
+++ b/src/devices/bus/electron/cart/slot.cpp
@@ -89,8 +89,8 @@ void device_electron_cart_interface::nvram_alloc(uint32_t size)
//-------------------------------------------------
// electron_cartslot_device - constructor
//-------------------------------------------------
-electron_cartslot_device::electron_cartslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, ELECTRON_CARTSLOT, tag, owner, clock),
+electron_cartslot_device::electron_cartslot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, type, tag, owner, clock),
device_image_interface(mconfig, *this),
device_single_card_slot_interface<device_electron_cart_interface>(mconfig, *this),
m_cart(nullptr),
@@ -99,6 +99,11 @@ electron_cartslot_device::electron_cartslot_device(const machine_config &mconfig
{
}
+electron_cartslot_device::electron_cartslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ electron_cartslot_device(mconfig, ELECTRON_CARTSLOT, tag, owner, clock)
+{
+}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/devices/bus/electron/cart/slot.h b/src/devices/bus/electron/cart/slot.h
index e0fc2666136..4cbf3d00ee0 100644
--- a/src/devices/bus/electron/cart/slot.h
+++ b/src/devices/bus/electron/cart/slot.h
@@ -157,6 +157,8 @@ public:
virtual uint8_t read(offs_t offset, int infc, int infd, int romqa, int oe, int oe2);
virtual void write(offs_t offset, uint8_t data, int infc, int infd, int romqa, int oe, int oe2);
+ virtual bool present() { return is_loaded() || loaded_through_softlist(); }
+
DECLARE_WRITE_LINE_MEMBER(irq_w) { m_irq_handler(state); }
DECLARE_WRITE_LINE_MEMBER(nmi_w) { m_nmi_handler(state); }
@@ -164,6 +166,8 @@ protected:
// device-level overrides
virtual void device_start() override;
+ electron_cartslot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
device_electron_cart_interface *m_cart;
private:
diff --git a/src/devices/bus/electron/exp.cpp b/src/devices/bus/electron/exp.cpp
index 8c6c4644b45..9676e02e959 100644
--- a/src/devices/bus/electron/exp.cpp
+++ b/src/devices/bus/electron/exp.cpp
@@ -109,12 +109,14 @@ void electron_expansion_slot_device::expbus_w(offs_t offset, uint8_t data)
#include "fbjoy.h"
//#include "fbprint.h"
//#include "jafamode7.h"
+//#include "lebox.h"
#include "plus1.h"
#include "plus2.h"
#include "plus3.h"
#include "pwrjoy.h"
#include "rombox.h"
#include "romboxp.h"
+#include "sidewndr.h"
#include "m2105.h"
//#include "voxbox.h"
@@ -124,12 +126,14 @@ void electron_expansion_devices(device_slot_interface &device)
device.option_add("fbjoy", ELECTRON_FBJOY);
//device.option_add("fbprint", ELECTRON_FBPRINT);
//device.option_add("jafamode7", ELECTRON_JAFAMODE7);
+ //device.option_add("lebox", ELECTRON_LEBOX);
device.option_add("plus1", ELECTRON_PLUS1);
device.option_add("plus2", ELECTRON_PLUS2);
device.option_add("plus3", ELECTRON_PLUS3);
device.option_add("pwrjoy", ELECTRON_PWRJOY);
device.option_add("rombox", ELECTRON_ROMBOX);
device.option_add("romboxp", ELECTRON_ROMBOXP);
+ device.option_add("sidewndr", ELECTRON_SIDEWNDR);
device.option_add("m2105", ELECTRON_M2105);
//device.option_add("voxbox", ELECTRON_VOXBOX);
}
diff --git a/src/devices/bus/electron/sidewndr.cpp b/src/devices/bus/electron/sidewndr.cpp
new file mode 100644
index 00000000000..e66ac800f3c
--- /dev/null
+++ b/src/devices/bus/electron/sidewndr.cpp
@@ -0,0 +1,189 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Wizard Sidewinder Rom Expansion Board
+
+ TODO: Fire button doesn't seem to be recognised.
+
+**********************************************************************/
+
+
+#include "emu.h"
+#include "sidewndr.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(ELECTRON_SIDEWNDR, electron_sidewndr_device, "electron_sidewndr", "Wizard Sidewinder Rom Expansion Board")
+
+//-------------------------------------------------
+// ROM( sidewndr )
+//-------------------------------------------------
+
+ROM_START( sidewndr )
+ ROM_REGION(0x2000, "exp_rom", 0)
+ ROM_LOAD("joyrom.rom", 0x0000, 0x2000, CRC(a7320cda) SHA1(771664dbf23bb14febeb414a0272762cd6091ead))
+ROM_END
+
+//-------------------------------------------------
+// INPUT_PORTS( sidewndr )
+//-------------------------------------------------
+
+static INPUT_PORTS_START( sidewndr )
+ PORT_START("JOY")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_8WAY
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_8WAY
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_8WAY
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_8WAY
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Fire")
+ PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
+INPUT_PORTS_END
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor electron_sidewndr_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( sidewndr );
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void electron_sidewndr_device::device_add_mconfig(machine_config &config)
+{
+ /* rom sockets */
+ GENERIC_SOCKET(config, m_rom[0], generic_plain_slot, "electron_rom", "bin,rom"); // ROM SLOT 6
+ m_rom[0]->set_device_load(FUNC(electron_sidewndr_device::rom1_load));
+ GENERIC_SOCKET(config, m_rom[1], generic_plain_slot, "electron_rom", "bin,rom"); // ROM SLOT 7
+ m_rom[1]->set_device_load(FUNC(electron_sidewndr_device::rom2_load));
+ GENERIC_SOCKET(config, m_rom[2], generic_plain_slot, "electron_rom", "bin,rom"); // ROM SLOT 8
+ m_rom[2]->set_device_load(FUNC(electron_sidewndr_device::rom3_load));
+
+ /* pass-through */
+ ELECTRON_EXPANSION_SLOT(config, m_exp, DERIVED_CLOCK(1, 1), electron_expansion_devices, nullptr);
+ m_exp->irq_handler().set(DEVICE_SELF_OWNER, FUNC(electron_expansion_slot_device::irq_w));
+ m_exp->nmi_handler().set(DEVICE_SELF_OWNER, FUNC(electron_expansion_slot_device::nmi_w));
+}
+
+const tiny_rom_entry *electron_sidewndr_device::device_rom_region() const
+{
+ return ROM_NAME( sidewndr );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// electron_sidewndr_device - constructor
+//-------------------------------------------------
+
+electron_sidewndr_device::electron_sidewndr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, ELECTRON_SIDEWNDR, tag, owner, clock)
+ , device_electron_expansion_interface(mconfig, *this)
+ , m_exp(*this, "exp")
+ , m_exp_rom(*this, "exp_rom")
+ , m_rom(*this, "rom%u", 1)
+ , m_joy(*this, "JOY")
+ , m_romsel(0)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void electron_sidewndr_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// expbus_r - expansion data read
+//-------------------------------------------------
+
+uint8_t electron_sidewndr_device::expbus_r(offs_t offset)
+{
+ uint8_t data = 0xff;
+
+ switch (offset >> 12)
+ {
+ case 0x8: case 0x9: case 0xa: case 0xb:
+ switch (m_romsel)
+ {
+ case 5:
+ data = m_exp_rom->base()[offset & 0x0fff];
+ break;
+ case 6:
+ case 7:
+ case 8:
+ data = m_rom[m_romsel - 6]->read_rom(offset & 0x3fff);
+ break;
+ }
+ break;
+
+ case 0xf:
+ switch (offset >> 8)
+ {
+ case 0xfc:
+ if (offset == 0xfc05)
+ {
+ data = m_joy->read();
+ }
+ break;
+
+ case 0xfd:
+ data = m_exp_rom->base()[offset & 0x1dff];
+ break;
+ }
+ break;
+ }
+
+ data &= m_exp->expbus_r(offset);
+
+ return data;
+}
+
+//-------------------------------------------------
+// expbus_w - expansion data write
+//-------------------------------------------------
+
+void electron_sidewndr_device::expbus_w(offs_t offset, uint8_t data)
+{
+ m_exp->expbus_w(offset, data);
+
+ if (offset == 0xfe05)
+ {
+ m_romsel = data & 0x0f;
+ }
+}
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+image_init_result electron_sidewndr_device::load_rom(device_image_interface &image, generic_slot_device *slot)
+{
+ uint32_t size = slot->common_get_size("rom");
+
+ // socket accepts 8K and 16K ROM only
+ if (size != 0x2000 && size != 0x4000)
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size: Only 8K/16K is supported");
+ return image_init_result::FAIL;
+ }
+
+ slot->rom_alloc(0x4000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
+ slot->common_load_rom(slot->get_rom_base(), size, "rom");
+
+ // mirror 8K ROMs
+ uint8_t *crt = slot->get_rom_base();
+ if (size <= 0x2000) memcpy(crt + 0x2000, crt, 0x2000);
+
+ return image_init_result::PASS;
+}
diff --git a/src/devices/bus/electron/sidewndr.h b/src/devices/bus/electron/sidewndr.h
new file mode 100644
index 00000000000..2e1dea53087
--- /dev/null
+++ b/src/devices/bus/electron/sidewndr.h
@@ -0,0 +1,60 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/**********************************************************************
+
+ Wizard Sidewinder Rom Expansion Board
+
+**********************************************************************/
+
+
+#ifndef MAME_BUS_ELECTRON_SIDEWNDR_H
+#define MAME_BUS_ELECTRON_SIDEWNDR_H
+
+#include "exp.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class electron_sidewndr_device:
+ public device_t,
+ public device_electron_expansion_interface
+{
+public:
+ // construction/destruction
+ electron_sidewndr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual uint8_t expbus_r(offs_t offset) override;
+ virtual void expbus_w(offs_t offset, uint8_t data) override;
+
+private:
+ image_init_result load_rom(device_image_interface &image, generic_slot_device *slot);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_rom[0]); }
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_rom[1]); }
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom3_load) { return load_rom(image, m_rom[2]); }
+
+ required_device<electron_expansion_slot_device> m_exp;
+ required_memory_region m_exp_rom;
+ required_device_array<generic_slot_device, 3> m_rom;
+ required_ioport m_joy;
+
+ uint8_t m_romsel;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(ELECTRON_SIDEWNDR, electron_sidewndr_device)
+
+
+#endif /* MAME_BUS_ELECTRON_SIDEWNDR_H */
diff --git a/src/devices/bus/hp80_optroms/hp80_optrom.cpp b/src/devices/bus/hp80_optroms/hp80_optrom.cpp
deleted file mode 100644
index ab6dec10a53..00000000000
--- a/src/devices/bus/hp80_optroms/hp80_optrom.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders: F. Ulivi
-/*********************************************************************
-
- hp80_optrom.cpp
-
- Optional ROMs for HP80 systems
-
-*********************************************************************/
-
-#include "emu.h"
-#include "hp80_optrom.h"
-#include "softlist.h"
-
-// Debugging
-#define VERBOSE 1
-#include "logmacro.h"
-
-DEFINE_DEVICE_TYPE(HP80_OPTROM_CART, hp80_optrom_cart_device, "hp80_optrom_cart", "HP80 optional ROM cartridge")
-DEFINE_DEVICE_TYPE(HP80_OPTROM_SLOT, hp80_optrom_slot_device, "hp80_optrom_slot", "HP80 optional ROM slot")
-
-// +----------------------------+
-// |device_hp80_optrom_interface|
-// +----------------------------+
-device_hp80_optrom_interface::device_hp80_optrom_interface(const machine_config &config, device_t &device) :
- device_interface(device, "hp80optrom")
-{
-}
-
-// +-----------------------+
-// |hp80_optrom_cart_device|
-// +-----------------------+
-hp80_optrom_cart_device::hp80_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, type, tag, owner, clock),
- device_hp80_optrom_interface(mconfig, *this)
-{
-}
-
-hp80_optrom_cart_device::hp80_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- hp80_optrom_cart_device(mconfig, HP80_OPTROM_CART, tag, owner, clock)
-{
-}
-
-// +-----------------------+
-// |hp80_optrom_slot_device|
-// +-----------------------+
-hp80_optrom_slot_device::hp80_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, HP80_OPTROM_SLOT, tag, owner, clock),
- device_image_interface(mconfig, *this),
- device_single_card_slot_interface<device_hp80_optrom_interface>(mconfig, *this),
- m_cart(nullptr),
- m_select_code(0)
-{
-}
-
-hp80_optrom_slot_device::~hp80_optrom_slot_device()
-{
-}
-
-void hp80_optrom_slot_device::install_read_handler(address_space& space)
-{
- if (loaded_through_softlist()) {
- offs_t start = (offs_t)m_select_code * HP80_OPTROM_SIZE;
- space.install_rom(start , start + HP80_OPTROM_SIZE - 1 , get_software_region("rom"));
- }
-}
-
-void hp80_optrom_slot_device::device_start()
-{
- m_cart = get_card_device();
-}
-
-image_init_result hp80_optrom_slot_device::call_load()
-{
- LOG("hp80_optrom: call_load\n");
- if (m_cart == nullptr || !loaded_through_softlist()) {
- LOG("hp80_optrom: must be loaded from sw list\n");
- return image_init_result::FAIL;
- }
-
- const char *sc_feature = get_feature("sc");
- if (sc_feature == nullptr) {
- LOG("hp80_optrom: no 'sc' feature\n");
- return image_init_result::FAIL;
- }
-
- unsigned sc;
- if (sc_feature[ 0 ] != '0' || sc_feature[ 1 ] != 'x' || sscanf(&sc_feature[ 2 ] , "%x" , &sc) != 1) {
- LOG("hp80_optrom: can't parse 'sc' feature\n");
- return image_init_result::FAIL;
- }
-
- // Valid SC values: 0x01..0xff
- if (sc < 1 || sc > 0xff) {
- LOG("hp80_optrom: illegal select code (%x)\n" , sc);
- return image_init_result::FAIL;
- }
-
- auto length = get_software_region_length("rom");
-
- if (length != HP80_OPTROM_SIZE) {
- LOG("hp80_optrom: illegal region length (%x)\n" , length);
- return image_init_result::FAIL;
- }
-
- LOG("hp80_optrom: loaded SC=0x%02x\n" , sc);
- m_select_code = sc;
- return image_init_result::PASS;
-}
-
-void hp80_optrom_slot_device::call_unload()
-{
- LOG("hp80_optrom: call_unload\n");
- machine().schedule_soft_reset();
-}
-
-std::string hp80_optrom_slot_device::get_default_card_software(get_default_card_software_hook &hook) const
-{
- return software_get_default_slot("rom");
-}
-
-void hp80_optrom_slot_devices(device_slot_interface &device)
-{
- device.option_add_internal("rom", HP80_OPTROM_CART);
-}
diff --git a/src/devices/bus/hp80_optroms/hp80_optrom.h b/src/devices/bus/hp80_optroms/hp80_optrom.h
deleted file mode 100644
index 267e3110290..00000000000
--- a/src/devices/bus/hp80_optroms/hp80_optrom.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders: F. Ulivi
-/*********************************************************************
-
- hp80_optrom.h
-
- Optional ROMs for HP80 systems
-
-*********************************************************************/
-
-#ifndef MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
-#define MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
-
-#pragma once
-
-#include "softlist_dev.h"
-
-// Size of optional ROMs (8k)
-static constexpr offs_t HP80_OPTROM_SIZE = 0x2000;
-
-void hp80_optrom_slot_devices(device_slot_interface &device);
-
-class device_hp80_optrom_interface : public device_interface
-{
-protected:
- device_hp80_optrom_interface(const machine_config &mconfig, device_t &device);
-};
-
-class hp80_optrom_cart_device : public device_t, public device_hp80_optrom_interface
-{
-public:
- // construction/destruction
- hp80_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
-protected:
- hp80_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override { }
-};
-
-class hp80_optrom_slot_device : public device_t,
- public device_image_interface,
- public device_single_card_slot_interface<device_hp80_optrom_interface>
-{
-public:
- // construction/destruction
- hp80_optrom_slot_device(machine_config const &mconfig, char const *tag, device_t *owner)
- : hp80_optrom_slot_device(mconfig, tag, owner, (uint32_t)0)
- {
- option_reset();
- hp80_optrom_slot_devices(*this);
- set_default_option(nullptr);
- set_fixed(false);
- }
-
- hp80_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- virtual ~hp80_optrom_slot_device();
-
- void install_read_handler(address_space& space);
-
-protected:
- // device-level overrides
- virtual void device_start() override;
-
- // image-level overrides
- virtual image_init_result call_load() override;
- virtual void call_unload() override;
- virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
-
- virtual iodevice_t image_type() const override { return IO_ROM; }
- virtual bool is_readable() const override { return true; }
- virtual bool is_writeable() const override { return false; }
- virtual bool is_creatable() const override { return false; }
- virtual bool must_be_loaded() const override { return false; }
- virtual bool is_reset_on_load() const override { return true; }
- virtual const char *image_interface() const override { return "hp80_rom"; }
- virtual const char *file_extensions() const override { return "bin"; }
-
- // slot interface overrides
- virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
-
- device_hp80_optrom_interface *m_cart;
- uint8_t m_select_code;
-};
-
-// device type definition
-DECLARE_DEVICE_TYPE(HP80_OPTROM_SLOT, hp80_optrom_slot_device)
-DECLARE_DEVICE_TYPE(HP80_OPTROM_CART, hp80_optrom_cart_device)
-
-#endif // MAME_BUS_HP80_OPTROMS_HP80_OPTROM_H
diff --git a/src/devices/bus/hp_optroms/hp_optrom.cpp b/src/devices/bus/hp_optroms/hp_optrom.cpp
deleted file mode 100644
index 5c19c089111..00000000000
--- a/src/devices/bus/hp_optroms/hp_optrom.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders: F. Ulivi
-/*********************************************************************
-
- hp_optrom.cpp
-
- Optional ROMs for HP9845 systems
-
-*********************************************************************/
-
-#include "emu.h"
-#include "hp_optrom.h"
-#include "softlist.h"
-#include "cpu/hphybrid/hphybrid.h"
-
-DEFINE_DEVICE_TYPE(HP_OPTROM_CART, hp_optrom_cart_device, "hp_optrom_cart", "HP9845 optional ROM cartridge")
-DEFINE_DEVICE_TYPE(HP_OPTROM_SLOT, hp_optrom_slot_device, "hp_optrom_slot", "HP9845 optional ROM slot")
-
-// +--------------------------+
-// |device_hp_optrom_interface|
-// +--------------------------+
-device_hp_optrom_interface::device_hp_optrom_interface(const machine_config &config, device_t &device) :
- device_interface(device, "hpoptrom")
-{
-}
-
-// +---------------------+
-// |hp_optrom_cart_device|
-// +---------------------+
-hp_optrom_cart_device::hp_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, type, tag, owner, clock),
- device_hp_optrom_interface(mconfig, *this)
-{
-}
-
-hp_optrom_cart_device::hp_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- hp_optrom_cart_device(mconfig, HP_OPTROM_CART, tag, owner, clock)
-{
-}
-
-// +---------------------+
-// |hp_optrom_slot_device|
-// +---------------------+
-hp_optrom_slot_device::hp_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, HP_OPTROM_SLOT, tag, owner, clock),
- device_image_interface(mconfig, *this),
- device_single_card_slot_interface<device_hp_optrom_interface>(mconfig, *this),
- m_cart(nullptr),
- m_base_addr(0),
- m_end_addr(0)
-{
- option_reset();
- option_add_internal("rom", HP_OPTROM_CART);
- set_default_option(nullptr);
- set_fixed(false);
-}
-
-hp_optrom_slot_device::~hp_optrom_slot_device()
-{
-}
-
-void hp_optrom_slot_device::device_start()
-{
- m_cart = get_card_device();
-}
-
-image_init_result hp_optrom_slot_device::call_load()
-{
- logerror("hp_optrom: call_load\n");
- if (m_cart == nullptr || !loaded_through_softlist()) {
- logerror("hp_optrom: must be loaded from sw list\n");
- return image_init_result::FAIL;
- }
-
- const char *base_feature = get_feature("base");
- if (base_feature == nullptr) {
- logerror("hp_optrom: no 'base' feature\n");
- return image_init_result::FAIL;
- }
-
- offs_t base_addr;
- if (base_feature[ 0 ] != '0' || base_feature[ 1 ] != 'x' || sscanf(&base_feature[ 2 ] , "%x" , &base_addr) != 1) {
- logerror("hp_optrom: can't parse 'base' feature\n");
- return image_init_result::FAIL;
- }
-
- // Valid BSC values for ROMs on LPU drawer: 0x07 0x0b .... 0x3b
- // Valid BSC values for ROMs on PPU drawer: 0x09 0x0d .... 0x3d
- // (BSC is field in bits 16..21 of base address)
- // Bit 15 of base address must be 0
- // Base address must be multiple of 0x1000
- if ((base_addr & ~0x3f7000UL) != 0 || ((base_addr & 0x30000) != 0x10000 && (base_addr & 0x30000) != 0x30000) || base_addr < 0x70000) {
- logerror("hp_optrom: illegal base address (%x)\n" , base_addr);
- return image_init_result::FAIL;
- }
-
- auto length = get_software_region_length("rom") / 2;
-
- if (length < 0x1000 || length > 0x8000 || (length & 0xfff) != 0 || ((base_addr & 0x7000) + length) > 0x8000) {
- logerror("hp_optrom: illegal region length (%x)\n" , length);
- return image_init_result::FAIL;
- }
-
- offs_t end_addr = base_addr + length - 1;
- logerror("hp_optrom: base_addr = %06x end_addr = %06x\n" , base_addr , end_addr);
-
- m_content.resize(length * 2);
- uint8_t *buffer = m_content.data();
- memcpy(buffer , get_software_region("rom") , length * 2);
-
- // Install ROM in address space of every CPU
- for (hp_hybrid_cpu_device& cpu : device_interface_iterator<hp_hybrid_cpu_device>(machine().root_device())) {
- logerror("hp_optrom: install in %s AS\n" , cpu.tag());
- cpu.space(AS_PROGRAM).install_rom(base_addr , end_addr , buffer);
- }
-
- m_base_addr = base_addr;
- m_end_addr = end_addr;
-
- return image_init_result::PASS;
-}
-
-void hp_optrom_slot_device::call_unload()
-{
- logerror("hp_optrom: call_unload\n");
- if (m_cart != nullptr && m_base_addr != 0 && m_end_addr != 0) {
- for (hp_hybrid_cpu_device& cpu : device_interface_iterator<hp_hybrid_cpu_device>(machine().root_device())) {
- cpu.space(AS_PROGRAM).unmap_read(m_base_addr , m_end_addr);
- }
- m_content.resize(0);
- m_base_addr = 0;
- m_end_addr = 0;
- }
-}
-
-std::string hp_optrom_slot_device::get_default_card_software(get_default_card_software_hook &hook) const
-{
- return software_get_default_slot("rom");
-}
diff --git a/src/devices/bus/hp_optroms/hp_optrom.h b/src/devices/bus/hp_optroms/hp_optrom.h
deleted file mode 100644
index 67b85cfc9aa..00000000000
--- a/src/devices/bus/hp_optroms/hp_optrom.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders: F. Ulivi
-/*********************************************************************
-
- hp_optrom.h
-
- Optional ROMs for HP9845 systems
-
-*********************************************************************/
-
-#ifndef MAME_BUS_HP_OPTROMS_HP_OPTROM_H
-#define MAME_BUS_HP_OPTROMS_HP_OPTROM_H
-
-#pragma once
-
-#include "softlist_dev.h"
-
-
-class device_hp_optrom_interface : public device_interface
-{
-protected:
- device_hp_optrom_interface(const machine_config &mconfig, device_t &device);
-};
-
-class hp_optrom_cart_device : public device_t, public device_hp_optrom_interface
-{
-public:
- // construction/destruction
- hp_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
-protected:
- hp_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override { }
-};
-
-class hp_optrom_slot_device : public device_t,
- public device_image_interface,
- public device_single_card_slot_interface<device_hp_optrom_interface>
-{
-public:
- // construction/destruction
- hp_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- virtual ~hp_optrom_slot_device();
-
-protected:
- // device-level overrides
- virtual void device_start() override;
-
- // image-level overrides
- virtual image_init_result call_load() override;
- virtual void call_unload() override;
- virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
-
- virtual iodevice_t image_type() const override { return IO_ROM; }
- virtual bool is_readable() const override { return true; }
- virtual bool is_writeable() const override { return false; }
- virtual bool is_creatable() const override { return false; }
- virtual bool must_be_loaded() const override { return false; }
- virtual bool is_reset_on_load() const override { return true; }
- virtual const char *image_interface() const override { return "hp9845b_rom"; }
- virtual const char *file_extensions() const override { return "bin"; }
-
- // slot interface overrides
- virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
-
- device_hp_optrom_interface *m_cart;
- std::vector<uint8_t> m_content;
- offs_t m_base_addr;
- offs_t m_end_addr;
-};
-
-// device type definition
-DECLARE_DEVICE_TYPE(HP_OPTROM_SLOT, hp_optrom_slot_device)
-DECLARE_DEVICE_TYPE(HP_OPTROM_CART, hp_optrom_cart_device)
-
-#endif // MAME_BUS_HP_OPTROMS_HP_OPTROM_H
diff --git a/src/devices/bus/spectrum/kempjoy.cpp b/src/devices/bus/spectrum/kempjoy.cpp
index a433d615e8c..a09583d3a3e 100644
--- a/src/devices/bus/spectrum/kempjoy.cpp
+++ b/src/devices/bus/spectrum/kempjoy.cpp
@@ -73,7 +73,7 @@ uint8_t spectrum_kempjoy_device::iorq_r(offs_t offset)
{
uint8_t data = 0xff;
- if (offset == 0x1f)
+ if ((offset & 0x00ff) == 0x1f)
{
data = m_joy->read() & 0x1f;
}
diff --git a/src/devices/bus/spectrum/melodik.cpp b/src/devices/bus/spectrum/melodik.cpp
index 9a6f743a65b..780d74c3485 100644
--- a/src/devices/bus/spectrum/melodik.cpp
+++ b/src/devices/bus/spectrum/melodik.cpp
@@ -108,10 +108,10 @@ void spectrum_melodik_device::iorq_w(offs_t offset, uint8_t data)
switch (offset & 0xc002)
{
case 0x8000:
- m_psg->address_w(data);
+ m_psg->data_w(data);
break;
case 0xc000:
- m_psg->data_w(data);
+ m_psg->address_w(data);
break;
}
m_exp->iorq_w(offset, data);
diff --git a/src/devices/bus/spectrum/mikroplus.cpp b/src/devices/bus/spectrum/mikroplus.cpp
index 87552f79bf3..04ce942c632 100644
--- a/src/devices/bus/spectrum/mikroplus.cpp
+++ b/src/devices/bus/spectrum/mikroplus.cpp
@@ -93,7 +93,7 @@ uint8_t spectrum_mikroplus_device::iorq_r(offs_t offset)
{
uint8_t data = 0xff;
- if (offset == 0xdf)
+ if ((offset & 0xff) == 0xdf)
{
data = m_joy->read() | (0xff ^ 0x1f);
}
diff --git a/src/devices/bus/ss50/dc5.cpp b/src/devices/bus/ss50/dc5.cpp
index 149e99967ed..14f47896fe6 100644
--- a/src/devices/bus/ss50/dc5.cpp
+++ b/src/devices/bus/ss50/dc5.cpp
@@ -44,17 +44,20 @@ public:
, m_floppy1(*this, "fdc:1")
, m_floppy2(*this, "fdc:2")
, m_floppy3(*this, "fdc:3")
- , m_interrupt_select(*this, "interrupt_select")
- , m_address_mode(*this, "address_mode")
- , m_two_control_regs(*this, "two_control_regs")
- , m_ctrl_reg_bit7_side_select(*this, "ctrl_reg_bit7_side_select")
- , m_expected_clock(*this, "expected_clock")
- , m_expected_density(*this, "expected_density")
- , m_expected_sectors(*this, "expected_sectors")
- , m_track_zero_expected_sectors(*this, "track_zero_expected_sectors")
+ , m_interrupt_select(*this, "INTERRUPT_SELECT")
+ , m_address_mode(*this, "ADDRESS_MODE")
+ , m_two_control_regs(*this, "TWO_CONTROL_REGS")
+ , m_ctrl_reg_bit7_side_select(*this, "CTRL_REG_BIT7_SIDE_SELECT")
+ , m_expected_clock(*this, "EXPECTED_CLOCK")
+ , m_expected_density(*this, "EXPECTED_DENSITY")
+ , m_expected_sectors(*this, "EXPECTED_SECTORS")
+ , m_track_zero_expected_sectors(*this, "TRACK_ZERO_EXPECTED_SECTORS")
{
}
+ DECLARE_INPUT_CHANGED_MEMBER(ctrl_reg_bit7_side_select_change);
+ DECLARE_INPUT_CHANGED_MEMBER(expected_clock_change);
+
protected:
virtual ioport_constructor device_input_ports() const override;
virtual void device_add_mconfig(machine_config &config) override;
@@ -75,8 +78,9 @@ private:
uint8_t m_motor_timer_out;
emu_timer *m_floppy_motor_timer;
floppy_image_device *m_fdc_selected_floppy; // Current selected floppy.
- uint8_t m_fdc_side; // Current floppy side.
- uint32_t m_fdc_clock; // Current clock frequency.
+ uint8_t m_fdc_side; // Current floppy side.
+ uint8_t m_fdc_clock_div; // Current clock frequency divisor.
+ uint8_t m_fdc_prog_clock_div; // Programmed clock frequency divisor.
TIMER_CALLBACK_MEMBER(floppy_motor_callback);
@@ -104,18 +108,18 @@ private:
static INPUT_PORTS_START( dc5 )
- PORT_START("interrupt_select")
+ PORT_START("INTERRUPT_SELECT")
PORT_DIPNAME(0xf, 0, "Interrupt select")
PORT_DIPSETTING(0, "N/C")
PORT_DIPSETTING(1, "IRQ")
PORT_DIPSETTING(2, "NMI/FIRQ")
- PORT_START("address_mode")
+ PORT_START("ADDRESS_MODE")
PORT_DIPNAME(0xf, 1, "Address mode")
PORT_DIPSETTING(0, "4 address")
PORT_DIPSETTING(1, "16 address")
- PORT_START("two_control_regs")
+ PORT_START("TWO_CONTROL_REGS")
PORT_DIPNAME(0xf, 0, "Two control registers")
PORT_DIPSETTING(0, "No, DC4 compatible")
PORT_DIPSETTING(1, "Yes, DC5 extension")
@@ -131,8 +135,8 @@ static INPUT_PORTS_START( dc5 )
// 3.5" 'standard' - 1.2MHz
// 3.5" HD - 2.0MHz
// 8" 360rpm - 2.4MHz
- PORT_START("expected_clock")
- PORT_CONFNAME(0xf, 0, "FDC expected clock rate")
+ PORT_START("EXPECTED_CLOCK")
+ PORT_CONFNAME(0xf, 0, "FDC expected clock rate") PORT_CHANGED_MEMBER(DEVICE_SELF, ss50_dc5_device, expected_clock_change, 0)
PORT_CONFSETTING(0, "-")
PORT_CONFSETTING(12, "1.0 MHz")
PORT_CONFSETTING(10, "1.2 MHz")
@@ -144,8 +148,8 @@ static INPUT_PORTS_START( dc5 )
// earlier controllers in this series, which use bit 7 to inhibit
// drive selection. These drivers need to be corrected, but this
// option helps identify this issue and work around it.
- PORT_START("ctrl_reg_bit7_side_select")
- PORT_CONFNAME(0x01, 0, "Control register bit 7")
+ PORT_START("CTRL_REG_BIT7_SIDE_SELECT")
+ PORT_CONFNAME(0x01, 0, "Control register bit 7") PORT_CHANGED_MEMBER(DEVICE_SELF, ss50_dc5_device, ctrl_reg_bit7_side_select_change, 0)
PORT_CONFSETTING(0, "Inhibits drive selection")
PORT_CONFSETTING(1, "Erroneous side select")
@@ -154,7 +158,7 @@ static INPUT_PORTS_START( dc5 )
// purely double density and often without properly implement driver
// support for that. This setting is an aid to report unexpected
// usage, and it attempts to correct that.
- PORT_START("expected_density")
+ PORT_START("EXPECTED_DENSITY")
PORT_CONFNAME(0xff, 0, "Expected density")
PORT_CONFSETTING(0, "-")
PORT_CONFSETTING(1, "single density") // Purely single density.
@@ -166,14 +170,14 @@ static INPUT_PORTS_START( dc5 )
// FLEX disk images were developed for vitural machines that have
// little regard for the actual head and can work off the sector ID
// and their drivers can set the head incorrectly. E.g. a disk with 18
- // sectors per side might have a drive set to switch heads for sectors
+ // sectors per side might have a driver switch heads for sectors
// above 10. Another issue is that double density disk images are
// often 'fixed' so that they are pure double density without being
- // single density onthe first track, and the drivers might still set
- // the head based track zero being single density. This aid is not
+ // single density on the first track, and the drivers might still set
+ // the head based on track zero being single density. This aid is not
// intended to be a substitute for fixing the drivers but it does help
// work through the issues while patching the disks.
- PORT_START("expected_sectors")
+ PORT_START("EXPECTED_SECTORS")
PORT_CONFNAME(0xff, 0, "Expected sectors per side")
PORT_CONFSETTING(0, "-")
PORT_CONFSETTING(10, "10") // 5 1/4" single density 256B
@@ -185,7 +189,7 @@ static INPUT_PORTS_START( dc5 )
// 6800 disks did format track zero in single density and if the
// driver sticks to that and if using a double density disk then set a
// single density size here.
- PORT_START("track_zero_expected_sectors")
+ PORT_START("TRACK_ZERO_EXPECTED_SECTORS")
PORT_CONFNAME(0xff, 0, "Track zero expected sectors per side")
PORT_CONFSETTING(0, "-")
PORT_CONFSETTING(10, "10") // 5 1/4" single density 256B
@@ -249,10 +253,11 @@ void ss50_dc5_device::device_add_mconfig(machine_config &config)
void ss50_dc5_device::device_reset()
{
// Initialize to the expected rate if any, otherwise to 1MHz.
- uint32_t clock = m_expected_clock->read();
- clock = (12_MHz_XTAL / (clock ? clock : 12)).value();
- m_fdc->set_unscaled_clock(clock);
- m_fdc_clock = clock;
+ m_fdc_prog_clock_div = 12;
+ uint8_t expected_clock_div = m_expected_clock->read();
+ uint8_t clock_div = expected_clock_div ? expected_clock_div : m_fdc_prog_clock_div;
+ m_fdc->set_unscaled_clock(12_MHz_XTAL / clock_div);
+ m_fdc_clock_div = clock_div;
// The reset state of DDEN for the DC5 is one, so selecting single density.
m_fdc->dden_w(1);
@@ -265,9 +270,29 @@ void ss50_dc5_device::device_start()
m_fdc_side = 0;
m_floppy_motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ss50_dc5_device::floppy_motor_callback),this));
m_motor_timer_out = 0;
+ m_fdc_prog_clock_div = 12;
+
+ save_item(NAME(m_fdc_status));
+ save_item(NAME(m_control_register));
+ save_item(NAME(m_motor_timer_out));
+ save_item(NAME(m_fdc_side));
+ save_item(NAME(m_fdc_clock_div));
+ save_item(NAME(m_fdc_prog_clock_div));
}
+INPUT_CHANGED_MEMBER(ss50_dc5_device::ctrl_reg_bit7_side_select_change)
+{
+ control_register_update();
+}
+
+INPUT_CHANGED_MEMBER(ss50_dc5_device::expected_clock_change)
+{
+ uint8_t clock_div = newval ? newval : m_fdc_prog_clock_div;
+ m_fdc->set_unscaled_clock(12_MHz_XTAL / clock_div);
+ m_fdc_clock_div = clock_div;
+}
+
/* Shared floppy support. */
void ss50_dc5_device::floppy_motor_trigger()
@@ -384,7 +409,7 @@ uint8_t ss50_dc5_device::validate_fdc_sso(uint8_t cmd)
uint32_t two_regs = m_two_control_regs->read();
if (two_regs)
{
- // How if drivers are attempting to use SSO to control the
+ // If drivers are attempting to use SSO to control the
// density then that might need correcting so report such
// usage.
logerror("%s Unexpected SSO flag set in two control registers mode\n", machine().describe_context());
@@ -436,13 +461,9 @@ WRITE_LINE_MEMBER( ss50_dc5_device::fdc_intrq_w )
uint8_t selection = m_interrupt_select->read();
if (selection == 1)
- {
write_irq(state);
- }
else if (selection == 2)
- {
write_firq(state);
- }
}
WRITE_LINE_MEMBER( ss50_dc5_device::fdc_drq_w )
@@ -560,7 +581,7 @@ void ss50_dc5_device::control_register_update()
// the most useful choice because drivers in error are
// most likely just writing to the wrong bit rather
// than inconsistently to both bits. This allows
- // incremental correction of driver while spotting
+ // incremental correction of drivers while spotting
// remaining uses of bit 7 for side selection.
side |= bit7;
}
@@ -594,7 +615,7 @@ uint8_t ss50_dc5_device::register_read(offs_t offset)
uint32_t two_regs = m_two_control_regs->read();
// Note: access to this control register does not trigger the
- // motor on and and does not reset the motor timer.
+ // motor on and does not reset the motor timer.
if (!two_regs || (offset & 2) == 0)
{
@@ -661,7 +682,7 @@ void ss50_dc5_device::register_write(offs_t offset, uint8_t data)
// Osc20 and osc12 control a clock divider.
uint8_t osc12 = BIT(data, 2);
uint8_t osc20 = BIT(data, 3);
- uint32_t clock = 12'000'000 / 12;
+ uint8_t clock_div = 12;
// Note: supporting 2.4MHz is here is an extension to
// the published DC5 design, and appears necessary to
@@ -676,24 +697,28 @@ void ss50_dc5_device::register_write(offs_t offset, uint8_t data)
// 8" drives run at 300rpm; is there an error in the
// rates elsewhere?
if (osc20 && osc12)
- clock = 12'000'000 / 5;
+ clock_div = 5;
else if (osc20)
- clock = 12'000'000 / 6;
+ clock_div = 6;
else if (osc12)
- clock = 12'000'000 / 10;
+ clock_div = 10;
+
+ // Note the programmed clock divisor, in case the
+ // expected changes.
+ m_fdc_prog_clock_div = clock_div;
- // Compare to the expected clock rate if any.
- uint32_t expected_clock = m_expected_clock->read();
- if (expected_clock && clock != 12'000'000 / expected_clock)
+ // Compare to the expected clock divisor if any.
+ uint32_t expected_clock_div = m_expected_clock->read();
+ if (expected_clock_div && clock_div != expected_clock_div)
{
- logerror("%s Unexpected clock rate of %dHz expected %dHz.\n", machine().describe_context(), clock, 12'000'000 / expected_clock);
- clock = expected_clock;
+ logerror("%s Unexpected clock rate of %dHz expected %dHz.\n", machine().describe_context(), 12'000'000 / clock_div, 12'000'000 / expected_clock_div);
+ clock_div = expected_clock_div;
}
- if (clock != m_fdc_clock)
+ if (clock_div != m_fdc_clock_div)
{
- m_fdc->set_unscaled_clock(clock);
- m_fdc_clock = clock;
+ m_fdc->set_unscaled_clock(12_MHz_XTAL / clock_div);
+ m_fdc_clock_div = clock_div;
}
#if 0
diff --git a/src/devices/bus/ss50/mps.cpp b/src/devices/bus/ss50/mps.cpp
index a7ff13a7555..b7e4157812e 100644
--- a/src/devices/bus/ss50/mps.cpp
+++ b/src/devices/bus/ss50/mps.cpp
@@ -32,11 +32,13 @@ public:
{
}
+ DECLARE_INPUT_CHANGED_MEMBER(cts_route_change);
+
protected:
// device-specific overrides
virtual ioport_constructor device_input_ports() const override;
virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override { }
+ virtual void device_start() override;
// interface-specific overrides
virtual u8 register_read(offs_t offset) override;
@@ -49,12 +51,13 @@ protected:
private:
DECLARE_WRITE_LINE_MEMBER(acia_irq_w);
- DECLARE_WRITE_LINE_MEMBER(route_cts_r);
+ DECLARE_WRITE_LINE_MEMBER(route_cts);
required_device<acia6850_device> m_acia;
required_ioport m_irq_jumper;
required_ioport m_rate_jumper;
required_ioport m_cts_route;
+ int m_cts;
};
@@ -73,7 +76,7 @@ static INPUT_PORTS_START( mps )
PORT_CONFSETTING(0x0f, "1200")
PORT_START("CTS_ROUTE")
- PORT_CONFNAME(1, 0, "CTS route")
+ PORT_CONFNAME(1, 0, "CTS route") PORT_CHANGED_MEMBER(DEVICE_SELF, ss50_mps_device, cts_route_change, 0)
PORT_CONFSETTING(0, "Wired low (standard)")
PORT_CONFSETTING(1, "Connected through (modified)")
@@ -114,10 +117,14 @@ void ss50_mps_device::device_add_mconfig(machine_config &config)
rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
rs232.rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd));
- rs232.cts_handler().set(FUNC(ss50_mps_device::route_cts_r));
+ rs232.cts_handler().set(FUNC(ss50_mps_device::route_cts));
rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));
}
+void ss50_mps_device::device_start()
+{
+ save_item(NAME(m_cts));
+}
//-------------------------------------------------
// register_read - read from a port register
@@ -188,12 +195,21 @@ WRITE_LINE_MEMBER(ss50_mps_device::acia_irq_w)
write_irq(state);
}
-WRITE_LINE_MEMBER(ss50_mps_device::route_cts_r)
+WRITE_LINE_MEMBER(ss50_mps_device::route_cts)
{
if (m_cts_route->read())
- {
m_acia->write_cts(state);
- }
+
+ // Cache the state, in case the ioport setting changes.
+ m_cts = state;
+}
+
+INPUT_CHANGED_MEMBER(ss50_mps_device::cts_route_change)
+{
+ if (newval)
+ m_acia->write_cts(m_cts);
+ else
+ m_acia->write_cts(0);
}
// device type definition
diff --git a/src/devices/bus/ss50/mps2.cpp b/src/devices/bus/ss50/mps2.cpp
index 30bdd9e5a64..04e8d0de9ac 100644
--- a/src/devices/bus/ss50/mps2.cpp
+++ b/src/devices/bus/ss50/mps2.cpp
@@ -28,11 +28,11 @@ public:
: device_t(mconfig, SS50_MPS2, tag, owner, clock)
, ss50_card_interface(mconfig, *this)
, m_acia_upper(*this, "acia_upper")
- , m_tx_rate_upper_jumper(*this, "tx_baud_upper")
- , m_rx_rate_upper_jumper(*this, "rx_baud_upper")
+ , m_tx_rate_upper_jumper(*this, "TX_BAUD_UPPER")
+ , m_rx_rate_upper_jumper(*this, "RX_BAUD_UPPER")
, m_acia_lower(*this, "acia_lower")
- , m_tx_rate_lower_jumper(*this, "tx_baud_lower")
- , m_rx_rate_lower_jumper(*this, "rx_baud_lower")
+ , m_tx_rate_lower_jumper(*this, "TX_BAUD_LOWER")
+ , m_rx_rate_lower_jumper(*this, "RX_BAUD_LOWER")
{
}
@@ -62,37 +62,37 @@ private:
static INPUT_PORTS_START( mps2 )
- PORT_START("tx_baud_upper")
+ PORT_START("TX_BAUD_UPPER")
PORT_DIPNAME(0x1f, 0x1d, "Upper TX Baud Rate")
- PORT_DIPSETTING(0x1d, "9600 / 38400")
- PORT_DIPSETTING(0x17, "4800 / 19200")
- PORT_DIPSETTING(0x0f, "1200 / 4800")
- PORT_DIPSETTING(0x1b, "300 / 1200")
PORT_DIPSETTING(0x1e, "110 / 440")
+ PORT_DIPSETTING(0x1b, "300 / 1200")
+ PORT_DIPSETTING(0x0f, "1200 / 4800")
+ PORT_DIPSETTING(0x17, "4800 / 19200")
+ PORT_DIPSETTING(0x1d, "9600 / 38400")
- PORT_START("rx_baud_upper")
+ PORT_START("RX_BAUD_UPPER")
PORT_DIPNAME(0x1f, 0x1d, "Upper RX Baud Rate")
- PORT_DIPSETTING(0x1d, "9600 / 38400")
- PORT_DIPSETTING(0x17, "4800 / 19200")
- PORT_DIPSETTING(0x0f, "1200 / 4800")
- PORT_DIPSETTING(0x1b, "300 / 1200")
PORT_DIPSETTING(0x1e, "110 / 440")
+ PORT_DIPSETTING(0x1b, "300 / 1200")
+ PORT_DIPSETTING(0x0f, "1200 / 4800")
+ PORT_DIPSETTING(0x17, "4800 / 19200")
+ PORT_DIPSETTING(0x1d, "9600 / 38400")
- PORT_START("tx_baud_lower")
+ PORT_START("TX_BAUD_LOWER")
PORT_DIPNAME(0x1f, 0x1d, "Lower TX Baud Rate")
- PORT_DIPSETTING(0x1d, "9600 / 38400")
- PORT_DIPSETTING(0x17, "4800 / 19200")
- PORT_DIPSETTING(0x0f, "1200 / 4800")
- PORT_DIPSETTING(0x1b, "300 / 1200")
PORT_DIPSETTING(0x1e, "110 / 440")
+ PORT_DIPSETTING(0x1b, "300 / 1200")
+ PORT_DIPSETTING(0x0f, "1200 / 4800")
+ PORT_DIPSETTING(0x17, "4800 / 19200")
+ PORT_DIPSETTING(0x1d, "9600 / 38400")
- PORT_START("rx_baud_lower")
+ PORT_START("RX_BAUD_LOWER")
PORT_DIPNAME(0x1f, 0x1d, "Lower RX Baud Rate")
- PORT_DIPSETTING(0x1d, "9600 / 38400")
- PORT_DIPSETTING(0x17, "4800 / 19200")
- PORT_DIPSETTING(0x0f, "1200 / 4800")
- PORT_DIPSETTING(0x1b, "300 / 1200")
PORT_DIPSETTING(0x1e, "110 / 440")
+ PORT_DIPSETTING(0x1b, "300 / 1200")
+ PORT_DIPSETTING(0x0f, "1200 / 4800")
+ PORT_DIPSETTING(0x17, "4800 / 19200")
+ PORT_DIPSETTING(0x1d, "9600 / 38400")
INPUT_PORTS_END
diff --git a/src/devices/bus/ss50/mpt.cpp b/src/devices/bus/ss50/mpt.cpp
index 70ce9d0e3fa..95735b3ae1d 100644
--- a/src/devices/bus/ss50/mpt.cpp
+++ b/src/devices/bus/ss50/mpt.cpp
@@ -21,8 +21,8 @@ public:
: device_t(mconfig, SS50_MPT, tag, owner, clock)
, ss50_card_interface(mconfig, *this)
, m_pia(*this, "pia")
- , m_irqa_jumper(*this, "irqa")
- , m_irqb_jumper(*this, "irqb")
+ , m_irqa_jumper(*this, "IRQA")
+ , m_irqb_jumper(*this, "IRQB")
{
}
@@ -53,12 +53,12 @@ private:
static INPUT_PORTS_START( mpt )
- PORT_START("irqa")
+ PORT_START("IRQA")
PORT_DIPNAME(1, 0, "IRQ-A")
PORT_DIPSETTING(0, DEF_STR(Off))
PORT_DIPSETTING(1, DEF_STR(On))
- PORT_START("irqb")
+ PORT_START("IRQB")
PORT_DIPNAME(1, 1, "IRQ-B")
PORT_DIPSETTING(0, DEF_STR(Off))
PORT_DIPSETTING(1, DEF_STR(On))
@@ -92,6 +92,8 @@ void ss50_mpt_device::device_start()
{
m_mpt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ss50_mpt_device::mpt_timer_callback),this));
m_mpt_timer_state = 0;
+
+ save_item(NAME(m_mpt_timer_state));
}
//-------------------------------------------------
diff --git a/src/devices/bus/ss50/piaide.cpp b/src/devices/bus/ss50/piaide.cpp
index c2b74c6873d..afedc512934 100644
--- a/src/devices/bus/ss50/piaide.cpp
+++ b/src/devices/bus/ss50/piaide.cpp
@@ -60,7 +60,7 @@ public:
protected:
// device-specific overrides
virtual void device_add_mconfig(machine_config &config) override;
- virtual void device_start() override { }
+ virtual void device_start() override;
// interface-specific overrides
virtual uint8_t register_read(offs_t offset) override;
@@ -80,6 +80,12 @@ private:
};
+void ss50_piaide_device::device_start()
+{
+ save_item(NAME(m_pia_porta));
+ save_item(NAME(m_pia_portb));
+}
+
//-------------------------------------------------
// device_add_mconfig - add device-specific
// machine configuration
diff --git a/src/devices/cpu/i86/i86.cpp b/src/devices/cpu/i86/i86.cpp
index c6eca719146..b5af615377a 100644
--- a/src/devices/cpu/i86/i86.cpp
+++ b/src/devices/cpu/i86/i86.cpp
@@ -2531,6 +2531,7 @@ bool i8086_common_cpu_device::common_op(uint8_t op)
CLKM(PUSH_R16,PUSH_M16);
break;
default:
+ m_icount -= 10;
logerror("%06x: FF Pre with unimplemented mod\n", m_pc);
break;
}
diff --git a/src/devices/cpu/m6502/st2204.cpp b/src/devices/cpu/m6502/st2204.cpp
index 3a6c794ba8b..829ff74ac08 100644
--- a/src/devices/cpu/m6502/st2204.cpp
+++ b/src/devices/cpu/m6502/st2204.cpp
@@ -2,6 +2,7 @@
// copyright-holders:AJR
/**********************************************************************
+ Sitronix ST2202 8-Bit Integrated Microcontroller
Sitronix ST2204 8-Bit Integrated Microcontroller
Functional blocks:
@@ -10,18 +11,23 @@
* External bus (up to 7 CS outputs, 48M maximum addressable)
* Timers/event counters with clocking outputs (2 plus base timer)
* Programmable sound generator (2 channels plus DAC)
- * LCD controller (320x240 B/W or 240x160 4-gray)
+ * LCD controller (ST2202: 240x120 B/W, software gray levels)
+ (ST2204: 320x240 B/W or 240x160 4-gray)
* Serial peripheral interface
* UART (built-in BRG; RS-232 and IrDA modes)
* Direct memory access (1 channel)
* Power down modes (WAI-0, WAI-1, STP)
* Watchdog timer
* Low voltage detector
- * 512K ROM (may be disabled)
- * 10K RAM
+ * 256K (ST2202) or 512K (ST2204) ROM (may be disabled)
+ * 4K (ST2202) or 10K (ST2204) RAM
- Emulation is largely based on documentation for the ST2202, which
- has similar though somewhat lesser capabilities.
+ Emulation is largely based on documentation for the ST2202. The
+ ST2204 is believed to be almost entirely backward compatible.
+
+ Two versions of the ST2204 were manufactured: ST2204A, fabricated
+ by TSMC, and ST2204B, fabricated by Hyundai. A PDF document
+ describing the differences between these two was once available.
Reverse-engineered documentation for SS2204's internal registers:
http://blog.kevtris.org/blogfiles/Game%20King%20Inside.txt
@@ -31,28 +37,31 @@
#include "emu.h"
#include "st2204.h"
+DEFINE_DEVICE_TYPE(ST2202, st2202_device, "st2202", "Sitronix ST2202 Integrated Microcontroller")
DEFINE_DEVICE_TYPE(ST2204, st2204_device, "st2204", "Sitronix ST2204 Integrated Microcontroller")
-st2204_device::st2204_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
- : st2xxx_device(mconfig, ST2204, tag, owner, clock,
- address_map_constructor(FUNC(st2204_device::int_map), this),
- 26, // logical; only 23 address lines are brought out
- 0x0f7f)
- , m_bten(0)
- , m_btsr(0)
- , m_base_timer{0}
+st2204_device::st2204_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor map)
+ : st2xxx_device(mconfig, type, tag, owner, clock, map, 26, false) // logical; only 23 address lines are brought out
+ , m_tmode{0}
+ , m_tcntr{0}
+ , m_tload{0}
+ , m_timer{0}
+ , m_psg{0}
+ , m_psgc(0)
, m_dms(0)
, m_dmd(0)
, m_dcnth(0)
{
}
-template<int N>
-TIMER_CALLBACK_MEMBER(st2204_device::bt_interrupt)
+st2204_device::st2204_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : st2204_device(mconfig, ST2204, tag, owner, clock, address_map_constructor(FUNC(st2204_device::int_map), this))
+{
+}
+
+st2202_device::st2202_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : st2204_device(mconfig, ST2202, tag, owner, clock, address_map_constructor(FUNC(st2202_device::int_map), this))
{
- m_btsr |= 1 << N;
- m_ireq |= 0x020;
- update_irq_state();
}
void st2204_device::device_start()
@@ -67,62 +76,67 @@ void st2204_device::device_start()
intf->dmr = 0;
intf->irq_service = false;
- m_base_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::bt_interrupt<0>), this));
- m_base_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::bt_interrupt<1>), this));
- m_base_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::bt_interrupt<2>), this));
- m_base_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::bt_interrupt<3>), this));
- m_base_timer[4] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::bt_interrupt<4>), this));
-
- save_item(NAME(m_pdata));
- save_item(NAME(m_pctrl));
- save_item(NAME(m_psel));
- save_item(NAME(m_pfun));
- save_item(NAME(m_bten));
- save_item(NAME(m_btsr));
+ init_base_timer(0x0020);
+ init_lcd_timer(0x0040);
+
+ m_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::t0_interrupt), this));
+ m_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2204_device::t1_interrupt), this));
+
+ save_item(NAME(m_tmode));
+ save_item(NAME(m_tcntr));
+ save_item(NAME(m_tload));
+ save_item(NAME(m_psg));
+ save_item(NAME(m_psgc));
save_item(NAME(m_dms));
save_item(NAME(m_dmd));
save_item(NAME(m_dcnth));
- save_item(NAME(m_sys));
- save_item(NAME(m_pmcr));
- save_item(NAME(m_ireq));
- save_item(NAME(m_iena));
- save_item(NAME(m_lssa));
- save_item(NAME(m_lvpw));
- save_item(NAME(m_lxmax));
- save_item(NAME(m_lymax));
- save_item(NAME(intf->irr_enable));
- save_item(NAME(intf->irr));
- save_item(NAME(intf->prr));
- save_item(NAME(intf->drr));
- save_item(NAME(intf->irq_service));
mintf = std::move(intf);
+ save_common_registers();
init();
state_add(ST_IRR, "IRR", downcast<mi_st2204 &>(*mintf).irr).mask(0xff);
state_add(ST_PRR, "PRR", downcast<mi_st2204 &>(*mintf).prr).mask(0xfff);
state_add(ST_DRR, "DRR", downcast<mi_st2204 &>(*mintf).drr).mask(0x7ff);
- state_add<u8>(ST_IREQ, "IREQ", [this]() { return m_ireq; }, [this](u16 data) { m_ireq = data; update_irq_state(); }).mask(m_ireq_mask);
- state_add<u8>(ST_IENA, "IENA", [this]() { return m_iena; }, [this](u16 data) { m_iena = data; update_irq_state(); }).mask(m_ireq_mask);
+ state_add<u16>(ST_IREQ, "IREQ", [this]() { return m_ireq; }, [this](u16 data) { m_ireq = data; update_irq_state(); }).mask(st2xxx_ireq_mask());
+ state_add<u16>(ST_IENA, "IENA", [this]() { return m_iena; }, [this](u16 data) { m_iena = data; update_irq_state(); }).mask(st2xxx_ireq_mask());
for (int i = 0; i < 5; i++)
{
- state_add(ST_PDA + i, string_format("PD%c", 'A' + i).c_str(), m_pdata[i]);
+ state_add(ST_PAOUT + i, string_format("P%cOUT", 'A' + i).c_str(), m_pdata[i]);
state_add(ST_PCA + i, string_format("PC%c", 'A' + i).c_str(), m_pctrl[i]);
if (i == 2)
state_add(ST_PSA + i, string_format("PS%c", 'A' + i).c_str(), m_psel[i]);
if (i == 2 || i == 3)
state_add(ST_PFC + i - 2, string_format("PF%c", 'A' + i).c_str(), m_pfun[i - 2]);
}
- state_add(ST_PDL, "PDL", m_pdata[6]);
+ state_add(ST_PLOUT, "PLOUT", m_pdata[6]);
state_add(ST_PCL, "PCL", m_pctrl[6]);
state_add(ST_PMCR, "PMCR", m_pmcr);
+ state_add<u8>(ST_PRS, "PRS", [this]() { return m_prs; }, [this](u8 data) { prs_w(data); }).mask(0x60);
state_add<u8>(ST_BTEN, "BTEN", [this]() { return m_bten; }, [this](u8 data) { bten_w(data); }).mask(0x1f);
state_add(ST_BTSR, "BTSR", m_btsr).mask(0x1f);
+ state_add(ST_T0M, "T0M", m_tmode[0]).mask(0x37);
+ state_add(ST_T0C, "T0C", m_tload[0]);
+ state_add(ST_T1M, "T1M", m_tmode[1]).mask(0x1f);
+ state_add(ST_T1C, "T1C", m_tload[1]);
+ state_add(ST_PSG0, "PSG0", m_psg[0]).mask(0xfff);
+ state_add(ST_PSG1, "PSG1", m_psg[1]).mask(0xfff);
+ state_add(ST_PSGC, "PSGC", m_psgc).mask(0x7f);
state_add<u8>(ST_SYS, "SYS", [this]() { return m_sys; }, [this](u8 data) { sys_w(data); });
+ state_add(ST_MISC, "MISC", m_misc).mask(st2xxx_misc_mask());
state_add(ST_LSSA, "LSSA", m_lssa);
state_add(ST_LVPW, "LVPW", m_lvpw);
state_add(ST_LXMAX, "LXMAX", m_lxmax);
state_add(ST_LYMAX, "LYMAX", m_lymax);
+ state_add(ST_LPAN, "LPAN", m_lpan).mask(st2xxx_lpan_mask());
+ state_add(ST_LCTR, "LCTR", m_lctr).mask(st2xxx_lctr_mask());
+ state_add(ST_LCKR, "LCKR", m_lckr).mask(st2xxx_lckr_mask());
+ state_add(ST_LFRA, "LFRA", m_lfra).mask(0x3f);
+ state_add(ST_LAC, "LAC", m_lac).mask(0x1f);
+ state_add(ST_LPWM, "LPWM", m_lpwm).mask(st2xxx_lpwm_mask());
+ state_add(ST_BCTR, "BCTR", m_bctr).mask(0x87);
+ state_add(ST_BRS, "BRS", m_brs);
+ state_add(ST_BDIV, "BDIV", m_bdiv);
state_add(ST_DMS, "DMS", m_dms);
state_add(ST_DMR, "DMR", downcast<mi_st2204 &>(*mintf).dmr).mask(0x7ff);
state_add(ST_DMD, "DMD", m_dmd);
@@ -132,15 +146,33 @@ void st2204_device::device_reset()
{
st2xxx_device::device_reset();
- mi_st2204 &m = downcast<mi_st2204 &>(*mintf);
- m.irr_enable = false;
- m.irr = 0;
- m.prr = 0;
- m.drr = 0;
- m.dmr = 0;
+ m_tmode[0] = m_tmode[1] = 0;
+ m_tcntr[0] = m_tcntr[1] = 0;
+ m_tload[0] = m_tload[1] = 0;
+ m_timer[0]->adjust(attotime::never);
+ m_timer[1]->adjust(attotime::never);
- bten_w(0);
- m_btsr = 0;
+ m_psg[0] = m_psg[1] = 0;
+ m_psgc = 0;
+}
+
+const char *st2204_device::st2xxx_irq_name(int i) const
+{
+ switch (i)
+ {
+ case 0: return "PC0 edge";
+ case 1: return "DAC reload";
+ case 2: return "Timer 0";
+ case 3: return "Timer 1";
+ case 4: return "PA transition";
+ case 5: return "Base timer";
+ case 6: return "LCD frame";
+ case 8: return "SPI TX empty";
+ case 9: return "SPI RX ready";
+ case 10: return "UART TX";
+ case 11: return "UART RX";
+ default: return "Reserved";
+ }
}
u8 st2204_device::mi_st2204::pread(u16 adr)
@@ -209,113 +241,194 @@ void st2204_device::mi_st2204::write(u16 adr, u8 val)
program->write_byte(adr, val);
}
-u8 st2204_device::pmcr_r()
+unsigned st2204_device::st2xxx_bt_divider(int n) const
{
- return m_pmcr;
+ // 2 Hz, 8 Hz, 64 Hz, 256 Hz, 2048 Hz
+ if (n < 5)
+ return 16384 >> ((n & 1) * 2 + (n >> 1) * 5);
+ else
+ return 0;
}
-void st2204_device::pmcr_w(u8 data)
+TIMER_CALLBACK_MEMBER(st2204_device::t0_interrupt)
{
- m_pmcr = data;
+ m_ireq |= 0x004;
+ update_irq_state();
+
+ // Bit 4 allows auto-reload
+ m_tcntr[0] = BIT(m_tmode[0], 4) ? m_tload[0] : 0;
+ m_timer[0]->adjust(cycles_to_attotime((256 - m_tcntr[0]) * tclk_pres_div(m_tmode[0] & 0x07)));
}
-u8 st2204_device::bten_r()
+TIMER_CALLBACK_MEMBER(st2204_device::t1_interrupt)
{
- return m_bten;
+ m_ireq |= 0x008;
+ update_irq_state();
+
+ // Bit 4 allows auto-reload
+ m_tcntr[1] = BIT(m_tmode[1], 4) ? m_tload[1] : 0;
+ if (!BIT(m_tmode[1], 3))
+ m_timer[1]->adjust(cycles_to_attotime((256 - m_tcntr[1]) * tclk_pres_div(m_tmode[1] & 0x07)));
+ else if ((m_tmode[1] & 0x07) < 3)
+ t1_start_from_oscx();
}
-void st2204_device::bten_w(u8 data)
+void st2204_device::timer_start_from_tclk(int t)
{
- for (int n = 0; n < 5; n++)
- {
- if (BIT(data, n) && !BIT(m_bten, n))
- {
- // 2 Hz, 8 Hz, 64 Hz, 256 Hz, 2048 Hz
- attotime period = attotime::from_hz(2 << ((n & 1) * 2 + (n >> 1) * 5));
- m_base_timer[n]->adjust(period, 0, period);
- }
- else if (!BIT(data, n) && BIT(m_bten, n))
- m_base_timer[n]->adjust(attotime::never);
- }
+ u32 div = tclk_pres_div(m_tmode[t] & 0x07);
+ m_timer[t]->adjust(cycles_to_attotime((255 - m_tcntr[t]) * div + div - (pres_count() & (div - 1))));
+}
- m_bten = data & 0x1f;
+void st2204_device::t1_start_from_oscx()
+{
+ u32 div = 256 >> (m_tmode[1] & 0x03);
+ m_timer[1]->adjust(attotime::from_ticks(div, 32768));
}
-u8 st2204_device::btsr_r()
+u8 st2204_device::t0m_r()
{
- return m_btsr;
+ return m_tmode[0];
}
-void st2204_device::btsr_w(u8 data)
+void st2204_device::t0m_w(u8 data)
{
- // Only bit 7 has any effect
- if (BIT(data, 7))
- m_btsr = 0;
+ u8 t0m_old = std::exchange(m_tmode[0], data & 0x37);
+
+ if ((data & 0x27) != (t0m_old & 0x27) && (m_prs & 0x60) == 0x40)
+ {
+ // forced update
+ m_tcntr[0] = t0c_r();
+
+ if (BIT(data, 5))
+ timer_start_from_tclk(0);
+ else if (BIT(t0m_old, 5))
+ m_timer[0]->adjust(attotime::never);
+ }
}
-u8 st2204_device::sys_r()
+u8 st2204_device::t0c_r()
{
- return m_sys | 0x01;
+ if ((m_prs & 0x60) != 0x40 || !BIT(m_tmode[0], 5))
+ return m_tcntr[0];
+ else
+ {
+ u32 div = tclk_pres_div(m_tmode[0] & 0x07);
+ return 255 - u8(attotime_to_cycles(m_timer[0]->remaining()) / div);
+ }
}
-void st2204_device::sys_w(u8 data)
+void st2204_device::t0c_w(u8 data)
{
- m_sys = data;
- downcast<mi_st2204 &>(*mintf).irr_enable = BIT(data, 1);
+ m_tcntr[0] = m_tload[0] = data;
+ if ((m_prs & 0x60) == 0x40 && BIT(m_tmode[0], 5))
+ timer_start_from_tclk(0);
}
-u8 st2204_device::irr_r()
+u8 st2204_device::t1m_r()
{
- return downcast<mi_st2204 &>(*mintf).irr;
+ return m_tmode[1];
}
-void st2204_device::irr_w(u8 data)
+void st2204_device::t1m_w(u8 data)
{
- downcast<mi_st2204 &>(*mintf).irr = data;
+ data &= 0x1f;
+ u8 t1m_old = std::exchange(m_tmode[1], data);
+
+ if ((data & 0x0f) != (t1m_old & 0x0f))
+ {
+ // forced update
+ m_tcntr[1] = t1c_r();
+
+ if (!BIT(data, 3))
+ {
+ if ((m_prs & 0x60) == 0x40)
+ timer_start_from_tclk(1);
+ else
+ m_timer[1]->adjust(attotime::never);
+ }
+ else if (data < 0x0b)
+ t1_start_from_oscx();
+
+ // TODO: BGRCK source
+ }
+
}
-u8 st2204_device::prrl_r()
+u8 st2204_device::t1c_r()
{
- return downcast<mi_st2204 &>(*mintf).prr & 0xff;
+ if (!BIT(m_tmode[1], 3))
+ {
+ if ((m_prs & 0x60) != 0x40)
+ return m_tcntr[1];
+ else
+ {
+ u32 div = tclk_pres_div(m_tmode[1] & 0x07);
+ return 255 - u8(attotime_to_cycles(m_timer[1]->remaining()) / div);
+ }
+ }
+ else if ((m_tmode[1] & 0x07) < 3)
+ {
+ u32 div = 256 >> (m_tmode[1] & 0x03);
+ return 255 - u8(m_timer[1]->remaining().as_ticks(32768) / div);
+ }
+ else
+ return m_tcntr[1];
}
-void st2204_device::prrl_w(u8 data)
+void st2204_device::t1c_w(u8 data)
{
- u16 &prr = downcast<mi_st2204 &>(*mintf).prr;
- prr = data | (prr & 0x0f00);
+ m_tcntr[1] = m_tload[1] = data;
}
-u8 st2204_device::prrh_r()
+void st2204_device::st2xxx_tclk_start()
{
- return downcast<mi_st2204 &>(*mintf).prr >> 8;
+ if (BIT(m_tmode[0], 5))
+ timer_start_from_tclk(0);
+ if (!BIT(m_tmode[1], 3))
+ timer_start_from_tclk(1);
}
-void st2204_device::prrh_w(u8 data)
+void st2204_device::st2xxx_tclk_stop()
{
- u16 &prr = downcast<mi_st2204 &>(*mintf).prr;
- prr = u16(data & 0x0f) << 8 | (prr & 0x00ff);
+ if (m_timer[0]->enabled())
+ {
+ m_tcntr[0] = t0c_r();
+ m_timer[0]->adjust(attotime::never);
+ }
+ if (!BIT(m_tmode[1], 3))
+ {
+ m_tcntr[1] = t1c_r();
+ m_timer[1]->adjust(attotime::never);
+ }
}
-u8 st2204_device::drrl_r()
+void st2204_device::psg_w(offs_t offset, u8 data)
{
- return downcast<mi_st2204 &>(*mintf).drr & 0xff;
+ if (BIT(offset, 0))
+ m_psg[offset >> 1] = u16(data & 0x0f) << 8 | (m_psg[offset >> 1] & 0x0ff);
+ else
+ m_psg[offset >> 1] = data | (m_psg[offset >> 1] & 0xf00);
}
-void st2204_device::drrl_w(u8 data)
+void st2204_device::psgc_w(u8 data)
{
- u16 &drr = downcast<mi_st2204 &>(*mintf).drr;
- drr = data | (drr & 0x0700);
+ m_psgc = data & 0x7f;
}
-u8 st2204_device::drrh_r()
+void st2204_device::dac_w(u8 data)
{
- return downcast<mi_st2204 &>(*mintf).drr >> 8;
+ // TODO
}
-void st2204_device::drrh_w(u8 data)
+unsigned st2204_device::st2xxx_lfr_clocks() const
{
- u16 &drr = downcast<mi_st2204 &>(*mintf).drr;
- drr = u16(data & 0x07) << 8 | (drr & 0x00ff);
+ // ST2202 datasheet suggests 1/4 as many clocks in 4-bit mode; this seems too fast for GameKing 3 (TODO: double-check this)
+ unsigned lcdcks = ((m_lxmax + m_lfra) * 2 + 3) * 8 * (m_lymax ? m_lymax : 256);
+
+ if (BIT(m_lckr, 4))
+ return lcdcks * std::max((m_lckr & 0x0f) * 2, 1);
+ else
+ return lcdcks * std::max(((m_lckr & 0x0c) >> 2) * 2, 1);
}
u8 st2204_device::dmsl_r()
@@ -388,28 +501,6 @@ void st2204_device::dcnth_w(u8 data)
m_dcnth = data & 0x1f;
}
-u8 st2204_device::dmrl_r()
-{
- return downcast<mi_st2204 &>(*mintf).dmr & 0xff;
-}
-
-void st2204_device::dmrl_w(u8 data)
-{
- u16 &dmr = downcast<mi_st2204 &>(*mintf).dmr;
- dmr = data | (dmr & 0x0700);
-}
-
-u8 st2204_device::dmrh_r()
-{
- return downcast<mi_st2204 &>(*mintf).dmr >> 8;
-}
-
-void st2204_device::dmrh_w(u8 data)
-{
- u16 &dmr = downcast<mi_st2204 &>(*mintf).dmr;
- dmr = (data & 0x07) << 8 | (dmr & 0x00ff);
-}
-
u8 st2204_device::pmem_r(offs_t offset)
{
return downcast<mi_st2204 &>(*mintf).pread(offset);
@@ -430,7 +521,7 @@ void st2204_device::dmem_w(offs_t offset, u8 data)
downcast<mi_st2204 &>(*mintf).dwrite(offset, data);
}
-void st2204_device::int_map(address_map &map)
+void st2204_device::common_map(address_map &map)
{
map(0x0000, 0x0004).rw(FUNC(st2204_device::pdata_r), FUNC(st2204_device::pdata_w));
map(0x0005, 0x0005).rw(FUNC(st2204_device::psc_r), FUNC(st2204_device::psc_w));
@@ -438,23 +529,31 @@ void st2204_device::int_map(address_map &map)
map(0x000d, 0x000d).rw(FUNC(st2204_device::pfc_r), FUNC(st2204_device::pfc_w));
map(0x000e, 0x000e).rw(FUNC(st2204_device::pfd_r), FUNC(st2204_device::pfd_w));
map(0x000f, 0x000f).rw(FUNC(st2204_device::pmcr_r), FUNC(st2204_device::pmcr_w));
+ map(0x0010, 0x0013).w(FUNC(st2204_device::psg_w));
+ map(0x0014, 0x0014).w(FUNC(st2204_device::dac_w));
+ map(0x0016, 0x0016).w(FUNC(st2204_device::psgc_w));
map(0x0020, 0x0020).rw(FUNC(st2204_device::bten_r), FUNC(st2204_device::bten_w));
- map(0x0021, 0x0021).rw(FUNC(st2204_device::btsr_r), FUNC(st2204_device::btsr_w));
- // Source/destination registers are not readable on ST2202, but may be readable here (count register isn't)
- map(0x0028, 0x0028).rw(FUNC(st2204_device::dmsl_r), FUNC(st2204_device::dmsl_w));
- map(0x0029, 0x0029).rw(FUNC(st2204_device::dmsh_r), FUNC(st2204_device::dmsh_w));
- map(0x002a, 0x002a).rw(FUNC(st2204_device::dmdl_r), FUNC(st2204_device::dmdl_w));
- map(0x002b, 0x002b).rw(FUNC(st2204_device::dmdh_r), FUNC(st2204_device::dmdh_w));
+ map(0x0021, 0x0021).rw(FUNC(st2204_device::btsr_r), FUNC(st2204_device::btclr_all_w));
+ map(0x0023, 0x0023).rw(FUNC(st2204_device::prs_r), FUNC(st2204_device::prs_w));
+ map(0x0024, 0x0024).rw(FUNC(st2204_device::t0m_r), FUNC(st2204_device::t0m_w));
+ map(0x0025, 0x0025).rw(FUNC(st2204_device::t0c_r), FUNC(st2204_device::t0c_w));
+ map(0x0026, 0x0026).rw(FUNC(st2204_device::t1m_r), FUNC(st2204_device::t1m_w));
+ map(0x0027, 0x0027).rw(FUNC(st2204_device::t1c_r), FUNC(st2204_device::t1c_w));
+ map(0x0028, 0x0028).w(FUNC(st2204_device::dmsl_w));
+ map(0x0029, 0x0029).w(FUNC(st2204_device::dmsh_w));
+ map(0x002a, 0x002a).w(FUNC(st2204_device::dmdl_w));
+ map(0x002b, 0x002b).w(FUNC(st2204_device::dmdh_w));
map(0x002c, 0x002c).w(FUNC(st2204_device::dcntl_w));
map(0x002d, 0x002d).w(FUNC(st2204_device::dcnth_w));
map(0x0030, 0x0030).rw(FUNC(st2204_device::sys_r), FUNC(st2204_device::sys_w));
- map(0x0031, 0x0031).rw(FUNC(st2204_device::irr_r), FUNC(st2204_device::irr_w));
+ map(0x0031, 0x0031).rw(FUNC(st2204_device::irrl_r), FUNC(st2204_device::irrl_w));
map(0x0032, 0x0032).rw(FUNC(st2204_device::prrl_r), FUNC(st2204_device::prrl_w));
map(0x0033, 0x0033).rw(FUNC(st2204_device::prrh_r), FUNC(st2204_device::prrh_w));
map(0x0034, 0x0034).rw(FUNC(st2204_device::drrl_r), FUNC(st2204_device::drrl_w));
map(0x0035, 0x0035).rw(FUNC(st2204_device::drrh_r), FUNC(st2204_device::drrh_w));
map(0x0036, 0x0036).rw(FUNC(st2204_device::dmrl_r), FUNC(st2204_device::dmrl_w));
map(0x0037, 0x0037).rw(FUNC(st2204_device::dmrh_r), FUNC(st2204_device::dmrh_w));
+ map(0x0038, 0x0038).rw(FUNC(st2204_device::misc_r), FUNC(st2204_device::misc_w));
map(0x003c, 0x003c).rw(FUNC(st2204_device::ireql_r), FUNC(st2204_device::ireql_w));
map(0x003d, 0x003d).rw(FUNC(st2204_device::ireqh_r), FUNC(st2204_device::ireqh_w));
map(0x003e, 0x003e).rw(FUNC(st2204_device::ienal_r), FUNC(st2204_device::ienal_w));
@@ -464,9 +563,35 @@ void st2204_device::int_map(address_map &map)
map(0x0042, 0x0042).w(FUNC(st2204_device::lvpw_w));
map(0x0043, 0x0043).rw(FUNC(st2204_device::lxmax_r), FUNC(st2204_device::lxmax_w));
map(0x0044, 0x0044).rw(FUNC(st2204_device::lymax_r), FUNC(st2204_device::lymax_w));
+ map(0x0045, 0x0045).rw(FUNC(st2204_device::lpan_r), FUNC(st2204_device::lpan_w));
+ map(0x0047, 0x0047).rw(FUNC(st2204_device::lctr_r), FUNC(st2204_device::lctr_w));
+ map(0x0048, 0x0048).w(FUNC(st2204_device::lckr_w));
+ map(0x0049, 0x0049).w(FUNC(st2204_device::lfra_w));
+ map(0x004a, 0x004a).rw(FUNC(st2204_device::lac_r), FUNC(st2204_device::lac_w));
+ map(0x004b, 0x004b).rw(FUNC(st2204_device::lpwm_r), FUNC(st2204_device::lpwm_w));
map(0x004c, 0x004c).rw(FUNC(st2204_device::pl_r), FUNC(st2204_device::pl_w));
- map(0x004e, 0x004e).w(FUNC(st2204_device::pcl_w));
- map(0x0080, 0x287f).ram(); // 2800-287F possibly not present in earlier versions
+ // PCL is listed as write-only in ST2202 specification, but DynamiDesk suggests otherwise
+ map(0x004e, 0x004e).rw(FUNC(st2204_device::pcl_r), FUNC(st2204_device::pcl_w));
+ map(0x0063, 0x0063).rw(FUNC(st2204_device::bctr_r), FUNC(st2204_device::bctr_w));
+ map(0x0066, 0x0066).rw(FUNC(st2204_device::brs_r), FUNC(st2204_device::brs_w));
+ map(0x0067, 0x0067).rw(FUNC(st2204_device::bdiv_r), FUNC(st2204_device::bdiv_w));
map(0x4000, 0x7fff).rw(FUNC(st2204_device::pmem_r), FUNC(st2204_device::pmem_w));
map(0x8000, 0xffff).rw(FUNC(st2204_device::dmem_r), FUNC(st2204_device::dmem_w));
}
+
+void st2202_device::int_map(address_map &map)
+{
+ common_map(map);
+ map(0x0080, 0x0fff).ram();
+}
+
+void st2204_device::int_map(address_map &map)
+{
+ common_map(map);
+ // Source/destination registers are supposedly not readable on ST2202, but may be readable here (count register isn't)
+ map(0x0028, 0x0028).r(FUNC(st2204_device::dmsl_r));
+ map(0x0029, 0x0029).r(FUNC(st2204_device::dmsh_r));
+ map(0x002a, 0x002a).r(FUNC(st2204_device::dmdl_r));
+ map(0x002b, 0x002b).r(FUNC(st2204_device::dmdh_r));
+ map(0x0080, 0x287f).ram(); // 2800-287F possibly not present in earlier versions
+}
diff --git a/src/devices/cpu/m6502/st2204.h b/src/devices/cpu/m6502/st2204.h
index 63ef404ea48..6c5772b7ecf 100644
--- a/src/devices/cpu/m6502/st2204.h
+++ b/src/devices/cpu/m6502/st2204.h
@@ -2,6 +2,7 @@
// copyright-holders:AJR
/**********************************************************************
+ Sitronix ST2202 8-Bit Integrated Microcontroller
Sitronix ST2204 8-Bit Integrated Microcontroller
**********************************************************************/
@@ -17,19 +18,43 @@ class st2204_device : public st2xxx_device
{
public:
enum {
- ST_BTEN = ST_LYMAX + 1,
- ST_BTSR,
+ ST_T0M = ST_BDIV + 1,
+ ST_T0C,
+ ST_T1M,
+ ST_T1C,
+ ST_PSG0,
+ ST_PSG1,
ST_DMS,
- ST_DMD,
- ST_DMR
+ ST_DMD
};
st2204_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
+ st2204_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor int_map);
+
virtual void device_start() override;
virtual void device_reset() override;
+ virtual u16 st2xxx_ireq_mask() const override { return 0x0f7f; }
+ virtual const char *st2xxx_irq_name(int i) const override;
+ virtual u8 st2xxx_pmcr_mask() const override { return 0xff; }
+ virtual unsigned st2xxx_bt_divider(int n) const override;
+ virtual u8 st2xxx_prs_mask() const override { return 0xe0; }
+ virtual void st2xxx_tclk_start() override;
+ virtual void st2xxx_tclk_stop() override;
+ virtual u8 st2xxx_sys_mask() const override { return 0xff; }
+ virtual u8 st2xxx_misc_mask() const override { return 0x1f; }
+ virtual bool st2xxx_has_dma() const override { return true; }
+ virtual u8 st2xxx_lpan_mask() const override { return 0x07; }
+ virtual u8 st2xxx_lctr_mask() const override { return 0xff; }
+ virtual u8 st2xxx_lckr_mask() const override { return 0x1f; }
+ virtual u8 st2xxx_lpwm_mask() const override { return 0x3f; }
+ virtual unsigned st2xxx_lfr_clocks() const override;
+ virtual u8 st2xxx_bctr_mask() const override { return 0x87; }
+
+ void common_map(address_map &map);
+
private:
class mi_st2204 : public mi_st2xxx {
public:
@@ -46,34 +71,23 @@ private:
u8 dread(u16 adr);
u8 dreadc(u16 adr);
void dwrite(u16 adr, u8 val);
-
- bool irr_enable;
- u8 irr;
- u16 prr;
- u16 drr;
- u16 dmr;
};
- template<int N> TIMER_CALLBACK_MEMBER(bt_interrupt);
-
- u8 sys_r();
- void sys_w(u8 data);
- u8 irr_r();
- void irr_w(u8 data);
- u8 prrl_r();
- void prrl_w(u8 data);
- u8 prrh_r();
- void prrh_w(u8 data);
- u8 drrl_r();
- void drrl_w(u8 data);
- u8 drrh_r();
- void drrh_w(u8 data);
- u8 pmcr_r();
- void pmcr_w(u8 data);
- u8 bten_r();
- void bten_w(u8 data);
- u8 btsr_r();
- void btsr_w(u8 data);
+ TIMER_CALLBACK_MEMBER(t0_interrupt);
+ TIMER_CALLBACK_MEMBER(t1_interrupt);
+ void timer_start_from_tclk(int t);
+ void t1_start_from_oscx();
+ u8 t0m_r();
+ void t0m_w(u8 data);
+ u8 t0c_r();
+ void t0c_w(u8 data);
+ u8 t1m_r();
+ void t1m_w(u8 data);
+ u8 t1c_r();
+ void t1c_w(u8 data);
+ void psg_w(offs_t offset, u8 data);
+ void psgc_w(u8 data);
+ void dac_w(u8 data);
u8 dmsl_r();
void dmsl_w(u8 data);
u8 dmsh_r();
@@ -84,10 +98,6 @@ private:
void dmdh_w(u8 data);
void dcntl_w(u8 data);
void dcnth_w(u8 data);
- u8 dmrl_r();
- void dmrl_w(u8 data);
- u8 dmrh_r();
- void dmrh_w(u8 data);
u8 pmem_r(offs_t offset);
void pmem_w(offs_t offset, u8 data);
@@ -96,15 +106,31 @@ private:
void int_map(address_map &map);
- u8 m_bten;
- u8 m_btsr;
- emu_timer *m_base_timer[5];
-
+ u8 m_tmode[2];
+ u8 m_tcntr[2];
+ u8 m_tload[2];
+ emu_timer *m_timer[2];
+ u16 m_psg[2];
+ u8 m_psgc;
u16 m_dms;
u16 m_dmd;
u8 m_dcnth;
};
+class st2202_device : public st2204_device
+{
+public:
+ st2202_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ virtual u8 st2xxx_misc_mask() const override { return 0x0f; }
+ virtual u8 st2xxx_lctr_mask() const override { return 0xe0; }
+
+private:
+ void int_map(address_map &map);
+};
+
+DECLARE_DEVICE_TYPE(ST2202, st2202_device)
DECLARE_DEVICE_TYPE(ST2204, st2204_device)
#endif // MAME_MACHINE_M6502_ST2204_H
diff --git a/src/devices/cpu/m6502/st2205u.cpp b/src/devices/cpu/m6502/st2205u.cpp
index e43b79dc449..c6036fbe21d 100644
--- a/src/devices/cpu/m6502/st2205u.cpp
+++ b/src/devices/cpu/m6502/st2205u.cpp
@@ -39,23 +39,15 @@ st2205u_device::st2205u_device(const machine_config &mconfig, const char *tag, d
: st2xxx_device(mconfig, ST2205U, tag, owner, clock,
address_map_constructor(FUNC(st2205u_device::int_map), this),
26, // logical; only 23 address lines are brought out
- 0xdfff)
- , m_bten(0)
- , m_btreq(0)
+ true)
, m_btc(0)
- , m_base_timer{0}
+ , m_tc_12bit{0}
+ , m_t4c(0)
+ , m_tien(0)
, m_lvctr(0)
{
}
-template<int N>
-TIMER_CALLBACK_MEMBER(st2205u_device::bt_interrupt)
-{
- m_btreq |= 1 << N;
- m_ireq |= 0x0020;
- update_irq_state();
-}
-
void st2205u_device::device_start()
{
std::unique_ptr<mi_st2205u> intf = std::make_unique<mi_st2205u>();
@@ -67,71 +59,64 @@ void st2205u_device::device_start()
intf->drr = 0;
intf->brr = 0;
intf->irq_service = false;
-
- m_base_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<0>), this));
- m_base_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<1>), this));
- m_base_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<2>), this));
- m_base_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<3>), this));
- m_base_timer[4] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<4>), this));
- m_base_timer[5] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<5>), this));
- m_base_timer[6] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<6>), this));
- m_base_timer[7] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2205u_device::bt_interrupt<7>), this));
-
intf->ram = make_unique_clear<u8[]>(0x8000);
- save_item(NAME(m_pdata));
- save_item(NAME(m_pctrl));
- save_item(NAME(m_psel));
- save_item(NAME(m_pfun));
- save_item(NAME(m_bten));
- save_item(NAME(m_btreq));
+ init_base_timer(0x0040);
+ init_lcd_timer(0x0080);
+
save_item(NAME(m_btc));
- save_item(NAME(m_sys));
- save_item(NAME(m_pmcr));
- save_item(NAME(m_ireq));
- save_item(NAME(m_iena));
- save_item(NAME(m_lssa));
- save_item(NAME(m_lvpw));
- save_item(NAME(m_lxmax));
- save_item(NAME(m_lymax));
+ save_item(NAME(m_tc_12bit));
+ save_item(NAME(m_t4c));
+ save_item(NAME(m_tien));
save_item(NAME(m_lvctr));
- save_item(NAME(intf->irr_enable));
- save_item(NAME(intf->irr));
- save_item(NAME(intf->prr));
- save_item(NAME(intf->drr));
save_item(NAME(intf->brr));
- save_item(NAME(intf->irq_service));
save_pointer(NAME(intf->ram), 0x8000);
mintf = std::move(intf);
+ save_common_registers();
init();
state_add(ST_IRR, "IRR", downcast<mi_st2205u &>(*mintf).irr).mask(0x87ff);
state_add(ST_PRR, "PRR", downcast<mi_st2205u &>(*mintf).prr).mask(0x87ff);
state_add(ST_DRR, "DRR", downcast<mi_st2205u &>(*mintf).drr).mask(0x8fff);
state_add(ST_BRR, "BRR", downcast<mi_st2205u &>(*mintf).brr).mask(0x9fff);
- state_add<u8>(ST_IREQ, "IREQ", [this]() { return m_ireq; }, [this](u16 data) { m_ireq = data; update_irq_state(); }).mask(m_ireq_mask);
- state_add<u8>(ST_IENA, "IENA", [this]() { return m_iena; }, [this](u16 data) { m_iena = data; update_irq_state(); }).mask(m_ireq_mask);
+ state_add<u16>(ST_IREQ, "IREQ", [this]() { return m_ireq; }, [this](u16 data) { m_ireq = data; update_irq_state(); }).mask(st2xxx_ireq_mask());
+ state_add<u16>(ST_IENA, "IENA", [this]() { return m_iena; }, [this](u16 data) { m_iena = data; update_irq_state(); }).mask(st2xxx_ireq_mask());
for (int i = 0; i < 6; i++)
{
- state_add(ST_PDA + i, string_format("PD%c", 'A' + i).c_str(), m_pdata[i]);
+ state_add(ST_PAOUT + i, string_format("P%cOUT", 'A' + i).c_str(), m_pdata[i]);
state_add(ST_PCA + i, string_format("PC%c", 'A' + i).c_str(), m_pctrl[i]);
if (i == 2 || i == 4)
state_add(ST_PSA + i, string_format("PS%c", 'A' + i).c_str(), m_psel[i]);
if (i == 2 || i == 3)
state_add(ST_PFC + i - 2, string_format("PF%c", 'A' + i).c_str(), m_pfun[i - 2]).mask(i == 2 ? 0xfe : 0xff);
}
- state_add(ST_PDL, "PDL", m_pdata[6]);
+ state_add(ST_PLOUT, "PLOUT", m_pdata[6]);
state_add(ST_PCL, "PCL", m_pctrl[6]);
state_add(ST_PMCR, "PMCR", m_pmcr);
+ state_add(ST_MISC, "MISC", m_misc).mask(st2xxx_misc_mask());
state_add<u8>(ST_SYS, "SYS", [this]() { return m_sys; }, [this](u8 data) { sys_w(data); }).mask(0xfe);
+ state_add<u8>(ST_PRS, "PRS", [this]() { return m_prs; }, [this](u8 data) { prs_w(data); }).mask(0x40);
state_add<u8>(ST_BTEN, "BTEN", [this]() { return m_bten; }, [this](u8 data) { bten_w(data); });
- state_add(ST_BTREQ, "BTREQ", m_btreq);
+ state_add(ST_BTSR, "BTREQ", m_btsr);
state_add(ST_BTC, "BTC", m_btc);
+ for (int i = 0; i < 4; i++)
+ state_add(ST_T0C + i, string_format("T%dC", i).c_str(), m_tc_12bit[i]);
+ state_add(ST_T4C, "T4C", m_t4c);
+ state_add(ST_TIEN, "TIEN", m_tien);
state_add(ST_LSSA, "LSSA", m_lssa);
state_add(ST_LVPW, "LVPW", m_lvpw);
state_add(ST_LXMAX, "LXMAX", m_lxmax);
state_add(ST_LYMAX, "LYMAX", m_lymax);
+ state_add(ST_LPAN, "LPAN", m_lpan).mask(st2xxx_lpan_mask());
+ state_add(ST_LCTR, "LCTR", m_lctr).mask(st2xxx_lctr_mask());
+ state_add(ST_LCKR, "LCKR", m_lckr).mask(st2xxx_lckr_mask());
+ state_add(ST_LFRA, "LFRA", m_lfra).mask(0x3f);
+ state_add(ST_LAC, "LAC", m_lac).mask(0x1f);
+ state_add(ST_LPWM, "LPWM", m_lpwm).mask(st2xxx_lpwm_mask());
+ state_add(ST_BCTR, "BCTR", m_bctr).mask(0xb7);
+ state_add(ST_BRS, "BRS", m_brs);
+ state_add(ST_BDIV, "BDIV", m_bdiv);
state_add(ST_LVCTR, "LVCTR", m_lvctr).mask(0x0f);
}
@@ -139,22 +124,43 @@ void st2205u_device::device_reset()
{
st2xxx_device::device_reset();
- mi_st2205u &m = downcast<mi_st2205u &>(*mintf);
- m.irr_enable = false;
- m.irr = 0;
- m.prr = 0;
- m.drr = 0;
+ downcast<mi_st2205u &>(*mintf).brr = 0;
- bten_w(0);
- m_btreq = 0;
m_btc = 0;
+ std::fill(std::begin(m_tc_12bit), std::end(m_tc_12bit), 0);
+ m_t4c = 0;
+ m_tien = 0;
+
m_lvctr = 0;
}
+const char *st2205u_device::st2xxx_irq_name(int i) const
+{
+ switch (i)
+ {
+ case 0: return "PE0/1/2 edge";
+ case 1: return "Timer 0";
+ case 2: return "Timer 1";
+ case 3: return "Timer 2";
+ case 4: return "Timer 3";
+ case 5: return "PA transition";
+ case 6: return "Base timer";
+ case 7: return "LCD buffer";
+ case 8: return "SPI TX empty";
+ case 9: return "SPI RX ready";
+ case 10: return "UART TX";
+ case 11: return "UART RX";
+ case 12: return "USB";
+ case 14: return "PCM";
+ case 15: return "RTC";
+ default: return "Reserved";
+ }
+}
+
u8 st2205u_device::mi_st2205u::pread(u16 adr)
{
- u16 bank = irq_service ? irr : prr;
+ u16 bank = irq_service && irr_enable ? irr : prr;
if (BIT(bank, 15))
return ram[0x4000 | (adr & 0x3fff)];
else
@@ -163,7 +169,7 @@ u8 st2205u_device::mi_st2205u::pread(u16 adr)
u8 st2205u_device::mi_st2205u::preadc(u16 adr)
{
- u16 bank = irq_service ? irr : prr;
+ u16 bank = irq_service && irr_enable ? irr : prr;
if (BIT(bank, 15))
return ram[0x4000 | (adr & 0x3fff)];
else
@@ -172,7 +178,7 @@ u8 st2205u_device::mi_st2205u::preadc(u16 adr)
void st2205u_device::mi_st2205u::pwrite(u16 adr, u8 val)
{
- u16 bank = irq_service ? irr : prr;
+ u16 bank = irq_service && irr_enable ? irr : prr;
if (BIT(bank, 15))
ram[0x4000 | (adr & 0x3fff)] = val;
else
@@ -252,72 +258,6 @@ void st2205u_device::mi_st2205u::write(u16 adr, u8 val)
program->write_byte(adr, val);
}
-u8 st2205u_device::irrl_r()
-{
- return downcast<mi_st2205u &>(*mintf).irr & 0xff;
-}
-
-void st2205u_device::irrl_w(u8 data)
-{
- u16 &irr = downcast<mi_st2205u &>(*mintf).irr;
- irr = data | (irr & 0x8f00);
-}
-
-u8 st2205u_device::irrh_r()
-{
- return downcast<mi_st2205u &>(*mintf).irr >> 8;
-}
-
-void st2205u_device::irrh_w(u8 data)
-{
- u16 &irr = downcast<mi_st2205u &>(*mintf).irr;
- irr = (data & 0x8f) << 8 | (irr & 0x00ff);
-}
-
-u8 st2205u_device::prrl_r()
-{
- return downcast<mi_st2205u &>(*mintf).prr & 0xff;
-}
-
-void st2205u_device::prrl_w(u8 data)
-{
- u16 &prr = downcast<mi_st2205u &>(*mintf).prr;
- prr = data | (prr & 0x8f00);
-}
-
-u8 st2205u_device::prrh_r()
-{
- return downcast<mi_st2205u &>(*mintf).prr >> 8;
-}
-
-void st2205u_device::prrh_w(u8 data)
-{
- u16 &prr = downcast<mi_st2205u &>(*mintf).prr;
- prr = (data & 0x8f) << 8 | (prr & 0x00ff);
-}
-
-u8 st2205u_device::drrl_r()
-{
- return downcast<mi_st2205u &>(*mintf).drr & 0xff;
-}
-
-void st2205u_device::drrl_w(u8 data)
-{
- u16 &drr = downcast<mi_st2205u &>(*mintf).drr;
- drr = data | (drr & 0x8700);
-}
-
-u8 st2205u_device::drrh_r()
-{
- return downcast<mi_st2205u &>(*mintf).drr >> 8;
-}
-
-void st2205u_device::drrh_w(u8 data)
-{
- u16 &drr = downcast<mi_st2205u &>(*mintf).drr;
- drr = (data & 0x87) << 8 | (drr & 0x00ff);
-}
-
u8 st2205u_device::brrl_r()
{
return downcast<mi_st2205u &>(*mintf).brr & 0xff;
@@ -340,81 +280,84 @@ void st2205u_device::brrh_w(u8 data)
brr = (data & 0x9f) << 8 | (brr & 0x00ff);
}
-u8 st2205u_device::pmcr_r()
+unsigned st2205u_device::st2xxx_bt_divider(int n) const
{
- return m_pmcr;
+ // 2 Hz
+ if (n == 0)
+ return 16384;
+
+ // 32 Hz, 64 Hz, 128 Hz, 256 Hz, 512 Hz
+ if (n <= 5)
+ return 2048 >> n;
+
+ // 2048 Hz
+ if (n == 6)
+ return 16;
+
+ // 8192 Hz / BTC
+ assert(n == 7);
+ return 4 * (m_btc != 0 ? m_btc : 256);
}
-void st2205u_device::pmcr_w(u8 data)
+u8 st2205u_device::btc_r()
{
- m_pmcr = data;
+ return m_btc;
}
-u8 st2205u_device::sys_r()
+void st2205u_device::btc_w(u8 data)
{
- return m_sys;
+ m_btc = data;
}
-void st2205u_device::sys_w(u8 data)
+u8 st2205u_device::tc_12bit_r(offs_t offset)
{
- m_sys = data & 0xfe;
- downcast<mi_st2205u &>(*mintf).irr_enable = BIT(data, 1);
+ return (m_tc_12bit[offset >> 1] >> (BIT(offset, 0) ? 8 : 0)) & 0x00ff;
}
-u8 st2205u_device::bten_r()
+void st2205u_device::tc_12bit_w(offs_t offset, u8 data)
{
- return m_bten;
+ if (BIT(offset, 0))
+ m_tc_12bit[offset >> 1] = (m_tc_12bit[offset >> 1] & 0x00ff) | u16(data) << 8;
+ else
+ m_tc_12bit[offset >> 1] = (m_tc_12bit[offset >> 1] & 0xff00) | data;
}
-void st2205u_device::bten_w(u8 data)
+u8 st2205u_device::t4c_r()
{
- if (BIT(data, 0) && !BIT(m_bten, 0))
- m_base_timer[0]->adjust(attotime::from_hz(2), 0, attotime::from_hz(2));
- else if (!BIT(data, 0) && BIT(m_bten, 0))
- m_base_timer[0]->adjust(attotime::never);
-
- for (int n = 1; n <= 5; n++)
- {
- if (BIT(data, n) && !BIT(m_bten, n))
- m_base_timer[n]->adjust(attotime::from_hz(16 << n), 0, attotime::from_hz(16 << n));
- else if (!BIT(data, n) && BIT(m_bten, n))
- m_base_timer[n]->adjust(attotime::never);
- }
-
- if (BIT(data, 6) && !BIT(m_bten, 6))
- m_base_timer[6]->adjust(attotime::from_hz(2048), 0, attotime::from_hz(2048));
- else if (!BIT(data, 6) && BIT(m_bten, 6))
- m_base_timer[6]->adjust(attotime::never);
+ return m_t4c;
+}
- if (BIT(data, 7) && !BIT(m_bten, 7))
- {
- attotime period = attotime::from_hz(8192) * (m_btc ? m_btc : 256);
- m_base_timer[7]->adjust(period, 0, period);
- }
- else if (!BIT(data, 7) && BIT(m_bten, 7))
- m_base_timer[7]->adjust(attotime::never);
+void st2205u_device::t4c_w(u8 data)
+{
+ m_t4c = data;
+}
- m_bten = data;
+u8 st2205u_device::tien_r()
+{
+ return m_tien;
}
-u8 st2205u_device::btreq_r()
+void st2205u_device::tien_w(u8 data)
{
- return m_btreq;
+ m_tien = data;
}
-void st2205u_device::btclr_w(u8 data)
+void st2205u_device::st2xxx_tclk_start()
{
- m_btreq &= ~data;
}
-u8 st2205u_device::btc_r()
+void st2205u_device::st2xxx_tclk_stop()
{
- return m_btc;
}
-void st2205u_device::btc_w(u8 data)
+unsigned st2205u_device::st2xxx_lfr_clocks() const
{
- m_btc = data;
+ unsigned lcdcks = ((m_lxmax * 2 + m_lfra * 4) + 5) * (m_lymax ? m_lymax : 256) * ((m_lctr & 0x03) == 0 ? 2 : 4);
+
+ if ((m_lckr & 0x30) == 0x00 || (m_lckr & 0x30) == 0x30)
+ return lcdcks * std::max(((m_lckr & 0x0c) >> 2) * 8, 4);
+ else
+ return lcdcks * std::max((m_lckr & 0x0f) * 2, 1);
}
u8 st2205u_device::lvctr_r()
@@ -475,9 +418,13 @@ void st2205u_device::int_map(address_map &map)
map(0x0008, 0x000d).rw(FUNC(st2205u_device::pctrl_r), FUNC(st2205u_device::pctrl_w));
map(0x000e, 0x000e).rw(FUNC(st2205u_device::pfc_r), FUNC(st2205u_device::pfc_w));
map(0x000f, 0x000f).rw(FUNC(st2205u_device::pfd_r), FUNC(st2205u_device::pfd_w));
+ map(0x0020, 0x0027).rw(FUNC(st2205u_device::tc_12bit_r), FUNC(st2205u_device::tc_12bit_w));
+ map(0x0028, 0x0028).rw(FUNC(st2205u_device::tien_r), FUNC(st2205u_device::tien_w));
+ map(0x0029, 0x0029).rw(FUNC(st2205u_device::prs_r), FUNC(st2205u_device::prs_w));
map(0x002a, 0x002a).rw(FUNC(st2205u_device::bten_r), FUNC(st2205u_device::bten_w));
- map(0x002b, 0x002b).rw(FUNC(st2205u_device::btreq_r), FUNC(st2205u_device::btclr_w));
+ map(0x002b, 0x002b).rw(FUNC(st2205u_device::btsr_r), FUNC(st2205u_device::btclr_w));
map(0x002c, 0x002c).rw(FUNC(st2205u_device::btc_r), FUNC(st2205u_device::btc_w));
+ map(0x002d, 0x002d).rw(FUNC(st2205u_device::t4c_r), FUNC(st2205u_device::t4c_w));
map(0x0030, 0x0030).rw(FUNC(st2205u_device::irrl_r), FUNC(st2205u_device::irrl_w));
map(0x0031, 0x0031).rw(FUNC(st2205u_device::irrh_r), FUNC(st2205u_device::irrh_w));
map(0x0032, 0x0032).rw(FUNC(st2205u_device::prrl_r), FUNC(st2205u_device::prrl_w));
@@ -486,6 +433,7 @@ void st2205u_device::int_map(address_map &map)
map(0x0035, 0x0035).rw(FUNC(st2205u_device::drrh_r), FUNC(st2205u_device::drrh_w));
map(0x0036, 0x0036).rw(FUNC(st2205u_device::brrl_r), FUNC(st2205u_device::brrl_w));
map(0x0037, 0x0037).rw(FUNC(st2205u_device::brrh_r), FUNC(st2205u_device::brrh_w));
+ map(0x0038, 0x0038).rw(FUNC(st2205u_device::misc_r), FUNC(st2205u_device::misc_w));
map(0x0039, 0x0039).rw(FUNC(st2205u_device::sys_r), FUNC(st2205u_device::sys_w));
map(0x003a, 0x003a).rw(FUNC(st2205u_device::pmcr_r), FUNC(st2205u_device::pmcr_w));
map(0x003c, 0x003c).rw(FUNC(st2205u_device::ireql_r), FUNC(st2205u_device::ireql_w));
@@ -497,9 +445,20 @@ void st2205u_device::int_map(address_map &map)
map(0x0042, 0x0042).w(FUNC(st2205u_device::lvpw_w));
map(0x0043, 0x0043).rw(FUNC(st2205u_device::lxmax_r), FUNC(st2205u_device::lxmax_w));
map(0x0044, 0x0044).rw(FUNC(st2205u_device::lymax_r), FUNC(st2205u_device::lymax_w));
+ map(0x0045, 0x0045).rw(FUNC(st2205u_device::lpan_r), FUNC(st2205u_device::lpan_w));
+ map(0x0047, 0x0047).rw(FUNC(st2205u_device::lctr_r), FUNC(st2205u_device::lctr_w));
+ map(0x0048, 0x0048).w(FUNC(st2205u_device::lckr_w));
+ map(0x0049, 0x0049).w(FUNC(st2205u_device::lfra_w));
+ map(0x004a, 0x004a).rw(FUNC(st2205u_device::lac_r), FUNC(st2205u_device::lac_w));
+ map(0x004b, 0x004b).rw(FUNC(st2205u_device::lpwm_r), FUNC(st2205u_device::lpwm_w));
map(0x004e, 0x004e).rw(FUNC(st2205u_device::pl_r), FUNC(st2205u_device::pl_w));
map(0x004f, 0x004f).rw(FUNC(st2205u_device::pcl_r), FUNC(st2205u_device::pcl_w));
map(0x0057, 0x0057).rw(FUNC(st2205u_device::lvctr_r), FUNC(st2205u_device::lvctr_w));
+ map(0x005a, 0x005a).rw(FUNC(st2205u_device::dmrl_r), FUNC(st2205u_device::dmrl_w));
+ map(0x005b, 0x005b).rw(FUNC(st2205u_device::dmrh_r), FUNC(st2205u_device::dmrh_w));
+ map(0x0063, 0x0063).rw(FUNC(st2205u_device::bctr_r), FUNC(st2205u_device::bctr_w));
+ map(0x0066, 0x0066).rw(FUNC(st2205u_device::brs_r), FUNC(st2205u_device::brs_w));
+ map(0x0067, 0x0067).rw(FUNC(st2205u_device::bdiv_r), FUNC(st2205u_device::bdiv_w));
map(0x0080, 0x1fff).rw(FUNC(st2205u_device::ram_r), FUNC(st2205u_device::ram_w)); // assumed to be shared with banked RAM
map(0x2000, 0x3fff).rw(FUNC(st2205u_device::bmem_r), FUNC(st2205u_device::bmem_w));
map(0x4000, 0x7fff).rw(FUNC(st2205u_device::pmem_r), FUNC(st2205u_device::pmem_w));
diff --git a/src/devices/cpu/m6502/st2205u.h b/src/devices/cpu/m6502/st2205u.h
index 2a04bc67be7..f8ee13649d1 100644
--- a/src/devices/cpu/m6502/st2205u.h
+++ b/src/devices/cpu/m6502/st2205u.h
@@ -17,9 +17,13 @@ class st2205u_device : public st2xxx_device
{
public:
enum {
- ST_BTEN = ST_LYMAX + 1,
- ST_BTREQ,
- ST_BTC,
+ ST_BTC = ST_BDIV + 1,
+ ST_T0C,
+ ST_T1C,
+ ST_T2C,
+ ST_T3C,
+ ST_T4C,
+ ST_TIEN,
ST_BRR,
ST_LVCTR
};
@@ -30,6 +34,24 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
+ virtual u16 st2xxx_ireq_mask() const override { return 0xdfff; }
+ virtual const char *st2xxx_irq_name(int i) const override;
+ virtual u8 st2xxx_pmcr_mask() const override { return 0xff; }
+ virtual unsigned st2xxx_bt_divider(int n) const override;
+ virtual u8 st2xxx_prs_mask() const override { return 0xc0; }
+ virtual void st2xxx_tclk_start() override;
+ virtual void st2xxx_tclk_stop() override;
+ virtual u8 st2xxx_sys_mask() const override { return 0xfe; }
+ virtual u8 st2xxx_misc_mask() const override { return 0x0f; }
+ virtual bool st2xxx_wdten_on_reset() const override { return true; }
+ virtual bool st2xxx_has_dma() const override { return true; }
+ virtual u8 st2xxx_lpan_mask() const override { return 0x0f; }
+ virtual u8 st2xxx_lctr_mask() const override { return 0xef; }
+ virtual u8 st2xxx_lckr_mask() const override { return 0x3f; }
+ virtual u8 st2xxx_lpwm_mask() const override { return 0xff; }
+ virtual unsigned st2xxx_lfr_clocks() const override;
+ virtual u8 st2xxx_bctr_mask() const override { return 0xb7; }
+
private:
class mi_st2205u : public mi_st2xxx {
public:
@@ -49,10 +71,6 @@ private:
u8 breadc(u16 adr);
void bwrite(u16 adr, u8 val);
- bool irr_enable;
- u16 irr;
- u16 prr;
- u16 drr;
u16 brr;
std::unique_ptr<u8[]> ram;
@@ -60,32 +78,18 @@ private:
template<int N> TIMER_CALLBACK_MEMBER(bt_interrupt);
- u8 irrl_r();
- void irrl_w(u8 data);
- u8 irrh_r();
- void irrh_w(u8 data);
- u8 prrl_r();
- void prrl_w(u8 data);
- u8 prrh_r();
- void prrh_w(u8 data);
- u8 drrl_r();
- void drrl_w(u8 data);
- u8 drrh_r();
- void drrh_w(u8 data);
u8 brrl_r();
void brrl_w(u8 data);
u8 brrh_r();
void brrh_w(u8 data);
- u8 sys_r();
- void sys_w(u8 data);
- u8 pmcr_r();
- void pmcr_w(u8 data);
- u8 bten_r();
- void bten_w(u8 data);
- u8 btreq_r();
- void btclr_w(u8 data);
u8 btc_r();
void btc_w(u8 data);
+ u8 tc_12bit_r(offs_t offset);
+ void tc_12bit_w(offs_t offset, u8 data);
+ u8 t4c_r();
+ void t4c_w(u8 data);
+ u8 tien_r();
+ void tien_w(u8 data);
u8 lvctr_r();
void lvctr_w(u8 data);
@@ -100,10 +104,10 @@ private:
void int_map(address_map &map);
- u8 m_bten;
- u8 m_btreq;
u8 m_btc;
- emu_timer *m_base_timer[8];
+ u16 m_tc_12bit[4];
+ u8 m_t4c;
+ u8 m_tien;
u8 m_lvctr;
};
diff --git a/src/devices/cpu/m6502/st2xxx.cpp b/src/devices/cpu/m6502/st2xxx.cpp
index ce5a91ba619..47d6b6778b4 100644
--- a/src/devices/cpu/m6502/st2xxx.cpp
+++ b/src/devices/cpu/m6502/st2xxx.cpp
@@ -28,20 +28,48 @@
#include "emu.h"
#include "st2xxx.h"
-st2xxx_device::st2xxx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor internal_map, int data_bits, u16 ireq_mask)
+#define LOG_IRQ (1 << 1U)
+#define LOG_BT (1 << 2U)
+#define LOG_LCDC (1 << 3U)
+//#define VERBOSE (LOG_IRQ | LOG_BT | LOG_LCDC)
+#include "logmacro.h"
+
+st2xxx_device::st2xxx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor internal_map, int data_bits, bool has_banked_ram)
: r65c02_device(mconfig, type, tag, owner, clock)
, m_data_config("data", ENDIANNESS_LITTLE, 8, data_bits, 0)
, m_in_port_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
, m_out_port_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
+ , m_prr_mask(data_bits <= 14 ? 0 : ((u16(1) << (data_bits - 14)) - 1) | (has_banked_ram ? 0x8000 : 0))
+ , m_drr_mask(data_bits <= 15 ? 0 : ((u16(1) << (data_bits - 15)) - 1) | (has_banked_ram ? 0x8000 : 0))
, m_pdata{0}
, m_pctrl{0}
, m_psel{0}
, m_pfun{0}
, m_pmcr(0)
+ , m_bten(0)
+ , m_btsr(0)
+ , m_bt_mask(0)
+ , m_bt_ireq(0)
+ , m_pres_base(0)
+ , m_pres_started(attotime::zero)
+ , m_prs(0)
+ , m_sys(0)
+ , m_misc(0)
, m_ireq(0)
, m_iena(0)
- , m_ireq_mask(ireq_mask)
- , m_sys(0)
+ , m_lssa(0)
+ , m_lvpw(0)
+ , m_lxmax(0)
+ , m_lymax(0)
+ , m_lpan(0)
+ , m_lctr(0)
+ , m_lckr(0)
+ , m_lfra(0)
+ , m_lac(0)
+ , m_lpwm(0)
+ , m_lcd_ireq(0)
+ , m_lcd_timer(nullptr)
+ , m_bctr(0)
{
program_config.m_internal_map = std::move(internal_map);
}
@@ -62,6 +90,113 @@ void st2xxx_device::device_resolve_objects()
cb.resolve_safe();
}
+TIMER_CALLBACK_MEMBER(st2xxx_device::bt_interrupt)
+{
+ // BTSR must be cleared each time the interrupt is serviced
+ bool interrupt = (m_btsr == 0);
+
+ m_btsr |= 1 << param;
+
+ unsigned div = st2xxx_bt_divider(param);
+ assert(div != 0);
+ m_base_timer[param]->adjust(attotime::from_ticks(div, 32768), param);
+
+ if (interrupt)
+ {
+ LOGMASKED(LOG_BT, "Interrupt caused by %.1f Hz base timer\n", 32768.0 / div);
+ m_ireq |= m_bt_ireq;
+ update_irq_state();
+ }
+}
+
+void st2xxx_device::init_base_timer(u16 ireq)
+{
+ m_bt_ireq = ireq;
+
+ for (int n = 0; n < 8; n++)
+ {
+ if (st2xxx_bt_divider(n) != 0)
+ {
+ m_bt_mask |= 1 << n;
+ m_base_timer[n] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2xxx_device::bt_interrupt), this));
+ }
+ }
+
+ assert(m_bt_mask != 0);
+ assert(m_bt_ireq != 0);
+}
+
+TIMER_CALLBACK_MEMBER(st2xxx_device::lcd_interrupt)
+{
+ m_ireq |= m_lcd_ireq;
+ update_irq_state();
+}
+
+void st2xxx_device::init_lcd_timer(u16 ireq)
+{
+ m_lcd_ireq = ireq;
+ assert(m_lcd_ireq != 0);
+
+ m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(st2xxx_device::lcd_interrupt), this));
+}
+
+void st2xxx_device::save_common_registers()
+{
+ mi_st2xxx *intf = downcast<mi_st2xxx *>(mintf.get());
+
+ save_item(NAME(m_pdata));
+ save_item(NAME(m_pctrl));
+ save_item(NAME(m_psel));
+ save_item(NAME(m_pfun));
+ save_item(NAME(m_pmcr));
+ if (m_prr_mask != 0)
+ {
+ if (BIT(st2xxx_sys_mask(), 1))
+ {
+ save_item(NAME(intf->irq_service));
+ save_item(NAME(intf->irr_enable));
+ save_item(NAME(intf->irr));
+ }
+ save_item(NAME(intf->prr));
+ }
+ if (m_drr_mask != 0)
+ {
+ save_item(NAME(intf->drr));
+ if (st2xxx_has_dma())
+ save_item(NAME(intf->dmr));
+ }
+ if (m_bt_mask != 0)
+ {
+ save_item(NAME(m_bten));
+ save_item(NAME(m_btsr));
+ }
+ save_item(NAME(m_pres_base));
+ save_item(NAME(m_pres_started));
+ save_item(NAME(m_prs));
+ save_item(NAME(m_sys));
+ if (st2xxx_misc_mask() != 0)
+ save_item(NAME(m_misc));
+ save_item(NAME(m_ireq));
+ save_item(NAME(m_iena));
+ save_item(NAME(m_lssa));
+ save_item(NAME(m_lvpw));
+ save_item(NAME(m_lxmax));
+ save_item(NAME(m_lymax));
+ if (st2xxx_lpan_mask() != 0)
+ save_item(NAME(m_lpan));
+ save_item(NAME(m_lctr));
+ save_item(NAME(m_lckr));
+ save_item(NAME(m_lfra));
+ save_item(NAME(m_lac));
+ save_item(NAME(m_lpwm));
+ if (st2xxx_bctr_mask() != 0)
+ {
+ save_item(NAME(m_bctr));
+ save_item(NAME(m_brs));
+ save_item(NAME(m_bdiv));
+ }
+}
+
void st2xxx_device::device_reset()
{
m6502_device::device_reset();
@@ -75,37 +210,59 @@ void st2xxx_device::device_reset()
cb(0xff);
m_pmcr = 0x80;
+ // reset bank registers
+ mi_st2xxx &m = downcast<mi_st2xxx &>(*mintf);
+ m.irr_enable = false;
+ m.irr = 0;
+ m.prr = 0;
+ m.drr = 0;
+ m.dmr = 0;
+
// reset interrupt registers
m_ireq = 0;
m_iena = 0;
update_irq_state();
+ // reset base timer
+ bten_w(0);
+ m_btsr = 0;
+
+ // reset prescaler
+ prs_w(0x80);
+
// reset miscellaneous registers
m_sys = 0;
+ m_misc = st2xxx_wdten_on_reset() ? 0x0c : 0;
// reset LCDC registers
m_lssa = 0;
m_lvpw = 0;
m_lxmax = 0;
m_lymax = 0;
+ m_lpan = 0;
+ m_lctr = 0x80;
+ m_lckr = 0;
+ m_lfra = 0;
+ m_lac = 0;
+ m_lpwm = 0;
+ m_lcd_timer->adjust(attotime::never);
+
+ // reset UART and BRG
+ m_bctr = 0;
}
u8 st2xxx_device::acknowledge_irq()
{
// IREQH interrupts have priority over IREQL interrupts
- for (int level = 8; level < 16; level++)
- {
- if (BIT(m_ireq & m_iena, level))
- {
- m_ireq &= ~(1 << level);
- update_irq_state();
- return level;
- }
- }
- for (int level = 0; level < 8; level++)
+ for (int pri = 0; pri < 16; pri++)
{
+ int level = pri ^ 8;
if (BIT(m_ireq & m_iena, level))
{
+ LOGMASKED(LOG_IRQ, "%s interrupt acknowledged (PC = $%04X, vector = $%04X)\n",
+ st2xxx_irq_name(level),
+ PPC,
+ 0x7ff8 - (level << 1));
m_ireq &= ~(1 << level);
update_irq_state();
return level;
@@ -207,6 +364,229 @@ void st2xxx_device::pcl_w(u8 data)
pctrl_w(6, data);
}
+u8 st2xxx_device::pmcr_r()
+{
+ return m_pmcr;
+}
+
+void st2xxx_device::pmcr_w(u8 data)
+{
+ m_pmcr = data & st2xxx_pmcr_mask();
+}
+
+u8 st2xxx_device::bten_r()
+{
+ return m_bten;
+}
+
+void st2xxx_device::bten_w(u8 data)
+{
+ data &= m_bt_mask;
+
+ for (int n = 0; n < 8; n++)
+ {
+ if (BIT(data, n) && !BIT(m_bten, n))
+ {
+ unsigned div = st2xxx_bt_divider(n);
+ assert(div != 0);
+ assert(m_base_timer[n] != nullptr);
+ m_base_timer[n]->adjust(attotime::from_ticks(div, 32768), n);
+ LOGMASKED(LOG_BT, "Base timer %d enabled at %.1f Hz (PC = $%04X)\n", n, 32768.0 / div, PPC);
+ }
+ else if (!BIT(data, n) && BIT(m_bten, n))
+ {
+ m_base_timer[n]->adjust(attotime::never);
+ LOGMASKED(LOG_BT, "Base timer %d disabled (PC = $%04X)\n", n, PPC);
+ }
+ }
+
+ m_bten = data;
+}
+
+u8 st2xxx_device::btsr_r()
+{
+ return m_btsr;
+}
+
+void st2xxx_device::btclr_w(u8 data)
+{
+ // Write 1 to clear each individual bit
+ m_btsr &= ~data;
+}
+
+void st2xxx_device::btclr_all_w(u8 data)
+{
+ // Only bit 7 has any effect
+ if (BIT(data, 7))
+ m_btsr = 0;
+}
+
+u32 st2xxx_device::tclk_pres_div(u8 mode) const
+{
+ assert(mode < 8);
+ if (mode == 0)
+ return 0x10000;
+ else if (mode < 4)
+ return 0x20000 >> (mode * 2);
+ else if (mode == 4)
+ return 0x100;
+ else
+ return 0x8000 >> (mode * 2);
+}
+
+u16 st2xxx_device::pres_count() const
+{
+ return (m_pres_base + ((m_prs & 0x60) == 0x40 ? attotime_to_cycles(machine().time() - m_pres_started) : 0));
+}
+
+u8 st2xxx_device::prs_r()
+{
+ return pres_count() & 0xff;
+}
+
+void st2xxx_device::prs_w(u8 data)
+{
+ data &= st2xxx_prs_mask();
+
+ // Bit 7 produces prescaler reset pulse
+ if (BIT(data, 7))
+ {
+ st2xxx_tclk_stop();
+ m_pres_base = 0;
+ if ((m_prs & 0x60) == 0x40)
+ {
+ m_pres_started = machine().time();
+ st2xxx_tclk_start();
+ }
+ data &= 0x7f;
+ }
+
+ // Bit 6 enables prescaler; bit 5 selects clock source
+ if ((data & 0x60) == 0x40 && (m_prs & 0x60) != 0x40)
+ {
+ m_pres_started = machine().time();
+ st2xxx_tclk_start();
+ }
+ else if ((data & 0x60) == 0x40 && (m_prs & 0x60) != 0x40)
+ {
+ st2xxx_tclk_stop();
+ m_pres_base += attotime_to_cycles(machine().time() - m_pres_started);
+ }
+
+ m_prs = data;
+}
+
+u8 st2xxx_device::sys_r()
+{
+ return m_sys | 0x01;
+}
+
+void st2xxx_device::sys_w(u8 data)
+{
+ u8 mask = st2xxx_sys_mask();
+ m_sys = data & mask;
+ if (BIT(mask, 1))
+ downcast<mi_st2xxx &>(*mintf).irr_enable = BIT(data, 1);
+}
+
+u8 st2xxx_device::misc_r()
+{
+ return m_misc;
+}
+
+void st2xxx_device::misc_w(u8 data)
+{
+ m_misc = data & st2xxx_misc_mask();
+}
+
+u8 st2xxx_device::irrl_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).irr & 0xff;
+}
+
+void st2xxx_device::irrl_w(u8 data)
+{
+ u16 &irr = downcast<mi_st2xxx &>(*mintf).irr;
+ irr = (data & m_prr_mask) | (irr & 0xff00);
+}
+
+u8 st2xxx_device::irrh_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).irr >> 8;
+}
+
+void st2xxx_device::irrh_w(u8 data)
+{
+ u16 &irr = downcast<mi_st2xxx &>(*mintf).irr;
+ irr = ((u16(data) << 8) & m_prr_mask) | (irr & 0x00ff);
+}
+
+u8 st2xxx_device::prrl_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).prr & 0xff;
+}
+
+void st2xxx_device::prrl_w(u8 data)
+{
+ u16 &prr = downcast<mi_st2xxx &>(*mintf).prr;
+ prr = (data & m_prr_mask) | (prr & 0xff00);
+}
+
+u8 st2xxx_device::prrh_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).prr >> 8;
+}
+
+void st2xxx_device::prrh_w(u8 data)
+{
+ u16 &prr = downcast<mi_st2xxx &>(*mintf).prr;
+ prr = ((u16(data) << 8) & m_prr_mask) | (prr & 0x00ff);
+}
+
+u8 st2xxx_device::drrl_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).drr & 0xff;
+}
+
+void st2xxx_device::drrl_w(u8 data)
+{
+ u16 &drr = downcast<mi_st2xxx &>(*mintf).drr;
+ drr = (data & m_drr_mask) | (drr & 0xff00);
+}
+
+u8 st2xxx_device::drrh_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).drr >> 8;
+}
+
+void st2xxx_device::drrh_w(u8 data)
+{
+ u16 &drr = downcast<mi_st2xxx &>(*mintf).drr;
+ drr = ((u16(data) << 8) & m_drr_mask) | (drr & 0x00ff);
+}
+
+u8 st2xxx_device::dmrl_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).dmr & 0xff;
+}
+
+void st2xxx_device::dmrl_w(u8 data)
+{
+ u16 &dmr = downcast<mi_st2xxx &>(*mintf).dmr;
+ dmr = (data & m_drr_mask) | (dmr & 0xff00);
+}
+
+u8 st2xxx_device::dmrh_r()
+{
+ return downcast<mi_st2xxx &>(*mintf).dmr >> 8;
+}
+
+void st2xxx_device::dmrh_w(u8 data)
+{
+ u16 &dmr = downcast<mi_st2xxx &>(*mintf).dmr;
+ dmr = ((u16(data) << 8) & m_drr_mask) | (dmr & 0x00ff);
+}
+
u8 st2xxx_device::ireql_r()
{
return m_ireq & 0x00ff;
@@ -216,6 +596,11 @@ void st2xxx_device::ireql_w(u8 data)
{
if ((m_ireq & ~data & 0x00ff) != 0)
{
+ for (int i = 0; i < 8; i++)
+ {
+ if (!BIT(data, i) && BIT(m_ireq, i))
+ LOGMASKED(LOG_IRQ, "%s interrupt cleared (PC = $%04X)\n", st2xxx_irq_name(i), PPC);
+ }
m_ireq &= data | 0xff00;
update_irq_state();
}
@@ -230,6 +615,11 @@ void st2xxx_device::ireqh_w(u8 data)
{
if ((m_ireq & ~(u16(data) << 8) & 0xff00) != 0)
{
+ for (int i = 0; i < 8; i++)
+ {
+ if (!BIT(data, i) && BIT(m_ireq, i + 8))
+ LOGMASKED(LOG_IRQ, "%s interrupt cleared (PC = $%04X)\n", st2xxx_irq_name(i + 8), PPC);
+ }
m_ireq &= u16(data) << 8 | 0x00ff;
update_irq_state();
}
@@ -242,8 +632,20 @@ u8 st2xxx_device::ienal_r()
void st2xxx_device::ienal_w(u8 data)
{
- m_iena = (m_iena & 0xff00) | (data & m_ireq_mask);
- update_irq_state();
+ data &= st2xxx_ireq_mask();
+ if (data != (m_iena & 0x00ff))
+ {
+ for (int i = 0; i < 8; i++)
+ {
+ if (BIT(data, i) != BIT(m_iena, i))
+ LOGMASKED(LOG_IRQ, "%s interrupt %sabled (PC = $%04X)\n",
+ st2xxx_irq_name(i),
+ BIT(data, i) ? "en" : "dis",
+ PPC);
+ }
+ m_iena = (m_iena & 0xff00) | data;
+ update_irq_state();
+ }
}
u8 st2xxx_device::ienah_r()
@@ -253,8 +655,20 @@ u8 st2xxx_device::ienah_r()
void st2xxx_device::ienah_w(u8 data)
{
- m_iena = (m_iena & 0x00ff) | ((u16(data) << 8) & m_ireq_mask);
- update_irq_state();
+ data &= st2xxx_ireq_mask() >> 8;
+ if (data != (m_iena >> 8))
+ {
+ for (int i = 0; i < 8; i++)
+ {
+ if (BIT(data, i) != BIT(m_iena, i + 8))
+ LOGMASKED(LOG_IRQ, "%s interrupt %sabled (PC = $%04X)\n",
+ st2xxx_irq_name(i + 8),
+ BIT(data, i) ? "en" : "dis",
+ PPC);
+ }
+ m_iena = (m_iena & 0x00ff) | (u16(data) << 8);
+ update_irq_state();
+ }
}
void st2xxx_device::lssal_w(u8 data)
@@ -280,6 +694,7 @@ u8 st2xxx_device::lxmax_r()
void st2xxx_device::lxmax_w(u8 data)
{
m_lxmax = data;
+ lfr_recalculate_period();
}
u8 st2xxx_device::lymax_r()
@@ -290,6 +705,107 @@ u8 st2xxx_device::lymax_r()
void st2xxx_device::lymax_w(u8 data)
{
m_lymax = data;
+ lfr_recalculate_period();
+}
+
+u8 st2xxx_device::lpan_r()
+{
+ return m_lpan;
+}
+
+void st2xxx_device::lpan_w(u8 data)
+{
+ m_lpan = data & st2xxx_lpan_mask();
+}
+
+u8 st2xxx_device::lctr_r()
+{
+ return m_lctr;
+}
+
+void st2xxx_device::lctr_w(u8 data)
+{
+ data &= st2xxx_lctr_mask();
+ u8 old_lctr = std::exchange(m_lctr, data);
+
+ if ((old_lctr & 0xbf) != (m_lctr & 0xbf))
+ lfr_recalculate_period();
+}
+
+void st2xxx_device::lckr_w(u8 data)
+{
+ m_lckr = data & st2xxx_lckr_mask();
+ lfr_recalculate_period();
+}
+
+void st2xxx_device::lfra_w(u8 data)
+{
+ m_lfra = data & 0x3f;
+ lfr_recalculate_period();
+}
+
+void st2xxx_device::lfr_recalculate_period()
+{
+ if (!BIT(m_lctr, 7))
+ {
+ unsigned clocks = st2xxx_lfr_clocks();
+ assert(clocks != 0);
+ attotime period = cycles_to_attotime(clocks);
+ LOGMASKED(LOG_LCDC, "LCD frame rate = %f Hz (PC = $%04X)\n", period.as_hz(), PPC);
+ m_lcd_timer->adjust(period, 0, period);
+ }
+ else
+ m_lcd_timer->adjust(attotime::never);
+}
+
+u8 st2xxx_device::lac_r()
+{
+ return m_lac;
+}
+
+void st2xxx_device::lac_w(u8 data)
+{
+ m_lac = data & 0x1f;
+}
+
+u8 st2xxx_device::lpwm_r()
+{
+ return m_lpwm;
+}
+
+void st2xxx_device::lpwm_w(u8 data)
+{
+ m_lpwm = data & st2xxx_lpwm_mask();
+}
+
+u8 st2xxx_device::bctr_r()
+{
+ return m_bctr;
+}
+
+void st2xxx_device::bctr_w(u8 data)
+{
+ m_bctr = data & st2xxx_bctr_mask();
+}
+
+u8 st2xxx_device::brs_r()
+{
+ return m_brs;
+}
+
+void st2xxx_device::brs_w(u8 data)
+{
+ m_brs = data;
+}
+
+u8 st2xxx_device::bdiv_r()
+{
+ return m_bdiv;
+}
+
+void st2xxx_device::bdiv_w(u8 data)
+{
+ m_bdiv = data;
}
#include "cpu/m6502/st2xxx.hxx"
diff --git a/src/devices/cpu/m6502/st2xxx.h b/src/devices/cpu/m6502/st2xxx.h
index f35b5e540b3..9dbdef3ba24 100644
--- a/src/devices/cpu/m6502/st2xxx.h
+++ b/src/devices/cpu/m6502/st2xxx.h
@@ -8,13 +8,13 @@
class st2xxx_device : public r65c02_device {
public:
enum {
- ST_PDA = M6502_IR + 1,
- ST_PDB,
- ST_PDC,
- ST_PDD,
- ST_PDE,
- ST_PDF,
- ST_PDL,
+ ST_PAOUT = M6502_IR + 1,
+ ST_PBOUT,
+ ST_PCOUT,
+ ST_PDOUT,
+ ST_PEOUT,
+ ST_PFOUT,
+ ST_PLOUT,
ST_PCA,
ST_PCB,
ST_PCC,
@@ -32,16 +32,31 @@ public:
ST_PFC,
ST_PFD,
ST_PMCR,
+ ST_PSGC,
+ ST_BTEN,
+ ST_BTSR,
+ ST_PRS,
ST_SYS,
ST_IRR,
ST_PRR,
ST_DRR,
+ ST_DMR,
+ ST_MISC,
ST_IREQ,
ST_IENA,
ST_LSSA,
ST_LVPW,
ST_LXMAX,
- ST_LYMAX
+ ST_LYMAX,
+ ST_LPAN,
+ ST_LCTR,
+ ST_LCKR,
+ ST_LFRA,
+ ST_LAC,
+ ST_LPWM,
+ ST_BCTR,
+ ST_BRS,
+ ST_BDIV
};
auto in_pa_callback() { return m_in_port_cb[0].bind(); }
@@ -60,7 +75,7 @@ public:
auto out_pl_callback() { return m_out_port_cb[6].bind(); }
protected:
- st2xxx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor internal_map, int data_bits, u16 ireq_mask);
+ st2xxx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, address_map_constructor internal_map, int data_bits, bool has_banked_ram);
virtual space_config_vector memory_space_config() const override;
virtual void device_resolve_objects() override;
@@ -69,21 +84,52 @@ protected:
virtual void do_exec_full() override;
virtual void do_exec_partial() override;
+ virtual u16 st2xxx_ireq_mask() const = 0;
+ virtual const char *st2xxx_irq_name(int i) const = 0;
+ virtual u8 st2xxx_pmcr_mask() const = 0;
+ virtual unsigned st2xxx_bt_divider(int n) const = 0;
+ virtual u8 st2xxx_prs_mask() const = 0;
+ virtual void st2xxx_tclk_start() { }
+ virtual void st2xxx_tclk_stop() { }
+ virtual u8 st2xxx_sys_mask() const = 0;
+ virtual u8 st2xxx_misc_mask() const = 0;
+ virtual bool st2xxx_wdten_on_reset() const { return false; }
+ virtual bool st2xxx_has_dma() const { return false; }
+ virtual u8 st2xxx_lpan_mask() const = 0;
+ virtual u8 st2xxx_lctr_mask() const = 0;
+ virtual u8 st2xxx_lckr_mask() const = 0;
+ virtual u8 st2xxx_lpwm_mask() const = 0;
+ virtual unsigned st2xxx_lfr_clocks() const = 0;
+ virtual u8 st2xxx_bctr_mask() const = 0;
+
class mi_st2xxx : public memory_interface {
public:
virtual u8 read_vector(u16 adr) = 0;
address_space *data;
memory_access_cache<0, 0, ENDIANNESS_LITTLE> *dcache;
+
bool irq_service;
+ bool irr_enable;
+ u16 irr;
+ u16 prr;
+ u16 drr;
+ u16 dmr;
};
+ void init_base_timer(u16 ireq);
+ void init_lcd_timer(u16 ireq);
+ void save_common_registers();
+
u8 read_vector(u16 adr) { return downcast<mi_st2xxx &>(*mintf).read_vector(adr); }
void set_irq_service(bool state) { downcast<mi_st2xxx &>(*mintf).irq_service = state; }
void update_irq_state() { irq_state = (m_ireq & m_iena) != 0; }
u8 acknowledge_irq();
+ TIMER_CALLBACK_MEMBER(bt_interrupt);
+ TIMER_CALLBACK_MEMBER(lcd_interrupt);
+
u8 pdata_r(offs_t offset);
void pdata_w(offs_t offset, u8 data);
u8 pctrl_r(offs_t offset);
@@ -100,6 +146,41 @@ protected:
void pfc_w(u8 data);
u8 pfd_r();
void pfd_w(u8 data);
+ u8 pmcr_r();
+ void pmcr_w(u8 data);
+
+ u8 sys_r();
+ void sys_w(u8 data);
+ u8 misc_r();
+ void misc_w(u8 data);
+
+ u8 irrl_r();
+ void irrl_w(u8 data);
+ u8 irrh_r();
+ void irrh_w(u8 data);
+ u8 prrl_r();
+ void prrl_w(u8 data);
+ u8 prrh_r();
+ void prrh_w(u8 data);
+ u8 drrl_r();
+ void drrl_w(u8 data);
+ u8 drrh_r();
+ void drrh_w(u8 data);
+ u8 dmrl_r();
+ void dmrl_w(u8 data);
+ u8 dmrh_r();
+ void dmrh_w(u8 data);
+
+ u8 bten_r();
+ void bten_w(u8 data);
+ u8 btsr_r();
+ void btclr_w(u8 data);
+ void btclr_all_w(u8 data);
+
+ u32 tclk_pres_div(u8 mode) const;
+ u16 pres_count() const;
+ u8 prs_r();
+ void prs_w(u8 data);
u8 ireql_r();
void ireql_w(u8 data);
@@ -117,6 +198,23 @@ protected:
void lxmax_w(u8 data);
u8 lymax_r();
void lymax_w(u8 data);
+ u8 lpan_r();
+ void lpan_w(u8 data);
+ u8 lctr_r();
+ void lctr_w(u8 data);
+ void lckr_w(u8 data);
+ void lfra_w(u8 data);
+ void lfr_recalculate_period();
+ u8 lac_r();
+ void lac_w(u8 data);
+ u8 lpwm_r();
+ void lpwm_w(u8 data);
+ u8 bctr_r();
+ void bctr_w(u8 data);
+ u8 brs_r();
+ void brs_w(u8 data);
+ u8 bdiv_r();
+ void bdiv_w(u8 data);
#define O(o) void o ## _full(); void o ## _partial()
@@ -131,19 +229,47 @@ protected:
devcb_read8 m_in_port_cb[7];
devcb_write8 m_out_port_cb[7];
+ const u16 m_prr_mask;
+ const u16 m_drr_mask;
+
u8 m_pdata[7];
u8 m_pctrl[7];
u8 m_psel[7];
u8 m_pfun[2];
u8 m_pmcr;
+
+ u8 m_bten;
+ u8 m_btsr;
+ emu_timer *m_base_timer[8];
+ u8 m_bt_mask;
+ u16 m_bt_ireq;
+
+ u16 m_pres_base;
+ attotime m_pres_started;
+ u8 m_prs;
+
+ u8 m_sys;
+ u8 m_misc;
+
u16 m_ireq;
u16 m_iena;
- const u16 m_ireq_mask;
- u8 m_sys;
+
u16 m_lssa;
u8 m_lvpw;
u8 m_lxmax;
u8 m_lymax;
+ u8 m_lpan;
+ u8 m_lctr;
+ u8 m_lckr;
+ u8 m_lfra;
+ u8 m_lac;
+ u8 m_lpwm;
+ u16 m_lcd_ireq;
+ emu_timer *m_lcd_timer;
+
+ u8 m_bctr;
+ u8 m_brs;
+ u8 m_bdiv;
};
#endif // MAME_CPU_M6502_ST2XXX_H
diff --git a/src/devices/cpu/sh/sh2.cpp b/src/devices/cpu/sh/sh2.cpp
index b9be01f3c7e..eddf593b2db 100644
--- a/src/devices/cpu/sh/sh2.cpp
+++ b/src/devices/cpu/sh/sh2.cpp
@@ -515,6 +515,8 @@ void sh2_device::device_start()
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh2_device::sh2_timer_callback), this));
m_timer->adjust(attotime::never);
+ m_wdtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh2_device::sh2_wdtimer_callback), this));
+ m_wdtimer->adjust(attotime::never);
m_dma_current_active_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sh2_device::sh2_dma_current_active_callback), this));
m_dma_current_active_timer[0]->adjust(attotime::never);
diff --git a/src/devices/cpu/sh/sh2.h b/src/devices/cpu/sh/sh2.h
index fd4e9c01bcd..a83bea94646 100644
--- a/src/devices/cpu/sh/sh2.h
+++ b/src/devices/cpu/sh/sh2.h
@@ -302,6 +302,7 @@ private:
int m_internal_irq_vector;
emu_timer *m_timer;
+ emu_timer *m_wdtimer;
emu_timer *m_dma_current_active_timer[2];
int m_dma_timer_active[2];
uint8_t m_dma_irq[2];
@@ -339,9 +340,12 @@ private:
virtual void execute_one_f000(uint16_t opcode) override;
TIMER_CALLBACK_MEMBER( sh2_timer_callback );
+ TIMER_CALLBACK_MEMBER( sh2_wdtimer_callback );
TIMER_CALLBACK_MEMBER( sh2_dma_current_active_callback );
void sh2_timer_resync();
void sh2_timer_activate();
+ void sh2_wtcnt_recalc();
+ void sh2_wdt_activate();
void sh2_do_dma(int dmach);
virtual void sh2_exception(const char *message, int irqline) override;
void sh2_dmac_check(int dma);
diff --git a/src/devices/cpu/sh/sh2comn.cpp b/src/devices/cpu/sh/sh2comn.cpp
index bb17a818c17..fc39aacd1f0 100644
--- a/src/devices/cpu/sh/sh2comn.cpp
+++ b/src/devices/cpu/sh/sh2comn.cpp
@@ -18,6 +18,7 @@
#include "logmacro.h"
static const int div_tab[4] = { 3, 5, 7, 0 };
+static const int wdtclk_tab[8] = { 1, 6, 7, 8, 9, 10, 12, 13 };
void sh2_device::sh2_timer_resync()
@@ -100,6 +101,32 @@ TIMER_CALLBACK_MEMBER( sh2_device::sh2_timer_callback )
sh2_timer_activate();
}
+void sh2_device::sh2_wtcnt_recalc()
+{
+ if (m_wdtimer->expire() != attotime::never)
+ m_wtcnt = 0x100 - (attotime_to_cycles(m_wdtimer->remaining()) >> wdtclk_tab[m_wtcsr & 7]);
+}
+
+void sh2_device::sh2_wdt_activate()
+{
+ m_wdtimer->adjust(cycles_to_attotime((0x100 - m_wtcnt) << wdtclk_tab[m_wtcsr & 7]));
+}
+
+TIMER_CALLBACK_MEMBER(sh2_device::sh2_wdtimer_callback)
+{
+ m_wtcnt = 0;
+ if (!(m_wtcsr & 0x40)) // timer mode
+ {
+ m_wtcsr |= 0x80;
+ sh2_recalc_irq();
+ sh2_wdt_activate();
+ }
+ else // watchdog mode
+ {
+ m_rstcsr |= 0x80;
+ // TODO reset and /WDTOVF out
+ }
+}
/*
We have to do DMA on a timer (or at least, in chunks) due to the way some systems use it.
@@ -841,6 +868,7 @@ WRITE32_MEMBER( sh2_device::dvdntl_w )
READ16_MEMBER( sh2_device::wtcnt_r )
{
+ sh2_wtcnt_recalc();
return ((m_wtcsr | 0x18) << 8) | (m_wtcnt & 0xff);
}
@@ -856,6 +884,8 @@ WRITE16_MEMBER( sh2_device::wtcnt_w )
{
case 0x5a00:
m_wtcnt = m_wtcw[0] & 0xff;
+ if (m_wtcsr & 0x20)
+ sh2_wdt_activate();
break;
case 0xa500:
/*
@@ -866,7 +896,17 @@ WRITE16_MEMBER( sh2_device::wtcnt_w )
---1 1---
---- -xxx Clock select
*/
- m_wtcsr = m_wtcw[0] & 0xff;
+ sh2_wtcnt_recalc();
+ m_wtcsr &= m_wtcw[0] & 0x80;
+ m_wtcsr |= m_wtcw[0] & 0x7f;
+ if (m_wtcsr & 0x20)
+ sh2_wdt_activate();
+ else
+ {
+ m_wtcnt = 0;
+ m_wdtimer->adjust(attotime::never);
+ }
+ sh2_recalc_irq();
break;
}
}
@@ -1049,6 +1089,17 @@ void sh2_device::sh2_recalc_irq()
}
}
+ // WDT irqs
+ if (m_wtcsr & 0x80)
+ {
+ level = m_irq_level.wdt & 15;
+ if (level > irq)
+ {
+ irq = level;
+ vector = (m_vcrwdt >> 8) & 0x7f;
+ }
+ }
+
// DMA irqs
if((m_dmac[0].chcr & 6) == 6 && m_dma_irq[0]) {
level = m_irq_level.dmac & 15;
diff --git a/src/devices/cpu/superfx/superfx.cpp b/src/devices/cpu/superfx/superfx.cpp
index 4624a5bb06b..b467bf82903 100644
--- a/src/devices/cpu/superfx/superfx.cpp
+++ b/src/devices/cpu/superfx/superfx.cpp
@@ -1,5 +1,5 @@
-// license:BSD-3-Clause
-// copyright-holders:Ryan Holtz
+// license:GPL-2.0+
+// copyright-holders:byuu
#include "emu.h"
#include "debugger.h"
#include "superfx.h"
diff --git a/src/devices/cpu/superfx/superfx.h b/src/devices/cpu/superfx/superfx.h
index fe135f9bf1d..f5ac568e0ec 100644
--- a/src/devices/cpu/superfx/superfx.h
+++ b/src/devices/cpu/superfx/superfx.h
@@ -1,5 +1,5 @@
-// license:BSD-3-Clause
-// copyright-holders:Ryan Holtz
+// license:GPL-2.0+
+// copyright-holders:byuu
#ifndef MAME_CPU_SUPERFX_SUPERFX_H
#define MAME_CPU_SUPERFX_SUPERFX_H
diff --git a/src/devices/machine/spg2xx_video.cpp b/src/devices/machine/spg2xx_video.cpp
index daef752bc82..3fde969d344 100644
--- a/src/devices/machine/spg2xx_video.cpp
+++ b/src/devices/machine/spg2xx_video.cpp
@@ -209,6 +209,51 @@ void spg2xx_video_device::draw(const rectangle &cliprect, uint32_t line, uint32_
}
}
+void spg2xx_video_device::draw_bitmap(const rectangle& cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t* regs)
+{
+ if ((scanline < 0) || (scanline >= 240))
+ return;
+
+ address_space& space = m_cpu->space(AS_PROGRAM);
+ const int linewidth = 320 / 2;
+ int sourcebase = 0x3f0000; // this is correct for Texas Hold'em - TODO: get from a register?
+
+ sourcebase++; // why is this needed?
+ int bitmapline = scanline - 20; // should be from scrolly?
+
+ // at least for Texas Hold'em there is only enough memory for this size bitmap, and other reads would be outside of memory and generate excessive logging
+ // maybe we just need to silence logging instead tho?
+ if ((bitmapline < 0) || (bitmapline >= 200))
+ return;
+
+ sourcebase += bitmapline * linewidth;
+
+ uint32_t* dest = &m_screenbuf[320 * scanline];
+
+ for (int i = 0; i < 320 / 2; i++)
+ {
+ uint8_t palette_entry;
+ uint16_t color;
+ const uint16_t data = space.read_word(sourcebase + i);
+
+ palette_entry = (data & 0x00ff);
+ color = m_paletteram[palette_entry];
+
+ if (!(color & 0x8000))
+ {
+ dest[(i * 2)+0] = m_rgb555_to_rgb888[color & 0x7fff];
+ }
+
+ palette_entry = (data & 0xff00) >> 8;
+ color = m_paletteram[palette_entry];
+
+ if (!(color & 0x8000))
+ {
+ dest[(i * 2)+1] = m_rgb555_to_rgb888[color & 0x7fff];
+ }
+ }
+}
+
void spg2xx_video_device::draw_page(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t *regs)
{
uint32_t xscroll = regs[0];
@@ -229,6 +274,13 @@ void spg2xx_video_device::draw_page(const rectangle &cliprect, uint32_t scanline
return;
}
+ if (ctrl & 0x0001) // Bitmap mode!
+ {
+ draw_bitmap(cliprect, scanline, priority, bitmap_addr, regs);
+ return;
+ }
+
+
uint32_t tile_h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT);
uint32_t tile_w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT);
diff --git a/src/devices/machine/spg2xx_video.h b/src/devices/machine/spg2xx_video.h
index df98a1a639d..95bdd22cafe 100644
--- a/src/devices/machine/spg2xx_video.h
+++ b/src/devices/machine/spg2xx_video.h
@@ -84,6 +84,7 @@ protected:
template<blend_enable_t Blend, rowscroll_enable_t RowScroll, flipx_t FlipX>
void draw(const rectangle &cliprect, uint32_t line, uint32_t xoff, uint32_t yoff, uint32_t bitmap_addr, uint16_t tile, int32_t h, int32_t w, uint8_t bpp, uint32_t yflipmask, uint32_t palette_offset);
+ void draw_bitmap(const rectangle& cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t* regs);
void draw_page(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t bitmap_addr, uint16_t *regs);
void draw_sprite(const rectangle &cliprect, uint32_t scanline, int priority, uint32_t base_addr);
void draw_sprites(const rectangle &cliprect, uint32_t scanline, int priority);
diff --git a/src/devices/machine/wd1000.cpp b/src/devices/machine/wd1000.cpp
index e9ac75bad49..b0dbb182590 100644
--- a/src/devices/machine/wd1000.cpp
+++ b/src/devices/machine/wd1000.cpp
@@ -28,6 +28,7 @@ wd1000_device::wd1000_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, WD1000, tag, owner, clock)
, m_intrq_cb(*this)
, m_drq_cb(*this)
+ , m_drives(*this, "%u", 0)
, m_sector_base(0)
, m_buffer_index(0)
, m_buffer_end(0)
@@ -68,18 +69,29 @@ void wd1000_device::device_start()
m_buffer_index = 0;
for (int i = 0; i < 4; i++)
- {
- char name[2];
- name[0] = '0' + i;
- name[1] = 0;
- m_drives[i].drive = subdevice<harddisk_image_device>(name);
- m_drives[i].cylinder = 0;
- }
+ m_drive_cylinder[i] = 0;
// Initialize the status as ready if the initial drive exists,
// and assume it has been restored so seek is complete.
- if (m_drives[drive()].drive->exists())
+ if (m_drives[drive()] && m_drives[drive()]->exists())
m_status |= S_RDY | S_SC;
+
+ save_item(NAME(m_drive_cylinder));
+ save_item(NAME(m_sector_base));
+ save_item(NAME(m_buffer));
+ save_item(NAME(m_buffer_index));
+ save_item(NAME(m_buffer_end));
+ save_item(NAME(m_intrq));
+ save_item(NAME(m_drq));
+ save_item(NAME(m_stepping_rate));
+ save_item(NAME(m_command));
+ save_item(NAME(m_error));
+ save_item(NAME(m_precomp));
+ save_item(NAME(m_sector_count));
+ save_item(NAME(m_sector_number));
+ save_item(NAME(m_cylinder));
+ save_item(NAME(m_sdh));
+ save_item(NAME(m_status));
}
//-------------------------------------------------
@@ -92,9 +104,9 @@ void wd1000_device::device_reset()
m_sdh = 0x20;
for (int i = 0; i < 4; i++)
- m_drives[i].cylinder = 0;
+ m_drive_cylinder[i] = 0;
- if (m_drives[drive()].drive->exists())
+ if (m_drives[drive()] && m_drives[drive()]->exists())
m_status |= S_RDY | S_SC;
}
@@ -108,7 +120,7 @@ void wd1000_device::device_timer(emu_timer &timer, device_timer_id tid, int para
{
case TIMER_SEEK:
- m_drives[drive()].cylinder = param;
+ m_drive_cylinder[drive()] = param;
m_status |= S_SC;
switch (m_command >> 4)
@@ -228,7 +240,7 @@ void wd1000_device::end_command()
int wd1000_device::get_lbasector()
{
- hard_disk_file *file = m_drives[drive()].drive->get_hard_disk_file();
+ hard_disk_file *file = m_drives[drive()]->get_hard_disk_file();
hard_disk_info *info = hard_disk_get_info(file);
int lbasector;
@@ -413,7 +425,7 @@ void wd1000_device::data_w(uint8_t data)
set_error(0);
// Implied seek
m_status &= ~S_SC;
- int amount = abs(m_drives[drive()].cylinder - m_cylinder);
+ int amount = abs(m_drive_cylinder[drive()] - m_cylinder);
int target = m_cylinder;
m_seek_timer->adjust(get_stepping_rate() * amount, target);
}
@@ -476,7 +488,7 @@ WRITE8_MEMBER( wd1000_device::write )
// Update the drive ready flag in the status register which
// indicates the ready state for the selected drive.
// TODO should this also set the SC flag?
- if (m_drives[drive].drive->exists())
+ if (m_drives[drive] && m_drives[drive]->exists())
m_status |= S_RDY;
else
m_status &= ~S_RDY;
@@ -519,7 +531,7 @@ WRITE8_MEMBER( wd1000_device::write )
start_command();
// Schedule an implied seek.
m_status &= ~S_SC;
- int amount = m_drives[drive()].cylinder;
+ int amount = m_drive_cylinder[drive()];
int target = 0;
m_seek_timer->adjust(get_stepping_rate() * amount, target);
break;
@@ -529,7 +541,7 @@ WRITE8_MEMBER( wd1000_device::write )
case CMD_READ_SECTOR:
{
start_command();
- int amount = abs(m_drives[drive()].cylinder - m_cylinder);
+ int amount = abs(m_drive_cylinder[drive()] - m_cylinder);
int target = m_cylinder;
m_seek_timer->adjust(get_stepping_rate() * amount, target);
break;
@@ -558,9 +570,12 @@ void wd1000_device::cmd_restore()
end_command();
}
+// These commands should only be reachable if the status flag S_RDY is
+// true, and that should only occur if the m_drives element is there,
+// so it is not necessary to guard that case in these functions.
void wd1000_device::cmd_read_sector()
{
- hard_disk_file *file = m_drives[drive()].drive->get_hard_disk_file();
+ hard_disk_file *file = m_drives[drive()]->get_hard_disk_file();
uint8_t dma = BIT(m_command, 3);
hard_disk_read(file, get_lbasector(), m_buffer);
@@ -581,7 +596,7 @@ void wd1000_device::cmd_read_sector()
void wd1000_device::cmd_write_sector()
{
- hard_disk_file *file = m_drives[drive()].drive->get_hard_disk_file();
+ hard_disk_file *file = m_drives[drive()]->get_hard_disk_file();
if (m_buffer_index != sector_bytes())
{
@@ -595,7 +610,7 @@ void wd1000_device::cmd_write_sector()
void wd1000_device::cmd_format_sector()
{
- hard_disk_file *file = m_drives[drive()].drive->get_hard_disk_file();
+ hard_disk_file *file = m_drives[drive()]->get_hard_disk_file();
uint8_t buffer[512];
// The m_buffer appears to be loaded with an interleave table which is
diff --git a/src/devices/machine/wd1000.h b/src/devices/machine/wd1000.h
index 52ba9b71955..e7386ee543b 100644
--- a/src/devices/machine/wd1000.h
+++ b/src/devices/machine/wd1000.h
@@ -107,11 +107,8 @@ private:
devcb_write_line m_intrq_cb, m_drq_cb;
- struct
- {
- harddisk_image_device *drive;
- uint16_t cylinder;
- } m_drives[4];
+ optional_device_array<harddisk_image_device, 4> m_drives;
+ uint16_t m_drive_cylinder[4];
uint16_t m_sector_base;
diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp
index be0adeefc84..84c8e6eeaab 100644
--- a/src/devices/video/mc6845.cpp
+++ b/src/devices/video/mc6845.cpp
@@ -1336,7 +1336,7 @@ void sy6845e_device::device_start()
void hd6345_device::device_start()
{
- mc6845_device::device_start();
+ hd6845s_device::device_start();
m_supports_disp_start_addr_r = true;
m_supports_vert_sync_width = true;
@@ -1549,6 +1549,12 @@ mc6845_1_device::mc6845_1_device(const machine_config &mconfig, const char *tag,
}
+hd6845s_device::hd6845s_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : mc6845_device(mconfig, type, tag, owner, clock)
+{
+}
+
+
hd6845s_device::hd6845s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: mc6845_device(mconfig, HD6845S, tag, owner, clock)
{
@@ -1574,7 +1580,7 @@ sy6845e_device::sy6845e_device(const machine_config &mconfig, const char *tag, d
hd6345_device::hd6345_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : mc6845_device(mconfig, HD6345, tag, owner, clock)
+ : hd6845s_device(mconfig, HD6345, tag, owner, clock)
{
}
diff --git a/src/devices/video/mc6845.h b/src/devices/video/mc6845.h
index 46dfd9b19fb..1cfd768cdeb 100644
--- a/src/devices/video/mc6845.h
+++ b/src/devices/video/mc6845.h
@@ -330,6 +330,8 @@ public:
hd6845s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ hd6845s_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
virtual void device_start() override;
virtual void device_reset() override;
virtual bool check_cursor_visible(uint16_t ra, uint16_t line_addr) override;
@@ -357,7 +359,7 @@ protected:
// HD6345/HD6445 CRTC-II
// http://bitsavers.informatik.uni-stuttgart.de/pdf/hitachi/_dataBooks/1987_Hitachi_8_16_Bit_Peripheral_LSI_Data_Book.pdf, pp. 99
-class hd6345_device : public mc6845_device
+class hd6345_device : public hd6845s_device
{
public:
hd6345_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/video/ppu2c0x_vt.cpp b/src/devices/video/ppu2c0x_vt.cpp
index 8fc25cf88cd..44cc2ea14fe 100644
--- a/src/devices/video/ppu2c0x_vt.cpp
+++ b/src/devices/video/ppu2c0x_vt.cpp
@@ -16,11 +16,11 @@
#define VISIBLE_SCREEN_WIDTH (32*8) /* Visible screen width */
// devices
-DEFINE_DEVICE_TYPE(PPU_VT03, ppu_vt03_device, "ppu_vt03", "VT03 PPU")
+DEFINE_DEVICE_TYPE(PPU_VT03, ppu_vt03_device, "ppu_vt03", "VT03 PPU (NTSC)")
+DEFINE_DEVICE_TYPE(PPU_VT03PAL, ppu_vt03pal_device, "ppu_vt03pal", "VT03 PPU (PAL)")
-
-ppu_vt03_device::ppu_vt03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : ppu2c0x_device(mconfig, PPU_VT03, tag, owner, clock),
+ppu_vt03_device::ppu_vt03_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ ppu2c0x_device(mconfig, type, tag, owner, clock),
m_read_bg(*this),
m_read_sp(*this)
{
@@ -28,6 +28,20 @@ ppu_vt03_device::ppu_vt03_device(const machine_config &mconfig, const char *tag,
m_2012_2017_descramble[i] = 2 + i;
}
+ppu_vt03_device::ppu_vt03_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) :
+ ppu_vt03_device(mconfig, PPU_VT03, tag, owner, clock)
+{
+}
+
+
+ppu_vt03pal_device::ppu_vt03pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ ppu_vt03_device(mconfig, PPU_VT03PAL, tag, owner, clock)
+{
+ m_scanlines_per_frame = PAL_SCANLINES_PER_FRAME;
+ m_vblank_first_scanline = VBLANK_FIRST_SCANLINE_PALC;
+}
+
+
READ8_MEMBER(ppu_vt03_device::palette_read)
{
if (m_201x_regs[0] & 0x80)
diff --git a/src/devices/video/ppu2c0x_vt.h b/src/devices/video/ppu2c0x_vt.h
index cfc2cacc525..7801ce44351 100644
--- a/src/devices/video/ppu2c0x_vt.h
+++ b/src/devices/video/ppu2c0x_vt.h
@@ -25,7 +25,8 @@ enum vtxx_pal_mode {
class ppu_vt03_device : public ppu2c0x_device {
public:
- ppu_vt03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ ppu_vt03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ ppu_vt03_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
auto read_bg() { return m_read_bg.bind(); }
auto read_sp() { return m_read_sp.bind(); }
@@ -84,6 +85,12 @@ private:
void set_new_pen(int i);
};
+class ppu_vt03pal_device : public ppu_vt03_device {
+public:
+ ppu_vt03pal_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock);
+};
+
DECLARE_DEVICE_TYPE(PPU_VT03, ppu_vt03_device)
+DECLARE_DEVICE_TYPE(PPU_VT03PAL, ppu_vt03pal_device)
#endif // MAME_VIDEO_PPU_VT03_H
diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp
index 43fbeeac74f..1fd564beea5 100644
--- a/src/devices/video/snes_ppu.cpp
+++ b/src/devices/video/snes_ppu.cpp
@@ -1,5 +1,5 @@
-// license:BSD-3-Clause
-// copyright-holders:Anthony Kruize, Fabio Priuli
+// license:GPL-2.0+
+// copyright-holders:byuu, Anthony Kruize, Fabio Priuli
/***************************************************************************
snes.c
@@ -82,7 +82,7 @@
#define SNES_CLIP_OUT 2
#define SNES_CLIP_ALWAYS 3
-#define SNES_VRAM_SIZE 0x10000 /* 128kb of video ram */
+#define SNES_VRAM_SIZE 0x10000 /* 64kb of video ram */
#define SNES_CGRAM_SIZE 0x202 /* 256 16-bit colours + 1 tacked on 16-bit colour for fixed colour */
#define SNES_OAM_SIZE 0x440 /* 1088 bytes of Object Attribute Memory */
#define FIXED_COLOUR 256 /* Position in cgram for fixed colour */
@@ -160,18 +160,6 @@
//static const uint16_t dbg_mode_colours[8] = { 0x1f, 0x3e0, 0x7c00, 0x7c1f, 0x3ff, 0x7fe0, 0x4210, 0x7fff };
#endif /* SNES_LAYER_DEBUG */
-static const uint16_t table_obj_offset[8][8] =
-{
- { (0*32), (0*32)+32, (0*32)+64, (0*32)+96, (0*32)+128, (0*32)+160, (0*32)+192, (0*32)+224 },
- { (16*32), (16*32)+32, (16*32)+64, (16*32)+96, (16*32)+128, (16*32)+160, (16*32)+192, (16*32)+224 },
- { (32*32), (32*32)+32, (32*32)+64, (32*32)+96, (32*32)+128, (32*32)+160, (32*32)+192, (32*32)+224 },
- { (48*32), (48*32)+32, (48*32)+64, (48*32)+96, (48*32)+128, (48*32)+160, (48*32)+192, (48*32)+224 },
- { (64*32), (64*32)+32, (64*32)+64, (64*32)+96, (64*32)+128, (64*32)+160, (64*32)+192, (64*32)+224 },
- { (80*32), (80*32)+32, (80*32)+64, (80*32)+96, (80*32)+128, (80*32)+160, (80*32)+192, (80*32)+224 },
- { (96*32), (96*32)+32, (96*32)+64, (96*32)+96, (96*32)+128, (96*32)+160, (96*32)+192, (96*32)+224 },
- { (112*32), (112*32)+32, (112*32)+64, (112*32)+96, (112*32)+128, (112*32)+160, (112*32)+192, (112*32)+224 }
-};
-
enum
{
@@ -214,7 +202,6 @@ snes_ppu_device::snes_ppu_device(const machine_config &mconfig, const char *tag,
{
}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -227,6 +214,26 @@ void snes_ppu_device::device_start()
m_cgram = std::make_unique<uint16_t[]>(SNES_CGRAM_SIZE/2);
m_oam_ram = std::make_unique<uint16_t[]>(SNES_OAM_SIZE/2);
+ m_light_table = std::make_unique<std::unique_ptr<uint16_t[]>[]>(16);
+ for (uint8_t l = 0; l < 16; l++)
+ {
+ m_light_table[l] = std::make_unique<uint16_t[]>(32768);
+ for (uint8_t r = 0; r < 32; r++)
+ {
+ for (uint8_t g = 0; g < 32; g++)
+ {
+ for (uint8_t b = 0; b < 32; b++)
+ {
+ double luma = (double)l / 15.0;
+ uint8_t ar = (uint8_t)(luma * r + 0.5);
+ uint8_t ag = (uint8_t)(luma * g + 0.5);
+ uint8_t ab = (uint8_t)(luma * b + 0.5);
+ m_light_table[l][r << 10 | g << 5 | b << 0] = ar << 10 | ag << 5 | ab << 0;
+ }
+ }
+ }
+ }
+
for (int i = 0; i < 2; i++)
{
save_item(NAME(m_scanlines[i].enable), i);
@@ -528,178 +535,107 @@ inline void snes_ppu_device::set_scanline_pixel( int screen, int16_t x, uint16_t
*************************************************************************************************/
/*****************************************
- * draw_bgtile_lores()
- * draw_bgtile_hires()
- * draw_oamtile_()
+ * render_window()
*
- * Check if a pixel is clipped or not, and
- * copy it to the scanline buffer when
- * appropriate. The actual way to perform
- * such operations depends on the source
- * (BG or OAM) and on the resolution (hires
- * or lores)
+ * An example of how windows work:
+ * Win1: ...#####......
+ * Win2: ......#####...
+ * IN OUT
+ * OR: ...########... ###........###
+ * AND: ......##...... ######..######
+ * XOR: ...###..###... ###...##...###
+ * XNOR: ###...##...### ...###..###...
*****************************************/
-inline void snes_ppu_device::draw_bgtile_lores( uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority )
+void snes_ppu_device::render_window(uint16_t layer_idx, uint8_t enable, uint8_t *output)
{
- for (int screen = SNES_MAINSCREEN; screen <= SNES_SUBSCREEN; screen++)
+ layer_t &self = m_layer[layer_idx];
+ if (!enable || (!self.window1_enabled && !self.window2_enabled))
{
- if (ii >= 0 && ii < SNES_SCR_WIDTH && m_scanlines[screen].enable)
- {
- if (m_scanlines[screen].priority[ii] <= priority)
- {
- uint8_t clr = colour;
- uint8_t clipmask = m_clipmasks[layer][ii];
-
-#if SNES_LAYER_DEBUG
- if (m_debug_options.windows_disabled)
- clipmask = 0xff;
-#endif /* SNES_LAYER_DEBUG */
-
- /* Clip to windows */
- if (m_scanlines[screen].clip)
- clr &= clipmask;
+ memset(output, 0, 256);
+ return;
+ }
- /* Only draw if we have a colour (0 == transparent) */
- if (clr)
- {
- uint16_t c = get_bgcolor(direct_colors, pal, clr);
- set_scanline_pixel(screen, ii, c, priority, layer, 0);
- }
- }
+ if (self.window1_enabled && !self.window2_enabled)
+ {
+ const uint8_t set = 1 ^ self.window1_invert;
+ const uint8_t clear = 1 - set;
+ for (uint16_t x = 0; x < 256; x++)
+ {
+ output[x] = (x >= m_window1_left && x <= m_window1_right) ? set : clear;
}
+ return;
}
-}
-inline void snes_ppu_device::draw_bgtile_hires( uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority )
-{
- for (int screen = SNES_MAINSCREEN; screen <= SNES_SUBSCREEN; screen++)
+ if (self.window2_enabled && !self.window1_enabled)
{
- // odd pixels to main screen, even pixels to sub screen
- if (ii >= 0 && ii < (SNES_SCR_WIDTH << 1) && ((ii & 1) ^ screen) && m_scanlines[screen].enable)
+ const uint8_t set = 1 ^ self.window2_invert;
+ const uint8_t clear = 1 - set;
+ for (uint16_t x = 0; x < 256; x++)
{
- if (m_scanlines[screen].priority[ii >> 1] <= priority)
- {
- uint8_t clr = colour;
- uint8_t clipmask = m_clipmasks[layer][ii >> 1];
-
-#if SNES_LAYER_DEBUG
- if (m_debug_options.windows_disabled)
- clipmask = 0xff;
-#endif /* SNES_LAYER_DEBUG */
-
- /* Clip to windows */
- if (m_scanlines[screen].clip)
- clr &= clipmask;
-
- /* Only draw if we have a colour (0 == transparent) */
- if (clr)
- {
- uint16_t c = get_bgcolor(direct_colors, pal, clr);
- set_scanline_pixel(screen, ii >> 1, c, priority, layer, 0);
- }
- }
+ output[x] = (x >= m_window2_left && x <= m_window2_right) ? set : clear;
}
+ return;
}
-}
-inline void snes_ppu_device::draw_oamtile( int16_t ii, uint8_t colour, uint16_t pal, uint8_t priority )
-{
- int16_t pos = ii & 0x1ff;
-
- for (int screen = SNES_MAINSCREEN; screen <= SNES_SUBSCREEN; screen++)
+ for (uint16_t x = 0; x < 256; x++)
{
- if (pos >= 0 && pos < SNES_SCR_WIDTH && m_scanlines[screen].enable)
+ uint8_t one_mask = ((x >= m_window1_left && x <= m_window1_right) ? 1 : 0) ^ self.window1_invert;
+ uint8_t two_mask = ((x >= m_window2_left && x <= m_window2_right) ? 1 : 0) ^ self.window2_invert;
+ switch (self.wlog_mask)
{
- uint8_t clr = colour;
- uint8_t clipmask = m_clipmasks[SNES_OAM][pos];
-
-#if SNES_LAYER_DEBUG
- if (m_debug_options.windows_disabled)
- clipmask = 0xff;
-#endif /* SNES_LAYER_DEBUG */
-
- /* Clip to windows */
- if (m_scanlines[screen].clip)
- clr &= clipmask;
-
- /* Only draw if we have a colour (0 == transparent) */
- if (clr)
- {
- uint16_t c = m_cgram[(pal + clr) % FIXED_COLOUR];
- int blend = (pal + clr < 192) ? 1 : 0;
- set_scanline_pixel(screen, pos, c, priority, SNES_OAM, blend);
- }
+ case 0: output[x] = (one_mask | two_mask); break;
+ case 1: output[x] = (one_mask & two_mask); break;
+ case 2: output[x] = (one_mask ^ two_mask); break;
+ case 3: output[x] = 1 - (one_mask ^ two_mask); break;
}
}
}
/*****************************************
- * draw_tile()
+ * draw_oamtile()
*
- * Draw 8 pixels from the expected tile
+ * Draw 8 pixels from the expected OAM
+ * tile into priority/palette buffers
* by reading the color planes from vram
- * and by calling the appropriate routine
- * (depending on layer and resolution)
+ * and by calling draw_oamtile
*****************************************/
-inline void snes_ppu_device::draw_tile( uint8_t planes, uint8_t layer, uint32_t tileaddr, int16_t x, uint8_t priority, uint8_t flip, uint8_t direct_colors, uint16_t pal, uint8_t hires )
+inline void snes_ppu_device::draw_oamtile( uint32_t tileaddr, int16_t tile_x, uint8_t priority, uint8_t flip, uint16_t pal, uint8_t *palbuf, uint8_t *pribuf )
{
- uint8_t plane[8];
- int16_t ii, jj;
- int x_mos;
+ uint8_t plane[4];
- for (ii = 0; ii < planes / 2; ii++)
+ for (int16_t ii = 0; ii < 2; ii++)
{
- plane[2 * ii + 0] = m_vram[(tileaddr + 16 * ii + 0) % SNES_VRAM_SIZE];
- plane[2 * ii + 1] = m_vram[(tileaddr + 16 * ii + 1) % SNES_VRAM_SIZE];
+ plane[2 * ii + 0] = m_vram[((tileaddr << 1) + 16 * ii + 0) % SNES_VRAM_SIZE];
+ plane[2 * ii + 1] = m_vram[((tileaddr << 1) + 16 * ii + 1) % SNES_VRAM_SIZE];
}
- for (ii = x; ii < (x + 8); ii++)
+ for (int16_t x = 0; x < 8; x++)
{
- uint8_t colour = 0;
- uint8_t mosaic = m_layer[layer].mosaic_enabled;
-
-#if SNES_LAYER_DEBUG
- if (m_debug_options.mosaic_disabled)
- mosaic = 0;
-#endif /* SNES_LAYER_DEBUG */
-
- if (flip)
- {
- for (jj = 0; jj < planes; jj++)
- colour |= BIT(plane[jj], ii - x) ? (1 << jj) : 0;
- }
- else
+ tile_x &= 0x01ff;
+ if (tile_x < 256)
{
- for (jj = 0; jj < planes; jj++)
- colour |= BIT(plane[jj], 7 - (ii - x)) ? (1 << jj) : 0;
- }
+ uint8_t colour = 0;
- if (layer == SNES_OAM)
- draw_oamtile(ii, colour, pal, priority);
- else if (!hires)
- {
- if (mosaic)
+ if (flip)
{
- for (x_mos = 0; x_mos < (m_mosaic_size + 1); x_mos++)
- draw_bgtile_lores(layer, ii + x_mos, colour, pal, direct_colors, priority);
- ii += x_mos - 1;
+ for (int16_t jj = 0; jj < 4; jj++)
+ colour |= BIT(plane[jj], x) ? (1 << jj) : 0;
}
else
- draw_bgtile_lores(layer, ii, colour, pal, direct_colors, priority);
- }
- else /* hires */
- {
- if (mosaic)
{
- for (x_mos = 0; x_mos < (m_mosaic_size + 1); x_mos++)
- draw_bgtile_hires(layer, ii + x_mos, colour, pal, direct_colors, priority);
- ii += x_mos - 1;
+ for (int16_t jj = 0; jj < 4; jj++)
+ colour |= BIT(plane[jj], 7 - x) ? (1 << jj) : 0;
+ }
+
+ if (colour)
+ {
+ palbuf[tile_x] = pal + colour;
+ pribuf[tile_x] = priority;
}
- else
- draw_bgtile_hires(layer, ii, colour, pal, direct_colors, priority);
}
+ tile_x++;
}
}
@@ -738,26 +674,39 @@ inline uint32_t snes_ppu_device::get_tile( uint8_t layer_idx, uint32_t hoffset,
}
/*********************************************
- * get_tmap_addr()
+ * plot_above()
*
- * Find the address in VRAM of the tile (x,y)
+ * Update a main-screen pixel based on
+ * priority.
*********************************************/
-inline uint32_t snes_ppu_device::get_tmap_addr( uint8_t layer, uint8_t hires, uint8_t tile_size, uint32_t base, uint32_t x, uint32_t y )
+inline void snes_ppu_device::plot_above( uint16_t x, uint8_t source, uint8_t priority, uint16_t color, int blend_exception )
{
- uint32_t res = base;
- x >>= (3 + tile_size);
- y >>= (3 + tile_size);
-
- res += (m_layer[layer].tilemap_size & 2) ? ((y & 0x20) << ((m_layer[layer].tilemap_size & 1) ? 7 : 6)) : 0;
- /* Scroll vertically */
- res += (y & 0x1f) << 6;
- /* Offset horizontally */
- res += (m_layer[layer].tilemap_size & 1) ? ((x & 0x20) << 6) : 0;
- /* Scroll horizontally */
- res += (x & 0x1f) << 1;
+ if (priority > m_scanlines[SNES_MAINSCREEN].priority[x])
+ {
+ m_scanlines[SNES_MAINSCREEN].priority[x] = priority;
+ m_scanlines[SNES_MAINSCREEN].buffer[x] = color;
+ m_scanlines[SNES_MAINSCREEN].layer[x] = source;
+ m_scanlines[SNES_MAINSCREEN].blend_exception[x] = blend_exception;
+ }
+}
- return res;
+/*********************************************
+ * plot_below()
+ *
+ * Update a sub-screen pixel based on
+ * priority.
+ *********************************************/
+
+inline void snes_ppu_device::plot_below( uint16_t x, uint8_t source, uint8_t priority, uint16_t color, int blend_exception )
+{
+ if (priority > m_scanlines[SNES_SUBSCREEN].priority[x])
+ {
+ m_scanlines[SNES_SUBSCREEN].priority[x] = priority;
+ m_scanlines[SNES_SUBSCREEN].buffer[x] = color;
+ m_scanlines[SNES_SUBSCREEN].layer[x] = source;
+ m_scanlines[SNES_SUBSCREEN].blend_exception[x] = blend_exception;
+ }
}
/*********************************************
@@ -766,7 +715,7 @@ inline uint32_t snes_ppu_device::get_tmap_addr( uint8_t layer, uint8_t hires, ui
* Update an entire line of tiles.
*********************************************/
-inline void snes_ppu_device::update_line( uint16_t curline, uint8_t layer_idx, uint8_t direct_colors )
+void snes_ppu_device::update_line( uint16_t curline, uint8_t layer_idx, uint8_t direct_colors )
{
layer_t &layer = m_layer[layer_idx];
@@ -779,14 +728,17 @@ inline void snes_ppu_device::update_line( uint16_t curline, uint8_t layer_idx, u
m_scanlines[SNES_MAINSCREEN].enable = layer.main_bg_enabled;
m_scanlines[SNES_SUBSCREEN].enable = layer.sub_bg_enabled;
- m_scanlines[SNES_MAINSCREEN].clip = layer.main_window_enabled;
- m_scanlines[SNES_SUBSCREEN].clip = layer.sub_window_enabled;
if (!m_scanlines[SNES_MAINSCREEN].enable && !m_scanlines[SNES_SUBSCREEN].enable)
{
return;
}
+ uint8_t window_above[256];
+ uint8_t window_below[256];
+ render_window(layer_idx, layer.main_window_enabled, window_above);
+ render_window(layer_idx, layer.sub_window_enabled, window_below);
+
bool hires = m_mode == 5 || m_mode == 6;
bool opt_mode = m_mode == 2 || m_mode == 4 || m_mode == 6;
bool direct_color_mode = direct_colors && layer_idx == SNES_BG1 && (m_mode == 3 || m_mode == 4);
@@ -808,7 +760,6 @@ inline void snes_ppu_device::update_line( uint16_t curline, uint8_t layer_idx, u
uint32_t y = layer.mosaic_enabled ? layer.mosaic_offset : curline;
- //printf("h:%d i:%d l:%d ", hires ? 1 : 0, m_interlace, curline);
if (hires)
{
hscroll <<= 1;
@@ -919,50 +870,26 @@ inline void snes_ppu_device::update_line( uint16_t curline, uint8_t layer_idx, u
}
else
{
- mosaic_color = m_cgram[palette_index + mosaic_palette];
+ mosaic_color = m_cgram[(palette_index + mosaic_palette) % FIXED_COLOUR];
}
}
if (!mosaic_palette) continue;
if (!hires)
{
- if (layer.main_bg_enabled && mosaic_priority > m_scanlines[SNES_MAINSCREEN].priority[x])
- {
- if (!m_scanlines[SNES_MAINSCREEN].clip || m_clipmasks[layer_idx][x])
- {
- set_scanline_pixel(SNES_MAINSCREEN, x, mosaic_color, mosaic_priority, layer_idx, 0);
- }
- }
- if (layer.sub_bg_enabled && mosaic_priority > m_scanlines[SNES_SUBSCREEN].priority[x])
- {
- if (!m_scanlines[SNES_SUBSCREEN].clip || m_clipmasks[layer_idx][x])
- {
- set_scanline_pixel(SNES_SUBSCREEN, x, mosaic_color, mosaic_priority, layer_idx, 0);
- }
- }
+ if (layer.main_bg_enabled && window_above[x] == 0) plot_above(x, layer_idx, mosaic_priority, mosaic_color);
+ if (layer.sub_bg_enabled && window_below[x] == 0) plot_below(x, layer_idx, mosaic_priority, mosaic_color);
}
else
{
uint32_t _x = x >> 1;
if (x & 1)
{
- if (layer.main_bg_enabled && mosaic_priority > m_scanlines[SNES_MAINSCREEN].priority[_x])
- {
- if (!m_scanlines[SNES_MAINSCREEN].clip || m_clipmasks[layer_idx][_x])
- {
- set_scanline_pixel(SNES_MAINSCREEN, _x, mosaic_color, mosaic_priority, layer_idx, 0);
- }
- }
+ if (layer.main_bg_enabled && window_above[_x] == 0) plot_above(_x, layer_idx, mosaic_priority, mosaic_color);
}
else
{
- if (layer.sub_bg_enabled && mosaic_priority > m_scanlines[SNES_SUBSCREEN].priority[_x])
- {
- if (!m_scanlines[SNES_SUBSCREEN].clip || m_clipmasks[layer_idx][_x])
- {
- set_scanline_pixel(SNES_SUBSCREEN, _x, mosaic_color, mosaic_priority, layer_idx, 0);
- }
- }
+ if (layer.sub_bg_enabled && window_below[_x] == 0) plot_below(_x, layer_idx, mosaic_priority, mosaic_color);
}
}
}
@@ -978,168 +905,76 @@ inline void snes_ppu_device::update_line( uint16_t curline, uint8_t layer_idx, u
#define MODE7_CLIP(x) (((x) & 0x2000) ? ((x) | ~0x03ff) : ((x) & 0x03ff))
-void snes_ppu_device::update_line_mode7( uint16_t curline, uint8_t layer )
+void snes_ppu_device::update_line_mode7( uint16_t curline, uint8_t layer_idx )
{
- uint8_t priority_a = m_layer[layer].priority[0];
- uint8_t priority_b = m_layer[layer].priority[1];
- uint32_t tiled;
- int16_t ma, mb, mc, md;
- int32_t xc, yc, tx, ty, sx, sy, hs, vs, xpos, xdir, x0, y0;
- uint8_t priority = priority_b;
- uint8_t colour = 0;
- uint16_t *mosaic_x, *mosaic_y;
- uint16_t c;
- int screen;
-
-#if SNES_LAYER_DEBUG
- if (m_debug_options.bg_disabled[layer])
- return;
-#endif /* SNES_LAYER_DEBUG */
-
- m_scanlines[SNES_MAINSCREEN].enable = m_layer[layer].main_bg_enabled;
- m_scanlines[SNES_SUBSCREEN].enable = m_layer[layer].sub_bg_enabled;
- m_scanlines[SNES_MAINSCREEN].clip = m_layer[layer].main_window_enabled;
- m_scanlines[SNES_SUBSCREEN].clip = m_layer[layer].sub_window_enabled;
-
- if (!m_scanlines[SNES_MAINSCREEN].enable && !m_scanlines[SNES_SUBSCREEN].enable)
- return;
-
- ma = m_mode7.matrix_a;
- mb = m_mode7.matrix_b;
- mc = m_mode7.matrix_c;
- md = m_mode7.matrix_d;
- xc = m_mode7.origin_x;
- yc = m_mode7.origin_y;
- hs = m_mode7.hor_offset;
- vs = m_mode7.ver_offset;
-
- /* Sign extend */
- xc <<= 19;
- xc >>= 19;
- yc <<= 19;
- yc >>= 19;
- hs <<= 19;
- hs >>= 19;
- vs <<= 19;
- vs >>= 19;
-
- /* Vertical flip */
- if (m_mode7.vflip)
- sy = 255 - curline;
- else
- sy = curline;
-
- /* Horizontal flip */
- if (m_mode7.hflip)
- {
- xpos = 255;
- xdir = -1;
- }
- else
- {
- xpos = 0;
- xdir = 1;
- }
+ layer_t &self = m_layer[layer_idx];
+ int _y = self.mosaic_enabled ? self.mosaic_offset : curline;
+ int y = !m_mode7.vflip ? _y : 255 - _y;
+
+ int a = m_mode7.matrix_a;
+ int b = m_mode7.matrix_b;
+ int c = m_mode7.matrix_c;
+ int d = m_mode7.matrix_d;
+ int hcenter = (m_mode7.origin_x << 19) >> 19;
+ int vcenter = (m_mode7.origin_y << 19) >> 19;
+ int hoffset = (m_mode7.hor_offset << 19) >> 19;
+ int voffset = (m_mode7.ver_offset << 19) >> 19;
- /* MOSAIC - to be verified */
- if (layer == SNES_BG2) // BG2 use two different bits for horizontal and vertical mosaic
- {
- mosaic_x = m_mosaic_table[m_layer[SNES_BG2].mosaic_enabled ? m_mosaic_size : 0];
- mosaic_y = m_mosaic_table[m_layer[SNES_BG1].mosaic_enabled ? m_mosaic_size : 0];
- }
- else // BG1 works as usual
- {
- mosaic_x = m_mosaic_table[m_layer[SNES_BG1].mosaic_enabled ? m_mosaic_size : 0];
- mosaic_y = m_mosaic_table[m_layer[SNES_BG1].mosaic_enabled ? m_mosaic_size : 0];
- }
+ uint32_t mosaic_counter = 1;
+ uint32_t mosaic_palette = 0;
+ uint8_t mosaic_priority = 0;
+ uint16_t mosaic_color = 0;
-#if SNES_LAYER_DEBUG
- if (m_debug_options.mosaic_disabled)
- {
- mosaic_x = m_mosaic_table[0];
- mosaic_y = m_mosaic_table[0];
- }
-#endif /* SNES_LAYER_DEBUG */
+ int origin_x = (a * MODE7_CLIP(hoffset - hcenter) & ~63) + (b * MODE7_CLIP(voffset - vcenter) & ~63) + (b * y & ~63) + (hcenter << 8);
+ int origin_y = (c * MODE7_CLIP(hoffset - hcenter) & ~63) + (d * MODE7_CLIP(voffset - vcenter) & ~63) + (d * y & ~63) + (vcenter << 8);
- /* Let's do some mode7 drawing huh? */
- /* These can be computed only once, since they do not depend on sx */
- x0 = ((ma * MODE7_CLIP(hs - xc)) & ~0x3f) + ((mb * mosaic_y[sy]) & ~0x3f) + ((mb * MODE7_CLIP(vs - yc)) & ~0x3f) + (xc << 8);
- y0 = ((mc * MODE7_CLIP(hs - xc)) & ~0x3f) + ((md * mosaic_y[sy]) & ~0x3f) + ((md * MODE7_CLIP(vs - yc)) & ~0x3f) + (yc << 8);
+ uint8_t window_above[256];
+ uint8_t window_below[256];
+ render_window(layer_idx, self.main_window_enabled, window_above);
+ render_window(layer_idx, self.sub_window_enabled, window_below);
- for (sx = 0; sx < 256; sx++, xpos += xdir)
+ for (int _x = 0; _x < 256; _x++)
{
- tx = (x0 + (ma * mosaic_x[sx])) >> 8;
- ty = (y0 + (mc * mosaic_x[sx])) >> 8;
-
- switch (m_mode7.repeat)
+ int x = !m_mode7.hflip ? _x : 255 - _x;
+ int pixel_x = (origin_x + (a * x)) >> 8;
+ int pixel_y = (origin_y + (c * x)) >> 8;
+ int tile_x = (pixel_x >> 3) & 0x7f;
+ int tile_y = (pixel_y >> 3) & 0x7f;
+ bool out_of_bounds = (pixel_x | pixel_y) & ~0x03ff;
+ uint16_t tile_address = (tile_y * 0x80 + tile_x) << 1;
+ uint16_t palette_address = (((pixel_y & 7) << 3) + (pixel_x & 7)) & 0x7fff;
+ uint8_t tile = m_mode7.repeat == 3 && out_of_bounds ? 0 : m_vram[tile_address];
+ uint8_t palette = m_mode7.repeat == 2 && out_of_bounds ? 0 : m_vram[((tile << 6 | palette_address) << 1) | 1];
+
+ uint8_t priority = 0;
+ if (layer_idx == SNES_BG1)
{
- case 0x00: /* Repeat if outside screen area */
- case 0x01: /* Repeat if outside screen area */
- tx &= 0x3ff;
- ty &= 0x3ff;
- tiled = m_vram[((((tx >> 3) & 0x7f) + (((ty >> 3) & 0x7f) * 128)) * 2) % SNES_VRAM_SIZE] << 7;
- colour = m_vram[(tiled + ((tx & 0x07) * 2) + ((ty & 0x07) * 16) + 1) % SNES_VRAM_SIZE];
- break;
- case 0x02: /* Single colour backdrop screen if outside screen area */
- if ((tx >= 0) && (tx < 1024) && (ty >= 0) && (ty < 1024))
- {
- tiled = m_vram[((((tx >> 3) & 0x7f) + (((ty >> 3) & 0x7f) * 128)) * 2) % SNES_VRAM_SIZE] << 7;
- colour = m_vram[(tiled + ((tx & 0x07) * 2) + ((ty & 0x07) * 16) + 1) % SNES_VRAM_SIZE];
- }
- else
- colour = 0;
- break;
- case 0x03: /* Character 0x00 repeat if outside screen area */
- if ((tx >= 0) && (tx < 1024) && (ty >= 0) && (ty < 1024))
- tiled = m_vram[((((tx >> 3) & 0x7f) + (((ty >> 3) & 0x7f) * 128)) * 2) % SNES_VRAM_SIZE] << 7;
- else
- tiled = 0;
-
- colour = m_vram[(tiled + ((tx & 0x07) * 2) + ((ty & 0x07) * 16) + 1) % SNES_VRAM_SIZE];
- break;
+ priority = self.priority[0];
}
-
- /* The last bit is for priority in EXTBG mode (used only for BG2) */
- if (layer == SNES_BG2)
+ else if (layer_idx == SNES_BG2)
{
- priority = ((colour & 0x80) >> 7) ? priority_a : priority_b;
- colour &= 0x7f;
-
-#if SNES_LAYER_DEBUG
- /* if we want to draw only one of the priorities of this layer */
- if (((m_debug_options.select_pri[layer] & 0x01) && (priority == priority_a)) ||
- ((m_debug_options.select_pri[layer] & 0x02) && (priority == priority_b)))
- continue;
-#endif /* SNES_LAYER_DEBUG */
+ priority = self.priority[palette >> 7];
+ palette &= 0x7f;
}
- for (screen = SNES_MAINSCREEN; screen <= SNES_SUBSCREEN; screen++)
+ if (!self.mosaic_enabled || --mosaic_counter == 0)
{
- if (m_scanlines[screen].enable)
+ mosaic_counter = 1 + m_mosaic_size;
+ mosaic_palette = palette;
+ mosaic_priority = priority;
+ if (m_direct_color && layer_idx == SNES_BG1)
{
- uint8_t clr = colour;
- uint8_t clipmask = m_clipmasks[layer][xpos];
-
-#if SNES_LAYER_DEBUG
- if (m_debug_options.windows_disabled)
- clipmask = 0xff;
-#endif /* SNES_LAYER_DEBUG */
-
- /* Clip to windows */
- if (m_scanlines[screen].clip)
- clr &= clipmask;
-
- /* Draw pixel if appropriate */
- if (m_scanlines[screen].priority[xpos] <= priority && clr > 0)
- {
- /* Direct select, but only outside EXTBG! */
- // Direct color format is: 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded.
- // In other words, like normal direct color, with pal = 0
- c = get_bgcolor(m_direct_color && layer == SNES_BG1, 0, clr);
- set_scanline_pixel(screen, xpos, c, priority, layer, 0);
- }
+ mosaic_color = direct_color(0, palette);
+ }
+ else
+ {
+ mosaic_color = m_cgram[palette];
}
}
+ if (!mosaic_palette) continue;
+
+ if (self.main_bg_enabled && window_above[_x] == 0) plot_above(_x, layer_idx, mosaic_priority, mosaic_color);
+ if (self.sub_bg_enabled && window_below[_x] == 0) plot_below(_x, layer_idx, mosaic_priority, mosaic_color);
}
}
@@ -1287,7 +1122,7 @@ void snes_ppu_device::oam_list_build( void )
/*********************************************
* is_sprite_on_scanline()
*
- * Check if a given sprites intersect current
+ * Check if a given sprite intersects current
* scanline
*********************************************/
@@ -1325,7 +1160,6 @@ void snes_ppu_device::update_objects_rto( uint16_t curline )
uint8_t height, width, vflip, hflip, priority, pal;
uint16_t tile;
int16_t x, y;
- uint32_t name_sel;
oam_list_build();
@@ -1383,7 +1217,7 @@ void snes_ppu_device::update_objects_rto( uint16_t curline )
if (curline >= y && curline < (y + (height << 3)))
{
/* Only objects using tiles over 255 use name select */
- name_sel = (tile < 256) ? 0 : m_oam.name_select;
+ uint32_t name_sel = (tile < 256) ? 0 : ((1 + m_oam.name_select) << 12);
ys = (curline - y) >> 3;
line = (curline - y) % 8;
@@ -1392,8 +1226,9 @@ void snes_ppu_device::update_objects_rto( uint16_t curline )
ys = height - ys - 1;
line = 7 - line;
}
- line <<= 1;
- tile <<= 5;
+
+ uint16_t character_x = tile & 15;
+ uint16_t character_y = (((tile >> 4) + ys) & 15) << 4;
for (jj = 0; jj < width; jj++)
{
@@ -1406,7 +1241,9 @@ void snes_ppu_device::update_objects_rto( uint16_t curline )
break;
xs = (hflip) ? (width - 1 - jj) : jj;
- m_oam_tilelist[time_over - 1].tileaddr = name_sel + tile + table_obj_offset[ys][xs] + line;
+ m_oam_tilelist[time_over - 1].tileaddr = name_sel + ((character_y + ((character_x + xs) & 15)) << 4);
+ m_oam_tilelist[time_over - 1].tileaddr &= 0x7ff0;
+ m_oam_tilelist[time_over - 1].tileaddr += line;
m_oam_tilelist[time_over - 1].hflip = hflip;
m_oam_tilelist[time_over - 1].x = xx;
m_oam_tilelist[time_over - 1].pal = pal;
@@ -1443,23 +1280,30 @@ void snes_ppu_device::update_objects( uint8_t priority_oam0, uint8_t priority_oa
m_scanlines[SNES_MAINSCREEN].enable = m_layer[SNES_OAM].main_bg_enabled;
m_scanlines[SNES_SUBSCREEN].enable = m_layer[SNES_OAM].sub_bg_enabled;
- m_scanlines[SNES_MAINSCREEN].clip = m_layer[SNES_OAM].main_window_enabled;
- m_scanlines[SNES_SUBSCREEN].clip = m_layer[SNES_OAM].sub_window_enabled;
if (!m_scanlines[SNES_MAINSCREEN].enable && !m_scanlines[SNES_SUBSCREEN].enable)
return;
- charaddr = m_layer[SNES_OAM].charmap << 13;
+ uint8_t window_above[256];
+ uint8_t window_below[256];
+ render_window(SNES_OAM, m_layer[SNES_OAM].main_window_enabled, window_above);
+ render_window(SNES_OAM, m_layer[SNES_OAM].sub_window_enabled, window_below);
+
+ charaddr = m_layer[SNES_OAM].charmap;
priority[0] = priority_oam0;
priority[1] = priority_oam1;
priority[2] = priority_oam2;
priority[3] = priority_oam3;
+ uint8_t palbuf[256] = {};
+ uint8_t pribuf[256] = {};
+
/* finally draw the tiles from the tilelist */
for (ii = 0; ii < 34; ii++)
{
int tile = ii;
+
#if SNES_LAYER_DEBUG
if (m_debug_options.sprite_reversed)
tile = 33 - ii;
@@ -1480,7 +1324,16 @@ void snes_ppu_device::update_objects( uint8_t priority_oam0, uint8_t priority_oa
#endif /* SNES_LAYER_DEBUG */
/* OAM tiles have fixed planes (4), no direct color and no hires, but otherwise work the same as BG ones */
- draw_tile(4, SNES_OAM, charaddr + m_oam_tilelist[tile].tileaddr, m_oam_tilelist[tile].x, pri, m_oam_tilelist[tile].hflip, 0, m_oam_tilelist[tile].pal, 0);
+ draw_oamtile(charaddr + m_oam_tilelist[tile].tileaddr, m_oam_tilelist[tile].x, pri, m_oam_tilelist[tile].hflip, m_oam_tilelist[tile].pal, palbuf, pribuf);
+ }
+
+ for (uint16_t x = 0; x < SNES_SCR_WIDTH; x++)
+ {
+ if (pribuf[x] == 0) continue;
+ uint16_t c = m_cgram[palbuf[x]];
+ int blend = (palbuf[x] < 192) ? 1 : 0;
+ if (m_layer[SNES_OAM].main_bg_enabled && window_above[x] == 0) plot_above(x, SNES_OAM, pribuf[x], c, blend);
+ if (m_layer[SNES_OAM].sub_bg_enabled && window_below[x] == 0) plot_below(x, SNES_OAM, pribuf[x], c, blend);
}
}
@@ -1498,11 +1351,11 @@ void snes_ppu_device::update_mode_0( uint16_t curline )
return;
#endif /* SNES_LAYER_DEBUG */
- update_objects(3, 6, 9, 12);
update_line(curline, SNES_BG1, 0);
update_line(curline, SNES_BG2, 0);
update_line(curline, SNES_BG3, 0);
update_line(curline, SNES_BG4, 0);
+ update_objects(3, 6, 9, 12);
}
void snes_ppu_device::update_mode_1( uint16_t curline )
@@ -1514,17 +1367,17 @@ void snes_ppu_device::update_mode_1( uint16_t curline )
if (!m_bg_priority)
{
- update_objects(2, 4, 7, 10);
update_line(curline, SNES_BG1, 0);
update_line(curline, SNES_BG2, 0);
update_line(curline, SNES_BG3, 0);
+ update_objects(2, 4, 7, 10);
}
else
{
- update_objects(2, 3, 6, 9);
update_line(curline, SNES_BG1, 0);
update_line(curline, SNES_BG2, 0);
update_line(curline, SNES_BG3, 0);
+ update_objects(2, 3, 6, 9);
}
}
@@ -1535,9 +1388,9 @@ void snes_ppu_device::update_mode_2( uint16_t curline )
return;
#endif /* SNES_LAYER_DEBUG */
- update_objects(2, 4, 6, 8);
update_line(curline, SNES_BG1, 0);
update_line(curline, SNES_BG2, 0);
+ update_objects(2, 4, 6, 8);
}
void snes_ppu_device::update_mode_3( uint16_t curline )
@@ -1547,9 +1400,9 @@ void snes_ppu_device::update_mode_3( uint16_t curline )
return;
#endif /* SNES_LAYER_DEBUG */
- update_objects(2, 4, 6, 8);
update_line(curline, SNES_BG1, m_direct_color);
update_line(curline, SNES_BG2, 0);
+ update_objects(2, 4, 6, 8);
}
void snes_ppu_device::update_mode_4( uint16_t curline )
@@ -1559,9 +1412,9 @@ void snes_ppu_device::update_mode_4( uint16_t curline )
return;
#endif /* SNES_LAYER_DEBUG */
- update_objects(2, 4, 6, 8);
update_line(curline, SNES_BG1, m_direct_color);
update_line(curline, SNES_BG2, 0);
+ update_objects(2, 4, 6, 8);
}
void snes_ppu_device::update_mode_5( uint16_t curline )
@@ -1571,9 +1424,9 @@ void snes_ppu_device::update_mode_5( uint16_t curline )
return;
#endif /* SNES_LAYER_DEBUG */
- update_objects(2, 4, 6, 8);
update_line(curline, SNES_BG1, 0);
update_line(curline, SNES_BG2, 0);
+ update_objects(2, 4, 6, 8);
}
void snes_ppu_device::update_mode_6( uint16_t curline )
@@ -1583,8 +1436,8 @@ void snes_ppu_device::update_mode_6( uint16_t curline )
return;
#endif /* SNES_LAYER_DEBUG */
- update_objects(1, 3, 4, 6);
update_line(curline, SNES_BG1, 0);
+ update_objects(1, 3, 4, 6);
}
void snes_ppu_device::update_mode_7( uint16_t curline )
@@ -1596,14 +1449,14 @@ void snes_ppu_device::update_mode_7( uint16_t curline )
if (!m_mode7.extbg)
{
- update_objects(1, 3, 4, 5);
update_line_mode7(curline, SNES_BG1);
+ update_objects(1, 3, 4, 5);
}
else
{
- update_objects(2, 4, 6, 7);
update_line_mode7(curline, SNES_BG1);
update_line_mode7(curline, SNES_BG2);
+ update_objects(2, 4, 6, 7);
}
}
@@ -1629,7 +1482,7 @@ void snes_ppu_device::draw_screens( uint16_t curline )
}
/*********************************************
- * update_windowmasks()
+ * update_color_windowmasks()
*
* An example of how windows work:
* Win1: ...#####......
@@ -1641,201 +1494,63 @@ void snes_ppu_device::draw_screens( uint16_t curline )
* XNOR: ###...##...### ...###..###...
*********************************************/
-void snes_ppu_device::update_windowmasks( void )
+void snes_ppu_device::update_color_windowmasks( uint8_t mask, uint8_t *output )
{
- m_update_windows = 0; /* reset the flag */
-
- for (uint16_t ii = 0; ii < SNES_SCR_WIDTH; ii++)
+ layer_t &self = m_layer[SNES_COLOR];
+ uint8_t set = 0, clear = 0;
+ switch (mask)
{
- /* update obj & color windows */
- /* jj = layer */
- for (uint16_t jj = 0; jj < 6; jj++)
- {
- m_clipmasks[jj][ii] = 0xff; /* let's start from un-masked */
- int8_t w1 = -1;
- int8_t w2 = -1;
-
- if (m_layer[jj].window1_enabled)
- {
- /* Default to mask area inside */
- if ((ii < m_window1_left) || (ii > m_window1_right))
- w1 = 0;
- else
- w1 = 1;
-
- /* If mask area is outside then swap */
- if (m_layer[jj].window1_invert)
- w1 = !w1;
- }
-
- if (m_layer[jj].window2_enabled)
- {
- if ((ii < m_window2_left) || (ii > m_window2_right))
- w2 = 0;
- else
- w2 = 1;
- if (m_layer[jj].window2_invert)
- w2 = !w2;
- }
-
- /* mask if the appropriate expression is true */
- if (w1 >= 0 && w2 >= 0)
- {
- switch (m_layer[jj].wlog_mask)
- {
- case 0x00: /* OR */
- m_clipmasks[jj][ii] = (w1 | w2) ? 0x00 : 0xff;
- break;
- case 0x01: /* AND */
- m_clipmasks[jj][ii] = (w1 & w2) ? 0x00 : 0xff;
- break;
- case 0x02: /* XOR */
- m_clipmasks[jj][ii] = (w1 ^ w2) ? 0x00 : 0xff;
- break;
- case 0x03: /* XNOR */
- m_clipmasks[jj][ii] = !(w1 ^ w2) ? 0x00 : 0xff;
- break;
- }
- }
- else if (w1 >= 0)
- m_clipmasks[jj][ii] = w1 ? 0x00 : 0xff;
- else if (w2 >= 0)
- m_clipmasks[jj][ii] = w2 ? 0x00 : 0xff;
- }
+ case 0: memset(output, 1, 256); return; // always
+ case 1: set = 1; clear = 0; break;
+ case 2: set = 0; clear = 1; break;
+ case 3: memset(output, 0, 256); return; // never
}
-}
-
-/*********************************************
- * update_offsets()
- *
- * Update the offsets with the latest changes.
- * This is currently unused, but it could
- * possibly be handy for some minor optimization
- *********************************************/
-void snes_ppu_device::update_offsets( void )
-{
- int ii;
- for (ii = 0; ii < 4; ii++)
+ if (!self.window1_enabled && !self.window2_enabled)
{
- }
- m_update_offsets = 0;
-}
-
-/*****************************************
- * draw_blend()
- *
- * Routine for additive/subtractive blending
- * between the main and sub screens, i.e.
- * color math.
- *****************************************/
-
-inline void snes_ppu_device::draw_blend( uint16_t offset, uint16_t *colour, uint8_t prevent_color_math, uint8_t black_pen_clip, int switch_screens )
-{
-#if SNES_LAYER_DEBUG
- if (m_debug_options.colormath_disabled)
- return;
-#endif /* SNES_LAYER_DEBUG */
-
- /* when color math is applied to subscreen pixels, the blending depends on the blending used by the previous mainscreen
- pixel, except for subscreen pixel 0 which has no previous mainscreen pixel, see comments in refresh_scanline */
- if (switch_screens && offset > 0)
- offset -= 1;
-
- if ((black_pen_clip == SNES_CLIP_ALWAYS) ||
- (black_pen_clip == SNES_CLIP_IN && m_clipmasks[SNES_COLOR][offset]) ||
- (black_pen_clip == SNES_CLIP_OUT && !m_clipmasks[SNES_COLOR][offset]))
- *colour = 0; //clip to black before color math
-
- if (prevent_color_math == SNES_CLIP_ALWAYS) // blending mode 3 == always OFF
+ memset(output, clear, 256);
return;
+ }
- if ((prevent_color_math == SNES_CLIP_NEVER) ||
- (prevent_color_math == SNES_CLIP_IN && !m_clipmasks[SNES_COLOR][offset]) ||
- (prevent_color_math == SNES_CLIP_OUT && m_clipmasks[SNES_COLOR][offset]))
+ if (self.window1_enabled && !self.window2_enabled)
{
- uint16_t r, g, b;
- struct SNES_SCANLINE *subscreen;
- int clip_max = 0; // if add then clip to 0x1f, if sub then clip to 0
-
-#if SNES_LAYER_DEBUG
- /* Toggle drawing of SNES_SUBSCREEN or SNES_MAINSCREEN */
- if (m_debug_options.draw_subscreen)
+ if (self.window1_invert)
{
- subscreen = switch_screens ? &m_scanlines[SNES_SUBSCREEN] : &m_scanlines[SNES_MAINSCREEN];
+ set ^= 1;
+ clear ^= 1;
}
- else
-#endif /* SNES_LAYER_DEBUG */
+ for (uint16_t x = 0; x < 256; x++)
{
- subscreen = switch_screens ? &m_scanlines[SNES_MAINSCREEN] : &m_scanlines[SNES_SUBSCREEN];
+ output[x] = (x >= m_window1_left && x <= m_window1_right) ? set : clear;
}
+ return;
+ }
- if (m_sub_add_mode) /* SNES_SUBSCREEN*/
+ if (self.window2_enabled && !self.window1_enabled)
+ {
+ if (self.window2_invert)
{
- if (!BIT(m_color_modes, 7))
- {
- /* 0x00 add */
- r = (*colour & 0x1f) + (subscreen->buffer[offset] & 0x1f);
- g = ((*colour & 0x3e0) >> 5) + ((subscreen->buffer[offset] & 0x3e0) >> 5);
- b = ((*colour & 0x7c00) >> 10) + ((subscreen->buffer[offset] & 0x7c00) >> 10);
- clip_max = 1;
- }
- else
- {
- /* 0x80 sub */
- r = (*colour & 0x1f) - (subscreen->buffer[offset] & 0x1f);
- g = ((*colour & 0x3e0) >> 5) - ((subscreen->buffer[offset] & 0x3e0) >> 5);
- b = ((*colour & 0x7c00) >> 10) - ((subscreen->buffer[offset] & 0x7c00) >> 10);
- if (r > 0x1f) r = 0;
- if (g > 0x1f) g = 0;
- if (b > 0x1f) b = 0;
- }
- /* only halve if the color is not the back colour */
- if (BIT(m_color_modes, 6) && (subscreen->buffer[offset] != m_cgram[FIXED_COLOUR]))
- {
- r >>= 1;
- g >>= 1;
- b >>= 1;
- }
+ set ^= 1;
+ clear ^= 1;
}
- else /* Fixed colour */
+ for (uint16_t x = 0; x < 256; x++)
{
- if (!BIT(m_color_modes, 7))
- {
- /* 0x00 add */
- r = (*colour & 0x1f) + (m_cgram[FIXED_COLOUR] & 0x1f);
- g = ((*colour & 0x3e0) >> 5) + ((m_cgram[FIXED_COLOUR] & 0x3e0) >> 5);
- b = ((*colour & 0x7c00) >> 10) + ((m_cgram[FIXED_COLOUR] & 0x7c00) >> 10);
- clip_max = 1;
- }
- else
- {
- /* 0x80: sub */
- r = (*colour & 0x1f) - (m_cgram[FIXED_COLOUR] & 0x1f);
- g = ((*colour & 0x3e0) >> 5) - ((m_cgram[FIXED_COLOUR] & 0x3e0) >> 5);
- b = ((*colour & 0x7c00) >> 10) - ((m_cgram[FIXED_COLOUR] & 0x7c00) >> 10);
- if (r > 0x1f) r = 0;
- if (g > 0x1f) g = 0;
- if (b > 0x1f) b = 0;
- }
- /* halve if necessary */
- if (BIT(m_color_modes, 6))
- {
- r >>= 1;
- g >>= 1;
- b >>= 1;
- }
+ output[x] = (x >= m_window2_left && x <= m_window2_right) ? set : clear;
}
+ return;
+ }
- /* according to anomie's docs, after addition has been performed, division by 2 happens *before* clipping to max, hence we clip now */
- if (clip_max)
+ for (uint16_t x = 0; x < 256; x++)
+ {
+ uint8_t one_mask = ((x >= m_window1_left && x <= m_window1_right) ? 1 : 0) ^ self.window1_invert;
+ uint8_t two_mask = ((x >= m_window2_left && x <= m_window2_right) ? 1 : 0) ^ self.window2_invert;
+ switch (self.wlog_mask)
{
- if (r > 0x1f) r = 0x1f;
- if (g > 0x1f) g = 0x1f;
- if (b > 0x1f) b = 0x1f;
+ case 0: output[x] = (one_mask | two_mask) == 1 ? set : clear; break;
+ case 1: output[x] = (one_mask & two_mask) == 1 ? set : clear; break;
+ case 2: output[x] = (one_mask ^ two_mask) == 1 ? set : clear; break;
+ case 3: output[x] = (one_mask ^ two_mask) == 0 ? set : clear; break;
}
-
- *colour = ((r & 0x1f) | ((g & 0x1f) << 5) | ((b & 0x1f) << 10));
}
}
@@ -1871,12 +1586,8 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
bitmap.pix32(0, x) = rgb_t::black();
else
{
- /* Update clip window masks if necessary */
- if (m_update_windows)
- update_windowmasks();
- /* Update the offsets if necessary */
- if (m_update_offsets)
- update_offsets();
+ uint8_t window_above[256];
+ uint8_t window_below[256];
/* Clear priority */
memset(m_scanlines[SNES_MAINSCREEN].priority, 0, SNES_SCR_WIDTH);
@@ -1890,27 +1601,8 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
memset(m_scanlines[SNES_MAINSCREEN].blend_exception, 0, SNES_SCR_WIDTH);
memset(m_scanlines[SNES_SUBSCREEN].blend_exception, 0, SNES_SCR_WIDTH);
- /* Draw back colour */
- for (uint16_t ii = 0; ii < SNES_SCR_WIDTH; ii++)
- {
- if (m_mode == 5 || m_mode == 6 || m_pseudo_hires)
- m_scanlines[SNES_SUBSCREEN].buffer[ii] = m_cgram[0];
- else
- m_scanlines[SNES_SUBSCREEN].buffer[ii] = m_cgram[FIXED_COLOUR];
-
- m_scanlines[SNES_MAINSCREEN].buffer[ii] = m_cgram[0];
- }
-
- /* Prepare OAM for this scanline */
- update_objects_rto(curline);
-
- /* Draw scanline */
- draw_screens(curline);
-
- update_obsel();
-
- struct SNES_SCANLINE *scanline1 = &m_scanlines[SNES_MAINSCREEN];
- struct SNES_SCANLINE *scanline2 = &m_scanlines[SNES_SUBSCREEN];
+ struct SNES_SCANLINE *above = &m_scanlines[SNES_MAINSCREEN];
+ struct SNES_SCANLINE *below = &m_scanlines[SNES_SUBSCREEN];
#if SNES_LAYER_DEBUG
if (dbg_video(curline))
{
@@ -1921,87 +1613,87 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
/* Toggle drawing of SNES_SUBSCREEN or SNES_MAINSCREEN */
if (m_debug_options.draw_subscreen)
{
- scanline1 = &m_scanlines[SNES_SUBSCREEN];
- scanline2 = &m_scanlines[SNES_MAINSCREEN];
+ above = &m_scanlines[SNES_SUBSCREEN];
+ below = &m_scanlines[SNES_MAINSCREEN];
}
#endif
- /* Draw the scanline to screen */
+ const bool hires = m_mode == 5 || m_mode == 6 || m_pseudo_hires;
+ uint16_t above_color = m_cgram[0];
+ uint16_t below_color = hires ? m_cgram[0] : m_cgram[FIXED_COLOUR];
+ for (int x = 0; x < SNES_SCR_WIDTH; x++)
+ {
+ above->buffer[x] = above_color;
+ above->priority[x] = 0;
+ above->layer[x] = SNES_COLOR;
+
+ below->buffer[x] = below_color;
+ below->priority[x] = 0;
+ below->layer[x] = SNES_COLOR;
+ }
- int fade = m_screen_brightness;
- uint16_t prev_colour = 0;
+ update_color_windowmasks(m_clip_to_black, window_above);
+ update_color_windowmasks(m_prevent_color_math, window_below);
+
+ /* Draw backgrounds and OAM */
+ draw_screens(curline);
+
+ /* Prepare OAM for this scanline */
+ update_objects_rto(curline);
+
+ update_obsel();
+
+ /* Draw the scanline to screen */
+ uint16_t prev = 0;
+ uint16_t *luma = &m_light_table[m_screen_brightness][0];
for (int x = 0; x < SNES_SCR_WIDTH; x++)
{
- const bool hires = (m_mode != 5 && m_mode != 6 && !m_pseudo_hires) ? false : true;
-
/* in hires, the first pixel (of 512) is subscreen pixel, then the first mainscreen pixel follows, and so on... */
if (!hires)
{
- uint16_t c = scanline1->buffer[x];
-
- /* perform color math if the layer wants it (except if it's an object > 192) */
- if (!scanline1->blend_exception[x] && m_layer[scanline1->layer[x]].color_math)
- draw_blend(x, &c, m_prevent_color_math, m_clip_to_black, 0);
-
- int r = ((c & 0x1f) * fade) >> 4;
- int g = (((c & 0x3e0) >> 5) * fade) >> 4;
- int b = (((c & 0x7c00) >> 10) * fade) >> 4;
+ const uint16_t c = luma[pixel(x, above, below, window_above, window_below)];
+ const int r = (c & 0x1f);
+ const int g = (c & 0x3e0) >> 5;
+ const int b = (c & 0x7c00) >> 10;
bitmap.pix32(0, x * 2 + 0) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
bitmap.pix32(0, x * 2 + 1) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
}
+ else if (!blurring)
+ {
+ const uint16_t c0 = luma[pixel(x, below, above, window_above, window_below)];
+ const uint16_t c1 = luma[pixel(x, above, below, window_above, window_below)];
+ const int r0 = (c0 & 0x1f);
+ const int r1 = (c1 & 0x1f);
+ const int g0 = (c0 & 0x3e0) >> 5;
+ const int g1 = (c1 & 0x3e0) >> 5;
+ const int b0 = (c0 & 0x7c00) >> 10;
+ const int b1 = (c1 & 0x7c00) >> 10;
+
+ bitmap.pix32(0, x * 2 + 0) = rgb_t(pal5bit(r0), pal5bit(g0), pal5bit(b0));
+ bitmap.pix32(0, x * 2 + 1) = rgb_t(pal5bit(r1), pal5bit(g1), pal5bit(b1));
+ }
else
{
- /* prepare the pixel from main screen */
- uint16_t c = scanline1->buffer[x];
+ uint16_t curr = luma[pixel(x, below, above, window_above, window_below)];
- /* perform color math if the layer wants it (except if it's an object > 192) */
- if (!scanline1->blend_exception[x] && m_layer[scanline1->layer[x]].color_math)
- draw_blend(x, &c, m_prevent_color_math, m_clip_to_black, 0);
+ uint16_t c0 = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
+ const int r0 = (c0 & 0x1f);
+ const int g0 = (c0 & 0x3e0) >> 5;
+ const int b0 = (c0 & 0x7c00) >> 10;
+ bitmap.pix32(0, x * 2 + 0) = rgb_t(pal5bit(r0), pal5bit(g0), pal5bit(b0));
- uint16_t tmp_col1 = c;
-
- /* prepare the pixel from sub screen */
- c = scanline2->buffer[x];
-
- /* in hires/pseudo-hires, subscreen pixels are blended as well: for each subscreen pixel, color math
- is applied if it had been applied to the previous mainscreen pixel. What happens at subscreen pixel 0
- (which has no previous mainscreen pixel) is undocumented. Until more info are discovered, we (arbitrarily)
- apply to it the same color math as the *next* mainscreen pixel (i.e. mainscreen pixel 0), which seems as good as
- any other choice */
- if (x == 0 && !scanline1->blend_exception[0] && m_layer[scanline1->layer[0]].color_math)
- draw_blend(0, &c, m_prevent_color_math, m_clip_to_black, 1);
- else if (x > 0 && !scanline1->blend_exception[x - 1] && m_layer[scanline1->layer[x - 1]].color_math)
- draw_blend(x, &c, m_prevent_color_math, m_clip_to_black, 1);
-
- uint16_t tmp_col0 = c;
-
- /* average the first pixel if required, or draw it directly*/
- if (blurring)
- c = (prev_colour + tmp_col0 - ((prev_colour ^ tmp_col0) & 0x0421)) >> 1; // Hack code to mimic TV pixel blurring
- else
- c = tmp_col0;
+ prev = curr;
+ curr = luma[pixel(x, above, below, window_above, window_below)];
- int r = ((c & 0x1f) * fade) >> 4;
- int g = (((c & 0x3e0) >> 5) * fade) >> 4;
- int b = (((c & 0x7c00) >> 10) * fade) >> 4;
+ uint16_t c1 = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
+ const int r1 = (c1 & 0x1f);
+ const int g1 = (c1 & 0x3e0) >> 5;
+ const int b1 = (c1 & 0x7c00) >> 10;
+ bitmap.pix32(0, x * 2 + 1) = rgb_t(pal5bit(r1), pal5bit(g1), pal5bit(b1));
- bitmap.pix32(0, x * 2 + 0) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
- prev_colour = tmp_col0;
-
- /* average the second pixel if required, or draw it directly*/
- if (blurring)
- c = (prev_colour + tmp_col1 - ((prev_colour ^ tmp_col1) & 0x0421)) >> 1; // Hack code to mimic TV pixel blurring
- else
- c = tmp_col1;
-
- r = ((c & 0x1f) * fade) >> 4;
- g = (((c & 0x3e0) >> 5) * fade) >> 4;
- b = (((c & 0x7c00) >> 10) * fade) >> 4;
-
- bitmap.pix32(0, x * 2 + 1) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
- prev_colour = tmp_col1;
+ prev = curr;
}
}
}
@@ -2009,6 +1701,44 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
g_profiler.stop();
}
+uint16_t snes_ppu_device::pixel(uint16_t x, SNES_SCANLINE *above, SNES_SCANLINE *below, uint8_t *window_above, uint8_t *window_below)
+{
+ if (!window_above[x]) above->buffer[x] = 0;
+ if (!window_below[x]) return above->buffer[x];
+ if (!m_layer[above->layer[x]].color_math || (above->layer[x] == SNES_OAM && above->blend_exception[x])) return above->buffer[x];
+ if (!m_sub_add_mode) return blend(above->buffer[x], m_cgram[FIXED_COLOUR], BIT(m_color_modes, 0) != 0 && window_above[x] != 0);
+ return blend(above->buffer[x], below->buffer[x], BIT(m_color_modes, 0) != 0 && window_above[x] != 0 && below->layer[x] != SNES_COLOR);
+}
+
+inline uint16_t snes_ppu_device::blend( uint16_t x, uint16_t y, bool halve )
+{
+ if (!BIT(m_color_modes, 1)) // add
+ {
+ if (!halve)
+ {
+ uint16_t sum = x + y;
+ uint16_t carry = (sum - ((x ^ y) & 0x0421)) & 0x8420;
+ return (sum - carry) | (carry - (carry >> 5));
+ }
+ else
+ {
+ return (x + y - ((x ^ y) & 0x0421)) >> 1;
+ }
+ }
+ else // sub
+ {
+ uint16_t diff = x - y + 0x8420;
+ uint16_t borrow = (diff - ((x ^ y) & 0x8420)) & 0x8420;
+ if (!halve)
+ {
+ return (diff - borrow) & (borrow - (borrow >> 5));
+ }
+ else
+ {
+ return (((diff - borrow) & (borrow - (borrow >> 5))) & 0x7bde) >> 1;
+ }
+ }
+}
/* CPU <-> PPU comms */
@@ -2308,6 +2038,11 @@ uint16_t snes_ppu_device::direct_color(uint16_t palette, uint16_t group)
+ (palette << 2 & 0x001c) + (group << 1 & 0x0002);
}
+void snes_ppu_device::set_current_vert(uint16_t value)
+{
+ m_beam.current_vert = value;
+}
+
void snes_ppu_device::cache_background()
{
for (int i = SNES_BG1; i <= SNES_BG4; i++)
@@ -2397,7 +2132,7 @@ void snes_ppu_device::update_video_mode()
m_layer[SNES_BG1].priority[0] = 2; m_layer[SNES_BG1].priority[1] = 5;
break;
case 7:
- if (m_mode7.extbg)
+ if (!m_mode7.extbg)
{
m_layer[SNES_BG1].tile_mode = SNES_COLOR_DEPTH_MODE7;
m_layer[SNES_BG2].tile_mode = SNES_COLOR_DEPTH_NONE;
@@ -2579,12 +2314,12 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
m_oam.first_sprite = m_oam.priority_rotation ? (m_oam.address >> 1) & 127 : 0;
}
m_screen_disabled = data & 0x80;
- m_screen_brightness = (data & 0x0f) + 1;
+ m_screen_brightness = data & 0x0f;
break;
case OBSEL: /* Object size and data area designation */
- m_oam.next_charmap = (data & 0x03) << 1;
- m_oam.next_name_select = (((data & 0x18) >> 3) * 0x1000) << 1;
- m_oam.next_size = (data & 0xe0) >> 5;
+ m_oam.next_charmap = (data << 13) & 0x6000;
+ m_oam.next_name_select = (data >> 3) & 3;
+ m_oam.next_size = (data >> 5) & 7;
break;
case OAMADDL: /* Address for accessing OAM (low) */
m_oam.saved_address_low = data;
@@ -2666,7 +2401,6 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
/* In Mode 7 we use mode7_last_scroll as Prev */
m_mode7.hor_offset = (data << 8) | (m_mode7_last_scroll & ~7) | ((m_mode7.hor_offset >> 8) & 7);
m_mode7_last_scroll = data;
- m_update_offsets = 1;
return;
case BG1VOFS: /* BG1 - vertical scroll (DW) */
/* In Mode 0->6 we use ppu_last_scroll as Prev */
@@ -2675,37 +2409,30 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
/* In Mode 7 we use mode7_last_scroll as Prev */
m_mode7.ver_offset = (data << 8) | m_mode7_last_scroll;
m_mode7_last_scroll = data;
- m_update_offsets = 1;
return;
case BG2HOFS: /* BG2 - horizontal scroll (DW) */
m_layer[SNES_BG2].hoffs = (data << 8) | (m_ppu_last_scroll & ~7) | ((m_layer[SNES_BG2].hoffs >> 8) & 7);
m_ppu_last_scroll = data;
- m_update_offsets = 1;
return;
case BG2VOFS: /* BG2 - vertical scroll (DW) */
m_layer[SNES_BG2].voffs = (data << 8) | (m_ppu_last_scroll);
m_ppu_last_scroll = data;
- m_update_offsets = 1;
return;
case BG3HOFS: /* BG3 - horizontal scroll (DW) */
m_layer[SNES_BG3].hoffs = (data << 8) | (m_ppu_last_scroll & ~7) | ((m_layer[SNES_BG3].hoffs >> 8) & 7);
m_ppu_last_scroll = data;
- m_update_offsets = 1;
return;
case BG3VOFS: /* BG3 - vertical scroll (DW) */
m_layer[SNES_BG3].voffs = (data << 8) | (m_ppu_last_scroll);
m_ppu_last_scroll = data;
- m_update_offsets = 1;
return;
case BG4HOFS: /* BG4 - horizontal scroll (DW) */
m_layer[SNES_BG4].hoffs = (data << 8) | (m_ppu_last_scroll & ~7) | ((m_layer[SNES_BG4].hoffs >> 8) & 7);
m_ppu_last_scroll = data;
- m_update_offsets = 1;
return;
case BG4VOFS: /* BG4 - vertical scroll (DW) */
m_layer[SNES_BG4].voffs = (data << 8) | (m_ppu_last_scroll);
m_ppu_last_scroll = data;
- m_update_offsets = 1;
return;
case VMAIN: /* VRAM address increment value designation */
m_vram_fgr_high = (data & 0x80);
@@ -2810,7 +2537,6 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
m_layer[SNES_BG2].window1_enabled = BIT(data, 5);
m_layer[SNES_BG2].window2_invert = BIT(data, 6);
m_layer[SNES_BG2].window2_enabled = BIT(data, 7);
- m_update_windows = 1;
}
break;
case W34SEL: /* Window mask settings for BG3-4 */
@@ -2824,7 +2550,6 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
m_layer[SNES_BG4].window1_enabled = BIT(data, 5);
m_layer[SNES_BG4].window2_invert = BIT(data, 6);
m_layer[SNES_BG4].window2_enabled = BIT(data, 7);
- m_update_windows = 1;
}
break;
case WOBJSEL: /* Window mask settings for objects */
@@ -2838,35 +2563,30 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
m_layer[SNES_COLOR].window1_enabled = BIT(data, 5);
m_layer[SNES_COLOR].window2_invert = BIT(data, 6);
m_layer[SNES_COLOR].window2_enabled = BIT(data, 7);
- m_update_windows = 1;
}
break;
case WH0: /* Window 1 left position */
if (data != PPU_REG(WH0))
{
m_window1_left = data;
- m_update_windows = 1;
}
break;
case WH1: /* Window 1 right position */
if (data != PPU_REG(WH1))
{
m_window1_right = data;
- m_update_windows = 1;
}
break;
case WH2: /* Window 2 left position */
if (data != PPU_REG(WH2))
{
m_window2_left = data;
- m_update_windows = 1;
}
break;
case WH3: /* Window 2 right position */
if (data != PPU_REG(WH3))
{
m_window2_right = data;
- m_update_windows = 1;
}
break;
case WBGLOG: /* Window mask logic for BG's */
@@ -2876,7 +2596,6 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
m_layer[SNES_BG2].wlog_mask = (data & 0x0c) >> 2;
m_layer[SNES_BG3].wlog_mask = (data & 0x30) >> 4;
m_layer[SNES_BG4].wlog_mask = (data & 0xc0) >> 6;
- m_update_windows = 1;
}
break;
case WOBJLOG: /* Window mask logic for objects */
@@ -2884,7 +2603,6 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
{
m_layer[SNES_OAM].wlog_mask = data & 0x03;
m_layer[SNES_COLOR].wlog_mask = (data & 0x0c) >> 2;
- m_update_windows = 1;
}
break;
case TM: /* Main screen designation */
@@ -2926,7 +2644,7 @@ void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data)
#endif
break;
case CGADSUB: /* Addition/Subtraction designation for each screen */
- m_color_modes = data & 0xc0;
+ m_color_modes = (data >> 6) & 0x03;
m_layer[SNES_BG1].color_math = BIT(data, 0);
m_layer[SNES_BG2].color_math = BIT(data, 1);
m_layer[SNES_BG3].color_math = BIT(data, 2);
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index 6085b848965..471d3ea00d4 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -48,7 +48,7 @@ public:
void refresh_scanline(bitmap_rgb32 &bitmap, uint16_t curline);
- int16_t current_x() const { return screen().hpos() / m_htmult; }
+ int16_t current_x() const { return screen().hpos(); }
int16_t current_y() const { return screen().vpos(); }
void set_latch_hv(int16_t x, int16_t y);
@@ -72,7 +72,7 @@ public:
m_interlace = 1;
m_obj_interlace = 1;
}
- void set_current_vert(uint16_t value) { m_beam.current_vert = value; }
+ void set_current_vert(uint16_t value);
void set_first_sprite() { m_oam.first_sprite = m_oam.priority_rotation ? ((m_oam.address >> 1) & 127) : 0; }
protected:
@@ -152,7 +152,7 @@ protected:
uint8_t saved_address_high;
uint16_t address;
uint16_t priority_rotation;
- uint8_t next_charmap;
+ uint16_t next_charmap;
uint8_t next_size;
uint8_t size;
uint32_t next_name_select;
@@ -182,8 +182,8 @@ protected:
int16_t matrix_d;
int16_t origin_x;
int16_t origin_y;
- uint16_t hor_offset;
- uint16_t ver_offset;
+ int16_t hor_offset;
+ int16_t ver_offset;
uint8_t extbg;
} m_mode7;
@@ -192,6 +192,7 @@ protected:
uint16_t tile;
int16_t x, y;
uint8_t size, vflip, hflip, priority_bits, pal;
+ uint8_t nameselect;
int height, width;
};
@@ -266,14 +267,10 @@ protected:
inline uint16_t get_bgcolor(uint8_t direct_colors, uint16_t palette, uint8_t color);
inline void set_scanline_pixel(int screen, int16_t x, uint16_t color, uint8_t priority, uint8_t layer, int blend);
- inline void draw_bgtile_lores(uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority);
- inline void draw_bgtile_hires(uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority);
- inline void draw_oamtile(int16_t ii, uint8_t colour, uint16_t pal, uint8_t priority);
- inline void draw_tile(uint8_t planes, uint8_t layer, uint32_t tileaddr, int16_t x, uint8_t priority, uint8_t flip, uint8_t direct_colors, uint16_t pal, uint8_t hires);
- inline uint32_t get_tmap_addr(uint8_t layer, uint8_t hires, uint8_t tile_size, uint32_t base, uint32_t x, uint32_t y);
+ inline void draw_oamtile(uint32_t tileaddr, int16_t tile_x, uint8_t priority, uint8_t flip, uint16_t pal, uint8_t *palbuf, uint8_t *pribuf);
inline uint32_t get_tile(uint8_t layer_idx, uint32_t hoffset, uint32_t voffset);
- inline void update_line(uint16_t curline, uint8_t layer, uint8_t direct_colors);
- void update_line_mode7(uint16_t curline, uint8_t layer);
+ void update_line(uint16_t curline, uint8_t layer, uint8_t direct_colors);
+ void update_line_mode7(uint16_t curline, uint8_t layer_idx);
void update_obsel(void);
void oam_list_build(void);
int is_sprite_on_scanline(uint16_t curline, uint8_t sprite);
@@ -288,12 +285,15 @@ protected:
void update_mode_6(uint16_t curline);
void update_mode_7(uint16_t curline);
void draw_screens(uint16_t curline);
- void update_windowmasks(void);
- void update_offsets(void);
+ void render_window(uint16_t layer_idx, uint8_t enable, uint8_t *output);
+ inline void plot_above(uint16_t x, uint8_t source, uint8_t priority, uint16_t color, int blend_exception = 0);
+ inline void plot_below(uint16_t x, uint8_t source, uint8_t priority, uint16_t color, int blend_exception = 0);
+ void update_color_windowmasks(uint8_t mask, uint8_t *output);
void update_video_mode(void);
- void cache_background(void);
+ void cache_background();
+ uint16_t pixel(uint16_t x, SNES_SCANLINE *above, SNES_SCANLINE *below, uint8_t *window_above, uint8_t *window_below);
uint16_t direct_color(uint16_t palette, uint16_t group);
- inline void draw_blend(uint16_t offset, uint16_t *colour, uint8_t prevent_color_math, uint8_t black_pen_clip, int switch_screens);
+ inline uint16_t blend(uint16_t x, uint16_t y, bool halve);
void dynamic_res_change();
inline uint32_t get_vram_address();
@@ -307,6 +307,7 @@ protected:
std::unique_ptr<uint16_t[]> m_oam_ram; /* Object Attribute Memory */
std::unique_ptr<uint16_t[]> m_cgram; /* Palette RAM */
std::unique_ptr<uint8_t[]> m_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */
+ std::unique_ptr<std::unique_ptr<uint16_t[]>[]> m_light_table; /* Luma ramp */
// device-level overrides
virtual void device_start() override;
diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp
index 45a4ad42107..6736626325a 100644
--- a/src/emu/screen.cpp
+++ b/src/emu/screen.cpp
@@ -637,18 +637,37 @@ void screen_device::allocate_scan_bitmaps()
{
const bool screen16 = !m_screen_update_ind16.isnull();
s32 effwidth = std::max(m_max_width, m_visarea.right() + 1);
+ const s32 old_height = (s32)m_scan_widths.size();
s32 effheight = std::max(m_height, m_visarea.bottom() + 1);
- for (int i = 0; i < effheight; i++)
+ if (old_height < effheight)
{
- for (int j = 0; j < 2; j++)
- {
- if (screen16)
- m_scan_bitmaps[j].push_back(new bitmap_ind16(effwidth, 1));
- else
- m_scan_bitmaps[j].push_back(new bitmap_rgb32(effwidth, 1));
- }
- m_scan_widths.push_back(m_width);
- }
+ for (int i = old_height; i < effheight; i++)
+ {
+ for (int j = 0; j < 2; j++)
+ {
+ if (screen16)
+ m_scan_bitmaps[j].push_back(new bitmap_ind16(effwidth, 1));
+ else
+ m_scan_bitmaps[j].push_back(new bitmap_rgb32(effwidth, 1));
+ }
+ m_scan_widths.push_back(m_width);
+ }
+ }
+ else
+ {
+ for (int i = effheight; i < old_height; i++)
+ {
+ for (int j = 0; j < 2; j++)
+ {
+ if (screen16)
+ delete (bitmap_ind16 *)m_scan_bitmaps[j][i];
+ else
+ delete (bitmap_rgb32 *)m_scan_bitmaps[j][i];
+ m_scan_bitmaps[j].erase(m_scan_bitmaps[j].begin() + i);
+ }
+ m_scan_widths.erase(m_scan_widths.begin() + i);
+ }
+ }
}
}
@@ -1003,6 +1022,7 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a
// reallocate bitmap(s) if necessary
realloc_screen_bitmaps();
+ if (machine().input().code_pressed(KEYCODE_E)) printf("CONFIGURE\n");
// compute timing parameters
m_frame_period = frame_period;
@@ -1118,7 +1138,6 @@ void screen_device::realloc_screen_bitmaps()
m_texture[0]->set_bitmap(m_bitmap[0], m_visarea, m_bitmap[0].texformat());
m_texture[1]->set_bitmap(m_bitmap[1], m_visarea, m_bitmap[1].texformat());
- destroy_scan_bitmaps();
allocate_scan_bitmaps();
}
diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp
index 635225769fb..7ddf42c1b5c 100644
--- a/src/lib/netlist/analog/nld_bjt.cpp
+++ b/src/lib/netlist/analog/nld_bjt.cpp
@@ -1,9 +1,5 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*
- * nld_bjt.c
- *
- */
#include "netlist/solver/nld_solver.h"
#include "netlist/nl_setup.h"
@@ -270,8 +266,8 @@ namespace analog
nl_fptype m_alpha_f;
nl_fptype m_alpha_r;
- NETLIB_SUBXX(analog, C) m_CJE;
- NETLIB_SUBXX(analog, C) m_CJC;
+ NETLIB_SUB_UPTR(analog, C) m_CJE;
+ NETLIB_SUB_UPTR(analog, C) m_CJC;
};
diff --git a/src/lib/netlist/analog/nld_mosfet.cpp b/src/lib/netlist/analog/nld_mosfet.cpp
index bb3116a6960..78f4b4df615 100644
--- a/src/lib/netlist/analog/nld_mosfet.cpp
+++ b/src/lib/netlist/analog/nld_mosfet.cpp
@@ -59,38 +59,38 @@ namespace analog
* | |Cbd | Zero-bias B-D junction capacitance |F|0|20f|
* | |Cbs | Zero-bias B-S junction capacitance |F|0|20f|
* | Y |Is | Bulk junction saturation current |A|0.00000000000001|1E-015|
- * | Y |N | Bulk diode emission coefficient |-|1|*
- * | |Pb | Bulk junction potential |V|0.8|0.87|8|
+ * | Y |N | Bulk diode emission coefficient |-|1|*|
+ * | |Pb | Bulk junction potential |V|0.8|0.87|
* | Y |Cgso | Gate-source overlap capacitance per meter channel width |F/m|0|0.00000000004|
- * | Y |Cgdo | Gate-drain overlap capacitance per meter channel width |F/m|0|0.00000000004|*
- * | Y |Cgbo | Gate-bulk overlap capacitance per meter channel width |F/m|0|0.0000000002|*
- * | |Rsh | Drain and source diffusion sheet resistance |W|0|10|*
- * | |Cj | Zero-bias bulk junction bottom capacitance per square meter of junction area|F/m²|0|0.0002|*
- * | |Mj | Bulk junction bottom grading coefficient |-|0.5|0.5|*
- * | |Cjsw | Zero-bias bulk junction sidewall capacitance per meter of junction perimeter|F/m|0|1p|*
+ * | Y |Cgdo | Gate-drain overlap capacitance per meter channel width |F/m|0|0.00000000004*|
+ * | Y |Cgbo | Gate-bulk overlap capacitance per meter channel width |F/m|0|0.0000000002*|
+ * | |Rsh | Drain and source diffusion sheet resistance |W|0|10*|
+ * | |Cj | Zero-bias bulk junction bottom capacitance per square meter of junction area|F/m²|0|0.0002*|
+ * | |Mj | Bulk junction bottom grading coefficient |-|0.5|0.5*|
+ * | |Cjsw | Zero-bias bulk junction sidewall capacitance per meter of junction perimeter|F/m|0|1p*|
* | |Mjsw | Bulk junction sidewall grading coefficient |-|.50 level 1 .33 level 2,3||
* | |Js | Bulk junction saturation current per square-meter of junction area|A/m|0|0.00000001|
* | Y |Tox | Oxide thickness |m|0.0000001|0.0000001|
* | Y |Nsub | Substrate doping |1/cm³|0|4000000000000000|
* | |Nss | Surface state density |1/cm²|0|10000000000|
- * | |Nfs | Fast surface state |1/cm²|0|10000000000|*
- * | |TPG | Type of gate material: +1 opp. to substrate -1 same as substrate 0 Al gate|-|1|
- * | |Xj | Metallurgical junction depth |m|0|1µ|*
+ * | |Nfs | Fast surface state |1/cm²|0|10000000000*|
+ * | |TPG | Type of gate material: +1 opp. to substrate -1 same as substrate |Al gate|-|1|
+ * | |Xj | Metallurgical junction depth |m|0|1µ*|
* | Y |Ld | Lateral diffusion |m|0|0.8µ|
* | Y |Uo | Surface mobility |cm²/V/s|600|700|
* | |Ucrit | Critical field for mobility degradation (level 2 only) |V/cm|10000|10000|
* | |Uexp | Critical field exponent in mobility degradation (level 2 only) |-|0|0.1|
- * | |Utra | Transverse field coefficient (level 2 only) |-|0|0.3|*
+ * | |Utra | Transverse field coefficient (level 2 only) |-|0|0.3*|
* | |Vmax | Maximum carrier drift velocity (levels 2 & 3 only) |m/s|0|50000|
* | |Neff | Total channel-charge exponent (level 2 only) |-|1|5|
* | |Kf | Flicker noise coefficient |-|0|1E-026|
* | |Af | Flicker noise exponent |-|1|1.2|
- * | |Fc | Coefficient for forward-bias depletion capacitance formula |-|0.5|
+ * | |Fc | Coefficient for forward-bias depletion capacitance formula |-|0.5||
* | |Delta | Width effect on threshold voltage(levels 2 and 3) |-|0|1|
* | |Theta | Mobility modulation (level 3 only) |-|0|0.1|
* | |Eta | Static feedback (level 3 only) |-|0|1|
- * | |Kappa | Saturation field (level 3 only) |0.2|0.5|
- * | |Tnom | Parameter measurement temperature |ºC|27|50||
+ * | |Kappa | Saturation field (level 3 only) |-|0.2|0.5|
+ * | |Tnom | Parameter measurement temperature |ºC|27|50|
* | Y |L | Length scaling |-|100e-6||
* | Y |W | Width scaling |-|100e-6||
* */
diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp
index e2d7d5d4cb7..ac21037671f 100644
--- a/src/lib/netlist/analog/nld_opamps.cpp
+++ b/src/lib/netlist/analog/nld_opamps.cpp
@@ -179,10 +179,10 @@ namespace netlist
analog::NETLIB_SUB(R_base) m_RP;
analog::NETLIB_SUB(VCCS) m_G1;
- NETLIB_SUBXX(analog, C) m_CP;
- NETLIB_SUBXX(analog, VCVS) m_EBUF;
- NETLIB_SUBXX(analog, D) m_DP;
- NETLIB_SUBXX(analog, D) m_DN;
+ NETLIB_SUB_UPTR(analog, C) m_CP;
+ NETLIB_SUB_UPTR(analog, VCVS) m_EBUF;
+ NETLIB_SUB_UPTR(analog, D) m_DP;
+ NETLIB_SUB_UPTR(analog, D) m_DN;
analog_input_t m_VCC;
analog_input_t m_GND;
diff --git a/src/lib/netlist/build/doxygen.conf b/src/lib/netlist/build/doxygen.conf
index 6fb0b377e7b..6c592f3fdae 100644
--- a/src/lib/netlist/build/doxygen.conf
+++ b/src/lib/netlist/build/doxygen.conf
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
-PROJECT_NAME = Netlist documentation
+PROJECT_NAME = "Netlist documentation"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@@ -475,7 +475,7 @@ HIDE_UNDOC_MEMBERS = YES
# has no effect if EXTRACT_ALL is enabled.
# The default value is: NO.
-HIDE_UNDOC_CLASSES = YES
+HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO, these declarations will be
@@ -771,7 +771,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = .. ../analog ../documentation ../devices
+INPUT = .. ../analog ../documentation ../devices ../macro
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -2019,7 +2019,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-INCLUDE_PATH =
+INCLUDE_PATH = .. ../..
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
@@ -2145,6 +2145,7 @@ DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
+
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile
index 51f43550a8d..af02b100c86 100644
--- a/src/lib/netlist/build/makefile
+++ b/src/lib/netlist/build/makefile
@@ -58,7 +58,7 @@ CC = g++
LD = @g++
MD = @mkdir
RM = @rm
-DOXYGEN = @doxygen
+DOXYGEN = @./doxygen
CLANG_TIDY = clang-tidy-9
TARGETS = nltool nlwav
@@ -261,8 +261,9 @@ tidy_db: compile_commands_prefix $(ALL_TIDY_FILES) compile_commands_postfix
# -Wno-missing-variable-declarations : Device factory code, on purpose
mingw:
- $(MAKE) CEXTRAFLAGS="-DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN" \
- LDEXTRAFLAGS="-Wl,--subsystem,console -municode" LIBS= MD=@mkdir.exe SHELL=sh.exe
+ $(MAKE) CEXTRAFLAGS="-DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 \
+ -DWIN32_LEAN_AND_MEAN" LDEXTRAFLAGS="-Wl,--subsystem,console \
+ -municode" LIBS= MD=@mkdir.exe SHELL=sh.exe DOXYGEN=doxygen.exe $(PARAMS)
#
# FIXME: Unicode
@@ -275,6 +276,9 @@ doc: nltool
./nltool -c docheader > ../documentation/devsyn.dox.h
$(DOXYGEN) doxygen.conf
+docw:
+ $(DOXYGEN) doxygen.conf
+
#-------------------------------------------------
# depends
#-------------------------------------------------
diff --git a/src/lib/netlist/buildVS/netlistlib.vcxproj b/src/lib/netlist/buildVS/netlistlib.vcxproj
index 4a36bdc3496..4d4226a11ec 100755
--- a/src/lib/netlist/buildVS/netlistlib.vcxproj
+++ b/src/lib/netlist/buildVS/netlistlib.vcxproj
@@ -21,28 +21,28 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{A374399B-B87F-4E0F-9525-6C099600705F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -100,13 +100,15 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
- <AdditionalIncludeDirectories>$(SolutionDir)..\..\</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(SolutionDir)..;$(SolutionDir)..\..</AdditionalIncludeDirectories>
<Optimization>Full</Optimization>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <AdditionalOptions>/bigobj</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\analog\nld_bjt.cpp" />
+ <ClCompile Include="..\analog\nld_mosfet.cpp" />
<ClCompile Include="..\analog\nld_opamps.cpp" />
<ClCompile Include="..\analog\nld_switches.cpp" />
<ClCompile Include="..\analog\nlid_fourterm.cpp" />
@@ -114,6 +116,8 @@
<ClCompile Include="..\devices\net_lib.cpp" />
<ClCompile Include="..\devices\nld_2102A.cpp" />
<ClCompile Include="..\devices\nld_2716.cpp" />
+ <ClCompile Include="..\devices\nld_7497.cpp" />
+ <ClCompile Include="..\devices\nld_schmitt.cpp" />
<ClCompile Include="..\devices\nld_tms4800.cpp" />
<ClCompile Include="..\devices\nld_4020.cpp" />
<ClCompile Include="..\devices\nld_4066.cpp" />
@@ -169,18 +173,15 @@
<ClCompile Include="..\nl_factory.cpp" />
<ClCompile Include="..\nl_parser.cpp" />
<ClCompile Include="..\nl_setup.cpp" />
- <ClCompile Include="..\plib\palloc.cpp" />
- <ClCompile Include="..\plib\pchrono.cpp" />
<ClCompile Include="..\plib\pdynlib.cpp" />
<ClCompile Include="..\plib\pexception.cpp" />
<ClCompile Include="..\plib\pfmtlog.cpp" />
<ClCompile Include="..\plib\pfunction.cpp" />
<ClCompile Include="..\plib\pmain.cpp" />
<ClCompile Include="..\plib\poptions.cpp" />
- <ClCompile Include="..\plib\pparser.cpp" />
- <ClCompile Include="..\plib\pstate.cpp" />
- <ClCompile Include="..\plib\pstream.cpp" />
+ <ClCompile Include="..\plib\ppreprocessor.cpp" />
<ClCompile Include="..\plib\pstring.cpp" />
+ <ClCompile Include="..\plib\ptokenizer.cpp" />
<ClCompile Include="..\plib\putil.cpp" />
<ClCompile Include="..\solver\nld_matrix_solver.cpp" />
<ClCompile Include="..\solver\nld_solver.cpp" />
@@ -189,6 +190,8 @@
<ItemGroup>
<ClInclude Include="..\analog\nld_bjt.h" />
<ClInclude Include="..\analog\nld_fourterm.h" />
+ <ClInclude Include="..\analog\nld_generic_models.h" />
+ <ClInclude Include="..\analog\nld_mosfet.h" />
<ClInclude Include="..\analog\nld_opamps.h" />
<ClInclude Include="..\analog\nld_switches.h" />
<ClInclude Include="..\analog\nld_twoterm.h" />
@@ -197,6 +200,8 @@
<ClInclude Include="..\devices\net_lib.h" />
<ClInclude Include="..\devices\nld_2102A.h" />
<ClInclude Include="..\devices\nld_2716.h" />
+ <ClInclude Include="..\devices\nld_7497.h" />
+ <ClInclude Include="..\devices\nld_schmitt.h" />
<ClInclude Include="..\devices\nld_tms4800.h" />
<ClInclude Include="..\devices\nld_4020.h" />
<ClInclude Include="..\devices\nld_4066.h" />
@@ -253,7 +258,6 @@
<ClInclude Include="..\macro\nlm_opamp.h" />
<ClInclude Include="..\macro\nlm_other.h" />
<ClInclude Include="..\macro\nlm_ttl74xx.h" />
- <ClInclude Include="..\netlist_types.h" />
<ClInclude Include="..\nl_base.h" />
<ClInclude Include="..\nl_config.h" />
<ClInclude Include="..\nl_dice_compat.h" />
@@ -262,8 +266,10 @@
<ClInclude Include="..\nl_lists.h" />
<ClInclude Include="..\nl_parser.h" />
<ClInclude Include="..\nl_setup.h" />
- <ClInclude Include="..\nl_time.h" />
+ <ClInclude Include="..\plib\gmres.h" />
+ <ClInclude Include="..\plib\mat_cr.h" />
<ClInclude Include="..\plib\palloc.h" />
+ <ClInclude Include="..\plib\parray.h" />
<ClInclude Include="..\plib\pchrono.h" />
<ClInclude Include="..\plib\pconfig.h" />
<ClInclude Include="..\plib\pdynlib.h" />
@@ -272,15 +278,24 @@
<ClInclude Include="..\plib\pfunction.h" />
<ClInclude Include="..\plib\plists.h" />
<ClInclude Include="..\plib\pmain.h" />
+ <ClInclude Include="..\plib\pmath.h" />
+ <ClInclude Include="..\plib\pmatrix2d.h" />
+ <ClInclude Include="..\plib\pmempool.h" />
+ <ClInclude Include="..\plib\pomp.h" />
<ClInclude Include="..\plib\poptions.h" />
<ClInclude Include="..\plib\pparser.h" />
<ClInclude Include="..\plib\ppmf.h" />
+ <ClInclude Include="..\plib\ppreprocessor.h" />
<ClInclude Include="..\plib\pstate.h" />
+ <ClInclude Include="..\plib\pstonum.h" />
<ClInclude Include="..\plib\pstream.h" />
<ClInclude Include="..\plib\pstring.h" />
+ <ClInclude Include="..\plib\pstrutil.h" />
+ <ClInclude Include="..\plib\ptime.h" />
+ <ClInclude Include="..\plib\ptokenizer.h" />
<ClInclude Include="..\plib\ptypes.h" />
<ClInclude Include="..\plib\putil.h" />
- <ClInclude Include="..\solver\mat_cr.h" />
+ <ClInclude Include="..\plib\vector_ops.h" />
<ClInclude Include="..\solver\nld_matrix_solver.h" />
<ClInclude Include="..\solver\nld_ms_direct.h" />
<ClInclude Include="..\solver\nld_ms_direct1.h" />
diff --git a/src/lib/netlist/buildVS/netlistlib.vcxproj.filters b/src/lib/netlist/buildVS/netlistlib.vcxproj.filters
index 2b923f04bde..8b4f473556e 100755
--- a/src/lib/netlist/buildVS/netlistlib.vcxproj.filters
+++ b/src/lib/netlist/buildVS/netlistlib.vcxproj.filters
@@ -30,9 +30,6 @@
<ClCompile Include="..\plib\pfunction.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\plib\pstream.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\plib\pmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -48,21 +45,9 @@
<ClCompile Include="..\plib\pexception.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\plib\pstate.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\plib\pparser.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\plib\putil.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\plib\palloc.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\plib\pchrono.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\plib\pdynlib.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -252,6 +237,21 @@
<ClCompile Include="..\devices\nld_74164.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\plib\ppreprocessor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\plib\ptokenizer.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\devices\nld_7497.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\devices\nld_schmitt.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\analog\nld_mosfet.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\nl_errstr.h">
@@ -260,18 +260,12 @@
<ClInclude Include="..\nl_dice_compat.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\nl_time.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\nl_base.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\nl_parser.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\netlist_types.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\nl_factory.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -389,9 +383,6 @@
<ClInclude Include="..\solver\nld_ms_direct.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\solver\mat_cr.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\solver\nld_ms_direct_lu.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -578,5 +569,56 @@
<ClInclude Include="..\devices\nld_74164.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\plib\gmres.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\mat_cr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\parray.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\pmath.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\pmatrix2d.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\pmempool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\pomp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\ppreprocessor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\pstonum.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\pstrutil.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\ptime.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\ptokenizer.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\plib\vector_ops.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\devices\nld_7497.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\devices\nld_schmitt.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\analog\nld_generic_models.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\analog\nld_mosfet.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/src/lib/netlist/buildVS/nltool.vcxproj b/src/lib/netlist/buildVS/nltool.vcxproj
index 200e701ea33..680dd7a054a 100755
--- a/src/lib/netlist/buildVS/nltool.vcxproj
+++ b/src/lib/netlist/buildVS/nltool.vcxproj
@@ -22,32 +22,32 @@
<ProjectGuid>{9204EC28-A29B-4A36-9E47-2C46041D67D3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>nltool</RootNamespace>
- <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@@ -144,7 +144,10 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
- <ClCompile Include="..\prg\nltool.cpp" />
+ <ClCompile Include="..\prg\nltool.cpp">
+ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\;$(SolutionDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/bigobj</AdditionalOptions>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="netlistlib.vcxproj">
diff --git a/src/lib/netlist/devices/nld_7493.cpp b/src/lib/netlist/devices/nld_7493.cpp
index 003c3291096..855bd8a3770 100644
--- a/src/lib/netlist/devices/nld_7493.cpp
+++ b/src/lib/netlist/devices/nld_7493.cpp
@@ -9,6 +9,67 @@
#include "netlist/nl_base.h"
#include "nlid_system.h"
+//- Identifier: TTL_7493_DIP
+//- Title: 7493 Binary Counters
+//- Description:
+//- Each of these monolithic counters contains four master-slave
+//- flip-flops and additional gating to provide a divide-by-two
+//- counter and a three-stage binary counter for which the
+//- count cycle length is divide-by-five for the 90A and divide-by-eight
+//- for the 93A.
+//-
+//- All of these counters have a gated zero reset and the 90A
+//- also has gated set-to-nine inputs for use in BCD nine’s complement
+//- applications.
+//-
+//- To use their maximum count length (decade or four-bit binary),
+//- the B input is connected to the Q A output. The input count pulses
+//- are applied to input A and the outputs are as described in the
+//- appropriate truth table. A symmetrical divide-by-ten count can be
+//- obtained from the 90A counters by connecting the Q D output to the
+//- A input and applying the input count to the B input which gives
+//- a divide-by-ten square wave at output Q A.
+//-
+//- Pinalias: B,R01,R02,NC,VCC,NC,NC,QC,QB,GND,QD,QA,NC,A
+//- Package: DIP
+//- NamingConvention: Naming conventions follow National Semiconductor datasheet
+//- Limitations: Internal resistor network currently fixed to 5k
+//- more limitations
+//- Example: ne555_astable.c,ne555_example
+//- FunctionTable:
+//- Counter Sequence
+//-
+//- | COUNT || QD | QC | QB | QA |
+//- |------:||:--:|:--:|:--:|:--:|
+//- | 0 || 0 | 0 | 0 | 0 |
+//- | 1 || 0 | 0 | 0 | 1 |
+//- | 2 || 0 | 0 | 1 | 0 |
+//- | 3 || 0 | 0 | 1 | 1 |
+//- | 4 || 0 | 1 | 0 | 0 |
+//- | 5 || 0 | 1 | 0 | 1 |
+//- | 6 || 0 | 1 | 1 | 0 |
+//- | 7 || 0 | 1 | 1 | 1 |
+//- | 8 || 1 | 0 | 0 | 0 |
+//- | 9 || 1 | 0 | 0 | 1 |
+//- | 10 || 1 | 0 | 1 | 0 |
+//- | 11 || 1 | 0 | 1 | 1 |
+//- | 12 || 1 | 1 | 0 | 0 |
+//- | 13 || 1 | 1 | 0 | 1 |
+//- | 14 || 1 | 1 | 1 | 0 |
+//- | 15 || 1 | 1 | 1 | 1 |
+//-
+//- Note C Output QA is connected to input B
+//-
+//- Reset Count Function table
+//-
+//- | R01 | R02 | QD | QC | QB | QA |
+//- |:---:|:---:|:--:|:--:|:--:|:--:|
+//- | 1 | 1 | 0 | 0 | 0 | 0 |
+//- | 0 | X | COUNT ||||
+//- | X | 0 | COUNT ||||
+//-
+//-
+
namespace netlist
{
namespace devices
@@ -115,9 +176,8 @@ namespace netlist
}
};
-
NETLIB_DEVICE_IMPL(7493, "TTL_7493", "+CLKA,+CLKB,+R1,+R2,@VCC,@GND")
NETLIB_DEVICE_IMPL(7493_dip, "TTL_7493_DIP", "")
- } //namespace devices
+ } // namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp
index 6a6834df5d5..59eed00b02d 100644
--- a/src/lib/netlist/devices/nld_ne555.cpp
+++ b/src/lib/netlist/devices/nld_ne555.cpp
@@ -1,48 +1,69 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*!
- * \file nld_NE555.cpp
- *
- * \page NE555 NE555: PRECISION TIMERS
- *
- * The Swiss army knife for timing purposes
- *
- * \section ne555_1 Synopsis
- *
- * \snippet devsyn.dox.h NE555 synopsis
- * \snippet devsyn.dox.h NE555_DIP synopsis
- * \section ne555_11 "C" Synopsis
- *
- * \snippet devsyn.dox.h NE555 csynopsis
- * \snippet devsyn.dox.h NE555_DIP csynopsis
- *
- * For the \c NE555 use verbose pin assignments like \c name.TRIG or \c name.OUT.
- * For the \c NE555_DIP use pin numbers like \c name.1.
- *
- * \section ne555_2 Connection Diagram
- *
- * <pre>
- * +--------+
- * GND |1 ++ 8| VCC
- * TRIG |2 7| DISCH
- * OUT |3 6| THRES
- * RESET |4 5| CONT
- * +--------+
- * </pre>
- *
- * Naming conventions follow Texas Instruments datasheet
+//- Identifier: NE555_DIP
+//- Title: NE555 PRECISION TIMERS
+//- Description:
+//- These devices are precision timing circuits capable of producing accurate
+//- time delays or oscillation. In the time-delay or monostable mode of
+//- operation, the timed interval is controlled by a single external resistor
+//- and capacitor network. In the astable mode of operation, the frequency and
+//- duty cycle can be controlled independently with two external resistors and
+//- a single external capacitor.
+//-
+//- The threshold and trigger levels normally are two-thirds and one-third,
+//- respectively, of V CC. These levels can be altered by use of the
+//- control-voltage terminal. When the trigger input falls below the trigger
+//- level, the flip-flop is set and NC – No internal connection the output
+//- goes high. If the trigger input is above the trigger level and the
+//- threshold input is above the threshold level, the flip-flop is reset and
+//- the output is low. The reset (RESET) input can override all other
+//- inputs and can be used to initiate a new timing cycle. When RESET goes
+//- low, the flip-flop is reset and the output goes low. When the output is low,
+//- a low-impedance path is provided between discharge (DISCH) and ground.
+//-
+//- The output circuit is capable of sinking or sourcing current up to 200 mA.
+//- Operation is specified for supplies of 5 V to 15 V. With a 5-V supply,
+//- output levels are compatible with TTL inputs.
+//-
+//- The NE555 is characterized for operation from 0°C to 70°C. The SA555 is
+//- characterized for operation from –40°C to 85°C. The SE555 is characterized
+//- for operation over the full military range of –55°C to 125°C.
+//-
+//- Pinalias: GND,TRIG,OUT,RESET,CONT,THRES,DISCH,VCC
+//- Package: DIP
+//- NamingConvention: Naming conventions follow Texas instrument datasheet
+//- Limitations: Internal resistor network currently fixed to 5k
+//- Example: ne555_astable.c,ne555_example
+//- FunctionTable:
+//-
+//- |RESET|TRIGGER VOLTAGE|THRESHOLD VOLTAGE|OUTPUT|DISCHARGE SWITCH|
+//- |:---:|:-------------:|:---------------:|:----:|:--------------:|
+//- |Low | Irrelevant | Irrelevant | Low | On |
+//- |High | <1/3 VDD | Irrelevant | High | Off |
+//- |High | >1/3 VDD | >2/3 VDD | Low | On |
+//- |High | >1/3 VDD | <2/3 VDD | As previously established||
+//-
+
+
+/*
+ * "Description: The Swiss army knife for timing purposes\n"
+ * " which has a ton of applications.\n"
+ * "DipAlias: GND,TRIG,OUT,RESET,VCC,DISCH,THRES,CONT\n"
+ * "Package: DIP\n"
+ * "NamingConvention: Naming conventions follow Texas Instruments datasheet\n"
+ * "Limitations: Internal resistor network currently fixed to 5k\n"
+ * " more limitations\n"
+ * "Function Table:\n"
*
- * \section ne555_3 Function Table
+ * Function table created from truthtable if missing.
*
- * Please refer to the datasheet.
+ * For package, refer to:
*
- * \section ne555_4 Limitations
+ * https://en.wikipedia.org/wiki/List_of_integrated_circuit_packaging_types
*
- * Internal resistor network currently fixed to 5k.
+ * Special case: GATE -> use symbolic names
*
- * \section ne555_5 Example
- * \snippet ne555_astable.c ne555 example
*/
#include "nld_ne555.h"
diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp
index 54ef14fa1d0..e81824cc1b9 100644
--- a/src/lib/netlist/devices/nld_system.cpp
+++ b/src/lib/netlist/devices/nld_system.cpp
@@ -11,8 +11,8 @@
namespace netlist
{
- namespace devices
- {
+namespace devices
+{
// ----------------------------------------------------------------------------------------
// netlistparams
// ----------------------------------------------------------------------------------------
@@ -60,53 +60,10 @@ namespace netlist
m_feedback.m_delegate.set(&NETLIB_NAME(extclock)::clk2, this);
}
- // -----------------------------------------------------------------------------
- // nld_res_sw
- // -----------------------------------------------------------------------------
-
- NETLIB_RESET(res_sw)
- {
- m_last_state = 0;
- m_R.set_R(m_ROFF());
- }
-
- NETLIB_UPDATE(res_sw)
- {
- const netlist_sig_t state = m_I();
- if (state != m_last_state)
- {
- m_last_state = state;
- const nl_fptype R = state ? m_RON() : m_ROFF();
-
- // FIXME: We only need to update the net first if this is a time stepping net
- m_R.update();
- m_R.set_R(R);
- m_R.solve_later();
- }
- }
-
- /* -----------------------------------------------------------------------------
- * nld_function
- * ----------------------------------------------------------------------------- */
-
- NETLIB_RESET(function)
- {
- //m_Q.initial(0.0);
- }
-
- NETLIB_UPDATE(function)
- {
- for (std::size_t i=0; i < static_cast<unsigned>(m_N()); i++)
- {
- m_vals[i] = (*m_I[i])();
- }
- m_Q.push(m_compiled.evaluate(m_vals));
- }
-
- NETLIB_DEVICE_IMPL(dummy_input, "DUMMY_INPUT", "")
- NETLIB_DEVICE_IMPL(frontier, "FRONTIER_DEV", "+I,+G,+Q")
- NETLIB_DEVICE_IMPL(function, "AFUNC", "N,FUNC")
+ NETLIB_DEVICE_IMPL(dummy_input, "DUMMY_INPUT", "")
+ NETLIB_DEVICE_IMPL(frontier, "FRONTIER_DEV", "+I,+G,+Q")
+ NETLIB_DEVICE_IMPL(function, "AFUNC", "N,FUNC")
NETLIB_DEVICE_IMPL(analog_input, "ANALOG_INPUT", "IN")
NETLIB_DEVICE_IMPL(clock, "CLOCK", "FREQ")
NETLIB_DEVICE_IMPL(varclock, "VARCLOCK", "FUNC")
@@ -116,8 +73,8 @@ namespace netlist
NETLIB_DEVICE_IMPL(gnd, "GND", "")
NETLIB_DEVICE_IMPL(netlistparams, "PARAMETER", "")
- NETLIB_DEVICE_IMPL(logic_input, "LOGIC_INPUT", "IN,FAMILY")
+ NETLIB_DEVICE_IMPL(logic_input, "LOGIC_INPUT", "IN,FAMILY")
NETLIB_DEVICE_IMPL_ALIAS(logic_input_ttl, logic_input, "TTL_INPUT", "IN")
- } //namespace devices
+} // namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h
index 65c0437c020..6d0d0325feb 100644
--- a/src/lib/netlist/devices/nlid_system.h
+++ b/src/lib/netlist/devices/nlid_system.h
@@ -351,11 +351,11 @@ namespace devices
param_fp_t m_p_ROUT;
};
- /* -----------------------------------------------------------------------------
- * nld_function
- *
- * FIXME: Currently a proof of concept to get congo bongo working
- * ----------------------------------------------------------------------------- */
+ // -----------------------------------------------------------------------------
+ // nld_function
+ //
+ // FIXME: Currently a proof of concept to get congo bongo working
+ // ----------------------------------------------------------------------------- */
NETLIB_OBJECT(function)
{
@@ -378,9 +378,19 @@ namespace devices
protected:
- NETLIB_RESETI();
- NETLIB_UPDATEI();
+ NETLIB_RESETI()
+ {
+ //m_Q.initial(0.0);
+ }
+ NETLIB_UPDATEI()
+ {
+ for (std::size_t i = 0; i < static_cast<unsigned>(m_N()); i++)
+ {
+ m_vals[i] = (*m_I[i])();
+ }
+ m_Q.push(m_compiled.evaluate(m_vals));
+ }
private:
param_int_t m_N;
@@ -410,9 +420,28 @@ namespace devices
register_subalias("2", m_R.m_N);
}
- NETLIB_RESETI();
+ NETLIB_RESETI()
+ {
+ m_last_state = 0;
+ m_R.set_R(m_ROFF());
+ }
+
+ NETLIB_UPDATEI()
+ {
+ const netlist_sig_t state = m_I();
+ if (state != m_last_state)
+ {
+ m_last_state = state;
+ const nl_fptype R = state ? m_RON() : m_ROFF();
+
+ // FIXME: We only need to update the net first if this is a time stepping net
+ m_R.update();
+ m_R.set_R(R);
+ m_R.solve_later();
+ }
+ }
+
//NETLIB_UPDATE_PARAMI();
- NETLIB_UPDATEI();
analog::NETLIB_SUB(R_base) m_R;
logic_input_t m_I;
@@ -420,7 +449,6 @@ namespace devices
param_fp_t m_ROFF;
private:
-
state_var<netlist_sig_t> m_last_state;
};
@@ -435,19 +463,19 @@ namespace devices
class nld_power_pins
{
public:
- explicit nld_power_pins(device_t &owner, const pstring &sVCC = "VCC",
- const pstring &sGND = "GND", bool force_analog_input = false)
+ explicit nld_power_pins(device_t &owner, const pstring &sVCC = sPowerVCC,
+ const pstring &sGND = sPowerGND, bool force_analog_input = false)
{
if (owner.state().setup().is_extended_validation() || force_analog_input)
{
- m_GND = plib::make_unique<analog_input_t>(owner, sGND, NETLIB_DELEGATE(power_pins, noop));
- m_VCC = plib::make_unique<analog_input_t>(owner, sVCC, NETLIB_DELEGATE(power_pins, noop));
+ m_GND = pool().make_unique<analog_input_t>(owner, sGND, NETLIB_DELEGATE(power_pins, noop));
+ m_VCC = pool().make_unique<analog_input_t>(owner, sVCC, NETLIB_DELEGATE(power_pins, noop));
}
else
{
owner.create_and_register_subdevice(sPowerDevRes, m_RVG);
- owner.register_subalias(sVCC, "_RVG.1");
- owner.register_subalias(sGND, "_RVG.2");
+ owner.register_subalias(sVCC, pstring(sPowerDevRes) + ".1");
+ owner.register_subalias(sGND, pstring(sPowerDevRes) + ".2");
}
}
@@ -455,15 +483,15 @@ namespace devices
nl_fptype VCC() const NL_NOEXCEPT { return m_VCC->Q_Analog(); }
nl_fptype GND() const NL_NOEXCEPT { return m_GND->Q_Analog(); }
- NETLIB_SUBXX(analog, R) m_RVG; // dummy resistor between VCC and GND
-
private:
void noop() { }
- plib::unique_ptr<analog_input_t> m_VCC; // only used during validation or force_analog_input
- plib::unique_ptr<analog_input_t> m_GND; // only used during validation or force_analog_input
+ unique_pool_ptr<analog_input_t> m_VCC; // only used during validation or force_analog_input
+ unique_pool_ptr<analog_input_t> m_GND; // only used during validation or force_analog_input
+
+ NETLIB_SUB_UPTR(analog, R) m_RVG; // dummy resistor between VCC and GND
};
-} //namespace devices
+} // namespace devices
} // namespace netlist
#endif /* NLD_SYSTEM_H_ */
diff --git a/src/lib/netlist/documentation/primer_1.dox.h b/src/lib/netlist/documentation/primer_1.dox.h
index 8df612e242d..33f0bf64759 100644
--- a/src/lib/netlist/documentation/primer_1.dox.h
+++ b/src/lib/netlist/documentation/primer_1.dox.h
@@ -1,6 +1,6 @@
/*! \page primer_1 nltool primer
-## First example
+# First example
Let's start with a simple charge/discharge circuit. I denotes the input,
O denotes the output.
@@ -53,7 +53,7 @@ Next, run
and enjoy the results.
-##Recap
+# Recap
We have created our first netlist fragment. nltool was used to model the
periodically forced charge/discharge circuit for 50ms. Finally we plotted both input
diff --git a/src/lib/netlist/documentation/structure.dox.h b/src/lib/netlist/documentation/structure.dox.h
index 41dd9507717..d284208a51b 100644
--- a/src/lib/netlist/documentation/structure.dox.h
+++ b/src/lib/netlist/documentation/structure.dox.h
@@ -1,20 +1,34 @@
-/*! The netlist namespace.
- * All netlist related code is contained in the netlist namespace
- */
+///
+/// \defgroup compiledefine Compilation defines
+///
+/// Compilation defines can be specified using -DDEFINE=VALUE during compilation.
+/// If this is not done, a default is set, e.g.
+/// \code
+/// #ifndef DEFINE
+/// #define DEFINE (0)
+/// #endif
+/// \endcode
+///
+/// The define statements below thus show the default value.
+///
+///@{
+///@}
+
+/// \brief The netlist namespace.
+/// All netlist related code is contained in the netlist namespace
+
namespace netlist
{
- /*! The netlist::devices namespace.
- * All netlist devices are contained in the netlist::devices namespace.
- */
+ /// \brief The netlist::devices namespace.
+ /// All netlist devices are contained in the netlist::devices namespace.
namespace devices
{
}
- /*! Internal support classes you should not use in code using netlist api.
- * This namespace contains all internal support classes not intended
- * to be used outside of the core.
- */
+ /// \brief Internal support classes you should not use in code using netlist api.
+ /// This namespace contains all internal support classes not intended
+ /// to be used outside of the core.
namespace detail
{
}
diff --git a/src/lib/netlist/macro/nlm_base.h b/src/lib/netlist/macro/nlm_base.h
index 6a88ad5a1be..2b5596b5410 100644
--- a/src/lib/netlist/macro/nlm_base.h
+++ b/src/lib/netlist/macro/nlm_base.h
@@ -3,6 +3,9 @@
#ifndef NLM_BASE_H_
#define NLM_BASE_H_
+/// \file nlm_base.h
+///
+
/*
* Provide base environment for netlist
*
diff --git a/src/lib/netlist/macro/nlm_cd4xxx.h b/src/lib/netlist/macro/nlm_cd4xxx.h
index d4d9c97fdc2..afb78706ea6 100644
--- a/src/lib/netlist/macro/nlm_cd4xxx.h
+++ b/src/lib/netlist/macro/nlm_cd4xxx.h
@@ -3,6 +3,9 @@
#ifndef NLD_CD4XXX_H_
#define NLD_CD4XXX_H_
+/// \file nlm_cd4xxx.h
+///
+
#include "netlist/nl_setup.h"
/*
diff --git a/src/lib/netlist/netlist.cppcheck b/src/lib/netlist/netlist.cppcheck
new file mode 100644
index 00000000000..642815cb052
--- /dev/null
+++ b/src/lib/netlist/netlist.cppcheck
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="1">
+ <platform>Native</platform>
+ <analyze-all-vs-configs>false</analyze-all-vs-configs>
+ <check-headers>true</check-headers>
+ <check-unused-templates>false</check-unused-templates>
+ <max-ctu-depth>10</max-ctu-depth>
+ <includedir>
+ <dir name="plib/"/>
+ <dir name="../"/>
+ </includedir>
+ <paths>
+ <dir name="/mnt/mfhome/andre/mame/mamegit/src/lib/netlist"/>
+ </paths>
+ <libraries>
+ <library>bsd</library>
+ <library>cppcheck-lib</library>
+ <library>gnu</library>
+ <library>posix</library>
+ <library>zlib</library>
+ </libraries>
+ <addons>
+ <addon>threadsafety</addon>
+ <addon>cert</addon>
+ </addons>
+</project>
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index 85939d3c19c..a5d94710ed6 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -1,9 +1,5 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*
- * nlbase.c
- *
- */
#include "solver/nld_matrix_solver.h"
#include "solver/nld_solver.h"
@@ -339,10 +335,9 @@ namespace netlist
dev.second->update_param();
// Step all devices once !
- /*
- * INFO: The order here affects power up of e.g. breakout. However, such
- * variations are explicitly stated in the breakout manual.
- */
+ //
+ // INFO: The order here affects power up of e.g. breakout. However, such
+ // variations are explicitly stated in the breakout manual.
auto *netlist_params = get_single_device<devices::NETLIB_NAME(netlistparams)>("parameter");
@@ -401,7 +396,7 @@ namespace netlist
}
#if 1
- /* the above may screw up m_active and the list */
+ // the above may screw up m_active and the list
rebuild_lists();
#endif
}
@@ -442,8 +437,8 @@ namespace netlist
const auto clang_workaround_unreachable_code = NL_USE_QUEUE_STATS;
if (clang_workaround_unreachable_code)
{
- /* Only one serialization should be counted in total time */
- /* But two are contained in m_stat_mainloop */
+ // Only one serialization should be counted in total time
+ // But two are contained in m_stat_mainloop
plib::pperftime_t<true> overhead;
plib::pperftime_t<true> test;
{
@@ -602,9 +597,8 @@ namespace netlist
state().setup().register_link_fqn(name() + "." + t1, name() + "." + t2);
}
- /* FIXME: this is only used by solver code since matrix solvers are started in
- * post_start.
- */
+ // FIXME: this is only used by solver code since matrix solvers are started in
+ // post_start.
void device_t::connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2)
{
if (!state().setup().connect(t1, t2))
@@ -651,7 +645,7 @@ namespace netlist
void detail::net_t::rebuild_list()
{
- /* rebuild m_list */
+ // rebuild m_list
m_list_active.clear();
for (auto & term : m_core_terms)
@@ -676,7 +670,7 @@ namespace netlist
if (p != nullptr)
p->m_cur_Analog = nlconst::zero();
- /* rebuild m_list and reset terminals to active or analog out state */
+ // rebuild m_list and reset terminals to active or analog out state
m_list_active.clear();
for (core_terminal_t *ct : m_core_terms)
@@ -943,7 +937,7 @@ namespace netlist
{
}
- const pstring param_model_t::value_str(const pstring &entity)
+ pstring param_model_t::value_str(const pstring &entity)
{
return state().setup().models().value_str(str(), entity);
}
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h
index 0260b096a8c..cd8d9f9fc5b 100644
--- a/src/lib/netlist/nl_base.h
+++ b/src/lib/netlist/nl_base.h
@@ -1,14 +1,13 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*!
- *
- * \file nl_base.h
- *
- */
#ifndef NLBASE_H_
#define NLBASE_H_
+///
+/// \file nl_base.h
+///
+
#ifdef NL_PROHIBIT_BASEH_INCLUDE
#error "nl_base.h included. Please correct."
#endif
@@ -34,24 +33,25 @@
// MACROS / New Syntax
//============================================================
-/*! Construct a netlist device name */
+/// Construct a netlist device name
#define NETLIB_NAME(chip) nld_ ## chip
#define NETLIB_OBJECT_DERIVED(name, pclass) \
class NETLIB_NAME(name) : public NETLIB_NAME(pclass)
-/*! Start a netlist device class.
- * Used to start defining a netlist device class.
- * The simplest device without inputs or outputs would look like this:
- *
- * NETLIB_OBJECT(some_object)
- * {
- * public:
- * NETLIB_CONSTRUCTOR(some_object) { }
- * };
- *
- * Also refer to #NETLIB_CONSTRUCTOR.
- */
+/// \brief Start a netlist device class.
+///
+/// Used to start defining a netlist device class.
+/// The simplest device without inputs or outputs would look like this:
+///
+/// NETLIB_OBJECT(some_object)
+/// {
+/// public:
+/// NETLIB_CONSTRUCTOR(some_object) { }
+/// };
+///
+/// Also refer to #NETLIB_CONSTRUCTOR.
+
#define NETLIB_OBJECT(name) \
class NETLIB_NAME(name) : public device_t
@@ -65,73 +65,87 @@ class NETLIB_NAME(name) : public device_t
public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name, __VA_ARGS__) \
: NETLIB_NAME(pclass)(owner, name)
-/*! Used to define the constructor of a netlist device.
- * Use this to define the constructor of a netlist device. Please refer to
- * #NETLIB_OBJECT for an example.
- */
+/// \brief Used to define the constructor of a netlist device.
+/// Use this to define the constructor of a netlist device. Please refer to
+/// #NETLIB_OBJECT for an example.
+
#define NETLIB_CONSTRUCTOR(cname) \
private: detail::family_setter_t m_famsetter; \
public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \
: device_t(owner, name)
- /*! Used to define the destructor of a netlist device.
- * The use of a destructor for netlist device should normally not be necessary.
- */
+/// \brief Used to define the destructor of a netlist device.
+/// The use of a destructor for netlist device should normally not be necessary.
+
#define NETLIB_DESTRUCTOR(name) public: virtual ~NETLIB_NAME(name)() noexcept
- /*! Define an extended constructor and add further parameters to it.
- * The macro allows to add further parameters to a device constructor. This is
- * normally used for sub-devices and system devices only.
- */
+/// \brief Define an extended constructor and add further parameters to it.
+/// The macro allows to add further parameters to a device constructor. This is
+/// normally used for sub-devices and system devices only.
+
#define NETLIB_CONSTRUCTOR_EX(cname, ...) \
private: detail::family_setter_t m_famsetter; \
public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name, __VA_ARGS__) \
: device_t(owner, name)
- /*! Add this to a device definition to mark the device as dynamic.
- *
- * If NETLIB_IS_DYNAMIC(true) is added to the device definition the device
- * is treated as an analog dynamic device, i.e. #NETLIB_UPDATE_TERMINALSI
- * is called on a each step of the Newton-Raphson step
- * of solving the linear equations.
- *
- * You may also use e.g. NETLIB_IS_DYNAMIC(m_func() != "") to only make the
- * device a dynamic device if parameter m_func is set.
- */
+/// \brief Add this to a device definition to mark the device as dynamic.
+///
+/// If NETLIB_IS_DYNAMIC(true) is added to the device definition the device
+/// is treated as an analog dynamic device, i.e. \ref NETLIB_UPDATE_TERMINALSI
+/// is called on a each step of the Newton-Raphson step
+/// of solving the linear equations.
+///
+/// You may also use e.g. NETLIB_IS_DYNAMIC(m_func() != "") to only make the
+/// device a dynamic device if parameter m_func is set.
+///
+/// \param expr boolean expression
+///
#define NETLIB_IS_DYNAMIC(expr) \
public: virtual bool is_dynamic() const noexcept override { return expr; }
- /*! Add this to a device definition to mark the device as a time-stepping device.
- *
- * You have to implement NETLIB_TIMESTEP in this case as well. Currently, only
- * the capacitor and inductor devices uses this.
- *
- * You may also use e.g. NETLIB_IS_TIMESTEP(m_func() != "") to only make the
- * device a dynamic device if parameter m_func is set. This is used by the
- * Voltage Source element.
- *
- * Example:
- *
- * NETLIB_TIMESTEP_IS_TIMESTEP()
- * NETLIB_TIMESTEPI()
- * {
- * // Gpar should support convergence
- * const nl_fptype G = m_C.Value() / step + m_GParallel;
- * const nl_fptype I = -G * deltaV();
- * set(G, 0.0, I);
- * }
- *
- */
+/// \brief Add this to a device definition to mark the device as a time-stepping device.
+///
+/// You have to implement NETLIB_TIMESTEP in this case as well. Currently, only
+/// the capacitor and inductor devices uses this.
+///
+/// You may also use e.g. NETLIB_IS_TIMESTEP(m_func() != "") to only make the
+/// device a dynamic device if parameter m_func is set. This is used by the
+/// Voltage Source element.
+///
+/// Example:
+///
+/// \code
+/// NETLIB_TIMESTEP_IS_TIMESTEP()
+/// NETLIB_TIMESTEPI()
+/// {
+/// // Gpar should support convergence
+/// const nl_fptype G = m_C.Value() / step + m_GParallel;
+/// const nl_fptype I = -G/// deltaV();
+/// set(G, 0.0, I);
+/// }
+/// \endcode
+
#define NETLIB_IS_TIMESTEP(expr) \
public: virtual bool is_timestep() const noexcept override { return expr; }
- /*! Used to implement the time stepping code.
- *
- * Please see NETLIB_IS_TIMESTEP for an example.
- */
+/// \brief Used to implement the time stepping code.
+///
+/// Please see \ref NETLIB_IS_TIMESTEP for an example.
+
#define NETLIB_TIMESTEPI() \
public: virtual void timestep(const nl_fptype step) noexcept override
+/// \brief Used to implement the body of the time stepping code.
+///
+/// Used when the implementation is outside the class definition
+///
+/// Please see \ref NETLIB_IS_TIMESTEP for an example.
+///
+/// \param cname Name of object as given to \ref NETLIB_OBJECT
+///
+#define NETLIB_TIMESTEP(cname) \
+ void NETLIB_NAME(cname) :: timestep(nl_fptype step) noexcept
+
#define NETLIB_FAMILY(family) , m_famsetter(*this, family)
#define NETLIB_DELEGATE(chip, name) nldelegate(&NETLIB_NAME(chip) :: name, this)
@@ -142,10 +156,8 @@ class NETLIB_NAME(name) : public device_t
#define NETLIB_UPDATE_PARAMI() virtual void update_param() noexcept override
#define NETLIB_RESETI() virtual void reset() override
-#define NETLIB_TIMESTEP(chip) void NETLIB_NAME(chip) :: timestep(nl_fptype step) noexcept
-
#define NETLIB_SUB(chip) nld_ ## chip
-#define NETLIB_SUBXX(ns, chip) unique_pool_ptr< ns :: nld_ ## chip >
+#define NETLIB_SUB_UPTR(ns, chip) unique_pool_ptr< ns :: nld_ ## chip >
#define NETLIB_HANDLER(chip, name) void NETLIB_NAME(chip) :: name() NL_NOEXCEPT
#define NETLIB_UPDATE(chip) NETLIB_HANDLER(chip, update)
@@ -175,9 +187,9 @@ class NETLIB_NAME(name) : public device_t
namespace netlist
{
- /*! Delegate type for device notification.
- *
- */
+ /// \brief Delegate type for device notification.
+ ///
+
using nldelegate = plib::pmfp<void>;
// -----------------------------------------------------------------------------
@@ -212,19 +224,22 @@ namespace netlist
// Exceptions
//============================================================
- /*! Generic netlist exception.
- * The exception is used in all events which are considered fatal.
- */
+ /// \brief Generic netlist exception.
+ /// The exception is used in all events which are considered fatal.
+
class nl_exception : public plib::pexception
{
public:
- /*! Constructor.
- * Allows a descriptive text to be assed to the exception
- */
+ /// \brief Constructor.
+ /// Allows a descriptive text to be assed to the exception
+
explicit nl_exception(const pstring &text //!< text to be passed
)
: plib::pexception(text) { }
+ /// \brief Constructor.
+ /// Allows to use \ref plib::pfmt logic to be used in exception
+
template<typename... Args>
explicit nl_exception(const pstring &fmt //!< format to be used
, Args&&... args //!< arguments to be passed
@@ -232,10 +247,10 @@ namespace netlist
: plib::pexception(plib::pfmt(fmt)(std::forward<Args>(args)...)) { }
};
- /*! Logic families descriptors are used to create proxy devices.
- * The logic family describes the analog capabilities of logic devices,
- * inputs and outputs.
- */
+ /// \brief Logic families descriptors are used to create proxy devices.
+ /// The logic family describes the analog capabilities of logic devices,
+ /// inputs and outputs.
+
class logic_family_desc_t
{
public:
@@ -258,7 +273,7 @@ namespace netlist
nl_fptype R_low() const noexcept{ return m_R_low; }
nl_fptype R_high() const noexcept{ return m_R_high; }
- nl_fptype m_fixed_V; //!< For variable voltage families, specify 0. For TTL this would be 5. */
+ nl_fptype m_fixed_V; //!< For variable voltage families, specify 0. For TTL this would be 5.
nl_fptype m_low_thresh_PCNT; //!< low input threshhold offset. If the input voltage is below this value times supply voltage, a "0" input is signalled
nl_fptype m_high_thresh_PCNT; //!< high input threshhold offset. If the input voltage is above the value times supply voltage, a "0" input is signalled
nl_fptype m_low_VO; //!< low output voltage offset. This voltage is output if the ouput is "0"
@@ -267,17 +282,17 @@ namespace netlist
nl_fptype m_R_high; //!< high output resistance. Value of series resistor used for high output
};
- /*! Base class for devices, terminals, outputs and inputs which support
- * logic families.
- * This class is a storage container to store the logic family for a
- * netlist object. You will not directly use it. Please refer to
- * #NETLIB_FAMILY to learn how to define a logic family for a device.
- *
- * All terminals inherit the family description from the device
- * The default is the ttl family, but any device can override the family.
- * For individual terminals, the family can be overwritten as well.
- *
- */
+ /// \brief Base class for devices, terminals, outputs and inputs which support
+ /// logic families.
+ /// This class is a storage container to store the logic family for a
+ /// netlist object. You will not directly use it. Please refer to
+ /// \ref NETLIB_FAMILY to learn how to define a logic family for a device.
+ ///
+ /// All terminals inherit the family description from the device
+ /// The default is the ttl family, but any device can override the family.
+ /// For individual terminals, the family can be overwritten as well.
+ ///
+
class logic_family_t
{
public:
@@ -292,21 +307,20 @@ namespace netlist
const logic_family_desc_t *m_logic_family;
};
- const logic_family_desc_t *family_TTL(); //*!< logic family for TTL devices.
- const logic_family_desc_t *family_CD4XXX(); //*!< logic family for CD4XXX CMOS devices.
-
- /*! A persistent variable template.
- * Use the state_var template to define a variable whose value is saved.
- * Within a device definition use
- *
- * NETLIB_OBJECT(abc)
- * {
- * NETLIB_CONSTRUCTOR(abc)
- * , m_var(*this, "myvar", 0)
- * ...
- * state_var<unsigned> m_var;
- * }
- */
+ const logic_family_desc_t *family_TTL(); ///< logic family for TTL devices.
+ const logic_family_desc_t *family_CD4XXX(); ///< logic family for CD4XXX CMOS devices.
+
+ /// \brief A persistent variable template.
+ /// Use the state_var template to define a variable whose value is saved.
+ /// Within a device definition use
+ ///
+ /// NETLIB_OBJECT(abc)
+ /// {
+ /// NETLIB_CONSTRUCTOR(abc)
+ /// , m_var(*this, "myvar", 0)
+ /// ...
+ /// state_var<unsigned> m_var;
+ /// }
template <typename T>
struct state_var
{
@@ -325,28 +339,32 @@ namespace netlist
//! Move Constructor.
constexpr state_var(state_var &&rhs) noexcept = default;
//! Assignment operator to assign value of a state var.
- C14CONSTEXPR state_var &operator=(const state_var &rhs) /*noexcept*/ = default; // OSX doesn't like noexcept
+ C14CONSTEXPR state_var &operator=(const state_var &rhs) = default; // OSX doesn't like noexcept
//! Assignment move operator to assign value of a state var.
C14CONSTEXPR state_var &operator=(state_var &&rhs) noexcept = default;
//! Assignment operator to assign value of type T.
C14CONSTEXPR state_var &operator=(const T &rhs) noexcept { m_value = rhs; return *this; }
//! Assignment move operator to assign value of type T.
C14CONSTEXPR state_var &operator=(T &&rhs) noexcept { std::swap(m_value, rhs); return *this; }
- //! Return value of state variable.
+ //! Return non-const value of state variable.
C14CONSTEXPR operator T & () noexcept { return m_value; }
//! Return const value of state variable.
constexpr operator const T & () const noexcept { return m_value; }
+ //! Return pointer to state variable.
C14CONSTEXPR T * ptr() noexcept { return &m_value; }
+ //! Return const pointer to state variable.
constexpr const T * ptr() const noexcept{ return &m_value; }
private:
T m_value;
};
- /*! A persistent array template.
- * Use this state_var template to define an array whose contents are saved.
- * Please refer to \ref state_var.
- */
+ /// \brief A persistent array template.
+ /// Use this state_var template to define an array whose contents are saved.
+ /// Please refer to \ref state_var.
+ ///
+ /// \tparam C container class to use.
+
template <typename C>
struct state_container : public C
{
@@ -379,16 +397,16 @@ namespace netlist
// State variables - predefined and c++11 non-optional
// -----------------------------------------------------------------------------
- /*! predefined state variable type for uint8_t */
+ /// \brief predefined state variable type for uint8_t
using state_var_u8 = state_var<std::uint8_t>;
- /*! predefined state variable type for int8_t */
+ /// \brief predefined state variable type for int8_t
using state_var_s8 = state_var<std::int8_t>;
- /*! predefined state variable type for uint32_t */
+ /// \brief predefined state variable type for uint32_t
using state_var_u32 = state_var<std::uint32_t>;
- /*! predefined state variable type for int32_t */
+ /// \brief predefined state variable type for int32_t
using state_var_s32 = state_var<std::int32_t>;
- /*! predefined state variable type for sig_t */
+ /// \brief predefined state variable type for sig_t
using state_var_sig = state_var<netlist_sig_t>;
namespace detail {
@@ -423,31 +441,32 @@ namespace netlist
// object_t
// -----------------------------------------------------------------------------
- /*! The base class for netlist devices, terminals and parameters.
- *
- * This class serves as the base class for all device, terminal and
- * objects. It provides new and delete operators to support e.g. pooled
- * memory allocation to enhance locality. Please refer to \ref USE_MEMPOOL as
- * well.
- */
+ /// \brief The base class for netlist devices, terminals and parameters.
+ ///
+ /// This class serves as the base class for all device, terminal and
+ /// objects. It provides new and delete operators to support e.g. pooled
+ /// memory allocation to enhance locality. Please refer to \ref NL_USE_MEMPOOL as
+ /// well.
+
class object_t
{
public:
- /*! Constructor.
- *
- * Every class derived from the object_t class must have a name.
- */
- explicit object_t(const pstring &aname /*!< string containing name of the object */)
+ /// \brief Constructor.
+ /// Every class derived from the object_t class must have a name.
+ ///
+ /// \param aname string containing name of the object
+
+ explicit object_t(const pstring &aname)
{
props::add(this, aname);
}
COPYASSIGNMOVE(object_t, delete)
- /*! return name of the object
- *
- * \returns name of the object.
- */
+ /// \brief return name of the object
+ ///
+ /// \returns name of the object.
+
pstring name() const noexcept
{
return props::get(this);
@@ -490,30 +509,30 @@ namespace netlist
// device_object_t
// -----------------------------------------------------------------------------
- /*! Base class for all objects being owned by a device.
- *
- * Serves as the base class of all objects being owned by a device.
- *
- */
+ /// \brief Base class for all objects being owned by a device.
+ ///
+ /// Serves as the base class of all objects being owned by a device.
+ ///
+
class device_object_t : public object_t
{
public:
- /*! Constructor.
- *
- * \param dev device owning the object.
- * \param name string holding the name of the device
- */
+ /// \brief Constructor.
+ ///
+ /// \param dev device owning the object.
+ /// \param name string holding the name of the device
+
device_object_t(core_device_t &dev, const pstring &name);
- /*! returns reference to owning device.
- * \returns reference to owning device.
- */
+ /// \brief returns reference to owning device.
+ /// \returns reference to owning device.
+
core_device_t &device() noexcept { return m_device; }
const core_device_t &device() const noexcept { return m_device; }
- /*! The netlist owning the owner of this object.
- * \returns reference to netlist object.
- */
+ /// \brief The netlist owning the owner of this object.
+ /// \returns reference to netlist object.
+
netlist_state_t &state() noexcept;
const netlist_state_t &state() const noexcept;
@@ -528,11 +547,11 @@ namespace netlist
// core_terminal_t
// -----------------------------------------------------------------------------
- /*! Base class for all terminals.
- *
- * All terminals are derived from this class.
- *
- */
+ /// \brief Base class for all terminals.
+ ///
+ /// All terminals are derived from this class.
+ ///
+
class net_t;
@@ -559,14 +578,14 @@ namespace netlist
COPYASSIGNMOVE(core_terminal_t, delete)
- /*! The object type.
- * \returns type of the object
- */
+ /// \brief The object type.
+ /// \returns type of the object
+
terminal_type type() const noexcept(false);
- /*! Checks if object is of specified type.
- * \param atype type to check object against.
- * \returns true if object is of specified type else false.
- */
+ /// \brief Checks if object is of specified type.
+ /// \param atype type to check object against.
+ /// \returns true if object is of specified type else false.
+
bool is_type(const terminal_type atype) const noexcept { return (type() == atype); }
void set_net(net_t *anet) noexcept { m_net = anet; }
@@ -656,7 +675,7 @@ namespace netlist
void add_to_active_list(core_terminal_t &term) noexcept;
void remove_from_active_list(core_terminal_t &term) noexcept;
- /* setup stuff */
+ // setup stuff
void add_terminal(core_terminal_t &terminal) noexcept(false);
void remove_terminal(core_terminal_t &terminal) noexcept(false);
@@ -664,7 +683,7 @@ namespace netlist
bool is_logic() const noexcept;
bool is_analog() const noexcept;
- void rebuild_list(); /* rebuild m_list after a load */
+ void rebuild_list(); // rebuild m_list after a load
void move_connections(net_t &dest_net);
std::vector<core_terminal_t *> &core_terms() noexcept { return m_core_terms; }
@@ -677,23 +696,23 @@ namespace netlist
#else
void update_inputs() const noexcept
{
- /* nothing needs to be done */
+ // nothing needs to be done
}
#endif
protected:
- /* only used for logic nets */
+ // only used for logic nets
netlist_sig_t Q() const noexcept { return m_cur_Q; }
- /* only used for logic nets */
+ // only used for logic nets
void initial(netlist_sig_t val) noexcept
{
m_cur_Q = m_new_Q = val;
update_inputs();
}
- /* only used for logic nets */
+ // only used for logic nets
void set_Q_and_push(netlist_sig_t newQ, netlist_time delay) noexcept
{
if (newQ != m_new_Q)
@@ -703,7 +722,7 @@ namespace netlist
}
}
- /* only used for logic nets */
+ // only used for logic nets
void set_Q_time(netlist_sig_t newQ, netlist_time at) noexcept
{
if (newQ != m_new_Q)
@@ -715,16 +734,16 @@ namespace netlist
update_inputs();
}
- /* internal state support
- * FIXME: get rid of this and implement export/import in MAME
- */
- /* only used for logic nets */
+ // internal state support
+ // FIXME: get rid of this and implement export/import in MAME
+
+ // only used for logic nets
netlist_sig_t *Q_state_ptr() noexcept { return m_cur_Q.ptr(); }
private:
state_var<netlist_sig_t> m_new_Q;
state_var<netlist_sig_t> m_cur_Q;
- state_var<queue_status> m_in_queue; /* 0: not in queue, 1: in queue, 2: last was taken */
+ state_var<queue_status> m_in_queue; // 0: not in queue, 1: in queue, 2: last was taken
state_var<netlist_time> m_next_scheduled_time;
core_terminal_t * m_railterminal;
@@ -851,28 +870,28 @@ namespace netlist
// analog_input_t
// -----------------------------------------------------------------------------
- /*! terminal providing analog input voltage.
- *
- * This terminal class provides a voltage measurement. The conductance against
- * ground is infinite.
- */
+ /// \brief terminal providing analog input voltage.
+ ///
+ /// This terminal class provides a voltage measurement. The conductance against
+ /// ground is infinite.
+
class analog_input_t : public analog_t
{
public:
- /*! Constructor */
- analog_input_t(core_device_t &dev, /*!< owning device */
- const pstring &aname, /*!< name of terminal */
- nldelegate delegate = nldelegate() /*!< delegate */
+ /// \brief Constructor
+ analog_input_t(core_device_t &dev, ///< owning device
+ const pstring &aname, ///< name of terminal
+ nldelegate delegate = nldelegate() ///< delegate
);
- /*! returns voltage at terminal.
- * \returns voltage at terminal.
- */
+ /// \brief returns voltage at terminal.
+ /// \returns voltage at terminal.
+
nl_fptype operator()() const noexcept { return Q_Analog(); }
- /*! returns voltage at terminal.
- * \returns voltage at terminal.
- */
+ /// \brief returns voltage at terminal.
+ /// \returns voltage at terminal.
+
nl_fptype Q_Analog() const noexcept;
};
@@ -977,7 +996,7 @@ namespace netlist
param_type_t param_type() const noexcept(false);
protected:
- virtual ~param_t() noexcept = default; /* not intended to be destroyed */
+ virtual ~param_t() noexcept = default; // not intended to be destroyed
void update_param() noexcept;
@@ -1026,7 +1045,7 @@ namespace netlist
int m_param;
};
- /* FIXME: these should go as well */
+ // FIXME: these should go as well
using param_logic_t = param_num_t<bool>;
using param_int_t = param_num_t<int>;
using param_fp_t = param_num_t<nl_fptype>;
@@ -1102,10 +1121,10 @@ namespace netlist
param_model_t(device_t &device, const pstring &name, const pstring &val)
: param_str_t(device, name, val) { }
- const pstring value_str(const pstring &entity) /*const*/;
- nl_fptype value(const pstring &entity) /*const*/;
- const pstring type() /*const*/;
- /* hide this */
+ pstring value_str(const pstring &entity);
+ nl_fptype value(const pstring &entity);
+ const pstring type();
+ // hide this
void setTo(const pstring &param) = delete;
protected:
void changed() noexcept override;
@@ -1174,7 +1193,7 @@ namespace netlist
{
if (++m_active_outputs == 1)
{
- if (m_stats/*NL_KEEP_STATISTICS*/)
+ if (m_stats)
m_stats->m_stat_inc_active.inc();
inc_active();
}
@@ -1192,12 +1211,12 @@ namespace netlist
void set_hint_deactivate(bool v) noexcept { m_hint_deactivate = v; }
bool get_hint_deactivate() const noexcept { return m_hint_deactivate; }
- /* Has to be set in device reset */
+ // Has to be set in device reset
void set_active_outputs(int n) noexcept { m_active_outputs = n; }
void set_default_delegate(detail::core_terminal_t &term);
- /* stats */
+ // stats
struct stats_t
{
// NL_KEEP_STATISTICS
@@ -1274,9 +1293,6 @@ namespace netlist
struct family_setter_t
{
- /* clang will complain about an unused private field if
- * a defaulted constructor is used
- */
// NOLINTNEXTLINE(modernize-use-equals-default)
family_setter_t();
family_setter_t(core_device_t &dev, const pstring &desc);
@@ -1286,9 +1302,9 @@ namespace netlist
template <class T, bool TS>
using timed_queue = plib::timed_queue_linear<T, TS>;
- /* Use timed_queue_heap to use stdc++ heap functions instead of linear processing.
- * This slows down processing by about 25% on a Kaby Lake.
- */
+ // Use timed_queue_heap to use stdc++ heap functions instead of linear processing.
+ /// This slows down processing by about 25% on a Kaby Lake.
+
//template <class T, bool TS>
//using timed_queue = timed_queue_heap<T, TS>;
@@ -1297,9 +1313,9 @@ namespace netlist
// queue_t
// -----------------------------------------------------------------------------
- /* We don't need a thread-safe queue currently. Parallel processing of
- * solvers will update inputs after parallel processing.
- */
+ // We don't need a thread-safe queue currently. Parallel processing of
+ /// solvers will update inputs after parallel processing.
+
class queue_t :
//public timed_queue<pqentry_t<net_t *, netlist_time>, false, NL_KEEP_STATISTICS>,
public timed_queue<plib::pqentry_t<net_t *, netlist_time>, false>,
@@ -1341,7 +1357,7 @@ namespace netlist
using nets_collection_type = std::vector<owned_pool_ptr<detail::net_t>>;
- /* need to preserve order of device creation ... */
+ // need to preserve order of device creation ...
using devices_collection_type = std::vector<std::pair<pstring, owned_pool_ptr<core_device_t>>>;
netlist_state_t(const pstring &aname,
netlist_t & anetlist,
@@ -1361,27 +1377,25 @@ namespace netlist
core_device_t *get_single_device(const pstring &classname, bool (*cc)(core_device_t *)) const;
- /**
- * @brief Get single device filtered by class and name
- *
- * @tparam C Device class for which devices will be returned
- * @param name Name of the device
- *
- * @return pointers to device
- */
+ /// \brief Get single device filtered by class and name
+ ///
+ /// \tparam C Device class for which devices will be returned
+ /// \param name Name of the device
+ ///
+ /// \return pointers to device
+
template<class C>
C *get_single_device(const pstring &name) const
{
return dynamic_cast<C *>(get_single_device(name, check_class<C>));
}
- /**
- * @brief Get vector of devices
- *
- * @tparam C Device class for which devices will be returned
- *
- * @return vector with pointers to devices
- */
+ /// \brief Get vector of devices
+ ///
+ /// \tparam C Device class for which devices will be returned
+ ///
+ /// \return vector with pointers to devices
+
template<class C>
inline std::vector<C *> get_device_list()
{
@@ -1395,7 +1409,7 @@ namespace netlist
return tmp;
}
- /* logging and name */
+ // logging and name
pstring name() const noexcept { return m_name; }
@@ -1407,7 +1421,7 @@ namespace netlist
netlist_t &exec() { return m_netlist; }
const netlist_t &exec() const { return m_netlist; }
- /* state handling */
+ // state handling
plib::state_manager_t &run_state_manager() { return m_state; }
template<typename O, typename C>
@@ -1427,14 +1441,13 @@ namespace netlist
template <typename T>
void register_net(owned_pool_ptr<T> &&net) { m_nets.push_back(std::move(net)); }
- /**
- * @brief Get device pointer by name
- *
- *
- * @param name Name of the device
- *
- * @return core_device_t pointer if device exists, else nullptr
- */
+ /// \brief Get device pointer by name
+ ///
+ ///
+ /// \param name Name of the device
+ ///
+ /// \return core_device_t pointer if device exists, else nullptr
+
core_device_t *find_device(const pstring &name)
{
for (auto & d : m_devices)
@@ -1443,15 +1456,14 @@ namespace netlist
return nullptr;
}
- /**
- * @brief Register device using owned_ptr
- *
- * Used to register owned devices. These are devices declared as objects
- * in another devices.
- *
- * @param name Name of the device
- * @param dev Device to be registered
- */
+ /// \brief Register device using owned_ptr
+ ///
+ /// Used to register owned devices. These are devices declared as objects
+ /// in another devices.
+ ///
+ /// \param name Name of the device
+ /// \param dev Device to be registered
+
template <typename T>
void register_device(const pstring &name, owned_pool_ptr<T> &&dev) noexcept(false)
{
@@ -1466,28 +1478,26 @@ namespace netlist
m_devices.insert(m_devices.end(), { name, std::move(dev) });
}
- /**
- * @brief Register device using unique_ptr
- *
- * Used to register devices.
- *
- * @param name Name of the device
- * @param dev Device to be registered
- */
+ /// \brief Register device using unique_ptr
+ ///
+ /// Used to register devices.
+ ///
+ /// \param name Name of the device
+ /// \param dev Device to be registered
+
template <typename T>
void register_device(const pstring &name, unique_pool_ptr<T> &&dev)
{
register_device(name, owned_pool_ptr<T>(dev.release(), true, dev.get_deleter()));
}
- /**
- * @brief Remove device
- *
- * Care needs to be applied if this is called to remove devices with
- * sub-devices which may have registered state.
- *
- * @param dev Device to be removed
- */
+ /// \brief Remove device
+ ///
+ /// Care needs to be applied if this is called to remove devices with
+ /// sub-devices which may have registered state.
+ ///
+ /// \param dev Device to be removed
+
void remove_device(core_device_t *dev)
{
for (auto it = m_devices.begin(); it != m_devices.end(); it++)
@@ -1503,7 +1513,7 @@ namespace netlist
const setup_t &setup() const noexcept { return *m_setup; }
// FIXME: make a postload member and include code there
- void rebuild_lists(); /* must be called after post_load ! */
+ void rebuild_lists(); // must be called after post_load !
static void compile_defines(std::vector<std::pair<pstring, pstring>> &defs);
@@ -1513,7 +1523,7 @@ namespace netlist
devices_collection_type & devices() noexcept { return m_devices; }
const devices_collection_type & devices() const noexcept { return m_devices; }
- /* sole use is to manage lifetime of family objects */
+ // sole use is to manage lifetime of family objects
std::unordered_map<pstring, plib::unique_ptr<logic_family_desc_t>> m_family_cache;
private:
@@ -1529,7 +1539,7 @@ namespace netlist
plib::unique_ptr<setup_t> m_setup;
nets_collection_type m_nets;
- /* sole use is to manage lifetime of net objects */
+ // sole use is to manage lifetime of net objects
devices_collection_type m_devices;
@@ -1550,7 +1560,7 @@ namespace netlist
virtual ~netlist_t() noexcept = default;
- /* run functions */
+ // run functions
netlist_time time() const noexcept { return m_time; }
@@ -1583,19 +1593,19 @@ namespace netlist
m_queue.remove<true>(elem);
}
- /* Control functions */
+ // Control functions
void stop();
void reset();
- /* state handling */
+ // state handling
plib::state_manager_t &run_state_manager() noexcept { return m_state->run_state_manager(); }
- /* only used by nltool to create static c-code */
+ // only used by nltool to create static c-code
devices::NETLIB_NAME(solver) *solver() const noexcept { return m_solver; }
- /* force late type resolution */
+ // force late type resolution
template <typename X = devices::NETLIB_NAME(solver)>
nl_fptype gmin(X *solv = nullptr) const noexcept
{
@@ -1622,7 +1632,7 @@ namespace netlist
plib::unique_ptr<netlist_state_t> m_state;
devices::NETLIB_NAME(solver) * m_solver;
- /* mostly rw */
+ // mostly rw
PALIGNAS_CACHELINE()
netlist_time m_time;
devices::NETLIB_NAME(mainclock) * m_mainclock;
@@ -1794,7 +1804,7 @@ namespace netlist
{
if (m_next_scheduled_time > exec().time())
{
- m_in_queue = queue_status::QUEUED; /* pending */
+ m_in_queue = queue_status::QUEUED; // pending
exec().qpush(detail::queue_t::entry_t(m_next_scheduled_time, this));
}
else
@@ -1972,7 +1982,7 @@ namespace netlist
{
nl_assert(this->isRailNet());
- m_in_queue = queue_status::DELIVERED; /* mark as taken ... */
+ m_in_queue = queue_status::DELIVERED; // mark as taken ...
if (m_new_Q ^ m_cur_Q)
process<KEEP_STATS>((m_new_Q << core_terminal_t::INP_LH_SHIFT)
| (m_cur_Q << core_terminal_t::INP_HL_SHIFT), m_new_Q);
@@ -2042,4 +2052,4 @@ namespace plib
-#endif /* NLBASE_H_ */
+#endif // NLBASE_H_
diff --git a/src/lib/netlist/nl_config.h b/src/lib/netlist/nl_config.h
index bbd32490c30..72926478a50 100644
--- a/src/lib/netlist/nl_config.h
+++ b/src/lib/netlist/nl_config.h
@@ -1,89 +1,82 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*!
- *
- * \file nl_config.h
- *
- */
+
+/// \file nl_config.h
+///
#ifndef NLCONFIG_H_
#define NLCONFIG_H_
#include "plib/pconfig.h"
-//============================================================
-// SETUP
-//============================================================
-
+/// \addtogroup compiledefine
+/// @{
//============================================================
// GENERAL
//============================================================
-/*! Make use of a memory pool for performance related objects.
- *
- * Set to 1 to compile netlist with memory allocations from a
- * linear memory pool. This is based of the assumption that
- * due to enhanced locality there will be less cache misses.
- * Your mileage may vary.
- *
- */
+/// \brief Make use of a memory pool for performance related objects.
+///
+/// Set to 1 to compile netlist with memory allocations from a
+/// linear memory pool. This is based of the assumption that
+/// due to enhanced locality there will be less cache misses.
+/// Your mileage may vary.
+///
+
#ifndef NL_USE_MEMPOOL
#define NL_USE_MEMPOOL (1)
#endif
-/*! Enable queue statistics.
- *
- * Queue statistics come at a performance cost. Although
- * the cost is low, we disable them here since they are
- * only needed during development.
- *
- */
+/// \brief Enable queue statistics.
+///
+/// Queue statistics come at a performance cost. Although
+/// the cost is low, we disable them here since they are
+/// only needed during development.
+///
+
#ifndef NL_USE_QUEUE_STATS
#define NL_USE_QUEUE_STATS (0)
#endif
-/*! Store input values in logic_terminal_t.
- *
- * Set to 1 to store values in logic_terminal_t instead of
- * accessing them indirectly by pointer from logic_net_t.
- * This approach is stricter and should identify bugs in
- * the netlist core faster.
- * By default it is disabled since it is not as fast as
- * the default approach. It is up to 10% slower.
- *
- */
+/// \brief Store input values in logic_terminal_t.
+///
+/// Set to 1 to store values in logic_terminal_t instead of
+/// accessing them indirectly by pointer from logic_net_t.
+/// This approach is stricter and should identify bugs in
+/// the netlist core faster.
+/// By default it is disabled since it is not as fast as
+/// the default approach. It is up to 10% slower.
+///
+
#ifndef NL_USE_COPY_INSTEAD_OF_REFERENCE
#define NL_USE_COPY_INSTEAD_OF_REFERENCE (0)
#endif
-/*! Use the truthtable implementation of 7448 instead of the coded device
- *
- * FIXME: Using truthtable is a lot slower than the explicit device
- * in breakout. Performance drops by 20%. This can be fixed by
- * setting param USE_DEACTIVATE for the device.
- */
+/// \brief Use the truthtable implementation of 7448 instead of the coded device
+///
+/// FIXME: Using truthtable is a lot slower than the explicit device
+/// in breakout. Performance drops by 20%. This can be fixed by
+/// setting param USE_DEACTIVATE for the device.
#ifndef NL_USE_TRUTHTABLE_7448
#define NL_USE_TRUTHTABLE_7448 (0)
#endif
-/*! Use the truthtable implementation of 74107 instead of the coded device
- *
- * FIXME: The truthtable implementation of 74107 (JK-Flipflop)
- * is included for educational purposes to demonstrate how
- * to implement state holding devices as truthtables.
- * It will completely nuke performance for pong.
- */
+/// \brief Use the truthtable implementation of 74107 instead of the coded device
+///
+/// FIXME: The truthtable implementation of 74107 (JK-Flipflop)
+/// is included for educational purposes to demonstrate how
+/// to implement state holding devices as truthtables.
+/// It will completely nuke performance for pong.
#ifndef NL_USE_TRUTHTABLE_74107
#define NL_USE_TRUTHTABLE_74107 (0)
#endif
-/*! Use the __float128 type for matrix calculations.
- *
- * Defaults to PUSE_FLOAT128
- */
+/// \brief Use the __float128 type for matrix calculations.
+///
+/// Defaults to \ref PUSE_FLOAT128
#ifndef NL_USE_FLOAT128
#define NL_USE_FLOAT128 PUSE_FLOAT128
@@ -93,6 +86,9 @@
// DEBUGGING
//============================================================
+/// \brief Enable compile time debugging code
+///
+
#ifndef NL_DEBUG
#define NL_DEBUG (false)
//#define NL_DEBUG (true)
@@ -102,37 +98,43 @@
// Time resolution
//============================================================
-// Use nano-second resolution - Sufficient for now
+/// \brief Resolution as clocks per second for timing
+///
+/// Uses nano-second resolution - Sufficient for now
static constexpr const auto NETLIST_INTERNAL_RES = 1000000000;
+
+// FIXME: Belongs into MAME netlist.h
static constexpr const auto NETLIST_CLOCK = NETLIST_INTERNAL_RES;
-/*! Floating point types used
- *
- * nl_fptype is the floating point type used throughout the
- * netlist core.
- *
- * Don't change this! Simple analog circuits like pong
- * work with float. Kidniki just doesn't work at all.
- *
- * FIXME: More work needed. Review magic numbers.
- *
- */
+/// @}
+
+/// \brief Floating point types used
+///
+/// nl_fptype is the floating point type used throughout the
+/// netlist core.
+///
+/// Don't change this! Simple analog circuits like pong
+/// work with float. Kidniki just doesn't work at all.
+///
+/// FIXME: More work needed. Review magic numbers.
+///
+///
using nl_fptype = double;
namespace netlist
{
- /*! Specific constants depending on floating type
- *
- * @tparam FT floating point type: double/float
- */
+ /// \brief Specific constants depending on floating type
+ ///
+ /// @tparam FT floating point type: double/float
+ ///
template <typename FT>
struct fp_constants
{ };
- /*! Specific constants for long double floating point type
- */
+ /// \brief Specific constants for long double floating point type
+ ///
template <>
struct fp_constants<long double>
{
@@ -146,8 +148,8 @@ namespace netlist
static inline constexpr const char * suffix() noexcept { return "L"; }
};
- /*! Specific constants for double floating point type
- */
+ /// \brief Specific constants for double floating point type
+ ///
template <>
struct fp_constants<double>
{
@@ -161,8 +163,8 @@ namespace netlist
static inline constexpr const char * suffix() noexcept { return ""; }
};
- /*! Specific constants for float floating point type
- */
+ /// \brief Specific constants for float floating point type
+ ///
template <>
struct fp_constants<float>
{
@@ -177,8 +179,8 @@ namespace netlist
};
#if (NL_USE_FLOAT128)
- /*! Specific constants for __float128 floating point type
- */
+ /// \brief Specific constants for __float128 floating point type
+ ///
template <>
struct fp_constants<__float128>
{
@@ -207,4 +209,4 @@ namespace netlist
#endif
} // namespace netlist
-#endif /* NLCONFIG_H_ */
+#endif // NLCONFIG_H_
diff --git a/src/lib/netlist/nl_errstr.h b/src/lib/netlist/nl_errstr.h
index 4681d027d79..bec1070b3d0 100644
--- a/src/lib/netlist/nl_errstr.h
+++ b/src/lib/netlist/nl_errstr.h
@@ -1,10 +1,9 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*!
- *
- * \file nl_errstr.h
- *
- */
+
+///
+/// \file nl_errstr.h
+///
#ifndef NL_ERRSTR_H_
#define NL_ERRSTR_H_
@@ -32,6 +31,8 @@ namespace netlist
static constexpr const char sHINT_NO_DEACTIVATE[] = ".HINT_NO_DEACTIVATE";
static constexpr const char sPowerDevRes[] = "_RVG";
+ static constexpr const char sPowerGND[] = "GND";
+ static constexpr const char sPowerVCC[] = "VCC";
// nl_base.cpp
@@ -149,4 +150,4 @@ namespace netlist
} // namespace netlist
-#endif /* NL_ERRSTR_H_ */
+#endif // NL_ERRSTR_H_
diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp
index 624d35975ad..4ab1c7765d0 100644
--- a/src/lib/netlist/nl_factory.cpp
+++ b/src/lib/netlist/nl_factory.cpp
@@ -1,12 +1,9 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/***************************************************************************
- nl_factory.c
-
- Discrete netlist implementation.
-
-****************************************************************************/
+//
+// nl_factory.cpp
+//
#include "nl_factory.h"
#include "nl_base.h"
diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h
index f633962d86d..ec53eb3bde7 100644
--- a/src/lib/netlist/nl_factory.h
+++ b/src/lib/netlist/nl_factory.h
@@ -1,10 +1,9 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*
- * nl_factory.h
- *
- *
- */
+
+///
+/// \file nl_factory.h
+///
#ifndef NLFACTORY_H_
#define NLFACTORY_H_
@@ -68,10 +67,10 @@ namespace factory {
const pstring &sourcefile() const { return m_sourcefile; }
private:
- pstring m_name; /* device name */
- pstring m_classname; /* device class name */
- pstring m_def_param; /* default parameter */
- pstring m_sourcefile; /* source file */
+ pstring m_name; ///< device name
+ pstring m_classname; ///< device class name
+ pstring m_def_param; ///< default parameter
+ pstring m_sourcefile; ///< source file
};
template <class C>
@@ -161,4 +160,4 @@ namespace factory {
} // namespace devices
} // namespace netlist
-#endif /* NLFACTORY_H_ */
+#endif // NLFACTORY_H_
diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp
index d07335f343b..3db19416193 100644
--- a/src/lib/netlist/nl_parser.cpp
+++ b/src/lib/netlist/nl_parser.cpp
@@ -1,9 +1,5 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*
- * nl_parser.c
- *
- */
#include "nl_parser.h"
#include "nl_base.h"
diff --git a/src/lib/netlist/nl_parser.h b/src/lib/netlist/nl_parser.h
index ce95f6ec346..0805684e286 100644
--- a/src/lib/netlist/nl_parser.h
+++ b/src/lib/netlist/nl_parser.h
@@ -1,9 +1,9 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*
- * nl_parser.c
- *
- */
+
+///
+/// \file nl_parser.c
+///
#ifndef NL_PARSER_H_
#define NL_PARSER_H_
@@ -42,9 +42,6 @@ namespace netlist
void net_local_source();
void net_truthtable_start(const pstring &nlname);
- /* for debugging messages */
- //netlist_state_t &netlist() { return m_setup.netlist(); }
-
void verror(const pstring &msg) override;
private:
@@ -77,4 +74,4 @@ namespace netlist
} // namespace netlist
-#endif /* NL_PARSER_H_ */
+#endif // NL_PARSER_H_
diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp
index 21c9bf02654..61672b5b73f 100644
--- a/src/lib/netlist/nl_setup.cpp
+++ b/src/lib/netlist/nl_setup.cpp
@@ -1,9 +1,5 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*
- * nlsetup.c
- *
- */
#include "plib/palloc.h"
#include "analog/nld_twoterm.h"
@@ -63,7 +59,7 @@ namespace netlist
}
else
{
- /* make sure we parse macro library entries */
+ // make sure we parse macro library entries
f->macro_actions(*this, name);
pstring key = build_fqn(name);
if (device_exists(key))
@@ -331,7 +327,7 @@ pstring setup_t::resolve_alias(const pstring &name) const
pstring temp = name;
pstring ret;
- /* FIXME: Detect endless loop */
+ // FIXME: Detect endless loop
do {
ret = temp;
auto p = m_alias.find(ret);
@@ -347,7 +343,7 @@ pstring setup_t::de_alias(const pstring &alias) const
pstring temp = alias;
pstring ret;
- /* FIXME: Detect endless loop */
+ // FIXME: Detect endless loop
do {
ret = temp;
temp = "";
@@ -406,10 +402,10 @@ detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool
{
const pstring &tname = resolve_alias(terminal_in);
auto ret = m_terminals.find(tname);
- /* look for default */
+ // look for default
if (ret == m_terminals.end())
{
- /* look for ".Q" std output */
+ // look for ".Q" std output
ret = m_terminals.find(tname + ".Q");
}
@@ -430,10 +426,10 @@ detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in,
{
const pstring &tname = resolve_alias(terminal_in);
auto ret = m_terminals.find(tname);
- /* look for default */
+ // look for default
if (ret == m_terminals.end() && atype == detail::terminal_type::OUTPUT)
{
- /* look for ".Q" std output */
+ // look for ".Q" std output
ret = m_terminals.find(tname + ".Q");
}
if (ret == m_terminals.end() && required)
@@ -489,7 +485,7 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(detail::core_terminal_t &out)
auto new_proxy =
out_cast.logic_family()->create_d_a_proxy(m_nlstate, x, &out_cast);
m_proxy_cnt++;
- /* connect all existing terminals to new net */
+ // connect all existing terminals to new net
for (auto & p : out.net().core_terms())
{
@@ -534,7 +530,7 @@ devices::nld_base_proxy *setup_t::get_a_d_proxy(detail::core_terminal_t &inp)
auto ret = new_proxy.get();
- /* connect all existing terminals to new net */
+ // connect all existing terminals to new net
if (inp.has_net())
{
@@ -639,7 +635,7 @@ void setup_t::connect_terminal_output(terminal_t &in, detail::core_terminal_t &o
if (out.is_analog())
{
log().debug("connect_terminal_output: {1} {2}\n", in.name(), out.name());
- /* no proxy needed, just merge existing terminal net */
+ // no proxy needed, just merge existing terminal net
if (in.has_net())
merge_nets(out.net(), in.net());
else
@@ -794,10 +790,10 @@ void setup_t::resolve_inputs()
{
log().verbose("Resolving inputs ...");
- /* Netlist can directly connect input to input.
- * We therefore first park connecting inputs and retry
- * after all other terminals were connected.
- */
+ // Netlist can directly connect input to input.
+ // We therefore first park connecting inputs and retry
+ // after all other terminals were connected.
+
unsigned tries = m_netlist_params->m_max_link_loops();
while (m_links.size() > 0 && tries > 0)
{
@@ -1113,7 +1109,7 @@ void setup_t::prepare_to_run()
{
register_dynamic_log_devices();
- /* make sure the solver and parameters are started first! */
+ // make sure the solver and parameters are started first!
for (auto & e : m_device_factory)
{
@@ -1129,12 +1125,12 @@ void setup_t::prepare_to_run()
auto solver = m_nlstate.get_single_device<devices::NETLIB_NAME(solver)>("solver");
m_netlist_params = m_nlstate.get_single_device<devices::NETLIB_NAME(netlistparams)>("parameter");
- /* set default model parameters */
+ // set default model parameters
m_models.register_model(plib::pfmt("NMOS_DEFAULT _(CAPMOD={1})")(m_netlist_params->m_mos_capmodel()));
m_models.register_model(plib::pfmt("PMOS_DEFAULT _(CAPMOD={1})")(m_netlist_params->m_mos_capmodel()));
- /* create devices */
+ // create devices
log().debug("Creating devices ...\n");
for (auto & e : m_device_factory)
@@ -1190,7 +1186,7 @@ void setup_t::prepare_to_run()
d.second->set_hint_deactivate(false);
}
- /* resolve inputs */
+ // resolve inputs
resolve_inputs();
log().verbose("looking for two terms connected to rail nets ...");
diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h
index 695c9553193..caa25c6092f 100644
--- a/src/lib/netlist/nl_setup.h
+++ b/src/lib/netlist/nl_setup.h
@@ -1,9 +1,9 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*
- * nlsetup.h
- *
- */
+
+///
+/// \file nl_setup.h
+///
#ifndef NLSETUP_H_
#define NLSETUP_H_
@@ -38,7 +38,7 @@
#define DIPPINS(pin1, ...) \
setup.register_dippins_arr( # pin1 ", " # __VA_ARGS__);
-/* to be used to reference new library truthtable devices */
+// to be used to reference new library truthtable devices
#define NET_REGISTER_DEV(type, name) \
setup.register_dev(# type, # name);
@@ -80,7 +80,6 @@ void NETLIST_NAME(name)(netlist::nlparse_t &setup) \
#define SUBMODEL(model, name) \
setup.namespace_push(# name); \
setup.include(# model); \
- /*NETLIST_NAME(model)(setup);*/ \
setup.namespace_pop();
#define OPTIMIZE_FRONTIER(attach, r_in, r_out) \
@@ -208,7 +207,7 @@ namespace netlist
{
public:
void register_model(const pstring &model_in);
- /* model / family related */
+ // model / family related
pstring value_str(const pstring &model, const pstring &entity);
@@ -265,7 +264,7 @@ namespace netlist
void register_lib_entry(const pstring &name, const pstring &sourcefile);
void register_frontier(const pstring &attach, const nl_fptype r_IN, const nl_fptype r_OUT);
- /* register a source */
+ // register a source
void register_source(plib::unique_ptr<plib::psource_t> &&src)
{
m_sources.add_source(std::move(src));
@@ -273,25 +272,25 @@ namespace netlist
void tt_factory_create(tt_desc &desc, const pstring &sourcefile);
- /* handle namespace */
+ // handle namespace
void namespace_push(const pstring &aname);
void namespace_pop();
- /* include other files */
+ // include other files
void include(const pstring &netlist_name);
pstring build_fqn(const pstring &obj_name) const;
void register_alias_nofqn(const pstring &alias, const pstring &out);
- /* also called from devices for latebinding connected terminals */
+ // also called from devices for latebinding connected terminals
void register_link_fqn(const pstring &sin, const pstring &sout);
- /* used from netlist.cpp (mame) */
+ // used from netlist.cpp (mame)
bool device_exists(const pstring &name) const;
- /* FIXME: used by source_t - need a different approach at some time */
+ // FIXME: used by source_t - need a different approach at some time
bool parse_stream(plib::psource_t::stream_ptr &&istrm, const pstring &name);
void add_include(plib::unique_ptr<plib::psource_t> &&inc)
@@ -312,13 +311,13 @@ namespace netlist
log_type &log() { return m_log; }
const log_type &log() const { return m_log; }
- /* FIXME: sources may need access to the netlist parent type
- * since they may be created in a context in which they don't
- * have access to their environment.
- * Example is the MAME memregion source.
- * We thus need a better approach to creating netlists in a context
- * other than static procedures.
- */
+ // FIXME: sources may need access to the netlist parent type
+ // since they may be created in a context in which they don't
+ // have access to their environment.
+ // Example is the MAME memregion source.
+ // We thus need a better approach to creating netlists in a context
+ // other than static procedures.
+
setup_t &setup() { return m_setup; }
const setup_t &setup() const { return m_setup; }
@@ -336,7 +335,7 @@ namespace netlist
factory::list_t m_factory;
- /* need to preserve order of device creation ... */
+ // need to preserve order of device creation ...
std::vector<std::pair<pstring, factory::element_t *>> m_device_factory;
@@ -377,7 +376,7 @@ namespace netlist
param_t *find_param(const pstring &param_in, bool required = true) const;
- /* get family */
+ // get family
const logic_family_desc_t *family_from_model(const pstring &model);
void register_dynamic_log_devices();
@@ -388,38 +387,44 @@ namespace netlist
factory::list_t &factory() { return m_factory; }
const factory::list_t &factory() const { return m_factory; }
- /* helper - also used by nltool */
+ // helper - also used by nltool
pstring resolve_alias(const pstring &name) const;
pstring de_alias(const pstring &alias) const;
- /* needed by nltool */
+ // needed by nltool
std::vector<pstring> get_terminals_for_device_name(const pstring &devname) const;
log_type &log();
const log_type &log() const;
- /* needed by proxy */
+ // needed by proxy
detail::core_terminal_t *find_terminal(const pstring &outname_in, const detail::terminal_type atype, bool required = true) const;
detail::core_terminal_t *find_terminal(const pstring &terminal_in, bool required = true) const;
- /* core net handling */
+ // core net handling
void delete_empty_nets();
- /* run preparation */
+ // run preparation
void prepare_to_run();
- /* validation */
-
- /* The extended validation mode is not intended for running.
- * The intention is to identify power pins which are not properly
- * connected. The downside is that this mode creates a netlist which
- * is different (and not able to run).
- *
- * Extended validation is supported by nltool validate option.
- */
+ /// \brief set extended validation mode.
+ ///
+ /// The extended validation mode is not intended for running.
+ /// The intention is to identify power pins which are not properly
+ /// connected. The downside is that this mode creates a netlist which
+ /// is different (and not able to run).
+ ///
+ /// Extended validation is supported by nltool validate option.
+ ///
+ /// \param val Boolean value enabling/disabling extended validation mode
void set_extended_validation(bool val) { m_validation = val; }
+
+ /// \brief State of extended validation mode.
+ ///
+ /// \returns boolean value indicating if extended validation mode is
+ /// turned on.
bool is_extended_validation() const { return m_validation; }
private:
@@ -525,4 +530,4 @@ namespace netlist
} // namespace netlist
-#endif /* NLSETUP_H_ */
+#endif // NLSETUP_H_
diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h
index 1171d56cd34..2cebef3b428 100644
--- a/src/lib/netlist/nltypes.h
+++ b/src/lib/netlist/nltypes.h
@@ -1,14 +1,13 @@
// license:GPL-2.0+
// copyright-holders:Couriersud
-/*!
- *
- * \file nltypes.h
- *
- */
-/* \note never change the name to nl_types.h. This creates a conflict
- * with nl_types.h file provided by libc++ (clang, macosx)
- */
+///
+/// \file nltypes.h
+///
+
+/// \note never change the name to nl_types.h. This creates a conflict
+/// with nl_types.h file provided by libc++ (clang, macosx)
+///
#ifndef NLTYPES_H_
#define NLTYPES_H_
@@ -26,41 +25,36 @@
namespace netlist
{
- /*! @brief plib::constants struct specialized for nl_fptype
- *
- */
+ /// @brief plib::constants struct specialized for nl_fptype.
+ ///
struct nlconst : public plib::constants<nl_fptype>
{
};
- /*! @brief netlist_sig_t is the type used for logic signals.
- *
- * This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t.
- * The choice has little to no impact on performance.
- */
+ /// @brief netlist_sig_t is the type used for logic signals.
+ ///
+ /// This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t.
+ /// The choice has little to no impact on performance.
+ ///
using netlist_sig_t = std::uint32_t;
- /* FIXME: belongs into nl_base.h to nlstate */
- /**
- * @brief Interface definition for netlist callbacks into calling code
- *
- * A class inheriting from netlist_callbacks_t has to be passed to the netlist_t
- * constructor. Netlist does processing during construction and thus needs
- * the object passed completely constructed.
- *
- */
+ /// @brief Interface definition for netlist callbacks into calling code
+ ///
+ /// A class inheriting from netlist_callbacks_t has to be passed to the netlist_t
+ /// constructor. Netlist does processing during construction and thus needs
+ /// the object passed completely constructed.
+ ///
class callbacks_t
{
public:
callbacks_t() = default;
- /* what is done before this is passed as a unique_ptr to netlist
- * we should not limit.
- */
virtual ~callbacks_t() = default;
+
COPYASSIGNMOVE(callbacks_t, default)
- /* logging callback */
+ /// \brief logging callback.
+ ///
virtual void vlog(const plib::plog_level &l, const pstring &ls) const noexcept = 0;
};
@@ -71,11 +65,10 @@ namespace netlist
// Types needed by various includes
//============================================================
- /*! The memory pool for netlist objects
- *
- * \note This is not the right location yet.
- *
- */
+ /// \brief The memory pool for netlist objects
+ ///
+ /// \note This is not the right location yet.
+ ///
#if (NL_USE_MEMPOOL)
using nlmempool = plib::mempool;
@@ -83,15 +76,14 @@ namespace netlist
using nlmempool = plib::aligned_arena;
#endif
- /*! Owned pointer type for pooled allocations.
- *
- */
+ /// \brief Owned pointer type for pooled allocations.
+ ///
template <typename T>
using owned_pool_ptr = nlmempool::owned_pool_ptr<T>;
- /*! Unique pointer type for pooled allocations.
- *
- */
+ /// \brief Unique pointer type for pooled allocations.
+ ///
+
template <typename T>
using unique_pool_ptr = nlmempool::unique_pool_ptr<T>;
@@ -103,11 +95,12 @@ namespace netlist
namespace detail {
- /*! Enum specifying the type of object */
+ /// \brief Enum specifying the type of object
+ ///
enum class terminal_type {
- TERMINAL = 0, /*!< object is an analog terminal */
- INPUT = 1, /*!< object is an input */
- OUTPUT = 2, /*!< object is an output */
+ TERMINAL = 0, ///< object is an analog terminal
+ INPUT = 1, ///< object is an input
+ OUTPUT = 2, ///< object is an output
};
} // namespace detail
@@ -138,4 +131,4 @@ namespace plib {
}
} // namespace plib
-#endif /* NLTYPES_H_ */
+#endif // NLTYPES_H_
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp
index 0bfb324c607..31cbecf2bb4 100644
--- a/src/lib/netlist/prg/nltool.cpp
+++ b/src/lib/netlist/prg/nltool.cpp
@@ -9,6 +9,7 @@
****************************************************************************/
#include "netlist/plib/pmain.h"
+#include "netlist/plib/pstrutil.h"
#include "netlist/devices/net_lib.h"
#include "netlist/nl_errstr.h"
#include "netlist/nl_parser.h"
@@ -114,6 +115,18 @@ public:
int execute() override;
pstring usage() override;
+ template<typename... ARGS>
+ void poutprefix(pstring prefix, pstring fmt, ARGS&&... args)
+ {
+ pstring res = plib::pfmt(fmt)(std::forward<ARGS>(args)...);
+ auto lines(plib::psplit(res, "\n", false));
+ if (lines.size() == 0)
+ pout(prefix + "\n");
+ else
+ for (auto &l : lines)
+ pout(prefix + l + "\n");
+ }
+
int m_warnings;
int m_errors;
private:
@@ -529,6 +542,103 @@ void tool_app_t::static_compile()
}
+
+
+/* "Description: The Swiss army knife for timing purposes\n"
+* " which has a ton of applications.\n"
+* "DipAlias: GND,TRIG,OUT,RESET,VCC,DISCH,THRES,CONT\n"
+* "Package: DIP\n"
+* "NamingConvention: Naming conventions follow Texas Instruments datasheet\n"
+* "Limitations: Internal resistor network currently fixed to 5k\n"
+* " more limitations\n"
+* "FunctionTable:\n"
+*/
+
+struct doc_ext
+{
+ pstring id;
+ pstring title;
+ pstring description;
+ std::vector<pstring> pinalias;
+ pstring package;
+ pstring namingconventions;
+ pstring limitations;
+ pstring functiontable;
+ std::vector<pstring> example;
+};
+
+static doc_ext read_docsrc(const pstring &fname, const pstring &id)
+{
+ //printf("file %s\n", fname.c_str());
+ plib::putf8_reader r = plib::putf8_reader(std::ifstream(plib::filesystem::u8path(fname)));
+ if (r.stream().fail())
+ plib::pthrow<netlist::nl_exception>(netlist::MF_FILE_OPEN_ERROR(fname));
+ r.stream().imbue(std::locale::classic());
+ doc_ext ret;
+
+ pstring l;
+ if (!r.readline(l))
+ return ret;
+ do
+ {
+ l = plib::trim(l);
+ if (plib::startsWith(l, "//-"))
+ {
+ l = plib::trim(l.substr(3));
+ if (l != "")
+ {
+ auto a(plib::psplit(l, ":", true));
+ if ((a.size() < 1) || (a.size() > 2))
+ plib::pthrow<netlist::nl_exception>(l+" size mismatch");
+ pstring n(plib::trim(a[0]));
+ pstring v(a.size() < 2 ? "" : plib::trim(a[1]));
+ if (n == "Identifier")
+ {
+ ret.id = v;
+ if (!r.readline(l))
+ return (ret.id == id ? ret : doc_ext());
+ }
+ else
+ {
+ while (r.readline(l))
+ {
+ l = plib::ltrim(l);
+ if (!(plib::startsWith(l, "//- ") || plib::startsWith(l, "//-\t"))
+ && !(plib::rtrim(l) == "//-"))
+ break;
+ v = v + "\n" + l.substr(3);
+ }
+ if (n == "Title")
+ ret.title = plib::trim(v);
+ else if (n == "Pinalias")
+ ret.pinalias = plib::psplit(plib::trim(v),",",true);
+ else if (n == "Description")
+ ret.description = v;
+ else if (n == "Package")
+ ret.package = plib::trim(v);
+ else if (n == "NamingConvention")
+ ret.namingconventions = v;
+ else if (n == "Limitations")
+ ret.limitations = v;
+ else if (n == "FunctionTable")
+ ret.functiontable = v;
+ else if (n == "Example")
+ {
+ ret.example = plib::psplit(plib::trim(v),",",true);
+ if (ret.example.size() != 2 && ret.example.size() != 0)
+ plib::pthrow<netlist::nl_exception>("Example requires 2 parameters, but found {1}", ret.example.size());
+ }
+ else
+ plib::pthrow<netlist::nl_exception>(n);
+ }
+ }
+ }
+ else if (!r.readline(l))
+ return (ret.id == id ? ret : doc_ext());
+ } while (true);
+ //return ret;
+}
+
void tool_app_t::mac_out(const pstring &s, const bool cont)
{
if (cont)
@@ -674,9 +784,9 @@ void tool_app_t::create_docheader()
pout(" *\n");
for (auto &s : devs)
- pout(" * - \\subpage {1}\n", s);
+ pout(" * - @subpage {1}\n", s);
- pout(" *\n");
+ pout(" */\n");
for (auto &e : nt.setup().factory())
{
@@ -687,6 +797,78 @@ void tool_app_t::create_docheader()
mac(e.get());
pout("//! [{1} synopsis]\n", e->name());
}
+
+ poutprefix("", "");
+ poutprefix("///", "");
+ //poutprefix("///", " @file ");
+ poutprefix("///", " @page '' "); // FIXME: snippets and pages need to be separate files
+ poutprefix("", "");
+
+ for (auto &e : nt.setup().factory())
+ {
+ auto d(read_docsrc(e->sourcefile(), e->name()));
+
+ if (d.id != "")
+ {
+
+ poutprefix("///", "");
+ //poutprefix("///", " @file {}", e->sourcefile());
+ poutprefix("///", "");
+ poutprefix("///", " @page {} {}", d.id, d.title);
+ poutprefix("///", "");
+ poutprefix("///", " {}", d.description);
+ poutprefix("///", "");
+ poutprefix("///", " @section {}_1 Synopsis", d.id);
+ poutprefix("///", "");
+ poutprefix("///", " @snippet devsyn.dox.h {} synopsis", d.id);
+ poutprefix("///", "");
+ poutprefix("///", " @section {}_11 C Synopsis", d.id);
+ poutprefix("///", "");
+ poutprefix("///", " @snippet devsyn.dox.h {} csynopsis", d.id);
+ poutprefix("///", "");
+ poutprefix("///", " @section {}_2 Connection Diagram", d.id);
+ poutprefix("///", "");
+
+ if (d.pinalias.size() > 0)
+ {
+ poutprefix("///", " <pre>");
+ if (d.package == "DIP")
+ {
+ auto & pins = d.pinalias;
+ //const int w = 8;
+ poutprefix("///", " {1:10} +--------+", " ");
+ for (std::size_t i=0; i<pins.size()/2; i++)
+ {
+ poutprefix("///", " {1:10} |{2:-2} {3:2}| {4:-10}",
+ pins[i], i+1, pins.size()-i, pins[pins.size()-i-1]);
+ }
+ poutprefix("///", " {1:10} +--------+", " ");
+ }
+ poutprefix("///", " </pre>");
+ }
+ poutprefix("///", "");
+ poutprefix("///", " {}", d.namingconventions);
+ poutprefix("///", "");
+ poutprefix("///", " @section {}_3 Function Table", d.id);
+ poutprefix("///", "");
+ if (d.functiontable == "")
+ poutprefix("///", " Please refer to the datasheet.");
+ else
+ poutprefix("///", " {}", d.functiontable);
+ poutprefix("///", "");
+ poutprefix("///", " @section {}_4 Limitations", d.id);
+ poutprefix("///", "");
+ poutprefix("///", " {}", d.limitations);
+ if (d.example.size() > 0)
+ {
+ poutprefix("///", "");
+ poutprefix("///", " @section {}_5 Example", d.id);
+ poutprefix("///", " @snippet {1} {2}", d.example[0], d.example[1]);
+ poutprefix("///", "");
+ poutprefix("", "");
+ }
+ }
+ }
nt.stop();
}
diff --git a/src/mame/audio/elan_eu3a05.cpp b/src/mame/audio/elan_eu3a05.cpp
index 814849e3a43..b80258f32f0 100644
--- a/src/mame/audio/elan_eu3a05.cpp
+++ b/src/mame/audio/elan_eu3a05.cpp
@@ -16,11 +16,12 @@ DEFINE_DEVICE_TYPE(ELAN_EU3A05_SOUND, elan_eu3a05_sound_device, "elan_eu3a05soun
#include "logmacro.h"
-elan_eu3a05_sound_device::elan_eu3a05_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, ELAN_EU3A05_SOUND, tag, owner, clock)
- , device_sound_interface(mconfig, *this)
- , m_stream(nullptr)
- , m_space_read_cb(*this)
+elan_eu3a05_sound_device::elan_eu3a05_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, ELAN_EU3A05_SOUND, tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_stream(nullptr),
+ m_space_read_cb(*this),
+ m_sound_end_cb{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }
{
}
@@ -28,6 +29,19 @@ void elan_eu3a05_sound_device::device_start()
{
m_space_read_cb.resolve_safe(0);
m_stream = stream_alloc(0, 1, 8000);
+
+ for (devcb_write_line &cb : m_sound_end_cb)
+ cb.resolve_safe();
+
+ save_item(NAME(m_sound_byte_address));
+ save_item(NAME(m_sound_byte_len));
+ save_item(NAME(m_sound_current_nib_pos));
+ save_item(NAME(m_isstopped));
+ save_item(NAME(m_sound_trigger));
+ save_item(NAME(m_sound_unk));
+ save_item(NAME(m_volumes));
+ save_item(NAME(m_5024));
+ save_item(NAME(m_50a9));
}
void elan_eu3a05_sound_device::device_reset()
@@ -40,6 +54,15 @@ void elan_eu3a05_sound_device::device_reset()
}
m_isstopped = 0x3f;
+
+ m_sound_trigger = 0x00;
+ m_sound_unk = 0x00;
+
+ m_volumes[0] = 0xff;
+ m_volumes[1] = 0x0f;
+
+ m_5024 = 0x00;
+ m_50a9 = 0x00;
}
//-------------------------------------------------
@@ -81,8 +104,7 @@ void elan_eu3a05_sound_device::sound_stream_update(sound_stream &stream, stream_
m_sound_current_nib_pos[channel] = 0;
m_isstopped |= (1 << channel);
- // maybe should generate an interrupt with vector
- // ffb8, ffbc, ffc0, ffc4, ffc8, or ffcc depending on which channel finished??
+ m_sound_end_cb[channel](1); // generate interrupt based on which channel just stopped?
}
}
else
@@ -95,6 +117,8 @@ void elan_eu3a05_sound_device::sound_stream_update(sound_stream &stream, stream_
}
+
+
void elan_eu3a05_sound_device::handle_sound_addr_w(int which, int offset, uint8_t data)
{
switch (offset)
@@ -260,8 +284,11 @@ void elan_eu3a05_sound_device::handle_sound_trigger(int which)
{
LOGMASKED( LOG_AUDIO, "Triggering operation on channel (%d) with params %08x %08x\n", which, m_sound_byte_address[which], m_sound_byte_len[which]);
- m_sound_current_nib_pos[which] = 0;
- m_isstopped &= ~(1 << which);
+ if (m_isstopped & (1 << which)) // golden tee will repeatedly try to start the music on the title screen (although could depend on a status read first?)
+ {
+ m_sound_current_nib_pos[which] = 0;
+ m_isstopped &= ~(1 << which);
+ }
}
@@ -272,3 +299,107 @@ READ8_MEMBER(elan_eu3a05_sound_device::elan_eu3a05_50a8_r)
LOGMASKED( LOG_AUDIO, "%s: elan_eu3a05_50a8_r\n", machine().describe_context());
return m_isstopped;
}
+
+READ8_MEMBER(elan_eu3a05_sound_device::elan_eu3a05_sound_volume_r)
+{
+ return m_volumes[offset];
+}
+
+WRITE8_MEMBER(elan_eu3a05_sound_device::elan_eu3a05_sound_volume_w)
+{
+ m_volumes[offset] = data;
+}
+
+WRITE8_MEMBER(elan_eu3a05_sound_device::write)
+{
+ switch (offset)
+ {
+ case 0x00: case 0x01: case 0x02: // channel 0 address
+ case 0x03: case 0x04: case 0x05: // channel 1 address
+ case 0x06: case 0x07: case 0x08: // channel 2 address
+ case 0x09: case 0x0a: case 0x0b: // channel 3 address
+ case 0x0c: case 0x0d: case 0x0e: // channel 4 address
+ case 0x0f: case 0x10: case 0x11: // channel 5 address
+ elan_eu3a05_sound_addr_w(space, offset, data);
+ break;
+
+ case 0x12: case 0x13: case 0x14: // channel 0 length
+ case 0x15: case 0x16: case 0x17: // channel 1 length
+ case 0x18: case 0x19: case 0x1a: // channel 2 length
+ case 0x1b: case 0x1c: case 0x1d: // channel 3 length
+ case 0x1e: case 0x1f: case 0x20: // channel 4 length
+ case 0x21: case 0x22: case 0x23: // channel 5 length
+ elan_eu3a05_sound_size_w(space, offset - 0x12, data);
+ break;
+
+ case 0x24: // unk
+ m_5024 = data;
+ break;
+
+ case 0x25: // trigger
+ elan_eu3a05_sound_trigger_w(space, offset - 0x25, data);
+ break;
+
+ case 0x26: // volume channels 0,1,2,3 ? (lunar rescue sets 0x03 here and 0x00 below and just uses a single channel)
+ case 0x27: // volume channels 5,6 ?
+ elan_eu3a05_sound_volume_w(space, offset - 0x26, data);
+ break;
+
+ case 0x28: // stopped status?
+ LOGMASKED( LOG_AUDIO, "%s: write to stop state register? %02x\n", machine().describe_context(), data);
+ break;
+
+ case 0x29: // interrupt enable? or looping?
+ m_50a9 = data;
+ break;
+ }
+}
+
+READ8_MEMBER(elan_eu3a05_sound_device::read)
+{
+ uint8_t ret = 0x00;
+
+ switch (offset)
+ {
+ case 0x00: case 0x01: case 0x02: // channel 0 address
+ case 0x03: case 0x04: case 0x05: // channel 1 address
+ case 0x06: case 0x07: case 0x08: // channel 2 address
+ case 0x09: case 0x0a: case 0x0b: // channel 3 address
+ case 0x0c: case 0x0d: case 0x0e: // channel 4 address
+ case 0x0f: case 0x10: case 0x11: // channel 5 address
+ ret = elan_eu3a05_sound_addr_r(space, offset);
+ break;
+
+ case 0x12: case 0x13: case 0x14: // channel 0 length
+ case 0x15: case 0x16: case 0x17: // channel 1 length
+ case 0x18: case 0x19: case 0x1a: // channel 2 length
+ case 0x1b: case 0x1c: case 0x1d: // channel 3 length
+ case 0x1e: case 0x1f: case 0x20: // channel 4 length
+ case 0x21: case 0x22: case 0x23: // channel 5 length
+ ret = elan_eu3a05_sound_size_r(space, offset - 0x12);
+ break;
+
+ case 0x24: // unk
+ ret = m_5024;
+ break;
+
+ case 0x25: // trigger
+ ret = elan_eu3a05_sound_trigger_r(space, offset - 0x25);
+ break;
+
+ case 0x26: // volume channels 0,1,2,3 ?
+ case 0x27: // volume channels 5,6 ?
+ ret = elan_eu3a05_sound_volume_r(space, offset - 0x26);
+ break;
+
+ case 0x28: // stopped status?
+ ret = elan_eu3a05_50a8_r(space, offset - 0x28);
+ break;
+
+ case 0x29: // interrupt enable? or looping?
+ ret = m_50a9;
+ break;
+ }
+
+ return ret;
+} \ No newline at end of file
diff --git a/src/mame/audio/elan_eu3a05.h b/src/mame/audio/elan_eu3a05.h
index e56f8cdc166..867998051be 100644
--- a/src/mame/audio/elan_eu3a05.h
+++ b/src/mame/audio/elan_eu3a05.h
@@ -18,16 +18,11 @@ public:
auto space_read_callback() { return m_space_read_cb.bind(); }
- DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_addr_w);
- DECLARE_READ8_MEMBER(elan_eu3a05_sound_addr_r);
- DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_size_w);
- DECLARE_READ8_MEMBER(elan_eu3a05_sound_size_r);
- DECLARE_READ8_MEMBER(elan_eu3a05_sound_trigger_r);
- DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_trigger_w);
- DECLARE_READ8_MEMBER(elan_eu3a05_sound_unk_r);
- DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_unk_w);
+ template <unsigned N> auto sound_end_cb() { return m_sound_end_cb[N].bind(); }
+
+ DECLARE_WRITE8_MEMBER(write);
+ DECLARE_READ8_MEMBER(read);
- DECLARE_READ8_MEMBER(elan_eu3a05_50a8_r);
protected:
// device-level overrides
virtual void device_start() override;
@@ -49,12 +44,32 @@ private:
uint8_t m_isstopped;
+ uint8_t m_volumes[2];
+ uint8_t m_5024;
+ uint8_t m_50a9;
+
void handle_sound_trigger(int which);
void handle_sound_addr_w(int which, int offset, uint8_t data);
uint8_t handle_sound_addr_r(int which, int offset);
void handle_sound_size_w(int which, int offset, uint8_t data);
uint8_t handle_sound_size_r(int which, int offset);
+
+ DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_addr_w);
+ DECLARE_READ8_MEMBER(elan_eu3a05_sound_addr_r);
+ DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_size_w);
+ DECLARE_READ8_MEMBER(elan_eu3a05_sound_size_r);
+ DECLARE_READ8_MEMBER(elan_eu3a05_sound_trigger_r);
+ DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_trigger_w);
+ DECLARE_READ8_MEMBER(elan_eu3a05_sound_unk_r);
+ DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_unk_w);
+
+ DECLARE_READ8_MEMBER(elan_eu3a05_50a8_r);
+
+ DECLARE_READ8_MEMBER(elan_eu3a05_sound_volume_r);
+ DECLARE_WRITE8_MEMBER(elan_eu3a05_sound_volume_w);
+
+ devcb_write_line m_sound_end_cb[6];
};
DECLARE_DEVICE_TYPE(ELAN_EU3A05_SOUND, elan_eu3a05_sound_device)
diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp
index 5bfcd4c7721..ce0368f91f8 100644
--- a/src/mame/drivers/apple2e.cpp
+++ b/src/mame/drivers/apple2e.cpp
@@ -4212,9 +4212,9 @@ static void apple2_cards(device_slot_interface &device)
static void apple2eaux_cards(device_slot_interface &device)
{
- device.option_add("std80", A2EAUX_STD80COL); /* Apple IIe Standard 80 Column Card */
- device.option_add("ext80", A2EAUX_EXT80COL); /* Apple IIe Extended 80 Column Card */
- device.option_add("rw3", A2EAUX_RAMWORKS3); /* Applied Engineering RamWorks III */
+ device.option_add("std80", A2EAUX_STD80COL); // Apple IIe Standard 80 Column Card
+ device.option_add("ext80", A2EAUX_EXT80COL); // Apple IIe Extended 80 Column Card
+ device.option_add("rw3", A2EAUX_RAMWORKS3); // Applied Engineering RamWorks III
}
void apple2e_state::apple2e(machine_config &config)
@@ -4321,7 +4321,7 @@ void apple2e_state::apple2e(machine_config &config)
m_a2eauxslot->set_space(m_maincpu, AS_PROGRAM);
m_a2eauxslot->out_irq_callback().set(FUNC(apple2e_state::a2bus_irq_w));
m_a2eauxslot->out_nmi_callback().set(FUNC(apple2e_state::a2bus_nmi_w));
- A2EAUXSLOT_SLOT(config, "aux", m_a2eauxslot, apple2eaux_cards, "ext80");
+ A2EAUXSLOT_SLOT(config, "aux", m_a2eauxslot, apple2eaux_cards, "ext80"); // default to an extended 80-column card
APPLE2_GAMEIO(config, m_gameio, apple2_gameio_device::default_options, nullptr);
diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp
index 9f9f270e524..b0ae71e2577 100644
--- a/src/mame/drivers/bbc.cpp
+++ b/src/mame/drivers/bbc.cpp
@@ -76,7 +76,7 @@ M = BBC Master
| | | | |
| &5000 | | | |
| LYNNE | | |2 |2
-|3 &6000 |3 | | |
+| &6000 | | | |
| | | | |
| &7000 | | | |
| | | | |
@@ -127,12 +127,11 @@ read:
void bbc_state::bbca_mem(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0x3fff).bankrw("bank1"); // 0000-3fff Regular RAM
- map(0x4000, 0x7fff).bankrw("bank3"); // 4000-7fff Regular RAM mirrored
+ map(0x0000, 0x7fff).rw(FUNC(bbc_state::bbc_ram_r), FUNC(bbc_state::bbc_ram_w)); // 0000-7fff Regular RAM
map(0x8000, 0xbfff).rw(FUNC(bbc_state::bbc_paged_r), FUNC(bbc_state::bbc_paged_w)); // 8000-bfff Paged ROM/RAM
map(0xc000, 0xffff).rom().region("mos", 0); // c000-fbff OS ROM
map(0xfe00, 0xfeff).r(FUNC(bbc_state::bbc_fe_r)); // fe00-feff SHEILA Address Page
- map(0xfe00, 0xfe00).mirror(0x06).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
+ map(0xfe00, 0xfe00).mirror(0x06).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
map(0xfe01, 0xfe01).mirror(0x06).rw(m_hd6845, FUNC(hd6845s_device::register_r), FUNC(hd6845s_device::register_w));
map(0xfe08, 0xfe0f).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); // fe08-fe0f 6850 ACIA Serial controller
map(0xfe10, 0xfe17).w(FUNC(bbc_state::serial_ula_w)); // fe10-fe17 Serial ULA Serial system chip
@@ -145,11 +144,11 @@ void bbc_state::bbca_mem(address_map &map)
void bbc_state::bbc_base(address_map &map)
{
map.unmap_value_high();
- map(0xc000, 0xffff).rom().region("mos", 0); // c000-fbff OS ROM
+ map(0xc000, 0xffff).rw(FUNC(bbc_state::bbc_mos_r), FUNC(bbc_state::bbc_mos_w)); // c000-fbff OS ROM
map(0xfc00, 0xfcff).rw(m_1mhzbus, FUNC(bbc_1mhzbus_slot_device::fred_r), FUNC(bbc_1mhzbus_slot_device::fred_w)); // fc00-fcff FRED Address Page
map(0xfd00, 0xfdff).rw(m_1mhzbus, FUNC(bbc_1mhzbus_slot_device::jim_r), FUNC(bbc_1mhzbus_slot_device::jim_w)); // fd00-fdff JIM Address Page
map(0xfe00, 0xfeff).r(FUNC(bbc_state::bbc_fe_r)); // fe00-feff SHEILA Address Page
- map(0xfe00, 0xfe00).mirror(0x06).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
+ map(0xfe00, 0xfe00).mirror(0x06).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
map(0xfe01, 0xfe01).mirror(0x06).rw(m_hd6845, FUNC(hd6845s_device::register_r), FUNC(hd6845s_device::register_w));
map(0xfe08, 0xfe0f).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); // fe08-fe0f 6850 ACIA Serial controller
map(0xfe10, 0xfe17).w(FUNC(bbc_state::serial_ula_w)); // fe10-fe17 Serial ULA Serial system chip
@@ -166,10 +165,9 @@ void bbc_state::bbc_base(address_map &map)
void bbc_state::bbcb_mem(address_map &map)
{
bbc_base(map);
- map(0x0000, 0x3fff).bankrw("bank1"); // 0000-3fff Regular RAM
- map(0x4000, 0x7fff).bankrw("bank3"); // 4000-7fff Regular RAM
+ map(0x0000, 0x7fff).rw(FUNC(bbc_state::bbc_ram_r), FUNC(bbc_state::bbc_ram_w)); // 0000-7fff Regular RAM
map(0x8000, 0xbfff).rw(FUNC(bbc_state::bbc_paged_r), FUNC(bbc_state::bbc_paged_w)); // 8000-bfff Paged ROM/RAM
- map(0xfe30, 0xfe3f).w(FUNC(bbc_state::bbc_romsel_w)); // W: fe30-fe3f 84LS161 Paged ROM selector
+ map(0xfe30, 0xfe3f).rw(FUNC(bbc_state::bbc_romsel_r), FUNC(bbc_state::bbc_romsel_w)); // W: fe30-fe3f 84LS161 Paged ROM selector
map(0xfe80, 0xfe83).mirror(0x08).m(m_i8271, FUNC(i8271_device::map)); // fe80-fe83 8271 FDC Floppy disc controller
map(0xfe84, 0xfe87).mirror(0x08).rw(m_i8271, FUNC(i8271_device::data_r), FUNC(i8271_device::data_w)); // fe84-fe9f 8271 FDC Floppy disc controller
}
@@ -178,10 +176,9 @@ void bbc_state::bbcb_mem(address_map &map)
void bbc_state::bbcb_nofdc_mem(address_map &map)
{
bbc_base(map);
- map(0x0000, 0x3fff).bankrw("bank1"); // 0000-3fff Regular RAM
- map(0x4000, 0x7fff).bankrw("bank3"); // 4000-7fff Regular RAM
+ map(0x0000, 0x7fff).rw(FUNC(bbc_state::bbc_ram_r), FUNC(bbc_state::bbc_ram_w)); // 0000-7fff Regular RAM
map(0x8000, 0xbfff).rw(FUNC(bbc_state::bbc_paged_r), FUNC(bbc_state::bbc_paged_w)); // 8000-bfff Paged ROM/RAM
- map(0xfe30, 0xfe3f).w(FUNC(bbc_state::bbc_romsel_w)); // W: fe30-fe3f 84LS161 Paged ROM selector
+ map(0xfe30, 0xfe3f).rw(FUNC(bbc_state::bbc_romsel_r), FUNC(bbc_state::bbc_romsel_w)); // W: fe30-fe3f 84LS161 Paged ROM selector
map(0xfe80, 0xfe9f).rw(m_fdc, FUNC(bbc_fdc_slot_device::read), FUNC(bbc_fdc_slot_device::write)); // fe84-fe9f 8271 FDC Floppy disc controller
}
@@ -219,9 +216,9 @@ void bbcm_state::bbcm_mem(address_map &map)
map(0x0000, 0x2fff).bankrw("bank1"); // 0000-2fff Regular RAM
map(0x3000, 0x7fff).bankrw("bank2"); // 3000-7fff Video/Shadow RAM LYNNE
map(0x8000, 0xbfff).rw(FUNC(bbc_state::bbcm_paged_r), FUNC(bbc_state::bbcm_paged_w)); // 8000-8fff Paged ROM/RAM or 4K of RAM ANDY
- map(0xc000, 0xffff).rom().region("mos", 0); // c000-ffff OS ROM
+ map(0xc000, 0xffff).rw(FUNC(bbc_state::bbc_mos_r), FUNC(bbc_state::bbc_mos_w)); // c000-ffff OS ROM
map(0xc000, 0xdfff).rw(FUNC(bbc_state::bbcm_hazel_r), FUNC(bbc_state::bbcm_hazel_w)); // c000-dfff OS ROM or 8K of RAM HAZEL
- map(0xfc00, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); // fc00-ffff OS ROM or hardware IO
+ map(0xfc00, 0xfeff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); // fc00-ffff OS ROM or hardware IO
}
@@ -235,11 +232,11 @@ void bbcm_state::bbcm_bankdev(address_map &map)
{
map.unmap_value_high();
/* ACCCON TST bit - normal state */
- map(0x0000, 0x03ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
- map(0x0000, 0x00ff).mirror(0x400).rw(m_1mhzbus, FUNC(bbc_1mhzbus_slot_device::fred_r), FUNC(bbc_1mhzbus_slot_device::fred_w)); // fc00-fcff Master FRED Address Page
- map(0x0100, 0x01ff).mirror(0x400).rw(m_1mhzbus, FUNC(bbc_1mhzbus_slot_device::jim_r), FUNC(bbc_1mhzbus_slot_device::jim_w)); // fd00-fdff Master JIM Address Page
+ map(0x0000, 0x02ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+ map(0x0000, 0x00ff).mirror(0x400).rw(FUNC(bbc_state::bbc_fred_r), FUNC(bbc_state::bbc_fred_w)); // fc00-fcff Master FRED Address Page
+ map(0x0100, 0x01ff).mirror(0x400).rw(FUNC(bbc_state::bbc_jim_r), FUNC(bbc_state::bbc_jim_w)); // fd00-fdff Master JIM Address Page
map(0x0200, 0x02ff).mirror(0x400).r(FUNC(bbc_state::bbc_fe_r)); // fe00-feff SHEILA Address Page
- map(0x0200, 0x0200).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
+ map(0x0200, 0x0200).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
map(0x0201, 0x0201).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::register_r), FUNC(hd6845s_device::register_w));
map(0x0208, 0x020f).mirror(0x400).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); // fe08-fe0f 6850 ACIA Serial controller
map(0x0210, 0x0217).mirror(0x400).w(FUNC(bbc_state::serial_ula_w)); // fe10-fe17 Serial ULA Serial system chip
@@ -257,7 +254,7 @@ void bbcm_state::bbcm_bankdev(address_map &map)
map(0x02a0, 0x02bf).mirror(0x400).rw(m_adlc, FUNC(mc6854_device::read), FUNC(mc6854_device::write)); // fea0-febf 68B54 ADLC ECONET controller
map(0x02e0, 0x02ff).mirror(0x400).rw(FUNC(bbc_state::bbcm_tube_r), FUNC(bbc_state::bbcm_tube_w)); // fee0-feff Tube ULA Tube system interface
/* ACCCON TST bit - hardware test */
- map(0x0400, 0x07ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+ map(0x0400, 0x06ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
}
@@ -265,11 +262,11 @@ void bbcm_state::bbcmet_bankdev(address_map &map)
{
map.unmap_value_high();
/* ACCCON TST bit - normal state */
- map(0x0000, 0x03ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+ map(0x0000, 0x02ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
map(0x0000, 0x00ff).mirror(0x400).unmaprw(); // fc00-fcff FRED Address Page
map(0x0100, 0x01ff).mirror(0x400).unmaprw(); // fd00-fdff JIM Address Page
map(0x0200, 0x02ff).mirror(0x400).r(FUNC(bbc_state::bbc_fe_r)); // fe00-feff SHEILA Address Page
- map(0x0200, 0x0200).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
+ map(0x0200, 0x0200).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
map(0x0201, 0x0201).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::register_r), FUNC(hd6845s_device::register_w));
map(0x0208, 0x020f).mirror(0x400).r(FUNC(bbc_state::bbc_fe_r)); // fe08-fe0f 6850 ACIA Serial controller
map(0x0210, 0x0217).mirror(0x400).w(FUNC(bbc_state::serial_ula_w)); // fe10-fe17 Serial ULA Serial system chip
@@ -287,7 +284,18 @@ void bbcm_state::bbcmet_bankdev(address_map &map)
map(0x02a0, 0x02bf).mirror(0x400).rw(m_adlc, FUNC(mc6854_device::read), FUNC(mc6854_device::write)); // fea0-febf 68B54 ADLC ECONET controller
map(0x02e0, 0x02ff).mirror(0x400).rw(FUNC(bbc_state::bbcm_tube_r), FUNC(bbc_state::bbcm_tube_w)); // fee0-feff Tube ULA Tube system interface
/* ACCCON TST bit - hardware test */
- map(0x0400, 0x07ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+ map(0x0400, 0x06ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+}
+
+
+void bbcm_state::bbcmc_mem(address_map &map)
+{
+ map(0x0000, 0x2fff).bankrw("bank1"); // 0000-2fff Regular RAM
+ map(0x3000, 0x7fff).bankrw("bank2"); // 3000-7fff Video/Shadow RAM LYNNE
+ map(0x8000, 0xbfff).rw(FUNC(bbc_state::bbcmc_paged_r), FUNC(bbc_state::bbcmc_paged_w)); // 8000-8fff Paged ROM/RAM or 4K of RAM ANDY
+ map(0xc000, 0xffff).rw(FUNC(bbc_state::bbc_mos_r), FUNC(bbc_state::bbc_mos_w)); // c000-ffff OS ROM
+ map(0xc000, 0xdfff).rw(FUNC(bbc_state::bbcm_hazel_r), FUNC(bbc_state::bbcm_hazel_w)); // c000-dfff OS ROM or 8K of RAM HAZEL
+ map(0xfc00, 0xfeff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); // fc00-ffff OS ROM or hardware IO
}
@@ -295,11 +303,11 @@ void bbcm_state::bbcmc_bankdev(address_map &map)
{
map.unmap_value_high();
/* ACCCON TST bit - normal state */
- map(0x0000, 0x03ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+ map(0x0000, 0x02ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
map(0x0000, 0x00ff).mirror(0x400).rw(m_exp, FUNC(bbc_exp_slot_device::fred_r), FUNC(bbc_exp_slot_device::fred_w)); // fc00-fcff Compact FRED Address Page
map(0x0100, 0x01ff).mirror(0x400).rw(m_exp, FUNC(bbc_exp_slot_device::jim_r), FUNC(bbc_exp_slot_device::jim_w)); // fd00-fdff Compact JIM Address Page
map(0x0200, 0x02ff).mirror(0x400).rw(m_exp, FUNC(bbc_exp_slot_device::sheila_r), FUNC(bbc_exp_slot_device::sheila_w)); // fd00-fdff Compact SHEILA Address Page
- map(0x0200, 0x0200).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
+ map(0x0200, 0x0200).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::status_r), FUNC(hd6845s_device::address_w)); // fe00-fe07 6845 CRTC Video controller
map(0x0201, 0x0201).mirror(0x406).rw(m_hd6845, FUNC(hd6845s_device::register_r), FUNC(hd6845s_device::register_w));
map(0x0208, 0x020f).mirror(0x400).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); // fe08-fe0f 6850 ACIA Serial controller
map(0x0210, 0x0217).mirror(0x400).w(FUNC(bbc_state::serial_ula_w)); // fe10-fe17 Serial ULA Serial system chip
@@ -316,7 +324,15 @@ void bbcm_state::bbcmc_bankdev(address_map &map)
map(0x02a0, 0x02bf).mirror(0x400).rw(m_adlc, FUNC(mc6854_device::read), FUNC(mc6854_device::write)); // fea0-febf 68B54 ADLC ECONET controller
map(0x02e0, 0x02ff).mirror(0x400).r(FUNC(bbc_state::bbc_fe_r)); // fee0-feff Tube ULA Tube system interface
/* ACCCON TST bit - hardware test */
- map(0x0400, 0x07ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+ map(0x0400, 0x06ff).rom().region("mos", 0x3c00); // fc00-ffff OS ROM (continued)
+}
+
+
+void bbcm_state::autoc15_bankdev(address_map &map)
+{
+ bbcmc_bankdev(map);
+ map(0x0200, 0x0200).mirror(0x406).rw(m_hd6845, FUNC(hd6345_device::status_r), FUNC(hd6345_device::address_w)); // fe00-fe07 6345 CRTC Video controller
+ map(0x0201, 0x0201).mirror(0x406).rw(m_hd6845, FUNC(hd6345_device::register_r), FUNC(hd6345_device::register_w));
}
@@ -337,6 +353,7 @@ INPUT_CHANGED_MEMBER(bbc_state::trigger_reset)
if (m_tube) m_tube->reset();
if (m_intube) m_intube->reset();
if (m_extube) m_extube->reset();
+ if (m_internal) m_internal->reset();
}
}
@@ -456,6 +473,17 @@ static INPUT_PORTS_START(bbc_keyboard)
PORT_START("COL12")
PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
+
+ /* Keyboard columns 13 -> 14 are reserved for Torch */
+ PORT_START("COL13")
+ PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
+
+ PORT_START("COL14")
+ PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
+
+ /* Keyboard column 15 not known to be used */
+ PORT_START("COL15")
+ PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNUSED)
INPUT_PORTS_END
@@ -723,11 +751,6 @@ static INPUT_PORTS_START(bbcb_config)
PORT_CONFNAME( 0x04, 0x00, "Econet fitted")
PORT_CONFSETTING( 0x00, DEF_STR( No ))
PORT_CONFSETTING( 0x04, DEF_STR( Yes ))
- PORT_CONFNAME( 0x38, 0x00, "Sideways RAM Board")
- PORT_CONFSETTING( 0x00, DEF_STR( None ) )
- //PORT_CONFSETTING( 0x08, "Solidisk 128K (fe62)" )
- PORT_CONFSETTING( 0x10, "Acorn 64K (fe30)" )
- PORT_CONFSETTING( 0x20, "Acorn 128K (fe30)" )
INPUT_PORTS_END
static INPUT_PORTS_START(bbca)
@@ -907,10 +930,10 @@ void bbc_state::bbca(machine_config &config)
m_via6522_0->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<1>));
/* eprom sockets */
- BBC_ROMSLOT16(config, m_rom[0x0c], bbc_rom_devices, nullptr); /* ic101 */
- BBC_ROMSLOT16(config, m_rom[0x0d], bbc_rom_devices, nullptr); /* ic100 */
- BBC_ROMSLOT16(config, m_rom[0x0e], bbc_rom_devices, nullptr); /* ic88 */
- BBC_ROMSLOT16(config, m_rom[0x0f], bbc_rom_devices, nullptr); /* ic52 */
+ BBC_ROMSLOT16(config, m_rom[0], bbc_rom_devices, nullptr); /* ic101 */
+ BBC_ROMSLOT16(config, m_rom[1], bbc_rom_devices, nullptr); /* ic100 */
+ BBC_ROMSLOT16(config, m_rom[2], bbc_rom_devices, nullptr); /* ic88 */
+ BBC_ROMSLOT16(config, m_rom[3], bbc_rom_devices, nullptr); /* ic52 */
/* software lists */
SOFTWARE_LIST(config, "cass_ls_a").set_original("bbca_cass");
@@ -942,6 +965,7 @@ void bbc_state::bbcb(machine_config &config)
m_via6522_1->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
m_via6522_1->readpb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_r));
m_via6522_1->writepb_handler().set(m_userport, FUNC(bbc_userport_slot_device::pb_w));
+ m_via6522_1->writepb_handler().append(m_internal, FUNC(bbc_internal_slot_device::latch_fe60_w));
m_via6522_1->ca2_handler().set("centronics", FUNC(centronics_device::write_strobe));
m_via6522_1->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<2>));
@@ -992,9 +1016,9 @@ void bbc_state::bbcb(machine_config &config)
m_userport->cb2_handler().set(m_via6522_1, FUNC(via6522_device::write_cb2));
/* internal expansion boards */
- //BBC_INTERNAL_SLOT(config, m_internal, bbc_internal_devices, nullptr);
- //m_internal->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<5>));
- //m_internal->nmi_handler().set(FUNC(bbc_state::bus_nmi_w));
+ BBC_INTERNAL_SLOT(config, m_internal, 16_MHz_XTAL, bbcb_internal_devices, nullptr);
+ m_internal->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<5>));
+ m_internal->nmi_handler().set(FUNC(bbc_state::bus_nmi_w));
/* software lists */
SOFTWARE_LIST(config, "cass_ls_b").set_original("bbcb_cass");
@@ -1055,7 +1079,7 @@ void bbc_state::bbcb_us(machine_config &config)
****************************************************************************/
-void bbc_state::torchf(machine_config &config)
+void torch_state::torchf(machine_config &config)
{
bbcb(config);
/* basic machine hardware */
@@ -1077,25 +1101,23 @@ void bbc_state::torchf(machine_config &config)
}
-void bbc_state::torchh10(machine_config &config)
+void torch_state::torchh10(machine_config &config)
{
torchf(config);
/* fdc */
m_i8271->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* 10MB HDD */
-
}
-void bbc_state::torchh21(machine_config &config)
+void torch_state::torchh21(machine_config &config)
{
torchf(config);
/* fdc */
m_i8271->subdevice<floppy_connector>("1")->set_default_option(nullptr);
/* 21MB HDD */
-
}
@@ -1126,16 +1148,23 @@ void bbcbp_state::bbcbp(machine_config &config)
FLOPPY_CONNECTOR(config, "wd1770:0", bbc_floppies, "525qd", bbc_state::floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, "wd1770:1", bbc_floppies, "525qd", bbc_state::floppy_formats).enable_sound(true);
+ /* remove sockets not present in B+ */
+ config.device_remove("romslot0");
+ config.device_remove("romslot1");
+ config.device_remove("romslot2");
+ config.device_remove("romslot3");
+
/* eprom sockets */
- BBC_ROMSLOT32(config, m_rom[0x02], bbc_rom_devices, nullptr); /* ic35 */
- BBC_ROMSLOT32(config, m_rom[0x04], bbc_rom_devices, nullptr); /* ic44 */
- BBC_ROMSLOT32(config, m_rom[0x06], bbc_rom_devices, nullptr); /* ic57 */
- BBC_ROMSLOT32(config, m_rom[0x08], bbc_rom_devices, nullptr); /* ic62 */
- BBC_ROMSLOT32(config, m_rom[0x0a], bbc_rom_devices, nullptr); /* ic68 */
- config.device_remove("romslot12");
- config.device_remove("romslot13");
- config.device_remove("romslot14");
- config.device_remove("romslot15");
+ BBC_ROMSLOT32(config, m_rom[0x02], bbc_rom_devices, nullptr); /* ic35 32K socket */
+ BBC_ROMSLOT32(config, m_rom[0x04], bbc_rom_devices, nullptr); /* ic44 32K socket */
+ BBC_ROMSLOT32(config, m_rom[0x06], bbc_rom_devices, nullptr); /* ic57 32K socket */
+ BBC_ROMSLOT32(config, m_rom[0x08], bbc_rom_devices, nullptr); /* ic62 32K socket */
+ BBC_ROMSLOT32(config, m_rom[0x0a], bbc_rom_devices, nullptr); /* ic68 32K socket */
+
+ /* internal expansion boards */
+ BBC_INTERNAL_SLOT(config.replace(), m_internal, 16_MHz_XTAL, bbcbp_internal_devices, nullptr);
+ m_internal->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<5>));
+ m_internal->nmi_handler().set(FUNC(bbc_state::bus_nmi_w));
/* software lists */
subdevice<software_list_device>("rom_ls")->set_filter("B+");
@@ -1148,6 +1177,10 @@ void bbcbp_state::bbcbp128(machine_config &config)
/* internal ram */
m_ram->set_default_size("128K");
+
+ /* sideways RAM banks */
+ BBC_ROMSLOT32(config, m_rom[0x00], bbc_rom_devices, "ram").set_fixed_ram(true);
+ BBC_ROMSLOT32(config, m_rom[0x0c], bbc_rom_devices, "ram").set_fixed_ram(true);
}
@@ -1460,15 +1493,22 @@ void bbcm_state::bbcm(machine_config &config)
m_userport->cb2_handler().set(m_via6522_1, FUNC(via6522_device::write_cb2));
/* cartridge slots */
- GENERIC_CARTSLOT(config, m_cart[0], generic_linear_slot, "bbcm_cart", "bin,rom");
- m_cart[0]->set_device_load(FUNC(bbc_state::cart1_load));
- GENERIC_CARTSLOT(config, m_cart[1], generic_linear_slot, "bbcm_cart", "bin,rom");
- m_cart[1]->set_device_load(FUNC(bbc_state::cart2_load));
+ BBCM_CARTSLOT(config, m_cart[0], 16_MHz_XTAL, bbcm_cart, nullptr);
+ m_cart[0]->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<6>));
+ m_cart[0]->nmi_handler().set(FUNC(bbc_state::bus_nmi_w));
+ BBCM_CARTSLOT(config, m_cart[1], 16_MHz_XTAL, bbcm_cart, nullptr);
+ m_cart[1]->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<7>));
+ m_cart[1]->nmi_handler().set(FUNC(bbc_state::bus_nmi_w));
/* eprom sockets */
BBC_ROMSLOT16(config, m_rom[0x08], bbc_rom_devices, nullptr); /* ic27 */
- BBC_ROMSLOT32(config, m_rom[0x04], bbc_rom_devices, nullptr); /* ic41 */
- BBC_ROMSLOT32(config, m_rom[0x06], bbc_rom_devices, nullptr); /* ic37 */
+ BBC_ROMSLOT32(config, m_rom[0x04], bbc_rom_devices, "ram").set_fixed_ram(true); /* ic41 32K socket */
+ BBC_ROMSLOT32(config, m_rom[0x06], bbc_rom_devices, "ram").set_fixed_ram(true); /* ic37 32K socket */
+
+ /* internal expansion boards */
+ BBC_INTERNAL_SLOT(config, m_internal, 16_MHz_XTAL, bbcm_internal_devices, nullptr);
+ m_internal->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<8>));
+ m_internal->nmi_handler().set(FUNC(bbc_state::bus_nmi_w));
/* software lists */
SOFTWARE_LIST(config, "cass_ls_m").set_original("bbcm_cass");
@@ -1571,6 +1611,21 @@ void bbcm_state::bbcmarm(machine_config &config)
}
+void bbcm_state::daisy(machine_config &config)
+{
+ bbcm(config);
+ /* Acorn 65C102 co-processor */
+ m_intube->set_default_option("65c102");
+ m_intube->set_fixed(true);
+
+ /* lk18 and lk19 are set to enable rom, disabling ram */
+ m_rom[0x04]->set_default_option(nullptr);
+ m_rom[0x04]->set_fixed_ram(false);
+ m_rom[0x06]->set_default_option(nullptr);
+ m_rom[0x06]->set_fixed_ram(false);
+}
+
+
void bbcm_state::discmon(machine_config &config)
{
bbcm(config);
@@ -1611,14 +1666,23 @@ void bbcm_state::cfa3000(machine_config &config)
m_wd1770->subdevice<floppy_connector>("0")->set_default_option(nullptr);
m_wd1770->subdevice<floppy_connector>("1")->set_default_option(nullptr);
+ /* lk18 and lk19 are set to enable rom, disabling ram */
+ m_rom[0x04]->set_default_option(nullptr);
+ m_rom[0x04]->set_fixed_ram(false);
+ m_rom[0x06]->set_default_option(nullptr);
+ m_rom[0x06]->set_fixed_ram(false);
+
/* keyboard */
m_userport->set_default_option("cfa3000kbd");
+ m_userport->set_fixed(true);
/* option board */
m_1mhzbus->set_default_option("cfa3000opt");
+ m_1mhzbus->set_fixed(true);
/* analogue dials/sensors */
m_analog->set_default_option("cfa3000a");
+ m_analog->set_fixed(true);
/* software lists */
config.device_remove("cass_ls_m");
@@ -1641,6 +1705,7 @@ void bbcm_state::bbcmc(machine_config &config)
{
bbcm(config);
+ m_maincpu->set_addrmap(AS_PROGRAM, &bbcm_state::bbcmc_mem);
m_bankdev->set_map(&bbcm_state::bbcmc_bankdev).set_options(ENDIANNESS_LITTLE, 8, 16, 0x0400);
/* cassette */
@@ -1670,8 +1735,6 @@ void bbcm_state::bbcmc(machine_config &config)
config.device_remove("cartslot2");
/* eprom sockets */
- config.device_remove("romslot4");
- config.device_remove("romslot6");
config.device_remove("romslot8");
BBC_ROMSLOT16(config, m_rom[0x03], bbc_rom_devices, nullptr); /* ic17 */
BBC_ROMSLOT16(config, m_rom[0x02], bbc_rom_devices, nullptr); /* ic23 */
@@ -1701,6 +1764,7 @@ void bbcm_state::bbcmc(machine_config &config)
config.device_remove("intube");
config.device_remove("extube");
config.device_remove("userport");
+ config.device_remove("internal");
}
@@ -1716,36 +1780,51 @@ void bbcm_state::pro128s(machine_config &config)
void bbcm_state::autoc15(machine_config &config)
{
bbcmc(config);
+
+ m_bankdev->set_map(&bbcm_state::autoc15_bankdev).set_options(ENDIANNESS_LITTLE, 8, 16, 0x0400);
+
+ /* crtc - replaces HD6845 to support smooth scrolling */
+ HD6345(config.replace(), m_hd6845, 16_MHz_XTAL / 8);
+ m_hd6845->set_screen("screen");
+ m_hd6845->set_show_border_area(false);
+ m_hd6845->set_char_width(12);
+ //m_hd6845->set_begin_update_callback(FUNC(bbc_state::crtc_begin_update));
+ m_hd6845->set_update_row_callback(FUNC(bbc_state::crtc_update_row));
+ //m_hd6845->set_reconfigure_callback(FUNC(bbc_state::crtc_reconfig));
+ m_hd6845->out_de_callback().set(FUNC(bbc_state::bbc_de_changed));
+ m_hd6845->out_hsync_callback().set(FUNC(bbc_state::bbc_hsync_changed));
+ m_hd6845->out_vsync_callback().set(FUNC(bbc_state::bbc_vsync_changed));
+
/* Autocue RAM disc */
- //m_exp->set_default_option("autocue");
- //m_exp->set_fixed(true);
+ m_exp->set_default_option("autocue");
+ m_exp->set_fixed(true);
}
ROM_START(bbca)
ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
- /* rom page 12 30000 IC52 SPARE SOCKET */
- /* rom page 13 34000 IC88 SPARE SOCKET */
- /* rom page 14 38000 IC100 SPARE SOCKET */
- /* rom page 15 3c000 IC101 BASIC */
+ /* rom page 0 00000 IC52 SPARE SOCKET */
+ /* rom page 1 04000 IC88 SPARE SOCKET */
+ /* rom page 2 08000 IC100 SPARE SOCKET */
+ /* rom page 3 0c000 IC101 BASIC */
ROM_DEFAULT_BIOS("os12")
ROM_SYSTEM_BIOS( 0, "os12", "OS 1.20" )
ROMX_LOAD("os12.rom", 0x40000, 0x4000, CRC(3c14fc70) SHA1(0d9bcaf6a393c9ce2359ed700ddb53c232c2c45d), ROM_BIOS(0))
- ROMX_LOAD("basic2.rom", 0x3c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(0))
+ ROMX_LOAD("basic2.rom", 0x0c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(0))
ROM_SYSTEM_BIOS( 1, "os10", "OS 1.00" )
ROMX_LOAD("os10.rom", 0x40000, 0x4000, CRC(9679b8f8) SHA1(d35f6723132aabe3c4d00fc16fd9ecc6768df753), ROM_BIOS(1))
- ROMX_LOAD("basic2.rom", 0x3c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(1))
+ ROMX_LOAD("basic2.rom", 0x0c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(1))
ROM_SYSTEM_BIOS( 2, "os09", "OS 0.92")
ROMX_LOAD("os092.rom", 0x40000, 0x4000, CRC(59ef7eb8) SHA1(dca33995c0d008a527efe923d03333394b01022c), ROM_BIOS(2))
- ROMX_LOAD("basic1.rom", 0x3c000, 0x4000, CRC(b3364108) SHA1(890f6e3e7fab3340f75b85e93ff29332bc9ecb2e), ROM_BIOS(2))
+ ROMX_LOAD("basic1.rom", 0x0c000, 0x4000, CRC(b3364108) SHA1(890f6e3e7fab3340f75b85e93ff29332bc9ecb2e), ROM_BIOS(2))
ROM_SYSTEM_BIOS( 3, "os01", "OS 0.10" )
ROMX_LOAD("os01.rom", 0x40000, 0x4000, CRC(45ee0980) SHA1(4b0ece6dc139d5d3f4fabd023716fb6f25149b80), ROM_BIOS(3))
/* OS0.1 does not support rom paging, load BASIC into all pages */
- ROMX_LOAD("basic1.rom", 0x30000, 0x4000, CRC(b3364108) SHA1(890f6e3e7fab3340f75b85e93ff29332bc9ecb2e), ROM_BIOS(3))
- ROM_RELOAD( 0x34000, 0x4000 )
- ROM_RELOAD( 0x38000, 0x4000 )
- ROM_RELOAD( 0x3c000, 0x4000 )
+ ROMX_LOAD("basic1.rom", 0x00000, 0x4000, CRC(b3364108) SHA1(890f6e3e7fab3340f75b85e93ff29332bc9ecb2e), ROM_BIOS(3))
+ ROM_RELOAD( 0x04000, 0x4000 )
+ ROM_RELOAD( 0x08000, 0x4000 )
+ ROM_RELOAD( 0x0c000, 0x4000 )
ROM_REGION(0x4000, "mos", 0)
ROM_COPY("swr", 0x40000, 0, 0x4000)
@@ -1754,20 +1833,20 @@ ROM_END
ROM_START(bbcb)
ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
- /* rom page 12 30000 IC52 DFS */
- /* rom page 13 34000 IC88 SPARE SOCKET */
- /* rom page 14 38000 IC100 SPARE SOCKET */
- /* rom page 15 3c000 IC101 BASIC */
+ /* rom page 0 00000 IC52 DFS */
+ /* rom page 1 04000 IC88 SPARE SOCKET */
+ /* rom page 2 08000 IC100 SPARE SOCKET */
+ /* rom page 3 0c000 IC101 BASIC */
ROM_DEFAULT_BIOS("os12")
ROM_SYSTEM_BIOS( 0, "os12", "OS 1.20" )
ROMX_LOAD("os12.rom", 0x40000, 0x4000, CRC(3c14fc70) SHA1(0d9bcaf6a393c9ce2359ed700ddb53c232c2c45d), ROM_BIOS(0))
- ROMX_LOAD("basic2.rom", 0x3c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(0))
+ ROMX_LOAD("basic2.rom", 0x0c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(0))
ROM_SYSTEM_BIOS( 1, "os10", "OS 1.00" )
ROMX_LOAD("os10.rom", 0x40000, 0x4000, CRC(9679b8f8) SHA1(d35f6723132aabe3c4d00fc16fd9ecc6768df753), ROM_BIOS(1))
- ROMX_LOAD("basic2.rom", 0x3c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(1))
+ ROMX_LOAD("basic2.rom", 0x0c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281), ROM_BIOS(1))
ROM_SYSTEM_BIOS( 2, "os09", "OS 0.92")
ROMX_LOAD("os092.rom", 0x40000, 0x4000, CRC(59ef7eb8) SHA1(dca33995c0d008a527efe923d03333394b01022c), ROM_BIOS(2))
- ROMX_LOAD("basic1.rom", 0x3c000, 0x4000, CRC(b3364108) SHA1(890f6e3e7fab3340f75b85e93ff29332bc9ecb2e), ROM_BIOS(2))
+ ROMX_LOAD("basic1.rom", 0x0c000, 0x4000, CRC(b3364108) SHA1(890f6e3e7fab3340f75b85e93ff29332bc9ecb2e), ROM_BIOS(2))
ROM_SYSTEM_BIOS( 3, "os01", "OS 0.10" )
ROMX_LOAD("os01.rom", 0x40000, 0x4000, CRC(45ee0980) SHA1(4b0ece6dc139d5d3f4fabd023716fb6f25149b80), ROM_BIOS(3))
/* OS0.1 does not support rom paging, load BASIC into all pages */
@@ -1776,7 +1855,8 @@ ROM_START(bbcb)
ROM_RELOAD( 0x08000, 0x4000 )
ROM_RELOAD( 0x0c000, 0x4000 )
- ROM_LOAD("dnfs120-201666.rom", 0x30000, 0x4000, CRC(8ccd2157) SHA1(7e3c536baeae84d6498a14e8405319e01ee78232))
+ /* appropriate DFS will be inserted by fdc device */
+ //ROM_LOAD("dnfs120-201666.rom", 0x00000, 0x4000, CRC(8ccd2157) SHA1(7e3c536baeae84d6498a14e8405319e01ee78232))
ROM_REGION(0x4000, "mos", 0)
ROM_COPY("swr", 0x40000, 0, 0x4000)
@@ -1787,17 +1867,16 @@ ROM_END
ROM_START(bbcb_de)
- ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
- /* rom page 12 30000 IC72 DFS */
- /* rom page 13 34000 IC73 SPARE SOCKET */
- /* rom page 14 38000 IC74 SPARE SOCKET */
- /* rom page 15 3c000 IC75 BASIC */
- ROM_LOAD("os_de.rom", 0x40000, 0x4000, CRC(b7262caf) SHA1(aadf90338ee9d1c85dfa73beba50e930c2a38f10))
- ROM_LOAD("basic2.rom", 0x3c000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281))
- ROM_LOAD("dfs10.rom", 0x30000, 0x4000, CRC(7e367e8c) SHA1(161f585dc45665ea77433c84afd2f95049f7f5a0))
+ ROM_REGION(0x40000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
+ /* rom page 0 00000 IC72 DFS */
+ /* rom page 1 04000 IC73 SPARE SOCKET */
+ /* rom page 2 08000 IC74 SPARE SOCKET */
+ /* rom page 3 0c000 IC75 BASIC */
+ ROM_LOAD("basic2.rom", 0xc000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281))
+ ROM_LOAD("dfs10.rom", 0x0000, 0x4000, CRC(7e367e8c) SHA1(161f585dc45665ea77433c84afd2f95049f7f5a0))
ROM_REGION(0x4000, "mos", 0)
- ROM_COPY("swr", 0x40000, 0, 0x4000)
+ ROM_LOAD("os_de.rom", 0x0000, 0x4000, CRC(b7262caf) SHA1(aadf90338ee9d1c85dfa73beba50e930c2a38f10))
ROM_REGION(0x8000, "vsm", 0) /* system speech PHROM */
ROM_LOAD("phroma.bin", 0x0000, 0x4000, CRC(98e1bf9e) SHA1(b369809275cb67dfd8a749265e91adb2d2558ae6))
@@ -1805,18 +1884,17 @@ ROM_END
ROM_START(bbcb_us)
- ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
- /* rom page 12 30000 IC72 VIEW2.1 */
- /* rom page 13 34000 IC73 US DNFS */
- /* rom page 14 38000 IC74 US BASIC */
- /* rom page 15 3c000 IC75 SPARE SOCKET */
- ROM_LOAD("usmos10.rom", 0x40000, 0x4000, CRC(c8e946a9) SHA1(83d91d089dca092d2c8b7c3650ff8143c9069b89))
- ROM_LOAD("usbasic3.rom", 0x38000, 0x4000, CRC(161b9539) SHA1(b39014610a968789afd7695aa04d1277d874405c))
- ROM_LOAD("viewa210.rom", 0x30000, 0x4000, CRC(4345359f) SHA1(88c93df1854f5fbe6cd6e5f0e29a8bf4ea3b5614))
- ROM_LOAD("usdnfs10.rom", 0x34000, 0x4000, CRC(7e367e8c) SHA1(161f585dc45665ea77433c84afd2f95049f7f5a0))
+ ROM_REGION(0x40000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
+ /* rom page 0 00000 IC72 VIEW2.1 */
+ /* rom page 1 04000 IC73 US DNFS */
+ /* rom page 2 08000 IC74 US BASIC */
+ /* rom page 3 0c000 IC75 SPARE SOCKET */
+ ROM_LOAD("usbasic3.rom", 0x8000, 0x4000, CRC(161b9539) SHA1(b39014610a968789afd7695aa04d1277d874405c))
+ ROM_LOAD("viewa210.rom", 0x0000, 0x4000, CRC(4345359f) SHA1(88c93df1854f5fbe6cd6e5f0e29a8bf4ea3b5614))
+ ROM_LOAD("usdnfs10.rom", 0x4000, 0x4000, CRC(7e367e8c) SHA1(161f585dc45665ea77433c84afd2f95049f7f5a0))
ROM_REGION(0x4000, "mos", 0)
- ROM_COPY("swr", 0x40000, 0, 0x4000)
+ ROM_LOAD("usmos10.rom", 0x0000, 0x4000, CRC(c8e946a9) SHA1(83d91d089dca092d2c8b7c3650ff8143c9069b89))
ROM_REGION(0x8000, "vsm", 0) /* system speech PHROM */
ROM_LOAD("phrom_us.bin", 0x0000, 0x4000, CRC(bf4b3b64) SHA1(66876702d1d95eecc034d20f25047f893a27cde5))
@@ -1824,17 +1902,16 @@ ROM_END
ROM_START(torchf)
- ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
- /* rom page 12 30000 IC52 BASIC */
- /* rom page 13 34000 IC88 DNFS */
- /* rom page 14 38000 IC100 CPN (inserted by device) */
- /* rom page 15 3c000 IC101 SPARE SOCKET */
- ROM_LOAD("os12.rom", 0x40000, 0x4000, CRC(3c14fc70) SHA1(0d9bcaf6a393c9ce2359ed700ddb53c232c2c45d))
- ROM_LOAD("basic2.rom", 0x30000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281))
- ROM_LOAD("dnfs120-201666.rom", 0x34000, 0x4000, CRC(8ccd2157) SHA1(7e3c536baeae84d6498a14e8405319e01ee78232))
+ ROM_REGION(0x40000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
+ /* rom page 0 00000 IC52 BASIC */
+ /* rom page 1 04000 IC88 DNFS */
+ /* rom page 2 08000 IC100 CPN (inserted by device) */
+ /* rom page 3 0c000 IC101 SPARE SOCKET */
+ ROM_LOAD("basic2.rom", 0x0000, 0x4000, CRC(79434781) SHA1(4a7393f3a45ea309f744441c16723e2ef447a281))
+ ROM_LOAD("dnfs120-201666.rom", 0x4000, 0x4000, CRC(8ccd2157) SHA1(7e3c536baeae84d6498a14e8405319e01ee78232))
ROM_REGION(0x4000, "mos", 0)
- ROM_COPY("swr", 0x40000, 0, 0x4000)
+ ROM_LOAD("os12.rom", 0x0000, 0x4000, CRC(3c14fc70) SHA1(0d9bcaf6a393c9ce2359ed700ddb53c232c2c45d))
ROM_REGION(0x4000, "vsm", 0) /* system speech PHROM */
ROM_LOAD("phrom_us.bin", 0x0000, 0x4000, CRC(bf4b3b64) SHA1(66876702d1d95eecc034d20f25047f893a27cde5))
@@ -2161,7 +2238,7 @@ ROM_START(bbcmc)
ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
ROM_DEFAULT_BIOS("mos510")
ROM_SYSTEM_BIOS( 0, "mos510", "Enhanced MOS 5.10" )
- ROMX_LOAD("mos510.ic49", 0x30000, 0x10000, BAD_DUMP CRC(9a2a6086) SHA1(094ab37b0b6437c4f1653eaa0602ef102737adb6), ROM_BIOS(0)) // Merged individual ROM bank dumps
+ ROMX_LOAD("mos510.ic49", 0x30000, 0x10000, CRC(9a2a6086) SHA1(094ab37b0b6437c4f1653eaa0602ef102737adb6), ROM_BIOS(0))
ROM_SYSTEM_BIOS( 1, "mos500", "Original MOS 5.00" )
ROMX_LOAD("mos500.ic49", 0x30000, 0x10000, CRC(f6170023) SHA1(140d002d2d9cd34b47197a2ba823505af2a84633), ROM_BIOS(1))
ROM_COPY("swr", 0x30000, 0x40000, 0x4000) // Move loaded roms into place
@@ -2192,7 +2269,7 @@ ROM_START(bbcmc_ar)
ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
ROM_DEFAULT_BIOS("mos511i")
ROM_SYSTEM_BIOS( 0, "mos511i", "International MOS 5.11i" )
- ROMX_LOAD("mos511.ic49", 0x30000, 0x10000, BAD_DUMP CRC(8708803c) SHA1(d2170c8b9b536f3ad84a4a603a7fe712500cc751), ROM_BIOS(0)) // Merged individual ROM bank dumps
+ ROMX_LOAD("mos511.ic49", 0x30000, 0x10000, CRC(8708803c) SHA1(d2170c8b9b536f3ad84a4a603a7fe712500cc751), ROM_BIOS(0))
ROM_COPY("swr", 0x30000, 0x40000, 0x4000) // Move loaded roms into place
ROM_FILL(0x30000, 0x4000, 0xff)
/* 00000 rom 0 IC38 or EXTERNAL */
@@ -2281,6 +2358,42 @@ ROM_START(autoc15)
ROM_END
+ROM_START(daisy)
+ ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
+ ROM_DEFAULT_BIOS("mos320")
+ ROM_SYSTEM_BIOS(0, "mos320", "Original MOS 3.20")
+ ROMX_LOAD("mos320.ic24", 0x20000, 0x20000, CRC(0f747ebe) SHA1(eacacbec3892dc4809ad5800e6c8299ff9eb528f), ROM_BIOS(0))
+ ROM_COPY("swr", 0x20000, 0x40000, 0x4000) // Move loaded roms into place
+ ROM_FILL(0x20000, 0x4000, 0xff)
+ /* 00000 rom 0 SK3 Rear Cartridge bottom 16K */
+ /* 04000 rom 1 SK3 Rear Cartridge top 16K */
+ /* 08000 rom 2 SK4 Front Cartridge bottom 16K */
+ /* 0c000 rom 3 SK4 Front Cartridge top 16K */
+ /* 10000 rom 4 IC41 SIMDIST */
+ /* 14000 rom 5 IC41 DHRFDSY */
+ /* 18000 rom 6 IC37 IRFDSY */
+ /* 1c000 rom 7 IC37 DAISY */
+ /* 20000 rom 8 IC27 HiBASIC3 */
+ /* 24000 rom 9 IC24 DFS + SRAM */
+ /* 28000 rom 10 IC24 Viewsheet */
+ /* 2c000 rom 11 IC24 Edit */
+ /* 30000 rom 12 IC24 BASIC */
+ /* 34000 rom 13 IC24 ADFS */
+ /* 38000 rom 14 IC24 View + MOS code */
+ /* 3c000 rom 15 IC24 Terminal + Tube host + CFS */
+ ROM_LOAD("simdist_2_22-2-89_dhrfdsy.rom", 0x10000, 0x8000, CRC(8a9d9c4a) SHA1(278c5c63e06359601cdf972f55e98f5a7442a713))
+ ROM_LOAD("daisy_irfdsy_vr4_5-1-89.rom", 0x18000, 0x8000, CRC(9662d779) SHA1(0841c1fd34c152f3f02ace8633f1fa3f5139069e))
+ ROM_LOAD("hibas03_a063.rom", 0x20000, 0x4000, CRC(6ea7affc) SHA1(99234b55fde57680e4217b72ef4ccb8fc56edeff))
+
+ ROM_REGION(0x4000, "mos", 0)
+ ROM_COPY("swr", 0x40000, 0, 0x4000)
+
+ ROM_REGION(0x40, "rtc", 0) /* mc146818 */
+ /* Factory defaulted CMOS RAM, sets default language ROM, etc. */
+ ROMX_LOAD("mos320.cmos", 0x00, 0x40, CRC(c7f9e85a) SHA1(f24cc9db0525910689219f7204bf8b864033ee94), ROM_BIOS(0))
+ROM_END
+
+
ROM_START(discmon)
ROM_REGION(0x44000, "swr", ROMREGION_ERASEFF) /* Sideways ROMs */
ROM_DEFAULT_BIOS("mos320")
@@ -2388,33 +2501,34 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
-COMP ( 1981, bbcb, 0, bbca, bbcb, bbcb, bbc_state, init_bbc, "Acorn", "BBC Micro Model B", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1981, bbca, bbcb, 0, bbca, bbca, bbc_state, init_bbc, "Acorn", "BBC Micro Model A", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1981, bbcb, 0, bbca, bbcb, bbcb, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model B", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1981, bbca, bbcb, 0, bbca, bbca, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model A", MACHINE_IMPERFECT_GRAPHICS)
COMP ( 1982, torchf, bbcb, 0, torchf, torch, torch_state, init_bbc, "Torch Computers", "Torch CF240", MACHINE_IMPERFECT_GRAPHICS)
COMP ( 1982, torchh10, bbcb, 0, torchh10, torch, torch_state, init_bbc, "Torch Computers", "Torch CH240/10", MACHINE_NOT_WORKING)
COMP ( 1982, torchh21, bbcb, 0, torchh21, torch, torch_state, init_bbc, "Torch Computers", "Torch CH240/21", MACHINE_NOT_WORKING)
-COMP ( 1982, bbcb_de, bbcb, 0, bbcb_de, bbcb, bbc_state, init_bbc, "Acorn", "BBC Micro Model B (German)", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1983, bbcb_us, bbcb, 0, bbcb_us, bbcb, bbc_state, init_bbc, "Acorn", "BBC Micro Model B (US)", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1985, bbcbp, 0, bbcb, bbcbp, bbcbp, bbcbp_state, init_bbc, "Acorn", "BBC Micro Model B+ 64K", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1985, bbcbp128, bbcbp, 0, bbcbp128, bbcbp, bbcbp_state, init_bbc, "Acorn", "BBC Micro Model B+ 128K", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1985, abc110, bbcbp, 0, abc110, abc, bbcbp_state, init_bbc, "Acorn", "ABC 110", MACHINE_NOT_WORKING)
-COMP ( 1985, acw443, bbcbp, 0, acw443, abc, bbcbp_state, init_bbc, "Acorn", "ABC 210/Cambridge Workstation", MACHINE_NOT_WORKING)
-COMP ( 1985, abc310, bbcbp, 0, abc310, abc, bbcbp_state, init_bbc, "Acorn", "ABC 310", MACHINE_NOT_WORKING)
+COMP ( 1982, bbcb_de, bbcb, 0, bbcb_de, bbcb, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model B (German)", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1983, bbcb_us, bbcb, 0, bbcb_us, bbcb, bbc_state, init_bbc, "Acorn Computers", "BBC Micro Model B (US)", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1985, bbcbp, 0, bbcb, bbcbp, bbcbp, bbcbp_state, init_bbc, "Acorn Computers", "BBC Micro Model B+ 64K", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1985, bbcbp128, bbcbp, 0, bbcbp128, bbcbp, bbcbp_state, init_bbc, "Acorn Computers", "BBC Micro Model B+ 128K", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1985, abc110, bbcbp, 0, abc110, abc, bbcbp_state, init_bbc, "Acorn Computers", "ABC 110", MACHINE_NOT_WORKING)
+COMP ( 1985, acw443, bbcbp, 0, acw443, abc, bbcbp_state, init_bbc, "Acorn Computers", "ABC 210/Cambridge Workstation", MACHINE_NOT_WORKING)
+COMP ( 1985, abc310, bbcbp, 0, abc310, abc, bbcbp_state, init_bbc, "Acorn Computers", "ABC 310", MACHINE_NOT_WORKING)
COMP ( 1985, ltmpbp, bbcbp, 0, bbcbp, ltmpbp, bbcbp_state, init_ltmp, "Lawrie T&M Ltd.", "LTM Portable (B+)", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1985, reutapm, bbcbp, 0, reutapm, bbcb, bbcbp_state, init_bbc, "Acorn", "Reuters APM", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING)
-COMP ( 1986, econx25, bbcbp, 0, econx25, bbcbp, bbcbp_state, init_bbc, "Acorn", "Econet X25 Gateway", MACHINE_NOT_WORKING)
-COMP ( 1986, bbcm, 0, bbcb, bbcm, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master 128", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1986, bbcmt, bbcm, 0, bbcmt, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master Turbo", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1986, bbcmaiv, bbcm, 0, bbcmaiv, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master AIV", MACHINE_NOT_WORKING)
-COMP ( 1986, bbcmet, bbcm, 0, bbcmet, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master ET", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1986, bbcm512, bbcm, 0, bbcm512, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master 512", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1986, bbcmarm, bbcm, 0, bbcmarm, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master (ARM Evaluation)", MACHINE_NOT_WORKING)
+COMP ( 1985, reutapm, bbcbp, 0, reutapm, bbcb, bbcbp_state, init_bbc, "Acorn Computers", "Reuters APM", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING)
+COMP ( 1986, econx25, bbcbp, 0, econx25, bbcbp, bbcbp_state, init_bbc, "Acorn Computers", "Econet X25 Gateway", MACHINE_NOT_WORKING)
+COMP ( 1986, bbcm, 0, bbcb, bbcm, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master 128", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1986, bbcmt, bbcm, 0, bbcmt, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master Turbo", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1986, bbcmaiv, bbcm, 0, bbcmaiv, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master AIV", MACHINE_NOT_WORKING)
+COMP ( 1986, bbcmet, bbcm, 0, bbcmet, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master ET", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1986, bbcm512, bbcm, 0, bbcm512, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master 512", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1986, bbcmarm, bbcm, 0, bbcmarm, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master (ARM Evaluation)", MACHINE_NOT_WORKING)
COMP ( 1986, ltmpm, bbcm, 0, bbcm, ltmpm, bbcm_state, init_ltmp, "Lawrie T&M Ltd.", "LTM Portable (Master)", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1986, bbcmc, 0, bbcm, bbcmc, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master Compact", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1986, bbcmc_ar, bbcmc, 0, bbcmc, bbcm, bbcm_state, init_bbcm, "Acorn", "BBC Master Compact (Arabic)", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1987, pro128s, bbcmc, 0, pro128s, bbcm, bbcm_state, init_bbcm, "Olivetti", "Prodest PC 128S", MACHINE_IMPERFECT_GRAPHICS)
-COMP ( 1988, autoc15, bbcmc, 0, autoc15, bbcm, bbcm_state, init_bbcm, "Autocue", "Autocue 1500", MACHINE_NOT_WORKING)
-COMP ( 1988, discmon, bbcm, 0, discmon, bbcm, bbcm_state, init_bbcm, "Arbiter Leisure", "Arbiter Discmonitor A-01", MACHINE_NOT_WORKING)
-COMP ( 1988, discmate, bbcm, 0, discmate, bbcm, bbcm_state, init_bbcm, "Arbiter Leisure", "Arbiter Discmate A-02", MACHINE_NOT_WORKING)
+COMP ( 1987, daisy, bbcm, 0, daisy, bbcm, bbcm_state, init_bbc, "Comus Instruments Ltd.", "Comus Daisy", MACHINE_NOT_WORKING)
+COMP ( 1986, bbcmc, 0, bbcm, bbcmc, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master Compact", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1986, bbcmc_ar, bbcmc, 0, bbcmc, bbcm, bbcm_state, init_bbc, "Acorn Computers", "BBC Master Compact (Arabic)", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1987, pro128s, bbcmc, 0, pro128s, bbcm, bbcm_state, init_bbc, "Olivetti", "Prodest PC 128S", MACHINE_IMPERFECT_GRAPHICS)
+COMP ( 1988, autoc15, bbcmc, 0, autoc15, bbcm, bbcm_state, init_bbc, "Autocue Ltd.", "Autocue 1500", MACHINE_NOT_WORKING)
+COMP ( 1988, discmon, bbcm, 0, discmon, bbcm, bbcm_state, init_bbc, "Arbiter Leisure", "Arbiter Discmonitor A-01", MACHINE_NOT_WORKING)
+COMP ( 1988, discmate, bbcm, 0, discmate, bbcm, bbcm_state, init_bbc, "Arbiter Leisure", "Arbiter Discmate A-02", MACHINE_NOT_WORKING)
//COMP ( 1988, discmast, bbcm, 0, discmast, bbcm, bbcm_state, init_bbc, "Arbiter Leisure", "Arbiter Discmaster A-03", MACHINE_NOT_WORKING)
COMP ( 1989, cfa3000, bbcm, 0, cfa3000, bbcm, bbcm_state, init_cfa, "Tinsley Medical Instruments", "Henson CFA 3000", MACHINE_NOT_WORKING)
diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp
index 3c9566c3900..393f9964a95 100644
--- a/src/mame/drivers/coolridr.cpp
+++ b/src/mame/drivers/coolridr.cpp
@@ -389,8 +389,6 @@ public:
DECLARE_WRITE32_MEMBER(fb_data_w);
DECLARE_WRITE32_MEMBER(dma_w);
- DECLARE_READ32_MEMBER(coolridr_hack2_r);
- DECLARE_READ32_MEMBER(aquastge_hack_r);
template<int Chip> DECLARE_READ16_MEMBER(soundram_r);
template<int Chip> DECLARE_WRITE16_MEMBER(soundram_w);
DECLARE_WRITE8_MEMBER(lamps_w);
@@ -3380,80 +3378,21 @@ ROM_START( aquastge )
ROM_END
-/*
-TODO: both irq routines writes 1 to 0x60d8894, sets up the Watchdog timer then expect that this buffer goes low IN the irq routines.
- The Watchdog Timer is setted up with these params:
- 0xee for wtcnt
- 0x39 for wtcsr (enable irq (bit 5), enable timer (bit 4), clock select divider / 64 (bits 2-0))
- vector is 0x7f (so VBR+0x1fc)
- level is 0xf
-... and indeed the Watchdog irq routine effectively clears this RAM buffer. What the manual doesn't say is that the Watchdog timer irq
- presumably is treated as an NMI by the SH-2 CPU and not really a "normal" irq exception.
- For the record, here's the ITI code snippet:
- 06002DE4: 2F36 MOV.L R3,@-SP
- 06002DE6: E300 MOV #$00,R3
- 06002DE8: 2F26 MOV.L R2,@-SP
- 06002DEA: D20B MOV.L @($2C,PC),R2
- 06002DEC: 2230 MOV.B R3,@R2 ;writes 0 to the RAM buffer 0x60d8896
- 06002DEE: 9305 MOV.W @($000A,PC),R3
- 06002DF0: 9205 MOV.W @($000A,PC),R2
- 06002DF2: 2231 MOV.W R3,@R2 ;writes 0x19, disables the watchdog timer
- 06002DF4: 62F6 MOV.L @SP+,R2
- 06002DF6: 63F6 MOV.L @SP+,R3
- 06002DF8: 002B RTE
- 06002DFA: 0009 NOP
-
-*/
-READ32_MEMBER(coolridr_state::coolridr_hack2_r)
-{
- offs_t pc = m_maincpu->pc();
-
- if(pc == 0x6002cba || pc == 0x6002d42)
- return 0;
-
- // with the non-recompiler pc returns +2
- if(pc == 0x06002cbc || pc == 0x06002d44)
- return 0;
-
- return m_workram_h[0xd8894/4];
-}
-
-
-READ32_MEMBER(coolridr_state::aquastge_hack_r)
-{
- offs_t pc = m_maincpu->pc();
-
- if ((pc == 0x6009e76) || (pc == 0x6009e78))
- return 0;
- else
- {
-// printf("pc %08x\n", pc);
- }
-
- return m_workram_h[0xc3fd8/4];
-}
-
-
void coolridr_state::init_coolridr()
{
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x60d8894, 0x060d8897, read32_delegate(*this, FUNC(coolridr_state::coolridr_hack2_r)));
-
m_maincpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
m_subcpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
m_colbase = 0x7b20;
// work around the hack when mapping the workram directly
- m_maincpu->sh2drc_add_fastram(0x06000000, 0x060d7fff, 0, &m_workram_h[0]);
- m_maincpu->sh2drc_add_fastram(0x060d9000, 0x060fffff, 0, &m_workram_h[0xd9000/4]);
+ m_maincpu->sh2drc_add_fastram(0x06000000, 0x060fffff, 0, &m_workram_h[0]);
m_maincpu->sh2drc_add_fastram(0x00000000, 0x001fffff, 1, &m_rom[0]);
m_maincpu->sh2drc_add_fastram(0x20000000, 0x201fffff, 1, &m_rom[0]);
}
void coolridr_state::init_aquastge()
{
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x60c3fd8, 0x60c3fdb, read32_delegate(*this, FUNC(coolridr_state::aquastge_hack_r)));
-
m_maincpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
m_subcpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp
index 47b1b719576..2d689fd1f63 100644
--- a/src/mame/drivers/einstein.cpp
+++ b/src/mame/drivers/einstein.cpp
@@ -419,8 +419,11 @@ WRITE8_MEMBER(einstein_state::evdpint_msk_w)
READ8_MEMBER( einstein_state::rom_r )
{
- m_rom_enabled ^= 1;
- m_bank1->set_entry(m_rom_enabled);
+ if (!machine().side_effects_disabled())
+ {
+ m_rom_enabled ^= 1;
+ m_bank1->set_entry(m_rom_enabled);
+ }
return 0xff;
}
diff --git a/src/mame/drivers/elan_eu3a05.cpp b/src/mame/drivers/elan_eu3a05.cpp
index 903918779ff..06b077c0704 100644
--- a/src/mame/drivers/elan_eu3a05.cpp
+++ b/src/mame/drivers/elan_eu3a05.cpp
@@ -107,10 +107,6 @@ private:
DECLARE_READ8_MEMBER(elan_eu3a05_pal_ntsc_r);
DECLARE_WRITE8_MEMBER(elan_eu3a05_500b_unk_w);
- // more sound regs?
- DECLARE_READ8_MEMBER(elan_eu3a05_50a9_r);
- DECLARE_WRITE8_MEMBER(elan_eu3a05_50a9_w);
-
INTERRUPT_GEN_MEMBER(interrupt);
// for callback
@@ -137,7 +133,12 @@ private:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- uint8_t m_50a9_data;
+ DECLARE_WRITE_LINE_MEMBER(sound_end0) { m_sys->generate_custom_interrupt(2); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end1) { m_sys->generate_custom_interrupt(3); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end2) { m_sys->generate_custom_interrupt(4); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end3) { m_sys->generate_custom_interrupt(5); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end4) { m_sys->generate_custom_interrupt(6); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end5) { m_sys->generate_custom_interrupt(7); }
};
void elan_eu3a05_state::video_start()
@@ -180,19 +181,6 @@ READ8_MEMBER(elan_eu3a05_state::elan_eu3a05_5003_r)
-// probably also sound device, maybe for forcing channels to stop?
-READ8_MEMBER(elan_eu3a05_state::elan_eu3a05_50a9_r)
-{
- logerror("%s: elan_eu3a05_50a9_r\n", machine().describe_context());
- return m_50a9_data;
-}
-
-WRITE8_MEMBER(elan_eu3a05_state::elan_eu3a05_50a9_w)
-{
- logerror("%s: elan_eu3a05_50a9_w %02x\n", machine().describe_context(), data);
- m_50a9_data = data;
-}
-
WRITE8_MEMBER(elan_eu3a05_state::elan_eu3a05_500b_unk_w)
{
// this is the PAL / NTSC flag when read, so what are writes?
@@ -253,17 +241,10 @@ void elan_eu3a05_state::elan_eu3a05_map(address_map &map)
map(0x5048, 0x504a).w(m_gpio, FUNC(elan_eu3a05gpio_device::gpio_unk_w));
// 506x unknown
- map(0x5060, 0x506d).ram(); // read/written by tetris
+ map(0x5060, 0x506d).ram(); // read/written by tetris (ADC?)
// 508x sound
- map(0x5080, 0x5091).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_addr_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_addr_w));
- map(0x5092, 0x50a3).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_size_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_size_w));
- map(0x50a4, 0x50a4).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_unk_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_unk_w));
- map(0x50a5, 0x50a5).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_trigger_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_trigger_w));
- map(0x50a6, 0x50a6).ram();
- map(0x50a7, 0x50a7).ram();
- map(0x50a8, 0x50a8).r(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_50a8_r)); // possible 'stopped' status of above channels, waits for it to be 0x3f in places
- map(0x50a9, 0x50a9).rw(FUNC(elan_eu3a05_state::elan_eu3a05_50a9_r), FUNC(elan_eu3a05_state::elan_eu3a05_50a9_w));
+ map(0x5080, 0x50a9).rw(m_sound, FUNC(elan_eu3a05_sound_device::read), FUNC(elan_eu3a05_sound_device::write));
//map(0x5000, 0x50ff).ram();
map(0x6000, 0xdfff).m(m_bank, FUNC(address_map_bank_device::amap8));
@@ -497,6 +478,14 @@ void elan_eu3a05_state::elan_eu3a05(machine_config &config)
ELAN_EU3A05_SOUND(config, m_sound, 8000);
m_sound->space_read_callback().set(FUNC(elan_eu3a05_state::read_full_space));
m_sound->add_route(ALL_OUTPUTS, "mono", 1.0);
+ /* just causes select sound to loop in Tetris for now!
+ m_sound->sound_end_cb<0>().set(FUNC(elan_eu3a05_state::sound_end0));
+ m_sound->sound_end_cb<1>().set(FUNC(elan_eu3a05_state::sound_end1));
+ m_sound->sound_end_cb<2>().set(FUNC(elan_eu3a05_state::sound_end2));
+ m_sound->sound_end_cb<3>().set(FUNC(elan_eu3a05_state::sound_end3));
+ m_sound->sound_end_cb<4>().set(FUNC(elan_eu3a05_state::sound_end4));
+ m_sound->sound_end_cb<5>().set(FUNC(elan_eu3a05_state::sound_end5));
+ */
}
void elan_eu3a05_state::airblsjs(machine_config& config)
diff --git a/src/mame/drivers/elan_eu3a14.cpp b/src/mame/drivers/elan_eu3a14.cpp
index bc324de3c05..f0519473c68 100644
--- a/src/mame/drivers/elan_eu3a14.cpp
+++ b/src/mame/drivers/elan_eu3a14.cpp
@@ -69,7 +69,7 @@
#include "audio/elan_eu3a05.h"
#include "machine/timer.h"
#include "machine/elan_eu3a14sys.h"
-#include "video/elan_eu3a05commonvid.h"
+#include "video/elan_eu3a14vid.h"
@@ -81,16 +81,8 @@ public:
m_maincpu(*this, "maincpu"),
m_sys(*this, "sys"),
m_sound(*this, "eu3a05sound"),
- m_commonvid(*this, "commonvid"),
+ m_vid(*this, "commonvid"),
m_mainregion(*this, "maincpu"),
- m_scrollregs(*this, "scrollregs"),
- m_tilecfg(*this, "tilecfg"),
- m_rowscrollregs(*this, "rowscrollregs"),
- m_rowscrollsplit(*this, "rowscrollsplit"),
- m_rowscrollcfg(*this, "rowscrollcfg"),
- m_ramtilecfg(*this, "ramtilecfg"),
- m_spriteaddr(*this, "spriteaddr"),
- m_spritebase(*this, "spritebase"),
m_mainram(*this, "mainram"),
m_bank(*this, "bank"),
m_palette(*this, "palette"),
@@ -101,12 +93,11 @@ public:
void radica_eu3a14(machine_config &config);
- void radica_eu3a14_adc(machine_config &config);
void radica_eu3a14p(machine_config &config);
- void init_rad_gtg();
- void init_rad_foot();
- void init_rad_hnt3();
+ void radica_eu3a14p_altrambase(machine_config &config);
+ void radica_eu3a14_altrambase(machine_config& config);
+ void radica_eu3a14_altrambase_adc(machine_config &config);
private:
// screen updates
@@ -116,7 +107,6 @@ private:
DECLARE_READ8_MEMBER(elan_eu3a05_pal_ntsc_r);
-
DECLARE_WRITE8_MEMBER(porta_dir_w);
DECLARE_WRITE8_MEMBER(portb_dir_w);
DECLARE_WRITE8_MEMBER(portc_dir_w);
@@ -125,11 +115,8 @@ private:
DECLARE_WRITE8_MEMBER(portb_dat_w);
DECLARE_WRITE8_MEMBER(portc_dat_w);
-
DECLARE_READ8_MEMBER(radica_5009_unk_r) { return machine().rand(); };
- DECLARE_READ8_MEMBER(random_r) { return machine().rand(); };
-
TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
// for callback
@@ -147,16 +134,9 @@ private:
required_device<cpu_device> m_maincpu;
required_device<elan_eu3a14sys_device> m_sys;
required_device<elan_eu3a05_sound_device> m_sound;
- required_device<elan_eu3a05commonvid_device> m_commonvid;
+ required_device<elan_eu3a14vid_device> m_vid;
required_region_ptr<uint8_t> m_mainregion;
- required_shared_ptr<uint8_t> m_scrollregs;
- required_shared_ptr<uint8_t> m_tilecfg;
- required_shared_ptr<uint8_t> m_rowscrollregs;
- required_shared_ptr<uint8_t> m_rowscrollsplit;
- required_shared_ptr<uint8_t> m_rowscrollcfg;
- required_shared_ptr<uint8_t> m_ramtilecfg;
- required_shared_ptr<uint8_t> m_spriteaddr;
- required_shared_ptr<uint8_t> m_spritebase;
+
required_shared_ptr<uint8_t> m_mainram;
required_device<address_map_bank_device> m_bank;
required_device<palette_device> m_palette;
@@ -164,746 +144,26 @@ private:
required_device<screen_device> m_screen;
required_ioport m_tvtype;
- int m_tilerambase;
- int m_spriterambase;
-
- bitmap_ind8 m_prioritybitmap;
-
uint8_t m_portdir[3];
- void draw_background_ramlayer(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect);
- int get_xscroll_for_screenypos(int line);
- void draw_background_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int bpp, int tileno, int palette, int priority, int flipx, int flipy, int xpos, int ypos, int transpen, int size, int base, int drawfromram);
- void draw_background_page(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int ramstart, int ramend, int xbase, int ybase, int size, int bpp, int base, int pagewidth,int pageheight, int bytespertile, int palettepri, int drawfromram);
- void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void draw_sprite_pix(const rectangle& cliprect, uint16_t* dst, uint8_t* pridst, int realx, int priority, uint8_t pix, uint8_t mask, uint8_t shift, int palette);
- void draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int line, int pal, int flipx, int pri, int xpos, int ypos, int bpp);
- void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(sound_end0) { m_sys->generate_custom_interrupt(2); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end1) { m_sys->generate_custom_interrupt(3); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end2) { m_sys->generate_custom_interrupt(4); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end3) { m_sys->generate_custom_interrupt(5); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end4) { m_sys->generate_custom_interrupt(6); }
+ DECLARE_WRITE_LINE_MEMBER(sound_end5) { m_sys->generate_custom_interrupt(7); }
};
void elan_eu3a14_state::video_start()
{
- m_screen->register_screen_bitmap(m_prioritybitmap);
-}
-
-void elan_eu3a14_state::draw_background_tile(bitmap_ind16& bitmap, const rectangle& cliprect, int bpp, int tileno, int palette, int priority, int flipx, int flipy, int xpos, int ypos, int transpen, int size, int base, int drawfromram)
-{
- int baseaddr = base * 256;
-
- int xstride = 8;
-
- if (bpp == 8) // 8bpp selection
- {
- if (size == 8)
- {
- xstride = size / 1; baseaddr += tileno * 64; // 8x8 8bpp
- }
- else
- {
- xstride = size / 1; baseaddr += tileno * 256; // 16x16 8bpp
- }
-
- palette &= 0x100; // only top bit valid, as there are only 2 palettes?
- }
- else if (bpp == 4) // 4bpp selection
- {
- if (size == 8)
- {
- xstride = size / 2; baseaddr += tileno * 32; // 8x8 4bpp
- }
- else
- {
- xstride = size / 2; baseaddr += tileno * 128; // 16x16 4bpp
- }
- }
- else if (bpp == 2) // 2bpp?
- {
- xstride = size / 4; baseaddr += tileno * 64; // 16x16 2bpp
- }
- else
- {
- popmessage("draw_background_tile unsupported bpp %d\n", bpp);
- return;
- }
-
-
-
- uint8_t* gfxdata;
-
- if (drawfromram)
- {
- gfxdata = &m_mainram[baseaddr & 0x3fff];
- }
- else
- {
- gfxdata = &m_mainregion[baseaddr & 0x3fffff];
- }
-
-
- int count = 0;
- for (int y = 0; y < size; y++)
- {
- int realy = ypos + y;
- int xposwithscroll = 0;
-
- if (!drawfromram)
- {
- xposwithscroll = xpos - get_xscroll_for_screenypos(realy);
- }
- else
- {
- xposwithscroll = xpos;
- // RAM tile layer has no scrolling? (or we've never seen it used / enabled)
- }
-
- uint16_t* dst = &bitmap.pix16(ypos + y);
- uint8_t* pridst = &m_prioritybitmap.pix8(ypos + y);
-
- for (int x = 0; x < xstride; x++)
- {
- int pix = gfxdata[count];
-
- if (realy >= cliprect.min_y && realy <= cliprect.max_y)
- {
- if (bpp == 8) // 8bpp
- {
- int realx = x + xposwithscroll;
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pix)
- {
- if (pridst[realx] <= priority)
- {
- dst[realx] = pix | palette;
- pridst[realx] = priority;
- }
-
- }
- }
- }
- else if (bpp == 7)
- {
- popmessage("draw_background_tile bpp == 7");
- }
- else if (bpp == 6)
- {
- popmessage("draw_background_tile bpp == 6");
- }
- else if (bpp == 5)
- {
- popmessage("draw_background_tile bpp == 5");
- }
- else if (bpp == 4) // 4bpp
- {
- int realx = (x * 2) + xposwithscroll;
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pix & 0xf0)
- {
- if (pridst[realx] <= priority)
- {
- dst[realx] = ((pix & 0xf0) >> 4) | palette;
- pridst[realx] = priority;
- }
- }
- }
-
- realx++;
-
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pix & 0x0f)
- {
- if (pridst[realx] <= priority)
- {
- dst[realx] = (pix & 0x0f) | palette;
- pridst[realx] = priority;
- }
- }
- }
- }
- else if (bpp == 3)
- {
- popmessage("draw_background_tile bpp == 3");
- }
- else if (bpp == 2) // 2bpp (hnt3 ram text)
- {
- int realx = (x * 4) + xposwithscroll;
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pix & 0xc0)
- {
- if (pridst[realx] <= priority)
- {
- dst[realx] = ((pix & 0xc0) >> 6) | palette;
- pridst[realx] = priority;
- }
- }
- }
-
- realx++;
-
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pix & 0x30)
- {
- if (pridst[realx] <= priority)
- {
- dst[realx] = ((pix & 0x30) >> 4) | palette;
- pridst[realx] = priority;
- }
- }
- }
-
- realx++;
-
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pix & 0x0c)
- {
- if (pridst[realx] <= priority)
- {
- dst[realx] = ((pix & 0x0c) >> 2) | palette;
- pridst[realx] = priority;
- }
- }
- }
-
- realx++;
-
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pix & 0x03)
- {
- if (pridst[realx] <= priority)
- {
- dst[realx] = ((pix & 0x03) >> 0) | palette;
- pridst[realx] = priority;
- }
- }
- }
- }
- else if (bpp == 1)
- {
- popmessage("draw_background_tile bpp == 1");
- }
- }
- count++;
- }
- }
-}
-
-int elan_eu3a14_state::get_xscroll_for_screenypos(int ydraw)
-{
- if ((ydraw < 0) || (ydraw >= 224))
- return 0;
-
- int xscroll = m_scrollregs[0] | (m_scrollregs[1] << 8);
-
- if (m_rowscrollcfg[1] == 0x01) // GUESS! could be anything, but this bit is set in Huntin'3
- {
- int split0 = m_rowscrollregs[0] | (m_rowscrollregs[1] << 8);
- int split1 = m_rowscrollregs[2] | (m_rowscrollregs[3] << 8);
- int split2 = m_rowscrollregs[4] | (m_rowscrollregs[5] << 8);
- int split3 = m_rowscrollregs[6] | (m_rowscrollregs[7] << 8);
-
- if (ydraw < m_rowscrollsplit[0])
- {
- return xscroll;
- }
- else if (ydraw < m_rowscrollsplit[1])
- {
- return split0;
- }
- else if (ydraw < m_rowscrollsplit[2])
- {
- return split1;
- }
- else if (ydraw < m_rowscrollsplit[3])
- {
- return split2;
- }
- else if (ydraw < m_rowscrollsplit[4])
- {
- return split3;
- }
- else
- {
- return 0;
- }
- }
- else
- {
- return xscroll;
- }
-}
-
-
-void elan_eu3a14_state::draw_background_page(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect, int ramstart, int ramend, int xbase, int ybase, int size, int bpp, int base, int pagewidth, int pageheight, int bytespertile, int palettepri, int drawfromram)
-{
-
- int palette = ((palettepri & 0xf0) >> 4) | ((palettepri & 0x08) << 1);
- palette = palette << 4;
- int priority = palettepri & 0x07;
-
- int xdraw = xbase;
- int ydraw = ybase;
- int count = 0;
-
- for (int i = ramstart; i < ramend; i += bytespertile)
- {
- int tile = 0;
- int realpalette = palette;
- int realpriority = priority;
- int realbpp = bpp;
-
- if (bytespertile == 2)
- {
- tile = m_mainram[i + 0] | (m_mainram[i + 1] << 8);
- }
- else if (bytespertile == 4) // rad_foot hidden test mode, rad_hnt3 "Target Range" (not yet correct)
- {
- tile = m_mainram[i + 0] | (m_mainram[i + 1] << 8);// | (m_mainram[i + 2] << 16) | | (m_mainram[i + 3] << 24);
-
- // m_mainram[i + 3] & 0x04 is set in both seen cases, maybe per-tile bpp?
- // this would match up with this mode being inline replacements for m_tilecfg[1] (palettepri) and m_tilecfg[2] (bpp);
-
- int newpalette = ((m_mainram[i + 2] & 0xf0) >> 4) | ((m_mainram[i + 2] & 0x08) << 1);
- newpalette = newpalette << 4;
- realpalette = newpalette;
- realpriority = m_mainram[i + 2] & 0x07;
- realbpp = m_mainram[i + 3] & 0x07;
- if (realbpp == 0)
- realbpp = 8;
-
- }
-
-
- draw_background_tile(bitmap, cliprect, realbpp, tile, realpalette, realpriority, 0, 0, xdraw, ydraw, 0, size, base, drawfromram);
-
- xdraw += size;
-
- count++;
- if (((count % pagewidth) == 0))
- {
- xdraw -= size * pagewidth;
- ydraw += size;
- }
- }
-}
-
-void elan_eu3a14_state::draw_background_ramlayer(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect)
-{
- // this register use is questionable
- if (m_ramtilecfg[0] & 0x80)
- {
- int rtm_size;;
- int rtm_pagewidth;
- int rtm_pageheight;
- int rtm_yscroll;
- int rtm_bpp;
- int rtm_bytespertile = 2;
- uint8_t palettepri = m_ramtilecfg[1];
-
- rtm_yscroll = 0;
-
- // this is the gfxbase in ram for all cases seen
- int rtm_base = (0x2000 - 0x200) / 256;
-
- // same as regular layer?
- if (m_ramtilecfg[0] & 0x10)
- {
- rtm_size = 8;
- rtm_pagewidth = 32;
- rtm_pageheight = 28;
- }
- else
- {
- rtm_size = 16;
- rtm_pagewidth = 32 / 2;
- rtm_pageheight = 28 / 2;
- }
-
- rtm_bpp = m_ramtilecfg[2] & 0x07;
- if (rtm_bpp == 0)
- rtm_bpp = 8;
-
- // this is in the same place even when the first tilemap is in 16x16 mode, probably a base register somewhere
- int ramstart = m_tilerambase + 0x700;
- int ramend = m_tilerambase + 0x700 + 0x700;
-
- // hack for "Target Range" mode
- if (m_ramtilecfg[5] == 0x06)
- {
- ramstart = 0x3980-0x200;
- ramend = 0x3980-0x200 + 0x700;
- }
-
- // normal
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
- // wrap x
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (rtm_size * rtm_pagewidth), 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
- // wrap y
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, (rtm_size * rtm_pageheight) + 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
- // wrap x+y
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (rtm_size * rtm_pagewidth), (rtm_size * rtm_pageheight) + 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
- }
-}
-
-
-void elan_eu3a14_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- int yscroll = m_scrollregs[2] | (m_scrollregs[3] << 8);
-
- int base = (m_tilecfg[5] << 8) | m_tilecfg[4];
- uint8_t palettepri = m_tilecfg[1];
-
- int pagewidth = 1, pageheight = 1;
- int bytespertile = 2;
- int size;
-
- // m_tilecfg[0] b-as ?-hh b = bytes per tile s = tilesize / page size? a = always set when tilemaps are in use - check? h = related to page positions, when set uses 2x2 pages? ? = used
- // m_tilecfg[1] pppp x--? ? = used foot x = used, huntin3 summary (palette bank?) p = palette (used for different stages in huntin3 and the hidden test modes in others)
- // m_tilecfg[2] ---- bbbb b = bpp mode (0 = 8bpp)
- // m_tilecfg[3] ---- ---- (unused or more gfxbase?)
- // m_tilecfg[4] gggg gggg gfxbase (lower bits)
- // m_tilecfg[5] gggg gggg gfxbase (upper bits)
-
- // ramtilecfg appears to be a similar format, except for the other layer with ram base tiles
- // however 'a' in m_tilecfg[0] is NOT set
- // also m_tilecfg[0] has 0x80 set, which would be 4 bytes per tile, but it isn't?
- // the layer seems to be disabled by setting m_tilecfg[0] to 0?
-
- if (m_tilecfg[0] & 0x10)
- {
- size = 8;
- pagewidth = 32;
- pageheight = 28;
- }
- else
- {
- size = 16;
- pagewidth = 16;
- pageheight = 14;
- }
-
- if (m_tilecfg[0] & 0x80)
- {
- bytespertile = 4;
- }
- else
- {
- bytespertile = 2;
- }
-
- int bpp = (m_tilecfg[2] & 0x07);
- if (bpp == 0)
- bpp = 8;
-
- int ramstart = 0;
- int ramend = 0;
-
- int pagesize = pagewidth * pageheight * 2;
-
- if (bytespertile == 4)
- {
- pagesize <<= 1; // shift because we need twice as much ram for this mode
- }
-
- if ((m_tilecfg[0] & 0x03) == 0x00) // tilemaps arranged as 2x2 pages?
- {
- ramstart = m_tilerambase + pagesize * 0;
- ramend = m_tilerambase + pagesize * 1;
-
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap y
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
-
- ramstart = m_tilerambase + pagesize * 1;
- ramend = m_tilerambase + pagesize * 2;
-
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap y
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
-
- ramstart = m_tilerambase + pagesize * 2;
- ramend = m_tilerambase + pagesize * 3;
-
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap y
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
-
- ramstart = m_tilerambase + pagesize * 3;
- ramend = m_tilerambase + pagesize * 4;
-
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);// wrap y
- draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
- }
- else if ((m_tilecfg[0] & 0x03) == 0x03) // individual tilemaps? multiple layers?
- {
- // popmessage("m_tilecfg[0] & 0x03 multiple layers config %04x", base);
- ramstart = m_tilerambase + pagesize * 0;
- ramend = m_tilerambase + pagesize * 1;
-
- // normal
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
- // wrap x
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (size * pagewidth), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
- // wrap y
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, (size * pageheight) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
- // wrap x+y
- draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (size * pagewidth), (size * pageheight) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
-
- // RAM based tile layer
- draw_background_ramlayer(screen, bitmap, cliprect);
- }
- else
- {
- popmessage("m_tilecfg[0] & 0x03 unknown config");
- }
-
-}
-
-void elan_eu3a14_state::draw_sprite_pix(const rectangle& cliprect, uint16_t* dst, uint8_t* pridst, int realx, int priority, uint8_t pix, uint8_t mask, uint8_t shift, int palette)
-{
- if (realx >= cliprect.min_x && realx <= cliprect.max_x)
- {
- if (pridst[realx] <= priority)
- {
- if (pix & mask)
- {
- dst[realx] = ((pix & mask) >> shift) | palette;
- pridst[realx] = priority;
- }
- }
- }
+ m_vid->video_start();
}
-void elan_eu3a14_state::draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int line, int palette, int flipx, int priority, int xpos, int ypos, int bpp)
-{
- offset = offset * 2;
-
- int bppdiv = 0;
- switch (bpp)
- {
- default:
- case 0x8:
- case 0x7:
- case 0x6:
- case 0x5:
- offset += line * 8;
- bppdiv = 1;
- break;
-
- case 0x4:
- case 0x3:
- offset += line * 4;
- bppdiv = 2;
- break;
-
- case 0x2:
- offset += line * 2;
- bppdiv = 4;
- break;
-
- case 0x1:
- offset += line * 1;
- bppdiv = 8;
- break;
- }
-
- uint8_t* gfxdata = &m_mainregion[offset & 0x3fffff];
-
- if (ypos >= cliprect.min_y && ypos <= cliprect.max_y)
- {
- uint16_t* dst = &bitmap.pix16(ypos);
- uint8_t* pridst = &m_prioritybitmap.pix8(ypos);
-
- int count = 0;
- for (int x = 0; x < 8/bppdiv;x++)
- {
- if (bpp == 8)
- {
- int pix,mask,shift;
- if (flipx) { pix = gfxdata[7 - count]; } else { pix = gfxdata[count]; }
- int realx = xpos + x * 1;
- if (flipx) { mask = 0xff; shift = 0; } else { mask = 0xff; shift = 0; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- }
- else if (bpp == 7)
- {
- int pix,mask,shift;
- if (flipx) { pix = gfxdata[7 - count]; } else { pix = gfxdata[count]; }
- int realx = xpos + x * 1;
- // stride doesn't change, data isn't packed, just don't use top bit
- if (flipx) { mask = 0x7f; shift = 0; } else { mask = 0x7f; shift = 0; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- }
- else if (bpp == 6)
- {
- popmessage("6bpp sprite\n");
- }
- else if (bpp == 5)
- {
- popmessage("5bpp sprite\n");
- }
- else if (bpp == 4)
- {
- int pix,mask,shift;
- if (flipx) { pix = gfxdata[3 - count]; } else { pix = gfxdata[count]; }
- int realx = xpos + x * 2;
- if (flipx) { mask = 0x0f; shift = 0; } else { mask = 0xf0; shift = 4; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- realx++;
- if (flipx) { mask = 0xf0; shift = 4; } else { mask = 0x0f; shift = 0; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- }
- else if (bpp == 3)
- {
- popmessage("3bpp sprite\n");
- }
- else if (bpp == 2)
- {
- int pix,mask,shift;
- if (flipx) { pix = gfxdata[1 - count]; } else { pix = gfxdata[count]; }
- int realx = xpos + x * 4;
- if (flipx) { mask = 0x03; shift = 0; } else { mask = 0xc0; shift = 6; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- realx++;
- if (flipx) { mask = 0x0c; shift = 2; } else { mask = 0x30; shift = 4; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- realx++;
- if (flipx) { mask = 0x30; shift = 4; } else { mask = 0x0c; shift = 2; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- realx++;
- if (flipx) { mask = 0xc0; shift = 6; } else { mask = 0x03; shift = 0; }
- draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
- }
- else if (bpp == 1)
- {
- popmessage("1bpp sprite\n");
- }
-
- count++;
- }
- }
-
-}
-
-
-void elan_eu3a14_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t elan_eu3a14_state::screen_update(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect)
{
- // first 4 sprite entries seem to be garbage sprites, so we start at 0x20
- // likely we're just interpreting them wrong and they're used for blanking things or clipping?
- for (int i = m_spriterambase; i < m_spriterambase + 0x800; i += 8)
- {
- /*
- +0 e-ff hhww flip yx, enable, height, width
- +1 yyyy yyyy ypos
- +2 xxxx xxxx xpos
- +3 pppp Pzzz p = palette, P = upper palette bank, z = priority
- +4 tttt tttt tile bits
- +5 tttt tttt
- +6 --TT TPPP TTT = tile bank PPP = bpp select (+more?)
- +7 ---- ----
-
- */
-
- int attr = m_mainram[i + 0];
- int y = m_mainram[i + 1];
- int x = m_mainram[i + 2];
- int palettepri = m_mainram[i + 3];
-
- int h = attr & 0x0c;
- int w = attr & 0x03;
- int flipx = (attr & 0x10) >> 4;
- int flipy = (attr & 0x20) >> 5;
-
- int height = 0;
- int width = 0;
-
- int pri = palettepri & 0x07;
-
- int palette = ((palettepri & 0xf0) >> 4) | ((palettepri & 0x08) << 1);
- palette = palette << 4;
-
- switch (h)
- {
- case 0x0:height = 2; break;
- case 0x4:height = 4; break;
- case 0x8:height = 8; break;
- case 0xc:height = 16; break;
- }
-
- switch (w)
- {
- case 0x0:width = 1; break;
- case 0x1:width = 2; break;
- case 0x2:width = 4; break;
- case 0x3:width = 8; break;
- }
-
- y -= ((height * 2) - 4);
-
- x -= ((width * 4) - 4);
-
- height *= 4;
-
- x -= 6;
- y -= 4;
-
- int offset = ((m_mainram[i + 5] << 8) + (m_mainram[i + 4] << 0));
- int extra = m_mainram[i + 6];
-
- int spritebase = (m_spritebase[1] << 8) | m_spritebase[0];
-
- offset += (extra & 0xf8) << 13;
- offset += spritebase << 7;
-
- int bpp = extra & 0x07;
- if (bpp == 0)
- bpp = 8;
-
- if (attr & 0x80)
- {
- int count = 0;
- for (int yy = 0; yy < height; yy++)
- {
- int yoff = flipy ? height-1-yy : yy;
-
- for (int xx = 0; xx < width; xx++)
- {
- int xoff = flipx ? (((width - 1) * 8) - (xx * 8)) : (xx * 8);
-
- draw_sprite_line(screen, bitmap, cliprect, offset, count, palette, flipx, pri, x + xoff, y + yoff, bpp);
- count++;
- }
- }
- }
- }
-}
-
-
-
-uint32_t elan_eu3a14_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- m_spriterambase = (m_spriteaddr[0] * 0x200) - 0x200;
-
- bitmap.fill(0, cliprect);
- m_prioritybitmap.fill(0, cliprect);
-
- draw_background(screen, bitmap, cliprect);
-
- draw_sprites(screen, bitmap, cliprect);
-
- return 0;
+ return m_vid->screen_update(screen, bitmap, cliprect);
}
// sound callback
@@ -964,7 +224,7 @@ void elan_eu3a14_state::radica_eu3a14_map(address_map &map)
map(0x0000, 0x01ff).ram();
map(0x0200, 0x3fff).ram().share("mainram"); // 200-9ff is sprites? a00 - ??? is tilemap?
- map(0x4800, 0x4bff).rw(m_commonvid, FUNC(elan_eu3a05commonvid_device::palette_r), FUNC(elan_eu3a05commonvid_device::palette_w));
+ map(0x4800, 0x4bff).rw(m_vid, FUNC(elan_eu3a14vid_device::palette_r), FUNC(elan_eu3a14vid_device::palette_w));
// 5000 - 501f = SYSTEM AREA
@@ -999,14 +259,7 @@ void elan_eu3a14_state::radica_eu3a14_map(address_map &map)
// 5060 - 506e r/w during startup on foot
// sound appears to be the same as eu3a05
- map(0x5080, 0x5091).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_addr_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_addr_w));
- map(0x5092, 0x50a3).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_size_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_size_w));
- map(0x50a4, 0x50a4).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_unk_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_unk_w)); // read frequently on this
- map(0x50a5, 0x50a5).rw(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_trigger_r), FUNC(elan_eu3a05_sound_device::elan_eu3a05_sound_trigger_w));
- map(0x50a6, 0x50a6).nopw(); // startup
- map(0x50a7, 0x50a7).nopw(); // startup
- map(0x50a8, 0x50a8).r(m_sound, FUNC(elan_eu3a05_sound_device::elan_eu3a05_50a8_r));
- map(0x50a9, 0x50a9).nopw(); // startup, read foot
+ map(0x5080, 0x50a9).rw(m_sound, FUNC(elan_eu3a05_sound_device::read), FUNC(elan_eu3a05_sound_device::write));
// video regs are in the 51xx range
@@ -1030,10 +283,11 @@ void elan_eu3a14_state::radica_eu3a14_map(address_map &map)
map(0x5108, 0x5109).ram(); // hnt3, frequently rewrites same values, maybe something to do with raster irq?
// layer specific regs?
- map(0x5110, 0x5115).ram().share("tilecfg");
- map(0x5116, 0x5117).ram().share("rowscrollcfg"); // 00 01 in hnt3 (could just be extra tile config bits, purpose guessed) set to 00 05 in rad_gtg overhead part (no rowscroll)
+ map(0x5110, 0x5115).rw(m_vid, FUNC(elan_eu3a14vid_device::tilecfg_r), FUNC(elan_eu3a14vid_device::tilecfg_w));
+ map(0x5116, 0x5117).rw(m_vid, FUNC(elan_eu3a14vid_device::rowscrollcfg_r), FUNC(elan_eu3a14vid_device::rowscrollcfg_w)); // 00 01 in hnt3 (could just be extra tile config bits, purpose guessed) set to 00 05 in rad_gtg overhead part (no rowscroll)
// 0x5118, 0x5119 not used
- map(0x511a, 0x511e).ram().share("rowscrollsplit"); // hnt3 (60 68 78 90 b8 - rowscroll position list see note below
+ map(0x511a, 0x511e).rw(m_vid, FUNC(elan_eu3a14vid_device::rowscrollsplit_r), FUNC(elan_eu3a14vid_device::rowscrollsplit_w)); // hnt3 (60 68 78 90 b8 - rowscroll position list see note below
+
// register value notes for 511a-511e and how they relate to screen
// 00-6f normal scroll reg
@@ -1043,18 +297,20 @@ void elan_eu3a14_state::radica_eu3a14_map(address_map &map)
// 90-b7 is the 4th
// b8-ff no scroll?
- map(0x5121, 0x5124).ram().share("scrollregs");
- map(0x5125, 0x512c).ram().share("rowscrollregs"); // 4 extra x scroll regs
+ map(0x5121, 0x5124).rw(m_vid, FUNC(elan_eu3a14vid_device::scrollregs_r), FUNC(elan_eu3a14vid_device::scrollregs_w));
+ map(0x5125, 0x512c).rw(m_vid, FUNC(elan_eu3a14vid_device::rowscrollregs_r), FUNC(elan_eu3a14vid_device::rowscrollregs_w)); // 4 extra x scroll regs
// layer specific regs?
- map(0x5140, 0x5145).ram().share("ramtilecfg"); // hnt3
+ map(0x5140, 0x5145).rw(m_vid, FUNC(elan_eu3a14vid_device::ramtilecfg_r), FUNC(elan_eu3a14vid_device::ramtilecfg_w)); // hnt3
map(0x5148, 0x514b).ram(); // hnt3 (always 0 tho?)
// sprite specific regs?
- map(0x5150, 0x5150).ram().share("spriteaddr"); // startup 01 bb3,gtg,rsg, (na) foot 0c hnt3
- map(0x5151, 0x5152).ram().share("spritebase");
+ map(0x5150, 0x5150).rw(m_vid, FUNC(elan_eu3a14vid_device::spriteaddr_r), FUNC(elan_eu3a14vid_device::spriteaddr_w)); // startup 01 bb3,gtg,rsg, (na) foot 0c hnt3
+ map(0x5151, 0x5152).rw(m_vid, FUNC(elan_eu3a14vid_device::spritebase_r), FUNC(elan_eu3a14vid_device::spritebase_w));
map(0x5153, 0x5153).ram(); // startup
+
+
map(0x6000, 0xdfff).m(m_bank, FUNC(address_map_bank_device::amap8));
map(0xe000, 0xffff).rom().region("maincpu", 0x0000);
@@ -1526,8 +782,6 @@ void elan_eu3a14_state::machine_reset()
m_portdir[0] = 0x00;
m_portdir[1] = 0x00;
m_portdir[2] = 0x00;
-
- m_spriteaddr[0] = 0x14; // ?? rad_foot never writes, other games seem to use it to set sprite location
}
@@ -1639,9 +893,13 @@ void elan_eu3a14_state::radica_eu3a14(machine_config &config)
PALETTE(config, m_palette).set_entries(512);
- ELAN_EU3A05_COMMONVID(config, m_commonvid, 0);
- m_commonvid->set_palette("palette");
- m_commonvid->set_entries(512);
+ ELAN_EU3A14_VID(config, m_vid, 0);
+ m_vid->set_cpu("maincpu");
+ m_vid->set_addrbank("bank");
+ m_vid->set_palette("palette");
+ m_vid->set_screen("screen");
+ m_vid->set_entries(512);
+ m_vid->set_tilerambase(0x0200 - 0x200);
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -1649,11 +907,23 @@ void elan_eu3a14_state::radica_eu3a14(machine_config &config)
ELAN_EU3A05_SOUND(config, m_sound, 8000);
m_sound->space_read_callback().set(FUNC(elan_eu3a14_state::read_full_space));
m_sound->add_route(ALL_OUTPUTS, "mono", 1.0);
+ m_sound->sound_end_cb<0>().set(FUNC(elan_eu3a14_state::sound_end0));
+ m_sound->sound_end_cb<1>().set(FUNC(elan_eu3a14_state::sound_end1));
+ m_sound->sound_end_cb<2>().set(FUNC(elan_eu3a14_state::sound_end2));
+ m_sound->sound_end_cb<3>().set(FUNC(elan_eu3a14_state::sound_end3));
+ m_sound->sound_end_cb<4>().set(FUNC(elan_eu3a14_state::sound_end4));
+ m_sound->sound_end_cb<5>().set(FUNC(elan_eu3a14_state::sound_end5));
}
-void elan_eu3a14_state::radica_eu3a14_adc(machine_config &config)
+void elan_eu3a14_state::radica_eu3a14_altrambase(machine_config& config)
{
radica_eu3a14(config);
+ m_vid->set_tilerambase(0x0a00 - 0x200);
+}
+
+void elan_eu3a14_state::radica_eu3a14_altrambase_adc(machine_config &config)
+{
+ radica_eu3a14_altrambase(config);
TIMER(config, "scantimer").configure_scanline(FUNC(elan_eu3a14_state::scanline_cb), "screen", 0, 1);
}
@@ -1666,23 +936,10 @@ void elan_eu3a14_state::radica_eu3a14p(machine_config &config) // TODO, clocks d
subdevice<screen_device>("screen")->set_refresh_hz(50);
}
-
-void elan_eu3a14_state::init_rad_gtg()
-{
- // must be registers to control this
- m_tilerambase = 0x0a00 - 0x200;
-}
-
-void elan_eu3a14_state::init_rad_foot()
-{
- // must be registers to control this
- m_tilerambase = 0x0200 - 0x200;
-}
-
-void elan_eu3a14_state::init_rad_hnt3()
+void elan_eu3a14_state::radica_eu3a14p_altrambase(machine_config& config)
{
- // must be registers to control this
- m_tilerambase = 0x0200 - 0x200;
+ radica_eu3a14p(config);
+ m_vid->set_tilerambase(0x0a00 - 0x200);
}
@@ -1737,20 +994,20 @@ ROM_START( rad_baskp )
ROM_LOAD( "basketball.bin", 0x000000, 0x400000, CRC(7d6ff53c) SHA1(1c75261d55e0107a3b8e8d4c1eb2854750f2d0e8) )
ROM_END
-CONS( 2006, rad_gtg, 0, 0, radica_eu3a14_adc, rad_gtg, elan_eu3a14_state, init_rad_gtg, "Radica / FarSight Studios (licensed from Incredible Technologies)", "Golden Tee Golf: Home Edition", MACHINE_NOT_WORKING )
+CONS( 2006, rad_gtg, 0, 0, radica_eu3a14_altrambase_adc, rad_gtg, elan_eu3a14_state, empty_init, "Radica / FarSight Studios (licensed from Incredible Technologies)", "Golden Tee Golf: Home Edition", MACHINE_NOT_WORKING )
-CONS( 2005, rad_rsg, 0, 0, radica_eu3a14, rad_rsg, elan_eu3a14_state, init_rad_gtg, "Radica / FarSight Studios", "Play TV Real Swing Golf", MACHINE_NOT_WORKING )
+CONS( 2005, rad_rsg, 0, 0, radica_eu3a14_altrambase, rad_rsg, elan_eu3a14_state, empty_init, "Radica / FarSight Studios", "Play TV Real Swing Golf", MACHINE_NOT_WORKING )
// some Connectv branded Real Swing Golf units have a language selection (checksum in test mode confirmed as different on said units)
-CONS( 2005, rad_rsgp, rad_rsg, 0, radica_eu3a14p, rad_rsgp, elan_eu3a14_state, init_rad_gtg, "Radica / FarSight Studios", "Connectv Real Swing Golf", MACHINE_NOT_WORKING )
+CONS( 2005, rad_rsgp, rad_rsg, 0, radica_eu3a14p_altrambase, rad_rsgp, elan_eu3a14_state, empty_init, "Radica / FarSight Studios", "Connectv Real Swing Golf", MACHINE_NOT_WORKING )
// also has a Connectv Real Soccer logo in the roms, apparently unused, maybe that was to be the US title (without the logo being changed to Play TV) but Play TV Soccer ended up being a different game licensed from Epoch instead.
-CONS( 2006, rad_foot, 0, 0, radica_eu3a14p, radica_foot, elan_eu3a14_state, init_rad_foot, "Radica / Medialink", "Connectv Football", MACHINE_NOT_WORKING )
+CONS( 2006, rad_foot, 0, 0, radica_eu3a14p, radica_foot, elan_eu3a14_state, empty_init, "Radica / Medialink", "Connectv Football", MACHINE_NOT_WORKING )
-CONS( 2005, rad_bb3, 0, 0, radica_eu3a14, radica_bb3, elan_eu3a14_state, init_rad_gtg, "Radica / FarSight Studios", "Play TV Baseball 3", MACHINE_NOT_WORKING )
-CONS( 2005, rad_bb3p, rad_bb3, 0, radica_eu3a14p, radica_bb3p, elan_eu3a14_state, init_rad_gtg, "Radica / FarSight Studios", "Connectv Baseball 3", MACHINE_NOT_WORKING )
+CONS( 2005, rad_bb3, 0, 0, radica_eu3a14_altrambase, radica_bb3, elan_eu3a14_state, empty_init, "Radica / FarSight Studios", "Play TV Baseball 3", MACHINE_NOT_WORKING )
+CONS( 2005, rad_bb3p, rad_bb3, 0, radica_eu3a14p_altrambase, radica_bb3p, elan_eu3a14_state, empty_init, "Radica / FarSight Studios", "Connectv Baseball 3", MACHINE_NOT_WORKING )
-CONS( 2005, rad_hnt3, 0, 0, radica_eu3a14, radica_hnt3, elan_eu3a14_state, init_rad_hnt3, "Radica / V-Tac Technology Co Ltd.", "Play TV Huntin' 3", MACHINE_NOT_WORKING )
-CONS( 2005, rad_hnt3p,rad_hnt3, 0, radica_eu3a14p, radica_hnt3p, elan_eu3a14_state, init_rad_hnt3, "Radica / V-Tac Technology Co Ltd.", "Connectv Huntin' 3", MACHINE_NOT_WORKING )
+CONS( 2005, rad_hnt3, 0, 0, radica_eu3a14, radica_hnt3, elan_eu3a14_state, empty_init, "Radica / V-Tac Technology Co Ltd.", "Play TV Huntin' 3", MACHINE_NOT_WORKING )
+CONS( 2005, rad_hnt3p,rad_hnt3, 0, radica_eu3a14p, radica_hnt3p, elan_eu3a14_state, empty_init, "Radica / V-Tac Technology Co Ltd.", "Connectv Huntin' 3", MACHINE_NOT_WORKING )
-CONS( 2005, rad_bask, 0, 0, radica_eu3a14, radica_bask, elan_eu3a14_state, init_rad_gtg, "Radica / FarSight Studios", "Play TV Basketball", MACHINE_NOT_WORKING )
-CONS( 2005, rad_baskp,rad_bask, 0, radica_eu3a14, radica_baskp, elan_eu3a14_state, init_rad_gtg, "Radica / FarSight Studios", "Connectv Basketball", MACHINE_NOT_WORKING )
+CONS( 2005, rad_bask, 0, 0, radica_eu3a14_altrambase, radica_bask, elan_eu3a14_state, empty_init, "Radica / FarSight Studios", "Play TV Basketball", MACHINE_NOT_WORKING )
+CONS( 2005, rad_baskp,rad_bask, 0, radica_eu3a14p_altrambase, radica_baskp, elan_eu3a14_state, empty_init, "Radica / FarSight Studios", "Connectv Basketball", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/gameking.cpp b/src/mame/drivers/gameking.cpp
index f9e3f77bb44..8dd9969ee0f 100644
--- a/src/mame/drivers/gameking.cpp
+++ b/src/mame/drivers/gameking.cpp
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:Peter Trauner
+// copyright-holders:Peter Trauner, AJR
/* TimeTop - GameKing */
/*
PeT mess@utanet.at 2015
@@ -57,6 +57,7 @@ private:
TIMER_CALLBACK_MEMBER(gameking_timer2);
uint32_t screen_update_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_gameking3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
void gameking_mem(address_map &map);
@@ -65,7 +66,7 @@ private:
required_device<cpu_device> m_maincpu;
required_device<generic_slot_device> m_cart;
required_ioport m_io_joy;
- required_device<palette_device> m_palette;
+ optional_device<palette_device> m_palette;
emu_timer *timer1;
emu_timer *timer2;
@@ -100,8 +101,7 @@ void gameking_state::gameking_mem(address_map &map)
void gameking_state::gameking3_mem(address_map &map)
{
map(0x000000, 0x07ffff).rom().region("maincpu", 0);
- map(0x800000, 0x802fff).ram();
- map(0x804800, 0x8048ff).ram();
+ map(0x800000, 0x807fff).ram();
}
@@ -117,6 +117,13 @@ static INPUT_PORTS_START( gameking )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP)
INPUT_PORTS_END
+static INPUT_PORTS_START( gameking3 )
+ PORT_INCLUDE( gameking )
+ PORT_MODIFY("JOY")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START) PORT_NAME("Start")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SELECT) PORT_NAME("Select") //?
+INPUT_PORTS_END
+
static constexpr rgb_t gameking_pens[] =
{
{ 255, 255, 255 },
@@ -153,6 +160,76 @@ uint32_t gameking_state::screen_update_gameking(screen_device &screen, bitmap_in
}
+static constexpr uint8_t gameking3_intensities[] =
+{
+ 0,
+ 127,
+ 191,
+ 255
+};
+
+uint32_t gameking_state::screen_update_gameking3(screen_device& screen, bitmap_rgb32 &bitmap, const rectangle& cliprect)
+{
+ address_space* maincpu_ram = &m_maincpu->space(AS_PROGRAM);
+ offs_t lssa = m_maincpu->state_int(st2xxx_device::ST_LSSA);
+ if (lssa < 0x0080)
+ return 0;
+
+ for (int y = 0, i = 0; i < 80; y += 2, i++)
+ {
+ for (int x = 0, j = 0; j < 40; x += 4, j++)
+ {
+ uint8_t data=maincpu_ram->read_byte(lssa+j+i*40);
+
+ // apply SPRD-C color filter
+ switch (i % 3)
+ {
+ case 0:
+ bitmap.pix32(y, x + 3) = rgb_t(0, gameking3_intensities[data&3], 0);
+ bitmap.pix32(y + 1, x + 2) = rgb_t(gameking3_intensities[(data>>2)&3], 0, 0);
+ bitmap.pix32(y, x + 1) = rgb_t(0, gameking3_intensities[(data>>4)&3], 0);
+ bitmap.pix32(y + 1, x) = rgb_t(gameking3_intensities[(data>>6)&3], 0, 0);
+ break;
+
+ case 1:
+ bitmap.pix32(y, x + 3) = rgb_t(0, 0, gameking3_intensities[data&3]);
+ bitmap.pix32(y + 1, x+2) = rgb_t(0, gameking3_intensities[(data>>2)&3], 0);
+ bitmap.pix32(y, x + 1) = rgb_t(0, 0, gameking3_intensities[(data>>4)&3]);
+ bitmap.pix32(y + 1, x) = rgb_t(0, gameking3_intensities[(data>>6)&3], 0);
+ break;
+
+ case 2:
+ bitmap.pix32(y, x + 3) = rgb_t(gameking3_intensities[data&3], 0, 0);
+ bitmap.pix32(y + 1, x+2) = rgb_t(0, 0, gameking3_intensities[(data>>2)&3]);
+ bitmap.pix32(y, x + 1) = rgb_t(gameking3_intensities[(data>>4)&3], 0, 0);
+ bitmap.pix32(y + 1, x) = rgb_t(0, 0, gameking3_intensities[(data>>6)&3]);
+ break;
+ }
+ }
+ }
+
+ // interpolate values for dots in between
+ for (int y = 0; y < 160; y++)
+ {
+ for (int x = y & 1; x < 160; x += 2)
+ {
+ rgb_t l = rgb_t(x == 0 ? 0 : bitmap.pix32(y, x - 1));
+ rgb_t r = rgb_t(x == 159 ? 0 : bitmap.pix32(y, x + 1));
+ rgb_t u = rgb_t(y == 0 ? 0 : bitmap.pix32(y - 1, x));
+ rgb_t d = rgb_t(y == 159 ? 0 : bitmap.pix32(y + 1, x));
+
+ bitmap.pix32(y, x) = rgb_t(
+ ((u.r() + d.r()) * 2 + l.r() + r.r()) / 3,
+ ((u.g() + d.g()) * 2 + l.g() + r.g()) / 3,
+ ((u.b() + d.b()) * 2 + l.b() + r.b()) / 3
+ );
+ }
+ }
+
+ return 0;
+}
+
+
void gameking_state::init_gameking()
{
timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gameking_state::gameking_timer), this));
@@ -162,7 +239,7 @@ void gameking_state::init_gameking()
TIMER_CALLBACK_MEMBER(gameking_state::gameking_timer)
{
m_maincpu->set_state_int(st2xxx_device::ST_IREQ,
- m_maincpu->state_int(st2xxx_device::ST_IREQ) | (0x016 & m_maincpu->state_int(st2xxx_device::ST_IENA)));
+ m_maincpu->state_int(st2xxx_device::ST_IREQ) | (0x012 & m_maincpu->state_int(st2xxx_device::ST_IENA)));
timer1->enable(false);
timer2->enable(true);
timer2->reset(m_maincpu->cycles_to_attotime(10/*?*/));
@@ -180,7 +257,7 @@ DEVICE_IMAGE_LOAD_MEMBER(gameking_state::cart_load)
{
uint32_t size = m_cart->common_get_size("rom");
- if (size > 0x80000)
+ if (size > 0x100000)
{
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
return image_init_result::FAIL;
@@ -234,7 +311,18 @@ void gameking_state::gameking1(machine_config &config)
void gameking_state::gameking3(machine_config &config)
{
gameking(config);
+ m_maincpu->set_clock(8000000);
m_maincpu->set_addrmap(AS_DATA, &gameking_state::gameking3_mem);
+
+ screen_device &screen(*subdevice<screen_device>("screen"));
+ screen.set_size(160, 160);
+ screen.set_visarea_full();
+ screen.set_physical_aspect(3, 2);
+ screen.set_refresh_hz(39.308176); // ?
+ screen.set_screen_update(FUNC(gameking_state::screen_update_gameking3));
+ screen.set_palette(finder_base::DUMMY_TAG);
+ config.device_remove("palette");
+
SOFTWARE_LIST(config, "cart_list").set_original("gameking");
SOFTWARE_LIST(config, "cart_list_3").set_original("gameking3");
}
@@ -253,6 +341,6 @@ ROM_END
CONS( 2003, gameking, 0, 0, gameking1, gameking, gameking_state, init_gameking, "TimeTop", "GameKing GM-218", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
// the GameKing 2 (GM-219) is probably identical HW
-CONS( 2003, gamekin3, 0, 0, gameking3, gameking, gameking_state, init_gameking, "TimeTop", "GameKing 3", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
+CONS( 2003, gamekin3, 0, 0, gameking3, gameking3, gameking_state, init_gameking, "TimeTop", "GameKing 3", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
// gameking 3: similiar cartridges, accepts gameking cartridges, gameking3 cartridges not working on gameking (illegal cartridge scroller)
// my gameking bios backup solution might work on it
diff --git a/src/mame/drivers/goodejan.cpp b/src/mame/drivers/goodejan.cpp
index 205710e4f29..b37a6c0223d 100644
--- a/src/mame/drivers/goodejan.cpp
+++ b/src/mame/drivers/goodejan.cpp
@@ -83,7 +83,7 @@ Secret menu hack [totmejan only] (I couldn't find official way to enter, so it's
#include "tilemap.h"
-class goodejan_state : public driver_device, protected seibu_sound_common
+class goodejan_state : public driver_device, public seibu_sound_common
{
public:
goodejan_state(const machine_config &mconfig, device_type type, const char *tag) :
diff --git a/src/mame/drivers/hp80.cpp b/src/mame/drivers/hp80.cpp
index af69dc4c11b..ab2ae8aff56 100644
--- a/src/mame/drivers/hp80.cpp
+++ b/src/mame/drivers/hp80.cpp
@@ -17,7 +17,7 @@
#include "sound/dac.h"
#include "sound/volt_reg.h"
#include "machine/1ma6.h"
-#include "bus/hp80_optroms/hp80_optrom.h"
+#include "machine/hp80_optrom.h"
#include "softlist.h"
#include "machine/bankdev.h"
#include "bus/hp80_io/hp80_io.h"
@@ -184,7 +184,7 @@ private:
required_ioport m_io_key1;
required_ioport m_io_key2;
required_ioport m_io_modkeys;
- required_device_array<hp80_optrom_slot_device , 6> m_rom_drawers;
+ required_device_array<hp80_optrom_device , 6> m_rom_drawers;
required_device<address_map_bank_device> m_rombank;
required_device_array<hp80_io_slot_device , IOP_COUNT> m_io_slots;
required_device<bitbanger_device> m_prt_graph_out;
@@ -1365,12 +1365,12 @@ void hp85_state::hp85(machine_config &config)
HP_1MA6(config, "tape", 0);
// Optional ROMs
- HP80_OPTROM_SLOT(config, m_rom_drawers[0]);
- HP80_OPTROM_SLOT(config, m_rom_drawers[1]);
- HP80_OPTROM_SLOT(config, m_rom_drawers[2]);
- HP80_OPTROM_SLOT(config, m_rom_drawers[3]);
- HP80_OPTROM_SLOT(config, m_rom_drawers[4]);
- HP80_OPTROM_SLOT(config, m_rom_drawers[5]);
+ HP80_OPTROM(config, m_rom_drawers[0]);
+ HP80_OPTROM(config, m_rom_drawers[1]);
+ HP80_OPTROM(config, m_rom_drawers[2]);
+ HP80_OPTROM(config, m_rom_drawers[3]);
+ HP80_OPTROM(config, m_rom_drawers[4]);
+ HP80_OPTROM(config, m_rom_drawers[5]);
// I/O slots
HP80_IO_SLOT(config, m_io_slots[0]).set_slot_no(0);
diff --git a/src/mame/drivers/hp9825.cpp b/src/mame/drivers/hp9825.cpp
index b90b60d7431..e6ad8ae4f5e 100644
--- a/src/mame/drivers/hp9825.cpp
+++ b/src/mame/drivers/hp9825.cpp
@@ -43,7 +43,7 @@
#include "machine/timer.h"
#include "machine/hp9825_tape.h"
#include "machine/hp98x5_io_sys.h"
-#include "bus/hp9825_optroms/hp9825_optrom.h"
+#include "machine/hp9825_optrom.h"
#include "bus/hp9845_io/hp9845_io.h"
#include "imagedev/bitbngr.h"
#include "speaker.h"
@@ -128,7 +128,7 @@ protected:
virtual void machine_reset() override;
required_device<hp_09825_67907_cpu_device> m_cpu;
- required_device_array<hp9825_optrom_slot_device , 4> m_rom_drawers;
+ required_device_array<hp9825_optrom_device , 4> m_rom_drawers;
private:
required_device<hp98x5_io_sys_device> m_io_sys;
@@ -681,7 +681,7 @@ void hp9825_state::hp9825_base(machine_config &config)
// Optional ROM slots
for (auto& finder : m_rom_drawers) {
- HP9825_OPTROM_SLOT(config , finder);
+ HP9825_OPTROM(config , finder);
}
config.set_default_layout(layout_hp9825);
diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp
index 9ee599a727b..52a1fc5ab1e 100644
--- a/src/mame/drivers/hp9845.cpp
+++ b/src/mame/drivers/hp9845.cpp
@@ -38,7 +38,7 @@
#include "emu.h"
#include "includes/hp9845.h"
-#include "bus/hp_optroms/hp_optrom.h"
+#include "machine/hp9845_optrom.h"
#include "bus/hp9845_io/hp9845_io.h"
#include "machine/timer.h"
@@ -3701,14 +3701,14 @@ void hp9845_base_state::hp9845_base(machine_config &config)
// right-hand side and left-hand side drawers, respectively.
// Here we do away with the distinction between LPU & PPU ROMs: in the end they
// are visible to both CPUs at the same addresses.
- HP_OPTROM_SLOT(config, "drawer1", 0);
- HP_OPTROM_SLOT(config, "drawer2", 0);
- HP_OPTROM_SLOT(config, "drawer3", 0);
- HP_OPTROM_SLOT(config, "drawer4", 0);
- HP_OPTROM_SLOT(config, "drawer5", 0);
- HP_OPTROM_SLOT(config, "drawer6", 0);
- HP_OPTROM_SLOT(config, "drawer7", 0);
- HP_OPTROM_SLOT(config, "drawer8", 0);
+ HP9845_OPTROM(config, "drawer1", 0);
+ HP9845_OPTROM(config, "drawer2", 0);
+ HP9845_OPTROM(config, "drawer3", 0);
+ HP9845_OPTROM(config, "drawer4", 0);
+ HP9845_OPTROM(config, "drawer5", 0);
+ HP9845_OPTROM(config, "drawer6", 0);
+ HP9845_OPTROM(config, "drawer7", 0);
+ HP9845_OPTROM(config, "drawer8", 0);
// I/O slots
for (unsigned slot = 0; slot < 4; slot++) {
diff --git a/src/mame/drivers/inteladv.cpp b/src/mame/drivers/inteladv.cpp
index 9aa7184f6f7..7e4234e84d3 100644
--- a/src/mame/drivers/inteladv.cpp
+++ b/src/mame/drivers/inteladv.cpp
@@ -45,13 +45,13 @@ INPUT_PORTS_END
void inteladv_state::inteladv(machine_config &config)
{
- ST2205U(config, m_maincpu, 32768 * 122);
+ ST2205U(config, m_maincpu, 4000000);
m_maincpu->set_addrmap(AS_DATA, &inteladv_state::inteladv_map);
}
void inteladv_state::dyndesk(machine_config &config)
{
- ST2204(config, m_maincpu, 32768 * 122);
+ ST2202(config, m_maincpu, 4000000);
m_maincpu->set_addrmap(AS_DATA, &inteladv_state::dyndesk_map);
}
diff --git a/src/mame/drivers/mekd1.cpp b/src/mame/drivers/mekd1.cpp
index d2fc5ad6f8d..601b9dec456 100644
--- a/src/mame/drivers/mekd1.cpp
+++ b/src/mame/drivers/mekd1.cpp
@@ -58,7 +58,7 @@ control codes when loading and 'punching' a tape. TODO perhaps these could
be detected and serial I/O diverted to a cassette.
Code 0x11 DC1 - Tape playback on
Code 0x12 DC2 - Tape record on.
- Code 0x13 DC4 - Tape playback off.
+ Code 0x13 DC3 - Tape playback off.
Code 0x14 DC4 - Tape record off.
The serial bit rate is controlled by a MC14536 timer and is variable. Common
@@ -104,9 +104,9 @@ public:
, m_acia(*this, "acia")
, m_brg(*this, "brg")
, m_rs232(*this, "rs232")
- , m_baud_rate(*this, "baud_rate")
- , m_stop_bits(*this, "stop_bits")
- , m_acia_baud_rate(*this, "acia_baud_rate")
+ , m_baud_rate(*this, "BAUD_RATE")
+ , m_stop_bits(*this, "STOP_BITS")
+ , m_acia_baud_rate(*this, "ACIA_BAUD_RATE")
{ }
void mekd1(machine_config &config);
@@ -186,7 +186,7 @@ void mekd1_state::mem_map(address_map &map)
static INPUT_PORTS_START( mekd1 )
- PORT_START("baud_rate")
+ PORT_START("BAUD_RATE")
PORT_CONFNAME(0x3fff, 416, "RS232 Baud Rate")
PORT_CONFSETTING(9091, "110")
PORT_CONFSETTING(3333, "300")
@@ -197,12 +197,12 @@ static INPUT_PORTS_START( mekd1 )
PORT_CONFSETTING( 139, "7200")
PORT_CONFSETTING( 104, "9600")
- PORT_START("stop_bits")
+ PORT_START("STOP_BITS")
PORT_CONFNAME(0x01, 0, "Stop bits")
PORT_CONFSETTING(0x00, "1")
PORT_CONFSETTING(0x01, "2")
- PORT_START("acia_baud_rate")
+ PORT_START("ACIA_BAUD_RATE")
PORT_CONFNAME(0xf, 1, "ACIA Baud Rate")
PORT_CONFSETTING(13, "110")
PORT_CONFSETTING(11, "150")
@@ -441,8 +441,8 @@ void mekd1_state::mekd1(machine_config &config)
m_pia1->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<1>));
// User ACIA. Available at P2.
- // /CTS is pulled low.
- // /DCD is pulled low.
+ // /CTS is pulled low, but may be driven.
+ // /DCD is pulled low, but may be driven.
ACIA6850(config, m_acia, 0);
m_acia->irq_handler().set("mainirq", FUNC(input_merger_device::in_w<2>));
diff --git a/src/mame/drivers/mekd3.cpp b/src/mame/drivers/mekd3.cpp
index 2d9bed36690..97757e46de3 100644
--- a/src/mame/drivers/mekd3.cpp
+++ b/src/mame/drivers/mekd3.cpp
@@ -150,9 +150,12 @@ public:
, m_acia_cas(*this, "acia_cas")
, m_brg(*this, "brg")
, m_cass(*this, "cassette")
- , m_tx_rate(*this, "tx_baud")
- , m_rx_rate(*this, "rx_baud")
- , m_cas_rate(*this, "cas_rate")
+ , m_console_enable(*this, "CONSOLE_ENABLE")
+ , m_rs232_tx_baud(*this, "RS232_TX_BAUD")
+ , m_rs232_rx_baud(*this, "RS232_RX_BAUD")
+ , m_rs232_cts_route(*this, "RS232_CTS_ROUTE")
+ , m_rs232_dcd_route(*this, "RS232_DCD_ROUTE")
+ , m_cas_baud(*this, "CAS_BAUD")
// MEK68R2
, m_mc6845(*this, "mc6845")
, m_palette(*this, "palette")
@@ -160,9 +163,9 @@ public:
, m_p_chargen(*this, "chargen")
, m_video_ram(*this, "videoram")
, m_r2_pia(*this, "r2_pia")
- , m_r2_mode(*this, "r2_mode")
- , m_r2_display_nationality(*this, "r2_display_nationality")
- , m_r2_display_format(*this, "r2_display_format")
+ , m_r2_mode(*this, "R2_MODE")
+ , m_r2_display_nationality(*this, "R2_DISPLAY_NATIONALITY")
+ , m_r2_display_format(*this, "R2_DISPLAY_FORMAT")
{ }
void mekd3(machine_config &config);
@@ -170,6 +173,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(reset_key_w);
DECLARE_INPUT_CHANGED_MEMBER(keypad_changed);
+ DECLARE_INPUT_CHANGED_MEMBER(rs232_cts_route_change);
+ DECLARE_INPUT_CHANGED_MEMBER(rs232_dcd_route_change);
private:
DECLARE_READ_LINE_MEMBER(keypad_cb1_r);
@@ -207,6 +212,11 @@ private:
// MEK68IO
+ DECLARE_WRITE_LINE_MEMBER(rs232_route_cts);
+ DECLARE_WRITE_LINE_MEMBER(rs232_route_dcd);
+ int m_cts;
+ int m_dcd;
+
// Clocks
DECLARE_WRITE_LINE_MEMBER(write_f1_clock);
DECLARE_WRITE_LINE_MEMBER(write_f2_clock);
@@ -228,9 +238,12 @@ private:
required_device<acia6850_device> m_acia_cas;
required_device<mc14411_device> m_brg;
required_device<cassette_image_device> m_cass;
- required_ioport m_tx_rate;
- required_ioport m_rx_rate;
- required_ioport m_cas_rate;
+ required_ioport m_console_enable;
+ required_ioport m_rs232_tx_baud;
+ required_ioport m_rs232_rx_baud;
+ required_ioport m_rs232_cts_route;
+ required_ioport m_rs232_dcd_route;
+ required_ioport m_cas_baud;
uint8_t m_cass_rx_period, m_cass_txcount;
bool m_cass_in, m_cass_inbit, m_cass_txbit, m_cass_last_txbit;
@@ -366,39 +379,50 @@ static INPUT_PORTS_START(mekd3)
// MEK68IO
- PORT_START("console_enable")
+ PORT_START("CONSOLE_ENABLE")
PORT_DIPNAME(0x01, 0x00, "RS-232 console")
PORT_DIPSETTING(0x01, DEF_STR(On))
PORT_DIPSETTING(0x00, DEF_STR(Off))
// RS232 baud rates available for use at socket 1.
- PORT_START("tx_baud")
+ PORT_START("RS232_TX_BAUD")
PORT_CONFNAME(0x3f, 1, "RS232 TX Baud Rate")
- PORT_CONFSETTING(0x01, "9600")
- PORT_CONFSETTING(0x02, "4800")
- PORT_CONFSETTING(0x04, "3600")
- PORT_CONFSETTING(0x08, "2400")
- PORT_CONFSETTING(0x10, "1200")
- PORT_CONFSETTING(0x20, "600")
- PORT_CONFSETTING(0x40, "300")
PORT_CONFSETTING(0x80, "110")
+ PORT_CONFSETTING(0x40, "300")
+ PORT_CONFSETTING(0x20, "600")
+ PORT_CONFSETTING(0x10, "1200")
+ PORT_CONFSETTING(0x08, "2400")
+ PORT_CONFSETTING(0x04, "3600")
+ PORT_CONFSETTING(0x02, "4800")
+ PORT_CONFSETTING(0x01, "9600")
- PORT_START("rx_baud")
+ PORT_START("RS232_RX_BAUD")
PORT_CONFNAME(0x3f, 1, "RS232 RX Baud Rate")
- PORT_CONFSETTING(0x01, "9600")
- PORT_CONFSETTING(0x02, "4800")
- PORT_CONFSETTING(0x04, "3600")
- PORT_CONFSETTING(0x08, "2400")
- PORT_CONFSETTING(0x10, "1200")
- PORT_CONFSETTING(0x20, "600")
- PORT_CONFSETTING(0x40, "300")
PORT_CONFSETTING(0x80, "110")
+ PORT_CONFSETTING(0x40, "300")
+ PORT_CONFSETTING(0x20, "600")
+ PORT_CONFSETTING(0x10, "1200")
+ PORT_CONFSETTING(0x08, "2400")
+ PORT_CONFSETTING(0x04, "3600")
+ PORT_CONFSETTING(0x02, "4800")
+ PORT_CONFSETTING(0x01, "9600")
+
+ // RS232 CTS and DCD routing at socket 3. These need to be
+ // jumpered low if not driven by the RS232 device.
+ PORT_START("RS232_CTS_ROUTE")
+ PORT_CONFNAME(0x1, 0, "RS232 CTS") PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, rs232_cts_route_change, 0)
+ PORT_CONFSETTING(0, "Jumper Low")
+ PORT_CONFSETTING(1, "Pass Through")
+ PORT_START("RS232_DCD_ROUTE")
+ PORT_CONFNAME(0x1, 0, "RS232 DCD") PORT_CHANGED_MEMBER(DEVICE_SELF, mekd3_state, rs232_dcd_route_change, 0)
+ PORT_CONFSETTING(0, "Jumper Low")
+ PORT_CONFSETTING(1, "Pass Through")
// A mechanical switch at the edge of the board set the cassette baud
// rate. The software could not control or read this rate setting and
// since D3BUG used a different format for 1200 baud it had to promote
// for the rate too.
- PORT_START("cas_rate")
+ PORT_START("CAS_BAUD")
PORT_CONFNAME(0x01, 0, "Cassette Baud Rate")
PORT_CONFSETTING(0x1, "1200")
PORT_CONFSETTING(0x0, "300")
@@ -406,17 +430,17 @@ static INPUT_PORTS_START(mekd3)
// MEK68R2
- PORT_START("r2_mode")
+ PORT_START("R2_MODE")
PORT_DIPNAME(0x1, 0, "R2 Mode")
PORT_DIPSETTING(0, "Normal")
PORT_DIPSETTING(1, "Dumb terminal")
- PORT_START("r2_display_nationality")
+ PORT_START("R2_DISPLAY_NATIONALITY")
PORT_DIPNAME(0x1, 1, "Display nationality")
PORT_DIPSETTING(0, "US")
PORT_DIPSETTING(1, "Europe")
- PORT_START("r2_display_format")
+ PORT_START("R2_DISPLAY_FORMAT")
PORT_DIPNAME(0x0003, 2, "Display format")
PORT_DIPSETTING(0, "16 lines of 32 characters")
PORT_DIPSETTING(1, "16 lines of 64 characters")
@@ -541,75 +565,109 @@ WRITE8_MEMBER(mekd3_state::led_digit_w)
************************************************************/
+WRITE_LINE_MEMBER(mekd3_state::rs232_route_cts)
+{
+ if (m_rs232_cts_route->read())
+ m_acia_io1->write_cts(state);
+
+ // Cache the state, in case the ioport setting changes.
+ m_cts = state;
+}
+
+WRITE_LINE_MEMBER(mekd3_state::rs232_route_dcd)
+{
+ if (m_rs232_dcd_route->read())
+ m_acia_io1->write_dcd(state);
+
+ // Cache the state, in case the ioport setting changes.
+ m_dcd = state;
+}
+
+INPUT_CHANGED_MEMBER(mekd3_state::rs232_cts_route_change)
+{
+ if (newval)
+ m_acia_io1->write_cts(m_cts);
+ else
+ m_acia_io1->write_cts(0);
+}
+
+INPUT_CHANGED_MEMBER(mekd3_state::rs232_dcd_route_change)
+{
+ if (newval)
+ m_acia_io1->write_dcd(m_dcd);
+ else
+ m_acia_io1->write_dcd(0);
+}
+
WRITE_LINE_MEMBER(mekd3_state::write_f1_clock)
{
- if (BIT(m_tx_rate->read(), 0))
+ if (BIT(m_rs232_tx_baud->read(), 0))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 0))
+ if (BIT(m_rs232_rx_baud->read(), 0))
m_acia_io1->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd3_state::write_f2_clock)
{
- if (BIT(m_tx_rate->read(), 1))
+ if (BIT(m_rs232_tx_baud->read(), 1))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 1))
+ if (BIT(m_rs232_rx_baud->read(), 1))
m_acia_io1->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd3_state::write_f4_clock)
{
- if (BIT(m_tx_rate->read(), 2))
+ if (BIT(m_rs232_tx_baud->read(), 2))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 2))
+ if (BIT(m_rs232_rx_baud->read(), 2))
m_acia_io1->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd3_state::write_f5_clock)
{
- if (BIT(m_tx_rate->read(), 3))
+ if (BIT(m_rs232_tx_baud->read(), 3))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 3))
+ if (BIT(m_rs232_rx_baud->read(), 3))
m_acia_io1->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd3_state::write_f7_clock)
{
- if (BIT(m_tx_rate->read(), 4))
+ if (BIT(m_rs232_tx_baud->read(), 4))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 4))
+ if (BIT(m_rs232_rx_baud->read(), 4))
m_acia_io1->write_rxc(state);
// 1200 baud also drives the cassette ACIA
- if (m_cas_rate->read() == 1)
+ if (m_cas_baud->read() == 1)
acia_cas_clock1200_w(state);
}
WRITE_LINE_MEMBER(mekd3_state::write_f8_clock)
{
- if (BIT(m_tx_rate->read(), 5))
+ if (BIT(m_rs232_tx_baud->read(), 5))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 5))
+ if (BIT(m_rs232_rx_baud->read(), 5))
m_acia_io1->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd3_state::write_f9_clock)
{
- if (BIT(m_tx_rate->read(), 6))
+ if (BIT(m_rs232_tx_baud->read(), 6))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 6))
+ if (BIT(m_rs232_rx_baud->read(), 6))
m_acia_io1->write_rxc(state);
// 300 baud also drives the cassette ACIA
- if (m_cas_rate->read() == 0)
+ if (m_cas_baud->read() == 0)
acia_cas_clock300_w(state);
}
WRITE_LINE_MEMBER(mekd3_state::write_f13_clock)
{
- if (BIT(m_tx_rate->read(), 7))
+ if (BIT(m_rs232_tx_baud->read(), 7))
m_acia_io1->write_txc(state);
- if (BIT(m_rx_rate->read(), 7))
+ if (BIT(m_rs232_rx_baud->read(), 7))
m_acia_io1->write_rxc(state);
}
@@ -693,7 +751,7 @@ WRITE_LINE_MEMBER(mekd3_state::acia_cas_clock1200_w)
READ8_MEMBER(mekd3_state::pia_io2a_r)
{
- uint32_t console_enable = ioport("console_enable")->read();
+ uint32_t console_enable = m_console_enable->read();
// bit 1 (0x02) is a jumper to set RS232 terminal mode when set.
@@ -842,6 +900,22 @@ void mekd3_state::machine_start()
{
uint8_t* RAM = m_ram->pointer();
m_ram_bank->configure_entries(0, 8, RAM, 0x8000);
+
+ save_item(NAME(m_rom_page));
+ save_item(NAME(m_ram_page));
+ save_item(NAME(m_trace));
+ save_item(NAME(m_segment));
+ save_item(NAME(m_digit));
+ save_item(NAME(m_cts));
+ save_item(NAME(m_dcd));
+ save_item(NAME(m_cass_rx_period));
+ save_item(NAME(m_cass_txcount));
+ save_item(NAME(m_cass_in));
+ save_item(NAME(m_cass_inbit));
+ save_item(NAME(m_cass_txbit));
+ save_item(NAME(m_cass_last_txbit));
+ save_item(NAME(m_term_data));
+ save_item(NAME(m_r2_vsync));
}
void mekd3_state::machine_reset()
@@ -863,6 +937,19 @@ void mekd3_state::machine_reset()
m_cass_txcount = 0;
m_cass_in = 0;
m_cass_inbit = 0;
+
+ // Write low here if jumpered low.
+ if (!m_rs232_cts_route->read())
+ m_acia_io1->write_cts(0);
+ if (!m_rs232_dcd_route->read())
+ m_acia_io1->write_dcd(0);
+
+ // MEK68R2
+ m_r2_pia->ca1_w(ASSERT_LINE);
+ m_r2_pia->ca2_w(ASSERT_LINE);
+ m_r2_vsync = 0;
+ m_r2_pia->cb1_w(m_r2_vsync);
+ m_r2_pia->cb2_w(0);
}
/***********************************************************
@@ -887,8 +974,8 @@ void mekd3_state::mekd3(machine_config &config)
RAM(config, m_ram).set_default_size("256K").set_default_value(0);
- INPUT_MERGER_ANY_HIGH(config, "mainirq").output_handler().set_inputline(m_maincpu, M6802_IRQ_LINE);
- INPUT_MERGER_ANY_HIGH(config, "mainnmi").output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ INPUT_MERGER_ANY_HIGH(config, m_mainirq).output_handler().set_inputline(m_maincpu, M6802_IRQ_LINE);
+ INPUT_MERGER_ANY_HIGH(config, m_mainnmi).output_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
// LED display
PWM_DISPLAY(config, m_display).set_size(8, 7);
@@ -909,21 +996,21 @@ void mekd3_state::mekd3(machine_config &config)
m_kpd_pia->writepa_handler().set(FUNC(mekd3_state::led_segment_w));
m_kpd_pia->writepb_handler().set(FUNC(mekd3_state::led_digit_w));
m_kpd_pia->readca1_handler().set(FUNC(mekd3_state::trace_timer_r));
- m_kpd_pia->irqa_handler().set("mainnmi", FUNC(input_merger_device::in_w<0>));
- m_kpd_pia->irqb_handler().set("mainnmi", FUNC(input_merger_device::in_w<1>));
+ m_kpd_pia->irqa_handler().set(m_mainnmi, FUNC(input_merger_device::in_w<0>));
+ m_kpd_pia->irqb_handler().set(m_mainnmi, FUNC(input_merger_device::in_w<1>));
// CP1, CP2, /CTG, /CTC are available at SK1, and not used here.
MC6846(config, m_mc6846, XTAL_MEKD3 / 4); // Same as the cpu clock
m_mc6846->out_port().set(FUNC(mekd3_state::page_w));
m_mc6846->cto().set(FUNC(mekd3_state::trace_timer_w));
- m_mc6846->irq().set("mainirq", FUNC(input_merger_device::in_w<0>));
+ m_mc6846->irq().set(m_mainirq, FUNC(input_merger_device::in_w<0>));
// MEK68IO
// A 'user' PIA, I/O available at SK6.
PIA6821(config, m_pia_io1, 0);
- m_pia_io1->irqa_handler().set("mainnmi", FUNC(input_merger_device::in_w<2>));
- m_pia_io1->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<1>));
+ m_pia_io1->irqa_handler().set(m_mainnmi, FUNC(input_merger_device::in_w<2>));
+ m_pia_io1->irqb_handler().set(m_mainirq, FUNC(input_merger_device::in_w<1>));
// Largely a 'user' PIA, I/O available at SK5.
// PA0 can optionally be an audio bit input, at TP1.
@@ -931,14 +1018,15 @@ void mekd3_state::mekd3(machine_config &config)
// PA2 can optionally be an audio bit output, at TP2.
PIA6821(config, m_pia_io2, 0);
m_pia_io2->readpa_handler().set(FUNC(mekd3_state::pia_io2a_r));
- m_pia_io2->irqa_handler().set("mainirq", FUNC(input_merger_device::in_w<2>));
- m_pia_io2->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<3>));
+ m_pia_io2->irqa_handler().set(m_mainirq, FUNC(input_merger_device::in_w<2>));
+ m_pia_io2->irqb_handler().set(m_mainirq, FUNC(input_merger_device::in_w<3>));
// RS232 ACIA
// /RTS, /CTS and /DCD are available at SK3.
ACIA6850(config, m_acia_io1, 0);
m_acia_io1->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
- m_acia_io1->irq_handler().set("mainirq", FUNC(input_merger_device::in_w<4>));
+ m_acia_io1->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
+ m_acia_io1->irq_handler().set(m_mainirq, FUNC(input_merger_device::in_w<4>));
MC14411(config, m_brg, XTAL(1'843'200));
m_brg->out_f<1>().set(FUNC(mekd3_state::write_f1_clock));
@@ -952,13 +1040,15 @@ void mekd3_state::mekd3(machine_config &config)
rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
rs232.rxd_handler().set(m_acia_io1, FUNC(acia6850_device::write_rxd));
+ rs232.cts_handler().set(FUNC(mekd3_state::rs232_route_cts));
+ rs232.dcd_handler().set(FUNC(mekd3_state::rs232_route_dcd));
rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));
// /RTS is available at SK2.
// /CTS and /DCD are available at SK2, or can be jumpered low.
ACIA6850(config, m_acia_cas, 0);
m_acia_cas->txd_handler().set([this] (bool state) { m_cass_txbit = state; });
- m_acia_cas->irq_handler().set("mainirq", FUNC(input_merger_device::in_w<5>));
+ m_acia_cas->irq_handler().set(m_mainirq, FUNC(input_merger_device::in_w<5>));
TIMER(config, "kansas_r").configure_periodic(FUNC(mekd3_state::kansas_r), attotime::from_hz(40000));
@@ -974,7 +1064,8 @@ void mekd3_state::mekd3(machine_config &config)
PALETTE(config, m_palette, palette_device::MONOCHROME_HIGHLIGHT);
MC6845(config, m_mc6845, XTAL(14'318'181)/8);
- m_mc6845->set_screen("screen");
+ m_mc6845->set_screen(m_screen);
+ //
m_mc6845->set_show_border_area(false);
m_mc6845->set_char_width(8);
m_mc6845->set_update_row_callback(FUNC(mekd3_state::update_row));
@@ -990,8 +1081,8 @@ void mekd3_state::mekd3(machine_config &config)
m_r2_pia->readpa_handler().set(FUNC(mekd3_state::r2_pia_pa_r));
m_r2_pia->readpb_handler().set(FUNC(mekd3_state::r2_pia_pb_r));
m_r2_pia->readcb1_handler().set(FUNC(mekd3_state::r2_pia_cb1_r));
- m_r2_pia->irqa_handler().set("mainirq", FUNC(input_merger_device::in_w<6>));
- m_r2_pia->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<7>));
+ m_r2_pia->irqa_handler().set(m_mainirq, FUNC(input_merger_device::in_w<6>));
+ m_r2_pia->irqb_handler().set(m_mainirq, FUNC(input_merger_device::in_w<7>));
generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
keyboard.set_keyboard_callback(FUNC(mekd3_state::kbd_put));
diff --git a/src/mame/drivers/mekd4.cpp b/src/mame/drivers/mekd4.cpp
index 2fa8507faa1..3a77846d955 100644
--- a/src/mame/drivers/mekd4.cpp
+++ b/src/mame/drivers/mekd4.cpp
@@ -274,11 +274,13 @@ public:
, m_display(*this, "display")
, m_user_pia(*this, "user_pia")
, m_brg(*this, "brg")
- , m_tx_rate(*this, "tx_baud")
- , m_rx_rate(*this, "rx_baud")
+ , m_rs232_tx_baud(*this, "RS232_TX_BAUD")
+ , m_rs232_rx_baud(*this, "RS232_RX_BAUD")
+ , m_rs232_cts_route(*this, "RS232_CTS_ROUTE")
+ , m_rs232_dcd_route(*this, "RS232_DCD_ROUTE")
, m_acia(*this, "acia")
, m_cass(*this, "cassette")
- , m_jumper1(*this, "jumper1")
+ , m_jumper1(*this, "JUMPER1")
, m_keypad_columns(*this, "COL%u", 0)
// MEK68R2
, m_mc6845(*this, "mc6845")
@@ -287,9 +289,9 @@ public:
, m_p_chargen(*this, "chargen")
, m_video_ram(*this, "videoram")
, m_r2_pia(*this, "r2_pia")
- , m_r2_mode(*this, "r2_mode")
- , m_r2_display_nationality(*this, "r2_display_nationality")
- , m_r2_display_format(*this, "r2_display_format")
+ , m_r2_mode(*this, "R2_MODE")
+ , m_r2_display_nationality(*this, "R2_DISPLAY_NATIONALITY")
+ , m_r2_display_format(*this, "R2_DISPLAY_FORMAT")
{ }
void mekd4(machine_config &config);
@@ -297,6 +299,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(reset_key_w);
DECLARE_INPUT_CHANGED_MEMBER(keypad_changed);
+ DECLARE_INPUT_CHANGED_MEMBER(rs232_cts_route_change);
+ DECLARE_INPUT_CHANGED_MEMBER(rs232_dcd_route_change);
private:
DECLARE_READ8_MEMBER(main_r);
@@ -310,6 +314,9 @@ private:
DECLARE_READ_LINE_MEMBER(stop_pia_ca2_r);
uint16_t m_stop_address;
+ DECLARE_WRITE_LINE_MEMBER(rs232_route_cts);
+ DECLARE_WRITE_LINE_MEMBER(rs232_route_dcd);
+
// Clocks
DECLARE_WRITE_LINE_MEMBER(write_f1_clock);
DECLARE_WRITE_LINE_MEMBER(write_f3_clock);
@@ -337,11 +344,8 @@ private:
uint8_t m_rom_page; // aka ROP0, ROP1, ROP2
uint8_t m_ram_page; // aka RAP0, RAP1, RAP2
- uint8_t m_cass_data[4];
uint8_t m_segment;
uint8_t m_digit;
- bool m_cassbit;
- bool m_cassold;
virtual void machine_start() override;
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
@@ -351,12 +355,16 @@ private:
required_device<pwm_display_device> m_display;
required_device<pia6821_device> m_user_pia;
required_device<mc14411_device> m_brg;
- required_ioport m_tx_rate;
- required_ioport m_rx_rate;
+ required_ioport m_rs232_tx_baud;
+ required_ioport m_rs232_rx_baud;
+ required_ioport m_rs232_cts_route;
+ required_ioport m_rs232_dcd_route;
required_device<acia6850_device> m_acia;
required_device<cassette_image_device> m_cass;
required_ioport m_jumper1;
required_ioport_array<4> m_keypad_columns;
+ int m_cts;
+ int m_dcd;
// MEK68R2
MC6845_UPDATE_ROW(update_row);
@@ -428,7 +436,7 @@ void mekd4_state::mekd4_mem(address_map &map)
static INPUT_PORTS_START(mekd4)
- PORT_START("jumper1")
+ PORT_START("JUMPER1")
PORT_DIPNAME(0x01, 0x00, "RS-232 console (D4B)")
PORT_DIPSETTING(0x00, DEF_STR(On))
PORT_DIPSETTING(0x01, DEF_STR(Off))
@@ -442,23 +450,35 @@ static INPUT_PORTS_START(mekd4)
PORT_DIPSETTING(0x00, DEF_STR(On))
PORT_DIPSETTING(0x08, DEF_STR(Off))
- PORT_START("tx_baud")
+ PORT_START("RS232_TX_BAUD")
PORT_CONFNAME(0x3f, 1, "RS232 TX Baud Rate")
- PORT_CONFSETTING(0x01, "9600")
- PORT_CONFSETTING(0x02, "4800")
- PORT_CONFSETTING(0x04, "1200")
- PORT_CONFSETTING(0x08, "600")
- PORT_CONFSETTING(0x10, "300")
PORT_CONFSETTING(0x20, "110")
+ PORT_CONFSETTING(0x10, "300")
+ PORT_CONFSETTING(0x08, "600")
+ PORT_CONFSETTING(0x04, "1200")
+ PORT_CONFSETTING(0x02, "4800")
+ PORT_CONFSETTING(0x01, "9600")
- PORT_START("rx_baud")
+ PORT_START("RS232_RX_BAUD")
PORT_CONFNAME(0x3f, 1, "RS232 RX Baud Rate")
- PORT_CONFSETTING(0x01, "9600")
- PORT_CONFSETTING(0x02, "4800")
- PORT_CONFSETTING(0x04, "1200")
- PORT_CONFSETTING(0x08, "600")
- PORT_CONFSETTING(0x10, "300")
PORT_CONFSETTING(0x20, "110")
+ PORT_CONFSETTING(0x10, "300")
+ PORT_CONFSETTING(0x08, "600")
+ PORT_CONFSETTING(0x04, "1200")
+ PORT_CONFSETTING(0x02, "4800")
+ PORT_CONFSETTING(0x01, "9600")
+
+ // RS232 CTS and DCD routing at the RS232 Conn. These need to be
+ // jumpered to logical low if not driven by the RS232 device. There is
+ // +12 and -12V available at this connector for this purpose.
+ PORT_START("RS232_CTS_ROUTE")
+ PORT_CONFNAME(0x1, 0, "RS232 CTS") PORT_CHANGED_MEMBER(DEVICE_SELF, mekd4_state, rs232_cts_route_change, 0)
+ PORT_CONFSETTING(0, "Jumper low")
+ PORT_CONFSETTING(1, "Pass through")
+ PORT_START("RS232_DCD_ROUTE")
+ PORT_CONFNAME(0x1, 0, "RS232 DCD") PORT_CHANGED_MEMBER(DEVICE_SELF, mekd4_state, rs232_dcd_route_change, 0)
+ PORT_CONFSETTING(0, "Jumper low")
+ PORT_CONFSETTING(1, "Pass through")
// RESET is not wired to the key matrix.
PORT_START("RESET")
@@ -504,17 +524,17 @@ static INPUT_PORTS_START(mekd4)
// MEK68R2
- PORT_START("r2_mode")
+ PORT_START("R2_MODE")
PORT_DIPNAME(0x1, 0, "R2 Mode")
PORT_DIPSETTING(0, "Normal")
PORT_DIPSETTING(1, "Dumb terminal")
- PORT_START("r2_display_nationality")
+ PORT_START("R2_DISPLAY_NATIONALITY")
PORT_DIPNAME(0x1, 1, "Display nationality")
PORT_DIPSETTING(0, "US")
PORT_DIPSETTING(1, "Europe")
- PORT_START("r2_display_format")
+ PORT_START("R2_DISPLAY_FORMAT")
PORT_DIPNAME(0x0003, 2, "Display format")
PORT_DIPSETTING(0, "16 lines of 32 characters")
PORT_DIPSETTING(1, "16 lines of 64 characters")
@@ -660,7 +680,6 @@ WRITE8_MEMBER(mekd4_state::led_digit_w)
m_display->matrix(m_digit, ~m_segment);
// Update the keypad pressed output which depends on m_digit.
m_kpd_pia->cb1_w(mekd4_state::keypad_key_pressed());
-
}
@@ -683,55 +702,89 @@ WRITE_LINE_MEMBER(mekd4_state::stop_pia_cb2_w)
/***********************************************************
- ACIA clocks
+ ACIA
************************************************************/
+WRITE_LINE_MEMBER(mekd4_state::rs232_route_cts)
+{
+ if (m_rs232_cts_route->read())
+ m_acia->write_cts(state);
+
+ // Cache the state, in case the ioport setting changes.
+ m_cts = state;
+}
+
+WRITE_LINE_MEMBER(mekd4_state::rs232_route_dcd)
+{
+ if (m_rs232_dcd_route->read())
+ m_acia->write_dcd(state);
+
+ // Cache the state, in case the ioport setting changes.
+ m_dcd = state;
+}
+
+INPUT_CHANGED_MEMBER(mekd4_state::rs232_cts_route_change)
+{
+ if (newval)
+ m_acia->write_cts(m_cts);
+ else
+ m_acia->write_cts(0);
+}
+
+INPUT_CHANGED_MEMBER(mekd4_state::rs232_dcd_route_change)
+{
+ if (newval)
+ m_acia->write_dcd(m_dcd);
+ else
+ m_acia->write_dcd(0);
+}
+
WRITE_LINE_MEMBER(mekd4_state::write_f1_clock)
{
- if (BIT(m_tx_rate->read(), 0))
+ if (BIT(m_rs232_tx_baud->read(), 0))
m_acia->write_txc(state);
- if (BIT(m_rx_rate->read(), 0))
+ if (BIT(m_rs232_rx_baud->read(), 0))
m_acia->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd4_state::write_f3_clock)
{
- if (BIT(m_tx_rate->read(), 1))
+ if (BIT(m_rs232_tx_baud->read(), 1))
m_acia->write_txc(state);
- if (BIT(m_rx_rate->read(), 1))
+ if (BIT(m_rs232_rx_baud->read(), 1))
m_acia->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd4_state::write_f7_clock)
{
- if (BIT(m_tx_rate->read(), 2))
+ if (BIT(m_rs232_tx_baud->read(), 2))
m_acia->write_txc(state);
- if (BIT(m_rx_rate->read(), 2))
+ if (BIT(m_rs232_rx_baud->read(), 2))
m_acia->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd4_state::write_f8_clock)
{
- if (BIT(m_tx_rate->read(), 3))
+ if (BIT(m_rs232_tx_baud->read(), 3))
m_acia->write_txc(state);
- if (BIT(m_rx_rate->read(), 3))
+ if (BIT(m_rs232_rx_baud->read(), 3))
m_acia->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd4_state::write_f9_clock)
{
- if (BIT(m_tx_rate->read(), 4))
+ if (BIT(m_rs232_tx_baud->read(), 4))
m_acia->write_txc(state);
- if (BIT(m_rx_rate->read(), 4))
+ if (BIT(m_rs232_rx_baud->read(), 4))
m_acia->write_rxc(state);
}
WRITE_LINE_MEMBER(mekd4_state::write_f13_clock)
{
- if (BIT(m_tx_rate->read(), 5))
+ if (BIT(m_rs232_tx_baud->read(), 5))
m_acia->write_txc(state);
- if (BIT(m_rx_rate->read(), 5))
+ if (BIT(m_rs232_rx_baud->read(), 5))
m_acia->write_rxc(state);
}
@@ -869,6 +922,16 @@ void mekd4_state::init_mekd4()
void mekd4_state::machine_start()
{
m_banked_space = &subdevice<address_map_bank_device>("bankdev")->space(AS_PROGRAM);
+
+ save_item(NAME(m_stop_address));
+ save_item(NAME(m_rom_page));
+ save_item(NAME(m_ram_page));
+ save_item(NAME(m_segment));
+ save_item(NAME(m_digit));
+ save_item(NAME(m_cts));
+ save_item(NAME(m_dcd));
+ save_item(NAME(m_term_data));
+ save_item(NAME(m_r2_vsync));
}
void mekd4_state::machine_reset()
@@ -887,6 +950,12 @@ void mekd4_state::machine_reset()
m_brg->rsa_w(CLEAR_LINE);
m_brg->rsb_w(ASSERT_LINE);
+ // Write low here if jumpered low.
+ if (!m_rs232_cts_route->read())
+ m_acia->write_cts(0);
+ if (!m_rs232_dcd_route->read())
+ m_acia->write_dcd(0);
+
// MEK68R2
m_r2_pia->ca1_w(ASSERT_LINE);
m_r2_pia->ca2_w(ASSERT_LINE);
@@ -939,6 +1008,7 @@ void mekd4_state::mekd4(machine_config &config)
// IRQ is not connected. RTS, CTS, and DCD are available.
ACIA6850(config, m_acia, 0);
m_acia->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
+ m_acia->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
MC14411(config, m_brg, XTAL(1'843'200));
m_brg->out_f<1>().set(FUNC(mekd4_state::write_f1_clock));
@@ -950,6 +1020,8 @@ void mekd4_state::mekd4(machine_config &config)
rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
rs232.rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd));
+ rs232.cts_handler().set(FUNC(mekd4_state::rs232_route_cts));
+ rs232.dcd_handler().set(FUNC(mekd4_state::rs232_route_dcd));
rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));
// Stop PIA. IRQB is NC.
@@ -986,7 +1058,7 @@ void mekd4_state::mekd4(machine_config &config)
PALETTE(config, m_palette, palette_device::MONOCHROME_HIGHLIGHT);
MC6845(config, m_mc6845, XTAL(14'318'181)/8);
- m_mc6845->set_screen("screen");
+ m_mc6845->set_screen(m_screen);
m_mc6845->set_show_border_area(false);
m_mc6845->set_char_width(8);
m_mc6845->set_update_row_callback(FUNC(mekd4_state::update_row));
diff --git a/src/mame/drivers/mekd5.cpp b/src/mame/drivers/mekd5.cpp
index 3c0eeb521c2..00295a92d92 100644
--- a/src/mame/drivers/mekd5.cpp
+++ b/src/mame/drivers/mekd5.cpp
@@ -106,7 +106,7 @@ public:
, m_user_pia(*this, "user_pia")
, m_display(*this, "display")
, m_brg(*this, "brg")
- , m_baud_rate(*this, "baud_rate")
+ , m_baud_rate(*this, "BAUD_RATE")
, m_acia(*this, "acia")
, m_cass(*this, "cassette")
, m_keypad_columns(*this, "COL%u", 0)
@@ -223,14 +223,14 @@ static INPUT_PORTS_START(mekd5)
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CHANGED_MEMBER(DEVICE_SELF, mekd5_state, keypad_changed, 0) PORT_NAME("D") PORT_CODE(KEYCODE_D)
/* RS232 baud rates available via J5. */
- PORT_START("baud_rate")
+ PORT_START("BAUD_RATE")
PORT_CONFNAME(0x3f, 1, "RS232 Baud Rate")
- PORT_CONFSETTING(0x01, "9600")
- PORT_CONFSETTING(0x02, "4800")
- PORT_CONFSETTING(0x04, "2400")
- PORT_CONFSETTING(0x08, "1200")
- PORT_CONFSETTING(0x10, "300")
PORT_CONFSETTING(0x20, "110")
+ PORT_CONFSETTING(0x10, "300")
+ PORT_CONFSETTING(0x08, "1200")
+ PORT_CONFSETTING(0x04, "2400")
+ PORT_CONFSETTING(0x02, "4800")
+ PORT_CONFSETTING(0x01, "9600")
INPUT_PORTS_END
@@ -423,6 +423,8 @@ void mekd5_state::init_mekd5()
void mekd5_state::machine_start()
{
+ save_item(NAME(m_segment));
+ save_item(NAME(m_digit));
}
void mekd5_state::machine_reset()
diff --git a/src/mame/drivers/mtx.cpp b/src/mame/drivers/mtx.cpp
index bc802a49a75..072489908d3 100644
--- a/src/mame/drivers/mtx.cpp
+++ b/src/mame/drivers/mtx.cpp
@@ -269,15 +269,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(mtx_state::cassette_tick)
}
}
-/*-------------------------------------------------
- mtx_tms9928a_interface
--------------------------------------------------*/
-
-WRITE_LINE_MEMBER(mtx_state::mtx_tms9929a_interrupt)
-{
- m_z80ctc->trg0(state ? 0 : 1);
-}
-
/***************************************************************************
MACHINE DRIVERS
***************************************************************************/
@@ -298,7 +289,7 @@ void mtx_state::mtx512(machine_config &config)
tms9929a_device &vdp(TMS9929A(config, "tms9929a", 10.6875_MHz_XTAL));
vdp.set_screen("screen");
vdp.set_vram_size(0x4000);
- vdp.int_callback().set(FUNC(mtx_state::mtx_tms9929a_interrupt));
+ vdp.int_callback().set(m_z80ctc, FUNC(z80ctc_device::trg0)).invert();
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
/* sound hardware */
diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp
index e9d467b4ade..da96f976704 100644
--- a/src/mame/drivers/nes_vt.cpp
+++ b/src/mame/drivers/nes_vt.cpp
@@ -88,40 +88,50 @@ enum class vt_scramble_mode {
class nes_vt_state : public nes_base_state
{
public:
- nes_vt_state(const machine_config &mconfig, device_type type, const char *tag)
- : nes_base_state(mconfig, type, tag)
- , m_ntram(nullptr)
- , m_chrram(nullptr)
- , m_screen(*this, "screen")
- , m_ppu(*this, "ppu")
- , m_apu(*this, "apu")
- , m_prg(*this, "prg")
- , m_prgbank0(*this, "prg_bank0")
- , m_prgbank1(*this, "prg_bank1")
- , m_prgbank2(*this, "prg_bank2")
- , m_prgbank3(*this, "prg_bank3")
- , m_prgrom(*this, "mainrom")
- , m_csel(*this, "CARTSEL")
- { }
-
- void nes_vt_base(machine_config &config);
-
- void nes_vt(machine_config &config);
- void nes_vt_ddr(machine_config &config);
-
- void nes_vt_hum(machine_config &config);
- void nes_vt_pjoy(machine_config &config);
- void nes_vt_sp69(machine_config &config);
- void nes_vt_ablping(machine_config &config);
-
- void nes_vt_xx(machine_config &config);
- void nes_vt_hh(machine_config &config);
- void nes_vt_cy(machine_config &config);
- void nes_vt_dg(machine_config &config);
- void nes_vt_bt(machine_config &config);
- void nes_vt_vg(machine_config &config);
- void nes_vt_fp(machine_config &config);
- void nes_vt_fa(machine_config &config);
+ nes_vt_state(const machine_config& mconfig, device_type type, const char* tag) :
+ nes_base_state(mconfig, type, tag),
+ m_screen(*this, "screen"),
+ m_ppu(*this, "ppu"),
+ m_ntram(nullptr),
+ m_chrram(nullptr),
+ m_apu(*this, "apu"),
+ m_prg(*this, "prg"),
+ m_prgbank0(*this, "prg_bank0"),
+ m_prgbank1(*this, "prg_bank1"),
+ m_prgbank2(*this, "prg_bank2"),
+ m_prgbank3(*this, "prg_bank3"),
+ m_prgrom(*this, "mainrom"),
+ m_csel(*this, "CARTSEL")
+ { }
+
+ void nes_vt_base(machine_config& config);
+
+ void nes_vt(machine_config& config);
+ void nes_vt_ddr(machine_config& config);
+
+ void nes_vt_hum(machine_config& config);
+ void nes_vt_pjoy(machine_config& config);
+ void nes_vt_sp69(machine_config& config);
+ void nes_vt_ablping(machine_config& config);
+
+ void nes_vt_xx(machine_config& config);
+ void nes_vt_hh(machine_config& config);
+ void nes_vt_cy(machine_config& config);
+ void nes_vt_dg(machine_config& config);
+ void nes_vt_bt(machine_config& config);
+ void nes_vt_vg(machine_config& config);
+ void nes_vt_fp(machine_config& config);
+ void nes_vt_fa(machine_config& config);
+
+ /* OneBus read callbacks for getting sprite and tile data during rendering*/
+ DECLARE_READ8_MEMBER(spr_r);
+ DECLARE_READ8_MEMBER(chr_r);
+
+protected:
+ void nes_vt_map(address_map& map);
+
+ required_device<screen_device> m_screen;
+ required_device<ppu_vt03_device> m_ppu;
private:
/* APU handling */
@@ -153,7 +163,7 @@ private:
DECLARE_WRITE8_MEMBER(vt03_8000_sp69_w);
void scrambled_410x_w(uint16_t offset, uint8_t data, vt_scramble_mode scram);
- void scrambled_8000_w(address_space &space, uint16_t offset, uint8_t data, vt_scramble_mode scram);
+ void scrambled_8000_w(address_space& space, uint16_t offset, uint8_t data, vt_scramble_mode scram);
DECLARE_WRITE8_MEMBER(vt03_4034_w);
DECLARE_WRITE8_MEMBER(vt03_41bx_w);
@@ -181,25 +191,21 @@ private:
DECLARE_READ8_MEMBER(vtfa_412c_r);
- /* OneBus read callbacks for getting sprite and tile data during rendering*/
- DECLARE_READ8_MEMBER(spr_r);
- DECLARE_READ8_MEMBER(chr_r);
DECLARE_WRITE8_MEMBER(chr_w);
- void nes_vt_hum_map(address_map &map);
- void nes_vt_pjoy_map(address_map &map);
- void nes_vt_sp69_map(address_map &map);
- void nes_vt_ablping_map(address_map &map);
- void nes_vt_bt_map(address_map &map);
- void nes_vt_cy_map(address_map &map);
- void nes_vt_dg_map(address_map &map);
- void nes_vt_hh_map(address_map &map);
- void nes_vt_map(address_map &map);
- void nes_vt_xx_map(address_map &map);
- void nes_vt_fa_map(address_map &map);
- void nes_vt_fp_map(address_map &map);
- void prg_map(address_map &map);
+ void nes_vt_hum_map(address_map& map);
+ void nes_vt_pjoy_map(address_map& map);
+ void nes_vt_sp69_map(address_map& map);
+ void nes_vt_ablping_map(address_map& map);
+ void nes_vt_bt_map(address_map& map);
+ void nes_vt_cy_map(address_map& map);
+ void nes_vt_dg_map(address_map& map);
+ void nes_vt_hh_map(address_map& map);
+ void nes_vt_xx_map(address_map& map);
+ void nes_vt_fa_map(address_map& map);
+ void nes_vt_fp_map(address_map& map);
+ void prg_map(address_map& map);
/* expansion nametable - todo, see if we can refactor NES code to be reusable without having to add full NES bus etc. */
std::unique_ptr<uint8_t[]> m_ntram;
@@ -236,8 +242,6 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
- required_device<screen_device> m_screen;
- required_device<ppu_vt03_device> m_ppu;
required_device<nesapu_device> m_apu;
required_device<address_map_bank_device> m_prg;
required_memory_bank m_prgbank0;
@@ -251,6 +255,37 @@ private:
void do_dma(uint8_t data, bool broken);
};
+class nes_vt_ablpinb_state : public nes_vt_state
+{
+public:
+ nes_vt_ablpinb_state(const machine_config& mconfig, device_type type, const char* tag) :
+ nes_vt_state(mconfig, type, tag),
+ m_ablpinb_in0_val(0),
+ m_ablpinb_in0_state(0),
+ m_ablpinb_in1_state(0),
+ m_io0(*this,"IO0"),
+ m_io1(*this,"IO1")
+ { }
+
+ void nes_vt_ablpinb(machine_config& config);
+
+private:
+ DECLARE_READ8_MEMBER(ablpinb_in0_r);
+ DECLARE_READ8_MEMBER(ablpinb_in1_r);
+ DECLARE_WRITE8_MEMBER(ablpinb_in0_w);
+
+ void nes_vt_ablpinb_map(address_map& map);
+ uint8_t m_ablpinb_in0_val;
+ uint8_t m_ablpinb_in0_state;
+ uint8_t m_ablpinb_in1_state;
+ required_ioport m_io0;
+ required_ioport m_io1;
+
+};
+
+
+
+
uint32_t nes_vt_state::get_banks(uint8_t bnk)
{
switch (m_410x[0xb] & 0x07)
@@ -507,12 +542,18 @@ WRITE8_MEMBER(nes_vt_state::vtfa_412c_w)
READ8_MEMBER(nes_vt_state::vtfa_412c_r)
{
- return m_csel->read();
+ if (m_csel)
+ return m_csel->read();
+ else
+ return 0;
}
READ8_MEMBER(nes_vt_state::vtfp_412d_r)
{
- return m_csel->read();
+ if (m_csel)
+ return m_csel->read();
+ else
+ return 0;
}
READ8_MEMBER(nes_vt_state::vtfp_4119_r)
@@ -750,7 +791,11 @@ void nes_vt_state::machine_reset()
m_411d = 0x00;
m_4242 = 0x00;
- m_ahigh = (m_csel->read() == 0x01) ? (1 << 25) : 0x0;
+ if (m_csel)
+ m_ahigh = (m_csel->read() == 0x01) ? (1 << 25) : 0x0;
+ else
+ m_ahigh = 0;
+
m_timer_irq_enabled = 0;
m_timer_running = 0;
m_timer_val = 0;
@@ -1180,6 +1225,61 @@ WRITE8_MEMBER(nes_vt_state::vt03_4034_w)
m_vdma_ctrl = data;
}
+
+// TODO: figure out how the inputs are meant to map on this. It should have an analog plunger and tilt mechanism
+READ8_MEMBER(nes_vt_ablpinb_state::ablpinb_in0_r)
+{
+ //if (!(m_ablpinb_in0_val & 0x04))
+ {
+ uint8_t i = (m_ablpinb_in0_state & 0x08)?0:1; // machine().rand() & 0x01;
+
+ m_ablpinb_in0_state++;
+
+ uint8_t ret = m_io0->read() & ~0x01;
+
+ return i | ret;
+ }
+ //else
+ //{
+ // return 0x00;
+ //}
+}
+
+READ8_MEMBER(nes_vt_ablpinb_state::ablpinb_in1_r)
+{
+ //if (!(m_ablpinb_in0_val & 0x04))
+ {
+ uint8_t i = machine().rand() & 0x18;
+
+ /*
+ switch (m_ablpinb_in1_state & 0x3)
+ {
+ case 0x0:i = 0x00; break;
+ case 0x1:i = 0x08; break;
+ case 0x2:i = 0x10; break;
+ case 0x3:i = 0x18; break;
+ }
+ */
+
+ uint8_t ret = m_io1->read() & ~0x18;
+
+ m_ablpinb_in1_state++;
+
+ return i | ret;
+ }
+ //else
+ //{
+ // return 0x00;
+ //}
+}
+
+WRITE8_MEMBER(nes_vt_ablpinb_state::ablpinb_in0_w)
+{
+ m_ablpinb_in0_val = data;
+ logerror("ablpinb_in0_w %02x\n", data);
+}
+
+
void nes_vt_state::nes_vt_map(address_map &map)
{
map(0x0000, 0x07ff).ram();
@@ -1200,6 +1300,17 @@ void nes_vt_state::nes_vt_map(address_map &map)
map(0x6000, 0x7fff).ram();
}
+void nes_vt_ablpinb_state::nes_vt_ablpinb_map(address_map& map)
+{
+ nes_vt_map(map);
+
+ // override the inputs as specific non-standard 'controller' behavior is needed here and adding it to the generic NES controller bus wouldn't make sense.
+ map(0x4016, 0x4016).rw(FUNC(nes_vt_ablpinb_state::ablpinb_in0_r), FUNC(nes_vt_ablpinb_state::ablpinb_in0_w));
+ map(0x4017, 0x4017).r(FUNC(nes_vt_ablpinb_state::ablpinb_in1_r));
+
+ // 410f reads / writes
+ // 4119 reads
+}
/* Some later VT models have more RAM */
void nes_vt_state::nes_vt_xx_map(address_map &map)
@@ -1396,7 +1507,7 @@ void nes_vt_state::nes_vt_base(machine_config &config)
GFXDECODE(config, "gfxdecode", "ppu", vt03_gfx_helper);
- PPU_VT03(config, m_ppu);
+ PPU_VT03(config, m_ppu, N2A03_NTSC_XTAL);
m_ppu->set_cpu_tag(m_maincpu);
m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
m_ppu->read_bg().set(FUNC(nes_vt_state::chr_r));
@@ -1417,6 +1528,29 @@ void nes_vt_state::nes_vt_base(machine_config &config)
m_apu->add_route(ALL_OUTPUTS, "mono", 0.50);
}
+void nes_vt_ablpinb_state::nes_vt_ablpinb(machine_config &config)
+{
+ nes_vt_base(config);
+
+ m_maincpu->set_clock(PALC_APU_CLOCK);
+
+ PPU_VT03PAL(config.replace(), m_ppu, N2A03_PAL_XTAL);
+ m_ppu->set_cpu_tag(m_maincpu);
+ m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
+ m_ppu->read_bg().set(FUNC(nes_vt_state::chr_r));
+ m_ppu->read_sp().set(FUNC(nes_vt_state::spr_r));
+
+ /* video hardware */
+ m_screen->set_refresh_hz(50.0070);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC((113.66 / (PALC_APU_CLOCK.dvalue() / 1000000)) *
+ (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL - ppu2c0x_device::VBLANK_FIRST_SCANLINE_PALC + 1 + 2)));
+ m_screen->set_size(32 * 8, 312);
+ m_screen->set_visarea(0 * 8, 32 * 8 - 1, 0 * 8, 30 * 8 - 1);
+
+ // override for controllers
+ m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_ablpinb_state::nes_vt_ablpinb_map);
+}
+
void nes_vt_state::nes_vt(machine_config &config)
{
nes_vt_base(config);
@@ -1554,6 +1688,47 @@ static INPUT_PORTS_START( nes_vt_fa )
INPUT_PORTS_END
+static INPUT_PORTS_START( ablpinb )
+ PORT_START("IO0")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // has to toggle or code gets stuck in interrupt
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Select" )
+ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+
+ PORT_START("IO1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Left Flipper" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Right Flipper" )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // has to toggle or code gets stuck on startup (maybe should cycle automatically when different inputs are available?)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // ^
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+INPUT_PORTS_END
+
+
ROM_START( vdogdeme )
ROM_REGION( 0x100000, "mainrom", 0 )
ROM_LOAD( "vdog.bin", 0x00000, 0x100000, CRC(29dae36d) SHA1(e7192c5b16f3e658b0802e5c50fab244e974d9c2) )
@@ -1574,6 +1749,11 @@ ROM_START( vtpinball )
ROM_LOAD( "rom.bin", 0x00000, 0x80000, CRC(62e52c23) SHA1(b83b82c928b9fe82abfaa915196322153787c8ce) )
ROM_END
+ROM_START( ablpinb )
+ ROM_REGION( 0x200000, "mainrom", 0 )
+ ROM_LOAD( "abl_pinball.bin", 0x00000, 0x200000, CRC(b2ce20fb) SHA1(f2af7f26fcdce6f26db5c71727ab380240f44f74) )
+ROM_END
+
ROM_START( vtsndtest )
ROM_REGION( 0x80000, "mainrom", 0 )
ROM_LOAD( "rom.bin", 0x00000, 0x80000, CRC(ddc2bc9c) SHA1(fb9209c62d1496ba7fe379e8a078cabd48cccd9b) )
@@ -1878,6 +2058,10 @@ CONS( 200?, vtsndtest, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "VRT
// Bundled as "Demo for VT03 Pic32" on the V.R. Technology VT SDK
CONS( 200?, vtboxing, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "VRT", "VRT VT SDK 'Boxing' (Demo for VT03 Pic32)", MACHINE_NOT_WORKING )
+// clearly started off as 'vtpinball' 050329 (29th March 2005) date on PCB
+CONS( 2005, ablpinb, 0, 0, nes_vt_ablpinb, ablpinb, nes_vt_ablpinb_state, empty_init, "Advance Bright Ltd", "Pinball (P8002, ABL TV Game)", MACHINE_NOT_WORKING )
+
+
// should be VT03 based
// for testing 'Shark', 'Octopus', 'Harbor', and 'Earth Fighter' use the extended colour modes, other games just seem to use standard NES modes
CONS( 200?, mc_dgear, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_init, "dreamGEAR", "dreamGEAR 75-in-1", MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/psikyo.cpp b/src/mame/drivers/psikyo.cpp
index 8b00d79f581..02413dd7d6f 100644
--- a/src/mame/drivers/psikyo.cpp
+++ b/src/mame/drivers/psikyo.cpp
@@ -29,6 +29,18 @@ Tengai (J) 1996 SH404 SH404 has MCU, ymf278-b for sound
To Do:
+- All games uses PORT_VBLANK and legacy screen parameters (which is already
+ bad per-se), with also naive and unlikely measurements (i.e. exactly 59.30
+ or 59.90 Hz).
+ The most blunt examples of something being wrong with timings are with
+ Gunbird and Tengai: they both have FOUR frames of input lag, the real thing
+ doesn't sport anything like that.
+ Given the above, all games are marked with MACHINE_IMPERFECT_TIMING until
+ somebody provides accurate H/Vsync signals for at least one game of this
+ driver.
+- tengai / tengaij: "For use in Japan" screen is supposed to output the
+ typical blue Psikyo backdrop gradient instead of being pure black as it is
+ now;
- Flip Screen support
NOTE: Despite being mentioned in the manual Strikers 1945 doesn't seem to
@@ -1033,8 +1045,9 @@ void psikyo_state::sngkace(machine_config &config)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ // TODO: accurate measurements
m_screen->set_refresh_hz(59.3);
- m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500));
m_screen->set_size(320, 256);
m_screen->set_visarea(0, 320-1, 0, 256-32-1);
m_screen->set_screen_update(FUNC(psikyo_state::screen_update));
@@ -1079,8 +1092,9 @@ void psikyo_state::gunbird(machine_config &config)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ // TODO: accurate measurements
m_screen->set_refresh_hz(59.3);
- m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500));
m_screen->set_size(320, 256);
m_screen->set_visarea(0, 320-1, 0, 256-32-1);
m_screen->set_screen_update(FUNC(psikyo_state::screen_update));
@@ -1120,8 +1134,9 @@ void psikyo_state::s1945bl(machine_config &config) /* Bootleg hardware based on
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ // TODO: accurate measurements
m_screen->set_refresh_hz(59.3);
- m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500));
m_screen->set_size(320, 256);
m_screen->set_visarea(0, 320-1, 0, 256-32-1);
m_screen->set_screen_update(FUNC(psikyo_state::screen_update_bootleg));
@@ -1163,8 +1178,9 @@ void psikyo_state::s1945(machine_config &config)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- m_screen->set_refresh_hz(59.90); /* verified on pcb */
- m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ // we're using PORT_VBLANK
+ // TODO: accurate measurements
+ m_screen->set_refresh_hz(59.90);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500));
m_screen->set_size(320, 256);
m_screen->set_visarea(0, 320-1, 0, 256-32-1);
m_screen->set_screen_update(FUNC(psikyo_state::screen_update));
@@ -1951,24 +1967,24 @@ void psikyo_state::init_s1945bl()
***************************************************************************/
-GAME( 1993, samuraia, 0, sngkace, samuraia, psikyo_state, init_sngkace, ROT270, "Psikyo", "Samurai Aces (World)", MACHINE_SUPPORTS_SAVE ) // Banpresto?
-GAME( 1993, sngkace, samuraia, sngkace, sngkace, psikyo_state, init_sngkace, ROT270, "Psikyo", "Sengoku Ace (Japan, set 1)", MACHINE_SUPPORTS_SAVE ) // Banpresto?
-GAME( 1993, sngkacea, samuraia, sngkace, sngkace, psikyo_state, init_sngkace, ROT270, "Psikyo", "Sengoku Ace (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) // Banpresto?
+GAME( 1993, samuraia, 0, sngkace, samuraia, psikyo_state, init_sngkace, ROT270, "Psikyo", "Samurai Aces (World)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // Banpresto?
+GAME( 1993, sngkace, samuraia, sngkace, sngkace, psikyo_state, init_sngkace, ROT270, "Psikyo", "Sengoku Ace (Japan, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // Banpresto?
+GAME( 1993, sngkacea, samuraia, sngkace, sngkace, psikyo_state, init_sngkace, ROT270, "Psikyo", "Sengoku Ace (Japan, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // Banpresto?
-GAME( 1994, gunbird, 0, gunbird, gunbird, psikyo_state, init_gunbird, ROT270, "Psikyo", "Gunbird (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1994, gunbirdk, gunbird, gunbird, gunbirdj, psikyo_state, init_gunbird, ROT270, "Psikyo", "Gunbird (Korea)", MACHINE_SUPPORTS_SAVE )
-GAME( 1994, gunbirdj, gunbird, gunbird, gunbirdj, psikyo_state, init_gunbird, ROT270, "Psikyo", "Gunbird (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1994, gunbird, 0, gunbird, gunbird, psikyo_state, init_gunbird, ROT270, "Psikyo", "Gunbird (World)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1994, gunbirdk, gunbird, gunbird, gunbirdj, psikyo_state, init_gunbird, ROT270, "Psikyo", "Gunbird (Korea)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1994, gunbirdj, gunbird, gunbird, gunbirdj, psikyo_state, init_gunbird, ROT270, "Psikyo", "Gunbird (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
-GAME( 1994, btlkroad, 0, gunbird, btlkroad, psikyo_state, init_gunbird, ROT0, "Psikyo", "Battle K-Road", MACHINE_SUPPORTS_SAVE )
-GAME( 1994, btlkroadk, btlkroad, gunbird, btlkroadk, psikyo_state, init_gunbird, ROT0, "Psikyo", "Battle K-Road (Korea)", MACHINE_SUPPORTS_SAVE ) // game code is still multi-region, but sound rom appears to be Korea specific at least
+GAME( 1994, btlkroad, 0, gunbird, btlkroad, psikyo_state, init_gunbird, ROT0, "Psikyo", "Battle K-Road", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1994, btlkroadk, btlkroad, gunbird, btlkroadk, psikyo_state, init_gunbird, ROT0, "Psikyo", "Battle K-Road (Korea)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // game code is still multi-region, but sound rom appears to be Korea specific at least
-GAME( 1995, s1945, 0, s1945, s1945, psikyo_state, init_s1945, ROT270, "Psikyo", "Strikers 1945 (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, s1945a, s1945, s1945, s1945a, psikyo_state, init_s1945a, ROT270, "Psikyo", "Strikers 1945 (Japan / World)", MACHINE_SUPPORTS_SAVE ) // Region dip - 0x0f=Japan, anything else=World
-GAME( 1995, s1945j, s1945, s1945, s1945j, psikyo_state, init_s1945j, ROT270, "Psikyo", "Strikers 1945 (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, s1945n, s1945, s1945n, s1945, psikyo_state, init_gunbird, ROT270, "Psikyo", "Strikers 1945 (World, unprotected)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, s1945nj, s1945, s1945n, s1945j, psikyo_state, init_gunbird, ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, s1945k, s1945, s1945, s1945j, psikyo_state, init_s1945, ROT270, "Psikyo", "Strikers 1945 (Korea)", MACHINE_SUPPORTS_SAVE )
-GAME( 1995, s1945bl, s1945, s1945bl, s1945bl, psikyo_state, init_s1945bl, ROT270, "bootleg", "Strikers 1945 (Hong Kong, bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, s1945, 0, s1945, s1945, psikyo_state, init_s1945, ROT270, "Psikyo", "Strikers 1945 (World)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1995, s1945a, s1945, s1945, s1945a, psikyo_state, init_s1945a, ROT270, "Psikyo", "Strikers 1945 (Japan / World)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // Region dip - 0x0f=Japan, anything else=World
+GAME( 1995, s1945j, s1945, s1945, s1945j, psikyo_state, init_s1945j, ROT270, "Psikyo", "Strikers 1945 (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1995, s1945n, s1945, s1945n, s1945, psikyo_state, init_gunbird, ROT270, "Psikyo", "Strikers 1945 (World, unprotected)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1995, s1945nj, s1945, s1945n, s1945j, psikyo_state, init_gunbird, ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1995, s1945k, s1945, s1945, s1945j, psikyo_state, init_s1945, ROT270, "Psikyo", "Strikers 1945 (Korea)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1995, s1945bl, s1945, s1945bl, s1945bl, psikyo_state, init_s1945bl, ROT270, "bootleg", "Strikers 1945 (Hong Kong, bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
-GAME( 1996, tengai, 0, s1945, tengai, psikyo_state, init_tengai, ROT0, "Psikyo", "Tengai (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1996, tengaij, tengai, s1945, tengaij, psikyo_state, init_tengai, ROT0, "Psikyo", "Sengoku Blade: Sengoku Ace Episode II / Tengai", MACHINE_SUPPORTS_SAVE ) // Region dip - 0x0f=Japan, anything else=World
+GAME( 1996, tengai, 0, s1945, tengai, psikyo_state, init_tengai, ROT0, "Psikyo", "Tengai (World)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING )
+GAME( 1996, tengaij, tengai, s1945, tengaij, psikyo_state, init_tengai, ROT0, "Psikyo", "Sengoku Blade: Sengoku Ace Episode II / Tengai", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING ) // Region dip - 0x0f=Japan, anything else=World
diff --git a/src/mame/drivers/raiden.cpp b/src/mame/drivers/raiden.cpp
index 40da2c3927f..3985471c65c 100644
--- a/src/mame/drivers/raiden.cpp
+++ b/src/mame/drivers/raiden.cpp
@@ -854,8 +854,8 @@ GAME( 1990, raidenk, raiden, raiden, raiden, raiden_state, init_raiden, ROT
GAME( 1990, raidenkb, raiden, raidenkb, raiden, raiden_state, init_raiden, ROT270, "bootleg", "Raiden (Korea, bootleg)", MACHINE_SUPPORTS_SAVE )
/* Alternate hardware; SEI8904 + SEI9008 PCBs. Main & Sub CPU code not encrypted */
-GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, empty_init, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, raidenua, raiden, raidenu, raiden, raiden_state, empty_init, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 2, SEI8904 hardware)", MACHINE_SUPPORTS_SAVE )
/* Alternate hardware. Main, Sub & Sound CPU code not encrypted. It also sports Seibu custom CRTC. */
-GAME( 1990, raidenb, raiden, raidenb, raiden, raidenb_state, empty_init, ROT270, "Seibu Kaihatsu", "Raiden (set 3)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, raidenub, raiden, raidenb, raiden, raidenb_state, empty_init, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 3)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, raidenb, raiden, raidenb, raiden, raidenb_state, empty_init, ROT270, "Seibu Kaihatsu", "Raiden (set 3, newer hardware)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, raidenub, raiden, raidenb, raiden, raidenb_state, empty_init, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 3, newer hardware)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp
index 627e08732ba..c90352dc918 100644
--- a/src/mame/drivers/rainbow.cpp
+++ b/src/mame/drivers/rainbow.cpp
@@ -7,7 +7,7 @@ Driver-in-progress by R. Belmont and Miodrag Milanovic.
Portions (2013 - 2018) by Karl-Ludwig Deisenhofer (Floppy, ClikClok RTC, NVRAM, DIPs, hard disk, Color Graphics).
Baud rate generator by AJR (2018) and Shattered (2016), keyboard & GDC fixes by Cracyc (June - Nov. 2016).
-To unlock floppy drives A-D compile with WORKAROUND_RAINBOW_B (prevents a side effect of ERROR 13).
+Model B implementation has a workaround prevents a side effect of ERROR 13 to unlock floppy drives A-D.
Native single sided 5.25" images with 80 tracks, 10 sectors are well tested (*.IMD / *.TD0=TeleDisk / *.IMG with 400 K).
VT180 images (184.320 Bytes) are very unreliable in CP/M - though a real machine can read them.
@@ -144,7 +144,7 @@ To obtain pixel exact graphics use 'Graphics Only' in Video Options and cmd.line
CURRENTY UNEMULATED
-------------------
(a) the serial printer on port B prints garbage. It is worth to mention that port B relies on XON/XOFF,
- while DTR_L (CTS B) means 'printer ready'. There is also a ROM patch in place (WORKAROUND macro)...
+ while DTR_L (CTS B) means 'printer ready'. There is also a ROM patch in place...
(b1) LOOPBACK circuit not emulated (used in startup tests).
@@ -349,6 +349,7 @@ W17 pulls J1 serial port pin 1 to GND when set (chassis to logical GND).
#include "machine/nvram.h"
#include "machine/ripple_counter.h"
#include "machine/timer.h"
+#include "machine/ram.h"
#include "machine/ds1315.h"
#include "emupal.h"
@@ -372,26 +373,7 @@ W17 pulls J1 serial port pin 1 to GND when set (chassis to logical GND).
// (Y2K) DS1315 unit only holds 2 digits, so Vincent Esser's freeware employs a windowing technique.
// While Suitable's DOS 3.10 accepts dates > 2000, don't take that for granted with software from the 80s.
-#ifdef ASSUME_MODEL_A_HARDWARE
- #define RTC_BASE 0xED000
-
- // Define standard and maximum RAM sizes (A model):
- #define MOTHERBOARD_RAM 0x0ffff // 64 K base RAM (100-A)
- #define END_OF_RAM 0xcffff // Very last byte (theretical; on 100-A) DO NOT CHANGE.
-
- // Pretend to emulate older RAM board (no NMI, also affects presence bit in 'system_parameter_r'):
- #define OLD_RAM_BOARD_PRESENT
-#else
- #define RTC_BASE 0xFC000 // (default configuration, also covers FE000+)
-// #define RTC_BASE 0xF4000 // (alternate configuration) - ClikClok V1.0 / CLIKF4.COM
-
- // DEC-100-B probes until a 'flaky' area is found (BOOT ROM around F400:0E04).
- // It is no longer possible to key in the RAM size from within the 100-B BIOS.
- #define MOTHERBOARD_RAM 0x1ffff // 128 K base RAM (100-B)
- #define END_OF_RAM 0xdffff // very last byte (100-B theoretical max.) DO NOT CHANGE.
-
- #define WORKAROUND_RAINBOW_B // work around DRIVE ERROR (tested on 100-B ROM only)
- #endif
+// Model B can have an RTC mapped at 0xF4000 instead - ClikClok V1.0 / CLIKF4.COM
// ----------------------------------------------------------------------------------------------
// * MHFU disabled by writing a _sensible_ value to port 0x10C (instead of port 0x0c)
@@ -466,10 +448,10 @@ static constexpr int COLOR_MONITOR = 0x02; // DEC recommendation. GWBASIC and mo
static constexpr int DUAL_MONITOR = 0x03; // Debugging, AutoCad, 'newer' freeware. Green is missing with unpatched software (for technical reasons)
static constexpr int AUTODETECT_MONITOR = 0x04; // Snoop palette, then choose best output.
-class rainbow_state : public driver_device
+class rainbow_base_state : public driver_device
{
public:
- rainbow_state(const machine_config &mconfig, device_type type, const char *tag) :
+ rainbow_base_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_inp1(*this, "W13"),
@@ -479,7 +461,6 @@ public:
m_inp5(*this, "DEC HARD DISK"), // DO NOT CHANGE ORDER
m_inp6(*this, "CORVUS HARD DISKS"), // DO NOT CHANGE ORDER
m_inp7(*this, "GRAPHICS OPTION"), // DO NOT CHANGE ORDER
- m_inp8(*this, "MEMORY PRESENT"), // DO NOT CHANGE ORDER
m_inp9(*this, "MONO MONITOR TYPE"),
m_inp10(*this, "J17"),
m_inp11(*this, "CLIKCLOK"),
@@ -490,6 +471,7 @@ public:
m_i8088(*this, "maincpu"),
m_z80(*this, "subcpu"),
+ m_ram(*this, "ram"),
m_fdc(*this, FD1793_TAG),
m_floppies(*this, FD1793_TAG ":%u", 0U),
@@ -508,9 +490,6 @@ public:
m_p_vol_ram(*this, "vol_ram"),
m_p_nvram(*this, "nvram"),
- m_shared(*this, "sh_ram"),
- m_ext_ram(*this, "ext_ram"),
-
m_rtc(*this, "rtc"),
m_hgdc(*this, "upd7220"), // GDC
@@ -522,13 +501,19 @@ public:
{
}
- void rainbow(machine_config &config);
+ void rainbow_base(machine_config &config);
protected:
virtual void machine_start() override;
+ virtual void machine_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
-private:
+ void rainbow8088_base_map(address_map &map);
+ void rainbow8088_base_io(address_map &map);
+
+ DECLARE_READ8_MEMBER(ext_ram_r);
+
+ DECLARE_WRITE8_MEMBER(rtc_w);
DECLARE_READ8_MEMBER(read_video_ram_r);
DECLARE_WRITE_LINE_MEMBER(video_interrupt);
@@ -579,20 +564,12 @@ private:
DECLARE_READ8_MEMBER(z80_diskstatus_r);
DECLARE_WRITE8_MEMBER(z80_diskcontrol_w);
- DECLARE_READ8_MEMBER(system_parameter_r);
-
DECLARE_WRITE_LINE_MEMBER(kbd_tx);
DECLARE_WRITE_LINE_MEMBER(kbd_rxready_w);
DECLARE_WRITE_LINE_MEMBER(kbd_txready_w);
- DECLARE_WRITE_LINE_MEMBER(irq_hi_w);
-
DECLARE_READ8_MEMBER(rtc_reset);
DECLARE_READ8_MEMBER(rtc_enable);
- DECLARE_READ8_MEMBER(rtc_r);
- DECLARE_WRITE8_MEMBER(rtc_w);
-
- DECLARE_WRITE8_MEMBER(ext_ram_w);
DECLARE_WRITE_LINE_MEMBER(mpsc_irq);
DECLARE_WRITE8_MEMBER(comm_bitrate_w);
@@ -616,8 +593,6 @@ private:
DECLARE_WRITE16_MEMBER(vram_w);
DECLARE_WRITE_LINE_MEMBER(GDC_vblank_irq);
- void rainbow8088_io(address_map &map);
- void rainbow8088_map(address_map &map);
void rainbowz80_io(address_map &map);
void rainbowz80_mem(address_map &map);
void upd7220_map(address_map &map);
@@ -643,7 +618,6 @@ private:
required_ioport m_inp5;
required_ioport m_inp6;
required_ioport m_inp7;
- required_ioport m_inp8;
required_ioport m_inp9;
required_ioport m_inp10;
required_ioport m_inp11;
@@ -652,6 +626,7 @@ private:
required_device<rainbow_video_device> m_crtc;
required_device<cpu_device> m_i8088;
required_device<cpu_device> m_z80;
+ required_device<ram_device> m_ram;
required_device<fd1793_device> m_fdc;
required_device_array<floppy_connector, 4> m_floppies;
@@ -668,8 +643,6 @@ private:
required_shared_ptr<uint8_t> m_p_ram;
required_shared_ptr<uint8_t> m_p_vol_ram;
required_shared_ptr<uint8_t> m_p_nvram;
- required_shared_ptr<uint8_t> m_shared;
- required_shared_ptr<uint8_t> m_ext_ram;
optional_device<ds1315_device> m_rtc;
@@ -732,7 +705,6 @@ private:
uint8_t m_z80_mailbox, m_8088_mailbox;
void update_kbd_irq();
- virtual void machine_reset() override;
int m_present_drive;
floppy_image_device *m_floppy;
@@ -769,6 +741,50 @@ private:
const int comm_rates[16] = { 50,75,110,134,150,200,300,600,1200,1800,2000,2400,3600,4800,9600,19200 };
};
+class rainbow_modela_state : public rainbow_base_state
+{
+public:
+ rainbow_modela_state(const machine_config &mconfig, device_type type, const char *tag) :
+ rainbow_base_state(mconfig, type, tag)
+ {
+ }
+
+ void rainbow_modela(machine_config &config);
+
+private:
+ virtual void machine_reset() override;
+
+ void rainbow8088_map(address_map &map);
+ void rainbow8088_io(address_map &map);
+
+ DECLARE_WRITE8_MEMBER(ext_ram_w);
+ DECLARE_READ8_MEMBER(rtc_r);
+ DECLARE_WRITE_LINE_MEMBER(irq_hi_w);
+ DECLARE_READ8_MEMBER(system_parameter_r);
+};
+
+class rainbow_modelb_state : public rainbow_base_state
+{
+public:
+ rainbow_modelb_state(const machine_config &mconfig, device_type type, const char *tag) :
+ rainbow_base_state(mconfig, type, tag)
+ {
+ }
+
+ void rainbow_modelb(machine_config &config);
+
+private:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ void rainbow8088_map(address_map &map);
+ void rainbow8088_io(address_map &map);
+
+ DECLARE_WRITE8_MEMBER(ext_ram_w);
+ DECLARE_READ8_MEMBER(rtc_r);
+ DECLARE_WRITE_LINE_MEMBER(irq_hi_w);
+ DECLARE_READ8_MEMBER(system_parameter_r);
+};
// It * should be * OK to RESET the SCROLL_BUFFER and the COLOR_MAP (at least with WELL WRITTEN programs)
@@ -800,7 +816,7 @@ private:
m_gdc_mode_register |= GDC_MODE_ENABLE_VIDEO; \
logerror("\n** OPTION GRFX. RESET **\n");
-UPD7220_DISPLAY_PIXELS_MEMBER( rainbow_state::hgdc_display_pixels )
+UPD7220_DISPLAY_PIXELS_MEMBER( rainbow_base_state::hgdc_display_pixels )
{
if(m_inp7->read() == 0)
return;
@@ -853,7 +869,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( rainbow_state::hgdc_display_pixels )
}
}
-FLOPPY_FORMATS_MEMBER(rainbow_state::floppy_formats)
+FLOPPY_FORMATS_MEMBER(rainbow_base_state::floppy_formats)
FLOPPY_RX50IMG_FORMAT,
FLOPPY_TD0_FORMAT,
FLOPPY_IMD_FORMAT,
@@ -868,7 +884,7 @@ static void rainbow_floppies(device_slot_interface &device)
device.option_add("525ssdd", FLOPPY_525_SSDD); // to read a single sided, (160K) PC-DOS 1 disk with MediaMaster
}
-void rainbow_state::machine_start()
+void rainbow_base_state::machine_start()
{
m_power_good = false; // Simulate AC_OK signal from power supply.
cmd_timer = timer_alloc(0);
@@ -894,8 +910,12 @@ void rainbow_state::machine_start()
save_item(NAME(m_kbd_rx_ready));
save_item(NAME(m_irq_high));
save_item(NAME(m_irq_mask));
+}
+
+void rainbow_modelb_state::machine_start()
+{
+ rainbow_base_state::machine_start();
-#ifdef WORKAROUND_RAINBOW_B
uint8_t *rom = memregion("maincpu")->base();
if (rom[0xf4000 + 0x3ffc] == 0x31) // 100-B (5.01) 0x35 would test for V5.05
{
@@ -908,14 +928,11 @@ void rainbow_state::machine_start()
rom[0xf4000 + 0x315E] = 0xe2;
rom[0xf4000 + 0x315F] = 0x02;
}
-#endif
}
-void rainbow_state::rainbow8088_map(address_map &map)
+void rainbow_base_state::rainbow8088_base_map(address_map &map)
{
map.unmap_value_high();
- map(0x00000, 0x0ffff).ram().share("sh_ram");
- map(0x10000, END_OF_RAM).ram().share("ext_ram").w(FUNC(rainbow_state::ext_ram_w));
// There is a 2212 (256 x 4 bit) NVRAM from 0xed000 to 0xed0ff (*)
// shadowed at $ec000 - $ecfff and from $ed100 - $edfff.
@@ -934,21 +951,48 @@ void rainbow_state::rainbow8088_map(address_map &map)
map(0xf0000, 0xfffff).rom();
}
-void rainbow_state::rainbow8088_io(address_map &map)
+void rainbow_modela_state::rainbow8088_map(address_map &map)
+{
+ rainbow8088_base_map(map);
+ map(0x00000, 0xcffff).rw(FUNC(rainbow_modela_state::ext_ram_r), FUNC(rainbow_modela_state::ext_ram_w));
+
+#ifdef RTC_ENABLED
+ // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-A' ***************************************
+ map(0xed000, 0xed000).r(FUNC(rainbow_modela_state::rtc_r));
+ map(0xed0fe, 0xed0ff).w(FUNC(rainbow_modela_state::rtc_w));
+ // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-A' ***************************************
+#endif
+}
+
+// DEC-100-B probes until a 'flaky' area is found (BOOT ROM around F400:0E04).
+// It is no longer possible to key in the RAM size from within the 100-B BIOS.
+void rainbow_modelb_state::rainbow8088_map(address_map &map)
+{
+ rainbow8088_base_map(map);
+ map(0x00000, 0xdffff).rw(FUNC(rainbow_modelb_state::ext_ram_r), FUNC(rainbow_modelb_state::ext_ram_w));
+
+#ifdef RTC_ENABLED
+ // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-B' ***************************************
+ // No address space needed ( -> IRQs must be disabled to block ROM accesses during reads ).
+ map(0xfc000, 0xfe104).r(FUNC(rainbow_modelb_state::rtc_r));
+ // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-B' ***************************************
+#endif
+}
+
+void rainbow_base_state::rainbow8088_base_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0x1ff);
- map(0x00, 0x00).rw(FUNC(rainbow_state::i8088_latch_r), FUNC(rainbow_state::i8088_latch_w));
- map(0x02, 0x02).rw(FUNC(rainbow_state::comm_control_r), FUNC(rainbow_state::comm_control_w)); // Communication status / control register (8088)
+ map(0x00, 0x00).rw(FUNC(rainbow_base_state::i8088_latch_r), FUNC(rainbow_base_state::i8088_latch_w));
+ map(0x02, 0x02).rw(FUNC(rainbow_base_state::comm_control_r), FUNC(rainbow_base_state::comm_control_w)); // Communication status / control register (8088)
map(0x04, 0x04).w(m_crtc, FUNC(rainbow_video_device::dc011_w));
- map(0x06, 0x06).w(FUNC(rainbow_state::comm_bitrate_w));
+ map(0x06, 0x06).w(FUNC(rainbow_base_state::comm_bitrate_w));
- map(0x08, 0x08).r(FUNC(rainbow_state::system_parameter_r));
- map(0x0a, 0x0a).rw(FUNC(rainbow_state::diagnostic_r), FUNC(rainbow_state::diagnostic_w));
+ map(0x0a, 0x0a).rw(FUNC(rainbow_base_state::diagnostic_r), FUNC(rainbow_base_state::diagnostic_w));
map(0x0c, 0x0c).select(0x100).w(m_crtc, FUNC(rainbow_video_device::dc012_w));
- map(0x0e, 0x0e).w(FUNC(rainbow_state::printer_bitrate_w));
+ map(0x0e, 0x0e).w(FUNC(rainbow_base_state::printer_bitrate_w));
map(0x10, 0x11).rw(m_kbd8251, FUNC(i8251_device::read), FUNC(i8251_device::write));
@@ -964,7 +1008,7 @@ void rainbow_state::rainbow8088_io(address_map &map)
// Corvus B/H harddisk controller (incompatible with EXT.COMM OPTION):
map(0x20, 0x20).rw(m_corvus_hdc, FUNC(corvus_hdc_device::read), FUNC(corvus_hdc_device::write));
- map(0x21, 0x21).r(FUNC(rainbow_state::corvus_status_r));
+ map(0x21, 0x21).r(FUNC(rainbow_base_state::corvus_status_r));
// ===========================================================
// 0x30 -> 0x3f ***** Option Select 3
@@ -979,15 +1023,15 @@ void rainbow_state::rainbow8088_io(address_map &map)
// * Color graphics option (NEC upd7220 GDC plus external hw.). See Programmer's Reference AA-AE36A-TV.
// Either 384 x 240 x 16 or 800 x 240 x 4 colors (out of 4096). 8 x 64 K video RAM.
// (Write Buffer, Pattern Register/Multiplier, ALU/PS, Color Map, readback and offset/scroll hardware):
- map(0x50, 0x57).rw(FUNC(rainbow_state::GDC_EXTRA_REGISTER_r), FUNC(rainbow_state::GDC_EXTRA_REGISTER_w));
+ map(0x50, 0x57).rw(FUNC(rainbow_base_state::GDC_EXTRA_REGISTER_r), FUNC(rainbow_base_state::GDC_EXTRA_REGISTER_w));
// ===========================================================
// 0x60 -> 0x6f ***** EXTENDED COMM. OPTION / Option Select 2.
// ===========================================================
// 0x60 -> 0x6f ***** RD51 HD. CONTROLLER / Option Select 2.
map(0x60, 0x67).rw(m_hdc, FUNC(wd2010_device::read), FUNC(wd2010_device::write)).mirror(0x100);
- map(0x68, 0x68).rw(FUNC(rainbow_state::hd_status_68_r), FUNC(rainbow_state::hd_status_68_w));
- map(0x69, 0x69).r(FUNC(rainbow_state::hd_status_69_r));
+ map(0x68, 0x68).rw(FUNC(rainbow_base_state::hd_status_68_r), FUNC(rainbow_base_state::hd_status_68_w));
+ map(0x69, 0x69).r(FUNC(rainbow_base_state::hd_status_69_r));
// ===========================================================
// THE RD51 CONTROLLER: WD1010AL - 00 (WDC '83)
// + 2 K x 8 SRAM (SY2128-4 or Japan 8328) 21-17872-01
@@ -1025,27 +1069,39 @@ void rainbow_state::rainbow8088_io(address_map &map)
// 0x10c -> (MHFU disable register handled by 0x0c + select())
}
-void rainbow_state::rainbowz80_mem(address_map &map)
+void rainbow_modela_state::rainbow8088_io(address_map &map)
+{
+ rainbow_base_state::rainbow8088_base_io(map);
+ map(0x08, 0x08).r(FUNC(rainbow_modela_state::system_parameter_r));
+}
+
+void rainbow_modelb_state::rainbow8088_io(address_map &map)
+{
+ rainbow_base_state::rainbow8088_base_io(map);
+ map(0x08, 0x08).r(FUNC(rainbow_modelb_state::system_parameter_r));
+}
+
+void rainbow_base_state::rainbowz80_mem(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0xffff).rw(FUNC(rainbow_state::share_z80_r), FUNC(rainbow_state::share_z80_w));
+ map(0x0000, 0xffff).rw(FUNC(rainbow_base_state::share_z80_r), FUNC(rainbow_base_state::share_z80_w));
}
-void rainbow_state::rainbowz80_io(address_map &map)
+void rainbow_base_state::rainbowz80_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0xff);
- map(0x00, 0x00).rw(FUNC(rainbow_state::z80_latch_r), FUNC(rainbow_state::z80_latch_w));
- map(0x20, 0x20).rw(FUNC(rainbow_state::z80_generalstat_r), FUNC(rainbow_state::z80_diskdiag_read_w)); // read to port 0x20 used by MS-DOS 2.x diskette loader.
- map(0x21, 0x21).rw(FUNC(rainbow_state::z80_generalstat_r), FUNC(rainbow_state::z80_diskdiag_write_w));
- map(0x40, 0x40).rw(FUNC(rainbow_state::z80_diskstatus_r), FUNC(rainbow_state::z80_diskcontrol_w));
+ map(0x00, 0x00).rw(FUNC(rainbow_base_state::z80_latch_r), FUNC(rainbow_base_state::z80_latch_w));
+ map(0x20, 0x20).rw(FUNC(rainbow_base_state::z80_generalstat_r), FUNC(rainbow_base_state::z80_diskdiag_read_w)); // read to port 0x20 used by MS-DOS 2.x diskette loader.
+ map(0x21, 0x21).rw(FUNC(rainbow_base_state::z80_generalstat_r), FUNC(rainbow_base_state::z80_diskdiag_write_w));
+ map(0x40, 0x40).rw(FUNC(rainbow_base_state::z80_diskstatus_r), FUNC(rainbow_base_state::z80_diskcontrol_w));
map(0x60, 0x63).rw(m_fdc, FUNC(fd1793_device::read), FUNC(fd1793_device::write));
// Z80 I/O shadow area > $80
- map(0x80, 0x80).rw(FUNC(rainbow_state::z80_latch_r), FUNC(rainbow_state::z80_latch_w));
- map(0xA0, 0xA0).rw(FUNC(rainbow_state::z80_generalstat_r), FUNC(rainbow_state::z80_diskdiag_read_w)); // read to port 0x20 used by MS-DOS 2.x diskette loader.
- map(0xA1, 0xA1).rw(FUNC(rainbow_state::z80_generalstat_r), FUNC(rainbow_state::z80_diskdiag_write_w));
- map(0xC0, 0xC0).rw(FUNC(rainbow_state::z80_diskstatus_r), FUNC(rainbow_state::z80_diskcontrol_w));
+ map(0x80, 0x80).rw(FUNC(rainbow_base_state::z80_latch_r), FUNC(rainbow_base_state::z80_latch_w));
+ map(0xA0, 0xA0).rw(FUNC(rainbow_base_state::z80_generalstat_r), FUNC(rainbow_base_state::z80_diskdiag_read_w)); // read to port 0x20 used by MS-DOS 2.x diskette loader.
+ map(0xA1, 0xA1).rw(FUNC(rainbow_base_state::z80_generalstat_r), FUNC(rainbow_base_state::z80_diskdiag_write_w));
+ map(0xC0, 0xC0).rw(FUNC(rainbow_base_state::z80_diskstatus_r), FUNC(rainbow_base_state::z80_diskcontrol_w));
map(0xE0, 0xE3).rw(m_fdc, FUNC(fd1793_device::read), FUNC(fd1793_device::write));
}
@@ -1060,23 +1116,7 @@ static INPUT_PORTS_START(rainbow100b_in)
PORT_DIPSETTING(0x02, "GREEN (VR201-B)")
PORT_DIPSETTING(0x03, "AMBER (VR201-C)")
- // MEMORY, FLOPPY, BUNDLE, GRAPHICS affect 'system_parameter_r':
- PORT_START("MEMORY PRESENT")
- PORT_DIPNAME(0xF0000, 0x20000, "MEMORY PRESENT")
- PORT_DIPSETTING(0x10000, "64 K (MINIMUM ON 100-A)") // see MOTHERBOARD_RAM
- PORT_DIPSETTING(0x20000, "128 K (MINIMUM ON 100-B)")
- PORT_DIPSETTING(0x30000, "192 K (w. MEMORY OPTION)")
- PORT_DIPSETTING(0x40000, "256 K (w. MEMORY OPTION)")
- PORT_DIPSETTING(0x50000, "320 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0x60000, "384 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0x70000, "448 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0x80000, "512 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0x90000, "576 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0xA0000, "640 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0xB0000, "704 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0xC0000, "768 K (100-B MEMORY OPTION)")
- PORT_DIPSETTING(0xD0000, "832 K (100-B MEMORY OPTION)") // see END_OF_RAM
- PORT_DIPSETTING(0xE0000, "896 K (100-B MAX. MEMORY)")
+ // FLOPPY, BUNDLE, GRAPHICS affect 'system_parameter_r':
// EXT.COMM.card -or- RD51 HD. controller (marketed later).
PORT_START("DEC HARD DISK") // BUNDLE_OPTION
@@ -1139,63 +1179,12 @@ static INPUT_PORTS_START(rainbow100b_in)
PORT_DIPSETTING(0x03, "DUAL MONITOR (SCREEN 1: TEXT; SCREEN 2: R-G-B)")
INPUT_PORTS_END
-void rainbow_state::machine_reset()
+void rainbow_base_state::machine_reset()
{
// 'F3' (in partial emulation) here replaces 'CTRL-SETUP' (soft reboot on an original Rainbow)
// FIXME: BIOS reports error 19 when CTRL-SETUP is pressed (Z80 or flags aren't fully reset then?)
popmessage("Reset");
- // Configure RAM
- address_space &program = m_i8088->space(AS_PROGRAM);
- uint32_t unmap_start = m_inp8->read();
-
- // Verify RAM size matches hardware (DIP switches)
-
-#ifdef ASSUME_RAINBOW_A_HARDWARE
- logerror("*** RAINBOW A MODEL ASSUMED (64 - 832 K RAM).\n");
- if (unmap_start > 0xD0000)
- {
- unmap_start = 0xD0000; // hardware limit 832 K (possibly as low as 256 K) [?]
- logerror("WARNING: 896 K is not a valid memory configuration on Rainbow 100 A!\n");
- }
-
- uint32_t check = (unmap_start >> 16)-1; // guess.
- uint8_t nvram_location = m_p_nvram[0x84]; // location not verified yet. DMT RAM check tests offset $84 !
-
- #ifdef RTC_ENABLED
- // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-A' ***************************************
- program.install_read_handler(RTC_BASE, RTC_BASE, read8_delegate(*this, FUNC(rainbow_state::rtc_r)));
- program.install_write_handler(RTC_BASE + 0xFE, RTC_BASE + 0xFF, write8_delegate(*this, FUNC(rainbow_state::rtc_w)));
- // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-A' ***************************************
- #endif
-
-#else
- logerror("*** RAINBOW B MODEL ASSUMED (128 - 896 K RAM)\n");
- if (unmap_start < 0x20000)
- {
- unmap_start = 0x20000; // 128 K minimum
- logerror("WARNING: 64 K is not a valid memory size on Rainbow 100-B!\n");
- }
-
- uint32_t check = (unmap_start >> 16) - 2;
- uint8_t nvram_location = m_p_nvram[0xdb];
-
- #ifdef RTC_ENABLED
- // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-B' ***************************************
- // No address space needed ( -> IRQs must be disabled to block ROM accesses during reads ).
- program.install_read_handler(RTC_BASE, RTC_BASE + 0x2104, read8_delegate(*this, FUNC(rainbow_state::rtc_r)));
- // *********************************** / DS1315 'PHANTOM CLOCK' IMPLEMENTATION FOR 'DEC-100-B' ***************************************
- #endif
-#endif
- if (check != nvram_location)
- logerror("NOTE: RAM configuration does not match NVRAM.\nUNMAP_START = %05x NVRAM VALUE = %02x SHOULD BE: %02x\n", unmap_start, nvram_location, check);
-
- if (END_OF_RAM > unmap_start)
- {
- logerror("Unmapping from %x to %x\n",unmap_start, END_OF_RAM);
- program.unmap_readwrite(unmap_start, END_OF_RAM);
- }
-
m_crtc->MHFU(MHFU_RESET_and_DISABLE);
m_rtc->chip_reset(); // * Reset RTC to a defined state *
@@ -1206,8 +1195,8 @@ void rainbow_state::machine_reset()
{
// Install 8088 read / write handler
io.unmap_readwrite(0x60, 0x60);
- io.install_read_handler(0x60, 0x60, read8_delegate(*this, FUNC(rainbow_state::hd_status_60_r)));
- io.install_write_handler(0x60, 0x60, write8_delegate(*this, FUNC(rainbow_state::hd_status_60_w)));
+ io.install_read_handler(0x60, 0x60, read8_delegate(*this, FUNC(rainbow_base_state::hd_status_60_r)));
+ io.install_write_handler(0x60, 0x60, write8_delegate(*this, FUNC(rainbow_base_state::hd_status_60_w)));
hdc_reset();
m_hdc_drive_ready = true;
@@ -1294,8 +1283,20 @@ void rainbow_state::machine_reset()
output().set_value("led_hold", 0); // led11
}
+void rainbow_modela_state::machine_reset()
+{
+ rainbow_base_state::machine_reset();
+ logerror("*** RAINBOW A MODEL ASSUMED (64 - 832 K RAM).\n");
+}
+
+void rainbow_modelb_state::machine_reset()
+{
+ rainbow_base_state::machine_reset();
+ logerror("*** RAINBOW B MODEL ASSUMED (128 - 896 K RAM)\n");
+}
+
// Simulate AC_OK signal (power good) and RESET after ~ 108 ms.
-void rainbow_state::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
+void rainbow_base_state::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
{
switch (tid)
{
@@ -1331,7 +1332,7 @@ void rainbow_state::device_timer(emu_timer &timer, device_timer_id tid, int para
} // switch (timer ID)
}
-uint32_t rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t rainbow_base_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
static int old_monitor;
@@ -1366,7 +1367,7 @@ uint32_t rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind1
}
// Interrupt handling and arbitration. See 3.1.3.8 OF PC-100 spec.
-void rainbow_state::update_8088_irqs()
+void rainbow_base_state::update_8088_irqs()
{
if (m_irq_mask != 0)
{
@@ -1386,13 +1387,13 @@ void rainbow_state::update_8088_irqs()
}
-void rainbow_state::raise_8088_irq(int ref)
+void rainbow_base_state::raise_8088_irq(int ref)
{
m_irq_mask |= (1 << ref);
update_8088_irqs();
}
-void rainbow_state::lower_8088_irq(int ref)
+void rainbow_base_state::lower_8088_irq(int ref)
{
m_irq_mask &= ~(1 << ref);
update_8088_irqs();
@@ -1400,7 +1401,7 @@ void rainbow_state::lower_8088_irq(int ref)
// IRQ service for 7201 (commm / printer)
-void rainbow_state::update_mpsc_irq()
+void rainbow_base_state::update_mpsc_irq()
{
if (m_mpsc_irq == 0)
lower_8088_irq(IRQ_COMM_PTR_INTR_L);
@@ -1408,14 +1409,14 @@ void rainbow_state::update_mpsc_irq()
raise_8088_irq(IRQ_COMM_PTR_INTR_L);
}
-WRITE_LINE_MEMBER(rainbow_state::mpsc_irq)
+WRITE_LINE_MEMBER(rainbow_base_state::mpsc_irq)
{
m_mpsc_irq = state;
update_mpsc_irq();
}
// PORT 0x06 : Communication bit rates (see page 21 of PC 100 SPEC)
-WRITE8_MEMBER(rainbow_state::comm_bitrate_w)
+WRITE8_MEMBER(rainbow_base_state::comm_bitrate_w)
{
m_dbrg->str_w(data & 0x0f); // PDF is wrong, low nibble is RECEIVE clock (verified in SETUP).
logerror("\n(COMM.) receive bitrate = %d ($%02x)\n", comm_rates[data & 0x0f] , data & 0x0f);
@@ -1425,7 +1426,7 @@ WRITE8_MEMBER(rainbow_state::comm_bitrate_w)
}
// PORT 0x0e : Printer bit rates
-WRITE8_MEMBER(rainbow_state::printer_bitrate_w)
+WRITE8_MEMBER(rainbow_base_state::printer_bitrate_w)
{
m_printer_bitrate = data & 7;
// bits 0 - 2 = 0: nominally 75 bps, actually 75.35 bps
@@ -1443,17 +1444,17 @@ WRITE8_MEMBER(rainbow_state::printer_bitrate_w)
logerror(" - CLOCK (0 = internal): %02x", data & 8);
}
-WRITE_LINE_MEMBER(rainbow_state::dbrg_fr_w)
+WRITE_LINE_MEMBER(rainbow_base_state::dbrg_fr_w)
{
m_mpsc->rxca_w(state);
}
-WRITE_LINE_MEMBER(rainbow_state::dbrg_ft_w)
+WRITE_LINE_MEMBER(rainbow_base_state::dbrg_ft_w)
{
m_mpsc->txca_w(state);
}
-WRITE8_MEMBER(rainbow_state::bitrate_counter_w)
+WRITE8_MEMBER(rainbow_base_state::bitrate_counter_w)
{
bool prt_rxtxc = BIT(data, 7 - m_printer_bitrate);
bool kbd_rxtxc = BIT(data, 1);
@@ -1470,20 +1471,20 @@ WRITE8_MEMBER(rainbow_state::bitrate_counter_w)
// Shared memory is contended by refresh, concurrent
// 8088 accesses and arbitration logic (DMA).
-READ8_MEMBER(rainbow_state::share_z80_r)
+READ8_MEMBER(rainbow_base_state::share_z80_r)
{
if (m_zflip)
{
if (offset < 0x8000)
{
- return m_shared[offset + 0x8000];
+ return m_ram->read(offset + 0x8000);
}
else if (offset < 0x8800)
{
return m_z80_private[offset & 0x7ff]; // SRAM
}
- return m_shared[offset ^ 0x8000];
+ return m_ram->read(offset ^ 0x8000);
}
else
{
@@ -1492,17 +1493,17 @@ READ8_MEMBER(rainbow_state::share_z80_r)
return m_z80_private[offset]; // SRAM
}
- return m_shared[offset];
+ return m_ram->read(offset);
}
}
-WRITE8_MEMBER(rainbow_state::share_z80_w)
+WRITE8_MEMBER(rainbow_base_state::share_z80_w)
{
if (m_zflip)
{
if (offset < 0x8000)
{
- m_shared[offset + 0x8000] = data;
+ m_ram->write(offset + 0x8000, data);
return; // [!]
}
else if (offset < 0x8800)
@@ -1511,28 +1512,40 @@ WRITE8_MEMBER(rainbow_state::share_z80_w)
return; // [!]
}
- m_shared[offset ^ 0x8000] = data;
+ m_ram->write(offset ^ 0x8000, data);
}
else
{
if (offset < 0x800)
m_z80_private[offset] = data; // SRAM
else
- m_shared[offset] = data;
+ m_ram->write(offset, data);
}
return;
}
+READ8_MEMBER(rainbow_base_state::ext_ram_r)
+{
+ if (offset < m_ram->size())
+ return m_ram->read(offset);
+ return 0;
+}
+
+WRITE8_MEMBER(rainbow_modela_state::ext_ram_w)
+{
+ if (offset < m_ram->size())
+ m_ram->write(offset, data);
+}
+
// NMI logic (parity test)
-WRITE8_MEMBER(rainbow_state::ext_ram_w)
+WRITE8_MEMBER(rainbow_modelb_state::ext_ram_w)
{
- m_ext_ram[offset] = data;
+ if (offset < m_ram->size())
+ m_ram->write(offset, data);
-#ifndef OLD_RAM_BOARD_PRESENT
if (m_diagnostic & 0x08)
- if ((offset + 0x10000) >= (MOTHERBOARD_RAM + 1))
+ if (offset >= 0x10000)
m_i8088->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
-#endif
}
// ------------------------ClikClok (for 100-A; DS1315) ------------------------------------------
@@ -1540,7 +1553,7 @@ WRITE8_MEMBER(rainbow_state::ext_ram_w)
// Requires a short program from the Suitable Solutions ClikClok distribution disk (CLIKA.COM)
// - also needed to set time/date (*). Reads $ed000, writes ed0fe/ed0ff.
-WRITE8_MEMBER(rainbow_state::rtc_w)
+WRITE8_MEMBER(rainbow_base_state::rtc_w)
{
if (m_inp11->read() == 0x01) // if enabled...
{
@@ -1567,19 +1580,28 @@ WRITE8_MEMBER(rainbow_state::rtc_w)
// ------------------------ClikClok (for 100-B; DS1315) ------------------------------------------------
// Add-on hardware, occupies one of the EPROM sockets of the 100-B. TODO: check address decoders on board
// Requires CLIKCLOK.COM or RBCLIK21.COM (freeware from Latrobe). Uses FC000/FE000.
-READ8_MEMBER(rainbow_state::rtc_r)
+READ8_MEMBER(rainbow_modela_state::rtc_r)
{
if (m_inp11->read() == 0x01) // if enabled...
{
- switch (offset)
+ if (offset == 0x00) // read time/date from 0xED000 (ClikClok for 100-A)
{
-#ifdef ASSUME_RAINBOW_A_HARDWARE
- case 0x00: // read time/date from 0xED000 (ClikClok for 100-A)
if (m_rtc->chip_enable())
return m_rtc->read_data() & 0x01;
else
m_rtc->chip_reset();
-#else
+ }
+ }
+
+ return m_p_vol_ram[offset]; // return volatile RAM
+}
+
+READ8_MEMBER(rainbow_modelb_state::rtc_r)
+{
+ if (m_inp11->read() == 0x01) // if enabled...
+ {
+ switch (offset)
+ {
// Transfer data to DS1315 (data = offset):
case 0x0000: // RTC_WRITE_DATA_0 0xFC000
case 0x2000: // RTC_WRITE_DATA_0 0xFE000 (MIRROR)
@@ -1612,23 +1634,18 @@ READ8_MEMBER(rainbow_state::rtc_r)
case 0x2104: // 0xFE104 (MIRROR)
m_rtc->chip_reset();
break;
-#endif
}
}
-#ifdef ASSUME_RAINBOW_A_HARDWARE
- return m_p_vol_ram[offset]; // return volatile RAM
-#else
uint8_t *rom = memregion("maincpu")->base();
- return rom[RTC_BASE + offset]; // return ROM
-#endif
+ return rom[0xfc000 + offset]; // return ROM
}
// ------------------------/ ClikClok (for model B; DS1315) -------------------------------
// --------------------------------- Corvus (B/H) -----------------------------------------
// PORT 0x21 : Corvus status register (ready / direction)
-READ8_MEMBER(rainbow_state::corvus_status_r)
+READ8_MEMBER(rainbow_base_state::corvus_status_r)
{
if (m_inp6->read() == 0) // Corvus controller
{
@@ -1652,7 +1669,7 @@ READ8_MEMBER(rainbow_state::corvus_status_r)
// ---------------------------- RD51 HARD DISK CONTROLLER ----------------------------------
static const int SECTOR_SIZES[4] = { 256, 512, 1024, 128 };
-void rainbow_state::hdc_reset()
+void rainbow_base_state::hdc_reset()
{
// logerror(">> HARD DISC CONTROLLER RESET <<\n");
m_hdc->reset();
@@ -1672,7 +1689,7 @@ void rainbow_state::hdc_reset()
// Return 'hard_disk_file' object for harddisk 1 (fixed).
// < nullptr if geometry is insane or other errors occured >
-hard_disk_file *rainbow_state::rainbow_hdc_file(int drv)
+hard_disk_file *rainbow_base_state::rainbow_hdc_file(int drv)
{
m_hdc_drive_ready = false;
@@ -1734,7 +1751,7 @@ static uint32_t get_and_print_lbasector(device_t *device, hard_disk_info *info,
}
// READ SECTOR (on BCS 1 -> 0 transition)
-WRITE_LINE_MEMBER(rainbow_state::hdc_read_sector)
+WRITE_LINE_MEMBER(rainbow_base_state::hdc_read_sector)
{
static int last_state;
int read_status = 1;
@@ -1802,7 +1819,7 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_read_sector)
// ...IF WRITE_GATE (WG) TRANSITS FROM 1 -> 0
// NO PROVISIONS for sector sizes != 512 or MULTIPLE DRIVES (> 0) !!!
-WRITE_LINE_MEMBER(rainbow_state::hdc_write_sector)
+WRITE_LINE_MEMBER(rainbow_base_state::hdc_write_sector)
{
int success = 0;
static int wg_last;
@@ -1850,7 +1867,7 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_write_sector)
// 99 = SUCCESS : SECTOR WRITTEN
// * RELIES * ON THE FACT THAT THERE WILL BE NO MULTI SECTOR TRANSFERS (!)
-int rainbow_state::do_write_sector()
+int rainbow_base_state::do_write_sector()
{
int feedback = 0; // no error
output().set_value("led1", 0); // ON
@@ -1899,7 +1916,7 @@ int rainbow_state::do_write_sector()
}
-READ8_MEMBER(rainbow_state::hd_status_60_r)
+READ8_MEMBER(rainbow_base_state::hd_status_60_r)
{
int data = m_hdc_buffer[m_hdc_buf_offset];
//logerror("HARD DISK DISK BUFFER: READ offset %04x | data = %02x\n", m_hdc_buf_offset, data); // ! DO NOT CHANGE ORDER !
@@ -1913,7 +1930,7 @@ READ8_MEMBER(rainbow_state::hd_status_60_r)
return data;
}
-WRITE8_MEMBER(rainbow_state::hd_status_60_w)
+WRITE8_MEMBER(rainbow_base_state::hd_status_60_w)
{
//logerror("HARD DISK BUFFER: WRITE offset %04x | data = %02x\n", m_hdc_buf_offset, data);
@@ -1935,7 +1952,7 @@ WRITE8_MEMBER(rainbow_state::hd_status_60_w)
// - 3 hard-wired controller module identification bits.
// - signals from the WD1010 chip,
// - disk drive(latched status signals)
-READ8_MEMBER(rainbow_state::hd_status_68_r)
+READ8_MEMBER(rainbow_base_state::hd_status_68_r)
{
// (*) Bits 5-7 : HARD WIRED IDENTIFICATION BITS, bits 5+7 = 1 and bit 6 = 0 (= 101 f?r RD51 module)
int data = 0xe0; // 111 gives DRIVE NOT READY (when W is pressed on boot screen)
@@ -1981,7 +1998,7 @@ READ8_MEMBER(rainbow_state::hd_status_68_r)
// 68 (WRITE): Secondary Command Registers (68H) - - "write-only register for commands"
// - see TABLE 4.8 (4-24)
-WRITE8_MEMBER(rainbow_state::hd_status_68_w)
+WRITE8_MEMBER(rainbow_base_state::hd_status_68_w)
{
// Bit 4-7 : --- not used / reserved
@@ -2041,7 +2058,7 @@ inhibited.
7 Track 0 - The disk drive sets this bit high (1) when the R/W heads are
positioned over cylinder 0 (the data track furthest away from the spindle).
*/
-READ8_MEMBER(rainbow_state::hd_status_69_r)
+READ8_MEMBER(rainbow_base_state::hd_status_69_r)
{
int hs = m_hdc->read(0x06) & (1 + 2 + 4); // SDH bits 0-2 = HEAD #
// logerror("(x69 READ) %i = HEAD SELECT WD1010\n", hs);
@@ -2071,7 +2088,7 @@ READ8_MEMBER(rainbow_state::hd_status_69_r)
}
// TREAT SIGNALS FROM / TO CONTROLLER
-WRITE_LINE_MEMBER(rainbow_state::hdc_step)
+WRITE_LINE_MEMBER(rainbow_base_state::hdc_step)
{
m_hdc_step_latch = true;
@@ -2079,23 +2096,23 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_step)
switch_off_timer->adjust(attotime::from_msec(500));
}
-WRITE_LINE_MEMBER(rainbow_state::hdc_direction)
+WRITE_LINE_MEMBER(rainbow_base_state::hdc_direction)
{
m_hdc_direction = state; // (0 = OUT)
}
-READ_LINE_MEMBER(rainbow_state::hdc_drive_ready)
+READ_LINE_MEMBER(rainbow_base_state::hdc_drive_ready)
{
return m_hdc_drive_ready;
}
-READ_LINE_MEMBER(rainbow_state::hdc_write_fault)
+READ_LINE_MEMBER(rainbow_base_state::hdc_write_fault)
{
return m_hdc_write_fault;
}
// Buffer counter reset when BCR goes from 0 -> 1
-WRITE_LINE_MEMBER(rainbow_state::hdc_bcr)
+WRITE_LINE_MEMBER(rainbow_base_state::hdc_bcr)
{
static int bcr_state;
if (bcr_state == 0 && state == 1)
@@ -2103,7 +2120,7 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_bcr)
bcr_state = state;
}
-void rainbow_state::hdc_buffer_counter_reset()
+void rainbow_base_state::hdc_buffer_counter_reset()
{
m_hdc->buffer_ready(false);
m_hdc_buf_offset = 0;
@@ -2115,7 +2132,7 @@ void rainbow_state::hdc_buffer_counter_reset()
// On a WRITE / FORMAT command, signal goes high when the WD1010
// chip is READY TO ACCESS the information in the sector buffer.
-WRITE_LINE_MEMBER(rainbow_state::hdc_bdrq)
+WRITE_LINE_MEMBER(rainbow_base_state::hdc_bdrq)
{
static int old_state;
// logerror("BDRQ - BUFFER DATA REQUEST OBTAINED: %u\n", state);
@@ -2133,7 +2150,7 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_bdrq)
// IRQ service for both RD51 and COMM. OPTION
-void rainbow_state::update_bundle_irq()
+void rainbow_base_state::update_bundle_irq()
{
if (m_bdl_irq == 0)
{
@@ -2148,14 +2165,14 @@ void rainbow_state::update_bundle_irq()
}
}
-WRITE_LINE_MEMBER(rainbow_state::bundle_irq)
+WRITE_LINE_MEMBER(rainbow_base_state::bundle_irq)
{
m_bdl_irq = state;
update_bundle_irq();
}
-READ8_MEMBER(rainbow_state::system_parameter_r)
+READ8_MEMBER(rainbow_modela_state::system_parameter_r)
{
/* Info about option boards is in bits 0 - 3:
SYSTEM PARAMETER INFORMATION: see AA-P308A-TV page 92 section 14.0
@@ -2171,12 +2188,27 @@ READ8_MEMBER(rainbow_state::system_parameter_r)
*/
return ((m_inp5->read() == 1 ? 0 : 1) |
(m_inp7->read() == 1 ? 0 : 4) | // Floppy is always present (bit 1 zero)
-#ifdef OLD_RAM_BOARD_PRESENT
- (m_inp8->read() > MOTHERBOARD_RAM ? 0 : 8) |
-#else
- 8 | // unverified
-#endif
- 16 | 32 | 64 | 128); // unverified
+ (m_ram->size() > 0x10000 ? 0 : 8) |
+ 0xf0); // unverified
+}
+
+READ8_MEMBER(rainbow_modelb_state::system_parameter_r)
+{
+ /* Info about option boards is in bits 0 - 3:
+ SYSTEM PARAMETER INFORMATION: see AA-P308A-TV page 92 section 14.0
+ Bundle card (1) | Floppy (2) | Graphics (4) | Memory option (8)
+ 0 1 2 3 4 5 6 7
+ B F G M
+ (bit SET means NOT present; 4-7 reserved )
+
+ B : no separation between the 2 available 'bundle cards' (HD controller / COMM.OPTION) ?
+
+ M : old RAM extension (128 / 192 K ?) detected with OPTION_PRESENT bit, newer models 'by presence'.
+ BIOS uses a seperate IRQ vector for RAM board detection (at least on a 100-B).
+ */
+ return ((m_inp5->read() == 1 ? 0 : 1) |
+ (m_inp7->read() == 1 ? 0 : 4) | // Floppy is always present (bit 1 zero)
+ 0xf8); // unverified
}
// [02] COMMUNICATIONS STATUS REGISTER - PAGE 154 (**** READ **** )
@@ -2188,7 +2220,7 @@ READ8_MEMBER(rainbow_state::system_parameter_r)
// 2 COMM DSR (reflects status of DSR at COMM)
// 3 COMM CTS (reflects status of CTS at COMM)
// 4 COMM RLSD (receive line signal detect at COMM; also connected to DCDA on MPSC)
-READ8_MEMBER(rainbow_state::comm_control_r)
+READ8_MEMBER(rainbow_base_state::comm_control_r)
{
bool is_mhfu_enabled = false;
if (m_power_good)
@@ -2211,7 +2243,7 @@ READ8_MEMBER(rainbow_state::comm_control_r)
// 1 COMM SRTS H (controls secondary request to send line of COMM)
// 2 COMM DTR L (controls terminal ready line of COMM)
// 3 COMM RTS (controls request to send line of COMM)
-WRITE8_MEMBER(rainbow_state::comm_control_w)
+WRITE8_MEMBER(rainbow_base_state::comm_control_w)
{
logerror("%02x to COMM.CONTROL REGISTER ", data);
@@ -2233,7 +2265,7 @@ WRITE8_MEMBER(rainbow_state::comm_control_w)
// 8088 writes to port 0x00 (interrupts Z80)
// See page 133 (4-34)
-WRITE8_MEMBER(rainbow_state::i8088_latch_w)
+WRITE8_MEMBER(rainbow_base_state::i8088_latch_w)
{
// logerror("%02x to Z80 mailbox\n", data);
@@ -2248,7 +2280,7 @@ WRITE8_MEMBER(rainbow_state::i8088_latch_w)
// Z80 reads port 0x00
// See page 134 (4-35)
-READ8_MEMBER(rainbow_state::z80_latch_r)
+READ8_MEMBER(rainbow_base_state::z80_latch_r)
{
// logerror("Read %02x from Z80 mailbox\n", m_z80_mailbox);
m_z80->set_input_line(0, CLEAR_LINE);
@@ -2259,7 +2291,7 @@ READ8_MEMBER(rainbow_state::z80_latch_r)
// Z80 writes to port 0x00 (interrupts 8088)
// See page 134 (4-35)
-WRITE8_MEMBER(rainbow_state::z80_latch_w)
+WRITE8_MEMBER(rainbow_base_state::z80_latch_w)
{
// logerror("%02x to 8088 mailbox\n", data);
raise_8088_irq(IRQ_8088_MAILBOX);
@@ -2269,7 +2301,7 @@ WRITE8_MEMBER(rainbow_state::z80_latch_w)
}
// 8088 reads port 0x00. See page 133 (4-34)
-READ8_MEMBER(rainbow_state::i8088_latch_r)
+READ8_MEMBER(rainbow_base_state::i8088_latch_r)
{
// logerror("Read %02x from 8088 mailbox\n", m_8088_mailbox);
lower_8088_irq(IRQ_8088_MAILBOX);
@@ -2279,13 +2311,13 @@ READ8_MEMBER(rainbow_state::i8088_latch_r)
}
// (Z80) : WRITE to 0x20
-WRITE8_MEMBER(rainbow_state::z80_diskdiag_read_w)
+WRITE8_MEMBER(rainbow_base_state::z80_diskdiag_read_w)
{
m_zflip = true; // "a write to 20H will _SET_ ZFLIP"
}
// (Z80) : PORT 21H * WRITE *
-WRITE8_MEMBER(rainbow_state::z80_diskdiag_write_w)
+WRITE8_MEMBER(rainbow_base_state::z80_diskdiag_write_w)
{
/* Z80 LEDs:
4 5 6 <- bit #
@@ -2300,7 +2332,7 @@ WRITE8_MEMBER(rainbow_state::z80_diskdiag_write_w)
}
// (Z80) : PORT 20H / 21H _READ_
-READ8_MEMBER(rainbow_state::z80_generalstat_r)
+READ8_MEMBER(rainbow_base_state::z80_generalstat_r)
{
/*
General / diag.status register Z80 / see page 157 (table 4-18).
@@ -2366,7 +2398,7 @@ READ8_MEMBER(rainbow_state::z80_generalstat_r)
// (Z80) : PORT 40H _READ_
// 40H diskette status Register **** READ ONLY *** ( 4-60 of TM100.pdf )
-READ8_MEMBER(rainbow_state::z80_diskstatus_r)
+READ8_MEMBER(rainbow_base_state::z80_diskstatus_r)
{
int track = 0xEE;
int data = m_z80_diskcontrol & (255 - 0x80 - 0x40 - 0x20 - 0x04); // 00011011
@@ -2414,7 +2446,7 @@ READ8_MEMBER(rainbow_state::z80_diskstatus_r)
// ALL SIGNALS ARE HIGH ACTIVE (H), EXCEPT:
// BIT 5 : SIDE 0 L : For single sided drives, this bit is always set to 0 for side O.
-WRITE8_MEMBER(rainbow_state::z80_diskcontrol_w)
+WRITE8_MEMBER(rainbow_base_state::z80_diskcontrol_w)
{
int enable_start;
int disable_start; // set defaults
@@ -2505,7 +2537,7 @@ WRITE8_MEMBER(rainbow_state::z80_diskcontrol_w)
}
// --------- END OF Z80 --------------------
-READ8_MEMBER(rainbow_state::read_video_ram_r)
+READ8_MEMBER(rainbow_base_state::read_video_ram_r)
{
return m_p_ram[offset];
}
@@ -2518,7 +2550,7 @@ READ8_MEMBER(rainbow_state::read_video_ram_r)
// **************************************************
// CPU acknowledge of VBL IRQ resets counter
-IRQ_CALLBACK_MEMBER(rainbow_state::irq_callback)
+IRQ_CALLBACK_MEMBER(rainbow_base_state::irq_callback)
{
int intnum = -1;
for (int i = IRQ_8088_VBL; i >= 0; i--)
@@ -2538,7 +2570,7 @@ IRQ_CALLBACK_MEMBER(rainbow_state::irq_callback)
// NEC7220 Vsync IRQ ***************************************** GDC
// VERIFY: SCROLL_MAP & COLOR_MAP are updated at the next VSYNC (not immediately)... Are there more registers?
-WRITE_LINE_MEMBER(rainbow_state::GDC_vblank_irq)
+WRITE_LINE_MEMBER(rainbow_base_state::GDC_vblank_irq)
{
// VERIFICATION NEEDED: IRQ raised before or after new palette loaded...?
if (m_gdc_mode_register & GDC_MODE_ENABLE_VSYNC_IRQ) // 0x40
@@ -2630,7 +2662,7 @@ WRITE_LINE_MEMBER(rainbow_state::GDC_vblank_irq)
} // 7220 vblank IRQ
-WRITE_LINE_MEMBER(rainbow_state::video_interrupt)
+WRITE_LINE_MEMBER(rainbow_base_state::video_interrupt)
{
if (state == ASSERT_LINE)
raise_8088_irq(IRQ_8088_VBL);
@@ -2651,12 +2683,12 @@ WRITE_LINE_MEMBER(rainbow_state::video_interrupt)
}
// Reflects bits from 'diagnostic_w' (1:1), except test jumpers
-READ8_MEMBER(rainbow_state::diagnostic_r) // 8088 (port 0A READ). Fig.4-29 + table 4-15
+READ8_MEMBER(rainbow_base_state::diagnostic_r) // 8088 (port 0A READ). Fig.4-29 + table 4-15
{
return ((m_diagnostic & 0xf1) | m_inp1->read() | m_inp2->read() | m_inp3->read());
}
-WRITE8_MEMBER(rainbow_state::diagnostic_w) // 8088 (port 0A WRITTEN). Fig.4-28 + table 4-15
+WRITE8_MEMBER(rainbow_base_state::diagnostic_w) // 8088 (port 0A WRITTEN). Fig.4-28 + table 4-15
{
// logerror("%02x to diag port (PC=%x)\n", data, m_i8088->pc());
@@ -2773,7 +2805,7 @@ WRITE8_MEMBER(rainbow_state::diagnostic_w) // 8088 (port 0A WRITTEN). Fig.4-28 +
}
// KEYBOARD
-void rainbow_state::update_kbd_irq()
+void rainbow_base_state::update_kbd_irq()
{
if ((m_kbd_rx_ready) || (m_kbd_tx_ready))
raise_8088_irq(IRQ_8088_KBD);
@@ -2781,24 +2813,24 @@ void rainbow_state::update_kbd_irq()
lower_8088_irq(IRQ_8088_KBD);
}
-WRITE_LINE_MEMBER(rainbow_state::kbd_tx)
+WRITE_LINE_MEMBER(rainbow_base_state::kbd_tx)
{
m_lk201->rx_w(state);
}
-WRITE_LINE_MEMBER(rainbow_state::kbd_rxready_w)
+WRITE_LINE_MEMBER(rainbow_base_state::kbd_rxready_w)
{
m_kbd_rx_ready = (state == 1) ? true : false;
update_kbd_irq();
}
-WRITE_LINE_MEMBER(rainbow_state::kbd_txready_w)
+WRITE_LINE_MEMBER(rainbow_base_state::kbd_txready_w)
{
m_kbd_tx_ready = (state == 1) ? true : false;
update_kbd_irq();
}
-TIMER_DEVICE_CALLBACK_MEMBER(rainbow_state::hd_motor_tick)
+TIMER_DEVICE_CALLBACK_MEMBER(rainbow_base_state::hd_motor_tick)
{
if (m_power_good)
m_crtc->MHFU(MHFU_COUNT); // // Increment IF ENABLED and POWER_GOOD, return count
@@ -2806,14 +2838,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(rainbow_state::hd_motor_tick)
m_hdc_index_latch = true; // HDC drive index signal (not working ?)
}
-// on 100-B, DTR from the keyboard 8051 controls bit 7 of IRQ vectors
-WRITE_LINE_MEMBER(rainbow_state::irq_hi_w)
+WRITE_LINE_MEMBER(rainbow_modela_state::irq_hi_w)
{
-#ifdef ASSUME_MODEL_A_HARDWARE
m_irq_high = 0;
-#else
+}
+
+// on 100-B, DTR from the keyboard 8051 controls bit 7 of IRQ vectors
+WRITE_LINE_MEMBER(rainbow_modelb_state::irq_hi_w)
+{
m_irq_high = (state == ASSERT_LINE) ? 0x80 : 0;
-#endif
}
@@ -2823,7 +2856,7 @@ WRITE_LINE_MEMBER(rainbow_state::irq_hi_w)
// NOTE: "More than one plane at a time can be enabled for a write operation; however,
// only one plane can be enabled for a read operation at anyone time."
-READ16_MEMBER(rainbow_state::vram_r)
+READ16_MEMBER(rainbow_base_state::vram_r)
{
if ((!(m_gdc_mode_register & GDC_MODE_VECTOR)) || machine().side_effects_disabled()) // (NOT VECTOR MODE)
{
@@ -2844,7 +2877,7 @@ READ16_MEMBER(rainbow_state::vram_r)
}
// NOTE: Rainbow has separate registers for fore and background.
-WRITE16_MEMBER(rainbow_state::vram_w)
+WRITE16_MEMBER(rainbow_base_state::vram_w)
{
if (m_gdc_mode_register & GDC_MODE_HIGHRES)
offset = (m_gdc_scroll_buffer[(offset & 0x3FC0) >> 6] << 6) | (offset & 0x3F);
@@ -2925,7 +2958,7 @@ WRITE16_MEMBER(rainbow_state::vram_w)
// (READ)
// Read scroll buffer (see GDC Diagnostic Disk, SCROLL BUFFER test)
-READ8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_r)
+READ8_MEMBER(rainbow_base_state::GDC_EXTRA_REGISTER_r)
{
uint8_t data = 0;
switch (offset)
@@ -2958,7 +2991,7 @@ READ8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_r)
return data;
}
-WRITE8_MEMBER(rainbow_state::GDC_EXTRA_REGISTER_w)
+WRITE8_MEMBER(rainbow_base_state::GDC_EXTRA_REGISTER_w)
{
static int last_message, last_mode, last_readback, last_scroll_index;
@@ -3192,45 +3225,43 @@ static GFXDECODE_START(gfx_rainbow)
GFXDECODE_END
// Allocate 512 K (4 x 64 K x 16 bit) of memory (GDC):
-void rainbow_state::upd7220_map(address_map &map)
+void rainbow_base_state::upd7220_map(address_map &map)
{
- map(0x00000, 0x3ffff).rw(FUNC(rainbow_state::vram_r), FUNC(rainbow_state::vram_w)).share("vram");
+ map(0x00000, 0x3ffff).rw(FUNC(rainbow_base_state::vram_r), FUNC(rainbow_base_state::vram_w)).share("vram");
}
-void rainbow_state::rainbow(machine_config &config)
+void rainbow_base_state::rainbow_base(machine_config &config)
{
config.set_default_layout(layout_rainbow);
/* basic machine hardware */
I8088(config, m_i8088, 24.0734_MHz_XTAL / 5); // approximately 4.815 MHz
- m_i8088->set_addrmap(AS_PROGRAM, &rainbow_state::rainbow8088_map);
- m_i8088->set_addrmap(AS_IO, &rainbow_state::rainbow8088_io);
- m_i8088->set_irq_acknowledge_callback(FUNC(rainbow_state::irq_callback));
+ m_i8088->set_irq_acknowledge_callback(FUNC(rainbow_base_state::irq_callback));
Z80(config, m_z80, 24.0734_MHz_XTAL / 6);
- m_z80->set_addrmap(AS_PROGRAM, &rainbow_state::rainbowz80_mem);
- m_z80->set_addrmap(AS_IO, &rainbow_state::rainbowz80_io);
+ m_z80->set_addrmap(AS_PROGRAM, &rainbow_base_state::rainbowz80_mem);
+ m_z80->set_addrmap(AS_IO, &rainbow_base_state::rainbowz80_io);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(24.0734_MHz_XTAL / 6, 442, 0, 400, 264, 0, 240); // ~NTSC compatible video timing (?)
- screen.set_screen_update(FUNC(rainbow_state::screen_update_rainbow));
+ screen.set_screen_update(FUNC(rainbow_base_state::screen_update_rainbow));
screen.set_palette("vt100_video:palette");
GFXDECODE(config, "gfxdecode", "vt100_video:palette", gfx_rainbow);
RAINBOW_VIDEO(config, m_crtc, 24.0734_MHz_XTAL);
m_crtc->set_screen("screen");
m_crtc->set_chargen("chargen");
- m_crtc->ram_rd_callback().set(FUNC(rainbow_state::read_video_ram_r));
- m_crtc->vert_freq_intr_wr_callback().set(FUNC(rainbow_state::video_interrupt));
+ m_crtc->ram_rd_callback().set(FUNC(rainbow_base_state::read_video_ram_r));
+ m_crtc->vert_freq_intr_wr_callback().set(FUNC(rainbow_base_state::video_interrupt));
// *************************** COLOR GRAPHICS (OPTION) **************************************
// While the OSC frequency is confirmed, the divider is not (refresh rate is ~60 Hz with 32).
UPD7220(config, m_hgdc, 31188000 / 32); // Duell schematics shows a 31.188 Mhz oscillator (confirmed by RFKA).
- m_hgdc->vsync_wr_callback().set(FUNC(rainbow_state::GDC_vblank_irq)); // "The vsync callback line needs to be below the 7220 DEVICE_ADD line."
+ m_hgdc->vsync_wr_callback().set(FUNC(rainbow_base_state::GDC_vblank_irq)); // "The vsync callback line needs to be below the 7220 DEVICE_ADD line."
- m_hgdc->set_addrmap(0, &rainbow_state::upd7220_map);
- m_hgdc->set_display_pixels(FUNC(rainbow_state::hgdc_display_pixels));
+ m_hgdc->set_addrmap(0, &rainbow_base_state::upd7220_map);
+ m_hgdc->set_display_pixels(FUNC(rainbow_base_state::hgdc_display_pixels));
m_hgdc->set_screen(m_screen2); // set_screen needs to be added after 7720 device in the machine config, not after the screen.
PALETTE(config, m_palette2).set_entries(32);
@@ -3248,30 +3279,30 @@ void rainbow_state::rainbow(machine_config &config)
m_screen2->set_screen_update("upd7220", FUNC(upd7220_device::screen_update));
FD1793(config, m_fdc, 24.0734_MHz_XTAL / 24); // no separate 1 Mhz quartz
- FLOPPY_CONNECTOR(config, FD1793_TAG ":0", rainbow_floppies, "525qd", rainbow_state::floppy_formats);
- FLOPPY_CONNECTOR(config, FD1793_TAG ":1", rainbow_floppies, "525qd", rainbow_state::floppy_formats);
- FLOPPY_CONNECTOR(config, FD1793_TAG ":2", rainbow_floppies, "525qd", rainbow_state::floppy_formats);
- FLOPPY_CONNECTOR(config, FD1793_TAG ":3", rainbow_floppies, "525qd", rainbow_state::floppy_formats);
- //FLOPPY_CONNECTOR(config, FD1793_TAG ":2", rainbow_floppies, "525dd", rainbow_state::floppy_formats);
- //FLOPPY_CONNECTOR(config, FD1793_TAG ":3", rainbow_floppies, "35dd", rainbow_state::floppy_formats);
+ FLOPPY_CONNECTOR(config, FD1793_TAG ":0", rainbow_floppies, "525qd", rainbow_base_state::floppy_formats);
+ FLOPPY_CONNECTOR(config, FD1793_TAG ":1", rainbow_floppies, "525qd", rainbow_base_state::floppy_formats);
+ FLOPPY_CONNECTOR(config, FD1793_TAG ":2", rainbow_floppies, "525qd", rainbow_base_state::floppy_formats);
+ FLOPPY_CONNECTOR(config, FD1793_TAG ":3", rainbow_floppies, "525qd", rainbow_base_state::floppy_formats);
+ //FLOPPY_CONNECTOR(config, FD1793_TAG ":2", rainbow_floppies, "525dd", rainbow_base_state::floppy_formats);
+ //FLOPPY_CONNECTOR(config, FD1793_TAG ":3", rainbow_floppies, "35dd", rainbow_base_state::floppy_formats);
SOFTWARE_LIST(config, "flop_list").set_original("rainbow");
/// ********************************* HARD DISK CONTROLLER *****************************************
WD2010(config, m_hdc, 5000000); // 10 Mhz quartz on controller (divided by 2 for WCLK)
- m_hdc->out_intrq_callback().set(FUNC(rainbow_state::bundle_irq)); // FIRST IRQ SOURCE (OR'ed with DRQ)
- m_hdc->out_bdrq_callback().set(FUNC(rainbow_state::hdc_bdrq)); // BUFFER DATA REQUEST
+ m_hdc->out_intrq_callback().set(FUNC(rainbow_base_state::bundle_irq)); // FIRST IRQ SOURCE (OR'ed with DRQ)
+ m_hdc->out_bdrq_callback().set(FUNC(rainbow_base_state::hdc_bdrq)); // BUFFER DATA REQUEST
// SIGNALS -FROM- WD CONTROLLER:
- m_hdc->out_bcs_callback().set(FUNC(rainbow_state::hdc_read_sector)); // Problem: OUT_BCS_CB = WRITE8 ... (!)
- m_hdc->out_bcr_callback().set(FUNC(rainbow_state::hdc_bcr)); // BUFFER COUNTER RESET (pulses)
+ m_hdc->out_bcs_callback().set(FUNC(rainbow_base_state::hdc_read_sector)); // Problem: OUT_BCS_CB = WRITE8 ... (!)
+ m_hdc->out_bcr_callback().set(FUNC(rainbow_base_state::hdc_bcr)); // BUFFER COUNTER RESET (pulses)
- m_hdc->out_wg_callback().set(FUNC(rainbow_state::hdc_write_sector)); // WRITE GATE
- m_hdc->out_step_callback().set(FUNC(rainbow_state::hdc_step)); // STEP PULSE
- m_hdc->out_dirin_callback().set(FUNC(rainbow_state::hdc_direction));
+ m_hdc->out_wg_callback().set(FUNC(rainbow_base_state::hdc_write_sector)); // WRITE GATE
+ m_hdc->out_step_callback().set(FUNC(rainbow_base_state::hdc_step)); // STEP PULSE
+ m_hdc->out_dirin_callback().set(FUNC(rainbow_base_state::hdc_direction));
// WF + DRDY are actually wired to a routine here:
- m_hdc->in_wf_callback().set(FUNC(rainbow_state::hdc_write_fault)); // WRITE FAULT (fatal until next reset)
- m_hdc->in_drdy_callback().set(FUNC(rainbow_state::hdc_drive_ready)); // DRIVE_READY (VCC = ready)
+ m_hdc->in_wf_callback().set(FUNC(rainbow_base_state::hdc_write_fault)); // WRITE FAULT (fatal until next reset)
+ m_hdc->in_drdy_callback().set(FUNC(rainbow_base_state::hdc_drive_ready)); // DRIVE_READY (VCC = ready)
// Always set seek complete and track 00 signal (not super clean, but does not affect operation):
m_hdc->in_sc_callback().set_constant(1); // SEEK COMPLETE (VCC = complete)
@@ -3289,11 +3320,11 @@ void rainbow_state::rainbow(machine_config &config)
DS1315(config, m_rtc, 0); // DS1315 (ClikClok for DEC-100 B) * OPTIONAL *
COM8116_003(config, m_dbrg, 24.0734_MHz_XTAL / 4); // 6.01835 MHz (nominally 6 MHz)
- m_dbrg->fr_handler().set(FUNC(rainbow_state::dbrg_fr_w));
- m_dbrg->ft_handler().set(FUNC(rainbow_state::dbrg_ft_w));
+ m_dbrg->fr_handler().set(FUNC(rainbow_base_state::dbrg_fr_w));
+ m_dbrg->ft_handler().set(FUNC(rainbow_base_state::dbrg_ft_w));
UPD7201_NEW(config, m_mpsc, 24.0734_MHz_XTAL / 5 / 2); // 2.4073 MHz (nominally 2.5 MHz)
- m_mpsc->out_int_callback().set(FUNC(rainbow_state::mpsc_irq));
+ m_mpsc->out_int_callback().set(FUNC(rainbow_base_state::mpsc_irq));
m_mpsc->out_txda_callback().set(m_comm_port, FUNC(rs232_port_device::write_txd));
m_mpsc->out_txdb_callback().set("printer", FUNC(rs232_port_device::write_txd));
// RTS and DTR outputs are not connected
@@ -3315,10 +3346,9 @@ void rainbow_state::rainbow(machine_config &config)
printer.set_default_option("printer");
I8251(config, m_kbd8251, 24.0734_MHz_XTAL / 5 / 2);
- m_kbd8251->txd_handler().set(FUNC(rainbow_state::kbd_tx));
- m_kbd8251->dtr_handler().set(FUNC(rainbow_state::irq_hi_w));
- m_kbd8251->rxrdy_handler().set(FUNC(rainbow_state::kbd_rxready_w));
- m_kbd8251->txrdy_handler().set(FUNC(rainbow_state::kbd_txready_w));
+ m_kbd8251->txd_handler().set(FUNC(rainbow_base_state::kbd_tx));
+ m_kbd8251->rxrdy_handler().set(FUNC(rainbow_base_state::kbd_rxready_w));
+ m_kbd8251->txrdy_handler().set(FUNC(rainbow_base_state::kbd_txready_w));
LK201(config, m_lk201, 0);
m_lk201->tx_handler().set(m_kbd8251, FUNC(i8251_device::write_rxd));
@@ -3326,13 +3356,31 @@ void rainbow_state::rainbow(machine_config &config)
ripple_counter_device &prtbrg(RIPPLE_COUNTER(config, "prtbrg", 24.0734_MHz_XTAL / 6 / 13)); // 74LS393 at E17 (both halves)
// divided clock should ideally be 307.2 kHz, but is actually approximately 308.6333 kHz
prtbrg.set_stages(8);
- prtbrg.count_out_cb().set(FUNC(rainbow_state::bitrate_counter_w));
+ prtbrg.count_out_cb().set(FUNC(rainbow_base_state::bitrate_counter_w));
- TIMER(config, "motor").configure_periodic(FUNC(rainbow_state::hd_motor_tick), attotime::from_hz(60));
+ TIMER(config, "motor").configure_periodic(FUNC(rainbow_base_state::hd_motor_tick), attotime::from_hz(60));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
}
+void rainbow_modela_state::rainbow_modela(machine_config &config)
+{
+ rainbow_base(config);
+ m_i8088->set_addrmap(AS_PROGRAM, &rainbow_modela_state::rainbow8088_map);
+ m_i8088->set_addrmap(AS_IO, &rainbow_modela_state::rainbow8088_io);
+ RAM(config, m_ram).set_default_size("64K").set_extra_options("64K,128K,192K,256K,320K,384K,448K,512K,576K,640K,704K,768K");
+ m_kbd8251->dtr_handler().set(FUNC(rainbow_modela_state::irq_hi_w));
+}
+
+void rainbow_modelb_state::rainbow_modelb(machine_config &config)
+{
+ rainbow_base(config);
+ m_i8088->set_addrmap(AS_PROGRAM, &rainbow_modelb_state::rainbow8088_map);
+ m_i8088->set_addrmap(AS_IO, &rainbow_modelb_state::rainbow8088_io);
+ RAM(config, m_ram).set_default_size("128K").set_extra_options("128K,192K,256K,320K,384K,448K,512K,576K,640K,704K,768K,832K,896K");
+ m_kbd8251->dtr_handler().set(FUNC(rainbow_modelb_state::irq_hi_w));
+}
+
//----------------------------------------------------------------------------------------
// 'Rainbow 100-A' (system module 70-19974-00, PSU H7842-A)
// - first generation hardware (introduced May '82) with ROM 04.03.11
@@ -3437,7 +3485,7 @@ ROM_END
/* Driver */
-/* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS */
-COMP(1982, rainbow100a, rainbow, 0, rainbow, rainbow100b_in, rainbow_state, empty_init, "Digital Equipment Corporation", "Rainbow 100-A", MACHINE_IS_SKELETON)
-COMP(1983, rainbow, 0, 0, rainbow, rainbow100b_in, rainbow_state, empty_init, "Digital Equipment Corporation", "Rainbow 100-B", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS)
-COMP(1985, rainbow190, rainbow, 0, rainbow, rainbow100b_in, rainbow_state, empty_init, "Digital Equipment Corporation", "Rainbow 190-B", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_COLORS)
+/* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS */
+COMP(1982, rainbow100a, rainbow, 0, rainbow_modela, rainbow100b_in, rainbow_modela_state, empty_init, "Digital Equipment Corporation", "Rainbow 100-A", MACHINE_IS_SKELETON)
+COMP(1983, rainbow, 0, 0, rainbow_modelb, rainbow100b_in, rainbow_modelb_state, empty_init, "Digital Equipment Corporation", "Rainbow 100-B", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS)
+COMP(1985, rainbow190, rainbow, 0, rainbow_modelb, rainbow100b_in, rainbow_modelb_state, empty_init, "Digital Equipment Corporation", "Rainbow 190-B", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_COLORS)
diff --git a/src/mame/drivers/ramtek.cpp b/src/mame/drivers/ramtek.cpp
index a67b8758c23..7a2ec31cc97 100644
--- a/src/mame/drivers/ramtek.cpp
+++ b/src/mame/drivers/ramtek.cpp
@@ -10,9 +10,9 @@
Clean Sweep (1974/06) YES 501082A/B/C/D 501083A/B/C/D
Deluxe Baseball (1975/06) YES 550188
Hockey (1973/11) YES 500699 500629
- Horoscope (1976) UNKNOWN
+ Horoscope (1976/11) UNKNOWN
Knock Out (1974/09) YES 550300
- Lie Detector (1976) UNKNOWN Unreleased Unreleased
+ Lie Detector (1976/11) UNKNOWN Unreleased Unreleased
Sea Battle (1976/04) UNKNOWN
Soccer (1973/11) YES 500880 500889
Trivia (1975/11) YES 550436
diff --git a/src/mame/drivers/rcm32p.cpp b/src/mame/drivers/rcm32p.cpp
new file mode 100644
index 00000000000..806f4df0b72
--- /dev/null
+++ b/src/mame/drivers/rcm32p.cpp
@@ -0,0 +1,562 @@
+// license:BSD-3-Clause
+// copyright-holders:Valley Bell
+/*************************************************************************************************
+
+ Roland CM-32P driver
+
+ Driver by Valley Bell
+
+ Thanks to KitsuWhooa for the PCB layout diagram and part list.
+
+
+Notes:
+- When booting, it does a basic check by writing values 0..0xFF to 0x108A.
+ It then expects (value & 0x03) to be read back from 0x1080 and (value) to be read back from 0x1081/0x1082.
+ The routine for doing the check begins at 0x4686.
+ Succeeding means it ends up at 0x4801.
+- When in test mode, the firmware gets stuck in the loop at 0xBB06, waiting for Interrupt #5 (calls 0x4014) to fire.
+ It gets there by calling function 0xBBBB, which writes text (address w@0x40, num characters b@0x43) to the LCD screen.
+ This can be worked around by setting b@BB2D = 03.
+- The firmware gets also stuck in the loop at 0x7D70, waiting for Interrupt #8 (calls 0x4020).
+ This might be related to finding the best free voice?
+ You can exit the loop by setting b@7D80 = 00.
+- Test Mode shows the results of 4 checks:
+ 1. SRAM check
+ 2. MIDI IN/OUT check
+ 3. PCM ROM and card check
+ 4. RCC-CPU check
+ Errors in check 2 and 3 are "not abnormal".
+ In order to make check 2 pass successfully, you need to connect MIDI Out with MIDI In, creating a loopback.
+ Check 3 requires the SN-U110-04 PCM card ("Electric Grand & Clavi") to be inserted in order to succeed.
+- In order to access the built-in PCM ROM (IC18), the CPU asks the sound chip to read offsets 0x000000 .. 0x07FFFF.
+ The PCM card is accessed via offsets 0x080000 .. 0x0FFFFF.
+ The additional PCM ROMs are mapped to 0x100000 .. 0x17FFFF (IC19) and 0x200000 .. 0x27FFFF according to the sample table in IC18.
+- The sound chip has 32 voices. Voice 0 is reserved by the firmware for reading data from the PCM ROM.
+ The firmware allocates voices from back to front, i.e. voice 31 first.
+
+
+TODO:
+- actual sound emulation
+- add PCM card support
+
+
+PCB Layout
+----------
+
+PCM BOARD CM-32P ASSY 79554310 00
+
+| OUTPUT | PHONES | INPUT (MT-32) | MIDI IN | MIDI THROUGH | DC 9V |
+|----------------------------------------------------------------------|
+| JK2 JK4 JK3 JKLI JKRI CN4 JK1I JK1T JK5 |
+| |
+| SW1 |
+| || IC2 IC1 |
+| IC35 IC33 IC34 || IC31 IC30 CN0 |
+| CN3 ||<--IC32 |
+| |----| |----| |----| |
+| | | | | | | |
+| IC22 || IC24 |IC10| |IC9 | | | |
+| || IC25 IC4 | | | | | | |
+| ||<--IC23 |SRAM| |ROM | | | |
+| |----| |----| |IC3 | X1 |
+| |----| | | |
+| | IC | |------| | | |
+| | 17 | | IC16 | IC12 | | |
+| |----| |------| X2 |----| |
+| |------| IC13 |
+| IC6 |----||----||----| | IC15 | |
+| |-||-| | || || | |------| IC14 |------| |
+| | || | |IC20||IC19||IC18| | IC8 | |
+| |-||-| | || || | |------| |
+| IC7 |SMPL||SMPL||SMPL| |------------------| |
+| |ROM ||ROM ||ROM | | CN5 | |
+| |----||----||----| | | CN1 |
+|------------------------------|------------------|--------------------|
+ | |
+
+Parts:
+
+(All parts THT unless otherwise noted.)
+|-----------------------------------------------------------------------|
+| JK1I, JK1T | DIN 5 |
+| JK2, JK4, JKRI, JKLI | 1/4 Mono Jack |
+| JK3 | 1/4 Stereo Jack |
+| JK5 | DC Barrel Jack (Centre Negative) |
+| SW1 | SW PCB DPDT |
+| IC1 | 74HC04AP |
+| IC2 | TLP552 |
+| IC3 | P8098 (CPU) |
+| IC4 | M51953AL |
+| IC6, IC7 | M5M4464AP-12 |
+| IC8 | Roland R15239111 / M60012-0141FP (QFP) |
+| IC9 | AM27C512-150DC |
+| IC10 | TC5564APL-15 |
+| IC12 | 74HC00AP |
+| IC13 | 74HC02AP |
+| IC14 | 74HC32AP |
+| IC15 | Roland R15229894 / MB87419 (QFP) |
+| IC16 | Roland R15229895 / MB87420 (QFP) |
+| IC17 | Roland P15239126 / 23140-007 (QFP) |
+| IC18 | Roland R15179970 / MB834000A-20 3B1 |
+| IC19 | Roland R15179971 / MB834000A-20 3B2 |
+| IC20 | Roland R15179972 / HN62304BPE98 |
+| IC22 | PCM56P |
+| IC23 | M5238L |
+| IC24 | HD14052BP |
+| IC25 | NJM2082D |
+| IC30, IC31, IC33, IC34, IC35 | NJM4565DD |
+| IC32 | M5207L01 |
+| CN0 | 7805A |
+| CN1 | LED PCB |
+| CN3 | Volume Control PCB |
+| CN4 | unpopulated |
+| CN5 | PCM Card Slot |
+| X1 | Crystal 12MHz |
+| X2 | Crystal 32.768KHz |
+|-----------------------------------------------------------------------|
+
+
+PCM ROM Tables
+--------------
+Sample Table (address: 0x00100)
+------------
+Pos Len Description
+00 02 start offset, bits 0-15 (Little Endian)
+02 01 start offset, bits 16-18 (bits 0-2)
+ PCM card select (bit 3): set for sounds on PCM cards
+ ROM bank (bits 4-5):
+ 0 = IC18
+ 1 = IC19
+ 2 = IC20
+ loop mode (bits 6-7):
+ 0 = normal loop
+ 1 = no loop
+ 2 = ping-pong (forwards, backwards, forwards, backwards, ...)
+03 02 last sample (sample length = last sample + 1)
+05 02 loop length (loop start = sample length - loop length)
+07 01 ??
+08 01 reference note (when played back at 32000 Hz)
+09 01 ??
+-> 0Ah bytes per entry
+
+Tone List (address: 0x01000)
+---------
+Pos Len Description
+00 0A sample name
+0A 01 tone type
+ 00 - single
+ 01 - dual
+ 02 - detune
+ 03 - velocity mix
+ 04 - velocity switch
+ 05..07 - invalid
+ 08..0F/10..17/.../78..7F - same as 00..07
+ 80..FF - rhythm?
+0B 01 ??
+0C 02 ??
+0E 01 ??
+0F 01 ??
+10 0B some note IDs (padded with FF)
+1B 0C sample IDs (always one more than number of note IDs, padded with FF)
+27 09 ??
+30 0B some note IDs (padded with FF)
+3B 0C sample IDs (always one more than number of note IDs, padded with FF)
+47 09 ??
+-> 50h bytes per entry
+
+Note: Section 30..4F is only used with tone types 01, 03, 04
+
+
+CM-32P Firmware Work RAM Layout
+-------------------------------
+2100..22FF - MIDI data receive buffer
+
+2344..23C1 - Part 1..6 "Patch temporary area" (see manual page 21, 0x15 bytes per partial)
+23C4..23D4 - "System area" settings (see manual page 22, master volume, reverb setting, channel assignments)
+ 23CE-23D3 - Part 1..6 MIDI channel
+23D6..25B5 - Part 1..6 instrument data (0x50 bytes per partial, from PCM ROM at 0x1000/0x1050/0x10A0/...)
+25B8..2B57 - Part 1..6 sample table data (0xF0 bytes per partial, from PCM ROM at 0x0100/0x010A/0x0114/...)
+
+34DC..34E1 - Part 1..6 Modulation (CC #1, initialized with 0)
+34E2..34E7 - Part 1..6 Pitch Bend LSB (initialized with 0)
+34E8..34ED - Part 1..6 Pitch Bend MSB (initialized with 64)
+34EE..34F3 - Part 1..6 Expression setting (CC #11, initialized with 100)
+34F4..34F9 - Part 1..6 Sustain setting (CC #64, initialized with 0)
+34FA..34FF - Part 1..6 unused (initialized with 0)
+3500..3505 - Part 1..6 RPN LSB (CC #98, initialized with 0xFF)
+3506..350B - Part 1..6 RPN MSB (CC #99, initialized with 0xFF)
+350C..3511 - Part 1..6 NRPN received (initialized with 0xFF, set to 0 when RPN LSB/MSB is received, set to 0xFF when NRPN is received)
+3512..3517 - Part 1..6 ?? (initialized with 0)
+3518..351D - Part 1..6 Instrument setting
+351E - Reverb Mode
+351F - Reverb Time
+3521 - ?? (initialized with 1)
+352A..3889 - voice memory (32 bytes per block)
+ 35AA..35C9 - some jump table index for interrupt #8
+38DE..394D - more voice memory (32 bytes per block)
+
+397E..3??? - state of playing notes
+ 3986 - current panning volume, left speaker (00..1F)
+ 39A6 - current panning volume, right speaker (00..1F)
+ 39C6 - target panning volume, left speaker (00..1F)
+ 39E6 - target panning volume, right speaker (00..1F)
+
+3D7C..3E84 - SysEx receive data buffer
+
+Some routine locations
+----------------------
+0x4014 LCD related interrupt handler
+0x401C serial input (MIDI data) interrupt handler
+0x4020 some interrupt handler required while playing notes
+0x45CB Initialization (memory clear + checks), external memory is checked from 0x4679 on
+0x5024 decide whether or not Test Mode is entered (normal boot == jump to 0x502A)
+0x50F5 MIDI handling code
+0x65E8 PCM ROM instrument check
+0x6650 PCM card instrument check (Note: assumes that the SN-U110-04 PCM card is inserted)
+0x6EA4 play a note (parameters: 0040 - part, 0041 = note pitch, 0042 - velocity)
+0xB027 load instrument data from PCM ROM (writes to 23D6 + 50*i)
+0xB12B load instrument sample data from PCM ROM (reads sample IDs from 23D6+1B + 50*i, writes to 25B8 + F0*i)
+0xB1A0 load secondary instrument sample data from PCM ROM (reads sample IDs from 23D6+3B + 50h*i, writes to 25B8+50 + F0*i)
+0xB1E8 load 1 sample table entry from PCM ROM
+0xB316 PCM ROM signature check
+0xBBBB write text to LCD
+
+*/
+
+#include "emu.h"
+#include "cpu/mcs96/i8x9x.h"
+#include "machine/ram.h"
+#include "machine/timer.h"
+#include "video/msm6222b.h"
+#include "emupal.h"
+#include "screen.h"
+
+
+// unscramble address: ROM dump offset -> proper (descrambled) offset
+#define UNSCRAMBLE_ADDRESS(_offset) \
+ bitswap<19>(_offset,18,17,15,14,16,12,11, 7, 9,13,10, 8, 3, 2, 1, 6, 4, 5, 0)
+// scramble address: proper offset -> ROM dump offset
+#define SCRAMBLE_ADDRESS(_offset) \
+ bitswap<19>(_offset,18,17,14,16,15, 9,13,12, 8,10, 7,11, 3, 1, 2, 6, 5, 4, 0)
+
+#define UNSCRAMBLE_DATA(_data) \
+ bitswap<8>(_data,1,2,7,3,5,0,4,6)
+
+
+static INPUT_PORTS_START( cm32p )
+ PORT_START("A7")
+ PORT_BIT(0x03ff, 0x0000, IPT_DIAL) PORT_NAME("Knob") PORT_SENSITIVITY(50) PORT_KEYDELTA(8) PORT_CODE_DEC(KEYCODE_DOWN) PORT_CODE_INC(KEYCODE_UP)
+
+ PORT_START("SERVICE") // connected to Port 0 of the P8098 CPU.
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test Switch") PORT_TOGGLE PORT_CODE(KEYCODE_F2) // SW A (checked during boot)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: Check/Tune") PORT_CODE(KEYCODE_B) // SW B
+
+ PORT_START("SW") // test switches, accessed by reading from address 0x1300
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: MSB Adj.") PORT_CODE(KEYCODE_1) // SW 1
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: THD Check") PORT_CODE(KEYCODE_2) // SW 2
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: PCM Out: String 1") PORT_CODE(KEYCODE_3) // SW 3
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: PCM Out: Sax 1") PORT_CODE(KEYCODE_4) // SW 4
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: PCM + Long Reverb") PORT_CODE(KEYCODE_5) // SW 5
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: PCM + Short Reverb") PORT_CODE(KEYCODE_6) // SW 6
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: VCA Down Check") PORT_CODE(KEYCODE_7) // SW 7
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Test: VCA Up Check") PORT_CODE(KEYCODE_8) // SW 8
+INPUT_PORTS_END
+
+class cm32p_state : public driver_device
+{
+public:
+ cm32p_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ void cm32p(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+private:
+ required_device<i8x9x_device> cpu;
+ required_device<msm6222b_device> lcd;
+ required_device<timer_device> midi_timer;
+ required_device<ram_device> some_ram;
+ required_ioport test_sw;
+ required_ioport service_port;
+
+ void mt32_palette(palette_device &palette) const;
+
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE16_MEMBER(midi_w);
+
+ DECLARE_READ8_MEMBER(lcd_ctrl_r);
+ DECLARE_WRITE8_MEMBER(lcd_ctrl_w);
+ DECLARE_WRITE8_MEMBER(lcd_data_w);
+ DECLARE_READ16_MEMBER(port0_r);
+ DECLARE_READ8_MEMBER(pcmrom_r);
+ DECLARE_READ8_MEMBER(dsp_io_r);
+ DECLARE_WRITE8_MEMBER(dsp_io_w);
+ DECLARE_READ8_MEMBER(snd_io_r);
+ DECLARE_WRITE8_MEMBER(snd_io_w);
+ DECLARE_READ8_MEMBER(test_sw_r);
+
+ TIMER_DEVICE_CALLBACK_MEMBER(midi_timer_cb);
+ TIMER_DEVICE_CALLBACK_MEMBER(samples_timer_cb);
+
+ void cm32p_map(address_map &map);
+
+ u8 midi;
+ int midi_pos;
+ u8 port0;
+ u8 sound_io_buffer[0x100];
+ u8 dsp_io_buffer[0x80];
+};
+
+cm32p_state::cm32p_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , cpu(*this, "maincpu")
+ , lcd(*this, "lcd")
+ , midi_timer(*this, "midi_timer")
+ , some_ram(*this, "some_ram")
+ , test_sw(*this, "SW")
+ , service_port(*this, "SERVICE")
+{
+}
+
+
+// screen update function from Roland D-110
+uint32_t cm32p_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ uint8_t y,ra,gfx;
+ uint16_t sy=0,x;
+ const uint8_t *data = lcd->render();
+ bitmap.fill(0);
+
+ for (y = 0; y < 2; y++)
+ {
+ for (ra = 0; ra < 9; ra++)
+ {
+ uint16_t *p = &bitmap.pix16(sy++);
+
+ for (x = 0; x < 16; x++)
+ {
+ gfx = 0;
+ if (ra < 8)
+ gfx = data[x*16 + y*640 + ra];
+
+ *p++ = BIT(gfx, 4);
+ *p++ = BIT(gfx, 3);
+ *p++ = BIT(gfx, 2);
+ *p++ = BIT(gfx, 1);
+ *p++ = BIT(gfx, 0);
+ *p++ = 0;
+ }
+ }
+ }
+ return 0;
+}
+
+void cm32p_state::machine_start()
+{
+ u8 *rom = memregion("maincpu")->base();
+
+ // TODO: The IC8 gate array has an "LCD INT" line that needs to be emulated. Then, the hack can be removed.
+ // Note: The hack is not necessary when *not* using test mode.
+ rom[0xBB2D] = 0x03; // hack to make test mode not freeze when displaying the LCD text
+
+ // TODO: remove this hack
+ rom[0x7D80] = 0x00; // hack to exit some loop waiting for interrupt #8
+}
+
+void cm32p_state::machine_reset()
+{
+ midi_timer->adjust(attotime::from_hz(1));
+ midi_pos = 0;
+ port0 = 0;
+}
+
+WRITE8_MEMBER(cm32p_state::lcd_ctrl_w)
+{
+ lcd->control_w(data);
+}
+
+READ8_MEMBER(cm32p_state::lcd_ctrl_r)
+{
+ // The CM-64 service manual lists "D-110 LCD UNIT" for using PCM test mode, so I assume it works like that.
+ // However, the CM-32P firmware doesn't seem to ever read the status.
+ return lcd->control_r() >> 7;
+}
+
+WRITE8_MEMBER(cm32p_state::lcd_data_w)
+{
+ lcd->data_w(data);
+}
+
+WRITE16_MEMBER(cm32p_state::midi_w)
+{
+ logerror("midi_out %02x\n", data);
+ midi = data;
+}
+
+TIMER_DEVICE_CALLBACK_MEMBER(cm32p_state::midi_timer_cb)
+{
+ const static uint8_t midi_data[3] = { 0x9a, 0x40, 0x7f };
+ midi = midi_data[midi_pos++];
+ logerror("midi_in %02x\n", midi);
+ cpu->serial_w(midi);
+ if(midi_pos < sizeof(midi_data))
+ midi_timer->adjust(attotime::from_hz(1250));
+}
+
+READ16_MEMBER(cm32p_state::port0_r)
+{
+ return port0 | service_port->read();
+}
+
+READ8_MEMBER(cm32p_state::pcmrom_r)
+{
+ offs_t romOfs = SCRAMBLE_ADDRESS(offset);
+ const u8* pcm_rom = memregion("pcm32")->base();
+ return UNSCRAMBLE_DATA(pcm_rom[romOfs]);
+}
+
+READ8_MEMBER(cm32p_state::dsp_io_r)
+{
+ return dsp_io_buffer[offset];
+}
+
+WRITE8_MEMBER(cm32p_state::dsp_io_w)
+{
+ dsp_io_buffer[offset] = data;
+ // do read/write to some external memory, makes the RCC-CPU check pass. (routine at 0x4679)
+ switch(offset)
+ {
+ case 0x04:
+ // write to partials?? (written in loop at 0x4375)
+ break;
+ case 0x06:
+ {
+ u8* ram = some_ram->pointer();
+ offs_t ofs = data;
+ ram[0x000 | ofs] = dsp_io_buffer[0x00] & 0x03;
+ ram[0x100 | ofs] = dsp_io_buffer[0x01];
+ ram[0x200 | ofs] = dsp_io_buffer[0x02];
+ }
+ break;
+ case 0x0A:
+ {
+ const u8* ram = some_ram->pointer();
+ offs_t ofs = data;
+ dsp_io_buffer[0x00] = ram[0x000 | ofs];
+ dsp_io_buffer[0x01] = ram[0x100 | ofs];
+ dsp_io_buffer[0x02] = ram[0x200 | ofs];
+ }
+ break;
+ }
+}
+
+READ8_MEMBER(cm32p_state::snd_io_r)
+{
+ if (offset == 0x01)
+ {
+ // code for reading from the PCM sample table is at 0xB027
+ // The code at 0xB0AC writes to 1411/1F (??), then 1403/02 (bank), then 1409/08/0B/0A (address).
+ // It waits a few cycles and at 0xB0F7 it reads the resulting data from 1401.
+ offs_t bank = sound_io_buffer[0x03];
+ offs_t addr = (sound_io_buffer[0x09] << 0) | (sound_io_buffer[0x0A] << 8) | (sound_io_buffer[0x0B] << 16);
+ addr = ((addr >> 6) + 2) & 0x3FFFF;
+ addr |= (bank << 16);
+ // write actual ROM address to 1440..1443 for debugging
+ sound_io_buffer[0x43] = (addr >> 0) & 0xFF;
+ sound_io_buffer[0x42] = (addr >> 8) & 0xFF;
+ sound_io_buffer[0x41] = (addr >> 16) & 0xFF;
+ sound_io_buffer[0x40] = (addr >> 24) & 0xFF;
+ return pcmrom_r(space, addr, 0xFF);
+ }
+ return sound_io_buffer[offset];
+}
+
+WRITE8_MEMBER(cm32p_state::snd_io_w)
+{
+ // register map
+ // ------------
+ // Note: 16-bit words are Little Endian, the firmware writes the odd byte is first
+ // 00/01 - ??
+ // 02/03 - ROM bank (only bits 11-13 are used, bit 11 = PCM card, bits 12-13 select between IC18/19/20)
+ // 04/05 - frequency (2.14 fixed point, 0x4000 = 32000 Hz)
+ // 06/07 - volume
+ // 08/09 - sample start address, fraction (2.14 fixed point, i.e. 1 byte = 0x4000)
+ // 0A/0B - sample start address (high word, i.e. address bits 2..17)
+ // 0C/0D - sample end address (high word)
+ // 0E/0F - sample loop address (high word)
+ // 11/13/15/17 - voice enable mask (11 = least significant 8 bits, 17 = most significant 8 bits)
+ // 1A - ??
+ // 1F - voice select
+ sound_io_buffer[offset] = data;
+}
+
+READ8_MEMBER(cm32p_state::test_sw_r)
+{
+ return test_sw->read();
+}
+
+TIMER_DEVICE_CALLBACK_MEMBER(cm32p_state::samples_timer_cb)
+{
+ port0 ^= 0x10;
+}
+
+void cm32p_state::mt32_palette(palette_device &palette) const
+{
+ palette.set_pen_color(0, rgb_t(0, 0, 0));
+ palette.set_pen_color(1, rgb_t(0, 255, 0));
+}
+
+void cm32p_state::cm32p_map(address_map &map)
+{
+ map(0x1080, 0x10ff).rw(FUNC(cm32p_state::dsp_io_r), FUNC(cm32p_state::dsp_io_w)); // DSP area (writes to 1080..82/86/8C/8D)
+ map(0x1100, 0x1100).rw(FUNC(cm32p_state::lcd_ctrl_r), FUNC(cm32p_state::lcd_ctrl_w));
+ map(0x1102, 0x1102).w(FUNC(cm32p_state::lcd_data_w));
+ map(0x1300, 0x1300).r(FUNC(cm32p_state::test_sw_r)); // test switch state
+ map(0x1400, 0x14ff).rw(FUNC(cm32p_state::snd_io_r), FUNC(cm32p_state::snd_io_w)); // sound chip area
+ map(0x2000, 0x20ff).rom().region("maincpu", 0x2000); // init vector @ 2080
+ map(0x2100, 0x3fff).ram(); // main RAM
+ map(0x4000, 0xbfff).rom().region("maincpu", 0x4000);
+ map(0xc000, 0xffff).r(FUNC(cm32p_state::pcmrom_r)); // show descrambled PCM ROM (for debugging)
+}
+
+void cm32p_state::cm32p(machine_config &config)
+{
+ i8x9x_device &maincpu(P8098(config, cpu, 12_MHz_XTAL));
+ maincpu.set_addrmap(AS_PROGRAM, &cm32p_state::cm32p_map);
+ maincpu.ach7_cb().set_ioport("A7");
+ maincpu.serial_tx_cb().set(FUNC(cm32p_state::midi_w));
+ maincpu.in_p0_cb().set(FUNC(cm32p_state::port0_r));
+
+ RAM(config, some_ram).set_default_size("8K");
+
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(50);
+ screen.set_screen_update(FUNC(cm32p_state::screen_update));
+ screen.set_size(16*6-1, (16*6-1)*3/4);
+ screen.set_visarea(0, 16*6-2, 0, (16*6-1)*3/4-1);
+ screen.set_palette("palette");
+
+ PALETTE(config, "palette", FUNC(cm32p_state::mt32_palette), 2);
+
+ MSM6222B_01(config, lcd, 0);
+
+ TIMER(config, midi_timer).configure_generic(FUNC(cm32p_state::midi_timer_cb));
+
+ TIMER(config, "samples_timer").configure_periodic(FUNC(cm32p_state::samples_timer_cb), attotime::from_hz(32000*2));
+}
+
+ROM_START( cm32p )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "cm-32p-ic9.bin", 0x000000, 0x10000, CRC(6f2f6dfd) SHA1(689f77c1d56f923ef1dab7d993a124c47736bc56) )
+
+ ROM_REGION( 0x400000, "pcm32", 0 )
+ ROM_LOAD( "cm-32p-ic18.bin", 0x000000, 0x80000, CRC(8e53b2a3) SHA1(4872530870d5079776e80e477febe425dc0ec1df) )
+ // 0x080000 .. 0x0FFFFF is reserved for the PCM card
+ ROM_LOAD( "cm-32p-ic19.bin", 0x100000, 0x80000, CRC(c8220761) SHA1(49e55fa672020f95fd9c858ceaae94d6db93df7d) )
+ ROM_LOAD( "cm-32p-ic20.bin", 0x200000, 0x80000, CRC(733c4054) SHA1(9b6b59ab74e5bf838702abb087c408aaa85b7b1f) )
+ROM_END
+
+CONS( 1989, cm32p, 0, 0, cm32p, cm32p, cm32p_state, empty_init, "Roland", "CM-32P", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
diff --git a/src/mame/drivers/rmt32.cpp b/src/mame/drivers/rmt32.cpp
index 3e93698e165..2f6c0be316f 100644
--- a/src/mame/drivers/rmt32.cpp
+++ b/src/mame/drivers/rmt32.cpp
@@ -437,5 +437,5 @@ ROM_START( cm32l )
ROM_LOAD( "r15179917.ic19.bin", 0, 0x8000, CRC(236c87a6) SHA1(e1c03905c46e962d1deb15eeed92eb61b42bba4a) )
ROM_END
-CONS( 1987, mt32, 0, 0, mt32, mt32, mt32_state, empty_init, "Roland", "MT32", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
-CONS( 1989, cm32l, 0, 0, mt32, mt32, mt32_state, empty_init, "Roland", "CM32L", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
+CONS( 1987, mt32, 0, 0, mt32, mt32, mt32_state, empty_init, "Roland", "MT-32", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
+CONS( 1989, cm32l, 0, 0, mt32, mt32, mt32_state, empty_init, "Roland", "CM-32L", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
diff --git a/src/mame/drivers/sengokmj.cpp b/src/mame/drivers/sengokmj.cpp
index d9e9b868b4d..7928c68fc2a 100644
--- a/src/mame/drivers/sengokmj.cpp
+++ b/src/mame/drivers/sengokmj.cpp
@@ -67,7 +67,7 @@ RSSENGO2.72 chr.
#include "tilemap.h"
-class sengokmj_state : public driver_device, protected seibu_sound_common
+class sengokmj_state : public driver_device, public seibu_sound_common
{
public:
sengokmj_state(const machine_config &mconfig, device_type type, const char *tag) :
diff --git a/src/mame/drivers/shisen.cpp b/src/mame/drivers/shisen.cpp
index e678f7283c6..a5c17c22e1f 100644
--- a/src/mame/drivers/shisen.cpp
+++ b/src/mame/drivers/shisen.cpp
@@ -239,7 +239,7 @@ void shisen_state::shisen(machine_config &config)
ymsnd.add_route(0, "lspeaker", 0.5);
ymsnd.add_route(1, "rspeaker", 0.5);
- DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "lspeaker", 0.25).add_route(ALL_OUTPUTS, "rspeaker", 0x25); // unknown DAC
+ DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "lspeaker", 0.25).add_route(ALL_OUTPUTS, "rspeaker", 0.25); // unknown DAC
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
diff --git a/src/mame/drivers/spdheat.cpp b/src/mame/drivers/spdheat.cpp
index fcc818c108d..6ec86de0e24 100644
--- a/src/mame/drivers/spdheat.cpp
+++ b/src/mame/drivers/spdheat.cpp
@@ -37,7 +37,7 @@ static constexpr XTAL FM_CLOCK = SOUND_CLOCK / 2;
void spdheat_state::machine_start()
{
- save_pointer(NAME(m_sound_data), sizeof(m_sound_data));
+ save_item(NAME(m_sound_data));
save_item(NAME(m_sound_status));
save_item(NAME(m_sub_data));
save_item(NAME(m_sub_status));
@@ -854,5 +854,5 @@ ROM_END
*
*************************************/
-GAME( 1985, spdheat, 0, spdheat, spdheat, spdheat_state, empty_init, ROT0, "Taito Corporation", "Super Dead Heat (World)", 0 )
-GAME( 1985, spdheatj, spdheat, spdheat, spdheatj, spdheat_state, empty_init, ROT0, "Taito Corporation", "Super Dead Heat (Japan)", 0 )
+GAME( 1985, spdheat, 0, spdheat, spdheat, spdheat_state, empty_init, ROT0, "Taito Corporation", "Super Dead Heat (World)", MACHINE_SUPPORTS_SAVE )
+GAME( 1985, spdheatj, spdheat, spdheat, spdheatj, spdheat_state, empty_init, ROT0, "Taito Corporation", "Super Dead Heat (Japan)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/swtpc.cpp b/src/mame/drivers/swtpc.cpp
index a1ca20ecef5..fc00330f8c0 100644
--- a/src/mame/drivers/swtpc.cpp
+++ b/src/mame/drivers/swtpc.cpp
@@ -109,14 +109,16 @@ public:
, m_maincpu(*this, "maincpu")
, m_ram(*this, "ram")
, m_brg(*this, "brg")
- , m_maincpu_clock(*this, "maincpu_clock")
- , m_swtbug_ready_wait(*this, "swtbug_ready_wait")
- , m_swtbug_load_at_a100(*this, "swtbug_load_at_a100")
+ , m_maincpu_clock(*this, "MAINCPU_CLOCK")
+ , m_swtbug_ready_wait(*this, "SWTBUG_READY_WAIT")
+ , m_swtbug_load_at_a100(*this, "SWTBUG_LOAD_AT_A100")
{ }
void swtpcm(machine_config &config);
void swtpc(machine_config &config);
+ DECLARE_INPUT_CHANGED_MEMBER(maincpu_clock_change);
+
private:
virtual void machine_reset() override;
virtual void machine_start() override;
@@ -158,8 +160,8 @@ static INPUT_PORTS_START( swtpc )
// the CPU clock and the frequency was variable. The 6800 was
// available at speeds up to 2MHz so that might not have been
// impossible. An overclock option of 4MHz is also implemented.
- PORT_START("maincpu_clock")
- PORT_CONFNAME(0xffffff, 1000000, "CPU clock")
+ PORT_START("MAINCPU_CLOCK")
+ PORT_CONFNAME(0xffffff, 1000000, "CPU clock") PORT_CHANGED_MEMBER(DEVICE_SELF, swtpc_state, maincpu_clock_change, 0)
PORT_CONFSETTING( 898550, "0.89855 MHz") // MIKBUG
PORT_CONFSETTING( 921600, "0.92160 MHz") // SWTPC
PORT_CONFSETTING(1000000, "1.0 MHz")
@@ -172,7 +174,7 @@ static INPUT_PORTS_START( swtpc )
// the motor when accessing the control register, the drive does not
// have time to become ready before commands are issued and the boot
// fails. This workaround is necessary in practice.
- PORT_START("swtbug_ready_wait")
+ PORT_START("SWTBUG_READY_WAIT")
PORT_CONFNAME(0x1, 1, "SWTBUG ready wait patch")
PORT_CONFSETTING(0, "No")
PORT_CONFSETTING(1, "Yes - apply patch")
@@ -184,7 +186,7 @@ static INPUT_PORTS_START( swtpc )
// 0xa100 or perhaps better implement support for the high PROM to
// allow custom code to be used which is needed anyway as even NEWBUG
// appears to have issues and is not optimized for the DC5 FDC.
- PORT_START("swtbug_load_at_a100")
+ PORT_START("SWTBUG_LOAD_AT_A100")
PORT_CONFNAME(0x1, 1, "SWTBUG disk boot patch, to load at 0xa100")
PORT_CONFSETTING(0, "No")
PORT_CONFSETTING(1, "Yes - apply patch")
@@ -195,6 +197,11 @@ static DEVICE_INPUT_DEFAULTS_START( dc5 )
DEVICE_INPUT_DEFAULTS("address_mode", 0xf, 0)
DEVICE_INPUT_DEFAULTS_END
+INPUT_CHANGED_MEMBER(swtpc_state::maincpu_clock_change)
+{
+ m_maincpu->set_clock(newval);
+}
+
void swtpc_state::machine_reset()
{
uint32_t maincpu_clock = m_maincpu_clock->read();
diff --git a/src/mame/drivers/swtpc09.cpp b/src/mame/drivers/swtpc09.cpp
index 6b7b85ba262..32f7a8044ff 100644
--- a/src/mame/drivers/swtpc09.cpp
+++ b/src/mame/drivers/swtpc09.cpp
@@ -206,8 +206,8 @@ static INPUT_PORTS_START( swtpc09 )
// Run the 6809 at 2MHz (an 8MHz XTAL) so that manual polling of FDC can
// keep up with higher rate operation. The MPU09 did have the option of
// 1MHz or 2MHz operation.
- PORT_START("maincpu_clock")
- PORT_CONFNAME(0xffffff, 2000000, "CPU clock")
+ PORT_START("MAINCPU_CLOCK")
+ PORT_CONFNAME(0xffffff, 2000000, "CPU clock") PORT_CHANGED_MEMBER(DEVICE_SELF, swtpc09_state, maincpu_clock_change, 0)
PORT_CONFSETTING(1000000, "1.0 MHz")
PORT_CONFSETTING(2000000, "2.0 MHz")
PORT_CONFSETTING(4000000, "4.0 MHz")
@@ -219,20 +219,20 @@ static INPUT_PORTS_START( swtpc09 )
// 'standard' 3.5" - 1.2MHz
// 3.5" hd - 2.0MHz
// 8" 360rpm - 2.4MHz
- PORT_START("fdc_clock")
- PORT_DIPNAME(0xffffff, 2000000, "DMAF2/3 FDC clock")
- PORT_DIPSETTING(1000000, "1.0 MHz")
- PORT_DIPSETTING(1200000, "1.2 MHz")
- PORT_DIPSETTING(2000000, "2.0 MHz")
- PORT_DIPSETTING(2400000, "2.4 MHz")
+ PORT_START("FDC_CLOCK")
+ PORT_CONFNAME(0xffffff, 2000000, "DMAF2/3 FDC clock") PORT_CHANGED_MEMBER(DEVICE_SELF, swtpc09_state, fdc_clock_change, 0)
+ PORT_CONFSETTING(1000000, "1.0 MHz")
+ PORT_CONFSETTING(1200000, "1.2 MHz")
+ PORT_CONFSETTING(2000000, "2.0 MHz")
+ PORT_CONFSETTING(2400000, "2.4 MHz")
// The MP-ID board has jumpers to vary the baud rates generated. The
// most useful is the Low/High rate jumper that provide a four times
// rate increase.
- PORT_START("baud_rate_high")
- PORT_DIPNAME(0x1, 0, "High baud rate")
- PORT_DIPSETTING(0, "Low (x1)")
- PORT_DIPSETTING(1, "High (x4)")
+ PORT_START("BAUD_RATE_HIGH")
+ PORT_CONFNAME(0x1, 0, "High baud rate") PORT_CHANGED_MEMBER(DEVICE_SELF, swtpc09_state, baud_rate_high_change, 0)
+ PORT_CONFSETTING(0, "Low (x1)")
+ PORT_CONFSETTING(1, "High (x4)")
// Debug aid to hard code the density. The FLEX format uses single
// density for track zero. Many virtual disks 'fix' the format to be
@@ -240,7 +240,7 @@ static INPUT_PORTS_START( swtpc09 )
// driver support for that. This setting is an aid to report
// unexpected usage, and it attempts to correct that. It is possible
// to patch the software to work with these pure double density disks.
- PORT_START("floppy_expected_density")
+ PORT_START("FLOPPY_EXPECTED_DENSITY")
PORT_CONFNAME(0xff, 0, "DMAF2/3 expected density")
PORT_CONFSETTING(0, "-")
PORT_CONFSETTING(1, "single density")
@@ -259,7 +259,7 @@ static INPUT_PORTS_START( swtpc09 )
// the head based track zero being single density. This aid is not
// intended to be a substitute for fixing the drivers but it does help
// work through the issues while patching the disks.
- PORT_START("floppy_expected_sectors")
+ PORT_START("FLOPPY_EXPECTED_SECTORS")
PORT_CONFNAME(0xff, 0, "DMAF2/3 expected sectors per side")
PORT_CONFSETTING(0, "-")
PORT_CONFSETTING(10, "10") // 5 1/4" single density 256B
@@ -271,7 +271,7 @@ static INPUT_PORTS_START( swtpc09 )
// 6800 disks did format track zero in single density and if the
// driver sticks to that and if using a double density disk then set a
// single density size here.
- PORT_START("floppy_track_zero_expected_sectors")
+ PORT_START("FLOPPY_TRACK_ZERO_EXPECTED_SECTORS")
PORT_CONFNAME(0xff, 0, "DMAF2/3 track zero expected sectors per side")
PORT_CONFSETTING(0, "-")
PORT_CONFSETTING(10, "10") // 5 1/4" single density 256B
@@ -280,7 +280,7 @@ static INPUT_PORTS_START( swtpc09 )
PORT_CONFSETTING(26, "26") // 8" double density 256B
PORT_CONFSETTING(36, "36") // 3.5" 1.4M QD 256B
- PORT_START("sbug_double_density")
+ PORT_START("SBUG_DOUBLE_DENSITY")
PORT_CONFNAME(0x1, 0, "SBUG patch for double density (SSO) disk boot")
PORT_CONFSETTING(0, "No - single density")
PORT_CONFSETTING(1, "Yes - double density")
@@ -289,7 +289,7 @@ static INPUT_PORTS_START( swtpc09 )
// after the disk boot code has loaded FLEX, and then it jumps to
// 0xc850 to cold start FLEX. Have seen 0xcd00 being the cold start
// address, so add an option to patch the PROM for that.
- PORT_START("piaide_flex_boot_cd00")
+ PORT_START("PIAIDE_FLEX_BOOT_CD00")
PORT_CONFNAME(0x1, 0, "PIA IDE PROM patch FLEX entry to 0xcd00")
PORT_CONFSETTING(0, "No - FLEX entry 0xc850")
PORT_CONFSETTING(1, "Yes - FLEX entry 0xcd00")
diff --git a/src/mame/drivers/uchroma68.cpp b/src/mame/drivers/uchroma68.cpp
index a9b075c183e..f57f6df03d7 100644
--- a/src/mame/drivers/uchroma68.cpp
+++ b/src/mame/drivers/uchroma68.cpp
@@ -148,7 +148,7 @@ public:
, m_screen(*this, "screen")
, m_video_ram(*this, "videoram")
, m_cass(*this, "cassette")
- , m_semi_graphics_six_mod(*this, "semi_graphics_six_mod")
+ , m_semi_graphics_six_mod(*this, "SEMI_GRAPHICS_SIX_MOD")
{ }
void uchroma68(machine_config &config);
@@ -161,7 +161,7 @@ public:
private:
required_device<cpu_device> m_maincpu;
required_device<mc6846_device> m_mc6846;
- required_device<mc6847_base_device> m_mc6847;
+ required_device<mc6847_ntsc_device> m_mc6847;
required_device<pia6821_device> m_pia;
required_device<acia6850_device> m_acia;
required_device<clock_device> m_acia_tx_clock;
@@ -237,7 +237,7 @@ static INPUT_PORTS_START(uchroma68)
// The documentation notes a hardware modification to allow the use of
// the Semi-graphics 6 mode of the MC6847.
- PORT_START("semi_graphics_six_mod")
+ PORT_START("SEMI_GRAPHICS_SIX_MOD")
PORT_CONFNAME(0x01, 0x00, "Semi-graphics 6 mode modification")
PORT_CONFSETTING(0x00, "No")
PORT_CONFSETTING(0x01, "Yes")
@@ -453,11 +453,11 @@ void uchroma68_state::uchroma68(machine_config &config)
m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
- SCREEN(config, "screen", SCREEN_TYPE_RASTER);
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- mc6847_ntsc_device &vdg(MC6847_NTSC(config, "mc6847", XTAL_UCHROMA68));
- vdg.set_screen("screen");
- vdg.input_callback().set(FUNC(uchroma68_state::mc6847_videoram_r));
+ MC6847_NTSC(config, m_mc6847, XTAL_UCHROMA68);
+ m_mc6847->set_screen(m_screen);
+ m_mc6847->input_callback().set(FUNC(uchroma68_state::mc6847_videoram_r));
PIA6821(config, m_pia, 0);
m_pia->readpa_handler().set(FUNC(uchroma68_state::pia_pa_r));
diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp
index 1f3f7ab8ea8..4c833c2a3d6 100644
--- a/src/mame/drivers/vii.cpp
+++ b/src/mame/drivers/vii.cpp
@@ -193,6 +193,7 @@ public:
void non_spg_base(machine_config &config);
void lexizeus(machine_config &config);
void taikeegr(machine_config &config);
+ void sentx6p(machine_config &config);
void init_crc();
void init_zeus();
@@ -216,7 +217,7 @@ protected:
DECLARE_READ16_MEMBER(rad_porta_r);
DECLARE_READ16_MEMBER(rad_portb_r);
DECLARE_READ16_MEMBER(rad_portc_r);
-
+
DECLARE_WRITE16_MEMBER(jakks_porta_w);
DECLARE_WRITE16_MEMBER(jakks_portb_w);
@@ -231,6 +232,9 @@ protected:
virtual void mem_map_2m(address_map &map);
virtual void mem_map_1m(address_map &map);
+ void mem_map_2m_texas(address_map &map);
+
+
uint32_t m_current_bank;
std::unique_ptr<uint8_t[]> m_serial_eeprom;
@@ -773,6 +777,12 @@ void spg2xx_game_state::mem_map_2m(address_map &map)
map(0x000000, 0x1fffff).mirror(0x200000).bankr("cartbank");
}
+void spg2xx_game_state::mem_map_2m_texas(address_map &map)
+{
+ map(0x000000, 0x1fffff).bankr("cartbank");
+ map(0x3f0000, 0x3f7fff).ram();
+}
+
void spg2xx_game_state::mem_map_1m(address_map &map)
{
map(0x000000, 0x0fffff).mirror(0x300000).bankr("cartbank");
@@ -1885,6 +1895,158 @@ static INPUT_PORTS_START( taikeegr )
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
+
+static INPUT_PORTS_START( sentx6p )
+ PORT_START("P1")
+ PORT_DIPNAME( 0x0001, 0x0001, "Port 1" )
+ PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x8000, 0x8000, "Low Battery" )
+ PORT_DIPSETTING( 0x8000, DEF_STR( On ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
+
+ PORT_START("P2")
+ // these must be sense lines
+ PORT_DIPNAME( 0x0001, 0x0001, "Player 1 Connected" )
+ PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x0001, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x0002, 0x0002, "Player 2 Connected" )
+ PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x0002, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x0004, 0x0004, "Player 3 Connected" )
+ PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x0004, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x0008, 0x0008, "Player 4 Connected" )
+ PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x0010, 0x0010, "Player 5 Connected" )
+ PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x0010, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x0020, 0x0020, "Player 6 Connected" )
+ PORT_DIPSETTING( 0x0000, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x0020, DEF_STR( Yes ) )
+
+ PORT_DIPNAME( 0x0040, 0x0040, "Port 2" )
+ PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+
+ PORT_START("P3")
+ PORT_DIPNAME( 0x0001, 0x0001, "Port 3" )
+ PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Console Select")
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Console Ok")
+ PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+INPUT_PORTS_END
+
+
READ16_MEMBER(dreamlif_state::portb_r)
{
uint16_t ret = 0x0000;
@@ -2623,6 +2785,23 @@ void spg2xx_game_state::taikeegr(machine_config &config)
NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1);
}
+
+void spg2xx_game_state::sentx6p(machine_config &config)
+{
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
+ m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_2m_texas);
+ m_maincpu->set_pal(true);
+
+ spg2xx_base(config);
+
+ m_screen->set_refresh_hz(50);
+
+ m_maincpu->porta_in().set_ioport("P1");
+ m_maincpu->portb_in().set_ioport("P2");
+ m_maincpu->portc_in().set_ioport("P3");
+}
+
+
ROM_START( vii )
ROM_REGION( 0x2000000, "maincpu", ROMREGION_ERASE00 )
ROM_LOAD16_WORD_SWAP( "vii.bin", 0x0000, 0x2000000, CRC(04627639) SHA1(f883a92d31b53c9a5b0cdb112d07cd793c95fc43))
@@ -2833,6 +3012,11 @@ ROM_START( taikeegr )
ROM_END
+ROM_START( sentx6p )
+ ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASE00 )
+ ROM_LOAD16_WORD_SWAP( "senario texas holdem.bin", 0x000000, 0x400000, CRC(7c7d2d33) SHA1(71631074ba66e3b0cdeb86ebca3931599f3a911c) )
+ROM_END
+
void spg2xx_game_state::init_crc()
{
// several games have a byte sum checksum listed at the start of ROM, this little helper function logs what it should match.
@@ -2999,3 +3183,7 @@ CONS( 2006, pvmil, 0, 0, pvmil, pvmil, pvmil_state, e
// for the UK version the title screen always shows "Guitar Rock", however there are multiple boxes with different titles and song selections.
// ROM is glued on the underside and soldered to the PCB, very difficult to remove without damaging.
CONS( 2007, taikeegr, 0, 0, taikeegr, taikeegr, spg2xx_game_state, init_taikeegr, "TaiKee", "Rockstar Guitar / Guitar Rock (PAL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad music timings (too slow)
+
+// "go 02d1d0" "do r1 = ff" to get past initial screen
+// a 'deluxe' version of this also exists with extra game modes
+CONS( 2004, sentx6p, 0, 0, sentx6p, sentx6p, spg2xx_game_state, empty_init, "Senario / Play Vision", "Texas Hold'em TV Poker - 6 Player Edition (UK)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // from a UK Play Vision branded box, values in GBP
diff --git a/src/mame/includes/bbc.h b/src/mame/includes/bbc.h
index 519a60cc59f..3573d4ba89b 100644
--- a/src/mame/includes/bbc.h
+++ b/src/mame/includes/bbc.h
@@ -42,14 +42,12 @@
#include "bus/bbc/fdc/fdc.h"
#include "bus/bbc/analogue/analogue.h"
#include "bus/bbc/1mhzbus/1mhzbus.h"
-//#include "bus/bbc/internal/internal.h"
+#include "bus/bbc/internal/internal.h"
#include "bus/bbc/tube/tube.h"
#include "bus/bbc/userport/userport.h"
#include "bus/bbc/exp/exp.h"
#include "bus/bbc/joyport/joyport.h"
-
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
+#include "bus/bbc/cart/slot.h"
#include "emupal.h"
#include "screen.h"
@@ -87,7 +85,7 @@ public:
, m_extube(*this, "extube")
, m_1mhzbus(*this, "1mhzbus")
, m_userport(*this, "userport")
-// , m_internal(*this, "internal")
+ , m_internal(*this, "internal")
, m_exp(*this, "exp")
, m_rtc(*this, "rtc")
, m_i2cmem(*this, "i2cmem")
@@ -101,7 +99,6 @@ public:
, m_region_swr(*this, "swr")
, m_bank1(*this, "bank1")
, m_bank2(*this, "bank2")
- , m_bank3(*this, "bank3")
, m_bankdev(*this, "bankdev")
, m_bbcconfig(*this, "BBCCONFIG")
{ }
@@ -116,9 +113,18 @@ public:
DECLARE_FLOPPY_FORMATS(floppy_formats);
+ DECLARE_READ8_MEMBER(bbc_ram_r);
+ DECLARE_WRITE8_MEMBER(bbc_ram_w);
+ DECLARE_READ8_MEMBER(bbc_romsel_r);
DECLARE_WRITE8_MEMBER(bbc_romsel_w);
DECLARE_READ8_MEMBER(bbc_paged_r);
DECLARE_WRITE8_MEMBER(bbc_paged_w);
+ DECLARE_READ8_MEMBER(bbc_mos_r);
+ DECLARE_WRITE8_MEMBER(bbc_mos_w);
+ DECLARE_READ8_MEMBER(bbc_fred_r);
+ DECLARE_WRITE8_MEMBER(bbc_fred_w);
+ DECLARE_READ8_MEMBER(bbc_jim_r);
+ DECLARE_WRITE8_MEMBER(bbc_jim_w);
DECLARE_READ8_MEMBER(bbcbp_fetch_r);
DECLARE_WRITE8_MEMBER(bbcbp_romsel_w);
DECLARE_READ8_MEMBER(bbcbp_paged_r);
@@ -133,6 +139,8 @@ public:
DECLARE_WRITE8_MEMBER(bbcm_hazel_w);
DECLARE_READ8_MEMBER(bbcm_tube_r);
DECLARE_WRITE8_MEMBER(bbcm_tube_w);
+ DECLARE_READ8_MEMBER(bbcmc_paged_r);
+ DECLARE_WRITE8_MEMBER(bbcmc_paged_w);
DECLARE_WRITE8_MEMBER(bbcbp_drive_control_w);
DECLARE_WRITE8_MEMBER(bbcm_drive_control_w);
DECLARE_WRITE8_MEMBER(bbcmc_drive_control_w);
@@ -187,19 +195,12 @@ public:
void insert_device_rom(memory_region *rom);
void setup_device_roms();
- image_init_result load_cart(device_image_interface &image, generic_slot_device *slot);
- DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart1_load) { return load_cart(image, m_cart[0]); }
- DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart2_load) { return load_cart(image, m_cart[1]); }
-
MC6845_UPDATE_ROW(crtc_update_row);
void bbca(machine_config &config);
void bbcb(machine_config &config);
void bbcb_de(machine_config &config);
void bbcb_us(machine_config &config);
- void torchf(machine_config &config);
- void torchh21(machine_config &config);
- void torchh10(machine_config &config);
void bbca_mem(address_map &map);
void bbc_base(address_map &map);
@@ -207,7 +208,6 @@ public:
void bbcb_nofdc_mem(address_map &map);
void init_bbc();
- void init_bbcm();
void init_ltmp();
void init_cfa();
@@ -219,14 +219,14 @@ protected:
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
- required_device<hd6845s_device> m_hd6845;
+ required_device<mc6845_device> m_hd6845;
required_device<screen_device> m_screen;
required_device<input_merger_device> m_irqs;
required_device<palette_device> m_palette;
optional_device<mc6854_device> m_adlc;
optional_device<sn76489a_device> m_sn;
optional_device<samples_device> m_samples;
- required_ioport_array<13> m_keyboard;
+ required_ioport_array<16> m_keyboard;
optional_device<saa5050_device> m_trom;
optional_device<tms5220_device> m_tms;
optional_device<cassette_image_device> m_cassette;
@@ -244,7 +244,7 @@ protected:
optional_device<bbc_tube_slot_device> m_extube;
optional_device<bbc_1mhzbus_slot_device> m_1mhzbus;
optional_device<bbc_userport_slot_device> m_userport;
- //optional_device<bbc_internal_slot_device> m_internal;
+ optional_device<bbc_internal_slot_device> m_internal;
optional_device<bbc_exp_slot_device> m_exp;
optional_device<mc146818_device> m_rtc;
optional_device<i2cmem_device> m_i2cmem;
@@ -253,23 +253,19 @@ protected:
optional_device<wd1770_device> m_wd1770;
optional_device<wd1772_device> m_wd1772;
optional_device_array<bbc_romslot_device, 16> m_rom;
- optional_device_array<generic_slot_device, 2> m_cart;
+ optional_device_array<bbc_cartslot_device, 2> m_cart;
required_memory_region m_region_mos;
required_memory_region m_region_swr;
- required_memory_bank m_bank1; // bbca bbcb bbcbp bbcbp128 bbcm
+ optional_memory_bank m_bank1; // bbcbp bbcbp128 bbcm
optional_memory_bank m_bank2; // bbcbp bbcbp128 bbcm
- optional_memory_bank m_bank3; // bbca bbcb
optional_device<address_map_bank_device> m_bankdev; // bbcm
optional_ioport m_bbcconfig;
int m_monitortype; // monitor type (colour, green, amber)
- int m_swramtype; // this stores the setting for the SWRAM type being used
- int m_swrbank; // This is the latch that holds the sideways ROM bank to read
+ int m_romsel; // This is the latch that holds the sideways ROM bank to read
int m_paged_ram; // BBC B+ memory handling
int m_vdusel; // BBC B+ memory handling
- bool m_lk18_ic41_paged_rom; // BBC Master Paged ROM/RAM select IC41
- bool m_lk19_ic37_paged_rom; // BBC Master Paged ROM/RAM select IC37
/*
ACCCON
@@ -380,6 +376,7 @@ protected:
void setvideoshadow(int vdusel);
void set_pixel_lookup();
+ uint8_t bus_video_data();
int bbc_keyboard(int data);
void mc6850_receive_clock(int new_clock);
@@ -397,6 +394,10 @@ class torch_state : public bbc_state
public:
using bbc_state::bbc_state;
static constexpr feature_type imperfect_features() { return feature::KEYBOARD; }
+
+ void torchf(machine_config &config);
+ void torchh21(machine_config &config);
+ void torchh10(machine_config &config);
};
@@ -435,6 +436,7 @@ public:
void bbcm512(machine_config &config);
void bbcmarm(machine_config &config);
void cfa3000(machine_config &config);
+ void daisy(machine_config &config);
void discmon(machine_config &config);
void discmate(machine_config &config);
void bbcmc(machine_config &config);
@@ -448,7 +450,9 @@ protected:
void bbcm_mem(address_map &map);
void bbcm_bankdev(address_map &map);
void bbcmet_bankdev(address_map &map);
+ void bbcmc_mem(address_map &map);
void bbcmc_bankdev(address_map &map);
+ void autoc15_bankdev(address_map &map);
void bbcm_fetch(address_map &map);
};
diff --git a/src/mame/includes/bloodbro.h b/src/mame/includes/bloodbro.h
index 5b109a4953d..7bafb6a3598 100644
--- a/src/mame/includes/bloodbro.h
+++ b/src/mame/includes/bloodbro.h
@@ -11,7 +11,7 @@
#include "screen.h"
#include "tilemap.h"
-class bloodbro_state : public driver_device, protected seibu_sound_common
+class bloodbro_state : public driver_device, public seibu_sound_common
{
public:
bloodbro_state(const machine_config &mconfig, device_type type, const char *tag) :
diff --git a/src/mame/includes/dcon.h b/src/mame/includes/dcon.h
index 5636bf8ad02..54ef3c3bf05 100644
--- a/src/mame/includes/dcon.h
+++ b/src/mame/includes/dcon.h
@@ -9,7 +9,7 @@
#include "emupal.h"
#include "tilemap.h"
-class dcon_state : public driver_device, protected seibu_sound_common
+class dcon_state : public driver_device, public seibu_sound_common
{
public:
dcon_state(const machine_config &mconfig, device_type type, const char *tag) :
diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h
index f265210dc18..518e2c96670 100644
--- a/src/mame/includes/legionna.h
+++ b/src/mame/includes/legionna.h
@@ -15,7 +15,7 @@
#include <algorithm>
-class legionna_state : public driver_device, protected seibu_sound_common
+class legionna_state : public driver_device, public seibu_sound_common
{
public:
legionna_state(const machine_config &mconfig, device_type type, const char *tag)
diff --git a/src/mame/includes/mtx.h b/src/mame/includes/mtx.h
index d35126493e5..361cd3932d4 100644
--- a/src/mame/includes/mtx.h
+++ b/src/mame/includes/mtx.h
@@ -96,7 +96,6 @@ private:
TIMER_DEVICE_CALLBACK_MEMBER(cassette_tick);
DECLARE_WRITE_LINE_MEMBER(ctc_trg1_w);
DECLARE_WRITE_LINE_MEMBER(ctc_trg2_w);
- DECLARE_WRITE_LINE_MEMBER(mtx_tms9929a_interrupt);
DECLARE_READ8_MEMBER(mtx_strobe_r);
DECLARE_READ8_MEMBER(mtx_sound_strobe_r);
DECLARE_WRITE8_MEMBER(mtx_cst_w);
diff --git a/src/mame/includes/nes.h b/src/mame/includes/nes.h
index 21d1f8a7d9e..ee722e92b36 100644
--- a/src/mame/includes/nes.h
+++ b/src/mame/includes/nes.h
@@ -60,8 +60,8 @@ public:
{ }
required_device<cpu_device> m_maincpu;
- required_device<nes_control_port_device> m_ctrl1;
- required_device<nes_control_port_device> m_ctrl2;
+ optional_device<nes_control_port_device> m_ctrl1;
+ optional_device<nes_control_port_device> m_ctrl2;
DECLARE_READ8_MEMBER(nes_in0_r);
DECLARE_READ8_MEMBER(nes_in1_r);
diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h
index 0f4036024da..5e7d714afa7 100644
--- a/src/mame/includes/nmk16.h
+++ b/src/mame/includes/nmk16.h
@@ -16,7 +16,7 @@
#include "screen.h"
#include "tilemap.h"
-class nmk16_state : public driver_device, protected seibu_sound_common
+class nmk16_state : public driver_device, public seibu_sound_common
{
public:
nmk16_state(const machine_config &mconfig, device_type type, const char *tag) :
diff --git a/src/mame/includes/raiden.h b/src/mame/includes/raiden.h
index b72aa108c1c..f6a8a4001c9 100644
--- a/src/mame/includes/raiden.h
+++ b/src/mame/includes/raiden.h
@@ -15,7 +15,7 @@
#include "emupal.h"
#include "tilemap.h"
-class raiden_state : public driver_device, protected seibu_sound_common
+class raiden_state : public driver_device, public seibu_sound_common
{
public:
raiden_state(const machine_config &mconfig, device_type type, const char *tag) :
@@ -56,7 +56,8 @@ protected:
DECLARE_WRITE16_MEMBER(raiden_text_w);
-private:
+ void common_video_start();
+
required_device<cpu_device> m_subcpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
diff --git a/src/mame/includes/swtpc09.h b/src/mame/includes/swtpc09.h
index b3e310c5487..ada157e8f7f 100644
--- a/src/mame/includes/swtpc09.h
+++ b/src/mame/includes/swtpc09.h
@@ -44,14 +44,14 @@ public:
, m_via_cb2(*this, "via_cb2")
, m_dat(*this, "dat")
, m_bankdev(*this, "bankdev")
- , m_maincpu_clock(*this, "maincpu_clock")
- , m_fdc_clock(*this, "fdc_clock")
- , m_baud_rate_high(*this, "baud_rate_high")
- , m_floppy_expected_density(*this, "floppy_expected_density")
- , m_floppy_expected_sectors(*this, "floppy_expected_sectors")
- , m_floppy_track_zero_expected_sectors(*this, "floppy_track_zero_expected_sectors")
- , m_sbug_double_density(*this, "sbug_double_density")
- , m_piaide_flex_boot_cd00(*this, "piaide_flex_boot_cd00")
+ , m_maincpu_clock(*this, "MAINCPU_CLOCK")
+ , m_fdc_clock(*this, "FDC_CLOCK")
+ , m_baud_rate_high(*this, "BAUD_RATE_HIGH")
+ , m_floppy_expected_density(*this, "FLOPPY_EXPECTED_DENSITY")
+ , m_floppy_expected_sectors(*this, "FLOPPY_EXPECTED_SECTORS")
+ , m_floppy_track_zero_expected_sectors(*this, "FLOPPY_TRACK_ZERO_EXPECTED_SECTORS")
+ , m_sbug_double_density(*this, "SBUG_DOUBLE_DENSITY")
+ , m_piaide_flex_boot_cd00(*this, "PIAIDE_FLEX_BOOT_CD00")
{ }
void swtpc09_base(machine_config &config);
@@ -65,6 +65,10 @@ public:
void init_swtpc09u();
void init_swtpc09d3();
+ DECLARE_INPUT_CHANGED_MEMBER(maincpu_clock_change);
+ DECLARE_INPUT_CHANGED_MEMBER(fdc_clock_change);
+ DECLARE_INPUT_CHANGED_MEMBER(baud_rate_high_change);
+
private:
DECLARE_FLOPPY_FORMATS(floppy_flex_formats);
DECLARE_FLOPPY_FORMATS(floppy_uniflex_formats);
diff --git a/src/mame/machine/315_5649.cpp b/src/mame/machine/315_5649.cpp
index cee6fcf2434..54381739954 100644
--- a/src/mame/machine/315_5649.cpp
+++ b/src/mame/machine/315_5649.cpp
@@ -36,7 +36,9 @@ sega_315_5649_device::sega_315_5649_device(const machine_config &mconfig, const
m_out_port_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
m_an_port_cb{ {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this} },
m_serial_rd_cb{ {*this}, {*this} }, m_serial_wr_cb{ {*this}, {*this} },
+ m_cnt_cb{ {*this}, {*this}, {*this}, {*this} },
m_port_config(0),
+ m_mode(0),
m_analog_channel(0)
{
std::fill(std::begin(m_port_value), std::end(m_port_value), 0xff);
@@ -60,14 +62,20 @@ void sega_315_5649_device::device_start()
for (unsigned i = 0; i < 2; i++)
{
- m_serial_rd_cb[i].resolve_safe(0xff);
+ m_serial_rd_cb[i].resolve_safe(0);
m_serial_wr_cb[i].resolve_safe();
}
+ for (unsigned i = 0; i < 4; i++)
+ {
+ m_cnt_cb[i].resolve_safe(0);
+ }
+
// register for save states
save_pointer(NAME(m_port_value), 7);
save_item(NAME(m_port_config));
save_item(NAME(m_analog_channel));
+ save_item(NAME(m_mode));
}
//-------------------------------------------------
@@ -78,6 +86,7 @@ void sega_315_5649_device::device_reset()
{
// set all ports to input on reset
m_port_config = 0xff;
+ m_mode = 0;
}
@@ -92,13 +101,20 @@ READ8_MEMBER( sega_315_5649_device::read )
switch (offset)
{
// port a to g
+ case 0x06:
+ if (m_mode & 0x80) // port G counter mode - 4x 16bit counters, auto-increments
+ {
+ data = m_cnt_cb[(m_port_value[6] >> 1) & 3](0) >> (((m_port_value[6] & 1) ^ 1) * 8);
+ if (!machine().side_effects_disabled())
+ m_port_value[6] = (m_port_value[6] & 0xf8) | ((m_port_value[6] + 1) & 7);
+ break;
+ }
case 0x00:
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
- case 0x06:
if (BIT(m_port_config, offset))
data = m_in_port_cb[offset](0);
else
@@ -109,8 +125,8 @@ READ8_MEMBER( sega_315_5649_device::read )
case 0x0b: data = m_serial_rd_cb[0](0); break;
case 0x0c: data = m_serial_rd_cb[1](0); break;
- // status
- case 0x0d: break;
+ // serial status
+ case 0x0d: data = 0; break; // not implemented
// analog input, auto-increments
case 0x0f:
@@ -138,7 +154,7 @@ WRITE8_MEMBER( sega_315_5649_device::write )
case 0x03:
case 0x04:
case 0x05:
- case 0x06:
+ case 0x06: // when in counter mode, bit 7 - 0 reset counters (not implemented)
m_port_value[offset] = data;
m_out_port_cb[offset](data);
break;
@@ -151,7 +167,9 @@ WRITE8_MEMBER( sega_315_5649_device::write )
case 0x0a: m_serial_wr_cb[1](data); break;
// mode register
- case 0x0e: break;
+ case 0x0e:
+ m_mode = data;
+ break;
// analog mux select
case 0x0f:
diff --git a/src/mame/machine/315_5649.h b/src/mame/machine/315_5649.h
index 6e9c4c67a6d..4d5484c59e3 100644
--- a/src/mame/machine/315_5649.h
+++ b/src/mame/machine/315_5649.h
@@ -49,6 +49,8 @@ public:
auto serial_ch1_wr_callback() { return m_serial_wr_cb[0].bind(); }
auto serial_ch2_wr_callback() { return m_serial_wr_cb[1].bind(); }
+ template <unsigned N> auto in_counter_callback() { return m_cnt_cb[N].bind(); }
+
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
@@ -64,9 +66,11 @@ private:
devcb_read8 m_an_port_cb[8];
devcb_read8 m_serial_rd_cb[2];
devcb_write8 m_serial_wr_cb[2];
+ devcb_read16 m_cnt_cb[4];
uint8_t m_port_value[7];
uint8_t m_port_config;
+ uint8_t m_mode;
int m_analog_channel;
};
diff --git a/src/mame/machine/bbc.cpp b/src/mame/machine/bbc.cpp
index c15e57f60b0..00a0e3051e1 100644
--- a/src/mame/machine/bbc.cpp
+++ b/src/mame/machine/bbc.cpp
@@ -31,32 +31,58 @@ TIMER_CALLBACK_MEMBER(bbc_state::reset_timer_cb)
BBC Model B memory handling functions
****************************************/
-WRITE8_MEMBER(bbc_state::bbc_romsel_w)
+READ8_MEMBER(bbc_state::bbc_ram_r)
{
- if (m_swramtype == 0)
- {
- /* no sideways expansion board fitted so address only the 4 on board ROM sockets */
- m_swrbank = (data & 0x03) | 0x0c;
- }
+ if (m_internal && m_internal->overrides_ram())
+ return m_internal->ram_r(offset);
else
- {
- /* expansion board fitted so address all 16 ROM sockets */
- m_swrbank = data & 0x0f;
- }
+ return m_ram->pointer()[offset & m_ram->mask()];
+}
+
+WRITE8_MEMBER(bbc_state::bbc_ram_w)
+{
+ if (m_internal && m_internal->overrides_ram())
+ m_internal->ram_w(offset, data);
+ else
+ m_ram->pointer()[offset & m_ram->mask()] = data;
+}
+
+READ8_MEMBER(bbc_state::bbc_romsel_r)
+{
+ if (m_internal && m_internal->overrides_rom())
+ return m_internal->romsel_r(offset);
+ else
+ return 0xfe;
+}
+
+WRITE8_MEMBER(bbc_state::bbc_romsel_w)
+{
+ /* no sideways expansion board fitted so address only the 4 on board ROM sockets */
+ m_romsel = data & 0x03;
+
+ /* pass romsel to internal expansion board */
+ if (m_internal && m_internal->overrides_rom())
+ m_internal->romsel_w(offset, data);
}
READ8_MEMBER(bbc_state::bbc_paged_r)
{
uint8_t data;
- std::string region_tag;
- if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
+ if (m_internal && m_internal->overrides_rom())
{
- data = m_rom[m_swrbank]->read(offset);
+ data = m_internal->paged_r(offset);
}
else
{
- data = m_region_swr->base()[offset + (m_swrbank << 14)];
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
}
return data;
@@ -64,25 +90,81 @@ READ8_MEMBER(bbc_state::bbc_paged_r)
WRITE8_MEMBER(bbc_state::bbc_paged_w)
{
- static const unsigned short swramtype[4][16] = {
- // TODO: move sideways ROM/RAM boards to slot devices
- { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, // 0: none
- { 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 }, // 1: 128K (bank 8 to 15) Solidisk sideways ram userport bank latch (not implemented)
- { 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0 }, // 2: 64K (banks 4 to 7) for Acorn sideways ram FE30 bank latch
- { 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 }, // 3: 128K (banks 8 to 15) for Acorn sideways ram FE30 bank latch
- };
- std::string region_tag;
-
- if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
+ if (m_internal && m_internal->overrides_rom())
{
- m_rom[m_swrbank]->write(offset, data);
+ m_internal->paged_w(offset, data);
}
- else if (swramtype[m_swramtype][m_swrbank])
+ else
{
- m_region_swr->base()[offset + (m_swrbank << 14)] = data;
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
}
}
+READ8_MEMBER(bbc_state::bbc_mos_r)
+{
+ if (m_internal && m_internal->overrides_mos())
+ return m_internal->mos_r(offset);
+ else
+ return m_region_mos->base()[offset];
+}
+
+WRITE8_MEMBER(bbc_state::bbc_mos_w)
+{
+ if (m_internal && m_internal->overrides_mos())
+ m_internal->mos_w(offset, data);
+}
+
+READ8_MEMBER(bbc_state::bbc_fred_r)
+{
+ uint8_t data = 0xff;
+
+ data &= m_1mhzbus->fred_r(offset);
+
+ if (m_cart[0])
+ data &= m_cart[0]->read(offset, 1, 0, m_romsel & 0x01, 0, 0);
+ if (m_cart[1])
+ data &= m_cart[1]->read(offset, 1, 0, m_romsel & 0x01, 0, 0);
+
+ return data;
+}
+
+WRITE8_MEMBER(bbc_state::bbc_fred_w)
+{
+ m_1mhzbus->fred_w(offset, data);
+
+ if (m_cart[0])
+ m_cart[0]->write(offset, data, 1, 0, m_romsel & 0x01, 0, 0);
+ if (m_cart[1])
+ m_cart[1]->write(offset, data, 1, 0, m_romsel & 0x01, 0, 0);
+}
+
+READ8_MEMBER(bbc_state::bbc_jim_r)
+{
+ uint8_t data = 0xff;
+
+ data &= m_1mhzbus->jim_r(offset);
+
+ if(m_cart[0])
+ data &= m_cart[0]->read(offset, 0, 1, m_romsel & 0x01, 0, 0);
+ if (m_cart[1])
+ data &= m_cart[1]->read(offset, 0, 1, m_romsel & 0x01, 0, 0);
+
+ return data;
+}
+
+WRITE8_MEMBER(bbc_state::bbc_jim_w)
+{
+ m_1mhzbus->jim_w(offset, data);
+
+ if (m_cart[0])
+ m_cart[0]->write(offset, data, 0, 1, m_romsel & 0x01, 0, 0);
+ if (m_cart[1])
+ m_cart[1]->write(offset, data, 0, 1, m_romsel & 0x01, 0, 0);
+}
+
/****************************************
BBC Model B+ memory handling functions
@@ -132,7 +214,7 @@ WRITE8_MEMBER(bbc_state::bbcbp_romsel_w)
case 0x00:
m_paged_ram = BIT(data, 7);
- m_swrbank = data & 0x0f;
+ m_romsel = data & 0x0f;
break;
case 0x04:
@@ -141,6 +223,10 @@ WRITE8_MEMBER(bbc_state::bbcbp_romsel_w)
setvideoshadow(m_vdusel);
break;
}
+
+ /* pass romsel to internal expansion board */
+ if (m_internal && m_internal->overrides_rom())
+ m_internal->romsel_w(offset, data);
}
READ8_MEMBER(bbc_state::bbcbp_paged_r)
@@ -154,13 +240,21 @@ READ8_MEMBER(bbc_state::bbcbp_paged_r)
}
else
{
- if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
+ if (m_internal && m_internal->overrides_rom())
{
- data = m_rom[m_swrbank]->read(offset);
+ data = m_internal->paged_r(offset);
}
else
{
- data = m_region_swr->base()[offset + (m_swrbank << 14)];
+ /* 32K sockets */
+ if (m_rom[m_romsel & 0x0e] && m_rom[m_romsel & 0x0e]->present())
+ {
+ data = m_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
}
}
@@ -169,23 +263,23 @@ READ8_MEMBER(bbc_state::bbcbp_paged_r)
WRITE8_MEMBER(bbc_state::bbcbp_paged_w)
{
- /* the BBC Model B+ 128K has extra RAM mapped in replacing the ROM banks 0,1,c and d. */
- static const unsigned short swram_banks[16] = { 1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0 };
- std::string region_tag;
-
if (m_paged_ram && offset < 0x3000)
{
m_ram->pointer()[offset + 0x8000] = data;
}
else
{
- if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
+ if (m_internal && m_internal->overrides_rom())
{
- m_rom[m_swrbank]->write(offset, data);
+ m_internal->paged_w(offset, data);
}
- else if (m_ram->size() == 128 * 1024 && swram_banks[m_swrbank])
+ else
{
- m_region_swr->base()[offset + (m_swrbank << 14)] = data;
+ /* 32K sockets */
+ if (m_rom[m_romsel & 0x0e])
+ {
+ m_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
}
}
}
@@ -280,14 +374,17 @@ WRITE8_MEMBER(bbc_state::bbcm_acccon_w)
WRITE8_MEMBER(bbc_state::bbcm_romsel_w)
{
- m_paged_ram = (data & 0x80) >> 7;
- m_swrbank = data & 0x0f;
+ m_paged_ram = BIT(data, 7);
+ m_romsel = data & 0x0f;
+
+ /* pass romsel to internal expansion board */
+ if (m_internal && m_internal->overrides_rom())
+ m_internal->romsel_w(offset, data);
}
READ8_MEMBER(bbc_state::bbcm_paged_r)
{
- uint8_t data;
- std::string region_tag;
+ uint8_t data = 0xff;
if (m_paged_ram && offset < 0x1000)
{
@@ -295,36 +392,198 @@ READ8_MEMBER(bbc_state::bbcm_paged_r)
}
else
{
- if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
+ switch (m_romsel)
{
- data = m_rom[m_swrbank]->read(offset);
+ case 0: case 1:
+ if (m_cart[0] && m_cart[0]->present())
+ {
+ data = m_cart[0]->read(offset, 0, 0, m_romsel & 0x01, 1, 0);
+ }
+ else
+ {
+ data = bus_video_data();
+ }
+ break;
+ case 2: case 3:
+ if (m_cart[1] && m_cart[1]->present())
+ {
+ data = m_cart[1]->read(offset, 0, 0, m_romsel & 0x01, 1, 0);
+ }
+ else
+ {
+ data = bus_video_data();
+ }
+ break;
+ default:
+ if (m_internal && m_internal->overrides_rom())
+ {
+ data = m_internal->paged_r(offset);
+ }
+ else
+ {
+ switch (m_romsel)
+ {
+ case 4: case 5: case 6: case 7:
+ /* 32K sockets */
+ if (m_rom[m_romsel & 0x0e] && m_rom[m_romsel & 0x0e]->present())
+ {
+ data = m_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* 16K sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+
+ return data;
+}
+
+WRITE8_MEMBER(bbc_state::bbcm_paged_w)
+{
+ if (m_paged_ram && offset < 0x1000)
+ {
+ m_ram->pointer()[offset + 0x8000] = data;
+ }
+ else
+ {
+ switch (m_romsel)
+ {
+ case 0: case 1:
+ if (m_cart[0])
+ {
+ m_cart[0]->write(offset, data, 0, 0, m_romsel & 0x01, 1, 0);
+ }
+ break;
+ case 2: case 3:
+ if (m_cart[1])
+ {
+ m_cart[1]->write(offset, data, 0, 0, m_romsel & 0x01, 1, 0);
+ }
+ break;
+ default:
+ if (m_internal && m_internal->overrides_rom())
+ {
+ m_internal->paged_w(offset, data);
+ }
+ else
+ {
+ switch (m_romsel)
+ {
+ case 4: case 5: case 6: case 7:
+ /* 32K sockets */
+ if (m_rom[m_romsel & 0x0e])
+ {
+ m_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
+ break;
+ default:
+ /* 16K sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+}
+
+READ8_MEMBER(bbc_state::bbcmc_paged_r)
+{
+ uint8_t data = 0xff;
+
+ if (m_paged_ram && offset < 0x1000)
+ {
+ data = m_ram->pointer()[offset + 0x8000];
+ }
+ else
+ {
+ if (m_internal && m_internal->overrides_rom())
+ {
+ data = m_internal->paged_r(offset);
}
else
{
- data = m_region_swr->base()[offset + (m_swrbank << 14)];
+ switch (m_romsel)
+ {
+ case 0: case 1: case 4: case 5: case 6: case 7:
+ /* 32K sockets */
+ if (m_rom[m_romsel & 0x0e] && m_rom[m_romsel & 0x0e]->present())
+ {
+ data = m_rom[m_romsel & 0x0e]->read(offset | (m_romsel & 0x01) << 14);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ default:
+ /* 16K sockets */
+ if (m_rom[m_romsel] && m_rom[m_romsel]->present())
+ {
+ data = m_rom[m_romsel]->read(offset);
+ }
+ else
+ {
+ data = m_region_swr->base()[offset + (m_romsel << 14)];
+ }
+ break;
+ }
}
}
return data;
}
-WRITE8_MEMBER(bbc_state::bbcm_paged_w)
+WRITE8_MEMBER(bbc_state::bbcmc_paged_w)
{
- std::string region_tag;
-
if (m_paged_ram && offset < 0x1000)
{
m_ram->pointer()[offset + 0x8000] = data;
}
else
{
- if (m_rom[m_swrbank] && memregion(region_tag.assign(m_rom[m_swrbank]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
+ if (m_internal && m_internal->overrides_rom())
{
- m_rom[m_swrbank]->write(offset, data);
+ m_internal->paged_w(offset, data);
}
- else if ((!m_lk19_ic37_paged_rom && (m_swrbank == 4 || m_swrbank == 5)) || (!m_lk18_ic41_paged_rom && (m_swrbank == 6 || m_swrbank == 7)))
+ else
{
- m_region_swr->base()[offset + (m_swrbank << 14)] = data;
+ switch (m_romsel)
+ {
+ case 0: case 1: case 4: case 5: case 6: case 7:
+ /* 32K sockets */
+ if (m_rom[m_romsel & 0x0e])
+ {
+ m_rom[m_romsel & 0x0e]->write(offset | (m_romsel & 0x01) << 14, data);
+ }
+ break;
+ default:
+ /* 16K sockets */
+ if (m_rom[m_romsel])
+ {
+ m_rom[m_romsel]->write(offset, data);
+ }
+ break;
+ }
}
}
}
@@ -339,7 +598,10 @@ READ8_MEMBER(bbc_state::bbcm_hazel_r)
}
else
{
- data = m_region_mos->base()[offset];
+ if (m_internal && m_internal->overrides_mos())
+ data = m_internal->mos_r(offset);
+ else
+ data = m_region_mos->base()[offset];
}
return data;
@@ -500,19 +762,12 @@ INTERRUPT_GEN_MEMBER(bbc_state::bbcb_keyscan)
/* keyboard not enabled so increment counter */
m_column = (m_column + 1) % 16;
- if (m_column < 13)
+ /* KBD IC4 8 input NAND gate */
+ /* set the value of via_system ca2, by checking for any keys
+ being pressed on the selected m_column */
+ if ((m_keyboard[m_column]->read() | 0x01) != 0xff)
{
- /* KBD IC4 8 input NAND gate */
- /* set the value of via_system ca2, by checking for any keys
- being pressed on the selected m_column */
- if ((m_keyboard[m_column]->read() | 0x01) != 0xff)
- {
- m_via6522_0->write_ca2(1);
- }
- else
- {
- m_via6522_0->write_ca2(0);
- }
+ m_via6522_0->write_ca2(1);
}
else
{
@@ -533,14 +788,7 @@ int bbc_state::bbc_keyboard(int data)
bit = 0;
- if (m_column < 13)
- {
- res = m_keyboard[m_column]->read();
- }
- else
- {
- res = 0xff;
- }
+ res = m_keyboard[m_column]->read();
/* Normal keyboard result */
if ((res & (1<<row)) == 0)
@@ -1175,45 +1423,6 @@ WRITE8_MEMBER(bbc_state::bbcmc_drive_control_w)
m_wd1772->mr_w(BIT(data, 2));
}
-/**************************************
- BBC cartslot loading functions
-***************************************/
-
-image_init_result bbc_state::load_cart(device_image_interface &image, generic_slot_device *slot)
-{
- if (!image.loaded_through_softlist())
- {
- uint32_t filesize = image.length();
-
- if (filesize > 0x8000)
- {
- image.seterror(IMAGE_ERROR_UNSPECIFIED, "Cartridge socket accepts 16K/32K only");
- return image_init_result::FAIL;
- }
-
- slot->rom_alloc(filesize, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- image.fread(slot->get_rom_base(), filesize);
- return image_init_result::PASS;
- }
- else
- {
- uint32_t size_lo = image.get_software_region_length("lorom");
- uint32_t size_hi = image.get_software_region_length("uprom");
-
- if (size_lo + size_hi > 0x8000)
- {
- image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
- return image_init_result::FAIL;
- }
-
- slot->rom_alloc(0x8000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
- memcpy(slot->get_rom_base() + 0x0000, image.get_software_region("lorom"), size_lo);
- memcpy(slot->get_rom_base() + 0x4000, image.get_software_region("uprom"), size_hi);
- }
-
- return image_init_result::PASS;
-}
-
/**************************************
Machine Initialisation functions
@@ -1235,7 +1444,6 @@ void bbc_state::init_bbc()
m_via6522_0->write_cb2(1);
m_monitortype = monitor_type_t::COLOUR;
- m_swramtype = 0;
}
void bbc_state::init_ltmp()
@@ -1246,42 +1454,10 @@ void bbc_state::init_ltmp()
m_monitortype = monitor_type_t::GREEN;
}
-void bbc_state::init_bbcm()
-{
- std::string region_tag;
-
- init_bbc();
-
- /* set links if ROM present, disabling RAM */
- if (m_rom[4] && memregion(region_tag.assign(m_rom[4]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
- {
- /* link for ROM in slots 4 and 5 */
- m_lk19_ic37_paged_rom = true;
- }
- else
- {
- m_lk18_ic41_paged_rom = false;
- }
- if (m_rom[6] && memregion(region_tag.assign(m_rom[6]->tag()).append(BBC_ROM_REGION_TAG).c_str()))
- {
- /* link for ROM in slots 6 and 7 */
- m_lk18_ic41_paged_rom = true;
- }
- else
- {
- m_lk18_ic41_paged_rom = false;
- }
-}
-
void bbc_state::init_cfa()
{
init_bbc();
- /* link for ROM in slots 4 and 5 */
- m_lk19_ic37_paged_rom = true;
- /* link for ROM in slots 6 and 7 */
- m_lk18_ic41_paged_rom = true;
-
m_monitortype = monitor_type_t::GREEN;
}
@@ -1365,12 +1541,18 @@ void bbc_state::setup_device_roms()
device_t* exp_device;
device_t* ext_device;
- /* insert ROM for FDC devices (BBC Model B only), always place into romslot 12 */
+ /* insert ROM(s) for internal expansion boards */
+ if (m_internal && (exp_device = dynamic_cast<device_t*>(m_internal->get_card_device())))
+ {
+ insert_device_rom(exp_device->memregion("exp_rom"));
+ }
+
+ /* insert ROM for FDC devices (BBC Model B only), always place into romslot 0 */
if (m_fdc && (exp_device = dynamic_cast<device_t*>(m_fdc->get_card_device())))
{
if (exp_device->memregion("dfs_rom"))
{
- memcpy(m_region_swr->base() + 0x30000, exp_device->memregion("dfs_rom")->base(), exp_device->memregion("dfs_rom")->bytes());
+ memcpy(m_region_swr->base(), exp_device->memregion("dfs_rom")->base(), exp_device->memregion("dfs_rom")->bytes());
}
}
@@ -1389,7 +1571,7 @@ void bbc_state::setup_device_roms()
/* configure cartslots */
for (int i = 0; i < 2; i++)
{
- if (m_cart[i] && (rom_region = memregion(region_tag.assign(m_cart[i]->tag()).append(GENERIC_ROM_REGION_TAG).c_str())))
+ if (m_cart[i] && (rom_region = memregion(region_tag.assign(m_cart[i]->tag()).append(ELECTRON_CART_ROM_REGION_TAG).c_str())))
{
memcpy(m_region_swr->base() + (i * 0x8000), rom_region->base(), rom_region->bytes());
}
@@ -1494,21 +1676,6 @@ void bbc_state::machine_start()
void bbc_state::machine_reset()
{
- m_swramtype = (m_bbcconfig.read_safe(0) & 0x38) >> 3;
- /* bank 1 regular lower RAM from 0000 to 3fff */
- m_bank1->set_base(m_ram->pointer());
- /* bank 3 regular higher RAM from 4000 to 7fff */
- if (m_ram->size() == 16 * 1024)
- {
- /* 16K just repeat the lower 16K*/
- m_bank3->set_base(m_ram->pointer());
- }
- else
- {
- /* 32K */
- m_bank3->set_base(m_ram->pointer() + 0x4000);
- }
-
/* install econet hardware */
if (m_bbcconfig.read_safe(0) & 0x04)
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfea0, 0xfebf, read8sm_delegate(*m_adlc, FUNC(mc6854_device::read)), write8sm_delegate(*m_adlc, FUNC(mc6854_device::write)));
diff --git a/src/mame/machine/hp80_optrom.cpp b/src/mame/machine/hp80_optrom.cpp
new file mode 100644
index 00000000000..c61646515ba
--- /dev/null
+++ b/src/mame/machine/hp80_optrom.cpp
@@ -0,0 +1,89 @@
+// license:BSD-3-Clause
+// copyright-holders: F. Ulivi
+/*********************************************************************
+
+ hp80_optrom.cpp
+
+ Optional ROMs for HP80 systems
+
+*********************************************************************/
+
+#include "emu.h"
+#include "hp80_optrom.h"
+#include "softlist.h"
+
+// Debugging
+#define VERBOSE 1
+#include "logmacro.h"
+
+DEFINE_DEVICE_TYPE(HP80_OPTROM, hp80_optrom_device, "hp80_optrom", "HP80 optional ROM")
+
+// +------------------+
+// |hp80_optrom_device|
+// +------------------+
+hp80_optrom_device::hp80_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, HP80_OPTROM, tag, owner, clock),
+ device_image_interface(mconfig, *this),
+ m_select_code(0)
+{
+}
+
+hp80_optrom_device::~hp80_optrom_device()
+{
+}
+
+void hp80_optrom_device::install_read_handler(address_space& space)
+{
+ if (loaded_through_softlist()) {
+ offs_t start = (offs_t)m_select_code * HP80_OPTROM_SIZE;
+ space.install_rom(start , start + HP80_OPTROM_SIZE - 1 , get_software_region("rom"));
+ }
+}
+
+void hp80_optrom_device::device_start()
+{
+}
+
+image_init_result hp80_optrom_device::call_load()
+{
+ LOG("hp80_optrom: call_load\n");
+ if (!loaded_through_softlist()) {
+ LOG("hp80_optrom: must be loaded from sw list\n");
+ return image_init_result::FAIL;
+ }
+
+ const char *sc_feature = get_feature("sc");
+ if (sc_feature == nullptr) {
+ LOG("hp80_optrom: no 'sc' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ unsigned sc;
+ if (sc_feature[ 0 ] != '0' || sc_feature[ 1 ] != 'x' || sscanf(&sc_feature[ 2 ] , "%x" , &sc) != 1) {
+ LOG("hp80_optrom: can't parse 'sc' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ // Valid SC values: 0x01..0xff
+ if (sc < 1 || sc > 0xff) {
+ LOG("hp80_optrom: illegal select code (%x)\n" , sc);
+ return image_init_result::FAIL;
+ }
+
+ auto length = get_software_region_length("rom");
+
+ if (length != HP80_OPTROM_SIZE) {
+ LOG("hp80_optrom: illegal region length (%x)\n" , length);
+ return image_init_result::FAIL;
+ }
+
+ LOG("hp80_optrom: loaded SC=0x%02x\n" , sc);
+ m_select_code = sc;
+ return image_init_result::PASS;
+}
+
+void hp80_optrom_device::call_unload()
+{
+ LOG("hp80_optrom: call_unload\n");
+ machine().schedule_soft_reset();
+}
diff --git a/src/mame/machine/hp80_optrom.h b/src/mame/machine/hp80_optrom.h
new file mode 100644
index 00000000000..f0e272f60c8
--- /dev/null
+++ b/src/mame/machine/hp80_optrom.h
@@ -0,0 +1,60 @@
+// license:BSD-3-Clause
+// copyright-holders: F. Ulivi
+/*********************************************************************
+
+ hp80_optrom.h
+
+ Optional ROMs for HP80 systems
+
+*********************************************************************/
+
+#ifndef MAME_MACHINE_HP80_OPTROM_H
+#define MAME_MACHINE_HP80_OPTROM_H
+
+#pragma once
+
+#include "softlist_dev.h"
+
+// Size of optional ROMs (8k)
+static constexpr offs_t HP80_OPTROM_SIZE = 0x2000;
+
+class hp80_optrom_device : public device_t,
+ public device_image_interface
+{
+public:
+ // construction/destruction
+ hp80_optrom_device(machine_config const &mconfig, char const *tag, device_t *owner)
+ : hp80_optrom_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ }
+
+ hp80_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~hp80_optrom_device();
+
+ void install_read_handler(address_space& space);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // image-level overrides
+ virtual image_init_result call_load() override;
+ virtual void call_unload() override;
+ virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
+
+ virtual iodevice_t image_type() const override { return IO_ROM; }
+ virtual bool is_readable() const override { return true; }
+ virtual bool is_writeable() const override { return false; }
+ virtual bool is_creatable() const override { return false; }
+ virtual bool must_be_loaded() const override { return false; }
+ virtual bool is_reset_on_load() const override { return true; }
+ virtual const char *image_interface() const override { return "hp80_rom"; }
+ virtual const char *file_extensions() const override { return "bin"; }
+
+ uint8_t m_select_code;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(HP80_OPTROM, hp80_optrom_device)
+
+#endif // MAME_MACHINE_HP80_OPTROM_H
diff --git a/src/devices/bus/hp9825_optroms/hp9825_optrom.cpp b/src/mame/machine/hp9825_optrom.cpp
index a94f5d484bf..b49ed6f4846 100644
--- a/src/devices/bus/hp9825_optroms/hp9825_optrom.cpp
+++ b/src/mame/machine/hp9825_optrom.cpp
@@ -16,8 +16,7 @@
//#define VERBOSE 1
#include "logmacro.h"
-DEFINE_DEVICE_TYPE(HP9825_OPTROM_CART, hp9825_optrom_cart_device, "hp9825_optrom_cart", "HP9825 optional ROM cartridge")
-DEFINE_DEVICE_TYPE(HP9825_OPTROM_SLOT, hp9825_optrom_slot_device, "hp9825_optrom_slot", "HP9825 optional ROM slot")
+DEFINE_DEVICE_TYPE(HP9825_OPTROM, hp9825_optrom_device, "hp9825_optrom", "HP9825 optional ROM")
struct optrom_region {
offs_t m_start;
@@ -37,57 +36,29 @@ constexpr std::array<struct optrom_region , 8> region_tab =
{ 0x5c00 ,0x2000 , "rom5c00" }
}};
-// +------------------------------+
-// |device_hp9825_optrom_interface|
-// +------------------------------+
-device_hp9825_optrom_interface::device_hp9825_optrom_interface(const machine_config &mconfig, device_t &device)
- : device_interface(device, "hp9825optrom")
+// +--------------------+
+// |hp9825_optrom_device|
+// +--------------------+
+hp9825_optrom_device::hp9825_optrom_device(machine_config const &mconfig, char const *tag, device_t *owner)
+ : hp9825_optrom_device(mconfig, tag, owner, (uint32_t)0)
{
}
-// +-------------------------+
-// |hp9825_optrom_cart_device|
-// +-------------------------+
-hp9825_optrom_cart_device::hp9825_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : hp9825_optrom_cart_device(mconfig , HP9825_OPTROM_CART , tag , owner , clock)
-{
-}
-
-hp9825_optrom_cart_device::hp9825_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, type, tag, owner, clock)
- , device_hp9825_optrom_interface(mconfig, *this)
-{
-}
-
-// +-------------------------+
-// |hp9825_optrom_slot_device|
-// +-------------------------+
-hp9825_optrom_slot_device::hp9825_optrom_slot_device(machine_config const &mconfig, char const *tag, device_t *owner)
- : hp9825_optrom_slot_device(mconfig, tag, owner, (uint32_t)0)
-{
-}
-
-hp9825_optrom_slot_device::hp9825_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, HP9825_OPTROM_SLOT, tag, owner, clock)
+hp9825_optrom_device::hp9825_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, HP9825_OPTROM, tag, owner, clock)
, device_image_interface(mconfig, *this)
- , device_single_card_slot_interface<device_hp9825_optrom_interface>(mconfig, *this)
- , m_cart(nullptr)
, m_rom_limit(0xffffU)
, m_loaded_regions(0)
, m_space_r(nullptr)
, m_bank(*this , "rombank")
{
- option_reset();
- option_add_internal("rom", HP9825_OPTROM_CART);
- set_default_option(nullptr);
- set_fixed(false);
}
-hp9825_optrom_slot_device::~hp9825_optrom_slot_device()
+hp9825_optrom_device::~hp9825_optrom_device()
{
}
-void hp9825_optrom_slot_device::install_rw_handlers(address_space *space_r , address_space *space_w)
+void hp9825_optrom_device::install_rw_handlers(address_space *space_r , address_space *space_w)
{
LOG("limit=%04x\n" , m_rom_limit);
m_loaded_regions = 0;
@@ -121,20 +92,19 @@ void hp9825_optrom_slot_device::install_rw_handlers(address_space *space_r , add
}
}
-void hp9825_optrom_slot_device::device_add_mconfig(machine_config &config)
+void hp9825_optrom_device::device_add_mconfig(machine_config &config)
{
ADDRESS_MAP_BANK(config, m_bank).set_options(ENDIANNESS_BIG, 16, 13, 0x400).set_shift(-1);
}
-void hp9825_optrom_slot_device::device_start()
+void hp9825_optrom_device::device_start()
{
- m_cart = get_card_device();
}
-image_init_result hp9825_optrom_slot_device::call_load()
+image_init_result hp9825_optrom_device::call_load()
{
LOG("hp9825_optrom: call_load\n");
- if (m_cart == nullptr || !loaded_through_softlist()) {
+ if (!loaded_through_softlist()) {
LOG("hp9825_optrom: must be loaded from sw list\n");
return image_init_result::FAIL;
}
@@ -156,7 +126,7 @@ image_init_result hp9825_optrom_slot_device::call_load()
return image_init_result::PASS;
}
-void hp9825_optrom_slot_device::call_unload()
+void hp9825_optrom_device::call_unload()
{
LOG("hp9825_optrom: call_unload\n");
if (m_space_r != nullptr && m_loaded_regions) {
@@ -179,9 +149,3 @@ void hp9825_optrom_slot_device::call_unload()
}
machine().schedule_soft_reset();
}
-
-std::string hp9825_optrom_slot_device::get_default_card_software(get_default_card_software_hook &hook) const
-{
- return software_get_default_slot("rom");
-}
-
diff --git a/src/devices/bus/hp9825_optroms/hp9825_optrom.h b/src/mame/machine/hp9825_optrom.h
index 458e17809c6..390c6a43eea 100644
--- a/src/devices/bus/hp9825_optroms/hp9825_optrom.h
+++ b/src/mame/machine/hp9825_optrom.h
@@ -7,42 +7,22 @@
Optional ROMs for HP9825 systems
*********************************************************************/
-#ifndef MAME_BUS_HP9825_OPTROMS_HP9825_OPTROM_H
-#define MAME_BUS_HP9825_OPTROMS_HP9825_OPTROM_H
+#ifndef MAME_MACHINE_HP9825_OPTROM_H
+#define MAME_MACHINE_HP9825_OPTROM_H
#pragma once
#include "machine/bankdev.h"
#include "softlist_dev.h"
-class device_hp9825_optrom_interface : public device_interface
-{
-public:
- device_hp9825_optrom_interface(const machine_config &mconfig, device_t &device);
-};
-
-class hp9825_optrom_cart_device : public device_t, public device_hp9825_optrom_interface
-{
-public:
- // construction/destruction
- hp9825_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
-protected:
- hp9825_optrom_cart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override { }
-};
-
-class hp9825_optrom_slot_device : public device_t,
- public device_image_interface,
- public device_single_card_slot_interface<device_hp9825_optrom_interface>
+class hp9825_optrom_device : public device_t,
+ public device_image_interface
{
public:
// construction/destruction
- hp9825_optrom_slot_device(machine_config const &mconfig, char const *tag, device_t *owner);
- hp9825_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- virtual ~hp9825_optrom_slot_device();
+ hp9825_optrom_device(machine_config const &mconfig, char const *tag, device_t *owner);
+ hp9825_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~hp9825_optrom_device();
void set_rom_limit(offs_t rom_limit) { m_rom_limit = rom_limit; }
@@ -67,10 +47,6 @@ protected:
virtual const char *image_interface() const override { return "hp9825_rom"; }
virtual const char *file_extensions() const override { return "bin"; }
- // slot interface overrides
- virtual std::string get_default_card_software(get_default_card_software_hook &hook) const override;
-
- device_hp9825_optrom_interface *m_cart;
offs_t m_rom_limit;
unsigned m_loaded_regions;
address_space *m_space_r;
@@ -78,7 +54,6 @@ protected:
};
// device type definition
-DECLARE_DEVICE_TYPE(HP9825_OPTROM_SLOT, hp9825_optrom_slot_device)
-DECLARE_DEVICE_TYPE(HP9825_OPTROM_CART, hp9825_optrom_cart_device)
+DECLARE_DEVICE_TYPE(HP9825_OPTROM, hp9825_optrom_device)
-#endif /* MAME_BUS_HP9825_OPTROMS_HP9825_OPTROM_H */
+#endif /* MAME_MACHINE_HP9825_OPTROM_H */
diff --git a/src/mame/machine/hp9845_optrom.cpp b/src/mame/machine/hp9845_optrom.cpp
new file mode 100644
index 00000000000..26f5a41cf3b
--- /dev/null
+++ b/src/mame/machine/hp9845_optrom.cpp
@@ -0,0 +1,99 @@
+// license:BSD-3-Clause
+// copyright-holders: F. Ulivi
+/*********************************************************************
+
+ hp9845_optrom.cpp
+
+ Optional ROMs for HP9845 systems
+
+*********************************************************************/
+
+#include "emu.h"
+#include "hp9845_optrom.h"
+#include "softlist.h"
+#include "cpu/hphybrid/hphybrid.h"
+
+DEFINE_DEVICE_TYPE(HP9845_OPTROM, hp9845_optrom_device, "hp9845_optrom", "HP9845 optional ROM")
+
+// +--------------------+
+// |hp9845_optrom_device|
+// +--------------------+
+hp9845_optrom_device::hp9845_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, HP9845_OPTROM, tag, owner, clock),
+ device_image_interface(mconfig, *this),
+ m_base_addr(0),
+ m_end_addr(0)
+{
+}
+
+hp9845_optrom_device::~hp9845_optrom_device()
+{
+}
+
+void hp9845_optrom_device::device_start()
+{
+}
+
+image_init_result hp9845_optrom_device::call_load()
+{
+ logerror("hp9845_optrom: call_load\n");
+ if (!loaded_through_softlist()) {
+ logerror("hp9845_optrom: must be loaded from sw list\n");
+ return image_init_result::FAIL;
+ }
+
+ const char *base_feature = get_feature("base");
+ if (base_feature == nullptr) {
+ logerror("hp9845_optrom: no 'base' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ offs_t base_addr;
+ if (base_feature[ 0 ] != '0' || base_feature[ 1 ] != 'x' || sscanf(&base_feature[ 2 ] , "%x" , &base_addr) != 1) {
+ logerror("hp9845_optrom: can't parse 'base' feature\n");
+ return image_init_result::FAIL;
+ }
+
+ // Valid BSC values for ROMs on LPU drawer: 0x07 0x0b .... 0x3b
+ // Valid BSC values for ROMs on PPU drawer: 0x09 0x0d .... 0x3d
+ // (BSC is field in bits 16..21 of base address)
+ // Bit 15 of base address must be 0
+ // Base address must be multiple of 0x1000
+ if ((base_addr & ~0x3f7000UL) != 0 || ((base_addr & 0x30000) != 0x10000 && (base_addr & 0x30000) != 0x30000) || base_addr < 0x70000) {
+ logerror("hp9845_optrom: illegal base address (%x)\n" , base_addr);
+ return image_init_result::FAIL;
+ }
+
+ auto length = get_software_region_length("rom") / 2;
+
+ if (length < 0x1000 || length > 0x8000 || (length & 0xfff) != 0 || ((base_addr & 0x7000) + length) > 0x8000) {
+ logerror("hp9845_optrom: illegal region length (%x)\n" , length);
+ return image_init_result::FAIL;
+ }
+
+ offs_t end_addr = base_addr + length - 1;
+ logerror("hp9845_optrom: base_addr = %06x end_addr = %06x\n" , base_addr , end_addr);
+
+ // Install ROM in address space of every CPU
+ for (hp_hybrid_cpu_device& cpu : device_interface_iterator<hp_hybrid_cpu_device>(machine().root_device())) {
+ logerror("hp9845_optrom: install in %s AS\n" , cpu.tag());
+ cpu.space(AS_PROGRAM).install_rom(base_addr , end_addr , get_software_region("rom"));
+ }
+
+ m_base_addr = base_addr;
+ m_end_addr = end_addr;
+
+ return image_init_result::PASS;
+}
+
+void hp9845_optrom_device::call_unload()
+{
+ logerror("hp9845_optrom: call_unload\n");
+ if (m_base_addr != 0 && m_end_addr != 0) {
+ for (hp_hybrid_cpu_device& cpu : device_interface_iterator<hp_hybrid_cpu_device>(machine().root_device())) {
+ cpu.space(AS_PROGRAM).unmap_read(m_base_addr , m_end_addr);
+ }
+ m_base_addr = 0;
+ m_end_addr = 0;
+ }
+}
diff --git a/src/mame/machine/hp9845_optrom.h b/src/mame/machine/hp9845_optrom.h
new file mode 100644
index 00000000000..289c3b2c7bc
--- /dev/null
+++ b/src/mame/machine/hp9845_optrom.h
@@ -0,0 +1,51 @@
+// license:BSD-3-Clause
+// copyright-holders: F. Ulivi
+/*********************************************************************
+
+ hp9845_optrom.h
+
+ Optional ROMs for HP9845 systems
+
+*********************************************************************/
+
+#ifndef MAME_MACHINE_HP9845_OPTROM_H
+#define MAME_MACHINE_HP9845_OPTROM_H
+
+#pragma once
+
+#include "softlist_dev.h"
+
+class hp9845_optrom_device : public device_t,
+ public device_image_interface
+{
+public:
+ // construction/destruction
+ hp9845_optrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~hp9845_optrom_device();
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // image-level overrides
+ virtual image_init_result call_load() override;
+ virtual void call_unload() override;
+ virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
+
+ virtual iodevice_t image_type() const override { return IO_ROM; }
+ virtual bool is_readable() const override { return true; }
+ virtual bool is_writeable() const override { return false; }
+ virtual bool is_creatable() const override { return false; }
+ virtual bool must_be_loaded() const override { return false; }
+ virtual bool is_reset_on_load() const override { return true; }
+ virtual const char *image_interface() const override { return "hp9845b_rom"; }
+ virtual const char *file_extensions() const override { return "bin"; }
+
+ offs_t m_base_addr;
+ offs_t m_end_addr;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(HP9845_OPTROM, hp9845_optrom_device)
+
+#endif // MAME_MACHINE_HP9845_OPTROM_H
diff --git a/src/mame/machine/swtpc09.cpp b/src/mame/machine/swtpc09.cpp
index ad84096fc79..ddf424b02e8 100644
--- a/src/mame/machine/swtpc09.cpp
+++ b/src/mame/machine/swtpc09.cpp
@@ -45,7 +45,7 @@ WRITE_LINE_MEMBER(swtpc09_state::io_irq_w)
/******* MC6840 PTM on MPID Board *******/
-/* 6840 PTM handlers */
+// 6840 PTM handlers
WRITE_LINE_MEMBER( swtpc09_state::ptm_o1_callback )
{
m_pia_counter++;
@@ -55,7 +55,7 @@ WRITE_LINE_MEMBER( swtpc09_state::ptm_o1_callback )
WRITE_LINE_MEMBER( swtpc09_state::ptm_o3_callback )
{
- /* the output from timer3 is the input clock for timer2 */
+ // the output from timer3 is the input clock for timer2
//m_ptm->set_c2(state);
}
@@ -604,25 +604,17 @@ offs_t swtpc09_state::dat_translate(offs_t offset) const
READ8_MEMBER(swtpc09_state::main_r)
{
if (offset < 0xff00)
- {
return m_banked_space->read_byte(dat_translate(offset));
- }
else
- {
return m_banked_space->read_byte(offset | 0xfff00);
- }
}
WRITE8_MEMBER(swtpc09_state::main_w)
{
if (offset < 0xff00)
- {
m_banked_space->write_byte(dat_translate(offset), data);
- }
else
- {
m_banked_space->write_byte(offset | 0xfff00, data);
- }
}
/* MC6844 DMA controller I/O */
@@ -735,10 +727,10 @@ READ8_MEMBER( swtpc09_state::m6844_r )
{
uint8_t result = 0;
- /* switch off the offset we were given */
+ // switch off the offset we were given
switch (offset)
{
- /* upper byte of address */
+ // upper byte of address
case 0x00:
case 0x04:
case 0x08:
@@ -746,7 +738,7 @@ READ8_MEMBER( swtpc09_state::m6844_r )
result = m_m6844_channel[offset / 4].address >> 8;
break;
- /* lower byte of address */
+ // lower byte of address
case 0x01:
case 0x05:
case 0x09:
@@ -754,7 +746,7 @@ READ8_MEMBER( swtpc09_state::m6844_r )
result = m_m6844_channel[offset / 4].address & 0xff;
break;
- /* upper byte of counter */
+ // upper byte of counter
case 0x02:
case 0x06:
case 0x0a:
@@ -762,7 +754,7 @@ READ8_MEMBER( swtpc09_state::m6844_r )
result = m_m6844_channel[offset / 4].counter >> 8;
break;
- /* lower byte of counter */
+ // lower byte of counter
case 0x03:
case 0x07:
case 0x0b:
@@ -770,7 +762,7 @@ READ8_MEMBER( swtpc09_state::m6844_r )
result = m_m6844_channel[offset / 4].counter & 0xff;
break;
- /* channel control */
+ // channel control
case 0x10:
case 0x11:
case 0x12:
@@ -787,33 +779,30 @@ READ8_MEMBER( swtpc09_state::m6844_r )
}
break;
- /* priority control */
+ // priority control
case 0x14:
result = m_m6844_priority;
break;
- /* interrupt control */
+ // interrupt control
case 0x15:
result = m_m6844_interrupt;
break;
- /* chaining control */
+ // chaining control
case 0x16:
result = m_m6844_chain;
break;
- /* 0x17-0x1f not used */
+ // 0x17-0x1f not used
default: break;
}
- if (m_system_type == UNIFLEX_DMAF2 || m_system_type == FLEX_DMAF2) // if DMAF2 controller data bus is inverted to 6844
- {
+ // if DMAF2 controller data bus is inverted to 6844
+ if (m_system_type == UNIFLEX_DMAF2 || m_system_type == FLEX_DMAF2)
return ~result & 0xff;
- }
else
- {
return result & 0xff;
- }
}
@@ -821,13 +810,14 @@ WRITE8_MEMBER( swtpc09_state::m6844_w )
{
int i;
- if (m_system_type == UNIFLEX_DMAF2 || m_system_type == FLEX_DMAF2) // if DMAF2 controller data bus is inverted to 6844
+ // if DMAF2 controller data bus is inverted to 6844
+ if (m_system_type == UNIFLEX_DMAF2 || m_system_type == FLEX_DMAF2)
data = ~data & 0xff;
- /* switch off the offset we were given */
+ // switch off the offset we were given
switch (offset)
{
- /* upper byte of address */
+ // upper byte of address
case 0x00:
case 0x04:
case 0x08:
@@ -835,7 +825,7 @@ WRITE8_MEMBER( swtpc09_state::m6844_w )
m_m6844_channel[offset / 4].address = (m_m6844_channel[offset / 4].address & 0xff) | (data << 8);
break;
- /* lower byte of address */
+ // lower byte of address
case 0x01:
case 0x05:
case 0x09:
@@ -843,7 +833,7 @@ WRITE8_MEMBER( swtpc09_state::m6844_w )
m_m6844_channel[offset / 4].address = (m_m6844_channel[offset / 4].address & 0xff00) | (data & 0xff);
break;
- /* upper byte of counter */
+ // upper byte of counter
case 0x02:
case 0x06:
case 0x0a:
@@ -851,7 +841,7 @@ WRITE8_MEMBER( swtpc09_state::m6844_w )
m_m6844_channel[offset / 4].counter = (m_m6844_channel[offset / 4].counter & 0xff) | (data << 8);
break;
- /* lower byte of counter */
+ // lower byte of counter
case 0x03:
case 0x07:
case 0x0b:
@@ -859,7 +849,7 @@ WRITE8_MEMBER( swtpc09_state::m6844_w )
m_m6844_channel[offset / 4].counter = (m_m6844_channel[offset / 4].counter & 0xff00) | (data & 0xff);
break;
- /* channel control */
+ // channel control
case 0x10:
case 0x11:
case 0x12:
@@ -867,57 +857,73 @@ WRITE8_MEMBER( swtpc09_state::m6844_w )
m_m6844_channel[offset - 0x10].control = (m_m6844_channel[offset - 0x10].control & 0xc0) | (data & 0x3f);
break;
- /* priority control */
+ // priority control
case 0x14:
m_m6844_priority = data;
- /* update each channel */
+ // update each channel
for (i = 0; i < 4; i++)
{
- /* if we're going active... */
+ // if we're going active...
if (!m_m6844_channel[i].active && (data & (1 << i)))
{
- /* mark us active */
+ // mark us active
m_m6844_channel[i].active = 1;
- /* set the DMA busy bit and clear the DMA end bit */
+ // set the DMA busy bit and clear the DMA end bit
m_m6844_channel[i].control |= 0x40;
m_m6844_channel[i].control &= ~0x80;
- /* set the starting address, counter, and time */
+ // set the starting address, counter, and time
m_m6844_channel[i].start_address = m_m6844_channel[i].address;
m_m6844_channel[i].start_counter = m_m6844_channel[i].counter;
-
-
- /* generate and play the sample */
- //play_cvsd(space->machine, i);
}
- /* if we're going inactive... */
+ // if we're going inactive...
else if (m_m6844_channel[i].active && !(data & (1 << i)))
{
- /* mark us inactive */
+ //mark us inactive
m_m6844_channel[i].active = 0;
}
}
break;
- /* interrupt control */
+ // interrupt control
case 0x15:
m_m6844_interrupt = (m_m6844_interrupt & 0x80) | (data & 0x7f);
m6844_update_interrupt();
break;
- /* chaining control */
+ // chaining control
case 0x16:
m_m6844_chain = data;
break;
- /* 0x17-0x1f not used */
+ // 0x17-0x1f not used
default: break;
}
}
+INPUT_CHANGED_MEMBER(swtpc09_state::maincpu_clock_change)
+{
+ m_maincpu->set_clock(newval * 4);
+}
+
+INPUT_CHANGED_MEMBER(swtpc09_state::fdc_clock_change)
+{
+ if (m_system_type == FLEX_DMAF2 ||
+ m_system_type == UNIFLEX_DMAF2 ||
+ m_system_type == UNIFLEX_DMAF3)
+ {
+ m_fdc->set_unscaled_clock(newval);
+ }
+}
+
+INPUT_CHANGED_MEMBER(swtpc09_state::baud_rate_high_change)
+{
+ m_brg->rsa_w(newval);
+}
+
void swtpc09_state::machine_reset()
{
uint32_t maincpu_clock = m_maincpu_clock->read();
@@ -933,8 +939,8 @@ void swtpc09_state::machine_reset()
// Divider select X64 is the default Low baud rate setting. A High
// baud rate setting is also available that selects a X16 divider, so
- // gives rate four times as high. Note the schematic appears to have
- // mislabeled the this setting.
+ // gives a rate four times as high. Note the schematic appears to have
+ // mislabeled this setting.
uint8_t baud_rate_high = m_baud_rate_high->read();
m_brg->rsa_w(baud_rate_high);
m_brg->rsb_w(1);
@@ -947,7 +953,7 @@ void swtpc09_state::machine_reset()
// Note UNIBUG has a smarter boot loader in ROM and will toggle the
// density on failure so this is not necessary for UniFLEX.
if ((m_system_type == FLEX_DMAF2 ||
- m_system_type == FLEX_DC5_PIAIDE) &&
+ m_system_type == FLEX_DC5_PIAIDE) &&
m_sbug_double_density->read())
{
// Patch the boot ROM to load the boot sector in double density.
@@ -971,7 +977,7 @@ void swtpc09_state::machine_reset()
void swtpc09_state::machine_start()
{
- m_pia_counter = 0; // init ptm/pia counter to 0
+ m_pia_counter = 0; // init ptm/pia counter to 0
m_fdc_status = 0; // for floppy controller
m_interrupt = 0;
m_active_interrupt = false;
@@ -1000,6 +1006,30 @@ void swtpc09_state::machine_start()
m_m6844_chain = 0x00;
m_banked_space = &subdevice<address_map_bank_device>("bankdev")->space(AS_PROGRAM);
+
+ save_item(NAME(m_pia_counter));
+ save_item(NAME(m_dmaf_high_address));
+ save_item(NAME(m_dmaf2_interrupt_enable));
+ save_item(NAME(m_system_type));
+ save_item(NAME(m_fdc_status));
+ save_item(NAME(m_floppy_motor_on));
+ save_item(NAME(m_fdc_side));
+ save_item(NAME(m_dmaf3_via_porta));
+ save_item(NAME(m_dmaf3_via_portb));
+ save_item(NAME(m_active_interrupt));
+ save_item(NAME(m_interrupt));
+ for (int i = 0; i < 4; i++)
+ {
+ save_item(NAME(m_m6844_channel[i].active), i);
+ save_item(NAME(m_m6844_channel[i].address), i);
+ save_item(NAME(m_m6844_channel[i].counter), i);
+ save_item(NAME(m_m6844_channel[i].control), i);
+ save_item(NAME(m_m6844_channel[i].start_address), i);
+ save_item(NAME(m_m6844_channel[i].start_counter), i);
+ }
+ save_item(NAME(m_m6844_priority));
+ save_item(NAME(m_m6844_interrupt));
+ save_item(NAME(m_m6844_chain));
}
void swtpc09_state::init_swtpc09()
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index a79d88d8d98..3f73ae7127c 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -3122,6 +3122,7 @@ bbcmc_ar // 1986 BBC Master Compact (Arabic)
bbcmet // 1986 BBC Master ET
bbcmt // 1986 BBC Master Turbo
cfa3000 // 1989 Henson CFA 3000
+daisy // 1987 Comus Daisy
discmon // 1988 Arbiter Discmonitor
discmate // 1988 Arbiter Discmate
econx25 // 1986 Econet X25 Gateway
@@ -31008,6 +31009,7 @@ pinkjelly // From V.R. Technology VT SDK
vtpinball // From V.R. Technology VT SDK
vtsndtest // From V.R. Technology VT SDK
vtboxing // From V.R. Technology VT SDK
+ablpinb
mc_dgear
dgun2500
dgun2561
@@ -34049,6 +34051,9 @@ nimbus // RM Nimbus 186
cm32l //
mt32 //
+@source:rcm32p.cpp
+cm32p //
+
@source:rockrage.cpp
rockrage // GX620 (c) 1986 (World?)
rockragea // GX620 (c) 1986 (Prototype?)
@@ -39511,6 +39516,7 @@ icanpian //
tvgogo //
pvmil //
taikeegr //
+sentx6p //
@source:vsmile.cpp
vsmile //
diff --git a/src/mame/mess.flt b/src/mame/mess.flt
index 17980311e2a..7987752ea3e 100644
--- a/src/mame/mess.flt
+++ b/src/mame/mess.flt
@@ -697,6 +697,7 @@ rambo.cpp
ravens.cpp
rc702.cpp
rc759.cpp
+rcm32p.cpp
rd100.cpp
rd110.cpp
replicator.cpp
diff --git a/src/mame/video/bbc.cpp b/src/mame/video/bbc.cpp
index a8416517010..24d8d0f5a4b 100644
--- a/src/mame/video/bbc.cpp
+++ b/src/mame/video/bbc.cpp
@@ -150,7 +150,7 @@ WRITE8_MEMBER(bbc_state::video_ula_w)
else
m_screen->update_partial(vpos - 1);
- logerror("setting videoULA %.4x to:%.4x at :%d \n", data, offset, vpos);
+ //logerror("setting videoULA %.4x to:%.4x at :%d \n", data, offset, vpos);
switch (offset & 0x01)
{
@@ -280,6 +280,14 @@ WRITE_LINE_MEMBER(bbc_state::bbc_de_changed)
m_teletext_latch &= ~0x80;
}
+uint8_t bbc_state::bus_video_data()
+{
+ int hpos = m_screen->hpos();
+ int vpos = m_screen->vpos();
+
+ return m_video_ram[calculate_video_address(hpos, vpos)];
+}
+
/**** BBC B+/Master Shadow Ram change ****/
void bbc_state::setvideoshadow(int vdusel)
diff --git a/src/mame/video/elan_eu3a14vid.cpp b/src/mame/video/elan_eu3a14vid.cpp
new file mode 100644
index 00000000000..79b2f4a97d0
--- /dev/null
+++ b/src/mame/video/elan_eu3a14vid.cpp
@@ -0,0 +1,766 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+#include "emu.h"
+#include "elan_eu3a14vid.h"
+
+DEFINE_DEVICE_TYPE(ELAN_EU3A14_VID, elan_eu3a14vid_device, "elan_eu3a14vid", "Elan EU3A14 Video")
+
+elan_eu3a14vid_device::elan_eu3a14vid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : elan_eu3a05commonvid_device(mconfig, ELAN_EU3A14_VID, tag, owner, clock),
+ m_cpu(*this, finder_base::DUMMY_TAG),
+ m_bank(*this, finder_base::DUMMY_TAG),
+ m_screen(*this, finder_base::DUMMY_TAG)
+{
+}
+
+void elan_eu3a14vid_device::device_start()
+{
+ elan_eu3a05commonvid_device::device_start();
+}
+
+void elan_eu3a14vid_device::device_reset()
+{
+ elan_eu3a05commonvid_device::device_reset();
+
+ m_spriteaddr = 0x14; // ?? rad_foot never writes, other games seem to use it to set sprite location
+}
+
+
+
+uint8_t elan_eu3a14vid_device::read_vram(int offset)
+{
+ address_space& cpuspace = m_cpu->space(AS_PROGRAM);
+ int realoffset = offset + 0x200;
+ if (realoffset < 0x4000)
+ {
+ return cpuspace.read_byte(realoffset);
+ }
+ else
+ return 0x00;
+}
+
+uint32_t elan_eu3a14vid_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ m_spriterambase = (m_spriteaddr * 0x200) - 0x200;
+
+ bitmap.fill(0, cliprect);
+ m_prioritybitmap.fill(0, cliprect);
+
+ draw_background(screen, bitmap, cliprect);
+
+ draw_sprites(screen, bitmap, cliprect);
+ return 0;
+}
+
+void elan_eu3a14vid_device::video_start()
+{
+ m_screen->register_screen_bitmap(m_prioritybitmap);
+}
+
+
+uint8_t elan_eu3a14vid_device::read_gfxdata(int offset, int x)
+{
+ address_space& fullbankspace = m_bank->space(AS_PROGRAM);
+ return fullbankspace.read_byte((offset+x) & 0x3fffff);
+}
+
+void elan_eu3a14vid_device::draw_background_tile(bitmap_ind16& bitmap, const rectangle& cliprect, int bpp, int tileno, int palette, int priority, int flipx, int flipy, int xpos, int ypos, int transpen, int size, int base, int drawfromram)
+{
+ int baseaddr = base * 256;
+
+ int xstride = 8;
+
+ if (bpp == 8) // 8bpp selection
+ {
+ if (size == 8)
+ {
+ xstride = size / 1; baseaddr += tileno * 64; // 8x8 8bpp
+ }
+ else
+ {
+ xstride = size / 1; baseaddr += tileno * 256; // 16x16 8bpp
+ }
+
+ palette &= 0x100; // only top bit valid, as there are only 2 palettes?
+ }
+ else if (bpp == 4) // 4bpp selection
+ {
+ if (size == 8)
+ {
+ xstride = size / 2; baseaddr += tileno * 32; // 8x8 4bpp
+ }
+ else
+ {
+ xstride = size / 2; baseaddr += tileno * 128; // 16x16 4bpp
+ }
+ }
+ else if (bpp == 2) // 2bpp?
+ {
+ xstride = size / 4; baseaddr += tileno * 64; // 16x16 2bpp
+ }
+ else
+ {
+ popmessage("draw_background_tile unsupported bpp %d\n", bpp);
+ return;
+ }
+
+
+ int count = 0;
+ for (int y = 0; y < size; y++)
+ {
+ int realy = ypos + y;
+ int xposwithscroll = 0;
+
+ if (!drawfromram)
+ {
+ xposwithscroll = xpos - get_xscroll_for_screenypos(realy);
+ }
+ else
+ {
+ xposwithscroll = xpos;
+ // RAM tile layer has no scrolling? (or we've never seen it used / enabled)
+ }
+
+ uint16_t* dst = &bitmap.pix16(ypos + y);
+ uint8_t* pridst = &m_prioritybitmap.pix8(ypos + y);
+
+ for (int x = 0; x < xstride; x++)
+ {
+ int pix;
+
+ if (drawfromram)
+ {
+ pix = read_vram((baseaddr + count) & 0x3fff);
+ }
+ else
+ {
+ address_space& fullbankspace = m_bank->space(AS_PROGRAM);
+ pix = fullbankspace.read_byte((baseaddr+count) & 0x3fffff);
+ }
+
+ if (realy >= cliprect.min_y && realy <= cliprect.max_y)
+ {
+ if (bpp == 8) // 8bpp
+ {
+ int realx = x + xposwithscroll;
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pix)
+ {
+ if (pridst[realx] <= priority)
+ {
+ dst[realx] = pix | palette;
+ pridst[realx] = priority;
+ }
+
+ }
+ }
+ }
+ else if (bpp == 7)
+ {
+ popmessage("draw_background_tile bpp == 7");
+ }
+ else if (bpp == 6)
+ {
+ popmessage("draw_background_tile bpp == 6");
+ }
+ else if (bpp == 5)
+ {
+ popmessage("draw_background_tile bpp == 5");
+ }
+ else if (bpp == 4) // 4bpp
+ {
+ int realx = (x * 2) + xposwithscroll;
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pix & 0xf0)
+ {
+ if (pridst[realx] <= priority)
+ {
+ dst[realx] = ((pix & 0xf0) >> 4) | palette;
+ pridst[realx] = priority;
+ }
+ }
+ }
+
+ realx++;
+
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pix & 0x0f)
+ {
+ if (pridst[realx] <= priority)
+ {
+ dst[realx] = (pix & 0x0f) | palette;
+ pridst[realx] = priority;
+ }
+ }
+ }
+ }
+ else if (bpp == 3)
+ {
+ popmessage("draw_background_tile bpp == 3");
+ }
+ else if (bpp == 2) // 2bpp (hnt3 ram text)
+ {
+ int realx = (x * 4) + xposwithscroll;
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pix & 0xc0)
+ {
+ if (pridst[realx] <= priority)
+ {
+ dst[realx] = ((pix & 0xc0) >> 6) | palette;
+ pridst[realx] = priority;
+ }
+ }
+ }
+
+ realx++;
+
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pix & 0x30)
+ {
+ if (pridst[realx] <= priority)
+ {
+ dst[realx] = ((pix & 0x30) >> 4) | palette;
+ pridst[realx] = priority;
+ }
+ }
+ }
+
+ realx++;
+
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pix & 0x0c)
+ {
+ if (pridst[realx] <= priority)
+ {
+ dst[realx] = ((pix & 0x0c) >> 2) | palette;
+ pridst[realx] = priority;
+ }
+ }
+ }
+
+ realx++;
+
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pix & 0x03)
+ {
+ if (pridst[realx] <= priority)
+ {
+ dst[realx] = ((pix & 0x03) >> 0) | palette;
+ pridst[realx] = priority;
+ }
+ }
+ }
+ }
+ else if (bpp == 1)
+ {
+ popmessage("draw_background_tile bpp == 1");
+ }
+ }
+ count++;
+ }
+ }
+}
+
+int elan_eu3a14vid_device::get_xscroll_for_screenypos(int ydraw)
+{
+ if ((ydraw < 0) || (ydraw >= 224))
+ return 0;
+
+ int xscroll = m_scrollregs[0] | (m_scrollregs[1] << 8);
+
+ if (m_rowscrollcfg[1] == 0x01) // GUESS! could be anything, but this bit is set in Huntin'3
+ {
+ int split0 = m_rowscrollregs[0] | (m_rowscrollregs[1] << 8);
+ int split1 = m_rowscrollregs[2] | (m_rowscrollregs[3] << 8);
+ int split2 = m_rowscrollregs[4] | (m_rowscrollregs[5] << 8);
+ int split3 = m_rowscrollregs[6] | (m_rowscrollregs[7] << 8);
+
+ if (ydraw < m_rowscrollsplit[0])
+ {
+ return xscroll;
+ }
+ else if (ydraw < m_rowscrollsplit[1])
+ {
+ return split0;
+ }
+ else if (ydraw < m_rowscrollsplit[2])
+ {
+ return split1;
+ }
+ else if (ydraw < m_rowscrollsplit[3])
+ {
+ return split2;
+ }
+ else if (ydraw < m_rowscrollsplit[4])
+ {
+ return split3;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ else
+ {
+ return xscroll;
+ }
+}
+
+
+void elan_eu3a14vid_device::draw_background_page(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect, int ramstart, int ramend, int xbase, int ybase, int size, int bpp, int base, int pagewidth, int pageheight, int bytespertile, int palettepri, int drawfromram)
+{
+
+ int palette = ((palettepri & 0xf0) >> 4) | ((palettepri & 0x08) << 1);
+ palette = palette << 4;
+ int priority = palettepri & 0x07;
+
+ int xdraw = xbase;
+ int ydraw = ybase;
+ int count = 0;
+
+ for (int i = ramstart; i < ramend; i += bytespertile)
+ {
+ int tile = 0;
+ int realpalette = palette;
+ int realpriority = priority;
+ int realbpp = bpp;
+
+ if (bytespertile == 2)
+ {
+ tile = read_vram(i + 0) | (read_vram(i + 1) << 8);
+ }
+ else if (bytespertile == 4) // rad_foot hidden test mode, rad_hnt3 "Target Range" (not yet correct)
+ {
+ tile = read_vram(i + 0) | (read_vram(i + 1) << 8);// | (read_vram(i + 2) << 16) | | (read_vram(i + 3) << 24);
+
+ // read_vram(i + 3) & 0x04 is set in both seen cases, maybe per-tile bpp?
+ // this would match up with this mode being inline replacements for m_tilecfg[1] (palettepri) and m_tilecfg[2] (bpp);
+
+ int newpalette = ((read_vram(i + 2) & 0xf0) >> 4) | ((read_vram(i + 2) & 0x08) << 1);
+ newpalette = newpalette << 4;
+ realpalette = newpalette;
+ realpriority = read_vram(i + 2) & 0x07;
+ realbpp = read_vram(i + 3) & 0x07;
+ if (realbpp == 0)
+ realbpp = 8;
+
+ }
+
+
+ draw_background_tile(bitmap, cliprect, realbpp, tile, realpalette, realpriority, 0, 0, xdraw, ydraw, 0, size, base, drawfromram);
+
+ xdraw += size;
+
+ count++;
+ if (((count % pagewidth) == 0))
+ {
+ xdraw -= size * pagewidth;
+ ydraw += size;
+ }
+ }
+}
+
+void elan_eu3a14vid_device::draw_background_ramlayer(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect)
+{
+ // this register use is questionable
+ if (m_ramtilecfg[0] & 0x80)
+ {
+ int rtm_size;;
+ int rtm_pagewidth;
+ int rtm_pageheight;
+ int rtm_yscroll;
+ int rtm_bpp;
+ int rtm_bytespertile = 2;
+ uint8_t palettepri = m_ramtilecfg[1];
+
+ rtm_yscroll = 0;
+
+ // this is the gfxbase in ram for all cases seen
+ int rtm_base = (0x2000 - 0x200) / 256;
+
+ // same as regular layer?
+ if (m_ramtilecfg[0] & 0x10)
+ {
+ rtm_size = 8;
+ rtm_pagewidth = 32;
+ rtm_pageheight = 28;
+ }
+ else
+ {
+ rtm_size = 16;
+ rtm_pagewidth = 32 / 2;
+ rtm_pageheight = 28 / 2;
+ }
+
+ rtm_bpp = m_ramtilecfg[2] & 0x07;
+ if (rtm_bpp == 0)
+ rtm_bpp = 8;
+
+ // this is in the same place even when the first tilemap is in 16x16 mode, probably a base register somewhere
+ int ramstart = m_tilerambase + 0x700;
+ int ramend = m_tilerambase + 0x700 + 0x700;
+
+ // hack for "Target Range" mode
+ if (m_ramtilecfg[5] == 0x06)
+ {
+ ramstart = 0x3980-0x200;
+ ramend = 0x3980-0x200 + 0x700;
+ }
+
+ // normal
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
+ // wrap x
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (rtm_size * rtm_pagewidth), 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
+ // wrap y
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, (rtm_size * rtm_pageheight) + 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
+ // wrap x+y
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (rtm_size * rtm_pagewidth), (rtm_size * rtm_pageheight) + 0 - rtm_yscroll, rtm_size, rtm_bpp, rtm_base, rtm_pagewidth, rtm_pageheight, rtm_bytespertile, palettepri, 1);
+ }
+}
+
+
+void elan_eu3a14vid_device::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ int yscroll = m_scrollregs[2] | (m_scrollregs[3] << 8);
+
+ int base = (m_tilecfg[5] << 8) | m_tilecfg[4];
+ uint8_t palettepri = m_tilecfg[1];
+
+ int pagewidth = 1, pageheight = 1;
+ int bytespertile = 2;
+ int size;
+
+ // m_tilecfg[0] b-as ?-hh b = bytes per tile s = tilesize / page size? a = always set when tilemaps are in use - check? h = related to page positions, when set uses 2x2 pages? ? = used
+ // m_tilecfg[1] pppp x--? ? = used foot x = used, huntin3 summary (palette bank?) p = palette (used for different stages in huntin3 and the hidden test modes in others)
+ // m_tilecfg[2] ---- bbbb b = bpp mode (0 = 8bpp)
+ // m_tilecfg[3] ---- ---- (unused or more gfxbase?)
+ // m_tilecfg[4] gggg gggg gfxbase (lower bits)
+ // m_tilecfg[5] gggg gggg gfxbase (upper bits)
+
+ // ramtilecfg appears to be a similar format, except for the other layer with ram base tiles
+ // however 'a' in m_tilecfg[0] is NOT set
+ // also m_tilecfg[0] has 0x80 set, which would be 4 bytes per tile, but it isn't?
+ // the layer seems to be disabled by setting m_tilecfg[0] to 0?
+
+ if (m_tilecfg[0] & 0x10)
+ {
+ size = 8;
+ pagewidth = 32;
+ pageheight = 28;
+ }
+ else
+ {
+ size = 16;
+ pagewidth = 16;
+ pageheight = 14;
+ }
+
+ if (m_tilecfg[0] & 0x80)
+ {
+ bytespertile = 4;
+ }
+ else
+ {
+ bytespertile = 2;
+ }
+
+ int bpp = (m_tilecfg[2] & 0x07);
+ if (bpp == 0)
+ bpp = 8;
+
+ int ramstart = 0;
+ int ramend = 0;
+
+ int pagesize = pagewidth * pageheight * 2;
+
+ if (bytespertile == 4)
+ {
+ pagesize <<= 1; // shift because we need twice as much ram for this mode
+ }
+
+ if ((m_tilecfg[0] & 0x03) == 0x00) // tilemaps arranged as 2x2 pages?
+ {
+ ramstart = m_tilerambase + pagesize * 0;
+ ramend = m_tilerambase + pagesize * 1;
+
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap y
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
+
+ ramstart = m_tilerambase + pagesize * 1;
+ ramend = m_tilerambase + pagesize * 2;
+
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap y
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), (size * pageheight * 2) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
+
+ ramstart = m_tilerambase + pagesize * 2;
+ ramend = m_tilerambase + pagesize * 3;
+
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, 0, (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap y
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 2), (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
+
+ ramstart = m_tilerambase + pagesize * 3;
+ ramend = m_tilerambase + pagesize * 4;
+
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // normal
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), (size * pageheight) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth), (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);// wrap y
+ draw_background_page(screen, bitmap, cliprect, ramstart,ramend, (size * pagewidth * 3), (size * pageheight * 3) - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0); // wrap x+y
+ }
+ else if ((m_tilecfg[0] & 0x03) == 0x03) // individual tilemaps? multiple layers?
+ {
+ // popmessage("m_tilecfg[0] & 0x03 multiple layers config %04x", base);
+ ramstart = m_tilerambase + pagesize * 0;
+ ramend = m_tilerambase + pagesize * 1;
+
+ // normal
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
+ // wrap x
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (size * pagewidth), 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
+ // wrap y
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, 0, (size * pageheight) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
+ // wrap x+y
+ draw_background_page(screen, bitmap, cliprect, ramstart, ramend, (size * pagewidth), (size * pageheight) + 0 - yscroll, size, bpp, base, pagewidth,pageheight, bytespertile, palettepri, 0);
+
+ // RAM based tile layer
+ draw_background_ramlayer(screen, bitmap, cliprect);
+ }
+ else
+ {
+ popmessage("m_tilecfg[0] & 0x03 unknown config");
+ }
+
+}
+
+void elan_eu3a14vid_device::draw_sprite_pix(const rectangle& cliprect, uint16_t* dst, uint8_t* pridst, int realx, int priority, uint8_t pix, uint8_t mask, uint8_t shift, int palette)
+{
+ if (realx >= cliprect.min_x && realx <= cliprect.max_x)
+ {
+ if (pridst[realx] <= priority)
+ {
+ if (pix & mask)
+ {
+ dst[realx] = ((pix & mask) >> shift) | palette;
+ pridst[realx] = priority;
+ }
+ }
+ }
+}
+
+void elan_eu3a14vid_device::draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int line, int palette, int flipx, int priority, int xpos, int ypos, int bpp)
+{
+ offset = offset * 2;
+
+ int bppdiv = 0;
+
+ switch (bpp)
+ {
+ default:
+ case 0x8:
+ case 0x7:
+ case 0x6:
+ case 0x5:
+ offset += line * 8;
+ bppdiv = 1;
+ break;
+
+ case 0x4:
+ case 0x3:
+ offset += line * 4;
+ bppdiv = 2;
+ break;
+
+ case 0x2:
+ offset += line * 2;
+ bppdiv = 4;
+ break;
+
+ case 0x1:
+ offset += line * 1;
+ bppdiv = 8;
+ break;
+ }
+
+
+ if (ypos >= cliprect.min_y && ypos <= cliprect.max_y)
+ {
+ uint16_t* dst = &bitmap.pix16(ypos);
+ uint8_t* pridst = &m_prioritybitmap.pix8(ypos);
+
+ int count = 0;
+ for (int x = 0; x < 8/bppdiv;x++)
+ {
+ if (bpp == 8)
+ {
+ int pix,mask,shift;
+ if (flipx) { pix = read_gfxdata(offset, 7 - count); } else { pix = read_gfxdata(offset, count); }
+ int realx = xpos + x * 1;
+ if (flipx) { mask = 0xff; shift = 0; } else { mask = 0xff; shift = 0; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ }
+ else if (bpp == 7)
+ {
+ int pix,mask,shift;
+ if (flipx) { pix = read_gfxdata(offset, 7 - count); } else { pix = read_gfxdata(offset, count); }
+ int realx = xpos + x * 1;
+ // stride doesn't change, data isn't packed, just don't use top bit
+ if (flipx) { mask = 0x7f; shift = 0; } else { mask = 0x7f; shift = 0; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ }
+ else if (bpp == 6)
+ {
+ popmessage("6bpp sprite\n");
+ }
+ else if (bpp == 5)
+ {
+ popmessage("5bpp sprite\n");
+ }
+ else if (bpp == 4)
+ {
+ int pix,mask,shift;
+ if (flipx) { pix = read_gfxdata(offset, 3 - count); } else { pix = read_gfxdata(offset, count); }
+ int realx = xpos + x * 2;
+ if (flipx) { mask = 0x0f; shift = 0; } else { mask = 0xf0; shift = 4; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ realx++;
+ if (flipx) { mask = 0xf0; shift = 4; } else { mask = 0x0f; shift = 0; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ }
+ else if (bpp == 3)
+ {
+ popmessage("3bpp sprite\n");
+ }
+ else if (bpp == 2)
+ {
+ int pix,mask,shift;
+ if (flipx) { pix = read_gfxdata(offset, 1 - count); } else { pix = read_gfxdata(offset, count); }
+ int realx = xpos + x * 4;
+ if (flipx) { mask = 0x03; shift = 0; } else { mask = 0xc0; shift = 6; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ realx++;
+ if (flipx) { mask = 0x0c; shift = 2; } else { mask = 0x30; shift = 4; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ realx++;
+ if (flipx) { mask = 0x30; shift = 4; } else { mask = 0x0c; shift = 2; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ realx++;
+ if (flipx) { mask = 0xc0; shift = 6; } else { mask = 0x03; shift = 0; }
+ draw_sprite_pix(cliprect, dst, pridst, realx, priority, pix, mask, shift, palette);
+ }
+ else if (bpp == 1)
+ {
+ popmessage("1bpp sprite\n");
+ }
+
+ count++;
+ }
+ }
+
+}
+
+
+void elan_eu3a14vid_device::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ // first 4 sprite entries seem to be garbage sprites, so we start at 0x20
+ // likely we're just interpreting them wrong and they're used for blanking things or clipping?
+ for (int i = m_spriterambase; i < m_spriterambase + 0x800; i += 8)
+ {
+ /*
+ +0 e-ff hhww flip yx, enable, height, width
+ +1 yyyy yyyy ypos
+ +2 xxxx xxxx xpos
+ +3 pppp Pzzz p = palette, P = upper palette bank, z = priority
+ +4 tttt tttt tile bits
+ +5 tttt tttt
+ +6 --TT TPPP TTT = tile bank PPP = bpp select (+more?)
+ +7 ---- ----
+
+ */
+
+ int attr = read_vram(i + 0);
+ int y = read_vram(i + 1);
+ int x = read_vram(i + 2);
+ int palettepri = read_vram(i + 3);
+
+ int h = attr & 0x0c;
+ int w = attr & 0x03;
+ int flipx = (attr & 0x10) >> 4;
+ int flipy = (attr & 0x20) >> 5;
+
+ int height = 0;
+ int width = 0;
+
+ int pri = palettepri & 0x07;
+
+ int palette = ((palettepri & 0xf0) >> 4) | ((palettepri & 0x08) << 1);
+ palette = palette << 4;
+
+ switch (h)
+ {
+ case 0x0:height = 2; break;
+ case 0x4:height = 4; break;
+ case 0x8:height = 8; break;
+ case 0xc:height = 16; break;
+ }
+
+ switch (w)
+ {
+ case 0x0:width = 1; break;
+ case 0x1:width = 2; break;
+ case 0x2:width = 4; break;
+ case 0x3:width = 8; break;
+ }
+
+ y -= ((height * 2) - 4);
+
+ x -= ((width * 4) - 4);
+
+ height *= 4;
+
+ x -= 6;
+ y -= 4;
+
+ int offset = ((read_vram(i + 5) << 8) + (read_vram(i + 4) << 0));
+ int extra = read_vram(i + 6);
+
+ int spritebase = (m_spritebase[1] << 8) | m_spritebase[0];
+
+ offset += (extra & 0xf8) << 13;
+ offset += spritebase << 7;
+
+ int bpp = extra & 0x07;
+ if (bpp == 0)
+ bpp = 8;
+
+ if (attr & 0x80)
+ {
+ int count = 0;
+ for (int yy = 0; yy < height; yy++)
+ {
+ int yoff = flipy ? height-1-yy : yy;
+
+ for (int xx = 0; xx < width; xx++)
+ {
+ int xoff = flipx ? (((width - 1) * 8) - (xx * 8)) : (xx * 8);
+
+ draw_sprite_line(screen, bitmap, cliprect, offset, count, palette, flipx, pri, x + xoff, y + yoff, bpp);
+ count++;
+ }
+ }
+ }
+ }
+}
+
diff --git a/src/mame/video/elan_eu3a14vid.h b/src/mame/video/elan_eu3a14vid.h
new file mode 100644
index 00000000000..71f91a6aae0
--- /dev/null
+++ b/src/mame/video/elan_eu3a14vid.h
@@ -0,0 +1,90 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+#ifndef MAME_VIDEO_ELAN_EU3A14VID_H
+#define MAME_VIDEO_ELAN_EU3A14VID_H
+
+#include "elan_eu3a05commonvid.h"
+#include "cpu/m6502/m6502.h"
+#include "machine/bankdev.h"
+#include "screen.h"
+
+class elan_eu3a14vid_device : public elan_eu3a05commonvid_device
+{
+public:
+ elan_eu3a14vid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ template <typename T> void set_cpu(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); }
+ template <typename T> void set_addrbank(T &&tag) { m_bank.set_tag(std::forward<T>(tag)); }
+ template <typename T> void set_screen(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); }
+
+ void set_tilerambase(int tilerambase) { m_tilerambase = tilerambase; }
+
+ void video_start();
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER(tilecfg_r) { return m_tilecfg[offset]; }
+ DECLARE_WRITE8_MEMBER(tilecfg_w) { m_tilecfg[offset] = data; }
+ DECLARE_READ8_MEMBER(ramtilecfg_r) { return m_ramtilecfg[offset]; }
+ DECLARE_WRITE8_MEMBER(ramtilecfg_w) { m_ramtilecfg[offset] = data; }
+ DECLARE_READ8_MEMBER(rowscrollcfg_r) { return m_rowscrollcfg[offset]; }
+ DECLARE_WRITE8_MEMBER(rowscrollcfg_w) { m_rowscrollcfg[offset] = data; }
+ DECLARE_READ8_MEMBER(scrollregs_r) { return m_scrollregs[offset]; }
+ DECLARE_WRITE8_MEMBER(scrollregs_w) { m_scrollregs[offset] = data; }
+ DECLARE_READ8_MEMBER(rowscrollregs_r) { return m_rowscrollregs[offset]; }
+ DECLARE_WRITE8_MEMBER(rowscrollregs_w) { m_rowscrollregs[offset] = data; }
+
+ DECLARE_READ8_MEMBER(spriteaddr_r) { return m_spriteaddr; }
+ DECLARE_WRITE8_MEMBER(spriteaddr_w) { m_spriteaddr = data; }
+
+ DECLARE_READ8_MEMBER(spritebase_r) { return m_spritebase[offset]; }
+ DECLARE_WRITE8_MEMBER(spritebase_w) { m_spritebase[offset] = data; }
+
+ DECLARE_READ8_MEMBER(rowscrollsplit_r) { return m_rowscrollsplit[offset]; }
+ DECLARE_WRITE8_MEMBER(rowscrollsplit_w) { m_rowscrollsplit[offset] = data; }
+
+
+ int m_tilerambase;
+ int m_spriterambase;
+
+ bitmap_ind8 m_prioritybitmap;
+
+
+ void draw_background_ramlayer(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect);
+ int get_xscroll_for_screenypos(int line);
+ void draw_background_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int bpp, int tileno, int palette, int priority, int flipx, int flipy, int xpos, int ypos, int transpen, int size, int base, int drawfromram);
+ void draw_background_page(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int ramstart, int ramend, int xbase, int ybase, int size, int bpp, int base, int pagewidth,int pageheight, int bytespertile, int palettepri, int drawfromram);
+ void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprite_pix(const rectangle& cliprect, uint16_t* dst, uint8_t* pridst, int realx, int priority, uint8_t pix, uint8_t mask, uint8_t shift, int palette);
+ void draw_sprite_line(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int offset, int line, int pal, int flipx, int pri, int xpos, int ypos, int bpp);
+ void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+private:
+ required_device<m6502_device> m_cpu;
+ required_device<address_map_bank_device> m_bank;
+ required_device<screen_device> m_screen;
+
+ uint8_t read_gfxdata(int offset, int x);
+
+ uint8_t read_vram(int offset);
+
+ uint8_t m_scrollregs[4];
+ uint8_t m_tilecfg[6];
+ uint8_t m_rowscrollregs[8];
+ uint8_t m_rowscrollsplit[5];
+ uint8_t m_rowscrollcfg[2];
+ uint8_t m_ramtilecfg[6];
+ uint8_t m_spriteaddr;
+ uint8_t m_spritebase[2];
+
+};
+
+DECLARE_DEVICE_TYPE(ELAN_EU3A14_VID, elan_eu3a14vid_device)
+
+#endif // MAME_VIDEO_ELAN_EU3A14VID_H
diff --git a/src/mame/video/raiden.cpp b/src/mame/video/raiden.cpp
index 593ceeee287..0fba5069bba 100644
--- a/src/mame/video/raiden.cpp
+++ b/src/mame/video/raiden.cpp
@@ -222,14 +222,11 @@ TILE_GET_INFO_MEMBER(raiden_state::get_text_tile_info)
SET_TILE_INFO_MEMBER(0, tile, color, 0);
}
-void raiden_state::video_start()
+void raiden_state::common_video_start()
{
m_bg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raiden_state::get_back_tile_info)), TILEMAP_SCAN_COLS, 16,16, 32,32);
m_fg_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raiden_state::get_fore_tile_info)), TILEMAP_SCAN_COLS, 16,16, 32,32);
- m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raiden_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32,32);
-
m_fg_layer->set_transparent_pen(15);
- m_tx_layer->set_transparent_pen(15);
save_item(NAME(m_bg_layer_enabled));
save_item(NAME(m_fg_layer_enabled));
@@ -238,9 +235,20 @@ void raiden_state::video_start()
save_item(NAME(m_flipscreen));
}
+void raiden_state::video_start()
+{
+ common_video_start();
+
+ m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raiden_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32,32);
+ m_tx_layer->set_transparent_pen(15);
+}
+
void raidenb_state::video_start()
{
- raiden_state::video_start();
+ common_video_start();
+
+ m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(raidenb_state::get_text_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 32,32);
+ m_tx_layer->set_transparent_pen(15);
save_item(NAME(m_raidenb_scroll_ram));
}