diff options
97 files changed, 593 insertions, 511 deletions
diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index 0b6a770bdfc..5718b938030 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -38,6 +38,7 @@ includedirs { files { MAME_DIR .. "src/emu/emu.h", + MAME_DIR .. "src/emu/emufwd.h", MAME_DIR .. "src/emu/main.h", MAME_DIR .. "src/emu/main.cpp", MAME_DIR .. "src/emu/gamedrv.h", diff --git a/src/devices/bus/megadrive/md_slot.cpp b/src/devices/bus/megadrive/md_slot.cpp index 8c62da3861c..26afaf888cc 100644 --- a/src/devices/bus/megadrive/md_slot.cpp +++ b/src/devices/bus/megadrive/md_slot.cpp @@ -402,7 +402,7 @@ static int genesis_is_SMD(unsigned char *buf, unsigned int len) if (len > 0x2081 && buf[0x2080] == ' ' && buf[0x0080] == 'S' && buf[0x2081] == 'E' && buf[0x0081] == 'G') return 1; - /* jap baseball 94 */ + /* jpn baseball 94 */ if (len > (0xf0 + 9) && !strncmp("OL R-AEAL", (const char *) &buf[0xf0], 9)) return 1; diff --git a/src/devices/bus/rs232/pty.h b/src/devices/bus/rs232/pty.h index 8c4c9c69a91..f5ed25d7167 100644 --- a/src/devices/bus/rs232/pty.h +++ b/src/devices/bus/rs232/pty.h @@ -6,6 +6,7 @@ #pragma once #include "rs232.h" +#include "dipty.h" class pseudo_terminal_device : public device_t, public device_serial_interface, diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp index 2a9ca96d543..c53c1d29b56 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.cpp +++ b/src/devices/cpu/e0c6200/e0c6s46.cpp @@ -889,7 +889,7 @@ WRITE8_MEMBER(e0c6s46_device::io_w) break; default: - if (machine().phase() > MACHINE_PHASE_RESET) + if (machine().phase() > machine_phase::RESET) logerror("%s unknown io_w $%X to $0F%02X at $%04X\n", tag(), data, offset, m_prev_pc); break; } diff --git a/src/devices/video/dm9368.h b/src/devices/video/dm9368.h index 59eff4d05a1..ba628da64fc 100644 --- a/src/devices/video/dm9368.h +++ b/src/devices/video/dm9368.h @@ -22,6 +22,7 @@ #pragma once +#include "dioutput.h" diff --git a/src/emu/addrmap.h b/src/emu/addrmap.h index d7a2144bd25..675b90ff2ff 100644 --- a/src/emu/addrmap.h +++ b/src/emu/addrmap.h @@ -43,10 +43,6 @@ enum map_handler_type // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class validity_checker; - - // address map handler data class map_handler_data { diff --git a/src/emu/bookkeeping.h b/src/emu/bookkeeping.h index e66fdf042a4..760789fd536 100644 --- a/src/emu/bookkeeping.h +++ b/src/emu/bookkeeping.h @@ -22,8 +22,6 @@ // ======================> bookkeeping_manager -enum class config_type; - class bookkeeping_manager { public: diff --git a/src/emu/crsshair.h b/src/emu/crsshair.h index bd938dada8a..c733f0afccf 100644 --- a/src/emu/crsshair.h +++ b/src/emu/crsshair.h @@ -12,9 +12,6 @@ #pragma once -class render_container; -class render_texture; - /*************************************************************************** CONSTANTS diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h index dd6dda0902d..7eca669908e 100644 --- a/src/emu/debug/debugcmd.h +++ b/src/emu/debug/debugcmd.h @@ -16,8 +16,6 @@ #include "debugcpu.h" #include "debugcon.h" -class parsed_expression; -class symbol_table; class debugger_commands { diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp index f8f0832d102..fa4ac6a7a5e 100644 --- a/src/emu/debug/debugcon.cpp +++ b/src/emu/debug/debugcon.cpp @@ -373,7 +373,7 @@ CMDERR debugger_console::validate_command(const char *command) void debugger_console::register_command(const char *command, u32 flags, int ref, int minparams, int maxparams, std::function<void(int, const std::vector<std::string> &)> handler) { - assert_always(m_machine.phase() == MACHINE_PHASE_INIT, "Can only call register_command() at init time!"); + assert_always(m_machine.phase() == machine_phase::INIT, "Can only call register_command() at init time!"); assert_always((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call register_command() when debugger is not running"); debug_command *cmd = auto_alloc_clear(m_machine, <debug_command>()); diff --git a/src/emu/debug/debugcon.h b/src/emu/debug/debugcon.h index c614859f976..31de5bb5b51 100644 --- a/src/emu/debug/debugcon.h +++ b/src/emu/debug/debugcon.h @@ -8,13 +8,16 @@ *********************************************************************/ -#ifndef __DEBUGCON_H__ -#define __DEBUGCON_H__ +#ifndef MAME_EMU_DEBUG_DEBUGCON_H +#define MAME_EMU_DEBUG_DEBUGCON_H -#include <functional> +#pragma once #include "textbuf.h" +#include <functional> + + /*************************************************************************** CONSTANTS ***************************************************************************/ @@ -131,4 +134,4 @@ private: debug_command *m_commandlist; }; -#endif +#endif // MAME_EMU_DEBUG_DEBUGCON_H diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 3fb5c2421ae..143159936bf 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -202,7 +202,7 @@ void debugger_cpu::source_script(const char *file) m_source_file = fopen(file, "r"); if (!m_source_file) { - if (m_machine.phase() == MACHINE_PHASE_RUNNING) + if (m_machine.phase() == machine_phase::RUNNING) m_machine.debugger().console().printf("Cannot open command file '%s'\n", file); else fatalerror("Cannot open command file '%s'\n", file); diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 9cd130db122..ff5a4f186b0 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -8,19 +8,16 @@ ***************************************************************************/ -#pragma once - #ifndef MAME_EMU_DEBUG_DEBUGCPU_H #define MAME_EMU_DEBUG_DEBUGCPU_H +#pragma once + #include "express.h" #include <set> -namespace util { namespace xml { class data_node; } } - - //************************************************************************** // CONSTANTS //************************************************************************** diff --git a/src/emu/debug/debughlp.h b/src/emu/debug/debughlp.h index 87881f6967f..30cf6d5820f 100644 --- a/src/emu/debug/debughlp.h +++ b/src/emu/debug/debughlp.h @@ -11,6 +11,8 @@ #ifndef MAME_EMU_DEBUG_DEBUGHLP_H #define MAME_EMU_DEBUG_DEBUGHLP_H +#pragma once + /*************************************************************************** FUNCTION PROTOTYPES diff --git a/src/emu/debug/debugvw.h b/src/emu/debug/debugvw.h index 382f45e5e20..142f5d3170d 100644 --- a/src/emu/debug/debugvw.h +++ b/src/emu/debug/debugvw.h @@ -79,10 +79,6 @@ constexpr int DCK_MIDDLE_CLICK = 3; // middle instantaneous click // TYPE DEFINITIONS //************************************************************************** -// forward references -class debug_view; - - // OSD callback function for a view typedef void (*debug_view_osd_update_func)(debug_view &view, void *osdprivate); diff --git a/src/emu/debug/dvbpoints.h b/src/emu/debug/dvbpoints.h index 0c954fefa22..5d74549fd66 100644 --- a/src/emu/debug/dvbpoints.h +++ b/src/emu/debug/dvbpoints.h @@ -11,6 +11,8 @@ #ifndef MAME_EMU_DEBUG_DVBPOINTS_H #define MAME_EMU_DEBUG_DVBPOINTS_H +#pragma once + #include "debugvw.h" #include "debugcpu.h" @@ -50,5 +52,4 @@ private: std::vector<device_debug::breakpoint *> m_buffer; }; - #endif // MAME_EMU_DEBUG_DVBPOINTS_H diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h index efb3120f5ec..295e23ffa0a 100644 --- a/src/emu/debug/dvdisasm.h +++ b/src/emu/debug/dvdisasm.h @@ -11,6 +11,8 @@ #ifndef MAME_EMU_DEBUG_DVDISASM_H #define MAME_EMU_DEBUG_DVDISASM_H +#pragma once + #include "debugvw.h" #include "vecstream.h" @@ -113,5 +115,4 @@ private: static constexpr int DASM_MAX_BYTES = 16; }; - #endif // MAME_EMU_DEBUG_DVDISASM_H diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index 710eca244e4..e81b33019a1 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -9,12 +9,12 @@ ***************************************************************************/ #include "emu.h" -#include "debugvw.h" #include "dvmemory.h" + #include "debugcpu.h" #include "debugger.h" -#include <ctype.h> +#include <ctype.h> //************************************************************************** diff --git a/src/emu/debug/dvmemory.h b/src/emu/debug/dvmemory.h index 0ab5be93bb1..3f00fc83d29 100644 --- a/src/emu/debug/dvmemory.h +++ b/src/emu/debug/dvmemory.h @@ -11,9 +11,14 @@ #ifndef MAME_EMU_DEBUG_DVMEMORY_H #define MAME_EMU_DEBUG_DVMEMORY_H +#pragma once + +#include "debugvw.h" + #include "softfloat/mamesf.h" #include "softfloat/softfloat.h" + //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -128,8 +133,7 @@ private: static const memory_view_pos s_memory_pos_table[12]; // table for rendering at different data formats // constants - static const int MEM_MAX_LINE_WIDTH = 1024; + static constexpr int MEM_MAX_LINE_WIDTH = 1024; }; - #endif // MAME_EMU_DEBUG_DVMEMORY_H diff --git a/src/emu/debug/dvtext.h b/src/emu/debug/dvtext.h index 01bd4ee5706..d9f28e80298 100644 --- a/src/emu/debug/dvtext.h +++ b/src/emu/debug/dvtext.h @@ -11,6 +11,8 @@ #ifndef MAME_EMU_DEBUG_DVTEXT_H #define MAME_EMU_DEBUG_DVTEXT_H +#pragma once + #include "debugvw.h" #include "textbuf.h" @@ -57,5 +59,4 @@ class debug_view_log : public debug_view_textbuf debug_view_log(running_machine &machine, debug_view_osd_update_func osdupdate, void *osdprivate); }; - #endif // MAME_EMU_DEBUG_DVTEXT_H diff --git a/src/emu/debug/dvwpoints.h b/src/emu/debug/dvwpoints.h index dd884e32cc6..b1707b7d5b2 100644 --- a/src/emu/debug/dvwpoints.h +++ b/src/emu/debug/dvwpoints.h @@ -8,19 +8,16 @@ ***************************************************************************/ -#ifndef __DVWPOINTS_H__ -#define __DVWPOINTS_H__ +#ifndef MAME_EMU_DEBUG_DVWPOINTS_H +#define MAME_EMU_DEBUG_DVWPOINTS_H + +#pragma once #include "debugvw.h" #include "debugcpu.h" //************************************************************************** -// CONSTANTS -//************************************************************************** - - -//************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -50,5 +47,4 @@ private: std::vector<device_debug::watchpoint *> m_buffer; }; - -#endif +#endif // MAME_EMU_DEBUG_DVWPOINTS_H diff --git a/src/emu/debug/express.h b/src/emu/debug/express.h index 602670cbe07..19381786d1b 100644 --- a/src/emu/debug/express.h +++ b/src/emu/debug/express.h @@ -8,12 +8,13 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_EMU_DEBUG_EXPRESS_H +#define MAME_EMU_DEBUG_EXPRESS_H -#ifndef __EXPRESS_H__ -#define __EXPRESS_H__ +#pragma once #include "emucore.h" + #include <functional> #include <unordered_map> @@ -46,10 +47,6 @@ enum expression_space // TYPE DEFINITIONS //************************************************************************** -// forward references -class symbol_table; - - // ======================> expression_error // an expression_error holds an error code and a string offset @@ -389,5 +386,4 @@ private: parse_token m_token_stack[MAX_STACK_DEPTH]; // token stack (used during execution) }; - -#endif +#endif // MAME_EMU_DEBUG_EXPRESS_H diff --git a/src/emu/debugger.cpp b/src/emu/debugger.cpp index 188b74cb3b7..de73c976dc4 100644 --- a/src/emu/debugger.cpp +++ b/src/emu/debugger.cpp @@ -164,7 +164,7 @@ void debugger_manager::refresh_display() execution -------------------------------------------------*/ -void debugger_flush_all_traces_on_abnormal_exit(void) +void debugger_flush_all_traces_on_abnormal_exit() { if(g_machine != nullptr) { diff --git a/src/emu/debugger.h b/src/emu/debugger.h index 7760d9193bd..91431d31631 100644 --- a/src/emu/debugger.h +++ b/src/emu/debugger.h @@ -7,14 +7,10 @@ General debugging interfaces ****************************************************************************/ -#pragma once - -#ifndef __DEBUGGER_H__ -#define __DEBUGGER_H__ +#ifndef MAME_EMU_DEBUGGER_H +#define MAME_EMU_DEBUGGER_H -class debugger_commands; -class debugger_cpu; -class debugger_console; +#pragma once // ======================> debugger_manager @@ -54,7 +50,7 @@ private: ***************************************************************************/ /* OSD can call this to safely flush all traces in the event of a crash */ -void debugger_flush_all_traces_on_abnormal_exit(void); +void debugger_flush_all_traces_on_abnormal_exit(); @@ -76,4 +72,4 @@ void debugger_stop_cpu_hook(device_t *device); void debugger_interrupt_hook(device_t *device, int irqline); -#endif /* __DEBUGGER_H__ */ +#endif // MAME_EMU_DEBUGGER_H diff --git a/src/emu/device.h b/src/emu/device.h index 43bb7d73ee0..3fdcff23464 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -68,22 +68,6 @@ static const char DEVICE_SELF_OWNER[] = "^"; // TYPE DEFINITIONS //************************************************************************** -// forward references -class memory_region; -class device_debug; -class device_t; -class device_interface; -class device_execute_interface; -class device_memory_interface; -class device_state_interface; -class validity_checker; -class rom_entry; -class machine_config; -class emu_timer; -struct input_device_default; -class finder_base; - - namespace emu { namespace detail { class device_type_impl; diff --git a/src/emu/didisasm.h b/src/emu/didisasm.h index c96fe3b9159..edd56b3352f 100644 --- a/src/emu/didisasm.h +++ b/src/emu/didisasm.h @@ -23,12 +23,12 @@ //************************************************************************** // Disassembler constants -const u32 DASMFLAG_SUPPORTED = 0x80000000; // are disassembly flags supported? -const u32 DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence -const u32 DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards -const u32 DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over -const u32 DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value -const u32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length +constexpr u32 DASMFLAG_SUPPORTED = 0x80000000; // are disassembly flags supported? +constexpr u32 DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence +constexpr u32 DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards +constexpr u32 DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over +constexpr u32 DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value +constexpr u32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length diff --git a/src/emu/diexec.h b/src/emu/diexec.h index daec1a98a0c..8e4c4ce9cc5 100644 --- a/src/emu/diexec.h +++ b/src/emu/diexec.h @@ -111,10 +111,6 @@ enum // TYPE DEFINITIONS //************************************************************************** -class emu_timer; -class screen_device; -class device_scheduler; - // interrupt callback for VBLANK and timed interrupts typedef device_delegate<void (device_t &)> device_interrupt_delegate; diff --git a/src/emu/digfx.h b/src/emu/digfx.h index 539266190d6..5b5749a1d3c 100644 --- a/src/emu/digfx.h +++ b/src/emu/digfx.h @@ -154,10 +154,6 @@ const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW }, { 0 }, { // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class gfx_element; -class device_palette_interface; - struct gfx_layout { u32 xoffs(int x) const { return (extxoffs != nullptr) ? extxoffs[x] : xoffset[x]; } diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index 372f2005458..28dad1f82ee 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -1048,7 +1048,7 @@ done: if (m_err!=0) { if (!init_phase()) { - if (device().machine().phase() == MACHINE_PHASE_RUNNING) + if (device().machine().phase() == machine_phase::RUNNING) device().popmessage("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, error()); else osd_printf_error("Error: Unable to %s image '%s': %s\n", is_create ? "create" : "load", path.c_str(), error()); @@ -1484,7 +1484,7 @@ bool device_image_interface::init_phase() const // differently at startup; this is an enc[r]apsulation of the "logic" // that switches these behaviors return !device().has_running_machine() - || device().machine().phase() == MACHINE_PHASE_INIT; + || device().machine().phase() == machine_phase::INIT; } diff --git a/src/emu/diimage.h b/src/emu/diimage.h index bf656b6a040..1f716075451 100644 --- a/src/emu/diimage.h +++ b/src/emu/diimage.h @@ -28,9 +28,6 @@ extern struct io_procs image_ioprocs; -class software_list; -class software_list_loader; - enum iodevice_t { /* List of all supported devices. Refer to the device by these names only */ @@ -94,11 +91,6 @@ private: }; -class device_image_interface; -struct feature_list; -class software_part; -class software_info; - enum class image_init_result { PASS, FAIL }; enum class image_verify_result { PASS, FAIL }; diff --git a/src/emu/dioutput.cpp b/src/emu/dioutput.cpp index 176b5c8efc5..bde41b2a7e1 100644 --- a/src/emu/dioutput.cpp +++ b/src/emu/dioutput.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "emu.h" - +#include "dioutput.h" //************************************************************************** diff --git a/src/emu/dioutput.h b/src/emu/dioutput.h index 70426a88509..8e952a7dcd9 100644 --- a/src/emu/dioutput.h +++ b/src/emu/dioutput.h @@ -8,15 +8,10 @@ ***************************************************************************/ -#pragma once - -#ifndef __EMU_H__ -#error Dont include this file directly; include emu.h instead. -#endif - #ifndef MAME_EMU_DIOUTPUT_H #define MAME_EMU_DIOUTPUT_H +#pragma once //************************************************************************** @@ -58,5 +53,4 @@ protected: }; - -#endif /* MAME_EMU_DIOUTPUT_H */ +#endif // MAME_EMU_DIOUTPUT_H diff --git a/src/emu/dipalette.h b/src/emu/dipalette.h index fc1f767300d..eb2979f6118 100644 --- a/src/emu/dipalette.h +++ b/src/emu/dipalette.h @@ -30,8 +30,6 @@ constexpr float PALETTE_DEFAULT_HIGHLIGHT_FACTOR = 1.0f/PALETTE_DEFAULT_SHADOW_F // TYPE DEFINITIONS //************************************************************************** -class gfx_element; - typedef u16 indirect_pen_t; diff --git a/src/emu/dipty.cpp b/src/emu/dipty.cpp index 2759b27078a..0a894cfbfec 100644 --- a/src/emu/dipty.cpp +++ b/src/emu/dipty.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "emu.h" -#include "osdcore.h" +#include "dipty.h" device_pty_interface::device_pty_interface(const machine_config &mconfig, device_t &device) : device_interface(device, "pty") diff --git a/src/emu/dipty.h b/src/emu/dipty.h index 4d13f9f8470..e3297da9967 100644 --- a/src/emu/dipty.h +++ b/src/emu/dipty.h @@ -8,12 +8,6 @@ ***************************************************************************/ -#pragma once - -#ifndef __EMU_H__ -#error Dont include this file directly; include emu.h instead. -#endif - #ifndef MAME_EMU_DIPTY_H #define MAME_EMU_DIPTY_H @@ -45,4 +39,4 @@ protected: // iterator typedef device_interface_iterator<device_pty_interface> pty_interface_iterator; -#endif /* MAME_EMU_DIPTY_H */ +#endif // MAME_EMU_DIPTY_H diff --git a/src/emu/dirtc.h b/src/emu/dirtc.h index acc4cfe4487..64069f58923 100644 --- a/src/emu/dirtc.h +++ b/src/emu/dirtc.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_EMU_DIRTC_H +#define MAME_EMU_DIRTC_H -#ifndef __DIRTC_H__ -#define __DIRTC_H__ +#pragma once @@ -78,4 +78,4 @@ protected: typedef device_interface_iterator<device_rtc_interface> rtc_interface_iterator; -#endif /* __DIRTC_H__ */ +#endif // MAME_EMU_DIRTC_H diff --git a/src/emu/disound.h b/src/emu/disound.h index d5684fed1c5..e9207bbcf91 100644 --- a/src/emu/disound.h +++ b/src/emu/disound.h @@ -57,8 +57,6 @@ constexpr int AUTO_ALLOC_INPUT = 65535; // TYPE DEFINITIONS //************************************************************************** -class sound_stream; - // ======================> device_sound_interface diff --git a/src/emu/divtlb.h b/src/emu/divtlb.h index d8614e593db..56b874e3915 100644 --- a/src/emu/divtlb.h +++ b/src/emu/divtlb.h @@ -8,11 +8,11 @@ ***************************************************************************/ -#pragma once - #ifndef MAME_EMU_DIVTLB_H #define MAME_EMU_DIVTLB_H +#pragma once + /*************************************************************************** diff --git a/src/emu/emu.h b/src/emu/emu.h index 2e15d825f56..90457e2a5ab 100644 --- a/src/emu/emu.h +++ b/src/emu/emu.h @@ -57,7 +57,6 @@ // define machine_config_constructor here due to circular dependency // between devices and the machine config -class machine_config; typedef void (*machine_config_constructor)(machine_config &config, device_t *owner, device_t *device); // I/O @@ -76,7 +75,6 @@ typedef void (*machine_config_constructor)(machine_config &config, device_t *own #include "dipalette.h" #include "digfx.h" #include "diimage.h" -#include "dioutput.h" #include "diserial.h" #include "dislot.h" #include "disound.h" @@ -86,7 +84,6 @@ typedef void (*machine_config_constructor)(machine_config &config, device_t *own #include "schedule.h" #include "timer.h" #include "dinetwork.h" -#include "dipty.h" // machine and driver configuration #include "mconfig.h" diff --git a/src/emu/emualloc.h b/src/emu/emualloc.h index 77fcd92c1b1..0ed7cc7ea75 100644 --- a/src/emu/emualloc.h +++ b/src/emu/emualloc.h @@ -8,16 +8,19 @@ ***************************************************************************/ -#pragma once - #ifndef MAME_EMU_EMUALLOC_H #define MAME_EMU_EMUALLOC_H -#include <new> -#include <mutex> +#pragma once + #include "osdcore.h" #include "coretmpl.h" +#include <memory> +#include <mutex> +#include <new> + + //************************************************************************** // MACROS //************************************************************************** @@ -39,17 +42,18 @@ class resource_pool_item { private: - resource_pool_item(const resource_pool_item &); - resource_pool_item &operator=(const resource_pool_item &); + resource_pool_item(const resource_pool_item &) = delete; + resource_pool_item &operator=(const resource_pool_item &) = delete; public: resource_pool_item(void *ptr, size_t size) - : m_next(nullptr), - m_ordered_next(nullptr), - m_ordered_prev(nullptr), - m_ptr(ptr), - m_size(size), - m_id(~osd::u64(0)) { } + : m_next(nullptr) + , m_ordered_next(nullptr) + , m_ordered_prev(nullptr) + , m_ptr(ptr) + , m_size(size) + , m_id(~osd::u64(0)) + { } virtual ~resource_pool_item() { } resource_pool_item * m_next; @@ -62,42 +66,47 @@ public: // a resource_pool_object is a simple object wrapper for the templatized type -template<class _ObjectClass> +template <class ObjectClass> class resource_pool_object : public resource_pool_item { private: - resource_pool_object<_ObjectClass>(const resource_pool_object<_ObjectClass> &); - resource_pool_object<_ObjectClass> &operator=(const resource_pool_object<_ObjectClass> &); + resource_pool_object(const resource_pool_object<ObjectClass> &) = delete; + resource_pool_object &operator=(const resource_pool_object<ObjectClass> &) = delete; public: - resource_pool_object(_ObjectClass *object) - : resource_pool_item(reinterpret_cast<void *>(object), sizeof(_ObjectClass)), - m_object(object) { } + resource_pool_object(ObjectClass *object) + : resource_pool_item(reinterpret_cast<void *>(object), sizeof(ObjectClass)) + , m_object(object) + { } + resource_pool_object(std::unique_ptr<ObjectClass> &&object) + : resource_pool_object(object.release()) + { } virtual ~resource_pool_object() { delete m_object; } private: - _ObjectClass * m_object; + ObjectClass *const m_object; }; // a resource_pool_array is a simple object wrapper for an allocated array of // the templatized type -template<class _ObjectClass> class resource_pool_array : public resource_pool_item +template <class ObjectClass> class resource_pool_array : public resource_pool_item { private: - resource_pool_array<_ObjectClass>(const resource_pool_array<_ObjectClass> &); - resource_pool_array<_ObjectClass> &operator=(const resource_pool_array<_ObjectClass> &); + resource_pool_array(const resource_pool_array<ObjectClass> &) = delete; + resource_pool_array &operator=(const resource_pool_array<ObjectClass> &) = delete; public: - resource_pool_array(_ObjectClass *array, int count) - : resource_pool_item(reinterpret_cast<void *>(array), sizeof(_ObjectClass) * count), - m_array(array), - m_count(count) { } + resource_pool_array(ObjectClass *array, int count) + : resource_pool_item(reinterpret_cast<void *>(array), sizeof(ObjectClass) * count) + , m_array(array) + , m_count(count) + { } virtual ~resource_pool_array() { delete[] m_array; } private: - _ObjectClass * m_array; - int m_count; + ObjectClass *const m_array; + int const m_count; }; @@ -105,8 +114,8 @@ private: class resource_pool { private: - resource_pool(const resource_pool &); - resource_pool &operator=(const resource_pool &); + resource_pool(const resource_pool &) = delete; + resource_pool &operator=(const resource_pool &) = delete; public: resource_pool(int hash_size = 193); @@ -120,8 +129,9 @@ public: bool contains(void *ptrstart, void *ptrend); void clear(); - template<class _ObjectClass> _ObjectClass *add_object(_ObjectClass* object) { add(*new resource_pool_object<_ObjectClass>(object), sizeof(_ObjectClass), typeid(_ObjectClass).name()); return object; } - template<class _ObjectClass> _ObjectClass *add_array(_ObjectClass* array, int count) { add(*new resource_pool_array<_ObjectClass>(array, count), sizeof(_ObjectClass), typeid(_ObjectClass).name()); return array; } + template <class ObjectClass> ObjectClass *add_object(ObjectClass *object) { add(*new resource_pool_object<ObjectClass>(object), sizeof(ObjectClass), typeid(ObjectClass).name()); return object; } + template <class ObjectClass> ObjectClass *add_object(std::unique_ptr<ObjectClass> &&object) { return add_object(object.release()); } + template <class ObjectClass> ObjectClass *add_array(ObjectClass *array, int count) { add(*new resource_pool_array<ObjectClass>(array, count), sizeof(ObjectClass), typeid(ObjectClass).name()); return array; } private: int m_hash_size; @@ -133,4 +143,4 @@ private: }; -#endif /* MAME_EMU_EMUALLOC_H */ +#endif // MAME_EMU_EMUALLOC_H diff --git a/src/emu/emucore.h b/src/emu/emucore.h index a3e3abbd0ac..4f1bc149275 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -38,6 +38,8 @@ #include "corestr.h" #include "bitmap.h" +#include "emufwd.h" + //************************************************************************** // COMPILER-SPECIFIC NASTINESS @@ -74,9 +76,6 @@ typedef u32 pen_t; // stream_sample_t is used to represent a single sample in a sound stream typedef s32 stream_sample_t; -// running_machine is core to pretty much everything -class running_machine; - //************************************************************************** @@ -305,8 +304,6 @@ private: // CASTING TEMPLATES //************************************************************************** -class device_t; - void report_bad_cast(const std::type_info &src_type, const std::type_info &dst_type); void report_bad_device_cast(const device_t *dev, const std::type_info &src_type, const std::type_info &dst_type); diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h new file mode 100644 index 00000000000..cd7de9fecb9 --- /dev/null +++ b/src/emu/emufwd.h @@ -0,0 +1,238 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb +/********************************************************************** + * emufwd.h + * + * Forward declarations for MAME famework. + * + * Please place forward declarations here rather than littering them + * throughout headers in src/emu. It makes it much easier to update + * them and remove obsolete ones. + **********************************************************************/ +#ifndef MAME_EMU_EMUFWD_H +#define MAME_EMU_EMUFWD_H + +#pragma once + + +//---------------------------------- +// 3rdparty +//---------------------------------- + +// declared in expat.h +struct XML_ParserStruct; + + + +//---------------------------------- +// osd +//---------------------------------- + +// declared in modules/output/output_module.h +class output_module; + +// declared in osdepend.h +class osd_font; +class osd_interface; + + + +//---------------------------------- +// lib/util +//---------------------------------- + +// declared in aviio.h +class avi_file; + +// declared in chd.h +class chd_file; + +// declared in unzip.h +namespace util { class archive_file; } + +// declared in wavwrite.h +struct wav_file; + +// declared in xmlfile.h +namespace util { namespace xml { class data_node; } } + + + +//---------------------------------- +// emu +//---------------------------------- + +// declared in addrmap.h +class address_map; +class address_map_entry; + +// declared in bookkeeping.h +class bookkeeping_manager; + +// declared in config.h +enum class config_type; +class configuration_manager; + +// declared in crsshair.h +class crosshair_manager; + +// declared in debug/debugcmd.h +class debugger_commands; + +// declared in debug/debugcmd.h +class debugger_console; + +// declared in debug/debugcpu.h +class debugger_cpu; +class device_debug; + +// declared in debug/debugvw.h +class debug_view; +class debug_view_manager; + +// declared in debug/express.h +class parsed_expression; +class symbol_table; + +// declared in debugger.h +class debugger_manager; + +// declared in devfind.h +class finder_base; + +// declared in device.h +class device_interface; +class device_t; + +// declared in diexec.h +class device_execute_interface; + +// declared in digfx.h +struct gfx_decode_entry; + +// declared in diimage.h +class device_image_interface; + +// declared in dimemory.h +class device_memory_interface; + +// declared in dipalette.h +class device_palette_interface; + +// declared in distate.h +class device_state_interface; + +// declared in drawgfx.h +class gfx_element; + +// declared in driver.h +class driver_device; + +// declared in emumem.h +class address_space; +class direct_read_data; +class memory_bank; +class memory_block; +class memory_manager; +class memory_region; +class memory_share; + +// declared in emuopts.h +class emu_options; + +// declared in emupal.h +class palette_device; + +// declared in gamedrv.h +class game_driver; + +// declared in input.h +class input_manager; + +// declared in inputdev.h +class input_class; +class input_device; +class input_device_item; + +// declared in image.h +class image_manager; + +// declared in ioport.h +class analog_field; +struct input_device_default; +class ioport_field; +struct ioport_field_live; +class ioport_list; +class ioport_manager; +class ioport_port; +struct ioport_port_live; + +// declared in machine.h +class running_machine; + +// declared in mconfig.h +class machine_config; + +// declared in natkeyboard.h +class natural_keyboard; + +// declared in network.h +class network_manager; + +// declared in output.h +class output_manager; + +// declared in render.h +class layout_element; +class layout_view; +class render_container; +class render_manager; +class render_target; +class render_texture; + +// declared in rendfont.h +class render_font; + +// declared in romentry.h +class rom_entry; + +// declared in romload.h +class rom_load_manager; + +// declared in schedule.h +class device_scheduler; +class emu_timer; + +// declared in screen.h +class screen_device; + +// declared in softlist.h +class software_info; +class software_part; + +// declared in softlist_dev.h +class software_list_device; +class software_list_loader; + +// declared in sound.h +class sound_manager; +class sound_stream; + +// declared in tilemap.h +class tilemap_device; +class tilemap_manager; +class tilemap_t; + +// declared in ui/uimain.h +class ui_manager; + +// declared in uiinput.h +class ui_input_manager; + +// declared in validity.h +class validity_checker; + +// declared in video.h +class video_manager; + +#endif // MAME_EMU_EMUFWD_H diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index debc9cbdd05..012d7901bef 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -2581,7 +2581,7 @@ void address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_t // if we still don't have a pointer, and we're past the initialization phase, allocate a new block if (bank.base() == nullptr && manager().m_initialized) { - if (machine().phase() >= MACHINE_PHASE_RESET) + if (machine().phase() >= machine_phase::RESET) fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!\n"); auto block = std::make_unique<memory_block>(*this, address_to_byte(addrstart), address_to_byte_end(addrend)); bank.set_base(block.get()->data()); @@ -2611,7 +2611,7 @@ void address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_t // if we still don't have a pointer, and we're past the initialization phase, allocate a new block if (bank.base() == nullptr && manager().m_initialized) { - if (machine().phase() >= MACHINE_PHASE_RESET) + if (machine().phase() >= machine_phase::RESET) fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!\n"); auto block = std::make_unique<memory_block>(*this, address_to_byte(addrstart), address_to_byte_end(addrend)); bank.set_base(block.get()->data()); diff --git a/src/emu/emumem.h b/src/emu/emumem.h index 138720647f8..12b72d40101 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -56,25 +56,11 @@ enum read_or_write // TYPE DEFINITIONS //************************************************************************** -// referenced types from other classes -class device_memory_interface; -class device_t; -class game_driver; - -// forward declarations of classes defined here -class address_map; -class address_map_entry; -class memory_manager; -class memory_bank; -class memory_block; -class memory_share; -class direct_read_data; -class address_space; +// private classes declared in emumem.cpp class address_table; class address_table_read; -class address_table_write; class address_table_setoffset; - +class address_table_write; // offsets and addresses are 32-bit (for now...) typedef u32 offs_t; diff --git a/src/emu/emupal.h b/src/emu/emupal.h index 2a8d8228328..546bc36c168 100644 --- a/src/emu/emupal.h +++ b/src/emu/emupal.h @@ -286,7 +286,6 @@ // TYPE DEFINITIONS //************************************************************************** -class palette_device; // forward declaration typedef device_delegate<void (palette_device &)> palette_init_delegate; @@ -355,7 +354,7 @@ private: // ======================> palette_device // device type definition -extern const device_type PALETTE; +DECLARE_DEVICE_TYPE(PALETTE, palette_device) class palette_device : public device_t, public device_palette_interface { diff --git a/src/emu/fileio.h b/src/emu/fileio.h index 900cd5c8141..26e9fb4e907 100644 --- a/src/emu/fileio.h +++ b/src/emu/fileio.h @@ -25,9 +25,6 @@ // TYPE DEFINITIONS //************************************************************************** -// forward declarations -namespace util { class archive_file; } - // ======================> path_iterator // helper class for iterating over configured paths diff --git a/src/emu/hashfile.h b/src/emu/hashfile.h index 2c12b8d867f..b11601f126e 100644 --- a/src/emu/hashfile.h +++ b/src/emu/hashfile.h @@ -8,12 +8,13 @@ *********************************************************************/ -#ifndef __HASHFILE_H__ -#define __HASHFILE_H__ +#ifndef MAME_EMU_HASHFILE_H +#define MAME_EMU_HASHFILE_H +#pragma once bool hashfile_extrainfo(device_image_interface &image, std::string &result); bool hashfile_extrainfo(const char *hash_path, const game_driver &driver, const util::hash_collection &hashes, std::string &result); -#endif /* __HASHFILE_H__ */ +#endif // MAME_EMU_HASHFILE_H diff --git a/src/emu/input.h b/src/emu/input.h index f5bdcbbae18..78bf518e917 100644 --- a/src/emu/input.h +++ b/src/emu/input.h @@ -55,7 +55,7 @@ DECLARE_ENUM_OPERATORS(input_device_class) // device index -const int DEVICE_INDEX_MAXIMUM = 0xff; +constexpr int DEVICE_INDEX_MAXIMUM = 0xff; // input item classes @@ -346,12 +346,6 @@ DECLARE_ENUM_OPERATORS(input_item_id) // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class input_device_item; -class input_device; -class input_class; - - // controller alias table typedef typedef std::map<std::string, std::string> devicemap_table_type; diff --git a/src/emu/inputdev.cpp b/src/emu/inputdev.cpp index 380b42d9c3a..62aa1428b21 100644 --- a/src/emu/inputdev.cpp +++ b/src/emu/inputdev.cpp @@ -9,9 +9,10 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "inputdev.h" +#include "emuopts.h" + //************************************************************************** // TYPE DEFINITIONS @@ -276,7 +277,7 @@ input_device::~input_device() input_item_id input_device::add_item(const char *name, input_item_id itemid, item_get_state_func getstate, void *internal) { - assert_always(machine().phase() == MACHINE_PHASE_INIT, "Can only call input_device::add_item at init time!"); + assert_always(machine().phase() == machine_phase::INIT, "Can only call input_device::add_item at init time!"); assert(name != nullptr); assert(itemid > ITEM_ID_INVALID && itemid < ITEM_ID_MAXIMUM); assert(getstate != nullptr); @@ -493,7 +494,7 @@ input_class::~input_class() input_device *input_class::add_device(const char *name, const char *id, void *internal) { - assert_always(machine().phase() == MACHINE_PHASE_INIT, "Can only call input_class::add_device at init time!"); + assert_always(machine().phase() == machine_phase::INIT, "Can only call input_class::add_device at init time!"); assert(name != nullptr); assert(id != nullptr); diff --git a/src/emu/inputdev.h b/src/emu/inputdev.h index 767e2b8978b..f6f0027b325 100644 --- a/src/emu/inputdev.h +++ b/src/emu/inputdev.h @@ -8,22 +8,16 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_EMU_INPUTDEV_H +#define MAME_EMU_INPUTDEV_H -#ifndef EMU_INPUTDEV_H -#define EMU_INPUTDEV_H +#pragma once //************************************************************************** // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class input_device; -class input_class; -class input_manager; - - // callback for getting the value of an item on a device typedef s32 (*item_get_state_func)(void *device_internal, void *item_internal); @@ -395,6 +389,4 @@ inline running_machine &input_device_item::machine() const { return m_device.mac inline input_code input_device_item::code() const { return input_code(m_device.devclass(), m_device.devindex(), m_itemclass, ITEM_MODIFIER_NONE, m_itemid); } inline s32 input_device_item::update_value() { return m_current = (*m_getstate)(m_device.internal(), m_internal); } - - -#endif // EMU_INPUTDEV_H +#endif // MAME_EMU_INPUTDEV_H diff --git a/src/emu/ioport.h b/src/emu/ioport.h index a5169e08c21..7b434c55fdd 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -653,17 +653,6 @@ enum // TYPE DEFINITIONS //************************************************************************** -// forward declarations -namespace util { namespace xml { class data_node; } } -class ioport_list; -class ioport_port; -struct ioport_port_live; -class ioport_field; -struct ioport_field_live; -class ioport_manager; -class natural_keyboard; -class analog_field; - // constructor function pointer typedef void(*ioport_constructor)(device_t &owner, ioport_list &portlist, std::string &errorbuf); @@ -1378,8 +1367,6 @@ struct ioport_port_live }; -enum class config_type; - // ======================> ioport_manager // private input port state @@ -1824,4 +1811,4 @@ inline device_t &ioport_setting::device() const { return m_field.device(); } inline running_machine &ioport_setting::machine() const { return m_field.machine(); } -#endif // MAME_EMU_IOPORT_H */ +#endif // MAME_EMU_IOPORT_H diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index 1568dada8ef..6712951b0ae 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -116,7 +116,7 @@ running_machine::running_machine(const machine_config &_config, machine_manager m_config(_config), m_system(_config.gamedrv()), m_manager(manager), - m_current_phase(MACHINE_PHASE_PREINIT), + m_current_phase(machine_phase::PREINIT), m_paused(false), m_hard_reset_pending(false), m_exit_pending(false), @@ -293,7 +293,7 @@ int running_machine::run(bool quiet) m_manager.http()->clear(); // move to the init phase - m_current_phase = MACHINE_PHASE_INIT; + m_current_phase = machine_phase::INIT; // if we have a logfile, set up the callback if (options().log() && !quiet) @@ -369,7 +369,7 @@ int running_machine::run(bool quiet) m_manager.http()->clear(); // and out via the exit phase - m_current_phase = MACHINE_PHASE_EXIT; + m_current_phase = machine_phase::EXIT; // save the NVRAM and configuration sound().ui_mute(true); @@ -411,7 +411,7 @@ int running_machine::run(bool quiet) // make sure our phase is set properly before cleaning up, // in case we got here via exception - m_current_phase = MACHINE_PHASE_EXIT; + m_current_phase = machine_phase::EXIT; // call all exit callbacks registered call_notifiers(MACHINE_NOTIFY_EXIT); @@ -736,7 +736,7 @@ void running_machine::toggle_pause() void running_machine::add_notifier(machine_notification event, machine_notify_delegate callback, bool first) { - assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_notifier at init time!"); + assert_always(m_current_phase == machine_phase::INIT, "Can only call add_notifier at init time!"); if(first) m_notifier_list[event].push_front(std::make_unique<notifier_callback_item>(callback)); @@ -758,7 +758,7 @@ void running_machine::add_notifier(machine_notification event, machine_notify_de void running_machine::add_logerror_callback(logerror_callback callback) { - assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_logerror_callback at init time!"); + assert_always(m_current_phase == machine_phase::INIT, "Can only call add_logerror_callback at init time!"); m_string_buffer.reserve(1024); m_logerror_list.push_back(std::make_unique<logerror_callback_item>(callback)); } @@ -943,13 +943,13 @@ void running_machine::soft_reset(void *ptr, s32 param) logerror("Soft reset\n"); // temporarily in the reset phase - m_current_phase = MACHINE_PHASE_RESET; + m_current_phase = machine_phase::RESET; // call all registered reset callbacks call_notifiers(MACHINE_NOTIFY_RESET); // now we're running - m_current_phase = MACHINE_PHASE_RUNNING; + m_current_phase = machine_phase::RUNNING; } diff --git a/src/emu/machine.h b/src/emu/machine.h index 5d3a6e3a047..a9b30425ec3 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -21,21 +21,18 @@ #include <time.h> -// forward declaration instead of osdepend.h -class osd_interface; - //************************************************************************** // CONSTANTS //************************************************************************** // machine phases -enum machine_phase +enum class machine_phase { - MACHINE_PHASE_PREINIT, - MACHINE_PHASE_INIT, - MACHINE_PHASE_RESET, - MACHINE_PHASE_RUNNING, - MACHINE_PHASE_EXIT + PREINIT, + INIT, + RESET, + RUNNING, + EXIT }; @@ -52,15 +49,15 @@ enum machine_notification // debug flags -const int DEBUG_FLAG_ENABLED = 0x00000001; // debugging is enabled -const int DEBUG_FLAG_CALL_HOOK = 0x00000002; // CPU cores must call instruction hook -const int DEBUG_FLAG_WPR_PROGRAM = 0x00000010; // watchpoints are enabled for PROGRAM memory reads -const int DEBUG_FLAG_WPR_DATA = 0x00000020; // watchpoints are enabled for DATA memory reads -const int DEBUG_FLAG_WPR_IO = 0x00000040; // watchpoints are enabled for IO memory reads -const int DEBUG_FLAG_WPW_PROGRAM = 0x00000100; // watchpoints are enabled for PROGRAM memory writes -const int DEBUG_FLAG_WPW_DATA = 0x00000200; // watchpoints are enabled for DATA memory writes -const int DEBUG_FLAG_WPW_IO = 0x00000400; // watchpoints are enabled for IO memory writes -const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled +constexpr int DEBUG_FLAG_ENABLED = 0x00000001; // debugging is enabled +constexpr int DEBUG_FLAG_CALL_HOOK = 0x00000002; // CPU cores must call instruction hook +constexpr int DEBUG_FLAG_WPR_PROGRAM = 0x00000010; // watchpoints are enabled for PROGRAM memory reads +constexpr int DEBUG_FLAG_WPR_DATA = 0x00000020; // watchpoints are enabled for DATA memory reads +constexpr int DEBUG_FLAG_WPR_IO = 0x00000040; // watchpoints are enabled for IO memory reads +constexpr int DEBUG_FLAG_WPW_PROGRAM = 0x00000100; // watchpoints are enabled for PROGRAM memory writes +constexpr int DEBUG_FLAG_WPW_DATA = 0x00000200; // watchpoints are enabled for DATA memory writes +constexpr int DEBUG_FLAG_WPW_IO = 0x00000400; // watchpoints are enabled for IO memory writes +constexpr int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled @@ -80,26 +77,6 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is e // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class render_manager; -class sound_manager; -class video_manager; -class ui_manager; -class tilemap_manager; -class debug_view_manager; -class network_manager; -class bookkeeping_manager; -class configuration_manager; -class output_manager; -class ui_input_manager; -class crosshair_manager; -class image_manager; -class rom_load_manager; -class debugger_manager; -class osd_interface; -enum class config_type; - - // ======================> system_time // system time description, both local and UTC @@ -213,7 +190,7 @@ public: driver_device *driver_data() const { return &downcast<driver_device &>(root_device()); } template<class _DriverClass> _DriverClass *driver_data() const { return &downcast<_DriverClass &>(root_device()); } machine_phase phase() const { return m_current_phase; } - bool paused() const { return m_paused || (m_current_phase != MACHINE_PHASE_RUNNING); } + bool paused() const { return m_paused || (m_current_phase != machine_phase::RUNNING); } bool exit_pending() const { return m_exit_pending; } bool ui_active() const { return m_ui_active; } const char *basename() const { return m_basename.c_str(); } diff --git a/src/emu/main.h b/src/emu/main.h index 9b61aa6b929..9a01a73af24 100644 --- a/src/emu/main.h +++ b/src/emu/main.h @@ -40,7 +40,6 @@ enum //************************************************************************** // TYPE DEFINITIONS //************************************************************************** -class osd_interface; class emulator_info { @@ -65,8 +64,6 @@ public: static bool standalone(); }; -// ======================> machine_manager -class ui_manager; class machine_manager { @@ -101,5 +98,4 @@ protected: std::unique_ptr<http_manager> m_http; }; - -#endif /* MAME_EMU_MAIN_H */ +#endif // MAME_EMU_MAIN_H diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 58281e22e14..2ff22fd1960 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -29,11 +29,6 @@ // TYPE DEFINITIONS //************************************************************************** -// forward references -struct gfx_decode_entry; -class driver_device; -class screen_device; - struct internal_layout { size_t decompressed_size; diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp index e1921b7a21d..6e334b92066 100644 --- a/src/emu/natkeyboard.cpp +++ b/src/emu/natkeyboard.cpp @@ -796,35 +796,35 @@ void natural_keyboard::timer(void *ptr, int param) // logging and debugging //------------------------------------------------- -std::string natural_keyboard::unicode_to_string(char32_t ch) +std::string natural_keyboard::unicode_to_string(char32_t ch) const { std::string buffer; switch (ch) { - // check some magic values - case '\0': buffer.assign("\\0"); break; - case '\r': buffer.assign("\\r"); break; - case '\n': buffer.assign("\\n"); break; - case '\t': buffer.assign("\\t"); break; - - default: - // seven bit ASCII is easy - if (ch >= 32 && ch < 128) - { - char temp[2] = { char(ch), 0 }; - buffer.assign(temp); - } - else if (ch >= UCHAR_MAMEKEY_BEGIN) - { - // try to obtain a codename with code_name(); this can result in an empty string - input_code code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(ch - UCHAR_MAMEKEY_BEGIN)); - buffer = machine().input().code_name(code); - } + // check some magic values + case '\0': buffer.assign("\\0"); break; + case '\r': buffer.assign("\\r"); break; + case '\n': buffer.assign("\\n"); break; + case '\t': buffer.assign("\\t"); break; + + default: + // seven bit ASCII is easy + if (ch >= 32 && ch < 128) + { + char temp[2] = { char(ch), 0 }; + buffer.assign(temp); + } + else if (ch >= UCHAR_MAMEKEY_BEGIN) + { + // try to obtain a codename with code_name(); this can result in an empty string + input_code code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(ch - UCHAR_MAMEKEY_BEGIN)); + buffer = machine().input().code_name(code); + } - // did we fail to resolve? if so, we have a last resort - if (buffer.empty()) - buffer = string_format("U+%04X", unsigned(ch)); - break; + // did we fail to resolve? if so, we have a last resort + if (buffer.empty()) + buffer = string_format("U+%04X", unsigned(ch)); + break; } return buffer; } @@ -846,31 +846,40 @@ const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(char32_t //------------------------------------------------- -// dump - dumps info to string +// dump - dumps info to stream //------------------------------------------------- -std::string natural_keyboard::dump() +void natural_keyboard::dump(std::ostream &str) const { - std::ostringstream buffer; - const size_t left_column_width = 24; + constexpr size_t left_column_width = 24; // loop through all codes - for (auto & code : m_keycode_map) + for (auto &code : m_keycode_map) { // describe the character code std::string description = string_format("%08X (%s) ", code.ch, unicode_to_string(code.ch).c_str()); // pad with spaces - util::stream_format(buffer, "%-*s", left_column_width, description); + util::stream_format(str, "%-*s", left_column_width, description); // identify the keys used for (int field = 0; field < ARRAY_LENGTH(code.field) && code.field[field] != nullptr; field++) - util::stream_format(buffer, "%s'%s'", (field > 0) ? ", " : "", code.field[field]->name()); + util::stream_format(str, "%s'%s'", (field > 0) ? ", " : "", code.field[field]->name()); // carriage return - buffer << '\n'; + str << '\n'; } +} + +//------------------------------------------------- +// dump - dumps info to string +//------------------------------------------------- + +std::string natural_keyboard::dump() const +{ + std::ostringstream buffer; + dump(buffer); return buffer.str(); } diff --git a/src/emu/natkeyboard.h b/src/emu/natkeyboard.h index e89d9b3f2ca..ded7eefdcb9 100644 --- a/src/emu/natkeyboard.h +++ b/src/emu/natkeyboard.h @@ -7,11 +7,13 @@ Natural keyboard input support. ***************************************************************************/ -#ifndef EMU_NATKEYBOARD_H -#define EMU_NATKEYBOARD_H +#ifndef MAME_EMU_NATKEYBOARD_H +#define MAME_EMU_NATKEYBOARD_H #pragma once +#include <iosfwd> + //************************************************************************** // TYPE DEFINITIONS @@ -53,7 +55,8 @@ public: void post_coded(const char *text, size_t length = 0, const attotime &rate = attotime::zero); // debugging - std::string dump(); + void dump(std::ostream &str) const; + std::string dump() const; private: enum @@ -76,7 +79,7 @@ private: attotime choose_delay(char32_t ch); void internal_post(char32_t ch); void timer(void *ptr, int param); - std::string unicode_to_string(char32_t ch); + std::string unicode_to_string(char32_t ch) const; const keycode_map_entry *find_code(char32_t ch) const; // internal state @@ -96,4 +99,7 @@ private: std::vector<keycode_map_entry> m_keycode_map; // keycode map }; -#endif + +inline std::ostream &operator<<(std::ostream &str, natural_keyboard const &kbd) { kbd.dump(str); return str; } + +#endif // MAME_EMU_NATKEYBOARD_H diff --git a/src/emu/network.h b/src/emu/network.h index 29cf8c3c5d0..5ac8e4f2d37 100644 --- a/src/emu/network.h +++ b/src/emu/network.h @@ -7,11 +7,11 @@ Core network interface functions and definitions. ***************************************************************************/ -#pragma once - #ifndef MAME_EMU_NETWORK_H #define MAME_EMU_NETWORK_H +#pragma once + // ======================> network_manager class network_manager @@ -30,4 +30,4 @@ private: running_machine & m_machine; // reference to our machine }; -#endif /* MAME_EMU_NETWORK_H */ +#endif // MAME_EMU_NETWORK_H diff --git a/src/emu/output.h b/src/emu/output.h index 20b5086db9a..ea5095c060e 100644 --- a/src/emu/output.h +++ b/src/emu/output.h @@ -21,7 +21,6 @@ TYPE DEFINITIONS ***************************************************************************/ -class output_module; typedef void (*output_notifier_func)(const char *outname, s32 value, void *param); // ======================> output_manager diff --git a/src/emu/render.cpp b/src/emu/render.cpp index f1e7a952bc8..5b243306a9c 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -1267,7 +1267,7 @@ void render_target::compute_minimum_size(s32 &minwidth, s32 &minheight) int screens_considered = 0; // early exit in case we are called between device teardown and render teardown - if (m_manager.machine().phase() == MACHINE_PHASE_EXIT) + if (m_manager.machine().phase() == machine_phase::EXIT) { minwidth = 640; minheight = 480; @@ -1360,7 +1360,7 @@ render_primitive_list &render_target::get_primitives() root_xform.no_center = false; // iterate over layers back-to-front, but only if we're running - if (m_manager.machine().phase() >= MACHINE_PHASE_RESET) + if (m_manager.machine().phase() >= machine_phase::RESET) for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; ++layernum) { int blendmode; diff --git a/src/emu/render.h b/src/emu/render.h index 2f86b6032e0..61ff02dc0ff 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -46,9 +46,6 @@ #ifndef MAME_EMU_RENDER_H #define MAME_EMU_RENDER_H -//#include "osdepend.h" - -//#include "bitmap.h" #include "screen.h" #include <math.h> @@ -161,17 +158,8 @@ constexpr u32 PRIMFLAG_PACKABLE = 1 << PRIMFLAG_PACKABLE_SHIFT; // TYPE DEFINITIONS //************************************************************************** -// forward definitions -namespace util { namespace xml { class data_node; } } -class device_t; -class screen_device; -class render_container; -class render_manager; -class render_font; +// private classes declared in render.cpp struct object_transform; -class layout_element; -class layout_view; - // texture scaling callback typedef void (*texture_scaler_func)(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param); diff --git a/src/emu/rendfont.h b/src/emu/rendfont.h index 30968103b3d..aa04a094d75 100644 --- a/src/emu/rendfont.h +++ b/src/emu/rendfont.h @@ -13,9 +13,6 @@ #include "render.h" -// forward instead of include -class osd_font; - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h index 1267be32773..e51a783e968 100644 --- a/src/emu/rendlay.h +++ b/src/emu/rendlay.h @@ -8,8 +8,11 @@ ***************************************************************************/ -#ifndef __RENDLAY_H__ -#define __RENDLAY_H__ +#ifndef MAME_EMU_RENDLAY_H +#define MAME_EMU_RENDLAY_H + +#pragma once + //************************************************************************** // GLOBAL VARIABLES @@ -40,5 +43,4 @@ extern const internal_layout layout_lcd_rot; // same, for use with ROT90 or // SVG screen layouts extern const internal_layout layout_svg; // generic 1:1 lcd screen layout - -#endif // __RENDLAY_H__ +#endif // MAME_EMU_RENDLAY_H diff --git a/src/emu/rendutil.h b/src/emu/rendutil.h index d1908edbafe..ba74f8696ed 100644 --- a/src/emu/rendutil.h +++ b/src/emu/rendutil.h @@ -7,8 +7,10 @@ Core rendering utilities. ***************************************************************************/ -#ifndef __RENDUTIL_H__ -#define __RENDUTIL_H__ +#ifndef MAME_EMU_RENDUTIL_H +#define MAME_EMU_RENDUTIL_H + +#pragma once #include "render.h" @@ -198,4 +200,4 @@ static inline u8 apply_brightness_contrast_gamma(u8 src, float brightness, float } -#endif /* __RENDUTIL_H__ */ +#endif // MAME_EMU_RENDUTIL_H diff --git a/src/emu/romentry.h b/src/emu/romentry.h index eaa426da33a..e56403c14c7 100644 --- a/src/emu/romentry.h +++ b/src/emu/romentry.h @@ -11,11 +11,12 @@ #ifndef MAME_EMU_ROMENTRY_H #define MAME_EMU_ROMENTRY_H -#include <string> - #include "emucore.h" #include "osdcomm.h" +#include <string> + + /*************************************************************************** CONSTANTS ***************************************************************************/ diff --git a/src/emu/romload.h b/src/emu/romload.h index 41d02dbadae..420000a78e2 100644 --- a/src/emu/romload.h +++ b/src/emu/romload.h @@ -24,12 +24,6 @@ TYPE DEFINITIONS ***************************************************************************/ -class machine_config; -class emu_options; -class chd_file; -class software_list_device; - - /*************************************************************************** MACROS diff --git a/src/emu/schedule.h b/src/emu/schedule.h index e4925d29a8c..de50fe5e4f5 100644 --- a/src/emu/schedule.h +++ b/src/emu/schedule.h @@ -198,4 +198,4 @@ private: }; -#endif // MAME_EMU_SCHEDULE_H */ +#endif // MAME_EMU_SCHEDULE_H diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 1333ee3c4a2..1284ad35b53 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -37,10 +37,10 @@ const attotime screen_device::DEFAULT_FRAME_PERIOD(attotime::from_hz(DEFAULT_FRA u32 screen_device::m_id_counter = 0; -class screen_device_svg_renderer { +class screen_device::svg_renderer { public: - screen_device_svg_renderer(memory_region *region); - ~screen_device_svg_renderer(); + svg_renderer(memory_region *region); + ~svg_renderer(); int width() const; int height() const; @@ -89,7 +89,7 @@ private: void blit(bitmap_rgb32 &bitmap, const cached_bitmap &src) const; }; -screen_device_svg_renderer::screen_device_svg_renderer(memory_region *region) +screen_device::svg_renderer::svg_renderer(memory_region *region) { char *s = new char[region->bytes()+1]; memcpy(s, region->base(), region->bytes()); @@ -137,23 +137,23 @@ screen_device_svg_renderer::screen_device_svg_renderer(memory_region *region) #endif } -screen_device_svg_renderer::~screen_device_svg_renderer() +screen_device::svg_renderer::~svg_renderer() { nsvgDeleteRasterizer(m_rasterizer); nsvgDelete(m_image); } -int screen_device_svg_renderer::width() const +int screen_device::svg_renderer::width() const { return int(m_image->width + 0.5); } -int screen_device_svg_renderer::height() const +int screen_device::svg_renderer::height() const { return int(m_image->height + 0.5); } -void screen_device_svg_renderer::render_state(std::vector<u32> &dest, const std::vector<bool> &state) +void screen_device::svg_renderer::render_state(std::vector<u32> &dest, const std::vector<bool> &state) { for(int key = 0; key != m_key_count; key++) { if (state[key]) @@ -187,7 +187,7 @@ void screen_device_svg_renderer::render_state(std::vector<u32> &dest, const std: } } -void screen_device_svg_renderer::blit(bitmap_rgb32 &bitmap, const cached_bitmap &src) const +void screen_device::svg_renderer::blit(bitmap_rgb32 &bitmap, const cached_bitmap &src) const { const u32 *s = &src.image[0]; for(int y=0; y<src.sy; y++) { @@ -201,7 +201,7 @@ void screen_device_svg_renderer::blit(bitmap_rgb32 &bitmap, const cached_bitmap } } -int screen_device_svg_renderer::render(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +int screen_device::svg_renderer::render(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int nsx = bitmap.width(); int nsy = bitmap.height(); @@ -236,12 +236,12 @@ int screen_device_svg_renderer::render(screen_device &screen, bitmap_rgb32 &bitm return 0; } -void screen_device_svg_renderer::output_notifier(const char *outname, s32 value, void *param) +void screen_device::svg_renderer::output_notifier(const char *outname, s32 value, void *param) { - static_cast<screen_device_svg_renderer *>(param)->output_change(outname, value); + static_cast<svg_renderer *>(param)->output_change(outname, value); } -void screen_device_svg_renderer::output_change(const char *outname, s32 value) +void screen_device::svg_renderer::output_change(const char *outname, s32 value) { auto l = m_key_ids.find(outname); if (l == m_key_ids.end()) @@ -249,7 +249,7 @@ void screen_device_svg_renderer::output_change(const char *outname, s32 value) m_key_state[l->second] = value; } -void screen_device_svg_renderer::compute_initial_bboxes(std::vector<bbox> &bboxes) +void screen_device::svg_renderer::compute_initial_bboxes(std::vector<bbox> &bboxes) { bboxes.resize(m_key_count); for(int key = 0; key != m_key_count; key++) { @@ -300,7 +300,7 @@ void screen_device_svg_renderer::compute_initial_bboxes(std::vector<bbox> &bboxe } } -void screen_device_svg_renderer::compute_diff_image(const std::vector<u32> &rend, const bbox &bb, cached_bitmap &dest) const +void screen_device::svg_renderer::compute_diff_image(const std::vector<u32> &rend, const bbox &bb, cached_bitmap &dest) const { int x0, y0, x1, y1; x0 = y0 = x1 = y1 = -1; @@ -354,7 +354,7 @@ void screen_device_svg_renderer::compute_diff_image(const std::vector<u32> &rend } -bool screen_device_svg_renderer::compute_mask_intersection_bbox(int key1, int key2, bbox &bb) const +bool screen_device::svg_renderer::compute_mask_intersection_bbox(int key1, int key2, bbox &bb) const { const cached_bitmap &c1 = m_cache[key1]; const cached_bitmap &c2 = m_cache[key2]; @@ -403,7 +403,7 @@ bool screen_device_svg_renderer::compute_mask_intersection_bbox(int key1, int ke return true; } -void screen_device_svg_renderer::compute_dual_diff_image(const std::vector<u32> &rend, const bbox &bb, const cached_bitmap &src1, const cached_bitmap &src2, cached_bitmap &dest) const +void screen_device::svg_renderer::compute_dual_diff_image(const std::vector<u32> &rend, const bbox &bb, const cached_bitmap &src1, const cached_bitmap &src2, cached_bitmap &dest) const { dest.x = bb.x0; dest.y = bb.y0; @@ -426,7 +426,7 @@ void screen_device_svg_renderer::compute_dual_diff_image(const std::vector<u32> } } -void screen_device_svg_renderer::rebuild_cache() +void screen_device::svg_renderer::rebuild_cache() { m_cache.clear(); std::vector<u32> rend(m_sx*m_sy); @@ -814,8 +814,8 @@ void screen_device::device_start() memory_region *reg = owner()->memregion(m_svg_region); if (!reg) fatalerror("SVG region \"%s\" does not exist\n", m_svg_region); - m_svg = std::make_unique<screen_device_svg_renderer>(reg); - machine().output().set_notifier(nullptr, screen_device_svg_renderer::output_notifier, m_svg.get()); + m_svg = std::make_unique<svg_renderer>(reg); + machine().output().set_notifier(nullptr, svg_renderer::output_notifier, m_svg.get()); if (0) { diff --git a/src/emu/screen.h b/src/emu/screen.h index 21ba8ac186a..3da146bac1d 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -79,11 +79,6 @@ constexpr u32 VIDEO_UPDATE_SCANLINE = 0x0100; // TYPE DEFINITIONS //************************************************************************** -// forward references -class render_texture; -class screen_device; - - // ======================> screen_bitmap class screen_bitmap @@ -166,9 +161,6 @@ typedef device_delegate<u32 (screen_device &, bitmap_rgb32 &, const rectangle &) // ======================> screen_device -class screen_device_svg_renderer; -class render_container; - class screen_device : public device_t { friend class render_manager; @@ -258,6 +250,8 @@ public: static const attotime DEFAULT_FRAME_PERIOD; private: + class svg_renderer; + // timer IDs enum { @@ -300,7 +294,7 @@ private: // internal state render_container * m_container; // pointer to our container - std::unique_ptr<screen_device_svg_renderer> m_svg; // the svg renderer + std::unique_ptr<svg_renderer> m_svg; // the svg renderer // dimensions int m_width; // current width (HTOTAL) int m_height; // current height (VTOTAL) diff --git a/src/emu/softlist.cpp b/src/emu/softlist.cpp index 1d2fcf17100..5e88baaeab1 100644 --- a/src/emu/softlist.cpp +++ b/src/emu/softlist.cpp @@ -8,12 +8,14 @@ ***************************************************************************/ -#include <regex> - #include "softlist.h" #include "hash.h" + #include "expat.h" +#include <regex> + + //************************************************************************** // STATIC VARIABLES diff --git a/src/emu/softlist.h b/src/emu/softlist.h index 2f321419b56..feab67448d3 100644 --- a/src/emu/softlist.h +++ b/src/emu/softlist.h @@ -8,14 +8,18 @@ *********************************************************************/ -#ifndef __SOFTLIST_H_ -#define __SOFTLIST_H_ +#ifndef MAME_EMU_SOFTLIST_H +#define MAME_EMU_SOFTLIST_H + +#pragma once + -#include <list> #include "emucore.h" #include "romentry.h" #include "corefile.h" +#include <list> + //************************************************************************** // CONSTANTS @@ -30,9 +34,6 @@ // TYPE DEFINITIONS //************************************************************************** -struct XML_ParserStruct; -class software_info; - // ======================> feature_list_item // an item in a list of name/value pairs @@ -211,4 +212,4 @@ private: // parses a software identifier (e.g. - 'apple2e:agentusa:flop1') into its constituent parts (returns false if cannot parse) bool software_name_parse(const std::string &identifier, std::string *list_name = nullptr, std::string *software_name = nullptr, std::string *part_name = nullptr); -#endif // __SOFTLIST_H_ +#endif // MAME_EMU_SOFTLIST_H diff --git a/src/emu/softlist_dev.h b/src/emu/softlist_dev.h index adc73b8637c..855fee42062 100644 --- a/src/emu/softlist_dev.h +++ b/src/emu/softlist_dev.h @@ -8,8 +8,11 @@ *********************************************************************/ -#ifndef MAME_EMU_SOFTLIST_DEV -#define MAME_EMU_SOFTLIST_DEV +#ifndef MAME_EMU_SOFTLIST_DEV_H +#define MAME_EMU_SOFTLIST_DEV_H + +#pragma once + #include "softlist.h" @@ -71,9 +74,6 @@ enum software_compatibility // TYPE DEFINITIONS //************************************************************************** -class device_image_interface; -class software_list_device; - // ======================> software_list_loader @@ -193,4 +193,4 @@ DECLARE_DEVICE_TYPE(SOFTWARE_LIST, software_list_device) typedef device_type_iterator<software_list_device> software_list_device_iterator; -#endif // MAME_EMU_SOFTLIST_DEV +#endif // MAME_EMU_SOFTLIST_DEV_H diff --git a/src/emu/sound.h b/src/emu/sound.h index 8cb4c725e6b..37c3492588a 100644 --- a/src/emu/sound.h +++ b/src/emu/sound.h @@ -22,7 +22,7 @@ // CONSTANTS //************************************************************************** -const int STREAM_SYNC = -1; // special rate value indicating a one-sample-at-a-time stream +constexpr int STREAM_SYNC = -1; // special rate value indicating a one-sample-at-a-time stream // with actual rate defined by its input //************************************************************************** @@ -35,9 +35,6 @@ typedef delegate<void (sound_stream &, stream_sample_t **inputs, stream_sample_t // TYPE DEFINITIONS //************************************************************************** -// forward references -struct wav_file; - // structure describing an indexed mixer struct mixer_input @@ -250,4 +247,4 @@ private: }; -#endif /* MAME_EMU_SOUND_H */ +#endif // MAME_EMU_SOUND_H diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h index c8364f3b931..ac3f021e9ab 100644 --- a/src/emu/tilemap.h +++ b/src/emu/tilemap.h @@ -426,12 +426,6 @@ enum tilemap_standard_mapper // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class tilemap_t; -class tilemap_manager; -class tilemap_device; - - // global types typedef u32 tilemap_memory_index; @@ -818,4 +812,4 @@ inline running_machine &tilemap_t::machine() const } -#endif // MAME_EMU_TILEMAP_H +#endif // MAME_EMU_TILEMAP_H diff --git a/src/emu/timer.cpp b/src/emu/timer.cpp index 9fa9f6b9ec0..b723a344a98 100644 --- a/src/emu/timer.cpp +++ b/src/emu/timer.cpp @@ -36,7 +36,7 @@ DEFINE_DEVICE_TYPE(TIMER, timer_device, "timer", "Timer") timer_device::timer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, TIMER, tag, owner, clock), m_type(TIMER_TYPE_GENERIC), - m_callback(timer_device_expired_delegate()), + m_callback(), m_ptr(nullptr), m_start_delay(attotime::zero), m_period(attotime::zero), @@ -56,7 +56,7 @@ timer_device::timer_device(const machine_config &mconfig, const char *tag, devic // helper to set up a generic timer //------------------------------------------------- -void timer_device::static_configure_generic(device_t &device, timer_device_expired_delegate callback) +void timer_device::static_configure_generic(device_t &device, expired_delegate callback) { timer_device &timer = downcast<timer_device &>(device); timer.m_type = TIMER_TYPE_GENERIC; @@ -69,7 +69,7 @@ void timer_device::static_configure_generic(device_t &device, timer_device_expir // helper to set up a periodic timer //------------------------------------------------- -void timer_device::static_configure_periodic(device_t &device, timer_device_expired_delegate callback, const attotime &period) +void timer_device::static_configure_periodic(device_t &device, expired_delegate callback, const attotime &period) { timer_device &timer = downcast<timer_device &>(device); timer.m_type = TIMER_TYPE_PERIODIC; @@ -83,7 +83,7 @@ void timer_device::static_configure_periodic(device_t &device, timer_device_expi // helper to set up a scanline timer //------------------------------------------------- -void timer_device::static_configure_scanline(device_t &device, timer_device_expired_delegate callback, const char *screen, int first_vpos, int increment) +void timer_device::static_configure_scanline(device_t &device, expired_delegate callback, const char *screen, int first_vpos, int increment) { timer_device &timer = downcast<timer_device &>(device); timer.m_type = TIMER_TYPE_SCANLINE; @@ -99,7 +99,7 @@ void timer_device::static_configure_scanline(device_t &device, timer_device_expi // to set the callback //------------------------------------------------- -void timer_device::static_set_callback(device_t &device, timer_device_expired_delegate callback) +void timer_device::static_set_callback(device_t &device, expired_delegate callback) { timer_device &timer = downcast<timer_device &>(device); timer.m_callback = callback; diff --git a/src/emu/timer.h b/src/emu/timer.h index 184131ca89c..e4eb63511d1 100644 --- a/src/emu/timer.h +++ b/src/emu/timer.h @@ -32,30 +32,30 @@ #define MCFG_TIMER_ADD_NONE(_tag) \ MCFG_DEVICE_ADD(_tag, TIMER, 0) \ - timer_device::static_configure_generic(*device, timer_device_expired_delegate()); + timer_device::static_configure_generic(*device, timer_device::expired_delegate()); #define MCFG_TIMER_DRIVER_ADD(_tag, _class, _callback) \ MCFG_DEVICE_ADD(_tag, TIMER, 0) \ - timer_device::static_configure_generic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr)); + timer_device::static_configure_generic(*device, timer_device::expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr)); #define MCFG_TIMER_DEVICE_ADD(_tag, _devtag, _class, _callback) \ MCFG_DEVICE_ADD(_tag, TIMER, 0) \ - timer_device::static_configure_generic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, _devtag, (_class *)nullptr)); + timer_device::static_configure_generic(*device, timer_device::expired_delegate(&_class::_callback, #_class "::" #_callback, _devtag, (_class *)nullptr)); #define MCFG_TIMER_DRIVER_ADD_PERIODIC(_tag, _class, _callback, _period) \ MCFG_DEVICE_ADD(_tag, TIMER, 0) \ - timer_device::static_configure_periodic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr), _period); + timer_device::static_configure_periodic(*device, timer_device::expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr), _period); #define MCFG_TIMER_DEVICE_ADD_PERIODIC(_tag, _devtag, _class, _callback, _period) \ MCFG_DEVICE_ADD(_tag, TIMER, 0) \ - timer_device::static_configure_periodic(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, _devtag, (_class *)nullptr), _period); + timer_device::static_configure_periodic(*device, timer_device::expired_delegate(&_class::_callback, #_class "::" #_callback, _devtag, (_class *)nullptr), _period); #define MCFG_TIMER_DRIVER_ADD_SCANLINE(_tag, _class, _callback, _screen, _first_vpos, _increment) \ MCFG_DEVICE_ADD(_tag, TIMER, 0) \ - timer_device::static_configure_scanline(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr), _screen, _first_vpos, _increment); + timer_device::static_configure_scanline(*device, timer_device::expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr), _screen, _first_vpos, _increment); #define MCFG_TIMER_DEVICE_ADD_SCANLINE(_tag, _devtag, _class, _callback, _screen, _first_vpos, _increment) \ MCFG_DEVICE_ADD(_tag, TIMER, 0) \ - timer_device::static_configure_scanline(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, _devtag, (_class *)nullptr), _screen, _first_vpos, _increment); + timer_device::static_configure_scanline(*device, timer_device::expired_delegate(&_class::_callback, #_class "::" #_callback, _devtag, (_class *)nullptr), _screen, _first_vpos, _increment); #define MCFG_TIMER_MODIFY(_tag) \ MCFG_DEVICE_MODIFY(_tag) #define MCFG_TIMER_DRIVER_CALLBACK(_class, _callback) \ - timer_device::static_set_callback(*device, timer_device_expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr)); + timer_device::static_set_callback(*device, timer_device::expired_delegate(&_class::_callback, #_class "::" #_callback, nullptr, (_class *)nullptr)); #define MCFG_TIMER_START_DELAY(_start_delay) \ timer_device::static_set_start_delay(*device, _start_delay); #define MCFG_TIMER_PARAM(_param) \ @@ -68,26 +68,22 @@ // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class emu_timer; -class timer_device; - -// a timer callbacks look like this -typedef device_delegate<void (timer_device &, void *, s32)> timer_device_expired_delegate; - // ======================> timer_device class timer_device : public device_t { public: + // a timer callbacks look like this + typedef device_delegate<void (timer_device &, void *, s32)> expired_delegate; + // construction/destruction timer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // inline configuration helpers - static void static_configure_generic(device_t &device, timer_device_expired_delegate callback); - static void static_configure_periodic(device_t &device, timer_device_expired_delegate callback, const attotime &period); - static void static_configure_scanline(device_t &device, timer_device_expired_delegate callback, const char *screen, int first_vpos, int increment); - static void static_set_callback(device_t &device, timer_device_expired_delegate callback); + static void static_configure_generic(device_t &device, expired_delegate callback); + static void static_configure_periodic(device_t &device, expired_delegate callback, const attotime &period); + static void static_configure_scanline(device_t &device, expired_delegate callback, const char *screen, int first_vpos, int increment); + static void static_set_callback(device_t &device, expired_delegate callback); static void static_set_start_delay(device_t &device, const attotime &delay); static void static_set_param(device_t &device, int param); static void static_set_ptr(device_t &device, void *ptr); @@ -129,7 +125,7 @@ private: // configuration data timer_type m_type; // type of timer - timer_device_expired_delegate m_callback; // the timer's callback function + expired_delegate m_callback; // the timer's callback function void * m_ptr; // the pointer parameter passed to the timer callback // periodic timers only @@ -154,7 +150,7 @@ private: // GLOBAL VARIABLES //************************************************************************** -extern const device_type TIMER; +DECLARE_DEVICE_TYPE(TIMER, timer_device) -#endif /* MAME_EMU_TIMER_H */ +#endif // MAME_EMU_TIMER_H diff --git a/src/emu/ui/uimain.h b/src/emu/ui/uimain.h index 3c92b5c8073..ecbbcf695ca 100644 --- a/src/emu/ui/uimain.h +++ b/src/emu/ui/uimain.h @@ -2,16 +2,16 @@ // copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods /*************************************************************************** - ui/menu.h + ui/uimain.h Internal MAME menus for the user interface. ***************************************************************************/ -#pragma once +#ifndef MAME_EMU_UI_UIMAIN_H +#define MAME_EMU_UI_UIMAIN_H -#ifndef __BASIC_UI_H__ -#define __BASIC_UI_H__ +#pragma once /*************************************************************************** @@ -65,4 +65,4 @@ inline void ui_manager::popup_time(int seconds, Format &&fmt, Params &&... args) popup_time_string(seconds, string_format(std::forward<Format>(fmt), std::forward<Params>(args)...)); } -#endif // __BASIC_UI_H__ +#endif // MAME_EMU_UI_UIMAIN_H diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h index 66cdd1f80b5..e6673c4d763 100644 --- a/src/emu/uiinput.h +++ b/src/emu/uiinput.h @@ -23,8 +23,6 @@ TYPE DEFINITIONS ***************************************************************************/ -class render_target; - enum ui_event_type { UI_EVENT_NONE, @@ -119,4 +117,4 @@ private: int m_events_end; }; -#endif /* MAME_EMU_UIINPUT_H */ +#endif // MAME_EMU_UIINPUT_H diff --git a/src/emu/validity.h b/src/emu/validity.h index 7bdde37e576..eaaa9f7336f 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -21,10 +21,6 @@ // TYPE DEFINITIONS //************************************************************************** -// forward declarations -class machine_config; - - // core validity checker class class validity_checker : public osd_output { diff --git a/src/emu/video.cpp b/src/emu/video.cpp index 6e40d073ab8..34e8eb0033d 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -201,9 +201,9 @@ void video_manager::set_frameskip(int frameskip) void video_manager::frame_update(bool from_debugger) { // only render sound and video if we're in the running phase - int phase = machine().phase(); + machine_phase const phase = machine().phase(); bool skipped_it = m_skipping_this_frame; - if (phase == MACHINE_PHASE_RUNNING && (!machine().paused() || machine().options().update_in_pause())) + if (phase == machine_phase::RUNNING && (!machine().paused() || machine().options().update_in_pause())) { bool anything_changed = finish_screen_updates(); @@ -244,7 +244,7 @@ void video_manager::frame_update(bool from_debugger) recompute_speed(current_time); // call the end-of-frame callback - if (phase == MACHINE_PHASE_RUNNING) + if (phase == machine_phase::RUNNING) { // reset partial updates if we're paused or if the debugger is active screen_device *const screen = machine().first_screen(); diff --git a/src/emu/video.h b/src/emu/video.h index 71313fe58b2..7e19de3c5ab 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -25,8 +25,8 @@ //************************************************************************** // number of levels of frameskipping supported -const int FRAMESKIP_LEVELS = 12; -const int MAX_FRAMESKIP = FRAMESKIP_LEVELS - 2; +constexpr int FRAMESKIP_LEVELS = 12; +constexpr int MAX_FRAMESKIP = FRAMESKIP_LEVELS - 2; #define LCD_FRAMES_PER_SECOND 30 @@ -34,13 +34,6 @@ const int MAX_FRAMESKIP = FRAMESKIP_LEVELS - 2; // TYPE DEFINITIONS //************************************************************************** -// forward references -class render_target; -class screen_device; -class avi_file; - - - // ======================> video_manager class video_manager diff --git a/src/emu/video/rgbvmx.h b/src/emu/video/rgbvmx.h index 1686f0d0b6b..824e8dd3799 100644 --- a/src/emu/video/rgbvmx.h +++ b/src/emu/video/rgbvmx.h @@ -11,6 +11,8 @@ #ifndef MAME_EMU_VIDEO_RGBVMX_H #define MAME_EMU_VIDEO_RGBVMX_H +#pragma once + #include <altivec.h> /*************************************************************************** diff --git a/src/frontend/mame/ui/info_pty.cpp b/src/frontend/mame/ui/info_pty.cpp index 7b85b090b10..deed38ae932 100644 --- a/src/frontend/mame/ui/info_pty.cpp +++ b/src/frontend/mame/ui/info_pty.cpp @@ -9,11 +9,13 @@ ***************************************************************************/ #include "emu.h" - #include "ui/info_pty.h" +#include "dipty.h" + namespace ui { + menu_pty_info::menu_pty_info(mame_ui_manager &mui, render_container &container) : menu(mui, container) { diff --git a/src/frontend/mame/ui/mainmenu.cpp b/src/frontend/mame/ui/mainmenu.cpp index bf796513e29..7ea7022c7a9 100644 --- a/src/frontend/mame/ui/mainmenu.cpp +++ b/src/frontend/mame/ui/mainmenu.cpp @@ -9,34 +9,39 @@ *********************************************************************/ #include "emu.h" -#include "crsshair.h" -#include "emuopts.h" -#include "natkeyboard.h" -#include "mame.h" -#include "luaengine.h" -#include "ui/menu.h" -#include "ui/filemngr.h" +#include "ui/mainmenu.h" + #include "ui/barcode.h" #include "ui/cheatopt.h" +#include "ui/datmenu.h" +#include "ui/filemngr.h" #include "ui/info.h" #include "ui/info_pty.h" +#include "ui/inifile.h" #include "ui/inputmap.h" -#include "ui/mainmenu.h" #include "ui/miscmenu.h" +#include "ui/pluginopt.h" #include "ui/selgame.h" #include "ui/simpleselgame.h" #include "ui/sliders.h" #include "ui/slotopt.h" #include "ui/tapectrl.h" #include "ui/videoopt.h" -#include "imagedev/cassette.h" + +#include "mame.h" +#include "luaengine.h" + #include "machine/bcreader.h" -#include "ui/inifile.h" -#include "ui/datmenu.h" -#include "ui/pluginopt.h" +#include "imagedev/cassette.h" + +#include "crsshair.h" +#include "dipty.h" +#include "emuopts.h" +#include "natkeyboard.h" namespace ui { + /*************************************************************************** MENU HANDLERS ***************************************************************************/ diff --git a/src/frontend/mame/ui/mainmenu.h b/src/frontend/mame/ui/mainmenu.h index 16ca2d1cde4..33ba0d8f35b 100644 --- a/src/frontend/mame/ui/mainmenu.h +++ b/src/frontend/mame/ui/mainmenu.h @@ -8,12 +8,16 @@ ***************************************************************************/ -#pragma once - #ifndef MAME_FRONTEND_UI_MAINMENU_H #define MAME_FRONTEND_UI_MAINMENU_H +#pragma once + +#include "ui/menu.h" + + namespace ui { + class menu_main : public menu { public: diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 675f8162469..4b570491d0f 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -402,7 +402,7 @@ void mame_ui_manager::update_and_render(render_container &container) container.empty(); // if we're paused, dim the whole screen - if (machine().phase() >= MACHINE_PHASE_RESET && (single_step() || machine().paused())) + if (machine().phase() >= machine_phase::RESET && (single_step() || machine().paused())) { int alpha = (1.0f - machine().options().pause_brightness()) * 255.0f; if (ui::menu::stack_has_special_main_menu(machine())) @@ -414,7 +414,7 @@ void mame_ui_manager::update_and_render(render_container &container) } // render any cheat stuff at the bottom - if (machine().phase() >= MACHINE_PHASE_RESET) + if (machine().phase() >= machine_phase::RESET) mame_machine_manager::instance()->cheat().render_text(*this, container); // call the current UI handler @@ -1016,7 +1016,7 @@ void mame_ui_manager::start_load_state() void mame_ui_manager::image_handler_ingame() { // run display routine for devices - if (machine().phase() == MACHINE_PHASE_RUNNING) + if (machine().phase() == machine_phase::RUNNING) { auto layout = create_layout(machine().render().ui_container()); @@ -1111,7 +1111,7 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container) } // is the natural keyboard enabled? - if (machine().ioport().natkeyboard().in_use() && (machine().phase() == MACHINE_PHASE_RUNNING)) + if (machine().ioport().natkeyboard().in_use() && (machine().phase() == machine_phase::RUNNING)) process_natural_keyboard(); if (!ui_disabled) diff --git a/src/mame/drivers/cinemat.cpp b/src/mame/drivers/cinemat.cpp index 9f8ad15954e..0915588d3db 100644 --- a/src/mame/drivers/cinemat.cpp +++ b/src/mame/drivers/cinemat.cpp @@ -145,7 +145,7 @@ WRITE8_MEMBER(cinemat_state::mux_select_w) READ8_MEMBER(cinemat_state::joystick_read) { - if (machine().phase() != MACHINE_PHASE_RUNNING) + if (machine().phase() != machine_phase::RUNNING) return 0; else { diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp index a89a0f67cec..1b1e5d8a154 100644 --- a/src/mame/drivers/fidel6502.cpp +++ b/src/mame/drivers/fidel6502.cpp @@ -676,7 +676,7 @@ READ8_MEMBER(fidel6502_state::eas_input_r) WRITE8_MEMBER(fidel6502_state::eas_ppi_porta_w) { // pull output low during reset (see TODO) - if (machine().phase() == MACHINE_PHASE_RESET) + if (machine().phase() == machine_phase::RESET) data = 0; // d0-d5: TSI C0-C5 diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp index 5bac65002c7..8b4284c98f0 100644 --- a/src/mame/drivers/fidelz80.cpp +++ b/src/mame/drivers/fidelz80.cpp @@ -812,7 +812,7 @@ MACHINE_START_MEMBER(fidelz80_state,vcc) WRITE8_MEMBER(fidelz80_state::vcc_ppi_porta_w) { // pull output low during reset (see TODO) - if (machine().phase() == MACHINE_PHASE_RESET) + if (machine().phase() == machine_phase::RESET) data = 0; // d0-d6: digit segment data, bits are xABCDEFG @@ -842,7 +842,7 @@ READ8_MEMBER(fidelz80_state::vcc_ppi_portb_r) WRITE8_MEMBER(fidelz80_state::vcc_ppi_portb_w) { // pull output low during reset (see TODO) - if (machine().phase() == MACHINE_PHASE_RESET) + if (machine().phase() == machine_phase::RESET) data = 0; // d0,d2-d5: digit/led select diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index c110e00974d..fa3bf7ea34f 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -340,7 +340,7 @@ void hh_hmcs40_state::set_interrupt(int line, int state) if (state != m_int[line]) { - if (machine().phase() >= MACHINE_PHASE_RESET) + if (machine().phase() >= machine_phase::RESET) m_maincpu->set_input_line(line, state ? ASSERT_LINE : CLEAR_LINE); m_int[line] = state; } diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp index 8cd3b477e5f..87e5679dca1 100644 --- a/src/mame/drivers/hh_ucom4.cpp +++ b/src/mame/drivers/hh_ucom4.cpp @@ -246,7 +246,7 @@ void hh_ucom4_state::set_interrupt(int state) if (state != m_int) { - if (machine().phase() >= MACHINE_PHASE_RESET) + if (machine().phase() >= machine_phase::RESET) m_maincpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); m_int = state; } diff --git a/src/mame/drivers/taito_l.cpp b/src/mame/drivers/taito_l.cpp index 9efe2a9cc77..c4e9e4c8eca 100644 --- a/src/mame/drivers/taito_l.cpp +++ b/src/mame/drivers/taito_l.cpp @@ -2583,4 +2583,4 @@ GAME( 1992, lagirl, plgirls, cachat, plgirls, taitol_1cpu_state, 0, GAME( 1993, plgirls2, 0, cachat, plgirls2, taitol_1cpu_state, 0, ROT270, "Hot-B", "Play Girls 2", 0 ) GAME( 1993, plgirls2b, plgirls2, cachat, plgirls2, taitol_1cpu_state, 0, ROT270, "bootleg", "Play Girls 2 (bootleg)", MACHINE_IMPERFECT_GRAPHICS ) // bootleg hardware (regular Z80 etc. instead of TC0090LVC, but acts almost the same - scroll offset problems) -GAME( 1990, evilston, 0, evilston, evilston, taitol_2cpu_state, 0, ROT270, "Spacy Industrial, Ltd.", "Evil Stone" ) +GAME( 1990, evilston, 0, evilston, evilston, taitol_2cpu_state, 0, ROT270, "Spacy Industrial, Ltd.", "Evil Stone", 0 ) diff --git a/src/mame/drivers/ti74.cpp b/src/mame/drivers/ti74.cpp index de66bfd065a..0e4ab1494a0 100644 --- a/src/mame/drivers/ti74.cpp +++ b/src/mame/drivers/ti74.cpp @@ -287,7 +287,7 @@ ADDRESS_MAP_END INPUT_CHANGED_MEMBER(ti74_state::battery_status_changed) { - if (machine().phase() == MACHINE_PHASE_RUNNING) + if (machine().phase() == machine_phase::RUNNING) update_battery_status(newval); } diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index 67a4ffd6cf3..0307aebe273 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -772,7 +772,7 @@ WRITE_LINE_MEMBER( ti99_4x_state::console_ready_cart ) */ WRITE_LINE_MEMBER( ti99_4x_state::console_reset ) { - if (machine().phase() != MACHINE_PHASE_INIT) + if (machine().phase() != machine_phase::INIT) { logerror("ti99_4x: Console reset line = %d\n", state); m_cpu->set_input_line(INT_9900_RESET, state); diff --git a/src/mame/drivers/ti99_8.cpp b/src/mame/drivers/ti99_8.cpp index a2556b4c137..8ce0acb0f04 100644 --- a/src/mame/drivers/ti99_8.cpp +++ b/src/mame/drivers/ti99_8.cpp @@ -621,7 +621,7 @@ void ti99_8_state::console_ready(int state) WRITE_LINE_MEMBER( ti99_8_state::console_reset ) { if (TRACE_RESET) logerror("Incoming RESET line = %d\n", state); - if (machine().phase() != MACHINE_PHASE_INIT) + if (machine().phase() != machine_phase::INIT) { // RESET the 9901 m_tms9901->rst1_line(state); diff --git a/src/mame/machine/microtan.cpp b/src/mame/machine/microtan.cpp index c17fdc93dd8..4f93260027f 100644 --- a/src/mame/machine/microtan.cpp +++ b/src/mame/machine/microtan.cpp @@ -131,19 +131,15 @@ static const char keyboard[8][9][8] = { uint8_t microtan_state::read_dsw() { - uint8_t result; switch(machine().phase()) { - case MACHINE_PHASE_RESET: - case MACHINE_PHASE_RUNNING: - result = ioport("DSW")->read(); - break; + case machine_phase::RESET: + case machine_phase::RUNNING: + return ioport("DSW")->read(); - default: - result = 0x00; - break; + default: + return 0x00; } - return result; } void microtan_state::microtan_set_irq_line() diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 8c48d1a2b7d..05f56521b18 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -1530,7 +1530,7 @@ void debug_imgui::wait_for_debugger(device_t &device, bool firststop) void debug_imgui::debugger_update() { - if (m_machine && (m_machine->phase() == MACHINE_PHASE_RUNNING) && !m_machine->debugger().cpu().is_stopped() && !m_hide) + if (m_machine && (m_machine->phase() == machine_phase::RUNNING) && !m_machine->debugger().cpu().is_stopped() && !m_hide) { uint32_t width = m_machine->render().ui_target().width(); uint32_t height = m_machine->render().ui_target().height(); |