summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/cbus/pc9801_cbus.cpp11
-rw-r--r--src/devices/bus/cbus/pc9801_cbus.h69
-rw-r--r--src/devices/bus/vme/vme.h39
-rw-r--r--src/devices/bus/vme/vme_mzr8105.cpp12
-rw-r--r--src/devices/cpu/arm7/lpc210x.cpp2
-rw-r--r--src/devices/cpu/mips/mips1.cpp66
-rw-r--r--src/devices/cpu/tms1000/tms0270.cpp7
-rw-r--r--src/devices/cpu/tms1000/tms0270.h9
-rw-r--r--src/devices/cpu/tms1000/tms1000c.cpp18
-rw-r--r--src/devices/cpu/tms1000/tms1000c.h1
-rw-r--r--src/devices/cpu/tms1000/tms1k_base.cpp17
-rw-r--r--src/devices/cpu/tms1000/tms1k_base.h18
-rw-r--r--src/devices/machine/ldp1000.h7
-rw-r--r--src/devices/machine/ldpr8210.h2
-rw-r--r--src/devices/machine/ldstub.cpp8
-rw-r--r--src/devices/machine/ldstub.h21
-rw-r--r--src/devices/machine/ldv1000.h6
-rw-r--r--src/devices/machine/ldvp931.cpp80
-rw-r--r--src/devices/machine/ldvp931.h18
-rw-r--r--src/devices/machine/netlist.cpp6
-rw-r--r--src/devices/machine/netlist.h2
-rw-r--r--src/lib/netlist/build/makefile7
-rw-r--r--src/lib/netlist/devices/nlid_system.h2
-rw-r--r--src/lib/netlist/devices/nlid_truthtable.cpp2
-rw-r--r--src/lib/netlist/nl_base.cpp24
-rw-r--r--src/lib/netlist/nl_base.h20
-rw-r--r--src/lib/netlist/nl_dice_compat.h1
-rw-r--r--src/lib/netlist/nl_factory.cpp2
-rw-r--r--src/lib/netlist/nl_factory.h10
-rw-r--r--src/lib/netlist/nl_lists.h5
-rw-r--r--src/lib/netlist/nl_setup.cpp14
-rw-r--r--src/lib/netlist/nl_setup.h11
-rw-r--r--src/lib/netlist/nltypes.h6
-rw-r--r--src/lib/netlist/plib/mat_cr.h14
-rw-r--r--src/lib/netlist/plib/palloc.h378
-rw-r--r--src/lib/netlist/plib/pconfig.h2
-rw-r--r--src/lib/netlist/plib/pdynlib.cpp8
-rw-r--r--src/lib/netlist/plib/pexception.h4
-rw-r--r--src/lib/netlist/plib/pmatrix2d.h7
-rw-r--r--src/lib/netlist/plib/pmempool.h60
-rw-r--r--src/lib/netlist/plib/pomp.h4
-rw-r--r--src/lib/netlist/plib/pparser.cpp2
-rw-r--r--src/lib/netlist/plib/pparser.h6
-rw-r--r--src/lib/netlist/plib/ppmf.h4
-rw-r--r--src/lib/netlist/plib/pstream.cpp44
-rw-r--r--src/lib/netlist/plib/pstream.h29
-rw-r--r--src/lib/netlist/plib/pstring.h4
-rw-r--r--src/lib/netlist/plib/ptypes.h8
-rw-r--r--src/lib/netlist/plib/vector_ops.h4
-rw-r--r--src/lib/netlist/prg/nltool.cpp2
-rw-r--r--src/lib/netlist/prg/nlwav.cpp59
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver.cpp14
-rw-r--r--src/lib/netlist/solver/nld_matrix_solver.h5
-rw-r--r--src/lib/netlist/solver/nld_ms_direct.h334
-rw-r--r--src/lib/netlist/solver/nld_ms_direct2.h45
-rw-r--r--src/lib/netlist/solver/nld_ms_direct_lu.h4
-rw-r--r--src/lib/netlist/solver/nld_ms_gcr.h453
-rw-r--r--src/lib/netlist/solver/nld_ms_sm.h399
-rw-r--r--src/lib/netlist/solver/nld_ms_sor.h4
-rw-r--r--src/lib/netlist/solver/nld_ms_sor_mat.h322
-rw-r--r--src/lib/netlist/solver/nld_ms_w.h4
-rw-r--r--src/lib/netlist/solver/nld_solver.cpp620
-rw-r--r--src/lib/netlist/solver/nld_solver.h177
-rw-r--r--src/lib/netlist/tools/nl_convert.cpp1
-rw-r--r--src/lib/netlist/tools/nl_convert.h33
-rw-r--r--src/mame/arcade.flt1
-rw-r--r--src/mame/drivers/ave_arb.cpp9
-rw-r--r--src/mame/drivers/cliffhgr.cpp66
-rw-r--r--src/mame/drivers/cromptons.cpp150
-rw-r--r--src/mame/drivers/deco_ld.cpp26
-rw-r--r--src/mame/drivers/dlair.cpp32
-rw-r--r--src/mame/drivers/esh.cpp24
-rw-r--r--src/mame/drivers/fccpu20.cpp75
-rw-r--r--src/mame/drivers/fccpu30.cpp15
-rw-r--r--src/mame/drivers/fcrash.cpp6
-rw-r--r--src/mame/drivers/fidel_card.cpp201
-rw-r--r--src/mame/drivers/fidel_csc.cpp23
-rw-r--r--src/mame/drivers/fidel_elite.cpp10
-rw-r--r--src/mame/drivers/fidel_sc9.cpp2
-rw-r--r--src/mame/drivers/firefox.cpp62
-rw-r--r--src/mame/drivers/force68k.cpp15
-rw-r--r--src/mame/drivers/gkigt.cpp2
-rw-r--r--src/mame/drivers/gp32.cpp30
-rw-r--r--src/mame/drivers/hh_cop400.cpp14
-rw-r--r--src/mame/drivers/hh_sm510.cpp1
-rw-r--r--src/mame/drivers/hh_tms1k.cpp72
-rw-r--r--src/mame/drivers/hk68v10.cpp13
-rw-r--r--src/mame/drivers/konblands.cpp29
-rw-r--r--src/mame/drivers/labyrunr.cpp28
-rw-r--r--src/mame/drivers/ladybug.cpp68
-rw-r--r--src/mame/drivers/laser3k.cpp29
-rw-r--r--src/mame/drivers/lasso.cpp89
-rw-r--r--src/mame/drivers/lastbank.cpp37
-rw-r--r--src/mame/drivers/lastfght.cpp26
-rw-r--r--src/mame/drivers/laz_awetoss.cpp17
-rw-r--r--src/mame/drivers/laz_ribrac.cpp15
-rw-r--r--src/mame/drivers/lazercmd.cpp78
-rw-r--r--src/mame/drivers/lbeach.cpp26
-rw-r--r--src/mame/drivers/lc80.cpp36
-rw-r--r--src/mame/drivers/lckydraw.cpp9
-rw-r--r--src/mame/drivers/lcmate2.cpp25
-rw-r--r--src/mame/drivers/ldplayer.cpp5
-rw-r--r--src/mame/drivers/leapster.cpp16
-rw-r--r--src/mame/drivers/learnwin.cpp14
-rw-r--r--src/mame/drivers/leland.cpp72
-rw-r--r--src/mame/drivers/lemmings.cpp40
-rw-r--r--src/mame/drivers/lethalj.cpp33
-rw-r--r--src/mame/drivers/lg-dvd.cpp9
-rw-r--r--src/mame/drivers/lgp.cpp29
-rw-r--r--src/mame/drivers/liberate.cpp115
-rw-r--r--src/mame/drivers/lilith.cpp5
-rw-r--r--src/mame/drivers/lindbergh.cpp7
-rw-r--r--src/mame/drivers/llc.cpp43
-rw-r--r--src/mame/drivers/lockon.cpp36
-rw-r--r--src/mame/drivers/lsasquad.cpp72
-rw-r--r--src/mame/drivers/ltcasino.cpp25
-rw-r--r--src/mame/drivers/ltd.cpp14
-rw-r--r--src/mame/drivers/luckgrln.cpp40
-rw-r--r--src/mame/drivers/lvcards.cpp43
-rw-r--r--src/mame/drivers/lviv.cpp33
-rw-r--r--src/mame/drivers/lynx.cpp18
-rw-r--r--src/mame/drivers/miniforce.cpp27
-rw-r--r--src/mame/drivers/mvme147.cpp10
-rw-r--r--src/mame/drivers/mzr8105.cpp14
-rw-r--r--src/mame/drivers/neoprint.cpp37
-rw-r--r--src/mame/drivers/pc9801.cpp8
-rw-r--r--src/mame/drivers/sc2.cpp4
-rw-r--r--src/mame/drivers/segaybd.cpp1
-rw-r--r--src/mame/drivers/tecnbras.cpp2
-rw-r--r--src/mame/drivers/ti74.cpp2
-rw-r--r--src/mame/drivers/tispeak.cpp224
-rw-r--r--src/mame/drivers/tispellb.cpp40
-rw-r--r--src/mame/drivers/turrett.cpp2
-rw-r--r--src/mame/includes/ladybug.h3
-rw-r--r--src/mame/includes/lvcards.h5
-rw-r--r--src/mame/includes/segaybd.h2
-rw-r--r--src/mame/layout/fidel_brc.lay (renamed from src/mame/layout/fidel_vbrc.lay)0
-rw-r--r--src/mame/layout/fidel_gin.lay465
-rw-r--r--src/mame/layout/h2hbaskb.lay140
-rw-r--r--src/mame/layout/h2hbaskbc.lay15
-rw-r--r--src/mame/layout/h2hhockey.lay15
-rw-r--r--src/mame/layout/h2hhockeyc.lay15
-rw-r--r--src/mame/layout/h2hsoccerc.lay15
-rw-r--r--src/mame/layout/tntell.lay6
-rw-r--r--src/mame/machine/apple2common.cpp73
-rw-r--r--src/mame/machine/kc_keyb.cpp2
-rw-r--r--src/mame/mame.lst9
-rw-r--r--src/mame/video/segaybd.cpp2
-rw-r--r--src/osd/modules/debugger/qt/memorywindow.cpp2
-rw-r--r--src/osd/modules/input/input_x11.cpp18
150 files changed, 3861 insertions, 2904 deletions
diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp
index eb62af6daaa..5a53eddcce7 100644
--- a/src/devices/bus/cbus/pc9801_cbus.cpp
+++ b/src/devices/bus/cbus/pc9801_cbus.cpp
@@ -55,7 +55,8 @@ device_pc9801cbus_card_interface::~device_pc9801cbus_card_interface()
pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PC9801CBUS_SLOT, tag, owner, clock),
device_slot_interface(mconfig, *this),
- m_cpu(*this, finder_base::DUMMY_TAG),
+ m_memspace(*this, finder_base::DUMMY_TAG, -1),
+ m_iospace(*this, finder_base::DUMMY_TAG, -1),
m_int_callback{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
{
}
@@ -97,17 +98,17 @@ void pc9801_slot_device::device_start()
void pc9801_slot_device::install_io(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler)
{
- int buswidth = this->io_space().data_width();
+ int buswidth = m_iospace->data_width();
switch(buswidth)
{
case 8:
- this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0);
+ m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0);
break;
case 16:
- this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0xffff);
+ m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0xffff);
break;
case 32:
- this->io_space().install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff);
+ m_iospace->install_readwrite_handler(start, end, rhandler, whandler, 0xffffffff);
break;
default:
fatalerror("PC-9801-26: Bus width %d not supported\n", buswidth);
diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h
index d238f659320..e094693f06c 100644
--- a/src/devices/bus/cbus/pc9801_cbus.h
+++ b/src/devices/bus/cbus/pc9801_cbus.h
@@ -2,6 +2,60 @@
// copyright-holders:Angelo Salese
/**********************************************************************
+ <B> <A>
+ +------+
+ GND |[ 01 ]| GND
+ V1 |[ 02 ]| V1
+ V2 |[ 03 ]| V2
+ DB001 |[ 04 ]| AB001
+ DB011 |[ 05 ]| AB011
+ DB021 |[ 06 ]| AB021
+ DB031 |[ 07 ]| AB031
+ DB041 |[ 08 ]| AB041
+ DB051 |[ 09 ]| AB051
+ DB061 |[ 10 ]| AB061
+ GND |[ 11 ]| GND
+ DB071 |[ 12 ]| AB071
+ DB081 |[ 13 ]| AB081
+ DB091 |[ 14 ]| AB091
+ DB101 |[ 15 ]| AB101
+ DB111 |[ 16 ]| AB111
+ DB121 |[ 17 ]| AB121
+ DB131 |[ 18 ]| AB131
+ DB141 |[ 19 ]| AB141
+ DB151 |[ 20 ]| AB151
+ GND |[ 21 ]| GND
+ +12 V |[ 22 ]| AB161
+ +12 V |[ 23 ]| AB171
+ "INT0" IR31 |[ 24 ]| AB181
+ "INT1" IR51 |[ 25 ]| AB191
+ "INT2" IR61 |[ 26 ]| AB201
+ "INT3" IR91 |[ 27 ]| AB211
+ "INT4" IR101/IR111 |[ 28 ]| AB221
+ "INT5" IR121 |[ 29 ]| AB231
+ "INT6" IR131 |[ 30 ]| INT0
+ GND |[ 31 ]| GND
+ -12 V |[ 32 ]| IOCHK0
+ -12 V |[ 33 ]| IOR0
+ RESET0 |[ 34 ]| IOW0
+ DACK00 |[ 35 ]| MRC0
+ DACK30/DACK20 |[ 36 ]| MWC0
+ DRQ00 |[ 37 ]| S00 (INTA0)
+ DRQ30/DRQ20 |[ 38 ]| S10 (NOWAIT0)
+ WORD0 |[ 39 ]| S20 (SALE1)
+ (EXHRQ10) CPKILL0 |[ 40 ]| LOCK (MACS0)
+ GND |[ 41 ]| GND
+ (EXHLA10) RQGT0 |[ 42 ]| CPUENB10
+ DMATC0 |[ 43 ]| RFSH0
+ NMI0 |[ 44 ]| BHE0
+ MWE0 |[ 45 ]| IORDY1
+ (EXHLA20) HLDA00 |[ 46 ]| SCLK1
+ (EXHRQ20) HRQ00 |[ 47 ]| S18CLK1 = 307.2 kHz
+ (SUBSRQ1) DMAHLD0 |[ 48 ]| POWER0
+ +5 V |[ 49 ]| +5 V
+ +5 V |[ 50 ]| +5 V
+ +------+
+ <B> <A>
**********************************************************************/
#ifndef MAME_MACHINE_PC9801_CBUS_H
@@ -37,11 +91,10 @@ class pc9801_slot_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
- template <typename T, typename U>
- pc9801_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&cpu_tag, U &&opts, char const *dflt)
+ template <typename T>
+ pc9801_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
: pc9801_slot_device(mconfig, tag, owner, (uint32_t)0)
{
- m_cpu.set_tag(std::forward<T>(cpu_tag));
option_reset();
opts(*this);
set_default_option(dflt);
@@ -49,11 +102,14 @@ public:
}
pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T> void set_memspace(T &&tag, int spacenum) { m_memspace.set_tag(std::forward<T>(tag), spacenum); }
+ template <typename T> void set_iospace(T &&tag, int spacenum) { m_iospace.set_tag(std::forward<T>(tag), spacenum); }
+
// configuration access
template<std::size_t Line> auto int_cb() { return m_int_callback[Line].bind(); }
- address_space &program_space() const { return m_cpu->space(AS_PROGRAM); }
- address_space &io_space() const { return m_cpu->space(AS_IO); }
+ address_space &program_space() const { return *m_memspace; }
+ address_space &io_space() const { return *m_iospace; }
template<int I> void int_w(bool state) { m_int_callback[I](state); }
void install_io(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
@@ -65,7 +121,8 @@ protected:
private:
// device_pc9801_slot_card_interface *m_card;
- required_device<cpu_device> m_cpu;
+ required_address_space m_memspace;
+ required_address_space m_iospace;
devcb_write_line m_int_callback[7];
};
diff --git a/src/devices/bus/vme/vme.h b/src/devices/bus/vme/vme.h
index 7af8d0961c0..edce2cd1246 100644
--- a/src/devices/bus/vme/vme.h
+++ b/src/devices/bus/vme/vme.h
@@ -57,10 +57,6 @@
#define VME_BUS_TAG "vme"
-// Callbacks to the board from the VME bus comes through here
-#define MCFG_VME_J1_CB(_devcb) \
- downcast<vme_slot_device &>(*device).set_vme_j1_callback(DEVCB_##_devcb);
-
//void vme_slot1(device_slot_interface &device); // Disabled until we know how to combine a board driver and a slot device.
void vme_slots(device_slot_interface &device);
@@ -89,9 +85,22 @@ public:
};
// construction/destruction
+ template <typename T>
+ vme_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt, uint32_t slot_nbr, char const *bus_tag)
+ : vme_slot_device(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ set_vme_slot(bus_tag, tag);
+ update_vme_chains(slot_nbr);
+ }
+
vme_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_vme_j1_callback(Object &&cb) { return m_vme_j1_callback.set_callback(std::forward<Object>(cb)); }
+ // Callbacks to the board from the VME bus comes through here
+ auto vme_j1_callback() { return m_vme_j1_callback.bind(); }
void set_vme_slot(const char *tag, const char *slottag);
void update_vme_chains(uint32_t slot_nbr);
@@ -116,18 +125,6 @@ protected:
DECLARE_DEVICE_TYPE(VME, vme_device)
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_VME_DEVICE_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, VME, 0)
-
-#define MCFG_VME_CPU(_cputag) \
- downcast<vme_device &>(*device).set_cputag(_cputag);
-
-#define MCFG_VME_BUS_OWNER_SPACES() \
- downcast<vme_device &>(*device).use_owner_spaces();
class vme_card_interface;
@@ -241,12 +238,4 @@ private:
device_vme_card_interface *m_next;
};
-#define MCFG_VME_SLOT_ADD(_tag, _slotnbr, _slot_intf,_def_slot) \
- { std::string stag = "slot" + std::to_string(_slotnbr); \
- MCFG_DEVICE_ADD(stag.c_str(), VME_SLOT, 0); \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false); \
- downcast<vme_slot_device &>(*device).set_vme_slot(_tag, stag.c_str()); \
- downcast<vme_slot_device &>(*device).update_vme_chains(_slotnbr); \
- }
-
#endif // MAME_BUS_VME_VME_H
diff --git a/src/devices/bus/vme/vme_mzr8105.cpp b/src/devices/bus/vme/vme_mzr8105.cpp
index 985f6bad905..fe63e92ee28 100644
--- a/src/devices/bus/vme/vme_mzr8105.cpp
+++ b/src/devices/bus/vme/vme_mzr8105.cpp
@@ -36,13 +36,13 @@ DEFINE_DEVICE_TYPE(VME_MZR8105, vme_mzr8105_card_device, "mzr8105", "Mizar 8105
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(vme_mzr8105_card_device::device_add_mconfig)
+void vme_mzr8105_card_device::device_add_mconfig(machine_config &config)
{
- MCFG_DEVICE_ADD ("maincpu", M68000, XTAL(10'000'000))
- MCFG_DEVICE_PROGRAM_MAP (mzr8105_mem)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_BUS_OWNER_SPACES()
- MCFG_VME_SLOT_ADD ("vme", 1, mzr8105_vme_cards, "mzr8300")
+ M68000(config, m_maincpu, XTAL(10'000'000))
+ m_maincpu->set_addrmap(AS_PROGRAM, &vme_mzr8105_card_device::mzr8105_mem);
+
+ VME(config, "vme", 0).use_owner_spaces();
+ VME_SLOT(config, "slot1", mzr8105_vme_cards, "mzr8300", 1, "vme");
}
vme_mzr8105_card_device::vme_mzr8105_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
diff --git a/src/devices/cpu/arm7/lpc210x.cpp b/src/devices/cpu/arm7/lpc210x.cpp
index 62c0732c194..d2964589e01 100644
--- a/src/devices/cpu/arm7/lpc210x.cpp
+++ b/src/devices/cpu/arm7/lpc210x.cpp
@@ -2,7 +2,7 @@
// copyright-holders:David Haywood
/***************************************************************************
- NXP (Phillips) LPC2103 series
+ NXP (Philips) LPC2103 series
covering LPC2101, LPC2102, LPC2103*
*currently only LPC2103
diff --git a/src/devices/cpu/mips/mips1.cpp b/src/devices/cpu/mips/mips1.cpp
index cc6fd58343f..1ed202c0d63 100644
--- a/src/devices/cpu/mips/mips1.cpp
+++ b/src/devices/cpu/mips/mips1.cpp
@@ -955,13 +955,75 @@ void mips1core_device_base::handle_cop1(u32 const op)
void mips1core_device_base::handle_cop2(u32 const op)
{
- if (!(SR & SR_COP2))
+ if (SR & SR_COP2)
+ {
+ switch (RSREG)
+ {
+ case 0x08: // BC2
+ switch (RTREG)
+ {
+ case 0x00: // BC2F
+ if (!m_in_brcond[2]())
+ {
+ m_branch_state = BRANCH;
+ m_branch_target = m_pc + 4 + (s32(SIMMVAL) << 2);
+ }
+ break;
+ case 0x01: // BC2T
+ if (m_in_brcond[2]())
+ {
+ m_branch_state = BRANCH;
+ m_branch_target = m_pc + 4 + (s32(SIMMVAL) << 2);
+ }
+ break;
+ default:
+ generate_exception(EXCEPTION_INVALIDOP);
+ break;
+ }
+ break;
+ default:
+ generate_exception(EXCEPTION_INVALIDOP);
+ break;
+ }
+ }
+ else
generate_exception(EXCEPTION_BADCOP2);
}
void mips1core_device_base::handle_cop3(u32 const op)
{
- if (!(SR & SR_COP3))
+ if (SR & SR_COP3)
+ {
+ switch (RSREG)
+ {
+ case 0x08: // BC3
+ switch (RTREG)
+ {
+ case 0x00: // BC3F
+ if (!m_in_brcond[3]())
+ {
+ m_branch_state = BRANCH;
+ m_branch_target = m_pc + 4 + (s32(SIMMVAL) << 2);
+ }
+ break;
+ case 0x01: // BC3T
+ if (m_in_brcond[3]())
+ {
+ m_branch_state = BRANCH;
+ m_branch_target = m_pc + 4 + (s32(SIMMVAL) << 2);
+ }
+ break;
+ default:
+ generate_exception(EXCEPTION_INVALIDOP);
+ break;
+ }
+ break;
+ default:
+ generate_exception(EXCEPTION_INVALIDOP);
+ break;
+ }
+ }
+ else
generate_exception(EXCEPTION_BADCOP3);
}
diff --git a/src/devices/cpu/tms1000/tms0270.cpp b/src/devices/cpu/tms1000/tms0270.cpp
index 5d1eb2b14d1..899e3eb1ba3 100644
--- a/src/devices/cpu/tms1000/tms0270.cpp
+++ b/src/devices/cpu/tms1000/tms0270.cpp
@@ -24,9 +24,6 @@ DEFINE_DEVICE_TYPE(TMS0270, tms0270_cpu_device, "tms0270", "Texas Instruments TM
// device definitions
tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0980_cpu_device(mconfig, TMS0270, tag, owner, clock, 16 /* o pins */, 16 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 11 /* prg width */, address_map_constructor(FUNC(tms0270_cpu_device::program_11bit_9), this), 8 /* data width */, address_map_constructor(FUNC(tms0270_cpu_device::data_144x4), this))
- , m_read_ctl(*this)
- , m_write_ctl(*this)
- , m_write_pdc(*this)
{
}
@@ -47,10 +44,6 @@ void tms0270_cpu_device::device_start()
// common init
tms1k_base_device::device_start();
- m_read_ctl.resolve_safe(0);
- m_write_ctl.resolve_safe();
- m_write_pdc.resolve_safe();
-
// zerofill
m_r_prev = 0;
m_chipsel = 0;
diff --git a/src/devices/cpu/tms1000/tms0270.h b/src/devices/cpu/tms1000/tms0270.h
index 3043119e2aa..45c231a950a 100644
--- a/src/devices/cpu/tms1000/tms0270.h
+++ b/src/devices/cpu/tms1000/tms0270.h
@@ -19,11 +19,6 @@ class tms0270_cpu_device : public tms0980_cpu_device
public:
tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- // TMS0270 was designed to interface with TMS5100, set it up at driver level
- auto read_ctl() { return m_read_ctl.bind(); }
- auto write_ctl() { return m_write_ctl.bind(); }
- auto write_pdc() { return m_write_pdc.bind(); }
-
protected:
// overrides
virtual void device_start() override;
@@ -50,10 +45,6 @@ private:
u8 m_o_latch_low;
u8 m_o_latch;
u8 m_o_latch_prev;
-
- devcb_read8 m_read_ctl;
- devcb_write8 m_write_ctl;
- devcb_write_line m_write_pdc;
};
diff --git a/src/devices/cpu/tms1000/tms1000c.cpp b/src/devices/cpu/tms1000/tms1000c.cpp
index defc8482eef..b69a683f280 100644
--- a/src/devices/cpu/tms1000/tms1000c.cpp
+++ b/src/devices/cpu/tms1000/tms1000c.cpp
@@ -52,21 +52,3 @@ u32 tms1000c_cpu_device::decode_micro(u8 sel)
return decode;
}
-
-
-// execute
-void tms1000c_cpu_device::execute_run()
-{
- while (m_icount > 0)
- {
- if (m_halt_pin)
- {
- // not running (output pins remain unchanged)
- m_icount = 0;
- return;
- }
-
- m_icount--;
- execute_one();
- }
-}
diff --git a/src/devices/cpu/tms1000/tms1000c.h b/src/devices/cpu/tms1000/tms1000c.h
index 364dd56879f..7857bf07f0c 100644
--- a/src/devices/cpu/tms1000/tms1000c.h
+++ b/src/devices/cpu/tms1000/tms1000c.h
@@ -23,7 +23,6 @@ protected:
// overrides
virtual void device_add_mconfig(machine_config &config) override;
virtual u32 decode_micro(u8 sel) override;
- virtual void execute_run() override;
virtual void op_br() override { op_br3(); } // 3-level stack
virtual void op_call() override { op_call3(); } // "
diff --git a/src/devices/cpu/tms1000/tms1k_base.cpp b/src/devices/cpu/tms1000/tms1k_base.cpp
index 432e43e0d7b..a5942e71982 100644
--- a/src/devices/cpu/tms1000/tms1k_base.cpp
+++ b/src/devices/cpu/tms1000/tms1k_base.cpp
@@ -90,6 +90,9 @@ tms1k_base_device::tms1k_base_device(const machine_config &mconfig, device_type
, m_write_o(*this)
, m_write_r(*this)
, m_power_off(*this)
+ , m_read_ctl(*this)
+ , m_write_ctl(*this)
+ , m_write_pdc(*this)
{
}
@@ -131,6 +134,9 @@ void tms1k_base_device::device_start()
m_write_o.resolve_safe();
m_write_r.resolve_safe();
m_power_off.resolve_safe();
+ m_read_ctl.resolve_safe(0);
+ m_write_ctl.resolve_safe();
+ m_write_pdc.resolve_safe();
// zerofill
m_pc = 0;
@@ -147,7 +153,6 @@ void tms1k_base_device::device_start()
m_r = 0;
m_o = 0;
m_o_index = 0;
- m_halt_pin = false;
m_cki_bus = 0;
m_c4 = 0;
m_p = 0;
@@ -187,7 +192,6 @@ void tms1k_base_device::device_start()
save_item(NAME(m_r));
save_item(NAME(m_o));
save_item(NAME(m_o_index));
- save_item(NAME(m_halt_pin));
save_item(NAME(m_cki_bus));
save_item(NAME(m_c4));
save_item(NAME(m_p));
@@ -311,15 +315,6 @@ void tms1k_base_device::read_opcode()
// i/o handling
//-------------------------------------------------
-void tms1k_base_device::execute_set_input(int line, int state)
-{
- if (line != TMS1XXX_INPUT_LINE_HALT)
- return;
-
- // HALT pin (CMOS only)
- m_halt_pin = bool(state);
-}
-
void tms1k_base_device::write_o_output(u8 index)
{
// a hardcoded table is supported if the output pla is unknown
diff --git a/src/devices/cpu/tms1000/tms1k_base.h b/src/devices/cpu/tms1000/tms1k_base.h
index 7a394b8dfbb..d7681329c93 100644
--- a/src/devices/cpu/tms1000/tms1k_base.h
+++ b/src/devices/cpu/tms1000/tms1k_base.h
@@ -17,10 +17,6 @@
#include "machine/pla.h"
-// HALT input pin on CMOS chips (use set_input_line)
-#define TMS1XXX_INPUT_LINE_HALT 0
-
-
// pinout reference
/*
@@ -78,6 +74,14 @@ public:
// OFF request on TMS0980 and up
auto power_off() { return m_power_off.bind(); }
+ // note: for HALT input pin on CMOS chips, use set_input_line with INPUT_LINE_HALT
+ // similarly with the INIT pin, simply use INPUT_LINE_RESET
+
+ // TMS0270 was designed to interface with TMS5100, set it up at driver level
+ auto read_ctl() { return m_read_ctl.bind(); }
+ auto write_ctl() { return m_write_ctl.bind(); }
+ 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; }
@@ -95,8 +99,6 @@ protected:
// device_execute_interface overrides
virtual u32 execute_min_cycles() const override { return 1; }
virtual u32 execute_max_cycles() const override { return 1; }
- virtual u32 execute_input_lines() const override { return 1; }
- virtual void execute_set_input(int line, int state) override;
virtual void execute_run() override;
virtual void execute_one();
@@ -245,7 +247,6 @@ protected:
int m_subcycle;
int m_icount;
u8 m_o_index;
- bool m_halt_pin;
u8 m_o_pins; // how many O pins
u8 m_r_pins; // how many R pins
@@ -261,6 +262,9 @@ protected:
devcb_write16 m_write_o;
devcb_write16 m_write_r;
devcb_write_line m_power_off;
+ devcb_read8 m_read_ctl;
+ devcb_write8 m_write_ctl;
+ devcb_write_line m_write_pdc;
u32 m_o_mask;
u32 m_r_mask;
diff --git a/src/devices/machine/ldp1000.h b/src/devices/machine/ldp1000.h
index 1f3140f14e8..b3f420afb6e 100644
--- a/src/devices/machine/ldp1000.h
+++ b/src/devices/machine/ldp1000.h
@@ -15,13 +15,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_LASERDISC_LDP1000_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, SONY_LDP1000, 0)
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
diff --git a/src/devices/machine/ldpr8210.h b/src/devices/machine/ldpr8210.h
index f142229314c..fc0a28d6d26 100644
--- a/src/devices/machine/ldpr8210.h
+++ b/src/devices/machine/ldpr8210.h
@@ -23,8 +23,6 @@
#define MCFG_LASERDISC_PR8210_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, PIONEER_PR8210, 0)
-#define MCFG_LASERDISC_SIMUTREK_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, SIMUTREK_SPECIAL, 0)
//**************************************************************************
diff --git a/src/devices/machine/ldstub.cpp b/src/devices/machine/ldstub.cpp
index 9d3dab58ce3..c0c9a7ac05a 100644
--- a/src/devices/machine/ldstub.cpp
+++ b/src/devices/machine/ldstub.cpp
@@ -17,8 +17,8 @@
//**************************************************************************
// device type definition
-DEFINE_DEVICE_TYPE(PIONEER_PR7820, pioneer_pr7820_device, "pr7820", "Pioneer PR-7820")
-DEFINE_DEVICE_TYPE(PHILLIPS_22VP932, phillips_22vp932_device, "22vp932", "Phillips 22VP932")
+DEFINE_DEVICE_TYPE(PIONEER_PR7820, pioneer_pr7820_device, "pr7820", "Pioneer PR-7820")
+DEFINE_DEVICE_TYPE(PHILIPS_22VP932, philips_22vp932_device, "22vp932", "Philips 22VP932")
pioneer_pr7820_device::pioneer_pr7820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -27,7 +27,7 @@ pioneer_pr7820_device::pioneer_pr7820_device(const machine_config &mconfig, cons
}
-phillips_22vp932_device::phillips_22vp932_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : laserdisc_device(mconfig, PHILLIPS_22VP932, tag, owner, clock)
+philips_22vp932_device::philips_22vp932_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : laserdisc_device(mconfig, PHILIPS_22VP932, tag, owner, clock)
{
}
diff --git a/src/devices/machine/ldstub.h b/src/devices/machine/ldstub.h
index 4bf463b897d..9fbc756b240 100644
--- a/src/devices/machine/ldstub.h
+++ b/src/devices/machine/ldstub.h
@@ -17,23 +17,12 @@
//**************************************************************************
-// DEVICE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_LASERDISC_PR7820_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, PIONEER_PR7820, 0)
-#define MCFG_LASERDISC_22VP932_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, PHILLIPS_22VP932, 0)
-
-
-//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
// device type definition
-DECLARE_DEVICE_TYPE(PIONEER_PR7820, pioneer_pr7820_device)
-DECLARE_DEVICE_TYPE(PHILLIPS_22VP932, phillips_22vp932_device)
-
+DECLARE_DEVICE_TYPE(PIONEER_PR7820, pioneer_pr7820_device)
+DECLARE_DEVICE_TYPE(PHILIPS_22VP932, philips_22vp932_device)
//**************************************************************************
@@ -63,13 +52,13 @@ protected:
};
-// ======================> phillips_22vp932_device
+// ======================> philips_22vp932_device
-class phillips_22vp932_device : public laserdisc_device
+class philips_22vp932_device : public laserdisc_device
{
public:
// construction/destruction
- phillips_22vp932_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ philips_22vp932_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// input/output
uint8_t data_r() { return 0; }
diff --git a/src/devices/machine/ldv1000.h b/src/devices/machine/ldv1000.h
index 661d0a44f0b..55516da36fe 100644
--- a/src/devices/machine/ldv1000.h
+++ b/src/devices/machine/ldv1000.h
@@ -26,10 +26,6 @@
#define MCFG_LASERDISC_LDV1000_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, PIONEER_LDV1000, 0)
-#define MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(_cb) \
- downcast<pioneer_ldv1000_device *>(device)->set_command_strobe_callback(DEVCB_##_cb);
-
-
//**************************************************************************
// GLOBAL VARIABLES
@@ -53,7 +49,7 @@ public:
// construction/destruction
pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class cmd_strobe_cb> devcb_base &set_command_strobe_callback(cmd_strobe_cb &&latch) { return m_command_strobe_cb.set_callback(std::forward<cmd_strobe_cb>(latch)); }
+ auto command_strobe_callback() { return m_command_strobe_cb.bind(); }
// input and output
void data_w(uint8_t data);
diff --git a/src/devices/machine/ldvp931.cpp b/src/devices/machine/ldvp931.cpp
index 7a688736a93..4bcb74e1b6a 100644
--- a/src/devices/machine/ldvp931.cpp
+++ b/src/devices/machine/ldvp931.cpp
@@ -45,7 +45,7 @@
//**************************************************************************
// devices
-DEFINE_DEVICE_TYPE(PHILLIPS_22VP931, phillips_22vp931_device, "22vp931", "Phillips 22VP931")
+DEFINE_DEVICE_TYPE(PHILIPS_22VP931, philips_22vp931_device, "22vp931", "Philips 22VP931")
@@ -53,12 +53,12 @@ DEFINE_DEVICE_TYPE(PHILLIPS_22VP931, phillips_22vp931_device, "22vp931", "Philli
// 22VP931 ROM AND MACHINE INTERFACES
//**************************************************************************
-void phillips_22vp931_device::vp931_portmap(address_map &map)
+void philips_22vp931_device::vp931_portmap(address_map &map)
{
- map(0x00, 0x00).mirror(0xcf).rw(FUNC(phillips_22vp931_device::i8049_keypad_r), FUNC(phillips_22vp931_device::i8049_output0_w));
- map(0x10, 0x10).mirror(0xcf).rw(FUNC(phillips_22vp931_device::i8049_unknown_r), FUNC(phillips_22vp931_device::i8049_output1_w));
- map(0x20, 0x20).mirror(0xcf).rw(FUNC(phillips_22vp931_device::i8049_datic_r), FUNC(phillips_22vp931_device::i8049_lcd_w));
- map(0x30, 0x30).mirror(0xcf).rw(FUNC(phillips_22vp931_device::i8049_from_controller_r), FUNC(phillips_22vp931_device::i8049_to_controller_w));
+ map(0x00, 0x00).mirror(0xcf).rw(FUNC(philips_22vp931_device::i8049_keypad_r), FUNC(philips_22vp931_device::i8049_output0_w));
+ map(0x10, 0x10).mirror(0xcf).rw(FUNC(philips_22vp931_device::i8049_unknown_r), FUNC(philips_22vp931_device::i8049_output1_w));
+ map(0x20, 0x20).mirror(0xcf).rw(FUNC(philips_22vp931_device::i8049_datic_r), FUNC(philips_22vp931_device::i8049_lcd_w));
+ map(0x30, 0x30).mirror(0xcf).rw(FUNC(philips_22vp931_device::i8049_from_controller_r), FUNC(philips_22vp931_device::i8049_to_controller_w));
}
@@ -70,15 +70,15 @@ ROM_END
//**************************************************************************
-// PHILLIPS 22VP931 IMPLEMENTATION
+// PHILIPS 22VP931 IMPLEMENTATION
//**************************************************************************
//-------------------------------------------------
-// phillips_22vp931_device - constructor
+// philips_22vp931_device - constructor
//-------------------------------------------------
-phillips_22vp931_device::phillips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : laserdisc_device(mconfig, PHILLIPS_22VP931, tag, owner, clock),
+philips_22vp931_device::philips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : laserdisc_device(mconfig, PHILIPS_22VP931, tag, owner, clock),
m_i8049_cpu(*this, "vp931"),
m_tracktimer(nullptr),
m_i8049_out0(0),
@@ -103,7 +103,7 @@ phillips_22vp931_device::phillips_22vp931_device(const machine_config &mconfig,
// reset_w - write to the reset line
//-------------------------------------------------
-void phillips_22vp931_device::reset_w(uint8_t data)
+void philips_22vp931_device::reset_w(uint8_t data)
{
// control the CPU state
m_i8049_cpu->set_input_line(INPUT_LINE_RESET, data);
@@ -119,7 +119,7 @@ void phillips_22vp931_device::reset_w(uint8_t data)
// 22VP931
//-------------------------------------------------
-uint8_t phillips_22vp931_device::data_r()
+uint8_t philips_22vp931_device::data_r()
{
// if data is pending, clear the pending flag and notify any callbacks
if (m_tocontroller_pending)
@@ -139,7 +139,7 @@ uint8_t phillips_22vp931_device::data_r()
// device_start - device initialization
//-------------------------------------------------
-void phillips_22vp931_device::device_start()
+void philips_22vp931_device::device_start()
{
// pass through to the parent
laserdisc_device::device_start();
@@ -153,7 +153,7 @@ void phillips_22vp931_device::device_start()
// device_reset - device reset
//-------------------------------------------------
-void phillips_22vp931_device::device_reset()
+void philips_22vp931_device::device_reset()
{
// pass through to the parent
laserdisc_device::device_reset();
@@ -185,7 +185,7 @@ void phillips_22vp931_device::device_reset()
// device
//-------------------------------------------------
-void phillips_22vp931_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void philips_22vp931_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)
{
@@ -276,7 +276,7 @@ void phillips_22vp931_device::device_timer(emu_timer &timer, device_timer_id id,
// ROM region definitions
//-------------------------------------------------
-const tiny_rom_entry *phillips_22vp931_device::device_rom_region() const
+const tiny_rom_entry *philips_22vp931_device::device_rom_region() const
{
return ROM_NAME(vp931);
}
@@ -286,16 +286,16 @@ const tiny_rom_entry *phillips_22vp931_device::device_rom_region() const
// device_add_mconfig - add device configuration
//-------------------------------------------------
-void phillips_22vp931_device::device_add_mconfig(machine_config &config)
+void philips_22vp931_device::device_add_mconfig(machine_config &config)
{
I8049(config, m_i8049_cpu, XTAL(11'000'000));
- m_i8049_cpu->set_addrmap(AS_IO, &phillips_22vp931_device::vp931_portmap);
- m_i8049_cpu->p1_in_cb().set(FUNC(phillips_22vp931_device::i8049_port1_r));
- m_i8049_cpu->p1_out_cb().set(FUNC(phillips_22vp931_device::i8049_port1_w));
- m_i8049_cpu->p2_in_cb().set(FUNC(phillips_22vp931_device::i8049_port2_r));
- m_i8049_cpu->p2_out_cb().set(FUNC(phillips_22vp931_device::i8049_port2_w));
- m_i8049_cpu->t0_in_cb().set(FUNC(phillips_22vp931_device::i8049_t0_r));
- m_i8049_cpu->t1_in_cb().set(FUNC(phillips_22vp931_device::i8049_t1_r));
+ m_i8049_cpu->set_addrmap(AS_IO, &philips_22vp931_device::vp931_portmap);
+ m_i8049_cpu->p1_in_cb().set(FUNC(philips_22vp931_device::i8049_port1_r));
+ m_i8049_cpu->p1_out_cb().set(FUNC(philips_22vp931_device::i8049_port1_w));
+ m_i8049_cpu->p2_in_cb().set(FUNC(philips_22vp931_device::i8049_port2_r));
+ m_i8049_cpu->p2_out_cb().set(FUNC(philips_22vp931_device::i8049_port2_w));
+ m_i8049_cpu->t0_in_cb().set(FUNC(philips_22vp931_device::i8049_t0_r));
+ m_i8049_cpu->t1_in_cb().set(FUNC(philips_22vp931_device::i8049_t1_r));
}
@@ -304,7 +304,7 @@ void phillips_22vp931_device::device_add_mconfig(machine_config &config)
// start of the blanking period
//-------------------------------------------------
-void phillips_22vp931_device::player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime)
+void philips_22vp931_device::player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime)
{
// reset our command counter (debugging only)
m_cmdcount = 0;
@@ -320,7 +320,7 @@ void phillips_22vp931_device::player_vsync(const vbi_metadata &vbi, int fieldnum
// the first visible line of the frame
//-------------------------------------------------
-int32_t phillips_22vp931_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime)
+int32_t philips_22vp931_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime)
{
// set the first VBI timer to go at the start of line 16
timer_set(screen().time_until_pos(16*2), TID_VBI_DATA_FETCH, LASERDISC_CODE_LINE16 << 2);
@@ -335,7 +335,7 @@ int32_t phillips_22vp931_device::player_update(const vbi_metadata &vbi, int fiel
// and other bits
//-------------------------------------------------
-WRITE8_MEMBER( phillips_22vp931_device::i8049_output0_w )
+WRITE8_MEMBER( philips_22vp931_device::i8049_output0_w )
{
/*
$80 = n/c
@@ -374,7 +374,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_output0_w )
// i8049_output1_w - controls scanning behaviors
//-------------------------------------------------
-WRITE8_MEMBER( phillips_22vp931_device::i8049_output1_w )
+WRITE8_MEMBER( philips_22vp931_device::i8049_output1_w )
{
/*
$80 = n/c
@@ -418,7 +418,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_output1_w )
// i8049_lcd_w - vestigial LCD frame display
//-------------------------------------------------
-WRITE8_MEMBER( phillips_22vp931_device::i8049_lcd_w )
+WRITE8_MEMBER( philips_22vp931_device::i8049_lcd_w )
{
/*
Frame number is written as 5 digits here; however, it is not actually
@@ -431,7 +431,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_lcd_w )
// i8049_unknown_r - unknown input port
//-------------------------------------------------
-READ8_MEMBER( phillips_22vp931_device::i8049_unknown_r )
+READ8_MEMBER( philips_22vp931_device::i8049_unknown_r )
{
// only bit $80 is checked and its effects are minor
return 0x00;
@@ -443,7 +443,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_unknown_r )
// controls
//-------------------------------------------------
-READ8_MEMBER( phillips_22vp931_device::i8049_keypad_r )
+READ8_MEMBER( philips_22vp931_device::i8049_keypad_r )
{
/*
From the code, this is apparently a vestigial keypad with basic controls:
@@ -465,7 +465,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_keypad_r )
// DATIC circuit
//-------------------------------------------------
-READ8_MEMBER( phillips_22vp931_device::i8049_datic_r )
+READ8_MEMBER( philips_22vp931_device::i8049_datic_r )
{
return m_daticval;
}
@@ -476,7 +476,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_datic_r )
// external controller wrote
//-------------------------------------------------
-READ8_MEMBER( phillips_22vp931_device::i8049_from_controller_r )
+READ8_MEMBER( philips_22vp931_device::i8049_from_controller_r )
{
// clear the pending flag and return the data
m_fromcontroller_pending = false;
@@ -489,7 +489,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_from_controller_r )
// the external controller
//-------------------------------------------------
-WRITE8_MEMBER( phillips_22vp931_device::i8049_to_controller_w )
+WRITE8_MEMBER( philips_22vp931_device::i8049_to_controller_w )
{
// set the pending flag and stash the data
m_tocontroller_pending = true;
@@ -508,7 +508,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_to_controller_w )
// i8049_port1_r - read the 8048 I/O port 1
//-------------------------------------------------
-READ8_MEMBER( phillips_22vp931_device::i8049_port1_r )
+READ8_MEMBER( philips_22vp931_device::i8049_port1_r )
{
/*
$80 = P17 = (in) unsure
@@ -527,7 +527,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_port1_r )
// i8049_port1_w - write the 8048 I/O port 1
//-------------------------------------------------
-WRITE8_MEMBER( phillips_22vp931_device::i8049_port1_w )
+WRITE8_MEMBER( philips_22vp931_device::i8049_port1_w )
{
/*
$10 = P14 = (out) D104 -> /SPEED
@@ -598,7 +598,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_port1_w )
// i8049_port2_r - read from the 8048 I/O port 2
//-------------------------------------------------
-READ8_MEMBER( phillips_22vp931_device::i8049_port2_r )
+READ8_MEMBER( philips_22vp931_device::i8049_port2_r )
{
/*
$80 = P27 = (in) set/reset latch; set by FOC LS, reset by IGR
@@ -619,7 +619,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_port2_r )
// i8049_port2_w - write the 8048 I/O port 2
//-------------------------------------------------
-WRITE8_MEMBER( phillips_22vp931_device::i8049_port2_w )
+WRITE8_MEMBER( philips_22vp931_device::i8049_port2_w )
{
/*
$40 = P26 = (out) cleared while data is sent back & forth; set afterwards
@@ -633,7 +633,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_port2_w )
// connected to the DATIC's data strobe line
//-------------------------------------------------
-READ_LINE_MEMBER( phillips_22vp931_device::i8049_t0_r )
+READ_LINE_MEMBER( philips_22vp931_device::i8049_t0_r )
{
return m_datastrobe;
}
@@ -645,7 +645,7 @@ READ_LINE_MEMBER( phillips_22vp931_device::i8049_t0_r )
// to count the number of tracks advanced
//-------------------------------------------------
-READ_LINE_MEMBER( phillips_22vp931_device::i8049_t1_r )
+READ_LINE_MEMBER( philips_22vp931_device::i8049_t1_r )
{
return m_trackstate;
}
diff --git a/src/devices/machine/ldvp931.h b/src/devices/machine/ldvp931.h
index 0bf2e263558..fd69f52429e 100644
--- a/src/devices/machine/ldvp931.h
+++ b/src/devices/machine/ldvp931.h
@@ -18,19 +18,11 @@
//**************************************************************************
-// DEVICE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_LASERDISC_22VP931_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, PHILLIPS_22VP931, 0)
-
-
-//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
// device type definition
-DECLARE_DEVICE_TYPE(PHILLIPS_22VP931, phillips_22vp931_device)
+DECLARE_DEVICE_TYPE(PHILIPS_22VP931, philips_22vp931_device)
@@ -38,17 +30,17 @@ DECLARE_DEVICE_TYPE(PHILLIPS_22VP931, phillips_22vp931_device)
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> phillips_22vp931_device
+// ======================> philips_22vp931_device
// base _22vp931 class
-class phillips_22vp931_device : public laserdisc_device
+class philips_22vp931_device : public laserdisc_device
{
public:
// types
- typedef delegate<void (phillips_22vp931_device &, int)> data_ready_delegate;
+ typedef delegate<void (philips_22vp931_device &, int)> data_ready_delegate;
// construction/destruction
- phillips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ philips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// input and output
void data_w(uint8_t data) { synchronize(TID_DEFERRED_DATA, data); }
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index 7beb745cbf2..280973440a9 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -422,11 +422,11 @@ public:
struct channel
{
- netlist::poolptr<netlist::param_str_t> m_param_name;
+ netlist::pool_owned_ptr<netlist::param_str_t> m_param_name;
netlist::param_double_t *m_param;
stream_sample_t *m_buffer;
- netlist::poolptr<netlist::param_double_t> m_param_mult;
- netlist::poolptr<netlist::param_double_t> m_param_offset;
+ netlist::pool_owned_ptr<netlist::param_double_t> m_param_mult;
+ netlist::pool_owned_ptr<netlist::param_double_t> m_param_offset;
};
channel m_channels[MAX_INPUT_CHANNELS];
netlist::netlist_time m_inc;
diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h
index db27b2860df..9ec58f614bc 100644
--- a/src/devices/machine/netlist.h
+++ b/src/devices/machine/netlist.h
@@ -159,7 +159,7 @@ private:
netlist::netlist_time m_rem;
netlist::netlist_time m_old;
- netlist::poolptr<netlist_mame_t> m_netlist;
+ netlist::pool_owned_ptr<netlist_mame_t> m_netlist;
func_type m_setup_func;
};
diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile
index 79c51b54bec..ea034440b5e 100644
--- a/src/lib/netlist/build/makefile
+++ b/src/lib/netlist/build/makefile
@@ -19,14 +19,9 @@ TIDY_FLAGSX += -llvm-header-guard,-cppcoreguidelines-pro-type-reinterpret-cast,
TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-owning-memory,
TIDY_FLAGSX += -modernize-use-default-member-init,-cppcoreguidelines-pro-bounds-constant-array-index,
TIDY_FLAGSX += -modernize-pass-by-value,-cppcoreguidelines-pro-type-static-cast-downcast,
-#TIDY_FLAGSX += -cppcoreguidelines-special-member-functions,
-#TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-TIDY_FLAGSX += performance-unnecessary-value-param,-cppcoreguidelines-avoid-magic-numbers,
+TIDY_FLAGSX += -cppcoreguidelines-avoid-magic-numbers,
TIDY_FLAGSX += -cppcoreguidelines-macro-usage,
TIDY_FLAGSX += -cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,
-#TIDY_FLAGSX += -cppcoreguidelines-avoid-c-arrays,-modernize-avoid-c-arrays,
-#TIDY_FLAGSX += -modernize-use-using,
-TIDY_FLAGSX += performance-unnecessary-copy-initialization,
TIDY_FLAGSX += -bugprone-macro-parentheses,-misc-macro-parentheses
space :=
diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h
index 95712fc3416..324ceb93c38 100644
--- a/src/lib/netlist/devices/nlid_system.h
+++ b/src/lib/netlist/devices/nlid_system.h
@@ -335,7 +335,7 @@ namespace netlist
param_int_t m_N;
param_str_t m_func;
analog_output_t m_Q;
- std::vector<poolptr<analog_input_t>> m_I;
+ std::vector<pool_owned_ptr<analog_input_t>> m_I;
std::vector<double> m_vals;
plib::pfunction m_compiled;
diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp
index 622aee0e0c7..2221d855880 100644
--- a/src/lib/netlist/devices/nlid_truthtable.cpp
+++ b/src/lib/netlist/devices/nlid_truthtable.cpp
@@ -224,7 +224,7 @@ namespace netlist
: netlist_base_factory_truthtable_t(name, classname, def_param, sourcefile)
{ }
- poolptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override
+ pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override
{
using tt_type = nld_truthtable_t<m_NI, m_NO>;
truthtable_parser desc_s(m_NO, m_NI, &m_ttbl.m_initialized,
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index c2dd2c683a3..55e952ad723 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -82,15 +82,15 @@ public:
m_R_low = 1.0;
m_R_high = 130.0;
}
- poolptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const override;
- poolptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override;
+ pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const override;
+ pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override;
};
-poolptr<devices::nld_base_d_to_a_proxy> logic_family_ttl_t::create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const
+pool_owned_ptr<devices::nld_base_d_to_a_proxy> logic_family_ttl_t::create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const
{
return pool().make_poolptr<devices::nld_d_to_a_proxy>(anetlist, name, proxied);
}
-poolptr<devices::nld_base_a_to_d_proxy> logic_family_ttl_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const
+pool_owned_ptr<devices::nld_base_a_to_d_proxy> logic_family_ttl_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const
{
return pool().make_poolptr<devices::nld_a_to_d_proxy>(anetlist, name, proxied);
}
@@ -109,16 +109,16 @@ public:
m_R_low = 10.0;
m_R_high = 10.0;
}
- poolptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const override;
- poolptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override;
+ pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const override;
+ pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override;
};
-poolptr<devices::nld_base_d_to_a_proxy> logic_family_cd4xxx_t::create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const
+pool_owned_ptr<devices::nld_base_d_to_a_proxy> logic_family_cd4xxx_t::create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const
{
return pool().make_poolptr<devices::nld_d_to_a_proxy>(anetlist, name, proxied);
}
-poolptr<devices::nld_base_a_to_d_proxy> logic_family_cd4xxx_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const
+pool_owned_ptr<devices::nld_base_a_to_d_proxy> logic_family_cd4xxx_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const
{
return pool().make_poolptr<devices::nld_a_to_d_proxy>(anetlist, name, proxied);
}
@@ -578,7 +578,7 @@ core_device_t::core_device_t(core_device_t &owner, const pstring &name)
set_logic_family(owner.logic_family());
if (logic_family() == nullptr)
set_logic_family(family_TTL());
- state().add_dev(this->name(), poolptr<core_device_t>(this, false));
+ state().add_dev(this->name(), pool_owned_ptr<core_device_t>(this, false));
}
void core_device_t::set_default_delegate(detail::core_terminal_t &term)
@@ -856,7 +856,7 @@ terminal_t::terminal_t(core_device_t &dev, const pstring &aname, terminal_t *oth
, m_Idr1(nullptr)
, m_go1(nullptr)
, m_gt1(nullptr)
-, m_otherterm(otherterm)
+, m_connected_terminal(otherterm)
{
state().setup().register_term(*this);
}
@@ -894,7 +894,7 @@ logic_output_t::logic_output_t(core_device_t &dev, const pstring &aname)
, m_my_net(dev.state(), name() + ".net", this)
{
this->set_net(&m_my_net);
- state().register_net(poolptr<logic_net_t>(&m_my_net, false));
+ state().register_net(pool_owned_ptr<logic_net_t>(&m_my_net, false));
set_logic_family(dev.logic_family());
state().setup().register_term(*this);
}
@@ -923,7 +923,7 @@ analog_output_t::analog_output_t(core_device_t &dev, const pstring &aname)
: analog_t(dev, aname, STATE_OUT)
, m_my_net(dev.state(), name() + ".net", this)
{
- state().register_net(poolptr<analog_net_t>(&m_my_net, false));
+ state().register_net(pool_owned_ptr<analog_net_t>(&m_my_net, false));
this->set_net(&m_my_net);
//net().m_cur_Analog = NL_FCONST(0.0);
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h
index 572dba272b9..4a48dc892b3 100644
--- a/src/lib/netlist/nl_base.h
+++ b/src/lib/netlist/nl_base.h
@@ -139,7 +139,7 @@ class NETLIB_NAME(name) : public device_t
#define NETLIB_TIMESTEP(chip) void NETLIB_NAME(chip) :: timestep(const nl_double step)
#define NETLIB_SUB(chip) nld_ ## chip
-#define NETLIB_SUBXX(ns, chip) poolptr< ns :: nld_ ## chip >
+#define NETLIB_SUBXX(ns, chip) pool_owned_ptr< ns :: nld_ ## chip >
#define NETLIB_HANDLER(chip, name) void NETLIB_NAME(chip) :: name() NL_NOEXCEPT
#define NETLIB_UPDATE(chip) NETLIB_HANDLER(chip, update)
@@ -243,9 +243,9 @@ namespace netlist
virtual ~logic_family_desc_t() noexcept = default;
- virtual poolptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name,
+ virtual pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name,
logic_output_t *proxied) const = 0;
- virtual poolptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name,
+ virtual pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name,
logic_input_t *proxied) const = 0;
double fixed_V() const { return m_fixed_V; }
@@ -626,14 +626,14 @@ namespace netlist
void set_ptrs(nl_double *gt, nl_double *go, nl_double *Idr) noexcept;
- terminal_t *otherterm() const noexcept { return m_otherterm; }
+ terminal_t *connected_terminal() const noexcept { return m_connected_terminal; }
private:
nl_double *m_Idr1; // drive current
nl_double *m_go1; // conductance for Voltage from other term
nl_double *m_gt1; // conductance for total conductance
- terminal_t *m_otherterm;
+ terminal_t *m_connected_terminal;
};
@@ -1187,7 +1187,7 @@ namespace netlist
const setup_t &setup() const;
template<class C, typename... Args>
- void register_sub(const pstring &name, poolptr<C> &dev, const Args&... args)
+ void register_sub(const pstring &name, pool_owned_ptr<C> &dev, const Args&... args)
{
//dev.reset(plib::palloc<C>(*this, name, args...));
dev = pool().make_poolptr<C>(*this, name, args...);
@@ -1275,10 +1275,10 @@ namespace netlist
{
public:
- using nets_collection_type = std::vector<poolptr<detail::net_t>>;
+ using nets_collection_type = std::vector<pool_owned_ptr<detail::net_t>>;
/* need to preserve order of device creation ... */
- using devices_collection_type = std::vector<std::pair<pstring, poolptr<core_device_t>>>;
+ using devices_collection_type = std::vector<std::pair<pstring, pool_owned_ptr<core_device_t>>>;
netlist_state_t(const pstring &aname,
plib::unique_ptr<callbacks_t> &&callbacks,
plib::unique_ptr<setup_t> &&setup);
@@ -1330,7 +1330,7 @@ namespace netlist
std::size_t find_net_id(const detail::net_t *net) const;
template <typename T>
- void register_net(poolptr<T> &&net) { m_nets.push_back(std::move(net)); }
+ void register_net(pool_owned_ptr<T> &&net) { m_nets.push_back(std::move(net)); }
template<class device_class>
inline std::vector<device_class *> get_device_list()
@@ -1346,7 +1346,7 @@ namespace netlist
}
template <typename T>
- void add_dev(const pstring &name, poolptr<T> &&dev)
+ void add_dev(const pstring &name, pool_owned_ptr<T> &&dev)
{
for (auto & d : m_devices)
if (d.first == name)
diff --git a/src/lib/netlist/nl_dice_compat.h b/src/lib/netlist/nl_dice_compat.h
index b0ebdb2e371..7df86dde1e7 100644
--- a/src/lib/netlist/nl_dice_compat.h
+++ b/src/lib/netlist/nl_dice_compat.h
@@ -29,6 +29,7 @@ sed -e 's/#define \(.*\)"\(.*\)"[ \t]*,[ \t]*\(.*\)/NET_ALIAS(\1,\2.\3)/' src/ma
#include "analog/nld_twoterm.h"
#include <cmath>
+
#endif
diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp
index c9d5ea7e29f..1f0ac35c6c4 100644
--- a/src/lib/netlist/nl_factory.cpp
+++ b/src/lib/netlist/nl_factory.cpp
@@ -76,7 +76,7 @@ namespace netlist { namespace factory
// factory_lib_entry_t: factory class to wrap macro based chips/elements
// -----------------------------------------------------------------------------
- poolptr<device_t> library_element_t::Create(netlist_state_t &anetlist, const pstring &name)
+ pool_owned_ptr<device_t> library_element_t::Create(netlist_state_t &anetlist, const pstring &name)
{
return pool().make_poolptr<NETLIB_NAME(wrapper)>(anetlist, name);
}
diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h
index ee6b4a8ac8f..271bf72bf90 100644
--- a/src/lib/netlist/nl_factory.h
+++ b/src/lib/netlist/nl_factory.h
@@ -9,12 +9,12 @@
#ifndef NLFACTORY_H_
#define NLFACTORY_H_
-#include <vector>
-
#include "nltypes.h"
#include "plib/palloc.h"
#include "plib/ptypes.h"
+#include <vector>
+
#define NETLIB_DEVICE_IMPL_ALIAS(p_alias, chip, p_name, p_def_param) \
NETLIB_DEVICE_IMPL_BASE(devices, p_alias, chip, p_name, p_def_param) \
@@ -55,7 +55,7 @@ namespace factory {
COPYASSIGNMOVE(element_t, default)
- virtual poolptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) = 0;
+ virtual pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) = 0;
virtual void macro_actions(nlparse_t &nparser, const pstring &name)
{
plib::unused_var(nparser);
@@ -85,7 +85,7 @@ namespace factory {
const pstring &def_param, const pstring &sourcefile)
: element_t(name, classname, def_param, sourcefile) { }
- poolptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override
+ pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override
{
return pool().make_poolptr<C>(anetlist, name);
}
@@ -147,7 +147,7 @@ namespace factory {
{
}
- poolptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override;
+ pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override;
void macro_actions(nlparse_t &nparser, const pstring &name) override;
diff --git a/src/lib/netlist/nl_lists.h b/src/lib/netlist/nl_lists.h
index c0d3bfd6548..4ca1e7507c8 100644
--- a/src/lib/netlist/nl_lists.h
+++ b/src/lib/netlist/nl_lists.h
@@ -10,18 +10,19 @@
#ifndef NLLISTS_H_
#define NLLISTS_H_
-#include "nl_config.h"
#include "plib/pchrono.h"
#include "plib/plists.h"
#include "plib/ptypes.h"
+#include "nl_config.h"
+#include "nltypes.h"
+
#include <algorithm>
#include <atomic>
#include <mutex>
#include <thread>
#include <utility>
-#include "nltypes.h"
// ----------------------------------------------------------------------------------------
// timed queue
diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp
index 3ac1b604bc4..5dc9a9d2516 100644
--- a/src/lib/netlist/nl_setup.cpp
+++ b/src/lib/netlist/nl_setup.cpp
@@ -935,17 +935,17 @@ class logic_family_std_proxy_t : public logic_family_desc_t
{
public:
logic_family_std_proxy_t() = default;
- poolptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist,
+ pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist,
const pstring &name, logic_output_t *proxied) const override;
- poolptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override;
+ pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override;
};
-poolptr<devices::nld_base_d_to_a_proxy> logic_family_std_proxy_t::create_d_a_proxy(netlist_state_t &anetlist,
+pool_owned_ptr<devices::nld_base_d_to_a_proxy> logic_family_std_proxy_t::create_d_a_proxy(netlist_state_t &anetlist,
const pstring &name, logic_output_t *proxied) const
{
return pool().make_poolptr<devices::nld_d_to_a_proxy>(anetlist, name, proxied);
}
-poolptr<devices::nld_base_a_to_d_proxy> logic_family_std_proxy_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const
+pool_owned_ptr<devices::nld_base_a_to_d_proxy> logic_family_std_proxy_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const
{
return pool().make_poolptr<devices::nld_a_to_d_proxy>(anetlist, name, proxied);
}
@@ -1010,7 +1010,7 @@ void setup_t::delete_empty_nets()
{
netlist().nets().erase(
std::remove_if(netlist().nets().begin(), netlist().nets().end(),
- [](poolptr<detail::net_t> &x)
+ [](pool_owned_ptr<detail::net_t> &x)
{
if (x->num_cons() == 0)
{
@@ -1038,7 +1038,7 @@ void setup_t::prepare_to_run()
if ( factory().is_class<devices::NETLIB_NAME(solver)>(e.second)
|| factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second))
{
- m_netlist.nlstate().add_dev(e.first, poolptr<device_t>(e.second->Create(netlist(), e.first)));
+ m_netlist.nlstate().add_dev(e.first, pool_owned_ptr<device_t>(e.second->Create(netlist(), e.first)));
}
}
@@ -1055,7 +1055,7 @@ void setup_t::prepare_to_run()
if ( !factory().is_class<devices::NETLIB_NAME(solver)>(e.second)
&& !factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second))
{
- auto dev = poolptr<device_t>(e.second->Create(netlist(), e.first));
+ auto dev = pool_owned_ptr<device_t>(e.second->Create(netlist(), e.first));
m_netlist.nlstate().add_dev(dev->name(), std::move(dev));
}
}
diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h
index bf0c934a94b..24e29cfb401 100644
--- a/src/lib/netlist/nl_setup.h
+++ b/src/lib/netlist/nl_setup.h
@@ -8,11 +8,6 @@
#ifndef NLSETUP_H_
#define NLSETUP_H_
-#include <memory>
-#include <stack>
-#include <unordered_map>
-#include <vector>
-
#include "plib/pparser.h"
#include "plib/pstream.h"
#include "plib/pstring.h"
@@ -22,6 +17,12 @@
#include "nl_factory.h"
#include "nltypes.h"
+#include <memory>
+#include <stack>
+#include <unordered_map>
+#include <vector>
+
+
//============================================================
// MACROS / inline netlist definitions
//============================================================
diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h
index 1ddc29adfae..9abe8beebef 100644
--- a/src/lib/netlist/nltypes.h
+++ b/src/lib/netlist/nltypes.h
@@ -84,18 +84,18 @@ namespace netlist
#if (USE_MEMPOOL)
using nlmempool = plib::mempool;
#else
- using nlmempool = plib::mempool_default;
+ using nlmempool = plib::aligned_arena;
#endif
/*! Owned pointer type for pooled allocations.
*
*/
template <typename T>
- using poolptr = nlmempool::poolptr<T>;
+ using pool_owned_ptr = nlmempool::owned_pool_ptr<T>;
inline nlmempool &pool()
{
- static nlmempool static_pool(655360, 16);
+ static nlmempool static_pool;
return static_pool;
}
diff --git a/src/lib/netlist/plib/mat_cr.h b/src/lib/netlist/plib/mat_cr.h
index 7fc5d46b85d..4cc027f0d8f 100644
--- a/src/lib/netlist/plib/mat_cr.h
+++ b/src/lib/netlist/plib/mat_cr.h
@@ -10,13 +10,6 @@
#ifndef MAT_CR_H_
#define MAT_CR_H_
-#include <algorithm>
-#include <array>
-#include <cmath>
-#include <cstdlib>
-#include <type_traits>
-#include <vector>
-
#include "palloc.h"
#include "parray.h"
#include "pconfig.h"
@@ -25,6 +18,13 @@
#include "ptypes.h"
#include "putil.h"
+#include <algorithm>
+#include <array>
+#include <cmath>
+#include <cstdlib>
+#include <type_traits>
+#include <vector>
+
namespace plib
{
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h
index d7b00262f7f..f10fd548817 100644
--- a/src/lib/netlist/plib/palloc.h
+++ b/src/lib/netlist/plib/palloc.h
@@ -17,6 +17,7 @@
#include <memory>
#include <utility>
#include <vector>
+#include <type_traits>
#if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
#include <malloc.h>
@@ -25,127 +26,65 @@
namespace plib {
//============================================================
- // Memory allocation
+ // Standard arena_deleter
//============================================================
-#if (USE_ALIGNED_ALLOCATION)
- static inline void *paligned_alloc( size_t alignment, size_t size )
+ template <typename P, typename T>
+ struct arena_deleter
{
-#if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
- return _aligned_malloc(size, alignment);
-#elif defined(__APPLE__)
- void* p;
- if (::posix_memalign(&p, alignment, size) != 0) {
- p = nullptr;
+ //using arena_storage_type = P *;
+ using arena_storage_type = typename std::conditional<P::is_stateless, P, P *>::type;
+ template <typename X, typename Y = void>
+ typename std::enable_if<!X::is_stateless, X&>::type getref(X *x) { return *x;}
+ template <typename X, typename Y = void *>
+ typename std::enable_if<std::remove_pointer<X>::type::is_stateless, X&>::type
+ getref(X &x, Y y = nullptr)
+ {
+ unused_var(y);
+ return x;
}
- return p;
-#else
- return aligned_alloc(alignment, size);
-#endif
- }
-
- static inline void pfree( void *ptr )
- {
- // NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
- free(ptr);
- }
-
-#else
- static inline void *paligned_alloc( size_t alignment, size_t size )
- {
- unused_var(alignment);
- return ::operator new(size);
- }
-
- static inline void pfree( void *ptr )
- {
- ::operator delete(ptr);
- }
-#endif
-
- template <typename T, std::size_t ALIGN>
- /*inline */ C14CONSTEXPR T *assume_aligned_ptr(T *p) noexcept
- {
- static_assert(ALIGN >= alignof(T), "Alignment must be greater or equal to alignof(T)");
- static_assert(is_pow2(ALIGN), "Alignment must be a power of 2");
- //auto t = reinterpret_cast<std::uintptr_t>(p);
- //if (t & (ALIGN-1))
- // printf("alignment error!");
-#if (USE_ALIGNED_HINTS)
- return reinterpret_cast<T *>(__builtin_assume_aligned(p, ALIGN));
-#else
- return p;
-#endif
- }
-
- template <typename T, std::size_t ALIGN>
- constexpr const T *assume_aligned_ptr(const T *p) noexcept
- {
- static_assert(ALIGN >= alignof(T), "Alignment must be greater or equal to alignof(T)");
- static_assert(is_pow2(ALIGN), "Alignment must be a power of 2");
-#if (USE_ALIGNED_HINTS)
- return reinterpret_cast<const T *>(__builtin_assume_aligned(p, ALIGN));
-#else
- return p;
-#endif
- }
-
- template<typename T, typename... Args>
- inline T *pnew(Args&&... args)
- {
- auto *p = paligned_alloc(alignof(T), sizeof(T));
- return new(p) T(std::forward<Args>(args)...);
- }
- template<typename T>
- inline void pdelete(T *ptr)
- {
- ptr->~T();
- pfree(ptr);
- }
+ constexpr arena_deleter(arena_storage_type a = arena_storage_type()) noexcept
+ : m_a(a) { }
- template<typename T>
- inline T* pnew_array(const std::size_t num)
- {
- return new T[num]();
- }
-
- template<typename T>
- inline void pdelete_array(T *ptr)
- {
- delete [] ptr;
- }
-
- template <typename T>
- struct pdefault_deleter
- {
- constexpr pdefault_deleter() noexcept = default;
-
- template<typename U, typename = typename
+ template<typename PU, typename U, typename = typename
std::enable_if<std::is_convertible< U*, T*>::value>::type>
- pdefault_deleter(const pdefault_deleter<U>&) noexcept { }
+ arena_deleter(const arena_deleter<PU, U> &rhs) noexcept : m_a(rhs.m_a) { }
- void operator()(T *p) const
+ void operator()(T *p) //const
{
- pdelete(p);
+ /* call destructor */
+ p->~T();
+ getref(m_a).deallocate(p);
}
+ //private:
+ arena_storage_type m_a;
};
- template <typename SC, typename D = pdefault_deleter<SC>>
+ //============================================================
+ // owned_ptr: smart pointer with ownership information
+ //============================================================
+
+ template <typename SC, typename D>
class owned_ptr
{
public:
+
+ using pointer = SC *;
+ using element_type = SC;
+ using deleter_type = D;
+
owned_ptr()
- : m_ptr(nullptr), m_is_owned(true) { }
+ : m_ptr(nullptr), m_deleter(), m_is_owned(true) { }
template <typename, typename>
friend class owned_ptr;
- owned_ptr(SC *p, bool owned) noexcept
+ owned_ptr(pointer p, bool owned) noexcept
: m_ptr(p), m_deleter(), m_is_owned(owned)
{ }
- owned_ptr(SC *p, bool owned, D deleter) noexcept
+ owned_ptr(pointer p, bool owned, D deleter) noexcept
: m_ptr(p), m_deleter(deleter), m_is_owned(owned)
{ }
@@ -168,10 +107,10 @@ namespace plib {
}
owned_ptr(owned_ptr &&r) noexcept
+ : m_ptr(r.m_ptr)
+ , m_deleter(r.m_deleter)
+ , m_is_owned(r.m_is_owned)
{
- m_is_owned = r.m_is_owned;
- m_ptr = r.m_ptr;
- m_deleter = r.m_deleter;
r.m_is_owned = false;
r.m_ptr = nullptr;
}
@@ -183,7 +122,7 @@ namespace plib {
m_deleter(m_ptr);
m_is_owned = r.m_is_owned;
m_ptr = r.m_ptr;
- m_deleter = r.m_deleter;
+ m_deleter = std::move(r.m_deleter);
r.m_is_owned = false;
r.m_ptr = nullptr;
return *this;
@@ -191,10 +130,10 @@ namespace plib {
template<typename DC, typename DC_D>
owned_ptr(owned_ptr<DC, DC_D> &&r) noexcept
+ : m_ptr(static_cast<pointer >(r.get()))
+ , m_deleter(r.m_deleter)
+ , m_is_owned(r.is_owned())
{
- m_ptr = static_cast<SC *>(r.get());
- m_is_owned = r.is_owned();
- m_deleter = r.m_deleter;
r.release();
}
@@ -208,9 +147,9 @@ namespace plib {
m_is_owned = false;
m_ptr = nullptr;
}
- SC * release()
+ pointer release()
{
- SC *tmp = m_ptr;
+ pointer tmp = m_ptr;
m_is_owned = false;
m_ptr = nullptr;
return tmp;
@@ -218,98 +157,217 @@ namespace plib {
bool is_owned() const { return m_is_owned; }
- SC * operator ->() const { return m_ptr; }
- SC & operator *() const { return *m_ptr; }
- SC * get() const { return m_ptr; }
+ pointer operator ->() const noexcept { return m_ptr; }
+ typename std::add_lvalue_reference<element_type>::type operator *() const noexcept { return *m_ptr; }
+ pointer get() const noexcept { return m_ptr; }
+
+ deleter_type& get_deleter() noexcept { return m_deleter; }
+ const deleter_type& get_deleter() const noexcept { return m_deleter; }
+
private:
- SC *m_ptr;
+ pointer m_ptr;
D m_deleter;
bool m_is_owned;
};
- template <typename T>
- using unique_ptr = std::unique_ptr<T, pdefault_deleter<T>>;
-
- template<typename T, typename... Args>
- plib::unique_ptr<T> make_unique(Args&&... args)
- {
- return plib::unique_ptr<T>(pnew<T>(std::forward<Args>(args)...));
- }
-
- template<typename T, typename... Args>
- static owned_ptr<T> make_owned(Args&&... args)
- {
- owned_ptr<T> a(pnew<T>(std::forward<Args>(args)...), true);
- return std::move(a);
- }
-
//============================================================
- // Aligned allocator for use with containers
+ // Arena allocator for use with containers
//============================================================
- template <class T, std::size_t ALIGN = alignof(T)>
- class aligned_allocator
+ template <class ARENA, class T, std::size_t ALIGN = alignof(T)>
+ class arena_allocator
{
public:
using value_type = T;
static constexpr const std::size_t align_size = ALIGN;
+ using arena_type = ARENA;
static_assert(align_size >= alignof(T) && (align_size % alignof(T)) == 0,
"ALIGN must be greater than alignof(T) and a multiple");
- aligned_allocator() noexcept = default;
- ~aligned_allocator() noexcept = default;
+ arena_allocator() noexcept
+ : m_a(arena_type::instance())
+ { }
+
+ ~arena_allocator() noexcept = default;
- aligned_allocator(const aligned_allocator&) noexcept = default;
- aligned_allocator& operator=(const aligned_allocator&) noexcept = delete;
+ arena_allocator(const arena_allocator &rhs) noexcept : m_a(rhs.m_a) { printf("copy called\n"); }//= default;
+ arena_allocator& operator=(const arena_allocator&) noexcept = delete;
- aligned_allocator(aligned_allocator&&) noexcept = default;
- aligned_allocator& operator=(aligned_allocator&&) = delete;
+ arena_allocator(arena_allocator&&) noexcept = default;
+ arena_allocator& operator=(arena_allocator&&) = delete;
+
+ arena_allocator(arena_type & a) noexcept : m_a(a)
+ {
+ }
template <class U>
- aligned_allocator(const aligned_allocator<U, ALIGN>& rhs) noexcept
+ arena_allocator(const arena_allocator<ARENA, U, ALIGN>& rhs) noexcept
+ : m_a(rhs.m_a)
{
- unused_var(rhs);
}
template <class U> struct rebind
{
- using other = aligned_allocator<U, ALIGN>;
+ using other = arena_allocator<ARENA, U, ALIGN>;
};
T* allocate(std::size_t n)
{
- return reinterpret_cast<T *>(paligned_alloc(ALIGN, sizeof(T) * n));
+ return reinterpret_cast<T *>(m_a.allocate(ALIGN, sizeof(T) * n));
}
void deallocate(T* p, std::size_t n) noexcept
{
unused_var(n);
- pfree(p);
+ m_a.deallocate(p);
}
- template <class T1, std::size_t A1, class U, std::size_t A2>
- friend bool operator==(const aligned_allocator<T1, A1>& lhs,
- const aligned_allocator<U, A2>& rhs) noexcept;
+ template <class AR1, class T1, std::size_t A1, class AR2, class T2, std::size_t A2>
+ friend bool operator==(const arena_allocator<AR1, T1, A1>& lhs,
+ const arena_allocator<AR2, T2, A2>& rhs) noexcept;
- template <class U, std::size_t A> friend class aligned_allocator;
+ template <class AU, class U, std::size_t A> friend class arena_allocator;
+ private:
+ arena_type &m_a;
};
- template <class T1, std::size_t A1, class U, std::size_t A2>
- /*friend*/ inline bool operator==(const aligned_allocator<T1, A1>& lhs,
- const aligned_allocator<U, A2>& rhs) noexcept
+ template <class AR1, class T1, std::size_t A1, class AR2, class T2, std::size_t A2>
+ inline bool operator==(const arena_allocator<AR1, T1, A1>& lhs,
+ const arena_allocator<AR2, T2, A2>& rhs) noexcept
{
- unused_var(lhs, rhs);
- return A1 == A2;
+ return A1 == A2 && rhs.m_a == lhs.m_a;
}
- template <class T1, std::size_t A1, class U, std::size_t A2>
- /*friend*/ inline bool operator!=(const aligned_allocator<T1, A1>& lhs,
- const aligned_allocator<U, A2>& rhs) noexcept
+ template <class AR1, class T1, std::size_t A1, class AR2, class T2, std::size_t A2>
+ inline bool operator!=(const arena_allocator<AR1, T1, A1>& lhs,
+ const arena_allocator<AR2, T2, A2>& rhs) noexcept
{
return !(lhs == rhs);
}
//============================================================
+ // Memory allocation
+ //============================================================
+
+ struct aligned_arena
+ {
+ static constexpr const bool is_stateless = true;
+ template <class T, std::size_t ALIGN = alignof(T)>
+ using allocator_type = arena_allocator<aligned_arena, T, ALIGN>;
+
+ template <typename T>
+ using owned_pool_ptr = plib::owned_ptr<T, arena_deleter<aligned_arena, T>>;
+
+ static inline aligned_arena &instance()
+ {
+ static aligned_arena s_arena;
+ return s_arena;
+ }
+
+ static inline void *allocate( size_t alignment, size_t size )
+ {
+ #if (USE_ALIGNED_ALLOCATION)
+ #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
+ return _aligned_malloc(size, alignment);
+ #elif defined(__APPLE__)
+ void* p;
+ if (::posix_memalign(&p, alignment, size) != 0) {
+ p = nullptr;
+ }
+ return p;
+ #else
+ return aligned_alloc(alignment, size);
+ #endif
+ #else
+ unused_var(alignment);
+ return ::operator new(size);
+ #endif
+ }
+
+ static inline void deallocate( void *ptr )
+ {
+ #if (USE_ALIGNED_ALLOCATION)
+ // NOLINTNEXTLINE(cppcoreguidelines-no-malloc)
+ free(ptr);
+ #else
+ ::operator delete(ptr);
+ #endif
+ }
+
+ template<typename T, typename... Args>
+ owned_pool_ptr<T> make_poolptr(Args&&... args)
+ {
+ auto *mem = allocate(alignof(T), sizeof(T));
+ return owned_pool_ptr<T>(new (mem) T(std::forward<Args>(args)...), true, arena_deleter<aligned_arena, T>(*this));
+ }
+
+ };
+
+ template <typename T, std::size_t ALIGN>
+ /*inline */ C14CONSTEXPR T *assume_aligned_ptr(T *p) noexcept
+ {
+ static_assert(ALIGN >= alignof(T), "Alignment must be greater or equal to alignof(T)");
+ static_assert(is_pow2(ALIGN), "Alignment must be a power of 2");
+ //auto t = reinterpret_cast<std::uintptr_t>(p);
+ //if (t & (ALIGN-1))
+ // printf("alignment error!");
+#if (USE_ALIGNED_HINTS)
+ return reinterpret_cast<T *>(__builtin_assume_aligned(p, ALIGN));
+#else
+ return p;
+#endif
+ }
+
+ template <typename T, std::size_t ALIGN>
+ constexpr const T *assume_aligned_ptr(const T *p) noexcept
+ {
+ static_assert(ALIGN >= alignof(T), "Alignment must be greater or equal to alignof(T)");
+ static_assert(is_pow2(ALIGN), "Alignment must be a power of 2");
+#if (USE_ALIGNED_HINTS)
+ return reinterpret_cast<const T *>(__builtin_assume_aligned(p, ALIGN));
+#else
+ return p;
+#endif
+ }
+
+ // FIXME: remove
+ template<typename T, typename... Args>
+ inline T *pnew(Args&&... args)
+ {
+ auto *p = aligned_arena::allocate(alignof(T), sizeof(T));
+ return new(p) T(std::forward<Args>(args)...);
+ }
+
+ template<typename T>
+ inline void pdelete(T *ptr)
+ {
+ ptr->~T();
+ aligned_arena::deallocate(ptr);
+ }
+
+
+ template <typename T>
+ using unique_ptr = std::unique_ptr<T, arena_deleter<aligned_arena, T>>;
+
+ template<typename T, typename... Args>
+ plib::unique_ptr<T> make_unique(Args&&... args)
+ {
+ return plib::unique_ptr<T>(pnew<T>(std::forward<Args>(args)...));
+ }
+
+#if 0
+ template<typename T, typename... Args>
+ static owned_ptr<T> make_owned(Args&&... args)
+ {
+ return owned_ptr<T>(pnew<T>(std::forward<Args>(args)...), true);
+ }
+#endif
+
+
+ template <class T, std::size_t ALIGN = alignof(T)>
+ using aligned_allocator = aligned_arena::allocator_type<T, ALIGN>;
+
+ //============================================================
// traits to determine alignment size and stride size
// from types supporting alignment
//============================================================
@@ -321,14 +379,7 @@ namespace plib {
{
static constexpr const std::size_t align_size = alignof(std::max_align_t);
static constexpr const std::size_t value_size = sizeof(typename T::value_type);
-#if 0
- static constexpr const std::size_t stride_size =
- ((value_size % align_size) == 0 ? 1 //T is a multiple of align_size
- : ((align_size % value_size) != 0 ? align_size // align_size is not a multiple of T
- : align_size / value_size));
-#else
static constexpr const std::size_t stride_size = lcm(align_size, value_size) / value_size;
-#endif
};
template <typename T>
@@ -336,14 +387,7 @@ namespace plib {
{
static constexpr const std::size_t align_size = T::align_size;
static constexpr const std::size_t value_size = sizeof(typename T::value_type);
-#if 0
- static constexpr const std::size_t stride_size =
- ((value_size % align_size) == 0 ? 1 //T is a multiple of align_size
- : ((align_size % value_size) != 0 ? align_size // align_size is not a multiple of T
- : align_size / value_size));
-#else
static constexpr const std::size_t stride_size = lcm(align_size, value_size) / value_size;
-#endif
};
//============================================================
diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h
index c521f24e5f8..6616669f619 100644
--- a/src/lib/netlist/plib/pconfig.h
+++ b/src/lib/netlist/plib/pconfig.h
@@ -38,7 +38,7 @@
*/
#ifndef USE_ALIGNED_OPTIMIZATIONS
-#define USE_ALIGNED_OPTIMIZATIONS (0)
+#define USE_ALIGNED_OPTIMIZATIONS (1)
#endif
#define USE_ALIGNED_ALLOCATION (USE_ALIGNED_OPTIMIZATIONS)
diff --git a/src/lib/netlist/plib/pdynlib.cpp b/src/lib/netlist/plib/pdynlib.cpp
index 91e1b5cf73a..0d32bead51d 100644
--- a/src/lib/netlist/plib/pdynlib.cpp
+++ b/src/lib/netlist/plib/pdynlib.cpp
@@ -25,7 +25,7 @@ CHAR *astring_from_utf8(const char *utf8string)
// convert UTF-16 to "ANSI code page" string
char_count = WideCharToMultiByte(CP_ACP, 0, wstring, -1, nullptr, 0, nullptr, nullptr);
- result = pnew_array<CHAR>(char_count);
+ result = new CHAR[char_count];
if (result != nullptr)
WideCharToMultiByte(CP_ACP, 0, wstring, -1, result, char_count, nullptr, nullptr);
@@ -39,7 +39,7 @@ WCHAR *wstring_from_utf8(const char *utf8string)
// convert MAME string (UTF-8) to UTF-16
char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, nullptr, 0);
- result = pnew_array<WCHAR>(char_count);
+ result = new WCHAR[char_count];
if (result != nullptr)
MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count);
@@ -72,7 +72,7 @@ dynlib::dynlib(const pstring &libname)
m_isLoaded = true;
//else
// fprintf(stderr, "win: library <%s> not found!\n", libname.c_str());
- pdelete_array(buffer);
+ delete [] buffer;
#elif defined(EMSCRIPTEN)
//no-op
#else
@@ -106,7 +106,7 @@ dynlib::dynlib(const pstring &path, const pstring &libname)
{
//printf("win: library <%s> not found!\n", libname.c_str());
}
- pdelete_array(buffer);
+ delete [] buffer;
#elif defined(EMSCRIPTEN)
//no-op
#else
diff --git a/src/lib/netlist/plib/pexception.h b/src/lib/netlist/plib/pexception.h
index 44daf53d591..28a3ac1adf1 100644
--- a/src/lib/netlist/plib/pexception.h
+++ b/src/lib/netlist/plib/pexception.h
@@ -8,11 +8,11 @@
#ifndef PEXCEPTION_H_
#define PEXCEPTION_H_
-#include <exception>
-
#include "pstring.h"
#include "ptypes.h"
+#include <exception>
+
namespace plib {
//============================================================
diff --git a/src/lib/netlist/plib/pmatrix2d.h b/src/lib/netlist/plib/pmatrix2d.h
index 52228548cbf..eab533688d7 100644
--- a/src/lib/netlist/plib/pmatrix2d.h
+++ b/src/lib/netlist/plib/pmatrix2d.h
@@ -22,21 +22,22 @@ namespace plib
{
- template<typename T, typename A = std::allocator<T>>
+ template<typename T, typename A = aligned_allocator<T>>
class pmatrix2d
{
public:
using value_type = T;
+ using allocator_type = A;
static constexpr const std::size_t align_size = align_traits<A>::align_size;
static constexpr const std::size_t stride_size = align_traits<A>::stride_size;
pmatrix2d()
- : m_N(0), m_M(0), m_stride(8)
+ : m_N(0), m_M(0), m_stride(8), m_v()
{
}
pmatrix2d(std::size_t N, std::size_t M)
- : m_N(N), m_M(M)
+ : m_N(N), m_M(M), m_v()
{
m_stride = ((M + stride_size-1) / stride_size) * stride_size;
m_v.resize(N * m_stride);
diff --git a/src/lib/netlist/plib/pmempool.h b/src/lib/netlist/plib/pmempool.h
index 00e78b09fb6..5449595c86c 100644
--- a/src/lib/netlist/plib/pmempool.h
+++ b/src/lib/netlist/plib/pmempool.h
@@ -23,21 +23,6 @@
namespace plib {
- template <typename P, typename T>
- struct pool_deleter
- {
- constexpr pool_deleter() noexcept = default;
-
- template<typename PU, typename U, typename = typename
- std::enable_if<std::is_convertible< U*, T*>::value>::type>
- pool_deleter(const pool_deleter<PU, U>&) noexcept { }
-
- void operator()(T *p) const
- {
- P::free(p);
- }
- };
-
//============================================================
// Memory pool
//============================================================
@@ -100,8 +85,11 @@ namespace plib {
std::vector<block *> m_blocks;
public:
+ static constexpr const bool is_stateless = false;
+ template <class T, std::size_t ALIGN = alignof(T)>
+ using allocator_type = arena_allocator<mempool, T, ALIGN>;
- mempool(size_t min_alloc, size_t min_align)
+ mempool(size_t min_alloc = (1<<21), size_t min_align = 16)
: m_min_alloc(min_alloc), m_min_align(min_align)
{
}
@@ -122,10 +110,8 @@ namespace plib {
}
}
- template <std::size_t ALIGN>
- void *alloc(size_t size)
+ void *allocate(size_t align, size_t size)
{
- size_t align = ALIGN;
if (align < m_min_align)
align = m_min_align;
@@ -164,11 +150,8 @@ namespace plib {
}
}
- template <typename T>
- static void free(T *ptr)
+ static void deallocate(void *ptr)
{
- /* call destructor */
- ptr->~T();
auto it = sinfo().find(ptr);
if (it == sinfo().end())
@@ -188,19 +171,18 @@ namespace plib {
}
template <typename T>
- using poolptr = plib::owned_ptr<T, pool_deleter<mempool, T>>;
+ using owned_pool_ptr = plib::owned_ptr<T, arena_deleter<mempool, T>>;
template<typename T, typename... Args>
- poolptr<T> make_poolptr(Args&&... args)
+ owned_pool_ptr<T> make_poolptr(Args&&... args)
{
- auto *mem = this->alloc<alignof(T)>(sizeof(T));
- auto *obj = new (mem) T(std::forward<Args>(args)...);
- poolptr<T> a(obj, true);
- return std::move(a);
+ auto *mem = this->allocate(alignof(T), sizeof(T));
+ return owned_pool_ptr<T>(new (mem) T(std::forward<Args>(args)...), true, arena_deleter<mempool, T>(this));
}
};
+#if 0
class mempool_default
{
private:
@@ -210,7 +192,11 @@ namespace plib {
public:
- mempool_default(size_t min_alloc, size_t min_align)
+ static constexpr const bool is_stateless = true;
+ template <class T, std::size_t ALIGN = alignof(T)>
+ using allocator_type = arena_allocator<mempool_default, T, ALIGN>;
+
+ mempool_default(size_t min_alloc = 16, size_t min_align = (1 << 21))
: m_min_alloc(min_alloc), m_min_align(min_align)
{
}
@@ -219,24 +205,22 @@ namespace plib {
~mempool_default() = default;
-#if 0
- void *alloc(size_t size)
+ void *allocate(size_t alignment, size_t size)
{
plib::unused_var(m_min_alloc); // -Wunused-private-field fires without
plib::unused_var(m_min_align);
+ plib::unused_var(alignment);
return ::operator new(size);
}
-#endif
- template <typename T>
- static void free(T *ptr)
+ static void deallocate(void *ptr)
{
- plib::pdelete(ptr);
+ ::operator delete(ptr);
}
template <typename T>
- using poolptr = plib::owned_ptr<T, pool_deleter<mempool_default, T>>;
+ using poolptr = plib::owned_ptr<T, arena_deleter<mempool_default, T>>;
template<typename T, typename... Args>
poolptr<T> make_poolptr(Args&&... args)
@@ -249,7 +233,7 @@ namespace plib {
return std::move(a);
}
};
-
+#endif
} // namespace plib
diff --git a/src/lib/netlist/plib/pomp.h b/src/lib/netlist/plib/pomp.h
index d86326f4594..f8a516df485 100644
--- a/src/lib/netlist/plib/pomp.h
+++ b/src/lib/netlist/plib/pomp.h
@@ -9,10 +9,10 @@
#ifndef POMP_H_
#define POMP_H_
-#include <cstddef>
-
#include "pconfig.h"
+#include <cstddef>
+
#if HAS_OPENMP
#include "omp.h"
#endif
diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp
index d0c7ea5d960..83d6f9f5e29 100644
--- a/src/lib/netlist/plib/pparser.cpp
+++ b/src/lib/netlist/plib/pparser.cpp
@@ -381,7 +381,7 @@ pstring ppreprocessor::replace_macros(const pstring &line)
return ret;
}
-static pstring catremainder(const std::vector<pstring> &elems, std::size_t start, pstring sep)
+static pstring catremainder(const std::vector<pstring> &elems, std::size_t start, const pstring &sep)
{
pstring ret("");
for (std::size_t i = start; i < elems.size(); i++)
diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h
index 24b096519bf..1eca20e99ad 100644
--- a/src/lib/netlist/plib/pparser.h
+++ b/src/lib/netlist/plib/pparser.h
@@ -8,13 +8,13 @@
#ifndef PPARSER_H_
#define PPARSER_H_
-#include <cstdint>
-#include <unordered_map>
-
#include "plists.h"
#include "pstream.h"
#include "pstring.h"
+#include <cstdint>
+#include <unordered_map>
+
namespace plib {
class ptokenizer
diff --git a/src/lib/netlist/plib/ppmf.h b/src/lib/netlist/plib/ppmf.h
index 32b151b357b..9c5329cccde 100644
--- a/src/lib/netlist/plib/ppmf.h
+++ b/src/lib/netlist/plib/ppmf.h
@@ -8,11 +8,11 @@
#ifndef PPMF_H_
#define PPMF_H_
+#include "pconfig.h"
+
#include <cstdint>
#include <utility>
-#include "pconfig.h"
-
/*
*
* NL_PMF_TYPE_GNUC_PMF
diff --git a/src/lib/netlist/plib/pstream.cpp b/src/lib/netlist/plib/pstream.cpp
index 8f80f317f98..a7acdaafb52 100644
--- a/src/lib/netlist/plib/pstream.cpp
+++ b/src/lib/netlist/plib/pstream.cpp
@@ -268,55 +268,25 @@ pimemstream::pos_type pimemstream::vtell() const
// -----------------------------------------------------------------------------
pomemstream::pomemstream()
-: postream(FLAG_SEEKABLE), m_pos(0), m_capacity(1024), m_size(0)
+: postream(FLAG_SEEKABLE), m_pos(0), m_mem(1024)
{
- m_mem = pnew_array<char>(m_capacity);
-}
-
-pomemstream::~pomemstream()
-{
- if (m_mem != nullptr)
- pdelete_array(m_mem);
+ m_mem.clear();
}
void pomemstream::vwrite(const value_type *buf, const pos_type n)
{
- if (m_pos + n >= m_capacity)
- {
- while (m_pos + n >= m_capacity)
- m_capacity *= 2;
- char *o = m_mem;
- m_mem = pnew_array<char>(m_capacity);
- if (m_mem == nullptr)
- {
- throw out_of_mem_e("pomemstream::vwrite");
- }
- std::copy(o, o + m_pos, m_mem);
- pdelete_array(o);
- }
+ if (m_pos + n >= m_mem.size())
+ m_mem.resize(m_pos + n);
- std::copy(buf, buf + n, m_mem + m_pos);
+ std::copy(buf, buf + n, &m_mem[0] + m_pos);
m_pos += n;
- m_size = std::max(m_pos, m_size);
}
void pomemstream::vseek(const pos_type n)
{
m_pos = n;
- m_size = std::max(m_pos, m_size);
- if (m_size >= m_capacity)
- {
- while (m_size >= m_capacity)
- m_capacity *= 2;
- char *o = m_mem;
- m_mem = pnew_array<char>(m_capacity);
- if (m_mem == nullptr)
- {
- throw out_of_mem_e("pomemstream::vseek");
- }
- std::copy(o, o + m_pos, m_mem);
- pdelete_array(o);
- }
+ if (m_pos>=m_mem.size())
+ m_mem.resize(m_pos);
}
pstream::pos_type pomemstream::vtell() const
diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h
index aaccf577c4d..93497eb1423 100644
--- a/src/lib/netlist/plib/pstream.h
+++ b/src/lib/netlist/plib/pstream.h
@@ -7,9 +7,6 @@
#ifndef PSTREAM_H_
#define PSTREAM_H_
-#include <array>
-#include <type_traits>
-#include <vector>
#include "palloc.h"
#include "pconfig.h"
@@ -19,6 +16,9 @@
#define USE_CSTREAM (0)
+#include <array>
+#include <type_traits>
+#include <vector>
#if USE_CSTREAM
#include <fstream>
@@ -26,7 +26,6 @@
#include <sstream>
#endif
-
namespace plib {
#if USE_CSTREAM
@@ -180,18 +179,15 @@ public:
pomemstream(pomemstream &&src) noexcept
: postream(std::move(src))
, m_pos(src.m_pos)
- , m_capacity(src.m_capacity)
- , m_size(src.m_size)
- , m_mem(src.m_mem)
+ , m_mem(std::move(src.m_mem))
{
- src.m_mem = nullptr;
}
pomemstream &operator=(pomemstream &&src) = delete;
- ~pomemstream() override;
+ ~pomemstream() override = default;
- char *memory() const { return m_mem; }
- pos_type size() const { return m_size; }
+ const char *memory() const { return m_mem.data(); }
+ pos_type size() const { return m_mem.size(); }
protected:
/* write n bytes to stream */
@@ -201,9 +197,7 @@ protected:
private:
pos_type m_pos;
- pos_type m_capacity;
- pos_type m_size;
- char *m_mem;
+ std::vector<char> m_mem;
};
class postringstream : public postream
@@ -627,11 +621,10 @@ public:
{
std::size_t sz = 0;
read(sz);
- auto buf = plib::pnew_array<plib::string_info<pstring>::mem_t>(sz+1);
- m_strm.read(reinterpret_cast<pistream::value_type *>(buf), sz);
+ std::vector<plib::string_info<pstring>::mem_t> buf(sz+1);
+ m_strm.read(buf.data(), sz);
buf[sz] = 0;
- s = pstring(buf);
- plib::pdelete_array(buf);
+ s = pstring(buf.data());
}
template <typename T>
diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h
index 76ad11b0f91..64cb0604b69 100644
--- a/src/lib/netlist/plib/pstring.h
+++ b/src/lib/netlist/plib/pstring.h
@@ -7,6 +7,8 @@
#ifndef PSTRING_H_
#define PSTRING_H_
+#include "ptypes.h"
+
#include <cstring>
#include <exception>
#include <iterator>
@@ -15,8 +17,6 @@
#include <string>
#include <type_traits>
-#include "ptypes.h"
-
// ----------------------------------------------------------------------------------------
// pstring: semi-immutable strings ...
//
diff --git a/src/lib/netlist/plib/ptypes.h b/src/lib/netlist/plib/ptypes.h
index 6b4a4af2f75..bda62099150 100644
--- a/src/lib/netlist/plib/ptypes.h
+++ b/src/lib/netlist/plib/ptypes.h
@@ -8,12 +8,12 @@
#ifndef PTYPES_H_
#define PTYPES_H_
+#include "pconfig.h"
+
#include <limits>
#include <string>
#include <type_traits>
-#include "pconfig.h"
-
#define COPYASSIGNMOVE(name, def) \
name(const name &) = def; \
name(name &&) noexcept = def; \
@@ -120,8 +120,8 @@ namespace plib
static_assert(std::is_integral<N>::value, "gcd: N must be an integer");
return m == 0 ? plib::abs(n)
- : n == 0 ? plib::abs(m)
- : gcd(n, m % n);
+ : n == 0 ? plib::abs(m)
+ : gcd(n, m % n);
}
template<typename M, typename N>
diff --git a/src/lib/netlist/plib/vector_ops.h b/src/lib/netlist/plib/vector_ops.h
index 0de931b40da..880840e8707 100644
--- a/src/lib/netlist/plib/vector_ops.h
+++ b/src/lib/netlist/plib/vector_ops.h
@@ -10,12 +10,12 @@
#ifndef PLIB_VECTOR_OPS_H_
#define PLIB_VECTOR_OPS_H_
+#include "pconfig.h"
+
#include <algorithm>
#include <cmath>
#include <type_traits>
-#include "pconfig.h"
-
#if !defined(__clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
#if !(__GNUC__ > 7 || (__GNUC__ == 7 && __GNUC_MINOR__ > 3))
#pragma GCC diagnostic push
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp
index f9e25346493..784161a71a8 100644
--- a/src/lib/netlist/prg/nltool.cpp
+++ b/src/lib/netlist/prg/nltool.cpp
@@ -625,7 +625,7 @@ void tool_app_t::listdevices()
nt.setup().prepare_to_run();
- std::vector<netlist::poolptr<netlist::core_device_t>> devs;
+ std::vector<netlist::pool_owned_ptr<netlist::core_device_t>> devs;
for (auto & f : list)
{
diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp
index c4ddf152515..683bb8a1c55 100644
--- a/src/lib/netlist/prg/nlwav.cpp
+++ b/src/lib/netlist/prg/nlwav.cpp
@@ -6,9 +6,8 @@
#include "plib/pmain.h"
#include "plib/ppmf.h"
#include "plib/pstream.h"
-#include <cstring>
-
+#include <cstring>
/* From: https://ffmpeg.org/pipermail/ffmpeg-devel/2007-October/038122.html
* The most compatible way to make a wav header for unknown length is to put
@@ -24,12 +23,14 @@
class wav_t
{
public:
- // FIXME: Initialized in intialize, need better c++ compliance
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
+ // XXNOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
wav_t(plib::postream &strm, std::size_t sr, std::size_t channels)
: m_f(strm)
+ /* force "play" to play and warn about eof instead of being silent */
+ , m_fmt(static_cast<std::uint16_t>(channels), static_cast<std::uint32_t>(sr))
+ , m_data(m_f.seekable() ? 0 : 0xffffffff)
{
- initialize(sr, channels);
+
write(m_fh);
write(m_fmt);
write(m_data);
@@ -73,56 +74,44 @@ public:
private:
struct riff_chunk_t
{
- uint8_t group_id[4];
- uint32_t filelen;
- uint8_t rifftype[4];
+ uint8_t group_id[4] = {'R','I','F','F'};
+ uint32_t filelen = 0;
+ uint8_t rifftype[4] = {'W','A','V','E'};
};
struct riff_format_t
{
- uint8_t signature[4];
- uint32_t fmt_length;
- uint16_t format_tag;
+ riff_format_t(uint16_t achannels, uint32_t asample_rate)
+ {
+ channels = achannels;
+ sample_rate = asample_rate;
+ block_align = channels * ((bits_sample + 7) / 8);
+ bytes_per_second = sample_rate * block_align;
+ }
+ uint8_t signature[4] = {'f','m','t',' '};
+ uint32_t fmt_length = 16;
+ uint16_t format_tag = 0x0001; // PCM
uint16_t channels;
uint32_t sample_rate;
uint32_t bytes_per_second;
uint16_t block_align;
- uint16_t bits_sample;
+ uint16_t bits_sample = 16;
};
struct riff_data_t
{
- uint8_t signature[4];
+ riff_data_t(uint32_t alen) : len(alen) {}
+ uint8_t signature[4] = {'d','a','t','a'};
uint32_t len;
// data follows
};
- void initialize(std::size_t sr, std::size_t channels)
- {
- std::memcpy(m_fh.group_id, "RIFF", 4);
- m_fh.filelen = 0x0; // Fixme
- std::memcpy(m_fh.rifftype, "WAVE", 4);
-
- std::memcpy(m_fmt.signature, "fmt ", 4);
- m_fmt.fmt_length = 16;
- m_fmt.format_tag = 0x0001; //PCM
- m_fmt.channels = static_cast<std::uint16_t>(channels);
- m_fmt.sample_rate = static_cast<std::uint32_t>(sr);
- m_fmt.bits_sample = 16;
- m_fmt.block_align = m_fmt.channels * ((m_fmt.bits_sample + 7) / 8);
- m_fmt.bytes_per_second = m_fmt.sample_rate * m_fmt.block_align;
-
- std::memcpy(m_data.signature, "data", 4);
- //m_data.len = m_fmt.bytes_per_second * 2 * 0;
- /* force "play" to play and warn about eof instead of being silent */
- m_data.len = (m_f.seekable() ? 0 : 0xffffffff);
- }
+ plib::postream &m_f;
riff_chunk_t m_fh;
riff_format_t m_fmt;
riff_data_t m_data;
- plib::postream &m_f;
};
class log_processor
@@ -305,7 +294,7 @@ public:
ANALOG
};
- vcdwriter(plib::postream &fo, std::vector<pstring> channels,
+ vcdwriter(plib::postream &fo, const std::vector<pstring> &channels,
format_e format, double high_level = 2.0, double low_level = 1.0)
: m_channels(channels.size())
, m_last_time(0)
diff --git a/src/lib/netlist/solver/nld_matrix_solver.cpp b/src/lib/netlist/solver/nld_matrix_solver.cpp
index 756c7817c03..1fe14b0f5e1 100644
--- a/src/lib/netlist/solver/nld_matrix_solver.cpp
+++ b/src/lib/netlist/solver/nld_matrix_solver.cpp
@@ -227,7 +227,7 @@ namespace devices
for (std::size_t i = 0; i < term->count(); i++)
//FIXME: this is weird
if (other[i] != -1)
- other[i] = get_net_idx(&term->terms()[i]->otherterm()->net());
+ other[i] = get_net_idx(&term->terms()[i]->connected_terminal()->net());
}
}
@@ -491,7 +491,7 @@ namespace devices
for (std::size_t i = 0; i < term->count(); i++)
{
- auto col = get_net_idx(&term->terms()[i]->otherterm()->net());
+ auto col = get_net_idx(&term->terms()[i]->connected_terminal()->net());
if (col != -1)
{
if (col==row) col = diag;
@@ -519,7 +519,7 @@ namespace devices
auto &term = m_terms[row];
for (std::size_t i = 0; i < term->count(); i++)
{
- auto col = get_net_idx(&term->terms()[i]->otherterm()->net());
+ auto col = get_net_idx(&term->terms()[i]->connected_terminal()->net());
if (col >= 0)
{
auto colu = static_cast<std::size_t>(col);
@@ -537,16 +537,15 @@ namespace devices
}
}
-
void matrix_solver_t::add_term(std::size_t k, terminal_t *term)
{
- if (term->otherterm()->net().isRailNet())
+ if (term->connected_terminal()->net().isRailNet())
{
m_rails_temp[k]->add(term, -1, false);
}
else
{
- int ot = get_net_idx(&term->otherterm()->net());
+ int ot = get_net_idx(&term->connected_terminal()->net());
if (ot>=0)
{
m_terms[k]->add(term, ot, true);
@@ -603,8 +602,6 @@ namespace devices
return std::max(netlist_time::from_double(new_solver_timestep), netlist_time::quantum() * 2);
}
-
-
void matrix_solver_t::log_stats()
{
if (this->m_stat_calculations != 0 && this->m_stat_vsolver_calls && this->m_params.m_log_stats)
@@ -626,7 +623,6 @@ namespace devices
}
}
-
} // namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/solver/nld_matrix_solver.h b/src/lib/netlist/solver/nld_matrix_solver.h
index e4cff24c43a..f76660e1cb9 100644
--- a/src/lib/netlist/solver/nld_matrix_solver.h
+++ b/src/lib/netlist/solver/nld_matrix_solver.h
@@ -85,7 +85,6 @@ namespace devices
analog_net_t *m_proxied_net; // only for proxy nets in analog input logic
};
-
class matrix_solver_t : public device_t
{
public:
@@ -193,7 +192,7 @@ namespace devices
for (std::size_t i = 0; i < count; i++)
{
m_terms[k]->terms()[i]->set_ptrs(&m_gtn[k][i], &m_gonn[k][i], &m_Idrn[k][i]);
- m_connected_net_Vn[k][i] = m_terms[k]->terms()[i]->otherterm()->net().Q_Analog_state_ptr();
+ m_connected_net_Vn[k][i] = m_terms[k]->terms()[i]->connected_terminal()->net().Q_Analog_state_ptr();
}
}
}
@@ -255,7 +254,7 @@ namespace devices
std::vector<plib::unique_ptr<terms_for_net_t>> m_terms;
std::vector<analog_net_t *> m_nets;
- std::vector<poolptr<proxied_analog_output_t>> m_inps;
+ std::vector<pool_owned_ptr<proxied_analog_output_t>> m_inps;
std::vector<plib::unique_ptr<terms_for_net_t>> m_rails_temp;
diff --git a/src/lib/netlist/solver/nld_ms_direct.h b/src/lib/netlist/solver/nld_ms_direct.h
index 0e3cd677ef7..35858363a33 100644
--- a/src/lib/netlist/solver/nld_ms_direct.h
+++ b/src/lib/netlist/solver/nld_ms_direct.h
@@ -8,230 +8,228 @@
#ifndef NLD_MS_DIRECT_H_
#define NLD_MS_DIRECT_H_
+#include "nld_matrix_solver.h"
+#include "nld_solver.h"
#include "plib/mat_cr.h"
#include "plib/vector_ops.h"
+
#include <algorithm>
#include <cmath>
-#include "nld_matrix_solver.h"
-#include "nld_solver.h"
-
namespace netlist
{
namespace devices
{
-template <typename FT, int SIZE>
-class matrix_solver_direct_t: public matrix_solver_t
-{
- friend class matrix_solver_t;
-public:
-
- using float_type = FT;
+ template <typename FT, int SIZE>
+ class matrix_solver_direct_t: public matrix_solver_t
+ {
+ friend class matrix_solver_t;
+ public:
- matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, const std::size_t size);
- matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const eSortType sort, const solver_parameters_t *params, const std::size_t size);
+ using float_type = FT;
- void vsetup(analog_net_t::list_t &nets) override;
- void reset() override { matrix_solver_t::reset(); }
+ matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, const std::size_t size);
+ matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const eSortType sort, const solver_parameters_t *params, const std::size_t size);
-protected:
- unsigned vsolve_non_dynamic(const bool newton_raphson) override;
- unsigned solve_non_dynamic(const bool newton_raphson);
+ void vsetup(analog_net_t::list_t &nets) override;
+ void reset() override { matrix_solver_t::reset(); }
- constexpr std::size_t size() const { return (SIZE > 0) ? static_cast<std::size_t>(SIZE) : m_dim; }
+ protected:
+ unsigned vsolve_non_dynamic(const bool newton_raphson) override;
+ unsigned solve_non_dynamic(const bool newton_raphson);
- void LE_solve();
+ constexpr std::size_t size() const { return (SIZE > 0) ? static_cast<std::size_t>(SIZE) : m_dim; }
- template <typename T>
- void LE_back_subst(T & x);
+ void LE_solve();
- FT &A(std::size_t r, std::size_t c) { return m_A[r * m_pitch + c]; }
- FT &RHS(std::size_t r) { return m_A[r * m_pitch + size()]; }
- plib::parray<FT, SIZE> m_new_V;
+ template <typename T>
+ void LE_back_subst(T & x);
-private:
- static constexpr const std::size_t SIZEABS = plib::parray<FT, SIZE>::SIZEABS();
- static constexpr const std::size_t m_pitch_ABS = (((SIZEABS + 1) + 7) / 8) * 8;
+ FT &A(std::size_t r, std::size_t c) { return m_A[r * m_pitch + c]; }
+ FT &RHS(std::size_t r) { return m_A[r * m_pitch + size()]; }
+ plib::parray<FT, SIZE> m_new_V;
- const std::size_t m_dim;
- const std::size_t m_pitch;
- plib::parray<FT, SIZE * int(m_pitch_ABS)> m_A;
+ private:
+ static constexpr const std::size_t SIZEABS = plib::parray<FT, SIZE>::SIZEABS();
+ static constexpr const std::size_t m_pitch_ABS = (((SIZEABS + 1) + 7) / 8) * 8;
-};
+ const std::size_t m_dim;
+ const std::size_t m_pitch;
+ plib::parray<FT, SIZE * int(m_pitch_ABS)> m_A;
-// ----------------------------------------------------------------------------------------
-// matrix_solver_direct
-// ----------------------------------------------------------------------------------------
+ };
-template <typename FT, int SIZE>
-void matrix_solver_direct_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
-{
- matrix_solver_t::setup_base(nets);
+ // ----------------------------------------------------------------------------------------
+ // matrix_solver_direct
+ // ----------------------------------------------------------------------------------------
- /* add RHS element */
- for (std::size_t k = 0; k < size(); k++)
+ template <typename FT, int SIZE>
+ void matrix_solver_direct_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
{
- terms_for_net_t * t = m_terms[k].get();
+ matrix_solver_t::setup_base(nets);
- if (!plib::container::contains(t->m_nzrd, static_cast<unsigned>(size())))
- t->m_nzrd.push_back(static_cast<unsigned>(size()));
- }
+ /* add RHS element */
+ for (std::size_t k = 0; k < size(); k++)
+ {
+ terms_for_net_t * t = m_terms[k].get();
- // FIXME: This shouldn't be necessary ...
- for (std::size_t k = 0; k < size(); k++)
- state().save(*this, RHS(k), this->name(), plib::pfmt("RHS.{1}")(k));
-}
+ if (!plib::container::contains(t->m_nzrd, static_cast<unsigned>(size())))
+ t->m_nzrd.push_back(static_cast<unsigned>(size()));
+ }
+ // FIXME: This shouldn't be necessary ...
+ for (std::size_t k = 0; k < size(); k++)
+ state().save(*this, RHS(k), this->name(), plib::pfmt("RHS.{1}")(k));
+ }
-template <typename FT, int SIZE>
-void matrix_solver_direct_t<FT, SIZE>::LE_solve()
-{
- const std::size_t kN = size();
- if (!m_params.m_pivot)
+ template <typename FT, int SIZE>
+ void matrix_solver_direct_t<FT, SIZE>::LE_solve()
{
- for (std::size_t i = 0; i < kN; i++)
+ const std::size_t kN = size();
+ if (!m_params.m_pivot)
{
- /* FIXME: Singular matrix? */
- const FT f = 1.0 / A(i,i);
- const auto &nzrd = m_terms[i]->m_nzrd;
- const auto &nzbd = m_terms[i]->m_nzbd;
-
- for (std::size_t j : nzbd)
+ for (std::size_t i = 0; i < kN; i++)
{
- const FT f1 = -f * A(j, i);
- for (std::size_t k : nzrd)
- A(j, k) += A(i, k) * f1;
- //RHS(j) += RHS(i) * f1;
+ /* FIXME: Singular matrix? */
+ const FT f = 1.0 / A(i,i);
+ const auto &nzrd = m_terms[i]->m_nzrd;
+ const auto &nzbd = m_terms[i]->m_nzbd;
+
+ for (std::size_t j : nzbd)
+ {
+ const FT f1 = -f * A(j, i);
+ for (std::size_t k : nzrd)
+ A(j, k) += A(i, k) * f1;
+ //RHS(j) += RHS(i) * f1;
+ }
}
}
- }
- else
- {
- for (std::size_t i = 0; i < kN; i++)
+ else
{
- /* Find the row with the largest first value */
- std::size_t maxrow = i;
- for (std::size_t j = i + 1; j < kN; j++)
+ for (std::size_t i = 0; i < kN; i++)
{
- //if (std::abs(m_A[j][i]) > std::abs(m_A[maxrow][i]))
- if (A(j,i) * A(j,i) > A(maxrow,i) * A(maxrow,i))
- maxrow = j;
- }
+ /* Find the row with the largest first value */
+ std::size_t maxrow = i;
+ for (std::size_t j = i + 1; j < kN; j++)
+ {
+ //if (std::abs(m_A[j][i]) > std::abs(m_A[maxrow][i]))
+ if (A(j,i) * A(j,i) > A(maxrow,i) * A(maxrow,i))
+ maxrow = j;
+ }
- if (maxrow != i)
- {
- /* Swap the maxrow and ith row */
- for (std::size_t k = 0; k < kN + 1; k++) {
- std::swap(A(i,k), A(maxrow,k));
+ if (maxrow != i)
+ {
+ /* Swap the maxrow and ith row */
+ for (std::size_t k = 0; k < kN + 1; k++) {
+ std::swap(A(i,k), A(maxrow,k));
+ }
+ //std::swap(RHS(i), RHS(maxrow));
}
- //std::swap(RHS(i), RHS(maxrow));
- }
- /* FIXME: Singular matrix? */
- const FT f = 1.0 / A(i,i);
+ /* FIXME: Singular matrix? */
+ const FT f = 1.0 / A(i,i);
- /* Eliminate column i from row j */
+ /* Eliminate column i from row j */
- for (std::size_t j = i + 1; j < kN; j++)
- {
- const FT f1 = - A(j,i) * f;
- if (f1 != plib::constants<FT>::zero())
+ for (std::size_t j = i + 1; j < kN; j++)
{
- const FT * pi = &A(i,i+1);
- FT * pj = &A(j,i+1);
-#if 1
- plib::vec_add_mult_scalar_p(kN-i,pi,f1,pj);
-#else
- vec_add_mult_scalar_p(kN-i-1,pj,f1,pi);
- //for (unsigned k = i+1; k < kN; k++)
- // pj[k] = pj[k] + pi[k] * f1;
- //for (unsigned k = i+1; k < kN; k++)
- //A(j,k) += A(i,k) * f1;
- RHS(j) += RHS(i) * f1;
-#endif
+ const FT f1 = - A(j,i) * f;
+ if (f1 != plib::constants<FT>::zero())
+ {
+ const FT * pi = &A(i,i+1);
+ FT * pj = &A(j,i+1);
+ #if 1
+ plib::vec_add_mult_scalar_p(kN-i,pi,f1,pj);
+ #else
+ vec_add_mult_scalar_p(kN-i-1,pj,f1,pi);
+ //for (unsigned k = i+1; k < kN; k++)
+ // pj[k] = pj[k] + pi[k] * f1;
+ //for (unsigned k = i+1; k < kN; k++)
+ //A(j,k) += A(i,k) * f1;
+ RHS(j) += RHS(i) * f1;
+ #endif
+ }
}
}
}
}
-}
-
-template <typename FT, int SIZE>
-template <typename T>
-void matrix_solver_direct_t<FT, SIZE>::LE_back_subst(
- T & x)
-{
- const std::size_t kN = size();
- /* back substitution */
- if (m_params.m_pivot)
+ template <typename FT, int SIZE>
+ template <typename T>
+ void matrix_solver_direct_t<FT, SIZE>::LE_back_subst(
+ T & x)
{
- for (std::size_t j = kN; j-- > 0; )
+ const std::size_t kN = size();
+
+ /* back substitution */
+ if (m_params.m_pivot)
{
- FT tmp = 0;
- for (std::size_t k = j+1; k < kN; k++)
- tmp += A(j,k) * x[k];
- x[j] = (RHS(j) - tmp) / A(j,j);
+ for (std::size_t j = kN; j-- > 0; )
+ {
+ FT tmp = 0;
+ for (std::size_t k = j+1; k < kN; k++)
+ tmp += A(j,k) * x[k];
+ x[j] = (RHS(j) - tmp) / A(j,j);
+ }
}
- }
- else
- {
- for (std::size_t j = kN; j-- > 0; )
+ else
{
- FT tmp = 0;
- const auto &nzrd = m_terms[j]->m_nzrd;
- const auto e = nzrd.size() - 1; /* exclude RHS element */
- for ( std::size_t k = 0; k < e; k++)
- tmp += A(j, nzrd[k]) * x[nzrd[k]];
- x[j] = (RHS(j) - tmp) / A(j,j);
+ for (std::size_t j = kN; j-- > 0; )
+ {
+ FT tmp = 0;
+ const auto &nzrd = m_terms[j]->m_nzrd;
+ const auto e = nzrd.size() - 1; /* exclude RHS element */
+ for ( std::size_t k = 0; k < e; k++)
+ tmp += A(j, nzrd[k]) * x[nzrd[k]];
+ x[j] = (RHS(j) - tmp) / A(j,j);
+ }
}
}
-}
+ template <typename FT, int SIZE>
+ unsigned matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson)
+ {
+ this->LE_solve();
+ this->LE_back_subst(m_new_V);
+
+ const FT err = (newton_raphson ? delta(m_new_V) : 0.0);
+ store(m_new_V);
+ return (err > this->m_params.m_accuracy) ? 2 : 1;
+ }
+
+ template <typename FT, int SIZE>
+ unsigned matrix_solver_direct_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
+ {
+ this->build_LE_A(*this);
+ this->build_LE_RHS(*this);
-template <typename FT, int SIZE>
-unsigned matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson)
-{
- this->LE_solve();
- this->LE_back_subst(m_new_V);
+ this->m_stat_calculations++;
+ return this->solve_non_dynamic(newton_raphson);
+ }
- const FT err = (newton_raphson ? delta(m_new_V) : 0.0);
- store(m_new_V);
- return (err > this->m_params.m_accuracy) ? 2 : 1;
-}
+ template <typename FT, int SIZE>
+ matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name,
+ const solver_parameters_t *params, const std::size_t size)
+ : matrix_solver_t(anetlist, name, ASCENDING, params)
+ , m_new_V(size)
+ , m_dim(size)
+ , m_pitch(m_pitch_ABS ? m_pitch_ABS : (((m_dim + 1) + 7) / 8) * 8)
+ , m_A(size * m_pitch)
+ {
+ }
-template <typename FT, int SIZE>
-unsigned matrix_solver_direct_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
-{
- this->build_LE_A(*this);
- this->build_LE_RHS(*this);
-
- this->m_stat_calculations++;
- return this->solve_non_dynamic(newton_raphson);
-}
-
-template <typename FT, int SIZE>
-matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name,
- const solver_parameters_t *params, const std::size_t size)
-: matrix_solver_t(anetlist, name, ASCENDING, params)
-, m_new_V(size)
-, m_dim(size)
-, m_pitch(m_pitch_ABS ? m_pitch_ABS : (((m_dim + 1) + 7) / 8) * 8)
-, m_A(size * m_pitch)
-{
-}
-
-template <typename FT, int SIZE>
-matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name,
- const eSortType sort, const solver_parameters_t *params, const std::size_t size)
-: matrix_solver_t(anetlist, name, sort, params)
-, m_new_V(size)
-, m_dim(size)
-, m_pitch(m_pitch_ABS ? m_pitch_ABS : (((m_dim + 1) + 7) / 8) * 8)
-, m_A(size * m_pitch)
-{
-}
+ template <typename FT, int SIZE>
+ matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name,
+ const eSortType sort, const solver_parameters_t *params, const std::size_t size)
+ : matrix_solver_t(anetlist, name, sort, params)
+ , m_new_V(size)
+ , m_dim(size)
+ , m_pitch(m_pitch_ABS ? m_pitch_ABS : (((m_dim + 1) + 7) / 8) * 8)
+ , m_A(size * m_pitch)
+ {
+ }
- } //namespace devices
+} // namespace devices
} // namespace netlist
#endif /* NLD_MS_DIRECT_H_ */
diff --git a/src/lib/netlist/solver/nld_ms_direct2.h b/src/lib/netlist/solver/nld_ms_direct2.h
index a4ff7e75546..1e7103f8672 100644
--- a/src/lib/netlist/solver/nld_ms_direct2.h
+++ b/src/lib/netlist/solver/nld_ms_direct2.h
@@ -16,6 +16,10 @@ namespace netlist
namespace devices
{
+ // ----------------------------------------------------------------------------------------
+ // matrix_solver - Direct2
+ // ----------------------------------------------------------------------------------------
+
template <typename FT>
class matrix_solver_direct2_t: public matrix_solver_direct_t<FT, 2>
{
@@ -26,33 +30,26 @@ namespace devices
matrix_solver_direct2_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params)
: matrix_solver_direct_t<double, 2>(anetlist, name, params, 2)
{}
- unsigned vsolve_non_dynamic(const bool newton_raphson) override;
+ unsigned vsolve_non_dynamic(const bool newton_raphson) override
+ {
+ this->build_LE_A(*this);
+ this->build_LE_RHS(*this);
- };
+ const float_type a = this->A(0,0);
+ const float_type b = this->A(0,1);
+ const float_type c = this->A(1,0);
+ const float_type d = this->A(1,1);
- // ----------------------------------------------------------------------------------------
- // matrix_solver - Direct2
- // ----------------------------------------------------------------------------------------
+ const float_type v1 = (a * this->RHS(1) - c * this->RHS(0)) / (a * d - b * c);
+ const float_type v0 = (this->RHS(0) - b * v1) / a;
+ std::array<float_type, 2> new_V = {v0, v1};
- template <typename FT>
- inline unsigned matrix_solver_direct2_t<FT>::vsolve_non_dynamic(const bool newton_raphson)
- {
- this->build_LE_A(*this);
- this->build_LE_RHS(*this);
-
- const float_type a = this->A(0,0);
- const float_type b = this->A(0,1);
- const float_type c = this->A(1,0);
- const float_type d = this->A(1,1);
-
- const float_type v1 = (a * this->RHS(1) - c * this->RHS(0)) / (a * d - b * c);
- const float_type v0 = (this->RHS(0) - b * v1) / a;
- std::array<float_type, 2> new_V = {v0, v1};
-
- const float_type err = (newton_raphson ? this->delta(new_V) : 0.0);
- this->store(new_V);
- return (err > this->m_params.m_accuracy) ? 2 : 1;
- }
+ const float_type err = (newton_raphson ? this->delta(new_V) : 0.0);
+ this->store(new_V);
+ return (err > this->m_params.m_accuracy) ? 2 : 1;
+ }
+
+ };
} //namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/solver/nld_ms_direct_lu.h b/src/lib/netlist/solver/nld_ms_direct_lu.h
index 86ddf015807..e7cedc1dd29 100644
--- a/src/lib/netlist/solver/nld_ms_direct_lu.h
+++ b/src/lib/netlist/solver/nld_ms_direct_lu.h
@@ -8,11 +8,11 @@
#ifndef NLD_MS_DIRECT_H_
#define NLD_MS_DIRECT_H_
-#include <algorithm>
-
#include "solver/nld_solver.h"
#include "solver/nld_matrix_solver.h"
+#include <algorithm>
+
//#define A(r, c) m_A[_r][_c]
namespace netlist
diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h
index 19dea107bc9..f3e56a342d6 100644
--- a/src/lib/netlist/solver/nld_ms_gcr.h
+++ b/src/lib/netlist/solver/nld_ms_gcr.h
@@ -25,302 +25,301 @@ namespace netlist
namespace devices
{
-template <typename FT, int SIZE>
-class matrix_solver_GCR_t: public matrix_solver_t
-{
-public:
-
- using mat_type = plib::matrix_compressed_rows_t<FT, SIZE>;
- // FIXME: dirty hack to make this compile
- static constexpr const std::size_t storage_N = 100;
-
- matrix_solver_GCR_t(netlist_state_t &anetlist, const pstring &name,
- const solver_parameters_t *params, const std::size_t size)
- : matrix_solver_t(anetlist, name, matrix_solver_t::PREFER_IDENTITY_TOP_LEFT, params)
- , m_dim(size)
- , RHS(size)
- , new_V(size)
- , mat(static_cast<typename mat_type::index_type>(size))
- , m_proc()
- {
- }
+ template <typename FT, int SIZE>
+ class matrix_solver_GCR_t: public matrix_solver_t
+ {
+ public:
+
+ using mat_type = plib::matrix_compressed_rows_t<FT, SIZE>;
+ // FIXME: dirty hack to make this compile
+ static constexpr const std::size_t storage_N = 100;
+
+ matrix_solver_GCR_t(netlist_state_t &anetlist, const pstring &name,
+ const solver_parameters_t *params, const std::size_t size)
+ : matrix_solver_t(anetlist, name, matrix_solver_t::PREFER_IDENTITY_TOP_LEFT, params)
+ , m_dim(size)
+ , RHS(size)
+ , new_V(size)
+ , mat(static_cast<typename mat_type::index_type>(size))
+ , m_proc()
+ {
+ }
- constexpr std::size_t N() const { return m_dim; }
+ constexpr std::size_t N() const { return m_dim; }
- void vsetup(analog_net_t::list_t &nets) override;
- unsigned vsolve_non_dynamic(const bool newton_raphson) override;
+ void vsetup(analog_net_t::list_t &nets) override;
+ unsigned vsolve_non_dynamic(const bool newton_raphson) override;
- std::pair<pstring, pstring> create_solver_code() override;
+ std::pair<pstring, pstring> create_solver_code() override;
-private:
+ private:
- using mat_index_type = typename plib::matrix_compressed_rows_t<FT, SIZE>::index_type;
+ using mat_index_type = typename plib::matrix_compressed_rows_t<FT, SIZE>::index_type;
- void csc_private(plib::putf8_fmt_writer &strm);
+ void csc_private(plib::putf8_fmt_writer &strm);
- using extsolver = void (*)(double * m_A, double * RHS, double * V);
+ using extsolver = void (*)(double * m_A, double * RHS, double * V);
- pstring static_compile_name();
+ pstring static_compile_name();
- const std::size_t m_dim;
- plib::parray<FT, SIZE> RHS;
- plib::parray<FT, SIZE> new_V;
+ const std::size_t m_dim;
+ plib::parray<FT, SIZE> RHS;
+ plib::parray<FT, SIZE> new_V;
- mat_type mat;
+ mat_type mat;
- //extsolver m_proc;
- plib::dynproc<void, double * , double * , double * > m_proc;
+ //extsolver m_proc;
+ plib::dynproc<void, double * , double * , double * > m_proc;
-};
+ };
-// ----------------------------------------------------------------------------------------
-// matrix_solver - GCR
-// ----------------------------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------------
+ // matrix_solver - GCR
+ // ----------------------------------------------------------------------------------------
-// FIXME: namespace or static class member
-template <typename V>
-std::size_t inline get_level(const V &v, std::size_t k)
-{
- for (std::size_t i = 0; i < v.size(); i++)
- if (plib::container::contains(v[i], k))
- return i;
- throw plib::pexception("Error in get_level");
-}
-
-template <typename FT, int SIZE>
-void matrix_solver_GCR_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
-{
- setup_base(nets);
+ // FIXME: namespace or static class member
+ template <typename V>
+ std::size_t inline get_level(const V &v, std::size_t k)
+ {
+ for (std::size_t i = 0; i < v.size(); i++)
+ if (plib::container::contains(v[i], k))
+ return i;
+ throw plib::pexception("Error in get_level");
+ }
- const std::size_t iN = this->N();
+ template <typename FT, int SIZE>
+ void matrix_solver_GCR_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
+ {
+ setup_base(nets);
- /* build the final matrix */
+ const std::size_t iN = this->N();
- std::vector<std::vector<unsigned>> fill(iN);
+ /* build the final matrix */
- std::size_t raw_elements = 0;
+ std::vector<std::vector<unsigned>> fill(iN);
- for (std::size_t k = 0; k < iN; k++)
- {
- fill[k].resize(iN, decltype(mat)::FILL_INFINITY);
- for (auto &j : this->m_terms[k]->m_nz)
+ std::size_t raw_elements = 0;
+
+ for (std::size_t k = 0; k < iN; k++)
{
- fill[k][j] = 0;
- raw_elements++;
- }
+ fill[k].resize(iN, decltype(mat)::FILL_INFINITY);
+ for (auto &j : this->m_terms[k]->m_nz)
+ {
+ fill[k][j] = 0;
+ raw_elements++;
+ }
- }
+ }
- auto gr = mat.gaussian_extend_fill_mat(fill);
+ auto gr = mat.gaussian_extend_fill_mat(fill);
- /* FIXME: move this to the cr matrix class and use computed
- * parallel ordering once it makes sense.
- */
+ /* FIXME: move this to the cr matrix class and use computed
+ * parallel ordering once it makes sense.
+ */
- std::vector<unsigned> levL(iN, 0);
- std::vector<unsigned> levU(iN, 0);
+ std::vector<unsigned> levL(iN, 0);
+ std::vector<unsigned> levU(iN, 0);
- // parallel scheme for L x = y
- for (std::size_t k = 0; k < iN; k++)
- {
- unsigned lm=0;
- for (std::size_t j = 0; j<k; j++)
- if (fill[k][j] < decltype(mat)::FILL_INFINITY)
- lm = std::max(lm, levL[j]);
- levL[k] = 1+lm;
- }
+ // parallel scheme for L x = y
+ for (std::size_t k = 0; k < iN; k++)
+ {
+ unsigned lm=0;
+ for (std::size_t j = 0; j<k; j++)
+ if (fill[k][j] < decltype(mat)::FILL_INFINITY)
+ lm = std::max(lm, levL[j]);
+ levL[k] = 1+lm;
+ }
- // parallel scheme for U x = y
- for (std::size_t k = iN; k-- > 0; )
- {
- unsigned lm=0;
- for (std::size_t j = iN; --j > k; )
- if (fill[k][j] < decltype(mat)::FILL_INFINITY)
- lm = std::max(lm, levU[j]);
- levU[k] = 1+lm;
- }
+ // parallel scheme for U x = y
+ for (std::size_t k = iN; k-- > 0; )
+ {
+ unsigned lm=0;
+ for (std::size_t j = iN; --j > k; )
+ if (fill[k][j] < decltype(mat)::FILL_INFINITY)
+ lm = std::max(lm, levU[j]);
+ levU[k] = 1+lm;
+ }
- for (std::size_t k = 0; k < iN; k++)
- {
- unsigned fm = 0;
- pstring ml = "";
- for (std::size_t j = 0; j < iN; j++)
+ for (std::size_t k = 0; k < iN; k++)
{
- ml += fill[k][j] == 0 ? "X" : fill[k][j] < decltype(mat)::FILL_INFINITY ? "+" : ".";
- if (fill[k][j] < decltype(mat)::FILL_INFINITY)
- if (fill[k][j] > fm)
- fm = fill[k][j];
+ unsigned fm = 0;
+ pstring ml = "";
+ for (std::size_t j = 0; j < iN; j++)
+ {
+ ml += fill[k][j] == 0 ? "X" : fill[k][j] < decltype(mat)::FILL_INFINITY ? "+" : ".";
+ if (fill[k][j] < decltype(mat)::FILL_INFINITY)
+ if (fill[k][j] > fm)
+ fm = fill[k][j];
+ }
+ this->log().verbose("{1:4} {2} {3:4} {4:4} {5:4} {6:4}", k, ml, levL[k], levU[k], get_level(mat.m_ge_par, k), fm);
}
- this->log().verbose("{1:4} {2} {3:4} {4:4} {5:4} {6:4}", k, ml, levL[k], levU[k], get_level(mat.m_ge_par, k), fm);
- }
- mat.build_from_fill_mat(fill);
+ mat.build_from_fill_mat(fill);
- for (mat_index_type k=0; k<iN; k++)
- {
- std::size_t cnt(0);
- /* build pointers into the compressed row format matrix for each terminal */
- for (std::size_t j=0; j< this->m_terms[k]->m_railstart;j++)
+ for (mat_index_type k=0; k<iN; k++)
{
- int other = this->m_terms[k]->m_connected_net_idx[j];
- for (auto i = mat.row_idx[k]; i < mat.row_idx[k+1]; i++)
- if (other == static_cast<int>(mat.col_idx[i]))
- {
- m_mat_ptr[k][j] = &mat.A[i];
- cnt++;
- break;
- }
+ std::size_t cnt(0);
+ /* build pointers into the compressed row format matrix for each terminal */
+ for (std::size_t j=0; j< this->m_terms[k]->m_railstart;j++)
+ {
+ int other = this->m_terms[k]->m_connected_net_idx[j];
+ for (auto i = mat.row_idx[k]; i < mat.row_idx[k+1]; i++)
+ if (other == static_cast<int>(mat.col_idx[i]))
+ {
+ m_mat_ptr[k][j] = &mat.A[i];
+ cnt++;
+ break;
+ }
+ }
+ nl_assert(cnt == this->m_terms[k]->m_railstart);
+ m_mat_ptr[k][this->m_terms[k]->m_railstart] = &mat.A[mat.diag[k]];
}
- nl_assert(cnt == this->m_terms[k]->m_railstart);
- m_mat_ptr[k][this->m_terms[k]->m_railstart] = &mat.A[mat.diag[k]];
- }
- this->log().verbose("maximum fill: {1}", gr.first);
- this->log().verbose("Post elimination occupancy ratio: {2} Ops: {1}", gr.second,
- static_cast<double>(mat.nz_num) / static_cast<double>(iN * iN));
- this->log().verbose(" Pre elimination occupancy ratio: {2}",
- static_cast<double>(raw_elements) / static_cast<double>(iN * iN));
+ this->log().verbose("maximum fill: {1}", gr.first);
+ this->log().verbose("Post elimination occupancy ratio: {2} Ops: {1}", gr.second,
+ static_cast<double>(mat.nz_num) / static_cast<double>(iN * iN));
+ this->log().verbose(" Pre elimination occupancy ratio: {2}",
+ static_cast<double>(raw_elements) / static_cast<double>(iN * iN));
- // FIXME: Move me
+ // FIXME: Move me
- if (state().lib().isLoaded())
- {
- pstring symname = static_compile_name();
- m_proc.load(this->state().lib(), symname);
- if (m_proc.resolved())
- this->log().warning("External static solver {1} found ...", symname);
- else
- this->log().warning("External static solver {1} not found ...", symname);
- }
-
-}
-
-template <typename FT, int SIZE>
-void matrix_solver_GCR_t<FT, SIZE>::csc_private(plib::putf8_fmt_writer &strm)
-{
- const std::size_t iN = N();
+ if (state().lib().isLoaded())
+ {
+ pstring symname = static_compile_name();
+ m_proc.load(this->state().lib(), symname);
+ if (m_proc.resolved())
+ this->log().warning("External static solver {1} found ...", symname);
+ else
+ this->log().warning("External static solver {1} not found ...", symname);
+ }
- for (std::size_t i = 0; i < mat.nz_num; i++)
- strm("double m_A{1} = m_A[{2}];\n", i, i);
+ }
- for (std::size_t i = 0; i < iN - 1; i++)
+ template <typename FT, int SIZE>
+ void matrix_solver_GCR_t<FT, SIZE>::csc_private(plib::putf8_fmt_writer &strm)
{
- const auto &nzbd = this->m_terms[i]->m_nzbd;
+ const std::size_t iN = N();
- if (nzbd.size() > 0)
- {
- std::size_t pi = mat.diag[i];
+ for (std::size_t i = 0; i < mat.nz_num; i++)
+ strm("double m_A{1} = m_A[{2}];\n", i, i);
- //const FT f = 1.0 / m_A[pi++];
- strm("const double f{1} = 1.0 / m_A{2};\n", i, pi);
- pi++;
- const std::size_t piie = mat.row_idx[i+1];
+ for (std::size_t i = 0; i < iN - 1; i++)
+ {
+ const auto &nzbd = this->m_terms[i]->m_nzbd;
- //for (auto & j : nzbd)
- for (std::size_t j : nzbd)
+ if (nzbd.size() > 0)
{
- // proceed to column i
- std::size_t pj = mat.row_idx[j];
+ std::size_t pi = mat.diag[i];
- while (mat.col_idx[pj] < i)
- pj++;
+ //const FT f = 1.0 / m_A[pi++];
+ strm("const double f{1} = 1.0 / m_A{2};\n", i, pi);
+ pi++;
+ const std::size_t piie = mat.row_idx[i+1];
- //const FT f1 = - m_A[pj++] * f;
- strm("\tconst double f{1}_{2} = -f{3} * m_A{4};\n", i, j, i, pj);
- pj++;
-
- // subtract row i from j */
- for (std::size_t pii = pi; pii<piie; )
+ //for (auto & j : nzbd)
+ for (std::size_t j : nzbd)
{
- while (mat.col_idx[pj] < mat.col_idx[pii])
+ // proceed to column i
+ std::size_t pj = mat.row_idx[j];
+
+ while (mat.col_idx[pj] < i)
pj++;
- //m_A[pj++] += m_A[pii++] * f1;
- strm("\tm_A{1} += m_A{2} * f{3}_{4};\n", pj, pii, i, j);
- pj++; pii++;
+
+ //const FT f1 = - m_A[pj++] * f;
+ strm("\tconst double f{1}_{2} = -f{3} * m_A{4};\n", i, j, i, pj);
+ pj++;
+
+ // subtract row i from j */
+ for (std::size_t pii = pi; pii<piie; )
+ {
+ while (mat.col_idx[pj] < mat.col_idx[pii])
+ pj++;
+ //m_A[pj++] += m_A[pii++] * f1;
+ strm("\tm_A{1} += m_A{2} * f{3}_{4};\n", pj, pii, i, j);
+ pj++; pii++;
+ }
+ //RHS[j] += f1 * RHS[i];
+ strm("\tRHS[{1}] += f{2}_{3} * RHS[{4}];\n", j, i, j, i);
}
- //RHS[j] += f1 * RHS[i];
- strm("\tRHS[{1}] += f{2}_{3} * RHS[{4}];\n", j, i, j, i);
}
}
- }
- //new_V[iN - 1] = RHS[iN - 1] / mat.A[mat.diag[iN - 1]];
- strm("\tV[{1}] = RHS[{2}] / m_A{3};\n", iN - 1, iN - 1, mat.diag[iN - 1]);
- for (std::size_t j = iN - 1; j-- > 0;)
- {
- strm("\tdouble tmp{1} = 0.0;\n", j);
- const std::size_t e = mat.row_idx[j+1];
- for (std::size_t pk = mat.diag[j] + 1; pk < e; pk++)
+ //new_V[iN - 1] = RHS[iN - 1] / mat.A[mat.diag[iN - 1]];
+ strm("\tV[{1}] = RHS[{2}] / m_A{3};\n", iN - 1, iN - 1, mat.diag[iN - 1]);
+ for (std::size_t j = iN - 1; j-- > 0;)
{
- strm("\ttmp{1} += m_A{2} * V[{3}];\n", j, pk, mat.col_idx[pk]);
+ strm("\tdouble tmp{1} = 0.0;\n", j);
+ const std::size_t e = mat.row_idx[j+1];
+ for (std::size_t pk = mat.diag[j] + 1; pk < e; pk++)
+ {
+ strm("\ttmp{1} += m_A{2} * V[{3}];\n", j, pk, mat.col_idx[pk]);
+ }
+ strm("\tV[{1}] = (RHS[{1}] - tmp{1}) / m_A{4};\n", j, j, j, mat.diag[j]);
}
- strm("\tV[{1}] = (RHS[{1}] - tmp{1}) / m_A{4};\n", j, j, j, mat.diag[j]);
}
-}
-template <typename FT, int SIZE>
-pstring matrix_solver_GCR_t<FT, SIZE>::static_compile_name()
-{
- plib::postringstream t;
- plib::putf8_fmt_writer w(&t);
- csc_private(w);
- std::hash<pstring> h;
+ template <typename FT, int SIZE>
+ pstring matrix_solver_GCR_t<FT, SIZE>::static_compile_name()
+ {
+ plib::postringstream t;
+ plib::putf8_fmt_writer w(&t);
+ csc_private(w);
+ std::hash<pstring> h;
- return plib::pfmt("nl_gcr_{1:x}_{2}")(h( t.str() ))(mat.nz_num);
-}
+ return plib::pfmt("nl_gcr_{1:x}_{2}")(h( t.str() ))(mat.nz_num);
+ }
-template <typename FT, int SIZE>
-std::pair<pstring, pstring> matrix_solver_GCR_t<FT, SIZE>::create_solver_code()
-{
- plib::postringstream t;
- plib::putf8_fmt_writer strm(&t);
- pstring name = static_compile_name();
+ template <typename FT, int SIZE>
+ std::pair<pstring, pstring> matrix_solver_GCR_t<FT, SIZE>::create_solver_code()
+ {
+ plib::postringstream t;
+ plib::putf8_fmt_writer strm(&t);
+ pstring name = static_compile_name();
+
+ strm.writeline(plib::pfmt("extern \"C\" void {1}(double * __restrict m_A, double * __restrict RHS, double * __restrict V)\n")(name));
+ strm.writeline("{\n");
+ csc_private(strm);
+ strm.writeline("}\n");
+ return std::pair<pstring, pstring>(name, t.str());
+ }
- strm.writeline(plib::pfmt("extern \"C\" void {1}(double * __restrict m_A, double * __restrict RHS, double * __restrict V)\n")(name));
- strm.writeline("{\n");
- csc_private(strm);
- strm.writeline("}\n");
- return std::pair<pstring, pstring>(name, t.str());
-}
+ template <typename FT, int SIZE>
+ unsigned matrix_solver_GCR_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
+ {
+ const std::size_t iN = this->N();
+ mat.set_scalar(0.0);
-template <typename FT, int SIZE>
-unsigned matrix_solver_GCR_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
-{
- const std::size_t iN = this->N();
+ /* populate matrix */
- mat.set_scalar(0.0);
+ this->fill_matrix(iN, m_mat_ptr, RHS);
- /* populate matrix */
+ /* now solve it */
- this->fill_matrix(iN, m_mat_ptr, RHS);
+ //if (m_proc != nullptr)
+ if (m_proc.resolved())
+ {
+ //static_solver(m_A, RHS);
+ m_proc(&mat.A[0], &RHS[0], &new_V[0]);
+ }
+ else
+ {
+ // mat.gaussian_elimination_parallel(RHS);
+ mat.gaussian_elimination(RHS);
+ /* backward substitution */
+ mat.gaussian_back_substitution(new_V, RHS);
+ }
- /* now solve it */
+ this->m_stat_calculations++;
- //if (m_proc != nullptr)
- if (m_proc.resolved())
- {
- //static_solver(m_A, RHS);
- m_proc(&mat.A[0], &RHS[0], &new_V[0]);
+ const FT err = (newton_raphson ? delta(new_V) : 0.0);
+ store(new_V);
+ return (err > this->m_params.m_accuracy) ? 2 : 1;
}
- else
- {
- // mat.gaussian_elimination_parallel(RHS);
- mat.gaussian_elimination(RHS);
- /* backward substitution */
- mat.gaussian_back_substitution(new_V, RHS);
- }
-
- this->m_stat_calculations++;
-
- const FT err = (newton_raphson ? delta(new_V) : 0.0);
- store(new_V);
- return (err > this->m_params.m_accuracy) ? 2 : 1;
-}
- } //namespace devices
+} // namespace devices
} // namespace netlist
#endif /* NLD_MS_GCR_H_ */
diff --git a/src/lib/netlist/solver/nld_ms_sm.h b/src/lib/netlist/solver/nld_ms_sm.h
index 9d5b4e0843a..d85ab0044f4 100644
--- a/src/lib/netlist/solver/nld_ms_sm.h
+++ b/src/lib/netlist/solver/nld_ms_sm.h
@@ -33,278 +33,275 @@
#ifndef NLD_MS_SM_H_
#define NLD_MS_SM_H_
-#include <algorithm>
-
#include "nld_matrix_solver.h"
#include "nld_solver.h"
#include "plib/vector_ops.h"
+#include <algorithm>
+
namespace netlist
{
namespace devices
{
-template <typename FT, int SIZE>
-class matrix_solver_sm_t: public matrix_solver_t
-{
- friend class matrix_solver_t;
-
-public:
-
- using float_ext_type = FT;
- using float_type = FT;
- // FIXME: dirty hack to make this compile
- static constexpr const std::size_t storage_N = 100;
-
- matrix_solver_sm_t(netlist_state_t &anetlist, const pstring &name,
- const solver_parameters_t *params, const std::size_t size);
-
- void vsetup(analog_net_t::list_t &nets) override;
- void reset() override { matrix_solver_t::reset(); }
-
-protected:
- unsigned vsolve_non_dynamic(const bool newton_raphson) override;
- unsigned solve_non_dynamic(const bool newton_raphson);
+ template <typename FT, int SIZE>
+ class matrix_solver_sm_t: public matrix_solver_t
+ {
+ friend class matrix_solver_t;
- constexpr std::size_t size() const { return m_dim; }
+ public:
- void LE_invert();
+ using float_ext_type = FT;
+ using float_type = FT;
+ // FIXME: dirty hack to make this compile
+ static constexpr const std::size_t storage_N = 100;
- template <typename T>
- void LE_compute_x(T * x);
+ matrix_solver_sm_t(netlist_state_t &anetlist, const pstring &name,
+ const solver_parameters_t *params, const std::size_t size);
+ void vsetup(analog_net_t::list_t &nets) override;
+ void reset() override { matrix_solver_t::reset(); }
- template <typename T1, typename T2>
- float_ext_type &A(const T1 &r, const T2 &c) { return m_A[r][c]; }
- template <typename T1, typename T2>
- float_ext_type &W(const T1 &r, const T2 &c) { return m_W[r][c]; }
- template <typename T1, typename T2>
- float_ext_type &Ainv(const T1 &r, const T2 &c) { return m_Ainv[r][c]; }
- template <typename T1>
- float_ext_type &RHS(const T1 &r) { return m_RHS[r]; }
+ protected:
+ unsigned vsolve_non_dynamic(const bool newton_raphson) override;
+ unsigned solve_non_dynamic(const bool newton_raphson);
+ constexpr std::size_t size() const { return m_dim; }
- template <typename T1, typename T2>
- float_ext_type &lA(const T1 &r, const T2 &c) { return m_lA[r][c]; }
- template <typename T1, typename T2>
- float_ext_type &lAinv(const T1 &r, const T2 &c) { return m_lAinv[r][c]; }
+ void LE_invert();
-private:
- static constexpr std::size_t m_pitch = ((( storage_N) + 7) / 8) * 8;
- float_ext_type m_A[storage_N][m_pitch];
- float_ext_type m_Ainv[storage_N][m_pitch];
- float_ext_type m_W[storage_N][m_pitch];
- float_ext_type m_RHS[storage_N]; // right hand side - contains currents
+ template <typename T>
+ void LE_compute_x(T * x);
- float_ext_type m_lA[storage_N][m_pitch];
- float_ext_type m_lAinv[storage_N][m_pitch];
- //float_ext_type m_RHSx[storage_N];
+ template <typename T1, typename T2>
+ float_ext_type &A(const T1 &r, const T2 &c) { return m_A[r][c]; }
+ template <typename T1, typename T2>
+ float_ext_type &W(const T1 &r, const T2 &c) { return m_W[r][c]; }
+ template <typename T1, typename T2>
+ float_ext_type &Ainv(const T1 &r, const T2 &c) { return m_Ainv[r][c]; }
+ template <typename T1>
+ float_ext_type &RHS(const T1 &r) { return m_RHS[r]; }
- const std::size_t m_dim;
- std::size_t m_cnt;
-};
+ template <typename T1, typename T2>
+ float_ext_type &lA(const T1 &r, const T2 &c) { return m_lA[r][c]; }
+ template <typename T1, typename T2>
+ float_ext_type &lAinv(const T1 &r, const T2 &c) { return m_lAinv[r][c]; }
-// ----------------------------------------------------------------------------------------
-// matrix_solver_direct
-// ----------------------------------------------------------------------------------------
+ private:
+ static constexpr std::size_t m_pitch = ((( storage_N) + 7) / 8) * 8;
+ float_ext_type m_A[storage_N][m_pitch];
+ float_ext_type m_Ainv[storage_N][m_pitch];
+ float_ext_type m_W[storage_N][m_pitch];
+ float_ext_type m_RHS[storage_N]; // right hand side - contains currents
-template <typename FT, int SIZE>
-void matrix_solver_sm_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
-{
- matrix_solver_t::setup_base(nets);
+ float_ext_type m_lA[storage_N][m_pitch];
+ float_ext_type m_lAinv[storage_N][m_pitch];
- /* FIXME: Shouldn't be necessary */
- for (std::size_t k = 0; k < size(); k++)
- state().save(*this, RHS(k), this->name(), plib::pfmt("RHS.{1}")(k));
-}
+ //float_ext_type m_RHSx[storage_N];
+ const std::size_t m_dim;
+ std::size_t m_cnt;
+ };
-template <typename FT, int SIZE>
-void matrix_solver_sm_t<FT, SIZE>::LE_invert()
-{
- const std::size_t kN = size();
+ // ----------------------------------------------------------------------------------------
+ // matrix_solver_direct
+ // ----------------------------------------------------------------------------------------
- for (std::size_t i = 0; i < kN; i++)
+ template <typename FT, int SIZE>
+ void matrix_solver_sm_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
{
- for (std::size_t j = 0; j < kN; j++)
- {
- W(i,j) = lA(i,j) = A(i,j);
- Ainv(i,j) = 0.0;
- }
- Ainv(i,i) = 1.0;
+ matrix_solver_t::setup_base(nets);
+
+ /* FIXME: Shouldn't be necessary */
+ for (std::size_t k = 0; k < size(); k++)
+ state().save(*this, RHS(k), this->name(), plib::pfmt("RHS.{1}")(k));
}
- /* down */
- for (std::size_t i = 0; i < kN; i++)
- {
- /* FIXME: Singular matrix? */
- const float_type f = 1.0 / W(i,i);
- const auto * const p = m_terms[i]->m_nzrd.data();
- const std::size_t e = m_terms[i]->m_nzrd.size();
- /* Eliminate column i from row j */
+ template <typename FT, int SIZE>
+ void matrix_solver_sm_t<FT, SIZE>::LE_invert()
+ {
+ const std::size_t kN = size();
- const auto * const pb = m_terms[i]->m_nzbd.data();
- const std::size_t eb = m_terms[i]->m_nzbd.size();
- for (std::size_t jb = 0; jb < eb; jb++)
+ for (std::size_t i = 0; i < kN; i++)
{
- const unsigned j = pb[jb];
- const float_type f1 = - W(j,i) * f;
- if (f1 != 0.0)
+ for (std::size_t j = 0; j < kN; j++)
{
- for (std::size_t k = 0; k < e; k++)
- W(j,p[k]) += W(i,p[k]) * f1;
- for (std::size_t k = 0; k <= i; k ++)
- Ainv(j,k) += Ainv(i,k) * f1;
+ W(i,j) = lA(i,j) = A(i,j);
+ Ainv(i,j) = 0.0;
}
+ Ainv(i,i) = 1.0;
}
- }
- /* up */
- for (std::size_t i = kN; i-- > 0; )
- {
- /* FIXME: Singular matrix? */
- const float_type f = 1.0 / W(i,i);
- for (std::size_t j = i; j-- > 0; )
+ /* down */
+ for (std::size_t i = 0; i < kN; i++)
{
- const float_type f1 = - W(j,i) * f;
- if (f1 != 0.0)
+ /* FIXME: Singular matrix? */
+ const float_type f = 1.0 / W(i,i);
+ const auto * const p = m_terms[i]->m_nzrd.data();
+ const std::size_t e = m_terms[i]->m_nzrd.size();
+
+ /* Eliminate column i from row j */
+
+ const auto * const pb = m_terms[i]->m_nzbd.data();
+ const std::size_t eb = m_terms[i]->m_nzbd.size();
+ for (std::size_t jb = 0; jb < eb; jb++)
{
- for (std::size_t k = i; k < kN; k++)
- W(j,k) += W(i,k) * f1;
- for (std::size_t k = 0; k < kN; k++)
- Ainv(j,k) += Ainv(i,k) * f1;
+ const unsigned j = pb[jb];
+ const float_type f1 = - W(j,i) * f;
+ if (f1 != 0.0)
+ {
+ for (std::size_t k = 0; k < e; k++)
+ W(j,p[k]) += W(i,p[k]) * f1;
+ for (std::size_t k = 0; k <= i; k ++)
+ Ainv(j,k) += Ainv(i,k) * f1;
+ }
}
}
- for (std::size_t k = 0; k < kN; k++)
+ /* up */
+ for (std::size_t i = kN; i-- > 0; )
{
- Ainv(i,k) *= f;
- lAinv(i,k) = Ainv(i,k);
+ /* FIXME: Singular matrix? */
+ const float_type f = 1.0 / W(i,i);
+ for (std::size_t j = i; j-- > 0; )
+ {
+ const float_type f1 = - W(j,i) * f;
+ if (f1 != 0.0)
+ {
+ for (std::size_t k = i; k < kN; k++)
+ W(j,k) += W(i,k) * f1;
+ for (std::size_t k = 0; k < kN; k++)
+ Ainv(j,k) += Ainv(i,k) * f1;
+ }
+ }
+ for (std::size_t k = 0; k < kN; k++)
+ {
+ Ainv(i,k) *= f;
+ lAinv(i,k) = Ainv(i,k);
+ }
}
}
-}
-
-template <typename FT, int SIZE>
-template <typename T>
-void matrix_solver_sm_t<FT, SIZE>::LE_compute_x(
- T * x)
-{
- const std::size_t kN = size();
-
- for (std::size_t i=0; i<kN; i++)
- x[i] = 0.0;
- for (std::size_t k=0; k<kN; k++)
+ template <typename FT, int SIZE>
+ template <typename T>
+ void matrix_solver_sm_t<FT, SIZE>::LE_compute_x(
+ T * x)
{
- const float_type f = RHS(k);
+ const std::size_t kN = size();
for (std::size_t i=0; i<kN; i++)
- x[i] += Ainv(i,k) * f;
- }
-}
-
-
-template <typename FT, int SIZE>
-unsigned matrix_solver_sm_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson)
-{
- static constexpr const bool incremental = true;
- const std::size_t iN = size();
+ x[i] = 0.0;
- float_type new_V[storage_N]; // = { 0.0 };
+ for (std::size_t k=0; k<kN; k++)
+ {
+ const float_type f = RHS(k);
- if ((m_cnt % 50) == 0)
- {
- /* complete calculation */
- this->LE_invert();
+ for (std::size_t i=0; i<kN; i++)
+ x[i] += Ainv(i,k) * f;
+ }
}
- else
+
+ template <typename FT, int SIZE>
+ unsigned matrix_solver_sm_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson)
{
- if (!incremental)
+ static constexpr const bool incremental = true;
+ const std::size_t iN = size();
+
+ float_type new_V[storage_N]; // = { 0.0 };
+
+ if ((m_cnt % 50) == 0)
{
- for (std::size_t row = 0; row < iN; row ++)
- for (std::size_t k = 0; k < iN; k++)
- Ainv(row,k) = lAinv(row, k);
+ /* complete calculation */
+ this->LE_invert();
}
- for (std::size_t row = 0; row < iN; row ++)
+ else
{
- float_type v[m_pitch] = {0};
- std::size_t cols[m_pitch];
- std::size_t colcount = 0;
-
- auto &nz = m_terms[row]->m_nz;
- for (unsigned & col : nz)
+ if (!incremental)
{
- v[col] = A(row,col) - lA(row,col);
- if (incremental)
- lA(row,col) = A(row,col);
- if (v[col] != 0.0)
- cols[colcount++] = col;
+ for (std::size_t row = 0; row < iN; row ++)
+ for (std::size_t k = 0; k < iN; k++)
+ Ainv(row,k) = lAinv(row, k);
}
-
- if (colcount > 0)
+ for (std::size_t row = 0; row < iN; row ++)
{
- float_type lamba = 0.0;
- float_type w[m_pitch] = {0};
-
- float_type z[m_pitch];
- /* compute w and lamba */
- for (std::size_t i = 0; i < iN; i++)
- z[i] = Ainv(i, row); /* u is row'th column */
+ float_type v[m_pitch] = {0};
+ std::size_t cols[m_pitch];
+ std::size_t colcount = 0;
- for (std::size_t j = 0; j < colcount; j++)
- lamba += v[cols[j]] * z[cols[j]];
-
- for (std::size_t j=0; j<colcount; j++)
+ auto &nz = m_terms[row]->m_nz;
+ for (unsigned & col : nz)
{
- std::size_t col = cols[j];
- float_type f = v[col];
- for (std::size_t k = 0; k < iN; k++)
- w[k] += Ainv(col,k) * f; /* Transpose(Ainv) * v */
+ v[col] = A(row,col) - lA(row,col);
+ if (incremental)
+ lA(row,col) = A(row,col);
+ if (v[col] != 0.0)
+ cols[colcount++] = col;
}
- lamba = -1.0 / (1.0 + lamba);
- for (std::size_t i=0; i<iN; i++)
+ if (colcount > 0)
{
- const float_type f = lamba * z[i];
- if (f != 0.0)
+ float_type lamba = 0.0;
+ float_type w[m_pitch] = {0};
+
+ float_type z[m_pitch];
+ /* compute w and lamba */
+ for (std::size_t i = 0; i < iN; i++)
+ z[i] = Ainv(i, row); /* u is row'th column */
+
+ for (std::size_t j = 0; j < colcount; j++)
+ lamba += v[cols[j]] * z[cols[j]];
+
+ for (std::size_t j=0; j<colcount; j++)
+ {
+ std::size_t col = cols[j];
+ float_type f = v[col];
for (std::size_t k = 0; k < iN; k++)
- Ainv(i,k) += f * w[k];
+ w[k] += Ainv(col,k) * f; /* Transpose(Ainv) * v */
+ }
+
+ lamba = -1.0 / (1.0 + lamba);
+ for (std::size_t i=0; i<iN; i++)
+ {
+ const float_type f = lamba * z[i];
+ if (f != 0.0)
+ for (std::size_t k = 0; k < iN; k++)
+ Ainv(i,k) += f * w[k];
+ }
}
- }
+ }
}
- }
- m_cnt++;
+ m_cnt++;
- this->LE_compute_x(new_V);
+ this->LE_compute_x(new_V);
- const float_type err = (newton_raphson ? delta(new_V) : 0.0);
- store(new_V);
- return (err > this->m_params.m_accuracy) ? 2 : 1;
-}
+ const float_type err = (newton_raphson ? delta(new_V) : 0.0);
+ store(new_V);
+ return (err > this->m_params.m_accuracy) ? 2 : 1;
+ }
-template <typename FT, int SIZE>
-unsigned matrix_solver_sm_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
-{
- this->build_LE_A(*this);
- this->build_LE_RHS(*this);
-
- this->m_stat_calculations++;
- return this->solve_non_dynamic(newton_raphson);
-}
-
-template <typename FT, int SIZE>
-matrix_solver_sm_t<FT, SIZE>::matrix_solver_sm_t(netlist_state_t &anetlist, const pstring &name,
- const solver_parameters_t *params, const std::size_t size)
-: matrix_solver_t(anetlist, name, NOSORT, params)
-, m_dim(size)
-, m_cnt(0)
-{
-}
+ template <typename FT, int SIZE>
+ unsigned matrix_solver_sm_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
+ {
+ this->build_LE_A(*this);
+ this->build_LE_RHS(*this);
+
+ this->m_stat_calculations++;
+ return this->solve_non_dynamic(newton_raphson);
+ }
+
+ template <typename FT, int SIZE>
+ matrix_solver_sm_t<FT, SIZE>::matrix_solver_sm_t(netlist_state_t &anetlist, const pstring &name,
+ const solver_parameters_t *params, const std::size_t size)
+ : matrix_solver_t(anetlist, name, NOSORT, params)
+ , m_dim(size)
+ , m_cnt(0)
+ {
+ }
- } //namespace devices
+} // namespace devices
} // namespace netlist
#endif /* NLD_MS_DIRECT_H_ */
diff --git a/src/lib/netlist/solver/nld_ms_sor.h b/src/lib/netlist/solver/nld_ms_sor.h
index fd1df9d6759..c31aaa6d46a 100644
--- a/src/lib/netlist/solver/nld_ms_sor.h
+++ b/src/lib/netlist/solver/nld_ms_sor.h
@@ -12,11 +12,11 @@
#ifndef NLD_MS_SOR_H_
#define NLD_MS_SOR_H_
-#include <algorithm>
-
#include "nld_ms_direct.h"
#include "nld_solver.h"
+#include <algorithm>
+
namespace netlist
{
namespace devices
diff --git a/src/lib/netlist/solver/nld_ms_sor_mat.h b/src/lib/netlist/solver/nld_ms_sor_mat.h
index df4409ca5e9..83e4870cf28 100644
--- a/src/lib/netlist/solver/nld_ms_sor_mat.h
+++ b/src/lib/netlist/solver/nld_ms_sor_mat.h
@@ -12,220 +12,220 @@
#ifndef NLD_MS_SOR_MAT_H_
#define NLD_MS_SOR_MAT_H_
-#include <algorithm>
-
#include "nld_matrix_solver.h"
#include "nld_ms_direct.h"
#include "nld_solver.h"
+#include <algorithm>
+
namespace netlist
{
- namespace devices
- {
-
-template <typename FT, int SIZE>
-class matrix_solver_SOR_mat_t: public matrix_solver_direct_t<FT, SIZE>
+namespace devices
{
- friend class matrix_solver_t;
-public:
-
- using float_type = FT;
+ template <typename FT, int SIZE>
+ class matrix_solver_SOR_mat_t: public matrix_solver_direct_t<FT, SIZE>
+ {
+ friend class matrix_solver_t;
- matrix_solver_SOR_mat_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, std::size_t size)
- : matrix_solver_direct_t<FT, SIZE>(anetlist, name, matrix_solver_t::ASCENDING, params, size)
- , m_Vdelta(*this, "m_Vdelta", std::vector<float_type>(size))
- , m_omega(*this, "m_omega", params->m_gs_sor)
- , m_lp_fact(*this, "m_lp_fact", 0)
- {
- }
+ public:
- void vsetup(analog_net_t::list_t &nets) override;
+ using float_type = FT;
- unsigned vsolve_non_dynamic(const bool newton_raphson) override;
+ matrix_solver_SOR_mat_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, std::size_t size)
+ : matrix_solver_direct_t<FT, SIZE>(anetlist, name, matrix_solver_t::ASCENDING, params, size)
+ , m_Vdelta(*this, "m_Vdelta", std::vector<float_type>(size))
+ , m_omega(*this, "m_omega", params->m_gs_sor)
+ , m_lp_fact(*this, "m_lp_fact", 0)
+ {
+ }
-private:
- //state_var<float_type[storage_N]> m_Vdelta;
- state_var<std::vector<float_type>> m_Vdelta;
+ void vsetup(analog_net_t::list_t &nets) override;
- state_var<float_type> m_omega;
- state_var<float_type> m_lp_fact;
+ unsigned vsolve_non_dynamic(const bool newton_raphson) override;
-};
+ private:
+ //state_var<float_type[storage_N]> m_Vdelta;
+ state_var<std::vector<float_type>> m_Vdelta;
-// ----------------------------------------------------------------------------------------
-// matrix_solver - Gauss - Seidel
-// ----------------------------------------------------------------------------------------
+ state_var<float_type> m_omega;
+ state_var<float_type> m_lp_fact;
-template <typename FT, int SIZE>
-void matrix_solver_SOR_mat_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
-{
- matrix_solver_direct_t<FT, SIZE>::vsetup(nets);
-}
+ };
-#if 0
-//FIXME: move to solve_base
-template <unsigned m_N, unsigned storage_N>
-float_type matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve()
-{
- /*
- * enable linear prediction on first newton pass
- */
+ // ----------------------------------------------------------------------------------------
+ // matrix_solver - Gauss - Seidel
+ // ----------------------------------------------------------------------------------------
- if (this->m_params->use_linear_prediction)
- for (unsigned k = 0; k < this->size(); k++)
- {
- this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
- this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact;
- }
- else
- for (unsigned k = 0; k < this->size(); k++)
- {
- this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
- }
-
- this->solve_base(this);
+ template <typename FT, int SIZE>
+ void matrix_solver_SOR_mat_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets)
+ {
+ matrix_solver_direct_t<FT, SIZE>::vsetup(nets);
+ }
- if (this->m_params->use_linear_prediction)
+ #if 0
+ //FIXME: move to solve_base
+ template <unsigned m_N, unsigned storage_N>
+ float_type matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve()
{
- float_type sq = 0;
- float_type sqo = 0;
- const float_type rez_cts = 1.0 / this->current_timestep();
- for (unsigned k = 0; k < this->size(); k++)
- {
- const analog_net_t *n = this->m_nets[k];
- const float_type nv = (n->Q_Analog() - this->m_last_V[k]) * rez_cts ;
- sq += nv * nv;
- sqo += this->m_Vdelta[k] * this->m_Vdelta[k];
- this->m_Vdelta[k] = nv;
- }
+ /*
+ * enable linear prediction on first newton pass
+ */
- // FIXME: used to be 1e90, but this would not be compatible with float
- if (sqo > NL_FCONST(1e-20))
- m_lp_fact = std::min(std::sqrt(sq/sqo), (float_type) 2.0);
+ if (this->m_params->use_linear_prediction)
+ for (unsigned k = 0; k < this->size(); k++)
+ {
+ this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
+ this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact;
+ }
else
- m_lp_fact = NL_FCONST(0.0);
- }
-
+ for (unsigned k = 0; k < this->size(); k++)
+ {
+ this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
+ }
- return this->compute_next_timestep();
-}
-#endif
+ this->solve_base(this);
-template <typename FT, int SIZE>
-unsigned matrix_solver_SOR_mat_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
-{
- /* The matrix based code looks a lot nicer but actually is 30% slower than
- * the optimized code which works directly on the data structures.
- * Need something like that for gaussian elimination as well.
- */
+ if (this->m_params->use_linear_prediction)
+ {
+ float_type sq = 0;
+ float_type sqo = 0;
+ const float_type rez_cts = 1.0 / this->current_timestep();
+ for (unsigned k = 0; k < this->size(); k++)
+ {
+ const analog_net_t *n = this->m_nets[k];
+ const float_type nv = (n->Q_Analog() - this->m_last_V[k]) * rez_cts ;
+ sq += nv * nv;
+ sqo += this->m_Vdelta[k] * this->m_Vdelta[k];
+ this->m_Vdelta[k] = nv;
+ }
+ // FIXME: used to be 1e90, but this would not be compatible with float
+ if (sqo > NL_FCONST(1e-20))
+ m_lp_fact = std::min(std::sqrt(sq/sqo), (float_type) 2.0);
+ else
+ m_lp_fact = NL_FCONST(0.0);
+ }
- const std::size_t iN = this->size();
- this->build_LE_A(*this);
- this->build_LE_RHS(*this);
+ return this->compute_next_timestep();
+ }
+ #endif
- bool resched = false;
+ template <typename FT, int SIZE>
+ unsigned matrix_solver_SOR_mat_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson)
+ {
+ /* The matrix based code looks a lot nicer but actually is 30% slower than
+ * the optimized code which works directly on the data structures.
+ * Need something like that for gaussian elimination as well.
+ */
- unsigned resched_cnt = 0;
+ const std::size_t iN = this->size();
-#if 0
- static int ws_cnt = 0;
- ws_cnt++;
- if (1 && ws_cnt % 200 == 0)
- {
- // update omega
- float_type lambdaN = 0;
- float_type lambda1 = 1e9;
- for (int k = 0; k < iN; k++)
- {
- #if 0
- float_type akk = std::abs(this->m_A[k][k]);
- if ( akk > lambdaN)
- lambdaN = akk;
- if (akk < lambda1)
- lambda1 = akk;
- #else
- float_type akk = std::abs(this->m_A[k][k]);
- float_type s = 0.0;
- for (int i=0; i<iN; i++)
- s = s + std::abs(this->m_A[k][i]);
- akk = s / akk - 1.0;
- if ( akk > lambdaN)
- lambdaN = akk;
- if (akk < lambda1)
- lambda1 = akk;
- #endif
- }
+ this->build_LE_A(*this);
+ this->build_LE_RHS(*this);
- //ws = 2.0 / (2.0 - lambdaN - lambda1);
- m_omega = 2.0 / (2.0 - lambda1);
- }
-#endif
+ bool resched = false;
- for (std::size_t k = 0; k < iN; k++)
- this->m_new_V[k] = this->m_nets[k]->Q_Analog();
+ unsigned resched_cnt = 0;
- do {
- resched = false;
- float_type cerr = 0.0;
- for (std::size_t k = 0; k < iN; k++)
+ #if 0
+ static int ws_cnt = 0;
+ ws_cnt++;
+ if (1 && ws_cnt % 200 == 0)
{
- float_type Idrive = 0;
+ // update omega
+ float_type lambdaN = 0;
+ float_type lambda1 = 1e9;
+ for (int k = 0; k < iN; k++)
+ {
+ #if 0
+ float_type akk = std::abs(this->m_A[k][k]);
+ if ( akk > lambdaN)
+ lambdaN = akk;
+ if (akk < lambda1)
+ lambda1 = akk;
+ #else
+ float_type akk = std::abs(this->m_A[k][k]);
+ float_type s = 0.0;
+ for (int i=0; i<iN; i++)
+ s = s + std::abs(this->m_A[k][i]);
+ akk = s / akk - 1.0;
+ if ( akk > lambdaN)
+ lambdaN = akk;
+ if (akk < lambda1)
+ lambda1 = akk;
+ #endif
+ }
+
+ //ws = 2.0 / (2.0 - lambdaN - lambda1);
+ m_omega = 2.0 / (2.0 - lambda1);
+ }
+ #endif
- const auto *p = this->m_terms[k]->m_nz.data();
- const std::size_t e = this->m_terms[k]->m_nz.size();
+ for (std::size_t k = 0; k < iN; k++)
+ this->m_new_V[k] = this->m_nets[k]->Q_Analog();
- for (std::size_t i = 0; i < e; i++)
- Idrive = Idrive + this->A(k,p[i]) * this->m_new_V[p[i]];
+ do {
+ resched = false;
+ float_type cerr = 0.0;
- FT w = m_omega / this->A(k,k);
- if (this->m_params.m_use_gabs)
+ for (std::size_t k = 0; k < iN; k++)
{
- FT gabs_t = 0.0;
+ float_type Idrive = 0;
+
+ const auto *p = this->m_terms[k]->m_nz.data();
+ const std::size_t e = this->m_terms[k]->m_nz.size();
+
for (std::size_t i = 0; i < e; i++)
- if (p[i] != k)
- gabs_t = gabs_t + std::abs(this->A(k,p[i]));
+ Idrive = Idrive + this->A(k,p[i]) * this->m_new_V[p[i]];
- gabs_t *= plib::constants<FT>::one(); // derived by try and error
- if (gabs_t > this->A(k,k))
+ FT w = m_omega / this->A(k,k);
+ if (this->m_params.m_use_gabs)
{
- w = plib::constants<FT>::one() / (this->A(k,k) + gabs_t);
+ FT gabs_t = 0.0;
+ for (std::size_t i = 0; i < e; i++)
+ if (p[i] != k)
+ gabs_t = gabs_t + std::abs(this->A(k,p[i]));
+
+ gabs_t *= plib::constants<FT>::one(); // derived by try and error
+ if (gabs_t > this->A(k,k))
+ {
+ w = plib::constants<FT>::one() / (this->A(k,k) + gabs_t);
+ }
}
+
+ const float_type delta = w * (this->RHS(k) - Idrive) ;
+ cerr = std::max(cerr, std::abs(delta));
+ this->m_new_V[k] += delta;
}
- const float_type delta = w * (this->RHS(k) - Idrive) ;
- cerr = std::max(cerr, std::abs(delta));
- this->m_new_V[k] += delta;
- }
+ if (cerr > this->m_params.m_accuracy)
+ {
+ resched = true;
+ }
+ resched_cnt++;
+ } while (resched && (resched_cnt < this->m_params.m_gs_loops));
+
+ this->m_stat_calculations++;
+ this->m_iterative_total += resched_cnt;
- if (cerr > this->m_params.m_accuracy)
+ if (resched)
{
- resched = true;
+ this->m_iterative_fail++;
+ //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
+ return matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(newton_raphson);
}
- resched_cnt++;
- } while (resched && (resched_cnt < this->m_params.m_gs_loops));
- this->m_stat_calculations++;
- this->m_iterative_total += resched_cnt;
+ const float_type err = (newton_raphson ? this->delta(this->m_new_V) : 0.0);
+ this->store(this->m_new_V);
+ return (err > this->m_params.m_accuracy) ? 2 : 1;
- if (resched)
- {
- this->m_iterative_fail++;
- //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
- return matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(newton_raphson);
}
- const float_type err = (newton_raphson ? this->delta(this->m_new_V) : 0.0);
- this->store(this->m_new_V);
- return (err > this->m_params.m_accuracy) ? 2 : 1;
-
-}
-
- } //namespace devices
+} // namespace devices
} // namespace netlist
#endif /* NLD_MS_GAUSS_SEIDEL_H_ */
diff --git a/src/lib/netlist/solver/nld_ms_w.h b/src/lib/netlist/solver/nld_ms_w.h
index 76225724a21..3372b50c7c5 100644
--- a/src/lib/netlist/solver/nld_ms_w.h
+++ b/src/lib/netlist/solver/nld_ms_w.h
@@ -40,12 +40,12 @@
#ifndef NLD_MS_W_H_
#define NLD_MS_W_H_
-#include <algorithm>
-
#include "nld_matrix_solver.h"
#include "nld_solver.h"
#include "plib/vector_ops.h"
+#include <algorithm>
+
namespace netlist
{
namespace devices
diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp
index d9685f24ae0..4734cc3624d 100644
--- a/src/lib/netlist/solver/nld_solver.cpp
+++ b/src/lib/netlist/solver/nld_solver.cpp
@@ -32,401 +32,397 @@
#endif
#include "netlist/nl_lists.h"
-
-#include "plib/pomp.h"
-
#include "netlist/nl_factory.h"
-
#include "nld_matrix_solver.h"
-#include "nld_solver.h"
-
-#if 1
#include "nld_ms_direct.h"
-#include "nld_ms_gcr.h"
-#else
-#include "nld_ms_direct_lu.h"
-#endif
#include "nld_ms_direct1.h"
#include "nld_ms_direct2.h"
+#include "nld_ms_gcr.h"
#include "nld_ms_gmres.h"
#include "nld_ms_sm.h"
#include "nld_ms_sor.h"
#include "nld_ms_sor_mat.h"
#include "nld_ms_w.h"
+#include "nld_solver.h"
+#include "plib/pomp.h"
#include <algorithm>
#include <cmath>
namespace netlist
{
- namespace devices
- {
-
-
+namespace devices
+{
-// ----------------------------------------------------------------------------------------
-// solver
-// ----------------------------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------------
+ // solver
+ // ----------------------------------------------------------------------------------------
-NETLIB_RESET(solver)
-{
- for (auto &s : m_mat_solvers)
- s->reset();
-}
+ NETLIB_RESET(solver)
+ {
+ for (auto &s : m_mat_solvers)
+ s->reset();
+ }
-void NETLIB_NAME(solver)::stop()
-{
- for (auto &s : m_mat_solvers)
- s->log_stats();
-}
+ void NETLIB_NAME(solver)::stop()
+ {
+ for (auto &s : m_mat_solvers)
+ s->log_stats();
+ }
-NETLIB_UPDATE(solver)
-{
- if (m_params.m_dynamic_ts)
- return;
+ NETLIB_UPDATE(solver)
+ {
+ if (m_params.m_dynamic_ts)
+ return;
- netlist_time now(exec().time());
- /* force solving during start up if there are no time-step devices */
- /* FIXME: Needs a more elegant solution */
- bool force_solve = (now < netlist_time::from_double(2 * m_params.m_max_timestep));
+ netlist_time now(exec().time());
+ /* force solving during start up if there are no time-step devices */
+ /* FIXME: Needs a more elegant solution */
+ bool force_solve = (now < netlist_time::from_double(2 * m_params.m_max_timestep));
- std::size_t nthreads = std::min(static_cast<std::size_t>(m_parallel()), plib::omp::get_max_threads());
+ std::size_t nthreads = std::min(static_cast<std::size_t>(m_parallel()), plib::omp::get_max_threads());
- std::vector<matrix_solver_t *> &solvers = (force_solve ? m_mat_solvers_all : m_mat_solvers_timestepping);
+ std::vector<matrix_solver_t *> &solvers = (force_solve ? m_mat_solvers_all : m_mat_solvers_timestepping);
- if (nthreads > 1 && solvers.size() > 1)
- {
- plib::omp::set_num_threads(nthreads);
- plib::omp::for_static(static_cast<std::size_t>(0), solvers.size(), [&solvers, now](std::size_t i)
+ if (nthreads > 1 && solvers.size() > 1)
+ {
+ plib::omp::set_num_threads(nthreads);
+ plib::omp::for_static(static_cast<std::size_t>(0), solvers.size(), [&solvers, now](std::size_t i)
+ {
+ const netlist_time ts = solvers[i]->solve(now);
+ plib::unused_var(ts);
+ });
+ }
+ else
+ for (auto & solver : solvers)
{
- const netlist_time ts = solvers[i]->solve(now);
+ const netlist_time ts = solver->solve(now);
plib::unused_var(ts);
- });
- }
- else
+ }
+
for (auto & solver : solvers)
+ solver->update_inputs();
+
+ /* step circuit */
+ if (!m_Q_step.net().is_queued())
{
- const netlist_time ts = solver->solve(now);
- plib::unused_var(ts);
+ m_Q_step.net().toggle_and_push_to_queue(netlist_time::from_double(m_params.m_max_timestep));
}
-
- for (auto & solver : solvers)
- solver->update_inputs();
-
- /* step circuit */
- if (!m_Q_step.net().is_queued())
- {
- m_Q_step.net().toggle_and_push_to_queue(netlist_time::from_double(m_params.m_max_timestep));
}
-}
-template <class C>
-poolptr<matrix_solver_t> create_it(netlist_state_t &nl, pstring name, solver_parameters_t &params, std::size_t size)
-{
- return pool().make_poolptr<C>(nl, name, &params, size);
-}
-
-template <typename FT, int SIZE>
-poolptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver(std::size_t size, const pstring &solvername)
-{
- if (m_method() == "SOR_MAT")
+ template <class C>
+ pool_owned_ptr<matrix_solver_t> create_it(netlist_state_t &nl, pstring name, solver_parameters_t &params, std::size_t size)
{
- return create_it<matrix_solver_SOR_mat_t<FT, SIZE>>(state(), solvername, m_params, size);
- //typedef matrix_solver_SOR_mat_t<m_N,storage_N> solver_sor_mat;
- //return plib::make_unique<solver_sor_mat>(state(), solvername, &m_params, size);
+ return pool().make_poolptr<C>(nl, name, &params, size);
}
- else if (m_method() == "MAT_CR")
+
+ template <typename FT, int SIZE>
+ pool_owned_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver(std::size_t size, const pstring &solvername)
{
- if (size > 0) // GCR always outperforms MAT solver
+ if (m_method() == "SOR_MAT")
{
- return create_it<matrix_solver_GCR_t<FT, SIZE>>(state(), solvername, m_params, size);
+ return create_it<matrix_solver_SOR_mat_t<FT, SIZE>>(state(), solvername, m_params, size);
+ //typedef matrix_solver_SOR_mat_t<m_N,storage_N> solver_sor_mat;
+ //return plib::make_unique<solver_sor_mat>(state(), solvername, &m_params, size);
}
- else
+ else if (m_method() == "MAT_CR")
+ {
+ if (size > 0) // GCR always outperforms MAT solver
+ {
+ return create_it<matrix_solver_GCR_t<FT, SIZE>>(state(), solvername, m_params, size);
+ }
+ else
+ {
+ return create_it<matrix_solver_direct_t<FT, SIZE>>(state(), solvername, m_params, size);
+ }
+ }
+ else if (m_method() == "MAT")
{
return create_it<matrix_solver_direct_t<FT, SIZE>>(state(), solvername, m_params, size);
}
- }
- else if (m_method() == "MAT")
- {
- return create_it<matrix_solver_direct_t<FT, SIZE>>(state(), solvername, m_params, size);
- }
- else if (m_method() == "SM")
- {
- /* Sherman-Morrison Formula */
- return create_it<matrix_solver_sm_t<FT, SIZE>>(state(), solvername, m_params, size);
- }
- else if (m_method() == "W")
- {
- /* Woodbury Formula */
- return create_it<matrix_solver_w_t<FT, SIZE>>(state(), solvername, m_params, size);
- }
- else if (m_method() == "SOR")
- {
- return create_it<matrix_solver_SOR_t<FT, SIZE>>(state(), solvername, m_params, size);
- }
- else if (m_method() == "GMRES")
- {
- return create_it<matrix_solver_GMRES_t<FT, SIZE>>(state(), solvername, m_params, size);
- }
- else
- {
- log().fatal(MF_1_UNKNOWN_SOLVER_TYPE, m_method());
- return poolptr<matrix_solver_t>();
- }
-}
-
-template <typename FT, int SIZE>
-poolptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver_x(std::size_t size, const pstring &solvername)
-{
- if (SIZE > 0)
- {
- if (size == SIZE)
- return create_solver<FT, SIZE>(size, solvername);
+ else if (m_method() == "SM")
+ {
+ /* Sherman-Morrison Formula */
+ return create_it<matrix_solver_sm_t<FT, SIZE>>(state(), solvername, m_params, size);
+ }
+ else if (m_method() == "W")
+ {
+ /* Woodbury Formula */
+ return create_it<matrix_solver_w_t<FT, SIZE>>(state(), solvername, m_params, size);
+ }
+ else if (m_method() == "SOR")
+ {
+ return create_it<matrix_solver_SOR_t<FT, SIZE>>(state(), solvername, m_params, size);
+ }
+ else if (m_method() == "GMRES")
+ {
+ return create_it<matrix_solver_GMRES_t<FT, SIZE>>(state(), solvername, m_params, size);
+ }
else
- return this->create_solver_x<FT, SIZE-1>(size, solvername);
+ {
+ log().fatal(MF_1_UNKNOWN_SOLVER_TYPE, m_method());
+ return pool_owned_ptr<matrix_solver_t>();
+ }
}
- else
+
+ template <typename FT, int SIZE>
+ pool_owned_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver_x(std::size_t size, const pstring &solvername)
{
- if (size * 2 > -SIZE )
- return create_solver<FT, SIZE>(size, solvername);
+ if (SIZE > 0)
+ {
+ if (size == SIZE)
+ return create_solver<FT, SIZE>(size, solvername);
+ else
+ return this->create_solver_x<FT, SIZE-1>(size, solvername);
+ }
else
- return this->create_solver_x<FT, SIZE / 2>(size, solvername);
+ {
+ if (size * 2 > -SIZE )
+ return create_solver<FT, SIZE>(size, solvername);
+ else
+ return this->create_solver_x<FT, SIZE / 2>(size, solvername);
+ }
}
-}
-
-struct net_splitter
-{
- bool already_processed(analog_net_t *n)
+ struct net_splitter
{
- if (n->isRailNet())
- return true;
- for (auto & grp : groups)
- if (plib::container::contains(grp, n))
+
+ bool already_processed(const analog_net_t &n) const
+ {
+ /* no need to process rail nets - these are known variables */
+ if (n.isRailNet())
return true;
- return false;
- }
+ /* if it's already processed - no need to continue */
+ for (auto & grp : groups)
+ if (plib::container::contains(grp, &n))
+ return true;
+ return false;
+ }
- void process_net(analog_net_t *n)
- {
- if (n->num_cons() == 0)
- return;
- /* add the net */
- groups.back().push_back(n);
- for (auto &p : n->core_terms())
+ void process_net(analog_net_t &n)
{
- if (p->is_type(detail::terminal_type::TERMINAL))
+ /* ignore empty nets. FIXME: print a warning message */
+ if (n.num_cons() == 0)
+ return;
+ /* add the net */
+ groups.back().push_back(&n);
+ /* process all terminals connected to this net */
+ for (auto &term : n.core_terms())
{
- auto *pt = static_cast<terminal_t *>(p);
- analog_net_t *other_net = &pt->otherterm()->net();
- if (!already_processed(other_net))
- process_net(other_net);
+ /* only process analog terminals */
+ if (term->is_type(detail::terminal_type::TERMINAL))
+ {
+ auto *pt = static_cast<terminal_t *>(term);
+ /* check the connected terminal */
+ analog_net_t &connected_net = pt->connected_terminal()->net();
+ if (!already_processed(connected_net))
+ process_net(connected_net);
+ }
}
}
- }
- void run(netlist_state_t &netlist)
- {
- for (auto & net : netlist.nets())
+ void run(netlist_state_t &netlist)
{
- netlist.log().debug("processing {1}\n", net->name());
- if (!net->isRailNet() && net->num_cons() > 0)
+ for (auto & net : netlist.nets())
{
- netlist.log().debug(" ==> not a rail net\n");
- /* Must be an analog net */
- auto *n = static_cast<analog_net_t *>(net.get());
- if (!already_processed(n))
+ netlist.log().debug("processing {1}\n", net->name());
+ if (!net->isRailNet() && net->num_cons() > 0)
{
- groups.emplace_back(analog_net_t::list_t());
- process_net(n);
+ netlist.log().debug(" ==> not a rail net\n");
+ /* Must be an analog net */
+ auto &n = *static_cast<analog_net_t *>(net.get());
+ if (!already_processed(n))
+ {
+ groups.emplace_back(analog_net_t::list_t());
+ process_net(n);
+ }
}
}
}
- }
-
- std::vector<analog_net_t::list_t> groups;
-};
-void NETLIB_NAME(solver)::post_start()
-{
- m_params.m_pivot = m_pivot();
- m_params.m_accuracy = m_accuracy();
- /* FIXME: Throw when negative */
- m_params.m_gs_loops = static_cast<unsigned>(m_gs_loops());
- m_params.m_nr_loops = static_cast<unsigned>(m_nr_loops());
- m_params.m_nr_recalc_delay = netlist_time::from_double(m_nr_recalc_delay());
- m_params.m_dynamic_lte = m_dynamic_lte();
- m_params.m_gs_sor = m_gs_sor();
+ std::vector<analog_net_t::list_t> groups;
+ };
- m_params.m_min_timestep = m_dynamic_min_ts();
- m_params.m_dynamic_ts = (m_dynamic_ts() == 1 ? true : false);
- m_params.m_max_timestep = netlist_time::from_double(1.0 / m_freq()).as_double();
+ void NETLIB_NAME(solver)::post_start()
+ {
+ m_params.m_pivot = m_pivot();
+ m_params.m_accuracy = m_accuracy();
+ /* FIXME: Throw when negative */
+ m_params.m_gs_loops = static_cast<unsigned>(m_gs_loops());
+ m_params.m_nr_loops = static_cast<unsigned>(m_nr_loops());
+ m_params.m_nr_recalc_delay = netlist_time::from_double(m_nr_recalc_delay());
+ m_params.m_dynamic_lte = m_dynamic_lte();
+ m_params.m_gs_sor = m_gs_sor();
- m_params.m_use_gabs = m_use_gabs();
- m_params.m_use_linear_prediction = m_use_linear_prediction();
+ m_params.m_min_timestep = m_dynamic_min_ts();
+ m_params.m_dynamic_ts = (m_dynamic_ts() == 1 ? true : false);
+ m_params.m_max_timestep = netlist_time::from_double(1.0 / m_freq()).as_double();
+ m_params.m_use_gabs = m_use_gabs();
+ m_params.m_use_linear_prediction = m_use_linear_prediction();
- if (m_params.m_dynamic_ts)
- {
- m_params.m_max_timestep *= 1;//NL_FCONST(1000.0);
- }
- else
- {
- m_params.m_min_timestep = m_params.m_max_timestep;
- }
- //m_params.m_max_timestep = std::max(m_params.m_max_timestep, m_params.m_max_timestep::)
+ if (m_params.m_dynamic_ts)
+ {
+ m_params.m_max_timestep *= 1;//NL_FCONST(1000.0);
+ }
+ else
+ {
+ m_params.m_min_timestep = m_params.m_max_timestep;
+ }
- // Override log statistics
- pstring p = plib::util::environment("NL_STATS", "");
- if (p != "")
- m_params.m_log_stats = plib::pstonum<decltype(m_params.m_log_stats)>(p);
- else
- m_params.m_log_stats = m_log_stats();
+ //m_params.m_max_timestep = std::max(m_params.m_max_timestep, m_params.m_max_timestep::)
- log().verbose("Scanning net groups ...");
- // determine net groups
+ // Override log statistics
+ pstring p = plib::util::environment("NL_STATS", "");
+ if (p != "")
+ m_params.m_log_stats = plib::pstonum<decltype(m_params.m_log_stats)>(p);
+ else
+ m_params.m_log_stats = m_log_stats();
- net_splitter splitter;
+ log().verbose("Scanning net groups ...");
+ // determine net groups
- splitter.run(state());
+ net_splitter splitter;
- // setup the solvers
- log().verbose("Found {1} net groups in {2} nets\n", splitter.groups.size(), state().nets().size());
- for (auto & grp : splitter.groups)
- {
- poolptr<matrix_solver_t> ms;
- std::size_t net_count = grp.size();
- pstring sname = plib::pfmt("Solver_{1}")(m_mat_solvers.size());
+ splitter.run(state());
- switch (net_count)
+ // setup the solvers
+ log().verbose("Found {1} net groups in {2} nets\n", splitter.groups.size(), state().nets().size());
+ for (auto & grp : splitter.groups)
{
-#if 1
- case 1:
- ms = pool().make_poolptr<matrix_solver_direct1_t<double>>(state(), sname, &m_params);
- break;
- case 2:
- ms = pool().make_poolptr<matrix_solver_direct2_t<double>>(state(), sname, &m_params);
- break;
- case 3:
- ms = create_solver<double, 3>(3, sname);
- break;
- case 4:
- ms = create_solver<double, 4>(4, sname);
- break;
- case 5:
- ms = create_solver<double, 5>(5, sname);
- break;
- case 6:
- ms = create_solver<double, 6>(6, sname);
- break;
- case 7:
- ms = create_solver<double, 7>(7, sname);
- break;
- case 8:
- ms = create_solver<double, 8>(8, sname);
- break;
- case 9:
- ms = create_solver<double, 9>(9, sname);
- break;
- case 10:
- ms = create_solver<double, 10>(10, sname);
- break;
-#if 0
- case 11:
- ms = create_solver<double, 11>(11, sname);
- break;
- case 12:
- ms = create_solver<double, 12>(12, sname);
- break;
- case 15:
- ms = create_solver<double, 15>(15, sname);
- break;
- case 31:
- ms = create_solver<double, 31>(31, sname);
- break;
- case 35:
- ms = create_solver<double, 35>(35, sname);
- break;
- case 43:
- ms = create_solver<double, 43>(43, sname);
- break;
- case 49:
- ms = create_solver<double, 49>(49, sname);
- break;
-#endif
-#if 1
- case 86:
- ms = create_solver<double,86>(86, sname);
- break;
-#endif
-#endif
- default:
- log().warning(MW_1_NO_SPECIFIC_SOLVER, net_count);
- if (net_count <= 8)
- {
- ms = create_solver<double, -8>(net_count, sname);
- }
- else if (net_count <= 16)
- {
- ms = create_solver<double, -16>(net_count, sname);
- }
- else if (net_count <= 32)
- {
- ms = create_solver<double, -32>(net_count, sname);
- }
- else
- if (net_count <= 64)
- {
- ms = create_solver<double, -64>(net_count, sname);
- }
- else
- if (net_count <= 128)
- {
- ms = create_solver<double, -128>(net_count, sname);
- }
- else
- {
- log().fatal(MF_1_NETGROUP_SIZE_EXCEEDED_1, 128);
- return; /* tease compilers */
- }
- break;
- }
+ pool_owned_ptr<matrix_solver_t> ms;
+ std::size_t net_count = grp.size();
+ pstring sname = plib::pfmt("Solver_{1}")(m_mat_solvers.size());
- // FIXME ...
- ms->setup(grp);
+ switch (net_count)
+ {
+ #if 1
+ case 1:
+ ms = pool().make_poolptr<matrix_solver_direct1_t<double>>(state(), sname, &m_params);
+ break;
+ case 2:
+ ms = pool().make_poolptr<matrix_solver_direct2_t<double>>(state(), sname, &m_params);
+ break;
+ case 3:
+ ms = create_solver<double, 3>(3, sname);
+ break;
+ case 4:
+ ms = create_solver<double, 4>(4, sname);
+ break;
+ case 5:
+ ms = create_solver<double, 5>(5, sname);
+ break;
+ case 6:
+ ms = create_solver<double, 6>(6, sname);
+ break;
+ case 7:
+ ms = create_solver<double, 7>(7, sname);
+ break;
+ case 8:
+ ms = create_solver<double, 8>(8, sname);
+ break;
+ case 9:
+ ms = create_solver<double, 9>(9, sname);
+ break;
+ case 10:
+ ms = create_solver<double, 10>(10, sname);
+ break;
+ #if 0
+ case 11:
+ ms = create_solver<double, 11>(11, sname);
+ break;
+ case 12:
+ ms = create_solver<double, 12>(12, sname);
+ break;
+ case 15:
+ ms = create_solver<double, 15>(15, sname);
+ break;
+ case 31:
+ ms = create_solver<double, 31>(31, sname);
+ break;
+ case 35:
+ ms = create_solver<double, 35>(35, sname);
+ break;
+ case 43:
+ ms = create_solver<double, 43>(43, sname);
+ break;
+ case 49:
+ ms = create_solver<double, 49>(49, sname);
+ break;
+ #endif
+ #if 1
+ case 86:
+ ms = create_solver<double,86>(86, sname);
+ break;
+ #endif
+ #endif
+ default:
+ log().warning(MW_1_NO_SPECIFIC_SOLVER, net_count);
+ if (net_count <= 8)
+ {
+ ms = create_solver<double, -8>(net_count, sname);
+ }
+ else if (net_count <= 16)
+ {
+ ms = create_solver<double, -16>(net_count, sname);
+ }
+ else if (net_count <= 32)
+ {
+ ms = create_solver<double, -32>(net_count, sname);
+ }
+ else
+ if (net_count <= 64)
+ {
+ ms = create_solver<double, -64>(net_count, sname);
+ }
+ else
+ if (net_count <= 128)
+ {
+ ms = create_solver<double, -128>(net_count, sname);
+ }
+ else
+ {
+ log().fatal(MF_1_NETGROUP_SIZE_EXCEEDED_1, 128);
+ return; /* tease compilers */
+ }
+ break;
+ }
- log().verbose("Solver {1}", ms->name());
- log().verbose(" ==> {2} nets", grp.size());
- log().verbose(" has {1} elements", ms->has_dynamic_devices() ? "dynamic" : "no dynamic");
- log().verbose(" has {1} elements", ms->has_timestep_devices() ? "timestep" : "no timestep");
- for (auto &n : grp)
- {
- log().verbose("Net {1}", n->name());
- for (const auto &pcore : n->core_terms())
+ // FIXME ...
+ ms->setup(grp);
+
+ log().verbose("Solver {1}", ms->name());
+ log().verbose(" ==> {2} nets", grp.size());
+ log().verbose(" has {1} elements", ms->has_dynamic_devices() ? "dynamic" : "no dynamic");
+ log().verbose(" has {1} elements", ms->has_timestep_devices() ? "timestep" : "no timestep");
+ for (auto &n : grp)
{
- log().verbose(" {1}", pcore->name());
+ log().verbose("Net {1}", n->name());
+ for (const auto &pcore : n->core_terms())
+ {
+ log().verbose(" {1}", pcore->name());
+ }
}
- }
- m_mat_solvers_all.push_back(ms.get());
- if (ms->has_timestep_devices())
- m_mat_solvers_timestepping.push_back(ms.get());
+ m_mat_solvers_all.push_back(ms.get());
+ if (ms->has_timestep_devices())
+ m_mat_solvers_timestepping.push_back(ms.get());
- m_mat_solvers.emplace_back(std::move(ms));
+ m_mat_solvers.emplace_back(std::move(ms));
+ }
}
-}
-void NETLIB_NAME(solver)::create_solver_code(std::map<pstring, pstring> &mp)
-{
- for (auto & s : m_mat_solvers)
+ void NETLIB_NAME(solver)::create_solver_code(std::map<pstring, pstring> &mp)
{
- auto r = s->create_solver_code();
- mp[r.first] = r.second; // automatically overwrites identical names
+ for (auto & s : m_mat_solvers)
+ {
+ auto r = s->create_solver_code();
+ mp[r.first] = r.second; // automatically overwrites identical names
+ }
}
-}
NETLIB_DEVICE_IMPL(solver, "SOLVER", "FREQ")
- } //namespace devices
+} // namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/solver/nld_solver.h b/src/lib/netlist/solver/nld_solver.h
index 8b1f1f0b96d..c9ec967a72a 100644
--- a/src/lib/netlist/solver/nld_solver.h
+++ b/src/lib/netlist/solver/nld_solver.h
@@ -25,98 +25,97 @@
namespace netlist
{
- namespace devices
- {
-class NETLIB_NAME(solver);
-
-
-class matrix_solver_t;
-
-NETLIB_OBJECT(solver)
+namespace devices
{
- NETLIB_CONSTRUCTOR(solver)
- , m_fb_step(*this, "FB_step")
- , m_Q_step(*this, "Q_step")
- , m_freq(*this, "FREQ", 48000.0)
-
- /* iteration parameters */
- , m_gs_sor(*this, "SOR_FACTOR", 1.059)
- , m_method(*this, "METHOD", "MAT_CR")
- , m_accuracy(*this, "ACCURACY", 1e-7)
- , m_gs_loops(*this, "GS_LOOPS", 9) // Gauss-Seidel loops
-
- /* general parameters */
- , m_gmin(*this, "GMIN", 1e-9)
- , m_pivot(*this, "PIVOT", false) // use pivoting - on supported solvers
- , m_nr_loops(*this, "NR_LOOPS", 250) // Newton-Raphson loops
- , m_nr_recalc_delay(*this, "NR_RECALC_DELAY", NLTIME_FROM_NS(10).as_double()) // Delay to next solve attempt if nr loops exceeded
- , m_parallel(*this, "PARALLEL", 0)
-
- /* automatic time step */
- , m_dynamic_ts(*this, "DYNAMIC_TS", false)
- , m_dynamic_lte(*this, "DYNAMIC_LTE", 1e-5) // diff/timestep
- , m_dynamic_min_ts(*this, "DYNAMIC_MIN_TIMESTEP", 1e-6) // nl_double timestep resolution
-
- /* special */
- , m_use_gabs(*this, "USE_GABS", true)
- , m_use_linear_prediction(*this, "USE_LINEAR_PREDICTION", false) // // savings are eaten up by effort
-
- , m_log_stats(*this, "LOG_STATS", true) // log statistics on shutdown
- , m_params()
- {
- // internal staff
-
- connect(m_fb_step, m_Q_step);
- }
-
- void post_start();
- void stop();
-
- nl_double gmin() const { return m_gmin(); }
-
- void create_solver_code(std::map<pstring, pstring> &mp);
+ class NETLIB_NAME(solver);
- NETLIB_UPDATEI();
- NETLIB_RESETI();
- // NETLIB_UPDATE_PARAMI();
+ class matrix_solver_t;
-private:
- logic_input_t m_fb_step;
- logic_output_t m_Q_step;
-
- param_double_t m_freq;
- param_double_t m_gs_sor;
- param_str_t m_method;
- param_double_t m_accuracy;
- param_int_t m_gs_loops;
- param_double_t m_gmin;
- param_logic_t m_pivot;
- param_int_t m_nr_loops;
- param_double_t m_nr_recalc_delay;
- param_int_t m_parallel;
- param_logic_t m_dynamic_ts;
- param_double_t m_dynamic_lte;
- param_double_t m_dynamic_min_ts;
-
- param_logic_t m_use_gabs;
- param_logic_t m_use_linear_prediction;
-
- param_logic_t m_log_stats;
-
- std::vector<poolptr<matrix_solver_t>> m_mat_solvers;
- std::vector<matrix_solver_t *> m_mat_solvers_all;
- std::vector<matrix_solver_t *> m_mat_solvers_timestepping;
-
- solver_parameters_t m_params;
-
- template <typename FT, int SIZE>
- poolptr<matrix_solver_t> create_solver(std::size_t size, const pstring &solvername);
-
- template <typename FT, int SIZE>
- poolptr<matrix_solver_t> create_solver_x(std::size_t size, const pstring &solvername);
-};
-
- } //namespace devices
+ NETLIB_OBJECT(solver)
+ {
+ NETLIB_CONSTRUCTOR(solver)
+ , m_fb_step(*this, "FB_step")
+ , m_Q_step(*this, "Q_step")
+ , m_freq(*this, "FREQ", 48000.0)
+
+ /* iteration parameters */
+ , m_gs_sor(*this, "SOR_FACTOR", 1.059)
+ , m_method(*this, "METHOD", "MAT_CR")
+ , m_accuracy(*this, "ACCURACY", 1e-7)
+ , m_gs_loops(*this, "GS_LOOPS", 9) // Gauss-Seidel loops
+
+ /* general parameters */
+ , m_gmin(*this, "GMIN", 1e-9)
+ , m_pivot(*this, "PIVOT", false) // use pivoting - on supported solvers
+ , m_nr_loops(*this, "NR_LOOPS", 250) // Newton-Raphson loops
+ , m_nr_recalc_delay(*this, "NR_RECALC_DELAY", NLTIME_FROM_NS(10).as_double()) // Delay to next solve attempt if nr loops exceeded
+ , m_parallel(*this, "PARALLEL", 0)
+
+ /* automatic time step */
+ , m_dynamic_ts(*this, "DYNAMIC_TS", false)
+ , m_dynamic_lte(*this, "DYNAMIC_LTE", 1e-5) // diff/timestep
+ , m_dynamic_min_ts(*this, "DYNAMIC_MIN_TIMESTEP", 1e-6) // nl_double timestep resolution
+
+ /* special */
+ , m_use_gabs(*this, "USE_GABS", true)
+ , m_use_linear_prediction(*this, "USE_LINEAR_PREDICTION", false) // // savings are eaten up by effort
+
+ , m_log_stats(*this, "LOG_STATS", true) // log statistics on shutdown
+ , m_params()
+ {
+ // internal staff
+
+ connect(m_fb_step, m_Q_step);
+ }
+
+ void post_start();
+ void stop();
+
+ nl_double gmin() const { return m_gmin(); }
+
+ void create_solver_code(std::map<pstring, pstring> &mp);
+
+ NETLIB_UPDATEI();
+ NETLIB_RESETI();
+ // NETLIB_UPDATE_PARAMI();
+
+ private:
+ logic_input_t m_fb_step;
+ logic_output_t m_Q_step;
+
+ param_double_t m_freq;
+ param_double_t m_gs_sor;
+ param_str_t m_method;
+ param_double_t m_accuracy;
+ param_int_t m_gs_loops;
+ param_double_t m_gmin;
+ param_logic_t m_pivot;
+ param_int_t m_nr_loops;
+ param_double_t m_nr_recalc_delay;
+ param_int_t m_parallel;
+ param_logic_t m_dynamic_ts;
+ param_double_t m_dynamic_lte;
+ param_double_t m_dynamic_min_ts;
+
+ param_logic_t m_use_gabs;
+ param_logic_t m_use_linear_prediction;
+
+ param_logic_t m_log_stats;
+
+ std::vector<pool_owned_ptr<matrix_solver_t>> m_mat_solvers;
+ std::vector<matrix_solver_t *> m_mat_solvers_all;
+ std::vector<matrix_solver_t *> m_mat_solvers_timestepping;
+
+ solver_parameters_t m_params;
+
+ template <typename FT, int SIZE>
+ pool_owned_ptr<matrix_solver_t> create_solver(std::size_t size, const pstring &solvername);
+
+ template <typename FT, int SIZE>
+ pool_owned_ptr<matrix_solver_t> create_solver_x(std::size_t size, const pstring &solvername);
+ };
+
+} //namespace devices
} // namespace netlist
#endif /* NLD_SOLVER_H_ */
diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp
index d6d5f3e2e01..0acf5041c91 100644
--- a/src/lib/netlist/tools/nl_convert.cpp
+++ b/src/lib/netlist/tools/nl_convert.cpp
@@ -8,6 +8,7 @@
#include "plib/palloc.h"
#include "nl_convert.h"
#include "plib/putil.h"
+
#include <algorithm>
#include <cmath>
#include <unordered_map>
diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h
index 367546092be..5cdae8e372d 100644
--- a/src/lib/netlist/tools/nl_convert.h
+++ b/src/lib/netlist/tools/nl_convert.h
@@ -14,6 +14,7 @@
#include "plib/pparser.h"
#include "plib/pstring.h"
#include "plib/ptypes.h"
+
#include <memory>
/*-------------------------------------------------
@@ -58,8 +59,8 @@ private:
struct net_t
{
public:
- explicit net_t(const pstring &aname)
- : m_name(aname), m_no_export(false) {}
+ explicit net_t(pstring aname)
+ : m_name(std::move(aname)), m_no_export(false) {}
const pstring &name() { return m_name;}
std::vector<pstring> &terminals() { return m_terminals; }
@@ -75,16 +76,28 @@ private:
struct dev_t
{
public:
- dev_t(const pstring &atype, const pstring &aname, const pstring &amodel)
- : m_type(atype), m_name(aname), m_model(amodel), m_val(0), m_has_val(false)
+ dev_t(pstring atype, pstring aname, pstring amodel)
+ : m_type(std::move(atype))
+ , m_name(std::move(aname))
+ , m_model(std::move(amodel))
+ , m_val(0)
+ , m_has_val(false)
{}
- dev_t(const pstring &atype, const pstring &aname, double aval)
- : m_type(atype), m_name(aname), m_model(""), m_val(aval), m_has_val(true)
+ dev_t(pstring atype, pstring aname, double aval)
+ : m_type(std::move(atype))
+ , m_name(std::move(aname))
+ , m_model("")
+ , m_val(aval)
+ , m_has_val(true)
{}
- dev_t(const pstring &atype, const pstring &aname)
- : m_type(atype), m_name(aname), m_model(""), m_val(0.0), m_has_val(false)
+ dev_t(pstring atype, pstring aname)
+ : m_type(std::move(atype))
+ , m_name(std::move(aname))
+ , m_model("")
+ , m_val(0.0)
+ , m_has_val(false)
{}
const pstring &name() { return m_name;}
@@ -112,8 +125,8 @@ private:
struct pin_alias_t
{
public:
- pin_alias_t(const pstring &name, const pstring &alias)
- : m_name(name), m_alias(alias)
+ pin_alias_t(pstring name, pstring alias)
+ : m_name(std::move(name)), m_alias(std::move(alias))
{}
const pstring &name() { return m_name; }
const pstring &alias() { return m_alias; }
diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt
index d8f106d0832..233d50a5f1d 100644
--- a/src/mame/arcade.flt
+++ b/src/mame/arcade.flt
@@ -256,6 +256,7 @@ cpzodiac.cpp
crbaloon.cpp
crgolf.cpp
crimfght.cpp
+cromptons.cpp
crospang.cpp
crshrace.cpp
crystal.cpp
diff --git a/src/mame/drivers/ave_arb.cpp b/src/mame/drivers/ave_arb.cpp
index f922382f714..3ca879b461f 100644
--- a/src/mame/drivers/ave_arb.cpp
+++ b/src/mame/drivers/ave_arb.cpp
@@ -61,8 +61,9 @@ public:
{ }
// halt button is tied to NMI, reset button to RESET(but only if halt button is held)
- DECLARE_INPUT_CHANGED_MEMBER(reset_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, (newval && m_inp_matrix[9]->read() & 2) ? ASSERT_LINE : CLEAR_LINE); }
- DECLARE_INPUT_CHANGED_MEMBER(halt_button) { m_maincpu->set_input_line(M6502_NMI_LINE, newval ? ASSERT_LINE : CLEAR_LINE); }
+ void update_reset() { m_maincpu->set_input_line(INPUT_LINE_RESET, (m_inp_matrix[9]->read() == 3) ? ASSERT_LINE : CLEAR_LINE); }
+ DECLARE_INPUT_CHANGED_MEMBER(reset_button) { update_reset(); }
+ DECLARE_INPUT_CHANGED_MEMBER(halt_button) { m_maincpu->set_input_line(M6502_NMI_LINE, newval ? ASSERT_LINE : CLEAR_LINE); update_reset(); }
// machine drivers
void arb(machine_config &config);
@@ -191,8 +192,8 @@ static INPUT_PORTS_START( arb )
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_0) PORT_NAME("New Game / Options / Pawn / 0")
PORT_START("IN.9")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, reset_button, nullptr)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Halt") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, halt_button, nullptr)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_F2) PORT_NAME("Reset") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, reset_button, nullptr)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_CODE(KEYCODE_F2) PORT_NAME("Halt") PORT_CHANGED_MEMBER(DEVICE_SELF, arb_state, halt_button, nullptr)
INPUT_PORTS_END
diff --git a/src/mame/drivers/cliffhgr.cpp b/src/mame/drivers/cliffhgr.cpp
index 2096eedf939..efd2290cba7 100644
--- a/src/mame/drivers/cliffhgr.cpp
+++ b/src/mame/drivers/cliffhgr.cpp
@@ -26,15 +26,15 @@ More info on the LD-V1100:
http://www.laserdiscarchive.co.uk/laserdisc_archive/pioneer/pioneer_ld-1100/pioneer_ld-1100.htm
Interrupts:
-The frame decoder reads in the Phillips code from the composite signal into
+The frame decoder reads in the Philips code from the composite signal into
3x8 bit flip flops. If bit 7 of the code is set, then an IRQ is generated.
-Phillips codes come in scanline 17 and 18 of the composite signal for each
+Philips codes come in scanline 17 and 18 of the composite signal for each
field, so if we have valid codes, we would have 4 irq's per frame.
NMIs are triggered by the TMS9128NL chip. The TMS9128NL SYNC signal is hooked
up to the composite SYNC signal from the frame decoder.
Goal To Go Side detection:
-The side detection code expects to read a chapter Phillips code of 0x881DDD
+The side detection code expects to read a chapter Philips code of 0x881DDD
for Side 1, or 0x8F7DDD for Side 2. That would be chapter 1 for Side 1, or
chapter number 119 for Side 2.
@@ -47,13 +47,13 @@ IO Ports:
0x44: W TMS9128NL VRAM Port
0x45: R TMS9128NL VRAM Port
0x46: W Sound/Overlay
-0x50: R Reads lower byte of Phillips code
-0x51: R Reads middle byte of Phillips code
-0x52: R Reads high byte of Phillips code
+0x50: R Reads lower byte of Philips code
+0x51: R Reads middle byte of Philips code
+0x52: R Reads high byte of Philips code
0x53: R Clears the flip flop that generated the IRQ
0x54: W TMS9128NL REG Port
0x55: R TMS9128NL REG Port
-0x57: W Clears the serial->parallel chips of the Phillips code reader.
+0x57: W Clears the serial->parallel chips of the Philips code reader.
0x60: W Input Port/Dipswitch selector
0x62: R Input Port/Dipswitch data read
0x64: - Unused in the schematics, but used in the code (maybe as delay?)
@@ -97,7 +97,7 @@ public:
: driver_device(mconfig, type, tag)
, m_laserdisc(*this, "laserdisc")
, m_port_bank(0)
- , m_phillips_code(0)
+ , m_philips_code(0)
, m_maincpu(*this, "maincpu")
, m_discrete(*this, "discrete")
, m_screen(*this, "screen")
@@ -107,8 +107,8 @@ public:
DECLARE_WRITE8_MEMBER(cliff_test_led_w);
DECLARE_WRITE8_MEMBER(cliff_port_bank_w);
DECLARE_READ8_MEMBER(cliff_port_r);
- DECLARE_READ8_MEMBER(cliff_phillips_code_r);
- DECLARE_WRITE8_MEMBER(cliff_phillips_clear_w);
+ DECLARE_READ8_MEMBER(cliff_philips_code_r);
+ DECLARE_WRITE8_MEMBER(cliff_philips_clear_w);
DECLARE_WRITE8_MEMBER(cliff_coin_counter_w);
DECLARE_READ8_MEMBER(cliff_irq_ack_r);
DECLARE_WRITE8_MEMBER(cliff_ldwire_w);
@@ -127,7 +127,7 @@ private:
required_device<pioneer_pr8210_device> m_laserdisc;
int m_port_bank;
- uint32_t m_phillips_code;
+ uint32_t m_philips_code;
emu_timer *m_irq_timer;
@@ -167,12 +167,12 @@ READ8_MEMBER(cliffhgr_state::cliff_port_r)
return 0xff;
}
-READ8_MEMBER(cliffhgr_state::cliff_phillips_code_r)
+READ8_MEMBER(cliffhgr_state::cliff_philips_code_r)
{
- return (m_phillips_code >> (8 * offset)) & 0xff;
+ return (m_philips_code >> (8 * offset)) & 0xff;
}
-WRITE8_MEMBER(cliffhgr_state::cliff_phillips_clear_w)
+WRITE8_MEMBER(cliffhgr_state::cliff_philips_clear_w)
{
/* reset serial to parallel converters */
}
@@ -209,25 +209,25 @@ WRITE8_MEMBER(cliffhgr_state::cliff_ldwire_w)
TIMER_CALLBACK_MEMBER(cliffhgr_state::cliff_irq_callback)
{
- m_phillips_code = 0;
+ m_philips_code = 0;
switch (param)
{
case 17:
- m_phillips_code = m_laserdisc->get_field_code(LASERDISC_CODE_LINE17, true);
+ m_philips_code = m_laserdisc->get_field_code(LASERDISC_CODE_LINE17, true);
param = 18;
break;
case 18:
- m_phillips_code = m_laserdisc->get_field_code(LASERDISC_CODE_LINE18, true);
+ m_philips_code = m_laserdisc->get_field_code(LASERDISC_CODE_LINE18, true);
param = 17;
break;
}
/* if we have a valid code, trigger an IRQ */
- if (m_phillips_code & 0x800000)
+ if (m_philips_code & 0x800000)
{
-// printf("%2d:code = %06X\n", param, phillips_code);
+// printf("%2d:code = %06X\n", param, philips_code);
m_maincpu->set_input_line(0, ASSERT_LINE);
}
@@ -243,7 +243,7 @@ void cliffhgr_state::machine_start()
void cliffhgr_state::machine_reset()
{
m_port_bank = 0;
- m_phillips_code = 0;
+ m_philips_code = 0;
m_irq_timer->adjust(m_screen->time_until_pos(17), 17);
}
@@ -262,11 +262,11 @@ void cliffhgr_state::mainport(address_map &map)
map(0x44, 0x44).w("tms9928a", FUNC(tms9928a_device::vram_w));
map(0x45, 0x45).r("tms9928a", FUNC(tms9928a_device::vram_r));
map(0x46, 0x46).w(FUNC(cliffhgr_state::cliff_sound_overlay_w));
- map(0x50, 0x52).r(FUNC(cliffhgr_state::cliff_phillips_code_r));
+ map(0x50, 0x52).r(FUNC(cliffhgr_state::cliff_philips_code_r));
map(0x53, 0x53).r(FUNC(cliffhgr_state::cliff_irq_ack_r));
map(0x54, 0x54).w("tms9928a", FUNC(tms9928a_device::register_w));
map(0x55, 0x55).r("tms9928a", FUNC(tms9928a_device::register_r));
- map(0x57, 0x57).w(FUNC(cliffhgr_state::cliff_phillips_clear_w));
+ map(0x57, 0x57).w(FUNC(cliffhgr_state::cliff_philips_clear_w));
map(0x60, 0x60).w(FUNC(cliffhgr_state::cliff_port_bank_w));
map(0x62, 0x62).r(FUNC(cliffhgr_state::cliff_port_r));
map(0x64, 0x64).nopw(); /* unused in schematics, may be used as timing delay for IR interface */
@@ -689,17 +689,18 @@ INPUT_PORTS_END
*************************************/
MACHINE_CONFIG_START(cliffhgr_state::cliffhgr)
-
- MCFG_DEVICE_ADD("maincpu", Z80, 4000000) /* 4MHz */
- MCFG_DEVICE_PROGRAM_MAP(mainmem)
- MCFG_DEVICE_IO_MAP(mainport)
+ Z80(config, m_maincpu, 4000000); /* 4MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &cliffhgr_state::mainmem);
+ m_maincpu->set_addrmap(AS_IO, &cliffhgr_state::mainport);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_LASERDISC_PR8210_ADD("laserdisc")
- MCFG_LASERDISC_OVERLAY_DEVICE(tms9928a_device::TOTAL_HORZ, tms9928a_device::TOTAL_VERT_NTSC, "tms9928a", tms9928a_device, screen_update)
- MCFG_LASERDISC_OVERLAY_CLIP(tms9928a_device::HORZ_DISPLAY_START-12, tms9928a_device::HORZ_DISPLAY_START+32*8+12-1, tms9928a_device::VERT_DISPLAY_START_NTSC - 12, tms9928a_device::VERT_DISPLAY_START_NTSC+24*8+12-1)
+ PIONEER_PR8210(config, m_laserdisc, 0);
+ m_laserdisc->set_overlay(tms9928a_device::TOTAL_HORZ, tms9928a_device::TOTAL_VERT_NTSC, "tms9928a", FUNC(tms9928a_device::screen_update));
+ m_laserdisc->set_overlay_clip(tms9928a_device::HORZ_DISPLAY_START-12, tms9928a_device::HORZ_DISPLAY_START+32*8+12-1, tms9928a_device::VERT_DISPLAY_START_NTSC - 12, tms9928a_device::VERT_DISPLAY_START_NTSC+24*8+12-1);
+ m_laserdisc->add_route(0, "lspeaker", 1.0);
+ m_laserdisc->add_route(1, "rspeaker", 1.0);
/* start with the TMS9928a video configuration */
tms9128_device &vdp(TMS9128(config, "tms9928a", XTAL(10'738'635))); /* TMS9128NL on the board */
@@ -713,12 +714,7 @@ MACHINE_CONFIG_START(cliffhgr_state::cliffhgr)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_MODIFY("laserdisc")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
-
- MCFG_DEVICE_ADD("discrete", DISCRETE, cliffhgr_discrete)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
+ DISCRETE(config, m_discrete, cliffhgr_discrete).add_route(ALL_OUTPUTS, "lspeaker", 1.0);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/cromptons.cpp b/src/mame/drivers/cromptons.cpp
new file mode 100644
index 00000000000..fd1701f1977
--- /dev/null
+++ b/src/mame/drivers/cromptons.cpp
@@ -0,0 +1,150 @@
+// license:BSD-3-Clause
+// copyright-holders:AJR
+/*
+ Skeleton driver for Cromptons Leisure Machines' Frantic Fruits redemption game.
+
+ Hardware overview:
+ Main CPU: TS80C32X2-MCA
+ Sound: CD sound?
+ Other: M48T08 timekeeper RAM
+ OSC: 11.0592 MHz
+ Dips: 2 x 8 dips banks
+
+ Video: https://www.youtube.com/watch?v=89XJpor9dSQ
+*/
+
+#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
+#include "machine/74259.h"
+#include "machine/timekpr.h"
+#include "screen.h"
+
+class cromptons_state : public driver_device
+{
+public:
+ cromptons_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_outlatch(*this, "outlatch%u", 0U)
+ , m_inputs(*this, "IN%u", 0U)
+ { }
+
+ void cromptons(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+
+private:
+ u8 port_r();
+ void port_w(u8 data);
+
+ required_device<mcs51_cpu_device> m_maincpu;
+ required_device_array<hc259_device, 4> m_outlatch;
+ required_ioport_array<4> m_inputs;
+
+ void prg_map(address_map &map);
+ void io_map(address_map &map);
+
+ u8 m_port_select;
+};
+
+void cromptons_state::machine_start()
+{
+ save_item(NAME(m_port_select));
+}
+
+u8 cromptons_state::port_r()
+{
+ return BIT(m_inputs[(m_port_select & 0x18) >> 3]->read(), m_port_select & 0x07) ? 0xff : 0x7f;
+}
+
+void cromptons_state::port_w(u8 data)
+{
+ if (!BIT(data, 6))
+ m_outlatch[(data & 0x18) >> 3]->write_bit(data & 0x07, BIT(data, 5));
+
+ m_port_select = data;
+}
+
+void cromptons_state::prg_map(address_map &map)
+{
+ map(0x0000, 0xffff).rom().region("maincpu", 0);
+}
+
+void cromptons_state::io_map(address_map &map)
+{
+ map(0xe000, 0xffff).rw("timekpr", FUNC(timekeeper_device::read), FUNC(timekeeper_device::write));
+}
+
+static INPUT_PORTS_START( cromptons )
+ PORT_START("IN0")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+
+ PORT_START("IN1")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8")
+
+ PORT_START("IN2")
+ PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1")
+ PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2")
+ PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3")
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5")
+ PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6")
+ PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7")
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8")
+
+ PORT_START("IN3")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED)
+INPUT_PORTS_END
+
+
+void cromptons_state::cromptons(machine_config &config)
+{
+ /* basic machine hardware */
+ I80C32(config, m_maincpu, 11.0592_MHz_XTAL); // TS80C32X2-MCA
+ m_maincpu->set_addrmap(AS_PROGRAM, &cromptons_state::prg_map);
+ m_maincpu->set_addrmap(AS_IO, &cromptons_state::io_map);
+ m_maincpu->port_in_cb<1>().set(FUNC(cromptons_state::port_r));
+ m_maincpu->port_out_cb<1>().set(FUNC(cromptons_state::port_w));
+
+ MK48T08(config, "timekpr");
+
+ HC259(config, m_outlatch[0]); // types not verified
+ HC259(config, m_outlatch[1]);
+ HC259(config, m_outlatch[2]);
+ HC259(config, m_outlatch[3]);
+
+ // sound ??
+}
+
+/***************************************************************************
+
+ Game drivers
+
+***************************************************************************/
+
+ROM_START( ffruits )
+ ROM_REGION(0x10000, "maincpu", 0)
+ ROM_LOAD( "frntf5v6.ic11", 0x00000, 0x10000, CRC(ca60c557) SHA1(6f356827f0c93ec0376a7edc03963ef0748dccdb) ) // 27c512
+ROM_END
+
+
+GAME( 2000, ffruits, 0, cromptons, cromptons, cromptons_state, empty_init, ROT0, "Cromptons Leisure Machines", "Frantic Fruits", MACHINE_IS_SKELETON_MECHANICAL )
diff --git a/src/mame/drivers/deco_ld.cpp b/src/mame/drivers/deco_ld.cpp
index cad7ecbe2a0..8caa719787b 100644
--- a/src/mame/drivers/deco_ld.cpp
+++ b/src/mame/drivers/deco_ld.cpp
@@ -465,20 +465,22 @@ void deco_ld_state::machine_start()
MACHINE_CONFIG_START(deco_ld_state::rblaster)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",M6502,8000000/2)
- MCFG_DEVICE_PROGRAM_MAP(rblaster_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", deco_ld_state, irq0_line_hold)
+ M6502(config, m_maincpu, 8000000/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &deco_ld_state::rblaster_map);
+ m_maincpu->set_vblank_int("screen", FUNC(deco_ld_state::irq0_line_hold));
- MCFG_DEVICE_ADD("audiocpu",M6502,8000000/2)
- MCFG_DEVICE_PROGRAM_MAP(rblaster_sound_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(deco_ld_state, sound_interrupt, 640)
+ M6502(config, m_audiocpu, 8000000/2);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &deco_ld_state::rblaster_sound_map);
+ m_audiocpu->set_periodic_int(FUNC(deco_ld_state::sound_interrupt), attotime::from_hz(640));
// config.m_minimum_quantum = attotime::from_hz(6000);
- MCFG_LASERDISC_LDP1000_ADD("laserdisc")
- MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, deco_ld_state, screen_update_rblaster)
- //MCFG_LASERDISC_OVERLAY_CLIP(0, 256-1, 8, 240-1)
- MCFG_LASERDISC_OVERLAY_PALETTE(m_palette)
+ SONY_LDP1000(config, m_laserdisc, 0);
+ m_laserdisc->set_overlay(256, 256, FUNC(deco_ld_state::screen_update_rblaster));
+ //m_laserdisc->set_overlay_clip(0, 256-1, 8, 240-1);
+ m_laserdisc->set_overlay_palette(m_palette);
+ m_laserdisc->add_route(0, "lspeaker", 1.0);
+ m_laserdisc->add_route(1, "rspeaker", 1.0);
/* video hardware */
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
@@ -500,10 +502,6 @@ MACHINE_CONFIG_START(deco_ld_state::rblaster)
AY8910(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "lspeaker", 0.25).add_route(ALL_OUTPUTS, "rspeaker", 0.25);
AY8910(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "lspeaker", 0.25).add_route(ALL_OUTPUTS, "rspeaker", 0.25);
-
- MCFG_DEVICE_MODIFY("laserdisc")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/dlair.cpp b/src/mame/drivers/dlair.cpp
index 7540a61f0b6..2125123dc60 100644
--- a/src/mame/drivers/dlair.cpp
+++ b/src/mame/drivers/dlair.cpp
@@ -141,7 +141,7 @@ private:
optional_device<palette_device> m_palette;
optional_device<pioneer_ldv1000_device> m_ldv1000;
optional_device<pioneer_pr7820_device> m_pr7820;
- optional_device<phillips_22vp932_device> m_22vp932;
+ optional_device<philips_22vp932_device> m_22vp932;
optional_shared_ptr<uint8_t> m_videoram;
output_finder<16> m_digits;
@@ -744,18 +744,18 @@ void dlair_state::dlair_base(machine_config &config)
MACHINE_CONFIG_START(dlair_state::dlair_pr7820)
dlair_base(config);
- MCFG_LASERDISC_PR7820_ADD("ld_pr7820")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ PIONEER_PR7820(config, m_pr7820, 0);
+ m_pr7820->add_route(0, "lspeaker", 1.0);
+ m_pr7820->add_route(1, "rspeaker", 1.0);
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "ld_pr7820")
MACHINE_CONFIG_END
MACHINE_CONFIG_START(dlair_state::dlair_ldv1000)
dlair_base(config);
- MCFG_LASERDISC_LDV1000_ADD("ld_ldv1000")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ PIONEER_LDV1000(config, m_ldv1000, 0);
+ m_ldv1000->add_route(0, "lspeaker", 1.0);
+ m_ldv1000->add_route(1, "rspeaker", 1.0);
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "ld_ldv1000")
MACHINE_CONFIG_END
@@ -778,9 +778,11 @@ MACHINE_CONFIG_START(dlair_state::dleuro)
WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_hz(MASTER_CLOCK_EURO/(16*16*16*16*16*8)));
- MCFG_LASERDISC_22VP932_ADD("ld_22vp932")
- MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, dlair_state, screen_update_dleuro)
- MCFG_LASERDISC_OVERLAY_PALETTE(m_palette)
+ PHILIPS_22VP932(config, m_22vp932, 0);
+ m_22vp932->set_overlay(256, 256, FUNC(dlair_state::screen_update_dleuro));
+ m_22vp932->set_overlay_palette(m_palette);
+ m_22vp932->add_route(0, "lspeaker", 1.0);
+ m_22vp932->add_route(1, "rspeaker", 1.0);
/* video hardware */
MCFG_LASERDISC_SCREEN_ADD_PAL("screen", "ld_22vp932")
@@ -792,13 +794,9 @@ MACHINE_CONFIG_START(dlair_state::dleuro)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33)
-
- MCFG_DEVICE_MODIFY("ld_22vp932")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ SPEAKER_SOUND(config, m_speaker);
+ m_speaker->add_route(ALL_OUTPUTS, "lspeaker", 0.33);
+ m_speaker->add_route(ALL_OUTPUTS, "rspeaker", 0.33);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/esh.cpp b/src/mame/drivers/esh.cpp
index 4137a8e7b12..6fb6c3f2f08 100644
--- a/src/mame/drivers/esh.cpp
+++ b/src/mame/drivers/esh.cpp
@@ -361,17 +361,19 @@ void esh_state::machine_start()
/* DRIVER */
MACHINE_CONFIG_START(esh_state::esh)
/* main cpu */
- MCFG_DEVICE_ADD("maincpu", Z80, PCB_CLOCK/6) /* The denominator is a Daphne guess based on PacMan's hardware */
- MCFG_DEVICE_PROGRAM_MAP(z80_0_mem)
- MCFG_DEVICE_IO_MAP(z80_0_io)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", esh_state, vblank_callback_esh)
+ Z80(config, m_maincpu, PCB_CLOCK/6); /* The denominator is a Daphne guess based on PacMan's hardware */
+ m_maincpu->set_addrmap(AS_PROGRAM, &esh_state::z80_0_mem);
+ m_maincpu->set_addrmap(AS_IO, &esh_state::z80_0_io);
+ m_maincpu->set_vblank_int("screen", FUNC(esh_state::vblank_callback_esh));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_LASERDISC_LDV1000_ADD("laserdisc")
- MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(WRITELINE(*this, esh_state, ld_command_strobe_cb))
- MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, esh_state, screen_update_esh)
- MCFG_LASERDISC_OVERLAY_PALETTE(m_palette)
+ PIONEER_LDV1000(config, m_laserdisc, 0);
+ m_laserdisc->command_strobe_callback().set(FUNC(esh_state::ld_command_strobe_cb));
+ m_laserdisc->set_overlay(256, 256, FUNC(esh_state::screen_update_esh));
+ m_laserdisc->set_overlay_palette(m_palette);
+ m_laserdisc->add_route(0, "lspeaker", 1.0);
+ m_laserdisc->add_route(1, "rspeaker", 1.0);
/* video hardware */
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
@@ -383,12 +385,8 @@ MACHINE_CONFIG_START(esh_state::esh)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- MCFG_DEVICE_MODIFY("laserdisc")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("beeper", BEEP, 2000)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ BEEP(config, m_beep, 2000).add_route(ALL_OUTPUTS, "mono", 0.25);
MACHINE_CONFIG_END
// we just disable even lines so we can simulate line blinking
diff --git a/src/mame/drivers/fccpu20.cpp b/src/mame/drivers/fccpu20.cpp
index 16cec979f3a..df443f4841f 100644
--- a/src/mame/drivers/fccpu20.cpp
+++ b/src/mame/drivers/fccpu20.cpp
@@ -154,40 +154,47 @@ static void cpu21yb_vme_cards(device_slot_interface &device)
}
/* Machine configurations */
-MACHINE_CONFIG_START(cpu20_state::cpu20)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, cpu20_vme_cards, "fccpu20")
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(cpu20_state::cpu21s)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, cpu21s_vme_cards, "fccpu21s")
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(cpu20_state::cpu21)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, cpu21_vme_cards, "fccpu21")
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(cpu20_state::cpu21a)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, cpu21a_vme_cards, "fccpu21a")
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(cpu20_state::cpu21ya)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, cpu21ya_vme_cards, "fccpu21ya")
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(cpu20_state::cpu21b)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, cpu21b_vme_cards, "fccpu21b")
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(cpu20_state::cpu21yb)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, cpu21yb_vme_cards, "fccpu21yb")
-MACHINE_CONFIG_END
+void cpu20_state::cpu20(machine_config &config)
+{
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", cpu20_vme_cards, "fccpu20", 1, "vme");
+}
+
+void cpu20_state::cpu21s(machine_config &config)
+{
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", cpu21s_vme_cards, "fccpu21s", 1, "vme");
+}
+
+void cpu20_state::cpu21(machine_config &config)
+{
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", cpu21_vme_cards, "fccpu21", 1, "vme");
+}
+
+void cpu20_state::cpu21a(machine_config &config)
+{
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", cpu21a_vme_cards, "fccpu21a", 1, "vme");
+}
+
+void cpu20_state::cpu21ya(machine_config &config)
+{
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", cpu21ya_vme_cards, "fccpu21ya", 1, "vme");
+}
+
+void cpu20_state::cpu21b(machine_config &config)
+{
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", cpu21b_vme_cards, "fccpu21b", 1, "vme");
+}
+
+void cpu20_state::cpu21yb(machine_config &config)
+{
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", cpu21yb_vme_cards, "fccpu21yb", 1, "vme");
+}
/* ROM configurations */
ROM_START(fccpu20sbc) ROM_END
diff --git a/src/mame/drivers/fccpu30.cpp b/src/mame/drivers/fccpu30.cpp
index b2515727109..c7f5b9081f1 100644
--- a/src/mame/drivers/fccpu30.cpp
+++ b/src/mame/drivers/fccpu30.cpp
@@ -658,15 +658,16 @@ static void fccpu30_vme_cards(device_slot_interface &device)
/*
* Machine configuration
*/
-MACHINE_CONFIG_START(cpu30_state::cpu30)
+void cpu30_state::cpu30(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68030, XTAL(25'000'000))
- MCFG_DEVICE_PROGRAM_MAP(cpu30_mem)
- MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("fga002", fga002_device, iack)
+ M68030(config, m_maincpu, XTAL(25'000'000));
+ m_maincpu->set_addrmap(AS_PROGRAM, &cpu30_state::cpu30_mem);
+ m_maincpu->set_irq_acknowledge_callback("fga002", FUNC(fga002_device::iack));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD("vme", 1, fccpu30_vme_cards, nullptr)
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", fccpu30_vme_cards, nullptr, 1, "vme");
/* Terminal Port config */
/* Force CPU30 series of boards has up to four serial ports, p1-p4, the FGA boot uses p4 as console and subsequent
firmware uses p1 as console and in an operating system environment there may be user login shells on the other.
@@ -760,7 +761,7 @@ MACHINE_CONFIG_START(cpu30_state::cpu30)
// dual ported ram
RAM(config, m_ram).set_default_size("4M").set_extra_options("8M, 16M, 32M");
-MACHINE_CONFIG_END
+}
/* SYS68K/CPU-30X Part No.1 01300: 16.7 MHz 68030 based CPU board with 68882 FPCP, DMAC, 1 Mbyte Dual Ported RAM capacity and VMEPROM. */
MACHINE_CONFIG_START(cpu30_state::cpu30x)
diff --git a/src/mame/drivers/fcrash.cpp b/src/mame/drivers/fcrash.cpp
index 6637d526974..900a7d5cf90 100644
--- a/src/mame/drivers/fcrash.cpp
+++ b/src/mame/drivers/fcrash.cpp
@@ -360,7 +360,6 @@ WRITE16_MEMBER(cps_state::punipic_layer_w)
break;
}
- m_cps_a_regs[0x08 / 2] = m_mainram[0xdb90 / 2]; // fixes split objects
break;
case 0x07:
// unknown
@@ -481,7 +480,6 @@ WRITE16_MEMBER(cps_state::sf2mdta_layer_w)
case 0x09:
m_cps_a_regs[0x12 / 2] = data; /* scroll 2y */
m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */
- m_cps_a_regs[0x08 / 2] = m_mainram[0x802e / 2];
break;
case 0x0a:
m_cps_a_regs[0x10 / 2] = 0xffce; /* scroll 2x */
@@ -3375,8 +3373,8 @@ GAME( 1991, knightsb, knights, knightsb, knights, cps_state, init_dinopic,
GAME( 1993, mtwinsb, mtwins, mtwinsb, mtwins, cps_state, init_mtwinsb, ROT0, "David Inc. (bootleg)", "Twins (Mega Twins bootleg)", MACHINE_SUPPORTS_SAVE ) // based on World version
-GAME( 1993, punipic, punisher, punipic, punisher, cps_state, init_punipic, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 1)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC
-GAME( 1993, punipic2, punisher, punipic, punisher, cps_state, init_punipic, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 2)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC
+GAME( 1993, punipic, punisher, punipic, punisher, cps_state, init_punipic, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC
+GAME( 1993, punipic2, punisher, punipic, punisher, cps_state, init_punipic, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC
GAME( 1993, punipic3, punisher, punipic, punisher, cps_state, init_punipic3, ROT0, "bootleg", "The Punisher (bootleg with PIC16c57, set 3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930422 ETC
GAME( 1992, sf2m1, sf2ce, sf2m1, sf2, cps_state, init_sf2m1, ROT0, "bootleg", "Street Fighter II': Champion Edition (M1, bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // 920313 ETC
diff --git a/src/mame/drivers/fidel_card.cpp b/src/mame/drivers/fidel_card.cpp
index ac5ca22bb49..220dac8cca8 100644
--- a/src/mame/drivers/fidel_card.cpp
+++ b/src/mame/drivers/fidel_card.cpp
@@ -9,7 +9,7 @@ Fidelity electronic card games
- Advanced Bridge Challenger (UBC)
- Voice Bridge Challenger (VBRC)
- Bridge Challenger III (English,*French) (BV3)
-- *Gin & Cribbage Challenger (GIN)
+- Gin & Cribbage Challenger (GIN)
- *Skat Challenger (SKT)
*: not dumped yet
@@ -152,6 +152,15 @@ by the grids. hi = grid on, hi = segment on.
A detailed description of the hardware can be found also in the patent 4,373,719.
+cards:
+------
+Playing cards have a 9-bit barcode on the face side near the edge. Swipe them downward
+against the card scanner and the game will detect the card.
+Barcode sync bits(msb and lsb) are the same for each card so that leaves 7 bits of data:
+2 for suit, 4 for value, and 1 for parity so the card can't be scanned backwards.
+
+Two card decks exist (red and blue), each has the same set of barcodes.
+
******************************************************************************/
#include "emu.h"
@@ -165,8 +174,9 @@ A detailed description of the hardware can be found also in the patent 4,373,719
#include "speaker.h"
// internal artwork
-#include "fidel_vbrc.lh" // clickable
+#include "fidel_brc.lh" // clickable
#include "fidel_bv3.lh" // clickable
+#include "fidel_gin.lh" // clickable
namespace {
@@ -184,6 +194,7 @@ public:
void ubc(machine_config &config);
void vbrc(machine_config &config);
void bv3(machine_config &config);
+ void gin(machine_config &config);
virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button) override;
DECLARE_INPUT_CHANGED_MEMBER(start_scan);
@@ -402,114 +413,125 @@ static INPUT_PORTS_START( scanner )
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CHANGED_MEMBER(DEVICE_SELF, card_state, start_scan, 0xbd) PORT_NAME("Scan: Diamonds K")
INPUT_PORTS_END
-static INPUT_PORTS_START( vbrc )
+static INPUT_PORTS_START( brc )
PORT_INCLUDE( scanner )
PORT_START("IN.0")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("A")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_NAME("10")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("6")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("2")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("A")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("10")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2")
PORT_START("IN.1")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("K")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_NAME("9")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("5")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("1")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("K")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1")
PORT_START("IN.2")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Q")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("8")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("4")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("P")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("Q")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SLASH) PORT_NAME("P")
PORT_START("IN.3")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("J")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("7")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("3")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("NT")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME("J")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_STOP) PORT_NAME("NT")
PORT_START("IN.4")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("EN")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("SC")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("PL")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Spades")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("EN")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("SC")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("PL")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Spades")
PORT_START("IN.5")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CL")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("CL")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("DB")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("VL")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Hearts")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("VL")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Hearts")
PORT_START("IN.6")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Speaker")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("PB")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("CV")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Diamonds")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Speaker")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("PB")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("CV")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("Diamonds")
PORT_START("IN.7")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("BR")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("DL")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Clubs")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("BR")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("DL")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Clubs")
PORT_START("RESET") // is not on matrix IN.7 d0
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, card_state, reset_button, nullptr) PORT_NAME("RE")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_CHANGED_MEMBER(DEVICE_SELF, card_state, reset_button, nullptr) PORT_NAME("RE")
INPUT_PORTS_END
static INPUT_PORTS_START( bv3 )
- PORT_INCLUDE( scanner )
+ PORT_INCLUDE( brc )
- PORT_START("IN.0")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Ace")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_NAME("10")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("6")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("2")
+ PORT_MODIFY("IN.0")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("Ace")
- PORT_START("IN.1")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("King")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_NAME("9")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("5")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("1")
+ PORT_MODIFY("IN.1")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("King")
- PORT_START("IN.2")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Queen")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("8")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("4")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Quit")
+ PORT_MODIFY("IN.2")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("Queen")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SLASH) PORT_NAME("Quit")
- PORT_START("IN.3")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Jack")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("7")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("3")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("No Trump")
+ PORT_MODIFY("IN.3")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME("Jack")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_STOP) PORT_NAME("No Trump")
- PORT_START("IN.4")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Yes/Enter")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("No/Pass")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Player")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Spades")
+ PORT_MODIFY("IN.4")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Yes/Enter")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("No/Pass")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Player")
- PORT_START("IN.5")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Clear")
+ PORT_MODIFY("IN.5")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Clear")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Double")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Score")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Hearts")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Score")
- PORT_START("IN.6")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Speaker")
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Auto")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Conv")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Diamonds")
+ PORT_MODIFY("IN.6")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Auto")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Conv")
- PORT_START("IN.7")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Review")
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Dealer")
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Clubs")
+ PORT_MODIFY("IN.7")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Review")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Dealer")
- PORT_START("RESET") // is not on matrix IN.7 d0
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, card_state, reset_button, nullptr) PORT_NAME("Reset")
+ PORT_MODIFY("RESET")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_CHANGED_MEMBER(DEVICE_SELF, card_state, reset_button, nullptr) PORT_NAME("Reset")
+INPUT_PORTS_END
+
+static INPUT_PORTS_START( gin )
+ PORT_INCLUDE( bv3 )
+
+ PORT_MODIFY("IN.2")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SLASH) PORT_NAME("Human")
+
+ PORT_MODIFY("IN.3")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_STOP) PORT_NAME("Computer")
+
+ PORT_MODIFY("IN.4")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Yes/Go")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("No")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Hand")
+
+ PORT_MODIFY("IN.5")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Score")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Conv")
+
+ PORT_MODIFY("IN.6")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Quit")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Language")
+
+ PORT_MODIFY("IN.7")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Knock")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Dealer")
INPUT_PORTS_END
@@ -546,7 +568,7 @@ void card_state::brc_base(machine_config &config)
TIMER(config, "barcode_shift").configure_periodic(FUNC(card_state::barcode_shift), attotime::from_msec(2));
TIMER(config, "display_decay").configure_periodic(FUNC(card_state::display_decay_tick), attotime::from_msec(1));
- config.set_default_layout(layout_fidel_vbrc);
+ config.set_default_layout(layout_fidel_brc);
}
void card_state::ubc(machine_config &config)
@@ -576,6 +598,12 @@ void card_state::bv3(machine_config &config)
config.set_default_layout(layout_fidel_bv3);
}
+void card_state::gin(machine_config &config)
+{
+ ubc(config);
+ config.set_default_layout(layout_fidel_gin);
+}
+
/******************************************************************************
@@ -619,6 +647,17 @@ ROM_START( bridgec3 ) // model BV3 aka 7014, PCB label 510-1016 Rev.1
ROM_LOAD("101-32118", 0x0000, 0x1000, CRC(a0b8bb8f) SHA1(f56852108928d5c6caccfc8166fa347d6760a740) ) // ea 101-32118 || (C) 1980 || EA 8332A247-4 || 8034
ROM_END
+
+ROM_START( gincribc ) // model GIN, PCB label 510-4020-1C
+ ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_LOAD("101-1036a01", 0x0000, 0x2000, CRC(30d8d900) SHA1(b31a4acc52143baad28a35ec515ab30d7b39683a) ) // MOSTEK MK36974N-5
+ ROM_LOAD("101-1037a02", 0x2000, 0x2000, CRC(8802a71b) SHA1(416350acc1cbf38ff74194d49916b848bf6c2330) ) // MOSTEK MK36976N-5
+ ROM_LOAD("bridge-3", 0x4000, 0x1000, CRC(d3cda2e3) SHA1(69b62fa22b388a922abad4e89c78bdb01a5fb322) ) // NEC 2332C 188
+
+ ROM_REGION( 0x0400, "mcu", 0 )
+ ROM_LOAD("100-1009", 0x0000, 0x0400, CRC(60eb343f) SHA1(8a63e95ebd62e123bdecc330c0484a47c354bd1a) )
+ROM_END
+
} // anonymous namespace
@@ -628,7 +667,9 @@ ROM_END
******************************************************************************/
// YEAR NAME PARENT CMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS
-CONS( 1980, vbrc, 0, 0, vbrc, vbrc, card_state, empty_init, "Fidelity Electronics", "Voice Bridge Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
-CONS( 1980, bridgeca, vbrc, 0, ubc, vbrc, card_state, empty_init, "Fidelity Electronics", "Advanced Bridge Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
+CONS( 1980, vbrc, 0, 0, vbrc, brc, card_state, empty_init, "Fidelity Electronics", "Voice Bridge Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
+CONS( 1980, bridgeca, vbrc, 0, ubc, brc, card_state, empty_init, "Fidelity Electronics", "Advanced Bridge Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
CONS( 1982, bridgec3, 0, 0, bv3, bv3, card_state, empty_init, "Fidelity Electronics", "Bridge Challenger III", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
+
+CONS( 1982, gincribc, 0, 0, gin, gin, card_state, empty_init, "Fidelity Electronics", "Gin & Cribbage Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
diff --git a/src/mame/drivers/fidel_csc.cpp b/src/mame/drivers/fidel_csc.cpp
index 367f05551da..36da2d7083e 100644
--- a/src/mame/drivers/fidel_csc.cpp
+++ b/src/mame/drivers/fidel_csc.cpp
@@ -12,7 +12,7 @@ Fidelity CSC(and derived) hardware
- Reversi Sensory Challenger
TODO:
-- is the original csce the same program+bookrom as the upgraded one?
+- verify csce original roms (current set came from an overclock mod)
- hook up csce I/O properly, it doesn't have PIAs
*******************************************************************************
@@ -159,7 +159,7 @@ Elite Champion Challenger
This is a limited-release chess computer based on the CSC. They removed the PIAs
and did the I/O with TTL instead (PIAs will still work from software point of view).
---------------------------------
-R6502 CPU @ 4MHz
+R6502B? CPU @ 4MHz
32KB ROMs total size, 4KB RAM(8*HM6147P)
In the 90s, Wilfried Bucke provided an upgrade to make it more similar to the one
@@ -197,7 +197,6 @@ PCB label 510-1035A01
#include "includes/fidelbase.h"
#include "cpu/m6502/m6502.h"
-#include "cpu/m6502/r65c02.h"
#include "machine/6821pia.h"
#include "sound/volt_reg.h"
#include "speaker.h"
@@ -220,7 +219,7 @@ public:
// machine drivers
void csc(machine_config &config);
- void cscetr(machine_config &config);
+ void csce(machine_config &config);
void su9(machine_config &config);
void rsc(machine_config &config);
@@ -273,7 +272,7 @@ void su9_state::su9_set_cpu_freq()
{
// SU9 CPU is clocked 1.95MHz, DS9 is 2.5MHz, SCC is 3MHz
u8 inp = ioport("FAKE")->read();
- m_maincpu->set_unscaled_clock((inp & 2) ? (6_MHz_XTAL/2) : ((inp & 1) ? (5_MHz_XTAL/2) : (3.9_MHz_XTAL/2)));
+ m_maincpu->set_unscaled_clock((inp & 2) ? (3_MHz_XTAL) : ((inp & 1) ? (5_MHz_XTAL/2) : (3.9_MHz_XTAL/2)));
}
@@ -483,9 +482,9 @@ static INPUT_PORTS_START( su9 )
PORT_START("FAKE")
PORT_CONFNAME( 0x03, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, su9_state, su9_cpu_freq, nullptr) // factory set
- PORT_CONFSETTING( 0x00, "1.95MHz (SU9)" )
- PORT_CONFSETTING( 0x01, "2.5MHz (DS9)" )
- PORT_CONFSETTING( 0x02, "3MHz (SCC)" )
+ PORT_CONFSETTING( 0x00, "1.95MHz (original)" )
+ PORT_CONFSETTING( 0x01, "2.5MHz (Deluxe)" )
+ PORT_CONFSETTING( 0x02, "3MHz (Septennial)" )
INPUT_PORTS_END
static INPUT_PORTS_START( rsc )
@@ -547,12 +546,12 @@ void csc_state::csc(machine_config &config)
VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
}
-void csc_state::cscetr(machine_config &config)
+void csc_state::csce(machine_config &config)
{
csc(config);
/* basic machine hardware */
- R65C02(config.replace(), m_maincpu, 5_MHz_XTAL); // R65C02P4
+ m_maincpu->set_clock(4_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &csc_state::su9_map);
}
@@ -629,7 +628,7 @@ ROM_START( csc )
ROMX_LOAD("101-64106", 0x0000, 0x2000, CRC(8766e128) SHA1(78c7413bf240159720b131ab70bfbdf4e86eb1e9), ROM_BIOS(3) )
ROM_END
-ROM_START( cscetr )
+ROM_START( csce )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD("03", 0x2000, 0x2000, CRC(22e43531) SHA1(696dc019bea3812ae6cf9c2b2c4d3a7b9017807d) )
ROM_LOAD("02", 0xa000, 0x2000, CRC(e593f114) SHA1(4dc5a2456a87c128235958f046cee9502cb3ac65) )
@@ -706,7 +705,7 @@ ROM_END
// YEAR NAME PARENT CMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS
CONS( 1981, csc, 0, 0, csc, csc, csc_state, empty_init, "Fidelity Electronics", "Champion Sensory Chess Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
-CONS( 199?, cscetr, 0, 0, cscetr, csc, csc_state, empty_init, "hack (Wilfried Bucke)", "Elite Champion Challenger (Travemünde upgrade)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
+CONS( 1981, csce, 0, 0, csce, csc, csc_state, empty_init, "Fidelity Electronics", "Elite Champion Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
CONS( 1983, super9cc, 0, 0, su9, su9, su9_state, empty_init, "Fidelity Electronics", "Super 9 Sensory Chess Challenger", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
diff --git a/src/mame/drivers/fidel_elite.cpp b/src/mame/drivers/fidel_elite.cpp
index ced7728796a..b3b2bc3ac56 100644
--- a/src/mame/drivers/fidel_elite.cpp
+++ b/src/mame/drivers/fidel_elite.cpp
@@ -27,8 +27,8 @@ hardware overview:
- module slot and printer port
- PCB label 510-1071A01
-*It was advertised as 3.2, 3.6, or 4MHz, with unofficial modifications up to 8MHz.
-PCB photos show only a 3MHz XTAL.
+*In West Germany, some distributors released it with overclocked CPUs,
+advertised as 3.2, 3.6, or 4MHz. Unmodified EAS PCB photos show only a 3MHz XTAL.
A condensator keeps RAM contents alive for a few hours when powered off.
@@ -39,8 +39,8 @@ this module is the same as CB16 but at different form factor.
Elite Avant Garde (models 6081,6088,6089) is on the same hardware as EAS.
-Fidelity Private Line is a modified EAS. They took out the motherboard and leds
-and placed them a little box separate from a (ledless) magnetic chessboard.
+Fidelity Private Line is a modified EAS Glasgow. They took out the motherboard
+and leds and placed them a little box separate from a (ledless) magnetic chessboard.
It was probably only released in Germany.
******************************************************************************/
@@ -638,7 +638,7 @@ ROM_END
// YEAR NAME PARENT CMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS
CONS( 1983, feasbu, 0, 0, eas, eas, elite_state, empty_init, "Fidelity Electronics", "Elite A/S Challenger (Budapest program)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS | MACHINE_IMPERFECT_TIMING )
CONS( 1984, feasgla, feasbu, 0, eas, eas, elite_state, empty_init, "Fidelity Electronics", "Elite A/S Challenger (Glasgow program)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS | MACHINE_IMPERFECT_TIMING )
-CONS( 1984, fepriv, feasbu, 0, eas_priv, eas, elite_state, empty_init, "Fidelity Electronics", "Elite Private Line (red version)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS | MACHINE_IMPERFECT_TIMING ) // by Fidelity West Germany
+CONS( 1984, fepriv, feasbu, 0, eas_priv, eas, elite_state, empty_init, "Fidelity Deutschland", "Elite Private Line (red version)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS | MACHINE_IMPERFECT_TIMING )
CONS( 1982, fpres, 0, 0, pc, eas, elite_state, empty_init, "Fidelity Electronics", "Prestige Challenger (original program)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS | MACHINE_IMPERFECT_TIMING )
CONS( 1983, fpresbu, fpres, 0, pc, eas, elite_state, empty_init, "Fidelity Electronics", "Prestige Challenger (Budapest program)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS | MACHINE_IMPERFECT_TIMING )
diff --git a/src/mame/drivers/fidel_sc9.cpp b/src/mame/drivers/fidel_sc9.cpp
index a6e48128a2e..671782c6447 100644
--- a/src/mame/drivers/fidel_sc9.cpp
+++ b/src/mame/drivers/fidel_sc9.cpp
@@ -292,4 +292,4 @@ ROM_END
CONS( 1982, fscc9, 0, 0, sc9d, sc9, sc9_state, empty_init, "Fidelity Electronics", "Sensory Chess Challenger 9 (rev. D)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS ) // aka version "B"
CONS( 1982, fscc9b, fscc9, 0, sc9b, sc9, sc9_state, empty_init, "Fidelity Electronics", "Sensory Chess Challenger 9 (rev. B)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
CONS( 1982, fscc9c, fscc9, 0, sc9b, sc9c, sc9c_state, empty_init, "Fidelity Electronics", "Sensory Chess Challenger 9 (rev. C)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
-CONS( 1983, fscc9ps, fscc9, 0, playmatic, playmatic, sc9_state, empty_init, "Fidelity Electronics", "Sensory 9 Playmatic 'S'", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS ) // by Fidelity West Germany
+CONS( 1983, fscc9ps, fscc9, 0, playmatic, playmatic, sc9_state, empty_init, "Fidelity Deutschland", "Sensory 9 Playmatic 'S'", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_CONTROLS )
diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp
index e7759684dcb..5f0329ae858 100644
--- a/src/mame/drivers/firefox.cpp
+++ b/src/mame/drivers/firefox.cpp
@@ -103,14 +103,14 @@ private:
uint32_t screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(video_timer_callback);
void set_rgba( int start, int index, unsigned char *palette_ram );
- void firq_gen(phillips_22vp931_device &laserdisc, int state);
+ void firq_gen(philips_22vp931_device &laserdisc, int state);
virtual void machine_start() override;
virtual void video_start() override;
void audio_map(address_map &map);
void main_map(address_map &map);
- required_device<phillips_22vp931_device> m_laserdisc;
+ required_device<philips_22vp931_device> m_laserdisc;
required_shared_ptr<unsigned char> m_tileram;
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<unsigned char> m_sprite_palette;
@@ -445,7 +445,7 @@ WRITE_LINE_MEMBER(firefox_state::coin_counter_left_w)
}
-void firefox_state::firq_gen(phillips_22vp931_device &laserdisc, int state)
+void firefox_state::firq_gen(philips_22vp931_device &laserdisc, int state)
{
if (state)
m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE );
@@ -456,7 +456,7 @@ void firefox_state::machine_start()
{
m_mainbank->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x1000);
- m_laserdisc->set_data_ready_callback(phillips_22vp931_device::data_ready_delegate(&firefox_state::firq_gen, this));
+ m_laserdisc->set_data_ready_callback(philips_22vp931_device::data_ready_delegate(&firefox_state::firq_gen, this));
m_sprite_bank = 0;
}
@@ -650,13 +650,13 @@ GFXDECODE_END
MACHINE_CONFIG_START(firefox_state::firefox)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", MC6809E, MASTER_XTAL/8) // 68B09E
- MCFG_DEVICE_PROGRAM_MAP(main_map)
+ MC6809E(config, m_maincpu, MASTER_XTAL/8); // 68B09E
+ m_maincpu->set_addrmap(AS_PROGRAM, &firefox_state::main_map);
/* interrupts count starting at end of VBLANK, which is 44, so add 44 */
TIMER(config, "32v").configure_scanline(FUNC(firefox_state::video_timer_callback), "screen", 96+44, 128);
- MCFG_DEVICE_ADD("audiocpu", M6502, MASTER_XTAL/8)
- MCFG_DEVICE_PROGRAM_MAP(audio_map)
+ M6502(config, m_audiocpu, MASTER_XTAL/8);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &firefox_state::audio_map);
config.m_minimum_quantum = attotime::from_hz(60000);
@@ -688,12 +688,14 @@ MACHINE_CONFIG_START(firefox_state::firefox)
/* video hardware */
GFXDECODE(config, m_gfxdecode, m_palette, gfx_firefox);
- MCFG_PALETTE_ADD("palette", 512)
+ PALETTE(config, m_palette).set_entries(512);
- MCFG_LASERDISC_22VP931_ADD("laserdisc")
- MCFG_LASERDISC_OVERLAY_DRIVER(64*8, 525, firefox_state, screen_update_firefox)
- MCFG_LASERDISC_OVERLAY_CLIP(7*8, 53*8-1, 44, 480+44)
- MCFG_LASERDISC_OVERLAY_PALETTE("palette")
+ PHILIPS_22VP931(config, m_laserdisc, 0);
+ m_laserdisc->set_overlay(64*8, 525, FUNC(firefox_state::screen_update_firefox));
+ m_laserdisc->set_overlay_clip(7*8, 53*8-1, 44, 480+44);
+ m_laserdisc->set_overlay_palette(m_palette);
+ m_laserdisc->add_route(0, "lspeaker", 0.50);
+ m_laserdisc->add_route(1, "rspeaker", 0.50);
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
@@ -716,29 +718,25 @@ MACHINE_CONFIG_START(firefox_state::firefox)
GENERIC_LATCH_8(config, m_soundlatch2);
- MCFG_DEVICE_ADD("pokey1", POKEY, MASTER_XTAL/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
+ pokey_device &pokey1(POKEY(config, "pokey1", MASTER_XTAL/8));
+ pokey1.add_route(ALL_OUTPUTS, "lspeaker", 0.30);
+ pokey1.add_route(ALL_OUTPUTS, "rspeaker", 0.30);
- MCFG_DEVICE_ADD("pokey2", POKEY, MASTER_XTAL/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
+ pokey_device &pokey2(POKEY(config, "pokey2", MASTER_XTAL/8));
+ pokey2.add_route(ALL_OUTPUTS, "lspeaker", 0.30);
+ pokey2.add_route(ALL_OUTPUTS, "rspeaker", 0.30);
- MCFG_DEVICE_ADD("pokey3", POKEY, MASTER_XTAL/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
+ pokey_device &pokey3(POKEY(config, "pokey3", MASTER_XTAL/8));
+ pokey3.add_route(ALL_OUTPUTS, "lspeaker", 0.30);
+ pokey3.add_route(ALL_OUTPUTS, "rspeaker", 0.30);
- MCFG_DEVICE_ADD("pokey4", POKEY, MASTER_XTAL/8)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
+ pokey_device &pokey4(POKEY(config, "pokey4", MASTER_XTAL/8));
+ pokey4.add_route(ALL_OUTPUTS, "lspeaker", 0.30);
+ pokey4.add_route(ALL_OUTPUTS, "rspeaker", 0.30);
- MCFG_DEVICE_ADD("tms", TMS5220, MASTER_XTAL/2/11)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75)
-
- MCFG_DEVICE_MODIFY("laserdisc")
- MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
+ TMS5220(config, m_tms, MASTER_XTAL/2/11);
+ m_tms->add_route(ALL_OUTPUTS, "lspeaker", 0.75);
+ m_tms->add_route(ALL_OUTPUTS, "rspeaker", 0.75);
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/force68k.cpp b/src/mame/drivers/force68k.cpp
index 974008b452d..d7fe7fd7ada 100644
--- a/src/mame/drivers/force68k.cpp
+++ b/src/mame/drivers/force68k.cpp
@@ -543,15 +543,16 @@ static void fccpu1_vme_cards(device_slot_interface &device)
/*
* Machine configuration
*/
-MACHINE_CONFIG_START(force68k_state::fccpu1)
+void force68k_state::fccpu1(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000) / 2)
- MCFG_DEVICE_PROGRAM_MAP(force68k_mem)
+ M68000(config, m_maincpu, XTAL(16'000'000) / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &force68k_state::force68k_mem);
/* P3/Host Port config
* LO command causes ROM monitor to expect S-records on HOST port by default
* Implementation through nullmodem currently does not support handshakes so
- * the ROM momitor is over-run while checking for checksums etc if used with
+ * the ROM monitor is over-run while checking for checksums etc if used with
* UI mount <file> feature.
*/
ACIA6850(config, m_aciahost, 0);
@@ -608,9 +609,9 @@ MACHINE_CONFIG_START(force68k_state::fccpu1)
fccpu1_eprom_sockets(config);
// VME interface
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD("vme", 1, fccpu1_vme_cards, nullptr)
-MACHINE_CONFIG_END
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", fccpu1_vme_cards, nullptr, 1, "vme");
+}
#if 0 /*
* CPU-6 family is device and adressmap compatible with CPU-1 but with additions
diff --git a/src/mame/drivers/gkigt.cpp b/src/mame/drivers/gkigt.cpp
index ee2a2b2a637..44254b69912 100644
--- a/src/mame/drivers/gkigt.cpp
+++ b/src/mame/drivers/gkigt.cpp
@@ -86,7 +86,7 @@ PCB board that connects to 044 boards via J6 & J7
or 039 EPROM + SIMM software
More chips (from eBay auction):
- 2x Phillips / NXT 28C94 quad UART (8 serial channels total)
+ 2x Philips / NXT 28C94 quad UART (8 serial channels total)
ADV476 256 color RAMDAC
*/
diff --git a/src/mame/drivers/gp32.cpp b/src/mame/drivers/gp32.cpp
index 9efc64a022f..9dcca0f150b 100644
--- a/src/mame/drivers/gp32.cpp
+++ b/src/mame/drivers/gp32.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Tim Schuerewegen
/**************************************************************************
*
- * gp32.c - Game Park GP32
+ * gp32.cpp - Game Park GP32
* Driver by Tim Schuerewegen
*
* CPU: Samsung S3C2400X01 SoC
@@ -1609,7 +1609,7 @@ void gp32_state::s3c240x_machine_start()
m_s3c240x_iic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iic_timer_exp),this), (void *)(uintptr_t)0);
m_s3c240x_iis_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iis_timer_exp),this), (void *)(uintptr_t)0);
m_s3c240x_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_lcd_timer_exp),this), (void *)(uintptr_t)0);
- m_eeprom_data = std::make_unique<uint8_t[]>(0x2000);
+ m_eeprom_data = std::make_unique<uint8_t[]>(0x2000); // a dump of the EEPROM (S524AB0X91) resulted to be 0x1000
m_nvram->set_base(m_eeprom_data.get(), 0x2000);
smc_init();
i2s_init();
@@ -1673,18 +1673,19 @@ void gp32_state::machine_reset()
s3c240x_machine_reset();
}
-MACHINE_CONFIG_START(gp32_state::gp32)
- MCFG_DEVICE_ADD("maincpu", ARM9, 40000000)
- MCFG_DEVICE_PROGRAM_MAP(gp32_map)
+void gp32_state::gp32(machine_config &config)
+{
+ ARM9(config, m_maincpu, 40000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &gp32_state::gp32_map);
- MCFG_PALETTE_ADD("palette", 32768)
+ PALETTE(config, m_palette).set_entries(32768);
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(240, 320)
- MCFG_SCREEN_VISIBLE_AREA(0, 239, 0, 319)
- MCFG_SCREEN_UPDATE_DRIVER(gp32_state, screen_update_gp32)
+ SCREEN(config, m_screen, SCREEN_TYPE_LCD);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_size(240, 320);
+ m_screen->set_visarea(0, 239, 0, 319);
+ m_screen->set_screen_update(FUNC(gp32_state::screen_update_gp32));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
@@ -1699,7 +1700,7 @@ MACHINE_CONFIG_START(gp32_state::gp32)
SMARTMEDIA(config, m_smartmedia, 0);
SOFTWARE_LIST(config, "memc_list").set_original("gp32");
-MACHINE_CONFIG_END
+}
ROM_START( gp32 )
ROM_REGION( 0x80000, "maincpu", 0 )
@@ -1717,6 +1718,9 @@ ROM_START( gp32 )
ROM_SYSTEM_BIOS( 5, "test", "test" )
ROMX_LOAD( "test.bin", 0x000000, 0x080000, CRC(00000000) SHA1(0000000000000000000000000000000000000000), ROM_BIOS(5) )
#endif
+
+ ROM_REGION( 0x4000, "plds", ROMREGION_ERASEFF )
+ ROM_LOAD( "x2c32.jed", 0, 0x3bbb, CRC(eeec10d8) SHA1(34c4b1b865511517a5de1fa352228d95cda387c5) ) // JEDEC format for the time being. X2C32: 32 Macrocell CoolRunner-II CPLD
ROM_END
CONS(2001, gp32, 0, 0, gp32, gp32, gp32_state, empty_init, "Game Park Holdings", "GP32", ROT270|MACHINE_NOT_WORKING|MACHINE_NO_SOUND)
diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp
index 75e4032081f..69b6a3d781c 100644
--- a/src/mame/drivers/hh_cop400.cpp
+++ b/src/mame/drivers/hh_cop400.cpp
@@ -11,7 +11,7 @@
- vidchal: Add screen and gun cursor with brightness detection callback,
and softwarelist for the video tapes. We'd also need a VHS player device.
The emulated lightgun itself appears to be working fine(eg. add a 30hz
- timer to IN3 to score +100)
+ timer to IN.3 to score +100)
***************************************************************************/
@@ -22,7 +22,6 @@
#include "sound/spkrdev.h"
#include "sound/dac.h"
#include "sound/volt_reg.h"
-//#include "rendlay.h"
#include "screen.h"
#include "speaker.h"
@@ -48,8 +47,8 @@
class hh_cop400_state : public driver_device
{
public:
- hh_cop400_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ hh_cop400_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_inp_matrix(*this, "IN.%u", 0),
m_out_x(*this, "%u.%u", 0U, 0U),
@@ -348,6 +347,7 @@ void ctstein_state::ctstein(machine_config &config)
An earlier revision of this runs on TMS1000, see hh_tms1k.cpp driver. Model
numbers are the same. From the outside, an easy way to spot the difference is
the Start/Display button: TMS1000 version button label is D, COP420 one is a *.
+ The COP420 version also plays much slower.
***************************************************************************/
@@ -457,8 +457,8 @@ INPUT_PORTS_END
void h2hbaskbc_state::h2hbaskbc(machine_config &config)
{
/* basic machine hardware */
- COP420(config, m_maincpu, 850000); // approximation - RC osc. R=43K, C=101pF
- m_maincpu->set_config(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed
+ COP420(config, m_maincpu, 1000000); // approximation - RC osc. R=43K, C=101pF
+ m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed
m_maincpu->write_d().set(FUNC(h2hbaskbc_state::write_d));
m_maincpu->write_g().set(FUNC(h2hbaskbc_state::write_g));
m_maincpu->write_l().set(FUNC(h2hbaskbc_state::write_l));
@@ -1914,7 +1914,7 @@ ROM_END
// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
CONS( 1979, ctstein, 0, 0, ctstein, ctstein, ctstein_state, empty_init, "Castle Toy", "Einstein (Castle Toy)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
-CONS( 1980, h2hbaskbc, 0, 0, h2hbaskbc, h2hbaskbc, h2hbaskbc_state, empty_init, "Coleco", "Head to Head: Electronic Basketball (COP420L version)", MACHINE_SUPPORTS_SAVE )
+CONS( 1980, h2hbaskbc, h2hbaskb, 0, h2hbaskbc, h2hbaskbc, h2hbaskbc_state, empty_init, "Coleco", "Head to Head: Electronic Basketball (COP420L version)", MACHINE_SUPPORTS_SAVE )
CONS( 1980, h2hhockeyc, h2hhockey, 0, h2hhockeyc, h2hhockeyc, h2hbaskbc_state, empty_init, "Coleco", "Head to Head: Electronic Hockey (COP420L version)", MACHINE_SUPPORTS_SAVE )
CONS( 1980, h2hsoccerc, 0, 0, h2hsoccerc, h2hsoccerc, h2hbaskbc_state, empty_init, "Coleco", "Head to Head: Electronic Soccer (COP420L version)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp
index 5408932444c..2aecf87783d 100644
--- a/src/mame/drivers/hh_sm510.cpp
+++ b/src/mame/drivers/hh_sm510.cpp
@@ -21,7 +21,6 @@
#include "includes/hh_sm510.h"
#include "cpu/sm510/sm500.h"
-#include "rendlay.h"
#include "screen.h"
#include "speaker.h"
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp
index b4847749c57..1d1c252442f 100644
--- a/src/mame/drivers/hh_tms1k.cpp
+++ b/src/mame/drivers/hh_tms1k.cpp
@@ -69,7 +69,7 @@
*MP3232 TMS1000 1979, Fonas 2-Player Baseball (no "MP" on chip label)
@MP3300 TMS1000 1979, Milton Bradley Simon (Rev F)
@MP3301A TMS1000 1979, Milton Bradley Big Trak
- *MP3320A TMS1000 1979, Coleco Head to Head: Electronic Basketball
+ @MP3320A TMS1000 1979, Coleco Head to Head: Electronic Basketball
@MP3321A TMS1000 1979, Coleco Head to Head: Electronic Hockey
*MP3352 TMS1200 1979, Tiger Sub Wars (model 7-490)
@M32001 TMS1000 1981, Coleco Quiz Wiz Challenger (note: MP3398, MP3399, M3200x?)
@@ -198,6 +198,7 @@
#include "gjackpot.lh"
#include "gpoker.lh"
#include "h2hbaseb.lh"
+#include "h2hbaskb.lh"
#include "h2hboxing.lh"
#include "h2hfootb.lh"
#include "h2hhockey.lh"
@@ -1475,18 +1476,22 @@ void h2hfootb_state::h2hfootb(machine_config &config)
/***************************************************************************
+ Coleco Head to Head: Electronic Basketball (model 2150)
+ * TMS1000NLL MP3320A (die label 1000E MP3320A)
+ * 2-digit 7seg LED display, LED grid display, 1-bit sound
+
Coleco Head to Head: Electronic Hockey (model 2160)
* TMS1000NLL E MP3321A (die label 1000E MP3321A)
- * 2-digit 7seg LED display, LED grid display, 1-bit sound
+ * same PCB/hardware as above
Unlike the COP420 version(see hh_cop400.cpp driver), each game has its own MCU.
***************************************************************************/
-class h2hhockey_state : public hh_tms1k_state
+class h2hbaskb_state : public hh_tms1k_state
{
public:
- h2hhockey_state(const machine_config &mconfig, device_type type, const char *tag)
+ h2hbaskb_state(const machine_config &mconfig, device_type type, const char *tag)
: hh_tms1k_state(mconfig, type, tag),
m_cap_empty_timer(*this, "cap_empty")
{ }
@@ -1500,6 +1505,7 @@ public:
DECLARE_WRITE16_MEMBER(write_r);
DECLARE_WRITE16_MEMBER(write_o);
DECLARE_READ8_MEMBER(read_k);
+ void h2hbaskb(machine_config &config);
void h2hhockey(machine_config &config);
protected:
@@ -1508,13 +1514,13 @@ protected:
// handlers
-TIMER_DEVICE_CALLBACK_MEMBER(h2hhockey_state::cap_empty_callback)
+TIMER_DEVICE_CALLBACK_MEMBER(h2hbaskb_state::cap_empty_callback)
{
if (~m_r & 0x200)
m_cap_state = false;
}
-void h2hhockey_state::prepare_display()
+void h2hbaskb_state::prepare_display()
{
// R6,R7 are commons for R0-R5
u16 sel = 0;
@@ -1525,7 +1531,7 @@ void h2hhockey_state::prepare_display()
display_matrix(7, 6+6, m_o, sel);
}
-WRITE16_MEMBER(h2hhockey_state::write_r)
+WRITE16_MEMBER(h2hbaskb_state::write_r)
{
// R0-R3: input mux
m_inp_mux = (data & 0xf);
@@ -1558,14 +1564,14 @@ WRITE16_MEMBER(h2hhockey_state::write_r)
prepare_display();
}
-WRITE16_MEMBER(h2hhockey_state::write_o)
+WRITE16_MEMBER(h2hbaskb_state::write_o)
{
// O1-O7: led data
m_o = data >> 1 & 0x7f;
prepare_display();
}
-READ8_MEMBER(h2hhockey_state::read_k)
+READ8_MEMBER(h2hbaskb_state::read_k)
{
// K1-K4: multiplexed inputs, K8: R9 and capacitor
return (read_inputs(4) & 7) | (m_cap_state ? 8 : 0);
@@ -1573,7 +1579,7 @@ READ8_MEMBER(h2hhockey_state::read_k)
// config
-static INPUT_PORTS_START( h2hhockey )
+static INPUT_PORTS_START( h2hbaskb )
PORT_START("IN.0") // R0
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_NAME("P1 Pass CW") // clockwise
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_NAME("P1 Pass CCW") // counter-clockwise
@@ -1594,12 +1600,20 @@ static INPUT_PORTS_START( h2hhockey )
PORT_CONFSETTING( 0x04, "2" )
PORT_START("IN.3") // R3
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
+INPUT_PORTS_END
+
+static INPUT_PORTS_START( h2hhockey )
+ PORT_INCLUDE( h2hbaskb )
+
+ PORT_MODIFY("IN.3") // R3
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL PORT_NAME("P2 Goalie Right")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_NAME("P2 Goalie Left")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
-void h2hhockey_state::machine_start()
+void h2hbaskb_state::machine_start()
{
hh_tms1k_state::machine_start();
@@ -1611,18 +1625,18 @@ void h2hhockey_state::machine_start()
save_item(NAME(m_cap_charge));
}
-void h2hhockey_state::h2hhockey(machine_config &config)
+void h2hbaskb_state::h2hbaskb(machine_config &config)
{
/* basic machine hardware */
TMS1000(config, m_maincpu, 375000); // approximation - RC osc. R=43K, C=100pF
- m_maincpu->k().set(FUNC(h2hhockey_state::read_k));
- m_maincpu->r().set(FUNC(h2hhockey_state::write_r));
- m_maincpu->o().set(FUNC(h2hhockey_state::write_o));
+ m_maincpu->k().set(FUNC(h2hbaskb_state::read_k));
+ m_maincpu->r().set(FUNC(h2hbaskb_state::write_r));
+ m_maincpu->o().set(FUNC(h2hbaskb_state::write_o));
- TIMER(config, "cap_empty").configure_generic(FUNC(h2hhockey_state::cap_empty_callback));
+ TIMER(config, "cap_empty").configure_generic(FUNC(h2hbaskb_state::cap_empty_callback));
TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1));
- config.set_default_layout(layout_h2hhockey);
+ config.set_default_layout(layout_h2hbaskb);
/* sound hardware */
SPEAKER(config, "mono").front_center();
@@ -1630,6 +1644,12 @@ void h2hhockey_state::h2hhockey(machine_config &config)
m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25);
}
+void h2hbaskb_state::h2hhockey(machine_config &config)
+{
+ h2hbaskb(config);
+ config.set_default_layout(layout_h2hhockey);
+}
+
@@ -9360,7 +9380,7 @@ void xl25_state::update_halt()
{
// O5+K4 go to HALT pin (used when pressing store/recall button)
bool halt = !((m_o & 0x20) || (read_k(machine().dummy_space(), 0) & 4));
- m_maincpu->set_input_line(TMS1XXX_INPUT_LINE_HALT, halt ? ASSERT_LINE : CLEAR_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_HALT, halt ? ASSERT_LINE : CLEAR_LINE);
}
void xl25_state::prepare_display()
@@ -9586,6 +9606,17 @@ ROM_START( h2hfootb )
ROM_END
+ROM_START( h2hbaskb )
+ ROM_REGION( 0x0400, "maincpu", 0 )
+ ROM_LOAD( "mp3320a", 0x0000, 0x0400, CRC(39a63f43) SHA1(14a765e42a39f8d3a465c990e09dd651e595a1c5) )
+
+ ROM_REGION( 867, "maincpu:mpla", 0 )
+ ROM_LOAD( "tms1000_common1_micro.pla", 0, 867, CRC(4becec19) SHA1(3c8a9be0f00c88c81f378b76886c39b10304f330) )
+ ROM_REGION( 365, "maincpu:opla", 0 )
+ ROM_LOAD( "tms1000_h2hbaskb_output.pla", 0, 365, CRC(9d1a91e1) SHA1(96303eb22375129b0dfbfcd823c8ca5b919511bc) )
+ROM_END
+
+
ROM_START( h2hhockey )
ROM_REGION( 0x0400, "maincpu", 0 )
ROM_LOAD( "mp3321a", 0x0000, 0x0400, CRC(e974e604) SHA1(ed740c98ce96ad70ee5237eccae1f54a75ad8100) )
@@ -10340,7 +10371,8 @@ CONS( 1978, amaztron, 0, 0, amaztron, amaztron, amaztron_state, emp
COMP( 1979, zodiac, 0, 0, zodiac, zodiac, zodiac_state, empty_init, "Coleco", "Zodiac - The Astrology Computer", MACHINE_SUPPORTS_SAVE )
CONS( 1978, cqback, 0, 0, cqback, cqback, cqback_state, empty_init, "Coleco", "Electronic Quarterback", MACHINE_SUPPORTS_SAVE )
CONS( 1979, h2hfootb, 0, 0, h2hfootb, h2hfootb, h2hfootb_state, empty_init, "Coleco", "Head to Head: Electronic Football", MACHINE_SUPPORTS_SAVE )
-CONS( 1979, h2hhockey, 0, 0, h2hhockey, h2hhockey, h2hhockey_state, empty_init, "Coleco", "Head to Head: Electronic Hockey (TMS1000 version)", MACHINE_SUPPORTS_SAVE )
+CONS( 1979, h2hbaskb, 0, 0, h2hbaskb, h2hbaskb, h2hbaskb_state, empty_init, "Coleco", "Head to Head: Electronic Basketball (TMS1000 version)", MACHINE_SUPPORTS_SAVE )
+CONS( 1979, h2hhockey, 0, 0, h2hhockey, h2hhockey, h2hbaskb_state, empty_init, "Coleco", "Head to Head: Electronic Hockey (TMS1000 version)", MACHINE_SUPPORTS_SAVE )
CONS( 1980, h2hbaseb, 0, 0, h2hbaseb, h2hbaseb, h2hbaseb_state, empty_init, "Coleco", "Head to Head: Electronic Baseball", MACHINE_SUPPORTS_SAVE )
CONS( 1981, h2hboxing, 0, 0, h2hboxing, h2hboxing, h2hboxing_state, empty_init, "Coleco", "Head to Head: Electronic Boxing", MACHINE_SUPPORTS_SAVE )
CONS( 1981, quizwizc, 0, 0, quizwizc, quizwizc, quizwizc_state, empty_init, "Coleco", "Quiz Wiz Challenger", MACHINE_SUPPORTS_SAVE ) // ***
diff --git a/src/mame/drivers/hk68v10.cpp b/src/mame/drivers/hk68v10.cpp
index 935d25039c6..2f5598f22ae 100644
--- a/src/mame/drivers/hk68v10.cpp
+++ b/src/mame/drivers/hk68v10.cpp
@@ -337,10 +337,11 @@ static void hk68_vme_cards(device_slot_interface &device)
/*
* Machine configuration
*/
-MACHINE_CONFIG_START(hk68v10_state::hk68v10)
+void hk68v10_state::hk68v10(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68010, 10_MHz_XTAL)
- MCFG_DEVICE_PROGRAM_MAP (hk68v10_mem)
+ M68010(config, m_maincpu, 10_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &hk68v10_state::hk68v10_mem);
Z8536(config, "cio", SCC_CLOCK);
@@ -354,9 +355,9 @@ MACHINE_CONFIG_START(hk68v10_state::hk68v10)
rs232trm.rxd_handler().set(m_sccterm, FUNC(scc8530_device::rxa_w));
rs232trm.cts_handler().set(m_sccterm, FUNC(scc8530_device::ctsa_w));
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD("vme", 1, hk68_vme_cards, nullptr)
-MACHINE_CONFIG_END
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", hk68_vme_cards, nullptr, 1, "vme");
+}
/* ROM definitions */
ROM_START (hk68v10)
diff --git a/src/mame/drivers/konblands.cpp b/src/mame/drivers/konblands.cpp
index 693e9d80eb0..4edf9ddf888 100644
--- a/src/mame/drivers/konblands.cpp
+++ b/src/mame/drivers/konblands.cpp
@@ -279,17 +279,17 @@ WRITE_LINE_MEMBER(konblands_state::ld_command_strobe_cb)
MACHINE_CONFIG_START(konblands_state::konblands)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",MC6809E,MASTER_CLOCK/12)
- MCFG_DEVICE_PROGRAM_MAP(konblands_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", konblands_state, vblank_irq)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(konblands_state, timer_irq, 8) // 8 times per frame
+ MC6809E(config, m_maincpu, MASTER_CLOCK/12);
+ m_maincpu->set_addrmap(AS_PROGRAM, &konblands_state::konblands_map);
+ m_maincpu->set_vblank_int("screen", FUNC(konblands_state::vblank_irq));
+ m_maincpu->set_periodic_int(FUNC(konblands_state::timer_irq), attotime::from_hz(8)); // 8 times per frame
/* video hardware */
- MCFG_LASERDISC_LDV1000_ADD("laserdisc")
- MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(WRITELINE(*this, konblands_state, ld_command_strobe_cb))
+ PIONEER_LDV1000(config, m_laserdisc, 0);
+ m_laserdisc->command_strobe_callback().set(FUNC(konblands_state::ld_command_strobe_cb));
// TODO: might be different
- MCFG_LASERDISC_OVERLAY_DRIVER(512, 256, konblands_state, screen_update)
- MCFG_LASERDISC_OVERLAY_PALETTE("palette")
+ m_laserdisc->set_overlay(512, 256, FUNC(konblands_state::screen_update));
+ m_laserdisc->set_overlay_palette("palette");
/* video hardware */
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
@@ -300,15 +300,14 @@ MACHINE_CONFIG_START(konblands_state::konblands)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("sn", SN76496, MASTER_CLOCK/12)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
+ SN76496(config, "sn", MASTER_CLOCK/12).add_route(ALL_OUTPUTS, "mono", 0.50);
+}
-MACHINE_CONFIG_START(konblands_state::konblandsh)
+void konblands_state::konblandsh(machine_config &config)
+{
konblands(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(konblandsh_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &konblands_state::konblandsh_map);
+}
/***************************************************************************
diff --git a/src/mame/drivers/labyrunr.cpp b/src/mame/drivers/labyrunr.cpp
index 41101cb84ec..5309b55a80f 100644
--- a/src/mame/drivers/labyrunr.cpp
+++ b/src/mame/drivers/labyrunr.cpp
@@ -164,24 +164,24 @@ void labyrunr_state::machine_start()
membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000);
}
-MACHINE_CONFIG_START(labyrunr_state::labyrunr)
-
+void labyrunr_state::labyrunr(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", HD6309, 3000000*4) /* 24MHz/8? */
- MCFG_DEVICE_PROGRAM_MAP(labyrunr_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(labyrunr_state, labyrunr_timer_interrupt, 4*60)
+ HD6309(config, m_maincpu, 3000000*4); /* 24MHz/8? */
+ m_maincpu->set_addrmap(AS_PROGRAM, &labyrunr_state::labyrunr_map);
+ m_maincpu->set_periodic_int(FUNC(labyrunr_state::labyrunr_timer_interrupt), attotime::from_hz(4*60));
WATCHDOG_TIMER(config, "watchdog");
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(37*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 35*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(labyrunr_state, screen_update_labyrunr)
- MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, labyrunr_state, vblank_irq))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(37*8, 32*8);
+ screen.set_visarea(0*8, 35*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(labyrunr_state::screen_update_labyrunr));
+ screen.set_palette(m_palette);
+ screen.screen_vblank().set(FUNC(labyrunr_state::vblank_irq));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_labyrunr);
PALETTE(config, m_palette, FUNC(labyrunr_state::labyrunr_palette));
@@ -209,7 +209,7 @@ MACHINE_CONFIG_START(labyrunr_state::labyrunr)
ym2.add_route(1, "mono", 0.40);
ym2.add_route(2, "mono", 0.40);
ym2.add_route(3, "mono", 0.80);
-MACHINE_CONFIG_END
+}
/***************************************************************************
diff --git a/src/mame/drivers/ladybug.cpp b/src/mame/drivers/ladybug.cpp
index 55436fab490..14ee602e55d 100644
--- a/src/mame/drivers/ladybug.cpp
+++ b/src/mame/drivers/ladybug.cpp
@@ -721,20 +721,20 @@ void sraider_state::machine_reset()
}
-MACHINE_CONFIG_START(ladybug_state::ladybug)
-
+void ladybug_state::ladybug(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, 4000000) /* 4 MHz */
- MCFG_DEVICE_PROGRAM_MAP(ladybug_map)
+ Z80(config, m_maincpu, 4000000); /* 4 MHz */
+ m_maincpu->set_addrmap(AS_PROGRAM, &ladybug_state::ladybug_map);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(ladybug_state, screen_update_ladybug)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(1*8, 31*8-1, 4*8, 28*8-1);
+ screen.set_screen_update(FUNC(ladybug_state::screen_update_ladybug));
+ screen.set_palette("palette");
GFXDECODE(config, "gfxdecode", "palette", gfx_ladybug);
PALETTE(config, "palette", FUNC(ladybug_state::ladybug_palette), 4*8 + 4*16, 32);
@@ -749,36 +749,36 @@ MACHINE_CONFIG_START(ladybug_state::ladybug)
SN76489(config, "sn1", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn2", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(dorodon_state::dorodon)
+void dorodon_state::dorodon(machine_config &config)
+{
ladybug(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(sraider_state::sraider)
+ m_maincpu->set_addrmap(AS_OPCODES, &dorodon_state::decrypted_opcodes_map);
+}
+void sraider_state::sraider(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, 4000000) /* 4 MHz */
- MCFG_DEVICE_PROGRAM_MAP(sraider_cpu1_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", sraider_state, irq0_line_hold)
+ z80_device &maincpu(Z80(config, "maincpu", 4000000)); /* 4 MHz */
+ maincpu.set_addrmap(AS_PROGRAM, &sraider_state::sraider_cpu1_map);
+ maincpu.set_vblank_int("screen", FUNC(sraider_state::irq0_line_hold));
- MCFG_DEVICE_ADD("sub", Z80, 4000000) /* 4 MHz */
- MCFG_DEVICE_PROGRAM_MAP(sraider_cpu2_map)
- MCFG_DEVICE_IO_MAP(sraider_cpu2_io_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", sraider_state, irq0_line_hold)
+ z80_device &sub(Z80(config, "sub", 4000000)); /* 4 MHz */
+ sub.set_addrmap(AS_PROGRAM, &sraider_state::sraider_cpu2_map);
+ sub.set_addrmap(AS_IO, &sraider_state::sraider_cpu2_io_map);
+ sub.set_vblank_int("screen", FUNC(sraider_state::irq0_line_hold));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(sraider_state, screen_update_sraider)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, sraider_state, screen_vblank_sraider))
- MCFG_SCREEN_PALETTE(m_palette)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(1*8, 31*8-1, 4*8, 28*8-1);
+ screen.set_screen_update(FUNC(sraider_state::screen_update_sraider));
+ screen.screen_vblank().set(FUNC(sraider_state::screen_vblank_sraider));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_sraider);
PALETTE(config, m_palette, FUNC(sraider_state::sraider_palette), 4*8 + 4*16 + 32 + 2, 32 + 32 + 1);
@@ -794,7 +794,7 @@ MACHINE_CONFIG_START(sraider_state::sraider)
SN76489(config, "sn3", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn4", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
SN76489(config, "sn5", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0);
-MACHINE_CONFIG_END
+}
/***************************************************************************
diff --git a/src/mame/drivers/laser3k.cpp b/src/mame/drivers/laser3k.cpp
index e2d3d28bd7c..df772f96d27 100644
--- a/src/mame/drivers/laser3k.cpp
+++ b/src/mame/drivers/laser3k.cpp
@@ -972,18 +972,19 @@ void laser3k_state::laser3k_palette(palette_device &palette) const
palette.set_pen_colors(0, laser3k_pens);
}
-MACHINE_CONFIG_START(laser3k_state::laser3k)
+void laser3k_state::laser3k(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502, 1021800)
- MCFG_DEVICE_PROGRAM_MAP(laser3k_map)
+ M6502(config, m_maincpu, 1021800);
+ m_maincpu->set_addrmap(AS_PROGRAM, &laser3k_state::laser3k_map);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(300*2, 192)
- MCFG_SCREEN_VISIBLE_AREA(0, (280*2)-1,0,192-1)
- MCFG_SCREEN_UPDATE_DRIVER(laser3k_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(50);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_size(300*2, 192);
+ m_screen->set_visarea(0, (280*2)-1,0,192-1);
+ m_screen->set_screen_update(FUNC(laser3k_state::screen_update));
+ m_screen->set_palette("palette");
PALETTE(config, "palette", FUNC(laser3k_state::laser3k_palette), ARRAY_LENGTH(laser3k_pens));
@@ -1012,11 +1013,9 @@ MACHINE_CONFIG_START(laser3k_state::laser3k)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
- MCFG_DEVICE_ADD("sn76489", SN76489, 1020484)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-MACHINE_CONFIG_END
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 1.00);
+ SN76489(config, m_sn, 1020484).add_route(ALL_OUTPUTS, "mono", 0.50);
+}
ROM_START(las3000)
ROM_REGION(0x0800,"gfx1",0)
diff --git a/src/mame/drivers/lasso.cpp b/src/mame/drivers/lasso.cpp
index 176400d0b9d..f5ecc749f62 100644
--- a/src/mame/drivers/lasso.cpp
+++ b/src/mame/drivers/lasso.cpp
@@ -491,26 +491,26 @@ MACHINE_RESET_MEMBER(lasso_state,wwjgtin)
m_track_enable = 0;
}
-MACHINE_CONFIG_START(lasso_state::base)
-
+void lasso_state::base(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6502, 11289000/16) /* guess */
- MCFG_DEVICE_PROGRAM_MAP(lasso_main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lasso_state, irq0_line_hold)
+ M6502(config, m_maincpu, 11289000/16); /* guess */
+ m_maincpu->set_addrmap(AS_PROGRAM, &lasso_state::lasso_main_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lasso_state::irq0_line_hold));
- MCFG_DEVICE_ADD("audiocpu", M6502, 600000)
- MCFG_DEVICE_PROGRAM_MAP(lasso_audio_map)
+ M6502(config, m_audiocpu, 600000);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lasso_state::lasso_audio_map);
config.m_minimum_quantum = attotime::from_hz(6000);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(57) /* guess, but avoids glitching of Chameleon's high score table */
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(lasso_state, screen_update_lasso)
- MCFG_SCREEN_PALETTE(m_palette)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(57); /* guess, but avoids glitching of Chameleon's high score table */
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(lasso_state::screen_update_lasso));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lasso);
@@ -521,52 +521,49 @@ MACHINE_CONFIG_START(lasso_state::base)
SN76489(config, m_sn_1, 2000000).add_route(ALL_OUTPUTS, "speaker", 1.0);
SN76489(config, m_sn_2, 2000000).add_route(ALL_OUTPUTS, "speaker", 1.0);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(lasso_state::lasso)
+void lasso_state::lasso(machine_config &config)
+{
base(config);
/* basic machine hardware */
- MCFG_DEVICE_ADD("blitter", M6502, 11289000/16) /* guess */
- MCFG_DEVICE_PROGRAM_MAP(lasso_coprocessor_map)
+ m6502_device & blitter(M6502(config, "blitter", 11289000/16)); /* guess */
+ blitter.set_addrmap(AS_PROGRAM, &lasso_state::lasso_coprocessor_map);
PALETTE(config, m_palette, FUNC(lasso_state::lasso_palette), 0x40);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(lasso_state::chameleo)
+void lasso_state::chameleo(machine_config &config)
+{
base(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(chameleo_main_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &lasso_state::chameleo_main_map);
- MCFG_DEVICE_MODIFY("audiocpu")
- MCFG_DEVICE_PROGRAM_MAP(chameleo_audio_map)
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lasso_state::chameleo_audio_map);
/* video hardware */
PALETTE(config, m_palette, FUNC(lasso_state::lasso_palette), 0x40);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(lasso_state, screen_update_chameleo)
-MACHINE_CONFIG_END
+ subdevice<screen_device>("screen")->set_screen_update(FUNC(lasso_state::screen_update_chameleo));
+}
-MACHINE_CONFIG_START(lasso_state::wwjgtin)
+void lasso_state::wwjgtin(machine_config &config)
+{
base(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(wwjgtin_main_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &lasso_state::wwjgtin_main_map);
- MCFG_DEVICE_MODIFY("audiocpu")
- MCFG_DEVICE_PROGRAM_MAP(wwjgtin_audio_map)
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lasso_state::wwjgtin_audio_map);
MCFG_MACHINE_START_OVERRIDE(lasso_state,wwjgtin)
MCFG_MACHINE_RESET_OVERRIDE(lasso_state,wwjgtin)
/* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(lasso_state, screen_update_wwjgtin)
+ subdevice<screen_device>("screen")->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
+ subdevice<screen_device>("screen")->set_screen_update(FUNC(lasso_state::screen_update_wwjgtin));
m_gfxdecode->set_info(gfx_wwjgtin); // Has 1 additional layer
PALETTE(config, m_palette, FUNC(lasso_state::wwjgtin_palette), 0x40 + 16*16, 64);
@@ -577,27 +574,27 @@ MACHINE_CONFIG_START(lasso_state::wwjgtin)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(lasso_state::pinbo)
+void lasso_state::pinbo(machine_config &config)
+{
base(config);
/* basic machine hardware */
- MCFG_DEVICE_REPLACE("maincpu", M6502, XTAL(18'000'000)/24)
- MCFG_DEVICE_PROGRAM_MAP(pinbo_main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lasso_state, irq0_line_hold)
+ M6502(config.replace(), m_maincpu, XTAL(18'000'000)/24);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lasso_state::pinbo_main_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lasso_state::irq0_line_hold));
- MCFG_DEVICE_REPLACE("audiocpu", Z80, XTAL(18'000'000)/6)
- MCFG_DEVICE_PROGRAM_MAP(pinbo_audio_map)
- MCFG_DEVICE_IO_MAP(pinbo_audio_io_map)
+ Z80(config.replace(), m_audiocpu, XTAL(18'000'000)/6);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lasso_state::pinbo_audio_map);
+ m_audiocpu->set_addrmap(AS_IO, &lasso_state::pinbo_audio_io_map);
/* video hardware */
m_gfxdecode->set_info(gfx_pinbo);
PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 256);
MCFG_VIDEO_START_OVERRIDE(lasso_state,pinbo)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(lasso_state, screen_update_chameleo)
+ subdevice<screen_device>("screen")->set_screen_update(FUNC(lasso_state::screen_update_chameleo));
/* sound hardware */
config.device_remove("sn76489.1");
@@ -605,7 +602,7 @@ MACHINE_CONFIG_START(lasso_state::pinbo)
AY8910(config, "ay1", XTAL(18'000'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.55);
AY8910(config, "ay2", XTAL(18'000'000)/12).add_route(ALL_OUTPUTS, "speaker", 0.55);
-MACHINE_CONFIG_END
+}
ROM_START( lasso )
diff --git a/src/mame/drivers/lastbank.cpp b/src/mame/drivers/lastbank.cpp
index bd40cefdaca..c76837381d7 100644
--- a/src/mame/drivers/lastbank.cpp
+++ b/src/mame/drivers/lastbank.cpp
@@ -512,18 +512,18 @@ TIMER_DEVICE_CALLBACK_MEMBER(lastbank_state::irq_scanline)
}
}
-MACHINE_CONFIG_START(lastbank_state::lastbank)
-
+void lastbank_state::lastbank(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",Z80,MASTER_CLOCK/4) //!!! TC0091LVC !!!
- MCFG_DEVICE_PROGRAM_MAP(lastbank_map)
+ Z80(config, m_maincpu, MASTER_CLOCK/4); //!!! TC0091LVC !!!
+ m_maincpu->set_addrmap(AS_PROGRAM, &lastbank_state::lastbank_map);
TIMER(config, "scantimer").configure_scanline(FUNC(lastbank_state::irq_scanline), "screen", 0, 1);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- MCFG_DEVICE_ADD("audiocpu",Z80,MASTER_CLOCK/4)
- MCFG_DEVICE_PROGRAM_MAP(lastbank_audio_map)
- MCFG_DEVICE_IO_MAP(lastbank_audio_io)
+ z80_device &audiocpu(Z80(config, "audiocpu", MASTER_CLOCK/4));
+ audiocpu.set_addrmap(AS_PROGRAM, &lastbank_state::lastbank_audio_map);
+ audiocpu.set_addrmap(AS_IO, &lastbank_state::lastbank_audio_io);
// yes, we have no interrupts
config.m_perfect_cpu_quantum = subtag("maincpu");
@@ -532,17 +532,17 @@ MACHINE_CONFIG_START(lastbank_state::lastbank)
//MCFG_MACHINE_RESET_OVERRIDE(lastbank_state,lastbank)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(lastbank_state, screen_update)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, lastbank_state, screen_vblank))
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
+ screen.set_size(64*8, 32*8);
+ screen.set_visarea(0*8, 40*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(lastbank_state::screen_update));
+ screen.screen_vblank().set(FUNC(lastbank_state::screen_vblank));
+ screen.set_palette("palette");
GFXDECODE(config, "gfxdecode", "palette", gfx_lastbank );
- MCFG_PALETTE_ADD("palette", 0x100)
+ PALETTE(config, "palette").set_entries(0x100);
TC0091LVC(config, m_vdp, 0);
m_vdp->set_gfxdecode_tag("gfxdecode");
@@ -555,8 +555,7 @@ MACHINE_CONFIG_START(lastbank_state::lastbank)
GENERIC_LATCH_8(config, "soundlatch1");
GENERIC_LATCH_8(config, "soundlatch2");
- MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
+ OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.75);
ES8712(config, m_essnd, 0);
m_essnd->msm_write_handler().set("msm", FUNC(msm6585_device::data_w));
@@ -570,7 +569,7 @@ MACHINE_CONFIG_START(lastbank_state::lastbank)
// A RTC-62421 is present on the Last Bank PCB. However, the code
// that tries to read from it is broken and nonfunctional. The RTC
// is also absent from some other games on the same hardware.
-MACHINE_CONFIG_END
+}
/***************************************************************************
diff --git a/src/mame/drivers/lastfght.cpp b/src/mame/drivers/lastfght.cpp
index ba14903c9ee..36b169f41f4 100644
--- a/src/mame/drivers/lastfght.cpp
+++ b/src/mame/drivers/lastfght.cpp
@@ -553,28 +553,28 @@ void lastfght_state::machine_reset()
m_c00006 = 0;
}
-MACHINE_CONFIG_START(lastfght_state::lastfght)
-
+void lastfght_state::lastfght(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", H83044, 32000000/2)
- MCFG_DEVICE_PROGRAM_MAP( lastfght_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lastfght_state, irq0_line_hold)
+ H83044(config, m_maincpu, 32000000/2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lastfght_state::lastfght_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lastfght_state::irq0_line_hold));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* video hardware */
- MCFG_PALETTE_ADD( "palette", 256 )
+ PALETTE(config, m_palette).set_entries(256);
ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, m_palette)); // HMC HM86171 VGA 256 colour RAMDAC
ramdac.set_addrmap(0, &lastfght_state::ramdac_map);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_SIZE( 512, 256 )
- MCFG_SCREEN_VISIBLE_AREA( 0, 512-1, 0, 256-16-1 )
- MCFG_SCREEN_REFRESH_RATE( 60 )
- MCFG_SCREEN_UPDATE_DRIVER(lastfght_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
-MACHINE_CONFIG_END
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_size(512, 256);
+ m_screen->set_visarea(0, 512-1, 0, 256-16-1);
+ m_screen->set_refresh_hz(60);
+ m_screen->set_screen_update(FUNC(lastfght_state::screen_update));
+ m_screen->set_palette(m_palette);
+}
/***************************************************************************
diff --git a/src/mame/drivers/laz_awetoss.cpp b/src/mame/drivers/laz_awetoss.cpp
index 6de09c4ecbf..8f88516353f 100644
--- a/src/mame/drivers/laz_awetoss.cpp
+++ b/src/mame/drivers/laz_awetoss.cpp
@@ -45,20 +45,19 @@ void awetoss_state::machine_reset()
}
-MACHINE_CONFIG_START(awetoss_state::awetoss)
-
+void awetoss_state::awetoss(machine_config &config)
+{
/* basic machine hardware */
-// MCFG_DEVICE_ADD("maincpu", ??, 8000000) // unknown
-// MCFG_DEVICE_PROGRAM_MAP(awetoss_map)
-// MCFG_DEVICE_IO_MAP(awetoss_io)
-// MCFG_DEVICE_VBLANK_INT_DRIVER("screen", awetoss_state, irq0_line_hold)
+// ??_device &maincpu(??(config, "maincpu", 8000000)); // unknown
+// maincpu.set_addrmap(AS_PROGRAM, &awetoss_state::awetoss_map);
+// maincpu.set_addrmap(AS_IO, &awetoss_state::awetoss_io);
+// maincpu.set_vblank_int("screen", FUNC(awetoss_state::irq0_line_hold));
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) // maybe
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // maybe
+}
diff --git a/src/mame/drivers/laz_ribrac.cpp b/src/mame/drivers/laz_ribrac.cpp
index 2003a22860a..7ef91dff45f 100644
--- a/src/mame/drivers/laz_ribrac.cpp
+++ b/src/mame/drivers/laz_ribrac.cpp
@@ -49,19 +49,18 @@ void laz_ribrac_state::machine_reset()
}
-MACHINE_CONFIG_START(laz_ribrac_state::laz_ribrac)
-
+void laz_ribrac_state::laz_ribrac(machine_config &config)
+{
/* basic machine hardware */
-// MCFG_DEVICE_ADD("maincpu", ??, 8000000) // unknown
-// MCFG_DEVICE_PROGRAM_MAP(laz_ribrac_map)
-// MCFG_DEVICE_IO_MAP(laz_ribrac_io)
+// ??_device &maincpu(??(config, "maincpu", 8000000)); // unknown
+// maincpu.set_addrmap(AS_PROGRAM, &laz_ribrac_state::laz_ribrac_map);
+// maincpu.set_addrmap(AS_IO, &laz_ribrac_state::laz_ribrac_io);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki", OKIM6295, 1000000, okim6295_device::PIN7_HIGH) // maybe
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
-MACHINE_CONFIG_END
+ OKIM6295(config, "oki", 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // maybe
+}
diff --git a/src/mame/drivers/lazercmd.cpp b/src/mame/drivers/lazercmd.cpp
index 6f9147c1b09..f5282ebecee 100644
--- a/src/mame/drivers/lazercmd.cpp
+++ b/src/mame/drivers/lazercmd.cpp
@@ -626,26 +626,26 @@ void lazercmd_state::machine_reset()
}
-MACHINE_CONFIG_START(lazercmd_state::lazercmd)
-
+void lazercmd_state::lazercmd(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", S2650, MASTER_CLOCK/12) /* 666 kHz? */
+ S2650(config, m_maincpu, MASTER_CLOCK/12); /* 666 kHz? */
/* Main Clock is 8MHz divided by 12
but memory and IO access is only possible
within the line and frame blanking period
thus requiring an extra loading of approx 3-5 */
- MCFG_DEVICE_PROGRAM_MAP(lazercmd_map)
- MCFG_DEVICE_DATA_MAP(lazercmd_portmap)
+ m_maincpu->set_addrmap(AS_PROGRAM, &lazercmd_state::lazercmd_map);
+ m_maincpu->set_addrmap(AS_DATA, &lazercmd_state::lazercmd_portmap);
TIMER(config, "scantimer").configure_scanline(FUNC(lazercmd_state::lazercmd_timer), "screen", 0, 1);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR + 16)
- MCFG_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1, 0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1)
- MCFG_SCREEN_UPDATE_DRIVER(lazercmd_state, screen_update_lazercmd)
- MCFG_SCREEN_PALETTE(m_palette)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR + 16);
+ screen.set_visarea(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1, 0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1);
+ screen.set_screen_update(FUNC(lazercmd_state::screen_update_lazercmd));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lazercmd);
PALETTE(config, m_palette, FUNC(lazercmd_state::lazercmd_palette), 5);
@@ -661,29 +661,29 @@ MACHINE_CONFIG_START(lazercmd_state::lazercmd)
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT);
-MACHINE_CONFIG_END
-
+}
-MACHINE_CONFIG_START(lazercmd_state::medlanes)
+void lazercmd_state::medlanes(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", S2650, MASTER_CLOCK/12) /* 666 kHz */
+ S2650(config, m_maincpu, MASTER_CLOCK/12); /* 666 kHz */
/* Main Clock is 8MHz divided by 12
but memory and IO access is only possible
within the line and frame blanking period
thus requiring an extra loading of approx 3-5 */
- MCFG_DEVICE_PROGRAM_MAP(medlanes_map)
- MCFG_DEVICE_DATA_MAP(lazercmd_portmap)
+ m_maincpu->set_addrmap(AS_PROGRAM, &lazercmd_state::medlanes_map);
+ m_maincpu->set_addrmap(AS_DATA, &lazercmd_state::lazercmd_portmap);
TIMER(config, "scantimer").configure_scanline(FUNC(lazercmd_state::lazercmd_timer), "screen", 0, 1);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR)
- MCFG_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1, 0 * VERT_CHR, VERT_RES * VERT_CHR - 1)
- MCFG_SCREEN_UPDATE_DRIVER(lazercmd_state, screen_update_lazercmd)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR);
+ screen.set_visarea(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1, 0 * VERT_CHR, VERT_RES * VERT_CHR - 1);
+ screen.set_screen_update(FUNC(lazercmd_state::screen_update_lazercmd));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lazercmd);
PALETTE(config, m_palette, FUNC(lazercmd_state::lazercmd_palette), 5);
@@ -695,29 +695,29 @@ MACHINE_CONFIG_START(lazercmd_state::medlanes)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT);
-MACHINE_CONFIG_END
-
+}
-MACHINE_CONFIG_START(lazercmd_state::bbonk)
+void lazercmd_state::bbonk(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", S2650, MASTER_CLOCK/12) /* 666 kHz */
+ S2650(config, m_maincpu, MASTER_CLOCK/12); /* 666 kHz */
/* Main Clock is 8MHz divided by 12
but memory and IO access is only possible
within the line and frame blanking period
thus requiring an extra loading of approx 3-5 */
- MCFG_DEVICE_PROGRAM_MAP(bbonk_map)
- MCFG_DEVICE_DATA_MAP(lazercmd_portmap)
+ m_maincpu->set_addrmap(AS_PROGRAM, &lazercmd_state::bbonk_map);
+ m_maincpu->set_addrmap(AS_DATA, &lazercmd_state::lazercmd_portmap);
TIMER(config, "scantimer").configure_scanline(FUNC(lazercmd_state::bbonk_timer), "screen", 0, 1);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR)
- MCFG_SCREEN_VISIBLE_AREA(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1, 0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1)
- MCFG_SCREEN_UPDATE_DRIVER(lazercmd_state, screen_update_lazercmd)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(HORZ_RES * HORZ_CHR, VERT_RES * VERT_CHR);
+ screen.set_visarea(0 * HORZ_CHR, HORZ_RES * HORZ_CHR - 1, 0 * VERT_CHR, (VERT_RES - 1) * VERT_CHR - 1);
+ screen.set_screen_update(FUNC(lazercmd_state::screen_update_lazercmd));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lazercmd);
PALETTE(config, m_palette, FUNC(lazercmd_state::lazercmd_palette), 5);
@@ -729,7 +729,7 @@ MACHINE_CONFIG_START(lazercmd_state::bbonk)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.add_route(0, "dac2", 1.0, DAC_VREF_POS_INPUT);
vref.add_route(0, "dac3", 1.0, DAC_VREF_POS_INPUT);
-MACHINE_CONFIG_END
+}
/***************************************************************************
diff --git a/src/mame/drivers/lbeach.cpp b/src/mame/drivers/lbeach.cpp
index 726d7ede5d7..d0f15f067c9 100644
--- a/src/mame/drivers/lbeach.cpp
+++ b/src/mame/drivers/lbeach.cpp
@@ -333,29 +333,29 @@ void lbeach_state::machine_reset()
{
}
-MACHINE_CONFIG_START(lbeach_state::lbeach)
-
+void lbeach_state::lbeach(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6800, XTAL(16'000'000) / 32) // Motorola MC6800P, 500kHz
- MCFG_DEVICE_PROGRAM_MAP(lbeach_map)
+ M6800(config, m_maincpu, XTAL(16'000'000) / 32); // Motorola MC6800P, 500kHz
+ m_maincpu->set_addrmap(AS_PROGRAM, &lbeach_state::lbeach_map);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60) // ~60Hz
- MCFG_SCREEN_SIZE(512, 256)
- MCFG_SCREEN_VISIBLE_AREA(0, 511-32, 0, 255-24)
- MCFG_SCREEN_UPDATE_DRIVER(lbeach_state, screen_update_lbeach)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE) // needed for collision detection
- MCFG_SCREEN_PALETTE(m_palette)
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(60); // ~60Hz
+ m_screen->set_size(512, 256);
+ m_screen->set_visarea(0, 511-32, 0, 255-24);
+ m_screen->set_screen_update(FUNC(lbeach_state::screen_update_lbeach));
+ m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); // needed for collision detection
+ m_screen->set_palette(m_palette);
+ m_screen->screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lbeach);
PALETTE(config, m_palette, FUNC(lbeach_state::lbeach_palette), 2 + 8 + 2);
/* sound hardware */
// ...
-MACHINE_CONFIG_END
+}
diff --git a/src/mame/drivers/lc80.cpp b/src/mame/drivers/lc80.cpp
index 56027374a61..a785258401f 100644
--- a/src/mame/drivers/lc80.cpp
+++ b/src/mame/drivers/lc80.cpp
@@ -330,19 +330,19 @@ void lc80_state::machine_start()
/* Machine Driver */
-MACHINE_CONFIG_START(lc80_state::lc80)
+void lc80_state::lc80(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD(Z80_TAG, Z80, 900000) /* UD880D */
- MCFG_DEVICE_PROGRAM_MAP(lc80_mem)
- MCFG_DEVICE_IO_MAP(lc80_io)
+ Z80(config, m_maincpu, 900000); /* UD880D */
+ m_maincpu->set_addrmap(AS_PROGRAM, &lc80_state::lc80_mem);
+ m_maincpu->set_addrmap(AS_IO, &lc80_state::lc80_io);
/* video hardware */
config.set_default_layout(layout_lc80);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
/* devices */
z80ctc_device& ctc(Z80CTC(config, Z80CTC_TAG, 900000));
@@ -365,21 +365,21 @@ MACHINE_CONFIG_START(lc80_state::lc80)
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED);
RAM(config, RAM_TAG).set_default_size("1K").set_extra_options("2K,3K,4K");
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(lc80_state::lc80_2)
+void lc80_state::lc80_2(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD(Z80_TAG, Z80, 1800000) /* UD880D */
- MCFG_DEVICE_PROGRAM_MAP(lc80_mem)
- MCFG_DEVICE_IO_MAP(lc80_io)
+ Z80(config, m_maincpu, 1800000); /* UD880D */
+ m_maincpu->set_addrmap(AS_PROGRAM, &lc80_state::lc80_mem);
+ m_maincpu->set_addrmap(AS_IO, &lc80_state::lc80_io);
/* video hardware */
config.set_default_layout(layout_lc80);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
/* devices */
z80ctc_device& ctc(Z80CTC(config, Z80CTC_TAG, 900000));
@@ -403,16 +403,16 @@ MACHINE_CONFIG_START(lc80_state::lc80_2)
/* internal ram */
RAM(config, RAM_TAG).set_default_size("4K");
-MACHINE_CONFIG_END
+}
#if 0
-static MACHINE_CONFIG_START( sc80 )
+void lc80_state::sc80(machine_config &config)
+{
lc80_2(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY(Z80_TAG)
- MCFG_DEVICE_PROGRAM_MAP(sc80_mem)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &lc80_state::sc80_mem);
+}
#endif
/* ROMs */
diff --git a/src/mame/drivers/lckydraw.cpp b/src/mame/drivers/lckydraw.cpp
index 1ae19f4939e..e97ac6f8b75 100644
--- a/src/mame/drivers/lckydraw.cpp
+++ b/src/mame/drivers/lckydraw.cpp
@@ -35,17 +35,18 @@ void lckydraw_state::maincpu_map(address_map &map)
static INPUT_PORTS_START( lckydraw )
INPUT_PORTS_END
-MACHINE_CONFIG_START(lckydraw_state::lckydraw)
+void lckydraw_state::lckydraw(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", I8035, 6000000)
- MCFG_DEVICE_PROGRAM_MAP(maincpu_map)
+ I8035(config, m_maincpu, 6000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lckydraw_state::maincpu_map);
/* video hardware */
//config.set_default_layout();
/* sound hardware */
genpin_audio(config);
-MACHINE_CONFIG_END
+}
ROM_START(lckydraw)
diff --git a/src/mame/drivers/lcmate2.cpp b/src/mame/drivers/lcmate2.cpp
index 2492ce640e0..a03cf631c46 100644
--- a/src/mame/drivers/lcmate2.cpp
+++ b/src/mame/drivers/lcmate2.cpp
@@ -229,20 +229,21 @@ static GFXDECODE_START( gfx_lcmate2 )
GFXDECODE_END
-MACHINE_CONFIG_START(lcmate2_state::lcmate2)
+void lcmate2_state::lcmate2(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(3'579'545)) // confirmed
- MCFG_DEVICE_PROGRAM_MAP(lcmate2_mem)
- MCFG_DEVICE_IO_MAP(lcmate2_io)
+ Z80(config, m_maincpu, XTAL(3'579'545)); // confirmed
+ m_maincpu->set_addrmap(AS_PROGRAM, &lcmate2_state::lcmate2_mem);
+ m_maincpu->set_addrmap(AS_IO, &lcmate2_state::lcmate2_io);
/* video hardware */
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
- MCFG_SCREEN_SIZE(120, 18)
- MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 18-1)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(50);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update));
+ screen.set_size(120, 18);
+ screen.set_visarea(0, 120-1, 0, 18-1);
+ screen.set_palette("palette");
PALETTE(config, "palette", FUNC(lcmate2_state::lcmate2_palette), 2);
GFXDECODE(config, "gfxdecode", "palette", gfx_lcmate2);
@@ -258,7 +259,7 @@ MACHINE_CONFIG_START(lcmate2_state::lcmate2)
/* Devices */
RP5C15(config, m_rtc, XTAL(32'768));
-MACHINE_CONFIG_END
+}
/* ROM definition */
ROM_START( lcmate2 )
diff --git a/src/mame/drivers/ldplayer.cpp b/src/mame/drivers/ldplayer.cpp
index 7b3aef786df..c621648f3c1 100644
--- a/src/mame/drivers/ldplayer.cpp
+++ b/src/mame/drivers/ldplayer.cpp
@@ -627,8 +627,9 @@ INPUT_PORTS_END
*
*************************************/
-MACHINE_CONFIG_START(ldplayer_state::ldplayer_ntsc)
-MACHINE_CONFIG_END
+void ldplayer_state::ldplayer_ntsc(machine_config &config)
+{
+}
MACHINE_CONFIG_START(ldv1000_state::ldv1000)
diff --git a/src/mame/drivers/leapster.cpp b/src/mame/drivers/leapster.cpp
index 8f57fdd007c..993aa687149 100644
--- a/src/mame/drivers/leapster.cpp
+++ b/src/mame/drivers/leapster.cpp
@@ -311,16 +311,16 @@ void leapster_state::leapster_aux(address_map &map)
MACHINE_CONFIG_START(leapster_state::leapster)
/* basic machine hardware */
// CPU is ArcTangent-A5 '5.1' (ARCompact core)
- MCFG_DEVICE_ADD("maincpu", ARCA5, 96000000/10)
- MCFG_DEVICE_PROGRAM_MAP(leapster_map)
- MCFG_DEVICE_IO_MAP(leapster_aux)
+ ARCA5(config, m_maincpu, 96000000/10);
+ m_maincpu->set_addrmap(AS_PROGRAM, &leapster_state::leapster_map);
+ m_maincpu->set_addrmap(AS_IO, &leapster_state::leapster_aux);
/* video hardware */
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_SIZE(160, 160)
- MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 160-1)
- MCFG_SCREEN_UPDATE_DRIVER(leapster_state, screen_update_leapster)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+ screen.set_refresh_hz(60);
+ screen.set_size(160, 160);
+ screen.set_visarea(0, 160-1, 0, 160-1);
+ screen.set_screen_update(FUNC(leapster_state::screen_update_leapster));
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "leapster_cart")
diff --git a/src/mame/drivers/learnwin.cpp b/src/mame/drivers/learnwin.cpp
index 9c84fa6dc3b..0eca6b1414f 100644
--- a/src/mame/drivers/learnwin.cpp
+++ b/src/mame/drivers/learnwin.cpp
@@ -140,17 +140,17 @@ void learnwin_state::machine_reset()
}
-MACHINE_CONFIG_START(learnwin_state::learnwin)
-
+void learnwin_state::learnwin(machine_config &config)
+{
/* video hardware */
-// MCFG_SCREEN_ADD("screen", LCD)
-// MCFG_SCREEN_REFRESH_RATE(60)
-// MCFG_SCREEN_SIZE(48, 32)
-// MCFG_SCREEN_VISIBLE_AREA(0,47,0,31)
+// screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
+// screen.set_refresh_hz(60);
+// screen.set_size(48, 32);
+// screen.set_visarea(0, 47, 0, 31);
/* sound hardware */
SPEAKER(config, "mono").front_center();
-MACHINE_CONFIG_END
+}
/***************************************************************************
diff --git a/src/mame/drivers/leland.cpp b/src/mame/drivers/leland.cpp
index 307bc7ef575..2a287d86571 100644
--- a/src/mame/drivers/leland.cpp
+++ b/src/mame/drivers/leland.cpp
@@ -978,17 +978,17 @@ INPUT_PORTS_END
*
*************************************/
-MACHINE_CONFIG_START(leland_state::leland)
-
+void leland_state::leland(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD(m_master, Z80, MASTER_CLOCK/2)
- MCFG_DEVICE_PROGRAM_MAP(master_map_program)
- MCFG_DEVICE_IO_MAP(master_map_io)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", leland_state, leland_master_interrupt)
+ Z80(config, m_master, MASTER_CLOCK/2);
+ m_master->set_addrmap(AS_PROGRAM, &leland_state::master_map_program);
+ m_master->set_addrmap(AS_IO, &leland_state::master_map_io);
+ m_master->set_vblank_int("screen", FUNC(leland_state::leland_master_interrupt));
- MCFG_DEVICE_ADD(m_slave, Z80, MASTER_CLOCK/2)
- MCFG_DEVICE_PROGRAM_MAP(slave_small_map_program)
- MCFG_DEVICE_IO_MAP(slave_map_io)
+ Z80(config, m_slave, MASTER_CLOCK/2);
+ m_slave->set_addrmap(AS_PROGRAM, &leland_state::slave_small_map_program);
+ m_slave->set_addrmap(AS_IO, &leland_state::slave_map_io);
EEPROM_93C46_16BIT(config, m_eeprom);
NVRAM(config, "battery", nvram_device::DEFAULT_ALL_0);
@@ -1018,48 +1018,49 @@ MACHINE_CONFIG_START(leland_state::leland)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
vref.add_route(0, "dac0", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac0", -1.0, DAC_VREF_NEG_INPUT);
vref.add_route(0, "dac1", 1.0, DAC_VREF_POS_INPUT); vref.add_route(0, "dac1", -1.0, DAC_VREF_NEG_INPUT);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(redline_state::redline)
+void redline_state::redline(machine_config &config)
+{
leland(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("master")
- MCFG_DEVICE_IO_MAP(master_redline_map_io)
+ m_master->set_addrmap(AS_IO, &redline_state::master_redline_map_io);
/* sound hardware */
- MCFG_DEVICE_ADD(m_sound, REDLINE_80186, 0)
-MACHINE_CONFIG_END
+ REDLINE_80186(config, m_sound, 0);
+}
-MACHINE_CONFIG_START(redline_state::quarterb)
+void redline_state::quarterb(machine_config &config)
+{
redline(config);
/* sound hardware */
- MCFG_DEVICE_REPLACE(m_sound, LELAND_80186, 0)
-MACHINE_CONFIG_END
+ LELAND_80186(config.replace(), m_sound, 0);
+}
-MACHINE_CONFIG_START(redline_state::lelandi)
+void redline_state::lelandi(machine_config &config)
+{
quarterb(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("slave")
- MCFG_DEVICE_PROGRAM_MAP(slave_large_map_program)
-MACHINE_CONFIG_END
-
+ m_slave->set_addrmap(AS_PROGRAM, &redline_state::slave_large_map_program);
+}
-MACHINE_CONFIG_START(ataxx_state::ataxx)
+void ataxx_state::ataxx(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD(m_master, Z80, 6000000)
- MCFG_DEVICE_PROGRAM_MAP(master_map_program_2)
- MCFG_DEVICE_IO_MAP(master_map_io_2)
+ Z80(config, m_master, 6000000);
+ m_master->set_addrmap(AS_PROGRAM, &ataxx_state::master_map_program_2);
+ m_master->set_addrmap(AS_IO, &ataxx_state::master_map_io_2);
- MCFG_DEVICE_ADD(m_slave, Z80, 6000000)
- MCFG_DEVICE_PROGRAM_MAP(slave_map_program)
- MCFG_DEVICE_IO_MAP(slave_map_io_2)
+ Z80(config, m_slave, 6000000);
+ m_slave->set_addrmap(AS_PROGRAM, &ataxx_state::slave_map_program);
+ m_slave->set_addrmap(AS_IO, &ataxx_state::slave_map_io_2);
EEPROM_93C56_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
@@ -1069,15 +1070,16 @@ MACHINE_CONFIG_START(ataxx_state::ataxx)
ataxx_video(config);
/* sound hardware */
- MCFG_DEVICE_ADD(m_sound, ATAXX_80186, 0)
-MACHINE_CONFIG_END
+ ATAXX_80186(config, m_sound, 0);
+}
-MACHINE_CONFIG_START(ataxx_state::wsf)
+void ataxx_state::wsf(machine_config &config)
+{
ataxx(config);
- MCFG_DEVICE_REPLACE(m_sound, WSF_80186, 0)
-MACHINE_CONFIG_END
+ WSF_80186(config.replace(), m_sound, 0);
+}
diff --git a/src/mame/drivers/lemmings.cpp b/src/mame/drivers/lemmings.cpp
index 94c53c01a9e..1d845cab76d 100644
--- a/src/mame/drivers/lemmings.cpp
+++ b/src/mame/drivers/lemmings.cpp
@@ -213,27 +213,27 @@ void lemmings_state::machine_start()
{
}
-MACHINE_CONFIG_START(lemmings_state::lemmings)
-
+void lemmings_state::lemmings(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, 14000000)
- MCFG_DEVICE_PROGRAM_MAP(lemmings_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lemmings_state, irq6_line_hold)
+ M68000(config, m_maincpu, 14000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lemmings_state::lemmings_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lemmings_state::irq6_line_hold));
- MCFG_DEVICE_ADD("audiocpu", M6809,32220000/8)
- MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ M6809(config, m_audiocpu, 32220000/8);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lemmings_state::sound_map);
/* video hardware */
- MCFG_DEVICE_ADD("spriteram1", BUFFERED_SPRITERAM16)
- MCFG_DEVICE_ADD("spriteram2", BUFFERED_SPRITERAM16)
+ BUFFERED_SPRITERAM16(config, m_spriteram[0]);
+ BUFFERED_SPRITERAM16(config, m_spriteram[1]);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529))
- MCFG_SCREEN_SIZE(40*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(lemmings_state, screen_update_lemmings)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, lemmings_state, screen_vblank_lemmings))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(529));
+ screen.set_size(40*8, 32*8);
+ screen.set_visarea(0*8, 40*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(lemmings_state::screen_update_lemmings));
+ screen.screen_vblank().set(FUNC(lemmings_state::screen_vblank_lemmings));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lemmings);
PALETTE(config, m_palette).set_format(palette_device::xBGR_888, 1024);
@@ -264,10 +264,10 @@ MACHINE_CONFIG_START(lemmings_state::lemmings)
ymsnd.add_route(0, "lspeaker", 0.45);
ymsnd.add_route(1, "rspeaker", 0.45);
- MCFG_DEVICE_ADD("oki", OKIM6295, 1023924, okim6295_device::PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
-MACHINE_CONFIG_END
+ okim6295_device &oki(OKIM6295(config, "oki", 1023924, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified
+ oki.add_route(ALL_OUTPUTS, "lspeaker", 0.50);
+ oki.add_route(ALL_OUTPUTS, "rspeaker", 0.50);
+}
/******************************************************************************/
diff --git a/src/mame/drivers/lethalj.cpp b/src/mame/drivers/lethalj.cpp
index 74eb7de823e..01875d251d5 100644
--- a/src/mame/drivers/lethalj.cpp
+++ b/src/mame/drivers/lethalj.cpp
@@ -367,7 +367,7 @@ static INPUT_PORTS_START( eggvntdx )
PORT_INCLUDE(eggventr)
PORT_MODIFY("IN0")
- PORT_DIPUNUSED_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW3:4" ) // Was "Slot Machine" - The slot machince is present in the code as a 'bonus stage'
+ PORT_DIPUNUSED_DIPLOC( 0x1000, IP_ACTIVE_LOW, "SW3:4" ) // Was "Slot Machine" - The slot machine is present in the code as a 'bonus stage'
// (when the egg reaches Vegas?), but not actually called (EC).
INPUT_PORTS_END
@@ -630,8 +630,8 @@ INPUT_PORTS_END
*
*************************************/
-MACHINE_CONFIG_START(lethalj_state::gameroom)
-
+void lethalj_state::gameroom(machine_config &config)
+{
/* basic machine hardware */
TMS34010(config, m_maincpu, MASTER_CLOCK);
m_maincpu->set_addrmap(AS_PROGRAM, &lethalj_state::lethalj_map);
@@ -643,35 +643,32 @@ MACHINE_CONFIG_START(lethalj_state::gameroom)
TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 701, 0, 512, 263, 0, 236)
- MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_ind16)
- MCFG_SCREEN_PALETTE("palette")
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_raw(VIDEO_CLOCK, 701, 0, 512, 263, 0, 236);
+ m_screen->set_screen_update("maincpu", FUNC(tms34010_device::tms340x0_ind16));
+ m_screen->set_palette("palette");
PALETTE(config, "palette", palette_device::RGB_555);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("oki1", OKIM6295, SOUND_CLOCK, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
+ OKIM6295(config, "oki1", SOUND_CLOCK, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.8);
- MCFG_DEVICE_ADD("oki2", OKIM6295, SOUND_CLOCK, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
+ OKIM6295(config, "oki2", SOUND_CLOCK, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.8);
- MCFG_DEVICE_ADD("oki3", OKIM6295, SOUND_CLOCK, okim6295_device::PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.8)
-MACHINE_CONFIG_END
+ OKIM6295(config, "oki3", SOUND_CLOCK, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.8);
+}
-MACHINE_CONFIG_START(lethalj_state::lethalj)
+void lethalj_state::lethalj(machine_config &config)
+{
gameroom(config);
m_maincpu->set_pixel_clock(VIDEO_CLOCK_LETHALJ);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK_LETHALJ, 689, 0, 512, 259, 0, 236)
-MACHINE_CONFIG_END
+ m_screen->set_raw(VIDEO_CLOCK_LETHALJ, 689, 0, 512, 259, 0, 236);
+}
diff --git a/src/mame/drivers/lg-dvd.cpp b/src/mame/drivers/lg-dvd.cpp
index 73f29b2c73c..cc685f02016 100644
--- a/src/mame/drivers/lg-dvd.cpp
+++ b/src/mame/drivers/lg-dvd.cpp
@@ -33,10 +33,11 @@ void lg_dvd_state::lg_dvd_map(address_map &map)
map(0x0000, 0x7fff).rom().region("maincpu", 0);
}
-MACHINE_CONFIG_START(lg_dvd_state::lg)
- MCFG_DEVICE_ADD( "maincpu", I80C52, XTAL(16'000'000) )
- MCFG_DEVICE_PROGRAM_MAP( lg_dvd_map )
-MACHINE_CONFIG_END
+void lg_dvd_state::lg(machine_config &config)
+{
+ I80C52(config, m_maincpu, XTAL(16'000'000));
+ m_maincpu->set_addrmap(AS_PROGRAM, &lg_dvd_state::lg_dvd_map);
+}
ROM_START( lggp40 )
ROM_REGION( 0x100000, "maincpu", 0 )
diff --git a/src/mame/drivers/lgp.cpp b/src/mame/drivers/lgp.cpp
index 2598595ba1d..2158a992817 100644
--- a/src/mame/drivers/lgp.cpp
+++ b/src/mame/drivers/lgp.cpp
@@ -412,21 +412,22 @@ void lgp_state::lgp_palette(palette_device &palette) const
/* DRIVER */
MACHINE_CONFIG_START(lgp_state::lgp)
/* main cpu */
- MCFG_DEVICE_ADD("maincpu", Z80, CPU_PCB_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(main_program_map)
- MCFG_DEVICE_IO_MAP(main_io_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lgp_state, vblank_callback_lgp)
+ Z80(config, m_maincpu, CPU_PCB_CLOCK);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lgp_state::main_program_map);
+ m_maincpu->set_addrmap(AS_IO, &lgp_state::main_io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lgp_state::vblank_callback_lgp));
/* sound cpu */
- MCFG_DEVICE_ADD("audiocpu", Z80, SOUND_PCB_CLOCK)
- MCFG_DEVICE_PROGRAM_MAP(sound_program_map)
- MCFG_DEVICE_IO_MAP(sound_io_map)
+ z80_device &audiocpu(Z80(config, "audiocpu", SOUND_PCB_CLOCK));
+ audiocpu.set_addrmap(AS_PROGRAM, &lgp_state::sound_program_map);
+ audiocpu.set_addrmap(AS_IO, &lgp_state::sound_io_map);
-
- MCFG_LASERDISC_LDV1000_ADD("laserdisc")
- MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(WRITELINE(*this, lgp_state, ld_command_strobe_cb))
- MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, lgp_state, screen_update_lgp)
- MCFG_LASERDISC_OVERLAY_PALETTE("palette")
+ PIONEER_LDV1000(config, m_laserdisc, 0);
+ m_laserdisc->command_strobe_callback().set(FUNC(lgp_state::ld_command_strobe_cb));
+ m_laserdisc->set_overlay(256, 256, FUNC(lgp_state::screen_update_lgp));
+ m_laserdisc->set_overlay_palette(m_palette);
+ m_laserdisc->add_route(0, "lspeaker", 1.0);
+ m_laserdisc->add_route(1, "rspeaker", 1.0);
/* video hardware */
MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
@@ -438,10 +439,6 @@ MACHINE_CONFIG_START(lgp_state::lgp)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
-
- MCFG_DEVICE_MODIFY("laserdisc")
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/liberate.cpp b/src/mame/drivers/liberate.cpp
index 0a072ebf7ec..245f906e692 100644
--- a/src/mame/drivers/liberate.cpp
+++ b/src/mame/drivers/liberate.cpp
@@ -741,16 +741,16 @@ MACHINE_RESET_MEMBER(liberate_state,liberate)
m_bank = 0;
}
-MACHINE_CONFIG_START(liberate_state::liberate_base)
-
+void liberate_state::liberate_base(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",DECO16, 2000000)
- MCFG_DEVICE_PROGRAM_MAP(liberate_map)
- MCFG_DEVICE_IO_MAP(deco16_io_map)
+ DECO16(config, m_maincpu, 2000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &liberate_state::liberate_map);
+ m_maincpu->set_addrmap(AS_IO, &liberate_state::deco16_io_map);
- MCFG_DEVICE_ADD("audiocpu",DECO_222, 1500000) /* is it a real 222 (M6502 with bitswapped opcodes), or the same thing in external logic? */
- MCFG_DEVICE_PROGRAM_MAP(liberate_sound_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(liberate_state, nmi_line_pulse, 16*60) /* ??? */
+ DECO_222(config, m_audiocpu, 1500000); /* is it a real 222 (M6502 with bitswapped opcodes), or the same thing in external logic? */
+ m_audiocpu->set_addrmap(AS_PROGRAM, &liberate_state::liberate_sound_map);
+ m_audiocpu->set_periodic_int(FUNC(liberate_state::nmi_line_pulse), attotime::from_hz(16*60)); /* ??? */
config.m_minimum_quantum = attotime::from_hz(12000);
@@ -758,14 +758,14 @@ MACHINE_CONFIG_START(liberate_state::liberate_base)
MCFG_MACHINE_RESET_OVERRIDE(liberate_state,liberate)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529) /* 529ms Vblank duration?? */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(liberate_state, screen_update_liberate)
- MCFG_SCREEN_PALETTE(m_palette)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, liberate_state, deco16_interrupt))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(529) /* 529ms Vblank duration?? */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
+ screen.set_screen_update(FUNC(liberate_state::screen_update_liberate));
+ screen.set_palette(m_palette);
+ screen.screen_vblank().set(FUNC(liberate_state::deco16_interrupt));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_liberate);
PALETTE(config, m_palette, FUNC(liberate_state::liberate_palette), 33);
@@ -780,64 +780,63 @@ MACHINE_CONFIG_START(liberate_state::liberate_base)
AY8912(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.30);
AY8912(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.50);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(liberate_state::liberate)
+void liberate_state::liberate(machine_config &config)
+{
liberate_base(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_OPCODES_MAP(decrypted_opcodes_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_OPCODES, &liberate_state::decrypted_opcodes_map);
+}
-MACHINE_CONFIG_START(liberate_state::liberatb)
+void liberate_state::liberatb(machine_config &config)
+{
liberate_base(config);
/* basic machine hardware */
- MCFG_DEVICE_REPLACE("maincpu", M6502, 2000000)
- MCFG_DEVICE_PROGRAM_MAP(liberatb_map)
-MACHINE_CONFIG_END
+ M6502(config.replace(), m_maincpu, 2000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &liberate_state::liberatb_map);
+}
-MACHINE_CONFIG_START(liberate_state::boomrang)
+void liberate_state::boomrang(machine_config &config)
+{
liberate_base(config);
MCFG_VIDEO_START_OVERRIDE(liberate_state,boomrang)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(liberate_state, screen_update_boomrang)
-MACHINE_CONFIG_END
+ subdevice<screen_device>("screen")->set_screen_update(FUNC(liberate_state::screen_update_boomrang));
+}
-MACHINE_CONFIG_START(liberate_state::prosoccr)
+void liberate_state::prosoccr(machine_config &config)
+{
liberate_base(config);
/* basic machine hardware */
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_CLOCK(10000000/8) //xtal is unknown?
- MCFG_DEVICE_PROGRAM_MAP(prosoccr_map)
- MCFG_DEVICE_IO_MAP(prosoccr_io_map)
+ m_maincpu->set_clock(10000000/8); //xtal is unknown?
+ m_maincpu->set_addrmap(AS_PROGRAM, &liberate_state::prosoccr_map);
+ m_maincpu->set_addrmap(AS_IO, &liberate_state::prosoccr_io_map);
- MCFG_DEVICE_MODIFY("audiocpu")
- MCFG_DEVICE_CLOCK(10000000/8) //xtal is 12 Mhz, divider is unknown
- MCFG_DEVICE_PROGRAM_MAP(prosoccr_sound_map)
+ m_audiocpu->set_clock(10000000/8); //xtal is 12 Mhz, divider is unknown
+ m_audiocpu->set_addrmap(AS_PROGRAM, &liberate_state::prosoccr_sound_map);
config.m_minimum_quantum = attotime::from_hz(12000);
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 0*8, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(liberate_state, screen_update_prosoccr)
+ subdevice<screen_device>("screen")->set_visarea(1*8, 31*8-1, 0*8, 32*8-1);
+ subdevice<screen_device>("screen")->set_screen_update(FUNC(liberate_state::screen_update_prosoccr));
m_gfxdecode->set_info(gfx_prosoccr);
MCFG_VIDEO_START_OVERRIDE(liberate_state,prosoccr)
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(liberate_state::prosport)
+}
+void liberate_state::prosport(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", DECO16, 2000000)
- MCFG_DEVICE_PROGRAM_MAP(prosport_map)
- MCFG_DEVICE_IO_MAP(deco16_io_map)
+ DECO16(config, m_maincpu, 2000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &liberate_state::prosport_map);
+ m_maincpu->set_addrmap(AS_IO, &liberate_state::deco16_io_map);
- MCFG_DEVICE_ADD("audiocpu", DECO_222, 1500000/2) /* is it a real 222 (M6502 with bitswapped opcodes), or the same thing in external logic? */
- MCFG_DEVICE_PROGRAM_MAP(liberate_sound_map)
- MCFG_DEVICE_PERIODIC_INT_DRIVER(liberate_state, nmi_line_pulse, 16*60) /* ??? */
+ DECO_222(config, m_audiocpu, 1500000/2); /* is it a real 222 (M6502 with bitswapped opcodes), or the same thing in external logic? */
+ m_audiocpu->set_addrmap(AS_PROGRAM, &liberate_state::liberate_sound_map);
+ m_audiocpu->set_periodic_int(FUNC(liberate_state::nmi_line_pulse), attotime::from_hz(16*60)); /* ??? */
// config.m_minimum_quantum = attotime::from_hz(12000);
@@ -845,14 +844,14 @@ MACHINE_CONFIG_START(liberate_state::prosport)
MCFG_MACHINE_RESET_OVERRIDE(liberate_state,liberate)
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1529) /* 529ms Vblank duration?? */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(liberate_state, screen_update_prosport)
- MCFG_SCREEN_PALETTE(m_palette)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, liberate_state, deco16_interrupt))
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(1529) /* 529ms Vblank duration?? */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
+ screen.set_screen_update(FUNC(liberate_state::screen_update_prosport));
+ screen.set_palette(m_palette);
+ screen.screen_vblank().set(FUNC(liberate_state::deco16_interrupt));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_prosport);
PALETTE(config, m_palette).set_format(palette_device::BGR_233_inverted, 256);
@@ -867,7 +866,7 @@ MACHINE_CONFIG_START(liberate_state::prosport)
AY8912(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.30);
AY8912(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.50);
-MACHINE_CONFIG_END
+}
/*************************************
diff --git a/src/mame/drivers/lilith.cpp b/src/mame/drivers/lilith.cpp
index d909b4b5264..9d9056f7d1f 100644
--- a/src/mame/drivers/lilith.cpp
+++ b/src/mame/drivers/lilith.cpp
@@ -26,8 +26,9 @@ private:
static INPUT_PORTS_START( lilith )
INPUT_PORTS_END
-MACHINE_CONFIG_START(lilith_state::lilith)
-MACHINE_CONFIG_END
+void lilith_state::lilith(machine_config &config)
+{
+}
ROM_START( lilith )
ROM_REGION( 0x10000, "maincpu", 0 )
diff --git a/src/mame/drivers/lindbergh.cpp b/src/mame/drivers/lindbergh.cpp
index 2c3c2172dab..8953bddb2e2 100644
--- a/src/mame/drivers/lindbergh.cpp
+++ b/src/mame/drivers/lindbergh.cpp
@@ -392,8 +392,9 @@ void lindbergh_state::machine_reset()
{
}
-MACHINE_CONFIG_START(lindbergh_state::lindbergh)
- MCFG_DEVICE_ADD("maincpu", PENTIUM4, 28000000U*5) /* Actually Celeron D at 2,8 GHz */
+void lindbergh_state::lindbergh(machine_config &config)
+{
+ PENTIUM4(config, "maincpu", 28000000U*5); /* Actually Celeron D at 2,8 GHz */
PCI_ROOT (config, ":pci", 0);
I82875P_HOST (config, ":pci:00.0", 0, 0x103382c0, "maincpu", 512*1024*1024);
@@ -417,7 +418,7 @@ MACHINE_CONFIG_START(lindbergh_state::lindbergh)
SATA (config, ":pci:1f.2", 0, 0x808625a3, 0x02, 0x103382c0);
SMBUS (config, ":pci:1f.3", 0, 0x808625a4, 0x02, 0x103382c0);
AC97 (config, ":pci:1f.5", 0, 0x808625a6, 0x02, 0x103382c0);
-MACHINE_CONFIG_END
+}
#define LINDBERGH_BIOS \
ROM_REGION32_LE(0x100000, ":pci:1f.0", 0) /* PC bios, location 3j7 */ \
diff --git a/src/mame/drivers/llc.cpp b/src/mame/drivers/llc.cpp
index 92b6bd6ea58..5c3568309d1 100644
--- a/src/mame/drivers/llc.cpp
+++ b/src/mame/drivers/llc.cpp
@@ -200,7 +200,8 @@ static GFXDECODE_START( gfx_llc2 )
GFXDECODE_END
/* Machine driver */
-MACHINE_CONFIG_START(llc_state::llc1)
+void llc_state::llc1(machine_config &config)
+{
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(3'000'000));
m_maincpu->set_daisy_config(llc1_daisy_chain);
@@ -211,13 +212,13 @@ MACHINE_CONFIG_START(llc_state::llc1)
MCFG_MACHINE_RESET_OVERRIDE(llc_state, llc1 )
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(64*8, 16*8)
- MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(llc_state, screen_update_llc1)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(50);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(64*8, 16*8);
+ screen.set_visarea(0, 64*8-1, 0, 16*8-1);
+ screen.set_screen_update(FUNC(llc_state::screen_update_llc1));
+ screen.set_palette("palette");
GFXDECODE(config, "gfxdecode", "palette", gfx_llc1);
PALETTE(config, "palette", palette_device::MONOCHROME);
@@ -242,9 +243,10 @@ MACHINE_CONFIG_START(llc_state::llc1)
generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
keyboard.set_keyboard_callback(FUNC(llc_state::kbd_put));
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(llc_state::llc2)
+void llc_state::llc2(machine_config &config)
+{
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(3'000'000));
m_maincpu->set_daisy_config(llc2_daisy_chain);
@@ -254,21 +256,20 @@ MACHINE_CONFIG_START(llc_state::llc2)
MCFG_MACHINE_RESET_OVERRIDE(llc_state, llc2 )
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(llc_state, screen_update_llc2)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(50);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ screen.set_size(64*8, 32*8);
+ screen.set_visarea(0, 64*8-1, 0, 32*8-1);
+ screen.set_screen_update(FUNC(llc_state::screen_update_llc2));
+ screen.set_palette("palette");
GFXDECODE(config, "gfxdecode", "palette", gfx_llc2);
PALETTE(config, "palette", palette_device::MONOCHROME);
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.15);
z80pio_device& pio1(Z80PIO(config, "z80pio1", XTAL(3'000'000)));
pio1.in_pa_callback().set(K7659_KEYBOARD_TAG, FUNC(k7659_keyboard_device::read));
@@ -278,13 +279,13 @@ MACHINE_CONFIG_START(llc_state::llc2)
z80pio_device& pio2(Z80PIO(config, "z80pio2", XTAL(3'000'000)));
pio2.in_pa_callback().set(FUNC(llc_state::llc2_port2_a_r));
- MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL(3'000'000))
+ Z80CTC(config, "z80ctc", XTAL(3'000'000));
K7659_KEYBOARD(config, K7659_KEYBOARD_TAG, 0);
/* internal ram */
RAM(config, RAM_TAG).set_default_size("64K");
-MACHINE_CONFIG_END
+}
/* ROM definition */
ROM_START( llc1 )
diff --git a/src/mame/drivers/lockon.cpp b/src/mame/drivers/lockon.cpp
index 0f5fb97040c..d9474d316a1 100644
--- a/src/mame/drivers/lockon.cpp
+++ b/src/mame/drivers/lockon.cpp
@@ -470,20 +470,20 @@ void lockon_state::machine_reset()
m_main_inten = 0;
}
-MACHINE_CONFIG_START(lockon_state::lockon)
-
- MCFG_DEVICE_ADD("maincpu", V30, 16_MHz_XTAL / 2)
- MCFG_DEVICE_PROGRAM_MAP(main_v30)
+void lockon_state::lockon(machine_config &config)
+{
+ V30(config, m_maincpu, 16_MHz_XTAL / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lockon_state::main_v30);
- MCFG_DEVICE_ADD("ground", V30, 16_MHz_XTAL / 2)
- MCFG_DEVICE_PROGRAM_MAP(ground_v30)
+ V30(config, m_ground, 16_MHz_XTAL / 2);
+ m_ground->set_addrmap(AS_PROGRAM, &lockon_state::ground_v30);
- MCFG_DEVICE_ADD("object", V30, 16_MHz_XTAL / 2)
- MCFG_DEVICE_PROGRAM_MAP(object_v30)
+ V30(config, m_object, 16_MHz_XTAL / 2);
+ m_object->set_addrmap(AS_PROGRAM, &lockon_state::object_v30);
- MCFG_DEVICE_ADD("audiocpu", Z80, 16_MHz_XTAL / 4)
- MCFG_DEVICE_PROGRAM_MAP(sound_prg)
- MCFG_DEVICE_IO_MAP(sound_io)
+ Z80(config, m_audiocpu, 16_MHz_XTAL / 4);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lockon_state::sound_prg);
+ m_audiocpu->set_addrmap(AS_IO, &lockon_state::sound_io);
WATCHDOG_TIMER(config, m_watchdog).set_time(PERIOD_OF_555_ASTABLE(10000, 4700, 10000e-12) * 4096);
config.m_minimum_quantum = attotime::from_hz(600);
@@ -494,12 +494,12 @@ MACHINE_CONFIG_START(lockon_state::lockon)
adc.in_callback<2>().set_ioport("ADC_MISSILE");
adc.in_callback<3>().set_ioport("ADC_HOVER");
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
- MCFG_SCREEN_UPDATE_DRIVER(lockon_state, screen_update_lockon)
- MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, lockon_state, screen_vblank_lockon))
- MCFG_SCREEN_PALETTE(m_palette)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK);
+ m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
+ m_screen->set_screen_update(FUNC(lockon_state::screen_update_lockon));
+ m_screen->screen_vblank().set(FUNC(lockon_state::screen_vblank_lockon));
+ m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lockon);
PALETTE(config, m_palette, FUNC(lockon_state::lockon_palette), 1024 + 2048);
@@ -526,7 +526,7 @@ MACHINE_CONFIG_START(lockon_state::lockon)
FILTER_VOLUME(config, "f2203.2r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
FILTER_VOLUME(config, "f2203.3l").add_route(ALL_OUTPUTS, "lspeaker", 1.0);
FILTER_VOLUME(config, "f2203.3r").add_route(ALL_OUTPUTS, "rspeaker", 1.0);
-MACHINE_CONFIG_END
+}
/*************************************
diff --git a/src/mame/drivers/lsasquad.cpp b/src/mame/drivers/lsasquad.cpp
index 8d359da3d8a..08436c78a2d 100644
--- a/src/mame/drivers/lsasquad.cpp
+++ b/src/mame/drivers/lsasquad.cpp
@@ -555,17 +555,17 @@ MACHINE_RESET_MEMBER(lsasquad_state,lsasquad)
}
/* Note: lsasquad clock values are not verified */
-MACHINE_CONFIG_START(lsasquad_state::lsasquad)
-
+void lsasquad_state::lsasquad(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK / 4)
- MCFG_DEVICE_PROGRAM_MAP(lsasquad_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lsasquad_state, irq0_line_hold)
+ Z80(config, m_maincpu, MASTER_CLOCK / 4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lsasquad_state::lsasquad_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lsasquad_state::irq0_line_hold));
- MCFG_DEVICE_ADD("audiocpu", Z80, MASTER_CLOCK / 8)
- MCFG_DEVICE_PROGRAM_MAP(lsasquad_sound_map)
+ Z80(config, m_audiocpu, MASTER_CLOCK / 8);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lsasquad_state::lsasquad_sound_map);
/* IRQs are triggered by the YM2203 */
- MCFG_DEVICE_ADD("bmcu", TAITO68705_MCU, MASTER_CLOCK / 8)
+ TAITO68705_MCU(config, m_bmcu, MASTER_CLOCK / 8);
config.m_minimum_quantum = attotime::from_hz(30000); /* 500 CPU slices per frame - a high value to ensure proper */
@@ -583,13 +583,13 @@ MACHINE_CONFIG_START(lsasquad_state::lsasquad)
GENERIC_LATCH_8(config, m_soundlatch2);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(lsasquad_state, screen_update_lsasquad)
- MCFG_SCREEN_PALETTE(m_palette)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(lsasquad_state::screen_update_lsasquad));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lsasquad);
PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 512);
@@ -607,31 +607,31 @@ MACHINE_CONFIG_START(lsasquad_state::lsasquad)
ymsnd.add_route(1, "mono", 0.12);
ymsnd.add_route(2, "mono", 0.12);
ymsnd.add_route(3, "mono", 0.63);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(lsasquad_state::storming)
+void lsasquad_state::storming(machine_config &config)
+{
lsasquad(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(storming_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &lsasquad_state::storming_map);
config.device_remove("bmcu");
AY8910(config.replace(), "aysnd", MASTER_CLOCK / 8).add_route(ALL_OUTPUTS, "mono", 0.12); // AY-3-8910A
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(lsasquad_state::daikaiju)
+}
+void lsasquad_state::daikaiju(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, MASTER_CLOCK / 4)
- MCFG_DEVICE_PROGRAM_MAP(daikaiju_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lsasquad_state, irq0_line_hold)
+ Z80(config, m_maincpu, MASTER_CLOCK / 4);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lsasquad_state::daikaiju_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lsasquad_state::irq0_line_hold));
- MCFG_DEVICE_ADD("audiocpu", Z80, MASTER_CLOCK / 8)
- MCFG_DEVICE_PROGRAM_MAP(daikaiju_sound_map)
+ Z80(config, m_audiocpu, MASTER_CLOCK / 8);
+ m_audiocpu->set_addrmap(AS_PROGRAM, &lsasquad_state::daikaiju_sound_map);
/* IRQs are triggered by the YM2203 */
- MCFG_DEVICE_ADD("bmcu", TAITO68705_MCU, MASTER_CLOCK / 8)
+ TAITO68705_MCU(config, m_bmcu, MASTER_CLOCK / 8);
config.m_minimum_quantum = attotime::from_hz(30000); /* 500 CPU slices per frame - a high value to ensure proper */
/* synchronization of the CPUs */
@@ -646,13 +646,13 @@ MACHINE_CONFIG_START(lsasquad_state::daikaiju)
INPUT_MERGER_ALL_HIGH(config, "soundnmi").output_handler().set_inputline(m_audiocpu, INPUT_LINE_NMI);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(lsasquad_state, screen_update_daikaiju)
- MCFG_SCREEN_PALETTE(m_palette)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(0, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(lsasquad_state::screen_update_daikaiju));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_lsasquad);
PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 512);
@@ -670,7 +670,7 @@ MACHINE_CONFIG_START(lsasquad_state::daikaiju)
ymsnd.add_route(1, "mono", 0.12);
ymsnd.add_route(2, "mono", 0.12);
ymsnd.add_route(3, "mono", 0.63);
-MACHINE_CONFIG_END
+}
/***************************************************************************
diff --git a/src/mame/drivers/ltcasino.cpp b/src/mame/drivers/ltcasino.cpp
index cbad9040b9f..e6fb14e2898 100644
--- a/src/mame/drivers/ltcasino.cpp
+++ b/src/mame/drivers/ltcasino.cpp
@@ -742,20 +742,21 @@ static GFXDECODE_START( gfx_ltcasino )
GFXDECODE_END
-MACHINE_CONFIG_START(ltcasino_state::ltcasino)
+void ltcasino_state::ltcasino(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD(m_maincpu, M6502, XTAL(18'432'000)/9) /* 2.048MHz ?? (or 18.432MHz/8 = 2.304MHz) - not verified */
- MCFG_DEVICE_PROGRAM_MAP(main_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", ltcasino_state, irq0_line_hold)
+ M6502(config, m_maincpu, XTAL(18'432'000)/9); /* 2.048MHz ?? (or 18.432MHz/8 = 2.304MHz) - not verified */
+ m_maincpu->set_addrmap(AS_PROGRAM, &ltcasino_state::main_map);
+ m_maincpu->set_vblank_int("screen", FUNC(ltcasino_state::irq0_line_hold));
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(6*8, 58*8-1, 0, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(ltcasino_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(64*8, 32*8);
+ screen.set_visarea(6*8, 58*8-1, 0, 32*8-1);
+ screen.set_screen_update(FUNC(ltcasino_state::screen_update));
+ screen.set_palette("palette");
GFXDECODE(config, m_gfxdecode, "palette", gfx_ltcasino);
PALETTE(config, "palette", FUNC(ltcasino_state::ltcasino_palette), 2*64);
@@ -768,7 +769,7 @@ MACHINE_CONFIG_START(ltcasino_state::ltcasino)
aysnd.port_b_read_callback().set_ioport("IN6");
//ltcasino -> pc: F3F3 (A in service) and F3FD (B in service)
aysnd.add_route(ALL_OUTPUTS, "mono", 0.4);
-MACHINE_CONFIG_END
+}
ROM_START( ltcasino )
diff --git a/src/mame/drivers/ltd.cpp b/src/mame/drivers/ltd.cpp
index 91987649b08..27f3e4e9500 100644
--- a/src/mame/drivers/ltd.cpp
+++ b/src/mame/drivers/ltd.cpp
@@ -523,10 +523,11 @@ TIMER_DEVICE_CALLBACK_MEMBER( ltd_state::timer_r )
}
}
-MACHINE_CONFIG_START(ltd_state::ltd3)
+void ltd_state::ltd3(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M6802, XTAL(3'579'545))
- MCFG_DEVICE_PROGRAM_MAP(ltd3_map)
+ M6802(config, m_maincpu, XTAL(3'579'545));
+ m_maincpu->set_addrmap(AS_PROGRAM, &ltd_state::ltd3_map);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -537,9 +538,10 @@ MACHINE_CONFIG_START(ltd_state::ltd3)
genpin_audio(config);
TIMER(config, "timer_r").configure_periodic(FUNC(ltd_state::timer_r), attotime::from_hz(500));
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(ltd_state::ltd4)
+void ltd_state::ltd4(machine_config &config)
+{
/* basic machine hardware */
m6803_cpu_device &maincpu(M6803(config, "maincpu", XTAL(3'579'545))); // guess, no details available
maincpu.set_addrmap(AS_PROGRAM, &ltd_state::ltd4_map);
@@ -559,7 +561,7 @@ MACHINE_CONFIG_START(ltd_state::ltd4)
SPEAKER(config, "mono").front_center();
AY8910(config, "aysnd_0", XTAL(3'579'545)/2).add_route(ALL_OUTPUTS, "mono", 0.3); /* guess */
AY8910(config, "aysnd_1", XTAL(3'579'545)/2).add_route(ALL_OUTPUTS, "mono", 0.3); /* guess */
-MACHINE_CONFIG_END
+}
/*-------------------------------------------------------------------
/ Arizona
diff --git a/src/mame/drivers/luckgrln.cpp b/src/mame/drivers/luckgrln.cpp
index c83d07d8138..a15a16257f7 100644
--- a/src/mame/drivers/luckgrln.cpp
+++ b/src/mame/drivers/luckgrln.cpp
@@ -861,11 +861,12 @@ INTERRUPT_GEN_MEMBER(luckgrln_state::irq)
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
-MACHINE_CONFIG_START(luckgrln_state::luckgrln)
- MCFG_DEVICE_ADD(m_maincpu, Z180,8000000)
- MCFG_DEVICE_PROGRAM_MAP(mainmap)
- MCFG_DEVICE_IO_MAP(luckgrln_io)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", luckgrln_state, irq)
+void luckgrln_state::luckgrln(machine_config &config)
+{
+ Z180(config, m_maincpu, 8000000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &luckgrln_state::mainmap);
+ m_maincpu->set_addrmap(AS_IO, &luckgrln_state::luckgrln_io);
+ m_maincpu->set_vblank_int("screen", FUNC(luckgrln_state::irq));
h46505_device &crtc(H46505(config, "crtc", 6000000/4)); /* unknown clock, hand tuned to get ~60 fps */
crtc.set_screen("screen");
@@ -874,29 +875,28 @@ MACHINE_CONFIG_START(luckgrln_state::luckgrln)
MSM6242(config, "rtc", 0);
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(512, 256)
- MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
- MCFG_SCREEN_UPDATE_DRIVER(luckgrln_state, screen_update)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
+ screen.set_size(512, 256);
+ screen.set_visarea(0, 512-1, 0, 256-1);
+ screen.set_screen_update(FUNC(luckgrln_state::screen_update));
+ screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_luckgrln);
- MCFG_PALETTE_ADD("palette", 0x8000)
+ PALETTE(config, m_palette).set_entries(0x8000);
SPEAKER(config, "mono").front_center();
+}
-MACHINE_CONFIG_END
-
-MACHINE_CONFIG_START(luckgrln_state::_7smash)
+void luckgrln_state::_7smash(machine_config &config)
+{
luckgrln(config);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(_7smash_map)
- MCFG_DEVICE_IO_MAP(_7smash_io)
+ m_maincpu->set_addrmap(AS_PROGRAM, &luckgrln_state::_7smash_map);
+ m_maincpu->set_addrmap(AS_IO, &luckgrln_state::_7smash_io);
config.device_remove("rtc");
-MACHINE_CONFIG_END
+}
void luckgrln_state::init_luckgrln()
{
diff --git a/src/mame/drivers/lvcards.cpp b/src/mame/drivers/lvcards.cpp
index cbc54fd9b48..ba00c75d0f3 100644
--- a/src/mame/drivers/lvcards.cpp
+++ b/src/mame/drivers/lvcards.cpp
@@ -459,21 +459,22 @@ GFXDECODE_END
/* Sound Interfaces */
-MACHINE_CONFIG_START(lvcards_state::lvcards)
+void lvcards_state::lvcards(machine_config &config)
+{
// basic machine hardware
- MCFG_DEVICE_ADD("maincpu",Z80, 18432000/4) // unknown frequency, assume same as tehkanwc.cpp
- MCFG_DEVICE_PROGRAM_MAP(lvcards_map)
- MCFG_DEVICE_IO_MAP(lvcards_io_map)
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", lvcards_state, irq0_line_hold)
+ Z80(config, m_maincpu, 18432000/4); // unknown frequency, assume same as tehkanwc.cpp
+ m_maincpu->set_addrmap(AS_PROGRAM, &lvcards_state::lvcards_map);
+ m_maincpu->set_addrmap(AS_IO, &lvcards_state::lvcards_io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(lvcards_state::irq0_line_hold));
// video hardware
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(8*0, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(lvcards_state, screen_update_lvcards)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_refresh_hz(60);
+ screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
+ screen.set_size(32*8, 32*8);
+ screen.set_visarea(8*0, 32*8-1, 2*8, 30*8-1);
+ screen.set_screen_update(FUNC(lvcards_state::screen_update_lvcards));
+ screen.set_palette("palette");
GFXDECODE(config, m_gfxdecode, "palette", gfx_lvcards);
PALETTE(config, "palette", FUNC(lvcards_state::lvcards_palette), 256);
@@ -485,28 +486,28 @@ MACHINE_CONFIG_START(lvcards_state::lvcards)
aysnd.port_a_read_callback().set_ioport("DSW0");
aysnd.port_b_read_callback().set_ioport("DSW1");
aysnd.add_route(ALL_OUTPUTS, "mono", 0.25);
-MACHINE_CONFIG_END
+}
-MACHINE_CONFIG_START(lvpoker_state::lvpoker)
+void lvpoker_state::lvpoker(machine_config &config)
+{
lvcards(config);
// basic machine hardware
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(lvpoker_map)
-MACHINE_CONFIG_END
+ m_maincpu->set_addrmap(AS_PROGRAM, &lvpoker_state::lvpoker_map);
+}
-MACHINE_CONFIG_START(lvpoker_state::ponttehk)
+void lvpoker_state::ponttehk(machine_config &config)
+{
lvcards(config);
// basic machine hardware
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1);
- MCFG_DEVICE_MODIFY("maincpu")
- MCFG_DEVICE_PROGRAM_MAP(ponttehk_map)
+ m_maincpu->set_addrmap(AS_PROGRAM, &lvpoker_state::ponttehk_map);
// video hardware
PALETTE(config.replace(), "palette", palette_device::RGB_444_PROMS, "proms", 256);
-MACHINE_CONFIG_END
+}
ROM_START( lvpoker )
ROM_REGION( 0x10000, "maincpu", 0 )
diff --git a/src/mame/drivers/lviv.cpp b/src/mame/drivers/lviv.cpp
index 4796b5ab7db..251f3e03dda 100644
--- a/src/mame/drivers/lviv.cpp
+++ b/src/mame/drivers/lviv.cpp
@@ -10,13 +10,13 @@ Dr. Volodimir Mosorov for two Lviv machines.
What's new:
-----------
-28.02.2003 Snapshot veryfing function added.
+28.02.2003 Snapshot verifying function added.
07.01.2003 Support for .SAV snapshots. Joystick support (there are strange
problems with "Doroga (1991)(-)(Ru).lvt".
21.12.2002 Cassette support rewritten, WAVs saving and loading are working now.
08.12.2002 Comments on emulation status updated. Changed 'lvive' to 'lvivp'.
ADC r instruction in I8080 core fixed (Arkanoid works now).
- Orginal keyboard layout added.
+ Original keyboard layout added.
20.07.2002 "Reset" key fixed. I8080 core fixed (all BASIC commands works).
now). Unsupported .lvt files versions aren't now loaded.
xx.07.2002 Improved port and memory mapping (Raphael Nabet).
@@ -34,7 +34,7 @@ Notes on emulation status and to do list:
-----------------------------------------
1. LIMITATION: Printer is not emulated.
2. LIMITATION: Timings are not implemented, due to it emulated machine runs
- twice fast as orginal.
+ twice fast as original.
3. LIMITATION: .RSS files are not supported.
4. LIMITATION: Some usage notes and trivia are needed in sysinfo.dat.
@@ -96,11 +96,11 @@ Ports:
D0-D3 8255 PPI
Port A:
- keyboard scaning
+ keyboard scanning
Port B:
keyboard reading
Port C:
- keyboard scaning/reading
+ keyboard scanning/reading
Keyboard:
---------
@@ -161,7 +161,7 @@ Keyboard:
Video:
-----
Screen resolution is 256x256 pixels. 4 colors at once are possible,
- but there is a posiibility of palette change. Bits 0..6 of port 0xc1
+ but there is a possibility of palette change. Bits 0..6 of port 0xc1
are used for palette setting.
One byte of video-RAM sets 4 pixels. Colors of pixels are corrected
@@ -423,9 +423,9 @@ INPUT_PORTS_END
/* machine definition */
MACHINE_CONFIG_START(lviv_state::lviv)
/* basic machine hardware */
- MCFG_DEVICE_ADD(m_maincpu, I8080, 2500000)
- MCFG_DEVICE_PROGRAM_MAP(mem_map)
- MCFG_DEVICE_IO_MAP(io_map)
+ I8080(config, m_maincpu, 2500000);
+ m_maincpu->set_addrmap(AS_PROGRAM, &lviv_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &lviv_state::io_map);
config.m_minimum_quantum = attotime::from_hz(60);
I8255(config, m_ppi[0]);
@@ -444,15 +444,14 @@ MACHINE_CONFIG_START(lviv_state::lviv)
m_ppi[1]->in_pc_callback().set(FUNC(lviv_state::ppi_1_portc_r));
m_ppi[1]->out_pc_callback().set(FUNC(lviv_state::ppi_1_portc_w));
- MCFG_SCREEN_ADD(m_screen, RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_VBLANK_TIME(0)
-
/* video hardware */
- MCFG_SCREEN_SIZE(256, 256)
- MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
- MCFG_SCREEN_UPDATE_DRIVER(lviv_state, screen_update)
- MCFG_SCREEN_PALETTE(m_palette)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(50);
+ m_screen->set_vblank_time(0);
+ m_screen->set_size(256, 256);
+ m_screen->set_visarea(0, 256-1, 0, 256-1);
+ m_screen->set_screen_update(FUNC(lviv_state::screen_update));
+ m_screen->set_palette(m_palette);
PALETTE(config, m_palette, FUNC(lviv_state::lviv_palette), ARRAY_LENGTH(s_palette));
diff --git a/src/mame/drivers/lynx.cpp b/src/mame/drivers/lynx.cpp
index b5aafc332fc..89c207682bf 100644
--- a/src/mame/drivers/lynx.cpp
+++ b/src/mame/drivers/lynx.cpp
@@ -76,23 +76,23 @@ void lynx_state::sound_cb()
MACHINE_CONFIG_START(lynx_state::lynx)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M65SC02, 4000000) /* vti core, integrated in vlsi, stz, but not bbr bbs */
- MCFG_DEVICE_PROGRAM_MAP(lynx_mem)
+ M65SC02(config, m_maincpu, 4000000); /* vti core, integrated in vlsi, stz, but not bbr bbs */
+ m_maincpu->set_addrmap(AS_PROGRAM, &lynx_state::lynx_mem);
config.m_minimum_quantum = attotime::from_hz(60);
ADDRESS_MAP_BANK(config, "bank_fc00").set_map(&lynx_state::lynx_fc00_mem).set_options(ENDIANNESS_LITTLE, 8, 9, 0x100);
ADDRESS_MAP_BANK(config, "bank_fd00").set_map(&lynx_state::lynx_fd00_mem).set_options(ENDIANNESS_LITTLE, 8, 9, 0x100);
/* video hardware */
- MCFG_SCREEN_ADD("screen", LCD)
- MCFG_SCREEN_REFRESH_RATE(30)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
- MCFG_SCREEN_UPDATE_DRIVER(lynx_state, screen_update)
- MCFG_SCREEN_SIZE(160, 102)
- MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 102-1)
+ SCREEN(config, m_screen, SCREEN_TYPE_LCD);
+ m_screen->set_refresh_hz(30);
+ m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
+ m_screen->set_screen_update(FUNC(lynx_state::screen_update));
+ m_screen->set_size(160, 102);
+ m_screen->set_visarea(0, 160-1, 0, 102-1);
config.set_default_layout(layout_lynx);
- MCFG_PALETTE_ADD("palette", 0x10)
+ PALETTE(config, m_palette).set_entries(0x10);
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/miniforce.cpp b/src/mame/drivers/miniforce.cpp
index 2e9feea1184..ef55e15c2e7 100644
--- a/src/mame/drivers/miniforce.cpp
+++ b/src/mame/drivers/miniforce.cpp
@@ -182,19 +182,20 @@ static void miniforce_vme_cards(device_slot_interface &device)
/*
* Machine configuration
*/
-MACHINE_CONFIG_START(miniforce_state::miniforce)
-// MCFG_DEVICE_PROGRAM_MAP (miniforce_mem)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD ("vme", 1, miniforce_vme_cards, "fccpu21")
- MCFG_VME_SLOT_ADD ("vme", 2, miniforce_vme_cards, nullptr)
- MCFG_VME_SLOT_ADD ("vme", 3, miniforce_vme_cards, nullptr)
- MCFG_VME_SLOT_ADD ("vme", 4, miniforce_vme_cards, nullptr)
- MCFG_VME_SLOT_ADD ("vme", 5, miniforce_vme_cards, nullptr)
- MCFG_VME_SLOT_ADD ("vme", 6, miniforce_vme_cards, nullptr)
- MCFG_VME_SLOT_ADD ("vme", 7, miniforce_vme_cards, nullptr)
- MCFG_VME_SLOT_ADD ("vme", 8, miniforce_vme_cards, nullptr)
- MCFG_VME_SLOT_ADD ("vme", 9, miniforce_vme_cards, nullptr)
-MACHINE_CONFIG_END
+void miniforce_state::miniforce(machine_config &config)
+{
+// ->set_addrmap(AS_PROGRAM, &miniforce_state::miniforce_mem);
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", miniforce_vme_cards, "fccpu21", 1, "vme");
+ VME_SLOT(config, "slot2", miniforce_vme_cards, nullptr, 2, "vme");
+ VME_SLOT(config, "slot3", miniforce_vme_cards, nullptr, 3, "vme");
+ VME_SLOT(config, "slot4", miniforce_vme_cards, nullptr, 4, "vme");
+ VME_SLOT(config, "slot5", miniforce_vme_cards, nullptr, 5, "vme");
+ VME_SLOT(config, "slot6", miniforce_vme_cards, nullptr, 6, "vme");
+ VME_SLOT(config, "slot7", miniforce_vme_cards, nullptr, 7, "vme");
+ VME_SLOT(config, "slot8", miniforce_vme_cards, nullptr, 8, "vme");
+ VME_SLOT(config, "slot9", miniforce_vme_cards, nullptr, 9, "vme");
+}
ROM_START(miniforce)
ROM_END
diff --git a/src/mame/drivers/mvme147.cpp b/src/mame/drivers/mvme147.cpp
index 9f1f5b89f52..6d3f012d7de 100644
--- a/src/mame/drivers/mvme147.cpp
+++ b/src/mame/drivers/mvme147.cpp
@@ -648,12 +648,14 @@ static void mvme147_vme_cards(device_slot_interface &device)
/*
* Machine configuration
*/
-MACHINE_CONFIG_START(mvme147_state::mvme147)
+void mvme147_state::mvme147(machine_config &config)
+{
/* basic machine hardware */
M68030(config, m_maincpu, 16_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &mvme147_state::mvme147_mem);
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_SLOT_ADD("vme", 1, mvme147_vme_cards, nullptr)
+
+ VME(config, "vme", 0);
+ VME_SLOT(config, "slot1", mvme147_vme_cards, nullptr, 1, "vme");
M48T02(config, "m48t18", 0); /* t08 differs only in accepted voltage levels compared to t18 */
@@ -668,7 +670,7 @@ MACHINE_CONFIG_START(mvme147_state::mvme147)
rs232trm.cts_handler().set(m_sccterm, FUNC(scc85c30_device::ctsa_w));
SCC85C30(config, m_sccterm2, SCC_CLOCK);
-MACHINE_CONFIG_END
+}
/* ROM definitions */
ROM_START (mvme147)
diff --git a/src/mame/drivers/mzr8105.cpp b/src/mame/drivers/mzr8105.cpp
index a029c2a45c4..76d5fb7af3f 100644
--- a/src/mame/drivers/mzr8105.cpp
+++ b/src/mame/drivers/mzr8105.cpp
@@ -208,13 +208,13 @@ static void mzr8105_vme_cards(device_slot_interface &device)
/*
* Machine configuration
*/
-MACHINE_CONFIG_START(mzr8105_state::mzr8105)
- MCFG_DEVICE_ADD ("maincpu", M68000, XTAL(10'000'000))
- MCFG_DEVICE_PROGRAM_MAP (mzr8105_mem)
- MCFG_VME_DEVICE_ADD("vme")
- MCFG_VME_BUS_OWNER_SPACES()
- MCFG_VME_SLOT_ADD ("vme", 1, mzr8105_vme_cards, "mzr8300")
-MACHINE_CONFIG_END
+void mzr8105_state::mzr8105(machine_config &config)
+{
+ M68000(config, m_maincpu, XTAL(10'000'000));
+ m_maincpu->set_addrmap(AS_PROGRAM, &mzr8105_state::mzr8105_mem);
+ VME(config, "vme", 0).use_owner_spaces();
+ VME_SLOT(config, "slot1", mzr8105_vme_cards, "mzr8300", 1, "vme");
+}
/* ROM definitions */
/* mzr8300 UPD7201 init sequence
diff --git a/src/mame/drivers/neoprint.cpp b/src/mame/drivers/neoprint.cpp
index 634f515f441..2a86c3a906f 100644
--- a/src/mame/drivers/neoprint.cpp
+++ b/src/mame/drivers/neoprint.cpp
@@ -759,6 +759,26 @@ ROM_START( nprsp ) // STAFYAMA19980925 string
// 8bpp might be possible with another ROM?
ROM_END
+ROM_START( npssr2 ) // STAFYAMA19980925 string
+ ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF )
+ ROM_LOAD16_WORD_SWAP( "s038a-ep1 nps-prg1.ep1", 0x000000, 0x080000, CRC(529fb4fa) SHA1(f31ba8998bb01458f43df1934222995f22d590a1) ) // program ROM, same as nprsp
+ ROM_LOAD16_WORD_SWAP( "s072-ep2 nps-prg1.ep2", 0x080000, 0x080000, CRC(5514e29f) SHA1(fd508b6b4b2ed587b5dfd4a186865c72181612e6) ) // data ROM
+
+ ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 program */
+ ROM_LOAD( "s001-m1 neo-pstm cha64c.m1", 0x00000, 0x20000, CRC(ea8111c1) SHA1(69e6bb7ad9a8d61db4513a762c0ce9e9da2a1785) )
+
+ ROM_REGION( 0x200000, "ymsnd", 0 ) /* Samples */
+ ROM_LOAD( "s001-v1 nps-prg1.v1", 0x000000, 0x100000, CRC(13d63625) SHA1(4a9e3b1192a4a7e405becfd5d2a95ffc14ae6e79) )
+
+ ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
+ ROM_LOAD32_BYTE( "s072-c1 neo-pstm cha64c.c1", 0x000000, 0x200000, CRC(c5f72b00) SHA1(b81a9d6025e79f98bdfd55d630ede181ef821132) )
+ ROM_LOAD32_BYTE( "s072-c2 neo-pstm cha64c.c2", 0x000001, 0x200000, CRC(3153db5a) SHA1(2166f452131f64e3806d177b5c5a6ddcd312adfd) )
+ ROM_LOAD32_BYTE( "s072-c3 neo-pstm cha64c.c3", 0x000002, 0x200000, CRC(57e8888f) SHA1(59acb22b2744bb798dd4779d9413d01bee79b43e) )
+
+ ROM_REGION( 0x100, "eeprom", ROMREGION_ERASE00 )
+ ROM_LOAD( "br9020 nps-prg1.u5", 0x000, 0x100, NO_DUMP ) // dump provided was 0xff filled
+ROM_END
+
ROM_START( npmillen ) // NP 1.30 19990225 string
ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD16_WORD_SWAP( "p093-ep1.bin", 0x000000, 0x080000, CRC(47783f56) SHA1(1845e90b05a58010054c4158ef08e167e61ea370) )
@@ -791,6 +811,21 @@ ROM_START( npscv1 ) // NP 1.10 19961015 string
ROM_LOAD32_BYTE( "np-jc2 pstm-romc.c2", 0x000001, 0x080000, CRC(c9687cd8) SHA1(809d9efd7ea76de0884ad76effb71217e9068f89) )
ROM_END
+ROM_START( npcramen ) // ? string
+ ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASEFF )
+ ROM_LOAD16_WORD_SWAP( "l009-ep1 neo-mvs progbk1.ep1", 0x000000, 0x080000, BAD_DUMP CRC(ff470ded) SHA1(d33dd90f9ac1cc7f2dcadb6a855d9cd5f3260d00) ) // 111111111xxxxxxxxxx = 0xFF, reads were consistent, but..
+
+ ROM_REGION( 0x20000, "audiocpu", ROMREGION_ERASEFF ) /* Z80 program */
+ // empty (removed or never populated)?
+
+ ROM_REGION( 0x80000, "ymsnd", ROMREGION_ERASEFF ) /* Samples */
+ // empty (removed or never populated)?
+
+ ROM_REGION( 0x200000, "gfx1", ROMREGION_ERASE00 )
+ ROM_LOAD32_BYTE( "l009-c1 pstm-romc.c1", 0x000000, 0x080000, CRC(d6b44550) SHA1(d402ffe372646b93344f7e36d29e4fe913f2479a) )
+ ROM_LOAD32_BYTE( "l009-c2 pstm-romc.c2", 0x000001, 0x080000, CRC(d63dea34) SHA1(cf2dbf982ed955fe5a4c737d1752cdb66ab5f84a) )
+ROM_END
+
/* FIXME: get rid of these two, probably something to do with irq3 and camera / printer devices */
void neoprint_state::init_npcartv1()
{
@@ -873,6 +908,7 @@ void neoprint_state::init_npotogib()
GAME( 1996, neoprint, 0, neoprint, neoprint, neoprint_state, init_unkneo, ROT0, "SNK", "Neo Print (Japan) (T2d)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1996, npcartv1, 0, neoprint, neoprint, neoprint_state, init_npcartv1, ROT0, "SNK", "Neo Print V1 (World) (E1a)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1996, npscv1, 0, neoprint, neoprint, neoprint_state, init_npscv1, ROT0, "SNK", "Neo Print - Senyou Cassette Ver. 1 (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
+GAME( 1996, npcramen, 0, neoprint, neoprint, neoprint_state, empty_init, ROT0, "SNK", "Neo Print - Chicken Ramen (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1997, npsprgv4, 0, neoprint, neoprint, neoprint_state, init_npsprgv4, ROT0, "SNK", "Neo Print - Spring Ver. 4 (Japan) (T4f 1.00)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1997, npskv, 0, neoprint, neoprint, neoprint_state, init_npskv, ROT0, "SNK", "Neo Print - Suizokukan Version (Japan) (T4i 2.00)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1997, npotogib, 0, neoprint, neoprint, neoprint_state, init_npotogib, ROT0, "SNK", "Neo Print - Otogibanashi (Japan) (T4i 3.00)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
@@ -882,3 +918,4 @@ GAME( 1998, npsprg98, 0, neoprint, neoprint, neoprint_state, init_n
GAME( 1999, npmillen, 0, neoprint, neoprint, neoprint_state, init_npmillen, ROT0, "SNK", "Neo Print - Millennium Multi Shot Edition (World) (T4i 3.07)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1999, npfpit, 0, neoprint, neoprint, neoprint_state, init_npmillen, ROT0, "SNK", "Neo Print - Fuyo Pri Iitoko Tori (Japan) (T4i 3.07)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1996, nprsp, 0, nprsp, neoprint, neoprint_state, init_nprsp, ROT0, "SNK", "NeopriSP Retro Collection (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
+GAME( 1996, npssr2, 0, nprsp, neoprint, neoprint_state, init_nprsp, ROT0, "SNK", "Neo Print Special: Sekai Ryokou 2 (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp
index 08cfafde863..c5c2ed6394c 100644
--- a/src/mame/drivers/pc9801.cpp
+++ b/src/mame/drivers/pc9801.cpp
@@ -2228,7 +2228,9 @@ void pc9801_state::pc9801_mouse(machine_config &config)
void pc9801_state::pc9801_cbus(machine_config &config)
{
- pc9801_slot_device &cbus0(PC9801CBUS_SLOT(config, "cbus0", m_maincpu, pc9801_cbus_devices, "pc9801_26"));
+ pc9801_slot_device &cbus0(PC9801CBUS_SLOT(config, "cbus0", pc9801_cbus_devices, "pc9801_26"));
+ cbus0.set_memspace(m_maincpu, AS_PROGRAM);
+ cbus0.set_iospace(m_maincpu, AS_IO);
cbus0.int_cb<0>().set("ir3", FUNC(input_merger_device::in_w<0>));
cbus0.int_cb<1>().set("ir5", FUNC(input_merger_device::in_w<0>));
cbus0.int_cb<2>().set("ir6", FUNC(input_merger_device::in_w<0>));
@@ -2237,7 +2239,9 @@ void pc9801_state::pc9801_cbus(machine_config &config)
cbus0.int_cb<5>().set("ir12", FUNC(input_merger_device::in_w<0>));
cbus0.int_cb<6>().set("ir13", FUNC(input_merger_device::in_w<0>));
- pc9801_slot_device &cbus1(PC9801CBUS_SLOT(config, "cbus1", m_maincpu, pc9801_cbus_devices, nullptr));
+ pc9801_slot_device &cbus1(PC9801CBUS_SLOT(config, "cbus1", pc9801_cbus_devices, nullptr));
+ cbus1.set_memspace(m_maincpu, AS_PROGRAM);
+ cbus1.set_iospace(m_maincpu, AS_IO);
cbus1.int_cb<0>().set("ir3", FUNC(input_merger_device::in_w<1>));
cbus1.int_cb<1>().set("ir5", FUNC(input_merger_device::in_w<1>));
cbus1.int_cb<2>().set("ir6", FUNC(input_merger_device::in_w<1>));
diff --git a/src/mame/drivers/sc2.cpp b/src/mame/drivers/sc2.cpp
index 10d59c906c4..a99d1be9890 100644
--- a/src/mame/drivers/sc2.cpp
+++ b/src/mame/drivers/sc2.cpp
@@ -173,8 +173,8 @@ static INPUT_PORTS_START( sc2 )
PORT_START("LINE1")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("T") PORT_CODE(KEYCODE_T)
- PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("L") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE)
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Q") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD)
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE)
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD)
PORT_START("LINE2")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("A1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_A)
diff --git a/src/mame/drivers/segaybd.cpp b/src/mame/drivers/segaybd.cpp
index c56ab281192..fbeee43126d 100644
--- a/src/mame/drivers/segaybd.cpp
+++ b/src/mame/drivers/segaybd.cpp
@@ -2722,7 +2722,6 @@ void segaybd_state::init_generic()
save_item(NAME(m_timer_irq_state));
save_item(NAME(m_vblank_irq_state));
save_item(NAME(m_misc_io_data));
- save_item(NAME(m_tmp_bitmap));
}
diff --git a/src/mame/drivers/tecnbras.cpp b/src/mame/drivers/tecnbras.cpp
index 0af732566d4..a7c1dbb964b 100644
--- a/src/mame/drivers/tecnbras.cpp
+++ b/src/mame/drivers/tecnbras.cpp
@@ -119,7 +119,7 @@ void tecnbras_state::tecnbras(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &tecnbras_state::i80c31_io);
m_maincpu->port_out_cb<1>().set_nop(); // buzzer ?
-/* TODO: Add an I2C RTC (Phillips PCF8583P)
+/* TODO: Add an I2C RTC (Philips PCF8583P)
pin 6 (SCL): cpu T0/P3.4 (pin 14)
pin 5 (SDA): cpu T1/P3.5 (pin 15)
*/
diff --git a/src/mame/drivers/ti74.cpp b/src/mame/drivers/ti74.cpp
index 99c85670ae0..a1ea72509dc 100644
--- a/src/mame/drivers/ti74.cpp
+++ b/src/mame/drivers/ti74.cpp
@@ -280,7 +280,7 @@ void ti74_state::main_map(address_map &map)
map.unmap_value_high();
map(0x1000, 0x1001).rw("hd44780", FUNC(hd44780_device::read), FUNC(hd44780_device::write));
map(0x2000, 0x3fff).ram().share("sysram.ic3");
- //AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
+ //map(0x4000, 0xbfff) // mapped by the cartslot
map(0xc000, 0xdfff).bankr("sysbank");
}
diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp
index 6f6d3324748..2c492a6a8e5 100644
--- a/src/mame/drivers/tispeak.cpp
+++ b/src/mame/drivers/tispeak.cpp
@@ -243,68 +243,70 @@ Touch & Tell modules:
Touch & Tell/Vocaid overlay reference:
tntell CD2610:
- - 04: a - Colors
- - 01: b - Objects
- - 05: c - Shapes
- - 09: d - Home Scene
+ - $04: a - Colors
+ - $01: b - Objects
+ - $05: c - Shapes
+ - $09: d - Home Scene
tntelluk CD62170, tntellfr CD62171:
- see tntell
- see numfun(not A)
- see animalfr
- - 08: ? - Clown Face
- - 0B: ? - Body Parts
+ - $08: ? - Clown Face
+ - $0B: ? - Body Parts
vocaid CD2357:
- - 1C: 1 - Leisure
- - 1E: 2 - Telephone
- - 1B: 3 - Bedside
- - 1D: 4 - Alphabet
+ - $1C: 1 - Leisure
+ - $1E: 2 - Telephone
+ - $1B: 3 - Bedside
+ - $1D: 4 - Alphabet
alphabet CD2611:
- - 0E: 1a - Alphabet A-M
- - 0D: 1b - Alphabet N-Z
- - 0C: 1c - Letter Jumble A-M
- - 0B: 1d - Letter Jumble N-Z
+ - $0E: 1a - Alphabet A-M
+ - $0D: 1b - Alphabet N-Z
+ - $0C: 1c - Letter Jumble A-M
+ - $0B: 1d - Letter Jumble N-Z
animalfr CD2355:
- - 0A: 2a - Farm Animals
- - 0F: 2b - At The Farm
- - 0E: 2c - Animal Babies
- - 0D: 2d - In The Jungle
+ - $0A: 2a - Farm Animals
+ - $0F: 2b - At The Farm
+ - $0E: 2c - Animal Babies
+ - $0D: 2d - In The Jungle
numfun CD2612:
- - 02/0A(rev.A): 3a - Numbers 1-10
- - 03/0F(rev.A): 3b - Numbers 11-30
- - 07/0D(rev.A): 3c - How Many?
- - 06/0E(rev.A): 3d - Hidden Numbers
+ - $02/$0A(rev.A): 3a - Numbers 1-10
+ - $03/$0F(rev.A): 3b - Numbers 11-30
+ - $07/$0D(rev.A): 3c - How Many?
+ - $06/$0E(rev.A): 3d - Hidden Numbers
aboutme CD2613:
- - 0E: 4a - Clown Face
- - 0B: 4b - Body Parts
- - 0D: 4c - Things to Wear
- - 0C: 4d - Just For Me
+ - $0E: 4a - Clown Face
+ - $0B: 4b - Body Parts
+ - $0D: 4c - Things to Wear
+ - $0C: 4d - Just For Me
wot CD2361:
- - 0A: 5a - On Land
- - 0B: 5b - In The Air
- - 0C: 5c - On The Water
- - 0D: 5d - In Space
- - 10: 5e - What Belongs Here?
- - 11: 5f - How It Used To Be
- - 12: 5g - Word Fun
- - 13: 5h - In the Surprise Garage
+ - $0A: 5a - On Land
+ - $0B: 5b - In The Air
+ - $0C: 5c - On The Water
+ - $0D: 5d - In Space
+ - $10: 5e - What Belongs Here?
+ - $11: 5f - How It Used To Be
+ - $12: 5g - Word Fun
+ - $13: 5h - In the Surprise Garage
lilcreat CD2362:
- - 14: 6a - In The Park
- - 15: 6b - In The Sea
- - 16: 6c - In The Woods
- - 17: 6d - Whose House?
- - 18: 6e - Hide & Seek
- - 1A: 6f - Who Is It?
- - 19: 6g - But It's Not
- - 1B: 6h - Word Fun
+ - $14: 6a - In The Park
+ - $15: 6b - In The Sea
+ - $16: 6c - In The Woods
+ - $17: 6d - Whose House?
+ - $18: 6e - Hide & Seek
+ - $1A: 6f - Who Is It?
+ - $19: 6g - But It's Not
+ - $1B: 6h - Word Fun
et CD2363:
- - 0F: 7a - The Adventure On Earth I
- - 10: 7b - The Adventure On Earth II
- - 11: 7c - Fun And Friendship I
- - 12: 7d - Fun And Friendship II
- - 13: 7e - E.T. The Star I
- - 14: 7f - E.T. The Star II
- - 15: 7g - Do You Remember? I
- - 16: 7h - Do You Remember? II
+ - $0F: 7a - The Adventure On Earth I
+ - $10: 7b - The Adventure On Earth II
+ - $11: 7c - Fun And Friendship I
+ - $12: 7d - Fun And Friendship II
+ - $13: 7e - E.T. The Star I
+ - $14: 7f - E.T. The Star II
+ - $15: 7g - Do You Remember? I
+ - $16: 7h - Do You Remember? II
+
+ $00: none inserted, and $1F is for diagnostics
Magic Wand "Speaking Reader" or "Speak & Learn":
@@ -405,9 +407,9 @@ K28 modules:
#include "bus/generic/slot.h"
#include "machine/tms6100.h"
#include "sound/tms5110.h"
-
#include "softlist.h"
#include "speaker.h"
+#include "render.h"
// internal artwork
#include "k28m2.lh"
@@ -482,6 +484,7 @@ private:
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(tispeak_cartridge);
+ u8 tntell_get_hexchar(const char c);
TIMER_DEVICE_CALLBACK_MEMBER(tntell_get_overlay);
void init_cartridge();
@@ -497,7 +500,7 @@ private:
// cartridge
u32 m_cart_max_size;
- u8* m_cart_base;
+ u8 *m_cart_base;
u8 m_overlay;
};
@@ -662,6 +665,7 @@ WRITE16_MEMBER(tispeak_state::snspellc_write_o)
{
// O3210: TMS5100 CTL8124
m_tms5100->ctl_w(space, 0, bitswap<4>(data,3,0,1,2));
+ m_o = data;
}
READ8_MEMBER(tispeak_state::snspellc_read_k)
@@ -685,19 +689,40 @@ READ8_MEMBER(tispeak_state::tntell_read_k)
return k8 | snspellc_read_k(space, offset);
}
+u8 tispeak_state::tntell_get_hexchar(const char c)
+{
+ if (c >= '0' && c <= '9') return c - '0';
+ if (c >= 'A' && c <= 'F') return c - 'A' + 10;
+ if (c >= 'a' && c <= 'f') return c - 'a' + 10;
+
+ return 0;
+}
+
TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::tntell_get_overlay)
{
// Each keyboard overlay insert has 5 holes, used by the game to determine
// which one is active(if any). If it matches with the internal ROM or
// external module, the game continues.
- // 00 for none, 1F for diagnostics, see comment section above for a list
- // try to get overlay code from artwork file(in decimal), otherwise pick the
- // one that was selected in machine configuration
- m_overlay = output().get_value("overlay_code") & 0x1f;
- if (m_overlay == 0)
- m_overlay = m_inp_matrix[10]->read();
+ // pick overlay code from machine config, see comment section above for reference
+ m_overlay = m_inp_matrix[10]->read();
+
+ // try to get it from (external) layout
+ if (m_overlay == 0x20)
+ {
+ // as output value, eg. with defstate (in decimal)
+ m_overlay = output().get_value("overlay_code") & 0x1f;
+
+ // and from current view name ($ + 2 hex digits)
+ render_target *target = machine().render().first_target();
+ const char *name = target->view_name(target->view());
+
+ for (int i = 0; name && i < strlen(name); i++)
+ if (name[i] == '$' && strlen(&name[i]) > 2)
+ m_overlay = (tntell_get_hexchar(name[i + 1]) << 4 | tntell_get_hexchar(name[i + 2])) & 0x1f;
+ }
+ // overlay holes
for (int i = 0; i < 5; i++)
m_ol_out[i] = BIT(m_overlay, i);
}
@@ -1168,39 +1193,40 @@ static INPUT_PORTS_START( tntell )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN.10")
- PORT_CONFNAME( 0x1f, 0x04, "Overlay Code" ) // only if not provided by external artwork
- PORT_CONFSETTING( 0x00, "00 (None)" )
- PORT_CONFSETTING( 0x01, "01" )
- PORT_CONFSETTING( 0x02, "02" )
- PORT_CONFSETTING( 0x03, "03" )
- PORT_CONFSETTING( 0x04, "04" )
- PORT_CONFSETTING( 0x05, "05" )
- PORT_CONFSETTING( 0x06, "06" )
- PORT_CONFSETTING( 0x07, "07" )
- PORT_CONFSETTING( 0x08, "08" )
- PORT_CONFSETTING( 0x09, "09" )
- PORT_CONFSETTING( 0x0a, "0A" )
- PORT_CONFSETTING( 0x0b, "0B" )
- PORT_CONFSETTING( 0x0c, "0C" )
- PORT_CONFSETTING( 0x0d, "0D" )
- PORT_CONFSETTING( 0x0e, "0E" )
- PORT_CONFSETTING( 0x0f, "0F" )
- PORT_CONFSETTING( 0x10, "10" )
- PORT_CONFSETTING( 0x11, "11" )
- PORT_CONFSETTING( 0x12, "12" )
- PORT_CONFSETTING( 0x13, "13" )
- PORT_CONFSETTING( 0x14, "14" )
- PORT_CONFSETTING( 0x15, "15" )
- PORT_CONFSETTING( 0x16, "16" )
- PORT_CONFSETTING( 0x17, "17" )
- PORT_CONFSETTING( 0x18, "18" )
- PORT_CONFSETTING( 0x19, "19" )
- PORT_CONFSETTING( 0x1a, "1A" )
- PORT_CONFSETTING( 0x1b, "1B" )
- PORT_CONFSETTING( 0x1c, "1C" )
- PORT_CONFSETTING( 0x1d, "1D" )
- PORT_CONFSETTING( 0x1e, "1E" )
- PORT_CONFSETTING( 0x1f, "1F (Diagnostic)" )
+ PORT_CONFNAME( 0x3f, 0x20, "Overlay Code" )
+ PORT_CONFSETTING( 0x20, "From Artwork View" )
+ PORT_CONFSETTING( 0x00, "$00 (None)" )
+ PORT_CONFSETTING( 0x01, "$01" )
+ PORT_CONFSETTING( 0x02, "$02" )
+ PORT_CONFSETTING( 0x03, "$03" )
+ PORT_CONFSETTING( 0x04, "$04" )
+ PORT_CONFSETTING( 0x05, "$05" )
+ PORT_CONFSETTING( 0x06, "$06" )
+ PORT_CONFSETTING( 0x07, "$07" )
+ PORT_CONFSETTING( 0x08, "$08" )
+ PORT_CONFSETTING( 0x09, "$09" )
+ PORT_CONFSETTING( 0x0a, "$0A" )
+ PORT_CONFSETTING( 0x0b, "$0B" )
+ PORT_CONFSETTING( 0x0c, "$0C" )
+ PORT_CONFSETTING( 0x0d, "$0D" )
+ PORT_CONFSETTING( 0x0e, "$0E" )
+ PORT_CONFSETTING( 0x0f, "$0F" )
+ PORT_CONFSETTING( 0x10, "$10" )
+ PORT_CONFSETTING( 0x11, "$11" )
+ PORT_CONFSETTING( 0x12, "$12" )
+ PORT_CONFSETTING( 0x13, "$13" )
+ PORT_CONFSETTING( 0x14, "$14" )
+ PORT_CONFSETTING( 0x15, "$15" )
+ PORT_CONFSETTING( 0x16, "$16" )
+ PORT_CONFSETTING( 0x17, "$17" )
+ PORT_CONFSETTING( 0x18, "$18" )
+ PORT_CONFSETTING( 0x19, "$19" )
+ PORT_CONFSETTING( 0x1a, "$1A" )
+ PORT_CONFSETTING( 0x1b, "$1B" )
+ PORT_CONFSETTING( 0x1c, "$1C" )
+ PORT_CONFSETTING( 0x1d, "$1D" )
+ PORT_CONFSETTING( 0x1e, "$1E" )
+ PORT_CONFSETTING( 0x1f, "$1F (Diagnostic)" )
INPUT_PORTS_END
@@ -1282,14 +1308,14 @@ void tispeak_state::tms5110_route(machine_config &config)
void tispeak_state::snmath(machine_config &config)
{
/* basic machine hardware */
- tms0270_cpu_device &tms(TMS0270(config, m_maincpu, MASTER_CLOCK/2));
- tms.k().set(FUNC(tispeak_state::snspell_read_k));
- tms.o().set(FUNC(tispeak_state::snmath_write_o));
- tms.r().set(FUNC(tispeak_state::snspell_write_r));
-
- tms.read_ctl().set("tms5100", FUNC(tms5110_device::ctl_r));
- tms.write_ctl().set("tms5100", FUNC(tms5110_device::ctl_w));
- tms.write_pdc().set("tms5100", FUNC(tms5110_device::pdc_w));
+ TMS0270(config, m_maincpu, MASTER_CLOCK/2);
+ m_maincpu->k().set(FUNC(tispeak_state::snspell_read_k));
+ m_maincpu->o().set(FUNC(tispeak_state::snmath_write_o));
+ m_maincpu->r().set(FUNC(tispeak_state::snspell_write_r));
+
+ m_maincpu->read_ctl().set("tms5100", FUNC(tms5110_device::ctl_r));
+ m_maincpu->write_ctl().set("tms5100", FUNC(tms5110_device::ctl_w));
+ m_maincpu->write_pdc().set("tms5100", FUNC(tms5110_device::pdc_w));
TIMER(config, "display_decay").configure_periodic(FUNC(hh_tms1k_state::display_decay_tick), attotime::from_msec(1));
config.set_default_layout(layout_snmath);
diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp
index 7a388c6525d..e3bb082a2bd 100644
--- a/src/mame/drivers/tispellb.cpp
+++ b/src/mame/drivers/tispellb.cpp
@@ -69,8 +69,8 @@
class tispellb_state : public hh_tms1k_state
{
public:
- tispellb_state(const machine_config &mconfig, device_type type, const char *tag)
- : hh_tms1k_state(mconfig, type, tag),
+ tispellb_state(const machine_config &mconfig, device_type type, const char *tag) :
+ hh_tms1k_state(mconfig, type, tag),
m_subcpu(*this, "subcpu"),
m_tms6100(*this, "tms6100")
{ }
@@ -82,7 +82,7 @@ public:
private:
// devices
- optional_device<cpu_device> m_subcpu;
+ optional_device<tms1k_base_device> m_subcpu;
optional_device<tms6100_device> m_tms6100;
u8 m_rev1_ctl;
@@ -348,17 +348,17 @@ INPUT_PORTS_END
void tispellb_state::rev1(machine_config &config)
{
/* basic machine hardware */
- tms0270_cpu_device &tms(TMS0270(config, m_maincpu, 350000)); // approximation
- tms.k().set(FUNC(tispellb_state::main_read_k));
- tms.o().set(FUNC(tispellb_state::main_write_o));
- tms.r().set(FUNC(tispellb_state::main_write_r));
- tms.read_ctl().set(FUNC(tispellb_state::rev1_ctl_r));
- tms.write_ctl().set(FUNC(tispellb_state::rev1_ctl_w));
-
- tms1980_cpu_device &subcpu(TMS1980(config, m_subcpu, 350000)); // approximation
- subcpu.k().set(FUNC(tispellb_state::sub_read_k));
- subcpu.o().set(FUNC(tispellb_state::sub_write_o));
- subcpu.r().set(FUNC(tispellb_state::sub_write_r));
+ TMS0270(config, m_maincpu, 350000); // approximation
+ m_maincpu->k().set(FUNC(tispellb_state::main_read_k));
+ m_maincpu->o().set(FUNC(tispellb_state::main_write_o));
+ m_maincpu->r().set(FUNC(tispellb_state::main_write_r));
+ m_maincpu->read_ctl().set(FUNC(tispellb_state::rev1_ctl_r));
+ m_maincpu->write_ctl().set(FUNC(tispellb_state::rev1_ctl_w));
+
+ TMS1980(config, m_subcpu, 350000); // approximation
+ m_subcpu->k().set(FUNC(tispellb_state::sub_read_k));
+ m_subcpu->o().set(FUNC(tispellb_state::sub_write_o));
+ m_subcpu->r().set(FUNC(tispellb_state::sub_write_r));
config.m_perfect_cpu_quantum = subtag("maincpu");
@@ -372,12 +372,12 @@ void tispellb_state::rev1(machine_config &config)
void tispellb_state::rev2(machine_config &config)
{
/* basic machine hardware */
- tms0270_cpu_device &tms(TMS0270(config, m_maincpu, 350000)); // approximation
- tms.k().set(FUNC(tispellb_state::main_read_k));
- tms.o().set(FUNC(tispellb_state::rev2_write_o));
- tms.r().set(FUNC(tispellb_state::rev2_write_r));
- tms.read_ctl().set(m_tms6100, FUNC(tms6100_device::data_r));
- tms.write_ctl().set(m_tms6100, FUNC(tms6100_device::add_w));
+ TMS0270(config, m_maincpu, 350000); // approximation
+ m_maincpu->k().set(FUNC(tispellb_state::main_read_k));
+ m_maincpu->o().set(FUNC(tispellb_state::rev2_write_o));
+ m_maincpu->r().set(FUNC(tispellb_state::rev2_write_r));
+ m_maincpu->read_ctl().set(m_tms6100, FUNC(tms6100_device::data_r));
+ m_maincpu->write_ctl().set(m_tms6100, FUNC(tms6100_device::add_w));
TMS6100(config, m_tms6100, 350000);
m_tms6100->enable_4bit_mode(true);
diff --git a/src/mame/drivers/turrett.cpp b/src/mame/drivers/turrett.cpp
index 9858b78464d..a6a8e3d4ddd 100644
--- a/src/mame/drivers/turrett.cpp
+++ b/src/mame/drivers/turrett.cpp
@@ -80,7 +80,7 @@ void turrett_state::machine_reset()
void turrett_state::cpu_map(address_map &map)
{
- map(0x00000000, 0x0007ffff).ram();
+ map(0x00000000, 0x0007ffff).ram().mirror(0x40000000);
map(0x02000010, 0x02000013).ram();
map(0x02000040, 0x02000043).ram();
map(0x02000050, 0x02000053).ram();
diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h
index 964a994252c..d9924f51948 100644
--- a/src/mame/includes/ladybug.h
+++ b/src/mame/includes/ladybug.h
@@ -53,8 +53,9 @@ protected:
void ladybug_map(address_map &map);
-private:
required_device<cpu_device> m_maincpu;
+
+private:
required_device<ladybug_video_device> m_video;
required_ioport m_port_dsw0;
diff --git a/src/mame/includes/lvcards.h b/src/mame/includes/lvcards.h
index 8bb4cc71061..bf9d07580a1 100644
--- a/src/mame/includes/lvcards.h
+++ b/src/mame/includes/lvcards.h
@@ -12,9 +12,9 @@ class lvcards_state : public driver_device
public:
lvcards_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
- m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode")
{ }
@@ -26,6 +26,8 @@ protected:
DECLARE_WRITE8_MEMBER(videoram_w);
DECLARE_WRITE8_MEMBER(colorram_w);
+ required_device<cpu_device> m_maincpu;
+
private:
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_colorram;
@@ -33,7 +35,6 @@ private:
TILE_GET_INFO_MEMBER(get_bg_tile_info);
void lvcards_palette(palette_device &palette) const;
uint32_t screen_update_lvcards(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
void lvcards_io_map(address_map &map);
void lvcards_map(address_map &map);
diff --git a/src/mame/includes/segaybd.h b/src/mame/includes/segaybd.h
index 6e08a4f6561..d344e610c10 100644
--- a/src/mame/includes/segaybd.h
+++ b/src/mame/includes/segaybd.h
@@ -42,7 +42,6 @@ public:
, m_timer_irq_state(0)
, m_vblank_irq_state(0)
, m_misc_io_data(0)
- , m_tmp_bitmap(512, 512)
{
}
@@ -140,7 +139,6 @@ private:
uint8_t m_timer_irq_state;
uint8_t m_vblank_irq_state;
uint8_t m_misc_io_data;
- bitmap_ind16 m_tmp_bitmap;
};
#endif // MAME_INCLUDES_SEGAYBD_H
diff --git a/src/mame/layout/fidel_vbrc.lay b/src/mame/layout/fidel_brc.lay
index 4e7cfe12572..4e7cfe12572 100644
--- a/src/mame/layout/fidel_vbrc.lay
+++ b/src/mame/layout/fidel_brc.lay
diff --git a/src/mame/layout/fidel_gin.lay b/src/mame/layout/fidel_gin.lay
new file mode 100644
index 00000000000..5a4f44cefd7
--- /dev/null
+++ b/src/mame/layout/fidel_gin.lay
@@ -0,0 +1,465 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="button" defstate="0">
+ <rect state="0"><color red="0.8" green="0.8" blue="0.7" /></rect>
+ <rect state="1"><color red="0.6" green="0.6" blue="0.5" /></rect>
+ </element>
+
+ <element name="digit" defstate="0">
+ <led14seg><color red="0.2" green="1.0" blue="0.85" /></led14seg>
+ </element>
+
+ <element name="text_b1"><text string="RESET"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b2"><text string="spk"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b3"><text string="CLEAR"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b4"><text string="YES/GO"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b5"><text string="KNOCK"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b6"><text string="QUIT"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b7"><text string="SCORE"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b8"><text string="NO"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b9"><text string="DEALER"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b10"><text string="LANGUAGE"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b11"><text string="CONV"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b12"><text string="HAND"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b13"><text string="&#x2663;"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b14"><text string="&#x2666;"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b15"><text string="&#x2665;"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b16"><text string="&#x2660;"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b17"><text string="JACK"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b18"><text string="QUEEN"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b19"><text string="KING"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b20"><text string="ACE"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b21"><text string="7"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b22"><text string="8"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b23"><text string="9"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b24"><text string="10"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b25"><text string="3"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b26"><text string="4"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b27"><text string="5"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b28"><text string="6"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b29"><text string="COMPUTER"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b30"><text string="HUMAN"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b31"><text string="1"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+ <element name="text_b32"><text string="2"><color red="0.7" green="0.7" blue="0.7" /></text></element>
+
+ <element name="white"><rect><color red="0.9" green="0.9" blue="0.9" /></rect></element>
+ <element name="edge1"><rect><color red="0.15" green="0.15" blue="0.15" /></rect></element>
+ <element name="edge2"><rect><color red="0.35" green="0.35" blue="0.35" /></rect></element>
+ <element name="gray"><rect><color red="0.4" green="0.4" blue="0.4" /></rect></element>
+ <element name="blackb"><rect><color red="0" green="0" blue="0" /></rect></element>
+
+ <element name="text_scan">
+ <rect><color red="0.0" green="0.0" blue="0.0" /></rect>
+ <text string="card scanner"><color red="0.4" green="0.4" blue="0.4" /></text>
+ </element>
+
+ <element name="nothing" defstate="0">
+ <text string=" "><color red="0.0" green="0.0" blue="0.0" /></text>
+ </element>
+
+ <element name="cba">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="A" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb2">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="2" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb3">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="3" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb4">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="4" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb5">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="5" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb6">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="6" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb7">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="7" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb8">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="8" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb9">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="9" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cb0">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="10" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cbj">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="J" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cbq">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="Q" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cbk">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="K" align="1"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+
+ <element name="cra">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="A" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr2">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="2" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr3">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="3" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr4">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="4" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr5">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="5" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr6">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="6" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr7">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="7" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr8">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="8" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr9">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="9" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="cr0">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="10" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="crj">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="J" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="crq">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="Q" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="crk">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="K" align="1"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+
+ <element name="csh">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text align="2" string="&#x2665;"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="csd">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text align="2" string="&#x2666;"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="csc">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text align="2" string="&#x2663;"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="css">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text align="2" string="&#x2660;"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+
+ <element name="cbjk">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="&#x263a;"><color red="0.1" green="0.1" blue="0.1" /></text>
+ </element>
+ <element name="crjk">
+ <rect><color red="0.9" green="0.9" blue="0.9" /></rect>
+ <text string="&#x263a;"><color red="0.8" green="0.1" blue="0.1" /></text>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-1" right="53" top="11" bottom="54" />
+
+ <!-- gin rummy game only uses the buttons within this box -->
+ <bezel element="gray"><bounds x="-1" y="18.1" width="24" height="10.3" /></bezel>
+ <bezel element="blackb"><bounds x="-0.9" y="18.2" width="23.8" height="10.1" /></bezel>
+
+ <!-- vfd -->
+
+ <bezel name="digit0" element="digit"><bounds x="0" y="12" width="2.75" height="4.125" /></bezel>
+ <bezel name="digit1" element="digit"><bounds x="2.75" y="12" width="2.75" height="4.125" /></bezel>
+ <bezel name="digit2" element="digit"><bounds x="5.50" y="12" width="2.75" height="4.125" /></bezel>
+ <bezel name="digit3" element="digit"><bounds x="8.25" y="12" width="2.75" height="4.125" /></bezel>
+ <bezel name="digit4" element="digit"><bounds x="11.00" y="12" width="2.75" height="4.125" /></bezel>
+ <bezel name="digit5" element="digit"><bounds x="13.75" y="12" width="2.75" height="4.125" /></bezel>
+ <bezel name="digit6" element="digit"><bounds x="16.50" y="12" width="2.75" height="4.125" /></bezel>
+ <bezel name="digit7" element="digit"><bounds x="19.25" y="12" width="2.75" height="4.125" /></bezel>
+
+ <!-- button panel -->
+
+ <bezel element="button" inputtag="RESET" inputmask="0x01"><bounds x="0" y="20" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.6" inputmask="0x01"><bounds x="6" y="20" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.5" inputmask="0x01"><bounds x="12" y="20" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.4" inputmask="0x01"><bounds x="18" y="20" width="4" height="3" /></bezel>
+
+ <bezel element="button" inputtag="IN.7" inputmask="0x02"><bounds x="0" y="25" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.6" inputmask="0x02"><bounds x="6" y="25" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.5" inputmask="0x02"><bounds x="12" y="25" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.4" inputmask="0x02"><bounds x="18" y="25" width="4" height="3" /></bezel>
+
+ <bezel element="button" inputtag="IN.7" inputmask="0x04"><bounds x="0" y="30" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.6" inputmask="0x04"><bounds x="6" y="30" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.5" inputmask="0x04"><bounds x="12" y="30" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.4" inputmask="0x04"><bounds x="18" y="30" width="4" height="3" /></bezel>
+
+ <bezel element="button" inputtag="IN.7" inputmask="0x08"><bounds x="0" y="35" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.6" inputmask="0x08"><bounds x="6" y="35" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.5" inputmask="0x08"><bounds x="12" y="35" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.4" inputmask="0x08"><bounds x="18" y="35" width="4" height="3" /></bezel>
+
+ <bezel element="text_b1"><bounds x="-2" y="18.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b2"><bounds x="4" y="18.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b3"><bounds x="10" y="18.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b4"><bounds x="16" y="18.45" width="8" height="1.4" /></bezel>
+
+ <bezel element="text_b5"><bounds x="-2" y="23.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b6"><bounds x="4" y="23.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b7"><bounds x="10" y="23.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b8"><bounds x="16" y="23.45" width="8" height="1.4" /></bezel>
+
+ <bezel element="text_b9"><bounds x="-2" y="28.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b10"><bounds x="4" y="28.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b11"><bounds x="10" y="28.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b12"><bounds x="16" y="28.45" width="8" height="1.4" /></bezel>
+
+ <bezel element="text_b13"><bounds x="-2" y="33.3" width="8" height="1.6" /></bezel>
+ <bezel element="text_b14"><bounds x="4" y="33.3" width="8" height="1.6" /></bezel>
+ <bezel element="text_b15"><bounds x="10" y="33.3" width="8" height="1.6" /></bezel>
+ <bezel element="text_b16"><bounds x="16" y="33.3" width="8" height="1.6" /></bezel>
+
+ <bezel element="button" inputtag="IN.3" inputmask="0x01"><bounds x="30" y="20" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.2" inputmask="0x01"><bounds x="36" y="20" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.1" inputmask="0x01"><bounds x="42" y="20" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.0" inputmask="0x01"><bounds x="48" y="20" width="4" height="3" /></bezel>
+
+ <bezel element="button" inputtag="IN.3" inputmask="0x02"><bounds x="30" y="25" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.2" inputmask="0x02"><bounds x="36" y="25" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.1" inputmask="0x02"><bounds x="42" y="25" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.0" inputmask="0x02"><bounds x="48" y="25" width="4" height="3" /></bezel>
+
+ <bezel element="button" inputtag="IN.3" inputmask="0x04"><bounds x="30" y="30" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.2" inputmask="0x04"><bounds x="36" y="30" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.1" inputmask="0x04"><bounds x="42" y="30" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.0" inputmask="0x04"><bounds x="48" y="30" width="4" height="3" /></bezel>
+
+ <bezel element="button" inputtag="IN.3" inputmask="0x08"><bounds x="30" y="35" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.2" inputmask="0x08"><bounds x="36" y="35" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.1" inputmask="0x08"><bounds x="42" y="35" width="4" height="3" /></bezel>
+ <bezel element="button" inputtag="IN.0" inputmask="0x08"><bounds x="48" y="35" width="4" height="3" /></bezel>
+
+ <bezel element="text_b17"><bounds x="28" y="18.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b18"><bounds x="34" y="18.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b19"><bounds x="40" y="18.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b20"><bounds x="46" y="18.45" width="8" height="1.4" /></bezel>
+
+ <bezel element="text_b21"><bounds x="28" y="23.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b22"><bounds x="34" y="23.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b23"><bounds x="40" y="23.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b24"><bounds x="46" y="23.45" width="8" height="1.4" /></bezel>
+
+ <bezel element="text_b25"><bounds x="28" y="28.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b26"><bounds x="34" y="28.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b27"><bounds x="40" y="28.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b28"><bounds x="46" y="28.45" width="8" height="1.4" /></bezel>
+
+ <bezel element="text_b29"><bounds x="28" y="33.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b30"><bounds x="34" y="33.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b31"><bounds x="40" y="33.45" width="8" height="1.4" /></bezel>
+ <bezel element="text_b32"><bounds x="46" y="33.45" width="8" height="1.4" /></bezel>
+
+ <!-- cards -->
+
+ <bezel element="gray"><bounds x="-0.5" y="39.7" width="18" height="0.2" /></bezel>
+ <bezel element="text_scan"><bounds x="4" y="39" width="8" height="1.4" /></bezel>
+
+ <bezel element="white"><bounds x="0" y="41" width="14" height="15" /></bezel>
+ <bezel element="white"><bounds x="15" y="41" width="2" height="15" /></bezel>
+
+ <bezel element="cba"><bounds x="0.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb2"><bounds x="1.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb3"><bounds x="2.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb4"><bounds x="3.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb5"><bounds x="4.08" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb6"><bounds x="5.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb7"><bounds x="6.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb8"><bounds x="7.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb9"><bounds x="8.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb0"><bounds x="9.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="white"><bounds x="10" y="41.5" width="2" height="2" /></bezel>
+ <bezel element="cbj"><bounds x="10.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cbq"><bounds x="11.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cbk"><bounds x="12.15" y="41.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="css"><bounds x="12.05" y="42.81" width="1.8" height="1.5" /></bezel>
+
+ <bezel element="cra"><bounds x="0.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr2"><bounds x="1.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr3"><bounds x="2.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr4"><bounds x="3.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr5"><bounds x="4.08" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr6"><bounds x="5.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr7"><bounds x="6.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr8"><bounds x="7.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr9"><bounds x="8.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr0"><bounds x="9.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="white"><bounds x="10" y="44.5" width="2" height="2" /></bezel>
+ <bezel element="crj"><bounds x="10.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="crq"><bounds x="11.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="crk"><bounds x="12.15" y="44.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="csh"><bounds x="12.05" y="45.81" width="1.8" height="1.5" /></bezel>
+
+ <bezel element="cba"><bounds x="0.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb2"><bounds x="1.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb3"><bounds x="2.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb4"><bounds x="3.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb5"><bounds x="4.08" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb6"><bounds x="5.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb7"><bounds x="6.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb8"><bounds x="7.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb9"><bounds x="8.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cb0"><bounds x="9.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="white"><bounds x="10" y="47.5" width="2" height="2" /></bezel>
+ <bezel element="cbj"><bounds x="10.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cbq"><bounds x="11.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cbk"><bounds x="12.15" y="47.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="csc"><bounds x="12.05" y="48.81" width="1.8" height="1.5" /></bezel>
+
+ <bezel element="cra"><bounds x="0.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr2"><bounds x="1.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr3"><bounds x="2.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr4"><bounds x="3.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr5"><bounds x="4.08" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr6"><bounds x="5.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr7"><bounds x="6.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr8"><bounds x="7.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr9"><bounds x="8.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="cr0"><bounds x="9.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="white"><bounds x="10" y="50.5" width="2" height="2" /></bezel>
+ <bezel element="crj"><bounds x="10.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="crq"><bounds x="11.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="crk"><bounds x="12.15" y="50.5" width="1.8" height="1.3" /></bezel>
+ <bezel element="csd"><bounds x="12.05" y="51.81" width="1.8" height="1.5" /></bezel>
+
+ <bezel element="cbjk"><bounds x="15.1" y="42" width="1.8" height="1.5" /></bezel>
+ <bezel element="crjk"><bounds x="15.1" y="45" width="1.8" height="1.5" /></bezel>
+
+ <bezel element="edge1"><bounds x="0.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="1.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="1.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="2.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="2.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="3.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="3.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="4.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="4.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="5.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="5.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="6.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="6.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="7.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="7.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="8.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="8.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="9.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="9.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="10.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="10.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="11.00" y="41" width="0.06" height="15" /></bezel>
+ <bezel element="edge1"><bounds x="11.95" y="41" width="0.08" height="15" /></bezel>
+ <bezel element="edge2"><bounds x="12.00" y="41" width="0.06" height="15" /></bezel>
+
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0001"><bounds x="0" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0002"><bounds x="1" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0004"><bounds x="2" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0008"><bounds x="3" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0010"><bounds x="4" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0020"><bounds x="5" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0040"><bounds x="6" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0080"><bounds x="7" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0100"><bounds x="8" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0200"><bounds x="9" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0400"><bounds x="10" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x0800"><bounds x="11" y="41.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x1000"><bounds x="12" y="41.5" width="2" height="2.7" /></bezel>
+
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0001"><bounds x="0" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0002"><bounds x="1" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0004"><bounds x="2" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0008"><bounds x="3" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0010"><bounds x="4" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0020"><bounds x="5" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0040"><bounds x="6" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0080"><bounds x="7" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0100"><bounds x="8" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0200"><bounds x="9" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0400"><bounds x="10" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x0800"><bounds x="11" y="44.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.1" inputmask="0x1000"><bounds x="12" y="44.5" width="2" height="2.7" /></bezel>
+
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0001"><bounds x="0" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0002"><bounds x="1" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0004"><bounds x="2" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0008"><bounds x="3" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0010"><bounds x="4" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0020"><bounds x="5" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0040"><bounds x="6" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0080"><bounds x="7" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0100"><bounds x="8" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0200"><bounds x="9" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0400"><bounds x="10" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x0800"><bounds x="11" y="47.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.2" inputmask="0x1000"><bounds x="12" y="47.5" width="2" height="2.7" /></bezel>
+
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0001"><bounds x="0" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0002"><bounds x="1" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0004"><bounds x="2" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0008"><bounds x="3" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0010"><bounds x="4" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0020"><bounds x="5" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0040"><bounds x="6" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0080"><bounds x="7" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0100"><bounds x="8" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0200"><bounds x="9" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0400"><bounds x="10" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x0800"><bounds x="11" y="50.5" width="1" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.3" inputmask="0x1000"><bounds x="12" y="50.5" width="2" height="2.7" /></bezel>
+
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x2000"><bounds x="15" y="41.5" width="2" height="2.7" /></bezel>
+ <bezel element="nothing" inputtag="CARDS.0" inputmask="0x4000"><bounds x="15" y="44.5" width="2" height="2.7" /></bezel>
+
+ <bezel element="blackb"><bounds x="0" y="40.5" width="50" height="1" /></bezel>
+ <bezel element="blackb"><bounds x="0" y="44.2" width="50" height="0.3" /></bezel>
+ <bezel element="blackb"><bounds x="0" y="47.2" width="50" height="0.3" /></bezel>
+ <bezel element="blackb"><bounds x="14.9" y="47.3" width="50" height="15" /></bezel>
+ <bezel element="blackb"><bounds x="0" y="50.2" width="50" height="0.3" /></bezel>
+ <bezel element="blackb"><bounds x="0" y="53.2" width="50" height="15" /></bezel>
+
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/h2hbaskb.lay b/src/mame/layout/h2hbaskb.lay
new file mode 100644
index 00000000000..d96cabfd003
--- /dev/null
+++ b/src/mame/layout/h2hbaskb.lay
@@ -0,0 +1,140 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_yellow"><rect><color red="0.75" green="0.7" blue="0.2" /></rect></element>
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_white"><rect><color red="0.85" green="0.85" blue="0.85" /></rect></element>
+ <element name="disk_white"><disk><color red="0.85" green="0.85" blue="0.85" /></disk></element>
+ <element name="disk_black"><disk><color red="0.0" green="0.0" blue="0.0" /></disk></element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.20" blue="0.22" /></led7seg>
+ </element>
+
+ <element name="led" defstate="0">
+ <disk state="0"><color red="0.14" green="0.02" blue="0.03" /></disk>
+ <disk state="1"><color red="1.0" green="0.20" blue="0.22" /></disk>
+ </element>
+ <element name="ledr" defstate="0">
+ <rect state="0"><color red="0.14" green="0.02" blue="0.03" /></rect>
+ <rect state="1"><color red="1.0" green="0.20" blue="0.22" /></rect>
+ </element>
+
+ <element name="text_home"><text string="HOME"><color red="0.85" green="0.85" blue="0.85" /></text></element>
+ <element name="text_away"><text string="AWAY"><color red="0.85" green="0.85" blue="0.85" /></text></element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="26" right="124" top="5" bottom="85.5" />
+
+ <!-- field, goal -->
+
+ <bezel element="static_yellow"><bounds x="25" y="4" width="100" height="22.1" /></bezel>
+ <bezel element="static_white"><bounds x="33" y="14" width="18" height="12.1" /></bezel>
+ <bezel element="static_black"><bounds x="34" y="15" width="16" height="12.1" /></bezel>
+
+ <bezel name="digit7" element="digit"><bounds x="36" y="16" width="6" height="9" /></bezel>
+ <bezel name="digit6" element="digit"><bounds x="42" y="16" width="6" height="9" /></bezel>
+
+ <bezel element="static_white"><bounds x="25" y="26" width="100" height="1" /></bezel>
+ <bezel element="disk_white"><bounds x="60" y="40" width="30" height="30" /></bezel>
+ <bezel element="disk_black"><bounds x="61" y="41" width="28" height="28" /></bezel>
+ <bezel element="static_white"><bounds x="60" y="5" width="30" height="50" /></bezel>
+ <bezel element="static_black"><bounds x="61" y="5" width="28" height="50.1" /></bezel>
+ <bezel element="static_white"><bounds x="57.5" y="4.9" width="35" height="1.1" /></bezel>
+ <bezel element="static_white"><bounds x="60.5" y="51" width="29" height="1" /></bezel>
+
+ <bezel element="static_black"><bounds x="59.99" y="10.5" width="30.02" height="0.9" /></bezel>
+ <bezel element="static_black"><bounds x="59.99" y="17.0" width="30.02" height="0.9" /></bezel>
+ <bezel element="static_black"><bounds x="59.99" y="23.5" width="30.02" height="0.9" /></bezel>
+ <bezel element="static_black"><bounds x="59.5" y="30.0" width="31" height="0.9" /></bezel>
+ <bezel element="static_black"><bounds x="59.5" y="36.5" width="31" height="0.9" /></bezel>
+ <bezel element="static_black"><bounds x="59.5" y="43.0" width="31" height="0.9" /></bezel>
+ <bezel element="static_black"><bounds x="59.5" y="49.5" width="31" height="0.9" /></bezel>
+
+ <bezel element="disk_white"><bounds x="70" y="8" width="10" height="10" /></bezel>
+ <bezel element="static_white"><bounds x="72" y="5.5" width="1" height="6" /></bezel>
+ <bezel element="static_white"><bounds x="77" y="5.5" width="1" height="6" /></bezel>
+
+ <bezel element="disk_black"><bounds x="71" y="9" width="8" height="8" /></bezel>
+ <bezel name="5.0" element="led"><bounds x="73" y="11" width="4" height="4" /></bezel>
+
+ <bezel name="9.0" element="led"><bounds x="62" y="21" width="4" height="4" /></bezel>
+ <bezel name="9.1" element="led"><bounds x="67" y="25" width="4" height="4" /></bezel>
+ <bezel name="9.2" element="led"><bounds x="73" y="26" width="4" height="4" /></bezel>
+ <bezel name="9.3" element="led"><bounds x="79" y="25" width="4" height="4" /></bezel>
+ <bezel name="9.4" element="led"><bounds x="84" y="21" width="4" height="4" /></bezel>
+
+ <!-- men -->
+
+ <bezel element="disk_white"><bounds x="72" y="54" width="6" height="6" /></bezel>
+ <bezel name="0.0" element="led"><bounds x="73" y="55" width="4" height="4" /></bezel>
+
+ <bezel element="disk_white"><bounds x="35" y="47" width="6" height="6" /></bezel>
+ <bezel name="11.0" element="led"><bounds x="36" y="48" width="4" height="4" /></bezel>
+
+ <bezel element="disk_white"><bounds x="109" y="47" width="6" height="6" /></bezel>
+ <bezel name="1.0" element="led"><bounds x="110" y="48" width="4" height="4" /></bezel>
+
+ <bezel element="disk_white"><bounds x="55" y="74" width="6" height="6" /></bezel>
+ <bezel name="10.0" element="led"><bounds x="56" y="75" width="4" height="4" /></bezel>
+ <bezel element="text_home"><bounds x="52" y="80.5" width="12" height="3" /></bezel>
+
+ <bezel element="disk_white"><bounds x="89" y="74" width="6" height="6" /></bezel>
+ <bezel name="2.0" element="led"><bounds x="90" y="75" width="4" height="4" /></bezel>
+ <bezel element="text_away"><bounds x="86" y="80.5" width="12" height="3" /></bezel>
+
+ <!-- small leds -->
+
+ <!-- the leds marked "x", sometimes seen unpopulated, maybe cutting costs in some of the production batches -->
+ <bezel name="3.1" element="led"><bounds x="57.1" y="29.1" width="1" height="1" /></bezel>
+ <bezel name="3.2" element="led"><bounds x="52.7" y="33.7" width="1" height="1" /></bezel>
+ <bezel name="3.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- x -->
+ <bezel name="8.0" element="ledr"><bounds x="44.6" y="40.6" width="4" height="1" /></bezel>
+ <bezel name="3.4" element="led"><bounds x="43.9" y="42.9" width="1" height="1" /></bezel>
+
+ <bezel name="4.1" element="led"><bounds x="74.5" y="34" width="1" height="1" /></bezel>
+ <bezel name="4.2" element="led"><bounds x="74.5" y="39" width="1" height="1" /></bezel>
+ <bezel name="4.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- x -->
+ <bezel name="8.2" element="ledr"><bounds x="73" y="46.5" width="4" height="1" /></bezel>
+ <bezel name="4.4" element="led"><bounds x="74.5" y="49" width="1" height="1" /></bezel>
+
+ <bezel name="5.1" element="led"><bounds x="91.9" y="29.1" width="1" height="1" /></bezel>
+ <bezel name="5.2" element="led"><bounds x="96.3" y="33.7" width="1" height="1" /></bezel>
+ <bezel name="5.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- x -->
+ <bezel name="8.4" element="ledr"><bounds x="101.4" y="40.6" width="4" height="1" /></bezel>
+ <bezel name="5.4" element="led"><bounds x="105.1" y="42.9" width="1" height="1" /></bezel>
+
+ <bezel name="11.1" element="led"><bounds x="45.6" y="50.9" width="1" height="1" /></bezel>
+ <bezel name="11.2" element="led"><bounds x="52.2" y="52.3" width="1" height="1" /></bezel>
+ <bezel name="8.1" element="ledr"><bounds x="55.5" y="51.5" width="1" height="4" /></bezel>
+ <bezel name="11.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- x -->
+ <bezel name="11.4" element="led"><bounds x="65.4" y="55.1" width="1" height="1" /></bezel>
+
+ <bezel name="0.4" element="led"><bounds x="103.4" y="50.9" width="1" height="1" /></bezel>
+ <bezel name="0.3" element="led"><bounds x="96.8" y="52.3" width="1" height="1" /></bezel>
+ <bezel name="8.3" element="ledr"><bounds x="93.5" y="51.5" width="1" height="4" /></bezel>
+ <bezel name="0.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- x -->
+ <bezel name="0.1" element="led"><bounds x="83.6" y="55.1" width="1" height="1" /></bezel>
+
+ <bezel name="10.4" element="led"><bounds x="42.7" y="56.1" width="1" height="1" /></bezel>
+ <bezel name="10.3" element="led"><bounds x="45.9" y="60.7" width="1" height="1" /></bezel>
+ <bezel name="10.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel> <!-- x -->
+ <bezel name="10.1" element="led"><bounds x="52.3" y="69.9" width="1" height="1" /></bezel>
+
+ <bezel name="2.4" element="led"><bounds x="65.5" y="76.5" width="1" height="1" /></bezel>
+ <bezel name="2.3" element="led"><bounds x="71.5" y="76.5" width="1" height="1" /></bezel>
+ <bezel name="2.2" element="led"><bounds x="77.5" y="76.5" width="1" height="1" /></bezel>
+ <bezel name="2.1" element="led"><bounds x="83.5" y="76.5" width="1" height="1" /></bezel>
+
+ <bezel name="1.1" element="led"><bounds x="107.3" y="56.1" width="1" height="1" /></bezel>
+ <bezel name="1.2" element="led"><bounds x="104.1" y="60.7" width="1" height="1" /></bezel>
+ <bezel name="1.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel> <!-- x -->
+ <bezel name="1.4" element="led"><bounds x="97.7" y="69.9" width="1" height="1" /></bezel>
+
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/h2hbaskbc.lay b/src/mame/layout/h2hbaskbc.lay
index a4d2c9e019c..e919638c7de 100644
--- a/src/mame/layout/h2hbaskbc.lay
+++ b/src/mame/layout/h2hbaskbc.lay
@@ -90,39 +90,40 @@
<!-- small leds -->
+ <!-- the leds marked "x", sometimes seen unpopulated, maybe cutting costs in some of the production batches -->
<bezel name="11.1" element="led"><bounds x="57.1" y="29.1" width="1" height="1" /></bezel>
<bezel name="11.2" element="led"><bounds x="52.7" y="33.7" width="1" height="1" /></bezel>
- <bezel name="11.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="11.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.0" element="ledr"><bounds x="44.6" y="40.6" width="4" height="1" /></bezel>
<bezel name="11.4" element="led"><bounds x="43.9" y="42.9" width="1" height="1" /></bezel>
<bezel name="12.1" element="led"><bounds x="74.5" y="34" width="1" height="1" /></bezel>
<bezel name="12.2" element="led"><bounds x="74.5" y="39" width="1" height="1" /></bezel>
- <bezel name="12.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="12.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.2" element="ledr"><bounds x="73" y="46.5" width="4" height="1" /></bezel>
<bezel name="12.4" element="led"><bounds x="74.5" y="49" width="1" height="1" /></bezel>
<bezel name="13.1" element="led"><bounds x="91.9" y="29.1" width="1" height="1" /></bezel>
<bezel name="13.2" element="led"><bounds x="96.3" y="33.7" width="1" height="1" /></bezel>
- <bezel name="13.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="13.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.4" element="ledr"><bounds x="101.4" y="40.6" width="4" height="1" /></bezel>
<bezel name="13.4" element="led"><bounds x="105.1" y="42.9" width="1" height="1" /></bezel>
<bezel name="5.1" element="led"><bounds x="45.6" y="50.9" width="1" height="1" /></bezel>
<bezel name="5.2" element="led"><bounds x="52.2" y="52.3" width="1" height="1" /></bezel>
<bezel name="2.1" element="ledr"><bounds x="55.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="5.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="5.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="5.4" element="led"><bounds x="65.4" y="55.1" width="1" height="1" /></bezel>
<bezel name="8.4" element="led"><bounds x="103.4" y="50.9" width="1" height="1" /></bezel>
<bezel name="8.3" element="led"><bounds x="96.8" y="52.3" width="1" height="1" /></bezel>
<bezel name="2.3" element="ledr"><bounds x="93.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="8.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="8.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="8.1" element="led"><bounds x="83.6" y="55.1" width="1" height="1" /></bezel>
<bezel name="4.4" element="led"><bounds x="42.7" y="56.1" width="1" height="1" /></bezel>
<bezel name="4.3" element="led"><bounds x="45.9" y="60.7" width="1" height="1" /></bezel>
- <bezel name="4.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="4.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="4.1" element="led"><bounds x="52.3" y="69.9" width="1" height="1" /></bezel>
<bezel name="10.4" element="led"><bounds x="65.5" y="76.5" width="1" height="1" /></bezel>
@@ -132,7 +133,7 @@
<bezel name="9.1" element="led"><bounds x="107.3" y="56.1" width="1" height="1" /></bezel>
<bezel name="9.2" element="led"><bounds x="104.1" y="60.7" width="1" height="1" /></bezel>
- <bezel name="9.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="9.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="9.4" element="led"><bounds x="97.7" y="69.9" width="1" height="1" /></bezel>
</view>
diff --git a/src/mame/layout/h2hhockey.lay b/src/mame/layout/h2hhockey.lay
index ac67e33f840..fa363570119 100644
--- a/src/mame/layout/h2hhockey.lay
+++ b/src/mame/layout/h2hhockey.lay
@@ -80,39 +80,40 @@
<!-- small leds -->
+ <!-- the leds marked "x", sometimes seen unpopulated, maybe cutting costs in some of the production batches -->
<bezel name="3.1" element="led"><bounds x="57.1" y="29.1" width="1" height="1" /></bezel>
<bezel name="3.2" element="led"><bounds x="52.7" y="33.7" width="1" height="1" /></bezel>
- <bezel name="3.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel>
+ <bezel name="3.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="8.0" element="ledr"><bounds x="44.6" y="40.6" width="4" height="1" /></bezel>
<bezel name="3.4" element="led"><bounds x="43.9" y="42.9" width="1" height="1" /></bezel>
<bezel name="4.1" element="led"><bounds x="74.5" y="34" width="1" height="1" /></bezel>
<bezel name="4.2" element="led"><bounds x="74.5" y="39" width="1" height="1" /></bezel>
- <bezel name="4.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel>
+ <bezel name="4.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- x -->
<bezel name="8.2" element="ledr"><bounds x="73" y="46.5" width="4" height="1" /></bezel>
<bezel name="4.4" element="led"><bounds x="74.5" y="49" width="1" height="1" /></bezel>
<bezel name="5.1" element="led"><bounds x="91.9" y="29.1" width="1" height="1" /></bezel>
<bezel name="5.2" element="led"><bounds x="96.3" y="33.7" width="1" height="1" /></bezel>
- <bezel name="5.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel>
+ <bezel name="5.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="8.4" element="ledr"><bounds x="101.4" y="40.6" width="4" height="1" /></bezel>
<bezel name="5.4" element="led"><bounds x="105.1" y="42.9" width="1" height="1" /></bezel>
<bezel name="11.1" element="led"><bounds x="45.6" y="50.9" width="1" height="1" /></bezel>
<bezel name="11.2" element="led"><bounds x="52.2" y="52.3" width="1" height="1" /></bezel>
<bezel name="8.1" element="ledr"><bounds x="55.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="11.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel>
+ <bezel name="11.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="11.4" element="led"><bounds x="65.4" y="55.1" width="1" height="1" /></bezel>
<bezel name="0.4" element="led"><bounds x="103.4" y="50.9" width="1" height="1" /></bezel>
<bezel name="0.3" element="led"><bounds x="96.8" y="52.3" width="1" height="1" /></bezel>
<bezel name="8.3" element="ledr"><bounds x="93.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="0.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel>
+ <bezel name="0.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="0.1" element="led"><bounds x="83.6" y="55.1" width="1" height="1" /></bezel>
<bezel name="10.4" element="led"><bounds x="42.7" y="56.1" width="1" height="1" /></bezel>
<bezel name="10.3" element="led"><bounds x="45.9" y="60.7" width="1" height="1" /></bezel>
- <bezel name="10.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="10.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="10.1" element="led"><bounds x="52.3" y="69.9" width="1" height="1" /></bezel>
<bezel name="2.4" element="led"><bounds x="65.5" y="76.5" width="1" height="1" /></bezel>
@@ -122,7 +123,7 @@
<bezel name="1.1" element="led"><bounds x="107.3" y="56.1" width="1" height="1" /></bezel>
<bezel name="1.2" element="led"><bounds x="104.1" y="60.7" width="1" height="1" /></bezel>
- <bezel name="1.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="1.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="1.4" element="led"><bounds x="97.7" y="69.9" width="1" height="1" /></bezel>
</view>
diff --git a/src/mame/layout/h2hhockeyc.lay b/src/mame/layout/h2hhockeyc.lay
index ab54c6e4cf2..f4dcf0bef24 100644
--- a/src/mame/layout/h2hhockeyc.lay
+++ b/src/mame/layout/h2hhockeyc.lay
@@ -80,39 +80,40 @@
<!-- small leds -->
+ <!-- the leds marked "x", sometimes seen unpopulated, maybe cutting costs in some of the production batches -->
<bezel name="11.1" element="led"><bounds x="57.1" y="29.1" width="1" height="1" /></bezel>
<bezel name="11.2" element="led"><bounds x="52.7" y="33.7" width="1" height="1" /></bezel>
- <bezel name="11.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="11.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.0" element="ledr"><bounds x="44.6" y="40.6" width="4" height="1" /></bezel>
<bezel name="11.4" element="led"><bounds x="43.9" y="42.9" width="1" height="1" /></bezel>
<bezel name="12.1" element="led"><bounds x="74.5" y="34" width="1" height="1" /></bezel>
<bezel name="12.2" element="led"><bounds x="74.5" y="39" width="1" height="1" /></bezel>
- <bezel name="12.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="12.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.2" element="ledr"><bounds x="73" y="46.5" width="4" height="1" /></bezel>
<bezel name="12.4" element="led"><bounds x="74.5" y="49" width="1" height="1" /></bezel>
<bezel name="13.1" element="led"><bounds x="91.9" y="29.1" width="1" height="1" /></bezel>
<bezel name="13.2" element="led"><bounds x="96.3" y="33.7" width="1" height="1" /></bezel>
- <bezel name="13.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="13.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.4" element="ledr"><bounds x="101.4" y="40.6" width="4" height="1" /></bezel>
<bezel name="13.4" element="led"><bounds x="105.1" y="42.9" width="1" height="1" /></bezel>
<bezel name="5.1" element="led"><bounds x="45.6" y="50.9" width="1" height="1" /></bezel>
<bezel name="5.2" element="led"><bounds x="52.2" y="52.3" width="1" height="1" /></bezel>
<bezel name="2.1" element="ledr"><bounds x="55.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="5.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="5.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="5.4" element="led"><bounds x="65.4" y="55.1" width="1" height="1" /></bezel>
<bezel name="8.4" element="led"><bounds x="103.4" y="50.9" width="1" height="1" /></bezel>
<bezel name="8.3" element="led"><bounds x="96.8" y="52.3" width="1" height="1" /></bezel>
<bezel name="2.3" element="ledr"><bounds x="93.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="8.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="8.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="8.1" element="led"><bounds x="83.6" y="55.1" width="1" height="1" /></bezel>
<bezel name="4.4" element="led"><bounds x="42.7" y="56.1" width="1" height="1" /></bezel>
<bezel name="4.3" element="led"><bounds x="45.9" y="60.7" width="1" height="1" /></bezel>
- <bezel name="4.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="4.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="4.1" element="led"><bounds x="52.3" y="69.9" width="1" height="1" /></bezel>
<bezel name="10.4" element="led"><bounds x="65.5" y="76.5" width="1" height="1" /></bezel>
@@ -122,7 +123,7 @@
<bezel name="9.1" element="led"><bounds x="107.3" y="56.1" width="1" height="1" /></bezel>
<bezel name="9.2" element="led"><bounds x="104.1" y="60.7" width="1" height="1" /></bezel>
- <bezel name="9.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="9.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="9.4" element="led"><bounds x="97.7" y="69.9" width="1" height="1" /></bezel>
</view>
diff --git a/src/mame/layout/h2hsoccerc.lay b/src/mame/layout/h2hsoccerc.lay
index 569eb129d59..9b5b7325da5 100644
--- a/src/mame/layout/h2hsoccerc.lay
+++ b/src/mame/layout/h2hsoccerc.lay
@@ -84,39 +84,40 @@
<!-- small leds -->
+ <!-- the leds marked "x", sometimes seen unpopulated, maybe cutting costs in some of the production batches -->
<bezel name="11.1" element="led"><bounds x="57.1" y="29.1" width="1" height="1" /></bezel>
<bezel name="11.2" element="led"><bounds x="52.7" y="33.7" width="1" height="1" /></bezel>
- <bezel name="11.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="11.3" element="led"><bounds x="48.3" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.0" element="ledr"><bounds x="44.6" y="40.6" width="4" height="1" /></bezel>
<bezel name="11.4" element="led"><bounds x="43.9" y="42.9" width="1" height="1" /></bezel>
<bezel name="12.1" element="led"><bounds x="74.5" y="34" width="1" height="1" /></bezel>
<bezel name="12.2" element="led"><bounds x="74.5" y="39" width="1" height="1" /></bezel>
- <bezel name="12.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="12.3" element="led"><bounds x="74.5" y="44" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.2" element="ledr"><bounds x="73" y="46.5" width="4" height="1" /></bezel>
<bezel name="12.4" element="led"><bounds x="74.5" y="49" width="1" height="1" /></bezel>
<bezel name="13.1" element="led"><bounds x="91.9" y="29.1" width="1" height="1" /></bezel>
<bezel name="13.2" element="led"><bounds x="96.3" y="33.7" width="1" height="1" /></bezel>
- <bezel name="13.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="13.3" element="led"><bounds x="100.7" y="38.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="2.4" element="ledr"><bounds x="101.4" y="40.6" width="4" height="1" /></bezel>
<bezel name="13.4" element="led"><bounds x="105.1" y="42.9" width="1" height="1" /></bezel>
<bezel name="5.1" element="led"><bounds x="45.6" y="50.9" width="1" height="1" /></bezel>
<bezel name="5.2" element="led"><bounds x="52.2" y="52.3" width="1" height="1" /></bezel>
<bezel name="2.1" element="ledr"><bounds x="55.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="5.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="5.3" element="led"><bounds x="58.8" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="5.4" element="led"><bounds x="65.4" y="55.1" width="1" height="1" /></bezel>
<bezel name="8.4" element="led"><bounds x="103.4" y="50.9" width="1" height="1" /></bezel>
<bezel name="8.3" element="led"><bounds x="96.8" y="52.3" width="1" height="1" /></bezel>
<bezel name="2.3" element="ledr"><bounds x="93.5" y="51.5" width="1" height="4" /></bezel>
- <bezel name="8.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- unpopulated, but is used -->
+ <bezel name="8.2" element="led"><bounds x="90.2" y="53.7" width="1" height="1" /></bezel> <!-- x -->
<bezel name="8.1" element="led"><bounds x="83.6" y="55.1" width="1" height="1" /></bezel>
<bezel name="4.4" element="led"><bounds x="42.7" y="56.1" width="1" height="1" /></bezel>
<bezel name="4.3" element="led"><bounds x="45.9" y="60.7" width="1" height="1" /></bezel>
- <bezel name="4.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="4.2" element="led"><bounds x="49.1" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="4.1" element="led"><bounds x="52.3" y="69.9" width="1" height="1" /></bezel>
<bezel name="10.4" element="led"><bounds x="65.5" y="76.5" width="1" height="1" /></bezel>
@@ -126,7 +127,7 @@
<bezel name="9.1" element="led"><bounds x="107.3" y="56.1" width="1" height="1" /></bezel>
<bezel name="9.2" element="led"><bounds x="104.1" y="60.7" width="1" height="1" /></bezel>
- <bezel name="9.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel>
+ <bezel name="9.3" element="led"><bounds x="100.9" y="65.3" width="1" height="1" /></bezel> <!-- x -->
<bezel name="9.4" element="led"><bounds x="97.7" y="69.9" width="1" height="1" /></bezel>
</view>
diff --git a/src/mame/layout/tntell.lay b/src/mame/layout/tntell.lay
index 629a79643c2..ce4f1c733d8 100644
--- a/src/mame/layout/tntell.lay
+++ b/src/mame/layout/tntell.lay
@@ -5,6 +5,7 @@
<element name="static_black"><rect><color red="0.1" green="0.1" blue="0.1" /></rect></element>
<element name="static_white"><rect><color red="0.98" green="0.98" blue="1.0" /></rect></element>
+ <element name="overlay_default" defstate="4"><text string=" "></text></element>
<element name="text_on">
<rect><color red="0.98" green="0.98" blue="1.0" /></rect>
@@ -40,6 +41,11 @@
<view name="Internal Layout">
<bounds left="3" right="71.8" top="9.7" bottom="71.8" />
+
+ <!-- this "overlay_code" example only works for 1 view, since MAME parses all views and not just current active one -->
+ <!-- you can also put the overlay code in the view name, as $XX where XX is the hex value of the overlay in tispeak.cpp -->
+ <bezel name="overlay_code" element="overlay_default"><bounds x="0" y="0" width="1" height="1" /></bezel>
+
<bezel element="static_black">
<bounds left="3" right="71.8" top="9.7" bottom="71.8" />
</bezel>
diff --git a/src/mame/machine/apple2common.cpp b/src/mame/machine/apple2common.cpp
index c7bb5cf5041..9589efc0e00 100644
--- a/src/mame/machine/apple2common.cpp
+++ b/src/mame/machine/apple2common.cpp
@@ -59,12 +59,21 @@ static const struct dasm_data p8_calls[] =
static const struct dasm_data a2_stuff[] =
{
- { 0x0020, "TXTLEFT" }, { 0x0021, "TXTWIDTH" }, { 0x0022, "TXTTOP" }, { 0x0023, "TXTBOTTOM" },
- { 0x0024, "CURSORHORZ" }, { 0x0025, "CURSORVERT" }, { 0x0028, "BASEADR" }, { 0x002b, "BOOTSLOT" }, { 0x002c, "GRLINEEND" },
- { 0x0030, "GRCOLOR" }, { 0x0032, "TEXTFORMAT" }, { 0x0033, "PROMPTCHAR" }, { 0x0036, "OUTHOOK" }, { 0x0038, "INHOOK" },
- { 0x0067, "BASICPRGBASE" }, { 0x0069, "BASICVARBASE" }, { 0x006b, "BASICARRBASE" }, { 0x6d, "BASICVAREND" },
- { 0x006f, "BASICSTREND" }, { 0x0075, "CURLINENUM" }, { 0x77, "ENDSTOPLINE" }, { 0x79, "CURLINEADR" },
- { 0x007b, "CURDATAADR" }, { 0x007d, "NEXTDATAADR" }, { 0x009d, "FAC" }, { 0x00a5, "ARG" }, { 0x00af, "BASICPRGEND" },
+ { 0x0020, "WNDLFT" }, { 0x0021, "WNDWDTH" }, { 0x0022, "WNDTOP" }, { 0x0023, "WNDBTM" },
+ { 0x0024, "CH" }, { 0x0025, "CV" }, { 0x0026, "GBASL" }, { 0x0027, "GBASH" },
+ { 0x0028, "BASL" }, { 0x0029, "BASH" }, { 0x002b, "BOOTSLOT" }, { 0x002c, "H2" },
+ { 0x002d, "V2" }, { 0x002e, "MASK" }, { 0x0030, "COLOR" }, { 0x0031, "MODE" },
+ { 0x0032, "INVFLG" }, { 0x0033, "PROMPT" }, { 0x0036, "CSWL" }, { 0x0037, "CSWH" },
+ { 0x0038, "KSWL" }, { 0x0039, "KSWH" }, { 0x0045, "ACC" }, { 0x0046, "XREG" },
+ { 0x0047, "YREG" }, { 0x0048, "STATUS" }, { 0x004E, "RNDL" }, { 0x004F, "RNDH" },
+ { 0x0067, "TXTTAB" }, { 0x0069, "VARTAB" }, { 0x006b, "ARYTAB" }, { 0x6d, "STREND" },
+ { 0x006f, "FRETOP" }, { 0x0071, "FRESPC" }, { 0x0073, "MEMSIZ" }, { 0x0075, "CURLIN" },
+ { 0x0077, "OLDLIN" }, { 0x0079, "OLDTEXT" }, { 0x007b, "DATLIN" }, { 0x007d, "DATPTR" },
+ { 0x007f, "INPTR" }, { 0x0081, "VARNAM" }, { 0x0083, "VARPNT" }, { 0x0085, "FORPNT" },
+ { 0x009A, "EXPON" }, { 0x009C, "EXPSGN" }, { 0x009d, "FAC" }, { 0x00A2, "FAC.SIGN" },
+ { 0x00a5, "ARG" }, { 0x00AA, "ARG.SIGN" }, { 0x00af, "PRGEND" }, { 0x00B8, "TXTPTR" },
+ { 0x00C9, "RNDSEED" }, { 0x00D6, "LOCK" }, { 0x00D8, "ERRFLG" }, { 0x00DA, "ERRLIN" },
+ { 0x00DE, "ERRNUM" }, { 0x00E4, "HGR.COLOR" }, { 0x00E6, "HGR.PAGE" }, { 0x00F1, "SPEEDZ" },
{ 0xc000, "KBD" }, { 0xc001, "80STOREON" }, { 0xc002, "RDMAINRAM" }, {0xc003, "RDCARDRAM" }, {0xc004, "WRMAINRAM" },
{ 0xc005, "WRCARDRAM" }, { 0xc006, "SETSLOTCXROM" }, { 0xc007, "SETINTCXROM" }, { 0xc008, "SETSTDZP" },
@@ -85,34 +94,42 @@ static const struct dasm_data a2_stuff[] =
{ 0xc085, "ROMIN" }, { 0xc087, "LCBANK2" }, { 0xcfff, "DISCC8ROM" },
{ 0xF800, "F8ROM:PLOT" }, { 0xF80E, "F8ROM:PLOT1" } , { 0xF819, "F8ROM:HLINE" }, { 0xF828, "F8ROM:VLINE" },
- { 0xF832, "F8ROM:CLRSCR" }, { 0xF836, "F8ROM:CLRTOP" }, { 0xF847, "F8ROM:GBASCALC" }, { 0xF85F, "F8ROM:NXTCOL" },
- { 0xF864, "F8ROM:SETCOL" }, { 0xF871, "F8ROM:SCRN" }, { 0xF88C, "F8ROM:INSDS1.2" }, { 0xF88E, "F8ROM:INSDS2" },
- { 0xF890, "F8ROM:GET816LEN" }, { 0xF8D0, "F8ROM:INSTDSP" }, { 0xF940, "F8ROM:PRNTYX" }, { 0xF941, "F8ROM:PRNTAX" },
- { 0xF944, "F8ROM:PRNTX" }, { 0xF948, "F8ROM:PRBLNK" }, { 0xF94A, "F8ROM:PRBL2" }, { 0xF953, "F8ROM:PCADJ" },
- { 0xF962, "F8ROM:TEXT2COPY" }, { 0xFA40, "F8ROM:OLDIRQ" }, { 0xFA4C, "F8ROM:BREAK" }, { 0xFA59, "F8ROM:OLDBRK" },
+ { 0xF832, "F8ROM:CLRSCR" }, { 0xF836, "F8ROM:CLRTOP" }, { 0xF838, "F8ROM:CLRSC2" }, { 0xF847, "F8ROM:GBASCALC" },
+ { 0xF856, "F8ROM:GBCALC" }, { 0xF85F, "F8ROM:NXTCOL" }, { 0xF864, "F8ROM:SETCOL" }, { 0xF871, "F8ROM:SCRN" },
+ { 0xF882, "F8ROM:INSDS1" }, { 0xF88E, "F8ROM:INSDS2" }, { 0xF8A5, "F8ROM:ERR" }, { 0xF8A9, "F8ROM:GETFMT" },
+ { 0xF8D0, "F8ROM:INSTDSP" }, { 0xF940, "F8ROM:PRNTYX" }, { 0xF941, "F8ROM:PRNTAX" }, { 0xF944, "F8ROM:PRNTX" },
+ { 0xF948, "F8ROM:PRBLNK" }, { 0xF94A, "F8ROM:PRBL2" }, { 0xF84C, "F8ROM:PRBL3" }, { 0xF953, "F8ROM:PCADJ" },
+ { 0xF854, "F8ROM:PCADJ2" }, { 0xF856, "F8ROM:PCADJ3" }, { 0xF85C, "F8ROM:PCADJ4" }, { 0xF962, "F8ROM:FMT1" },
+ { 0xF9A6, "F8ROM:FMT2" }, { 0xF9B4, "F8ROM:CHAR1" }, { 0xF9BA, "F8ROM:CHAR2" }, { 0xF9C0, "F8ROM:MNEML" },
+ { 0xFA00, "F8ROM:MNEMR" }, { 0xFA40, "F8ROM:OLDIRQ" }, { 0xFA4C, "F8ROM:BREAK" }, { 0xFA59, "F8ROM:OLDBRK" },
{ 0xFA62, "F8ROM:RESET" }, { 0xFAA6, "F8ROM:PWRUP" }, { 0xFABA, "F8ROM:SLOOP" }, { 0xFAD7, "F8ROM:REGDSP" },
- { 0xFADA, "F8ROM:RGDSP1" },
- { 0xFB19, "F8ROM:RTBL" }, { 0xFB1E, "F8ROM:PREAD" }, { 0xFB21, "F8ROM:PREAD4" }, { 0xFB2F, "F8ROM:INIT" },
- { 0xFB39, "F8ROM:SETTXT" }, { 0xFB40, "F8ROM:SETGR" }, { 0xFB4B, "F8ROM:SETWND" }, { 0xFB51, "F8ROM:SETWND2" },
- { 0xFB5B, "F8ROM:TABV" }, { 0xFB60, "F8ROM:APPLEII" }, { 0xFB6F, "F8ROM:SETPWRC" }, { 0xFB78, "F8ROM:VIDWAIT" },
- { 0xFB88, "F8ROM:KBDWAIT" }, { 0xFBB3, "F8ROM:VERSION" }, { 0xFBBF, "F8ROM:ZIDBYTE2" }, { 0xFBC0, "F8ROM:ZIDBYTE" },
- { 0xFBC1, "F8ROM:BASCALC" }, { 0xFBDD, "F8ROM:BELL1" }, { 0xFBE2, "F8ROM:BELL1.2" }, { 0xFBE4, "F8ROM:BELL2" },
+ { 0xFADA, "F8ROM:RGDSP1" }, { 0xFAE4, "F8ROM:RDSP1" }, { 0xFB19, "F8ROM:RTBL" }, { 0xFB1E, "F8ROM:PREAD" },
+ { 0xFB21, "F8ROM:PREAD4" }, { 0xFB25, "F8ROM:PREAD2" }, { 0xFB2F, "F8ROM:INIT" }, { 0xFB39, "F8ROM:SETTXT" },
+ { 0xFB40, "F8ROM:SETGR" }, { 0xFB4B, "F8ROM:SETWND" }, { 0xFB51, "F8ROM:SETWND2" }, { 0xFB5B, "F8ROM:TABV" },
+ { 0xFB60, "F8ROM:APPLEII" }, { 0xFB6F, "F8ROM:SETPWRC" }, { 0xFB78, "F8ROM:VIDWAIT" }, { 0xFB88, "F8ROM:KBDWAIT" },
+ { 0xFBB3, "F8ROM:VERSION" }, { 0xFBBF, "F8ROM:ZIDBYTE2" }, { 0xFBC0, "F8ROM:ZIDBYTE" }, { 0xFBC1, "F8ROM:BASCALC" },
+ { 0xFBD0, "F8ROM:BSCLC2" }, { 0xFBDD, "F8ROM:BELL1" }, { 0xFBE2, "F8ROM:BELL1.2" }, { 0xFBE4, "F8ROM:BELL2" },
{ 0xFBF0, "F8ROM:STORADV" }, { 0xFBF4, "F8ROM:ADVANCE" }, { 0xFBFD, "F8ROM:VIDOUT" }, { 0xFC10, "F8ROM:BS" },
{ 0xFC1A, "F8ROM:UP" }, { 0xFC22, "F8ROM:VTAB" }, { 0xFC24, "F8ROM:VTABZ" }, { 0xFC42, "F8ROM:CLREOP" },
- { 0xFC58, "F8ROM:HOME" }, { 0xFC62, "F8ROM:CR" }, { 0xFC66, "F8ROM:LF" }, { 0xFC70, "F8ROM:SCROLL" },
- { 0xFC9C, "F8ROM:CLREOL" }, { 0xFC9E, "F8ROM:CLREOLZ" }, {0xFCA8, "F8ROM:WAIT" }, { 0xFCB4, "F8ROM:NXTA4" },
- { 0xFCBA, "F8ROM:NXTA1" }, { 0xFCC9, "F8ROM:HEADR" }, { 0xFD0C, "F8ROM:RDKEY" }, { 0xFD10, "F8ROM:FD10" },
- { 0xFD18, "F8ROM:RDKEY1" }, { 0xFD1B, "F8ROM:KEYIN" }, { 0xFD35, "F8ROM:RDCHAR" }, { 0xFD67, "F8ROM:GETLNZ" },
- { 0xFD6A, "F8ROM:GETLN" }, { 0xFD6C, "F8ROM:GETLN0" }, { 0xFD6F, "F8ROM:GETLN1" }, { 0xFD8B, "F8ROM:CROUT1" },
- { 0xFD8E, "F8ROM:CROUT" }, { 0xFD92, "F8ROM:PRA1" }, { 0xFDDA, "F8ROM:PRBYTE" }, { 0xFDE3, "F8ROM:PRHEX" },
- { 0xFDED, "F8ROM:COUT" }, { 0xFDF0, "F8ROM:COUT1" }, { 0xFDF6, "F8ROM:COUTZ" }, { 0xFE1F, "F8ROM:IDROUTINE" },
- { 0xFE2C, "F8ROM:MOVE" }, { 0xFE5E, "F8ROM:LIST" }, { 0xFE80, "F8ROM:SETINV" }, { 0xFE84, "F8ROM:SETNORM" },
- { 0xFE89, "F8ROM:SETKBD" }, { 0xFE8B, "F8ROM:INPORT" }, { 0xFE93, "F8ROM:SETVID" }, { 0xFE95, "F8ROM:OUTPORT" },
- { 0xFEB6, "F8ROM:GO" }, { 0xFECD, "F8ROM:WRITE" }, { 0xFEFD, "F8ROM:READ" }, { 0xFF2D, "F8ROM:PRERR" },
+ { 0xFC46, "F8ROM:CLEOP1" }, { 0xFC58, "F8ROM:HOME" }, { 0xFC62, "F8ROM:CR" }, { 0xFC66, "F8ROM:LF" },
+ { 0xFC70, "F8ROM:SCROLL" }, { 0xFC95, "F8ROM:SCRL3" }, { 0xFC9C, "F8ROM:CLREOL" }, { 0xFC9E, "F8ROM:CLREOLZ" },
+ { 0xFCA8, "F8ROM:WAIT" }, { 0xFCB4, "F8ROM:NXTA4" }, { 0xFCBA, "F8ROM:NXTA1" }, { 0xFCC9, "F8ROM:HEADR" },
+ { 0xFCEC, "F8ROM:RDBYTE" }, { 0xFCEE, "F8ROM:RDBYT2" }, { 0xFCFA, "F8ROM:RD2BIT" }, { 0xFD0C, "F8ROM:RDKEY" },
+ { 0xFD18, "F8ROM:RDKEY1" }, { 0xFD1B, "F8ROM:KEYIN" }, { 0xFD2F, "F8ROM:ESC" }, { 0xFD35, "F8ROM:RDCHAR" },
+ { 0xFD3D, "F8ROM:NOTCR" }, { 0xFD62, "F8ROM:CANCEL" }, { 0xFD67, "F8ROM:GETLNZ" }, { 0xFD6A, "F8ROM:GETLN" },
+ { 0xFD6C, "F8ROM:GETLN0" }, { 0xFD6F, "F8ROM:GETLN1" }, { 0xFD8B, "F8ROM:CROUT1" }, { 0xFD8E, "F8ROM:CROUT" },
+ { 0xFD92, "F8ROM:PRA1" }, { 0xFDA3, "F8ROM:XAM8" }, { 0xFDDA, "F8ROM:PRBYTE" }, { 0xFDE3, "F8ROM:PRHEX" },
+ { 0xFDE5, "F8ROM:PRHEXZ" }, { 0xFDED, "F8ROM:COUT" }, { 0xFDF0, "F8ROM:COUT1" }, { 0xFDF6, "F8ROM:COUTZ" },
+ { 0xFE18, "F8ROM:SETMODE" }, { 0xFE1F, "F8ROM:IDROUTINE" }, { 0xFE20, "F8ROM:LT" }, { 0xFE22, "F8ROM:LT2" },
+ { 0xFE2C, "F8ROM:MOVE" }, { 0xFE36, "F8ROM:VFY" }, { 0xFE5E, "F8ROM:LIST" }, { 0xFE63, "F8ROM:LIST2" },
+ { 0xFE75, "F8ROM:A1PC" }, { 0xFE80, "F8ROM:SETINV" }, { 0xFE84, "F8ROM:SETNORM" }, { 0xFE89, "F8ROM:SETKBD" },
+ { 0xFE8B, "F8ROM:INPORT" }, { 0xFE8D, "F8ROM:INPRT" }, { 0xFE93, "F8ROM:SETVID" }, { 0xFE95, "F8ROM:OUTPORT" },
+ { 0xFE97, "F8ROM:OUTPRT" }, { 0xFEB0, "F8ROM:XBASIC" }, { 0xFEB3, "F8ROM:BASCONT" }, { 0xFEB6, "F8ROM:GO" },
+ { 0xFECA, "F8ROM:USR" }, { 0xFECD, "F8ROM:WRITE" }, { 0xFEFD, "F8ROM:READ" }, { 0xFF2D, "F8ROM:PRERR" },
{ 0xFF3A, "F8ROM:BELL" }, { 0xFF3F, "F8ROM:RESTORE" }, { 0xFF4A, "F8ROM:SAVE" }, { 0xFF58, "F8ROM:IORTS" },
{ 0xFF59, "F8ROM:OLDRST" }, { 0xFF65, "F8ROM:MON" }, { 0xFF69, "F8ROM:MONZ" }, { 0xFF6C, "F8ROM:MONZ2" },
{ 0xFF70, "F8ROM:MONZ4" }, { 0xFF8A, "F8ROM:DIG" }, { 0xFFA7, "F8ROM:GETNUM" }, { 0xFFAD, "F8ROM:NXTCHR" },
- { 0xFFBE, "F8ROM:TOSUB" }, { 0xFFC7, "F8ROM:ZMODE" },
+ { 0xFFBE, "F8ROM:TOSUB" }, { 0xFFC7, "F8ROM:ZMODE" }, { 0xFFCC, "F8ROM:CHRTBL" }, { 0xFFE3, "F8ROM:SUBTBL" },
{ 0xffff, "" }
};
diff --git a/src/mame/machine/kc_keyb.cpp b/src/mame/machine/kc_keyb.cpp
index 37c1beb7397..5fceb7fc8f9 100644
--- a/src/mame/machine/kc_keyb.cpp
+++ b/src/mame/machine/kc_keyb.cpp
@@ -42,7 +42,7 @@ The keyboard of the KC is driven by a remote control circuit that is
originally designed for infrared remote control. This one was named
U807 and I learned there should be a similar chip called SAB 3021
available but I never found the specs on the web. The SAB 3021 was
-produced by Valvo which doesn't exist anymore (bought by Phillips
+produced by Valvo which doesn't exist anymore (bought by Philips
if I remember correctly). If you have more luck finding the specs
I'm still interested.
There also was a complementary chip for the receiving side but that
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 9ec9c1a2790..d5ee5f7d07f 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -10763,6 +10763,9 @@ crimfghtj // GX821 (c) 1989 (Japan)
@source:crimson.cpp
crimson // (c) 1992 SGI
+@source:cromptons.cpp
+ffruits //
+
@source:crospang.cpp
bestri // (c) F2 System
bestria //
@@ -12862,6 +12865,7 @@ feleg //
@source:fidel_card.cpp
bridgec3 //
bridgeca //
+gincribc //
vbrc //
@source:fidel_cc10.cpp
@@ -12878,7 +12882,7 @@ kishon //
@source:fidel_csc.cpp
csc //
-cscetr
+csce //
reversic //
super9cc //
@@ -15190,6 +15194,7 @@ ginv2000 // Gakken
gjackpot // Gakken
gpoker // Gakken
h2hbaseb // Coleco
+h2hbaskb // Coleco
h2hboxing // Coleco
h2hfootb // Coleco
h2hhockey // Coleco
@@ -30348,6 +30353,7 @@ svcpcba // 0269 (c) 2003 Playmore / Capcom - JAMMA PCB
98best44 //
neoprint //
npcartv1 //
+npcramen //
npfpit //
npmillen //
npotogib //
@@ -30356,6 +30362,7 @@ npscv1 //
npskv //
npsprg98 //
npsprgv4 //
+npssr2 //
npusagif //
@source:neptunp2.cpp
diff --git a/src/mame/video/segaybd.cpp b/src/mame/video/segaybd.cpp
index fb93042f19e..f00b47d1886 100644
--- a/src/mame/video/segaybd.cpp
+++ b/src/mame/video/segaybd.cpp
@@ -55,8 +55,6 @@ uint32_t segaybd_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
uint16_t *src = &sprites.pix(y);
uint8_t *pri = &screen.priority().pix(y);
-
-
for (int x = rect->min_x; x <= rect->max_x; x++)
{
// only process written pixels
diff --git a/src/osd/modules/debugger/qt/memorywindow.cpp b/src/osd/modules/debugger/qt/memorywindow.cpp
index 19e3dee6785..c799ab66c65 100644
--- a/src/osd/modules/debugger/qt/memorywindow.cpp
+++ b/src/osd/modules/debugger/qt/memorywindow.cpp
@@ -329,7 +329,7 @@ void DebuggerMemView::mousePressEvent(QMouseEvent* event)
{
QFontMetrics actualFont = fontMetrics();
const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
- const int fontHeight = std::max(1, actualFont.height());
+ const int fontHeight = std::max(1, actualFont.lineSpacing());
debug_view_xy topLeft = view()->visible_position();
debug_view_xy clickViewPosition;
diff --git a/src/osd/modules/input/input_x11.cpp b/src/osd/modules/input/input_x11.cpp
index 0762b5ae35d..f7c48a10d87 100644
--- a/src/osd/modules/input/input_x11.cpp
+++ b/src/osd/modules/input/input_x11.cpp
@@ -401,7 +401,23 @@ public:
else if (xevent.type == button_press_type || xevent.type == button_release_type)
{
XDeviceButtonEvent *button = reinterpret_cast<XDeviceButtonEvent *>(&xevent);
- lightgun.buttons[button->button] = (xevent.type == button_press_type) ? 0x80 : 0;
+
+ /*
+ * SDL/X11 Number the buttons 1,2,3, while windows and other parts of MAME
+ * like offscreen_reload expect 0,2,1. Transpose buttons 2 and 3, and then
+ * -1 the button number to align the numbering schemes.
+ */
+ int button_number = button->button;
+ switch (button_number)
+ {
+ case 2:
+ button_number = 3;
+ break;
+ case 3:
+ button_number = 2;
+ break;
+ }
+ lightgun.buttons[button_number - 1] = (xevent.type == button_press_type) ? 0x80 : 0;
}
}