diff options
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/debug/debugcmd.cpp | 29 | ||||
-rw-r--r-- | src/emu/debug/debugcmd.h | 1 | ||||
-rw-r--r-- | src/emu/debug/debugcpu.cpp | 98 | ||||
-rw-r--r-- | src/emu/debug/debughlp.cpp | 16 | ||||
-rw-r--r-- | src/emu/debug/dvdisasm.cpp | 8 | ||||
-rw-r--r-- | src/emu/debug/dvmemory.cpp | 57 | ||||
-rw-r--r-- | src/emu/debug/dvmemory.h | 1 | ||||
-rw-r--r-- | src/emu/device.h | 1 | ||||
-rw-r--r-- | src/emu/diexec.cpp | 3 | ||||
-rw-r--r-- | src/emu/dirom.cpp | 20 | ||||
-rw-r--r-- | src/emu/dirom.h | 16 | ||||
-rw-r--r-- | src/emu/drivers/xtal.h | 6 | ||||
-rw-r--r-- | src/emu/emucore.h | 11 | ||||
-rw-r--r-- | src/emu/emumem.cpp | 86 | ||||
-rw-r--r-- | src/emu/emuopts.cpp | 2 | ||||
-rw-r--r-- | src/emu/emuopts.h | 4 | ||||
-rw-r--r-- | src/emu/http.cpp | 1 | ||||
-rw-r--r-- | src/emu/inpttype.h | 7 | ||||
-rw-r--r-- | src/emu/ioport.h | 1 | ||||
-rw-r--r-- | src/emu/machine.cpp | 39 | ||||
-rw-r--r-- | src/emu/machine.h | 5 | ||||
-rw-r--r-- | src/emu/save.cpp | 465 | ||||
-rw-r--r-- | src/emu/save.h | 68 | ||||
-rw-r--r-- | src/emu/softlist_dev.cpp | 10 | ||||
-rw-r--r-- | src/emu/softlist_dev.h | 8 | ||||
-rw-r--r-- | src/emu/validity.cpp | 4 |
26 files changed, 170 insertions, 797 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 1b48be30e1f..38bff17b8c4 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -206,9 +206,6 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu m_console.register_command("stateload", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_stateload, this, _1, _2)); m_console.register_command("sl", CMDFLAG_NONE, 0, 1, 1, std::bind(&debugger_commands::execute_stateload, this, _1, _2)); - m_console.register_command("rewind", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_rewind, this, _1, _2)); - m_console.register_command("rw", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_rewind, this, _1, _2)); - m_console.register_command("save", CMDFLAG_NONE, AS_PROGRAM, 3, 4, std::bind(&debugger_commands::execute_save, this, _1, _2)); m_console.register_command("saved", CMDFLAG_NONE, AS_DATA, 3, 4, std::bind(&debugger_commands::execute_save, this, _1, _2)); m_console.register_command("savei", CMDFLAG_NONE, AS_IO, 3, 4, std::bind(&debugger_commands::execute_save, this, _1, _2)); @@ -1630,7 +1627,7 @@ void debugger_commands::execute_stateload(int ref, const std::vector<std::string const std::string &filename(params[0]); m_machine.immediate_load(filename.c_str()); - // clear all PC & memory tracks + // Clear all PC & memory tracks for (device_t &device : device_iterator(m_machine.root_device())) { device.debug()->track_pc_data_clear(); @@ -1641,30 +1638,6 @@ void debugger_commands::execute_stateload(int ref, const std::vector<std::string /*------------------------------------------------- - execute_rewind - execute the rewind command --------------------------------------------------*/ - -void debugger_commands::execute_rewind(int ref, const std::vector<std::string> ¶ms) -{ - if (!m_machine.save().rewind()->enabled()) - { - m_console.printf("Rewind not enabled\n"); - return; - } - - m_machine.rewind_step(); - - // clear all PC & memory tracks - for (device_t &device : device_iterator(m_machine.root_device())) - { - device.debug()->track_pc_data_clear(); - device.debug()->track_mem_data_clear(); - } - m_console.printf("Rewind step attempted. Please refer to window message popup for results.\n"); -} - - -/*------------------------------------------------- execute_save - execute the save command -------------------------------------------------*/ diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h index 41405ec0a71..98b6d8ae03d 100644 --- a/src/emu/debug/debugcmd.h +++ b/src/emu/debug/debugcmd.h @@ -131,7 +131,6 @@ private: void execute_hotspot(int ref, const std::vector<std::string> ¶ms); void execute_statesave(int ref, const std::vector<std::string> ¶ms); void execute_stateload(int ref, const std::vector<std::string> ¶ms); - void execute_rewind(int ref, const std::vector<std::string> ¶ms); void execute_save(int ref, const std::vector<std::string> ¶ms); void execute_load(int ref, const std::vector<std::string> ¶ms); void execute_dump(int ref, const std::vector<std::string> ¶ms); diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 17c26191186..eab6f7771e7 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -389,20 +389,34 @@ u8 debugger_cpu::read_byte(address_space &space, offs_t address, bool apply_tran u16 debugger_cpu::read_word(address_space &space, offs_t address, bool apply_translation) { - device_memory_interface &memory = space.device().memory(); - /* mask against the logical byte mask */ address &= space.logaddrmask(); u16 result; - /* translate if necessary; if not mapped, return 0xffff */ - if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) - { - result = 0xffff; + if (!WORD_ALIGNED(address)) + { /* if this is misaligned read, or if there are no word readers, just read two bytes */ + u8 byte0 = read_byte(space, address + 0, apply_translation); + u8 byte1 = read_byte(space, address + 1, apply_translation); + + /* based on the endianness, the result is assembled differently */ + if (space.endianness() == ENDIANNESS_LITTLE) + result = byte0 | (byte1 << 8); + else + result = byte1 | (byte0 << 8); } else - { /* otherwise, call the byte reading function for the translated address */ - result = space.read_word_unaligned(address); + { /* otherwise, this proceeds like the byte case */ + device_memory_interface &memory = space.device().memory(); + + /* translate if necessary; if not mapped, return 0xffff */ + if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) + { + result = 0xffff; + } + else + { /* otherwise, call the byte reading function for the translated address */ + result = space.read_word(address); + } } return result; @@ -416,20 +430,33 @@ u16 debugger_cpu::read_word(address_space &space, offs_t address, bool apply_tra u32 debugger_cpu::read_dword(address_space &space, offs_t address, bool apply_translation) { - device_memory_interface &memory = space.device().memory(); - /* mask against the logical byte mask */ address &= space.logaddrmask(); u32 result; + if (!DWORD_ALIGNED(address)) + { /* if this is a misaligned read, or if there are no dword readers, just read two words */ + u16 word0 = read_word(space, address + 0, apply_translation); + u16 word1 = read_word(space, address + 2, apply_translation); - if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) - { /* translate if necessary; if not mapped, return 0xffffffff */ - result = 0xffffffff; + /* based on the endianness, the result is assembled differently */ + if (space.endianness() == ENDIANNESS_LITTLE) + result = word0 | (word1 << 16); + else + result = word1 | (word0 << 16); } else - { /* otherwise, call the byte reading function for the translated address */ - result = space.read_dword_unaligned(address); + { /* otherwise, this proceeds like the byte case */ + device_memory_interface &memory = space.device().memory(); + + if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) + { /* translate if necessary; if not mapped, return 0xffffffff */ + result = 0xffffffff; + } + else + { /* otherwise, call the byte reading function for the translated address */ + result = space.read_dword(address); + } } return result; @@ -443,21 +470,34 @@ u32 debugger_cpu::read_dword(address_space &space, offs_t address, bool apply_tr u64 debugger_cpu::read_qword(address_space &space, offs_t address, bool apply_translation) { - device_memory_interface &memory = space.device().memory(); - /* mask against the logical byte mask */ address &= space.logaddrmask(); u64 result; + if (!QWORD_ALIGNED(address)) + { /* if this is a misaligned read, or if there are no qword readers, just read two dwords */ + u32 dword0 = read_dword(space, address + 0, apply_translation); + u32 dword1 = read_dword(space, address + 4, apply_translation); - /* translate if necessary; if not mapped, return 0xffffffffffffffff */ - if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) - { - result = ~u64(0); + /* based on the endianness, the result is assembled differently */ + if (space.endianness() == ENDIANNESS_LITTLE) + result = dword0 | (u64(dword1) << 32); + else + result = dword1 | (u64(dword0) << 32); } else - { /* otherwise, call the byte reading function for the translated address */ - result = space.read_qword_unaligned(address); + { /* otherwise, this proceeds like the byte case */ + device_memory_interface &memory = space.device().memory(); + + /* translate if necessary; if not mapped, return 0xffffffffffffffff */ + if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) + { + result = ~u64(0); + } + else + { /* otherwise, call the byte reading function for the translated address */ + result = space.read_qword(address); + } } return result; @@ -1862,7 +1902,6 @@ void device_debug::single_step(int numsteps) { assert(m_exec != nullptr); - m_device.machine().rewind_capture(); m_stepsleft = numsteps; m_stepaddr = ~0; m_flags |= DEBUG_FLAG_STEPPING; @@ -1879,7 +1918,6 @@ void device_debug::single_step_over(int numsteps) { assert(m_exec != nullptr); - m_device.machine().rewind_capture(); m_stepsleft = numsteps; m_stepaddr = ~0; m_flags |= DEBUG_FLAG_STEPPING_OVER; @@ -1896,7 +1934,6 @@ void device_debug::single_step_out() { assert(m_exec != nullptr); - m_device.machine().rewind_capture(); m_stepsleft = 100; m_stepaddr = ~0; m_flags |= DEBUG_FLAG_STEPPING_OUT; @@ -1913,7 +1950,6 @@ void device_debug::go(offs_t targetpc) { assert(m_exec != nullptr); - m_device.machine().rewind_invalidate(); m_stopaddr = targetpc; m_flags |= DEBUG_FLAG_STOP_PC; m_device.machine().debugger().cpu().set_execution_state(EXECUTION_STATE_RUNNING); @@ -1928,7 +1964,6 @@ void device_debug::go_vblank() { assert(m_exec != nullptr); - m_device.machine().rewind_invalidate(); m_flags |= DEBUG_FLAG_STOP_VBLANK; m_device.machine().debugger().cpu().go_vblank(); } @@ -1943,7 +1978,6 @@ void device_debug::go_interrupt(int irqline) { assert(m_exec != nullptr); - m_device.machine().rewind_invalidate(); m_stopirq = irqline; m_flags |= DEBUG_FLAG_STOP_INTERRUPT; m_device.machine().debugger().cpu().set_execution_state(EXECUTION_STATE_RUNNING); @@ -1963,7 +1997,6 @@ void device_debug::go_exception(int exception) { assert(m_exec != nullptr); - m_device.machine().rewind_invalidate(); m_stopexception = exception; m_flags |= DEBUG_FLAG_STOP_EXCEPTION; m_device.machine().debugger().cpu().set_execution_state(EXECUTION_STATE_RUNNING); @@ -1979,7 +2012,6 @@ void device_debug::go_milliseconds(u64 milliseconds) { assert(m_exec != nullptr); - m_device.machine().rewind_invalidate(); m_stoptime = m_device.machine().time() + attotime::from_msec(milliseconds); m_flags |= DEBUG_FLAG_STOP_TIME; m_device.machine().debugger().cpu().set_execution_state(EXECUTION_STATE_RUNNING); @@ -2790,14 +2822,14 @@ void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t addre if (type & WATCHPOINT_WRITE) { - buffer = string_format("Stopped at watchpoint %X writing %s to %08X (PC=%X)", wp->index(), sizes[size], address, pc); + buffer = string_format("Stopped at watchpoint %X writing %s to %08X (PC=%X)", wp->index(), sizes[size], space.byte_to_address(address), pc); if (value_to_write >> 32) buffer.append(string_format(" (data=%X%08X)", u32(value_to_write >> 32), u32(value_to_write))); else buffer.append(string_format(" (data=%X)", u32(value_to_write))); } else - buffer = string_format("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->index(), sizes[size], address, pc); + buffer = string_format("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->index(), sizes[size], space.byte_to_address(address), pc); m_machine.debugger().console().printf("%s\n", buffer.c_str()); space.device().debug()->compute_debug_flags(); } diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index f25d52b3ae7..2848f970003 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -94,7 +94,6 @@ static const help_item static_help_list[] = " pcatmemd <address>[,<cpu>] -- query which PC wrote to a given data memory address for the current CPU\n" " pcatmemi <address>[,<cpu>] -- query which PC wrote to a given I/O memory address for the current CPU\n" " (Note: you can also query this info by right clicking in a memory window\n" - " rewind[rw] -- go back in time by loading the most recent rewind state" " statesave[ss] <filename> -- save a state file for the current driver\n" " stateload[sl] <filename> -- load a state file for the current driver\n" " snap [<filename>] -- save a screen snapshot.\n" @@ -456,19 +455,6 @@ static const help_item static_help_list[] = " Print which PC wrote this CPU's memory location 0x400000.\n" }, { - "rewind[rw]", - "\n" - " rewind[rw]" - "\n" - "The rewind command loads the most recent RAM-based state. Rewind states, when enabled, are " - "saved when \"step\", \"over\", or \"out\" command gets executed, storing the machine state as " - "of the moment before actually stepping. Consecutively loading rewind states can work like " - "reverse execution. Depending on which steps forward were taken previously, the bahavior can " - "be similar to GDB's \"reverse-stepi\" or \"reverse-next\". All output for this command is " - "currently echoed into the running machine window. Previous memory and PC tracking statistics " - "are cleared, actual reverse execution does not occur.\n" - }, - { "statesave[ss]", "\n" " statesave[ss] <filename>\n" @@ -486,7 +472,7 @@ static const help_item static_help_list[] = { "stateload[sl]", "\n" - " stateload[sl] <filename>\n" + " stateload[ss] <filename>\n" "\n" "The stateload command retrieves a save state from disk. " "The given state file gets read from the standard state directory (sta), and gets .sta to it - " diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index 8084251c7b1..2292e766132 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -321,7 +321,7 @@ void debug_view_disasm::generate_dasm(debug_disasm_buffer &buffer, offs_t pc) if(pos != -1) { if(!pc_changed) return; - if(pos >= m_topleft.y && pos < m_topleft.y + m_visible.y - 2) + if(pos >= m_topleft.y && pos < m_topleft.y + m_visible.y) return; if(pos < m_total.y - m_visible.y) { m_topleft.x = 0; @@ -566,8 +566,6 @@ void debug_view_disasm::set_selected_address(offs_t address) void debug_view_disasm::set_source(const debug_view_source &source) { - if(&source != m_source) { - debug_view::set_source(source); - m_dasm.clear(); - } + debug_view::set_source(source); + m_dasm.clear(); } diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index 13297dbe7b9..e32d576fa65 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -98,7 +98,6 @@ debug_view_memory::debug_view_memory(running_machine &machine, debug_view_osd_up m_expression(machine), m_chunks_per_row(16), m_bytes_per_chunk(1), - m_steps_per_chunk(1), m_data_format(1), m_reverse_view(false), m_ascii_view(true), @@ -198,7 +197,6 @@ void debug_view_memory::view_notify(debug_view_notification type) if (m_bytes_per_chunk > 8) m_bytes_per_chunk = 8; m_data_format = m_bytes_per_chunk; - m_steps_per_chunk = source.m_space ? source.m_space->byte_to_address(m_bytes_per_chunk) : m_bytes_per_chunk; if (source.m_space != nullptr) m_expression.set_context(&source.m_space->device().debug()->symtable()); else @@ -292,8 +290,7 @@ void debug_view_memory::view_update() if (dest >= destmin && dest < destmax) dest->byte = addrtext[ch]; - // generate the data and the ascii string - std::string chunkascii; + // generate the data for (int chunknum = 0; chunknum < m_chunks_per_row; chunknum++) { int chunkindex = m_reverse_view ? (m_chunks_per_row - 1 - chunknum) : chunknum; @@ -301,7 +298,7 @@ void debug_view_memory::view_update() if (m_data_format <= 8) { u64 chunkdata; - bool ismapped = read(m_bytes_per_chunk, address + chunknum * m_steps_per_chunk, chunkdata); + bool ismapped = read(m_bytes_per_chunk, addrbyte + chunknum * m_bytes_per_chunk, chunkdata); dest = destrow + m_section[1].m_pos + 1 + chunkindex * spacing; for (int ch = 0; ch < posdata.m_spacing; ch++, dest++) if (dest >= destmin && dest < destmax) @@ -310,10 +307,6 @@ void debug_view_memory::view_update() if (shift < 64) dest->byte = ismapped ? "0123456789ABCDEF"[(chunkdata >> shift) & 0x0f] : '*'; } - for (int i=0; i < m_bytes_per_chunk; i++) { - u8 chval = chunkdata >> (8 * (m_bytes_per_chunk - i - 1)); - chunkascii += char((ismapped && isprint(chval)) ? chval : '.'); - } } else { int ch; @@ -323,9 +316,9 @@ void debug_view_memory::view_update() bool ismapped; if (m_data_format != 11) - ismapped = read(m_bytes_per_chunk, address + chunknum * m_steps_per_chunk, chunkdata); + ismapped = read(m_bytes_per_chunk, addrbyte + chunknum * m_bytes_per_chunk, chunkdata); else - ismapped = read(m_bytes_per_chunk, address + chunknum * m_steps_per_chunk, chunkdata80); + ismapped = read(m_bytes_per_chunk, addrbyte + chunknum * m_bytes_per_chunk, chunkdata80); if (ismapped) switch (m_data_format) @@ -345,7 +338,6 @@ void debug_view_memory::view_update() valuetext[0] = '*'; valuetext[1] = 0; } - dest = destrow + m_section[1].m_pos + 1 + chunkindex * spacing; // first copy the text for (ch = 0; (ch < spacing) && (valuetext[ch] != 0); ch++, dest++) @@ -355,23 +347,20 @@ void debug_view_memory::view_update() for (; ch < spacing; ch++, dest++) if (dest >= destmin && dest < destmax) dest->byte = ' '; - - for (int i=0; i < m_bytes_per_chunk; i++) { - u8 chval = chunkdata >> (8 * (m_bytes_per_chunk - i - 1)); - chunkascii += char((ismapped && isprint(chval)) ? chval : '.'); - } } } - // generate the ASCII data, but follow the chunks + // generate the ASCII data if (m_section[2].m_width > 0) { dest = destrow + m_section[2].m_pos + 1; - for (size_t i = 0; i != chunkascii.size(); i++) { + for (int ch = 0; ch < m_bytes_per_row; ch++, dest++) if (dest >= destmin && dest < destmax) - dest->byte = chunkascii[i]; - dest++; - } + { + u64 chval; + bool ismapped = read(1, addrbyte + ch, chval); + dest->byte = (ismapped && isprint(chval)) ? chval : '.'; + } } } } @@ -574,10 +563,7 @@ void debug_view_memory::recompute() // recompute the byte offset based on the most recent expression result m_bytes_per_row = m_bytes_per_chunk * m_chunks_per_row; - offs_t val = m_expression.value(); - if (source.m_space) - val = source.m_space->address_to_byte(val); - m_byte_offset = val % m_bytes_per_row; + m_byte_offset = m_expression.value() % m_bytes_per_row; // compute the section widths m_section[0].m_width = 1 + 8 + 1; @@ -626,20 +612,17 @@ bool debug_view_memory::needs_recompute() // handle expression changes if (m_expression.dirty()) { - const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); - offs_t val = m_expression.value(); - if (source.m_space) - val = source.m_space->address_to_byte(val); recompute = true; - m_topleft.y = (val - m_byte_offset) / m_bytes_per_row; + m_topleft.y = (m_expression.value() - m_byte_offset) / m_bytes_per_row; m_topleft.y = std::max(m_topleft.y, 0); m_topleft.y = std::min(m_topleft.y, m_total.y - 1); + const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); offs_t resultbyte; if (source.m_space != nullptr) - resultbyte = val & source.m_space->logaddrmask(); + resultbyte = m_expression.value() & source.m_space->logaddrmask(); else - resultbyte = val; + resultbyte = m_expression.value(); set_cursor_pos(cursor_pos(resultbyte, m_bytes_per_chunk * 8 - 4)); } @@ -757,7 +740,7 @@ bool debug_view_memory::read(u8 size, offs_t offs, u64 &data) const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); // if no raw data, just use the standard debug routines - if (source.m_space) + if (source.m_space != nullptr) { auto dis = machine().disable_side_effect(); @@ -840,7 +823,7 @@ void debug_view_memory::write(u8 size, offs_t offs, u64 data) const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); // if no raw data, just use the standard debug routines - if (source.m_space) + if (source.m_space != nullptr) { auto dis = machine().disable_side_effect(); @@ -936,14 +919,13 @@ void debug_view_memory::set_data_format(int format) return; pos = begin_update_and_get_cursor_pos(); - const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); if ((format <= 8) && (m_data_format <= 8)) { + const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); pos.m_address += (pos.m_shift / 8) ^ ((source.m_endianness == ENDIANNESS_LITTLE) ? 0 : (m_bytes_per_chunk - 1)); pos.m_shift %= 8; m_bytes_per_chunk = format; - m_steps_per_chunk = source.m_space ? source.m_space->byte_to_address(m_bytes_per_chunk) : m_bytes_per_chunk; m_chunks_per_row = m_bytes_per_row / format; if (m_chunks_per_row < 1) m_chunks_per_row = 1; @@ -976,7 +958,6 @@ void debug_view_memory::set_data_format(int format) } } m_chunks_per_row = m_bytes_per_row / m_bytes_per_chunk; - m_steps_per_chunk = source.m_space ? source.m_space->byte_to_address(m_bytes_per_chunk) : m_bytes_per_chunk; pos.m_shift = 0; pos.m_address -= pos.m_address % m_bytes_per_chunk; } diff --git a/src/emu/debug/dvmemory.h b/src/emu/debug/dvmemory.h index c354b644053..1927e030d2b 100644 --- a/src/emu/debug/dvmemory.h +++ b/src/emu/debug/dvmemory.h @@ -107,7 +107,6 @@ private: debug_view_expression m_expression; // expression describing the start address u32 m_chunks_per_row; // number of chunks displayed per line u8 m_bytes_per_chunk; // bytes per chunk - u8 m_steps_per_chunk; // bytes per chunk int m_data_format; // 1-8 current values 9 32bit floating point bool m_reverse_view; // reverse-endian view? bool m_ascii_view; // display ASCII characters? diff --git a/src/emu/device.h b/src/emu/device.h index 38b20ba3111..211da59cb38 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -635,6 +635,7 @@ public: device_t &device() { return m_device; } const device_t &device() const { return m_device; } operator device_t &() { return m_device; } + operator device_t *() { return &m_device; } // iteration helpers device_interface *interface_next() const { return m_interface_next; } diff --git a/src/emu/diexec.cpp b/src/emu/diexec.cpp index d84f3b8f4be..0958108fe42 100644 --- a/src/emu/diexec.cpp +++ b/src/emu/diexec.cpp @@ -499,9 +499,6 @@ void device_execute_interface::interface_post_start() assert_always(m_icountptr != nullptr, "m_icountptr never initialized!"); // register for save states - device().save_pointer(NAME(m_icountptr), 1); - device().save_item(NAME(m_cycles_running)); - device().save_item(NAME(m_cycles_stolen)); device().save_item(NAME(m_suspend)); device().save_item(NAME(m_nextsuspend)); device().save_item(NAME(m_eatcycles)); diff --git a/src/emu/dirom.cpp b/src/emu/dirom.cpp index 87461926cf6..3a0ed23692f 100644 --- a/src/emu/dirom.cpp +++ b/src/emu/dirom.cpp @@ -4,9 +4,7 @@ device_rom_interface::device_rom_interface(const machine_config &mconfig, device_t &device, u8 addrwidth, endianness_t endian, u8 datawidth) : device_memory_interface(mconfig, device), m_rom_tag(device.basetag()), - m_rom_config("rom", endian, datawidth, addrwidth), - m_bank(nullptr), - m_cur_bank(-1) + m_rom_config("rom", endian, datawidth, addrwidth) { } @@ -44,14 +42,12 @@ void device_rom_interface::set_rom_bank(int bank) bank = bank % m_bank_count; } - if (m_cur_bank != bank) { - m_cur_bank = bank; - m_bank->set_entry(bank); - rom_bank_updated(); - } + m_cur_bank = bank; + m_bank->set_entry(bank); + rom_bank_updated(); } -void device_rom_interface::interface_post_load() +void device_rom_interface::reset_bank() { if(m_bank) m_bank->set_entry(m_cur_bank); @@ -89,12 +85,12 @@ void device_rom_interface::set_rom(const void *base, u32 size) void device_rom_interface::interface_pre_start() { - if(!has_space(0)) - return; - m_rom_direct = space().direct<0>(); + m_bank = nullptr; + m_cur_bank = -1; device().save_item(NAME(m_cur_bank)); device().save_item(NAME(m_bank_count)); + device().machine().save().register_postload(save_prepost_delegate(FUNC(device_rom_interface::reset_bank), this)); if(!has_configured_map(0)) { memory_region *reg = device().owner()->memregion(m_rom_tag); diff --git a/src/emu/dirom.h b/src/emu/dirom.h index aae6a7f5097..2ea7edca810 100644 --- a/src/emu/dirom.h +++ b/src/emu/dirom.h @@ -38,22 +38,24 @@ public: protected: virtual void rom_bank_updated() = 0; - virtual space_config_vector memory_space_config() const override; - - void set_rom_endianness(endianness_t endian) { assert(!device().configured()); m_rom_config.m_endianness = endian; } - void set_rom_data_width(u8 width) { assert(!device().configured()); m_rom_config.m_data_width = width; } - void set_rom_addr_width(u8 width) { assert(!device().configured()); m_rom_config.m_addr_width = m_rom_config.m_logaddr_width = width; } private: const char *m_rom_tag; - address_space_config m_rom_config; + const address_space_config m_rom_config; direct_read_data<0> *m_rom_direct; memory_bank *m_bank; int m_cur_bank, m_bank_count; + virtual space_config_vector memory_space_config() const override; virtual void interface_pre_start() override; - virtual void interface_post_load() override; + + DECLARE_READ8_MEMBER(z8_r); + DECLARE_READ16_MEMBER(z16_r); + DECLARE_READ32_MEMBER(z32_r); + DECLARE_READ64_MEMBER(z64_r); + + void reset_bank(); }; #endif // MAME_EMU_DIROM_H diff --git a/src/emu/drivers/xtal.h b/src/emu/drivers/xtal.h index b2cbaeb5fb9..8c9fb948510 100644 --- a/src/emu/drivers/xtal.h +++ b/src/emu/drivers/xtal.h @@ -100,7 +100,6 @@ enum XTAL_6MHz = 6000000, /* American Poker II, Taito SJ System */ XTAL_6_144MHz = 6144000, /* Used on Alpha Denshi early 80's games sound board, Casio FP-200 and Namco Universal System 16 */ XTAL_6_5MHz = 6500000, /* Jupiter Ace */ - XTAL_6_88MHz = 6880000, /* Barcrest MPU4 */ XTAL_6_9MHz = 6900000, /* BBN BitGraph CPU */ XTAL_7MHz = 7000000, /* Jaleco Mega System PCBs */ XTAL_7_15909MHz = 7159090, /* Blood Bros (2x NTSC subcarrier) */ @@ -176,7 +175,6 @@ enum XTAL_15_92MHz = 15920000, /* HP Integral PC */ XTAL_15_9744MHz = 15974400, /* Osborne 1 (9600 * 52 * 32) */ XTAL_16MHz = 16000000, /* Extremely common, used on 100's of PCBs */ - XTAL_16_128MHz = 16128000, /* Fujitsu FM-7 */ XTAL_16_384MHz = 16384000, XTAL_16_4MHz = 16400000, /* MS 6102 */ XTAL_16_5888MHz = 16588800, /* SM 7238 */ @@ -204,7 +202,6 @@ enum XTAL_20_079MHz = 20790000, /* Blockade-hardware Gremlin games */ XTAL_20_625MHz = 20625000, /* SM 7238 */ XTAL_21MHz = 21000000, /* Lock-On pixel clock */ - XTAL_21_0526MHz = 21052600, /* NEC PC-98xx pixel clock */ XTAL_21_3MHz = 21300000, XTAL_21_4772MHz = 21477272, /* BMC bowling, some Data East 90's games, Vtech Socrates; (6x NTSC subcarrier) */ XTAL_22MHz = 22000000, @@ -220,7 +217,6 @@ enum XTAL_24_8832MHz = 24883200, /* DEC VT100 */ XTAL_25MHz = 25000000, /* Namco System 22, Taito GNET, Dogyuun h/w */ XTAL_25_1748MHz = 25174800, /* Sega System 16A/16B (1600x NTSC line rate) */ - XTAL_25_2MHz = 25200000, /* Tektronix 4404 video clock */ XTAL_25_39836MHz = 25398360, /* Tandberg TDV 2324 */ XTAL_25_447MHz = 25447000, /* Namco EVA3A (Funcube2) */ XTAL_25_590906MHz = 25590906, /* Atari Jaguar NTSC */ @@ -249,7 +245,6 @@ enum XTAL_30_4761MHz = 30476100, /* Taito JC */ XTAL_30_8MHz = 30800000, /* 15IE-00-013 */ XTAL_31_684MHz = 31684000, /* TeleVideo TVI-955 132-column display clock */ - XTAL_31_9488MHz = 31948800, /* NEC PC-88xx, PC-98xx */ XTAL_32MHz = 32000000, XTAL_32_22MHz = 32220000, /* Typically used on 90's Data East PCBs (close to 9x NTSC subcarrier which is 32.215905Mhz*/ XTAL_32_5304MHz = 32530400, /* Seta 2 */ @@ -264,7 +259,6 @@ enum XTAL_39_3216MHz = 39321600, /* Sun 2/120 */ XTAL_40MHz = 40000000, XTAL_42MHz = 42000000, /* BMC A-00211 - Popo Bear */ - XTAL_42_1052MHz = 42105200, /* NEC PC-88xx */ XTAL_42_9545MHz = 42954545, /* CPS3 (12x NTSC subcarrier)*/ XTAL_43_320MHz = 43320000, /* DEC VT420 */ XTAL_44_1MHz = 44100000, /* Subsino's Bishou Jan */ diff --git a/src/emu/emucore.h b/src/emu/emucore.h index b6d1e7b3154..1782ac8726d 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -255,7 +255,6 @@ template <typename T, typename U, typename... V> constexpr T bitswap(T val, U b, return (BIT(val, b) << sizeof...(c)) | bitswap(val, c...); } -// explicit version that checks number of bit position arguments template <unsigned B, typename T, typename... U> T bitswap(T val, U... b) { static_assert(sizeof...(b) == B, "wrong number of bits"); @@ -263,6 +262,16 @@ template <unsigned B, typename T, typename... U> T bitswap(T val, U... b) return bitswap(val, b...); } +// explicit versions that check number of bit position arguments +template <typename T, typename... U> constexpr T BITSWAP8(T val, U... b) { return bitswap<8U>(val, b...); } +template <typename T, typename... U> constexpr T BITSWAP16(T val, U... b) { return bitswap<16U>(val, b...); } +template <typename T, typename... U> constexpr T BITSWAP24(T val, U... b) { return bitswap<24U>(val, b...); } +template <typename T, typename... U> constexpr T BITSWAP32(T val, U... b) { return bitswap<32U>(val, b...); } +template <typename T, typename... U> constexpr T BITSWAP40(T val, U... b) { return bitswap<40U>(val, b...); } +template <typename T, typename... U> constexpr T BITSWAP48(T val, U... b) { return bitswap<48U>(val, b...); } +template <typename T, typename... U> constexpr T BITSWAP56(T val, U... b) { return bitswap<56U>(val, b...); } +template <typename T, typename... U> constexpr T BITSWAP64(T val, U... b) { return bitswap<64U>(val, b...); } + //************************************************************************** diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index bbbf3b59fda..2b63aa4952b 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -738,20 +738,18 @@ private: } // internal watchpoint handler - template<typename UintType, int AddrShift> + template<typename UintType> UintType watchpoint_r(address_space &space, offs_t offset, UintType mask) { - int base_shift = sizeof(UintType) == 1 ? 0 : sizeof(UintType) == 2 ? 1 : sizeof(UintType) == 4 ? 2 : 3; - offset = offset << (AddrShift + base_shift); - m_space.device().debug()->memory_read_hook(m_space, offset, mask); + m_space.device().debug()->memory_read_hook(m_space, offset * sizeof(UintType), mask); u16 *oldtable = m_live_lookup; m_live_lookup = &m_table[0]; UintType result; if (sizeof(UintType) == 1) result = m_space.read_byte(offset); - if (sizeof(UintType) == 2) result = m_space.read_word(offset, mask); - if (sizeof(UintType) == 4) result = m_space.read_dword(offset, mask); - if (sizeof(UintType) == 8) result = m_space.read_qword(offset, mask); + if (sizeof(UintType) == 2) result = m_space.read_word(offset << 1, mask); + if (sizeof(UintType) == 4) result = m_space.read_dword(offset << 2, mask); + if (sizeof(UintType) == 8) result = m_space.read_qword(offset << 3, mask); m_live_lookup = oldtable; return result; } @@ -808,19 +806,17 @@ private: { } - template<typename UintType, int AddrShift> + template<typename UintType> void watchpoint_w(address_space &space, offs_t offset, UintType data, UintType mask) { - int base_shift = sizeof(UintType) == 1 ? 0 : sizeof(UintType) == 2 ? 1 : sizeof(UintType) == 4 ? 2 : 3; - offset = offset << (AddrShift + base_shift); - m_space.device().debug()->memory_write_hook(m_space, offset, data, mask); + m_space.device().debug()->memory_write_hook(m_space, offset * sizeof(UintType), data, mask); u16 *oldtable = m_live_lookup; m_live_lookup = &m_table[0]; if (sizeof(UintType) == 1) m_space.write_byte(offset, data); - if (sizeof(UintType) == 2) m_space.write_word(offset, data, mask); - if (sizeof(UintType) == 4) m_space.write_dword(offset, data, mask); - if (sizeof(UintType) == 8) m_space.write_qword(offset, data, mask); + if (sizeof(UintType) == 2) m_space.write_word(offset << 1, data, mask); + if (sizeof(UintType) == 4) m_space.write_dword(offset << 2, data, mask); + if (sizeof(UintType) == 8) m_space.write_qword(offset << 3, data, mask); m_live_lookup = oldtable; } @@ -3917,51 +3913,28 @@ address_table_read::address_table_read(address_space &space, bool large) case 8: m_handlers[STATIC_UNMAP]->set_delegate(read8_delegate(FUNC(address_table_read::unmap_r<u8>), this)); m_handlers[STATIC_NOP]->set_delegate(read8_delegate(FUNC(address_table_read::nop_r<u8>), this)); - switch (space.addr_shift()) - { - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(read8_delegate (&address_table_read::watchpoint_r<u8, 0>, "watchpoint_r", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(read8_delegate(FUNC(address_table_read::watchpoint_r<u8>), this)); break; // 16-bit case case 16: m_handlers[STATIC_UNMAP]->set_delegate(read16_delegate(FUNC(address_table_read::unmap_r<u16>), this)); m_handlers[STATIC_NOP]->set_delegate(read16_delegate(FUNC(address_table_read::nop_r<u16>), this)); - switch (space.addr_shift()) - { - case -1: m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate(&address_table_read::watchpoint_r<u16, -1>, "watchpoint_r", this)); break; - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate(&address_table_read::watchpoint_r<u16, 0>, "watchpoint_r", this)); break; - case 3: m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate(&address_table_read::watchpoint_r<u16, 3>, "watchpoint_r", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate(FUNC(address_table_read::watchpoint_r<u16>), this)); break; // 32-bit case case 32: m_handlers[STATIC_UNMAP]->set_delegate(read32_delegate(FUNC(address_table_read::unmap_r<u32>), this)); m_handlers[STATIC_NOP]->set_delegate(read32_delegate(FUNC(address_table_read::nop_r<u32>), this)); - switch (space.addr_shift()) - { - case -2: m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate(&address_table_read::watchpoint_r<u32, -2>, "watchpoint_r", this)); break; - case -1: m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate(&address_table_read::watchpoint_r<u32, -1>, "watchpoint_r", this)); break; - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate(&address_table_read::watchpoint_r<u32, 0>, "watchpoint_r", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate(FUNC(address_table_read::watchpoint_r<u32>), this)); break; // 64-bit case case 64: m_handlers[STATIC_UNMAP]->set_delegate(read64_delegate(FUNC(address_table_read::unmap_r<u64>), this)); m_handlers[STATIC_NOP]->set_delegate(read64_delegate(FUNC(address_table_read::nop_r<u64>), this)); - switch (space.addr_shift()) - { - case -3: m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(&address_table_read::watchpoint_r<u64, -3>, "watchpoint_r", this)); break; - case -2: m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(&address_table_read::watchpoint_r<u64, -2>, "watchpoint_r", this)); break; - case -1: m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(&address_table_read::watchpoint_r<u64, -1>, "watchpoint_r", this)); break; - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(&address_table_read::watchpoint_r<u64, 0>, "watchpoint_r", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(FUNC(address_table_read::watchpoint_r<u64>), this)); break; } @@ -4014,51 +3987,28 @@ address_table_write::address_table_write(address_space &space, bool large) case 8: m_handlers[STATIC_UNMAP]->set_delegate(write8_delegate(FUNC(address_table_write::unmap_w<u8>), this)); m_handlers[STATIC_NOP]->set_delegate(write8_delegate(FUNC(address_table_write::nop_w<u8>), this)); - switch (space.addr_shift()) - { - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(write8_delegate (&address_table_write::watchpoint_w<u8, 0>, "watchpoint_w", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(write8_delegate(FUNC(address_table_write::watchpoint_w<u8>), this)); break; // 16-bit case case 16: m_handlers[STATIC_UNMAP]->set_delegate(write16_delegate(FUNC(address_table_write::unmap_w<u16>), this)); m_handlers[STATIC_NOP]->set_delegate(write16_delegate(FUNC(address_table_write::nop_w<u16>), this)); - switch (space.addr_shift()) - { - case -1: m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate(&address_table_write::watchpoint_w<u16, -1>, "watchpoint_w", this)); break; - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate(&address_table_write::watchpoint_w<u16, 0>, "watchpoint_w", this)); break; - case 3: m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate(&address_table_write::watchpoint_w<u16, 3>, "watchpoint_w", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate(FUNC(address_table_write::watchpoint_w<u16>), this)); break; // 32-bit case case 32: m_handlers[STATIC_UNMAP]->set_delegate(write32_delegate(FUNC(address_table_write::unmap_w<u32>), this)); m_handlers[STATIC_NOP]->set_delegate(write32_delegate(FUNC(address_table_write::nop_w<u32>), this)); - switch (space.addr_shift()) - { - case -2: m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate(&address_table_write::watchpoint_w<u32, -2>, "watchpoint_w", this)); break; - case -1: m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate(&address_table_write::watchpoint_w<u32, -1>, "watchpoint_w", this)); break; - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate(&address_table_write::watchpoint_w<u32, 0>, "watchpoint_w", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate(FUNC(address_table_write::watchpoint_w<u32>), this)); break; // 64-bit case case 64: m_handlers[STATIC_UNMAP]->set_delegate(write64_delegate(FUNC(address_table_write::unmap_w<u64>), this)); m_handlers[STATIC_NOP]->set_delegate(write64_delegate(FUNC(address_table_write::nop_w<u64>), this)); - switch (space.addr_shift()) - { - case -3: m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(&address_table_write::watchpoint_w<u64, -3>, "watchpoint_w", this)); break; - case -2: m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(&address_table_write::watchpoint_w<u64, -2>, "watchpoint_w", this)); break; - case -1: m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(&address_table_write::watchpoint_w<u64, -1>, "watchpoint_w", this)); break; - case 0: m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(&address_table_write::watchpoint_w<u64, 0>, "watchpoint_w", this)); break; - default: abort(); - } + m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(FUNC(address_table_write::watchpoint_w<u64>), this)); break; } diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 4fd91155fd2..11e369f0aca 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -62,8 +62,6 @@ const options_entry emu_options::s_option_entries[] = { nullptr, nullptr, OPTION_HEADER, "CORE STATE/PLAYBACK OPTIONS" }, { OPTION_STATE, nullptr, OPTION_STRING, "saved state to load" }, { OPTION_AUTOSAVE, "0", OPTION_BOOLEAN, "enable automatic restore at startup, and automatic save at exit time" }, - { OPTION_REWIND, "0", OPTION_BOOLEAN, "enable rewind savestates" }, - { OPTION_REWIND_CAPACITY "(1-500)", "100", OPTION_INTEGER, "quantity of states rewind buffer can contain" }, { OPTION_PLAYBACK ";pb", nullptr, OPTION_STRING, "playback an input file" }, { OPTION_RECORD ";rec", nullptr, OPTION_STRING, "record an input file" }, { OPTION_RECORD_TIMECODE, "0", OPTION_BOOLEAN, "record an input timecode file (requires -record option)" }, diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 60de574bb22..a449c5d95a1 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -51,8 +51,6 @@ // core state/playback options #define OPTION_STATE "state" #define OPTION_AUTOSAVE "autosave" -#define OPTION_REWIND "rewind" -#define OPTION_REWIND_CAPACITY "rewind_capacity" #define OPTION_PLAYBACK "playback" #define OPTION_RECORD "record" #define OPTION_RECORD_TIMECODE "record_timecode" @@ -329,8 +327,6 @@ public: // core state/playback options const char *state() const { return value(OPTION_STATE); } bool autosave() const { return bool_value(OPTION_AUTOSAVE); } - int rewind() const { return bool_value(OPTION_REWIND); } - int rewind_capacity() const { return int_value(OPTION_REWIND_CAPACITY); } const char *playback() const { return value(OPTION_PLAYBACK); } const char *record() const { return value(OPTION_RECORD); } bool record_timecode() const { return bool_value(OPTION_RECORD_TIMECODE); } diff --git a/src/emu/http.cpp b/src/emu/http.cpp index 899378001fa..fc14b0e75ae 100644 --- a/src/emu/http.cpp +++ b/src/emu/http.cpp @@ -48,7 +48,6 @@ const static struct mapping { "jpx", "image/jpx" }, { "js", "application/javascript" }, { "json", "application/json" }, - { "lay", "text/xml" }, { "m3u", "audio/x-mpegurl" }, { "m4v", "video/x-m4v" }, { "mid", "audio/x-midi" }, diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h index a1e5bef133b..b58ca37bec6 100644 --- a/src/emu/inpttype.h +++ b/src/emu/inpttype.h @@ -820,12 +820,11 @@ inline void construct_core_types_keypad(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_seq::not_code, KEYCODE_LSHIFT) ) - INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_DEBUG_BREAK, "Break in Debugger", input_seq(KEYCODE_TILDE, input_seq::not_code, KEYCODE_LSHIFT) ) + 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) ) INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_CONFIGURE, "Config Menu", input_seq(KEYCODE_TAB) ) INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_PAUSE, "Pause", input_seq(KEYCODE_P, input_seq::not_code, KEYCODE_LSHIFT, input_seq::not_code, KEYCODE_RSHIFT) ) - INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_PAUSE_SINGLE, "Pause - Single Step", input_seq(KEYCODE_P, KEYCODE_LSHIFT) ) - INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_REWIND_SINGLE, "Rewind - Single Step", input_seq(KEYCODE_TILDE, KEYCODE_LSHIFT, input_seq::or_code, KEYCODE_TILDE, KEYCODE_RSHIFT) ) + INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_PAUSE_SINGLE, "Pause - Single Step", input_seq(KEYCODE_P, KEYCODE_LSHIFT, input_seq::or_code, KEYCODE_P, KEYCODE_RSHIFT) ) INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_RESET_MACHINE, "Reset Machine", input_seq(KEYCODE_F3, KEYCODE_LSHIFT) ) INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SOFT_RESET, "Soft Reset", input_seq(KEYCODE_F3, input_seq::not_code, KEYCODE_LSHIFT) ) INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SHOW_GFX, "Show Gfx", input_seq(KEYCODE_F4) ) diff --git a/src/emu/ioport.h b/src/emu/ioport.h index a9f25e29184..722c028e4dc 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -322,7 +322,6 @@ enum ioport_type IPT_UI_DEBUG_BREAK, IPT_UI_PAUSE, IPT_UI_PAUSE_SINGLE, - IPT_UI_REWIND_SINGLE, IPT_UI_RESET_MACHINE, IPT_UI_SOFT_RESET, IPT_UI_SHOW_GFX, diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index f55bfb6c5ad..fa6375ef937 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -683,42 +683,6 @@ void running_machine::immediate_load(const char *filename) //------------------------------------------------- -// rewind_capture - capture and append a new -// state to the rewind list -//------------------------------------------------- - -void running_machine::rewind_capture() -{ - if (m_save.rewind()->enabled()) - m_save.rewind()->capture(); -} - - -//------------------------------------------------- -// rewind_step - a single step back through -// rewind states -//------------------------------------------------- - -void running_machine::rewind_step() -{ - if (m_save.rewind()->enabled()) - m_save.rewind()->step(); -} - - -//------------------------------------------------- -// rewind_invalidate - mark all the future rewind -// states as invalid -//------------------------------------------------- - -void running_machine::rewind_invalidate() -{ - if (m_save.rewind()->enabled()) - m_save.rewind()->invalidate(); -} - - -//------------------------------------------------- // pause - pause the system //------------------------------------------------- @@ -757,10 +721,7 @@ void running_machine::resume() void running_machine::toggle_pause() { if (paused()) - { - rewind_invalidate(); resume(); - } else pause(); } diff --git a/src/emu/machine.h b/src/emu/machine.h index efe464983db..4cf274c9617 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -229,11 +229,6 @@ public: void immediate_save(const char *filename); void immediate_load(const char *filename); - // rewind operations - void rewind_capture(); - void rewind_step(); - void rewind_invalidate(); - // scheduled operations void schedule_exit(); void schedule_hard_reset(); diff --git a/src/emu/save.cpp b/src/emu/save.cpp index eff71cd6870..dea222227ee 100644 --- a/src/emu/save.cpp +++ b/src/emu/save.cpp @@ -23,7 +23,6 @@ ***************************************************************************/ #include "emu.h" -#include "emuopts.h" #include "coreutil.h" @@ -61,11 +60,10 @@ enum //------------------------------------------------- save_manager::save_manager(running_machine &machine) - : m_machine(machine) - , m_reg_allowed(true) - , m_illegal_regs(0) + : m_machine(machine), + m_reg_allowed(true), + m_illegal_regs(0) { - m_rewind = std::make_unique<rewinder>(*this); } @@ -171,8 +169,8 @@ void save_manager::save_memory(device_t *device, const char *module, const char totalname = string_format("%s/%X/%s", module, index, name); // look for duplicates and an entry to insert in front of - std::vector<std::unique_ptr<state_entry>>::iterator insert_after = m_entry_list.begin(); - for (auto it = m_entry_list.begin(); it != m_entry_list.end(); ++it) + std::vector<std::unique_ptr<state_entry>>::iterator insert_after = m_entry_list.begin(); + for (auto it = m_entry_list.begin(); it!= m_entry_list.end(); ++it) { // stop when we find an entry whose name is after ours if (it->get()->m_name.compare(totalname)>0) @@ -185,7 +183,7 @@ void save_manager::save_memory(device_t *device, const char *module, const char } // insert us into the list - m_entry_list.insert(insert_after, std::make_unique<state_entry>(val, totalname.c_str(), device, module, tag ? tag : "", index, valsize, valcount)); + m_entry_list.insert(insert_after,std::make_unique<state_entry>(val, totalname.c_str(), device, module, tag ? tag : "", index, valsize, valcount)); } @@ -215,19 +213,18 @@ save_error save_manager::check_file(running_machine &machine, emu_file &file, co return validate_header(header, gamename, sig, errormsg, ""); } - //------------------------------------------------- // dispatch_postload - invoke all registered // postload callbacks for updates //------------------------------------------------- + void save_manager::dispatch_postload() { for (auto &func : m_postload_list) func->m_func(); } - //------------------------------------------------- // read_file - read the data from a file //------------------------------------------------- @@ -272,19 +269,18 @@ save_error save_manager::read_file(emu_file &file) return STATERR_NONE; } - //------------------------------------------------- // dispatch_presave - invoke all registered // presave callbacks for updates //------------------------------------------------- + void save_manager::dispatch_presave() { for (auto &func : m_presave_list) func->m_func(); } - //------------------------------------------------- // write_file - writes the data to a file //------------------------------------------------- @@ -419,451 +415,26 @@ save_manager::state_callback::state_callback(save_prepost_delegate callback) //------------------------------------------------- -// ram_state - constructor -//------------------------------------------------- - -ram_state::ram_state(save_manager &save) - : m_save(save) - , m_data() - , m_valid(false) - , m_time(m_save.machine().time()) -{ - m_data.reserve(get_size(save)); - m_data.clear(); - m_data.rdbuf()->clear(); - m_data.seekp(0); - m_data.seekg(0); -} - - -//------------------------------------------------- -// get_size - utility function to get the -// uncompressed size of a state -//------------------------------------------------- - -size_t ram_state::get_size(save_manager &save) -{ - size_t totalsize = 0; - - for (auto &entry : save.m_entry_list) - { - totalsize += entry->m_typesize * entry->m_typecount; - } - - return totalsize + HEADER_SIZE; -} - - -//------------------------------------------------- -// save - write the current machine state to the -// allocated stream -//------------------------------------------------- - -save_error ram_state::save() -{ - // initialize - m_valid = false; - m_data.seekp(0); - - // if we have illegal registrations, return an error - if (m_save.m_illegal_regs > 0) - return STATERR_ILLEGAL_REGISTRATIONS; - - // generate the header - u8 header[HEADER_SIZE]; - memcpy(&header[0], STATE_MAGIC_NUM, 8); - header[8] = SAVE_VERSION; - header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST); - strncpy((char *)&header[0x0a], m_save.machine().system().name, 0x1c - 0x0a); - u32 sig = m_save.signature(); - *(u32 *)&header[0x1c] = little_endianize_int32(sig); - - // write the header - m_data.write((char *)header, sizeof(header)); - - // check for any errors - if (!m_data) - return STATERR_WRITE_ERROR; - - // call the pre-save functions - m_save.dispatch_presave(); - - // write all the data - for (auto &entry : m_save.m_entry_list) - { - u32 totalsize = entry->m_typesize * entry->m_typecount; - m_data.write((char *)entry->m_data, totalsize); - - // check for any errors - if (!m_data) - return STATERR_WRITE_ERROR; - } - - // final confirmation - m_valid = true; - m_time = m_save.machine().time(); - - return STATERR_NONE; -} - - -//------------------------------------------------- -// load - restore the machine state from the -// stream -//------------------------------------------------- - -save_error ram_state::load() -{ - // initialize - m_data.seekg(0); - - // if we have illegal registrations, return an error - if (m_save.m_illegal_regs > 0) - return STATERR_ILLEGAL_REGISTRATIONS; - - // read the header - u8 header[HEADER_SIZE]; - m_data.read((char *)header, sizeof(header)); - - // check for any errors - if (!m_data) - return STATERR_READ_ERROR; - - // verify the header and report an error if it doesn't match - u32 sig = m_save.signature(); - if (m_save.validate_header(header, m_save.machine().system().name, sig, nullptr, "Error: ") != STATERR_NONE) - return STATERR_INVALID_HEADER; - - // determine whether or not to flip the data when done - bool flip = NATIVE_ENDIAN_VALUE_LE_BE((header[9] & SS_MSB_FIRST) != 0, (header[9] & SS_MSB_FIRST) == 0); - - // read all the data, flipping if necessary - for (auto &entry : m_save.m_entry_list) - { - u32 totalsize = entry->m_typesize * entry->m_typecount; - m_data.read((char *)entry->m_data, totalsize); - - // check for any errors - if (!m_data) - return STATERR_READ_ERROR; - - // handle flipping - if (flip) - entry->flip_data(); - } - - // call the post-load functions - m_save.dispatch_postload(); - - return STATERR_NONE; -} - - -//------------------------------------------------- -// rewinder - constuctor -//------------------------------------------------- - -rewinder::rewinder(save_manager &save) - : m_save(save) - , m_enabled(save.machine().options().rewind()) - , m_capacity(save.machine().options().rewind_capacity()) -{ -} - - -//------------------------------------------------- -// check_size - shrink the state list if it is -// about to hit the capacity -//------------------------------------------------- - -void rewinder::check_size() -{ - // safety check that shouldn't be allowed to trigger - if (m_state_list.size() > m_capacity) - { - // drop all states beyond capacity - uint32_t count = m_state_list.size() - m_capacity; - m_state_list.erase(m_state_list.begin(), m_state_list.begin() + count); - } - - // check if we're about to hit capacity - if (m_state_list.size() == m_capacity) - { - // check the last state - ram_state *last = m_state_list.back().get(); - - // if we're not on top of the list, no need to move states around - if (!last->m_valid) - return; - - // we can now get the first state and invalidate it - std::unique_ptr<ram_state> first(std::move(m_state_list.front())); - first->m_valid = false; - - // move it to the end for future use - m_state_list.push_back(std::move(first)); - m_state_list.erase(m_state_list.begin()); - } -} - - -//------------------------------------------------- -// report_error - report rewind success or -// error type -//------------------------------------------------- - -void rewinder::report_error(save_error error, rewind_operation operation, int index) -{ - const char *const opname = (operation == rewind_operation::LOAD) ? "load" : "save"; - - switch (error) - { - // internal saveload failures - case STATERR_ILLEGAL_REGISTRATIONS: - m_save.machine().popmessage("Error: Unable to %s state due to illegal registrations. See error.log for details.", opname); - break; - - case STATERR_INVALID_HEADER: - m_save.machine().popmessage("Error: Unable to %s state due to an invalid header. Make sure the save state is correct for this machine.", opname); - break; - - case STATERR_READ_ERROR: - m_save.machine().popmessage("Error: Unable to %s state due to a read error.", opname); - break; - - case STATERR_WRITE_ERROR: - m_save.machine().popmessage("Error: Unable to %s state due to a write error.", opname); - break; - - // external saveload failures - case STATERR_NOT_FOUND: - if (operation == rewind_operation::LOAD) - m_save.machine().popmessage("No rewind state to load."); - break; - - // success - case STATERR_NONE: - { - const char *const warning = (m_save.machine().system().flags & MACHINE_SUPPORTS_SAVE) ? "" - : "\nWarning: Save states are not officially supported for this machine."; - - // figure out the qantity of valid states - int invalid = get_first_invalid_index(); - - // all states are valid - if (invalid == REWIND_INDEX_NONE) - invalid = m_state_list.size(); - - if (operation == rewind_operation::SAVE) - m_save.machine().popmessage("Rewind state %i captured.\nRewind state count: %i.%s", invalid - 1, invalid, warning); - else - m_save.machine().popmessage("Rewind state %i loaded.\nRewind state count: %i.%s", index, invalid, warning); - } - break; - - // something that shouldn't be allowed to happen - default: - m_save.machine().popmessage("Error: Unknown error during state %s.", opname); - break; - } -} - - -//------------------------------------------------- -// get_current_index - get the index of the -// state to assume as current -//------------------------------------------------- - -int rewinder::get_current_index() -{ - // nowhere to search - if (m_state_list.empty()) - return REWIND_INDEX_NONE; - - // fetch the current machine time - attotime curtime = m_save.machine().time(); - - // find the state at the current time, or at least the first one after - for (auto it = m_state_list.begin(); it < m_state_list.end(); ++it) - if (it->get()->m_time >= curtime) - return it - m_state_list.begin(); - - // all states are older - return REWIND_INDEX_NONE; -} - - -//------------------------------------------------- -// get_first_invalid_index - get the index of the -// first invalid state -//------------------------------------------------- - -int rewinder::get_first_invalid_index() -{ - for (auto it = m_state_list.begin(); it < m_state_list.end(); ++it) - if (!it->get()->m_valid) - return it - m_state_list.begin(); - - // all states are valid - return REWIND_INDEX_NONE; -} - - -//------------------------------------------------- -// invalidate - mark all the future states as -// invalid -//------------------------------------------------- - -int rewinder::invalidate() -{ - // fetch the current state index - int index = get_current_index(); - - // more invalid states may be farther back, account for them too - int invalid = get_first_invalid_index(); - - // roll back if we can - if (invalid != REWIND_INDEX_NONE && (index == REWIND_INDEX_NONE || invalid < index)) - index = invalid; - - if (index != REWIND_INDEX_NONE) - { - // if it's the last state in the list, skip further invalidation - if (++index >= m_state_list.size()) - return index; - - // invalidate all the future states, as the current input might have changed - for (auto it = m_state_list.begin() + index; it < m_state_list.end(); ++it) - it->get()->m_valid = false; - } - - // index of the first invalid state - return index; -} - - -//------------------------------------------------- -// capture - record a single state -//------------------------------------------------- - -void rewinder::capture() -{ - // fetch the current state index and invalidate the future states - int index = invalidate(); - - if (index == REWIND_INDEX_NONE) - { - // no current state, create one - std::unique_ptr<ram_state> state = std::make_unique<ram_state>(m_save); - save_error error = state->save(); - - // validate the state - if (error == STATERR_NONE) - { - // it's safe to append - m_state_list.push_back(std::move(state)); - } - else - { - // internal error, complain and evacuate - report_error(error, rewind_operation::SAVE); - return; - } - } - else - { - // update the existing state - ram_state *state = m_state_list.at(--index).get(); - save_error error = state->save(); - - // validate the state - if (error != STATERR_NONE) - { - // internal error, complain and evacuate - report_error(error, rewind_operation::SAVE); - return; - } - } - - // make sure we still fit in - check_size(); - - // success - report_error(STATERR_NONE, rewind_operation::SAVE); -} - - -//------------------------------------------------- -// step - single step back in time -//------------------------------------------------- - -void rewinder::step() -{ - // check presence of states - if (m_state_list.empty()) - { - // no states, complain and evacuate - report_error(STATERR_NOT_FOUND, rewind_operation::LOAD); - return; - } - - // fetch the current state index - int index = get_current_index(); - - // if there is room, retreat - if (index != REWIND_INDEX_FIRST) - { - // we may be on top of the list, when all states are older - if (index == REWIND_INDEX_NONE) - { - // use the last consecutively valid state, to ensure rewinder integrity - index = get_first_invalid_index(); - - if (index == REWIND_INDEX_NONE) - // all states are valid - index = m_state_list.size(); - else if (index == REWIND_INDEX_FIRST) - { - // no valid states, complain and evacuate - report_error(STATERR_NOT_FOUND, rewind_operation::LOAD); - return; - } - } - - // obtain the state pointer - ram_state *state = m_state_list.at(--index).get(); - - // try to load and report the result - report_error(state->load(), rewind_operation::LOAD, index); - return; - } - - // no valid states, complain - report_error(STATERR_NOT_FOUND, rewind_operation::LOAD); -} - - -//------------------------------------------------- // state_entry - constructor //------------------------------------------------- state_entry::state_entry(void *data, const char *name, device_t *device, const char *module, const char *tag, int index, u8 size, u32 count) - : m_data(data) - , m_name(name) - , m_device(device) - , m_module(module) - , m_tag(tag) - , m_index(index) - , m_typesize(size) - , m_typecount(count) - , m_offset(0) + : m_data(data), + m_name(name), + m_device(device), + m_module(module), + m_tag(tag), + m_index(index), + m_typesize(size), + m_typecount(count), + m_offset(0) { } //------------------------------------------------- // flip_data - reverse the endianness of a -// block of data +// block of data //------------------------------------------------- void state_entry::flip_data() diff --git a/src/emu/save.h b/src/emu/save.h index e5c8c2fdbbf..4f112796eaf 100644 --- a/src/emu/save.h +++ b/src/emu/save.h @@ -26,7 +26,6 @@ enum save_error { STATERR_NONE, - STATERR_NOT_FOUND, STATERR_ILLEGAL_REGISTRATIONS, STATERR_INVALID_HEADER, STATERR_READ_ERROR, @@ -80,25 +79,18 @@ public: u32 m_offset; // offset within the final structure }; -class ram_state; -class rewinder; - class save_manager { // type_checker is a set of templates to identify valid save types template<typename _ItemType> struct type_checker { static const bool is_atom = false; static const bool is_pointer = false; }; template<typename _ItemType> struct type_checker<_ItemType*> { static const bool is_atom = false; static const bool is_pointer = true; }; - friend class ram_state; - friend class rewinder; - public: // construction/destruction save_manager(running_machine &machine); // getters running_machine &machine() const { return m_machine; } - rewinder *rewind() { return m_rewind.get(); } int registration_count() const { return m_entry_list.size(); } bool registration_allowed() const { return m_reg_allowed; } @@ -174,69 +166,19 @@ private: // construction/destruction state_callback(save_prepost_delegate callback); - save_prepost_delegate m_func; // delegate + save_prepost_delegate m_func; // delegate }; // internal state - running_machine & m_machine; // reference to our machine - std::unique_ptr<rewinder> m_rewind; // rewinder - bool m_reg_allowed; // are registrations allowed? - int m_illegal_regs; // number of illegal registrations + running_machine & m_machine; // reference to our machine + bool m_reg_allowed; // are registrations allowed? + int m_illegal_regs; // number of illegal registrations - std::vector<std::unique_ptr<state_entry>> m_entry_list; // list of registered entries - std::vector<std::unique_ptr<ram_state>> m_ramstate_list; // list of ram states + std::vector<std::unique_ptr<state_entry>> m_entry_list; // list of registered entries std::vector<std::unique_ptr<state_callback>> m_presave_list; // list of pre-save functions std::vector<std::unique_ptr<state_callback>> m_postload_list; // list of post-load functions }; -class ram_state -{ - save_manager & m_save; // reference to save_manager - util::vectorstream m_data; // save data buffer - -public: - bool m_valid; // can we load this state? - attotime m_time; // machine timestamp - - ram_state(save_manager &save); - static size_t get_size(save_manager &save); - save_error save(); - save_error load(); -}; - -class rewinder -{ - save_manager & m_save; // reference to save_manager - bool m_enabled; // enable rewind savestates - uint32_t m_capacity; // imposed limit of total states (1-500) - std::vector<std::unique_ptr<ram_state>> m_state_list; // rewinder's own ram states - - // load/save management - enum class rewind_operation - { - SAVE, - LOAD - }; - - enum - { - REWIND_INDEX_NONE = -1, - REWIND_INDEX_FIRST = 0 - }; - - int get_current_index(); - int get_first_invalid_index(); - void check_size(); - void report_error(save_error type, rewind_operation operation, int index = REWIND_INDEX_FIRST); - -public: - rewinder(save_manager &save); - bool enabled() { return m_enabled; } - int invalidate(); - void capture(); - void step(); -}; - // template specializations to enumerate the fundamental atomic types you are allowed to save ALLOW_SAVE_TYPE_AND_ARRAY(char) diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp index d9dc013a26f..8e02afd48ed 100644 --- a/src/emu/softlist_dev.cpp +++ b/src/emu/softlist_dev.cpp @@ -44,7 +44,7 @@ image_software_list_loader image_software_list_loader::s_instance; // false_software_list_loader::load_software //------------------------------------------------- -bool false_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +bool false_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const { return false; } @@ -54,9 +54,9 @@ bool false_software_list_loader::load_software(device_image_interface &image, so // rom_software_list_loader::load_software //------------------------------------------------- -bool rom_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +bool rom_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const { - swlist.machine().rom_load().load_software_part_region(image.device(), swlist, swname, start_entry); + swlist.machine().rom_load().load_software_part_region(device, swlist, swname, start_entry); return true; } @@ -65,9 +65,9 @@ bool rom_software_list_loader::load_software(device_image_interface &image, soft // image_software_list_loader::load_software //------------------------------------------------- -bool image_software_list_loader::load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +bool image_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const { - return image.load_software(swlist, swname, start_entry); + return device.load_software(swlist, swname, start_entry); } diff --git a/src/emu/softlist_dev.h b/src/emu/softlist_dev.h index e5c893cd60a..855fee42062 100644 --- a/src/emu/softlist_dev.h +++ b/src/emu/softlist_dev.h @@ -80,7 +80,7 @@ enum software_compatibility class software_list_loader { public: - virtual bool load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const = 0; + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const = 0; }; @@ -89,7 +89,7 @@ public: class false_software_list_loader : public software_list_loader { public: - virtual bool load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; static const software_list_loader &instance() { return s_instance; } private: @@ -102,7 +102,7 @@ private: class rom_software_list_loader : public software_list_loader { public: - virtual bool load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; static const software_list_loader &instance() { return s_instance; } private: @@ -115,7 +115,7 @@ private: class image_software_list_loader : public software_list_loader { public: - virtual bool load_software(device_image_interface &image, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; static const software_list_loader &instance() { return s_instance; } private: diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index ff29b1b7442..a7e87c39f12 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -514,13 +514,9 @@ void validity_checker::validate_inlines() testi32a = (testi32a & 0x0000ffff) | 0x400000; if (count_leading_zeros(testi32a) != 9) osd_printf_error("Error testing count_leading_zeros\n"); - if (count_leading_zeros(0) != 32) - osd_printf_error("Error testing count_leading_zeros\n"); testi32a = (testi32a | 0xffff0000) & ~0x400000; if (count_leading_ones(testi32a) != 9) osd_printf_error("Error testing count_leading_ones\n"); - if (count_leading_ones(0xffffffff) != 32) - osd_printf_error("Error testing count_leading_ones\n"); } |