diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2016-04-25 20:09:51 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2016-04-25 20:09:51 -0400 |
commit | 596678f2cd1b40c456db8f278a7f652c2a37da84 (patch) | |
tree | a4ffbdf51889f7a63ea7dc3da3afee4535987030 /src/emu | |
parent | ec2669cacff2ec954ba351e09ba083c4e32b4ce4 (diff) | |
parent | e8326cdc3267591b635f4f97e5255e031ba6b834 (diff) |
Merge remote-tracking branch 'upstream/master' into firstrun
Diffstat (limited to 'src/emu')
58 files changed, 401 insertions, 297 deletions
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp index dedf97c780c..a7a510b56f7 100644 --- a/src/emu/addrmap.cpp +++ b/src/emu/addrmap.cpp @@ -445,7 +445,7 @@ void address_map::configure(address_spacenum spacenum, UINT8 databits) void address_map::set_global_mask(offs_t mask) { -// if (m_entrylist != NULL) +// if (m_entrylist != nullptr) // throw emu_fatalerror("AM_GLOBALMASK must be specified before any entries"); m_globalmask = mask; } @@ -755,8 +755,8 @@ void address_map::map_validity_check(validity_checker &valid, const device_t &de } // make sure ports exist -// if ((entry.m_read.m_type == AMH_PORT && entry.m_read.m_tag != NULL && portlist.find(entry.m_read.m_tag) == NULL) || -// (entry.m_write.m_type == AMH_PORT && entry.m_write.m_tag != NULL && portlist.find(entry.m_write.m_tag) == NULL)) +// if ((entry.m_read.m_type == AMH_PORT && entry.m_read.m_tag != nullptr && portlist.find(entry.m_read.m_tag) == nullptr) || +// (entry.m_write.m_type == AMH_PORT && entry.m_write.m_tag != nullptr && portlist.find(entry.m_write.m_tag) == nullptr)) // osd_printf_error("%s space memory map entry references nonexistent port tag '%s'\n", spaceconfig.m_name, entry.m_read.m_tag); // validate bank and share tags diff --git a/src/emu/addrmap.h b/src/emu/addrmap.h index 56e9fde3e8f..e4386d68365 100644 --- a/src/emu/addrmap.h +++ b/src/emu/addrmap.h @@ -302,7 +302,7 @@ public: //************************************************************************** // so that "0" can be used for unneeded address maps -#define construct_address_map_0 NULL +#define construct_address_map_0 nullptr // start/end tags for the address map #define ADDRESS_MAP_NAME(_name) construct_address_map_##_name @@ -312,7 +312,7 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, device_t &device) \ { \ typedef read##_bits##_delegate read_delegate ATTR_UNUSED; \ typedef write##_bits##_delegate write_delegate ATTR_UNUSED; \ - address_map_entry##_bits *curentry = NULL; \ + address_map_entry##_bits *curentry = nullptr; \ (void)curentry; \ assert(&device != nullptr); \ map.configure(_space, _bits); \ @@ -322,7 +322,7 @@ void _class :: _name(::address_map &map, device_t &device) \ { \ typedef read##_bits##_delegate read_delegate ATTR_UNUSED; \ typedef write##_bits##_delegate write_delegate ATTR_UNUSED; \ - address_map_entry##_bits *curentry = NULL; \ + address_map_entry##_bits *curentry = nullptr; \ (void)curentry; \ assert(&device != nullptr); \ map.configure(AS_PROGRAM, _bits); \ @@ -365,83 +365,83 @@ void _class :: _name(::address_map &map, device_t &device) \ // driver data reads #define AM_READ(_handler) \ - curentry->set_handler(read_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0)); + curentry->set_handler(read_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr)); #define AM_READ8(_handler, _unitmask) \ - curentry->set_handler(read8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(read8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); #define AM_READ16(_handler, _unitmask) \ - curentry->set_handler(read16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(read16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); #define AM_READ32(_handler, _unitmask) \ - curentry->set_handler(read32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(read32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); // driver data writes #define AM_WRITE(_handler) \ - curentry->set_handler(write_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0)); + curentry->set_handler(write_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr)); #define AM_WRITE8(_handler, _unitmask) \ - curentry->set_handler(write8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(write8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); #define AM_WRITE16(_handler, _unitmask) \ - curentry->set_handler(write16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(write16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); #define AM_WRITE32(_handler, _unitmask) \ - curentry->set_handler(write32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(write32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); // driver data reads/writes #define AM_READWRITE(_rhandler, _whandler) \ - curentry->set_handler(read_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)0), write_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)0)); + curentry->set_handler(read_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)nullptr), write_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)nullptr)); #define AM_READWRITE8(_rhandler, _whandler, _unitmask) \ - curentry->set_handler(read8_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)0), write8_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(read8_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)nullptr), write8_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); #define AM_READWRITE16(_rhandler, _whandler, _unitmask) \ - curentry->set_handler(read16_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)0), write16_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(read16_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)nullptr), write16_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); #define AM_READWRITE32(_rhandler, _whandler, _unitmask) \ - curentry->set_handler(read32_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)0), write32_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)0), _unitmask); + curentry->set_handler(read32_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, DEVICE_SELF, (drivdata_class *)nullptr), write32_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, DEVICE_SELF, (drivdata_class *)nullptr), _unitmask); // driver set offset. Upcast to base class because there are no data width variants, // and the compiler complains if we don't do it explicitly #define AM_SETOFFSET(_handler) \ - ((address_map_entry*)curentry)->set_handler(setoffset_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)0)); + ((address_map_entry*)curentry)->set_handler(setoffset_delegate(&drivdata_class::_handler, "driver_data::" #_handler, DEVICE_SELF, (drivdata_class *)nullptr)); // device reads #define AM_DEVREAD(_tag, _class, _handler) \ - curentry->set_handler(read_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0)); + curentry->set_handler(read_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr)); #define AM_DEVREAD8(_tag, _class, _handler, _unitmask) \ - curentry->set_handler(read8_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0), _unitmask); + curentry->set_handler(read8_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr), _unitmask); #define AM_DEVREAD16(_tag, _class, _handler, _unitmask) \ - curentry->set_handler(read16_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0), _unitmask); + curentry->set_handler(read16_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr), _unitmask); #define AM_DEVREAD32(_tag, _class, _handler, _unitmask) \ - curentry->set_handler(read32_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0), _unitmask); + curentry->set_handler(read32_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr), _unitmask); // device writes #define AM_DEVWRITE(_tag, _class, _handler) \ - curentry->set_handler(write_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0)); + curentry->set_handler(write_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr)); #define AM_DEVWRITE8(_tag, _class, _handler, _unitmask) \ - curentry->set_handler(write8_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0), _unitmask); + curentry->set_handler(write8_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr), _unitmask); #define AM_DEVWRITE16(_tag, _class, _handler, _unitmask) \ - curentry->set_handler(write16_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0), _unitmask); + curentry->set_handler(write16_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr), _unitmask); #define AM_DEVWRITE32(_tag, _class, _handler, _unitmask) \ - curentry->set_handler(write32_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0), _unitmask); + curentry->set_handler(write32_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr), _unitmask); // device reads/writes #define AM_DEVREADWRITE(_tag, _class, _rhandler, _whandler) \ - curentry->set_handler(read_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)0), write_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)0)); + curentry->set_handler(read_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)nullptr), write_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)nullptr)); #define AM_DEVREADWRITE8(_tag, _class, _rhandler, _whandler, _unitmask) \ - curentry->set_handler(read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)0), write8_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)0), _unitmask); + curentry->set_handler(read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)nullptr), write8_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)nullptr), _unitmask); #define AM_DEVREADWRITE16(_tag, _class, _rhandler, _whandler, _unitmask) \ - curentry->set_handler(read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)0), write16_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)0), _unitmask); + curentry->set_handler(read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)nullptr), write16_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)nullptr), _unitmask); #define AM_DEVREADWRITE32(_tag, _class, _rhandler, _whandler, _unitmask) \ - curentry->set_handler(read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)0), write32_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)0), _unitmask); + curentry->set_handler(read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, _tag, (_class *)nullptr), write32_delegate(&_class::_whandler, #_class "::" #_whandler, _tag, (_class *)nullptr), _unitmask); // device set offset #define AM_DEVSETOFFSET(_tag, _class, _handler) \ - ((address_map_entry*)curentry)->set_handler(setoffset_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)0)); + ((address_map_entry*)curentry)->set_handler(setoffset_delegate(&_class::_handler, #_class "::" #_handler, _tag, (_class *)nullptr)); // device mapping #define AM_DEVICE(_tag, _class, _handler) \ - curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), 0, 0); + curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)nullptr), 0, 0); #define AM_DEVICE8(_tag, _class, _handler, _unitmask) \ - curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), 8, _unitmask); + curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)nullptr), 8, _unitmask); #define AM_DEVICE16(_tag, _class, _handler, _unitmask) \ - curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), 16, _unitmask); + curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)nullptr), 16, _unitmask); #define AM_DEVICE32(_tag, _class, _handler, _unitmask) \ - curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), 32, _unitmask); + curentry->set_submap(_tag, address_map_delegate(&_class::_handler, #_class "::" #_handler, (_class *)nullptr), 32, _unitmask); // special-case accesses #define AM_ROM \ diff --git a/src/emu/crsshair.h b/src/emu/crsshair.h index 91becc37f58..0faf47f508e 100644 --- a/src/emu/crsshair.h +++ b/src/emu/crsshair.h @@ -65,7 +65,7 @@ public: void set_screen(int player, screen_device *screen) { m_screen[player] = screen; } /* return TRUE if any crosshairs are used */ - int get_usage() { return m_usage; } + int get_usage() const { return m_usage; } /* return the current crosshair settings for the given player */ void get_user_settings(UINT8 player, crosshair_user_settings *settings); diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 084eacfc66f..004ec75a8d1 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -510,7 +510,7 @@ static void global_set(symbol_table &table, void *ref, UINT64 value) int debug_command_parameter_number(running_machine &machine, const char *param, UINT64 *result) { - /* NULL parameter does nothing and returns no error */ + /* nullptr parameter does nothing and returns no error */ if (param == nullptr) return TRUE; @@ -614,7 +614,7 @@ int debug_command_parameter_cpu_space(running_machine &machine, const char *para static int debug_command_parameter_expression(running_machine &machine, const char *param, parsed_expression &result) { - /* NULL parameter does nothing and returns no error */ + /* nullptr parameter does nothing and returns no error */ if (param == nullptr) return TRUE; @@ -644,7 +644,7 @@ static int debug_command_parameter_command(running_machine &machine, const char { CMDERR err; - /* NULL parameter does nothing and returns no error */ + /* nullptr parameter does nothing and returns no error */ if (param == nullptr) return TRUE; diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index ffe188b722d..c0ed17bdde0 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -25,7 +25,6 @@ debug_view_disasm_source::debug_view_disasm_source(const char *name, device_t &device) : debug_view_source(name, &device), - m_device(device), m_disasmintf(dynamic_cast<device_disasm_interface *>(&device)), m_space(device.memory().space(AS_PROGRAM)), m_decrypted_space(device.memory().has_space(AS_DECRYPTED_OPCODES) ? device.memory().space(AS_DECRYPTED_OPCODES) : device.memory().space(AS_PROGRAM)) @@ -69,7 +68,7 @@ debug_view_disasm::debug_view_disasm(running_machine &machine, debug_view_osd_up for (const debug_view_source &source : m_source_list) { const debug_view_disasm_source &dasmsource = downcast<const debug_view_disasm_source &>(source); - total_comments += dasmsource.m_device.debug()->comment_count(); + total_comments += dasmsource.device()->debug()->comment_count(); } // configure the view @@ -122,7 +121,7 @@ void debug_view_disasm::view_notify(debug_view_notification type) adjust_visible_y_for_cursor(); else if (type == VIEW_NOTIFY_SOURCE_CHANGED) - m_expression.set_context(&downcast<const debug_view_disasm_source *>(m_source)->device().debug()->symtable()); + m_expression.set_context(&downcast<const debug_view_disasm_source *>(m_source)->device()->debug()->symtable()); } @@ -168,7 +167,7 @@ void debug_view_disasm::view_char(int chval) case DCH_HOME: // set the active column to the PC { const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); - offs_t pc = source.m_space.address_to_byte(source.m_device.safe_pc()) & source.m_space.logbytemask(); + offs_t pc = source.m_space.address_to_byte(source.device()->safe_pc()) & source.m_space.logbytemask(); // figure out which row the pc is on for (unsigned int curline = 0; curline < m_byteaddress.size(); curline++) @@ -273,7 +272,7 @@ offs_t debug_view_disasm::find_pc_backwards(offs_t targetpc, int numinstrs) if (debug_cpu_translate(source.m_space, TRANSLATE_FETCH, &physpcbyte)) { char dasmbuffer[100]; - instlen = source.m_device.debug()->disassemble(dasmbuffer, scanpc, &opbuf[1000 + scanpcbyte - targetpcbyte], &argbuf[1000 + scanpcbyte - targetpcbyte]) & DASMFLAG_LENGTHMASK; + instlen = source.device()->debug()->disassemble(dasmbuffer, scanpc, &opbuf[1000 + scanpcbyte - targetpcbyte], &argbuf[1000 + scanpcbyte - targetpcbyte]) & DASMFLAG_LENGTHMASK; } // count this one @@ -408,7 +407,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines) } // disassemble the result - pc += numbytes = source.m_device.debug()->disassemble(buffer, pc & source.m_space.logaddrmask(), opbuf, argbuf) & DASMFLAG_LENGTHMASK; + pc += numbytes = source.device()->debug()->disassemble(buffer, pc & source.m_space.logaddrmask(), opbuf, argbuf) & DASMFLAG_LENGTHMASK; } else strcpy(buffer, "<unmapped>"); @@ -428,7 +427,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines) { // get and add the comment, if present const offs_t comment_address = source.m_space.byte_to_address(m_byteaddress[instr]); - const char *const text = source.m_device.debug()->comment_text(comment_address); + const char *const text = source.device()->debug()->comment_text(comment_address); if (text != nullptr) util::stream_format(m_dasm.seekp(base + m_divider2), "// %.*s", m_total.x - m_divider2 - 4, text); } @@ -442,7 +441,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines) // update opcode base information m_last_direct_decrypted = source.m_decrypted_space.direct().ptr(); m_last_direct_raw = source.m_space.direct().ptr(); - m_last_change_count = source.m_device.debug()->comment_change_count(); + m_last_change_count = source.device()->debug()->comment_change_count(); // no longer need to recompute m_recompute = false; @@ -459,7 +458,7 @@ void debug_view_disasm::view_update() { const debug_view_disasm_source &source = downcast<const debug_view_disasm_source &>(*m_source); - offs_t pc = source.m_device.safe_pc(); + offs_t pc = source.device()->safe_pc(); offs_t pcbyte = source.m_space.address_to_byte(pc) & source.m_space.logbytemask(); // update our context; if the expression is dirty, recompute @@ -493,7 +492,7 @@ void debug_view_disasm::view_update() m_recompute = true; // if the comments have changed, redo it - if (m_last_change_count != source.m_device.debug()->comment_change_count()) + if (m_last_change_count != source.device()->debug()->comment_change_count()) m_recompute = true; // if we need to recompute, do it @@ -502,7 +501,7 @@ recompute: if (m_recompute) { // recompute the view - if (!m_byteaddress.empty() && m_last_change_count != source.m_device.debug()->comment_change_count()) + if (!m_byteaddress.empty() && m_last_change_count != source.device()->debug()->comment_change_count()) { // smoosh us against the left column, but not the top row m_topleft.x = 0; @@ -569,7 +568,7 @@ recompute: // if we're on a line with a breakpoint, tag it changed else { - for (device_debug::breakpoint *bp = source.m_device.debug()->breakpoint_first(); bp != nullptr; bp = bp->next()) + for (device_debug::breakpoint *bp = source.device()->debug()->breakpoint_first(); bp != nullptr; bp = bp->next()) if (m_byteaddress[effrow] == (source.m_space.address_to_byte(bp->address()) & source.m_space.logbytemask())) attrib = DCA_CHANGED; } @@ -579,7 +578,7 @@ recompute: attrib |= DCA_SELECTED; // if we've visited this pc, mark it as such - if (source.m_device.debug()->track_pc_visited(m_byteaddress[effrow])) + if (source.device()->debug()->track_pc_visited(m_byteaddress[effrow])) attrib |= DCA_VISITED; // get the effective string diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h index c474f5021a6..662d5102425 100644 --- a/src/emu/debug/dvdisasm.h +++ b/src/emu/debug/dvdisasm.h @@ -45,12 +45,10 @@ class debug_view_disasm_source : public debug_view_source public: // getters - device_t &device() const { return m_device; } address_space &space() const { return m_space; } private: // internal state - device_t & m_device; // underlying device device_disasm_interface *m_disasmintf; // disassembly interface address_space & m_space; // address space to display address_space & m_decrypted_space; // address space to display for decrypted opcodes diff --git a/src/emu/debug/dvmemory.h b/src/emu/debug/dvmemory.h index 234bd0ed19b..3b15748ed2e 100644 --- a/src/emu/debug/dvmemory.h +++ b/src/emu/debug/dvmemory.h @@ -52,7 +52,7 @@ class debug_view_memory : public debug_view public: // getters - const char *expression() { return m_expression.string(); } + const char *expression() const { return m_expression.string(); } int get_data_format() { flush_updates(); return m_data_format; } UINT32 chunks_per_row() { flush_updates(); return m_chunks_per_row; } bool reverse() const { return m_reverse_view; } diff --git a/src/emu/debug/dvstate.cpp b/src/emu/debug/dvstate.cpp index 0c1924d90fa..ca216c12f78 100644 --- a/src/emu/debug/dvstate.cpp +++ b/src/emu/debug/dvstate.cpp @@ -24,7 +24,6 @@ debug_view_state_source::debug_view_state_source(const char *name, device_t &device) : debug_view_source(name, &device), - m_device(device), m_stateintf(dynamic_cast<device_state_interface *>(&device)), m_execintf(dynamic_cast<device_execute_interface *>(&device)) { diff --git a/src/emu/debug/dvstate.h b/src/emu/debug/dvstate.h index 909526ee5f6..ad51ff69b3b 100644 --- a/src/emu/debug/dvstate.h +++ b/src/emu/debug/dvstate.h @@ -25,14 +25,8 @@ class debug_view_state_source : public debug_view_source // construction/destruction debug_view_state_source(const char *name, device_t &device); - -public: - // getters - device_t &device() const { return m_device; } - private: // internal state - device_t & m_device; // underlying device device_state_interface *m_stateintf; // state interface device_execute_interface *m_execintf; // execution interface }; diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp index 7a9ed4697ae..eb2477a1374 100644 --- a/src/emu/debug/express.cpp +++ b/src/emu/debug/express.cpp @@ -613,7 +613,7 @@ void parsed_expression::print_tokens(FILE *out) { #if DEBUG_TOKENS osd_printf_debug("----\n"); - for (parse_token *token = m_tokens.first(); token != NULL; token = token->next()) + for (parse_token *token = m_tokens.first(); token != nullptr; token = token->next()) { switch (token->type) { diff --git a/src/emu/debug/express.h b/src/emu/debug/express.h index bbbac044691..5eb961606e4 100644 --- a/src/emu/debug/express.h +++ b/src/emu/debug/express.h @@ -181,7 +181,7 @@ public: void add(const char *name, UINT64 constvalue); void add(const char *name, void *ref, getter_func getter, setter_func setter = nullptr); void add(const char *name, void *ref, int minparams, int maxparams, execute_func execute); - symbol_entry *find(const char *name) { return m_symlist.find(name); } + symbol_entry *find(const char *name) const { return m_symlist.find(name); } symbol_entry *find_deep(const char *name); // value getter/setter diff --git a/src/emu/debug/textbuf.cpp b/src/emu/debug/textbuf.cpp index 476fe6e1efc..5f2fbf8280b 100644 --- a/src/emu/debug/textbuf.cpp +++ b/src/emu/debug/textbuf.cpp @@ -261,7 +261,7 @@ void text_buffer_print_wrap(text_buffer *text, const char *data, int wrapcol) } } - /* NULL terminate what we have on this line */ + /* nullptr terminate what we have on this line */ text->buffer[text->bufend] = 0; } diff --git a/src/emu/devcb.h b/src/emu/devcb.h index 5aefb2b3429..d84d3bca1dc 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -23,7 +23,6 @@ //************************************************************************** // wrappers for ioports, constants, and loggers -#define DEVCB_NULL devcb_base::null_desc() #define DEVCB_NOOP devcb_base::null_desc() #define DEVCB_IOPORT(_tag) devcb_base::ioport_desc(_tag) #define DEVCB_CONSTANT(_value) devcb_base::constant_desc(_value) @@ -33,32 +32,32 @@ #define DEVCB_GND DEVCB_CONSTANT(0) // wrappers for read callbacks into the owner device -#define DEVCB_READLINE(_class, _func) read_line_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_READ8(_class, _func) read8_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_READ16(_class, _func) read16_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_READ32(_class, _func) read32_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_READ64(_class, _func) read64_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) +#define DEVCB_READLINE(_class, _func) read_line_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_READ8(_class, _func) read8_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_READ16(_class, _func) read16_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_READ32(_class, _func) read32_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_READ64(_class, _func) read64_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) // wrappers for read callbacks into any tagged device -#define DEVCB_DEVREADLINE(tag, _class, _func) read_line_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVREAD8(tag, _class, _func) read8_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVREAD16(tag, _class, _func) read16_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVREAD32(tag, _class, _func) read32_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVREAD64(tag, _class, _func) read64_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) +#define DEVCB_DEVREADLINE(tag, _class, _func) read_line_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVREAD8(tag, _class, _func) read8_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVREAD16(tag, _class, _func) read16_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVREAD32(tag, _class, _func) read32_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVREAD64(tag, _class, _func) read64_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) // wrappers for write callbacks into the owner device -#define DEVCB_WRITELINE(_class, _func) write_line_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_WRITE8(_class, _func) write8_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_WRITE16(_class, _func) write16_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_WRITE32(_class, _func) write32_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) -#define DEVCB_WRITE64(_class, _func) write64_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0) +#define DEVCB_WRITELINE(_class, _func) write_line_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_WRITE8(_class, _func) write8_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_WRITE16(_class, _func) write16_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_WRITE32(_class, _func) write32_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) +#define DEVCB_WRITE64(_class, _func) write64_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr) // wrappers for write callbacks into any tagged device -#define DEVCB_DEVWRITELINE(tag, _class, _func) write_line_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVWRITE8(tag, _class, _func) write8_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVWRITE16(tag, _class, _func) write16_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVWRITE32(tag, _class, _func) write32_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) -#define DEVCB_DEVWRITE64(tag, _class, _func) write64_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)0) +#define DEVCB_DEVWRITELINE(tag, _class, _func) write_line_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVWRITE8(tag, _class, _func) write8_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVWRITE16(tag, _class, _func) write16_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVWRITE32(tag, _class, _func) write32_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) +#define DEVCB_DEVWRITE64(tag, _class, _func) write64_delegate(&_class::_func, #_class "::" #_func, tag, (_class *)nullptr) // machine config helpers to add shift, mask, or address space configuration #define MCFG_DEVCB_RSHIFT(_shift) devcb->set_rshift(_shift); diff --git a/src/emu/devfind.cpp b/src/emu/devfind.cpp index 820a4e110c6..803bd0a15e5 100644 --- a/src/emu/devfind.cpp +++ b/src/emu/devfind.cpp @@ -42,7 +42,7 @@ finder_base::~finder_base() void *finder_base::find_memregion(UINT8 width, size_t &length, bool required) const { - // look up the region and return NULL if not found + // look up the region and return nullptr if not found memory_region *region = m_base.memregion(m_tag); if (region == nullptr) { @@ -119,7 +119,7 @@ bool finder_base::validate_memregion(size_t bytes, bool required) const void *finder_base::find_memshare(UINT8 width, size_t &bytes, bool required) const { - // look up the share and return NULL if not found + // look up the share and return nullptr if not found memory_share *share = m_base.memshare(m_tag); if (share == nullptr) return nullptr; diff --git a/src/emu/devfind.h b/src/emu/devfind.h index 98599e4a6e9..8ea8e59908c 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -154,7 +154,7 @@ public: : object_finder_base<memory_region>(base, tag) { } // make reference use transparent as well - operator memory_region &() { assert(object_finder_base<memory_region>::m_target != NULL); return *object_finder_base<memory_region>::m_target; } + operator memory_region &() const { assert(object_finder_base<memory_region>::m_target != nullptr); return *object_finder_base<memory_region>::m_target; } // finder virtual bool findit(bool isvalidation = false) override @@ -192,7 +192,7 @@ public: : object_finder_base<memory_bank>(base, tag) { } // make reference use transparent as well - operator memory_bank &() { assert(object_finder_base<memory_bank>::m_target != NULL); return *object_finder_base<memory_bank>::m_target; } + operator memory_bank &() const { assert(object_finder_base<memory_bank>::m_target != nullptr); return *object_finder_base<memory_bank>::m_target; } // finder virtual bool findit(bool isvalidation = false) override @@ -230,9 +230,9 @@ public: : object_finder_base<ioport_port>(base, tag) { } // make reference use transparent as well - operator ioport_port &() { assert(object_finder_base<ioport_port>::m_target != NULL); return *object_finder_base<ioport_port>::m_target; } + operator ioport_port &() const { assert(object_finder_base<ioport_port>::m_target != nullptr); return *object_finder_base<ioport_port>::m_target; } - // allow dereference even when target is NULL so read_safe() can be used + // allow dereference even when target is nullptr so read_safe() can be used ioport_port *operator->() const override { return object_finder_base<ioport_port>::m_target; } // finder diff --git a/src/emu/device.h b/src/emu/device.h index c33939dc210..114e8e28b16 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -190,7 +190,7 @@ public: virtual ~device_t(); // getters - running_machine &machine() const { /*assert(m_machine != NULL);*/ return *m_machine; } + running_machine &machine() const { /*assert(m_machine != nullptr);*/ return *m_machine; } const char *tag() const { return m_tag.c_str(); } const char *basetag() const { return m_basetag.c_str(); } device_type type() const { return m_type; } @@ -442,7 +442,7 @@ protected: // search depth-first for the next device void advance() { - // remember our starting position, and end immediately if we're NULL + // remember our starting position, and end immediately if we're nullptr device_t *start = m_curdevice; if (start == nullptr) return; @@ -730,7 +730,7 @@ private: inline device_t *device_t::subdevice(const char *tag) const { - // empty string or NULL means this device + // empty string or nullptr means this device if (tag == nullptr || *tag == 0) return const_cast<device_t *>(this); @@ -747,7 +747,7 @@ inline device_t *device_t::subdevice(const char *tag) const inline device_t *device_t::siblingdevice(const char *tag) const { - // empty string or NULL means this device + // empty string or nullptr means this device if (tag == nullptr || *tag == 0) return const_cast<device_t *>(this); @@ -758,7 +758,7 @@ inline device_t *device_t::siblingdevice(const char *tag) const if (m_owner != nullptr) return m_owner->subdevice(tag); - // otherwise, it's NULL unless the tag is absolute + // otherwise, it's nullptr unless the tag is absolute return (tag[0] == ':') ? subdevice(tag) : nullptr; } diff --git a/src/emu/diexec.h b/src/emu/diexec.h index 4fd379b5dae..240fd950043 100644 --- a/src/emu/diexec.h +++ b/src/emu/diexec.h @@ -89,21 +89,21 @@ enum #define MCFG_DEVICE_DISABLE() \ device_execute_interface::static_set_disable(*device); #define MCFG_DEVICE_VBLANK_INT_DRIVER(_tag, _class, _func) \ - device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0), _tag); + device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr), _tag); #define MCFG_DEVICE_VBLANK_INT_DEVICE(_tag, _devtag, _class, _func) \ - device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)0), _tag); + device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)nullptr), _tag); #define MCFG_DEVICE_VBLANK_INT_REMOVE() \ - device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(), NULL); + device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(), nullptr); #define MCFG_DEVICE_PERIODIC_INT_DRIVER(_class, _func, _rate) \ - device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0), attotime::from_hz(_rate)); + device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr), attotime::from_hz(_rate)); #define MCFG_DEVICE_PERIODIC_INT_DEVICE(_devtag, _class, _func, _rate) \ - device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)0), attotime::from_hz(_rate)); + device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)nullptr), attotime::from_hz(_rate)); #define MCFG_DEVICE_PERIODIC_INT_REMOVE() \ device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(), attotime()); #define MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(_class, _func) \ - device_execute_interface::static_set_irq_acknowledge_callback(*device, device_irq_acknowledge_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0)); + device_execute_interface::static_set_irq_acknowledge_callback(*device, device_irq_acknowledge_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr)); #define MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE(_devtag, _class, _func) \ - device_execute_interface::static_set_irq_acknowledge_callback(*device, device_irq_acknowledge_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)0)); + device_execute_interface::static_set_irq_acknowledge_callback(*device, device_irq_acknowledge_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)nullptr)); #define MCFG_DEVICE_IRQ_ACKNOWLEDGE_REMOVE() \ device_execute_interface::static_set_irq_acknowledge_callback(*device, device_irq_acknowledge_delegate()); diff --git a/src/emu/digfx.h b/src/emu/digfx.h index ec13147e966..510656dc253 100644 --- a/src/emu/digfx.h +++ b/src/emu/digfx.h @@ -178,7 +178,7 @@ struct gfx_decode_entry { const char * memory_region; // memory region where the data resides UINT32 start; // offset of beginning of data to decode - const gfx_layout *gfxlayout; // pointer to gfx_layout describing the layout; NULL marks the end of the array + const gfx_layout *gfxlayout; // pointer to gfx_layout describing the layout; nullptr marks the end of the array UINT16 color_codes_start; // offset in the color lookup table where color codes start UINT16 total_color_codes; // total number of color codes UINT32 flags; // flags and optional scaling factors diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index 67d7bbf06f5..c1e1e6de409 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -372,7 +372,7 @@ UINT8 *device_image_interface::get_software_region(const char *tag) sprintf( full_tag, "%s:%s", device().tag(), tag ); memory_region *region = device().machine().root_device().memregion(full_tag); - return region != NULL ? region->base() : NULL; + return region != nullptr ? region->base() : nullptr; } @@ -387,7 +387,7 @@ UINT32 device_image_interface::get_software_region_length(const char *tag) sprintf( full_tag, "%s:%s", device().tag(), tag ); memory_region *region = device().machine().root_device().memregion(full_tag); - return region != NULL ? region->bytes() : 0; + return region != nullptr ? region->bytes() : 0; } @@ -1178,8 +1178,8 @@ void device_image_interface::update_names(const device_type device_type, const c // strings. // // str1:str2:str3 => swlist_name - str1, swname - str2, swpart - str3 -// str1:str2 => swlist_name - NULL, swname - str1, swpart - str2 -// str1 => swlist_name - NULL, swname - str1, swpart - NULL +// str1:str2 => swlist_name - nullptr, swname - str1, swpart - str2 +// str1 => swlist_name - nullptr, swname - str1, swpart - nullptr // // Notice however that we could also have been // passed a string swlist_name:swname, and thus diff --git a/src/emu/diimage.h b/src/emu/diimage.h index 08001c8da89..10b4144e27f 100644 --- a/src/emu/diimage.h +++ b/src/emu/diimage.h @@ -165,24 +165,24 @@ public: virtual const char *file_extensions() const = 0; virtual const option_guide *create_option_guide() const = 0; - const image_device_format *device_get_indexed_creatable_format(int index) { return m_formatlist.find(index); } + const image_device_format *device_get_indexed_creatable_format(int index) const { return m_formatlist.find(index); } const image_device_format *device_get_named_creatable_format(const char *format_name); - const option_guide *device_get_creation_option_guide() { return create_option_guide(); } + const option_guide *device_get_creation_option_guide() const { return create_option_guide(); } const char *error(); void seterror(image_error_t err, const char *message); void message(const char *format, ...) ATTR_PRINTF(2,3); bool exists() { return !m_image_name.empty(); } - const char *filename() { if (m_image_name.empty()) return nullptr; else return m_image_name.c_str(); } - const char *basename() { if (m_basename.empty()) return nullptr; else return m_basename.c_str(); } - const char *basename_noext() { if (m_basename_noext.empty()) return nullptr; else return m_basename_noext.c_str(); } - const char *filetype() { if (m_filetype.empty()) return nullptr; else return m_filetype.c_str(); } + const char *filename() const { if (m_image_name.empty()) return nullptr; else return m_image_name.c_str(); } + const char *basename() const { if (m_basename.empty()) return nullptr; else return m_basename.c_str(); } + const char *basename_noext() const { if (m_basename_noext.empty()) return nullptr; else return m_basename_noext.c_str(); } + const char *filetype() const { if (m_filetype.empty()) return nullptr; else return m_filetype.c_str(); } bool is_open() const { return bool(m_file); } - util::core_file &image_core_file() { return *m_file; } + util::core_file &image_core_file() const { return *m_file; } UINT64 length() { check_for_file(); return m_file->size(); } - bool is_readonly() { return m_readonly; } - bool has_been_created() { return m_created; } + bool is_readonly() const { return m_readonly; } + bool has_been_created() const { return m_created; } void make_readonly() { m_readonly = true; } UINT32 fread(void *buffer, UINT32 length) { check_for_file(); return m_file->read(buffer, length); } UINT32 fread(optional_shared_ptr<UINT8> &ptr, UINT32 length) { ptr.allocate(length); return fread(ptr.target(), length); } @@ -197,14 +197,14 @@ public: // configuration access void set_init_phase() { m_init_phase = TRUE; } - const char* longname() { return m_longname.c_str(); } - const char* manufacturer() { return m_manufacturer.c_str(); } - const char* year() { return m_year.c_str(); } - UINT32 supported() { return m_supported; } + const char* longname() const { return m_longname.c_str(); } + const char* manufacturer() const { return m_manufacturer.c_str(); } + const char* year() const { return m_year.c_str(); } + UINT32 supported() const { return m_supported; } - const software_info *software_entry() { return m_software_info_ptr; } - const software_part *part_entry() { return m_software_part_ptr; } - const char *software_list_name() { return m_software_list_name.c_str(); } + const software_info *software_entry() const { return m_software_info_ptr; } + const software_part *part_entry() const { return m_software_part_ptr; } + const char *software_list_name() const { return m_software_list_name.c_str(); } void set_working_directory(const char *working_directory) { m_working_directory = working_directory; } const char * working_directory(); @@ -258,7 +258,7 @@ protected: void clear_error(); - void check_for_file() { assert_always(m_file, "Illegal operation on unmounted image"); } + void check_for_file() const { assert_always(m_file, "Illegal operation on unmounted image"); } void setup_working_directory(); bool try_change_working_directory(const char *subdir); diff --git a/src/emu/dimemory.h b/src/emu/dimemory.h index 941a8c87729..6bd85ff5e5e 100644 --- a/src/emu/dimemory.h +++ b/src/emu/dimemory.h @@ -47,7 +47,7 @@ const int TRANSLATE_FETCH_DEBUG = (TRANSLATE_FETCH | TRANSLATE_DEBUG_MASK); device_memory_interface::static_set_addrmap(*device, _space, ADDRESS_MAP_NAME(_map)); #define MCFG_DEVICE_REMOVE_ADDRESS_MAP(_space) \ - device_memory_interface::static_set_addrmap(*device, _space, NULL); + device_memory_interface::static_set_addrmap(*device, _space, nullptr); #define MCFG_DEVICE_PROGRAM_MAP(_map) \ MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _map) diff --git a/src/emu/dinetwork.h b/src/emu/dinetwork.h index f4383f67834..dd78dbcea15 100644 --- a/src/emu/dinetwork.h +++ b/src/emu/dinetwork.h @@ -15,9 +15,9 @@ public: void set_promisc(bool promisc); void set_mac(const char *mac); - const char *get_mac() { return m_mac; } - bool get_promisc() { return m_promisc; } - int get_interface() { return m_intf; } + const char *get_mac() const { return m_mac; } + bool get_promisc() const { return m_promisc; } + int get_interface() const { return m_intf; } int send(UINT8 *buf, int len) const; virtual void recv_cb(UINT8 *buf, int len); diff --git a/src/emu/diserial.h b/src/emu/diserial.h index 185c6849a4d..dbb9c3b8c55 100644 --- a/src/emu/diserial.h +++ b/src/emu/diserial.h @@ -109,12 +109,12 @@ protected: bool is_receive_register_full(); bool is_transmit_register_empty(); - bool is_receive_register_synchronized() { return m_rcv_flags & RECEIVE_REGISTER_SYNCHRONISED; } - bool is_receive_register_shifting() { return m_rcv_bit_count_received > 0; } - bool is_receive_framing_error() { return m_rcv_framing_error; } - bool is_receive_parity_error() { return m_rcv_parity_error; } + bool is_receive_register_synchronized() const { return m_rcv_flags & RECEIVE_REGISTER_SYNCHRONISED; } + bool is_receive_register_shifting() const { return m_rcv_bit_count_received > 0; } + bool is_receive_framing_error() const { return m_rcv_framing_error; } + bool is_receive_parity_error() const { return m_rcv_parity_error; } - UINT8 get_received_char() { return m_rcv_byte_received; } + UINT8 get_received_char() const { return m_rcv_byte_received; } virtual void tra_callback() { } virtual void rcv_callback() { receive_register_update_bit(m_rcv_line); } diff --git a/src/emu/dispatch.h b/src/emu/dispatch.h index f9442a658da..fae34197100 100644 --- a/src/emu/dispatch.h +++ b/src/emu/dispatch.h @@ -23,10 +23,17 @@ #define MCFG_LINE_DISPATCH_FWD_CB(_entry, _count, _devcb) \ devcb = &devcb_line_dispatch_device<_count>::set_fwd_cb(*device, _entry, DEVCB_##_devcb); +extern const device_type DEVCB_LINE_DISPATCH_2; +extern const device_type DEVCB_LINE_DISPATCH_3; +extern const device_type DEVCB_LINE_DISPATCH_4; +extern const device_type DEVCB_LINE_DISPATCH_5; +extern const device_type DEVCB_LINE_DISPATCH_6; + template<int N> class devcb_line_dispatch_device : public device_t { public: - devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, DEVCB_LINE_DISPATCH_2, "DEVCB_LINE_DISPATCH_2", tag, owner, clock, "devcb_line_dispatch_2", __FILE__) { } + void init_fwd() { for(auto & elem : fwd_cb) elem = new devcb_write_line(*this); @@ -54,10 +61,4 @@ private: devcb_write_line *fwd_cb[N]; }; -extern const device_type DEVCB_LINE_DISPATCH_2; -extern const device_type DEVCB_LINE_DISPATCH_3; -extern const device_type DEVCB_LINE_DISPATCH_4; -extern const device_type DEVCB_LINE_DISPATCH_5; -extern const device_type DEVCB_LINE_DISPATCH_6; - #endif diff --git a/src/emu/distate.cpp b/src/emu/distate.cpp index 3fa2fd8e03b..daa8942e3ee 100644 --- a/src/emu/distate.cpp +++ b/src/emu/distate.cpp @@ -111,7 +111,7 @@ device_state_entry &device_state_entry::formatstr(const char *_format) m_format.assign(_format); m_default_format = false; - // set the DSF_CUSTOM_STRING flag by formatting with a NULL string + // set the DSF_CUSTOM_STRING flag by formatting with a nullptr string m_flags &= ~DSF_CUSTOM_STRING; format(nullptr); @@ -417,7 +417,7 @@ device_state_interface::~device_state_interface() UINT64 device_state_interface::state_int(int index) { - // NULL or out-of-range entry returns 0 + // nullptr or out-of-range entry returns 0 const device_state_entry *entry = state_find_entry(index); if (entry == nullptr) return 0; @@ -438,7 +438,7 @@ UINT64 device_state_interface::state_int(int index) std::string device_state_interface::state_string(int index) const { - // NULL or out-of-range entry returns bogus string + // nullptr or out-of-range entry returns bogus string const device_state_entry *entry = state_find_entry(index); if (entry == nullptr) return std::string("???"); @@ -460,7 +460,7 @@ std::string device_state_interface::state_string(int index) const int device_state_interface::state_string_max_length(int index) { - // NULL or out-of-range entry returns bogus string + // nullptr or out-of-range entry returns bogus string const device_state_entry *entry = state_find_entry(index); if (entry == nullptr) return 3; @@ -477,7 +477,7 @@ int device_state_interface::state_string_max_length(int index) void device_state_interface::set_state_int(int index, UINT64 value) { - // NULL or out-of-range entry is a no-op + // nullptr or out-of-range entry is a no-op const device_state_entry *entry = state_find_entry(index); if (entry == nullptr) return; @@ -498,7 +498,7 @@ void device_state_interface::set_state_int(int index, UINT64 value) void device_state_interface::set_state_string(int index, const char *string) { - // NULL or out-of-range entry is a no-op + // nullptr or out-of-range entry is a no-op const device_state_entry *entry = state_find_entry(index); if (entry == nullptr) return; @@ -625,6 +625,6 @@ const device_state_entry *device_state_interface::state_find_entry(int index) co if (entry->m_index == index) return entry; - // handle failure by returning NULL + // handle failure by returning nullptr return nullptr; } diff --git a/src/emu/drawgfxm.h b/src/emu/drawgfxm.h index 4a310ca4839..7e4e803c6c9 100644 --- a/src/emu/drawgfxm.h +++ b/src/emu/drawgfxm.h @@ -59,7 +59,7 @@ extern bitmap_ind8 drawgfx_dummy_priority_bitmap; /* macros for using the optional priority */ #define PRIORITY_VALID(x) (sizeof(x) != sizeof(NO_PRIORITY)) -#define PRIORITY_ADDR(p,t,y,x) (PRIORITY_VALID(t) ? (&(p).pixt<t>(y, x)) : NULL) +#define PRIORITY_ADDR(p,t,y,x) (PRIORITY_VALID(t) ? (&(p).pixt<t>(y, x)) : nullptr) #define PRIORITY_ADVANCE(t,p,i) do { if (PRIORITY_VALID(t)) (p) += (i); } while (0) @@ -1173,7 +1173,7 @@ do { assert(destx + length <= bitmap.width()); \ assert(desty >= 0); \ assert(desty < bitmap.height()); \ - assert(srcptr != NULL); \ + assert(srcptr != nullptr); \ assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \ \ { \ @@ -1228,7 +1228,7 @@ do { assert(srcx + length <= bitmap.width()); \ assert(srcy >= 0); \ assert(srcy < bitmap.height()); \ - assert(destptr != NULL); \ + assert(destptr != nullptr); \ \ { \ const PIXEL_TYPE *srcptr = &bitmap.pixt<PIXEL_TYPE>(srcy, srcx); \ diff --git a/src/emu/drivenum.h b/src/emu/drivenum.h index e4f646d77f7..cc3bad554bf 100644 --- a/src/emu/drivenum.h +++ b/src/emu/drivenum.h @@ -91,9 +91,9 @@ public: // current item const game_driver &driver() const { return driver_list::driver(m_current); } machine_config &config() const { return config(m_current, m_options); } - int clone() { return driver_list::clone(m_current); } - int non_bios_clone() { return driver_list::non_bios_clone(m_current); } - int compatible_with() { return driver_list::compatible_with(m_current); } + int clone() const { return driver_list::clone(m_current); } + int non_bios_clone() const { return driver_list::non_bios_clone(m_current); } + int compatible_with() const { return driver_list::compatible_with(m_current); } void include() { include(m_current); } void exclude() { exclude(m_current); } diff --git a/src/emu/emucore.h b/src/emu/emucore.h index ae631cecd79..c8c95c1af48 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -209,7 +209,7 @@ inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); } // this macro wraps a function 'x' and can be used to pass a function followed by its name #define FUNC(x) &x, #x -#define FUNC_NULL NULL, "(null)" +#define FUNC_NULL nullptr, "(null)" // standard assertion macros diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index fb406709669..649be6d8138 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -1050,7 +1050,7 @@ public: accessors.write_qword_masked = reinterpret_cast<void (*)(address_space &, offs_t, UINT64, UINT64)>(&write_qword_masked_static); } - // return a pointer to the read bank, or NULL if none + // return a pointer to the read bank, or nullptr if none virtual void *get_read_ptr(offs_t byteaddress) override { // perform the lookup @@ -1064,7 +1064,7 @@ public: return handler.ramptr(handler.byteoffset(byteaddress)); } - // return a pointer to the write bank, or NULL if none + // return a pointer to the write bank, or nullptr if none virtual void *get_write_ptr(offs_t byteaddress) override { // perform the lookup @@ -4005,9 +4005,9 @@ void memory_bank::invalidate_references() void memory_bank::set_base(void *base) { - // NULL is not an option + // nullptr is not an option if (base == nullptr) - throw emu_fatalerror("memory_bank::set_base called NULL base"); + throw emu_fatalerror("memory_bank::set_base called nullptr base"); // set the base and invalidate any referencing spaces *m_baseptr = reinterpret_cast<UINT8 *>(base); diff --git a/src/emu/emumem.h b/src/emu/emumem.h index 9348058f650..ac17925370d 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -878,7 +878,7 @@ private: //------------------------------------------------- // read_ptr - return a pointer to valid RAM -// referenced by the address, or NULL if no RAM +// referenced by the address, or nullptr if no RAM // backing that address //------------------------------------------------- diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 9cf84a3a6eb..e7a7d74db2b 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -228,7 +228,7 @@ emu_options::emu_options() //------------------------------------------------- // system - return a pointer to the specified -// system driver, or NULL if no match +// system driver, or nullptr if no match //------------------------------------------------- const game_driver *emu_options::system() const diff --git a/src/emu/fileio.h b/src/emu/fileio.h index e71934ea22a..5e765f660d8 100644 --- a/src/emu/fileio.h +++ b/src/emu/fileio.h @@ -92,7 +92,7 @@ public: const char *fullpath() const { return m_fullpath.c_str(); } UINT32 openflags() const { return m_openflags; } hash_collection &hashes(const char *types); - bool restrict_to_mediapath() { return m_restrict_to_mediapath; } + bool restrict_to_mediapath() const { return m_restrict_to_mediapath; } bool part_of_mediapath(std::string path); // setters diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h index cd083738ecc..605abe0b024 100644 --- a/src/emu/inpttype.h +++ b/src/emu/inpttype.h @@ -31,7 +31,7 @@ /* split up into small functions to be nicer on optimizers */ -void construct_core_types_P1(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P1(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, JOYSTICK_UP, "P1 Up", input_seq(KEYCODE_UP, input_seq::or_code, JOYCODE_Y_UP_SWITCH_INDEXED(0)) ) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, JOYSTICK_DOWN, "P1 Down", input_seq(KEYCODE_DOWN, input_seq::or_code, JOYCODE_Y_DOWN_SWITCH_INDEXED(0)) ) @@ -65,7 +65,7 @@ void construct_core_types_P1(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SELECT, "P1 Select", input_seq(KEYCODE_5, input_seq::or_code, JOYCODE_SELECT_INDEXED(0)) ) } -void construct_core_types_P1_mahjong(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P1_mahjong(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, MAHJONG_A, "P1 Mahjong A", input_seq(KEYCODE_A) ) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, MAHJONG_B, "P1 Mahjong B", input_seq(KEYCODE_B) ) @@ -98,7 +98,7 @@ void construct_core_types_P1_mahjong(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, MAHJONG_SMALL, "P1 Mahjong Small", input_seq(KEYCODE_BACKSPACE) ) } -void construct_core_types_P1_hanafuda(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P1_hanafuda(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, HANAFUDA_A, "P1 Hanafuda A/1", input_seq(KEYCODE_A) ) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, HANAFUDA_B, "P1 Hanafuda B/2", input_seq(KEYCODE_B) ) @@ -112,7 +112,7 @@ void construct_core_types_P1_hanafuda(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, HANAFUDA_NO, "P1 Hanafuda No", input_seq(KEYCODE_N) ) } -void construct_core_types_gamble(simple_list<input_type_entry> &typelist) +inline void construct_core_types_gamble(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, GAMBLE_HIGH, "High", input_seq(KEYCODE_A) ) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, GAMBLE_LOW, "Low", input_seq(KEYCODE_S) ) @@ -130,7 +130,7 @@ void construct_core_types_gamble(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, GAMBLE_BOOK, "Book-Keeping", input_seq(KEYCODE_0) ) } -void construct_core_types_poker(simple_list<input_type_entry> &typelist) +inline void construct_core_types_poker(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, POKER_HOLD1, "Hold 1", input_seq(KEYCODE_Z) ) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, POKER_HOLD2, "Hold 2", input_seq(KEYCODE_X) ) @@ -141,7 +141,7 @@ void construct_core_types_poker(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, POKER_BET, "Bet", input_seq(KEYCODE_1) ) } -void construct_core_types_slot(simple_list<input_type_entry> &typelist) +inline void construct_core_types_slot(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP1, "Stop Reel 1", input_seq(KEYCODE_X) ) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP2, "Stop Reel 2", input_seq(KEYCODE_C) ) @@ -150,7 +150,7 @@ void construct_core_types_slot(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 1, PLAYER1, SLOT_STOP_ALL, "Stop All Reels", input_seq(KEYCODE_Z) ) } -void construct_core_types_P2(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P2(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, JOYSTICK_UP, "P2 Up", input_seq(KEYCODE_R, input_seq::or_code, JOYCODE_Y_UP_SWITCH_INDEXED(1)) ) INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, JOYSTICK_DOWN, "P2 Down", input_seq(KEYCODE_F, input_seq::or_code, JOYCODE_Y_DOWN_SWITCH_INDEXED(1)) ) @@ -184,7 +184,7 @@ void construct_core_types_P2(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, SELECT, "P2 Select", input_seq(KEYCODE_6, input_seq::or_code, JOYCODE_SELECT_INDEXED(1)) ) } -void construct_core_types_P2_mahjong(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P2_mahjong(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, MAHJONG_A, "P2 Mahjong A", input_seq() ) INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, MAHJONG_B, "P2 Mahjong B", input_seq() ) @@ -217,7 +217,7 @@ void construct_core_types_P2_mahjong(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, MAHJONG_SMALL, "P2 Mahjong Small", input_seq() ) } -void construct_core_types_P2_hanafuda(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P2_hanafuda(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, HANAFUDA_A, "P2 Hanafuda A/1", input_seq() ) INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, HANAFUDA_B, "P2 Hanafuda B/2", input_seq() ) @@ -231,7 +231,7 @@ void construct_core_types_P2_hanafuda(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 2, PLAYER2, HANAFUDA_NO, "P2 Hanafuda No", input_seq() ) } -void construct_core_types_P3(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P3(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 3, PLAYER3, JOYSTICK_UP, "P3 Up", input_seq(KEYCODE_I, input_seq::or_code, JOYCODE_Y_UP_SWITCH_INDEXED(2)) ) INPUT_PORT_DIGITAL_TYPE( 3, PLAYER3, JOYSTICK_DOWN, "P3 Down", input_seq(KEYCODE_K, input_seq::or_code, JOYCODE_Y_DOWN_SWITCH_INDEXED(2)) ) @@ -265,7 +265,7 @@ void construct_core_types_P3(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 3, PLAYER3, SELECT, "P3 Select", input_seq(KEYCODE_7, input_seq::or_code, JOYCODE_SELECT_INDEXED(2)) ) } -void construct_core_types_P4(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P4(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 4, PLAYER4, JOYSTICK_UP, "P4 Up", input_seq(KEYCODE_8_PAD, input_seq::or_code, JOYCODE_Y_UP_SWITCH_INDEXED(3)) ) INPUT_PORT_DIGITAL_TYPE( 4, PLAYER4, JOYSTICK_DOWN, "P4 Down", input_seq(KEYCODE_2_PAD, input_seq::or_code, JOYCODE_Y_DOWN_SWITCH_INDEXED(3)) ) @@ -299,7 +299,7 @@ void construct_core_types_P4(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 4, PLAYER4, SELECT, "P4 Select", input_seq(KEYCODE_8, input_seq::or_code, JOYCODE_SELECT_INDEXED(3)) ) } -void construct_core_types_P5(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P5(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 5, PLAYER5, JOYSTICK_UP, "P5 Up", input_seq(JOYCODE_Y_UP_SWITCH_INDEXED(4)) ) INPUT_PORT_DIGITAL_TYPE( 5, PLAYER5, JOYSTICK_DOWN, "P5 Down", input_seq(JOYCODE_Y_DOWN_SWITCH_INDEXED(4)) ) @@ -333,7 +333,7 @@ void construct_core_types_P5(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 5, PLAYER5, SELECT, "P5 Select", input_seq() ) } -void construct_core_types_P6(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P6(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 6, PLAYER6, JOYSTICK_UP, "P6 Up", input_seq(JOYCODE_Y_UP_SWITCH_INDEXED(5)) ) INPUT_PORT_DIGITAL_TYPE( 6, PLAYER6, JOYSTICK_DOWN, "P6 Down", input_seq(JOYCODE_Y_DOWN_SWITCH_INDEXED(5)) ) @@ -367,7 +367,7 @@ void construct_core_types_P6(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 6, PLAYER6, SELECT, "P6 Select", input_seq() ) } -void construct_core_types_P7(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P7(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 7, PLAYER7, JOYSTICK_UP, "P7 Up", input_seq(JOYCODE_Y_UP_SWITCH_INDEXED(6)) ) INPUT_PORT_DIGITAL_TYPE( 7, PLAYER7, JOYSTICK_DOWN, "P7 Down", input_seq(JOYCODE_Y_DOWN_SWITCH_INDEXED(6)) ) @@ -401,7 +401,7 @@ void construct_core_types_P7(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 7, PLAYER7, SELECT, "P7 Select", input_seq() ) } -void construct_core_types_P8(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P8(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 8, PLAYER8, JOYSTICK_UP, "P8 Up", input_seq(JOYCODE_Y_UP_SWITCH_INDEXED(7)) ) INPUT_PORT_DIGITAL_TYPE( 8, PLAYER8, JOYSTICK_DOWN, "P8 Down", input_seq(JOYCODE_Y_DOWN_SWITCH_INDEXED(7)) ) @@ -435,7 +435,75 @@ void construct_core_types_P8(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 8, PLAYER8, SELECT, "P8 Select", input_seq() ) } -void construct_core_types_start(simple_list<input_type_entry> &typelist) +inline void construct_core_types_P9(simple_list<input_type_entry> &typelist) +{ + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICK_UP, "P9 Up", input_seq(JOYCODE_Y_UP_SWITCH_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICK_DOWN, "P9 Down", input_seq(JOYCODE_Y_DOWN_SWITCH_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICK_LEFT, "P9 Left", input_seq(JOYCODE_X_LEFT_SWITCH_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICK_RIGHT, "P9 Right", input_seq(JOYCODE_X_RIGHT_SWITCH_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKRIGHT_UP, "P9 Right/Up", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKRIGHT_DOWN, "P9 Right/Down", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKRIGHT_LEFT, "P9 Right/Left", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKRIGHT_RIGHT, "P9 Right/Right", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKLEFT_UP, "P9 Left/Up", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKLEFT_DOWN, "P9 Left/Down", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKLEFT_LEFT, "P9 Left/Left", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, JOYSTICKLEFT_RIGHT, "P9 Left/Right", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON1, "P9 Button 1", input_seq(JOYCODE_BUTTON1_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON2, "P9 Button 2", input_seq(JOYCODE_BUTTON2_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON3, "P9 Button 3", input_seq(JOYCODE_BUTTON3_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON4, "P9 Button 4", input_seq(JOYCODE_BUTTON4_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON5, "P9 Button 5", input_seq(JOYCODE_BUTTON5_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON6, "P9 Button 6", input_seq(JOYCODE_BUTTON6_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON7, "P9 Button 7", input_seq(JOYCODE_BUTTON7_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON8, "P9 Button 8", input_seq(JOYCODE_BUTTON8_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON9, "P9 Button 9", input_seq(JOYCODE_BUTTON9_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON10, "P9 Button 10", input_seq(JOYCODE_BUTTON10_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON11, "P9 Button 11", input_seq(JOYCODE_BUTTON11_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON12, "P9 Button 12", input_seq(JOYCODE_BUTTON12_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON13, "P9 Button 13", input_seq(JOYCODE_BUTTON13_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON14, "P9 Button 14", input_seq(JOYCODE_BUTTON14_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON15, "P9 Button 15", input_seq(JOYCODE_BUTTON15_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, BUTTON16, "P9 Button 16", input_seq(JOYCODE_BUTTON16_INDEXED(8)) ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, START, "P9 Start", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 9, PLAYER9, SELECT, "P9 Select", input_seq() ) +} + +inline void construct_core_types_P10(simple_list<input_type_entry> &typelist) +{ + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICK_UP, "P10 Up", input_seq(JOYCODE_Y_UP_SWITCH_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICK_DOWN, "P10 Down", input_seq(JOYCODE_Y_DOWN_SWITCH_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICK_LEFT, "P10 Left", input_seq(JOYCODE_X_LEFT_SWITCH_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICK_RIGHT, "P10 Right", input_seq(JOYCODE_X_RIGHT_SWITCH_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKRIGHT_UP, "P10 Right/Up", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKRIGHT_DOWN, "P10 Right/Down", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKRIGHT_LEFT, "P10 Right/Left", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKRIGHT_RIGHT, "P10 Right/Right", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKLEFT_UP, "P10 Left/Up", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKLEFT_DOWN, "P10 Left/Down", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKLEFT_LEFT, "P10 Left/Left", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, JOYSTICKLEFT_RIGHT, "P10 Left/Right", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON1, "P10 Button 1", input_seq(JOYCODE_BUTTON1_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON2, "P10 Button 2", input_seq(JOYCODE_BUTTON2_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON3, "P10 Button 3", input_seq(JOYCODE_BUTTON3_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON4, "P10 Button 4", input_seq(JOYCODE_BUTTON4_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON5, "P10 Button 5", input_seq(JOYCODE_BUTTON5_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON6, "P10 Button 6", input_seq(JOYCODE_BUTTON6_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON7, "P10 Button 7", input_seq(JOYCODE_BUTTON7_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON8, "P10 Button 8", input_seq(JOYCODE_BUTTON8_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON9, "P10 Button 9", input_seq(JOYCODE_BUTTON9_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON10, "P10 Button 10", input_seq(JOYCODE_BUTTON10_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON11, "P10 Button 11", input_seq(JOYCODE_BUTTON11_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON12, "P10 Button 12", input_seq(JOYCODE_BUTTON12_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON13, "P10 Button 13", input_seq(JOYCODE_BUTTON13_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON14, "P10 Button 14", input_seq(JOYCODE_BUTTON14_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON15, "P10 Button 15", input_seq(JOYCODE_BUTTON15_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, BUTTON16, "P10 Button 16", input_seq(JOYCODE_BUTTON16_INDEXED(9)) ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, START, "P10 Start", input_seq() ) + INPUT_PORT_DIGITAL_TYPE( 10, PLAYER10, SELECT, "P10 Select", input_seq() ) +} + +inline void construct_core_types_start(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, OTHER, START1, "1 Player Start", input_seq(KEYCODE_1, input_seq::or_code, JOYCODE_START_INDEXED(0)) ) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, START2, "2 Players Start", input_seq(KEYCODE_2, input_seq::or_code, JOYCODE_START_INDEXED(1)) ) @@ -447,7 +515,7 @@ void construct_core_types_start(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, START8, "8 Players Start", input_seq() ) } -void construct_core_types_coin(simple_list<input_type_entry> &typelist) +inline void construct_core_types_coin(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN1, "Coin 1", input_seq(KEYCODE_5, input_seq::or_code, JOYCODE_SELECT_INDEXED(0)) ) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, COIN2, "Coin 2", input_seq(KEYCODE_6, input_seq::or_code, JOYCODE_SELECT_INDEXED(1)) ) @@ -464,7 +532,7 @@ void construct_core_types_coin(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, BILL1, "Bill 1", input_seq(KEYCODE_BACKSPACE) ) } -void construct_core_types_service(simple_list<input_type_entry> &typelist) +inline void construct_core_types_service(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, OTHER, SERVICE1, "Service 1", input_seq(KEYCODE_9) ) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, SERVICE2, "Service 2", input_seq(KEYCODE_0) ) @@ -472,7 +540,7 @@ void construct_core_types_service(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, SERVICE4, "Service 4", input_seq(KEYCODE_EQUALS) ) } -void construct_core_types_tilt(simple_list<input_type_entry> &typelist) +inline void construct_core_types_tilt(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, OTHER, TILT1, "Tilt 1", input_seq(KEYCODE_T) ) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, TILT2, "Tilt 2", input_seq() ) @@ -480,7 +548,7 @@ void construct_core_types_tilt(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, TILT4, "Tilt 4", input_seq() ) } -void construct_core_types_other(simple_list<input_type_entry> &typelist) +inline void construct_core_types_other(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, OTHER, POWER_ON, "Power On", input_seq(KEYCODE_F1) ) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, POWER_OFF, "Power Off", input_seq(KEYCODE_F2) ) @@ -491,7 +559,7 @@ void construct_core_types_other(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, VOLUME_UP, "Volume Up", input_seq(KEYCODE_EQUALS) ) } -void construct_core_types_pedal(simple_list<input_type_entry> &typelist) +inline void construct_core_types_pedal(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, PEDAL, "P1 Pedal 1", input_seq(JOYCODE_Z_NEG_ABSOLUTE_INDEXED(0)), input_seq(), input_seq(KEYCODE_LCONTROL, input_seq::or_code, JOYCODE_BUTTON1_INDEXED(0)) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, PEDAL, "P2 Pedal 1", input_seq(JOYCODE_Z_NEG_ABSOLUTE_INDEXED(1)), input_seq(), input_seq(KEYCODE_A, input_seq::or_code, JOYCODE_BUTTON1_INDEXED(1)) ) @@ -501,9 +569,11 @@ void construct_core_types_pedal(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, PEDAL, "P6 Pedal 1", input_seq(JOYCODE_Z_NEG_ABSOLUTE_INDEXED(5)), input_seq(), input_seq(JOYCODE_BUTTON1_INDEXED(5)) ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, PEDAL, "P7 Pedal 1", input_seq(JOYCODE_Z_NEG_ABSOLUTE_INDEXED(6)), input_seq(), input_seq(JOYCODE_BUTTON1_INDEXED(6)) ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, PEDAL, "P8 Pedal 1", input_seq(JOYCODE_Z_NEG_ABSOLUTE_INDEXED(7)), input_seq(), input_seq(JOYCODE_BUTTON1_INDEXED(7)) ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, PEDAL, "P9 Pedal 1", input_seq(JOYCODE_Z_NEG_ABSOLUTE_INDEXED(8)), input_seq(), input_seq(JOYCODE_BUTTON1_INDEXED(8)) ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, PEDAL, "P10 Pedal 1", input_seq(JOYCODE_Z_NEG_ABSOLUTE_INDEXED(9)), input_seq(), input_seq(JOYCODE_BUTTON1_INDEXED(9)) ) } -void construct_core_types_pedal2(simple_list<input_type_entry> &typelist) +inline void construct_core_types_pedal2(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, PEDAL2, "P1 Pedal 2", input_seq(JOYCODE_Z_POS_ABSOLUTE_INDEXED(0)), input_seq(), input_seq(KEYCODE_LALT, input_seq::or_code, JOYCODE_BUTTON2_INDEXED(0)) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, PEDAL2, "P2 Pedal 2", input_seq(JOYCODE_Z_POS_ABSOLUTE_INDEXED(1)), input_seq(), input_seq(KEYCODE_S, input_seq::or_code, JOYCODE_BUTTON2_INDEXED(1)) ) @@ -513,9 +583,11 @@ void construct_core_types_pedal2(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, PEDAL2, "P6 Pedal 2", input_seq(JOYCODE_Z_POS_ABSOLUTE_INDEXED(5)), input_seq(), input_seq(JOYCODE_BUTTON2_INDEXED(5)) ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, PEDAL2, "P7 Pedal 2", input_seq(JOYCODE_Z_POS_ABSOLUTE_INDEXED(6)), input_seq(), input_seq(JOYCODE_BUTTON2_INDEXED(6)) ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, PEDAL2, "P8 Pedal 2", input_seq(JOYCODE_Z_POS_ABSOLUTE_INDEXED(7)), input_seq(), input_seq(JOYCODE_BUTTON2_INDEXED(7)) ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, PEDAL2, "P9 Pedal 2", input_seq(JOYCODE_Z_POS_ABSOLUTE_INDEXED(8)), input_seq(), input_seq(JOYCODE_BUTTON2_INDEXED(8)) ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, PEDAL2, "P10 Pedal 2", input_seq(JOYCODE_Z_POS_ABSOLUTE_INDEXED(9)), input_seq(), input_seq(JOYCODE_BUTTON2_INDEXED(9)) ) } -void construct_core_types_pedal3(simple_list<input_type_entry> &typelist) +inline void construct_core_types_pedal3(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, PEDAL3, "P1 Pedal 3", input_seq(), input_seq(), input_seq(KEYCODE_SPACE, input_seq::or_code, JOYCODE_BUTTON3_INDEXED(0)) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, PEDAL3, "P2 Pedal 3", input_seq(), input_seq(), input_seq(KEYCODE_Q, input_seq::or_code, JOYCODE_BUTTON3_INDEXED(1)) ) @@ -525,9 +597,11 @@ void construct_core_types_pedal3(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, PEDAL3, "P6 Pedal 3", input_seq(), input_seq(), input_seq(JOYCODE_BUTTON3_INDEXED(5)) ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, PEDAL3, "P7 Pedal 3", input_seq(), input_seq(), input_seq(JOYCODE_BUTTON3_INDEXED(6)) ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, PEDAL3, "P8 Pedal 3", input_seq(), input_seq(), input_seq(JOYCODE_BUTTON3_INDEXED(7)) ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, PEDAL3, "P9 Pedal 3", input_seq(), input_seq(), input_seq(JOYCODE_BUTTON3_INDEXED(8)) ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, PEDAL3, "P10 Pedal 3", input_seq(), input_seq(), input_seq(JOYCODE_BUTTON3_INDEXED(9)) ) } -void construct_core_types_paddle(simple_list<input_type_entry> &typelist) +inline void construct_core_types_paddle(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, PADDLE, "Paddle", input_seq(JOYCODE_X_INDEXED(0), input_seq::or_code, MOUSECODE_X_INDEXED(0)), input_seq(KEYCODE_LEFT), input_seq(KEYCODE_RIGHT) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, PADDLE, "Paddle 2", input_seq(JOYCODE_X_INDEXED(1), input_seq::or_code, MOUSECODE_X_INDEXED(1)), input_seq(KEYCODE_D), input_seq(KEYCODE_G) ) @@ -537,9 +611,11 @@ void construct_core_types_paddle(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, PADDLE, "Paddle 6", input_seq(JOYCODE_X_INDEXED(5), input_seq::or_code, MOUSECODE_X_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, PADDLE, "Paddle 7", input_seq(JOYCODE_X_INDEXED(6), input_seq::or_code, MOUSECODE_X_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, PADDLE, "Paddle 8", input_seq(JOYCODE_X_INDEXED(7), input_seq::or_code, MOUSECODE_X_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, PADDLE, "Paddle 9", input_seq(JOYCODE_X_INDEXED(8), input_seq::or_code, MOUSECODE_X_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, PADDLE, "Paddle 10", input_seq(JOYCODE_X_INDEXED(9), input_seq::or_code, MOUSECODE_X_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_paddle_v(simple_list<input_type_entry> &typelist) +inline void construct_core_types_paddle_v(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, PADDLE_V, "Paddle V", input_seq(JOYCODE_Y_INDEXED(0), input_seq::or_code, MOUSECODE_Y_INDEXED(0)), input_seq(KEYCODE_UP), input_seq(KEYCODE_DOWN) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, PADDLE_V, "Paddle V 2", input_seq(JOYCODE_Y_INDEXED(1), input_seq::or_code, MOUSECODE_Y_INDEXED(1)), input_seq(KEYCODE_R), input_seq(KEYCODE_F) ) @@ -549,9 +625,11 @@ void construct_core_types_paddle_v(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, PADDLE_V, "Paddle V 6", input_seq(JOYCODE_Y_INDEXED(5), input_seq::or_code, MOUSECODE_Y_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, PADDLE_V, "Paddle V 7", input_seq(JOYCODE_Y_INDEXED(6), input_seq::or_code, MOUSECODE_Y_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, PADDLE_V, "Paddle V 8", input_seq(JOYCODE_Y_INDEXED(7), input_seq::or_code, MOUSECODE_Y_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, PADDLE_V, "Paddle V 9", input_seq(JOYCODE_Y_INDEXED(8), input_seq::or_code, MOUSECODE_Y_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, PADDLE_V, "Paddle V 10", input_seq(JOYCODE_Y_INDEXED(9), input_seq::or_code, MOUSECODE_Y_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_positional(simple_list<input_type_entry> &typelist) +inline void construct_core_types_positional(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, POSITIONAL, "Positional", input_seq(MOUSECODE_X_INDEXED(0), input_seq::or_code, JOYCODE_X_INDEXED(0)), input_seq(KEYCODE_LEFT), input_seq(KEYCODE_RIGHT) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, POSITIONAL, "Positional 2", input_seq(MOUSECODE_X_INDEXED(1), input_seq::or_code, JOYCODE_X_INDEXED(1)), input_seq(KEYCODE_D), input_seq(KEYCODE_G) ) @@ -561,9 +639,11 @@ void construct_core_types_positional(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, POSITIONAL, "Positional 6", input_seq(MOUSECODE_X_INDEXED(5), input_seq::or_code, JOYCODE_X_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, POSITIONAL, "Positional 7", input_seq(MOUSECODE_X_INDEXED(6), input_seq::or_code, JOYCODE_X_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, POSITIONAL, "Positional 8", input_seq(MOUSECODE_X_INDEXED(7), input_seq::or_code, JOYCODE_X_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, POSITIONAL, "Positional 9", input_seq(MOUSECODE_X_INDEXED(8), input_seq::or_code, JOYCODE_X_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, POSITIONAL, "Positional 10", input_seq(MOUSECODE_X_INDEXED(9), input_seq::or_code, JOYCODE_X_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_positional_v(simple_list<input_type_entry> &typelist) +inline void construct_core_types_positional_v(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, POSITIONAL_V, "Positional V", input_seq(MOUSECODE_Y_INDEXED(0), input_seq::or_code, JOYCODE_Y_INDEXED(0)), input_seq(KEYCODE_UP), input_seq(KEYCODE_DOWN) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, POSITIONAL_V, "Positional V 2", input_seq(MOUSECODE_Y_INDEXED(1), input_seq::or_code, JOYCODE_Y_INDEXED(1)), input_seq(KEYCODE_R), input_seq(KEYCODE_F) ) @@ -573,9 +653,11 @@ void construct_core_types_positional_v(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, POSITIONAL_V, "Positional V 6", input_seq(MOUSECODE_Y_INDEXED(5), input_seq::or_code, JOYCODE_Y_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, POSITIONAL_V, "Positional V 7", input_seq(MOUSECODE_Y_INDEXED(6), input_seq::or_code, JOYCODE_Y_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, POSITIONAL_V, "Positional V 8", input_seq(MOUSECODE_Y_INDEXED(7), input_seq::or_code, JOYCODE_Y_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, POSITIONAL_V, "Positional V 9", input_seq(MOUSECODE_Y_INDEXED(8), input_seq::or_code, JOYCODE_Y_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, POSITIONAL_V, "Positional V 10", input_seq(MOUSECODE_Y_INDEXED(9), input_seq::or_code, JOYCODE_Y_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_dial(simple_list<input_type_entry> &typelist) +inline void construct_core_types_dial(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, DIAL, "Dial", input_seq(MOUSECODE_X_INDEXED(0), input_seq::or_code, JOYCODE_X_INDEXED(0)), input_seq(KEYCODE_LEFT), input_seq(KEYCODE_RIGHT) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, DIAL, "Dial 2", input_seq(MOUSECODE_X_INDEXED(1), input_seq::or_code, JOYCODE_X_INDEXED(1)), input_seq(KEYCODE_D), input_seq(KEYCODE_G) ) @@ -585,9 +667,11 @@ void construct_core_types_dial(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, DIAL, "Dial 6", input_seq(MOUSECODE_X_INDEXED(5), input_seq::or_code, JOYCODE_X_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, DIAL, "Dial 7", input_seq(MOUSECODE_X_INDEXED(6), input_seq::or_code, JOYCODE_X_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, DIAL, "Dial 8", input_seq(MOUSECODE_X_INDEXED(7), input_seq::or_code, JOYCODE_X_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, DIAL, "Dial 9", input_seq(MOUSECODE_X_INDEXED(8), input_seq::or_code, JOYCODE_X_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, DIAL, "Dial 10", input_seq(MOUSECODE_X_INDEXED(9), input_seq::or_code, JOYCODE_X_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_dial_v(simple_list<input_type_entry> &typelist) +inline void construct_core_types_dial_v(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, DIAL_V, "Dial V", input_seq(MOUSECODE_Y_INDEXED(0), input_seq::or_code, JOYCODE_Y_INDEXED(0)), input_seq(KEYCODE_UP), input_seq(KEYCODE_DOWN) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, DIAL_V, "Dial V 2", input_seq(MOUSECODE_Y_INDEXED(1), input_seq::or_code, JOYCODE_Y_INDEXED(1)), input_seq(KEYCODE_R), input_seq(KEYCODE_F) ) @@ -597,9 +681,11 @@ void construct_core_types_dial_v(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, DIAL_V, "Dial V 6", input_seq(MOUSECODE_Y_INDEXED(5), input_seq::or_code, JOYCODE_Y_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, DIAL_V, "Dial V 7", input_seq(MOUSECODE_Y_INDEXED(6), input_seq::or_code, JOYCODE_Y_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, DIAL_V, "Dial V 8", input_seq(MOUSECODE_Y_INDEXED(7), input_seq::or_code, JOYCODE_Y_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, DIAL_V, "Dial V 9", input_seq(MOUSECODE_Y_INDEXED(8), input_seq::or_code, JOYCODE_Y_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, DIAL_V, "Dial V 10", input_seq(MOUSECODE_Y_INDEXED(9), input_seq::or_code, JOYCODE_Y_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_trackball_X(simple_list<input_type_entry> &typelist) +inline void construct_core_types_trackball_X(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, TRACKBALL_X, "Track X", input_seq(MOUSECODE_X_INDEXED(0), input_seq::or_code, JOYCODE_X_INDEXED(0)), input_seq(KEYCODE_LEFT), input_seq(KEYCODE_RIGHT) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, TRACKBALL_X, "Track X 2", input_seq(MOUSECODE_X_INDEXED(1), input_seq::or_code, JOYCODE_X_INDEXED(1)), input_seq(KEYCODE_D), input_seq(KEYCODE_G) ) @@ -609,9 +695,11 @@ void construct_core_types_trackball_X(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, TRACKBALL_X, "Track X 6", input_seq(MOUSECODE_X_INDEXED(5), input_seq::or_code, JOYCODE_X_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, TRACKBALL_X, "Track X 7", input_seq(MOUSECODE_X_INDEXED(6), input_seq::or_code, JOYCODE_X_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, TRACKBALL_X, "Track X 8", input_seq(MOUSECODE_X_INDEXED(7), input_seq::or_code, JOYCODE_X_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, TRACKBALL_X, "Track X 9", input_seq(MOUSECODE_X_INDEXED(8), input_seq::or_code, JOYCODE_X_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, TRACKBALL_X, "Track X 10", input_seq(MOUSECODE_X_INDEXED(9), input_seq::or_code, JOYCODE_X_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_trackball_Y(simple_list<input_type_entry> &typelist) +inline void construct_core_types_trackball_Y(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, TRACKBALL_Y, "Track Y", input_seq(MOUSECODE_Y_INDEXED(0), input_seq::or_code, JOYCODE_Y_INDEXED(0)), input_seq(KEYCODE_UP), input_seq(KEYCODE_DOWN) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, TRACKBALL_Y, "Track Y 2", input_seq(MOUSECODE_Y_INDEXED(1), input_seq::or_code, JOYCODE_Y_INDEXED(1)), input_seq(KEYCODE_R), input_seq(KEYCODE_F) ) @@ -621,9 +709,11 @@ void construct_core_types_trackball_Y(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, TRACKBALL_Y, "Track Y 6", input_seq(MOUSECODE_Y_INDEXED(5), input_seq::or_code, JOYCODE_Y_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, TRACKBALL_Y, "Track Y 7", input_seq(MOUSECODE_Y_INDEXED(6), input_seq::or_code, JOYCODE_Y_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, TRACKBALL_Y, "Track Y 8", input_seq(MOUSECODE_Y_INDEXED(7), input_seq::or_code, JOYCODE_Y_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, TRACKBALL_Y, "Track Y 9", input_seq(MOUSECODE_Y_INDEXED(8), input_seq::or_code, JOYCODE_Y_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, TRACKBALL_Y, "Track Y 10", input_seq(MOUSECODE_Y_INDEXED(9), input_seq::or_code, JOYCODE_Y_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_AD_stick_X(simple_list<input_type_entry> &typelist) +inline void construct_core_types_AD_stick_X(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, AD_STICK_X, "AD Stick X", input_seq(JOYCODE_X_INDEXED(0), input_seq::or_code, MOUSECODE_X_INDEXED(0)), input_seq(KEYCODE_LEFT), input_seq(KEYCODE_RIGHT) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, AD_STICK_X, "AD Stick X 2", input_seq(JOYCODE_X_INDEXED(1), input_seq::or_code, MOUSECODE_X_INDEXED(1)), input_seq(KEYCODE_D), input_seq(KEYCODE_G) ) @@ -633,9 +723,11 @@ void construct_core_types_AD_stick_X(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, AD_STICK_X, "AD Stick X 6", input_seq(JOYCODE_X_INDEXED(5), input_seq::or_code, MOUSECODE_X_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, AD_STICK_X, "AD Stick X 7", input_seq(JOYCODE_X_INDEXED(6), input_seq::or_code, MOUSECODE_X_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, AD_STICK_X, "AD Stick X 8", input_seq(JOYCODE_X_INDEXED(7), input_seq::or_code, MOUSECODE_X_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, AD_STICK_X, "AD Stick X 9", input_seq(JOYCODE_X_INDEXED(8), input_seq::or_code, MOUSECODE_X_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, AD_STICK_X, "AD Stick X 10", input_seq(JOYCODE_X_INDEXED(9), input_seq::or_code, MOUSECODE_X_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_AD_stick_Y(simple_list<input_type_entry> &typelist) +inline void construct_core_types_AD_stick_Y(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, AD_STICK_Y, "AD Stick Y", input_seq(JOYCODE_Y_INDEXED(0), input_seq::or_code, MOUSECODE_Y_INDEXED(0)), input_seq(KEYCODE_UP), input_seq(KEYCODE_DOWN) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, AD_STICK_Y, "AD Stick Y 2", input_seq(JOYCODE_Y_INDEXED(1), input_seq::or_code, MOUSECODE_Y_INDEXED(1)), input_seq(KEYCODE_R), input_seq(KEYCODE_F) ) @@ -645,9 +737,11 @@ void construct_core_types_AD_stick_Y(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, AD_STICK_Y, "AD Stick Y 6", input_seq(JOYCODE_Y_INDEXED(5), input_seq::or_code, MOUSECODE_Y_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, AD_STICK_Y, "AD Stick Y 7", input_seq(JOYCODE_Y_INDEXED(6), input_seq::or_code, MOUSECODE_Y_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, AD_STICK_Y, "AD Stick Y 8", input_seq(JOYCODE_Y_INDEXED(7), input_seq::or_code, MOUSECODE_Y_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, AD_STICK_Y, "AD Stick Y 9", input_seq(JOYCODE_Y_INDEXED(8), input_seq::or_code, MOUSECODE_Y_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, AD_STICK_Y, "AD Stick Y 10", input_seq(JOYCODE_Y_INDEXED(9), input_seq::or_code, MOUSECODE_Y_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_AD_stick_Z(simple_list<input_type_entry> &typelist) +inline void construct_core_types_AD_stick_Z(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, AD_STICK_Z, "AD Stick Z", input_seq(JOYCODE_Z_INDEXED(0)), input_seq(KEYCODE_A), input_seq(KEYCODE_Z) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, AD_STICK_Z, "AD Stick Z 2", input_seq(JOYCODE_Z_INDEXED(1)), input_seq(), input_seq() ) @@ -657,9 +751,11 @@ void construct_core_types_AD_stick_Z(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, AD_STICK_Z, "AD Stick Z 6", input_seq(JOYCODE_Z_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, AD_STICK_Z, "AD Stick Z 7", input_seq(JOYCODE_Z_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, AD_STICK_Z, "AD Stick Z 8", input_seq(JOYCODE_Z_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, AD_STICK_Z, "AD Stick Z 9", input_seq(JOYCODE_Z_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, AD_STICK_Z, "AD Stick Z 10", input_seq(JOYCODE_Z_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_lightgun_X(simple_list<input_type_entry> &typelist) +inline void construct_core_types_lightgun_X(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, LIGHTGUN_X, "Lightgun X", input_seq(GUNCODE_X_INDEXED(0), input_seq::or_code, MOUSECODE_X_INDEXED(0), input_seq::or_code, JOYCODE_X_INDEXED(0)), input_seq(KEYCODE_LEFT), input_seq(KEYCODE_RIGHT) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, LIGHTGUN_X, "Lightgun X 2", input_seq(GUNCODE_X_INDEXED(1), input_seq::or_code, MOUSECODE_X_INDEXED(1), input_seq::or_code, JOYCODE_X_INDEXED(1)), input_seq(KEYCODE_D), input_seq(KEYCODE_G) ) @@ -669,9 +765,11 @@ void construct_core_types_lightgun_X(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, LIGHTGUN_X, "Lightgun X 6", input_seq(GUNCODE_X_INDEXED(5), input_seq::or_code, MOUSECODE_X_INDEXED(5), input_seq::or_code, JOYCODE_X_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, LIGHTGUN_X, "Lightgun X 7", input_seq(GUNCODE_X_INDEXED(6), input_seq::or_code, MOUSECODE_X_INDEXED(6), input_seq::or_code, JOYCODE_X_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, LIGHTGUN_X, "Lightgun X 8", input_seq(GUNCODE_X_INDEXED(7), input_seq::or_code, MOUSECODE_X_INDEXED(7), input_seq::or_code, JOYCODE_X_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, LIGHTGUN_X, "Lightgun X 9", input_seq(GUNCODE_X_INDEXED(8), input_seq::or_code, MOUSECODE_X_INDEXED(8), input_seq::or_code, JOYCODE_X_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, LIGHTGUN_X, "Lightgun X 10", input_seq(GUNCODE_X_INDEXED(9), input_seq::or_code, MOUSECODE_X_INDEXED(9), input_seq::or_code, JOYCODE_X_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_lightgun_Y(simple_list<input_type_entry> &typelist) +inline void construct_core_types_lightgun_Y(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, LIGHTGUN_Y, "Lightgun Y", input_seq(GUNCODE_Y_INDEXED(0), input_seq::or_code, MOUSECODE_Y_INDEXED(0), input_seq::or_code, JOYCODE_Y_INDEXED(0)), input_seq(KEYCODE_UP), input_seq(KEYCODE_DOWN) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, LIGHTGUN_Y, "Lightgun Y 2", input_seq(GUNCODE_Y_INDEXED(1), input_seq::or_code, MOUSECODE_Y_INDEXED(1), input_seq::or_code, JOYCODE_Y_INDEXED(1)), input_seq(KEYCODE_R), input_seq(KEYCODE_F) ) @@ -681,9 +779,11 @@ void construct_core_types_lightgun_Y(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, LIGHTGUN_Y, "Lightgun Y 6", input_seq(GUNCODE_Y_INDEXED(5), input_seq::or_code, MOUSECODE_Y_INDEXED(5), input_seq::or_code, JOYCODE_Y_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, LIGHTGUN_Y, "Lightgun Y 7", input_seq(GUNCODE_Y_INDEXED(6), input_seq::or_code, MOUSECODE_Y_INDEXED(6), input_seq::or_code, JOYCODE_Y_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, LIGHTGUN_Y, "Lightgun Y 8", input_seq(GUNCODE_Y_INDEXED(7), input_seq::or_code, MOUSECODE_Y_INDEXED(7), input_seq::or_code, JOYCODE_Y_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, LIGHTGUN_Y, "Lightgun Y 9", input_seq(GUNCODE_Y_INDEXED(8), input_seq::or_code, MOUSECODE_Y_INDEXED(8), input_seq::or_code, JOYCODE_Y_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, LIGHTGUN_Y, "Lightgun Y 10", input_seq(GUNCODE_Y_INDEXED(9), input_seq::or_code, MOUSECODE_Y_INDEXED(9), input_seq::or_code, JOYCODE_Y_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_mouse_X(simple_list<input_type_entry> &typelist) +inline void construct_core_types_mouse_X(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, MOUSE_X, "Mouse X", input_seq(MOUSECODE_X_INDEXED(0)), input_seq(KEYCODE_LEFT), input_seq(KEYCODE_RIGHT) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, MOUSE_X, "Mouse X 2", input_seq(MOUSECODE_X_INDEXED(1)), input_seq(KEYCODE_D), input_seq(KEYCODE_G) ) @@ -693,9 +793,11 @@ void construct_core_types_mouse_X(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, MOUSE_X, "Mouse X 6", input_seq(MOUSECODE_X_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, MOUSE_X, "Mouse X 7", input_seq(MOUSECODE_X_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, MOUSE_X, "Mouse X 8", input_seq(MOUSECODE_X_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, MOUSE_X, "Mouse X 9", input_seq(MOUSECODE_X_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, MOUSE_X, "Mouse X 10", input_seq(MOUSECODE_X_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_mouse_Y(simple_list<input_type_entry> &typelist) +inline void construct_core_types_mouse_Y(simple_list<input_type_entry> &typelist) { INPUT_PORT_ANALOG_TYPE( 1, PLAYER1, MOUSE_Y, "Mouse Y", input_seq(MOUSECODE_Y_INDEXED(0)), input_seq(KEYCODE_UP), input_seq(KEYCODE_DOWN) ) INPUT_PORT_ANALOG_TYPE( 2, PLAYER2, MOUSE_Y, "Mouse Y 2", input_seq(MOUSECODE_Y_INDEXED(1)), input_seq(KEYCODE_R), input_seq(KEYCODE_F) ) @@ -705,15 +807,17 @@ void construct_core_types_mouse_Y(simple_list<input_type_entry> &typelist) INPUT_PORT_ANALOG_TYPE( 6, PLAYER6, MOUSE_Y, "Mouse Y 6", input_seq(MOUSECODE_Y_INDEXED(5)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 7, PLAYER7, MOUSE_Y, "Mouse Y 7", input_seq(MOUSECODE_Y_INDEXED(6)), input_seq(), input_seq() ) INPUT_PORT_ANALOG_TYPE( 8, PLAYER8, MOUSE_Y, "Mouse Y 8", input_seq(MOUSECODE_Y_INDEXED(7)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 9, PLAYER9, MOUSE_Y, "Mouse Y 9", input_seq(MOUSECODE_Y_INDEXED(8)), input_seq(), input_seq() ) + INPUT_PORT_ANALOG_TYPE( 10, PLAYER10, MOUSE_Y, "Mouse Y 10", input_seq(MOUSECODE_Y_INDEXED(9)), input_seq(), input_seq() ) } -void construct_core_types_keypad(simple_list<input_type_entry> &typelist) +inline void construct_core_types_keypad(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, OTHER, KEYPAD, "Keypad", input_seq() ) INPUT_PORT_DIGITAL_TYPE( 0, OTHER, KEYBOARD, "Keyboard", input_seq() ) } -void construct_core_types_UI(simple_list<input_type_entry> &typelist) +inline void construct_core_types_UI(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_ON_SCREEN_DISPLAY,"On Screen Display", input_seq(KEYCODE_TILDE) ) INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_DEBUG_BREAK, "Break in Debugger", input_seq(KEYCODE_TILDE) ) @@ -771,7 +875,7 @@ void construct_core_types_UI(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_AUDIT_ALL, "UI Audit All", input_seq(KEYCODE_F1, KEYCODE_LSHIFT) ) } -void construct_core_types_OSD(simple_list<input_type_entry> &typelist) +inline void construct_core_types_OSD(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, UI, OSD_1, nullptr, input_seq() ) INPUT_PORT_DIGITAL_TYPE( 0, UI, OSD_2, nullptr, input_seq() ) @@ -791,7 +895,7 @@ void construct_core_types_OSD(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, UI, OSD_16, nullptr, input_seq() ) } -void construct_core_types_invalid(simple_list<input_type_entry> &typelist) +inline void construct_core_types_invalid(simple_list<input_type_entry> &typelist) { INPUT_PORT_DIGITAL_TYPE( 0, INVALID, UNKNOWN, nullptr, input_seq() ) INPUT_PORT_DIGITAL_TYPE( 0, INVALID, UNUSED, nullptr, input_seq() ) @@ -802,7 +906,7 @@ void construct_core_types_invalid(simple_list<input_type_entry> &typelist) INPUT_PORT_DIGITAL_TYPE( 0, INVALID, CONFIG, nullptr, input_seq() ) } -void construct_core_types(simple_list<input_type_entry> &typelist) +inline void construct_core_types(simple_list<input_type_entry> &typelist) { construct_core_types_P1(typelist); construct_core_types_P1_mahjong(typelist); @@ -819,6 +923,8 @@ void construct_core_types(simple_list<input_type_entry> &typelist) construct_core_types_P6(typelist); construct_core_types_P7(typelist); construct_core_types_P8(typelist); + construct_core_types_P9(typelist); + construct_core_types_P10(typelist); construct_core_types_start(typelist); construct_core_types_coin(typelist); construct_core_types_service(typelist); diff --git a/src/emu/input.cpp b/src/emu/input.cpp index 68e825402b4..360810a3b6c 100644 --- a/src/emu/input.cpp +++ b/src/emu/input.cpp @@ -1184,7 +1184,7 @@ void input_manager::reset_polling() for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass) for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) { - // fetch the device; ignore if NULL + // fetch the device; ignore if nullptr input_device *device = m_class[devclass]->device(devnum); if (device == nullptr) continue; @@ -1211,7 +1211,7 @@ input_code input_manager::poll_switches() for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass) for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) { - // fetch the device; ignore if NULL + // fetch the device; ignore if nullptr input_device *device = m_class[devclass]->device(devnum); if (device == nullptr) continue; @@ -1291,7 +1291,7 @@ input_code input_manager::poll_keyboard_switches() // iterate over devices within each class for (int devnum = 0; devnum < m_keyboard_class.maxindex(); devnum++) { - // fetch the device; ignore if NULL + // fetch the device; ignore if nullptr input_device *device = m_keyboard_class.device(devnum); if (device == nullptr) continue; @@ -1365,7 +1365,7 @@ input_code input_manager::poll_axes() for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass) for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) { - // fetch the device; ignore if NULL + // fetch the device; ignore if nullptr input_device *device = m_class[devclass]->device(devnum); if (device == nullptr) continue; @@ -1400,7 +1400,7 @@ input_device *input_manager::device_from_code(input_code code) const if (devclass >= DEVICE_CLASS_FIRST_VALID && devclass <= DEVICE_CLASS_LAST_VALID) return m_class[devclass]->device(code.device_index()); - // otherwise, return NULL + // otherwise, return nullptr return nullptr; } diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index c7c40b139f2..5a68a76a0ae 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -3315,7 +3315,7 @@ void ioport_manager::save_game_inputs(xml_data_node *parentnode) template<typename _Type> _Type ioport_manager::playback_read(_Type &result) { - // protect against NULL handles if previous reads fail + // protect against nullptr handles if previous reads fail if (!m_playback_file.is_open()) result = 0; @@ -3480,7 +3480,7 @@ void ioport_manager::playback_port(ioport_port &port) template<typename _Type> void ioport_manager::record_write(_Type value) { - // protect against NULL handles if previous reads fail + // protect against nullptr handles if previous reads fail if (!m_record_file.is_open()) return; @@ -3499,7 +3499,7 @@ void ioport_manager::record_write<bool>(bool value) template<typename _Type> void ioport_manager::timecode_write(_Type value) { - // protect against NULL handles if previous reads fail + // protect against nullptr handles if previous reads fail if (!m_timecode_file.is_open()) return; diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 5155005569b..3f6a0185337 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -34,7 +34,7 @@ const ioport_value IP_ACTIVE_HIGH = 0x00000000; const ioport_value IP_ACTIVE_LOW = 0xffffffff; // maximum number of players supported -const int MAX_PLAYERS = 8; +const int MAX_PLAYERS = 10; // unicode constants const unicode_char UCHAR_PRIVATE = 0x100000; @@ -78,6 +78,8 @@ enum ioport_group IPG_PLAYER6, IPG_PLAYER7, IPG_PLAYER8, + IPG_PLAYER9, + IPG_PLAYER10, IPG_OTHER, IPG_TOTAL_GROUPS, IPG_INVALID @@ -105,6 +107,8 @@ enum ioport_type IPT_START6, IPT_START7, IPT_START8, + IPT_START9, + IPT_START10, // coin slots IPT_COIN1, @@ -1191,7 +1195,7 @@ private: // internal state ioport_field * m_next; // pointer to next field in sequence ioport_port & m_port; // reference to the port that owns us - std::unique_ptr<ioport_field_live> m_live; // live state of field (NULL if not live) + std::unique_ptr<ioport_field_live> m_live; // live state of field (nullptr if not live) int m_modcount; // modification count simple_list<ioport_setting> m_settinglist; // list of input_setting_configs simple_list<ioport_diplocation> m_diploclist; // list of locations for various bits @@ -1317,7 +1321,7 @@ private: std::string m_tag; // copy of this port's tag int m_modcount; // modification count ioport_value m_active; // mask of active bits in the port - std::unique_ptr<ioport_port_live> m_live; // live state of port (NULL if not live) + std::unique_ptr<ioport_port_live> m_live; // live state of port (nullptr if not live) }; inline ioport_value read_safe(ioport_port *port, ioport_value defval) { return (port == nullptr) ? defval : port->read(); } @@ -1539,7 +1543,7 @@ private: template<typename _Type> void timecode_write(_Type value); void timecode_init(); - void timecode_end(const char *message = NULL); + void timecode_end(const char *message = nullptr); // internal state running_machine & m_machine; // reference to owning machine @@ -1559,11 +1563,11 @@ private: attoseconds_t m_last_delta_nsec; // nanoseconds that passed since the previous callback // playback/record information - emu_file m_record_file; // recording file (NULL if not recording) - emu_file m_playback_file; // playback file (NULL if not recording) + emu_file m_record_file; // recording file (nullptr if not recording) + emu_file m_playback_file; // playback file (nullptr if not recording) UINT64 m_playback_accumulated_speed; // accumulated speed during playback UINT32 m_playback_accumulated_frames; // accumulated frames during playback - emu_file m_timecode_file; // timecode/frames playback file (NULL if not recording) + emu_file m_timecode_file; // timecode/frames playback file (nullptr if not recording) int m_timecode_count; attotime m_timecode_last_time; @@ -1671,7 +1675,7 @@ private: //************************************************************************** // so that "0" can be used for unneeded input ports -#define construct_ioport_0 NULL +#define construct_ioport_0 nullptr // name of table #define INPUT_PORTS_NAME(_name) construct_ioport_##_name @@ -1702,7 +1706,7 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s #define PORT_BIT(_mask, _default, _type) \ configurer.field_alloc((_type), (_default), (_mask)); #define PORT_SPECIAL_ONOFF(_mask, _default, _strindex) \ - PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, NULL) + PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, nullptr) #define PORT_SPECIAL_ONOFF_DIPLOC(_mask, _default, _strindex, _diploc) \ configurer.onoff_alloc(DEF_STR(_strindex), _default, _mask, _diploc); @@ -1775,10 +1779,10 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s configurer.field_set_crosshair(CROSSHAIR_AXIS_##axis, altaxis, scale, offset); #define PORT_CROSSHAIR_MAPPER(_callback) \ - configurer.field_set_crossmapper(ioport_field_crossmap_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)NULL)); + configurer.field_set_crossmapper(ioport_field_crossmap_delegate(_callback, #_callback, DEVICE_SELF, (device_t *)nullptr)); #define PORT_CROSSHAIR_MAPPER_MEMBER(_device, _class, _member) \ - configurer.field_set_crossmapper(ioport_field_crossmap_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL)); + configurer.field_set_crossmapper(ioport_field_crossmap_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)nullptr)); // how many optical counts for 1 full turn of the control #define PORT_FULL_TURN_COUNT(_count) \ @@ -1805,19 +1809,19 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s // read callbacks #define PORT_CUSTOM_MEMBER(_device, _class, _member, _param) \ - configurer.field_set_dynamic_read(ioport_field_read_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL), (void *)(_param)); + configurer.field_set_dynamic_read(ioport_field_read_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)nullptr), (void *)(_param)); // write callbacks #define PORT_CHANGED_MEMBER(_device, _class, _member, _param) \ - configurer.field_set_dynamic_write(ioport_field_write_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)NULL), (void *)(_param)); + configurer.field_set_dynamic_write(ioport_field_write_delegate(&_class::_member, #_class "::" #_member, _device, (_class *)nullptr), (void *)(_param)); // input device handler #define PORT_READ_LINE_DEVICE_MEMBER(_device, _class, _member) \ - configurer.field_set_dynamic_read(ioport_field_read_delegate([](_class &device, ioport_field &field, void *param)->ioport_value { return (device._member() & 1) ? ~ioport_value(0) : 0; } , #_class "::" #_member, _device, (_class *)NULL)); + configurer.field_set_dynamic_read(ioport_field_read_delegate([](_class &device, ioport_field &field, void *param)->ioport_value { return (device._member() & 1) ? ~ioport_value(0) : 0; } , #_class "::" #_member, _device, (_class *)nullptr)); // output device handler #define PORT_WRITE_LINE_DEVICE_MEMBER(_device, _class, _member) \ - configurer.field_set_dynamic_write(ioport_field_write_delegate([](_class &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval) { device._member(newval); }, #_class "::" #_member, _device, (_class *)NULL)); + configurer.field_set_dynamic_write(ioport_field_write_delegate([](_class &device, ioport_field &field, void *param, ioport_value oldval, ioport_value newval) { device._member(newval); }, #_class "::" #_member, _device, (_class *)nullptr)); // dip switch definition #define PORT_DIPNAME(_mask, _default, _name) \ @@ -1849,10 +1853,7 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s // name of table #define DEVICE_INPUT_DEFAULTS_NAME(_name) device_iptdef_##_name -#define device_iptdef_0 NULL -#define device_iptdef_0L NULL -#define device_iptdef_0LL NULL -#define device_iptdef___null NULL +#define device_iptdef_NOOP nullptr // start of table #define DEVICE_INPUT_DEFAULTS_START(_name) \ @@ -1862,7 +1863,7 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s { _tag ,_mask, _defval }, // end of table #define DEVICE_INPUT_DEFAULTS_END \ - {NULL,0,0} }; + {nullptr,0,0} }; diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index 27f6d0dd568..2555cda4c2e 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -257,7 +257,8 @@ void running_machine::start() m_render->resolve_tags(); - + manager().create_custom(*this); + // register callbacks for the devices, then start them add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(running_machine::reset_all_devices), this)); add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(running_machine::stop_all_devices), this)); diff --git a/src/emu/machine.h b/src/emu/machine.h index 02721c30718..9cdc893a2d2 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -244,7 +244,7 @@ public: private: // video-related information - screen_device * primary_screen; // the primary screen device, or NULL if screenless + screen_device * primary_screen; // the primary screen device, or nullptr if screenless public: // debugger-related information @@ -382,7 +382,7 @@ private: template <typename Format, typename... Params> inline void running_machine::popmessage(Format &&fmt, Params &&... args) const { - // if the format is NULL, it is a signal to clear the popmessage + // if the format is nullptr, it is a signal to clear the popmessage // otherwise, generate the buffer and call the UI to display the message if (is_null<Format>::value(fmt)) popup_clear(); diff --git a/src/emu/main.h b/src/emu/main.h index 0b0aa16121e..b8aaf3b838a 100644 --- a/src/emu/main.h +++ b/src/emu/main.h @@ -76,11 +76,12 @@ public: osd_interface &osd() const { return m_osd; } emu_options &options() const { return m_options; } - running_machine *machine() { return m_machine; } + running_machine *machine() const { return m_machine; } void set_machine(running_machine *machine) { m_machine = machine; } virtual ui_manager* create_ui(running_machine& machine) { return nullptr; } + virtual void create_custom(running_machine& machine) { } virtual void ui_initialize(running_machine& machine) { } virtual void update_machine() { } diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 582ea14d035..a2ae9638527 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -114,9 +114,9 @@ private: #define MACHINE_CONFIG_START(_name, _class) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ - devcb_base *devcb = NULL; \ + devcb_base *devcb = nullptr; \ (void)devcb; \ - if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); + if (owner == nullptr) owner = config.device_add(nullptr, "root", &driver_device_creator<_class>, 0); /** @def MACHINE_CONFIG_FRAGMENT(_name) @@ -127,9 +127,9 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t #define MACHINE_CONFIG_FRAGMENT(_name) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ - devcb_base *devcb = NULL; \ + devcb_base *devcb = nullptr; \ (void)devcb; \ - assert(owner != NULL); + assert(owner != nullptr); /** @def MACHINE_CONFIG_DERIVED(_name, _base) @@ -141,10 +141,10 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t #define MACHINE_CONFIG_DERIVED(_name, _base) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ - devcb_base *devcb = NULL; \ + devcb_base *devcb = nullptr; \ (void)devcb; \ owner = MACHINE_CONFIG_NAME(_base)(config, owner, device); \ - assert(owner != NULL); + assert(owner != nullptr); /** @def MACHINE_CONFIG_DERIVED_CLASS(_name, _base, _class) @@ -157,9 +157,9 @@ Begins a machine_config that is derived from another machine_config that can spe #define MACHINE_CONFIG_DERIVED_CLASS(_name, _base, _class) \ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner, device_t *device) \ { \ - devcb_base *devcb = NULL; \ + devcb_base *devcb = nullptr; \ (void)devcb; \ - if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); \ + if (owner == nullptr) owner = config.device_add(nullptr, "root", &driver_device_creator<_class>, 0); \ owner = MACHINE_CONFIG_NAME(_base)(config, owner, device); /** diff --git a/src/emu/output.cpp b/src/emu/output.cpp index 25d37dd4c43..b905c45d70b 100644 --- a/src/emu/output.cpp +++ b/src/emu/output.cpp @@ -183,7 +183,7 @@ INT32 output_manager::get_indexed_value(const char *basename, int index) /*------------------------------------------------- output_set_notifier - sets a notifier callback for a particular output, or for all outputs - if NULL is specified + if nullptr is specified -------------------------------------------------*/ void output_manager::set_notifier(const char *outname, output_notifier_func callback, void *param) diff --git a/src/emu/output.h b/src/emu/output.h index 77798c1eaf1..e83399aa4b1 100644 --- a/src/emu/output.h +++ b/src/emu/output.h @@ -68,10 +68,10 @@ public: // return the current value for a given indexed output INT32 get_indexed_value(const char *outname, int index); - // set a notifier on a particular output, or globally if NULL + // set a notifier on a particular output, or globally if nullptr void set_notifier(const char *outname, output_notifier_func callback, void *param); - // set a notifier on a particular output, or globally if NULL + // set a notifier on a particular output, or globally if nullptr void notify_all(output_notifier_func callback, void *param); // map a name to a unique ID diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 304e667b82f..22f23d3d263 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -546,7 +546,7 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container) case TEXFORMAT_ARGB32: case TEXFORMAT_YUY16: - // if no adjustment necessary, return NULL + // if no adjustment necessary, return nullptr if (!container.has_brightness_contrast_gamma_changes()) return nullptr; return container.bcg_lookup_table(m_format); @@ -2123,7 +2123,7 @@ bool render_target::map_point_internal(INT32 target_x, INT32 target_y, render_co //------------------------------------------------- // view_name - return the name of the indexed -// view, or NULL if it doesn't exist +// view, or nullptr if it doesn't exist //------------------------------------------------- layout_view *render_target::view_by_index(int index) const @@ -2770,7 +2770,7 @@ void render_manager::font_free(render_font *font) void render_manager::invalidate_all(void *refptr) { - // permit NULL + // permit nullptr if (refptr == nullptr) return; diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index e99bcc12088..70d87856378 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -32,7 +32,7 @@ inline const char *next_line(const char *ptr) // scan forward until we hit the end or a carriage return while (*ptr != 13 && *ptr != 10 && *ptr != 0) ptr++; - // if we hit the end, return NULL + // if we hit the end, return nullptr if (*ptr == 0) return nullptr; diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index ea2fc8b4bd5..5b945b09d04 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -647,7 +647,7 @@ layout_element::component::component(running_machine &machine, xml_data_node &co } m_stopnames[m_numstops++] = symbollist; - // careful, dirname is NULL if we're coming from internal layout, and our string assignment doesn't like that + // careful, dirname is nullptr if we're coming from internal layout, and our string assignment doesn't like that if (dirname != nullptr) m_dirname = dirname; diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp index a7f0d74d826..a03e25e91ed 100644 --- a/src/emu/romload.cpp +++ b/src/emu/romload.cpp @@ -661,7 +661,7 @@ int rom_load_manager::open_rom_file(const char *regiontag, const rom_entry *romp /*------------------------------------------------- rom_fread - cheesy fread that fills with - random data for a NULL file + random data for a nullptr file -------------------------------------------------*/ int rom_load_manager::rom_fread(UINT8 *buffer, int length, const rom_entry *parent_region) diff --git a/src/emu/romload.h b/src/emu/romload.h index 48190330409..f0553949d96 100644 --- a/src/emu/romload.h +++ b/src/emu/romload.h @@ -194,11 +194,11 @@ struct rom_entry /* ----- start/stop macros ----- */ #define ROM_NAME(name) rom_##name #define ROM_START(name) static const rom_entry ROM_NAME(name)[] = { -#define ROM_END { NULL, NULL, 0, 0, ROMENTRYTYPE_END } }; +#define ROM_END { nullptr, nullptr, 0, 0, ROMENTRYTYPE_END } }; /* ----- ROM region macros ----- */ -#define ROM_REGION(length,tag,flags) { tag, NULL, 0, length, ROMENTRYTYPE_REGION | (flags) }, +#define ROM_REGION(length,tag,flags) { tag, nullptr, 0, length, ROMENTRYTYPE_REGION | (flags) }, #define ROM_REGION16_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_16BIT | ROMREGION_LE) #define ROM_REGION16_BE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_16BIT | ROMREGION_BE) #define ROM_REGION32_LE(length,tag,flags) ROM_REGION(length, tag, (flags) | ROMREGION_32BIT | ROMREGION_LE) @@ -229,19 +229,19 @@ struct rom_entry /* ----- ROM_RELOAD related macros ----- */ -#define ROM_RELOAD(offset,length) { NULL, NULL, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS }, -#define ROM_RELOAD_PLAIN(offset,length) { NULL, NULL, offset, length, ROMENTRYTYPE_RELOAD }, +#define ROM_RELOAD(offset,length) { nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS }, +#define ROM_RELOAD_PLAIN(offset,length) { nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD }, /* ----- additional ROM-related macros ----- */ -#define ROM_CONTINUE(offset,length) { NULL, NULL, offset, length, ROMENTRYTYPE_CONTINUE | ROM_INHERITFLAGS }, -#define ROM_IGNORE(length) { NULL, NULL, 0, length, ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS }, -#define ROM_FILL(offset,length,value) { NULL, (const char *)value, offset, length, ROMENTRYTYPE_FILL }, +#define ROM_CONTINUE(offset,length) { nullptr, nullptr, offset, length, ROMENTRYTYPE_CONTINUE | ROM_INHERITFLAGS }, +#define ROM_IGNORE(length) { nullptr, nullptr, 0, length, ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS }, +#define ROM_FILL(offset,length,value) { nullptr, (const char *)value, offset, length, ROMENTRYTYPE_FILL }, #define ROM_COPY(srctag,srcoffs,offset,length) { srctag, (const char *)srcoffs, offset, length, ROMENTRYTYPE_COPY }, /* ----- system BIOS macros ----- */ #define ROM_SYSTEM_BIOS(value,name,description) { name, description, 0, 0, ROMENTRYTYPE_SYSTEM_BIOS | ROM_BIOS(value+1) }, -#define ROM_DEFAULT_BIOS(name) { name, NULL, 0, 0, ROMENTRYTYPE_DEFAULT_BIOS }, +#define ROM_DEFAULT_BIOS(name) { name, nullptr, 0, 0, ROMENTRYTYPE_DEFAULT_BIOS }, /* ----- game parameter macro ----- */ diff --git a/src/emu/save.h b/src/emu/save.h index b4c2c3c2186..fabbcba9071 100644 --- a/src/emu/save.h +++ b/src/emu/save.h @@ -74,7 +74,7 @@ public: state_entry * m_next; // pointer to next entry void * m_data; // pointer to the memory to save/restore std::string m_name; // full name - device_t * m_device; // associated device, NULL if none + device_t * m_device; // associated device, nullptr if none std::string m_module; // module name std::string m_tag; // tag name int m_index; // index diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index fa53767854d..8566e85f2b1 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -67,7 +67,7 @@ screen_device_svg_renderer::screen_device_svg_renderer(memory_region *region) delete[] s; m_rasterizer = nsvgCreateRasterizer(); - for (NSVGshape *shape = m_image->shapes; shape != NULL; shape = shape->next) + for (NSVGshape *shape = m_image->shapes; shape != nullptr; shape = shape->next) if(shape->title[0]) { shape->flags &= ~NSVG_FLAGS_VISIBLE; m_keyed_shapes[shape->title].push_back(shape); diff --git a/src/emu/screen.h b/src/emu/screen.h index cf55fcb0ec8..5650365032a 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -445,15 +445,15 @@ typedef device_type_iterator<&device_creator<screen_device>, screen_device> scre #define MCFG_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs) \ screen_device::static_set_default_position(*device, _xscale, _xoffs, _yscale, _yoffs); #define MCFG_SCREEN_UPDATE_DRIVER(_class, _method) \ - screen_device::static_set_screen_update(*device, screen_update_delegate_smart(&_class::_method, #_class "::" #_method, NULL)); + screen_device::static_set_screen_update(*device, screen_update_delegate_smart(&_class::_method, #_class "::" #_method, nullptr)); #define MCFG_SCREEN_UPDATE_DEVICE(_device, _class, _method) \ screen_device::static_set_screen_update(*device, screen_update_delegate_smart(&_class::_method, #_class "::" #_method, _device)); #define MCFG_SCREEN_VBLANK_NONE() \ screen_device::static_set_screen_vblank(*device, screen_vblank_delegate()); #define MCFG_SCREEN_VBLANK_DRIVER(_class, _method) \ - screen_device::static_set_screen_vblank(*device, screen_vblank_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0)); + screen_device::static_set_screen_vblank(*device, screen_vblank_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); #define MCFG_SCREEN_VBLANK_DEVICE(_device, _class, _method) \ - screen_device::static_set_screen_vblank(*device, screen_vblank_delegate(&_class::_method, #_class "::" #_method, _device, (_class *)0)); + screen_device::static_set_screen_vblank(*device, screen_vblank_delegate(&_class::_method, #_class "::" #_method, _device, (_class *)nullptr)); #define MCFG_SCREEN_PALETTE(_palette_tag) \ screen_device::static_set_palette(*device, "^" _palette_tag); #define MCFG_SCREEN_NO_PALETTE \ diff --git a/src/emu/softlist.cpp b/src/emu/softlist.cpp index 3d65dca7598..3b57a60c82c 100644 --- a/src/emu/softlist.cpp +++ b/src/emu/softlist.cpp @@ -142,7 +142,7 @@ const char *software_part::feature(const char *feature_name) const bool software_part::is_compatible(const software_list_device &swlistdev) const { - // get the compatibility feature and the softlist filter; if either is NULL, assume compatible + // get the compatibility feature and the softlist filter; if either is nullptr, assume compatible const char *compatibility = feature("compatibility"); const char *filter = swlistdev.filter(); if (compatibility == nullptr || filter == nullptr) @@ -447,7 +447,7 @@ void software_list_device::display_matches(const machine_config &config, const c software_info *software_list_device::find(const char *look_for, software_info *prev) { - // NULL search returns nothing + // nullptr search returns nothing if (look_for == nullptr) return nullptr; @@ -1139,8 +1139,6 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu add_rom_entry(nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD); else if (loadflag != nullptr && strcmp(loadflag, "continue") == 0) add_rom_entry(nullptr, nullptr, offset, length, ROMENTRYTYPE_CONTINUE | ROM_INHERITFLAGS); - else if (loadflag != nullptr && strcmp(loadflag, "ignore") == 0) - add_rom_entry(nullptr, nullptr, offset, length, ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS); else if (loadflag != nullptr && strcmp(loadflag, "fill") == 0) add_rom_entry(nullptr, (const char *)(FPTR)(strtol(value, nullptr, 0) & 0xff), offset, length, ROMENTRYTYPE_FILL); else if (name != nullptr) @@ -1181,6 +1179,11 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu else parse_error("Rom name missing"); } + else if (sizestr != nullptr && loadflag != nullptr && strcmp(loadflag, "ignore") == 0) + { + UINT32 length = strtol(sizestr, nullptr, 0); + add_rom_entry(nullptr, nullptr, 0, length, ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS); + } else parse_error("Incomplete rom definition"); } diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp index 69bde8821c0..48e288fa0c0 100644 --- a/src/emu/tilemap.cpp +++ b/src/emu/tilemap.cpp @@ -100,7 +100,7 @@ inline bool tilemap_t::gfx_elements_changed() //************************************************************************** //------------------------------------------------- -// scanline_draw_opaque_null - draw to a NULL +// scanline_draw_opaque_null - draw to a nullptr // bitmap, setting priority only //------------------------------------------------- @@ -117,7 +117,7 @@ inline void tilemap_t::scanline_draw_opaque_null(int count, UINT8 *pri, UINT32 p //------------------------------------------------- -// scanline_draw_masked_null - draw to a NULL +// scanline_draw_masked_null - draw to a nullptr // bitmap using a mask, setting priority only //------------------------------------------------- diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h index 6e4308d6052..48a2bcbd543 100644 --- a/src/emu/tilemap.h +++ b/src/emu/tilemap.h @@ -370,15 +370,15 @@ enum tilemap_standard_mapper #define MCFG_TILEMAP_BYTES_PER_ENTRY(_bpe) \ tilemap_device::static_set_bytes_per_entry(*device, _bpe); #define MCFG_TILEMAP_INFO_CB_DRIVER(_class, _method) \ - tilemap_device::static_set_info_callback(*device, tilemap_get_info_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0)); + tilemap_device::static_set_info_callback(*device, tilemap_get_info_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr)); #define MCFG_TILEMAP_INFO_CB_DEVICE(_device, _class, _method) \ - tilemap_device::static_set_info_callback(*device, tilemap_get_info_delegate(&_class::_method, #_class "::" #_method, _device, (_class *)0)); + tilemap_device::static_set_info_callback(*device, tilemap_get_info_delegate(&_class::_method, #_class "::" #_method, _device, (_class *)nullptr)); #define MCFG_TILEMAP_LAYOUT_STANDARD(_standard, _columns, _rows) \ tilemap_device::static_set_layout(*device, TILEMAP_##_standard, _columns, _rows); #define MCFG_TILEMAP_LAYOUT_CB_DRIVER(_class, _method, _columns, _rows) \ - tilemap_device::static_set_layout(*device, tilemap_mapper_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0), _columns, _rows); + tilemap_device::static_set_layout(*device, tilemap_mapper_delegate(&_class::_method, #_class "::" #_method, nullptr, (_class *)nullptr), _columns, _rows); #define MCFG_TILEMAP_LAYOUT_CB_DEVICE(_device, _class, _method, _columns, _rows) \ - tilemap_device::static_set_layout(*device, tilemap_mapper_delegate(&_class::_method, #_class "::" #_method, _device, (_class *)0), _columns, _rows); + tilemap_device::static_set_layout(*device, tilemap_mapper_delegate(&_class::_method, #_class "::" #_method, _device, (_class *)nullptr), _columns, _rows); #define MCFG_TILEMAP_TILE_SIZE(_width, _height) \ tilemap_device::static_set_tile_size(*device, _width, _height); #define MCFG_TILEMAP_TRANSPARENT_PEN(_pen) \ diff --git a/src/emu/timer.h b/src/emu/timer.h index 55db37c267b..ca8074f5b04 100644 --- a/src/emu/timer.h +++ b/src/emu/timer.h @@ -35,27 +35,27 @@ 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, NULL, (_class *)0)); + 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 *)0)); + 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, NULL, (_class *)0), _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 *)0), _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, NULL, (_class *)0), _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 *)0), _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, NULL, (_class *)0)); + 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) \ @@ -98,13 +98,13 @@ public: bool enabled() const { return m_timer->enabled(); } // property setters - void set_param(int param) { assert(m_type == TIMER_TYPE_GENERIC); m_timer->set_param(param); } + void set_param(int param) const { assert(m_type == TIMER_TYPE_GENERIC); m_timer->set_param(param); } void set_ptr(void *ptr) { m_ptr = ptr; } - void enable(bool enable = true) { m_timer->enable(enable); } + void enable(bool enable = true) const { m_timer->enable(enable); } // adjustments void reset() { adjust(attotime::never, 0, attotime::never); } - void adjust(const attotime &duration, INT32 param = 0, const attotime &period = attotime::never) { assert(m_type == TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); } + void adjust(const attotime &duration, INT32 param = 0, const attotime &period = attotime::never) const { assert(m_type == TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); } // timing information attotime time_elapsed() const { return m_timer->elapsed(); } diff --git a/src/emu/ui/cmddata.h b/src/emu/ui/cmddata.h index 31dd8c5ebd8..14c09c73883 100644 --- a/src/emu/ui/cmddata.h +++ b/src/emu/ui/cmddata.h @@ -396,7 +396,7 @@ static fix_strings_t convert_text[] = { "charge", 131 }, // Charge { "tap", 132 }, // Serious Tap { "button", 133 }, // Any Button - { 0, 0 } // end of array + { nullptr, 0 } // end of array }; #endif /* __UI_CMDDATA_H__ */ diff --git a/src/emu/ui/uimain.h b/src/emu/ui/uimain.h index c12107a6cc8..9230892adca 100644 --- a/src/emu/ui/uimain.h +++ b/src/emu/ui/uimain.h @@ -71,6 +71,8 @@ class ui_manager public: // construction/destruction ui_manager(running_machine &machine) : m_machine(machine),m_use_natural_keyboard(false),m_show_timecode_counter(false),m_show_timecode_total(false) { } + + virtual ~ui_manager() { } virtual void set_startup_text(const char *text, bool force) { } @@ -80,8 +82,8 @@ public: void set_show_timecode_counter(bool value) { m_show_timecode_counter = value; m_show_timecode_total = true; } - bool show_timecode_counter() { return m_show_timecode_counter; } - bool show_timecode_total() { return m_show_timecode_total; } + bool show_timecode_counter() const { return m_show_timecode_counter; } + bool show_timecode_total() const { return m_show_timecode_total; } virtual void popup_time_string(int seconds, std::string message) { } diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index 70070623e46..91f218b9470 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -599,7 +599,7 @@ void validity_checker::validate_roms() // check for a valid tag if (basetag == nullptr) { - osd_printf_error("ROM_REGION tag with NULL name\n"); + osd_printf_error("ROM_REGION tag with nullptr name\n"); continue; } @@ -874,7 +874,7 @@ void validity_checker::validate_inputs() { // dip switch fields must have a name if (field.name() == nullptr) - osd_printf_error("DIP switch has a NULL name\n"); + osd_printf_error("DIP switch has a nullptr name\n"); // verify the settings list validate_dip_settings(field); diff --git a/src/emu/video/rgbgen.h b/src/emu/video/rgbgen.h index 4ade036637a..12ec8f3d765 100644 --- a/src/emu/video/rgbgen.h +++ b/src/emu/video/rgbgen.h @@ -35,12 +35,12 @@ public: } inline void set(rgb_t& rgba) { set(rgba.a(), rgba.r(), rgba.g(), rgba.b()); } - inline rgb_t to_rgba() + inline rgb_t to_rgba() const { return rgb_t(m_a, m_r, m_g, m_b); } - inline rgb_t to_rgba_clamp() + inline rgb_t to_rgba_clamp() const { UINT8 a = (m_a < 0) ? 0 : (m_a > 255) ? 255 : m_a; UINT8 r = (m_r < 0) ? 0 : (m_r > 255) ? 255 : m_r; |