summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--COPYING12
-rw-r--r--hash/entex_sag.xml65
-rw-r--r--hash/microvision.xml4
-rw-r--r--hash/snes.xml24
-rw-r--r--scripts/src/bus.lua19
-rw-r--r--scripts/src/cpu.lua1
-rw-r--r--scripts/src/machine.lua24
-rw-r--r--scripts/target/mame/arcade.lua2
-rw-r--r--scripts/target/mame/mess.lua2
-rw-r--r--src/devices/bus/isa/fdc.cpp204
-rw-r--r--src/devices/bus/isa/fdc.h55
-rw-r--r--src/devices/bus/isa/mufdc.cpp2
-rw-r--r--src/devices/bus/isa/mufdc.h2
-rw-r--r--src/devices/bus/isa/omti8621.cpp91
-rw-r--r--src/devices/bus/isa/omti8621.h14
-rw-r--r--src/devices/bus/lpci/i82439tx.cpp2
-rw-r--r--src/devices/bus/pasopia/pac2.cpp159
-rw-r--r--src/devices/bus/pasopia/pac2.h83
-rw-r--r--src/devices/bus/pasopia/pac2exp.cpp92
-rw-r--r--src/devices/bus/pasopia/pac2exp.h44
-rw-r--r--src/devices/bus/pasopia/rampac2.cpp149
-rw-r--r--src/devices/bus/pasopia/rampac2.h76
-rw-r--r--src/devices/bus/pasopia/rompac2.cpp98
-rw-r--r--src/devices/bus/pasopia/rompac2.h44
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.cpp4
-rw-r--r--src/devices/cpu/lr35902/lr35902.cpp2
-rw-r--r--src/devices/cpu/lr35902/lr35902.h1
-rw-r--r--src/devices/cpu/m6800/6800ops.hxx7
-rw-r--r--src/devices/cpu/m6800/6800tbl.hxx95
-rw-r--r--src/devices/cpu/m6800/m6800.cpp80
-rw-r--r--src/devices/cpu/tms1000/tms0980.cpp4
-rw-r--r--src/devices/cpu/tms1000/tms1000.cpp2
-rw-r--r--src/devices/cpu/tms1000/tms1k_base.cpp2
-rw-r--r--src/devices/cpu/tms1000/tms1k_base.h6
-rw-r--r--src/devices/cpu/upd177x/upd177xd.cpp16
-rw-r--r--src/devices/machine/74161.cpp43
-rw-r--r--src/devices/machine/74161.h8
-rw-r--r--src/devices/machine/74543.cpp120
-rw-r--r--src/devices/machine/74543.h124
-rw-r--r--src/devices/machine/7474.cpp8
-rw-r--r--src/devices/machine/ds1994.cpp1
-rw-r--r--src/devices/machine/fdc37c93x.cpp2
-rw-r--r--src/devices/machine/fdc37c93x.h2
-rw-r--r--src/devices/machine/m3002.cpp507
-rw-r--r--src/devices/machine/m3002.h113
-rw-r--r--src/devices/machine/pc_fdc.cpp31
-rw-r--r--src/devices/machine/pc_fdc.h20
-rw-r--r--src/devices/machine/pci.cpp7
-rw-r--r--src/devices/machine/pla.cpp21
-rw-r--r--src/devices/machine/pla.h3
-rw-r--r--src/devices/machine/rtc65271.cpp8
-rw-r--r--src/devices/machine/rtc65271.h9
-rw-r--r--src/devices/machine/tc009xlvc.cpp1
-rw-r--r--src/devices/machine/upd765.cpp2
-rw-r--r--src/devices/machine/upd765.h35
-rw-r--r--src/emu/save.cpp327
-rw-r--r--src/emu/save.h21
-rw-r--r--src/lib/util/strformat.cpp533
-rw-r--r--src/lib/util/strformat.h533
-rw-r--r--src/mame/arcade.flt1
-rw-r--r--src/mame/audio/taito_en.cpp1
-rw-r--r--src/mame/drivers/advision.cpp4
-rw-r--r--src/mame/drivers/at.cpp2
-rw-r--r--src/mame/drivers/clxvme186.cpp8
-rw-r--r--src/mame/drivers/cms.cpp138
-rw-r--r--src/mame/drivers/dec0.cpp27
-rw-r--r--src/mame/drivers/dec8.cpp1
-rw-r--r--src/mame/drivers/europc.cpp153
-rw-r--r--src/mame/drivers/fp1100.cpp167
-rw-r--r--src/mame/drivers/ht68k.cpp2
-rw-r--r--src/mame/drivers/ibmpcjr.cpp1
-rw-r--r--src/mame/drivers/lbeach.cpp117
-rw-r--r--src/mame/drivers/madmotor.cpp86
-rw-r--r--src/mame/drivers/megaphx.cpp4
-rw-r--r--src/mame/drivers/meritsdx.cpp84
-rw-r--r--src/mame/drivers/microvsn.cpp170
-rw-r--r--src/mame/drivers/nforcepc.cpp2
-rw-r--r--src/mame/drivers/pasopia.cpp176
-rw-r--r--src/mame/drivers/pasopia7.cpp120
-rw-r--r--src/mame/drivers/pcxt.cpp10
-rw-r--r--src/mame/drivers/pt68k4.cpp1
-rw-r--r--src/mame/drivers/rzone.cpp1
-rw-r--r--src/mame/drivers/sag.cpp239
-rw-r--r--src/mame/drivers/scobra.cpp2
-rw-r--r--src/mame/drivers/snk.cpp16
-rw-r--r--src/mame/drivers/tandy1t.cpp1
-rw-r--r--src/mame/includes/advision.h8
-rw-r--r--src/mame/includes/dec0.h10
-rw-r--r--src/mame/includes/dec8.h1
-rw-r--r--src/mame/includes/nforcepc.h2
-rw-r--r--src/mame/layout/lbeach.lay10
-rw-r--r--src/mame/layout/speedrs.lay18
-rw-r--r--src/mame/machine/advision.cpp4
-rw-r--r--src/mame/machine/inder_sb.cpp2
-rw-r--r--src/mame/machine/taitosjsec.cpp1
-rw-r--r--src/mame/mame.lst10
-rw-r--r--src/mame/video/actfancr.cpp4
-rw-r--r--src/mame/video/advision.cpp4
-rw-r--r--src/mame/video/dec0.cpp292
-rw-r--r--src/mame/video/dec8.cpp24
-rw-r--r--src/mame/video/decbac06.cpp86
-rw-r--r--src/mame/video/decbac06.h53
-rw-r--r--src/mame/video/pcktgal.cpp2
-rw-r--r--src/mame/video/segas32.cpp63
-rw-r--r--src/mame/video/stadhero.cpp2
-rw-r--r--src/mame/video/thedeep.cpp2
106 files changed, 4457 insertions, 1641 deletions
diff --git a/COPYING b/COPYING
index 7cd1ef9f2af..0018c92aab1 100644
--- a/COPYING
+++ b/COPYING
@@ -82,8 +82,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-Berkeley SoftFloat - software implementation of binary floating-point that conforms to the IEEE Standard for Floating-Point Arithmetic
-Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California
+Berkeley SoftFloat - software implementation of binary floating-point that
+conforms to the IEEE Standard for Floating-Point Arithmetic
+Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of
+the University of California
FLAC - Free Lossless Audio Codec
Copyright (c) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson
@@ -152,7 +154,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Expat
-Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper
+Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
+and Clark Cooper
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers
Lua - a powerful, fast, lightweight, embeddable scripting language
@@ -193,7 +196,8 @@ tap-windows.h
Copyright (C) 2002-2014 OpenVPN Technologies, Inc.
utf8proc
-Copyright (c) 2014-2015 Steven G. Johnson, Jiahao Chen, Tony Kelman, Jonas Fonseca, and other contributors
+Copyright (c) 2014-2015 Steven G. Johnson, Jiahao Chen, Tony Kelman,
+Jonas Fonseca, and other contributors
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
diff --git a/hash/entex_sag.xml b/hash/entex_sag.xml
new file mode 100644
index 00000000000..2af13e46e5f
--- /dev/null
+++ b/hash/entex_sag.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
+<!--
+license:CC0
+
+Cartridges(MCU+ROM) for Entex Select-A-Game Machine, note that the manual and
+label calls one "Select-A-Game Cartridge" and not "Select-A-Game Machine Cartridge"
+-->
+
+<softwarelist name="entex_sag" description="Select-A-Game cartridges">
+
+ <software name="baseb4">
+ <description>Baseball 4</description>
+ <year>1981</year>
+ <publisher>Entex</publisher>
+ <part name="cart" interface="sag_cart"> <!-- HD38800 MCU -->
+ <dataarea name="rom" size="0x2000">
+ <rom name="b-b5_hd38800a37" offset="0x0000" size="0x1000" crc="64852bd5" sha1="fb1c24ca43934ceb6fc35ac7c35b71e6e843dbc5" />
+ <rom offset="0x1e80" size="0x0100" loadflag="continue" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="footb4">
+ <description>Football 4</description>
+ <year>1981</year>
+ <publisher>Entex</publisher>
+ <part name="cart" interface="sag_cart"> <!-- TMS1670 MCU, die label TMS1400, MP7573 -->
+ <dataarea name="rom" size="0x1000">
+ <rom name="ftba_mp7573" size="0x1000" crc="b17dd9e3" sha1="9c9e7a56643233ef2adff7b68a6df19e6ca176c2" />
+ </dataarea>
+ <dataarea name="rom:mpla" size="867">
+ <rom name="tms1100_common2_micro.pla" size="867" crc="7cc90264" sha1="c6e1cf1ffb178061da9e31858514f7cd94e86990" />
+ </dataarea>
+ <dataarea name="rom:opla" size="557">
+ <rom name="tms1400_sag_fb4_output.pla" size="557" crc="f15dc6a1" sha1="ee11a64037895ac566e902b6b590ff62a7f703b0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="pinball">
+ <description>Pinball</description>
+ <year>1981</year>
+ <publisher>Entex</publisher>
+ <part name="cart" interface="sag_cart"> <!-- HD38800 MCU -->
+ <dataarea name="rom" size="0x2000">
+ <rom name="pinb_hd38800a38" offset="0x0000" size="0x1000" crc="6e53a56b" sha1="13f057eab2e4cfbb3ef1247a041abff15ae727c9" />
+ <rom offset="0x1e80" size="0x0100" loadflag="continue" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="sinv2" supported="no"> <!-- bad dump -->
+ <description>Space Invader 2</description>
+ <year>1981</year>
+ <publisher>Entex</publisher>
+ <part name="cart" interface="sag_cart"> <!-- HD38800 MCU -->
+ <dataarea name="rom" size="0x2000">
+ <rom name="inv2_hd38800a31" offset="0x0000" size="0x1000" crc="29c8c100" sha1="41cd413065659c6d7d5b2408de2ca6d51c49629a" status="baddump" />
+ <rom offset="0x1e80" size="0x0100" loadflag="continue" />
+ </dataarea>
+ </part>
+ </software>
+
+</softwarelist>
diff --git a/hash/microvision.xml b/hash/microvision.xml
index 0807ab271cb..d894b8b1e66 100644
--- a/hash/microvision.xml
+++ b/hash/microvision.xml
@@ -101,8 +101,8 @@ The "rc" feature is used to indicate the source of the clock signal
<publisher>Milton Bradley</publisher>
<info name="serial" value="MP3481" />
<part name="cart" interface="microvision_cart">
- <feature name="pla" value="1" /> <!-- correct? -->
- <feature name="pcb" value="4952-79 REV-B" /> <!-- correct? -->
+ <feature name="pla" value="1" />
+ <feature name="pcb" value="4952-79 REV-B" /> <!-- correct? -->
<feature name="paddle" value="yes" />
<dataarea name="rom" size="2048">
<rom name="connect4t.bin" size="2048" crc="6a4cf60b" sha1="e93d848784205ab49234ad26718e04d267b776ed"/>
diff --git a/hash/snes.xml b/hash/snes.xml
index 1647924e8bf..bb49c8c2ede 100644
--- a/hash/snes.xml
+++ b/hash/snes.xml
@@ -36813,6 +36813,18 @@ List of unclassified roms
</part>
</software>
+ <software name="coolsknk">
+ <description>Cooly Skunk (Jpn, Prototype)</description>
+ <year>1996</year>
+ <publisher>Visit</publisher>
+ <part name="cart" interface="snes_cart">
+ <feature name="slot" value="hirom" />
+ <dataarea name="rom" size="1048576">
+ <rom name="cooly skunk prototype.sfc" size="1048576" crc="90fd3134" sha1="135c5330be85ba72a7417c6773ca0c352446c216" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="cornbust">
<description>Corn Buster (Euro, Prototype)</description>
<year>199?</year>
@@ -60036,6 +60048,18 @@ to ensure nothing has been touched in the Retro Quest cart production in 2013/20
</part>
</software>
+ <software name="tarzan">
+ <description>Edgar Rice Burroughs' Tarzan: Lord of the Jungle (Prototype)</description>
+ <year>199?</year>
+ <publisher>Gametek</publisher>
+ <part name="cart" interface="snes_cart">
+ <feature name="slot" value="hirom" />
+ <dataarea name="rom" size="4194304">
+ <rom name="tarzan prototype.sfc" size="4194304" crc="61290299" sha1="7127e7a39da36ec509280e27c72494a827bb6a5a" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="tatkgen2" cloneof="congocap">
<description>Tatakae Genshijin 2 - Rookie no Bouken (Jpn)</description>
<year>1992</year>
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 2b64a7008a4..5f606673a01 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -1690,6 +1690,25 @@ end
---------------------------------------------------
--
+--@src/devices/bus/pasopia/pac2.h,BUSES["PASOPIA"] = true
+---------------------------------------------------
+
+if (BUSES["PASOPIA"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/bus/pasopia/pac2.cpp",
+ MAME_DIR .. "src/devices/bus/pasopia/pac2.h",
+ MAME_DIR .. "src/devices/bus/pasopia/pac2exp.cpp",
+ MAME_DIR .. "src/devices/bus/pasopia/pac2exp.h",
+ MAME_DIR .. "src/devices/bus/pasopia/rampac2.cpp",
+ MAME_DIR .. "src/devices/bus/pasopia/rampac2.h",
+ MAME_DIR .. "src/devices/bus/pasopia/rompac2.cpp",
+ MAME_DIR .. "src/devices/bus/pasopia/rompac2.h",
+ }
+end
+
+
+---------------------------------------------------
+--
--@src/devices/bus/pc_joy/pc_joy.h,BUSES["PC_JOY"] = true
---------------------------------------------------
diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua
index 95d65cd8f70..3f32cc9b193 100644
--- a/scripts/src/cpu.lua
+++ b/scripts/src/cpu.lua
@@ -1620,7 +1620,6 @@ if (CPUS["M6800"]~=null) then
MAME_DIR .. "src/devices/cpu/m6800/m6801.cpp",
MAME_DIR .. "src/devices/cpu/m6800/m6801.h",
MAME_DIR .. "src/devices/cpu/m6800/6800ops.hxx",
- MAME_DIR .. "src/devices/cpu/m6800/6800tbl.hxx",
}
end
diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua
index 4e7352c3e41..8f372635c7b 100644
--- a/scripts/src/machine.lua
+++ b/scripts/src/machine.lua
@@ -525,6 +525,18 @@ end
---------------------------------------------------
--
+--@src/devices/machine/74543.h,MACHINES["TTL74543"] = true
+---------------------------------------------------
+
+if (MACHINES["TTL74543"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/machine/74543.cpp",
+ MAME_DIR .. "src/devices/machine/74543.h",
+ }
+end
+
+---------------------------------------------------
+--
--@src/devices/machine/7474.h,MACHINES["TTL7474"] = true
---------------------------------------------------
@@ -1751,6 +1763,18 @@ end
---------------------------------------------------
--
+--@src/devices/machine/m3002.h,MACHINES["M3002"] = true
+---------------------------------------------------
+
+if (MACHINES["M3002"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/machine/m3002.cpp",
+ MAME_DIR .. "src/devices/machine/m3002.h",
+ }
+end
+
+---------------------------------------------------
+--
--@src/devices/machine/m6m80011ap.h,MACHINES["M6M80011AP"] = true
---------------------------------------------------
diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua
index 1b3d5e07b5b..1c44d5df467 100644
--- a/scripts/target/mame/arcade.lua
+++ b/scripts/target/mame/arcade.lua
@@ -514,6 +514,7 @@ MACHINES["LDVP931"] = true
MACHINES["LINFLASH"] = true
MACHINES["LPCI"] = true
--MACHINES["LSI53C810"] = true
+--MACHINES["M3002"] = true
--MACHINES["M68307"] = true
--MACHINES["M68340"] = true
MACHINES["M6M80011AP"] = true
@@ -2679,6 +2680,7 @@ files {
MAME_DIR .. "src/mame/drivers/merit3xx.cpp",
MAME_DIR .. "src/mame/drivers/meritm.cpp",
MAME_DIR .. "src/mame/drivers/merits.cpp",
+ MAME_DIR .. "src/mame/drivers/meritsdx.cpp",
MAME_DIR .. "src/mame/drivers/mtouchxl.cpp",
MAME_DIR .. "src/mame/drivers/pubtimed.cpp",
MAME_DIR .. "src/mame/machine/at.h",
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index 67f09cda7e8..139f02cb7a6 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -536,6 +536,7 @@ MACHINES["LH5810"] = true
MACHINES["LINFLASH"] = true
MACHINES["LPCI"] = true
MACHINES["LSI53C810"] = true
+MACHINES["M3002"] = true
MACHINES["M68307"] = true
MACHINES["M68340"] = true
MACHINES["M6M80011AP"] = true
@@ -853,6 +854,7 @@ BUSES["NSCSI"] = true
BUSES["NUBUS"] = true
BUSES["O2"] = true
BUSES["ORICEXT"] = true
+BUSES["PASOPIA"] = true
BUSES["PC1512"] = true
BUSES["PCE"] = true
BUSES["PC_JOY"] = true
diff --git a/src/devices/bus/isa/fdc.cpp b/src/devices/bus/isa/fdc.cpp
index 3ec6db240d1..a10c2743c9a 100644
--- a/src/devices/bus/isa/fdc.cpp
+++ b/src/devices/bus/isa/fdc.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
+// copyright-holders:Miodrag Milanovic, Wilbert Pol
/**********************************************************************
ISA 8 bit Floppy Disk Controller
@@ -9,11 +9,13 @@
#include "emu.h"
#include "fdc.h"
#include "machine/busmouse.h"
-#include "machine/pc_fdc.h"
#include "formats/pc_dsk.h"
#include "formats/naslite_dsk.h"
#include "formats/ibmxdf_dsk.h"
+#define VERBOSE 0
+#include "logmacro.h"
+
FLOPPY_FORMATS_MEMBER( isa8_fdc_device::floppy_formats )
FLOPPY_PC_FORMAT,
@@ -43,13 +45,6 @@ isa8_fdc_device::isa8_fdc_device(const machine_config &mconfig, device_type type
{
}
-void isa8_fdc_device::device_start()
-{
- set_isa_device();
- m_isa->install_device(0x03f0, 0x03f7, *m_fdc, &pc_fdc_interface::map);
- m_isa->set_dma_channel(2, this, true);
-}
-
void isa8_fdc_device::device_reset()
{
}
@@ -85,33 +80,177 @@ void isa8_fdc_device::eop_w(int state)
}
-isa8_fdc_xt_device::isa8_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_XT, tag, owner, clock)
+isa8_upd765_fdc_device::isa8_upd765_fdc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, type, tag, owner, clock)
+{
+}
+
+void isa8_upd765_fdc_device::device_start()
+{
+ for(int i=0; i<4; i++) {
+ char name[2] = {static_cast<char>('0'+i), 0};
+ floppy_connector *conn = subdevice<floppy_connector>(name);
+ floppy[i] = conn ? conn->get_device() : nullptr;
+ }
+
+ irq = drq = false;
+ fdc_irq = fdc_drq = false;
+ dor = 0x00;
+}
+
+// Bits 0-1 select one of the 4 drives, but only if the associated
+// motor bit is on
+
+// Bit 2 is tied to the upd765 reset line
+
+// Bit 3 enables the irq and drq lines
+
+// Bit 4-7 control the drive motors
+
+void isa8_upd765_fdc_device::dor_w(uint8_t data)
+{
+ LOG("dor = %02x\n", data);
+ uint8_t pdor = dor;
+ dor = data;
+
+ for(int i=0; i<4; i++)
+ if(floppy[i])
+ floppy[i]->mon_w(!(dor & (0x10 << i)));
+
+ int fid = dor & 3;
+ if(dor & (0x10 << fid))
+ m_fdc->set_floppy(floppy[fid]);
+ else
+ m_fdc->set_floppy(nullptr);
+
+ check_irq();
+ check_drq();
+ if((pdor^dor) & 4)
+ m_fdc->soft_reset();
+}
+
+uint8_t isa8_upd765_fdc_device::dor_r()
+{
+ return dor;
+}
+
+void isa8_upd765_fdc_device::ccr_w(uint8_t data)
+{
+ static const int rates[4] = { 500000, 300000, 250000, 1000000 };
+ LOG("ccr = %02x\n", data);
+ m_fdc->set_rate(rates[data & 3]);
+}
+
+uint8_t isa8_upd765_fdc_device::dir_r()
+{
+ if(floppy[dor & 3])
+ return floppy[dor & 3]->dskchg_r() ? 0x00 : 0x80;
+ return 0x00;
+}
+
+WRITE_LINE_MEMBER(isa8_upd765_fdc_device::fdc_irq_w)
+{
+ fdc_irq = state;
+ check_irq();
+}
+
+WRITE_LINE_MEMBER(isa8_upd765_fdc_device::fdc_drq_w)
+{
+ fdc_drq = state;
+ check_drq();
+}
+
+void isa8_upd765_fdc_device::check_irq()
+{
+ bool pirq = irq;
+ irq = fdc_irq && (dor & 4) && (dor & 8);
+ if(irq != pirq) {
+ LOG("pc_irq = %d\n", irq);
+ irq_w(irq);
+ }
+}
+
+void isa8_upd765_fdc_device::check_drq()
+{
+ bool pdrq = drq;
+ drq = fdc_drq && (dor & 4) && (dor & 8);
+ if(drq != pdrq)
+ drq_w(drq);
+}
+
+
+isa8_fdc_xt_device::isa8_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_xt_device(mconfig, ISA8_FDC_XT, tag, owner, clock)
+{
+}
+
+isa8_fdc_xt_device::isa8_fdc_xt_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : isa8_upd765_fdc_device(mconfig, type, tag, owner, clock)
{
}
void isa8_fdc_xt_device::device_add_mconfig(machine_config &config)
{
- pc_fdc_xt_device &pc_fdc_xt(PC_FDC_XT(config, m_fdc, 0));
- pc_fdc_xt.intrq_wr_callback().set(FUNC(isa8_fdc_device::irq_w));
- pc_fdc_xt.drq_wr_callback().set(FUNC(isa8_fdc_device::drq_w));
+ upd765a_device &upd765a(UPD765A(config, m_fdc, 8'000'000, false, false));
+ upd765a.intrq_wr_callback().set(FUNC(isa8_fdc_xt_device::fdc_irq_w));
+ upd765a.drq_wr_callback().set(FUNC(isa8_fdc_xt_device::fdc_drq_w));
FLOPPY_CONNECTOR(config, "fdc:0", pc_dd_floppies, "525dd", isa8_fdc_device::floppy_formats);
FLOPPY_CONNECTOR(config, "fdc:1", pc_dd_floppies, "525dd", isa8_fdc_device::floppy_formats);
}
+void isa8_fdc_xt_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x03f0, 0x03f7, *this, &isa8_fdc_xt_device::map);
+ m_isa->set_dma_channel(2, this, true);
+
+ isa8_upd765_fdc_device::device_start();
+}
+
+// The schematics show address decoding is minimal
+void isa8_fdc_xt_device::map(address_map &map)
+{
+ map(0x0, 0x0).r(m_fdc, FUNC(upd765a_device::msr_r)).w(FUNC(isa8_fdc_xt_device::dor_w));
+ map(0x1, 0x1).r(m_fdc, FUNC(upd765a_device::fifo_r)).w(FUNC(isa8_fdc_xt_device::dor_fifo_w));
+ map(0x2, 0x2).w(FUNC(isa8_fdc_xt_device::dor_w));
+ map(0x3, 0x3).w(FUNC(isa8_fdc_xt_device::dor_w));
+ map(0x4, 0x5).m(m_fdc, FUNC(upd765a_device::map));
+}
-isa8_fdc_at_device::isa8_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_AT, tag, owner, clock)
+void isa8_fdc_xt_device::dor_fifo_w(uint8_t data)
+{
+ m_fdc->fifo_w(data);
+ dor_w(data);
+}
+
+
+isa8_fdc_at_device::isa8_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_upd765_fdc_device(mconfig, ISA8_FDC_AT, tag, owner, clock)
{
}
void isa8_fdc_at_device::device_add_mconfig(machine_config &config)
{
- pc_fdc_at_device &pc_fdc_at(PC_FDC_AT(config, m_fdc, 0));
- pc_fdc_at.intrq_wr_callback().set(FUNC(isa8_fdc_device::irq_w));
- pc_fdc_at.drq_wr_callback().set(FUNC(isa8_fdc_device::drq_w));
+ upd765a_device &upd765a(UPD765A(config, m_fdc, 8'000'000, false, false));
+ upd765a.intrq_wr_callback().set(FUNC(isa8_fdc_at_device::fdc_irq_w));
+ upd765a.drq_wr_callback().set(FUNC(isa8_fdc_at_device::fdc_drq_w));
FLOPPY_CONNECTOR(config, "fdc:0", pc_hd_floppies, "35hd", isa8_fdc_device::floppy_formats);
FLOPPY_CONNECTOR(config, "fdc:1", pc_hd_floppies, "35hd", isa8_fdc_device::floppy_formats);
}
+// Decoding is through a PAL, so presumably complete
+void isa8_fdc_at_device::map(address_map &map)
+{
+ map(0x2, 0x2).rw(FUNC(isa8_fdc_at_device::dor_r), FUNC(isa8_fdc_at_device::dor_w));
+ map(0x4, 0x5).m(m_fdc, FUNC(upd765a_device::map));
+ map(0x7, 0x7).rw(FUNC(isa8_fdc_at_device::dir_r), FUNC(isa8_fdc_at_device::ccr_w));
+}
+
+void isa8_fdc_at_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x03f0, 0x03f7, *this, &isa8_fdc_at_device::map);
+ m_isa->set_dma_channel(2, this, true);
+
+ isa8_upd765_fdc_device::device_start();
+}
+
isa8_fdc_smc_device::isa8_fdc_smc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_SMC, tag, owner, clock)
{
}
@@ -125,6 +264,13 @@ void isa8_fdc_smc_device::device_add_mconfig(machine_config &config)
FLOPPY_CONNECTOR(config, "fdc:1", pc_hd_floppies, "35hd", isa8_fdc_device::floppy_formats);
}
+void isa8_fdc_smc_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x03f0, 0x03f7, downcast<smc37c78_device &>(*m_fdc), &smc37c78_device::map);
+ m_isa->set_dma_channel(2, this, true);
+}
+
isa8_fdc_ps2_device::isa8_fdc_ps2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_PS2, tag, owner, clock)
{
}
@@ -139,6 +285,13 @@ void isa8_fdc_ps2_device::device_add_mconfig(machine_config &config)
FLOPPY_CONNECTOR(config, "fdc:1", pc_hd_floppies, "35hd", isa8_fdc_device::floppy_formats);
}
+void isa8_fdc_ps2_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x03f0, 0x03f7, downcast<n82077aa_device &>(*m_fdc), &n82077aa_device::map);
+ m_isa->set_dma_channel(2, this, true);
+}
+
isa8_fdc_superio_device::isa8_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_SUPERIO, tag, owner, clock)
{
}
@@ -152,15 +305,22 @@ void isa8_fdc_superio_device::device_add_mconfig(machine_config &config)
FLOPPY_CONNECTOR(config, "fdc:1", pc_hd_floppies, "35hd", isa8_fdc_device::floppy_formats);
}
+void isa8_fdc_superio_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x03f0, 0x03f7, downcast<pc_fdc_superio_device &>(*m_fdc), &pc_fdc_superio_device::map);
+ m_isa->set_dma_channel(2, this, true);
+}
+
isa8_ec1841_0003_device::isa8_ec1841_0003_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : isa8_fdc_device(mconfig, ISA8_EC1841_0003, tag, owner, clock)
+ : isa8_fdc_xt_device(mconfig, ISA8_EC1841_0003, tag, owner, clock)
, m_bus_mouse(*this, "bus_mouse")
{
}
void isa8_ec1841_0003_device::device_start()
{
- isa8_fdc_device::device_start();
+ isa8_fdc_xt_device::device_start();
m_isa->install_device(0x023c, 0x023f, *m_bus_mouse, &bus_mouse_device::map);
}
@@ -171,11 +331,7 @@ WRITE_LINE_MEMBER( isa8_ec1841_0003_device::aux_irq_w )
void isa8_ec1841_0003_device::device_add_mconfig(machine_config &config)
{
- pc_fdc_xt_device &pc_fdc_xt(PC_FDC_XT(config, m_fdc, 0));
- pc_fdc_xt.intrq_wr_callback().set(FUNC(isa8_fdc_device::irq_w));
- pc_fdc_xt.drq_wr_callback().set(FUNC(isa8_fdc_device::drq_w));
- FLOPPY_CONNECTOR(config, "fdc:0", pc_dd_floppies, "525dd", isa8_fdc_device::floppy_formats);
- FLOPPY_CONNECTOR(config, "fdc:1", pc_dd_floppies, "525dd", isa8_fdc_device::floppy_formats);
+ isa8_fdc_xt_device::device_add_mconfig(config);
BUS_MOUSE(config, "bus_mouse", 0).extint_callback().set(FUNC(isa8_ec1841_0003_device::aux_irq_w));
}
diff --git a/src/devices/bus/isa/fdc.h b/src/devices/bus/isa/fdc.h
index cec5f7dd06e..a0c872a28f0 100644
--- a/src/devices/bus/isa/fdc.h
+++ b/src/devices/bus/isa/fdc.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
+// copyright-holders:Miodrag Milanovic, Wilbert Pol
/**********************************************************************
ISA 8 bit Floppy Disk Controller
@@ -35,7 +35,6 @@ protected:
isa8_fdc_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;
virtual uint8_t dack_r(int line) override;
@@ -43,23 +42,61 @@ protected:
virtual void dack_line_w(int line, int state) override;
virtual void eop_w(int state) override;
- required_device<pc_fdc_interface> m_fdc;
+ required_device<upd765_family_device> m_fdc;
+};
+
+class isa8_upd765_fdc_device : public isa8_fdc_device
+{
+protected:
+ // construction/destruction
+ isa8_upd765_fdc_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;
+
+ uint8_t dor_r();
+ void dor_w(uint8_t data);
+ uint8_t dir_r();
+ void ccr_w(uint8_t data);
+
+ DECLARE_WRITE_LINE_MEMBER( fdc_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
+
+private:
+ bool irq, drq, fdc_drq, fdc_irq;
+ uint8_t dor;
+
+ floppy_image_device *floppy[4];
+
+ void check_irq();
+ void check_drq();
};
-class isa8_fdc_xt_device : public isa8_fdc_device {
+class isa8_fdc_xt_device : public isa8_upd765_fdc_device {
public:
isa8_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ isa8_fdc_xt_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
+
+ void map(address_map &map);
+ void dor_fifo_w(uint8_t data);
};
-class isa8_fdc_at_device : public isa8_fdc_device {
+class isa8_fdc_at_device : public isa8_upd765_fdc_device {
public:
isa8_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ // device-level overrides
virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
+
+ void map(address_map &map);
};
class isa8_fdc_smc_device : public isa8_fdc_device {
@@ -67,7 +104,9 @@ public:
isa8_fdc_smc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ // device-level overrides
virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
};
class isa8_fdc_ps2_device : public isa8_fdc_device {
@@ -75,7 +114,9 @@ public:
isa8_fdc_ps2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ // device-level overrides
virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
};
class isa8_fdc_superio_device : public isa8_fdc_device {
@@ -83,10 +124,12 @@ public:
isa8_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ // device-level overrides
virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
};
-class isa8_ec1841_0003_device : public isa8_fdc_device {
+class isa8_ec1841_0003_device : public isa8_fdc_xt_device {
public:
isa8_ec1841_0003_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/bus/isa/mufdc.cpp b/src/devices/bus/isa/mufdc.cpp
index 3e40653e175..61cbeecc95a 100644
--- a/src/devices/bus/isa/mufdc.cpp
+++ b/src/devices/bus/isa/mufdc.cpp
@@ -161,7 +161,7 @@ void mufdc_device::device_start()
void mufdc_device::device_reset()
{
m_isa->install_rom(this, 0xc8000, 0xc9fff, shortname(), "option");
- m_isa->install_device(0x3f0, 0x3f7, *m_fdc, &pc_fdc_interface::map);
+ m_isa->install_device(0x3f0, 0x3f7, *m_fdc, &mcs3201_device::map);
m_isa->set_dma_channel(2, this, true);
}
diff --git a/src/devices/bus/isa/mufdc.h b/src/devices/bus/isa/mufdc.h
index 2fa000757e4..fd21c1feb28 100644
--- a/src/devices/bus/isa/mufdc.h
+++ b/src/devices/bus/isa/mufdc.h
@@ -57,7 +57,7 @@ private:
DECLARE_WRITE_LINE_MEMBER( fdc_irq_w );
DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
- required_device<pc_fdc_interface> m_fdc;
+ required_device<mcs3201_device> m_fdc;
required_ioport m_config;
};
diff --git a/src/devices/bus/isa/omti8621.cpp b/src/devices/bus/isa/omti8621.cpp
index f74903797ac..176fa9ef192 100644
--- a/src/devices/bus/isa/omti8621.cpp
+++ b/src/devices/bus/isa/omti8621.cpp
@@ -249,12 +249,12 @@ void omti8621_device::device_add_mconfig(machine_config &config)
OMTI_DISK(config, OMTI_DISK0_TAG, 0);
OMTI_DISK(config, OMTI_DISK1_TAG, 0);
- pc_fdc_at_device &pc_fdc_at(PC_FDC_AT(config, m_fdc, 0));
- pc_fdc_at.intrq_wr_callback().set(FUNC(omti8621_device::fdc_irq_w));
- pc_fdc_at.drq_wr_callback().set(FUNC(omti8621_device::fdc_drq_w));
- FLOPPY_CONNECTOR(config, OMTI_FDC_TAG":0", pc_hd_floppies, "525hd", omti8621_device::floppy_formats);
+ UPD765A(config, m_fdc, 48_MHz_XTAL / 6, false, false); // clocked through FDC9239BT
+ m_fdc->intrq_wr_callback().set(FUNC(omti8621_device::fdc_irq_w));
+ m_fdc->drq_wr_callback().set(FUNC(omti8621_device::fdc_drq_w));
+ FLOPPY_CONNECTOR(config, m_floppy[0], pc_hd_floppies, "525hd", omti8621_device::floppy_formats);
// Apollo workstations never have more then 1 floppy drive
-// FLOPPY_CONNECTOR(config, OMTI_FDC_TAG":1", pc_hd_floppies, "525hd", omti8621_device::floppy_formats);
+// FLOPPY_CONNECTOR(config, m_floppy[1], pc_hd_floppies, nullptr, omti8621_device::floppy_formats);
}
const tiny_rom_entry *omti8621_device::device_rom_region() const
@@ -315,11 +315,11 @@ void omti8621_device::device_reset()
// and the onboard AT FDC ports
if (m_iobase->read() & 8)
{
- m_isa->install_device(0x0370, 0x0377, *m_fdc, &pc_fdc_interface::map);
+ m_isa->install_device(0x0370, 0x0377, *this, &omti8621_device::fdc_map);
}
else
{
- m_isa->install_device(0x03f0, 0x03f7, *m_fdc, &pc_fdc_interface::map);
+ m_isa->install_device(0x03f0, 0x03f7, *this, &omti8621_device::fdc_map);
}
m_isa->set_dma_channel(2, this, true);
@@ -362,6 +362,10 @@ void omti8621_device::device_reset()
diskaddr_format_bad_track = 0;
alternate_track_address[0] = 0;
alternate_track_address[1] = 0;
+
+ fd_moten_w(0);
+ fd_rate_w(0);
+ fd_extra_w(0);
}
DEFINE_DEVICE_TYPE(ISA16_OMTI8621, omti8621_pc_device, "omti8621isa", "OMTI 8621 ESDI/floppy controller (ISA)")
@@ -387,10 +391,11 @@ omti8621_device::omti8621_device(
: device_t(mconfig, type, tag, owner, clock)
, device_isa16_card_interface(mconfig, *this)
, m_fdc(*this, OMTI_FDC_TAG)
+ , m_floppy(*this, OMTI_FDC_TAG":%u", 0U)
, m_iobase(*this, "IO_BASE")
, m_biosopts(*this, "BIOS_OPTS")
, jumper(0), omti_state(0), status_port(0), config_port(0), mask_port(0), command_length(0), command_index(0), command_status(0), data_buffer(nullptr)
- , data_length(0), data_index(0), diskaddr_ecc_error(0), diskaddr_format_bad_track(0), m_timer(nullptr), m_installed(false)
+ , data_length(0), data_index(0), diskaddr_ecc_error(0), diskaddr_format_bad_track(0), m_timer(nullptr), m_moten(0), m_installed(false)
{
}
@@ -1268,12 +1273,14 @@ void omti8621_device::set_jumper(uint16_t disk_type)
// FDC uses the standard IRQ 6 / DMA 2, doesn't appear to be configurable
WRITE_LINE_MEMBER( omti8621_device::fdc_irq_w )
{
- m_isa->irq6_w(state ? ASSERT_LINE : CLEAR_LINE);
+ if (BIT(m_moten, 3))
+ m_isa->irq6_w(state ? ASSERT_LINE : CLEAR_LINE);
}
WRITE_LINE_MEMBER( omti8621_device::fdc_drq_w )
{
- m_isa->drq2_w(state ? ASSERT_LINE : CLEAR_LINE);
+ if (BIT(m_moten, 3))
+ m_isa->drq2_w(state ? ASSERT_LINE : CLEAR_LINE);
}
uint8_t omti8621_device::dack_r(int line)
@@ -1296,6 +1303,70 @@ void omti8621_device::eop_w(int state)
m_fdc->tc_w(state == ASSERT_LINE);
}
+void omti8621_device::fdc_map(address_map &map)
+{
+ map(2, 2).w(FUNC(omti8621_device::fd_moten_w));
+ map(4, 5).m(m_fdc, FUNC(upd765a_device::map));
+ map(6, 6).w(FUNC(omti8621_device::fd_extra_w));
+ map(7, 7).rw(FUNC(omti8621_device::fd_disk_chg_r), FUNC(omti8621_device::fd_rate_w));
+}
+
+void omti8621_device::fd_moten_w(uint8_t data)
+{
+ if (BIT(data, 3) && !BIT(m_moten, 3))
+ {
+ m_isa->irq6_w(m_fdc->get_irq() ? ASSERT_LINE : CLEAR_LINE);
+ m_isa->drq2_w(m_fdc->get_drq() ? ASSERT_LINE : CLEAR_LINE);
+ }
+ else if (!BIT(data, 3) && BIT(m_moten, 3))
+ {
+ m_isa->irq6_w(CLEAR_LINE);
+ m_isa->drq2_w(CLEAR_LINE);
+ }
+
+ m_moten = data;
+
+ if (!BIT(data, 2))
+ m_fdc->soft_reset();
+
+ for (int i = 0; i < 2; i++)
+ {
+ floppy_image_device *floppy = m_floppy[i].found() ? m_floppy[i]->get_device() : nullptr;
+ if (floppy != nullptr)
+ floppy->mon_w(!BIT(data, i + 4));
+
+ if (i == (data & 0x01))
+ m_fdc->set_floppy(BIT(data, i + 4) ? floppy : nullptr);
+ }
+}
+
+void omti8621_device::fd_rate_w(uint8_t data)
+{
+ // Bit 1 = FD_MINI (TODO)
+ // Bit 0 = FD_RATE (TODO)
+}
+
+void omti8621_device::fd_extra_w(uint8_t data)
+{
+ // Bit 7 = FD_EXTRA-2 (NC)
+ // Bit 6 = FD_EXTRA-1 (NC)
+ // Bit 5 = FD_PIN_6 (TODO)
+ // Bit 4 = FD_IUSE_HLD (TODO)
+ // Bit 3 = FD_DEN_SEL (TODO)
+ // Bit 2 = FD_PRE-2 (TODO)
+ // Bit 1 = FD_PRE-1 (TODO)
+ // Bit 0 = FD_PRE-0 (TODO)
+}
+
+uint8_t omti8621_device::fd_disk_chg_r()
+{
+ floppy_image_device *floppy = m_floppy[m_moten & 0x01].found() ? m_floppy[m_moten & 0x01]->get_device() : nullptr;
+ if (floppy == nullptr || floppy->dskchg_r())
+ return 0x00;
+ else
+ return 0x80;
+}
+
//##########################################################################
// device type definition
diff --git a/src/devices/bus/isa/omti8621.h b/src/devices/bus/isa/omti8621.h
index 1258af71854..a7a77f7c93d 100644
--- a/src/devices/bus/isa/omti8621.h
+++ b/src/devices/bus/isa/omti8621.h
@@ -16,7 +16,7 @@
#pragma once
#include "isa.h"
-#include "machine/pc_fdc.h"
+#include "machine/upd765.h"
#include "imagedev/floppy.h"
/***************************************************************************
@@ -61,7 +61,8 @@ protected:
void set_interrupt(enum line_state line_state);
- required_device<pc_fdc_interface> m_fdc;
+ required_device<upd765a_device> m_fdc;
+ optional_device_array<floppy_connector, 2> m_floppy;
required_ioport m_iobase;
required_ioport m_biosopts;
@@ -74,6 +75,13 @@ private:
DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
DECLARE_FLOPPY_FORMATS( floppy_formats );
+ void fd_moten_w(uint8_t data);
+ void fd_rate_w(uint8_t data);
+ void fd_extra_w(uint8_t data);
+ uint8_t fd_disk_chg_r();
+
+ void fdc_map(address_map &map);
+
uint16_t jumper;
uint8_t omti_state;
@@ -105,6 +113,8 @@ private:
emu_timer *m_timer;
+ uint8_t m_moten;
+
bool m_installed;
void clear_sense_data();
diff --git a/src/devices/bus/lpci/i82439tx.cpp b/src/devices/bus/lpci/i82439tx.cpp
index be768007a0c..62010fc5f21 100644
--- a/src/devices/bus/lpci/i82439tx.cpp
+++ b/src/devices/bus/lpci/i82439tx.cpp
@@ -26,6 +26,8 @@ i82439tx_device::i82439tx_device(const machine_config &mconfig, const char *tag,
m_rom(nullptr)
{
m_smram.smiact_n = 1;
+ m_smram.tseg_size = 0;
+ m_smram.mapping = 0;
}
void i82439tx_device::i82439tx_configure_memory(uint8_t val, offs_t begin, offs_t end)
diff --git a/src/devices/bus/pasopia/pac2.cpp b/src/devices/bus/pasopia/pac2.cpp
new file mode 100644
index 00000000000..13955bba61f
--- /dev/null
+++ b/src/devices/bus/pasopia/pac2.cpp
@@ -0,0 +1,159 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/****************************************************************************
+
+ Toshiba Pasopia PAC2 slot
+
+ This is the smallest of the three Pasopia expansion connectors. Despite
+ only providing access to a 4-by-8-bit space, this was mostly used for
+ memory cartridges.
+
+ ______
+ CDB 7 1 | . . | 2 CDB 6
+ GND 3 | . . | 4 CDB 5
+ CDB 4 5 | . . | 6 CDB 3
+ GND 7 | . . | 8 CDB 2
+ CDB 1 9 | . . | 10 CDB 0
+ CDAD01 11 | . . | 12 CDAD00
+ GND 13 | . . | 14 CSELP2
+ CDRD 15 | . . | 16 CDWR
+ GND 17 | . . | 18 GND
+ +5V 19 | . . | 20 +5V
+ ------
+
+****************************************************************************/
+
+#include "emu.h"
+#include "pac2.h"
+
+#include "pac2exp.h"
+#include "rampac2.h"
+#include "rompac2.h"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definition
+DEFINE_DEVICE_TYPE(PASOPIA_PAC2, pasopia_pac2_slot_device, "pasopia_pac2", "Pasopia PAC2 Slot")
+
+//**************************************************************************
+// PAC2 SLOT DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// pasopia_pac2_slot_device - construction
+//-------------------------------------------------
+
+pasopia_pac2_slot_device::pasopia_pac2_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, PASOPIA_PAC2, tag, owner, clock)
+ , device_single_card_slot_interface<pac2_card_interface>(mconfig, *this)
+ , m_card(nullptr)
+{
+}
+
+
+//-------------------------------------------------
+// device_resolve_objects - resolve objects that
+// may be needed for other devices to set
+// initial conditions at start time
+//-------------------------------------------------
+
+void pasopia_pac2_slot_device::device_resolve_objects()
+{
+ m_card = get_card_device();
+ if (m_card != nullptr)
+ m_card->m_slot = this;
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pasopia_pac2_slot_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// read - I/O read access
+//-------------------------------------------------
+
+u8 pasopia_pac2_slot_device::read(offs_t offset)
+{
+ if (m_card == nullptr)
+ {
+ if (!machine().side_effects_disabled())
+ logerror("%s: Read from unconnected PAC2 (CDAD = %X)\n", machine().describe_context(), offset);
+ return 0;
+ }
+
+ return m_card->pac2_read(offset);
+}
+
+
+//-------------------------------------------------
+// write - I/O write access
+//-------------------------------------------------
+
+void pasopia_pac2_slot_device::write(offs_t offset, u8 data)
+{
+ if (m_card != nullptr)
+ m_card->pac2_write(offset, data);
+}
+
+//**************************************************************************
+// PAC2 CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// pac2_card_interface - construction
+//-------------------------------------------------
+
+pac2_card_interface::pac2_card_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device, "pac2card")
+ , m_slot(nullptr)
+{
+}
+
+
+//-------------------------------------------------
+// interface_pre_start - called before the
+// device's own start function
+//-------------------------------------------------
+
+void pac2_card_interface::interface_pre_start()
+{
+ if (!m_slot)
+ throw device_missing_dependencies();
+}
+
+
+//-------------------------------------------------
+// pac2_subslot_devices - add standard options
+// for subslots
+//-------------------------------------------------
+
+void pac2_subslot_devices(device_slot_interface &device)
+{
+ //device.option_add("ram4k", PASOPIA_PA7241);
+ device.option_add("ram16k", PASOPIA_PA7243);
+ device.option_add("ram32k", PASOPIA_PA7245);
+ device.option_add("kanji", PASOPIA_PA7246);
+ //device.option_add("kanji2", PASOPIA_PA7247);
+ device.option_add("ram64k", PASOPIA_PA7248);
+ //device.option_add("joy", PASOPIA_PA7390);
+}
+
+
+//-------------------------------------------------
+// pac2_default_devices - add standard options
+// for main slots
+//-------------------------------------------------
+
+void pac2_default_devices(device_slot_interface &device)
+{
+ device.option_add("exp", PASOPIA_PA7234);
+ pac2_subslot_devices(device);
+}
diff --git a/src/devices/bus/pasopia/pac2.h b/src/devices/bus/pasopia/pac2.h
new file mode 100644
index 00000000000..9bbf30b44ca
--- /dev/null
+++ b/src/devices/bus/pasopia/pac2.h
@@ -0,0 +1,83 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/**********************************************************************
+
+ Toshiba Pasopia PAC2 slot
+
+**********************************************************************/
+
+#ifndef MAME_BUS_PASOPIA_PAC2_H
+#define MAME_BUS_PASOPIA_PAC2_H
+
+#pragma once
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// forward declarations
+class pac2_card_interface;
+
+// ======================> pasopia_pac2_slot_device
+
+class pasopia_pac2_slot_device : public device_t, public device_single_card_slot_interface<pac2_card_interface>
+{
+ friend class pac2_card_interface;
+
+public:
+ // construction/destruction
+ template <typename T>
+ pasopia_pac2_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : pasopia_pac2_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
+
+ pasopia_pac2_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
+
+ // memory accesses
+ u8 read(offs_t offset);
+ void write(offs_t offset, u8 data);
+
+protected:
+ // device-specific overrides
+ virtual void device_resolve_objects() override;
+ virtual void device_start() override;
+
+private:
+ pac2_card_interface *m_card;
+};
+
+
+// ======================> pac2_card_interface
+
+class pac2_card_interface : public device_interface
+{
+ friend class pasopia_pac2_slot_device;
+
+protected:
+ // construction/destruction
+ pac2_card_interface(const machine_config &mconfig, device_t &device);
+
+ // required overrides
+ virtual u8 pac2_read(offs_t offset) = 0;
+ virtual void pac2_write(offs_t offset, u8 data) = 0;
+
+private:
+ virtual void interface_pre_start() override;
+
+ pasopia_pac2_slot_device *m_slot;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(PASOPIA_PAC2, pasopia_pac2_slot_device)
+
+void pac2_subslot_devices(device_slot_interface &device);
+void pac2_default_devices(device_slot_interface &device);
+
+#endif // MAME_BUS_PASOPIA_PAC2_H
diff --git a/src/devices/bus/pasopia/pac2exp.cpp b/src/devices/bus/pasopia/pac2exp.cpp
new file mode 100644
index 00000000000..9b5b1987564
--- /dev/null
+++ b/src/devices/bus/pasopia/pac2exp.cpp
@@ -0,0 +1,92 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/****************************************************************************
+
+ Toshiba Pasopia PAC2 expander
+
+ Not much is known about the internal circuitry of this 4-slot expansion.
+ It was apparently designed primarily for the Pasopia 7, with the cord
+ connecting the sidecar to the main unit through a hole in a modified
+ slot cover.
+
+ The one-based slot selection scheme is due to the need to avoid
+ interfering with the 0x80 control byte needed to configure the PPI on
+ the PA7241 RAM PAC2.
+
+****************************************************************************/
+
+#include "emu.h"
+#include "pac2exp.h"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definition
+DEFINE_DEVICE_TYPE(PASOPIA_PA7234, pasopia_pa7234_device, "pa7234", "PA7234 Pasopia PAC2 Expansion Unit")
+
+//**************************************************************************
+// DEVICE DEFINITION
+//**************************************************************************
+
+//-------------------------------------------------
+// pasopia_pa7234_device - construction
+//-------------------------------------------------
+
+pasopia_pa7234_device::pasopia_pa7234_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, PASOPIA_PA7234, tag, owner, clock)
+ , pac2_card_interface(mconfig, *this)
+ , m_slot(*this, "slot%u", 1U)
+ , m_slot_selected(0)
+{
+}
+
+
+//-------------------------------------------------
+// device_add_mconfig - add device-specific
+// machine configuration
+//-------------------------------------------------
+
+void pasopia_pa7234_device::device_add_mconfig(machine_config &config)
+{
+ for (auto &slot : m_slot)
+ PASOPIA_PAC2(config, slot, pac2_subslot_devices, nullptr);
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pasopia_pa7234_device::device_start()
+{
+ save_item(NAME(m_slot_selected));
+}
+
+//**************************************************************************
+// PAC2 INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// pac2_read - I/O read access
+//-------------------------------------------------
+
+u8 pasopia_pa7234_device::pac2_read(offs_t offset)
+{
+ return m_slot[m_slot_selected]->read(offset);
+}
+
+
+//-------------------------------------------------
+// pac2_write - I/O write access
+//-------------------------------------------------
+
+void pasopia_pa7234_device::pac2_write(offs_t offset, u8 data)
+{
+ // Assume all writes are passed through
+ m_slot[m_slot_selected]->write(offset, data);
+
+ // 1, 2, 3, 4 or 7 may supposedly be written here
+ if ((offset & 3) == 3 && (data & 0x07) != 0)
+ m_slot_selected = (data & 0x03) - 1;
+}
diff --git a/src/devices/bus/pasopia/pac2exp.h b/src/devices/bus/pasopia/pac2exp.h
new file mode 100644
index 00000000000..ae874c01490
--- /dev/null
+++ b/src/devices/bus/pasopia/pac2exp.h
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+
+#ifndef MAME_BUS_PASOPIA_PAC2EXP_H
+#define MAME_BUS_PASOPIA_PAC2EXP_H
+
+#pragma once
+
+#include "pac2.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> pasopia_pa7234_device
+
+class pasopia_pa7234_device : public device_t, public pac2_card_interface
+{
+public:
+ // device type constructor
+ pasopia_pa7234_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ // device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
+
+ // pac2_card_interface overrides
+ virtual u8 pac2_read(offs_t offset) override;
+ virtual void pac2_write(offs_t offset, u8 data) override;
+
+private:
+ // object finders
+ required_device_array<pasopia_pac2_slot_device, 4> m_slot;
+
+ // internal state
+ u8 m_slot_selected;
+};
+
+// device type declaration
+DECLARE_DEVICE_TYPE(PASOPIA_PA7234, pasopia_pa7234_device)
+
+#endif // MAME_BUS_PASOPIA_PAC2EXP_H
diff --git a/src/devices/bus/pasopia/rampac2.cpp b/src/devices/bus/pasopia/rampac2.cpp
new file mode 100644
index 00000000000..f9059e24345
--- /dev/null
+++ b/src/devices/bus/pasopia/rampac2.cpp
@@ -0,0 +1,149 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR, Angelo Salese
+/****************************************************************************
+
+ Toshiba Pasopia RAM PAC2 emulation
+
+ This emulates the later, larger cartridges, but not the original 4K
+ model which used a 8255 PPI to latch the RAM address.
+
+****************************************************************************/
+
+#include "emu.h"
+#include "rampac2.h"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definitions
+DEFINE_DEVICE_TYPE(PASOPIA_PA7243, pasopia_pa7243_device, "pa7243", "PA7243 Pasopia RAM PAC2 (16KB)")
+DEFINE_DEVICE_TYPE(PASOPIA_PA7245, pasopia_pa7245_device, "pa7245", "PA7245 Pasopia RAM PAC2 (32KB)")
+DEFINE_DEVICE_TYPE(PASOPIA_PA7248, pasopia_pa7248_device, "pa7248", "PA7248 Pasopia RAM PAC2 (64KB)")
+
+//**************************************************************************
+// DEVICE DEFINITION
+//**************************************************************************
+
+//-------------------------------------------------
+// pasopia_rampac2_device - construction
+//-------------------------------------------------
+
+pasopia_rampac2_device::pasopia_rampac2_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 ram_size)
+ : device_t(mconfig, type, tag, owner, clock)
+ , pac2_card_interface(mconfig, *this)
+ , device_nvram_interface(mconfig, *this)
+ , m_ram_size(ram_size)
+ , m_ram_index(0)
+{
+}
+
+
+//-------------------------------------------------
+// pasopia_pa7243_device - construction
+//-------------------------------------------------
+
+pasopia_pa7243_device::pasopia_pa7243_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : pasopia_rampac2_device(mconfig, PASOPIA_PA7243, tag, owner, clock, 0x4000)
+{
+}
+
+
+//-------------------------------------------------
+// pasopia_pa7245_device - construction
+//-------------------------------------------------
+
+pasopia_pa7245_device::pasopia_pa7245_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : pasopia_rampac2_device(mconfig, PASOPIA_PA7245, tag, owner, clock, 0x8000)
+{
+}
+
+
+//-------------------------------------------------
+// pasopia_pa7248_device - construction
+//-------------------------------------------------
+
+pasopia_pa7248_device::pasopia_pa7248_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : pasopia_rampac2_device(mconfig, PASOPIA_PA7248, tag, owner, clock, 0x10000)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pasopia_rampac2_device::device_start()
+{
+ m_ram = std::make_unique<u8[]>(m_ram_size);
+
+ save_pointer(NAME(m_ram), m_ram_size);
+ save_item(NAME(m_ram_index));
+}
+
+
+//-------------------------------------------------
+// nvram_read - read NVRAM from the file
+//-------------------------------------------------
+
+void pasopia_rampac2_device::nvram_read(emu_file &file)
+{
+ file.read(&m_ram[0], m_ram_size);
+}
+
+
+//-------------------------------------------------
+// nvram_write - write NVRAM to the file
+//-------------------------------------------------
+
+void pasopia_rampac2_device::nvram_write(emu_file &file)
+{
+ file.write(&m_ram[0], m_ram_size);
+}
+
+
+//-------------------------------------------------
+// nvram_default - initialize NVRAM to its
+// default state
+//-------------------------------------------------
+
+void pasopia_rampac2_device::nvram_default()
+{
+ std::fill_n(&m_ram[0], m_ram_size, 0);
+}
+
+//**************************************************************************
+// PAC2 INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// pac2_read - I/O read access
+//-------------------------------------------------
+
+u8 pasopia_rampac2_device::pac2_read(offs_t offset)
+{
+ return m_ram[m_ram_index & (m_ram_size - 1)];
+}
+
+
+//-------------------------------------------------
+// pac2_write - I/O write access
+//-------------------------------------------------
+
+void pasopia_rampac2_device::pac2_write(offs_t offset, u8 data)
+{
+ switch (offset)
+ {
+ case 0:
+ m_ram_index = (m_ram_index & 0xff00) | (data & 0xff);
+ break;
+
+ case 1:
+ m_ram_index = (m_ram_index & 0xff) | ((data & 0xff) << 8);
+ break;
+
+ case 2: // PAC2 RAM write
+ m_ram[m_ram_index & (m_ram_size - 1)] = data;
+ break;
+ }
+}
diff --git a/src/devices/bus/pasopia/rampac2.h b/src/devices/bus/pasopia/rampac2.h
new file mode 100644
index 00000000000..b2ad3633394
--- /dev/null
+++ b/src/devices/bus/pasopia/rampac2.h
@@ -0,0 +1,76 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+
+#ifndef MAME_BUS_PASOPIA_RAMPAC2_H
+#define MAME_BUS_PASOPIA_RAMPAC2_H
+
+#pragma once
+
+#include "pac2.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> pasopia_rampac2_device
+
+class pasopia_rampac2_device : public device_t, public pac2_card_interface, public device_nvram_interface
+{
+protected:
+ // construction/destruction
+ pasopia_rampac2_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u32 ram_size);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ // device_nvram_interface overrides
+ virtual void nvram_read(emu_file &file) override;
+ virtual void nvram_write(emu_file &file) override;
+ virtual void nvram_default() override;
+
+ // pac2_card_interface overrides
+ virtual u8 pac2_read(offs_t offset) override;
+ virtual void pac2_write(offs_t offset, u8 data) override;
+
+private:
+ const u32 m_ram_size;
+
+ // internal state
+ std::unique_ptr<u8[]> m_ram;
+ u16 m_ram_index;
+};
+
+// ======================> pasopia_pa7243_device
+
+class pasopia_pa7243_device : public pasopia_rampac2_device
+{
+public:
+ // device type constructor
+ pasopia_pa7243_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+// ======================> pasopia_pa7245_device
+
+class pasopia_pa7245_device : public pasopia_rampac2_device
+{
+public:
+ // device type constructor
+ pasopia_pa7245_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+// ======================> pasopia_pa7248_device
+
+class pasopia_pa7248_device : public pasopia_rampac2_device
+{
+public:
+ // device type constructor
+ pasopia_pa7248_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+// device type declarations
+DECLARE_DEVICE_TYPE(PASOPIA_PA7243, pasopia_pa7243_device)
+DECLARE_DEVICE_TYPE(PASOPIA_PA7245, pasopia_pa7245_device)
+DECLARE_DEVICE_TYPE(PASOPIA_PA7248, pasopia_pa7248_device)
+
+#endif // MAME_BUS_PASOPIA_RAMPAC2_H
diff --git a/src/devices/bus/pasopia/rompac2.cpp b/src/devices/bus/pasopia/rompac2.cpp
new file mode 100644
index 00000000000..5ec120ac120
--- /dev/null
+++ b/src/devices/bus/pasopia/rompac2.cpp
@@ -0,0 +1,98 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR, Angelo Salese
+/****************************************************************************
+
+ Toshiba Pasopia Kanji ROM PAC2 emulation
+
+ TODO: find out the difference between PA7246 and PA7247 (which one
+ is actually dumped here?)
+
+****************************************************************************/
+
+#include "emu.h"
+#include "rompac2.h"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definition
+DEFINE_DEVICE_TYPE(PASOPIA_PA7246, pasopia_pa7246_device, "pa7246", "PA7246 Pasopia Kanji ROM PAC2")
+
+//**************************************************************************
+// DEVICE DEFINITION
+//**************************************************************************
+
+//-------------------------------------------------
+// pasopia_pa7246_device - construction
+//-------------------------------------------------
+
+pasopia_pa7246_device::pasopia_pa7246_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, PASOPIA_PA7246, tag, owner, clock)
+ , pac2_card_interface(mconfig, *this)
+ , m_kanji_rom(*this, "kanji")
+ , m_kanji_index(0)
+{
+}
+
+
+ROM_START(pa7246)
+ ROM_REGION(0x20000, "kanji", 0)
+ ROM_LOAD("kanji.rom", 0x00000, 0x20000, CRC(6109e308) SHA1(5c21cf1f241ef1fa0b41009ea41e81771729785f))
+ROM_END
+
+//-------------------------------------------------
+// device_rom_region - return a pointer to the
+// rom region description for this device
+//-------------------------------------------------
+
+const tiny_rom_entry *pasopia_pa7246_device::device_rom_region() const
+{
+ return ROM_NAME(pa7246);
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pasopia_pa7246_device::device_start()
+{
+ save_item(NAME(m_kanji_index));
+}
+
+//**************************************************************************
+// PAC2 INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// pac2_read - I/O read access
+//-------------------------------------------------
+
+u8 pasopia_pa7246_device::pac2_read(offs_t offset)
+{
+ return m_kanji_rom[m_kanji_index];
+}
+
+
+//-------------------------------------------------
+// pac2_write - I/O write access
+//-------------------------------------------------
+
+void pasopia_pa7246_device::pac2_write(offs_t offset, u8 data)
+{
+ switch (offset)
+ {
+ case 0:
+ m_kanji_index = (m_kanji_index & 0x1ff00) | ((data & 0xff) << 0);
+ break;
+
+ case 1:
+ m_kanji_index = (m_kanji_index & 0x100ff) | ((data & 0xff) << 8);
+ break;
+
+ case 2:
+ m_kanji_index = (m_kanji_index & 0x0ffff) | ((data & 0x01) << 16);
+ break;
+ }
+}
diff --git a/src/devices/bus/pasopia/rompac2.h b/src/devices/bus/pasopia/rompac2.h
new file mode 100644
index 00000000000..1b734e3b29f
--- /dev/null
+++ b/src/devices/bus/pasopia/rompac2.h
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+
+#ifndef MAME_BUS_PASOPIA_ROMPAC2_H
+#define MAME_BUS_PASOPIA_ROMPAC2_H
+
+#pragma once
+
+#include "pac2.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> pasopia_pa7246_device
+
+class pasopia_pa7246_device : public device_t, public pac2_card_interface
+{
+public:
+ // device type constructor
+ pasopia_pa7246_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ // device-level overrides
+ virtual const tiny_rom_entry *device_rom_region() const override;
+ virtual void device_start() override;
+
+ // pac2_card_interface overrides
+ virtual u8 pac2_read(offs_t offset) override;
+ virtual void pac2_write(offs_t offset, u8 data) override;
+
+private:
+ // object finders
+ required_region_ptr<u8> m_kanji_rom;
+
+ // internal state
+ u32 m_kanji_index;
+};
+
+// device type declaration
+DECLARE_DEVICE_TYPE(PASOPIA_PA7246, pasopia_pa7246_device)
+
+#endif // MAME_BUS_PASOPIA_ROMPAC2_H
diff --git a/src/devices/cpu/hmcs40/hmcs40.cpp b/src/devices/cpu/hmcs40/hmcs40.cpp
index abcde1d500a..5a15217e922 100644
--- a/src/devices/cpu/hmcs40/hmcs40.cpp
+++ b/src/devices/cpu/hmcs40/hmcs40.cpp
@@ -208,7 +208,6 @@ void hmcs40_cpu_device::device_start()
m_pcmask = (1 << m_pcwidth) - 1;
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hmcs40_cpu_device::simple_timer_cb), this));
- reset_prescaler();
// resolve callbacks
m_read_r.resolve_all_safe(m_polarity & 0xf);
@@ -308,6 +307,9 @@ void hmcs40_cpu_device::device_reset()
m_iri = m_irt = 0;
m_if[0] = m_if[1] = m_tf = 1;
+ if (!m_halt && m_timer->remaining().is_never())
+ reset_prescaler();
+
// clear i/o
m_d = m_polarity;
for (int i = 0; i < 16; i++)
diff --git a/src/devices/cpu/lr35902/lr35902.cpp b/src/devices/cpu/lr35902/lr35902.cpp
index 59b8b45f601..452c96f3b8b 100644
--- a/src/devices/cpu/lr35902/lr35902.cpp
+++ b/src/devices/cpu/lr35902/lr35902.cpp
@@ -81,6 +81,7 @@ lr35902_cpu_device::lr35902_cpu_device(const machine_config &mconfig, const char
, m_IF(0)
, m_enable(0)
, m_has_halt_bug(false)
+ , m_dma_cycles_to_burn(0)
, m_entering_halt(false)
, m_timer_func(*this)
, m_incdec16_func(*this)
@@ -137,7 +138,6 @@ inline void lr35902_cpu_device::mem_write_word( uint16_t addr, uint16_t data )
void lr35902_cpu_device::device_start()
{
- m_device = this;
m_program = &space(AS_PROGRAM);
// resolve callbacks
diff --git a/src/devices/cpu/lr35902/lr35902.h b/src/devices/cpu/lr35902/lr35902.h
index db950b6b48c..f723213137c 100644
--- a/src/devices/cpu/lr35902/lr35902.h
+++ b/src/devices/cpu/lr35902/lr35902.h
@@ -108,7 +108,6 @@ protected:
uint8_t m_IF;
int m_irq_state;
bool m_handle_ei_delay;
- lr35902_cpu_device *m_device;
address_space *m_program;
int m_icount;
diff --git a/src/devices/cpu/m6800/6800ops.hxx b/src/devices/cpu/m6800/6800ops.hxx
index 83bc10827c5..a498c846df7 100644
--- a/src/devices/cpu/m6800/6800ops.hxx
+++ b/src/devices/cpu/m6800/6800ops.hxx
@@ -245,15 +245,14 @@ OP_HANDLER( aba )
OP_HANDLER( bra )
{
uint8_t t;
- IMMBYTE(t);
- PC+=SIGNED(t);
+ BRANCH(1);
}
/* $21 BRN relative ----- */
-static uint8_t m6800_brn_t; // hack around GCC 4.6 error because we need the side effects of IMMBYTE
OP_HANDLER( brn )
{
- IMMBYTE(m6800_brn_t);
+ uint8_t t;
+ BRANCH(0);
}
/* $22 BHI relative ----- */
diff --git a/src/devices/cpu/m6800/6800tbl.hxx b/src/devices/cpu/m6800/6800tbl.hxx
deleted file mode 100644
index 4581d59632e..00000000000
--- a/src/devices/cpu/m6800/6800tbl.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
-const m6800_cpu_device::op_func m6800_cpu_device::m6800_insn[0x100] = {
-&m6800_cpu_device::illegl1,&m6800_cpu_device::nop, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tap, &m6800_cpu_device::tpa,
-&m6800_cpu_device::inx, &m6800_cpu_device::dex, &m6800_cpu_device::clv, &m6800_cpu_device::sev, &m6800_cpu_device::clc, &m6800_cpu_device::sec, &m6800_cpu_device::cli, &m6800_cpu_device::sei,
-&m6800_cpu_device::sba, &m6800_cpu_device::cba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tab, &m6800_cpu_device::tba,
-&m6800_cpu_device::illegl1,&m6800_cpu_device::daa, &m6800_cpu_device::illegl1,&m6800_cpu_device::aba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,
-&m6800_cpu_device::bra, &m6800_cpu_device::brn, &m6800_cpu_device::bhi, &m6800_cpu_device::bls, &m6800_cpu_device::bcc, &m6800_cpu_device::bcs, &m6800_cpu_device::bne, &m6800_cpu_device::beq,
-&m6800_cpu_device::bvc, &m6800_cpu_device::bvs, &m6800_cpu_device::bpl, &m6800_cpu_device::bmi, &m6800_cpu_device::bge, &m6800_cpu_device::blt, &m6800_cpu_device::bgt, &m6800_cpu_device::ble,
-&m6800_cpu_device::tsx, &m6800_cpu_device::ins, &m6800_cpu_device::pula, &m6800_cpu_device::pulb, &m6800_cpu_device::des, &m6800_cpu_device::txs, &m6800_cpu_device::psha, &m6800_cpu_device::pshb,
-&m6800_cpu_device::illegl1,&m6800_cpu_device::rts, &m6800_cpu_device::illegl1,&m6800_cpu_device::rti, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::wai, &m6800_cpu_device::swi,
-&m6800_cpu_device::nega, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::coma, &m6800_cpu_device::lsra, &m6800_cpu_device::illegl1,&m6800_cpu_device::rora, &m6800_cpu_device::asra,
-&m6800_cpu_device::asla, &m6800_cpu_device::rola, &m6800_cpu_device::deca, &m6800_cpu_device::illegl1,&m6800_cpu_device::inca, &m6800_cpu_device::tsta, &m6800_cpu_device::illegl1,&m6800_cpu_device::clra,
-&m6800_cpu_device::negb, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::comb, &m6800_cpu_device::lsrb, &m6800_cpu_device::illegl1,&m6800_cpu_device::rorb, &m6800_cpu_device::asrb,
-&m6800_cpu_device::aslb, &m6800_cpu_device::rolb, &m6800_cpu_device::decb, &m6800_cpu_device::illegl1,&m6800_cpu_device::incb, &m6800_cpu_device::tstb, &m6800_cpu_device::illegl1,&m6800_cpu_device::clrb,
-&m6800_cpu_device::neg_ix, &m6800_cpu_device::illegl2,&m6800_cpu_device::illegl2,&m6800_cpu_device::com_ix, &m6800_cpu_device::lsr_ix, &m6800_cpu_device::illegl2,&m6800_cpu_device::ror_ix, &m6800_cpu_device::asr_ix,
-&m6800_cpu_device::asl_ix, &m6800_cpu_device::rol_ix, &m6800_cpu_device::dec_ix, &m6800_cpu_device::illegl2,&m6800_cpu_device::inc_ix, &m6800_cpu_device::tst_ix, &m6800_cpu_device::jmp_ix, &m6800_cpu_device::clr_ix,
-&m6800_cpu_device::neg_ex, &m6800_cpu_device::illegl3,&m6800_cpu_device::illegl3,&m6800_cpu_device::com_ex, &m6800_cpu_device::lsr_ex, &m6800_cpu_device::illegl3,&m6800_cpu_device::ror_ex, &m6800_cpu_device::asr_ex,
-&m6800_cpu_device::asl_ex, &m6800_cpu_device::rol_ex, &m6800_cpu_device::dec_ex, &m6800_cpu_device::illegl3,&m6800_cpu_device::inc_ex, &m6800_cpu_device::tst_ex, &m6800_cpu_device::jmp_ex, &m6800_cpu_device::clr_ex,
-&m6800_cpu_device::suba_im,&m6800_cpu_device::cmpa_im,&m6800_cpu_device::sbca_im,&m6800_cpu_device::illegl2,&m6800_cpu_device::anda_im,&m6800_cpu_device::bita_im,&m6800_cpu_device::lda_im, &m6800_cpu_device::sta_im,
-&m6800_cpu_device::eora_im,&m6800_cpu_device::adca_im,&m6800_cpu_device::ora_im, &m6800_cpu_device::adda_im,&m6800_cpu_device::cmpx_im,&m6800_cpu_device::bsr, &m6800_cpu_device::lds_im, &m6800_cpu_device::sts_im,
-&m6800_cpu_device::suba_di,&m6800_cpu_device::cmpa_di,&m6800_cpu_device::sbca_di,&m6800_cpu_device::illegl2,&m6800_cpu_device::anda_di,&m6800_cpu_device::bita_di,&m6800_cpu_device::lda_di, &m6800_cpu_device::sta_di,
-&m6800_cpu_device::eora_di,&m6800_cpu_device::adca_di,&m6800_cpu_device::ora_di, &m6800_cpu_device::adda_di,&m6800_cpu_device::cmpx_di,&m6800_cpu_device::jsr_di, &m6800_cpu_device::lds_di, &m6800_cpu_device::sts_di,
-&m6800_cpu_device::suba_ix,&m6800_cpu_device::cmpa_ix,&m6800_cpu_device::sbca_ix,&m6800_cpu_device::illegl2,&m6800_cpu_device::anda_ix,&m6800_cpu_device::bita_ix,&m6800_cpu_device::lda_ix, &m6800_cpu_device::sta_ix,
-&m6800_cpu_device::eora_ix,&m6800_cpu_device::adca_ix,&m6800_cpu_device::ora_ix, &m6800_cpu_device::adda_ix,&m6800_cpu_device::cmpx_ix,&m6800_cpu_device::jsr_ix, &m6800_cpu_device::lds_ix, &m6800_cpu_device::sts_ix,
-&m6800_cpu_device::suba_ex,&m6800_cpu_device::cmpa_ex,&m6800_cpu_device::sbca_ex,&m6800_cpu_device::illegl3,&m6800_cpu_device::anda_ex,&m6800_cpu_device::bita_ex,&m6800_cpu_device::lda_ex, &m6800_cpu_device::sta_ex,
-&m6800_cpu_device::eora_ex,&m6800_cpu_device::adca_ex,&m6800_cpu_device::ora_ex, &m6800_cpu_device::adda_ex,&m6800_cpu_device::cmpx_ex,&m6800_cpu_device::jsr_ex, &m6800_cpu_device::lds_ex, &m6800_cpu_device::sts_ex,
-&m6800_cpu_device::subb_im,&m6800_cpu_device::cmpb_im,&m6800_cpu_device::sbcb_im,&m6800_cpu_device::illegl2,&m6800_cpu_device::andb_im,&m6800_cpu_device::bitb_im,&m6800_cpu_device::ldb_im, &m6800_cpu_device::stb_im,
-&m6800_cpu_device::eorb_im,&m6800_cpu_device::adcb_im,&m6800_cpu_device::orb_im, &m6800_cpu_device::addb_im,&m6800_cpu_device::illegl3,&m6800_cpu_device::illegl3,&m6800_cpu_device::ldx_im, &m6800_cpu_device::stx_im,
-&m6800_cpu_device::subb_di,&m6800_cpu_device::cmpb_di,&m6800_cpu_device::sbcb_di,&m6800_cpu_device::illegl2,&m6800_cpu_device::andb_di,&m6800_cpu_device::bitb_di,&m6800_cpu_device::ldb_di, &m6800_cpu_device::stb_di,
-&m6800_cpu_device::eorb_di,&m6800_cpu_device::adcb_di,&m6800_cpu_device::orb_di, &m6800_cpu_device::addb_di,&m6800_cpu_device::illegl2,&m6800_cpu_device::illegl2,&m6800_cpu_device::ldx_di, &m6800_cpu_device::stx_di,
-&m6800_cpu_device::subb_ix,&m6800_cpu_device::cmpb_ix,&m6800_cpu_device::sbcb_ix,&m6800_cpu_device::illegl2,&m6800_cpu_device::andb_ix,&m6800_cpu_device::bitb_ix,&m6800_cpu_device::ldb_ix, &m6800_cpu_device::stb_ix,
-&m6800_cpu_device::eorb_ix,&m6800_cpu_device::adcb_ix,&m6800_cpu_device::orb_ix, &m6800_cpu_device::addb_ix,&m6800_cpu_device::illegl2,&m6800_cpu_device::illegl2,&m6800_cpu_device::ldx_ix, &m6800_cpu_device::stx_ix,
-&m6800_cpu_device::subb_ex,&m6800_cpu_device::cmpb_ex,&m6800_cpu_device::sbcb_ex,&m6800_cpu_device::illegl3,&m6800_cpu_device::andb_ex,&m6800_cpu_device::bitb_ex,&m6800_cpu_device::ldb_ex, &m6800_cpu_device::stb_ex,
-&m6800_cpu_device::eorb_ex,&m6800_cpu_device::adcb_ex,&m6800_cpu_device::orb_ex, &m6800_cpu_device::addb_ex,&m6800_cpu_device::illegl3,&m6800_cpu_device::illegl3,&m6800_cpu_device::ldx_ex, &m6800_cpu_device::stx_ex
-};
-
-const m6800_cpu_device::op_func m6800_cpu_device::nsc8105_insn[0x100] = {
-// 0
-&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::nop, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tap, &m6800_cpu_device::illegl1,&m6800_cpu_device::tpa,
-// 8
-&m6800_cpu_device::inx, &m6800_cpu_device::clv, &m6800_cpu_device::dex, &m6800_cpu_device::sev, &m6800_cpu_device::clc, &m6800_cpu_device::cli, &m6800_cpu_device::sec, &m6800_cpu_device::sei,
-// 10
-&m6800_cpu_device::sba, &m6800_cpu_device::illegl1,&m6800_cpu_device::cba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tab, &m6800_cpu_device::illegl1,&m6800_cpu_device::tba,
-// 18
-&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::daa, &m6800_cpu_device::aba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,
-// 20
-&m6800_cpu_device::bra, &m6800_cpu_device::bhi, &m6800_cpu_device::brn, &m6800_cpu_device::bls, &m6800_cpu_device::bcc, &m6800_cpu_device::bne, &m6800_cpu_device::bcs, &m6800_cpu_device::beq,
-// 28
-&m6800_cpu_device::bvc, &m6800_cpu_device::bpl, &m6800_cpu_device::bvs, &m6800_cpu_device::bmi, &m6800_cpu_device::bge, &m6800_cpu_device::bgt, &m6800_cpu_device::blt, &m6800_cpu_device::ble,
-// 30
-&m6800_cpu_device::tsx, &m6800_cpu_device::pula, &m6800_cpu_device::ins, &m6800_cpu_device::pulb, &m6800_cpu_device::des, &m6800_cpu_device::psha, &m6800_cpu_device::txs, &m6800_cpu_device::pshb,
-// 38
-&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::rts, &m6800_cpu_device::rti, &m6800_cpu_device::illegl1,&m6800_cpu_device::wai, &m6800_cpu_device::illegl1,&m6800_cpu_device::swi,
-// 40
-&m6800_cpu_device::suba_im,&m6800_cpu_device::sbca_im,&m6800_cpu_device::cmpa_im,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_im,&m6800_cpu_device::lda_im, &m6800_cpu_device::bita_im,&m6800_cpu_device::sta_im,
-// 48
-&m6800_cpu_device::eora_im,&m6800_cpu_device::ora_im, &m6800_cpu_device::adca_im,&m6800_cpu_device::adda_im,&m6800_cpu_device::cmpx_im,&m6800_cpu_device::lds_im, &m6800_cpu_device::bsr, &m6800_cpu_device::sts_im,
-// 50
-&m6800_cpu_device::suba_di,&m6800_cpu_device::sbca_di,&m6800_cpu_device::cmpa_di,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_di,&m6800_cpu_device::lda_di, &m6800_cpu_device::bita_di,&m6800_cpu_device::sta_di,
-// 58
-&m6800_cpu_device::eora_di,&m6800_cpu_device::ora_di, &m6800_cpu_device::adca_di,&m6800_cpu_device::adda_di,&m6800_cpu_device::cmpx_di,&m6800_cpu_device::lds_di, &m6800_cpu_device::jsr_di, &m6800_cpu_device::sts_di,
-// 60
-&m6800_cpu_device::suba_ix,&m6800_cpu_device::sbca_ix,&m6800_cpu_device::cmpa_ix,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_ix,&m6800_cpu_device::lda_ix, &m6800_cpu_device::bita_ix,&m6800_cpu_device::sta_ix,
-// 68
-&m6800_cpu_device::eora_ix,&m6800_cpu_device::ora_ix, &m6800_cpu_device::adca_ix,&m6800_cpu_device::adda_ix,&m6800_cpu_device::cmpx_ix,&m6800_cpu_device::lds_ix, &m6800_cpu_device::jsr_ix, &m6800_cpu_device::sts_ix,
-// 70
-&m6800_cpu_device::suba_ex,&m6800_cpu_device::sbca_ex,&m6800_cpu_device::cmpa_ex,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_ex,&m6800_cpu_device::lda_ex, &m6800_cpu_device::bita_ex,&m6800_cpu_device::sta_ex,
-// 78
-&m6800_cpu_device::eora_ex,&m6800_cpu_device::ora_ex, &m6800_cpu_device::adca_ex,&m6800_cpu_device::adda_ex,&m6800_cpu_device::cmpx_ex,&m6800_cpu_device::lds_ex, &m6800_cpu_device::jsr_ex, &m6800_cpu_device::sts_ex,
-// 80
-&m6800_cpu_device::nega, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::coma, &m6800_cpu_device::lsra, &m6800_cpu_device::rora, &m6800_cpu_device::illegl1,&m6800_cpu_device::asra,
-// 88
-&m6800_cpu_device::asla, &m6800_cpu_device::deca, &m6800_cpu_device::rola, &m6800_cpu_device::illegl1,&m6800_cpu_device::inca, &m6800_cpu_device::illegl1,&m6800_cpu_device::tsta, &m6800_cpu_device::clra,
-// 90
-&m6800_cpu_device::negb, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::comb, &m6800_cpu_device::lsrb, &m6800_cpu_device::rorb, &m6800_cpu_device::illegl1,&m6800_cpu_device::asrb,
-// 98
-&m6800_cpu_device::aslb, &m6800_cpu_device::decb, &m6800_cpu_device::rolb, &m6800_cpu_device::illegl1,&m6800_cpu_device::incb, &m6800_cpu_device::illegl1,&m6800_cpu_device::tstb, &m6800_cpu_device::clrb,
-// a0
-&m6800_cpu_device::neg_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::com_ix, &m6800_cpu_device::lsr_ix, &m6800_cpu_device::ror_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::asr_ix,
-// a8
-&m6800_cpu_device::asl_ix, &m6800_cpu_device::dec_ix, &m6800_cpu_device::rol_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::inc_ix, &m6800_cpu_device::jmp_ix, &m6800_cpu_device::tst_ix, &m6800_cpu_device::clr_ix,
-// b0
-&m6800_cpu_device::neg_ex, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_nsc,&m6800_cpu_device::com_ex, &m6800_cpu_device::lsr_ex, &m6800_cpu_device::ror_ex, &m6800_cpu_device::illegl1,&m6800_cpu_device::asr_ex,
-// b8
-&m6800_cpu_device::asl_ex, &m6800_cpu_device::dec_ex, &m6800_cpu_device::rol_ex, &m6800_cpu_device::btst_ix,&m6800_cpu_device::inc_ex, &m6800_cpu_device::jmp_ex, &m6800_cpu_device::tst_ex, &m6800_cpu_device::clr_ex,
-&m6800_cpu_device::subb_im,&m6800_cpu_device::sbcb_im,&m6800_cpu_device::cmpb_im,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_im,&m6800_cpu_device::ldb_im, &m6800_cpu_device::bitb_im,&m6800_cpu_device::stb_im,
-&m6800_cpu_device::eorb_im,&m6800_cpu_device::orb_im, &m6800_cpu_device::adcb_im,&m6800_cpu_device::addb_im,&m6800_cpu_device::illegl1,&m6800_cpu_device::ldx_im, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_im,
-&m6800_cpu_device::subb_di,&m6800_cpu_device::sbcb_di,&m6800_cpu_device::cmpb_di,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_di,&m6800_cpu_device::ldb_di, &m6800_cpu_device::bitb_di,&m6800_cpu_device::stb_di,
-&m6800_cpu_device::eorb_di,&m6800_cpu_device::orb_di, &m6800_cpu_device::adcb_di,&m6800_cpu_device::addb_di,&m6800_cpu_device::illegl1,&m6800_cpu_device::ldx_di, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_di,
-&m6800_cpu_device::subb_ix,&m6800_cpu_device::sbcb_ix,&m6800_cpu_device::cmpb_ix,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_ix,&m6800_cpu_device::ldb_ix, &m6800_cpu_device::bitb_ix,&m6800_cpu_device::stb_ix,
-&m6800_cpu_device::eorb_ix,&m6800_cpu_device::orb_ix, &m6800_cpu_device::adcb_ix,&m6800_cpu_device::addb_ix,&m6800_cpu_device::adcx_im,&m6800_cpu_device::ldx_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_ix,
-&m6800_cpu_device::subb_ex,&m6800_cpu_device::sbcb_ex,&m6800_cpu_device::cmpb_ex,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_ex,&m6800_cpu_device::ldb_ex, &m6800_cpu_device::bitb_ex,&m6800_cpu_device::stb_ex,
-&m6800_cpu_device::eorb_ex,&m6800_cpu_device::orb_ex, &m6800_cpu_device::adcb_ex,&m6800_cpu_device::addb_ex,&m6800_cpu_device::addx_ex,&m6800_cpu_device::ldx_ex, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_ex
-};
diff --git a/src/devices/cpu/m6800/m6800.cpp b/src/devices/cpu/m6800/m6800.cpp
index ca09ef1c6b2..e6549dd8d27 100644
--- a/src/devices/cpu/m6800/m6800.cpp
+++ b/src/devices/cpu/m6800/m6800.cpp
@@ -276,6 +276,9 @@ const uint8_t m6800_cpu_device::flags8d[256]= /* decrement */
#define NXORV ((CC&0x08)^((CC&0x02)<<2))
#define NXORC ((CC&0x08)^((CC&0x01)<<3))
+/* include the opcode functions */
+#include "6800ops.hxx"
+
/* Note: don't use 0 cycles here for invalid opcodes so that we don't */
/* hang in an infinite loop if we hit one */
#define XX 5 // invalid opcode unknown cc
@@ -323,6 +326,77 @@ const uint8_t m6800_cpu_device::cycles_nsc8105[256] =
#undef XX // /invalid opcode unknown cc
+const m6800_cpu_device::op_func m6800_cpu_device::m6800_insn[0x100] = {
+&m6800_cpu_device::illegl1,&m6800_cpu_device::nop, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tap, &m6800_cpu_device::tpa,
+&m6800_cpu_device::inx, &m6800_cpu_device::dex, &m6800_cpu_device::clv, &m6800_cpu_device::sev, &m6800_cpu_device::clc, &m6800_cpu_device::sec, &m6800_cpu_device::cli, &m6800_cpu_device::sei,
+&m6800_cpu_device::sba, &m6800_cpu_device::cba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tab, &m6800_cpu_device::tba,
+&m6800_cpu_device::illegl1,&m6800_cpu_device::daa, &m6800_cpu_device::illegl1,&m6800_cpu_device::aba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,
+&m6800_cpu_device::bra, &m6800_cpu_device::brn, &m6800_cpu_device::bhi, &m6800_cpu_device::bls, &m6800_cpu_device::bcc, &m6800_cpu_device::bcs, &m6800_cpu_device::bne, &m6800_cpu_device::beq,
+&m6800_cpu_device::bvc, &m6800_cpu_device::bvs, &m6800_cpu_device::bpl, &m6800_cpu_device::bmi, &m6800_cpu_device::bge, &m6800_cpu_device::blt, &m6800_cpu_device::bgt, &m6800_cpu_device::ble,
+&m6800_cpu_device::tsx, &m6800_cpu_device::ins, &m6800_cpu_device::pula, &m6800_cpu_device::pulb, &m6800_cpu_device::des, &m6800_cpu_device::txs, &m6800_cpu_device::psha, &m6800_cpu_device::pshb,
+&m6800_cpu_device::illegl1,&m6800_cpu_device::rts, &m6800_cpu_device::illegl1,&m6800_cpu_device::rti, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::wai, &m6800_cpu_device::swi,
+&m6800_cpu_device::nega, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::coma, &m6800_cpu_device::lsra, &m6800_cpu_device::illegl1,&m6800_cpu_device::rora, &m6800_cpu_device::asra,
+&m6800_cpu_device::asla, &m6800_cpu_device::rola, &m6800_cpu_device::deca, &m6800_cpu_device::illegl1,&m6800_cpu_device::inca, &m6800_cpu_device::tsta, &m6800_cpu_device::illegl1,&m6800_cpu_device::clra,
+&m6800_cpu_device::negb, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::comb, &m6800_cpu_device::lsrb, &m6800_cpu_device::illegl1,&m6800_cpu_device::rorb, &m6800_cpu_device::asrb,
+&m6800_cpu_device::aslb, &m6800_cpu_device::rolb, &m6800_cpu_device::decb, &m6800_cpu_device::illegl1,&m6800_cpu_device::incb, &m6800_cpu_device::tstb, &m6800_cpu_device::illegl1,&m6800_cpu_device::clrb,
+&m6800_cpu_device::neg_ix, &m6800_cpu_device::illegl2,&m6800_cpu_device::illegl2,&m6800_cpu_device::com_ix, &m6800_cpu_device::lsr_ix, &m6800_cpu_device::illegl2,&m6800_cpu_device::ror_ix, &m6800_cpu_device::asr_ix,
+&m6800_cpu_device::asl_ix, &m6800_cpu_device::rol_ix, &m6800_cpu_device::dec_ix, &m6800_cpu_device::illegl2,&m6800_cpu_device::inc_ix, &m6800_cpu_device::tst_ix, &m6800_cpu_device::jmp_ix, &m6800_cpu_device::clr_ix,
+&m6800_cpu_device::neg_ex, &m6800_cpu_device::illegl3,&m6800_cpu_device::illegl3,&m6800_cpu_device::com_ex, &m6800_cpu_device::lsr_ex, &m6800_cpu_device::illegl3,&m6800_cpu_device::ror_ex, &m6800_cpu_device::asr_ex,
+&m6800_cpu_device::asl_ex, &m6800_cpu_device::rol_ex, &m6800_cpu_device::dec_ex, &m6800_cpu_device::illegl3,&m6800_cpu_device::inc_ex, &m6800_cpu_device::tst_ex, &m6800_cpu_device::jmp_ex, &m6800_cpu_device::clr_ex,
+&m6800_cpu_device::suba_im,&m6800_cpu_device::cmpa_im,&m6800_cpu_device::sbca_im,&m6800_cpu_device::illegl2,&m6800_cpu_device::anda_im,&m6800_cpu_device::bita_im,&m6800_cpu_device::lda_im, &m6800_cpu_device::sta_im,
+&m6800_cpu_device::eora_im,&m6800_cpu_device::adca_im,&m6800_cpu_device::ora_im, &m6800_cpu_device::adda_im,&m6800_cpu_device::cmpx_im,&m6800_cpu_device::bsr, &m6800_cpu_device::lds_im, &m6800_cpu_device::sts_im,
+&m6800_cpu_device::suba_di,&m6800_cpu_device::cmpa_di,&m6800_cpu_device::sbca_di,&m6800_cpu_device::illegl2,&m6800_cpu_device::anda_di,&m6800_cpu_device::bita_di,&m6800_cpu_device::lda_di, &m6800_cpu_device::sta_di,
+&m6800_cpu_device::eora_di,&m6800_cpu_device::adca_di,&m6800_cpu_device::ora_di, &m6800_cpu_device::adda_di,&m6800_cpu_device::cmpx_di,&m6800_cpu_device::jsr_di, &m6800_cpu_device::lds_di, &m6800_cpu_device::sts_di,
+&m6800_cpu_device::suba_ix,&m6800_cpu_device::cmpa_ix,&m6800_cpu_device::sbca_ix,&m6800_cpu_device::illegl2,&m6800_cpu_device::anda_ix,&m6800_cpu_device::bita_ix,&m6800_cpu_device::lda_ix, &m6800_cpu_device::sta_ix,
+&m6800_cpu_device::eora_ix,&m6800_cpu_device::adca_ix,&m6800_cpu_device::ora_ix, &m6800_cpu_device::adda_ix,&m6800_cpu_device::cmpx_ix,&m6800_cpu_device::jsr_ix, &m6800_cpu_device::lds_ix, &m6800_cpu_device::sts_ix,
+&m6800_cpu_device::suba_ex,&m6800_cpu_device::cmpa_ex,&m6800_cpu_device::sbca_ex,&m6800_cpu_device::illegl3,&m6800_cpu_device::anda_ex,&m6800_cpu_device::bita_ex,&m6800_cpu_device::lda_ex, &m6800_cpu_device::sta_ex,
+&m6800_cpu_device::eora_ex,&m6800_cpu_device::adca_ex,&m6800_cpu_device::ora_ex, &m6800_cpu_device::adda_ex,&m6800_cpu_device::cmpx_ex,&m6800_cpu_device::jsr_ex, &m6800_cpu_device::lds_ex, &m6800_cpu_device::sts_ex,
+&m6800_cpu_device::subb_im,&m6800_cpu_device::cmpb_im,&m6800_cpu_device::sbcb_im,&m6800_cpu_device::illegl2,&m6800_cpu_device::andb_im,&m6800_cpu_device::bitb_im,&m6800_cpu_device::ldb_im, &m6800_cpu_device::stb_im,
+&m6800_cpu_device::eorb_im,&m6800_cpu_device::adcb_im,&m6800_cpu_device::orb_im, &m6800_cpu_device::addb_im,&m6800_cpu_device::illegl3,&m6800_cpu_device::illegl3,&m6800_cpu_device::ldx_im, &m6800_cpu_device::stx_im,
+&m6800_cpu_device::subb_di,&m6800_cpu_device::cmpb_di,&m6800_cpu_device::sbcb_di,&m6800_cpu_device::illegl2,&m6800_cpu_device::andb_di,&m6800_cpu_device::bitb_di,&m6800_cpu_device::ldb_di, &m6800_cpu_device::stb_di,
+&m6800_cpu_device::eorb_di,&m6800_cpu_device::adcb_di,&m6800_cpu_device::orb_di, &m6800_cpu_device::addb_di,&m6800_cpu_device::illegl2,&m6800_cpu_device::illegl2,&m6800_cpu_device::ldx_di, &m6800_cpu_device::stx_di,
+&m6800_cpu_device::subb_ix,&m6800_cpu_device::cmpb_ix,&m6800_cpu_device::sbcb_ix,&m6800_cpu_device::illegl2,&m6800_cpu_device::andb_ix,&m6800_cpu_device::bitb_ix,&m6800_cpu_device::ldb_ix, &m6800_cpu_device::stb_ix,
+&m6800_cpu_device::eorb_ix,&m6800_cpu_device::adcb_ix,&m6800_cpu_device::orb_ix, &m6800_cpu_device::addb_ix,&m6800_cpu_device::illegl2,&m6800_cpu_device::illegl2,&m6800_cpu_device::ldx_ix, &m6800_cpu_device::stx_ix,
+&m6800_cpu_device::subb_ex,&m6800_cpu_device::cmpb_ex,&m6800_cpu_device::sbcb_ex,&m6800_cpu_device::illegl3,&m6800_cpu_device::andb_ex,&m6800_cpu_device::bitb_ex,&m6800_cpu_device::ldb_ex, &m6800_cpu_device::stb_ex,
+&m6800_cpu_device::eorb_ex,&m6800_cpu_device::adcb_ex,&m6800_cpu_device::orb_ex, &m6800_cpu_device::addb_ex,&m6800_cpu_device::illegl3,&m6800_cpu_device::illegl3,&m6800_cpu_device::ldx_ex, &m6800_cpu_device::stx_ex
+};
+
+const m6800_cpu_device::op_func m6800_cpu_device::nsc8105_insn[0x100] = {
+&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::nop, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tap, &m6800_cpu_device::illegl1,&m6800_cpu_device::tpa,
+&m6800_cpu_device::inx, &m6800_cpu_device::clv, &m6800_cpu_device::dex, &m6800_cpu_device::sev, &m6800_cpu_device::clc, &m6800_cpu_device::cli, &m6800_cpu_device::sec, &m6800_cpu_device::sei,
+&m6800_cpu_device::sba, &m6800_cpu_device::illegl1,&m6800_cpu_device::cba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::tab, &m6800_cpu_device::illegl1,&m6800_cpu_device::tba,
+&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::daa, &m6800_cpu_device::aba, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,
+&m6800_cpu_device::bra, &m6800_cpu_device::bhi, &m6800_cpu_device::brn, &m6800_cpu_device::bls, &m6800_cpu_device::bcc, &m6800_cpu_device::bne, &m6800_cpu_device::bcs, &m6800_cpu_device::beq,
+&m6800_cpu_device::bvc, &m6800_cpu_device::bpl, &m6800_cpu_device::bvs, &m6800_cpu_device::bmi, &m6800_cpu_device::bge, &m6800_cpu_device::bgt, &m6800_cpu_device::blt, &m6800_cpu_device::ble,
+&m6800_cpu_device::tsx, &m6800_cpu_device::pula, &m6800_cpu_device::ins, &m6800_cpu_device::pulb, &m6800_cpu_device::des, &m6800_cpu_device::psha, &m6800_cpu_device::txs, &m6800_cpu_device::pshb,
+&m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::rts, &m6800_cpu_device::rti, &m6800_cpu_device::illegl1,&m6800_cpu_device::wai, &m6800_cpu_device::illegl1,&m6800_cpu_device::swi,
+&m6800_cpu_device::suba_im,&m6800_cpu_device::sbca_im,&m6800_cpu_device::cmpa_im,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_im,&m6800_cpu_device::lda_im, &m6800_cpu_device::bita_im,&m6800_cpu_device::sta_im,
+&m6800_cpu_device::eora_im,&m6800_cpu_device::ora_im, &m6800_cpu_device::adca_im,&m6800_cpu_device::adda_im,&m6800_cpu_device::cmpx_im,&m6800_cpu_device::lds_im, &m6800_cpu_device::bsr, &m6800_cpu_device::sts_im,
+&m6800_cpu_device::suba_di,&m6800_cpu_device::sbca_di,&m6800_cpu_device::cmpa_di,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_di,&m6800_cpu_device::lda_di, &m6800_cpu_device::bita_di,&m6800_cpu_device::sta_di,
+&m6800_cpu_device::eora_di,&m6800_cpu_device::ora_di, &m6800_cpu_device::adca_di,&m6800_cpu_device::adda_di,&m6800_cpu_device::cmpx_di,&m6800_cpu_device::lds_di, &m6800_cpu_device::jsr_di, &m6800_cpu_device::sts_di,
+&m6800_cpu_device::suba_ix,&m6800_cpu_device::sbca_ix,&m6800_cpu_device::cmpa_ix,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_ix,&m6800_cpu_device::lda_ix, &m6800_cpu_device::bita_ix,&m6800_cpu_device::sta_ix,
+&m6800_cpu_device::eora_ix,&m6800_cpu_device::ora_ix, &m6800_cpu_device::adca_ix,&m6800_cpu_device::adda_ix,&m6800_cpu_device::cmpx_ix,&m6800_cpu_device::lds_ix, &m6800_cpu_device::jsr_ix, &m6800_cpu_device::sts_ix,
+&m6800_cpu_device::suba_ex,&m6800_cpu_device::sbca_ex,&m6800_cpu_device::cmpa_ex,&m6800_cpu_device::illegl1,&m6800_cpu_device::anda_ex,&m6800_cpu_device::lda_ex, &m6800_cpu_device::bita_ex,&m6800_cpu_device::sta_ex,
+&m6800_cpu_device::eora_ex,&m6800_cpu_device::ora_ex, &m6800_cpu_device::adca_ex,&m6800_cpu_device::adda_ex,&m6800_cpu_device::cmpx_ex,&m6800_cpu_device::lds_ex, &m6800_cpu_device::jsr_ex, &m6800_cpu_device::sts_ex,
+&m6800_cpu_device::nega, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::coma, &m6800_cpu_device::lsra, &m6800_cpu_device::rora, &m6800_cpu_device::illegl1,&m6800_cpu_device::asra,
+&m6800_cpu_device::asla, &m6800_cpu_device::deca, &m6800_cpu_device::rola, &m6800_cpu_device::illegl1,&m6800_cpu_device::inca, &m6800_cpu_device::illegl1,&m6800_cpu_device::tsta, &m6800_cpu_device::clra,
+&m6800_cpu_device::negb, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::comb, &m6800_cpu_device::lsrb, &m6800_cpu_device::rorb, &m6800_cpu_device::illegl1,&m6800_cpu_device::asrb,
+&m6800_cpu_device::aslb, &m6800_cpu_device::decb, &m6800_cpu_device::rolb, &m6800_cpu_device::illegl1,&m6800_cpu_device::incb, &m6800_cpu_device::illegl1,&m6800_cpu_device::tstb, &m6800_cpu_device::clrb,
+&m6800_cpu_device::neg_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::illegl1,&m6800_cpu_device::com_ix, &m6800_cpu_device::lsr_ix, &m6800_cpu_device::ror_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::asr_ix,
+&m6800_cpu_device::asl_ix, &m6800_cpu_device::dec_ix, &m6800_cpu_device::rol_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::inc_ix, &m6800_cpu_device::jmp_ix, &m6800_cpu_device::tst_ix, &m6800_cpu_device::clr_ix,
+&m6800_cpu_device::neg_ex, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_nsc,&m6800_cpu_device::com_ex, &m6800_cpu_device::lsr_ex, &m6800_cpu_device::ror_ex, &m6800_cpu_device::illegl1,&m6800_cpu_device::asr_ex,
+&m6800_cpu_device::asl_ex, &m6800_cpu_device::dec_ex, &m6800_cpu_device::rol_ex, &m6800_cpu_device::btst_ix,&m6800_cpu_device::inc_ex, &m6800_cpu_device::jmp_ex, &m6800_cpu_device::tst_ex, &m6800_cpu_device::clr_ex,
+&m6800_cpu_device::subb_im,&m6800_cpu_device::sbcb_im,&m6800_cpu_device::cmpb_im,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_im,&m6800_cpu_device::ldb_im, &m6800_cpu_device::bitb_im,&m6800_cpu_device::stb_im,
+&m6800_cpu_device::eorb_im,&m6800_cpu_device::orb_im, &m6800_cpu_device::adcb_im,&m6800_cpu_device::addb_im,&m6800_cpu_device::illegl1,&m6800_cpu_device::ldx_im, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_im,
+&m6800_cpu_device::subb_di,&m6800_cpu_device::sbcb_di,&m6800_cpu_device::cmpb_di,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_di,&m6800_cpu_device::ldb_di, &m6800_cpu_device::bitb_di,&m6800_cpu_device::stb_di,
+&m6800_cpu_device::eorb_di,&m6800_cpu_device::orb_di, &m6800_cpu_device::adcb_di,&m6800_cpu_device::addb_di,&m6800_cpu_device::illegl1,&m6800_cpu_device::ldx_di, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_di,
+&m6800_cpu_device::subb_ix,&m6800_cpu_device::sbcb_ix,&m6800_cpu_device::cmpb_ix,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_ix,&m6800_cpu_device::ldb_ix, &m6800_cpu_device::bitb_ix,&m6800_cpu_device::stb_ix,
+&m6800_cpu_device::eorb_ix,&m6800_cpu_device::orb_ix, &m6800_cpu_device::adcb_ix,&m6800_cpu_device::addb_ix,&m6800_cpu_device::adcx_im,&m6800_cpu_device::ldx_ix, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_ix,
+&m6800_cpu_device::subb_ex,&m6800_cpu_device::sbcb_ex,&m6800_cpu_device::cmpb_ex,&m6800_cpu_device::illegl1,&m6800_cpu_device::andb_ex,&m6800_cpu_device::ldb_ex, &m6800_cpu_device::bitb_ex,&m6800_cpu_device::stb_ex,
+&m6800_cpu_device::eorb_ex,&m6800_cpu_device::orb_ex, &m6800_cpu_device::adcb_ex,&m6800_cpu_device::addb_ex,&m6800_cpu_device::addx_ex,&m6800_cpu_device::ldx_ex, &m6800_cpu_device::illegl1,&m6800_cpu_device::stx_ex
+};
+
+
DEFINE_DEVICE_TYPE(M6800, m6800_cpu_device, "m6800", "Motorola MC6800")
DEFINE_DEVICE_TYPE(M6802, m6802_cpu_device, "m6802", "Motorola MC6802")
DEFINE_DEVICE_TYPE(M6808, m6808_cpu_device, "m6808", "Motorola MC6808")
@@ -469,12 +543,6 @@ void m6800_cpu_device::EAT_CYCLES()
increment_counter(m_icount);
}
-/* include the opcode prototypes and function pointer tables */
-#include "6800tbl.hxx"
-
-/* include the opcode functions */
-#include "6800ops.hxx"
-
void m6800_cpu_device::device_start()
{
diff --git a/src/devices/cpu/tms1000/tms0980.cpp b/src/devices/cpu/tms1000/tms0980.cpp
index 8521505d585..76d295717e7 100644
--- a/src/devices/cpu/tms1000/tms0980.cpp
+++ b/src/devices/cpu/tms1000/tms0980.cpp
@@ -139,7 +139,7 @@ void tms0980_cpu_device::device_reset()
m_fixed_decode[op] = (op & 0x80) ? F_CALL: F_BR;
// 6 output bits select a microinstruction index
- m_micro_decode[op] = decode_micro(m_ipla->read(op) & 0x3f);
+ m_micro_decode[op] = m_decode_micro.isnull() ? decode_micro(m_ipla->read(op) & 0x3f) : m_decode_micro(op);
// the other ipla terms each select a fixed instruction
m_fixed_decode[op] |= decode_fixed(op);
@@ -151,7 +151,7 @@ void tms0980_cpu_device::device_reset()
memset(&m_micro_decode[0], 0, 0x40*sizeof(u32));
for (int op = 0; op < 0x40; op++)
- m_micro_direct[op] = decode_micro(op);
+ m_micro_direct[op] = m_decode_micro.isnull() ? decode_micro(op) : m_decode_micro(op + 0x200);
}
diff --git a/src/devices/cpu/tms1000/tms1000.cpp b/src/devices/cpu/tms1000/tms1000.cpp
index f99aacc637f..4ffefd7ef91 100644
--- a/src/devices/cpu/tms1000/tms1000.cpp
+++ b/src/devices/cpu/tms1000/tms1000.cpp
@@ -151,7 +151,7 @@ void tms1000_cpu_device::device_reset()
// decode microinstructions
for (int op = 0; op < 0x100; op++)
- m_micro_decode[op] = decode_micro(op);
+ m_micro_decode[op] = m_decode_micro.isnull() ? decode_micro(op) : m_decode_micro(op);
// the fixed instruction set is not programmable
m_fixed_decode[0x00] = F_COMX;
diff --git a/src/devices/cpu/tms1000/tms1k_base.cpp b/src/devices/cpu/tms1000/tms1k_base.cpp
index f669a349662..6dbbaed3b60 100644
--- a/src/devices/cpu/tms1000/tms1k_base.cpp
+++ b/src/devices/cpu/tms1000/tms1k_base.cpp
@@ -94,6 +94,7 @@ tms1k_base_device::tms1k_base_device(const machine_config &mconfig, device_type
, m_read_ctl(*this)
, m_write_ctl(*this)
, m_write_pdc(*this)
+ , m_decode_micro(*this)
{
}
@@ -138,6 +139,7 @@ void tms1k_base_device::device_start()
m_read_ctl.resolve_safe(0);
m_write_ctl.resolve_safe();
m_write_pdc.resolve_safe();
+ m_decode_micro.resolve();
if (m_opla_b != nullptr && m_output_pla_table == nullptr)
set_output_pla(&m_opla_b->as_u16());
diff --git a/src/devices/cpu/tms1000/tms1k_base.h b/src/devices/cpu/tms1000/tms1k_base.h
index b4c8df9ed43..e535e9322c9 100644
--- a/src/devices/cpu/tms1000/tms1k_base.h
+++ b/src/devices/cpu/tms1000/tms1k_base.h
@@ -83,9 +83,12 @@ public:
auto write_pdc() { return m_write_pdc.bind(); }
// Use this if the output PLA is unknown:
- // If the microinstructions (or other) PLA is unknown, try using one from another romset.
void set_output_pla(const u16 *output_pla) { m_output_pla_table = output_pla; }
+ // If the microinstructions PLA is unknown, try using one from another romset.
+ // If that's not possible, use this callback:
+ auto set_decode_micro() { return m_decode_micro.bind(); }
+
u8 debug_peek_o_index() { return m_o_index; } // get output PLA index, for debugging (don't use in emulation)
protected:
@@ -266,6 +269,7 @@ protected:
devcb_read8 m_read_ctl;
devcb_write8 m_write_ctl;
devcb_write_line m_write_pdc;
+ devcb_read32 m_decode_micro;
u32 m_o_mask;
u32 m_r_mask;
diff --git a/src/devices/cpu/upd177x/upd177xd.cpp b/src/devices/cpu/upd177x/upd177xd.cpp
index 5e855ff5c09..d3ec79e84c7 100644
--- a/src/devices/cpu/upd177x/upd177xd.cpp
+++ b/src/devices/cpu/upd177x/upd177xd.cpp
@@ -151,14 +151,14 @@ const upd177x_disassembler::instruction upd177x_disassembler::instructions[] {
{ 0x9c00, 0xff00, [](P) -> u32 { util::stream_format(stream, "tsbic a, %s", imm8(opcode)); return 1; } },
{ 0x9e00, 0xff00, [](P) -> u32 { util::stream_format(stream, "tsbiz a, %s", imm8(opcode)); return 1; } },
- { 0x8100, 0xff00, [](P) -> u32 { util::stream_format(stream, "adi mdi, %s", imm8(opcode)); return 1; } },
- { 0x8300, 0xff00, [](P) -> u32 { util::stream_format(stream, "andi mdi, %s", imm8(opcode)); return 1; } },
- { 0x8500, 0xff00, [](P) -> u32 { util::stream_format(stream, "sbi mdi, %s", imm8(opcode)); return 1; } },
- { 0x8700, 0xff00, [](P) -> u32 { util::stream_format(stream, "ori mdi, %s", imm8(opcode)); return 1; } },
- { 0x8900, 0xff00, [](P) -> u32 { util::stream_format(stream, "adis mdi, %s", imm8(opcode)); return 1; } },
- { 0x8b00, 0xff00, [](P) -> u32 { util::stream_format(stream, "andis mdi, %s", imm8(opcode)); return 1; } },
- { 0x8d00, 0xff00, [](P) -> u32 { util::stream_format(stream, "sbis mdi, %s", imm8(opcode)); return 1; } },
- { 0x8f00, 0xff00, [](P) -> u32 { util::stream_format(stream, "xori mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8100, 0xff1f, [](P) -> u32 { util::stream_format(stream, "adi mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8300, 0xff1f, [](P) -> u32 { util::stream_format(stream, "andi mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8500, 0xff1f, [](P) -> u32 { util::stream_format(stream, "sbi mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8700, 0xff1f, [](P) -> u32 { util::stream_format(stream, "ori mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8900, 0xff1f, [](P) -> u32 { util::stream_format(stream, "adis mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8b00, 0xff1f, [](P) -> u32 { util::stream_format(stream, "andis mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8d00, 0xff1f, [](P) -> u32 { util::stream_format(stream, "sbis mdi, %s", imm8(opcode)); return 1; } },
+ { 0x8f00, 0xff1f, [](P) -> u32 { util::stream_format(stream, "xori mdi, %s", imm8(opcode)); return 1; } },
{ 0x9100, 0xff00, [](P) -> u32 { util::stream_format(stream, "tadinc md, %s", imm8(opcode)); return 1; } },
{ 0x9300, 0xff00, [](P) -> u32 { util::stream_format(stream, "tandinz md, %s", imm8(opcode)); return 1; } },
{ 0x9500, 0xff00, [](P) -> u32 { util::stream_format(stream, "tsbinc md, %s", imm8(opcode)); return 1; } },
diff --git a/src/devices/machine/74161.cpp b/src/devices/machine/74161.cpp
index 015e4dba6bd..64e935152f5 100644
--- a/src/devices/machine/74161.cpp
+++ b/src/devices/machine/74161.cpp
@@ -28,8 +28,9 @@ ttl7416x_device::ttl7416x_device(const machine_config &mconfig, device_type type
, m_cep(0)
, m_pclock(0)
, m_p(0)
+ , m_cetpre(0)
+ , m_ceppre(0)
, m_out(0)
- , m_tc(0)
, m_synchronous_reset(synchronous_reset)
, m_limit(limit)
{
@@ -64,7 +65,6 @@ void ttl7416x_device::device_start()
save_item(NAME(m_pclock));
save_item(NAME(m_p));
save_item(NAME(m_out));
- save_item(NAME(m_tc));
m_output_func.resolve_safe();
m_tc_func.resolve_safe();
@@ -79,15 +79,12 @@ void ttl7416x_device::init()
{
m_clear = 0;
m_pe = 1;
- m_cet = 0;
- m_cep = 0;
+ m_cet = m_cetpre;
+ m_cep = m_ceppre;
m_pclock = 0;
m_p = 0;
m_out = 0;
- m_tc = 0;
-
- m_tc = 0;
}
void ttl7416x_device::tick()
@@ -99,7 +96,7 @@ void ttl7416x_device::tick()
}
uint8_t last_out = m_out;
- uint8_t last_tc = m_tc;
+ uint8_t last_tc = tc_r();
if (m_pe)
{
@@ -118,20 +115,30 @@ void ttl7416x_device::tick()
m_output_func(m_out);
}
- if (m_tc != last_tc)
+ if (tc_r() != last_tc)
{
- m_tc_func(m_tc);
+ m_tc_func(tc_r());
}
}
+/*
+ State machine:
+ limit 16: 0->1->2->...->e->f(tc)->0
+ limit 10: 0->1->2->...->9(tc)->0
+ 10->11->4(no tc)
+ 12->13->4(no tc)
+ 14->15->0(no tc)
+*/
void ttl7416x_device::increment()
{
- m_out = (m_out + 1) % (m_limit + 1);
+ m_out++;
- if (m_out == m_limit)
- m_tc = 1;
- else
- m_tc = 0;
+ if (m_limit == 10)
+ {
+ if (m_out == 12 || m_out == 14) m_out = 4;
+ if (m_out == 10) m_out = 0;
+ }
+ m_out &= 0x0f;
}
WRITE_LINE_MEMBER( ttl7416x_device::clear_w )
@@ -201,7 +208,11 @@ READ_LINE_MEMBER( ttl7416x_device::output_r )
return m_out;
}
+/*
+ TC is an asynchronous signal, depending on the current states of CET, CEP,
+ and the counter value.
+*/
READ_LINE_MEMBER( ttl7416x_device::tc_r )
{
- return m_tc;
+ return ((m_cet==1) && (m_cep==1) && (m_out==m_limit-1))? 1:0;
}
diff --git a/src/devices/machine/74161.h b/src/devices/machine/74161.h
index abc702ba398..0145e08a9fb 100644
--- a/src/devices/machine/74161.h
+++ b/src/devices/machine/74161.h
@@ -82,6 +82,9 @@ public:
DECLARE_READ_LINE_MEMBER( output_r );
DECLARE_READ_LINE_MEMBER( tc_r );
+ void set_cet_pin_value(int value) { m_cetpre = value; }
+ void set_cep_pin_value(int value) { m_ceppre = value; }
+
protected:
// construction/destruction
ttl7416x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool synchronous_reset, uint8_t limit);
@@ -111,9 +114,12 @@ private:
uint8_t m_pclock; // pin 2
uint8_t m_p; // pins 3-6 from LSB to MSB
+ // Preset inputs
+ uint8_t m_cetpre;
+ uint8_t m_ceppre;
+
// outputs
uint8_t m_out; // pins 14-11 from LSB to MSB
- uint8_t m_tc; // pin 15
const bool m_synchronous_reset;
const uint8_t m_limit;
diff --git a/src/devices/machine/74543.cpp b/src/devices/machine/74543.cpp
new file mode 100644
index 00000000000..2abba597941
--- /dev/null
+++ b/src/devices/machine/74543.cpp
@@ -0,0 +1,120 @@
+// license:BSD-3-Clause
+// copyright-holders:Michael Zapf
+/*****************************************************************************
+
+ 74543: Octal Registered Transceiver
+ (typically 74F543)
+
+*****************************************************************************/
+
+#include "emu.h"
+#include "74543.h"
+
+DEFINE_DEVICE_TYPE(TTL74543, ttl74543_device, "ttl74543", "Octal Registered Transceiver")
+
+ttl74543_device::ttl74543_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, TTL74543, tag, owner, clock),
+ m_output_a(*this),
+ m_output_b(*this),
+ m_ceabpre(false),
+ m_leabpre(false),
+ m_oeabpre(false),
+ m_cebapre(false),
+ m_lebapre(false),
+ m_oebapre(false)
+{
+}
+
+void ttl74543_device::device_start()
+{
+ save_item(NAME(m_ceab));
+ save_item(NAME(m_leab));
+ save_item(NAME(m_oeab));
+ save_item(NAME(m_ceba));
+ save_item(NAME(m_leba));
+ save_item(NAME(m_oeba));
+
+ save_item(NAME(m_latch));
+
+ m_output_a.resolve_safe();
+ m_output_b.resolve_safe();
+}
+
+void ttl74543_device::device_reset()
+{
+ m_ceab = m_ceabpre;
+ m_leab = m_leabpre;
+ m_oeab = m_oeabpre;
+ m_ceba = m_cebapre;
+ m_leba = m_lebapre;
+ m_oeba = m_oebapre;
+}
+
+/*
+ Data I/O control table:
+
+ Inputs Latch Output
+ CEAB* LEAB* OEAB* Status Buffers
+ -----------------------------------------
+ H X X Latched High Z A->B flow shown
+ X H X Latched - B->A flow control is the same
+ L L X Transparent - except using CEBA*, LEBA*, OEBA*
+ X X H - High Z
+ L X L - Driving
+
+ X = immaterial
+*/
+
+void ttl74543_device::a_w(uint8_t a)
+{
+ if (m_ceab && m_leab) m_latch = a;
+}
+
+void ttl74543_device::b_w(uint8_t b)
+{
+ if (m_ceba && m_leba) m_latch = b;
+}
+
+void ttl74543_device::outputb_rz(uint8_t& value)
+{
+ if (m_ceab && m_oeab) value = m_latch;
+}
+
+void ttl74543_device::outputa_rz(uint8_t& value)
+{
+ if (m_ceba && m_oeba) value = m_latch;
+}
+
+WRITE_LINE_MEMBER( ttl74543_device::ceab_w )
+{
+ m_ceab = (state == 0);
+ if (m_ceab && m_oeab) m_output_b(m_latch);
+}
+
+WRITE_LINE_MEMBER( ttl74543_device::leab_w )
+{
+ m_leab = (state == 0);
+}
+
+WRITE_LINE_MEMBER( ttl74543_device::oeab_w )
+{
+ m_oeab = (state == 0);
+ if (m_ceab && m_oeab) m_output_b(m_latch);
+}
+
+WRITE_LINE_MEMBER( ttl74543_device::ceba_w )
+{
+ m_ceba = (state == 0);
+ if (m_ceba && m_oeba) m_output_a(m_latch);
+}
+
+WRITE_LINE_MEMBER( ttl74543_device::leba_w )
+{
+ m_leba = (state == 0);
+}
+
+WRITE_LINE_MEMBER( ttl74543_device::oeba_w )
+{
+ m_oeba = (state == 0);
+ if (m_ceba && m_oeba) m_output_a(m_latch);
+}
diff --git a/src/devices/machine/74543.h b/src/devices/machine/74543.h
new file mode 100644
index 00000000000..ab2c7a561d2
--- /dev/null
+++ b/src/devices/machine/74543.h
@@ -0,0 +1,124 @@
+// license:BSD-3-Clause
+// copyright-holders:Michael Zapf
+/*****************************************************************************
+
+ 74543: Octal Registered Transceiver
+ (typically 74F543)
+
+***********************************************************************
+
+ Connection Diagram:
+ _________
+ LEBA* 1 | | | | 24 Vcc
+ OEBA* 2 | --- | 23 CEBA*
+ A0 3 | | 22 B0
+ A1 4 | | 21 B1
+ A2 5 | | 20 B2
+ A3 6 | | 19 B3
+ A4 7 | | 18 B4
+ A5 8 | | 17 B5
+ A6 9 | | 16 B6
+ A7 10 | | 15 B7
+ CEAB* 11 | | 14 LEAB*
+ GND 12 |_________| 13 OEAB*
+
+
+ Logic Symbol:
+ | |
+ ____|______|____
+ | |
+ | A0 ... A7 |
+ | |
+ --O| OEAB |
+ --O| OEBA |
+ --O| CEAB |
+ --O| CEBA |
+ --O| LEAB |
+ --O| LEBA |
+ | |
+ | B0 ... B7 |
+ |________________|
+ | |
+ | |
+
+
+***********************************************************************
+
+ Data I/O control table:
+
+ Inputs Latch Output
+ CEAB* LEAB* OEAB* Status Buffers
+ -----------------------------------------
+ H X X Latched High Z A->B flow shown
+ X H X Latched - B->A flow control is the same
+ L L X Transparent - except using CEBA*, LEBA*, OEBA*
+ X X H - High Z
+ L X L - Driving
+
+ X = immaterial
+**********************************************************************/
+
+#ifndef MAME_MACHINE_74543_H
+#define MAME_MACHINE_74543_H
+
+#pragma once
+
+class ttl74543_device : public device_t
+{
+public:
+ ttl74543_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
+ auto outputa_cb() { return m_output_a.bind(); }
+ auto outputb_cb() { return m_output_b.bind(); }
+
+ // public interfaces
+ DECLARE_WRITE_LINE_MEMBER(ceab_w);
+ DECLARE_WRITE_LINE_MEMBER(leab_w);
+ DECLARE_WRITE_LINE_MEMBER(oeab_w);
+ DECLARE_WRITE_LINE_MEMBER(ceba_w);
+ DECLARE_WRITE_LINE_MEMBER(leba_w);
+ DECLARE_WRITE_LINE_MEMBER(oeba_w);
+
+ void a_w(uint8_t a);
+ void b_w(uint8_t a);
+ void outputa_rz(uint8_t& value);
+ void outputb_rz(uint8_t& value);
+
+ // Preset values
+ // for lines tied to H or L
+ void set_ceab_pin_value(int value) { m_ceabpre = (value==0); }
+ void set_leab_pin_value(int value) { m_leabpre = (value==0); }
+ void set_oeab_pin_value(int value) { m_oeabpre = (value==0); }
+ void set_ceba_pin_value(int value) { m_cebapre = (value==0); }
+ void set_leba_pin_value(int value) { m_lebapre = (value==0); }
+ void set_oeba_pin_value(int value) { m_oebapre = (value==0); }
+
+protected:
+ // device-level overrides
+ void device_start() override;
+ void device_reset() override;
+
+private:
+ devcb_write8 m_output_a;
+ devcb_write8 m_output_b;
+
+ bool m_ceab;
+ bool m_leab;
+ bool m_oeab;
+ bool m_ceba;
+ bool m_leba;
+ bool m_oeba;
+
+ bool m_ceabpre;
+ bool m_leabpre;
+ bool m_oeabpre;
+ bool m_cebapre;
+ bool m_lebapre;
+ bool m_oebapre;
+
+ uint8_t m_latch;
+};
+
+// device type definition
+DECLARE_DEVICE_TYPE(TTL74543, ttl74543_device)
+
+#endif // MAME_MACHINE_74161_H
diff --git a/src/devices/machine/7474.cpp b/src/devices/machine/7474.cpp
index ea2f315c72f..ae2a90e8f61 100644
--- a/src/devices/machine/7474.cpp
+++ b/src/devices/machine/7474.cpp
@@ -128,13 +128,13 @@ void ttl7474_device::update()
if (m_output != m_last_output)
{
m_last_output = m_output;
- m_output_func(m_output);
+ m_output_func(m_output!=0);
}
// call callback if any of the outputs changed
if (m_output_comp != m_last_output_comp)
{
m_last_output_comp = m_output_comp;
- m_comp_output_func(m_output_comp);
+ m_comp_output_func(m_output_comp!=0);
}
}
@@ -189,7 +189,7 @@ WRITE_LINE_MEMBER( ttl7474_device::d_w )
READ_LINE_MEMBER( ttl7474_device::output_r )
{
- return m_output;
+ return m_output!=0;
}
@@ -199,7 +199,7 @@ READ_LINE_MEMBER( ttl7474_device::output_r )
READ_LINE_MEMBER( ttl7474_device::output_comp_r )
{
- return m_output_comp;
+ return m_output_comp!=0;
}
void ttl7474_device::init()
diff --git a/src/devices/machine/ds1994.cpp b/src/devices/machine/ds1994.cpp
index 5bd8a7024ca..c8da607c35c 100644
--- a/src/devices/machine/ds1994.cpp
+++ b/src/devices/machine/ds1994.cpp
@@ -53,6 +53,7 @@ ds1994_device::ds1994_device(const machine_config &mconfig, const char *tag, dev
, m_rx(false)
, m_tx(false)
, m_state_ptr(0)
+ , m_offs_ro(false)
{
memset(m_ram, 0, sizeof(m_ram));
}
diff --git a/src/devices/machine/fdc37c93x.cpp b/src/devices/machine/fdc37c93x.cpp
index d29fe2fa89e..b18ed597097 100644
--- a/src/devices/machine/fdc37c93x.cpp
+++ b/src/devices/machine/fdc37c93x.cpp
@@ -536,7 +536,7 @@ void fdc37c93x_device::map_fdc_addresses()
{
uint16_t base = get_base_address(LogicalDevice::FDC, 0);
- m_isa->install_device(base, base + 7, *floppy_controller_fdcdev, &pc_fdc_interface::map);
+ m_isa->install_device(base, base + 7, *floppy_controller_fdcdev, &smc37c78_device::map);
}
void fdc37c93x_device::unmap_fdc_addresses()
diff --git a/src/devices/machine/fdc37c93x.h b/src/devices/machine/fdc37c93x.h
index a4a67d2ccf3..ae5a9619b78 100644
--- a/src/devices/machine/fdc37c93x.h
+++ b/src/devices/machine/fdc37c93x.h
@@ -147,7 +147,7 @@ private:
devcb_write_line m_txd2_callback;
devcb_write_line m_ndtr2_callback;
devcb_write_line m_nrts2_callback;
- required_device<pc_fdc_interface> floppy_controller_fdcdev;
+ required_device<smc37c78_device> floppy_controller_fdcdev;
required_device<pc_lpt_device> pc_lpt_lptdev;
required_device<ns16450_device> pc_serial1_comdev;
required_device<ns16450_device> pc_serial2_comdev;
diff --git a/src/devices/machine/m3002.cpp b/src/devices/machine/m3002.cpp
new file mode 100644
index 00000000000..8bb9edda2b9
--- /dev/null
+++ b/src/devices/machine/m3002.cpp
@@ -0,0 +1,507 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/**********************************************************************
+
+ EM Microelectronic-Marin (µem) M 3002 Real Time Clock
+
+ TODO:
+ - Pulse output (256 Hz, second, minute, hour)
+ - Test mode
+ - Emulate M 3000 differences (if any meaningful ones exist)
+
+**********************************************************************/
+
+#include "emu.h"
+#include "m3002.h"
+
+#define VERBOSE 0
+#include "logmacro.h"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(M3002, m3002_device, "m3002", "EM M 3002 Real Time Clock")
+DEFINE_DEVICE_TYPE(M3000, m3000_device, "m3000", "EM M 3000 Real Time Clock")
+
+//**************************************************************************
+// DEVICE CONSTRUCTION AND INITIALIZATION
+//**************************************************************************
+
+ALLOW_SAVE_TYPE(m3002_device::mux_state);
+
+//-------------------------------------------------
+// m3002_device - constructor
+//-------------------------------------------------
+
+m3002_device::m3002_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_nvram_interface(mconfig, *this)
+ , device_rtc_interface(mconfig, *this)
+ , m_irq_callback(*this)
+ , m_address(0)
+ , m_mux_state(mux_state::INIT)
+ , m_irq_active(false)
+ , m_update_deferred(false)
+ , m_second_timer(nullptr)
+{
+ std::fill_n(&m_ram[0], 0x10, 0);
+}
+
+m3002_device::m3002_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : m3002_device(mconfig, M3002, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// m3000_device - constructor
+//-------------------------------------------------
+
+m3000_device::m3000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : m3002_device(mconfig, M3000, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_resolve_objects - resolve objects that
+// may be needed for other devices to set
+// initial conditions at start time
+//-------------------------------------------------
+
+void m3002_device::device_resolve_objects()
+{
+ m_irq_callback.resolve_safe();
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void m3002_device::device_start()
+{
+ // Setup timer
+ m_second_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m3002_device::second_timer), this));
+
+ // Save internal state
+ save_item(NAME(m_ram));
+ save_item(NAME(m_address));
+ save_item(NAME(m_mux_state));
+ save_item(NAME(m_irq_active));
+ save_item(NAME(m_update_deferred));
+}
+
+
+//-------------------------------------------------
+// device_clock_changed - called when the
+// device clock is altered in any way
+//-------------------------------------------------
+
+void m3002_device::device_clock_changed()
+{
+ attotime second = clocks_to_attotime(32768);
+ m_second_timer->adjust(second, 0, second);
+}
+
+
+//-------------------------------------------------
+// nvram_read - read NVRAM from the file
+//-------------------------------------------------
+
+void m3002_device::nvram_read(emu_file &file)
+{
+ file.read(&m_ram[0], 0x10);
+}
+
+
+//-------------------------------------------------
+// nvram_write - write NVRAM to the file
+//-------------------------------------------------
+
+void m3002_device::nvram_write(emu_file &file)
+{
+ file.write(&m_ram[0], 0x10);
+}
+
+
+//-------------------------------------------------
+// nvram_default - initialize NVRAM to its
+// default state
+//-------------------------------------------------
+
+void m3002_device::nvram_default()
+{
+ // Set watch, alarm and timer registers to minimum values
+ m_ram[0x0] = m_ram[0x8] = m_ram[0xc] = 0x00;
+ m_ram[0x1] = m_ram[0x9] = m_ram[0xd] = 0x00;
+ m_ram[0x2] = m_ram[0xa] = m_ram[0xe] = 0x00;
+ m_ram[0x3] = m_ram[0xb] = 0x01;
+ m_ram[0x4] = 0x01;
+ m_ram[0x5] = 0x00;
+ m_ram[0x6] = 0x01;
+ m_ram[0x7] = 0x01;
+
+ // Allow watch to operate
+ m_ram[0xf] = 0x01;
+}
+
+
+//-------------------------------------------------
+// rtc_clock_updated - set emulated time
+//-------------------------------------------------
+
+void m3002_device::rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second)
+{
+ if (!BIT(m_ram[0xf], 0))
+ return;
+
+ m_ram[0x0] = convert_to_bcd(second);
+ m_ram[0x1] = convert_to_bcd(minute);
+ m_ram[0x2] = convert_to_bcd(hour);
+ m_ram[0x3] = convert_to_bcd(day);
+ m_ram[0x4] = convert_to_bcd(month);
+ m_ram[0x5] = convert_to_bcd(year);
+ m_ram[0x6] = convert_to_bcd(day_of_week);
+
+ unsigned day_of_year = day - 1;
+ for (int n = 1; n < month; n++)
+ {
+ if (n == 2)
+ day_of_year += (year % 4) == 0 ? 29 : 28;
+ else
+ day_of_year += BIT(0xa50, n) ? 30 : 31;
+ }
+ m_ram[0x7] = convert_to_bcd((day_of_year + 7 - day_of_week) / 7 + 1);
+}
+
+
+//**************************************************************************
+// INTERNAL UPDATE CYCLES
+//**************************************************************************
+
+//-------------------------------------------------
+// internal_busy - return true if in the middle
+// of a once-per-second update
+//-------------------------------------------------
+
+bool m3002_device::internal_busy() const
+{
+ // Each internal update lasts between 0.73 ms and 6 ms
+ return attotime_to_clocks(m_second_timer->remaining()) < 239;
+}
+
+
+//-------------------------------------------------
+// bcd_increment - increment the value of one RAM
+// location using BCD sequence
+//-------------------------------------------------
+
+void m3002_device::bcd_increment(u8 location)
+{
+ if ((m_ram[location] & 0x09) != 0x09)
+ m_ram[location]++;
+ else
+ {
+ if ((m_ram[location] & 0x90) != 0x90)
+ m_ram[location] = (m_ram[location] & 0xf0) + 0x10;
+ else
+ m_ram[location] = 0x00;
+ }
+}
+
+
+//-------------------------------------------------
+// max_date - return the maximum date (BCD) in
+// the current month
+//-------------------------------------------------
+
+u8 m3002_device::max_date() const
+{
+ if (m_ram[4] == 0x02)
+ return (m_ram[5] & 0x03) == 0x00 ? 0x29 : 0x28;
+ else
+ return BIT(0x20250, m_ram[4]) ? 0x30 : 0x31;
+}
+
+
+//-------------------------------------------------
+// watch_update - update watch registers
+//-------------------------------------------------
+
+void m3002_device::watch_update()
+{
+ // Count seconds
+ if (m_ram[0x0] != 0x59)
+ {
+ bcd_increment(0x0);
+ return;
+ }
+ m_ram[0x0] = 0x00;
+
+ // Count minutes
+ if (m_ram[0x1] != 0x59)
+ {
+ bcd_increment(0x1);
+ return;
+ }
+ m_ram[0x1] = 0x00;
+
+ // Count hours
+ if (m_ram[0x2] != 0x23)
+ {
+ bcd_increment(0x2);
+ return;
+ }
+ m_ram[0x2] = 0x00;
+
+ // Count weekdays
+ if (m_ram[0x6] != 0x07)
+ bcd_increment(0x6);
+ else
+ {
+ m_ram[0x6] = 0x01;
+
+ // Count weeks
+ bcd_increment(0x7);
+ }
+
+ // Count date
+ if (m_ram[0x3] != max_date())
+ {
+ bcd_increment(0x3);
+ return;
+ }
+ m_ram[0x3] = 0x01;
+
+ // Count months
+ if (m_ram[0x4] != 0x12)
+ {
+ bcd_increment(0x4);
+ return;
+ }
+ m_ram[0x4] = 0x01;
+ m_ram[0x7] = 0x01;
+
+ // Count years
+ bcd_increment(5);
+}
+
+
+//-------------------------------------------------
+// alarm_update - compare alarm registers against
+// watch registers
+//-------------------------------------------------
+
+void m3002_device::alarm_update()
+{
+ // Compare seconds, minutes, hours, date
+ for (int r = 0x0; r <= 0x3; r++)
+ if (m_ram[0x8 + r] != 0xff && m_ram[0x8 + r] != m_ram[r])
+ return;
+
+ // Alarm IRQ
+ m_ram[0xf] |= 0x04;
+}
+
+
+//-------------------------------------------------
+// timer_update - update timer registers
+//-------------------------------------------------
+
+void m3002_device::timer_update()
+{
+ // Count seconds
+ if (m_ram[0xc] != 0x59)
+ {
+ bcd_increment(0xc);
+ return;
+ }
+ m_ram[0xc] = 0x00;
+
+ // Count minutes
+ if (m_ram[0xd] != 0x59)
+ {
+ bcd_increment(0xd);
+ return;
+ }
+ m_ram[0xd] = 0x00;
+
+ // Count hours
+ if (m_ram[0xe] != 0x23)
+ {
+ bcd_increment(0xe);
+ return;
+ }
+ m_ram[0xe] = 0x00;
+
+ // Timer IRQ (23:59:59 -> 00:00:00)
+ m_ram[0xf] |= 0x08;
+}
+
+
+//-------------------------------------------------
+// irq_update - update IRQ output
+//-------------------------------------------------
+
+void m3002_device::irq_update()
+{
+ if (!m_irq_active && (m_ram[0xf] & 0x0c) != 0)
+ {
+ LOG("IRQ occurred\n");
+ m_irq_active = true;
+ m_irq_callback(ASSERT_LINE);
+ }
+ else if (m_irq_active && (m_ram[0xf] & 0x0c) == 0)
+ {
+ LOG("IRQ cleared\n");
+ m_irq_active = false;
+ m_irq_callback(CLEAR_LINE);
+ }
+}
+
+
+//-------------------------------------------------
+// update - perform one full internal update
+//-------------------------------------------------
+
+void m3002_device::update()
+{
+ if (BIT(m_ram[0xf], 0))
+ {
+ watch_update();
+ if (BIT(m_ram[0xf], 1))
+ alarm_update();
+ }
+
+ if (BIT(m_ram[0xf], 4))
+ timer_update();
+
+ irq_update();
+}
+
+
+//-------------------------------------------------
+// second_timer - called once each second
+//-------------------------------------------------
+
+TIMER_CALLBACK_MEMBER(m3002_device::second_timer)
+{
+ if (m_update_deferred)
+ {
+ m_update_deferred = false;
+ update();
+ }
+ else if (m_mux_state != mux_state::INIT)
+ m_update_deferred = true;
+
+ if (!m_update_deferred)
+ update();
+}
+
+//**************************************************************************
+// MICROPROCESSOR ACCESS
+//**************************************************************************
+
+const char *const m3002_device::s_register_names[0x10] =
+{
+ "watch seconds",
+ "watch minutes",
+ "watch hours",
+ "watch date",
+ "watch month",
+ "watch year",
+ "watch weekday",
+ "watch week",
+ "alarm seconds",
+ "alarm minutes",
+ "alarm hours",
+ "alarm date",
+ "timer seconds",
+ "timer minutes",
+ "timer hours",
+ "status/control"
+};
+
+//-------------------------------------------------
+// set_init_state - return the multiplexer to the
+// initial state
+//-------------------------------------------------
+
+void m3002_device::set_init_state()
+{
+ m_mux_state = mux_state::INIT;
+ if (m_update_deferred)
+ {
+ m_update_deferred = false;
+ update();
+ }
+ irq_update();
+}
+
+
+//-------------------------------------------------
+// read - read data or busy status using 3-step
+// access sequence
+//-------------------------------------------------
+
+u8 m3002_device::read()
+{
+ u8 data = 0x0;
+
+ switch (m_mux_state)
+ {
+ case mux_state::INIT:
+ if (internal_busy())
+ data = 0xf;
+ break;
+
+ case mux_state::TENS:
+ data = m_ram[m_address] >> 4;
+ if (!machine().side_effects_disabled())
+ m_mux_state = mux_state::UNITS;
+ break;
+
+ case mux_state::UNITS:
+ data = m_ram[m_address] & 0x0f;
+ if (!machine().side_effects_disabled())
+ {
+ LOG("%s: Read %02X from %s register\n", machine().describe_context(), m_ram[m_address], s_register_names[m_address]);
+ set_init_state();
+ }
+ break;
+ }
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// write - write address and/or data using 3-step
+// access sequence
+//-------------------------------------------------
+
+void m3002_device::write(u8 data)
+{
+ data &= 0xf;
+
+ switch (m_mux_state)
+ {
+ case mux_state::INIT:
+ m_address = data;
+ m_mux_state = mux_state::TENS;
+ break;
+
+ case mux_state::TENS:
+ m_ram[m_address] = (data << 4) | (m_ram[m_address] & 0x0f);
+ m_mux_state = mux_state::UNITS;
+ break;
+
+ case mux_state::UNITS:
+ m_ram[m_address] = (m_ram[m_address] & 0xf0) | data;
+ LOG("%s: Writing %02X to %s register\n", machine().describe_context(), m_ram[m_address], s_register_names[m_address]);
+ set_init_state();
+ break;
+ }
+}
diff --git a/src/devices/machine/m3002.h b/src/devices/machine/m3002.h
new file mode 100644
index 00000000000..d39f904fe60
--- /dev/null
+++ b/src/devices/machine/m3002.h
@@ -0,0 +1,113 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/**********************************************************************
+
+ EM Microelectronic-Marin (µem) M 3002 Real Time Clock
+
+***********************************************************************
+ ____ ____
+ Vbb 1 |* \__/ | 16 Vdd
+ XI 2 | | 15 _PULSE
+ XO 3 | | 14 _BUSY
+ _SYNC 4 | | 13 _IRQ
+ R/_W 5 | M 3002 | 12 I/O 3
+ _OE 6 | | 11 I/O 2
+ _CS 7 | | 10 I/O 1
+ Vss 8 |____________| 9 I/O 0
+
+**********************************************************************/
+
+#ifndef MAME_MACHINE_M3002_H
+#define MAME_MACHINE_M3002_H
+
+#pragma once
+
+#include "dirtc.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> m3002_device
+
+class m3002_device : public device_t, public device_nvram_interface, public device_rtc_interface
+{
+public:
+ // device type constructor
+ m3002_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ // 4-bit read/write handlers
+ u8 read();
+ void write(u8 data);
+
+ // status output polling
+ DECLARE_READ_LINE_MEMBER(busy_r) { return internal_busy() ? 0 : 1; }
+ DECLARE_READ_LINE_MEMBER(irq_r) { return m_irq_active ? 0 : 1; }
+
+protected:
+ m3002_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
+
+ // device-level overrides
+ virtual void device_resolve_objects() override;
+ virtual void device_start() override;
+ virtual void device_clock_changed() override;
+
+ // device_nvram_interface overrides
+ virtual void nvram_read(emu_file &file) override;
+ virtual void nvram_write(emu_file &file) override;
+ virtual void nvram_default() override;
+
+ // device_rtc_interface overrides
+ virtual bool rtc_feature_y2k() const override { return false; }
+ virtual bool rtc_feature_leap_year() const override { return true; }
+ virtual void rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) override;
+
+private:
+ static const char *const s_register_names[0x10];
+
+ enum class mux_state : u8
+ {
+ INIT,
+ TENS,
+ UNITS
+ };
+
+ // internal helpers
+ bool internal_busy() const;
+ void bcd_increment(u8 location);
+ u8 max_date() const;
+ void watch_update();
+ void alarm_update();
+ void timer_update();
+ void irq_update();
+ void update();
+ TIMER_CALLBACK_MEMBER(second_timer);
+ void set_init_state();
+
+ // callback objects
+ devcb_write_line m_irq_callback;
+
+ // internal state
+ u8 m_ram[16];
+ u8 m_address;
+ mux_state m_mux_state;
+ bool m_irq_active;
+ bool m_update_deferred;
+ emu_timer *m_second_timer;
+};
+
+// ======================> m3000_device
+
+class m3000_device : public m3002_device
+{
+public:
+ // device type constructor
+ m3000_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+};
+
+// device type declarations
+DECLARE_DEVICE_TYPE(M3002, m3002_device)
+DECLARE_DEVICE_TYPE(M3000, m3000_device)
+
+#endif // MAME_MACHINE_M3002_H
diff --git a/src/devices/machine/pc_fdc.cpp b/src/devices/machine/pc_fdc.cpp
index 69048e4e32d..d1668f2381d 100644
--- a/src/devices/machine/pc_fdc.cpp
+++ b/src/devices/machine/pc_fdc.cpp
@@ -26,11 +26,6 @@
DEFINE_DEVICE_TYPE(PC_FDC_XT, pc_fdc_xt_device, "pc_fdc_xt", "PC FDC (XT)")
-DEFINE_DEVICE_TYPE(PC_FDC_AT, pc_fdc_at_device, "pc_fdc_at", "PC FDC (AT)")
-
-void pc_fdc_family_device::map(address_map &map)
-{
-}
// The schematics show address decoding is minimal
void pc_fdc_xt_device::map(address_map &map)
@@ -43,16 +38,8 @@ void pc_fdc_xt_device::map(address_map &map)
}
-// Decoding is through a PAL, so presumably complete
-void pc_fdc_at_device::map(address_map &map)
-{
- map(0x2, 0x2).rw(FUNC(pc_fdc_at_device::dor_r), FUNC(pc_fdc_at_device::dor_w));
- map(0x4, 0x5).m(fdc, FUNC(upd765a_device::map));
- map(0x7, 0x7).rw(FUNC(pc_fdc_at_device::dir_r), FUNC(pc_fdc_at_device::ccr_w));
-}
-
pc_fdc_family_device::pc_fdc_family_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- pc_fdc_interface(mconfig, type, tag, owner, clock), fdc(*this, "upd765"),
+ device_t(mconfig, type, tag, owner, clock), fdc(*this, "upd765"),
intrq_cb(*this),
drq_cb(*this)
{
@@ -136,11 +123,6 @@ uint8_t pc_fdc_family_device::dor_r()
return dor;
}
-uint8_t pc_fdc_family_device::dir_r()
-{
- return do_dir_r();
-}
-
void pc_fdc_family_device::ccr_w(uint8_t data)
{
static const int rates[4] = { 500000, 300000, 250000, 1000000 };
@@ -148,13 +130,6 @@ void pc_fdc_family_device::ccr_w(uint8_t data)
fdc->set_rate(rates[data & 3]);
}
-uint8_t pc_fdc_family_device::do_dir_r()
-{
- if(floppy[dor & 3])
- return floppy[dor & 3]->dskchg_r() ? 0x00 : 0x80;
- return 0x00;
-}
-
void pc_fdc_xt_device::dor_fifo_w(uint8_t data)
{
fdc->fifo_w(data);
@@ -194,7 +169,3 @@ void pc_fdc_family_device::check_drq()
pc_fdc_xt_device::pc_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc_fdc_family_device(mconfig, PC_FDC_XT, tag, owner, clock)
{
}
-
-pc_fdc_at_device::pc_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc_fdc_family_device(mconfig, PC_FDC_AT, tag, owner, clock)
-{
-}
diff --git a/src/devices/machine/pc_fdc.h b/src/devices/machine/pc_fdc.h
index 56438d01499..bbb2f0a9068 100644
--- a/src/devices/machine/pc_fdc.h
+++ b/src/devices/machine/pc_fdc.h
@@ -14,21 +14,19 @@
#include "machine/upd765.h"
-class pc_fdc_family_device : public pc_fdc_interface {
+class pc_fdc_family_device : public device_t {
public:
auto intrq_wr_callback() { return intrq_cb.bind(); }
auto drq_wr_callback() { return drq_cb.bind(); }
- virtual void map(address_map &map) override;
+ virtual void map(address_map &map) = 0;
- virtual void tc_w(bool state) override;
- virtual uint8_t dma_r() override;
- virtual void dma_w(uint8_t data) override;
- virtual uint8_t do_dir_r() override;
+ void tc_w(bool state);
+ uint8_t dma_r();
+ void dma_w(uint8_t data);
uint8_t dor_r();
void dor_w(uint8_t data);
- uint8_t dir_r();
void ccr_w(uint8_t data);
required_device<upd765a_device> fdc;
@@ -62,14 +60,6 @@ public:
void dor_fifo_w(uint8_t data);
};
-class pc_fdc_at_device : public pc_fdc_family_device {
-public:
- pc_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- virtual void map(address_map &map) override;
-};
-
DECLARE_DEVICE_TYPE(PC_FDC_XT, pc_fdc_xt_device)
-DECLARE_DEVICE_TYPE(PC_FDC_AT, pc_fdc_at_device)
#endif // MAME_MACHINE_PC_FDC_H
diff --git a/src/devices/machine/pci.cpp b/src/devices/machine/pci.cpp
index 804fcbe6c1f..372cfac1913 100644
--- a/src/devices/machine/pci.cpp
+++ b/src/devices/machine/pci.cpp
@@ -72,6 +72,9 @@ pci_device::pci_device(const machine_config &mconfig, device_type type, const ch
revision = 0x00;
pclass = 0xffffff;
subsystem_id = 0xffffffff;
+ expansion_rom = nullptr;
+ expansion_rom_size = 0;
+ expansion_rom_base = 0;
is_multifunction_device = false;
intr_pin = 0x0;
intr_line = 0xff;
@@ -102,10 +105,6 @@ void pci_device::device_start()
bank_count = 0;
bank_reg_count = 0;
- expansion_rom = nullptr;
- expansion_rom_size = 0;
- expansion_rom_base = 0;
-
for (int i = 0; i < ARRAY_LENGTH(bank_infos); i++) {
save_item(NAME(bank_infos[i].adr), i);
}
diff --git a/src/devices/machine/pla.cpp b/src/devices/machine/pla.cpp
index 44db6a4ed10..7ad690b11cd 100644
--- a/src/devices/machine/pla.cpp
+++ b/src/devices/machine/pla.cpp
@@ -72,21 +72,29 @@ void pla_device::device_start()
m_input_mask = ((uint64_t)1 << m_inputs) - 1;
m_input_mask = ((uint64_t)m_input_mask << 32) | m_input_mask;
- // parse fusemap
- parse_fusemap();
+ m_cache_size = 1 << ((m_inputs > MAX_CACHE_BITS) ? MAX_CACHE_BITS : m_inputs);
+ m_cache.resize(m_cache_size);
+
+ reinit();
+}
+
+bool pla_device::reinit()
+{
+ int result = parse_fusemap();
// initialize cache
m_cache2_ptr = 0;
for (auto & elem : m_cache2)
elem = 0x80000000;
+ int csize = m_cache_size;
m_cache_size = 0;
- int csize = 1 << ((m_inputs > MAX_CACHE_BITS) ? MAX_CACHE_BITS : m_inputs);
- m_cache.resize(csize);
for (int i = 0; i < csize; i++)
m_cache[i] = read(i);
m_cache_size = csize;
+
+ return result == JEDERR_NONE;
}
@@ -94,7 +102,7 @@ void pla_device::device_start()
// parse_fusemap -
//-------------------------------------------------
-void pla_device::parse_fusemap()
+int pla_device::parse_fusemap()
{
jed_data jed;
int result = JEDERR_NONE;
@@ -120,7 +128,7 @@ void pla_device::parse_fusemap()
}
logerror("%s PLA parse error %d!\n", tag(), result);
- return;
+ return result;
}
// parse it
@@ -174,6 +182,7 @@ void pla_device::parse_fusemap()
m_xor <<= 32;
LOGMASKED(LOG_TERMS, "F ^= %0*X\n", (m_outputs + 3) / 4, m_xor >> 32);
+ return result;
}
diff --git a/src/devices/machine/pla.h b/src/devices/machine/pla.h
index b614a968b36..548ab4bf16b 100644
--- a/src/devices/machine/pla.h
+++ b/src/devices/machine/pla.h
@@ -69,6 +69,7 @@ public:
uint32_t outputs() { return m_outputs; }
uint32_t read(uint32_t input);
+ bool reinit();
protected:
// device-level overrides
@@ -79,7 +80,7 @@ private:
static constexpr unsigned MAX_CACHE_BITS = 20;
static constexpr unsigned CACHE2_SIZE = 8;
- void parse_fusemap();
+ int parse_fusemap();
required_memory_region m_region;
diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp
index 9ccc83997bf..0f53c1fe875 100644
--- a/src/devices/machine/rtc65271.cpp
+++ b/src/devices/machine/rtc65271.cpp
@@ -450,18 +450,24 @@ void rtc65271_device::field_interrupts()
{
if (m_regs[reg_C] & m_regs[reg_B] & (reg_C_PF | reg_C_AF | reg_C_UF))
{
+ m_int_pending = true;
m_regs[reg_C] |= reg_C_IRQF;
if (!m_interrupt_cb.isnull())
m_interrupt_cb(1);
}
else
{
+ m_int_pending = false;
m_regs[reg_C] &= ~reg_C_IRQF;
if (!m_interrupt_cb.isnull())
m_interrupt_cb(0);
}
}
+READ_LINE_MEMBER(rtc65271_device::intrq_r)
+{
+ return (m_int_pending)? ASSERT_LINE : CLEAR_LINE;
+}
/*
Update SQW output state each half-period and assert periodic interrupt each
@@ -656,6 +662,7 @@ rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag,
: device_t(mconfig, RTC65271, tag, owner, clock)
, device_nvram_interface(mconfig, *this)
, m_interrupt_cb(*this)
+ , m_int_pending(false)
{
}
@@ -674,4 +681,5 @@ void rtc65271_device::device_start()
save_item(NAME(m_xram));
save_item(NAME(m_cur_xram_page));
save_item(NAME(m_SQW_internal_state));
+ save_item(NAME(m_int_pending));
}
diff --git a/src/devices/machine/rtc65271.h b/src/devices/machine/rtc65271.h
index 1a69b518839..cb2c5b4bcb2 100644
--- a/src/devices/machine/rtc65271.h
+++ b/src/devices/machine/rtc65271.h
@@ -26,6 +26,11 @@ public:
void rtc_w(offs_t offset, uint8_t data);
void xram_w(offs_t offset, uint8_t data);
+ uint8_t read(int xramsel, offs_t offset);
+ void write(int xramsel, offs_t offset, uint8_t data);
+
+ DECLARE_READ_LINE_MEMBER(intrq_r);
+
protected:
// device-level overrides
virtual void device_start() override;
@@ -35,8 +40,6 @@ protected:
virtual void nvram_write(emu_file &file) override;
private:
- uint8_t read(int xramsel, offs_t offset);
- void write(int xramsel, offs_t offset, uint8_t data);
void field_interrupts();
TIMER_CALLBACK_MEMBER(rtc_SQW_cb);
@@ -60,6 +63,8 @@ private:
/* callback called when interrupt pin state changes (may be nullptr) */
devcb_write_line m_interrupt_cb;
+
+ bool m_int_pending;
};
// device type definition
diff --git a/src/devices/machine/tc009xlvc.cpp b/src/devices/machine/tc009xlvc.cpp
index a3553414d88..a98aa4a2ab4 100644
--- a/src/devices/machine/tc009xlvc.cpp
+++ b/src/devices/machine/tc009xlvc.cpp
@@ -118,6 +118,7 @@ void tc0091lvc_device::banked_map(address_map &map)
tc0091lvc_device::tc0091lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, TC0091LVC, tag, owner, clock)
, device_gfx_interface(mconfig, *this, gfxinfo, "palette")
+ , m_irq_enable(0)
, m_bankdev(*this, "bankdev_%u", 0U)
, m_vram(*this, "vram")
, m_bitmap_ram(*this, "bitmap_ram")
diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp
index 37a71638dca..461504b750f 100644
--- a/src/devices/machine/upd765.cpp
+++ b/src/devices/machine/upd765.cpp
@@ -167,7 +167,7 @@ void tc8566af_device::map(address_map &map)
constexpr int upd765_family_device::rates[4];
upd765_family_device::upd765_family_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
- pc_fdc_interface(mconfig, type, tag, owner, clock),
+ device_t(mconfig, type, tag, owner, clock),
ready_connected(true),
ready_polled(true),
select_connected(true),
diff --git a/src/devices/machine/upd765.h b/src/devices/machine/upd765.h
index e98f56f24f0..8abc7a6e3ef 100644
--- a/src/devices/machine/upd765.h
+++ b/src/devices/machine/upd765.h
@@ -15,30 +15,7 @@ class floppy_image_device;
* mode = mode_t::AT, mode_t::PS2 or mode_t::M30 for the fdcs that have reset-time selection
*/
-/* Interface required for PC ISA wrapping */
-class pc_fdc_interface : public device_t {
-protected:
- using device_t::device_t;
-
-public:
- typedef delegate<uint8_t ()> byte_read_cb;
- typedef delegate<void (uint8_t)> byte_write_cb;
-
- /* Note that the address map must cover and handle the whole 0-7
- * range. The upd765, while conforming to the rest of the
- * interface, is not eligible as a result.
- */
-
- virtual void map(address_map &map) = 0;
-
- virtual uint8_t dma_r() = 0;
- virtual void dma_w(uint8_t data) = 0;
-
- virtual void tc_w(bool val) = 0;
- virtual uint8_t do_dir_r() = 0;
-};
-
-class upd765_family_device : public pc_fdc_interface {
+class upd765_family_device : public device_t {
public:
enum class mode_t { AT, PS2, M30 };
@@ -48,7 +25,7 @@ public:
auto us_wr_callback() { return us_cb.bind(); }
auto idx_wr_callback() { return idx_cb.bind(); }
- virtual void map(address_map &map) override = 0;
+ virtual void map(address_map &map) = 0;
uint8_t sra_r();
uint8_t srb_r();
@@ -63,14 +40,14 @@ public:
uint8_t dir_r() { return do_dir_r(); }
void ccr_w(uint8_t data);
- virtual uint8_t do_dir_r() override;
+ uint8_t do_dir_r();
- uint8_t dma_r() override;
- void dma_w(uint8_t data) override;
+ uint8_t dma_r();
+ void dma_w(uint8_t data);
bool get_irq() const;
bool get_drq() const;
- void tc_w(bool val) override;
+ void tc_w(bool val);
void ready_w(bool val);
DECLARE_WRITE_LINE_MEMBER(tc_line_w) { tc_w(state == ASSERT_LINE); }
diff --git a/src/emu/save.cpp b/src/emu/save.cpp
index c345ef3e6ac..615578d80f2 100644
--- a/src/emu/save.cpp
+++ b/src/emu/save.cpp
@@ -240,119 +240,159 @@ void save_manager::dispatch_postload()
//-------------------------------------------------
-// read_file - read the data from a file
+// dispatch_presave - invoke all registered
+// presave callbacks for updates
//-------------------------------------------------
-save_error save_manager::read_file(emu_file &file)
+void save_manager::dispatch_presave()
{
- // if we have illegal registrations, return an error
- if (m_illegal_regs > 0)
- return STATERR_ILLEGAL_REGISTRATIONS;
-
- // read the header and turn on compression for the rest of the file
- file.compress(FCOMPRESS_NONE);
- file.seek(0, SEEK_SET);
- u8 header[HEADER_SIZE];
- if (file.read(header, sizeof(header)) != sizeof(header))
- return STATERR_READ_ERROR;
- file.compress(FCOMPRESS_MEDIUM);
+ for (auto &func : m_presave_list)
+ func->m_func();
+}
- // verify the header and report an error if it doesn't match
- u32 sig = signature();
- if (validate_header(header, machine().system().name, sig, nullptr, "Error: ") != STATERR_NONE)
- return STATERR_INVALID_HEADER;
- // determine whether or not to flip the data when done
- bool flip = NATIVE_ENDIAN_VALUE_LE_BE((header[9] & SS_MSB_FIRST) != 0, (header[9] & SS_MSB_FIRST) == 0);
+//-------------------------------------------------
+// write_file - writes the data to a file
+//-------------------------------------------------
- // read all the data, flipping if necessary
- for (auto &entry : m_entry_list)
- {
- const u32 blocksize = entry->m_typesize * entry->m_typecount;
- u8 *data = reinterpret_cast<u8 *>(entry->m_data);
- for (u32 b = 0; entry->m_blockcount > b; ++b, data += (entry->m_typesize * entry->m_stride))
- if (file.read(data, blocksize) != blocksize)
- return STATERR_READ_ERROR;
+save_error save_manager::write_file(emu_file &file)
+{
+ return do_write(
+ [] (size_t total_size) { return true; },
+ [&file] (const void *data, size_t size) { return file.write(data, size) == size; },
+ [&file] ()
+ {
+ file.compress(FCOMPRESS_NONE);
+ file.seek(0, SEEK_SET);
+ return true;
+ },
+ [&file] ()
+ {
+ file.compress(FCOMPRESS_MEDIUM);
+ return true;
+ });
+}
- // handle flipping
- if (flip)
- entry->flip_data();
- }
- // call the post-load functions
- dispatch_postload();
+//-------------------------------------------------
+// read_file - read the data from a file
+//-------------------------------------------------
- return STATERR_NONE;
+save_error save_manager::read_file(emu_file &file)
+{
+ return do_read(
+ [] (size_t total_size) { return true; },
+ [&file] (void *data, size_t size) { return file.read(data, size) == size; },
+ [&file] ()
+ {
+ file.compress(FCOMPRESS_NONE);
+ file.seek(0, SEEK_SET);
+ return true;
+ },
+ [&file] ()
+ {
+ file.compress(FCOMPRESS_MEDIUM);
+ return true;
+ });
}
//-------------------------------------------------
-// dispatch_presave - invoke all registered
-// presave callbacks for updates
+// write_stream - write the current machine state
+// to an output stream
//-------------------------------------------------
-void save_manager::dispatch_presave()
+save_error save_manager::write_stream(std::ostream &str)
{
- for (auto &func : m_presave_list)
- func->m_func();
+ return do_write(
+ [] (size_t total_size) { return true; },
+ [&str] (const void *data, size_t size)
+ {
+ return bool(str.write(reinterpret_cast<const char *>(data), size));
+ },
+ [] () { return true; },
+ [] () { return true; });
}
//-------------------------------------------------
-// write_file - writes the data to a file
+// read_stream - restore the machine state from
+// an input stream
//-------------------------------------------------
-save_error save_manager::write_file(emu_file &file)
+save_error save_manager::read_stream(std::istream &str)
{
- // if we have illegal registrations, return an error
- if (m_illegal_regs > 0)
- return STATERR_ILLEGAL_REGISTRATIONS;
+ return do_read(
+ [] (size_t total_size) { return true; },
+ [&str] (void *data, size_t size)
+ {
+ return bool(str.read(reinterpret_cast<char *>(data), size));
+ },
+ [] () { return true; },
+ [] () { return true; });
+}
- // generate the header
- u8 header[HEADER_SIZE];
- memcpy(&header[0], STATE_MAGIC_NUM, 8);
- header[8] = SAVE_VERSION;
- header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST);
- strncpy((char *)&header[0x0a], machine().system().name, 0x1c - 0x0a);
- u32 sig = signature();
- *(u32 *)&header[0x1c] = little_endianize_int32(sig);
- // write the header and turn on compression for the rest of the file
- file.compress(FCOMPRESS_NONE);
- file.seek(0, SEEK_SET);
- if (file.write(header, sizeof(header)) != sizeof(header))
- return STATERR_WRITE_ERROR;
- file.compress(FCOMPRESS_MEDIUM);
+//-------------------------------------------------
+// write_buffer - write the current machine state
+// to an allocated buffer
+//-------------------------------------------------
- // call the pre-save functions
- dispatch_presave();
+save_error save_manager::write_buffer(void *buf, size_t size)
+{
+ return do_write(
+ [size] (size_t total_size) { return size == total_size; },
+ [ptr = reinterpret_cast<u8 *>(buf)] (const void *data, size_t size) mutable
+ {
+ memcpy(ptr, data, size);
+ ptr += size;
+ return true;
+ },
+ [] () { return true; },
+ [] () { return true; });
+}
- // then write all the data
- for (auto &entry : m_entry_list)
- {
- const u32 blocksize = entry->m_typesize * entry->m_typecount;
- const u8 *data = reinterpret_cast<const u8 *>(entry->m_data);
- for (u32 b = 0; entry->m_blockcount > b; ++b, data += (entry->m_typesize * entry->m_stride))
- if (file.write(data, blocksize) != blocksize)
- return STATERR_WRITE_ERROR;
- }
- return STATERR_NONE;
+
+//-------------------------------------------------
+// read_buffer - restore the machine state from a
+// buffer
+//-------------------------------------------------
+
+save_error save_manager::read_buffer(const void *buf, size_t size)
+{
+ const u8 *ptr = reinterpret_cast<const u8 *>(buf);
+ const u8 *const end = ptr + size;
+ return do_read(
+ [size] (size_t total_size) { return size == total_size; },
+ [&ptr, &end] (void *data, size_t size) -> bool
+ {
+ if ((ptr + size) > end)
+ return false;
+ memcpy(data, ptr, size);
+ ptr += size;
+ return true;
+ },
+ [] () { return true; },
+ [] () { return true; });
}
//-------------------------------------------------
-// save - write the current machine state to the
-// allocated stream
+// do_write - serialisation logic
//-------------------------------------------------
-save_error save_manager::write_buffer(u8 *data, size_t size)
+template <typename T, typename U, typename V, typename W>
+inline save_error save_manager::do_write(T check_space, U write_block, V start_header, W start_data)
{
// if we have illegal registrations, return an error
if (m_illegal_regs > 0)
return STATERR_ILLEGAL_REGISTRATIONS;
- // verify the buffer length
- if (size != ram_state::get_size(*this))
+ // check for sufficient space
+ size_t total_size = HEADER_SIZE;
+ for (const auto &entry : m_entry_list)
+ total_size += entry->m_typesize * entry->m_typecount * entry->m_blockcount;
+ if (!check_space(total_size))
return STATERR_WRITE_ERROR;
// generate the header
@@ -364,11 +404,9 @@ save_error save_manager::write_buffer(u8 *data, size_t size)
u32 sig = signature();
*(u32 *)&header[0x1c] = little_endianize_int32(sig);
- // write the header
- memcpy(data, header, sizeof(header));
-
- // advance the pointer
- u8 *byte_ptr = data + sizeof(header);
+ // write the header and turn on compression for the rest of the file
+ if (!start_header() || !write_block(header, sizeof(header)) || !start_data())
+ return STATERR_WRITE_ERROR;
// call the pre-save functions
dispatch_presave();
@@ -376,40 +414,38 @@ save_error save_manager::write_buffer(u8 *data, size_t size)
// then write all the data
for (auto &entry : m_entry_list)
{
- u32 totalsize = entry->m_typesize * entry->m_typecount;
-
- // check bounds before writing
- if (byte_ptr + totalsize > data + size)
- return STATERR_WRITE_ERROR;
-
- memcpy(byte_ptr, entry->m_data, totalsize);
- byte_ptr += totalsize;
+ const u32 blocksize = entry->m_typesize * entry->m_typecount;
+ const u8 *data = reinterpret_cast<const u8 *>(entry->m_data);
+ for (u32 b = 0; entry->m_blockcount > b; ++b, data += (entry->m_typesize * entry->m_stride))
+ if (!write_block(data, blocksize))
+ return STATERR_WRITE_ERROR;
}
return STATERR_NONE;
}
//-------------------------------------------------
-// load - restore the machine state from the
-// stream
+// do_read - deserialisation logic
//-------------------------------------------------
-save_error save_manager::read_buffer(u8 *data, size_t size)
+template <typename T, typename U, typename V, typename W>
+inline save_error save_manager::do_read(T check_length, U read_block, V start_header, W start_data)
{
// if we have illegal registrations, return an error
if (m_illegal_regs > 0)
return STATERR_ILLEGAL_REGISTRATIONS;
- // verify the buffer length
- if (size != ram_state::get_size(*this))
- return STATERR_WRITE_ERROR;
+ // check for sufficient space
+ size_t total_size = HEADER_SIZE;
+ for (const auto &entry : m_entry_list)
+ total_size += entry->m_typesize * entry->m_typecount * entry->m_blockcount;
+ if (!check_length(total_size))
+ return STATERR_READ_ERROR;
- // read the header
+ // read the header and turn on compression for the rest of the file
u8 header[HEADER_SIZE];
- memcpy(header, data, sizeof(header));
-
- // advance the pointer
- u8 *byte_ptr = data + sizeof(header);
+ if (!start_header() || !read_block(header, sizeof(header)) || !start_data())
+ return STATERR_READ_ERROR;
// verify the header and report an error if it doesn't match
u32 sig = signature();
@@ -417,19 +453,16 @@ save_error save_manager::read_buffer(u8 *data, size_t size)
return STATERR_INVALID_HEADER;
// determine whether or not to flip the data when done
- bool flip = NATIVE_ENDIAN_VALUE_LE_BE((header[9] & SS_MSB_FIRST) != 0, (header[9] & SS_MSB_FIRST) == 0);
+ const bool flip = NATIVE_ENDIAN_VALUE_LE_BE((header[9] & SS_MSB_FIRST) != 0, (header[9] & SS_MSB_FIRST) == 0);
// read all the data, flipping if necessary
for (auto &entry : m_entry_list)
{
- u32 totalsize = entry->m_typesize * entry->m_typecount;
-
- // check bounds before reading
- if (byte_ptr + totalsize > data + size)
- return STATERR_READ_ERROR;
-
- memcpy(entry->m_data, byte_ptr, totalsize);
- byte_ptr += totalsize;
+ const u32 blocksize = entry->m_typesize * entry->m_typecount;
+ u8 *data = reinterpret_cast<u8 *>(entry->m_data);
+ for (u32 b = 0; entry->m_blockcount > b; ++b, data += (entry->m_typesize * entry->m_stride))
+ if (!read_block(data, blocksize))
+ return STATERR_READ_ERROR;
// handle flipping
if (flip)
@@ -583,41 +616,10 @@ save_error ram_state::save()
m_valid = false;
m_data.seekp(0);
- // if we have illegal registrations, return an error
- if (m_save.m_illegal_regs > 0)
- return STATERR_ILLEGAL_REGISTRATIONS;
-
- // generate the header
- u8 header[HEADER_SIZE];
- memcpy(&header[0], STATE_MAGIC_NUM, 8);
- header[8] = SAVE_VERSION;
- header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST);
- strncpy((char *)&header[0x0a], m_save.machine().system().name, 0x1c - 0x0a);
- u32 sig = m_save.signature();
- *(u32 *)&header[0x1c] = little_endianize_int32(sig);
-
- // write the header
- m_data.write((char *)header, sizeof(header));
-
- // check for any errors
- if (!m_data)
- return STATERR_WRITE_ERROR;
-
- // call the pre-save functions
- m_save.dispatch_presave();
-
- // write all the data
- for (auto &entry : m_save.m_entry_list)
- {
- const u32 blocksize = entry->m_typesize * entry->m_typecount;
- const char *data = reinterpret_cast<const char *>(entry->m_data);
- for (u32 b = 0; entry->m_blockcount > b; ++b, data += (entry->m_typesize * entry->m_stride))
- m_data.write(data, blocksize);
-
- // check for any errors
- if (!m_data)
- return STATERR_WRITE_ERROR;
- }
+ // get the save manager to write state
+ const save_error err = m_save.write_stream(m_data);
+ if (err != STATERR_NONE)
+ return err;
// final confirmation
m_valid = true;
@@ -641,43 +643,8 @@ save_error ram_state::load()
if (m_save.m_illegal_regs > 0)
return STATERR_ILLEGAL_REGISTRATIONS;
- // read the header
- u8 header[HEADER_SIZE];
- m_data.read((char *)header, sizeof(header));
-
- // check for any errors
- if (!m_data)
- return STATERR_READ_ERROR;
-
- // verify the header and report an error if it doesn't match
- u32 sig = m_save.signature();
- if (m_save.validate_header(header, m_save.machine().system().name, sig, nullptr, "Error: ") != STATERR_NONE)
- return STATERR_INVALID_HEADER;
-
- // determine whether or not to flip the data when done
- bool flip = NATIVE_ENDIAN_VALUE_LE_BE((header[9] & SS_MSB_FIRST) != 0, (header[9] & SS_MSB_FIRST) == 0);
-
- // read all the data, flipping if necessary
- for (auto &entry : m_save.m_entry_list)
- {
- const u32 blocksize = entry->m_typesize * entry->m_typecount;
- char *data = reinterpret_cast<char *>(entry->m_data);
- for (u32 b = 0; entry->m_blockcount > b; ++b, data += (entry->m_typesize * entry->m_stride))
- m_data.read(data, blocksize);
-
- // check for any errors
- if (!m_data)
- return STATERR_READ_ERROR;
-
- // handle flipping
- if (flip)
- entry->flip_data();
- }
-
- // call the post-load functions
- m_save.dispatch_postload();
-
- return STATERR_NONE;
+ // get the save manager to load state
+ return m_save.write_stream(m_data);
}
diff --git a/src/emu/save.h b/src/emu/save.h
index a9f25488a00..f015534f02c 100644
--- a/src/emu/save.h
+++ b/src/emu/save.h
@@ -233,15 +233,13 @@ public:
save_error write_file(emu_file &file);
save_error read_file(emu_file &file);
- save_error write_buffer(u8 *data, size_t size);
- save_error read_buffer(u8 *data, size_t size);
+ save_error write_stream(std::ostream &str);
+ save_error read_stream(std::istream &str);
-private:
- // internal helpers
- u32 signature() const;
- void dump_registry() const;
- static save_error validate_header(const u8 *header, const char *gamename, u32 signature, void (CLIB_DECL *errormsg)(const char *fmt, ...), const char *error_prefix);
+ save_error write_buffer(void *buf, size_t size);
+ save_error read_buffer(const void *buf, size_t size);
+private:
// state callback item
class state_callback
{
@@ -252,6 +250,15 @@ private:
save_prepost_delegate m_func; // delegate
};
+ // internal helpers
+ template <typename T, typename U, typename V, typename W>
+ save_error do_write(T check_space, U write_block, V start_header, W start_data);
+ template <typename T, typename U, typename V, typename W>
+ save_error do_read(T check_length, U read_block, V start_header, W start_data);
+ u32 signature() const;
+ void dump_registry() const;
+ static save_error validate_header(const u8 *header, const char *gamename, u32 signature, void (CLIB_DECL *errormsg)(const char *fmt, ...), const char *error_prefix);
+
// internal state
running_machine & m_machine; // reference to our machine
std::unique_ptr<rewinder> m_rewind; // rewinder
diff --git a/src/lib/util/strformat.cpp b/src/lib/util/strformat.cpp
index c47bb1b8996..e72e8b74a83 100644
--- a/src/lib/util/strformat.cpp
+++ b/src/lib/util/strformat.cpp
@@ -36,17 +36,550 @@ template void format_flags::apply(vectorstream &) const;
template void format_flags::apply(wvectorstream &) const;
template class format_argument<std::ostream>;
+template void format_argument<std::ostream>::static_output<char>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<signed char>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<unsigned char>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<short>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<unsigned short>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<int>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<unsigned int>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<long>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<unsigned long>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<long long>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<unsigned long long>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<char *>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<char const *>(std::ostream &, format_flags const &, void const *);
+template void format_argument<std::ostream>::static_output<std::string>(std::ostream &, format_flags const &, void const *);
+template bool format_argument<std::ostream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<char *>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<char const *>(void const *, int &);
+template bool format_argument<std::ostream>::static_make_integer<std::string>(void const *, int &);
+template void format_argument<std::ostream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<char *>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<char const *>(void const *, std::streamoff);
+template void format_argument<std::ostream>::static_store_integer<std::string>(void const *, std::streamoff);
+
template class format_argument<std::wostream>;
+template void format_argument<std::wostream>::static_output<char>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<signed char>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<unsigned char>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<wchar_t>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<short>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<unsigned short>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<int>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<unsigned int>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<long>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<unsigned long>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<long long>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<unsigned long long>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<wchar_t *>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<wchar_t const *>(std::wostream &, format_flags const &, void const *);
+template void format_argument<std::wostream>::static_output<std::wstring>(std::wostream &, format_flags const &, void const *);
+template bool format_argument<std::wostream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<wchar_t>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<wchar_t *>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<wchar_t const *>(void const *, int &);
+template bool format_argument<std::wostream>::static_make_integer<std::wstring>(void const *, int &);
+template void format_argument<std::wostream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+template void format_argument<std::wostream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
template class format_argument<std::iostream>;
+template void format_argument<std::iostream>::static_output<char>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<signed char>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<unsigned char>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<short>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<unsigned short>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<int>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<unsigned int>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<long>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<unsigned long>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<long long>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<unsigned long long>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<char *>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<char const *>(std::iostream &, format_flags const &, void const *);
+template void format_argument<std::iostream>::static_output<std::string>(std::iostream &, format_flags const &, void const *);
+template bool format_argument<std::iostream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<char *>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<char const *>(void const *, int &);
+template bool format_argument<std::iostream>::static_make_integer<std::string>(void const *, int &);
+template void format_argument<std::iostream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<char *>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<char const *>(void const *, std::streamoff);
+template void format_argument<std::iostream>::static_store_integer<std::string>(void const *, std::streamoff);
+
template class format_argument<std::wiostream>;
+template void format_argument<std::wiostream>::static_output<char>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<signed char>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<unsigned char>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<wchar_t>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<short>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<unsigned short>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<int>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<unsigned int>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<long>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<unsigned long>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<long long>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<unsigned long long>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<wchar_t *>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<wchar_t const *>(std::wiostream &, format_flags const &, void const *);
+template void format_argument<std::wiostream>::static_output<std::wstring>(std::wiostream &, format_flags const &, void const *);
+template bool format_argument<std::wiostream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<wchar_t>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<wchar_t *>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<wchar_t const *>(void const *, int &);
+template bool format_argument<std::wiostream>::static_make_integer<std::wstring>(void const *, int &);
+template void format_argument<std::wiostream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+template void format_argument<std::wiostream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
template class format_argument<std::ostringstream>;
+template void format_argument<std::ostringstream>::static_output<char>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<signed char>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<unsigned char>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<short>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<unsigned short>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<int>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<unsigned int>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<long>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<unsigned long>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<long long>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<unsigned long long>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<char *>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<char const *>(std::ostringstream &, format_flags const &, void const *);
+template void format_argument<std::ostringstream>::static_output<std::string>(std::ostringstream &, format_flags const &, void const *);
+template bool format_argument<std::ostringstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<char *>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<char const *>(void const *, int &);
+template bool format_argument<std::ostringstream>::static_make_integer<std::string>(void const *, int &);
+template void format_argument<std::ostringstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<char *>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<char const *>(void const *, std::streamoff);
+template void format_argument<std::ostringstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
template class format_argument<std::wostringstream>;
+template void format_argument<std::wostringstream>::static_output<char>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<signed char>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<unsigned char>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<wchar_t>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<short>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<unsigned short>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<int>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<unsigned int>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<long>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<unsigned long>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<long long>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<unsigned long long>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<wchar_t *>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<wchar_t const *>(std::wostringstream &, format_flags const &, void const *);
+template void format_argument<std::wostringstream>::static_output<std::wstring>(std::wostringstream &, format_flags const &, void const *);
+template bool format_argument<std::wostringstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<wchar_t>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<wchar_t *>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<wchar_t const *>(void const *, int &);
+template bool format_argument<std::wostringstream>::static_make_integer<std::wstring>(void const *, int &);
+template void format_argument<std::wostringstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+template void format_argument<std::wostringstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
template class format_argument<std::stringstream>;
+template void format_argument<std::stringstream>::static_output<char>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<signed char>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<unsigned char>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<short>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<unsigned short>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<int>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<unsigned int>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<long>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<unsigned long>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<long long>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<unsigned long long>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<char *>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<char const *>(std::stringstream &, format_flags const &, void const *);
+template void format_argument<std::stringstream>::static_output<std::string>(std::stringstream &, format_flags const &, void const *);
+template bool format_argument<std::stringstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<char *>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<char const *>(void const *, int &);
+template bool format_argument<std::stringstream>::static_make_integer<std::string>(void const *, int &);
+template void format_argument<std::stringstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<char *>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<char const *>(void const *, std::streamoff);
+template void format_argument<std::stringstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
template class format_argument<std::wstringstream>;
+template void format_argument<std::wstringstream>::static_output<char>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<signed char>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<unsigned char>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<wchar_t>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<short>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<unsigned short>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<int>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<unsigned int>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<long>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<unsigned long>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<long long>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<unsigned long long>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<wchar_t *>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<wchar_t const *>(std::wstringstream &, format_flags const &, void const *);
+template void format_argument<std::wstringstream>::static_output<std::wstring>(std::wstringstream &, format_flags const &, void const *);
+template bool format_argument<std::wstringstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<wchar_t>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<wchar_t *>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<wchar_t const *>(void const *, int &);
+template bool format_argument<std::wstringstream>::static_make_integer<std::wstring>(void const *, int &);
+template void format_argument<std::wstringstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+template void format_argument<std::wstringstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
template class format_argument<ovectorstream>;
+template void format_argument<ovectorstream>::static_output<char>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<signed char>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<unsigned char>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<short>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<unsigned short>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<int>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<unsigned int>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<long>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<unsigned long>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<long long>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<unsigned long long>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<char *>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<char const *>(ovectorstream &, format_flags const &, void const *);
+template void format_argument<ovectorstream>::static_output<std::string>(ovectorstream &, format_flags const &, void const *);
+template bool format_argument<ovectorstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<char *>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<char const *>(void const *, int &);
+template bool format_argument<ovectorstream>::static_make_integer<std::string>(void const *, int &);
+template void format_argument<ovectorstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<char *>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<char const *>(void const *, std::streamoff);
+template void format_argument<ovectorstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
template class format_argument<wovectorstream>;
+template void format_argument<wovectorstream>::static_output<char>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<signed char>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<unsigned char>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<wchar_t>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<short>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<unsigned short>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<int>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<unsigned int>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<long>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<unsigned long>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<long long>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<unsigned long long>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<wchar_t *>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<wchar_t const *>(wovectorstream &, format_flags const &, void const *);
+template void format_argument<wovectorstream>::static_output<std::wstring>(wovectorstream &, format_flags const &, void const *);
+template bool format_argument<wovectorstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<wchar_t>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<wchar_t *>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<wchar_t const *>(void const *, int &);
+template bool format_argument<wovectorstream>::static_make_integer<std::wstring>(void const *, int &);
+template void format_argument<wovectorstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+template void format_argument<wovectorstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
template class format_argument<vectorstream>;
+template void format_argument<vectorstream>::static_output<char>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<signed char>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<unsigned char>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<short>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<unsigned short>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<int>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<unsigned int>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<long>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<unsigned long>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<long long>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<unsigned long long>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<char *>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<char const *>(vectorstream &, format_flags const &, void const *);
+template void format_argument<vectorstream>::static_output<std::string>(vectorstream &, format_flags const &, void const *);
+template bool format_argument<vectorstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<char *>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<char const *>(void const *, int &);
+template bool format_argument<vectorstream>::static_make_integer<std::string>(void const *, int &);
+template void format_argument<vectorstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<char *>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<char const *>(void const *, std::streamoff);
+template void format_argument<vectorstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
template class format_argument<wvectorstream>;
+template void format_argument<wvectorstream>::static_output<char>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<signed char>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<unsigned char>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<wchar_t>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<short>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<unsigned short>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<int>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<unsigned int>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<long>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<unsigned long>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<long long>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<unsigned long long>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<wchar_t *>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<wchar_t const *>(wvectorstream &, format_flags const &, void const *);
+template void format_argument<wvectorstream>::static_output<std::wstring>(wvectorstream &, format_flags const &, void const *);
+template bool format_argument<wvectorstream>::static_make_integer<char>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<signed char>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<unsigned char>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<wchar_t>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<short>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<unsigned short>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<int>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<unsigned int>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<long>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<unsigned long>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<long long>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<wchar_t *>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<wchar_t const *>(void const *, int &);
+template bool format_argument<wvectorstream>::static_make_integer<std::wstring>(void const *, int &);
+template void format_argument<wvectorstream>::static_store_integer<char>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<short>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<int>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<long>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+template void format_argument<wvectorstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
template class format_argument_pack<std::ostream>;
template class format_argument_pack<std::wostream>;
diff --git a/src/lib/util/strformat.h b/src/lib/util/strformat.h
index cfba977f69c..98c599f4ad6 100644
--- a/src/lib/util/strformat.h
+++ b/src/lib/util/strformat.h
@@ -1797,17 +1797,550 @@ extern template void format_flags::apply(vectorstream &) const;
extern template void format_flags::apply(wvectorstream &) const;
extern template class format_argument<std::ostream>;
+extern template void format_argument<std::ostream>::static_output<char>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<signed char>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<unsigned char>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<short>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<unsigned short>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<int>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<unsigned int>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<long>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<unsigned long>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<long long>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<unsigned long long>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<char *>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<char const *>(std::ostream &, format_flags const &, void const *);
+extern template void format_argument<std::ostream>::static_output<std::string>(std::ostream &, format_flags const &, void const *);
+extern template bool format_argument<std::ostream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<char *>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<char const *>(void const *, int &);
+extern template bool format_argument<std::ostream>::static_make_integer<std::string>(void const *, int &);
+extern template void format_argument<std::ostream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<char *>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<char const *>(void const *, std::streamoff);
+extern template void format_argument<std::ostream>::static_store_integer<std::string>(void const *, std::streamoff);
+
extern template class format_argument<std::wostream>;
+extern template void format_argument<std::wostream>::static_output<char>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<signed char>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<unsigned char>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<wchar_t>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<short>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<unsigned short>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<int>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<unsigned int>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<long>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<unsigned long>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<long long>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<unsigned long long>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<wchar_t *>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<wchar_t const *>(std::wostream &, format_flags const &, void const *);
+extern template void format_argument<std::wostream>::static_output<std::wstring>(std::wostream &, format_flags const &, void const *);
+extern template bool format_argument<std::wostream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<wchar_t>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<wchar_t *>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<wchar_t const *>(void const *, int &);
+extern template bool format_argument<std::wostream>::static_make_integer<std::wstring>(void const *, int &);
+extern template void format_argument<std::wostream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+extern template void format_argument<std::wostream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
extern template class format_argument<std::iostream>;
+extern template void format_argument<std::iostream>::static_output<char>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<signed char>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<unsigned char>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<short>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<unsigned short>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<int>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<unsigned int>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<long>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<unsigned long>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<long long>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<unsigned long long>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<char *>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<char const *>(std::iostream &, format_flags const &, void const *);
+extern template void format_argument<std::iostream>::static_output<std::string>(std::iostream &, format_flags const &, void const *);
+extern template bool format_argument<std::iostream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<char *>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<char const *>(void const *, int &);
+extern template bool format_argument<std::iostream>::static_make_integer<std::string>(void const *, int &);
+extern template void format_argument<std::iostream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<char *>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<char const *>(void const *, std::streamoff);
+extern template void format_argument<std::iostream>::static_store_integer<std::string>(void const *, std::streamoff);
+
extern template class format_argument<std::wiostream>;
+extern template void format_argument<std::wiostream>::static_output<char>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<signed char>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<unsigned char>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<wchar_t>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<short>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<unsigned short>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<int>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<unsigned int>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<long>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<unsigned long>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<long long>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<unsigned long long>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<wchar_t *>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<wchar_t const *>(std::wiostream &, format_flags const &, void const *);
+extern template void format_argument<std::wiostream>::static_output<std::wstring>(std::wiostream &, format_flags const &, void const *);
+extern template bool format_argument<std::wiostream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<wchar_t>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<wchar_t *>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<wchar_t const *>(void const *, int &);
+extern template bool format_argument<std::wiostream>::static_make_integer<std::wstring>(void const *, int &);
+extern template void format_argument<std::wiostream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+extern template void format_argument<std::wiostream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
extern template class format_argument<std::ostringstream>;
+extern template void format_argument<std::ostringstream>::static_output<char>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<signed char>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<unsigned char>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<short>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<unsigned short>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<int>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<unsigned int>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<long>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<unsigned long>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<long long>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<unsigned long long>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<char *>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<char const *>(std::ostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::ostringstream>::static_output<std::string>(std::ostringstream &, format_flags const &, void const *);
+extern template bool format_argument<std::ostringstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<char *>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<char const *>(void const *, int &);
+extern template bool format_argument<std::ostringstream>::static_make_integer<std::string>(void const *, int &);
+extern template void format_argument<std::ostringstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<char *>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<char const *>(void const *, std::streamoff);
+extern template void format_argument<std::ostringstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
extern template class format_argument<std::wostringstream>;
+extern template void format_argument<std::wostringstream>::static_output<char>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<signed char>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<unsigned char>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<wchar_t>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<short>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<unsigned short>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<int>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<unsigned int>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<long>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<unsigned long>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<long long>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<unsigned long long>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<wchar_t *>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<wchar_t const *>(std::wostringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wostringstream>::static_output<std::wstring>(std::wostringstream &, format_flags const &, void const *);
+extern template bool format_argument<std::wostringstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<wchar_t>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<wchar_t *>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<wchar_t const *>(void const *, int &);
+extern template bool format_argument<std::wostringstream>::static_make_integer<std::wstring>(void const *, int &);
+extern template void format_argument<std::wostringstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+extern template void format_argument<std::wostringstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
extern template class format_argument<std::stringstream>;
+extern template void format_argument<std::stringstream>::static_output<char>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<signed char>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<unsigned char>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<short>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<unsigned short>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<int>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<unsigned int>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<long>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<unsigned long>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<long long>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<unsigned long long>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<char *>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<char const *>(std::stringstream &, format_flags const &, void const *);
+extern template void format_argument<std::stringstream>::static_output<std::string>(std::stringstream &, format_flags const &, void const *);
+extern template bool format_argument<std::stringstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<char *>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<char const *>(void const *, int &);
+extern template bool format_argument<std::stringstream>::static_make_integer<std::string>(void const *, int &);
+extern template void format_argument<std::stringstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<char *>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<char const *>(void const *, std::streamoff);
+extern template void format_argument<std::stringstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
extern template class format_argument<std::wstringstream>;
+extern template void format_argument<std::wstringstream>::static_output<char>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<signed char>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<unsigned char>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<wchar_t>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<short>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<unsigned short>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<int>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<unsigned int>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<long>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<unsigned long>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<long long>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<unsigned long long>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<wchar_t *>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<wchar_t const *>(std::wstringstream &, format_flags const &, void const *);
+extern template void format_argument<std::wstringstream>::static_output<std::wstring>(std::wstringstream &, format_flags const &, void const *);
+extern template bool format_argument<std::wstringstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<wchar_t>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<wchar_t *>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<wchar_t const *>(void const *, int &);
+extern template bool format_argument<std::wstringstream>::static_make_integer<std::wstring>(void const *, int &);
+extern template void format_argument<std::wstringstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+extern template void format_argument<std::wstringstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
extern template class format_argument<ovectorstream>;
+extern template void format_argument<ovectorstream>::static_output<char>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<signed char>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<unsigned char>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<short>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<unsigned short>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<int>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<unsigned int>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<long>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<unsigned long>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<long long>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<unsigned long long>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<char *>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<char const *>(ovectorstream &, format_flags const &, void const *);
+extern template void format_argument<ovectorstream>::static_output<std::string>(ovectorstream &, format_flags const &, void const *);
+extern template bool format_argument<ovectorstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<char *>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<char const *>(void const *, int &);
+extern template bool format_argument<ovectorstream>::static_make_integer<std::string>(void const *, int &);
+extern template void format_argument<ovectorstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<char *>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<char const *>(void const *, std::streamoff);
+extern template void format_argument<ovectorstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
extern template class format_argument<wovectorstream>;
+extern template void format_argument<wovectorstream>::static_output<char>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<signed char>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<unsigned char>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<wchar_t>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<short>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<unsigned short>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<int>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<unsigned int>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<long>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<unsigned long>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<long long>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<unsigned long long>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<wchar_t *>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<wchar_t const *>(wovectorstream &, format_flags const &, void const *);
+extern template void format_argument<wovectorstream>::static_output<std::wstring>(wovectorstream &, format_flags const &, void const *);
+extern template bool format_argument<wovectorstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<wchar_t>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<wchar_t *>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<wchar_t const *>(void const *, int &);
+extern template bool format_argument<wovectorstream>::static_make_integer<std::wstring>(void const *, int &);
+extern template void format_argument<wovectorstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+extern template void format_argument<wovectorstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
+
extern template class format_argument<vectorstream>;
+extern template void format_argument<vectorstream>::static_output<char>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<signed char>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<unsigned char>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<short>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<unsigned short>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<int>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<unsigned int>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<long>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<unsigned long>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<long long>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<unsigned long long>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<char *>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<char const *>(vectorstream &, format_flags const &, void const *);
+extern template void format_argument<vectorstream>::static_output<std::string>(vectorstream &, format_flags const &, void const *);
+extern template bool format_argument<vectorstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<char *>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<char const *>(void const *, int &);
+extern template bool format_argument<vectorstream>::static_make_integer<std::string>(void const *, int &);
+extern template void format_argument<vectorstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<char *>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<char const *>(void const *, std::streamoff);
+extern template void format_argument<vectorstream>::static_store_integer<std::string>(void const *, std::streamoff);
+
extern template class format_argument<wvectorstream>;
+extern template void format_argument<wvectorstream>::static_output<char>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<signed char>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<unsigned char>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<wchar_t>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<short>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<unsigned short>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<int>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<unsigned int>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<long>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<unsigned long>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<long long>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<unsigned long long>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<wchar_t *>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<wchar_t const *>(wvectorstream &, format_flags const &, void const *);
+extern template void format_argument<wvectorstream>::static_output<std::wstring>(wvectorstream &, format_flags const &, void const *);
+extern template bool format_argument<wvectorstream>::static_make_integer<char>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<signed char>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<unsigned char>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<wchar_t>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<short>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<unsigned short>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<int>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<unsigned int>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<long>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<unsigned long>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<long long>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<unsigned long long>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<wchar_t *>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<wchar_t const *>(void const *, int &);
+extern template bool format_argument<wvectorstream>::static_make_integer<std::wstring>(void const *, int &);
+extern template void format_argument<wvectorstream>::static_store_integer<char>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<signed char>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<unsigned char>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<wchar_t>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<short>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<unsigned short>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<int>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<unsigned int>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<long>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<unsigned long>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<long long>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<unsigned long long>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<wchar_t *>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<wchar_t const *>(void const *, std::streamoff);
+extern template void format_argument<wvectorstream>::static_store_integer<std::wstring>(void const *, std::streamoff);
extern template class format_argument_pack<std::ostream>;
extern template class format_argument_pack<std::wostream>;
diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt
index 1ea3d22983c..0f9b282329c 100644
--- a/src/mame/arcade.flt
+++ b/src/mame/arcade.flt
@@ -743,6 +743,7 @@ merit.cpp
merit3xx.cpp
meritm.cpp
merits.cpp
+meritsdx.cpp
mermaid.cpp
metalmx.cpp
metlclsh.cpp
diff --git a/src/mame/audio/taito_en.cpp b/src/mame/audio/taito_en.cpp
index 103d138540b..5a9281104da 100644
--- a/src/mame/audio/taito_en.cpp
+++ b/src/mame/audio/taito_en.cpp
@@ -68,7 +68,6 @@ void taito_en_device::device_reset()
/* reset CPU to catch any banking of startup vectors */
m_audiocpu->reset();
- m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
diff --git a/src/mame/drivers/advision.cpp b/src/mame/drivers/advision.cpp
index ca9c168cbe9..dc28f8b17e7 100644
--- a/src/mame/drivers/advision.cpp
+++ b/src/mame/drivers/advision.cpp
@@ -1,9 +1,7 @@
// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
+// copyright-holders:Dan Boris
/*************************************************************************
- drivers/advision.c
-
Driver for the Entex Adventure Vision
**************************************************************************/
diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp
index 8cf3b5d42b6..552d752ff94 100644
--- a/src/mame/drivers/at.cpp
+++ b/src/mame/drivers/at.cpp
@@ -645,7 +645,7 @@ void at_state::at486(machine_config &config)
maincpu.set_addrmap(AS_IO, &at_state::at32_io);
maincpu.set_irq_acknowledge_callback("mb:pic8259_master", FUNC(pic8259_device::inta_cb));
- AT_MB(config, m_mb, 0).at_softlists(config);
+ AT_MB(config, m_mb, 0).at_softlists(config);
config.set_maximum_quantum(attotime::from_hz(60));
diff --git a/src/mame/drivers/clxvme186.cpp b/src/mame/drivers/clxvme186.cpp
index 1594c6bdd80..ec3fdc68bb6 100644
--- a/src/mame/drivers/clxvme186.cpp
+++ b/src/mame/drivers/clxvme186.cpp
@@ -10,7 +10,7 @@
#include "cpu/i86/i186.h"
//#include "bus/vme/vme.h"
#include "machine/74259.h"
-//#include "machine/m3000.h"
+#include "machine/m3002.h"
#include "machine/z80scc.h"
class clxvme186_state : public driver_device
@@ -65,7 +65,7 @@ void clxvme186_state::io_map(address_map &map)
{
map(0xe000, 0xe001).unmaprw(); // SASI data port (PCS0)
map(0xe080, 0xe087).rw("scc", FUNC(scc8530_device::ab_dc_r), FUNC(scc8530_device::ab_dc_w)).umask16(0x00ff); // Serial I/O ports A & B (PCS1)
- //map(0xe100, 0xe100).rw("rtc", FUNC(m3000_device::read), FUNC(m3000_device::write)); // Real time clock (PCS2)
+ map(0xe100, 0xe100).rw("rtc", FUNC(m3000_device::read), FUNC(m3000_device::write)); // Real time clock (PCS2)
map(0xe180, 0xe181).portr("TTL"); // TTL input port (PCS3)
map(0xe180, 0xe181).w(FUNC(clxvme186_state::unknown_w));
map(0xe190, 0xe190).r(FUNC(clxvme186_state::sasi_status_r)); // SASI status port (PCS3)
@@ -85,7 +85,7 @@ static INPUT_PORTS_START(clxvme186)
PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN) // Printer busy
PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN) // Printer paper empty
PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN) // /SYSFAIL
- PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN) // Real time clock busy
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("rtc", m3000_device, busy_r)
PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN) // Colex use only
PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN) // Colex use only
PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN) // /ACFAIL
@@ -102,7 +102,7 @@ void clxvme186_state::clxvme186(machine_config &config)
SCC8530N(config, "scc", 3.6864_MHz_XTAL);
- //M3000(config, "rtc", 32.768_kHz_XTAL);
+ M3000(config, "rtc", 32.768_kHz_XTAL);
LS259(config, "ctrllatch");
}
diff --git a/src/mame/drivers/cms.cpp b/src/mame/drivers/cms.cpp
index 5b081ec3554..1c093c1bb64 100644
--- a/src/mame/drivers/cms.cpp
+++ b/src/mame/drivers/cms.cpp
@@ -23,7 +23,7 @@
&FC00-&FC0F CPU card VIA
&FC10-&FC1F GDP card control register
&FC20-&FC2F GDP card colour register
- &FC30-&FC3F Real-Time-Clock registers
+ &FC30-&FC3F Real-Time-Clock registers (EM M3002)
&FC40-&FC4F Disc controller registers
&FC50-&FC5F Disc controller drive select register
&FC60-&FC6F IEEE controller card
@@ -48,6 +48,7 @@
#include "cpu/m6502/m6502.h"
#include "machine/6522via.h"
#include "machine/input_merger.h"
+#include "machine/m3002.h"
#include "bus/acorn/bus.h"
#include "coreutil.h"
@@ -76,10 +77,6 @@ private:
DECLARE_WRITE8_MEMBER(map_select_w);
DECLARE_WRITE8_MEMBER(page_select_w);
DECLARE_WRITE_LINE_MEMBER(bus_nmi_w);
- DECLARE_READ8_MEMBER(cms_rtc_r);
- DECLARE_WRITE8_MEMBER(cms_rtc_w);
-
- void cms_rtc_set_time();
required_device<cpu_device> m_maincpu;
required_memory_region m_rom;
@@ -92,18 +89,6 @@ private:
uint8_t m_map_select;
uint8_t m_page_select[4];
-
- uint8_t m_rtc_data[0x10];
- int m_rtc_reg;
- int m_rtc_state;
-
- void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
- emu_timer* m_rtc_timer;
-
- enum
- {
- TIMER_RTC
- };
};
@@ -114,7 +99,7 @@ void cms_state::cms6502_mem(address_map &map)
map(0x8000, 0xbfff).bankr("bank1").w(FUNC(cms_state::page_select_w));
map(0xc000, 0xffff).rom().region("mos", 0);
map(0xfc00, 0xfc0f).m(m_via, FUNC(via6522_device::map));
- map(0xfc30, 0xfc3f).rw(FUNC(cms_state::cms_rtc_r), FUNC(cms_state::cms_rtc_w));
+ map(0xfc30, 0xfc30).mirror(0xf).rw("rtc", FUNC(m3002_device::read), FUNC(m3002_device::write));
map(0xfc70, 0xfc7f).w(FUNC(cms_state::map_select_w));
}
@@ -145,14 +130,6 @@ void cms_state::machine_start()
{
m_bank1->configure_entries(0, 16, m_rom->base(), 0x4000);
- memset(&m_rtc_data, 0, sizeof(m_rtc_data));
- m_rtc_reg = 0;
- m_rtc_state = 0;
- m_rtc_data[0xf] = 1;
-
- m_rtc_timer = timer_alloc();
- m_rtc_timer->adjust(attotime::zero, 0, attotime(1, 0));
-
/* register for save states */
save_item(NAME(m_map_select));
save_item(NAME(m_page_select));
@@ -169,113 +146,6 @@ void cms_state::machine_reset()
m_bank1->set_entry(0);
}
-/* Real Time Clock and NVRAM EM M3002
-
-reg 0: seconds
-reg 1: minutes
-reg 2: hours
-reg 3: day 1 based
-reg 4: month 1 based
-reg 5: year
-reg 6: week day
-reg 7: week number
-reg ..
-reg 15: status
-
-*/
-
-void cms_state::cms_rtc_set_time()
-{
- system_time systime;
-
- /* get the current date/time from the core */
- machine().current_datetime(systime);
-
- m_rtc_data[0] = dec_2_bcd(systime.utc_time.second);
- m_rtc_data[1] = dec_2_bcd(systime.utc_time.minute);
- m_rtc_data[2] = dec_2_bcd(systime.utc_time.hour);
-
- m_rtc_data[3] = dec_2_bcd(systime.utc_time.mday);
- m_rtc_data[4] = dec_2_bcd(systime.utc_time.month + 1);
- m_rtc_data[5] = dec_2_bcd(systime.utc_time.year % 100);
-}
-
-void cms_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- int month, year;
-
- switch (id)
- {
- case TIMER_RTC:
- m_rtc_data[0] = bcd_adjust(m_rtc_data[0] + 1);
- if (m_rtc_data[0] >= 0x60)
- {
- m_rtc_data[0] = 0;
- m_rtc_data[1] = bcd_adjust(m_rtc_data[1] + 1);
- if (m_rtc_data[1] >= 0x60)
- {
- m_rtc_data[1] = 0;
- m_rtc_data[2] = bcd_adjust(m_rtc_data[2] + 1);
- if (m_rtc_data[2] >= 0x24)
- {
- m_rtc_data[2] = 0;
- m_rtc_data[3] = bcd_adjust(m_rtc_data[3] + 1);
- month = bcd_2_dec(m_rtc_data[4]);
- year = bcd_2_dec(m_rtc_data[5]) + 2000; // save for julian_days_in_month_calculation
- if (m_rtc_data[3]> gregorian_days_in_month(month, year))
- {
- m_rtc_data[3] = 1;
- m_rtc_data[4] = bcd_adjust(m_rtc_data[4] + 1);
- if (m_rtc_data[4]>0x12)
- {
- m_rtc_data[4] = 1;
- m_rtc_data[5] = bcd_adjust(m_rtc_data[5] + 1) & 0xff;
- }
- }
- }
- }
- }
- break;
- }
-}
-
-READ8_MEMBER(cms_state::cms_rtc_r)
-{
- int data = 0;
-
- switch (m_rtc_state)
- {
- case 1:
- data = (m_rtc_data[m_rtc_reg] & 0xf0) >> 4;
- m_rtc_state++;
- break;
- case 2:
- data = m_rtc_data[m_rtc_reg] & 0xf;
- m_rtc_state = 0;
- break;
- }
- return data;
-}
-
-WRITE8_MEMBER(cms_state::cms_rtc_w)
-{
- switch (m_rtc_state)
- {
- case 0:
- m_rtc_reg = data;
- m_rtc_state = 1;
- break;
- case 1:
- m_rtc_data[m_rtc_reg] = (m_rtc_data[m_rtc_reg] & ~0xf0) | ((data & 0xf) << 4);
- m_rtc_state++;
- break;
- case 2:
- m_rtc_data[m_rtc_reg] = (m_rtc_data[m_rtc_reg] & ~0xf) | (data & 0xf);
- m_rtc_state = 0;
- break;
- }
-}
-
WRITE_LINE_MEMBER(cms_state::bus_nmi_w)
{
@@ -297,6 +167,8 @@ void cms_state::cms6502(machine_config &config)
VIA6522(config, m_via, 1_MHz_XTAL);
m_via->irq_handler().set("irqs", FUNC(input_merger_device::in_w<0>));
+ M3002(config, "rtc", 32.768_kHz_XTAL);
+
/* 7 Slot Backplane */
ACORN_BUS(config, m_bus, 0);
m_bus->set_space(m_maincpu, AS_PROGRAM);
diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp
index cd759911d5b..33843810851 100644
--- a/src/mame/drivers/dec0.cpp
+++ b/src/mame/drivers/dec0.cpp
@@ -1860,7 +1860,7 @@ void dec0_automat_state::automat(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &dec0_automat_state::automat_s_map);
/* video hardware */
- MCFG_VIDEO_START_OVERRIDE(dec0_state,dec0_nodma)
+ MCFG_VIDEO_START_OVERRIDE(dec0_automat_state,dec0_nodma)
BUFFERED_SPRITERAM16(config, m_spriteram);
@@ -1936,7 +1936,7 @@ void dec0_automat_state::secretab(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &dec0_automat_state::secretab_s_map);
/* video hardware */
- MCFG_VIDEO_START_OVERRIDE(dec0_state,dec0_nodma)
+ MCFG_VIDEO_START_OVERRIDE(dec0_automat_state,slyspy)
BUFFERED_SPRITERAM16(config, m_spriteram);
@@ -1954,6 +1954,7 @@ void dec0_automat_state::secretab(machine_config &config)
DECO_BAC06(config, m_tilegen[1], 0);
m_tilegen[1]->set_gfx_region_wide(0, 1, 0);
m_tilegen[1]->set_gfxdecode_tag("gfxdecode");
+ m_tilegen[1]->set_tile_callback(FUNC(dec0_automat_state::baddudes_tile_cb));
DECO_BAC06(config, m_tilegen[2], 0);
m_tilegen[2]->set_gfx_region_wide(0, 2, 0);
@@ -2035,7 +2036,7 @@ void dec0_state::bandit(machine_config &config)
mcu.port_out_cb<3>().set(FUNC(dec0_state::dec0_mcu_port3_w));
/* video hardware */
- m_screen->set_screen_update(FUNC(dec0_state::screen_update_bandit));
+ m_screen->set_screen_update(FUNC(dec0_state::screen_update_hbarrel));
m_spritegen->set_colpri_callback(FUNC(dec0_state::bandit_colpri_cb));
}
@@ -2051,6 +2052,11 @@ void dec0_state::baddudes(machine_config &config)
mcu.port_out_cb<3>().set(FUNC(dec0_state::dec0_mcu_port3_w));
/* video hardware */
+ MCFG_VIDEO_START_OVERRIDE(dec0_state,baddudes)
+
+ m_tilegen[1]->set_tile_callback(FUNC(dec0_state::baddudes_tile_cb));
+ m_tilegen[2]->set_tile_callback(FUNC(dec0_state::baddudes_tile_cb));
+
m_screen->set_screen_update(FUNC(dec0_state::screen_update_baddudes));
}
@@ -2059,6 +2065,11 @@ void dec0_state::drgninjab(machine_config &config)
dec0(config);
/* video hardware */
+ MCFG_VIDEO_START_OVERRIDE(dec0_state,baddudes)
+
+ m_tilegen[1]->set_tile_callback(FUNC(dec0_state::baddudes_tile_cb));
+ m_tilegen[2]->set_tile_callback(FUNC(dec0_state::baddudes_tile_cb));
+
m_screen->set_screen_update(FUNC(dec0_state::screen_update_baddudes));
}
@@ -2129,7 +2140,7 @@ void dec0_state::hippodrm(machine_config &config)
config.set_maximum_quantum(attotime::from_hz(300)); /* Interleave between H6280 & 68000 */
/* video hardware */
- m_screen->set_screen_update(FUNC(dec0_state::screen_update_hippodrm));
+ m_screen->set_screen_update(FUNC(dec0_state::screen_update_robocop));
m_screen->screen_vblank().set_inputline(m_subcpu, 1); /* VBL */
}
@@ -2145,7 +2156,7 @@ void dec0_state::ffantasybl(machine_config &config)
// config.set_maximum_quantum(attotime::from_hz(300)); /* Interleave between H6280 & 68000 */
/* video hardware */
- m_screen->set_screen_update(FUNC(dec0_state::screen_update_hippodrm));
+ m_screen->set_screen_update(FUNC(dec0_state::screen_update_robocop));
}
MACHINE_RESET_MEMBER(dec0_state,slyspy)
@@ -2175,6 +2186,10 @@ void dec0_state::slyspy(machine_config &config)
ADDRESS_MAP_BANK(config, "sndprotect").set_map(&dec0_state::slyspy_sound_protection_map).set_options(ENDIANNESS_LITTLE, 8, 21, 0x80000);
/* video hardware */
+ MCFG_VIDEO_START_OVERRIDE(dec0_state,slyspy)
+
+ m_tilegen[1]->set_tile_callback(FUNC(dec0_state::baddudes_tile_cb));
+
m_screen->set_screen_update(FUNC(dec0_state::screen_update_slyspy));
MCFG_MACHINE_RESET_OVERRIDE(dec0_state,slyspy)
@@ -2194,7 +2209,7 @@ void dec0_state::midres(machine_config &config)
audiocpu.add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
/* video hardware */
- m_screen->set_screen_update(FUNC(dec0_state::screen_update_midres));
+ m_screen->set_screen_update(FUNC(dec0_state::screen_update_robocop));
m_spritegen->set_colpri_callback(FUNC(dec0_state::midres_colpri_cb));
m_gfxdecode->set_info(gfx_midres);
diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp
index 7cedf39b5ea..ce2d0d1611a 100644
--- a/src/mame/drivers/dec8.cpp
+++ b/src/mame/drivers/dec8.cpp
@@ -2259,6 +2259,7 @@ void dec8_state::oscar(machine_config &config)
DECO_BAC06(config, m_tilegen[0], 0);
m_tilegen[0]->set_gfx_region_wide(2, 2, 0);
m_tilegen[0]->set_gfxdecode_tag(m_gfxdecode);
+ m_tilegen[0]->set_tile_callback(FUNC(dec8_state::oscar_tile_cb));
DECO_MXC06(config, m_spritegen_mxc, 0);
diff --git a/src/mame/drivers/europc.cpp b/src/mame/drivers/europc.cpp
index 7116d472661..572177a0005 100644
--- a/src/mame/drivers/europc.cpp
+++ b/src/mame/drivers/europc.cpp
@@ -34,7 +34,7 @@
#include "bus/isa/aga.h"
#include "bus/isa/fdc.h"
#include "machine/genpc.h"
-#include "machine/nvram.h"
+#include "machine/m3002.h"
#include "machine/pckeybrd.h"
#include "machine/ram.h"
@@ -50,6 +50,7 @@ public:
m_mb(*this, "mb"),
m_keyboard(*this, "pc_keyboard"),
m_ram(*this, RAM_TAG),
+ m_rtc(*this, "rtc"),
m_jim_state(0),
m_port61(0)
{ }
@@ -65,6 +66,7 @@ private:
required_device<pc_noppi_mb_device> m_mb;
required_device<pc_keyboard_device> m_keyboard;
required_device<ram_device> m_ram;
+ required_device<m3002_device> m_rtc;
DECLARE_WRITE8_MEMBER( europc_pio_w );
DECLARE_READ8_MEMBER( europc_pio_r );
@@ -73,26 +75,11 @@ private:
DECLARE_READ8_MEMBER ( europc_jim_r );
DECLARE_READ8_MEMBER ( europc_jim2_r );
- DECLARE_READ8_MEMBER( europc_rtc_r );
- DECLARE_WRITE8_MEMBER( europc_rtc_w );
-
- void europc_rtc_set_time();
-
uint8_t m_jim_data[16];
uint8_t m_jim_state;
isa8_aga_device::mode_t m_jim_mode;
int m_port61; // bit 0,1 must be 0 for startup; reset?
- uint8_t m_rtc_data[0x10];
- int m_rtc_reg;
- int m_rtc_state;
- void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
- emu_timer* m_rtc_timer;
-
- enum
- {
- TIMER_RTC
- };
void europc_io(address_map &map);
void europc_map(address_map &map);
};
@@ -208,7 +195,7 @@ WRITE8_MEMBER( europc_pc_state::europc_jim_w )
}
break;
case 0xa:
- europc_rtc_w(space, 0, data);
+ m_rtc->write(data);
return;
}
logerror("jim write %.2x %.2x\n", offset, data);
@@ -222,7 +209,7 @@ READ8_MEMBER( europc_pc_state::europc_jim_r )
{
case 4: case 5: case 6: case 7: data = m_jim_data[offset]; break;
case 0: case 1: case 2: case 3: data = 0; break;
- case 0xa: return europc_rtc_r(space, 0);
+ case 0xa: return m_rtc->read();
}
return data;
}
@@ -271,99 +258,6 @@ READ8_MEMBER( europc_pc_state::europc_jim2_r )
reg 0f: 01 status ok, when not 01 written
*/
-void europc_pc_state::europc_rtc_set_time()
-{
- system_time systime;
-
- /* get the current date/time from the core */
- machine().current_datetime(systime);
-
- m_rtc_data[0] = dec_2_bcd(systime.utc_time.second);
- m_rtc_data[1] = dec_2_bcd(systime.utc_time.minute);
- m_rtc_data[2] = dec_2_bcd(systime.utc_time.hour);
-
- m_rtc_data[3] = dec_2_bcd(systime.utc_time.mday);
- m_rtc_data[4] = dec_2_bcd(systime.utc_time.month + 1);
- m_rtc_data[5] = dec_2_bcd(systime.utc_time.year % 100);
-}
-
-void europc_pc_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- int month, year;
-
- switch(id)
- {
- case TIMER_RTC:
- m_rtc_data[0]=bcd_adjust(m_rtc_data[0]+1);
- if (m_rtc_data[0]>=0x60)
- {
- m_rtc_data[0]=0;
- m_rtc_data[1]=bcd_adjust(m_rtc_data[1]+1);
- if (m_rtc_data[1]>=0x60)
- {
- m_rtc_data[1]=0;
- m_rtc_data[2]=bcd_adjust(m_rtc_data[2]+1);
- if (m_rtc_data[2]>=0x24)
- {
- m_rtc_data[2]=0;
- m_rtc_data[3]=bcd_adjust(m_rtc_data[3]+1);
- month=bcd_2_dec(m_rtc_data[4]);
- year=bcd_2_dec(m_rtc_data[5])+2000; // save for julian_days_in_month_calculation
- if (m_rtc_data[3]> gregorian_days_in_month(month, year))
- {
- m_rtc_data[3]=1;
- m_rtc_data[4]=bcd_adjust(m_rtc_data[4]+1);
- if (m_rtc_data[4]>0x12)
- {
- m_rtc_data[4]=1;
- m_rtc_data[5]=bcd_adjust(m_rtc_data[5]+1)&0xff;
- }
- }
- }
- }
- }
- break;
- }
-}
-
-READ8_MEMBER( europc_pc_state::europc_rtc_r )
-{
- int data=0;
- switch (m_rtc_state)
- {
- case 1:
- data=(m_rtc_data[m_rtc_reg]&0xf0)>>4;
- m_rtc_state++;
- break;
- case 2:
- data=m_rtc_data[m_rtc_reg]&0xf;
- m_rtc_state=0;
-// logerror("rtc read %x %.2x\n",m_rtc_reg, m_rtc_data[m_rtc_reg]);
- break;
- }
- return data;
-}
-
-WRITE8_MEMBER( europc_pc_state::europc_rtc_w )
-{
- switch (m_rtc_state)
- {
- case 0:
- m_rtc_reg=data;
- m_rtc_state=1;
- break;
- case 1:
- m_rtc_data[m_rtc_reg]=(m_rtc_data[m_rtc_reg]&~0xf0)|((data&0xf)<<4);
- m_rtc_state++;
- break;
- case 2:
- m_rtc_data[m_rtc_reg]=(m_rtc_data[m_rtc_reg]&~0xf)|(data&0xf);
- m_rtc_state=0;
-// logerror("rtc written %x %.2x\n",m_rtc_reg, m_rtc_data[m_rtc_reg]);
- break;
- }
-}
-
void europc_pc_state::init_europc()
{
uint8_t *rom = &memregion("bios")->base()[0];
@@ -380,17 +274,6 @@ void europc_pc_state::init_europc()
a += rom[i];
rom[0xffff] = 256 - a;
}
-
- memset(&m_rtc_data,0,sizeof(m_rtc_data));
- m_rtc_reg = 0;
- m_rtc_state = 0;
- m_rtc_data[0xf]=1;
-
- m_rtc_timer = timer_alloc();
- m_rtc_timer->adjust(attotime::zero, 0, attotime(1,0));
- // europc_rtc_set_time();
-
- subdevice<nvram_device>("nvram")->set_base(m_rtc_data, sizeof(m_rtc_data));
}
WRITE8_MEMBER( europc_pc_state::europc_pio_w )
@@ -522,6 +405,10 @@ public:
protected:
virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
+
+private:
+ void map(address_map &map);
};
DEFINE_DEVICE_TYPE(EUROPC_FDC, europc_fdc_device, "europc_fdc", "EURO PC FDC hookup")
@@ -539,14 +426,28 @@ static void pc_dd_floppies(device_slot_interface &device)
void europc_fdc_device::device_add_mconfig(machine_config &config)
{
- wd37c65c_device &fdc(WD37C65C(config, m_fdc, 16_MHz_XTAL));
- fdc.intrq_wr_callback().set(FUNC(isa8_fdc_device::irq_w));
- fdc.drq_wr_callback().set(FUNC(isa8_fdc_device::drq_w));
+ WD37C65C(config, m_fdc, 16_MHz_XTAL);
+ m_fdc->intrq_wr_callback().set(FUNC(europc_fdc_device::irq_w));
+ m_fdc->drq_wr_callback().set(FUNC(europc_fdc_device::drq_w));
// single built-in 3.5" 720K drive, connector for optional external 3.5" or 5.25" drive
FLOPPY_CONNECTOR(config, "fdc:0", pc_dd_floppies, "35dd", isa8_fdc_device::floppy_formats).set_fixed(true);
FLOPPY_CONNECTOR(config, "fdc:1", pc_dd_floppies, nullptr, isa8_fdc_device::floppy_formats);
}
+void europc_fdc_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x03f0, 0x03f7, *this, &europc_fdc_device::map);
+ m_isa->set_dma_channel(2, this, true);
+}
+
+void europc_fdc_device::map(address_map &map)
+{
+ map(2, 2).w(m_fdc, FUNC(wd37c65c_device::dor_w));
+ map(4, 5).m(m_fdc, FUNC(wd37c65c_device::map));
+ // TODO: DCR also decoded by JIM/BIGJIM
+}
+
static void europc_fdc(device_slot_interface &device)
{
device.option_add("fdc", EUROPC_FDC);
@@ -573,7 +474,7 @@ void europc_pc_state::europc(machine_config &config)
PC_KEYB(config, m_keyboard);
m_keyboard->keypress().set("mb:pic8259", FUNC(pic8259_device::ir1_w));
- NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);;
+ M3002(config, m_rtc, 32.768_kHz_XTAL);
/* internal ram */
// Machine came with 512K standard, 640K via expansion card, but BIOS offers 256K as well
diff --git a/src/mame/drivers/fp1100.cpp b/src/mame/drivers/fp1100.cpp
index 7d12ed2b1e3..dab8f080191 100644
--- a/src/mame/drivers/fp1100.cpp
+++ b/src/mame/drivers/fp1100.cpp
@@ -50,7 +50,7 @@
#define VERBOSE 0
#include "logmacro.h"
-#define MAIN_CLOCK 15974400
+#define MAIN_CLOCK 15.9744_MHz_XTAL
class fp1100_state : public driver_device
{
@@ -61,7 +61,9 @@ public:
, m_maincpu(*this, "maincpu")
, m_subcpu(*this, "sub")
, m_crtc(*this, "crtc")
- , m_p_videoram(*this, "videoram")
+ , m_ipl(*this, "ipl")
+ , m_wram(*this, "wram")
+ , m_videoram(*this, "videoram")
, m_keyboard(*this, "KEY.%u", 0)
, m_beep(*this, "beeper")
, m_centronics(*this, "centronics")
@@ -70,58 +72,62 @@ public:
void fp1100(machine_config &config);
- void init_fp1100();
-
protected:
virtual void machine_reset() override;
private:
- DECLARE_WRITE8_MEMBER(main_bank_w);
- DECLARE_WRITE8_MEMBER(irq_mask_w);
- DECLARE_WRITE8_MEMBER(slot_bank_w);
- DECLARE_READ8_MEMBER(slot_id_r);
- DECLARE_WRITE8_MEMBER(colour_control_w);
- DECLARE_WRITE8_MEMBER(kbd_row_w);
- DECLARE_WRITE8_MEMBER(porta_w);
- DECLARE_READ8_MEMBER(portb_r);
- DECLARE_READ8_MEMBER(portc_r);
- DECLARE_WRITE8_MEMBER(portc_w);
+ void main_bank_w(u8 data);
+ void irq_mask_w(u8 data);
+ void slot_bank_w(u8 data);
+ u8 slot_id_r();
+ u8 memory_r(offs_t offset);
+ void colour_control_w(u8 data);
+ void kbd_row_w(u8 data);
+ void porta_w(u8 data);
+ u8 portb_r();
+ u8 portc_r();
+ void portc_w(u8 data);
DECLARE_WRITE_LINE_MEMBER(centronics_busy_w);
INTERRUPT_GEN_MEMBER(vblank_irq);
MC6845_UPDATE_ROW(crtc_update_row);
TIMER_DEVICE_CALLBACK_MEMBER(kansas_w);
+
required_device<palette_device> m_palette;
+
void io_map(address_map &map);
void main_map(address_map &map);
void sub_map(address_map &map);
void handle_int_to_main();
- uint8_t m_irq_mask;
- uint8_t m_slot_num;
- uint8_t m_kbd_row;
- uint8_t m_col_border;
- uint8_t m_col_cursor;
- uint8_t m_col_display;
- uint8_t m_centronics_busy;
- uint8_t m_cass_data[4];
+ u8 m_irq_mask;
+ u8 m_slot_num;
+ u8 m_kbd_row;
+ u8 m_col_border;
+ u8 m_col_cursor;
+ u8 m_col_display;
+ u8 m_centronics_busy;
+ u8 m_cass_data[4];
+ bool m_bank_sel;
bool m_main_irq_status;
bool m_sub_irq_status;
bool m_cassbit;
bool m_cassold;
struct {
- uint8_t id;
+ u8 id;
}m_slot[8];
struct {
- uint8_t porta;
- uint8_t portb;
- uint8_t portc;
+ u8 porta;
+ u8 portb;
+ u8 portc;
}m_upd7801;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
required_device<mc6845_device> m_crtc;
- required_shared_ptr<uint8_t> m_p_videoram;
+ required_region_ptr<u8> m_ipl;
+ required_shared_ptr<u8> m_wram;
+ required_shared_ptr<u8> m_videoram;
required_ioport_array<16> m_keyboard;
required_device<beep_device> m_beep;
required_device<centronics_device> m_centronics;
@@ -131,19 +137,17 @@ private:
MC6845_UPDATE_ROW( fp1100_state::crtc_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint8_t r,g,b,col,i;
- uint16_t mem,x;
- uint32_t *p = &bitmap.pix32(y);
+ u32 *p = &bitmap.pix32(y);
if (BIT(m_upd7801.porta, 4))
{ // green screen
- for (x = 0; x < x_count; x++)
+ for (u16 x = 0; x < x_count; x++)
{
- mem = (((ma+x)<<3) + ra) & 0x3fff;
- g = m_p_videoram[mem];
- for (i = 0; i < 8; i++)
+ u16 mem = (((ma+x)<<3) + ra) & 0x3fff;
+ u8 g = m_videoram[mem];
+ for (u8 i = 0; i < 8; i++)
{
- col = BIT(g, i);
+ u8 col = BIT(g, i);
if (x == cursor_x) col ^= 1;
*p++ = palette[col<<1];
}
@@ -151,15 +155,15 @@ MC6845_UPDATE_ROW( fp1100_state::crtc_update_row )
}
else
{ // RGB screen
- for (x = 0; x < x_count; x++)
+ for (u16 x = 0; x < x_count; x++)
{
- mem = (((ma+x)<<3) + ra) & 0x3fff;
- b = m_p_videoram[mem];
- r = m_p_videoram[mem+0x4000];
- g = m_p_videoram[mem+0x8000];
- for (i = 0; i < 8; i++)
+ u16 mem = (((ma+x)<<3) + ra) & 0x3fff;
+ u8 b = m_videoram[mem];
+ u8 r = m_videoram[mem+0x4000];
+ u8 g = m_videoram[mem+0x8000];
+ for (u8 i = 0; i < 8; i++)
{
- col = BIT(r, i) + (BIT(g, i) << 1) + (BIT(b, i) << 2);
+ u8 col = BIT(r, i) + (BIT(g, i) << 1) + (BIT(b, i) << 2);
if (x == cursor_x) col = m_col_cursor;
*p++ = palette[col];
}
@@ -172,14 +176,14 @@ d0 - Package select
d1 - Bank select (at boot time)
other bits not used
*/
-WRITE8_MEMBER( fp1100_state::main_bank_w )
+void fp1100_state::main_bank_w(u8 data)
{
- membank("bankr0")->set_entry( BIT(data,1)); //(1) RAM (0) ROM
+ m_bank_sel = BIT(data, 1);
m_slot_num = (m_slot_num & 3) | ((data & 1) << 2); //??
}
// tell sub that latch has a byte
-WRITE8_MEMBER( fp1100_state::irq_mask_w )
+void fp1100_state::irq_mask_w(u8 data)
{
m_irq_mask = data;
handle_int_to_main();
@@ -201,33 +205,41 @@ WRITE8_MEMBER( fp1100_state::irq_mask_w )
LOG("%s: IRQmask=%X\n",machine().describe_context(),data);
}
-WRITE8_MEMBER( fp1100_state::slot_bank_w )
+void fp1100_state::slot_bank_w(u8 data)
{
m_slot_num = (data & 3) | (m_slot_num & 4);
}
-READ8_MEMBER( fp1100_state::slot_id_r )
+u8 fp1100_state::slot_id_r()
{
//return 0xff;
return m_slot[m_slot_num & 7].id;
}
+u8 fp1100_state::memory_r(offs_t offset)
+{
+ if (offset < 0x9000 && !m_bank_sel)
+ return m_ipl[offset];
+ else
+ return m_wram[offset];
+}
+
void fp1100_state::main_map(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0x8fff).bankr("bankr0").bankw("bankw0");
- map(0x9000, 0xffff).ram().region("wram", 0x9000);
+ map(0x0000, 0xffff).r(FUNC(fp1100_state::memory_r));
+ map(0x0000, 0xffff).writeonly().share("wram"); // always write to ram
}
void fp1100_state::io_map(address_map &map)
{
map.unmap_value_high();
//map(0x0000, 0xfeff) slot memory area
- map(0xff00, 0xff7f).rw(FUNC(fp1100_state::slot_id_r), FUNC(fp1100_state::slot_bank_w));
- map(0xff80, 0xffff).r("sub2main", FUNC(generic_latch_8_device::read));
- map(0xff80, 0xff9f).w(FUNC(fp1100_state::irq_mask_w));
- map(0xffa0, 0xffbf).w(FUNC(fp1100_state::main_bank_w));
- map(0xffc0, 0xffff).w("main2sub", FUNC(generic_latch_8_device::write));
+ map(0xff00, 0xff00).mirror(0x7f).rw(FUNC(fp1100_state::slot_id_r), FUNC(fp1100_state::slot_bank_w));
+ map(0xff80, 0xff80).mirror(0x7f).r("sub2main", FUNC(generic_latch_8_device::read));
+ map(0xff80, 0xff80).mirror(0x1f).w(FUNC(fp1100_state::irq_mask_w));
+ map(0xffa0, 0xffa0).mirror(0x1f).w(FUNC(fp1100_state::main_bank_w));
+ map(0xffc0, 0xffc0).mirror(0x3f).w("main2sub", FUNC(generic_latch_8_device::write));
}
/*
@@ -236,7 +248,7 @@ d3 - not used
d4,5,6 - colour of cursor; or display area (B,R,G) (see d7)
d7 - 1=display area; 0=cursor
*/
-WRITE8_MEMBER( fp1100_state::colour_control_w )
+void fp1100_state::colour_control_w(u8 data)
{
data = bitswap<8>(data, 7, 4, 6, 5, 3, 0, 2, 1); // change BRG to RGB
@@ -257,7 +269,7 @@ d4 - Beeper
d5 - "3state buffer of key data line (1=open, 0=closed)"
d6,7 - not used
*/
-WRITE8_MEMBER( fp1100_state::kbd_row_w )
+void fp1100_state::kbd_row_w(u8 data)
{
m_kbd_row = data;
m_beep->set_state(BIT(data, 4));
@@ -269,11 +281,11 @@ void fp1100_state::sub_map(address_map &map)
map(0x2000, 0xdfff).ram().share("videoram"); //vram B/R/G
map(0xe000, 0xe000).mirror(0x3fe).rw(m_crtc, FUNC(mc6845_device::status_r), FUNC(mc6845_device::address_w));
map(0xe001, 0xe001).mirror(0x3fe).rw(m_crtc, FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w));
- map(0xe400, 0xe7ff).portr("DSW").w(FUNC(fp1100_state::kbd_row_w));
- map(0xe800, 0xebff).r("main2sub", FUNC(generic_latch_8_device::read));
- map(0xe800, 0xebff).w("sub2main", FUNC(generic_latch_8_device::write));
- map(0xec00, 0xefff).lw8(NAME([this] (u8 data) { m_subcpu->set_input_line(UPD7810_INTF0, CLEAR_LINE); }));
- map(0xf000, 0xf3ff).w(FUNC(fp1100_state::colour_control_w));
+ map(0xe400, 0xe400).mirror(0x3ff).portr("DSW").w(FUNC(fp1100_state::kbd_row_w));
+ map(0xe800, 0xe800).mirror(0x3ff).r("main2sub", FUNC(generic_latch_8_device::read));
+ map(0xe800, 0xe800).mirror(0x3ff).w("sub2main", FUNC(generic_latch_8_device::write));
+ map(0xec00, 0xec00).mirror(0x3ff).lw8(NAME([this] (u8 data) { m_subcpu->set_input_line(UPD7810_INTF0, CLEAR_LINE); }));
+ map(0xf000, 0xf000).mirror(0x3ff).w(FUNC(fp1100_state::colour_control_w));
map(0xf400, 0xff7f).rom().region("sub_ipl", 0x2400);
}
@@ -286,15 +298,15 @@ d6 - CMT baud rate (1=300; 0=1200)
d7 - CMT load clock
The SO pin is Serial Output to CMT (1=2400Hz; 0=1200Hz)
*/
-WRITE8_MEMBER( fp1100_state::porta_w )
+void fp1100_state::porta_w(u8 data)
{
m_upd7801.porta = data;
if (BIT(data, 5))
- memset(m_p_videoram, 0, 0xc000);
+ memset(m_videoram, 0, 0xc000);
}
-READ8_MEMBER( fp1100_state::portb_r )
+u8 fp1100_state::portb_r()
{
u8 data = m_keyboard[m_kbd_row & 15]->read() ^ 0xff;
LOG("%s: PortB:%X:%X\n",machine().describe_context(),m_kbd_row,data);
@@ -311,7 +323,7 @@ d1 - Centronics error
d2 - CMT load input clock
d7 - CMT load serial data
*/
-READ8_MEMBER( fp1100_state::portc_r )
+u8 fp1100_state::portc_r()
{
return (m_upd7801.portc & 0x78) | m_centronics_busy;
}
@@ -322,7 +334,7 @@ d4 - Centronics port is used for input or output
d5 - CMT relay
d6 - Centronics strobe
*/
-WRITE8_MEMBER( fp1100_state::portc_w )
+void fp1100_state::portc_w(u8 data)
{
u8 bits = data ^ m_upd7801.portc;
m_upd7801.portc = data;
@@ -607,8 +619,8 @@ void fp1100_state::machine_reset()
m_main_irq_status = false;
m_sub_irq_status = false;
int i;
- uint8_t slot_type;
- const uint8_t id_type[4] = { 0xff, 0x00, 0x01, 0x04};
+ u8 slot_type;
+ const u8 id_type[4] = { 0xff, 0x00, 0x01, 0x04};
for(i=0;i<8;i++)
{
slot_type = (ioport("SLOTS")->read() >> i*2) & 3;
@@ -617,8 +629,7 @@ void fp1100_state::machine_reset()
m_beep->set_state(0);
- membank("bankr0")->set_entry(0); // point at rom
- membank("bankw0")->set_entry(0); // always write to ram
+ m_bank_sel = false; // point at rom
m_irq_mask = 0;
m_slot_num = 0;
@@ -632,16 +643,6 @@ void fp1100_state::machine_reset()
m_maincpu->set_input_line_vector(0, 0xF0);
}
-void fp1100_state::init_fp1100()
-{
- uint8_t *main = memregion("ipl")->base();
- uint8_t *wram = memregion("wram")->base();
-
- membank("bankr0")->configure_entry(1, &wram[0x0000]);
- membank("bankr0")->configure_entry(0, &main[0x0000]);
- membank("bankw0")->configure_entry(0, &wram[0x0000]);
-}
-
void fp1100_state::fp1100(machine_config &config)
{
/* basic machine hardware */
@@ -707,11 +708,9 @@ ROM_START( fp1100 )
ROM_LOAD( "sub1.rom", 0x0000, 0x1000, CRC(8feda489) SHA1(917d5b398b9e7b9a6bfa5e2f88c5b99923c3c2a3))
ROM_LOAD( "sub2.rom", 0x1000, 0x1000, CRC(359f007e) SHA1(0188d5a7b859075cb156ee55318611bd004128d7))
ROM_LOAD( "sub3.rom", 0x2000, 0xf80, BAD_DUMP CRC(fb2b577a) SHA1(a9ae6b03e06ea2f5db30dfd51ebf5aede01d9672))
-
- ROM_REGION( 0x10000, "wram", ROMREGION_ERASE00 )
ROM_END
/* Driver */
-/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
-COMP( 1983, fp1100, 0, 0, fp1100, fp1100, fp1100_state, init_fp1100, "Casio", "FP-1100", MACHINE_NOT_WORKING)
+/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
+COMP( 1983, fp1100, 0, 0, fp1100, fp1100, fp1100_state, empty_init, "Casio", "FP-1100", MACHINE_NOT_WORKING)
diff --git a/src/mame/drivers/ht68k.cpp b/src/mame/drivers/ht68k.cpp
index 27e2d99c0a7..22bfa0651f8 100644
--- a/src/mame/drivers/ht68k.cpp
+++ b/src/mame/drivers/ht68k.cpp
@@ -165,4 +165,4 @@ ROM_END
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
-COMP( 1987, ht68k, 0, 0, ht68k, ht68k, ht68k_state, empty_init, "Hawthorne Technology", "TinyGiant HT68k", MACHINE_NO_SOUND)
+COMP( 1987, ht68k, 0, 0, ht68k, ht68k, ht68k_state, empty_init, "Hawthorne Technology", "TinyGiant HT68k", MACHINE_NO_SOUND_HW )
diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp
index ca25960204c..97573e6f3a7 100644
--- a/src/mame/drivers/ibmpcjr.cpp
+++ b/src/mame/drivers/ibmpcjr.cpp
@@ -6,7 +6,6 @@
#include "imagedev/cassette.h"
#include "machine/i8255.h"
#include "machine/ins8250.h"
-#include "machine/pc_fdc.h"
#include "machine/pc_lpt.h"
#include "machine/pckeybrd.h"
#include "machine/pic8259.h"
diff --git a/src/mame/drivers/lbeach.cpp b/src/mame/drivers/lbeach.cpp
index 6ad432f3152..b9b85c39df8 100644
--- a/src/mame/drivers/lbeach.cpp
+++ b/src/mame/drivers/lbeach.cpp
@@ -5,29 +5,35 @@
Seletron / Olympia Long Beach
Olympia probably took care of distribution, PCB and game by Seletron
-PCB was broken, and there are no known references.
-16MHz XTAL, M6800 @ 500kHz
-2x 5101 sram 256x4bit (256 byte) battery backed
-4x 4045 sram 1kx4 (2K byte)
+Hardware notes:
+- 16MHz XTAL, MC6800P @ 500kHz
+- 2x 5101 sram 256x4bit (256 byte) battery backed
+- 4x 4045 sram 1kx4 (2K byte)
-6800 hits many illegal opcodes (0x02), though it's harmless.
-Maybe they meant to inserts nops (0x01) to remove debug stuff
-or to make room for future additions?
+6800 hits many illegal opcodes (0x02), though it's harmless. Maybe they meant
+to inserts nops (0x01) to remove debug stuff or to make room for future additions?
-Speed Race is on the same hardware, no mention of Olympia, but it is
-listed online on Olympia game lists. It is a reimagination of Taito's
-Speed Race, not a bootleg.
+Speed Race is on the same hardware, no mention of Olympia, but it is listed
+online on Olympia game lists. It is a reimagination of Taito's Speed Race,
+not a bootleg.
+
+Speed Race PCB where this dump came from had an incorrect CPU in place (MC68B09)
+maybe from a wrong repair. PCB label: Seletron, 10-50058. Less ROM data than lbeach.
TODO:
- discrete sound
- unknown writes (most of it is sound)
- improve colors, lbeach is monochrome but what about speedrs?
+- is steering wheel analog? eg. with pulses to d7
- some unknown romlabels (see "x")
- lbeach 93448.h4 rom is a bad dump? it misses animation frames compared to
speedrs, but when compared to enemy cars, it looks ok
- speedrs has nvram? high scores are not saved
- sprite x position is wrong, but moving it to the left will break speedrs
(it does a sprite collision check at boot)
+- right side of screen should not be rendered? but speedrs sprite collision
+ check wouldn't work then. Video recording(pcb to monitor, not cabinet)
+ of lbeach shows right side is cropped - it is handled in the .lay file
***************************************************************************/
@@ -57,10 +63,12 @@ public:
m_sprite_code(*this, "sprite_code"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette"),
- m_inputs(*this, "IN.%u", 0)
+ m_palette(*this, "palette")
{ }
+ DECLARE_CUSTOM_INPUT_MEMBER(col_bg_r) { return m_collision_bg_car; }
+ DECLARE_CUSTOM_INPUT_MEMBER(col_fg_r) { return m_collision_fg_car; }
+
void lbeach(machine_config &config);
protected:
@@ -77,7 +85,6 @@ private:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
- required_ioport_array<3> m_inputs;
int m_collision_bg_car = 0;
int m_collision_fg_car = 0;
@@ -91,8 +98,6 @@ private:
DECLARE_WRITE8_MEMBER(bg_vram_w);
DECLARE_WRITE8_MEMBER(fg_vram_w);
- DECLARE_READ8_MEMBER(in1_r);
- DECLARE_READ8_MEMBER(in2_r);
void init_palette(palette_device &palette) const;
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -174,7 +179,7 @@ u32 lbeach_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con
int sprite_y = 160;
m_colmap_car.fill(0, cliprect);
- m_gfxdecode->gfx(2)->transpen(m_colmap_car,cliprect, sprite_code, 0, 0, 0, sprite_x, sprite_y, 0);
+ m_gfxdecode->gfx(2)->transpen(m_colmap_car, cliprect, sprite_code, 0, 0, 0, sprite_x, sprite_y, 0);
bitmap_ind16 &fg_bitmap = m_fg_tilemap->pixmap();
m_collision_bg_car = 0;
@@ -193,18 +198,13 @@ u32 lbeach_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
// draw player car
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, sprite_code, 0, 0, 0, sprite_x, sprite_y, 0);
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, sprite_code | 0x10, 0, 0, 0, sprite_x, sprite_y + 16, 0);
+ m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, sprite_code, 0, 0, 0, sprite_x, sprite_y, 0);
+ m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, sprite_code | 0x10, 0, 0, 0, sprite_x, sprite_y + 16, 0);
return 0;
}
-
-/******************************************************************************
- I/O
-******************************************************************************/
-
WRITE8_MEMBER(lbeach_state::bg_vram_w)
{
m_bg_vram[offset] = data;
@@ -217,22 +217,6 @@ WRITE8_MEMBER(lbeach_state::fg_vram_w)
m_fg_tilemap->mark_tile_dirty(offset);
}
-READ8_MEMBER(lbeach_state::in1_r)
-{
- // d7: steering wheel active
- // d6: steering wheel direction
- return bitswap<8>(m_inputs[1]->read(),6,7,5,4,3,2,1,0);
-}
-
-READ8_MEMBER(lbeach_state::in2_r)
-{
- // d6 and d7 are for collision detection
- u8 d6 = m_collision_bg_car ? 0x80 : 0;
- u8 d7 = m_collision_fg_car ? 0x40 : 0;
-
- return (m_inputs[2]->read() & 0x3f) | d6 | d7;
-}
-
/******************************************************************************
@@ -243,10 +227,10 @@ void lbeach_state::main_map(address_map &map)
{
map(0x0000, 0x00ff).ram().share("nvram");
map(0x4000, 0x41ff).ram().w(FUNC(lbeach_state::bg_vram_w)).share("bg_vram");
- map(0x4000, 0x4000).r(FUNC(lbeach_state::in1_r));
+ map(0x4000, 0x4000).portr("IN.0");
map(0x4200, 0x43ff).ram();
map(0x4400, 0x47ff).ram().w(FUNC(lbeach_state::fg_vram_w)).share("fg_vram");
- map(0x8000, 0x8000).r(FUNC(lbeach_state::in2_r));
+ map(0x8000, 0x8000).portr("IN.1");
map(0x8000, 0x8000).writeonly().share("scroll_y");
map(0x8001, 0x8001).writeonly().share("sprite_x");
map(0x8002, 0x8002).writeonly().share("sprite_code");
@@ -254,7 +238,7 @@ void lbeach_state::main_map(address_map &map)
// map(0x8004, 0x8004).nopw(); // ?
// map(0x8005, 0x8005).nopw(); // ?
map(0x8007, 0x8007).nopw(); // probably watchdog
- map(0xa000, 0xa000).portr("IN.0");
+ map(0xa000, 0xa000).portr("IN.2");
// map(0xa003, 0xa003).nopr(); // ? tests d7 at game over
map(0xc000, 0xcfff).rom();
map(0xf000, 0xffff).rom();
@@ -268,58 +252,63 @@ void lbeach_state::main_map(address_map &map)
static INPUT_PORTS_START( lbeach )
PORT_START("IN.0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas Pedal")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Shifter 1st Gear")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Shifter 2nd Gear")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Shifter 3rd Gear")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Shifter 4th Gear")
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset Record") // called RR in testmode
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Coin Counter") // called CC in testmode
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
-
- PORT_START("IN.1")
PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
- PORT_BIT(0xc0, 0x40, IPT_PADDLE ) PORT_INVERT PORT_MINMAX(0x00,0x80) PORT_SENSITIVITY(50) PORT_KEYDELTA(1) PORT_CENTERDELTA(1)
+ PORT_BIT( 0x40, 0x40, IPT_CUSTOM ) PORT_CONDITION("STEER", 0x02, EQUALS, 0x00) // steering wheel direction
+ PORT_BIT( 0x80, 0x80, IPT_CUSTOM ) PORT_CONDITION("STEER", 0x01, EQUALS, 0x00) // steering wheel active
- PORT_START("IN.2")
+ PORT_START("IN.1")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) // dupe
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
- PORT_DIPNAME( 0x0c, 0x00, "Refueling Point" )
+ PORT_DIPNAME( 0x0c, 0x04, "Refueling Point" )
PORT_DIPSETTING( 0x00, "200 km" )
PORT_DIPSETTING( 0x04, "250 km" )
PORT_DIPSETTING( 0x08, "300 km" )
PORT_DIPSETTING( 0x0c, "350 km" )
- PORT_DIPNAME( 0x30, 0x10, "Fuel Drop Rate" )
+ PORT_DIPNAME( 0x30, 0x20, "Fuel Drop Rate" )
PORT_DIPSETTING( 0x30, "1" ) // slow
PORT_DIPSETTING( 0x20, "2" )
PORT_DIPSETTING( 0x10, "3" )
PORT_DIPSETTING( 0x00, "4" ) // fast
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(lbeach_state, col_fg_r)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(lbeach_state, col_bg_r)
+
+ PORT_START("IN.2")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gas Pedal")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Shifter 1st Gear")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Shifter 2nd Gear")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Shifter 3rd Gear")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Shifter 4th Gear")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset Record") // called RR in testmode
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Coin Counter") // called CC in testmode
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
+
+ PORT_START("STEER")
+ PORT_BIT( 0x03, 0x01, IPT_PADDLE ) PORT_MINMAX(0x00,0x02) PORT_SENSITIVITY(50) PORT_KEYDELTA(1) PORT_CENTERDELTA(1)
INPUT_PORTS_END
static INPUT_PORTS_START( speedrs )
PORT_INCLUDE( lbeach )
- PORT_MODIFY("IN.0")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Shifter") PORT_TOGGLE
- PORT_BIT( 0x7c, IP_ACTIVE_HIGH, IPT_UNUSED )
-
- PORT_MODIFY("IN.2")
- PORT_DIPNAME( 0x0c, 0x00, "Refueling Point" )
+ PORT_MODIFY("IN.1")
+ PORT_DIPNAME( 0x0c, 0x04, "Refueling Point" )
PORT_DIPSETTING( 0x00, "1500" )
PORT_DIPSETTING( 0x04, "2000" )
PORT_DIPSETTING( 0x08, "2500" )
PORT_DIPSETTING( 0x0c, "3000" )
+
+ PORT_MODIFY("IN.2")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Shifter") PORT_TOGGLE
+ PORT_BIT( 0x7c, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
/******************************************************************************
- GFX Decodes
+ GFX Layouts
******************************************************************************/
static const gfx_layout layout_16x8 =
diff --git a/src/mame/drivers/madmotor.cpp b/src/mame/drivers/madmotor.cpp
index 71039e11a01..33a58105871 100644
--- a/src/mame/drivers/madmotor.cpp
+++ b/src/mame/drivers/madmotor.cpp
@@ -193,52 +193,30 @@ INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8, /* 8*8 chars */
- 4096,
+ RGN_FRAC(1,2),
4, /* 4 bits per pixel */
- { 0x18000*8, 0x8000*8, 0x10000*8, 0x00000*8 },
+ { RGN_FRAC(1,2)+8, RGN_FRAC(1,2), RGN_FRAC(0,2)+8, RGN_FRAC(0,2) },
{ STEP8(0,1) },
- { STEP8(0,8) },
- 8*8 /* every char takes 8 consecutive bytes */
+ { STEP8(0,8*2) },
+ 8*8*2 /* every char takes 8 consecutive bytes */
};
static const gfx_layout tilelayout =
{
16,16,
- 2048,
+ RGN_FRAC(1,2),
4,
- { 0x30000*8, 0x10000*8, 0x20000*8, 0x00000*8 },
- { STEP8(16*8,1), STEP8(0,1) },
- { STEP16(0,8) },
- 16*16
-};
-
-static const gfx_layout tilelayout2 =
-{
- 16,16,
- 4096,
- 4,
- { 0x60000*8, 0x20000*8, 0x40000*8, 0x00000*8 },
- { STEP8(16*8,1), STEP8(0,1) },
- { STEP16(0,8) },
- 16*16
-};
-
-static const gfx_layout spritelayout =
-{
- 16,16,
- 4096*2,
- 4,
- { 0xc0000*8, 0x80000*8, 0x40000*8, 0x00000*8 },
- { STEP8(16*8,1), STEP8(0,1) },
- { STEP16(0,8) },
- 16*16
+ { RGN_FRAC(1,2)+8, RGN_FRAC(1,2), RGN_FRAC(0,2)+8, RGN_FRAC(0,2) },
+ { STEP8(16*8*2,1), STEP8(0,1) },
+ { STEP16(0,8*2) },
+ 16*16*2
};
static GFXDECODE_START( gfx_madmotor )
- GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) /* Characters 8x8 */
- GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 512, 16 ) /* Tiles 16x16 */
- GFXDECODE_ENTRY( "gfx3", 0, tilelayout2, 768, 16 ) /* Tiles 16x16 */
- GFXDECODE_ENTRY( "gfx4", 0, spritelayout, 256, 16 ) /* Sprites 16x16 */
+ GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) /* Characters 8x8 */
+ GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 512, 16 ) /* Tiles 16x16 */
+ GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 768, 16 ) /* Tiles 16x16 */
+ GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 256, 16 ) /* Sprites 16x16 */
GFXDECODE_END
/******************************************************************************/
@@ -251,10 +229,10 @@ uint32_t madmotor_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_spriteram, 0x800/2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
return 0;
}
@@ -329,28 +307,28 @@ ROM_START( madmotor )
ROM_LOAD( "14.l7", 0x00000, 0x10000, CRC(1c28a7e5) SHA1(ed30d0a5a8a079677bd34b6d98ab1b15b934b30f) )
ROM_REGION( 0x020000, "gfx1", 0 )
- ROM_LOAD( "04.a9", 0x000000, 0x10000, CRC(833ca3ab) SHA1(7a3e7ebecc1596d2e487595369ad9ba54ced5bfb) ) /* chars */
- ROM_LOAD( "05.a11", 0x010000, 0x10000, CRC(a691fbfe) SHA1(c726a4c15d599feb6883d9b643453e7028fa16d6) )
+ ROM_LOAD16_BYTE( "04.a9", 0x000000, 0x10000, CRC(833ca3ab) SHA1(7a3e7ebecc1596d2e487595369ad9ba54ced5bfb) ) /* chars */
+ ROM_LOAD16_BYTE( "05.a11", 0x000001, 0x10000, CRC(a691fbfe) SHA1(c726a4c15d599feb6883d9b643453e7028fa16d6) )
ROM_REGION( 0x040000, "gfx2", 0 )
- ROM_LOAD( "10.a19", 0x000000, 0x20000, CRC(9dbf482b) SHA1(086e9170d577e502604c180f174fbce53a1e20e5) ) /* tiles */
- ROM_LOAD( "11.a21", 0x020000, 0x20000, CRC(593c48a9) SHA1(1158888f6b836253b8ae9db9b8e352f289b2e815) )
+ ROM_LOAD16_BYTE( "10.a19", 0x000000, 0x20000, CRC(9dbf482b) SHA1(086e9170d577e502604c180f174fbce53a1e20e5) ) /* tiles */
+ ROM_LOAD16_BYTE( "11.a21", 0x000001, 0x20000, CRC(593c48a9) SHA1(1158888f6b836253b8ae9db9b8e352f289b2e815) )
ROM_REGION( 0x080000, "gfx3", 0 )
- ROM_LOAD( "06.a13", 0x000000, 0x20000, CRC(448850e5) SHA1(6a44a42738cf6a55b4bec807e0a3939a42b36793) ) /* tiles */
- ROM_LOAD( "07.a14", 0x020000, 0x20000, CRC(ede4d141) SHA1(7b847372bac043aa397aa5c274f90b9193de9176) )
- ROM_LOAD( "08.a16", 0x040000, 0x20000, CRC(c380e5e5) SHA1(ec87a94e7948b84c96b1577f5a8caebc56e38a94) )
- ROM_LOAD( "09.a18", 0x060000, 0x20000, CRC(1ee3326a) SHA1(bd03e5c4a2e7689260e6cc67288e71ef13f05a4b) )
+ ROM_LOAD16_BYTE( "06.a13", 0x000000, 0x20000, CRC(448850e5) SHA1(6a44a42738cf6a55b4bec807e0a3939a42b36793) ) /* tiles */
+ ROM_LOAD16_BYTE( "07.a14", 0x040000, 0x20000, CRC(ede4d141) SHA1(7b847372bac043aa397aa5c274f90b9193de9176) )
+ ROM_LOAD16_BYTE( "08.a16", 0x000001, 0x20000, CRC(c380e5e5) SHA1(ec87a94e7948b84c96b1577f5a8caebc56e38a94) )
+ ROM_LOAD16_BYTE( "09.a18", 0x040001, 0x20000, CRC(1ee3326a) SHA1(bd03e5c4a2e7689260e6cc67288e71ef13f05a4b) )
ROM_REGION( 0x100000, "gfx4", 0 )
- ROM_LOAD( "15.h11", 0x000000, 0x20000, CRC(90ae9f74) SHA1(806f96fd08fca1beeeaefe3c0fac1991410aa9c4) ) /* sprites */
- ROM_LOAD( "16.h13", 0x020000, 0x20000, CRC(e96ac815) SHA1(a2b22a29ad0a4f144bb09299c454dc7a842a5318) )
- ROM_LOAD( "17.h14", 0x040000, 0x20000, CRC(abad9a1b) SHA1(3cec6b4ef925205efe4a8fb28e08eb58e3ba4019) )
- ROM_LOAD( "18.h16", 0x060000, 0x20000, CRC(96d8d64b) SHA1(54ce87fe2b14b574176d2a1d2b86057b9cd10883) )
- ROM_LOAD( "19.j13", 0x080000, 0x20000, CRC(cbd8c9b8) SHA1(5e86c0298b3eea06920121eecb70e5bee705addf) )
- ROM_LOAD( "20.j14", 0x0a0000, 0x20000, CRC(47f706a8) SHA1(bd4fe499710f8905eb4b8d1ca990f2908feb95e1) )
- ROM_LOAD( "21.j16", 0x0c0000, 0x20000, CRC(9c72d364) SHA1(9290e463273fa1f921279f1bab808d91d3aa9648) )
- ROM_LOAD( "22.j18", 0x0e0000, 0x20000, CRC(1e78aa60) SHA1(f5f58ee6f5efe56e72623e57ce27884551e09bd9) )
+ ROM_LOAD16_BYTE( "15.h11", 0x000000, 0x20000, CRC(90ae9f74) SHA1(806f96fd08fca1beeeaefe3c0fac1991410aa9c4) ) /* sprites */
+ ROM_LOAD16_BYTE( "16.h13", 0x040000, 0x20000, CRC(e96ac815) SHA1(a2b22a29ad0a4f144bb09299c454dc7a842a5318) )
+ ROM_LOAD16_BYTE( "17.h14", 0x000001, 0x20000, CRC(abad9a1b) SHA1(3cec6b4ef925205efe4a8fb28e08eb58e3ba4019) )
+ ROM_LOAD16_BYTE( "18.h16", 0x040001, 0x20000, CRC(96d8d64b) SHA1(54ce87fe2b14b574176d2a1d2b86057b9cd10883) )
+ ROM_LOAD16_BYTE( "19.j13", 0x080000, 0x20000, CRC(cbd8c9b8) SHA1(5e86c0298b3eea06920121eecb70e5bee705addf) )
+ ROM_LOAD16_BYTE( "20.j14", 0x0c0000, 0x20000, CRC(47f706a8) SHA1(bd4fe499710f8905eb4b8d1ca990f2908feb95e1) )
+ ROM_LOAD16_BYTE( "21.j16", 0x080001, 0x20000, CRC(9c72d364) SHA1(9290e463273fa1f921279f1bab808d91d3aa9648) )
+ ROM_LOAD16_BYTE( "22.j18", 0x0c0001, 0x20000, CRC(1e78aa60) SHA1(f5f58ee6f5efe56e72623e57ce27884551e09bd9) )
ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM samples */
ROM_LOAD( "12.h1", 0x00000, 0x20000, CRC(c202d200) SHA1(8470654923a0e8780dad678f5745f8e3e3be08b2) )
diff --git a/src/mame/drivers/megaphx.cpp b/src/mame/drivers/megaphx.cpp
index 03a671239c1..93f6de3af1c 100644
--- a/src/mame/drivers/megaphx.cpp
+++ b/src/mame/drivers/megaphx.cpp
@@ -438,7 +438,7 @@ ROM_START( megaphx )
ROM_REGION( 0x100000, "pic", 0 )
ROM_LOAD( "pic16c54-xt.bin", 0x000000, 0x430, CRC(21f396fb) SHA1(c8badb9b3681e684bced0ced1de4c3a15641de8b) )
- ROM_FILL(0x2c, 1, 0x01) // patch timer length or its too slow (pic issue?)
+ ROM_FILL(0x2c, 1, 0x01) // patch timer length or it's too slow (pic issue?)
ROM_REGION( 0x1000, "pals", 0 ) // protected
ROM_LOAD( "p31_u31_palce16v8h-25.jed", 0x000, 0xbd4, BAD_DUMP CRC(05ef04b7) SHA1(330dd81a832b6675fb0473868c26fe9bec2da854) )
@@ -469,7 +469,7 @@ ROM_START( hamboy )
ROM_REGION( 0x100000, "pic", 0 )
ROM_LOAD( "pic16c54-xt.bin", 0x000000, 0x430, CRC(21f396fb) SHA1(c8badb9b3681e684bced0ced1de4c3a15641de8b) )
- ROM_FILL(0x2c, 1, 0x01) // patch timer length or its too slow (pic issue?)
+ ROM_FILL(0x2c, 1, 0x01) // patch timer length or it's too slow (pic issue?)
ROM_END
GAME( 1991, megaphx, 0, megaphx, megaphx, megaphx_state, empty_init, ROT0, "Dinamic / Inder", "Mega Phoenix", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/meritsdx.cpp b/src/mame/drivers/meritsdx.cpp
new file mode 100644
index 00000000000..5433a5c2a4d
--- /dev/null
+++ b/src/mame/drivers/meritsdx.cpp
@@ -0,0 +1,84 @@
+// license:BSD-3-Clause
+// copyright-holders:
+/*******************************************************************************
+
+ Skeleton driver for Merit Scorpion DX darts machines
+
+ Hardware overview:
+ Main CPU: AMD Elan SC300-33KC (Am386SXLV CPU core + 6845 CGA)
+ Others: Dallas 1232, M48T08-150PC1, F82C735A, PCMCIA slot (for a modem),
+ LCD CGA screen and magnetic stripe card reader
+ OSC: 24.000 MHz
+
+ Notes:
+ Uses a ROM-DOS as its operating system.
+ The card reader emulates a PS2 keyboard. The keyboard BIOS is undumped
+ (it's a Phoenix BIOS on a protected Intel 8242 MCU).
+ The Flash ROMs contain user data (from a championship on Spain). Once emulated,
+ they must be reflashed with a factory reset (can be done on the emulated
+ system) and updated on the driver.
+
+*******************************************************************************/
+
+#include "emu.h"
+#include "cpu/i386/i386.h"
+#include "speaker.h"
+
+
+class meritsdx_state : public driver_device
+{
+public:
+ meritsdx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ {
+ }
+
+ void scrpndx(machine_config &config);
+
+private:
+ void mem_map(address_map &map);
+ void io_map(address_map &map);
+
+ required_device<cpu_device> m_maincpu;
+};
+
+void meritsdx_state::mem_map(address_map &map)
+{
+}
+
+void meritsdx_state::io_map(address_map &map)
+{
+}
+
+static INPUT_PORTS_START(scrpndx)
+INPUT_PORTS_END
+
+void meritsdx_state::scrpndx(machine_config &config)
+{
+ I386SX(config, m_maincpu, 24_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &meritsdx_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &meritsdx_state::io_map);
+}
+
+ROM_START(scrpndx)
+ ROM_REGION(0x10000, "maincpu", 0)
+ ROM_LOAD( "4999-02-00_u54-r0_c1997_mii.u54", 0x00000, 0x10000, CRC(dc834efc) SHA1(08bb1e0e818114ab3d4fa9cfecad337cf23a73d7) ) // mostly empty
+
+ ROM_REGION(0x80000, "romdos", 0)
+ ROM_LOAD( "4999-01-00_u20-r1_c1997_mii.u20", 0x00000, 0x80000, CRC(3c32355e) SHA1(56f846e655184b66db19cd01481e0016c463cf7d) )
+
+ // The Flash ROMs contain user data
+ ROM_REGION(0x400000, "flashroms", 0)
+ ROM_LOAD( "am29f800bb.u22", 0x000000, 0x100000, CRC(9b7510a5) SHA1(76ed78da976f8898a7a084fa5a37ea66aba886ff) )
+ ROM_LOAD( "am29f800bb.u23", 0x100000, 0x100000, CRC(8dc09838) SHA1(01e150daecac5f148a8cc6fb23715cf8b2cbd48a) )
+ ROM_LOAD( "am29f800bb.u24", 0x200000, 0x100000, CRC(c5d5a5ee) SHA1(66bfb9a1eccd43c3d5ede0c4f17c231593729926) )
+ ROM_LOAD( "am29f800bb.u25", 0x300000, 0x100000, CRC(1b26141d) SHA1(bf60c1f8ff9119aebc172fbacec3de89e2513c1c) )
+
+ ROM_REGION(0x5ba, "plds", 0)
+ ROM_LOAD( "sc_3986_intr_palce22v10q-25.u81", 0x000, 0x2dd, CRC(2a33bc54) SHA1(ed40828154f6c75f2c0109f6df6bbaef0773f841) )
+ ROM_LOAD( "sc_3987_pc104_palce22v10q-25.u88", 0x2dd, 0x2dd, CRC(460aea86) SHA1(8ffbd42bfc90e356db7d618b376fab7fe761e216) )
+ROM_END
+
+
+GAME(1996, scrpndx, 0, scrpndx, scrpndx, meritsdx_state, empty_init, ROT0, "Merit", "Scorpion DX", MACHINE_IS_SKELETON_MECHANICAL) // OCT 15 1996 -- ASM 15:30
diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp
index eb72798d1ab..9eed223464d 100644
--- a/src/mame/drivers/microvsn.cpp
+++ b/src/mame/drivers/microvsn.cpp
@@ -16,12 +16,14 @@ of the games were clocked at around 500KHz, 550KHz, or 300KHz.
****************************************************************************/
#include "emu.h"
+
#include "bus/generic/carts.h"
#include "bus/generic/slot.h"
#include "cpu/mcs48/mcs48.h"
#include "cpu/tms1000/tms1100.h"
#include "sound/dac.h"
#include "sound/volt_reg.h"
+
#include "emupal.h"
#include "softlist.h"
#include "screen.h"
@@ -39,8 +41,8 @@ public:
microvision_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_dac( *this, "dac" ),
- m_i8021( *this, "maincpu1" ),
- m_tms1100( *this, "maincpu2" ),
+ m_i8021( *this, "i8021_cpu" ),
+ m_tms1100( *this, "tms1100_cpu" ),
m_cart(*this, "cartslot")
{ }
@@ -72,6 +74,7 @@ private:
DECLARE_READ8_MEMBER(tms1100_read_k);
DECLARE_WRITE16_MEMBER(tms1100_write_o);
DECLARE_WRITE16_MEMBER(tms1100_write_r);
+ u32 tms1100_decode_micro(offs_t offset);
// enums
enum cpu_type
@@ -101,10 +104,9 @@ private:
pcb_type m_pcb_type;
rc_type m_rc_type;
-
required_device<dac_byte_interface> m_dac;
- required_device<i8021_device> m_i8021;
- required_device<tms1100_cpu_device> m_tms1100;
+ optional_device<i8021_device> m_i8021;
+ optional_device<tms1100_cpu_device> m_tms1100;
required_device<generic_slot_device> m_cart;
// Timers
@@ -185,35 +187,6 @@ void microvision_state::machine_reset()
m_t1 = 0;
m_paddle_timer->adjust(attotime::never);
-
- switch (m_cpu_type)
- {
- case CPU_TYPE_I8021:
- m_i8021->resume(SUSPEND_REASON_DISABLE);
- m_tms1100->suspend(SUSPEND_REASON_DISABLE, 0);
- break;
-
- case CPU_TYPE_TMS1100:
- m_i8021->suspend(SUSPEND_REASON_DISABLE, 0);
- m_tms1100->resume(SUSPEND_REASON_DISABLE);
-
- switch (m_rc_type)
- {
- case RC_TYPE_100PF_21_0K:
- m_tms1100->set_clock(550000);
- break;
-
- case RC_TYPE_100PF_23_2K:
- case RC_TYPE_UNKNOWN: // Default to most occurring setting
- m_tms1100->set_clock(500000);
- break;
-
- case RC_TYPE_100PF_39_4K:
- m_tms1100->set_clock(300000);
- break;
- }
- break;
- }
}
@@ -484,33 +457,62 @@ WRITE16_MEMBER( microvision_state::tms1100_write_r )
}
-static const u16 microvision_output_pla_0[0x20] =
+static const u16 microvision_output_pla[2][0x20] =
{
- /* O output PLA configuration currently unknown */
- 0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E,
- 0x01, 0x09, 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x0F,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ // default TMS1100 O output PLA
+ // verified for: blckbstr, pinball
+ {
+ 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e,
+ 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f,
+ 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e,
+ 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f
+ },
+
+ // reversed bit order
+ // verified for: bowling, vegasslt
+ {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
+ }
};
-
-static const u16 microvision_output_pla_1[0x20] =
+u32 microvision_state::tms1100_decode_micro(offs_t offset)
{
- /* O output PLA configuration currently unknown */
- /* Reversed bit order */
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
+ // default TMS1100 microinstructions PLA - this should work for all games
+ // verified for: blckbstr, bowling, pinball, vegasslt
+ static const u16 micro[0x80] =
+ {
+ 0x1402, 0x0c30, 0xd002, 0x2404, 0x8019, 0x8038, 0x0416, 0x0415,
+ 0x0104, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1100, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x000a, 0x0404, 0x0408, 0x8004, 0xa019, 0xa038, 0x2004, 0x2000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1580, 0x1580, 0x1580, 0x1580, 0x0c34, 0x0834, 0x0434, 0x1400,
+ 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
+ 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
+ 0x9080, 0x9080, 0x9080, 0x9080, 0x9080, 0x9080, 0x9080, 0x9080,
+ 0x9080, 0x9080, 0x9080, 0x9080, 0x9080, 0x9080, 0x9080, 0x9080,
+ 0x8068, 0x8068, 0x8068, 0x8068, 0x8068, 0x8068, 0x8068, 0x8068,
+ 0x8068, 0x8068, 0x8068, 0x8068, 0x8068, 0x8068, 0x8068, 0x8068,
+ 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136,
+ 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0134
+ };
+ if (offset >= 0x80 || micro[offset] == 0)
+ return 0x8fa3;
+ else
+ return micro[offset];
+}
DEVICE_IMAGE_LOAD_MEMBER(microvision_state::cart_load)
{
- uint8_t *rom1 = memregion("maincpu1")->base();
- uint8_t *rom2 = memregion("maincpu2")->base();
+ uint8_t *rom1 = memregion("i8021_cpu")->base();
+ uint8_t *rom2 = memregion("tms1100_cpu")->base();
uint32_t file_size = m_cart->common_get_size("rom");
- m_pla = 0;
if ( file_size != 1024 && file_size != 2048 )
{
@@ -518,7 +520,12 @@ DEVICE_IMAGE_LOAD_MEMBER(microvision_state::cart_load)
return image_init_result::FAIL;
}
- /* Read cartridge */
+ // Set default settings
+ m_pcb_type = microvision_state::PCB_TYPE_UNKNOWN;
+ m_rc_type = microvision_state::RC_TYPE_UNKNOWN;
+ m_pla = 0;
+
+ // Read cartridge
if (!image.loaded_through_softlist())
{
if (image.fread(rom1, file_size) != file_size)
@@ -538,11 +545,7 @@ DEVICE_IMAGE_LOAD_MEMBER(microvision_state::cart_load)
if (pla)
m_pla = 1;
- m_tms1100->set_output_pla(m_pla ? microvision_output_pla_1 : microvision_output_pla_0);
-
- // Set default setting for PCB type and RC type
- m_pcb_type = microvision_state::PCB_TYPE_UNKNOWN;
- m_rc_type = microvision_state::RC_TYPE_UNKNOWN;
+ m_tms1100->set_output_pla(microvision_output_pla[m_pla]);
// Detect settings for PCB type
const char *pcb = image.get_feature("pcb");
@@ -588,23 +591,40 @@ DEVICE_IMAGE_LOAD_MEMBER(microvision_state::cart_load)
}
}
- // Mirror rom data to maincpu2 region
+ // Mirror rom data to tms1100_cpu region
memcpy(rom2, rom1, file_size);
// Based on file size select cpu:
// - 1024 -> I8021
// - 2048 -> TI TMS1100
-
switch (file_size)
{
case 1024:
m_cpu_type = microvision_state::CPU_TYPE_I8021;
+ m_i8021->set_clock(2000000);
break;
case 2048:
m_cpu_type = microvision_state::CPU_TYPE_TMS1100;
+
+ switch (m_rc_type)
+ {
+ case RC_TYPE_100PF_21_0K:
+ m_tms1100->set_clock(550000);
+ break;
+
+ case RC_TYPE_100PF_23_2K:
+ case RC_TYPE_UNKNOWN: // Default to most occurring setting
+ m_tms1100->set_clock(500000);
+ break;
+
+ case RC_TYPE_100PF_39_4K:
+ m_tms1100->set_clock(300000);
+ break;
+ }
break;
}
+
return image_init_result::PASS;
}
@@ -635,21 +655,22 @@ INPUT_PORTS_END
void microvision_state::microvision(machine_config &config)
{
- I8021(config, m_i8021, 2000000); // approximately
+ /* basic machine hardware */
+ I8021(config, m_i8021, 0);
m_i8021->bus_out_cb().set(FUNC(microvision_state::i8021_p0_write));
m_i8021->p1_out_cb().set(FUNC(microvision_state::i8021_p1_write));
m_i8021->p2_out_cb().set(FUNC(microvision_state::i8021_p2_write));
m_i8021->t1_in_cb().set(FUNC(microvision_state::i8021_t1_read));
m_i8021->bus_in_cb().set(FUNC(microvision_state::i8021_bus_read));
- TMS1100(config, m_tms1100, 500000); // most games seem to be running at approximately this speed
- m_tms1100->set_output_pla(microvision_output_pla_0);
+ TMS1100(config, m_tms1100, 0);
+ m_tms1100->set_output_pla(microvision_output_pla[0]);
+ m_tms1100->set_decode_micro().set(FUNC(microvision_state::tms1100_decode_micro));
m_tms1100->k().set(FUNC(microvision_state::tms1100_read_k));
m_tms1100->o().set(FUNC(microvision_state::tms1100_write_o));
m_tms1100->r().set(FUNC(microvision_state::tms1100_write_r));
- config.set_maximum_quantum(attotime::from_hz(60));
-
+ /* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
screen.set_refresh_hz(60);
screen.set_vblank_time(0);
@@ -668,22 +689,21 @@ void microvision_state::microvision(machine_config &config)
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
- generic_cartslot_device &cartslot(GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "microvision_cart"));
- cartslot.set_must_be_loaded(true);
- cartslot.set_device_load(FUNC(microvision_state::cart_load));
+ /* cartridge */
+ GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "microvision_cart");
+ m_cart->set_must_be_loaded(true);
+ m_cart->set_device_load(FUNC(microvision_state::cart_load));
- /* Software lists */
SOFTWARE_LIST(config, "cart_list").set_original("microvision");
}
ROM_START( microvsn )
- ROM_REGION( 0x800, "maincpu1", ROMREGION_ERASE00 )
- ROM_REGION( 0x800, "maincpu2", ROMREGION_ERASE00 )
- ROM_REGION( 867, "maincpu2:mpla", 0 )
- ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) // verified for: pinball, blockbuster, bowling
-
- ROM_REGION( 365, "maincpu2:opla", ROMREGION_ERASE00 )
+ // nothing here yet, ROM is on the cartridge
+ ROM_REGION( 0x800, "i8021_cpu", ROMREGION_ERASE00 )
+ ROM_REGION( 0x800, "tms1100_cpu", ROMREGION_ERASE00 )
+ ROM_REGION( 867, "tms1100_cpu:mpla", ROMREGION_ERASE00 )
+ ROM_REGION( 365, "tms1100_cpu:opla", ROMREGION_ERASE00 )
ROM_END
diff --git a/src/mame/drivers/nforcepc.cpp b/src/mame/drivers/nforcepc.cpp
index afa0ff16c86..8ac0bd3a62c 100644
--- a/src/mame/drivers/nforcepc.cpp
+++ b/src/mame/drivers/nforcepc.cpp
@@ -897,7 +897,7 @@ void it8703f_device::map_fdc_addresses()
{
uint16_t base = get_base_address(LogicalDevice::FDC, 0);
- iospace->install_device(base, base + 7, *floppy_controller_fdcdev, &pc_fdc_interface::map);
+ iospace->install_device(base, base + 7, *floppy_controller_fdcdev, &smc37c78_device::map);
}
void it8703f_device::map_lpt(address_map& map)
diff --git a/src/mame/drivers/pasopia.cpp b/src/mame/drivers/pasopia.cpp
index 7fe2af76b2e..2c2254afdcf 100644
--- a/src/mame/drivers/pasopia.cpp
+++ b/src/mame/drivers/pasopia.cpp
@@ -13,7 +13,6 @@
completely different tho)
- screen resolution switching
- Centronics printer interface
- - RS-232C serial interface
- FDC and other I/O expansions
- fix keyboard
- colours
@@ -25,6 +24,8 @@
#include "emu.h"
#include "includes/pasopia.h"
+#include "bus/pasopia/pac2.h"
+#include "bus/rs232/rs232.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
#include "machine/z80ctc.h"
@@ -43,8 +44,9 @@ public:
pasopia_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_p_basic(*this, "basic")
, m_p_chargen(*this, "chargen")
- , m_p_vram(*this, "vram")
+ , m_p_ram(*this, "ram")
, m_ppi0(*this, "ppi0")
, m_ppi1(*this, "ppi1")
, m_ppi2(*this, "ppi2")
@@ -54,26 +56,31 @@ public:
, m_palette(*this, "palette")
, m_io_keyboard(*this, "KEY.%d", 0)
, m_cass(*this, "cassette")
+ , m_rs232(*this, "rs232")
, m_speaker(*this, "speaker")
{ }
void pasopia(machine_config &config);
- void init_pasopia();
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
private:
- DECLARE_WRITE8_MEMBER(pasopia_ctrl_w);
- DECLARE_WRITE8_MEMBER(vram_addr_lo_w);
- DECLARE_WRITE8_MEMBER(vram_latch_w);
- DECLARE_READ8_MEMBER(vram_latch_r);
- DECLARE_READ8_MEMBER(portb_1_r);
- DECLARE_READ8_MEMBER(portb_2_r);
- DECLARE_WRITE8_MEMBER(porta_2_w);
- DECLARE_WRITE8_MEMBER(vram_addr_hi_w);
- DECLARE_WRITE8_MEMBER(screen_mode_w);
- DECLARE_READ8_MEMBER(rombank_r);
- uint8_t keyb_r();
- DECLARE_WRITE8_MEMBER(mux_w);
+ void pasopia_ctrl_w(u8 data);
+ u8 memory_r(offs_t offset);
+ void vram_addr_lo_w(u8 data);
+ void vram_latch_w(u8 data);
+ u8 vram_latch_r();
+ u8 portb_1_r();
+ u8 portb_2_r();
+ void porta_2_w(u8 data);
+ void portc_2_w(u8 data);
+ void vram_addr_hi_w(u8 data);
+ void screen_mode_w(u8 data);
+ u8 rombank_r();
+ u8 keyb_r();
+ void mux_w(u8 data);
DECLARE_WRITE_LINE_MEMBER(speaker_w);
MC6845_UPDATE_ROW(crtc_update_row);
TIMER_CALLBACK_MEMBER(pio_timer);
@@ -81,22 +88,22 @@ private:
void pasopia_io(address_map &map);
void pasopia_map(address_map &map);
- uint8_t m_hblank;
- uint16_t m_vram_addr;
- uint8_t m_vram_latch;
- uint8_t m_attr_latch;
- uint8_t m_gfx_mode;
- uint8_t m_mux_data;
+ u8 m_hblank;
+ u16 m_vram_addr;
+ u16 m_vram_latch;
+ u8 m_gfx_mode;
+ u8 m_mux_data;
u8 m_porta_2;
bool m_video_wl;
bool m_ram_bank;
bool m_spr_sw;
emu_timer *m_pio_timer;
- virtual void machine_start() override;
- virtual void machine_reset() override;
+ std::unique_ptr<u16[]> m_p_vram;
+
required_device<z80_device> m_maincpu;
+ required_region_ptr<u8> m_p_basic;
required_region_ptr<u8> m_p_chargen;
- required_region_ptr<u8> m_p_vram;
+ required_shared_ptr<u8> m_p_ram;
required_device<i8255_device> m_ppi0;
required_device<i8255_device> m_ppi1;
required_device<i8255_device> m_ppi2;
@@ -106,6 +113,7 @@ private:
required_device<palette_device> m_palette;
required_ioport_array<12> m_io_keyboard;
required_device<cassette_image_device> m_cass;
+ required_device<rs232_port_device> m_rs232;
required_device<speaker_sound_device> m_speaker;
};
@@ -118,35 +126,41 @@ TIMER_CALLBACK_MEMBER( pasopia_state::pio_timer )
MC6845_UPDATE_ROW( pasopia_state::crtc_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint8_t chr,gfx,xi,fg=7,bg=0; // colours need to be determined
- uint16_t mem=ma,x;
+ u8 fg=7,bg=0; // colours need to be determined
uint32_t *p = &bitmap.pix32(y);
- for (x = 0; x < x_count; x++)
+ for (u16 x = 0; x < x_count; x++)
{
- uint8_t inv = (x == cursor_x) ? 0xff : 0;
- mem = ma + x;
- chr = m_p_vram[mem & 0x7ff];
+ u8 inv = (x == cursor_x) ? 0xff : 0;
+ u16 mem = ma + x;
+ u16 chr = m_p_vram[mem & 0x7ff];
/* get pattern of pixels for that character scanline */
- gfx = m_p_chargen[(chr<<3) | ra] ^ inv;
+ u8 gfx = m_p_chargen[((chr & 0xff)<<3) | ra] ^ inv;
/* Display a scanline of a character */
- for (xi = 0; xi < 8; xi++)
+ for (u8 xi = 0; xi < 8; xi++)
*p++ = palette[BIT(gfx, 7-xi) ? fg : bg];
}
}
-WRITE8_MEMBER( pasopia_state::pasopia_ctrl_w )
+void pasopia_state::pasopia_ctrl_w(u8 data)
{
m_ram_bank = BIT(data, 1);
- membank("bank1")->set_entry(m_ram_bank);
+}
+
+u8 pasopia_state::memory_r(offs_t offset)
+{
+ if (offset < 0x8000 && !m_ram_bank)
+ return m_p_basic[offset];
+ else
+ return m_p_ram[offset];
}
void pasopia_state::pasopia_map(address_map &map)
{
- map(0x0000, 0x7fff).bankr("bank1").bankw("bank2");
- map(0x8000, 0xffff).ram();
+ map(0x0000, 0xffff).r(FUNC(pasopia_state::memory_r));
+ map(0x0000, 0xffff).writeonly().share("ram");
}
@@ -158,8 +172,8 @@ void pasopia_state::pasopia_io(address_map &map)
map(0x08, 0x0b).rw(m_ppi1, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x10, 0x10).rw(m_crtc, FUNC(mc6845_device::status_r), FUNC(mc6845_device::address_w));
map(0x11, 0x11).rw(m_crtc, FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w));
-// 0x18 - 0x1b pac2
-// 0x1c - 0x1f something
+ map(0x18, 0x1b).rw("dtfcst", FUNC(pasopia_pac2_slot_device::read), FUNC(pasopia_pac2_slot_device::write));
+ map(0x1c, 0x1f).rw("dtfunt", FUNC(pasopia_pac2_slot_device::read), FUNC(pasopia_pac2_slot_device::write));
map(0x20, 0x23).rw(m_ppi2, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x28, 0x2b).rw(m_ctc, FUNC(z80ctc_device::read), FUNC(z80ctc_device::write));
map(0x30, 0x33).rw(m_pio, FUNC(z80pio_device::read), FUNC(z80pio_device::write));
@@ -174,9 +188,12 @@ INPUT_PORTS_END
void pasopia_state::machine_start()
{
+ m_p_vram = make_unique_clear<u16[]>(0x4000);
+
+ m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia_state::pio_timer), this));
+ m_pio_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50));
+
m_hblank = 0;
- membank("bank1")->set_entry(0);
- membank("bank2")->set_entry(0);
}
void pasopia_state::machine_reset()
@@ -185,22 +202,22 @@ void pasopia_state::machine_reset()
m_cass->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
}
-WRITE8_MEMBER( pasopia_state::vram_addr_lo_w )
+void pasopia_state::vram_addr_lo_w(u8 data)
{
m_vram_addr = (m_vram_addr & 0x3f00) | data;
}
-WRITE8_MEMBER( pasopia_state::vram_latch_w )
+void pasopia_state::vram_latch_w(u8 data)
{
- m_vram_latch = data;
+ m_vram_latch = (m_vram_latch & 0x100) | data;
}
-READ8_MEMBER( pasopia_state::vram_latch_r )
+u8 pasopia_state::vram_latch_r()
{
- return m_p_vram[m_vram_addr];
+ return m_p_vram[m_vram_addr] & 0xff;
}
-READ8_MEMBER( pasopia_state::portb_1_r )
+u8 pasopia_state::portb_1_r()
{
/*
x--- ---- attribute latch
@@ -208,21 +225,26 @@ READ8_MEMBER( pasopia_state::portb_1_r )
--x- ---- vblank
---x ---- LCD system mode, active low
*/
- uint8_t grph_latch,lcd_mode;
+ u8 grph_latch,lcd_mode;
m_hblank ^= 0x40; //TODO
- grph_latch = (m_p_vram[m_vram_addr | 0x4000] & 0x80);
+ grph_latch = (m_p_vram[m_vram_addr] & 0x100) >> 1;
lcd_mode = 0x10;
return m_hblank | lcd_mode | grph_latch; //bit 4: LCD mode
}
-READ8_MEMBER( pasopia_state::portb_2_r )
+u8 pasopia_state::portb_2_r()
{
- return (m_cass->input() > +0.04) ? 0x20 : 0;
+ u8 result = (m_cass->input() > +0.04) ? 0x20 : 0;
+ result |= m_rs232->dcd_r() << 3;
+ result |= m_rs232->dsr_r() << 2;
+ result |= m_rs232->cts_r() << 1;
+ result |= m_rs232->rxd_r() << 0;
+ return result;
}
-WRITE8_MEMBER( pasopia_state::porta_2_w )
+void pasopia_state::porta_2_w(u8 data)
{
m_cass->output(BIT(data, 4) ? -1.0 : +1.0);
u8 changed = data ^ m_porta_2;
@@ -233,6 +255,13 @@ WRITE8_MEMBER( pasopia_state::porta_2_w )
}
}
+void pasopia_state::portc_2_w(u8 data)
+{
+ m_rs232->write_dtr(BIT(data, 6));
+ m_rs232->write_rts(BIT(data, 5));
+ m_rs232->write_txd(BIT(data, 4));
+}
+
WRITE_LINE_MEMBER( pasopia_state::speaker_w )
{
if (state)
@@ -243,32 +272,31 @@ WRITE_LINE_MEMBER( pasopia_state::speaker_w )
}
}
-WRITE8_MEMBER( pasopia_state::vram_addr_hi_w )
+void pasopia_state::vram_addr_hi_w(u8 data)
{
- m_attr_latch = (data & 0x80) | (m_attr_latch & 0x7f);
+ m_vram_latch = u16(data & 0x80) << 1 | m_vram_latch;
if ( BIT(data, 6) && !m_video_wl )
{
m_p_vram[m_vram_addr] = m_vram_latch;
- m_p_vram[m_vram_addr | 0x4000] = m_attr_latch;
}
m_video_wl = BIT(data, 6);
m_vram_addr = (m_vram_addr & 0xff) | ((data & 0x3f) << 8);
}
-WRITE8_MEMBER( pasopia_state::screen_mode_w )
+void pasopia_state::screen_mode_w(u8 data)
{
m_gfx_mode = (data & 0xe0) >> 5;
- m_attr_latch = (m_attr_latch & 0x80) | (data & 7);
+ //m_attr_latch = (m_attr_latch & 0x80) | (data & 7);
printf("Screen Mode=%02x\n",data);
}
-READ8_MEMBER( pasopia_state::rombank_r )
+u8 pasopia_state::rombank_r()
{
return (m_ram_bank) ? 4 : 0;
}
-uint8_t pasopia_state::keyb_r()
+u8 pasopia_state::keyb_r()
{
u8 data = 0xff;
for (u8 i = 0; i < 3; i++)
@@ -280,7 +308,7 @@ uint8_t pasopia_state::keyb_r()
return data;
}
-WRITE8_MEMBER( pasopia_state::mux_w )
+void pasopia_state::mux_w(u8 data)
{
m_mux_data = data;
}
@@ -310,20 +338,6 @@ static const z80_daisy_config pasopia_daisy[] =
-void pasopia_state::init_pasopia()
-{
-/*
-We preset all banks here, so that bankswitching will incur no speed penalty.
-0000 indicates ROMs, 8000 indicates RAM.
-*/
- uint8_t *ram = memregion("maincpu")->base();
- membank("bank1")->configure_entries(0, 2, &ram[0x0000], 0x8000);
- membank("bank2")->configure_entry(0, &ram[0x8000]);
-
- m_pio_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pasopia_state::pio_timer), this));
- m_pio_timer->adjust(attotime::from_hz(50), 0, attotime::from_hz(50));
-}
-
void pasopia_state::pasopia(machine_config &config)
{
/* basic machine hardware */
@@ -357,9 +371,10 @@ void pasopia_state::pasopia(machine_config &config)
m_ppi1->out_pc_callback().set(FUNC(pasopia_state::vram_addr_hi_w));
I8255A(config, m_ppi2);
- m_ppi2->in_pc_callback().set(FUNC(pasopia_state::rombank_r));
m_ppi2->out_pa_callback().set(FUNC(pasopia_state::porta_2_w));
m_ppi2->in_pb_callback().set(FUNC(pasopia_state::portb_2_r));
+ m_ppi2->in_pc_callback().set(FUNC(pasopia_state::rombank_r));
+ m_ppi2->out_pc_callback().set(FUNC(pasopia_state::portc_2_w));
Z80CTC(config, m_ctc, 15.9744_MHz_XTAL / 4);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
@@ -378,21 +393,24 @@ void pasopia_state::pasopia(machine_config &config)
m_cass->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED);
m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
+ PASOPIA_PAC2(config, "dtfcst", pac2_default_devices, nullptr); // "Data File Cassette"
+ PASOPIA_PAC2(config, "dtfunt", pac2_default_devices, nullptr); // "Data File Unit"
+
+ RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
+
SOFTWARE_LIST(config, "cass_list").set_original("pasopia_cass");
}
/* ROM definition */
ROM_START( pasopia )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "basic", 0 )
ROM_LOAD( "tbasic.rom", 0x0000, 0x8000, CRC(f53774ff) SHA1(bbec45a3bad8d184505cc6fe1f6e2e60a7fb53f2))
ROM_REGION( 0x0800, "chargen", 0 )
ROM_LOAD( "font.rom", 0x0000, 0x0800, BAD_DUMP CRC(a91c45a9) SHA1(a472adf791b9bac3dfa6437662e1a9e94a88b412)) //stolen from pasopia7
-
- ROM_REGION( 0x8000, "vram", ROMREGION_ERASE00 )
ROM_END
/* Driver */
-// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
-COMP( 1982, pasopia, 0, 0, pasopia, pasopia, pasopia_state, init_pasopia, "Toshiba", "Personal Computer Pasopia PA7010", MACHINE_NOT_WORKING )
+// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
+COMP( 1982, pasopia, 0, 0, pasopia, pasopia, pasopia_state, empty_init, "Toshiba", "Personal Computer Pasopia PA7010", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/pasopia7.cpp b/src/mame/drivers/pasopia7.cpp
index 92f1b8036e5..3dd0dabb6b8 100644
--- a/src/mame/drivers/pasopia7.cpp
+++ b/src/mame/drivers/pasopia7.cpp
@@ -30,6 +30,7 @@
#include "emu.h"
#include "includes/pasopia.h"
+#include "bus/pasopia/pac2.h"
#include "cpu/z80/z80.h"
#include "imagedev/floppy.h"
#include "machine/i8255.h"
@@ -65,6 +66,7 @@ public:
, m_palette(*this, "palette")
, m_keyboard(*this, "KEY.%d", 0)
, m_cass(*this, "cassette")
+ , m_pac2(*this, "pac2")
, m_speaker(*this, "speaker")
, m_font_rom(*this, "font")
{ }
@@ -83,8 +85,6 @@ private:
uint8_t vram_r(offs_t offset);
void vram_w(offs_t offset, uint8_t data);
void memory_ctrl_w(uint8_t data);
- void pac2_w(offs_t offset, uint8_t data);
- uint8_t pac2_r(offs_t offset);
void ram_bank_w(offs_t offset, uint8_t data);
void pasopia7_6845_w(offs_t offset, uint8_t data);
uint8_t io_r(offs_t offset);
@@ -131,9 +131,6 @@ private:
uint8_t m_nmi_enable_reg;
uint8_t m_nmi_trap;
uint8_t m_nmi_reset;
- uint16_t m_pac2_index[2];
- uint32_t m_kanji_index;
- uint8_t m_pac2_bank_select;
uint8_t m_screen_type;
void pasopia_nmi_trap();
uint8_t m_mux_data;
@@ -161,6 +158,7 @@ private:
required_device<palette_device> m_palette;
required_ioport_array<12> m_keyboard;
required_device<cassette_image_device> m_cass;
+ required_device<pasopia_pac2_slot_device> m_pac2;
required_device<speaker_sound_device> m_speaker;
required_region_ptr<uint8_t> m_font_rom;
};
@@ -378,82 +376,6 @@ void pasopia7_state::memory_ctrl_w(uint8_t data)
// printf("%02x\n",m_vram_sel);
}
-
-void pasopia7_state::pac2_w(offs_t offset, uint8_t data)
-{
- /*
- select register:
- 4 = ram1;
- 3 = ram2;
- 2 = kanji ROM;
- 1 = joy;
- anything else is nop
- */
-
- if(m_pac2_bank_select == 3 || m_pac2_bank_select == 4)
- {
- switch(offset)
- {
- case 0: m_pac2_index[(m_pac2_bank_select-3) & 1] = (m_pac2_index[(m_pac2_bank_select-3) & 1] & 0x7f00) | (data & 0xff); break;
- case 1: m_pac2_index[(m_pac2_bank_select-3) & 1] = (m_pac2_index[(m_pac2_bank_select-3) & 1] & 0xff) | ((data & 0x7f) << 8); break;
- case 2: // PAC2 RAM write
- {
- uint8_t *pac2_ram;
-
- pac2_ram = memregion(((m_pac2_bank_select-3) & 1) ? "rampac2" : "rampac1")->base();
-
- pac2_ram[m_pac2_index[(m_pac2_bank_select-3) & 1]] = data;
- }
- }
- }
- else if(m_pac2_bank_select == 2) // kanji ROM
- {
- switch(offset)
- {
- case 0: m_kanji_index = (m_kanji_index & 0x1ff00) | ((data & 0xff) << 0); break;
- case 1: m_kanji_index = (m_kanji_index & 0x100ff) | ((data & 0xff) << 8); break;
- case 2: m_kanji_index = (m_kanji_index & 0x0ffff) | ((data & 0x01) << 16); break;
- }
- }
-
- if(offset == 3)
- {
- if(data & 0x80)
- {
- // ...
- }
- else
- m_pac2_bank_select = data & 7;
- }
-}
-
-uint8_t pasopia7_state::pac2_r(offs_t offset)
-{
- if(offset == 2)
- {
- if(m_pac2_bank_select == 3 || m_pac2_bank_select == 4)
- {
- uint8_t *pac2_ram;
-
- pac2_ram = memregion(((m_pac2_bank_select-3) & 1) ? "rampac2" : "rampac1")->base();
-
- return pac2_ram[m_pac2_index[(m_pac2_bank_select-3) & 1]];
- }
- else if(m_pac2_bank_select == 2)
- {
- uint8_t *kanji_rom = memregion("kanji")->base();
-
- return kanji_rom[m_kanji_index];
- }
- else
- {
- //printf("RAMPAC bank_select = %02x\n",m_pac2_bank_select);
- }
- }
-
- return 0xff;
-}
-
/* writes always occurs to the RAM banks, even if the ROMs are selected. */
void pasopia7_state::ram_bank_w(offs_t offset, uint8_t data)
{
@@ -544,7 +466,7 @@ uint8_t pasopia7_state::io_r(offs_t offset)
return m_crtc->register_r();
else
if(io_port >= 0x18 && io_port <= 0x1b)
- return pac2_r(io_port & 3);
+ return m_pac2->read(io_port & 3);
else
if(io_port >= 0x20 && io_port <= 0x23)
{
@@ -593,7 +515,7 @@ void pasopia7_state::io_w(offs_t offset, uint8_t data)
pasopia7_6845_w(io_port-0x10, data);
else
if(io_port >= 0x18 && io_port <= 0x1b)
- pac2_w(io_port & 3, data);
+ m_pac2->write(io_port & 3, data);
else
if(io_port >= 0x20 && io_port <= 0x23)
{
@@ -679,20 +601,8 @@ static const gfx_layout p7_chars_8x8 =
8*8
};
-static const gfx_layout p7_chars_16x16 =
-{
- 16,16,
- RGN_FRAC(1,1),
- 1,
- { 0 },
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
- { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
- 16*16
-};
-
static GFXDECODE_START( gfx_pasopia7 )
GFXDECODE_ENTRY( "font", 0x00000, p7_chars_8x8, 0, 0x10 )
- GFXDECODE_ENTRY( "kanji", 0x00000, p7_chars_16x16, 0, 0x10 )
GFXDECODE_END
uint8_t pasopia7_state::keyb_r()
@@ -928,6 +838,8 @@ void pasopia7_state::p7_base(machine_config &config)
CASSETTE(config, m_cass);
m_cass->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED);
m_cass->add_route(ALL_OUTPUTS, "mono", 0.05);
+
+ PASOPIA_PAC2(config, m_pac2, pac2_default_devices, nullptr);
}
void pasopia7_state::p7_raster(machine_config &config)
@@ -985,15 +897,6 @@ ROM_START( pasopia7 )
ROM_REGION( 0x800, "font", ROMREGION_ERASEFF )
ROM_LOAD( "font.rom", 0x0000, 0x0800, CRC(a91c45a9) SHA1(a472adf791b9bac3dfa6437662e1a9e94a88b412))
-
- ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF )
- ROM_LOAD( "kanji.rom", 0x0000, 0x20000, CRC(6109e308) SHA1(5c21cf1f241ef1fa0b41009ea41e81771729785f))
-
- ROM_REGION( 0x8000, "rampac1", ROMREGION_ERASEFF )
-// ROM_LOAD( "rampac1.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
-
- ROM_REGION( 0x8000, "rampac2", ROMREGION_ERASEFF )
-// ROM_LOAD( "rampac2.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
ROM_END
/* using an identical ROMset from now, but the screen type is different */
@@ -1006,15 +909,6 @@ ROM_START( pasopia7lcd )
ROM_REGION( 0x800, "font", ROMREGION_ERASEFF )
ROM_LOAD( "font.rom", 0x0000, 0x0800, BAD_DUMP CRC(a91c45a9) SHA1(a472adf791b9bac3dfa6437662e1a9e94a88b412))
-
- ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF )
- ROM_LOAD( "kanji.rom", 0x0000, 0x20000, CRC(6109e308) SHA1(5c21cf1f241ef1fa0b41009ea41e81771729785f))
-
- ROM_REGION( 0x8000, "rampac1", ROMREGION_ERASEFF )
-// ROM_LOAD( "rampac1.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
-
- ROM_REGION( 0x8000, "rampac2", ROMREGION_ERASEFF )
-// ROM_LOAD( "rampac2.bin", 0x0000, 0x8000, CRC(0e4f09bd) SHA1(4088906d57e4f6085a75b249a6139a0e2eb531a1) )
ROM_END
diff --git a/src/mame/drivers/pcxt.cpp b/src/mame/drivers/pcxt.cpp
index c80cd3fecf0..1a6aed2d12c 100644
--- a/src/mame/drivers/pcxt.cpp
+++ b/src/mame/drivers/pcxt.cpp
@@ -83,6 +83,7 @@ private:
uint8_t m_port_b_data;
uint8_t m_status;
uint8_t m_clr_status;
+ uint8_t m_voice;
DECLARE_READ8_MEMBER(disk_iobank_r);
DECLARE_WRITE8_MEMBER(disk_iobank_w);
@@ -296,6 +297,13 @@ WRITE8_MEMBER(pcxt_state::disk_iobank_w)
bank = 3;
}
+ if (!(data & 0xf0))
+ {
+ int bit = (data >> 1) - 2;
+ m_voice &= ~(1 << bit);
+ m_voice |= BIT(data, 0) << bit;
+ }
+
m_bank->set_bank(bank);
m_lastvalue = data;
@@ -383,6 +391,7 @@ void pcxt_state::filetto_io(address_map &map)
map(0x0201, 0x0201).portr("COIN"); //game port
map(0x0310, 0x0311).rw(FUNC(pcxt_state::disk_iobank_r), FUNC(pcxt_state::disk_iobank_w)); //Prototyping card
map(0x0312, 0x0312).portr("IN0"); //Prototyping card,read only
+ map(0x0313, 0x0313).lw8(NAME([this](u8 data) { logerror("play voice %x\n", m_voice); }));
map(0x03f2, 0x03f2).w(FUNC(pcxt_state::fdc_dor_w));
map(0x03f4, 0x03f4).r(FUNC(pcxt_state::fdc765_status_r)); //765 Floppy Disk Controller (FDC) Status
map(0x03f5, 0x03f5).rw(FUNC(pcxt_state::fdc765_data_r), FUNC(pcxt_state::fdc765_data_w));//FDC Data
@@ -487,6 +496,7 @@ INPUT_PORTS_END
void pcxt_state::machine_reset()
{
m_lastvalue = -1;
+ m_voice = 0;
}
static void filetto_isa8_cards(device_slot_interface &device)
diff --git a/src/mame/drivers/pt68k4.cpp b/src/mame/drivers/pt68k4.cpp
index f8dd84ebcd2..be50ddce5c8 100644
--- a/src/mame/drivers/pt68k4.cpp
+++ b/src/mame/drivers/pt68k4.cpp
@@ -57,7 +57,6 @@ TODO: 68230 device
#include "cpu/m68000/m68000.h"
#include "machine/mc68681.h"
-#include "machine/pc_fdc.h"
#include "machine/timekpr.h"
#include "machine/wd_fdc.h"
#include "sound/spkrdev.h"
diff --git a/src/mame/drivers/rzone.cpp b/src/mame/drivers/rzone.cpp
index c191db0a6ad..f4e24b5cbbd 100644
--- a/src/mame/drivers/rzone.cpp
+++ b/src/mame/drivers/rzone.cpp
@@ -22,6 +22,7 @@
1997: R-Zone DataZone: PDA with a built-in SuperScreen.
TODO:
+ - softwarelist? it's impossible right now due to SVG initialization
- support for SuperScreen. SVG colors will need to be inverted, or maybe
with artwork or HLSL?
- add DataZone, will get its own driver
diff --git a/src/mame/drivers/sag.cpp b/src/mame/drivers/sag.cpp
index f3c58916db8..b2c30cd074b 100644
--- a/src/mame/drivers/sag.cpp
+++ b/src/mame/drivers/sag.cpp
@@ -30,16 +30,20 @@ By default, the "visitor" side is at the bottom. This is how most of the games
are played, Space Invader 2 is an exception.
TODO:
-- add softwarelist? impractical with different MCUs, and no CPU inside console
- add the rest of the games
***************************************************************************/
#include "emu.h"
+
+#include "bus/generic/carts.h"
+#include "bus/generic/slot.h"
#include "cpu/hmcs40/hmcs40.h"
#include "cpu/tms1000/tms1400.h"
#include "video/pwm.h"
#include "sound/spkrdev.h"
+
+#include "softlist.h"
#include "speaker.h"
#include "sag.lh"
@@ -47,76 +51,55 @@ TODO:
namespace {
-class base_state : public driver_device
+class sag_state : public driver_device
{
public:
- base_state(const machine_config &mconfig, device_type type, const char *tag) :
+ sag_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
+ m_hmcs40_cpu(*this, "hmcs40_cpu"),
+ m_tms1k_cpu(*this, "tms1k_cpu"),
m_display(*this, "display"),
m_speaker(*this, "speaker"),
+ m_cart(*this, "cartslot"),
m_inputs(*this, "IN.%u", 0)
{ }
- void shared(machine_config &config);
+ void sag(machine_config &config);
protected:
virtual void machine_start() override;
+private:
+ optional_device<hmcs40_cpu_device> m_hmcs40_cpu;
+ optional_device<tms1k_base_device> m_tms1k_cpu;
+ required_device<pwm_display_device> m_display;
+ required_device<speaker_sound_device> m_speaker;
+ required_device<generic_slot_device> m_cart;
+ required_ioport_array<6> m_inputs;
+
void update_display();
u8 input_r();
void speaker_w(int state);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
u16 m_grid = 0;
u16 m_plate = 0;
-private:
- required_device<pwm_display_device> m_display;
- required_device<speaker_sound_device> m_speaker;
- required_ioport_array<6> m_inputs;
+ DECLARE_WRITE8_MEMBER(hmcs40_write_r);
+ DECLARE_WRITE16_MEMBER(hmcs40_write_d);
+ DECLARE_READ16_MEMBER(hmcs40_read_d);
+
+ DECLARE_WRITE16_MEMBER(tms1k_write_r);
+ DECLARE_WRITE16_MEMBER(tms1k_write_o);
+ DECLARE_READ8_MEMBER(tms1k_read_k);
};
-void base_state::machine_start()
+void sag_state::machine_start()
{
save_item(NAME(m_grid));
save_item(NAME(m_plate));
}
-class hmcs40_state : public base_state
-{
-public:
- hmcs40_state(const machine_config &mconfig, device_type type, const char *tag) :
- base_state(mconfig, type, tag),
- m_maincpu(*this, "maincpu")
- { }
-
- void sag(machine_config &config);
-
-private:
- required_device<hmcs40_cpu_device> m_maincpu;
-
- DECLARE_WRITE8_MEMBER(write_r);
- DECLARE_WRITE16_MEMBER(write_d);
- DECLARE_READ16_MEMBER(read_d);
-};
-
-class tms1k_state : public base_state
-{
-public:
- tms1k_state(const machine_config &mconfig, device_type type, const char *tag) :
- base_state(mconfig, type, tag),
- m_maincpu(*this, "maincpu")
- { }
-
- void sag(machine_config &config);
-
-private:
- required_device<tms1k_base_device> m_maincpu;
-
- DECLARE_WRITE16_MEMBER(write_r);
- DECLARE_WRITE16_MEMBER(write_o);
- DECLARE_READ8_MEMBER(read_k);
-};
-
/******************************************************************************
@@ -125,7 +108,7 @@ private:
// main unit
-void base_state::update_display()
+void sag_state::update_display()
{
// grid 0-7 are the 'pixels'
m_display->matrix_partial(0, 8, m_grid, m_plate, false);
@@ -135,7 +118,7 @@ void base_state::update_display()
m_display->matrix_partial(8, 6, m_grid >> 8, seg);
}
-u8 base_state::input_r()
+u8 sag_state::input_r()
{
u8 data = 0;
@@ -147,15 +130,79 @@ u8 base_state::input_r()
return data;
}
-void base_state::speaker_w(int state)
+void sag_state::speaker_w(int state)
{
m_speaker->level_w(state);
}
+// cartridge loading
+
+DEVICE_IMAGE_LOAD_MEMBER(sag_state::cart_load)
+{
+ u32 size = m_cart->common_get_size("rom");
+
+ if (size != 0x1000 && size != 0x1100 && size != 0x2000)
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid ROM file size");
+ return image_init_result::FAIL;
+ }
+
+ m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
+ m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");
+
+ if (size == 0x1000)
+ {
+ // TMS1670 MCU
+ if (!image.loaded_through_softlist())
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Can only load TMS1670 type through softwarelist");
+ return image_init_result::FAIL;
+ }
+
+ memcpy(memregion("tms1k_cpu")->base(), m_cart->get_rom_base(), size);
+ m_tms1k_cpu->set_clock(375000); // approximation - RC osc. R=47K, C=47pF
+
+ // init PLAs
+ size = image.get_software_region_length("rom:mpla");
+ if (size != 867)
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid MPLA file size");
+ return image_init_result::FAIL;
+ }
+ memcpy(memregion("tms1k_cpu:mpla")->base(), image.get_software_region("rom:mpla"), size);
+
+ size = image.get_software_region_length("rom:opla");
+ if (size != 557)
+ {
+ image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid OPLA file size");
+ return image_init_result::FAIL;
+ }
+ memcpy(memregion("tms1k_cpu:opla")->base(), image.get_software_region("rom:opla"), size);
+
+ subdevice<pla_device>("tms1k_cpu:mpla")->reinit();
+ subdevice<pla_device>("tms1k_cpu:opla")->reinit();
+ }
+ else
+ {
+ // HD38800 MCU
+ u8 *dest = memregion("hmcs40_cpu")->base();
+ memcpy(dest, m_cart->get_rom_base(), size);
+
+ // copy patterns
+ if (size == 0x1100)
+ memmove(dest + 0x1e80, dest + 0x1000, 0x100);
+
+ m_hmcs40_cpu->set_clock(450000); // from main PCB
+ }
+
+ return image_init_result::PASS;
+}
+
+
// cartridge type 1: HD38800
-WRITE8_MEMBER(hmcs40_state::write_r)
+WRITE8_MEMBER(sag_state::hmcs40_write_r)
{
// R0x-R3x: vfd plate
int shift = offset * 4;
@@ -163,7 +210,7 @@ WRITE8_MEMBER(hmcs40_state::write_r)
update_display();
}
-WRITE16_MEMBER(hmcs40_state::write_d)
+WRITE16_MEMBER(sag_state::hmcs40_write_d)
{
// D0: speaker out
speaker_w(data & 1);
@@ -173,7 +220,7 @@ WRITE16_MEMBER(hmcs40_state::write_d)
update_display();
}
-READ16_MEMBER(hmcs40_state::read_d)
+READ16_MEMBER(sag_state::hmcs40_read_d)
{
// D13-D15: multiplexed inputs
return input_r() << 13;
@@ -182,7 +229,7 @@ READ16_MEMBER(hmcs40_state::read_d)
// cartridge type 2: TMS1670
-WRITE16_MEMBER(tms1k_state::write_r)
+WRITE16_MEMBER(sag_state::tms1k_write_r)
{
// R0: speaker out
speaker_w(data & 1);
@@ -194,14 +241,14 @@ WRITE16_MEMBER(tms1k_state::write_r)
update_display();
}
-WRITE16_MEMBER(tms1k_state::write_o)
+WRITE16_MEMBER(sag_state::tms1k_write_o)
{
// O0-O7: vfd plate 4-11
m_plate = (m_plate & 0xf) | data << 4;
update_display();
}
-READ8_MEMBER(tms1k_state::read_k)
+READ8_MEMBER(sag_state::tms1k_read_k)
{
// K1-K4: multiplexed inputs
return input_r();
@@ -261,8 +308,22 @@ INPUT_PORTS_END
Machine Configs
******************************************************************************/
-void base_state::shared(machine_config &config)
+void sag_state::sag(machine_config &config)
{
+ /* basic machine hardware */
+ HD38800(config, m_hmcs40_cpu, 0);
+ m_hmcs40_cpu->write_r<0>().set(FUNC(sag_state::hmcs40_write_r));
+ m_hmcs40_cpu->write_r<1>().set(FUNC(sag_state::hmcs40_write_r));
+ m_hmcs40_cpu->write_r<2>().set(FUNC(sag_state::hmcs40_write_r));
+ m_hmcs40_cpu->write_r<3>().set(FUNC(sag_state::hmcs40_write_r));
+ m_hmcs40_cpu->write_d().set(FUNC(sag_state::hmcs40_write_d));
+ m_hmcs40_cpu->read_d().set(FUNC(sag_state::hmcs40_read_d));
+
+ TMS1670(config, m_tms1k_cpu, 0);
+ m_tms1k_cpu->k().set(FUNC(sag_state::tms1k_read_k));
+ m_tms1k_cpu->r().set(FUNC(sag_state::tms1k_write_r));
+ m_tms1k_cpu->o().set(FUNC(sag_state::tms1k_write_o));
+
/* video hardware */
PWM_DISPLAY(config, m_display).set_size(8+6, 14);
m_display->set_segmask(0x3f00, 0x7f);
@@ -271,31 +332,13 @@ void base_state::shared(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
-}
-void hmcs40_state::sag(machine_config &config)
-{
- /* basic machine hardware */
- HD38800(config, m_maincpu, 450000); // approximation
- m_maincpu->write_r<0>().set(FUNC(hmcs40_state::write_r));
- m_maincpu->write_r<1>().set(FUNC(hmcs40_state::write_r));
- m_maincpu->write_r<2>().set(FUNC(hmcs40_state::write_r));
- m_maincpu->write_r<3>().set(FUNC(hmcs40_state::write_r));
- m_maincpu->write_d().set(FUNC(hmcs40_state::write_d));
- m_maincpu->read_d().set(FUNC(hmcs40_state::read_d));
-
- shared(config);
-}
+ /* cartridge */
+ GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "sag_cart");
+ m_cart->set_must_be_loaded(true);
+ m_cart->set_device_load(FUNC(sag_state::cart_load));
-void tms1k_state::sag(machine_config &config)
-{
- /* basic machine hardware */
- TMS1670(config, m_maincpu, 375000); // approximation - RC osc. R=47K, C=47pF
- m_maincpu->k().set(FUNC(tms1k_state::read_k));
- m_maincpu->r().set(FUNC(tms1k_state::write_r));
- m_maincpu->o().set(FUNC(tms1k_state::write_o));
-
- shared(config);
+ SOFTWARE_LIST(config, "cart_list").set_original("entex_sag");
}
@@ -304,32 +347,12 @@ void tms1k_state::sag(machine_config &config)
ROM Definitions
******************************************************************************/
-ROM_START( sag_sinv2 )
- ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 )
- ROM_LOAD( "inv2_hd38800a31", 0x0000, 0x1000, BAD_DUMP CRC(29c8c100) SHA1(41cd413065659c6d7d5b2408de2ca6d51c49629a) )
- ROM_CONTINUE( 0x1e80, 0x0100 )
-ROM_END
-
-ROM_START( sag_baseb4 )
- ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 )
- ROM_LOAD( "b-b5_hd38800a37", 0x0000, 0x1000, CRC(64852bd5) SHA1(fb1c24ca43934ceb6fc35ac7c35b71e6e843dbc5) )
- ROM_CONTINUE( 0x1e80, 0x0100 )
-ROM_END
-
-ROM_START( sag_pinb )
- ROM_REGION( 0x2000, "maincpu", ROMREGION_ERASE00 )
- ROM_LOAD( "pinb_hd38800a38", 0x0000, 0x1000, CRC(6e53a56b) SHA1(13f057eab2e4cfbb3ef1247a041abff15ae727c9) )
- ROM_CONTINUE( 0x1e80, 0x0100 )
-ROM_END
-
-ROM_START( sag_footb4 )
- ROM_REGION( 0x1000, "maincpu", 0 )
- ROM_LOAD( "ftba_mp7573", 0x0000, 0x1000, CRC(b17dd9e3) SHA1(9c9e7a56643233ef2adff7b68a6df19e6ca176c2) ) // die label TMS1400, MP7573
-
- ROM_REGION( 867, "maincpu:mpla", 0 )
- ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) )
- ROM_REGION( 557, "maincpu:opla", 0 )
- ROM_LOAD( "tms1400_sag_fb4_output.pla", 0, 557, CRC(f15dc6a1) SHA1(ee11a64037895ac566e902b6b590ff62a7f703b0) )
+ROM_START( sag )
+ // nothing here yet, ROM is on the cartridge
+ ROM_REGION( 0x2000, "hmcs40_cpu", ROMREGION_ERASE00 )
+ ROM_REGION( 0x1000, "tms1k_cpu", ROMREGION_ERASE00 )
+ ROM_REGION( 867, "tms1k_cpu:mpla", ROMREGION_ERASE00 )
+ ROM_REGION( 557, "tms1k_cpu:opla", ROMREGION_ERASE00 )
ROM_END
} // anonymous namespace
@@ -340,9 +363,5 @@ ROM_END
Drivers
******************************************************************************/
-// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
-CONS( 1981, sag_sinv2, 0, 0, sag, sag, hmcs40_state, empty_init, "Entex", "Select-A-Game Machine: Space Invader 2", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING ) // suspect bad dump
-CONS( 1981, sag_baseb4, 0, 0, sag, sag, hmcs40_state, empty_init, "Entex", "Select-A-Game Machine: Baseball 4", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK )
-CONS( 1981, sag_pinb, 0, 0, sag, sag, hmcs40_state, empty_init, "Entex", "Select-A-Game Machine: Pinball", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK )
-
-CONS( 1981, sag_footb4, 0, 0, sag, sag, tms1k_state, empty_init, "Entex", "Select-A-Game Machine: Football 4", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK )
+// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
+CONS( 1981, sag, 0, 0, sag, sag, sag_state, empty_init, "Entex", "Select-A-Game Machine", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK )
diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp
index da71f6ddbdb..8cb5889a980 100644
--- a/src/mame/drivers/scobra.cpp
+++ b/src/mame/drivers/scobra.cpp
@@ -1960,4 +1960,4 @@ GAME( 1981, hustlerb6, hustler, hustlerb6, hustler, scobra_state, empty_i
GAME( 1982, mimonkey, 0, mimonkey, mimonkey, scobra_state, init_mimonkey, ROT90, "Universal Video Games", "Mighty Monkey", MACHINE_SUPPORTS_SAVE )
GAME( 1982, mimonsco, mimonkey, mimonkey, mimonsco, scobra_state, init_mimonsco, ROT90, "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", MACHINE_SUPPORTS_SAVE )
-GAME( 1983, mimonkeyug, mimonkey, mimonkeyug, mimonkeyug, scobra_state, init_mimonsco, ROT90, "bootleg (U.Games)", "Mighty Monkey (U.Games bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1983, mimonkeyug, mimonkey, mimonkeyug, mimonkeyug, scobra_state, init_mimonsco, ROT90, "bootleg (U.Games)", "Mighty Monkey (U.Games bootleg)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // missing discrete sound components emulation
diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp
index f08c801f6d9..196f46a81d8 100644
--- a/src/mame/drivers/snk.cpp
+++ b/src/mame/drivers/snk.cpp
@@ -5234,7 +5234,7 @@ ROM_END
/***********************************************************************/
-ROM_START( victroad )
+ROM_START( victroad ) // A6002UP03-02 PCB
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "p1.p4", 0x0000, 0x10000, CRC(e334acef) SHA1(f6d8da554276abbe5579c92eea46591a92623f6e) )
@@ -5244,10 +5244,14 @@ ROM_START( victroad )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "p3.k7", 0x00000, 0x10000, CRC(bac745f6) SHA1(c118d94aff16cbf1b85615ff5a93292f6e98c149) )
- ROM_REGION( 0x0c00, "proms", 0 )
- ROM_LOAD( "mb7122e.1k", 0x000, 0x400, CRC(491ab831) SHA1(2801d68d8a7fddaca5c48f09d421fc48ff53d244) )
- ROM_LOAD( "mb7122e.2l", 0x400, 0x400, CRC(8feca424) SHA1(c3d666f4b4b914199b24ded02f9a1b643bf90d26) )
- ROM_LOAD( "mb7122e.1l", 0x800, 0x400, CRC(220076ca) SHA1(a353c770c0ffb1105fb93c97977597ad2fda8ac8) )
+ ROM_REGION( 0xc00, "proms", 0 )
+ ROM_LOAD( "c1_mb7122e.1k", 0x000, 0x400, CRC(491ab831) SHA1(2801d68d8a7fddaca5c48f09d421fc48ff53d244) )
+ ROM_LOAD( "c2_mb7122e.2l", 0x400, 0x400, CRC(8feca424) SHA1(c3d666f4b4b914199b24ded02f9a1b643bf90d26) )
+ ROM_LOAD( "c3_mb7122e.1l", 0x800, 0x400, CRC(220076ca) SHA1(a353c770c0ffb1105fb93c97977597ad2fda8ac8) )
+
+ ROM_REGION( 0x2000, "rjproms", 0 ) // for rotary joystick decoding, same for both players
+ ROM_LOAD( "1_mb7134e.1d", 0x0000, 0x1000, CRC(5ab67bfc) SHA1(62a62a7e4573d1233b50ddd163c4e3d9bdefaddd) )
+ ROM_LOAD( "1_mb7134e.2d", 0x1000, 0x1000, CRC(5ab67bfc) SHA1(62a62a7e4573d1233b50ddd163c4e3d9bdefaddd) )
ROM_REGION( 0x4000, "tx_tiles", 0 )
ROM_LOAD( "p7.b3", 0x0000, 0x4000, CRC(2b6ed95b) SHA1(dddf3aa21776778153572a20d29d47928a7116d8) )
@@ -5279,7 +5283,7 @@ ROM_START( victroad )
ROM_LOAD( "a5004-1.d6", 0x000, 0x104, CRC(311e5ae6) SHA1(8a3799e1611ac4086dda2755c5ad44c0dc16ff5b) )
ROM_LOAD( "a5004-4.s8", 0x200, 0x104, CRC(fad4c493) SHA1(0aacc2d25434173366ba95eaac848812ea9f40c5) )
ROM_LOAD( "a6002-3.p2", 0x400, 0x104, CRC(036b1a16) SHA1(c688071c452066e5d4addf09212eb76d3078ec45) )
- ROM_LOAD( "pal20l8", 0x600, 0x144, NO_DUMP ) // protected
+ ROM_LOAD( "a6002-2.r5", 0x600, 0x144, NO_DUMP ) // PAL20L8ACNS, protected
ROM_END
ROM_START( dogosoke )
diff --git a/src/mame/drivers/tandy1t.cpp b/src/mame/drivers/tandy1t.cpp
index 96c42eb4661..4141cc45363 100644
--- a/src/mame/drivers/tandy1t.cpp
+++ b/src/mame/drivers/tandy1t.cpp
@@ -40,7 +40,6 @@ Tandy 1000 (80386) variations:
#include "machine/genpc.h"
#include "machine/pckeybrd.h"
#include "machine/nvram.h"
-#include "machine/pc_fdc.h"
#include "machine/bankdev.h"
#include "video/pc_t1t.h"
#include "sound/sn76496.h"
diff --git a/src/mame/includes/advision.h b/src/mame/includes/advision.h
index 4a2cd1b44b5..f55de1ba076 100644
--- a/src/mame/includes/advision.h
+++ b/src/mame/includes/advision.h
@@ -1,10 +1,6 @@
// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
-/*****************************************************************************
- *
- * includes/advision.h
- *
- ****************************************************************************/
+// copyright-holders:Dan Boris
+
#ifndef MAME_INCLUDES_ADVISION_H
#define MAME_INCLUDES_ADVISION_H
diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h
index 68683356f5f..9712948f85b 100644
--- a/src/mame/includes/dec0.h
+++ b/src/mame/includes/dec0.h
@@ -65,8 +65,6 @@ public:
void init_midresb();
void init_ffantasybl();
- DECLARE_VIDEO_START(dec0_nodma);
-
protected:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@@ -86,7 +84,11 @@ protected:
DECLARE_READ16_MEMBER(slyspy_controls_r);
DECLARE_WRITE16_MEMBER(priority_w);
+ DECLARE_VIDEO_START(dec0_nodma);
+ DECLARE_VIDEO_START(slyspy);
+
void robocop_colpri_cb(u32 &colour, u32 &pri_mask);
+ void baddudes_tile_cb(tile_data &tileinfo, u32 &tile, u32 &colour, u32 &flags);
void set_screen_raw_params_data_east(machine_config &config);
@@ -139,15 +141,13 @@ private:
virtual void machine_start() override;
DECLARE_MACHINE_RESET(slyspy);
DECLARE_VIDEO_START(dec0);
+ DECLARE_VIDEO_START(baddudes);
uint32_t screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_bandit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_baddudes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_birdtry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_robocop(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_hippodrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_slyspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_midres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void hbarrel_colpri_cb(u32 &colour, u32 &pri_mask);
void bandit_colpri_cb(u32 &colour, u32 &pri_mask);
diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h
index 5ed60fd5abb..031e557c59d 100644
--- a/src/mame/includes/dec8.h
+++ b/src/mame/includes/dec8.h
@@ -203,6 +203,7 @@ private:
void srdarwin_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &primap);
void gondo_colpri_cb(u32 &colour, u32 &pri_mask);
void cobracom_colpri_cb(u32 &colour, u32 &pri_mask);
+ void oscar_tile_cb(tile_data &tileinfo, u32 &tile, u32 &colour, u32 &flags);
DECLARE_WRITE_LINE_MEMBER(csilver_adpcm_int);
void set_screen_raw_params_data_east(machine_config &config);
diff --git a/src/mame/includes/nforcepc.h b/src/mame/includes/nforcepc.h
index 573d7c2fed0..c5122a117e9 100644
--- a/src/mame/includes/nforcepc.h
+++ b/src/mame/includes/nforcepc.h
@@ -286,7 +286,7 @@ private:
devcb_write_line m_txd2_callback;
devcb_write_line m_ndtr2_callback;
devcb_write_line m_nrts2_callback;
- required_device<pc_fdc_interface> floppy_controller_fdcdev;
+ required_device<smc37c78_device> floppy_controller_fdcdev;
required_device<pc_lpt_device> pc_lpt_lptdev;
required_device<ns16450_device> pc_serial1_comdev;
required_device<ns16450_device> pc_serial2_comdev;
diff --git a/src/mame/layout/lbeach.lay b/src/mame/layout/lbeach.lay
index 0ca977c13a3..c0596696609 100644
--- a/src/mame/layout/lbeach.lay
+++ b/src/mame/layout/lbeach.lay
@@ -27,12 +27,18 @@ license:CC0
</rect>
</element>
+ <element name="black"><rect><color red="0" green="0" blue="0" /></rect></element>
+
<view name="Color Overlay">
+ <bounds left="0" right="640" top="0" bottom="480" />
<screen index="0">
- <bounds left="0" top="0" right="4" bottom="3" />
+ <bounds x="0" y="0" width="738.46" height="480" />
</screen>
+ <bezel element="black">
+ <bounds x="640" y="0" width="100" height="480" />
+ </bezel>
<overlay element="overlay">
- <bounds left="0" top="0" right="4" bottom="3" />
+ <bounds x="0" y="0" width="738.46" height="480" />
</overlay>
</view>
</mamelayout>
diff --git a/src/mame/layout/speedrs.lay b/src/mame/layout/speedrs.lay
index a6dd0eefa89..1bda95a8871 100644
--- a/src/mame/layout/speedrs.lay
+++ b/src/mame/layout/speedrs.lay
@@ -51,20 +51,30 @@ license:CC0
</disk>
</element>
+ <element name="black"><rect><color red="0" green="0" blue="0" /></rect></element>
+
<view name="Shifter-R">
+ <bounds left="0" right="640" top="0" bottom="480" />
<screen index="0">
- <bounds x="0" y="0" width="640" height="480" />
+ <bounds x="0" y="0" width="738.46" height="480" />
</screen>
- <bezel element="shifter" inputtag="IN.0" inputmask="0x02">
+ <bezel element="black">
+ <bounds x="640" y="0" width="100" height="480" />
+ </bezel>
+ <bezel element="shifter" inputtag="IN.2" inputmask="0x02">
<bounds x="606" y="414" width="32" height="64" />
<color alpha="0.6" />
</bezel>
</view>
<view name="Shifter-L">
+ <bounds left="0" right="640" top="0" bottom="480" />
<screen index="0">
- <bounds x="0" y="0" width="640" height="480" />
+ <bounds x="0" y="0" width="738.46" height="480" />
</screen>
- <bezel element="shifter" inputtag="IN.0" inputmask="0x02">
+ <bezel element="black">
+ <bounds x="640" y="0" width="100" height="480" />
+ </bezel>
+ <bezel element="shifter" inputtag="IN.2" inputmask="0x02">
<bounds x="2" y="414" width="32" height="64" />
<color alpha="0.6" />
</bezel>
diff --git a/src/mame/machine/advision.cpp b/src/mame/machine/advision.cpp
index baa59914536..294fd5f2006 100644
--- a/src/mame/machine/advision.cpp
+++ b/src/mame/machine/advision.cpp
@@ -1,9 +1,7 @@
// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
+// copyright-holders:Dan Boris
/***************************************************************************
- advision.c
-
Machine file to handle emulation of the AdventureVision.
***************************************************************************/
diff --git a/src/mame/machine/inder_sb.cpp b/src/mame/machine/inder_sb.cpp
index 871c0e0df14..cd6465e1140 100644
--- a/src/mame/machine/inder_sb.cpp
+++ b/src/mame/machine/inder_sb.cpp
@@ -191,4 +191,6 @@ void inder_sb_device::device_start()
void inder_sb_device::device_reset()
{
+ m_soundsent = 0;
+ m_soundback = 0;
}
diff --git a/src/mame/machine/taitosjsec.cpp b/src/mame/machine/taitosjsec.cpp
index dd5a6267812..cd8c5ce12c4 100644
--- a/src/mame/machine/taitosjsec.cpp
+++ b/src/mame/machine/taitosjsec.cpp
@@ -24,6 +24,7 @@ taito_sj_security_mcu_device::taito_sj_security_mcu_device(
, m_read_data(0U)
, m_zaccept(false)
, m_zready(false)
+ , m_pa_val(0U)
, m_pb_val(0U)
, m_busak(false)
, m_reset(false)
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 8fb159bb3a2..82ab96d966b 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -22267,6 +22267,9 @@ spitboss // (c) 1988 Merit
scrpiond //
scrpionda //
+@source:meritsdx.cpp
+scrpndx //
+
@source:meritum.cpp
meritum1 //
meritum2 //
@@ -35058,10 +35061,7 @@ safarir // (c) 1980 Shin Nihon Kikaku (SNK) + Taito lice
safarirj // (c) 1979 Shin Nihon Kikaku (SNK)
@source:sag.cpp
-sag_baseb4
-sag_footb4
-sag_pinb
-sag_sinv2
+sag
@source:sage2.cpp
sage2 //
@@ -35411,7 +35411,7 @@ hustlerb5 // bootleg
hustlerb6 // bootleg
hustlerd // GX343 (c) 1981 Konami + Dynamo Games license
mimonkey // (c) 1982 Universal Video Games (US Copyright Office info - http://cocatalog.loc.gov)
-mimonkeyug // (c) 1982 bootleg
+mimonkeyug // (c) 1983 bootleg
mimonsco // (c) 1982 bootleg
minefld // (c) 1983 Stern
minefldfe // bootleg
diff --git a/src/mame/video/actfancr.cpp b/src/mame/video/actfancr.cpp
index f56c166a641..725293aae7a 100644
--- a/src/mame/video/actfancr.cpp
+++ b/src/mame/video/actfancr.cpp
@@ -25,9 +25,9 @@ uint32_t actfancr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
m_tilegen[1]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(1), m_spriteram16.get(), 0x800/2);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
return 0;
}
diff --git a/src/mame/video/advision.cpp b/src/mame/video/advision.cpp
index 60ba1928bdc..b0eec08439b 100644
--- a/src/mame/video/advision.cpp
+++ b/src/mame/video/advision.cpp
@@ -1,9 +1,7 @@
// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
+// copyright-holders:Dan Boris
/***************************************************************************
- video/advision.c
-
Routines to control the Adventurevision video hardware
Video hardware is composed of a vertical array of 40 LEDs which is
diff --git a/src/mame/video/dec0.cpp b/src/mame/video/dec0.cpp
index 3c4508fec77..f9103919935 100644
--- a/src/mame/video/dec0.cpp
+++ b/src/mame/video/dec0.cpp
@@ -16,34 +16,13 @@
void dec0_state::hbarrel_colpri_cb(u32 &colour, u32 &pri_mask)
{
- pri_mask = 0; // above background, foreground
+ pri_mask = GFX_PMASK_4; // above background, foreground
if (colour & 8)
{
pri_mask |= GFX_PMASK_2; // behind foreground
}
}
-uint32_t dec0_state::screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- screen.priority().fill(0,cliprect);
- bool flip = m_tilegen[0]->get_flip_state();
- m_tilegen[0]->set_flip_screen(flip);
- m_tilegen[1]->set_flip_screen(flip);
- m_tilegen[2]->set_flip_screen(flip);
- m_spritegen->set_flip_screen(flip);
-
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
-
- /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
-
- m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
- return 0;
-}
-
-/******************************************************************************/
-
void dec0_state::bandit_colpri_cb(u32 &colour, u32 &pri_mask)
{
pri_mask = 0; // above all
@@ -53,7 +32,8 @@ void dec0_state::bandit_colpri_cb(u32 &colour, u32 &pri_mask)
}
}
-uint32_t dec0_state::screen_update_bandit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+/* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
+uint32_t dec0_state::screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0,cliprect);
bool flip = m_tilegen[0]->get_flip_state();
@@ -62,15 +42,20 @@ uint32_t dec0_state::screen_update_bandit(screen_device &screen, bitmap_ind16 &b
m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 4);
+ m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 1);
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 2);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 4);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
return 0;
}
/******************************************************************************/
+void dec0_state::baddudes_tile_cb(tile_data &tileinfo, u32 &tile, u32 &colour, u32 &flags)
+{
+ tileinfo.group = BIT(colour, 3) ? 1 : 0;
+}
+
uint32_t dec0_state::screen_update_baddudes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bool flip = m_tilegen[0]->get_flip_state();
@@ -80,39 +65,29 @@ uint32_t dec0_state::screen_update_baddudes(screen_device &screen, bitmap_ind16
m_spritegen->set_flip_screen(flip);
/* WARNING: inverted wrt Midnight Resistance */
- if ((m_pri & 0x01) == 0)
- {
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
-
- if (m_pri & 2)
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0x08,0x08,0x08,0x08, 0); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
-
- m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
-
- if (m_pri & 4)
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
- }
- else
- {
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ const u8 fg = (m_pri & 0x01) ? 1 : 2;
+ const u8 bg = (m_pri & 0x01) ? 2 : 1;
+ m_tilegen[bg]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
+ m_tilegen[fg]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0 | TILEMAP_DRAW_LAYER1, 0);
- if (m_pri & 2)
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0x08,0x08,0x08,0x08, 0); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ if (m_pri & 2)
+ m_tilegen[bg]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0, 0); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
- m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
+ m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
- if (m_pri & 4)
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0x08,0x08,0x08,0x08, 0); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
- }
+ if (m_pri & 4)
+ m_tilegen[fg]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0, 0); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
return 0;
}
/******************************************************************************/
+/* WARNING: inverted wrt Midnight Resistance */
+/* Robocop uses it only for the title screen, so this might be just */
+/* completely wrong. The top 8 bits of the register might mean */
+/* something (they are 0x80 in midres, 0x00 here) */
void dec0_state::robocop_colpri_cb(u32 &colour, u32 &pri_mask)
{
pri_mask = 0; // above background, foreground
@@ -124,6 +99,17 @@ void dec0_state::robocop_colpri_cb(u32 &colour, u32 &pri_mask)
}
}
+void dec0_state::midres_colpri_cb(u32 &colour, u32 &pri_mask)
+{
+ pri_mask = 0; // above background, foreground
+ if (m_pri & 0x02)
+ {
+ const u32 trans = (m_pri & 0x04) ? 0x00 : 0x08;
+ if ((colour & 0x08) == trans)
+ pri_mask |= GFX_PMASK_2; // behind foreground
+ }
+}
+
uint32_t dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0,cliprect);
@@ -134,27 +120,15 @@ uint32_t dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &
m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- if (m_pri & 0x01)
- {
- /* WARNING: inverted wrt Midnight Resistance */
- /* Robocop uses it only for the title screen, so this might be just */
- /* completely wrong. The top 8 bits of the register might mean */
- /* something (they are 0x80 in midres, 0x00 here) */
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
- }
- else
- {
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
- }
-
+ const u8 fg = (m_pri & 0x01) ? 2 : 1;
+ const u8 bg = (m_pri & 0x01) ? 1 : 2;
+ m_tilegen[bg]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 1);
+ m_tilegen[fg]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 2);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
return 0;
}
-
uint32_t dec0_automat_state::screen_update_automat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0,cliprect);
@@ -194,72 +168,15 @@ uint32_t dec0_automat_state::screen_update_automat(screen_device &screen, bitmap
m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- if (m_pri & 0x01)
- {
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
- }
- else
- {
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
- }
-
+ const u8 fg = (m_pri & 0x01) ? 2 : 1;
+ const u8 bg = (m_pri & 0x01) ? 1 : 2;
+ m_tilegen[bg]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 1);
+ m_tilegen[fg]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 2);
m_spritegen->draw_sprites_bootleg(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2); // TODO : RAM size
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
return 0;
}
-uint32_t dec0_automat_state::screen_update_secretab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- // layer enables seem different... where are they?
-
- // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
- m_tilegen[0]->pf_control_0_w(0,0x0003, 0x00ff); // 8x8
- m_tilegen[0]->pf_control_0_w(1,0x0003, 0x00ff);
- m_tilegen[0]->pf_control_0_w(2,0x0000, 0x00ff);
- m_tilegen[0]->pf_control_0_w(3,0x0001, 0x00ff); // dimensions
-
- m_tilegen[1]->pf_control_0_w(0,0x0082, 0x00ff); // 16x16
- m_tilegen[1]->pf_control_0_w(1,0x0000, 0x00ff);
- m_tilegen[1]->pf_control_0_w(2,0x0000, 0x00ff);
- m_tilegen[1]->pf_control_0_w(3,0x0001, 0x00ff); // dimensions
-
- m_tilegen[2]->pf_control_0_w(0,0x0082, 0x00ff); // 16x16
- m_tilegen[2]->pf_control_0_w(1,0x0003, 0x00ff);
- m_tilegen[2]->pf_control_0_w(2,0x0000, 0x00ff);
- m_tilegen[2]->pf_control_0_w(3,0x0001, 0x00ff); // dimensions
-
- // scroll registers got written elsewhere, copy them across
- m_tilegen[0]->pf_control_1_w(0,0x0000, 0xffff); // no scroll?
- m_tilegen[0]->pf_control_1_w(1,0x0000, 0xffff); // no scroll?
-
- m_tilegen[1]->pf_control_1_w(0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
- m_tilegen[1]->pf_control_1_w(1,m_automat_scroll_regs[2], 0xffff);
-
- m_tilegen[2]->pf_control_1_w(0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
- m_tilegen[2]->pf_control_1_w(1,m_automat_scroll_regs[0], 0xffff);
-
- bool flip = m_tilegen[0]->get_flip_state();
- m_tilegen[0]->set_flip_screen(flip);
- m_tilegen[1]->set_flip_screen(flip);
- m_tilegen[2]->set_flip_screen(flip);
- m_spritegen->set_flip_screen(flip);
-
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
-
- m_spritegen->draw_sprites_bootleg(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2); // TODO : RAM size
-
- /* Redraw top 8 pens of top 8 palettes over sprites */
- if (m_pri & 0x80)
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0x08,0x08,0x08,0x08, 0); // upper 8 pens of upper 8 priority marked tiles
-
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
- return 0;
-}
-
-
/******************************************************************************/
uint32_t dec0_state::screen_update_birdtry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -272,35 +189,9 @@ uint32_t dec0_state::screen_update_birdtry(screen_device &screen, bitmap_ind16 &
/* This game doesn't have the extra playfield chip on the game board, but
the palette does show through. */
bitmap.fill(m_palette->pen(768), cliprect);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
- return 0;
-}
-
-/******************************************************************************/
-
-uint32_t dec0_state::screen_update_hippodrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- bool flip = m_tilegen[0]->get_flip_state();
- m_tilegen[0]->set_flip_screen(flip);
- m_tilegen[1]->set_flip_screen(flip);
- m_tilegen[2]->set_flip_screen(flip);
- m_spritegen->set_flip_screen(flip);
-
- if (m_pri & 0x01)
- {
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
- }
- else
- {
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
- }
-
- m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0);
return 0;
}
@@ -314,35 +205,48 @@ uint32_t dec0_state::screen_update_slyspy(screen_device &screen, bitmap_ind16 &b
m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0 | TILEMAP_DRAW_LAYER1, 0);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
/* Redraw top 8 pens of top 8 palettes over sprites */
if (m_pri & 0x80)
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0x08,0x08,0x08,0x08, 0); // upper 8 pens of upper 8 priority marked tiles
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0, 0); // upper 8 pens of upper 8 priority marked tiles
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0);
return 0;
}
-/******************************************************************************/
-
-void dec0_state::midres_colpri_cb(u32 &colour, u32 &pri_mask)
+uint32_t dec0_automat_state::screen_update_secretab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- pri_mask = 0; // above background, foreground
- if (m_pri & 0x02)
- {
- const u32 trans = (m_pri & 0x04) ? 0x00 : 0x08;
- if ((colour & 0x08) == trans)
- pri_mask |= GFX_PMASK_2; // behind foreground
- }
-}
+ // layer enables seem different... where are they?
-uint32_t dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- screen.priority().fill(0,cliprect);
+ // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
+ m_tilegen[0]->pf_control_0_w(0,0x0003, 0x00ff); // 8x8
+ m_tilegen[0]->pf_control_0_w(1,0x0003, 0x00ff);
+ m_tilegen[0]->pf_control_0_w(2,0x0000, 0x00ff);
+ m_tilegen[0]->pf_control_0_w(3,0x0001, 0x00ff); // dimensions
+
+ m_tilegen[1]->pf_control_0_w(0,0x0082, 0x00ff); // 16x16
+ m_tilegen[1]->pf_control_0_w(1,0x0000, 0x00ff);
+ m_tilegen[1]->pf_control_0_w(2,0x0000, 0x00ff);
+ m_tilegen[1]->pf_control_0_w(3,0x0001, 0x00ff); // dimensions
+
+ m_tilegen[2]->pf_control_0_w(0,0x0082, 0x00ff); // 16x16
+ m_tilegen[2]->pf_control_0_w(1,0x0003, 0x00ff);
+ m_tilegen[2]->pf_control_0_w(2,0x0000, 0x00ff);
+ m_tilegen[2]->pf_control_0_w(3,0x0001, 0x00ff); // dimensions
+
+ // scroll registers got written elsewhere, copy them across
+ m_tilegen[0]->pf_control_1_w(0,0x0000, 0xffff); // no scroll?
+ m_tilegen[0]->pf_control_1_w(1,0x0000, 0xffff); // no scroll?
+
+ m_tilegen[1]->pf_control_1_w(0,m_automat_scroll_regs[3] - 0x010a, 0xffff);
+ m_tilegen[1]->pf_control_1_w(1,m_automat_scroll_regs[2], 0xffff);
+
+ m_tilegen[2]->pf_control_1_w(0,m_automat_scroll_regs[1] - 0x0108, 0xffff);
+ m_tilegen[2]->pf_control_1_w(1,m_automat_scroll_regs[0], 0xffff);
bool flip = m_tilegen[0]->get_flip_state();
m_tilegen[0]->set_flip_screen(flip);
@@ -350,22 +254,20 @@ uint32_t dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &b
m_tilegen[2]->set_flip_screen(flip);
m_spritegen->set_flip_screen(flip);
- if (m_pri & 0x01)
- {
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
- }
- else
- {
- m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
- }
+ m_tilegen[2]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0 | TILEMAP_DRAW_LAYER1, 0);
- m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 0);
+ m_spritegen->draw_sprites_bootleg(screen, bitmap, cliprect, m_gfxdecode->gfx(3), m_buffered_spriteram, 0x800/2); // TODO : RAM size
+
+ /* Redraw top 8 pens of top 8 palettes over sprites */
+ if (m_pri & 0x80)
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0, 0); // upper 8 pens of upper 8 priority marked tiles
+
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0,0);
return 0;
}
+/******************************************************************************/
WRITE16_MEMBER(dec0_state::priority_w)
{
@@ -386,4 +288,20 @@ VIDEO_START_MEMBER(dec0_state,dec0)
save_pointer(NAME(m_buffered_spriteram), 0x800/2);
}
+VIDEO_START_MEMBER(dec0_state,baddudes)
+{
+ VIDEO_START_CALL_MEMBER(dec0);
+ m_tilegen[1]->set_transmask(0, 0xffff, 0x0001);
+ m_tilegen[1]->set_transmask(1, 0x00ff, 0xff01);
+ m_tilegen[2]->set_transmask(0, 0xffff, 0x0001);
+ m_tilegen[2]->set_transmask(1, 0x00ff, 0xff01);
+}
+
+VIDEO_START_MEMBER(dec0_state,slyspy)
+{
+ VIDEO_START_CALL_MEMBER(dec0_nodma);
+ m_tilegen[1]->set_transmask(0, 0xffff, 0x0001);
+ m_tilegen[1]->set_transmask(1, 0x00ff, 0xff01);
+}
+
/******************************************************************************/
diff --git a/src/mame/video/dec8.cpp b/src/mame/video/dec8.cpp
index ec62520a1d6..4d89823bf17 100644
--- a/src/mame/video/dec8.cpp
+++ b/src/mame/video/dec8.cpp
@@ -224,8 +224,8 @@ uint32_t dec8_state::screen_update_cobracom(screen_device &screen, bitmap_ind16
m_spritegen_mxc->set_flip_screen(flip);
m_fix_tilemap->set_flip(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 1);
- m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00, 2);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 1);
+ m_tilegen[1]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 2);
m_spritegen_mxc->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(1), m_buffered_spriteram16.get(), 0x800/2);
m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
@@ -254,15 +254,13 @@ VIDEO_START_MEMBER(dec8_state,cobracom)
m_fix_tilemap->set_transparent_pen(0);
m_game_uses_priority = 0;
- m_tilegen[0]->set_colmask(0x3);
- m_tilegen[1]->set_colmask(0x3);
}
/******************************************************************************/
uint32_t dec8_state::screen_update_ghostb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
m_spritegen_krn->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(1), m_buffered_spriteram16.get(), 0x400);
m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
@@ -287,7 +285,6 @@ VIDEO_START_MEMBER(dec8_state,ghostb)
m_fix_tilemap->set_transparent_pen(0);
m_game_uses_priority = 0;
- m_tilegen[0]->set_colmask(0xf);
m_nmi_enable = false;
save_item(NAME(m_nmi_enable));
@@ -295,6 +292,13 @@ VIDEO_START_MEMBER(dec8_state,ghostb)
/******************************************************************************/
+// we mimic the priority scheme in dec0.cpp, this was originally a bit different, so this could be wrong
+void dec8_state::oscar_tile_cb(tile_data &tileinfo, u32 &tile, u32 &colour, u32 &flags)
+{
+ tileinfo.group = BIT(colour, 3) ? 1 : 0;
+ colour &= 7;
+}
+
uint32_t dec8_state::screen_update_oscar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bool flip = m_tilegen[0]->get_flip_state();
@@ -302,10 +306,9 @@ uint32_t dec8_state::screen_update_oscar(screen_device &screen, bitmap_ind16 &bi
m_spritegen_mxc->set_flip_screen(flip);
m_fix_tilemap->set_flip(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- // we mimic the priority scheme in dec0.cpp, this was originally a bit different, so this could be wrong
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER1, 0);
m_spritegen_mxc->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(1), m_buffered_spriteram16.get(), 0x800/2);
- m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,0, 0x08,0x08,0x08,0x08, 0);
+ m_tilegen[0]->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_LAYER0, 0);
m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
@@ -328,9 +331,10 @@ VIDEO_START_MEMBER(dec8_state,oscar)
m_fix_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dec8_state::get_oscar_fix_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_fix_tilemap->set_transparent_pen(0);
+ m_tilegen[0]->set_transmask(0, 0xffff, 0x0000);
+ m_tilegen[0]->set_transmask(1, 0x00ff, 0xff00);
m_game_uses_priority = 1;
- m_tilegen[0]->set_colmask(0x7);
}
/******************************************************************************/
diff --git a/src/mame/video/decbac06.cpp b/src/mame/video/decbac06.cpp
index 84e6f19be1f..ed80c87ec33 100644
--- a/src/mame/video/decbac06.cpp
+++ b/src/mame/video/decbac06.cpp
@@ -85,12 +85,12 @@ deco_bac06_device::deco_bac06_device(const machine_config &mconfig, const char *
, m_supports_8x8(true)
, m_supports_16x16(true)
, m_supports_rc_scroll(true)
- , m_gfxcolmask(0)
, m_rambank(0)
, m_gfxregion8x8(0)
, m_gfxregion16x16(0)
, m_wide(0)
, m_gfxdecode(*this, finder_base::DUMMY_TAG)
+ , m_tile_cb(*this)
, m_thedeep_kludge(0)
{
std::fill(std::begin(m_pf_control_0), std::end(m_pf_control_0), 0);
@@ -102,12 +102,13 @@ void deco_bac06_device::device_start()
if(!m_gfxdecode->started())
throw device_missing_dependencies();
+ m_tile_cb.resolve();
+
m_pf_data = make_unique_clear<u16[]>(0x4000 / 2); // 0x2000 is the maximum needed, some games / chip setups map less and mirror - stadium hero banks this to 0x4000?!
m_pf_rowscroll = make_unique_clear<u16[]>(0x2000 / 2);
m_pf_colscroll = make_unique_clear<u16[]>(0x2000 / 2);
create_tilemaps(m_gfxregion8x8, m_gfxregion16x16);
- m_gfxcolmask = 0x0f;
m_rambank = 0;
m_flip_screen = false;
@@ -117,7 +118,6 @@ void deco_bac06_device::device_start()
save_pointer(NAME(m_pf_colscroll), 0x2000 / 2);
save_item(NAME(m_pf_control_0));
save_item(NAME(m_pf_control_1));
- save_item(NAME(m_gfxcolmask));
save_item(NAME(m_rambank));
save_item(NAME(m_flip_screen));
}
@@ -187,21 +187,27 @@ TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape2_8x8_scan)
TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf8x8_tile_info)
{
if (m_rambank & 1) tile_index += 0x1000;
- int tile = m_pf_data[tile_index];
- int colourpri = (tile >> 12);
+ u32 tile = m_pf_data[tile_index];
+ u32 colour = (tile >> 12);
u32 flags = (m_pf_control_0[0] & 2) ? 0 : TILE_FLIPX;
- tileinfo.set(m_tile_region_8,tile & 0xfff,colourpri,flags);
- tileinfo.category = colourpri;
+ tile &= 0xfff;
+ if (!m_tile_cb.isnull())
+ m_tile_cb(tileinfo, tile, colour, flags);
+
+ tileinfo.set(m_tile_region_8,tile,colour,flags);
}
TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf16x16_tile_info)
{
if (m_rambank & 1) tile_index += 0x1000;
- int tile = m_pf_data[tile_index];
- int colourpri = (tile >> 12);
+ u32 tile = m_pf_data[tile_index];
+ u32 colour = (tile >> 12);
u32 flags = (BIT(m_pf_control_0[0], 1) ^ m_thedeep_kludge) ? 0 : TILE_FLIPX;
- tileinfo.set(m_tile_region_16,tile & 0xfff,colourpri,flags);
- tileinfo.category = colourpri;
+ tile &= 0xfff;
+ if (!m_tile_cb.isnull())
+ m_tile_cb(tileinfo, tile, colour, flags);
+
+ tileinfo.set(m_tile_region_16,tile,colour,flags);
}
void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
@@ -209,6 +215,9 @@ void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
m_tile_region_8 = region8x8;
m_tile_region_16 = region16x16;
+ if (m_wide > 2)
+ m_wide = 2;
+
m_pf8x8_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf8x8_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape0_8x8_scan)), 8, 8, 128, 32);
m_pf8x8_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf8x8_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape1_8x8_scan)), 8, 8, 64, 64);
m_pf8x8_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf8x8_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape2_8x8_scan)), 8, 8, 32, 128);
@@ -217,30 +226,24 @@ void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
m_pf8x8_tilemap[1]->set_transparent_pen(0);
m_pf8x8_tilemap[2]->set_transparent_pen(0);
- if (m_wide == 2)
- {
- m_pf16x16_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape0_scan)), 16, 16, 256, 16);
- m_pf16x16_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape1_scan)), 16, 16, 128, 32);
- m_pf16x16_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape2_scan)), 16, 16, 64, 64);
- }
- else if (m_wide == 1)
- {
- m_pf16x16_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape0_scan)), 16, 16, 128, 16);
- m_pf16x16_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape1_scan)), 16, 16, 64, 32);
- m_pf16x16_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape2_scan)), 16, 16, 32, 64);
- }
- else
- {
- m_pf16x16_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape0_scan)), 16, 16, 64, 16);
- m_pf16x16_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape1_scan)), 16, 16, 32, 32);
- m_pf16x16_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape2_scan)), 16, 16, 16, 64);
- }
+ m_pf16x16_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape0_scan)), 16, 16, 64 << m_wide, 16);
+ m_pf16x16_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape1_scan)), 16, 16, 32 << m_wide, 32);
+ m_pf16x16_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(deco_bac06_device::get_pf16x16_tile_info)), tilemap_mapper_delegate(*this, FUNC(deco_bac06_device::tile_shape2_scan)), 16, 16, 16 << m_wide, 64);
m_pf16x16_tilemap[0]->set_transparent_pen(0);
m_pf16x16_tilemap[1]->set_transparent_pen(0);
m_pf16x16_tilemap[2]->set_transparent_pen(0);
}
+void deco_bac06_device::set_transmask(int group, u32 fgmask, u32 bgmask)
+{
+ for (auto & elem : m_pf8x8_tilemap)
+ elem->set_transmask(group, fgmask, bgmask);
+
+ for (auto & elem : m_pf16x16_tilemap)
+ elem->set_transmask(group, fgmask, bgmask);
+}
+
void deco_bac06_device::custom_tilemap_draw(bitmap_ind16 &bitmap,
bitmap_ind8 &primap,
const rectangle &cliprect,
@@ -250,10 +253,6 @@ void deco_bac06_device::custom_tilemap_draw(bitmap_ind16 &bitmap,
const u16 *control0,
const u16 *control1,
u32 flags,
- u16 penmask,
- u16 pencondition,
- u16 colprimask,
- u16 colpricondition,
u8 pri,
u8 pmask)
{
@@ -336,27 +335,26 @@ void deco_bac06_device::custom_tilemap_draw(bitmap_ind16 &bitmap,
const u16 p = src_bitmap.pix16((src_y + column_offset) & height_mask, src_x & width_mask);
const u8 colpri = flags_bitmap.pix8((src_y + column_offset) & height_mask, src_x & width_mask);
- const bool is_drawed = ((flags & TILEMAP_DRAW_OPAQUE) ||
+ const bool is_drawn = ((flags & TILEMAP_DRAW_OPAQUE) ||
((colpri & TILEMAP_PIXEL_LAYER0) && (flags & TILEMAP_DRAW_LAYER0)) ||
((colpri & TILEMAP_PIXEL_LAYER1) && (flags & TILEMAP_DRAW_LAYER1)) ||
((colpri & TILEMAP_PIXEL_LAYER2) && (flags & TILEMAP_DRAW_LAYER2)));
src_x++;
- if (is_drawed)
+ if (is_drawn)
{
- if ((p & penmask) == pencondition)
- if((colpri & colprimask) == colpricondition)
- {
- dstpix[x] = p;
- dstpri[x] = (dstpri[x] & pmask) | pri;
- }
+ if ((flags & TILEMAP_DRAW_ALL_CATEGORIES) || ((colpri & TILEMAP_DRAW_CATEGORY_MASK) == (flags & TILEMAP_DRAW_CATEGORY_MASK)))
+ {
+ dstpix[x] = p;
+ dstpri[x] = (dstpri[x] & pmask) | pri;
+ }
}
}
src_y++;
}
}
-void deco_bac06_device::deco_bac06_pf_draw(screen_device &screen,bitmap_ind16 &bitmap,const rectangle &cliprect,u32 flags,u16 penmask, u16 pencondition,u16 colprimask, u16 colpricondition, u8 pri, u8 primask)
+void deco_bac06_device::deco_bac06_pf_draw(screen_device &screen,bitmap_ind16 &bitmap,const rectangle &cliprect,u32 flags, u8 pri, u8 primask)
{
tilemap_t* tm = nullptr;
@@ -387,7 +385,7 @@ void deco_bac06_device::deco_bac06_pf_draw(screen_device &screen,bitmap_ind16 &b
}
if (tm)
- custom_tilemap_draw(bitmap,screen.priority(),cliprect,tm,m_pf_rowscroll.get(),m_pf_colscroll.get(),m_pf_control_0,m_pf_control_1,flags, penmask, pencondition, colprimask, colpricondition, pri, primask);
+ custom_tilemap_draw(bitmap,screen.priority(),cliprect,tm,m_pf_rowscroll.get(),m_pf_colscroll.get(),m_pf_control_0,m_pf_control_1,flags, pri, primask);
}
// used for pocket gal bootleg, which doesn't set registers properly and simply expects a fixed size tilemap.
@@ -403,7 +401,7 @@ void deco_bac06_device::deco_bac06_pf_draw_bootleg(screen_device &screen,bitmap_
tm = m_pf16x16_tilemap[type];
}
- custom_tilemap_draw(bitmap,screen.priority(),cliprect,tm,m_pf_rowscroll.get(),m_pf_colscroll.get(),nullptr,nullptr,flags, 0, 0, 0, 0, pri, primask);
+ custom_tilemap_draw(bitmap,screen.priority(),cliprect,tm,m_pf_rowscroll.get(),m_pf_colscroll.get(),nullptr,nullptr,flags, pri, primask);
}
diff --git a/src/mame/video/decbac06.h b/src/mame/video/decbac06.h
index 8029343fa78..ebfcb96eeb4 100644
--- a/src/mame/video/decbac06.h
+++ b/src/mame/video/decbac06.h
@@ -9,6 +9,8 @@
#include "tilemap.h"
#include <memory>
+typedef device_delegate<void (tile_data &tileinfo, u32 &tile, u32 &colour, u32 &flags)> decbac06_tile_cb_delegate;
+
class deco_bac06_device : public device_t
{
public:
@@ -26,29 +28,13 @@ public:
void disable_8x8() { m_supports_8x8 = false; }
void disable_16x16() { m_supports_16x16 = false; }
void disable_rc_scroll() { m_supports_rc_scroll = false; }
+ template <typename... T> void set_tile_callback(T &&... args) { m_tile_cb.set(std::forward<T>(args)...); }
- std::unique_ptr<u16[]> m_pf_data;
- std::unique_ptr<u16[]> m_pf_rowscroll;
- std::unique_ptr<u16[]> m_pf_colscroll;
-
- tilemap_t* m_pf8x8_tilemap[3];
- tilemap_t* m_pf16x16_tilemap[3];
- int m_tile_region_8;
- int m_tile_region_16;
-
- // some bootlegs (eg midresb / midresbj) don't appear to actually support the alt modes, they set them and end up with broken gfx on later levels.
- bool m_supports_8x8;
- bool m_supports_16x16;
- bool m_supports_rc_scroll;
-
- void create_tilemaps(int region8x8,int region16x16);
- u16 m_pf_control_0[8];
- u16 m_pf_control_1[8];
+ void set_transmask(int group, u32 fgmask, u32 bgmask);
- void deco_bac06_pf_draw(screen_device &screen,bitmap_ind16 &bitmap,const rectangle &cliprect,u32 flags,u16 penmask, u16 pencondition,u16 colprimask, u16 colpricondition, u8 pri = 0, u8 primask = 0xff);
+ void deco_bac06_pf_draw(screen_device &screen,bitmap_ind16 &bitmap,const rectangle &cliprect,u32 flags, u8 pri = 0, u8 primask = 0xff);
void deco_bac06_pf_draw_bootleg(screen_device &screen,bitmap_ind16 &bitmap,const rectangle &cliprect,u32 flags, int mode, int type, u8 pri = 0, u8 primask = 0xff);
-
/* I wonder if pf_control_0 is really registers, or a selection of pins.
For games with multiple chips typically the flip bit only gets set on one of the chips, but
@@ -63,13 +49,8 @@ public:
*/
u8 get_flip_state(void) { return m_pf_control_0[0] & 0x80; };
- void set_colmask(int data) { m_gfxcolmask = data; }
void set_flip_screen(bool flip);
- u8 m_gfxcolmask;
- int m_rambank; // external connection?
- bool m_flip_screen;
-
/* 16-bit accessors */
void pf_control_0_w(offs_t offset, u16 data, u16 mem_mask = ~0);
@@ -106,6 +87,28 @@ public:
u8 pf_colscroll_8bit_swap_r(offs_t offset);
void pf_colscroll_8bit_swap_w(offs_t offset, u8 data);
+// TODO: privatize values
+ std::unique_ptr<u16[]> m_pf_data;
+ std::unique_ptr<u16[]> m_pf_rowscroll;
+ std::unique_ptr<u16[]> m_pf_colscroll;
+
+ tilemap_t* m_pf8x8_tilemap[3];
+ tilemap_t* m_pf16x16_tilemap[3];
+ int m_tile_region_8;
+ int m_tile_region_16;
+
+ // some bootlegs (eg midresb / midresbj) don't appear to actually support the alt modes, they set them and end up with broken gfx on later levels.
+ bool m_supports_8x8;
+ bool m_supports_16x16;
+ bool m_supports_rc_scroll;
+
+ void create_tilemaps(int region8x8,int region16x16);
+ u16 m_pf_control_0[8];
+ u16 m_pf_control_1[8];
+
+ int m_rambank; // external connection?
+ bool m_flip_screen;
+
protected:
virtual void device_start() override;
virtual void device_reset() override;
@@ -123,7 +126,6 @@ protected:
const u16 *control0,
const u16 *control1,
u32 flags,
- u16 penmask, u16 pencondition,u16 colprimask, u16 colpricondition,
u8 pri = 0, u8 pmask = 0xff);
private:
@@ -137,6 +139,7 @@ private:
TILE_GET_INFO_MEMBER(get_pf16x16_tile_info);
required_device<gfxdecode_device> m_gfxdecode;
+ decbac06_tile_cb_delegate m_tile_cb;
bool m_thedeep_kludge;
};
diff --git a/src/mame/video/pcktgal.cpp b/src/mame/video/pcktgal.cpp
index e6946526265..63270fb69d1 100644
--- a/src/mame/video/pcktgal.cpp
+++ b/src/mame/video/pcktgal.cpp
@@ -65,7 +65,7 @@ uint32_t pcktgal_state::screen_update_pcktgal(screen_device &screen, bitmap_ind1
{
bool flip = m_tilegen->get_flip_state();
m_tilegen->set_flip_screen(flip);
- m_tilegen->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
draw_sprites(bitmap, cliprect, flip);
return 0;
}
diff --git a/src/mame/video/segas32.cpp b/src/mame/video/segas32.cpp
index b666713c00f..23aad199553 100644
--- a/src/mame/video/segas32.cpp
+++ b/src/mame/video/segas32.cpp
@@ -8,7 +8,16 @@
rendering.
- In radr, NBG1 should be opaque on select screen, and NBG3 should be
- opaque while driving. How is this controlled?
+ opaque while driving. This is controlled by register $31ff8e
+ (respectively $200 and $800), likewise darkedge sets $800 on the first
+ attract fight (which has ugly black pens which should be white according
+ to the ref)
+
+ - titlef NBG0 and NBG2 layers are currently hidden during gameplay, it
+ sets $31ff02 with either $7be0 and $2960 (and $31ff8e is $c00).
+ Is it possible that somewhere in the registers there may be a
+ Saturn-esque sprite window effect enable to draw the boxing ring
+ over NBG0;
- In radr, they use $1A0 as the X center for zooming; however, this
contradicts the theory that bit 9 is a sign bit. For now, the code
@@ -19,8 +28,7 @@
in this case, the rowselect lookups should be done in reverse order,
but this results in an incorrect display. For now, we assume there is
a bug in the procedure and implement it so that it looks correct.
-
-
+
Information extracted from below, and from Modeler:
Tile format:
@@ -48,8 +56,15 @@
---- ---- ---- --1- : 1= X+Y flip for NBG1
---- ---- ---- ---0 : 1= X+Y flip for NBG0
$31FF02 : x--- ---- --x- ---- : Bitmap layer enable (?)
+ -x-- ---- ---- ---- : 1= NBG3 page wrapping disable (clipping enable according to code?)
+ --x- ---- ---- ---- : 1= NBG2 page wrapping disable
---1 ---- ---- ---- : 1= NBG1 page wrapping disable
---- 0--- ---- ---- : 1= NBG0 page wrapping disable
+ ---- -x-- ---- ---- : 1= bitmap layer clipping mode (1=outside)
+ ---- --x- ---- ---- : 1= NBG3 clipping mode (1=outside)
+ ---- ---x ---- ---- : 1= NBG2 clipping mode (1=outside)
+ ---- ---- x--- ---- : 1= NBG1 clipping mode (1=outside)
+ ---- ---- -x-- ---- : 1= NBG0 clipping mode (1=outside)
---- ---- --b- ---- : 1= Bitmap layer disable
---- ---- ---t ---- : 1= Text layer disable
---- ---- ---- 3--- : 1= NBG3 layer disable
@@ -146,8 +161,42 @@
reference
- arabfgt : https://www.youtube.com/watch?v=98QivDAGz3I
- darkedge : https://www.youtube.com/watch?v=riO1yb95z7s
+
+====
+back layer setups (register $31ff5e):
+alien3: $0200
+arabfgt: $8000-$81ff -- depending on the scene
+arescue: $0200
+as1: (untested)
+brival: $8000
+darkedge: $0200
+dbzvrvs: $0200
+f1en: $0000
+f1lap: $0000
+ga2: $0200
+harddunk: $8200
+holo: $0200
+jpark: $0200
+kokoroj: (untested)
+kokoroj2: $8000 --
+ $8000-$81fc (in steps of 4) -- on introduction/initials scenes
+orunners: $0200
+radm: $0200
+radr: $8200 -- gameplay
+ $0200 -- title screen
+scross: $0200
+slipstrm: $0000
+sonic: $0000 -- on sega logo/title screen
+ $0200 -- everything else
+spidman: $0200
+svf: $0201 -- on attract
+ $0200 -- on gameplay
+titlef: $8200
+
*/
+
+
#include "emu.h"
#include "includes/segas32.h"
@@ -1205,7 +1254,7 @@ void segas32_state::update_background(struct segas32_state::layer_info *layer, c
{
bitmap_ind16 &bitmap = *layer->bitmap;
int x, y;
-
+
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
uint16_t *dst = &bitmap.pix16(y);
@@ -1213,7 +1262,11 @@ void segas32_state::update_background(struct segas32_state::layer_info *layer, c
/* determine the color */
if (m_videoram[0x1ff5e/2] & 0x8000)
- color = (m_videoram[0x1ff5e/2] & 0x1fff) + y;
+ {
+ // line color select (bank wraps at 511, confirmed by arabfgt and kokoroj2)
+ int yoffset = (m_videoram[0x1ff5e/2] + y) & 0x1ff;
+ color = (m_videoram[0x1ff5e/2] & 0x1e00) + yoffset;
+ }
else
color = m_videoram[0x1ff5e/2] & 0x1e00;
diff --git a/src/mame/video/stadhero.cpp b/src/mame/video/stadhero.cpp
index a14b73a0cc5..564a8b5eac2 100644
--- a/src/mame/video/stadhero.cpp
+++ b/src/mame/video/stadhero.cpp
@@ -27,7 +27,7 @@ uint32_t stadhero_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
m_spritegen->set_flip_screen(flip);
m_pf1_tilemap->set_flip(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- m_tilegen->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen->deco_bac06_pf_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(2), m_spriteram, 0x800/2);
m_pf1_tilemap->draw(screen, bitmap, cliprect, 0,0);
return 0;
diff --git a/src/mame/video/thedeep.cpp b/src/mame/video/thedeep.cpp
index 28edd39a90b..9e9734c5dbc 100644
--- a/src/mame/video/thedeep.cpp
+++ b/src/mame/video/thedeep.cpp
@@ -93,7 +93,7 @@ uint32_t thedeep_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
{
bitmap.fill(m_palette->black_pen(), cliprect);
- m_tilegen->deco_bac06_pf_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00, 0);
+ m_tilegen->deco_bac06_pf_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
m_spritegen->draw_sprites(screen, bitmap, cliprect, m_gfxdecode->gfx(0), reinterpret_cast<uint16_t *>(m_spriteram.target()), 0x400/2);
m_text_tilemap->draw(screen, bitmap, cliprect, 0,0);
return 0;