From 5931e886863ad1cca1e78696fd9a680edf14d142 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 3 Jul 2018 22:07:08 +1000 Subject: misc cleanup and devcb3 prep (nw) --- src/devices/bus/ecbbus/grip.cpp | 2 +- src/devices/bus/isa/ibm_mfc.cpp | 4 ++-- src/devices/cpu/s2650/s2650.h | 2 +- src/devices/machine/i8255.cpp | 14 ++++++-------- src/devices/machine/i8255.h | 4 ++-- src/mame/audio/segag80r.cpp | 2 +- src/mame/drivers/drgnmst.cpp | 2 +- src/mame/drivers/kinst.cpp | 4 ++-- src/mame/drivers/model1.cpp | 2 +- src/mame/drivers/norautp.cpp | 4 ++-- src/mame/drivers/segag80r.cpp | 2 +- src/mame/drivers/segas16a.cpp | 2 +- src/mame/drivers/sitcom.cpp | 2 +- src/mame/includes/dynduke.h | 14 +++++++++++--- src/mame/includes/model2.h | 11 +++++++++-- src/mame/includes/model3.h | 13 ++++++++++--- src/mame/includes/mrflea.h | 13 ++++++++++--- src/mame/includes/pacman.h | 7 +++++++ src/mame/includes/segas16b.h | 6 ++++++ src/mame/includes/segas18.h | 6 ++++++ src/mame/includes/segas24.h | 6 ++++++ src/mame/includes/segaybd.h | 6 ++++++ src/mame/includes/seta.h | 9 ++++++++- src/mame/includes/suprloco.h | 13 ++++++++++--- 24 files changed, 111 insertions(+), 39 deletions(-) diff --git a/src/devices/bus/ecbbus/grip.cpp b/src/devices/bus/ecbbus/grip.cpp index 1000a8a51bf..776519555a7 100644 --- a/src/devices/bus/ecbbus/grip.cpp +++ b/src/devices/bus/ecbbus/grip.cpp @@ -312,7 +312,7 @@ WRITE8_MEMBER( ecb_grip21_device::ppi_pc_w ) m_sti->i7_w(m_ia); // PROF-80 handshaking - m_ppi_pc = (!BIT(data, 7) << 7) | (!BIT(data, 5) << 6) | (m_ppi->pa_r() & 0x3f); + m_ppi_pc = (!BIT(data, 7) << 7) | (!BIT(data, 5) << 6) | (m_ppi->read_pa() & 0x3f); } //------------------------------------------------- diff --git a/src/devices/bus/isa/ibm_mfc.cpp b/src/devices/bus/isa/ibm_mfc.cpp index 6fd01e344d8..786739ed4e2 100644 --- a/src/devices/bus/isa/ibm_mfc.cpp +++ b/src/devices/bus/isa/ibm_mfc.cpp @@ -162,7 +162,7 @@ INPUT_PORTS_END READ8_MEMBER( isa8_ibm_mfc_device::ppi0_i_a ) { // Read data from the Z80 PIU - return m_d71055c_1->pa_r(); + return m_d71055c_1->read_pa(); } WRITE8_MEMBER( isa8_ibm_mfc_device::ppi0_o_b ) @@ -210,7 +210,7 @@ WRITE8_MEMBER( isa8_ibm_mfc_device::ppi1_o_a ) READ8_MEMBER( isa8_ibm_mfc_device::ppi1_i_b ) { // Read data from the PC PIU - return m_d71055c_0->pb_r(); + return m_d71055c_0->read_pb(); } WRITE8_MEMBER( isa8_ibm_mfc_device::ppi1_o_c ) diff --git a/src/devices/cpu/s2650/s2650.h b/src/devices/cpu/s2650/s2650.h index eed957ee828..666c79cad5b 100644 --- a/src/devices/cpu/s2650/s2650.h +++ b/src/devices/cpu/s2650/s2650.h @@ -36,7 +36,7 @@ DECLARE_DEVICE_TYPE(S2650, s2650_device) #define MCFG_S2650_INTACK_HANDLER(_devcb) \ devcb = &downcast(*device).set_intack_handler(DEVCB_##_devcb); - class s2650_device : public cpu_device, public s2650_disassembler::config +class s2650_device : public cpu_device, public s2650_disassembler::config { public: // construction/destruction diff --git a/src/devices/machine/i8255.cpp b/src/devices/machine/i8255.cpp index 6d2588b541c..0ae0a9d24ac 100644 --- a/src/devices/machine/i8255.cpp +++ b/src/devices/machine/i8255.cpp @@ -876,22 +876,20 @@ WRITE8_MEMBER( i8255_device::write ) READ8_MEMBER( i8255_device::pa_r ) { - return pa_r(); + return read_pa(); } //------------------------------------------------- -// pb_r - port A read +// read_pa - port A read //------------------------------------------------- -uint8_t i8255_device::pa_r() +uint8_t i8255_device::read_pa() { uint8_t data = 0xff; if (port_mode(PORT_A) == MODE_OUTPUT) - { data = m_output[PORT_A]; - } return data; } @@ -903,15 +901,15 @@ uint8_t i8255_device::pa_r() READ8_MEMBER( i8255_device::pb_r ) { - return pb_r(); + return read_pb(); } //------------------------------------------------- -// pb_r - port B read +// read_pb - port B read //------------------------------------------------- -uint8_t i8255_device::pb_r() +uint8_t i8255_device::read_pb() { uint8_t data = 0xff; diff --git a/src/devices/machine/i8255.h b/src/devices/machine/i8255.h index b9a018d49e8..4c2c28c42db 100644 --- a/src/devices/machine/i8255.h +++ b/src/devices/machine/i8255.h @@ -89,10 +89,10 @@ public: DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( pa_r ); - uint8_t pa_r(); + uint8_t read_pa(); DECLARE_READ8_MEMBER( pb_r ); - uint8_t pb_r(); + uint8_t read_pb(); DECLARE_WRITE_LINE_MEMBER( pc2_w ); DECLARE_WRITE_LINE_MEMBER( pc4_w ); diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp index a70416615b1..12cc48e6b40 100644 --- a/src/mame/audio/segag80r.cpp +++ b/src/mame/audio/segag80r.cpp @@ -704,7 +704,7 @@ MACHINE_CONFIG_START(monsterb_sound_device::device_add_mconfig) MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE(m_i8243, i8243_device, prog_w)) MCFG_DEVICE_ADD(m_i8243, I8243, 0) - MCFG_I8243_READHANDLER(NOOP) + MCFG_I8243_READHANDLER(CONSTANT(0)) MCFG_I8243_WRITEHANDLER(WRITE8(*this, monsterb_sound_device, n7751_rom_control_w)) MCFG_DEVICE_ADD(m_samples, SAMPLES) diff --git a/src/mame/drivers/drgnmst.cpp b/src/mame/drivers/drgnmst.cpp index c14ae41d527..d8c835086ec 100644 --- a/src/mame/drivers/drgnmst.cpp +++ b/src/mame/drivers/drgnmst.cpp @@ -55,7 +55,7 @@ WRITE16_MEMBER(drgnmst_state::coin_w) WRITE8_MEMBER(drgnmst_state::snd_command_w) { - m_snd_command = (data & 0xff); + m_snd_command = data; m_maincpu->yield(); } diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp index 3b844719d4e..2115fc25dd7 100644 --- a/src/mame/drivers/kinst.cpp +++ b/src/mame/drivers/kinst.cpp @@ -191,8 +191,8 @@ Notes: class kinst_state : public driver_device { public: - kinst_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + kinst_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_rambase(*this, "rambase"), m_rambase2(*this, "rambase2"), m_control(*this, "control"), diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp index 576811ad7d4..1761909668d 100644 --- a/src/mame/drivers/model1.cpp +++ b/src/mame/drivers/model1.cpp @@ -1817,7 +1817,7 @@ MACHINE_CONFIG_START(model1_state::wingwar360) MCFG_DEVICE_MODIFY("ioboard") MCFG_MODEL1IO2_IN2_CB(READ8(*this, model1_state, r360_r)) MCFG_MODEL1IO2_DRIVE_WRITE_CB(WRITE8(*this, model1_state, r360_w)) - MCFG_MODEL1IO2_AN2_CB(NOOP) + MCFG_MODEL1IO2_AN2_CB(CONSTANT(0)) MCFG_MODEL1IO2_OUTPUT_CB(WRITE8(*this, model1_state, wingwar360_outputs_w)) MCFG_DEFAULT_LAYOUT(layout_model1io2) diff --git a/src/mame/drivers/norautp.cpp b/src/mame/drivers/norautp.cpp index 549b70a00b6..c28bb800202 100644 --- a/src/mame/drivers/norautp.cpp +++ b/src/mame/drivers/norautp.cpp @@ -732,8 +732,8 @@ TIMER_CALLBACK_MEMBER(norautp_state::ppi2_ack) m_ppi8255[2]->pc6_w(param); if (param == 0) { - uint8_t np_addr = m_ppi8255[2]->pb_r(); - uint8_t vram_data = m_ppi8255[2]->pa_r(); + uint8_t const np_addr = m_ppi8255[2]->read_pb(); + uint8_t const vram_data = m_ppi8255[2]->read_pa(); m_np_vram[np_addr] = vram_data; } } diff --git a/src/mame/drivers/segag80r.cpp b/src/mame/drivers/segag80r.cpp index 605f88f0a31..d18ebf4f759 100644 --- a/src/mame/drivers/segag80r.cpp +++ b/src/mame/drivers/segag80r.cpp @@ -298,7 +298,7 @@ WRITE8_MEMBER(segag80r_state::coin_count_w) READ8_MEMBER(segag80r_state::sindbadm_sound_data_r) { - uint8_t result = m_ppi->pa_r(); + uint8_t result = m_ppi->read_pa(); if (!machine().side_effects_disabled()) { m_ppi->pc6_w(0); diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp index ed4f6273a34..0bd7a81e63d 100644 --- a/src/mame/drivers/segas16a.cpp +++ b/src/mame/drivers/segas16a.cpp @@ -1981,7 +1981,7 @@ MACHINE_CONFIG_START(segas16a_state::system16a) MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, segas16a_state, n7751_p2_w)) MCFG_MCS48_PORT_PROG_OUT_CB(WRITELINE("n7751_8243", i8243_device, prog_w)) - MCFG_I8243_ADD("n7751_8243", NOOP, WRITE8(*this, segas16a_state,n7751_rom_offset_w)) + MCFG_I8243_ADD("n7751_8243", CONSTANT(0), WRITE8(*this, segas16a_state,n7751_rom_offset_w)) MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mame/drivers/sitcom.cpp b/src/mame/drivers/sitcom.cpp index 4d0b44bc91f..e44564e6e4d 100644 --- a/src/mame/drivers/sitcom.cpp +++ b/src/mame/drivers/sitcom.cpp @@ -261,7 +261,7 @@ WRITE8_MEMBER( sitcom_timer_state::update_pia_pa ) WRITE8_MEMBER( sitcom_timer_state::update_pia_pb ) { if (!m_dac_cs && !BIT(data, 0)) - update_dac(m_pia->pa_r()); + update_dac(m_pia->read_pa()); m_dac_wr = BIT(data, 0); m_dac_cs = BIT(data, 1); diff --git a/src/mame/includes/dynduke.h b/src/mame/includes/dynduke.h index 0f8fac0b5de..ac93799df10 100644 --- a/src/mame/includes/dynduke.h +++ b/src/mame/includes/dynduke.h @@ -1,5 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Bryan McPhail, David Haywood +#ifndef MAME_INCLUDES_DYNDUKE_H +#define MAME_INCLUDES_DYNDUKE_H + +#pragma once + #include "audio/seibu.h" #include "video/bufsprite.h" #include "emupal.h" @@ -7,8 +12,8 @@ class dynduke_state : public driver_device { public: - dynduke_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + dynduke_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_seibu_sound(*this, "seibu_sound"), @@ -18,7 +23,8 @@ public: m_scroll_ram(*this, "scroll_ram"), m_videoram(*this, "videoram"), m_back_data(*this, "back_data"), - m_fore_data(*this, "fore_data") { } + m_fore_data(*this, "fore_data") + { } void dynduke(machine_config &config); void dbldyn(machine_config &config); @@ -72,3 +78,5 @@ private: void sound_decrypted_opcodes_map(address_map &map); void sound_map(address_map &map); }; + +#endif // MAME_INCLUDES_DYNDUKE_H diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h index fa376ef25af..4fed6b0a84c 100644 --- a/src/mame/includes/model2.h +++ b/src/mame/includes/model2.h @@ -1,5 +1,10 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont, Olivier Galibert, ElSemi, Angelo Salese +#ifndef MAME_INCLUDES_MODEL2_H +#define MAME_INCLUDES_MODEL2_H + +#pragma once + #include "audio/dsbz80.h" #include "audio/segam1audio.h" #include "cpu/i960/i960.h" @@ -28,8 +33,8 @@ struct triangle; class model2_state : public driver_device { public: - model2_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + model2_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_textureram0(*this, "textureram0"), m_textureram1(*this, "textureram1"), m_workram(*this, "workram"), @@ -736,3 +741,5 @@ struct quad_m2 uint16_t texheader[4]; uint8_t luma; }; + +#endif // MAME_INCLUDES_MODEL2_H diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h index 856d6b0540a..711dcfb6c24 100644 --- a/src/mame/includes/model3.h +++ b/src/mame/includes/model3.h @@ -1,5 +1,10 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont, Ville Linde +#ifndef MAME_INCLUDES_MODEL3_H +#define MAME_INCLUDES_MODEL3_H + +#pragma once + #include "cpu/powerpc/ppc.h" #include "video/poly.h" #include "bus/scsi/scsi.h" @@ -57,8 +62,8 @@ class model3_renderer; class model3_state : public driver_device { public: - model3_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + model3_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this,"maincpu"), m_lsi53c810(*this, "lsi53c810"), m_audiocpu(*this, "audiocpu"), @@ -66,7 +71,7 @@ public: m_eeprom(*this, "eeprom"), m_screen(*this, "screen"), m_rtc(*this, "rtc"), - m_adc_ports(*this, {"AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7"}), + m_adc_ports(*this, "AN%u", 0U), m_work_ram(*this, "work_ram"), m_paletteram64(*this, "paletteram64"), m_dsbz80(*this, DSBZ80_TAG), @@ -353,3 +358,5 @@ private: void model3_mem(address_map &map); void model3_snd(address_map &map); }; + +#endif // MAME_INCLUDES_MODEL3_H diff --git a/src/mame/includes/mrflea.h b/src/mame/includes/mrflea.h index 734277c29b4..36bc915f5ae 100644 --- a/src/mame/includes/mrflea.h +++ b/src/mame/includes/mrflea.h @@ -5,6 +5,10 @@ Mr. Flea *************************************************************************/ +#ifndef MAME_INCLUDES_MRFLEA_H +#define MAME_INCLUDES_MRFLEA_H + +#pragma once #include "machine/pic8259.h" #include "machine/timer.h" @@ -14,8 +18,8 @@ class mrflea_state : public driver_device { public: - mrflea_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + mrflea_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), @@ -23,7 +27,8 @@ public: m_pic(*this, "pic"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } void mrflea(machine_config &config); @@ -58,3 +63,5 @@ private: void mrflea_slave_io_map(address_map &map); void mrflea_slave_map(address_map &map); }; + +#endif // MAME_INCLUDES_MRFLEA_H diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h index 33ef50c2168..076c10e2f69 100644 --- a/src/mame/includes/pacman.h +++ b/src/mame/includes/pacman.h @@ -1,5 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Nicola Salmoria +#ifndef MAME_INCLUDES_PACMAN_H +#define MAME_INCLUDES_PACMAN_H + +#pragma once + #include "machine/watchdog.h" #include "sound/namco.h" #include "emupal.h" @@ -240,3 +245,5 @@ private: uint8_t jumpshot_decrypt(int addr, uint8_t e); void jumpshot_decode(); }; + +#endif // MAME_INCLUDES_PACMAN_H diff --git a/src/mame/includes/segas16b.h b/src/mame/includes/segas16b.h index f7fca6b1564..3cf888ed1ba 100644 --- a/src/mame/includes/segas16b.h +++ b/src/mame/includes/segas16b.h @@ -5,6 +5,10 @@ Sega System 16B hardware ***************************************************************************/ +#ifndef MAME_INCLUDES_SEGAS16B_H +#define MAME_INCLUDES_SEGAS16B_H + +#pragma once #include "cpu/m68000/m68000.h" #include "cpu/mcs51/mcs51.h" @@ -369,3 +373,5 @@ private: uint8_t m_rle_byte; void isgsm_map(address_map &map); }; + +#endif // MAME_INCLUDES_SEGAS16B_H diff --git a/src/mame/includes/segas18.h b/src/mame/includes/segas18.h index d983d93ee2d..dd9de1ee1a0 100644 --- a/src/mame/includes/segas18.h +++ b/src/mame/includes/segas18.h @@ -5,6 +5,10 @@ Sega System 16A/16B/18/Outrun/Hang On/X-Board/Y-Board hardware ***************************************************************************/ +#ifndef MAME_INCLUDES_SEGAS18_H +#define MAME_INCLUDES_SEGAS18_H + +#pragma once #include "cpu/m68000/m68000.h" #include "cpu/mcs51/mcs51.h" @@ -176,3 +180,5 @@ private: uint8_t m_lghost_value; uint8_t m_lghost_select; }; + +#endif // MAME_INCLUDES_SEGAS18_H diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h index c053f243147..071a08b1aa4 100644 --- a/src/mame/includes/segas24.h +++ b/src/mame/includes/segas24.h @@ -4,6 +4,10 @@ * Sega System 24 * */ +#ifndef MAME_INCLUDES_SEGAS24_H +#define MAME_INCLUDES_SEGAS24_H + +#pragma once #include "machine/timer.h" #include "video/segaic24.h" @@ -176,3 +180,5 @@ private: void system24_cpu1_map(address_map &map); void system24_cpu2_map(address_map &map); }; + +#endif // MAME_INCLUDES_SEGAS24_H diff --git a/src/mame/includes/segaybd.h b/src/mame/includes/segaybd.h index e96b7d3f3fb..6e08a4f6561 100644 --- a/src/mame/includes/segaybd.h +++ b/src/mame/includes/segaybd.h @@ -5,6 +5,10 @@ Sega Y-Board hardware ***************************************************************************/ +#ifndef MAME_INCLUDES_SEGAYBD_H +#define MAME_INCLUDES_SEGAYBD_H + +#pragma once #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" @@ -138,3 +142,5 @@ private: uint8_t m_misc_io_data; bitmap_ind16 m_tmp_bitmap; }; + +#endif // MAME_INCLUDES_SEGAYBD_H diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 54829179bd0..23d86b54401 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Luca Elia +#ifndef MAME_INCLUDES_SETA_H +#define MAME_INCLUDES_SETA_H + +#pragma once /*************************************************************************** @@ -68,7 +72,8 @@ public: m_gun_recoil(*this,"Player%u_Gun_Recoil", 1U), m_leds(*this, "led%u", 0U), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } void keroppij(machine_config &config); void madshark(machine_config &config); @@ -487,3 +492,5 @@ private: void update_hoppers(); void show_outputs(); }; + +#endif // MAME_INCLUDES_SETA_H diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h index a2b53d6d748..e62d46ce2c7 100644 --- a/src/mame/includes/suprloco.h +++ b/src/mame/includes/suprloco.h @@ -1,5 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Zsolt Vasvari +#ifndef MAME_INCLUDES_SUPRLOCO_H +#define MAME_INCLUDES_SUPRLOCO_H + +#pragma once #include "machine/i8255.h" #include "emupal.h" @@ -7,8 +11,8 @@ class suprloco_state : public driver_device { public: - suprloco_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + suprloco_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_gfxdecode(*this, "gfxdecode"), @@ -16,7 +20,8 @@ public: m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_scrollram(*this, "scrollram"), - m_decrypted_opcodes(*this, "decrypted_opcodes") { } + m_decrypted_opcodes(*this, "decrypted_opcodes") + { } void suprloco(machine_config &config); @@ -54,3 +59,5 @@ private: void main_map(address_map &map); void sound_map(address_map &map); }; + +#endif // MAME_INCLUDES_SUPRLOCO_H -- cgit v1.2.3