summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-07-05 23:05:45 +1000
committer Vas Crabb <vas@vastheman.com>2018-07-05 23:05:45 +1000
commitd4e62756908f5d5553fff62b10e4017e97a3d1c5 (patch)
tree57a28d84b0aa8b466305fea2418b7a6c4fd54795
parent827fbdbc1e5b3542ed174174c836c2fe9a2a5493 (diff)
misc cleanup and stuff to make macro removal easier (nw)
-rw-r--r--src/devices/imagedev/floppy.h12
-rw-r--r--src/devices/machine/ticket.h8
-rw-r--r--src/devices/machine/tms1024.h4
-rw-r--r--src/devices/machine/upd4992.h2
-rw-r--r--src/emu/softlist_dev.h6
-rw-r--r--src/mame/drivers/artmagic.cpp2
-rw-r--r--src/mame/drivers/avt.cpp2
-rw-r--r--src/mame/drivers/calomega.cpp4
-rw-r--r--src/mame/drivers/ice_tbd.cpp2
-rw-r--r--src/mame/drivers/mephistp.cpp2
-rw-r--r--src/mame/drivers/micro3d.cpp2
-rw-r--r--src/mame/drivers/othello.cpp2
-rw-r--r--src/mame/drivers/pntnpuzl.cpp4
-rw-r--r--src/mame/drivers/stargame.cpp2
-rw-r--r--src/mame/drivers/wardner.cpp4
-rw-r--r--src/mame/includes/aerofgt.h6
-rw-r--r--src/mame/includes/crshrace.h13
-rw-r--r--src/mame/includes/docastle.h10
-rw-r--r--src/mame/includes/f1gp.h13
-rw-r--r--src/mame/includes/gotcha.h11
-rw-r--r--src/mame/includes/kyugo.h13
-rw-r--r--src/mame/includes/micro3d.h4
-rw-r--r--src/mame/includes/shangkid.h13
-rw-r--r--src/mame/includes/slapfght.h10
-rw-r--r--src/mame/includes/toaplan2.h10
-rw-r--r--src/mame/includes/twincobr.h10
-rw-r--r--src/mame/includes/zac2650.h14
-rw-r--r--src/mame/machine/nmk112.cpp32
-rw-r--r--src/mame/machine/nmk112.h11
-rw-r--r--src/mame/video/decodmd1.cpp17
-rw-r--r--src/mame/video/decodmd1.h1
31 files changed, 161 insertions, 85 deletions
diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h
index 04b7fe722f0..c486018defd 100644
--- a/src/devices/imagedev/floppy.h
+++ b/src/devices/imagedev/floppy.h
@@ -316,7 +316,17 @@ class floppy_connector: public device_t,
public device_slot_interface
{
public:
- floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, const char *dflt, const floppy_format_type *formats)
+ : floppy_connector(mconfig, tag, owner, 0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ set_formats(formats);
+ }
+ floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~floppy_connector();
void set_formats(const floppy_format_type *formats);
diff --git a/src/devices/machine/ticket.h b/src/devices/machine/ticket.h
index 371dc3d2496..6157b6c27db 100644
--- a/src/devices/machine/ticket.h
+++ b/src/devices/machine/ticket.h
@@ -59,7 +59,13 @@ class ticket_dispenser_device : public device_t
{
public:
// construction/destruction
- ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period, uint8_t motor_sense, uint8_t status_sense)
+ : ticket_dispenser_device(mconfig, tag, owner, 0)
+ {
+ set_period(period);
+ set_senses(motor_sense, status_sense, false);
+ }
+ ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
virtual ~ticket_dispenser_device();
// inline configuration helpers
diff --git a/src/devices/machine/tms1024.h b/src/devices/machine/tms1024.h
index ea63328af02..eae25fca18d 100644
--- a/src/devices/machine/tms1024.h
+++ b/src/devices/machine/tms1024.h
@@ -66,7 +66,7 @@ public:
PORT7
};
- tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// configuration helpers
template <unsigned N, class Object> devcb_base &set_read_port_callback(Object &&cb) { return m_read_port[N].set_callback(std::forward<Object>(cb)); }
@@ -98,7 +98,7 @@ protected:
class tms1025_device : public tms1024_device
{
public:
- tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
};
diff --git a/src/devices/machine/upd4992.h b/src/devices/machine/upd4992.h
index ad757948673..6e023bd118d 100644
--- a/src/devices/machine/upd4992.h
+++ b/src/devices/machine/upd4992.h
@@ -31,7 +31,7 @@ class upd4992_device : public device_t, public device_rtc_interface
{
public:
// construction/destruction
- upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 32'768);
// I/O operations
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/emu/softlist_dev.h b/src/emu/softlist_dev.h
index 7921d751348..50cd2e01753 100644
--- a/src/emu/softlist_dev.h
+++ b/src/emu/softlist_dev.h
@@ -135,8 +135,10 @@ public:
software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
// inline configuration helpers
- void set_type(const char *list, softlist_type list_type) { m_list_name.assign(list); m_list_type = list_type; }
- void set_filter(const char *filter) { m_filter = filter; }
+ software_list_device &set_type(const char *list, softlist_type list_type) { m_list_name.assign(list); m_list_type = list_type; return *this; }
+ software_list_device &set_original(const char *list) { return set_type(list, SOFTWARE_LIST_ORIGINAL_SYSTEM); }
+ software_list_device &set_compatible(const char *list) { return set_type(list, SOFTWARE_LIST_COMPATIBLE_SYSTEM); }
+ software_list_device &set_filter(const char *filter) { m_filter = filter; return *this; }
// getters
const std::string &list_name() const { return m_list_name; }
diff --git a/src/mame/drivers/artmagic.cpp b/src/mame/drivers/artmagic.cpp
index 6cc0ba8c9ed..8a686bd980e 100644
--- a/src/mame/drivers/artmagic.cpp
+++ b/src/mame/drivers/artmagic.cpp
@@ -886,7 +886,7 @@ MACHINE_CONFIG_START(artmagic_state::shtstar)
MCFG_DEVICE_ADD("guncpu", I80C31, 6000000)
MCFG_DEVICE_IO_MAP(shtstar_guncpu_io_map)
MCFG_DEVICE_PROGRAM_MAP(shtstar_guncpu_map)
- MCFG_MCS51_PORT_P1_IN_CB(NOOP) // ?
+ MCFG_MCS51_PORT_P1_IN_CB(CONSTANT(0)) // ?
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/avt.cpp b/src/mame/drivers/avt.cpp
index d55989411dc..02a69d01aa0 100644
--- a/src/mame/drivers/avt.cpp
+++ b/src/mame/drivers/avt.cpp
@@ -447,7 +447,7 @@ public:
, m_colorram(*this, "colorram")
, m_gfxdecode(*this, "gfxdecode")
, m_palette(*this, "palette")
- { }
+ { }
void avtnfl(machine_config &config);
void avt(machine_config &config);
diff --git a/src/mame/drivers/calomega.cpp b/src/mame/drivers/calomega.cpp
index b6f2181ac7a..06e19138401 100644
--- a/src/mame/drivers/calomega.cpp
+++ b/src/mame/drivers/calomega.cpp
@@ -2630,7 +2630,7 @@ MACHINE_CONFIG_START(calomega_state::s903mod)
/* sound hardware */
MCFG_DEVICE_MODIFY("ay8912")
- MCFG_AY8910_PORT_A_READ_CB(NOOP)
+ MCFG_AY8910_PORT_A_READ_CB(CONSTANT(0))
MCFG_DEVICE_REMOVE("acia6850_0")
@@ -2655,7 +2655,7 @@ MACHINE_CONFIG_START(calomega_state::sys905)
/* sound hardware */
MCFG_DEVICE_MODIFY("ay8912")
- MCFG_AY8910_PORT_A_READ_CB(NOOP)
+ MCFG_AY8910_PORT_A_READ_CB(CONSTANT(0))
MCFG_DEVICE_REMOVE("acia6850_0")
diff --git a/src/mame/drivers/ice_tbd.cpp b/src/mame/drivers/ice_tbd.cpp
index 986fd4a1115..1cd013c8c13 100644
--- a/src/mame/drivers/ice_tbd.cpp
+++ b/src/mame/drivers/ice_tbd.cpp
@@ -76,7 +76,7 @@ MACHINE_CONFIG_START(ice_tbd_state::ice_tbd)
MCFG_DEVICE_ADD("ppi", I8255, 0)
MCFG_I8255_OUT_PORTA_CB(NOOP) // ?
MCFG_I8255_OUT_PORTB_CB(NOOP) // ?
- MCFG_I8255_IN_PORTC_CB(NOOP) // ?
+ MCFG_I8255_IN_PORTC_CB(CONSTANT(0)) // ?
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/mephistp.cpp b/src/mame/drivers/mephistp.cpp
index 5c38bc01add..915909fc55e 100644
--- a/src/mame/drivers/mephistp.cpp
+++ b/src/mame/drivers/mephistp.cpp
@@ -184,7 +184,7 @@ MACHINE_CONFIG_START(mephisto_pinball_state::mephisto)
MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, mephisto_pinball_state, ay8910_read))
MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, mephisto_pinball_state, ay8910_write))
MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, mephisto_pinball_state, t0_t1_w))
- MCFG_MCS51_SERIAL_RX_CB(NOOP) // from MUART
+ MCFG_MCS51_SERIAL_RX_CB(CONSTANT(0)) // from MUART
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/drivers/micro3d.cpp b/src/mame/drivers/micro3d.cpp
index eb511e3874b..bf0c61999c2 100644
--- a/src/mame/drivers/micro3d.cpp
+++ b/src/mame/drivers/micro3d.cpp
@@ -401,7 +401,7 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(micro3d_state::botss11)
micro3d(config);
MCFG_DEVICE_MODIFY("adc")
- MCFG_ADC0844_CH1_CB(NOOP)
+ MCFG_ADC0844_CH1_CB(CONSTANT(0))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/othello.cpp b/src/mame/drivers/othello.cpp
index 6f541d6bb05..5514da5af93 100644
--- a/src/mame/drivers/othello.cpp
+++ b/src/mame/drivers/othello.cpp
@@ -418,7 +418,7 @@ MACHINE_CONFIG_START(othello_state::othello)
MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, othello_state, n7751_p2_w))
MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w))
- MCFG_I8243_ADD(m_i8243, NOOP, WRITE8(*this, othello_state, n7751_rom_control_w))
+ MCFG_I8243_ADD(m_i8243, CONSTANT(0), WRITE8(*this, othello_state, n7751_rom_control_w))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/pntnpuzl.cpp b/src/mame/drivers/pntnpuzl.cpp
index f9c2d87f22b..36528e8994f 100644
--- a/src/mame/drivers/pntnpuzl.cpp
+++ b/src/mame/drivers/pntnpuzl.cpp
@@ -149,8 +149,8 @@ CN1 standard DB15 VGA connector (15KHz)
class pntnpuzl_state : public driver_device
{
public:
- pntnpuzl_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ pntnpuzl_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu"),
m_via(*this, "via")
{ }
diff --git a/src/mame/drivers/stargame.cpp b/src/mame/drivers/stargame.cpp
index c1a56c8cc59..2a8c005e115 100644
--- a/src/mame/drivers/stargame.cpp
+++ b/src/mame/drivers/stargame.cpp
@@ -27,7 +27,7 @@ public:
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
, m_ctc(*this, "ctc")
- { }
+ { }
void stargame(machine_config &config);
diff --git a/src/mame/drivers/wardner.cpp b/src/mame/drivers/wardner.cpp
index 3b866d011f6..3df24c22a91 100644
--- a/src/mame/drivers/wardner.cpp
+++ b/src/mame/drivers/wardner.cpp
@@ -141,8 +141,8 @@ out:
class wardner_state : public twincobr_state
{
public:
- wardner_state(const machine_config &mconfig, device_type type, const char *tag)
- : twincobr_state(mconfig, type, tag),
+ wardner_state(const machine_config &mconfig, device_type type, const char *tag) :
+ twincobr_state(mconfig, type, tag),
m_membank(*this, "membank")
{
}
diff --git a/src/mame/includes/aerofgt.h b/src/mame/includes/aerofgt.h
index b076d4d5b08..a8f8496fb13 100644
--- a/src/mame/includes/aerofgt.h
+++ b/src/mame/includes/aerofgt.h
@@ -1,5 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+#ifndef MAME_INCLUDES_AEROFGT_H
+#define MAME_INCLUDES_AEROFGT_H
+
+#pragma once
#include "machine/gen_latch.h"
#include "video/vsystem_spr.h"
@@ -172,3 +176,5 @@ public:
void wbbc97_map(address_map &map);
void wbbc97_sound_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_AEROFGT_H
diff --git a/src/mame/includes/crshrace.h b/src/mame/includes/crshrace.h
index 486e44ed88b..2f7324d7e97 100644
--- a/src/mame/includes/crshrace.h
+++ b/src/mame/includes/crshrace.h
@@ -1,5 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+#ifndef MAME_INCLUDES_CRSHRACE_H
+#define MAME_INCLUDES_CRSHRACE_H
+
+#pragma once
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
@@ -11,8 +15,8 @@
class crshrace_state : public driver_device
{
public:
- crshrace_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ crshrace_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_videoram1(*this, "videoram1"),
m_videoram2(*this, "videoram2"),
m_z80bank(*this, "bank1"),
@@ -24,7 +28,8 @@ public:
m_spriteram2(*this, "spriteram2"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch") { }
+ m_soundlatch(*this, "soundlatch")
+ { }
/* memory pointers */
required_shared_ptr<uint16_t> m_videoram1;
@@ -71,3 +76,5 @@ public:
void sound_io_map(address_map &map);
void sound_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_CRSHRACE_H
diff --git a/src/mame/includes/docastle.h b/src/mame/includes/docastle.h
index 9c5c194d1a2..a838322f9f8 100644
--- a/src/mame/includes/docastle.h
+++ b/src/mame/includes/docastle.h
@@ -5,6 +5,10 @@
Mr. Do's Castle hardware
***************************************************************************/
+#ifndef MAME_INCLUDES_DOCASTLE_H
+#define MAME_INCLUDES_DOCASTLE_H
+
+#pragma once
#include "machine/tms1024.h"
#include "video/mc6845.h"
@@ -14,8 +18,8 @@
class docastle_state : public driver_device
{
public:
- docastle_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ docastle_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_slave(*this, "slave"),
m_cpu3(*this, "cpu3"),
@@ -94,3 +98,5 @@ private:
void dorunrun_map2(address_map &map);
void idsoccer_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_DOCASTLE_H
diff --git a/src/mame/includes/f1gp.h b/src/mame/includes/f1gp.h
index 3f57055c5e0..ec777834dc7 100644
--- a/src/mame/includes/f1gp.h
+++ b/src/mame/includes/f1gp.h
@@ -1,5 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
+#ifndef MAME_INCLUDES_F1GP_H
+#define MAME_INCLUDES_F1GP_H
+
+#pragma once
#include "machine/6850acia.h"
#include "machine/gen_latch.h"
@@ -11,8 +15,8 @@
class f1gp_state : public driver_device
{
public:
- f1gp_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ f1gp_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_sharedram(*this, "sharedram"),
m_spr1vram(*this, "spr1vram"),
m_spr2vram(*this, "spr2vram"),
@@ -35,7 +39,8 @@ public:
m_k053936(*this, "k053936"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
- m_acia(*this, "acia") { }
+ m_acia(*this, "acia")
+ { }
void f1gp2(machine_config &config);
void f1gpb(machine_config &config);
@@ -115,3 +120,5 @@ private:
void sound_io_map(address_map &map);
void sound_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_F1GP_H
diff --git a/src/mame/includes/gotcha.h b/src/mame/includes/gotcha.h
index 2f29c2132ad..5b9e998fb5f 100644
--- a/src/mame/includes/gotcha.h
+++ b/src/mame/includes/gotcha.h
@@ -5,14 +5,19 @@
Gotcha
*************************************************************************/
+#ifndef MAME_INCLUDES_GOTCHA_H
+#define MAME_INCLUDES_GOTCHA_H
+
+#pragma once
+
#include "sound/okim6295.h"
#include "video/decospr.h"
class gotcha_state : public driver_device
{
public:
- gotcha_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ gotcha_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_fgvideoram(*this, "fgvideoram"),
m_bgvideoram(*this, "bgvideoram"),
m_spriteram(*this, "spriteram"),
@@ -73,3 +78,5 @@ private:
output_finder<3> m_lamp_b;
output_finder<3> m_lamp_s;
};
+
+#endif // MAME_INCLUDES_GOTCHA_H
diff --git a/src/mame/includes/kyugo.h b/src/mame/includes/kyugo.h
index 208b11db7a8..e9140239f1e 100644
--- a/src/mame/includes/kyugo.h
+++ b/src/mame/includes/kyugo.h
@@ -5,14 +5,18 @@
Kyugo hardware games
***************************************************************************/
+#ifndef MAME_INCLUDES_KYUGO_H
+#define MAME_INCLUDES_KYUGO_H
+
+#pragma once
#include "emupal.h"
class kyugo_state : public driver_device
{
public:
- kyugo_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ kyugo_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_fgvideoram(*this, "fgvideoram"),
m_bgvideoram(*this, "bgvideoram"),
m_bgattribram(*this, "bgattribram"),
@@ -22,7 +26,8 @@ public:
m_maincpu(*this, "maincpu"),
m_subcpu(*this, "sub"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette")
+ { }
void kyugo_base(machine_config &config);
void repulse(machine_config &config);
@@ -95,3 +100,5 @@ private:
TILE_GET_INFO_MEMBER(get_bg_tile_info);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
+
+#endif // MAME_INCLUDES_KYUGO_H
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index a91e8b70735..1931ddda7e4 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -43,8 +43,8 @@ class micro3d_sound_device;
class micro3d_state : public driver_device
{
public:
- micro3d_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ micro3d_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_upd7759(*this, "upd7759"),
diff --git a/src/mame/includes/shangkid.h b/src/mame/includes/shangkid.h
index 0f4a36d1687..d5b5e2bb845 100644
--- a/src/mame/includes/shangkid.h
+++ b/src/mame/includes/shangkid.h
@@ -1,5 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
+#ifndef MAME_INCLUDES_SHANGKID_H
+#define MAME_INCLUDES_SHANGKID_H
+
+#pragma once
#include "sound/ay8910.h"
#include "emupal.h"
@@ -7,8 +11,8 @@
class shangkid_state : public driver_device
{
public:
- shangkid_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ shangkid_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_bbx(*this, "bbx"),
@@ -17,7 +21,8 @@ public:
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
- m_videoreg(*this, "videoreg") { }
+ m_videoreg(*this, "videoreg")
+ { }
void dynamski(machine_config &config);
void chinhero(machine_config &config);
@@ -90,3 +95,5 @@ private:
void shangkid_sound_map(address_map &map);
void sound_portmap(address_map &map);
};
+
+#endif // MAME_INCLUDES_SHANGKID_H
diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h
index 8d44e7b3f95..10086d3ab55 100644
--- a/src/mame/includes/slapfght.h
+++ b/src/mame/includes/slapfght.h
@@ -5,6 +5,10 @@
Toaplan Slap Fight hardware
***************************************************************************/
+#ifndef MAME_INCLUDES_SLAPFGHT_H
+#define MAME_INCLUDES_SLAPFGHT_H
+
+#pragma once
#include "cpu/z80/z80.h"
#include "video/bufsprite.h"
@@ -15,8 +19,8 @@
class slapfght_state : public driver_device
{
public:
- slapfght_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ slapfght_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_bmcu(*this, "bmcu"),
@@ -146,3 +150,5 @@ private:
void tigerhb1_map(address_map &map);
void tigerhb2_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_SLAPFGHT_H
diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h
index 41d0644cf5a..b9822f27105 100644
--- a/src/mame/includes/toaplan2.h
+++ b/src/mame/includes/toaplan2.h
@@ -1,8 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Quench, Yochizo, David Haywood
+#ifndef MAME_INCLUDES_TOAPLAN2_H
+#define MAME_INCLUDES_TOAPLAN2_H
-/**************** Machine stuff ******************/
-//#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */
+#pragma once
#include "cpu/m68000/m68000.h"
#include "machine/bankdev.h"
@@ -16,6 +17,9 @@
#include "emupal.h"
#include "screen.h"
+/**************** Machine stuff ******************/
+//#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */
+
// We encode priority with colour in the tilemaps, so need a larger palette
#define T2PALETTE_LENGTH 0x10000
@@ -230,3 +234,5 @@ private:
void vfive_68k_mem(address_map &map);
void vfive_v25_mem(address_map &map);
};
+
+#endif // MAME_INCLUDES_TOAPLAN2_H
diff --git a/src/mame/includes/twincobr.h b/src/mame/includes/twincobr.h
index 812c73b042e..f05c2e882d0 100644
--- a/src/mame/includes/twincobr.h
+++ b/src/mame/includes/twincobr.h
@@ -4,6 +4,10 @@
Twincobr/Flying Shark/Wardner game hardware from 1986-1987
-----------------------------------------------------------
****************************************************************************/
+#ifndef MAME_INCLUDES_TWINCOBR_H
+#define MAME_INCLUDES_TWINCOBR_H
+
+#pragma once
#include "video/mc6845.h"
#include "video/bufsprite.h"
@@ -14,8 +18,8 @@
class twincobr_state : public driver_device
{
public:
- twincobr_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ twincobr_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_sharedram(*this, "sharedram"),
m_spriteram8(*this, "spriteram8"),
m_spriteram16(*this, "spriteram16"),
@@ -139,3 +143,5 @@ protected:
void sound_io_map(address_map &map);
void sound_program_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_TWINCOBR_H
diff --git a/src/mame/includes/zac2650.h b/src/mame/includes/zac2650.h
index 3a7554bb2cc..7d88e0edf62 100644
--- a/src/mame/includes/zac2650.h
+++ b/src/mame/includes/zac2650.h
@@ -1,5 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Mike Coates
+#ifndef MAME_INCLUDES_ZAC2650_H
+#define MAME_INCLUDES_ZAC2650_H
+
+#pragma once
+
#include "machine/s2636.h"
#include "emupal.h"
#include "screen.h"
@@ -7,15 +12,16 @@
class zac2650_state : public driver_device
{
public:
- zac2650_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
+ zac2650_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_s2636(*this, "s2636"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
- m_s2636_0_ram(*this, "s2636_0_ram") { }
+ m_s2636_0_ram(*this, "s2636_0_ram")
+ { }
void tinvader(machine_config &config);
@@ -51,3 +57,5 @@ private:
void main_map(address_map &map);
};
+
+#endif // MAME_INCLUDES_ZAC2650_H
diff --git a/src/mame/machine/nmk112.cpp b/src/mame/machine/nmk112.cpp
index e4cbe57ccca..1a4b52daea0 100644
--- a/src/mame/machine/nmk112.cpp
+++ b/src/mame/machine/nmk112.cpp
@@ -20,14 +20,12 @@
DEFINE_DEVICE_TYPE(NMK112, nmk112_device, "nmk112", "NMK112")
nmk112_device::nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NMK112, tag, owner, clock),
- m_page_mask(0xff),
- m_tag0(nullptr),
- m_tag1(nullptr),
- m_rom0(nullptr),
- m_rom1(nullptr),
- m_size0(0),
- m_size1(0)
+ : device_t(mconfig, NMK112, tag, owner, clock)
+ , m_page_mask(0xff)
+ , m_rom0(*this, finder_base::DUMMY_TAG)
+ , m_rom1(*this, finder_base::DUMMY_TAG)
+ , m_size0(0)
+ , m_size1(0)
{
}
@@ -38,18 +36,12 @@ nmk112_device::nmk112_device(const machine_config &mconfig, const char *tag, dev
void nmk112_device::device_start()
{
save_item(NAME(m_current_bank));
- machine().save().register_postload(save_prepost_delegate(FUNC(nmk112_device::postload_bankswitch), this));
- if (m_tag0)
- {
- m_rom0 = machine().root_device().memregion(m_tag0)->base();
- m_size0 = machine().root_device().memregion(m_tag0)->bytes() - 0x40000;
- }
- if (m_tag1)
- {
- m_rom1 = machine().root_device().memregion(m_tag1)->base();
- m_size1 = machine().root_device().memregion(m_tag1)->bytes() - 0x40000;
- }
+ if (m_rom0)
+ m_size0 = m_rom0.bytes() - 0x40000;
+
+ if (m_rom1)
+ m_size1 = m_rom1.bytes() - 0x40000;
}
//-------------------------------------------------
@@ -104,7 +96,7 @@ WRITE8_MEMBER( nmk112_device::okibank_w )
do_bankswitch(offset, data);
}
-void nmk112_device::postload_bankswitch()
+void nmk112_device::device_post_load()
{
for (int i = 0; i < 8; i++)
do_bankswitch(i, m_current_bank[i]);
diff --git a/src/mame/machine/nmk112.h b/src/mame/machine/nmk112.h
index f8f87bba5a1..7f0855fb1c7 100644
--- a/src/mame/machine/nmk112.h
+++ b/src/mame/machine/nmk112.h
@@ -21,9 +21,9 @@ public:
nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
- void set_rom0_tag(const char *tag) { m_tag0 = tag; }
- void set_rom1_tag(const char *tag) { m_tag1 = tag; }
- void set_page_mask(uint8_t mask) { m_page_mask = ~mask; }
+ template <typename T> nmk112_device &set_rom0_tag(T &&tag) { m_rom0.set_tag(std::forward<T>(tag)); return *this; }
+ template <typename T> nmk112_device &set_rom1_tag(T &&tag) { m_rom1.set_tag(std::forward<T>(tag)); return *this; }
+ nmk112_device &set_page_mask(uint8_t mask) { m_page_mask = ~mask; return *this; }
DECLARE_WRITE8_MEMBER( okibank_w );
@@ -31,10 +31,10 @@ protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
+ virtual void device_post_load() override;
private:
void do_bankswitch( int offset, int data );
- void postload_bankswitch();
// internal state
@@ -43,8 +43,7 @@ private:
uint8_t m_current_bank[8];
- const char *m_tag0, *m_tag1;
- uint8_t *m_rom0, *m_rom1;
+ optional_region_ptr<uint8_t> m_rom0, m_rom1;
int m_size0, m_size1;
};
diff --git a/src/mame/video/decodmd1.cpp b/src/mame/video/decodmd1.cpp
index 2df1e5662c1..90a5abf593e 100644
--- a/src/mame/video/decodmd1.cpp
+++ b/src/mame/video/decodmd1.cpp
@@ -60,11 +60,6 @@ READ8_MEMBER( decodmd_type1_device::status_r )
return (m_busy & 0x01) | (m_status << 1);
}
-WRITE8_MEMBER( decodmd_type1_device::status_w )
-{
- m_status = data;
-}
-
// Z80 I/O ports not fully decoded.
// if bit 7 = 0, then when bit 2 is 0 selects COCLK, and when bit 2 is 1 selects CLATCH
READ8_MEMBER( decodmd_type1_device::dmd_port_r )
@@ -233,12 +228,12 @@ MACHINE_CONFIG_END
decodmd_type1_device::decodmd_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, DECODMD1, tag, owner, clock),
- m_cpu(*this, "dmdcpu"),
- m_rombank1(*this, "dmdbank1"),
- m_rombank2(*this, "dmdbank2"),
- m_ram(*this, RAM_TAG),
- m_bitlatch(*this, "bitlatch")
+ : device_t(mconfig, DECODMD1, tag, owner, clock)
+ , m_cpu(*this, "dmdcpu")
+ , m_rombank1(*this, "dmdbank1")
+ , m_rombank2(*this, "dmdbank2")
+ , m_ram(*this, RAM_TAG)
+ , m_bitlatch(*this, "bitlatch")
{}
void decodmd_type1_device::device_start()
diff --git a/src/mame/video/decodmd1.h b/src/mame/video/decodmd1.h
index f94fb3da776..3455e606156 100644
--- a/src/mame/video/decodmd1.h
+++ b/src/mame/video/decodmd1.h
@@ -35,7 +35,6 @@ public:
DECLARE_WRITE8_MEMBER(ctrl_w);
DECLARE_READ8_MEMBER(ctrl_r);
DECLARE_READ8_MEMBER(status_r);
- DECLARE_WRITE8_MEMBER(status_w);
DECLARE_READ8_MEMBER(dmd_port_r);
DECLARE_WRITE8_MEMBER(dmd_port_w);