diff options
Diffstat (limited to 'src/devices/cpu/i86/i286.cpp')
-rw-r--r-- | src/devices/cpu/i86/i286.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index c307e23901b..6c65ab5c39d 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -2,7 +2,6 @@ // copyright-holders:Carl #include "emu.h" #include "i286.h" -#include "debugger.h" #include "i86inline.h" /* @@ -172,6 +171,7 @@ i80286_cpu_device::i80286_cpu_device(const machine_config &mconfig, const char * , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0) , m_opcodes_config("opcodes", ENDIANNESS_LITTLE, 16, 24, 0) , m_io_config("io", ENDIANNESS_LITTLE, 16, 16, 0) + , m_a20_callback(*this) , m_out_shutdown_func(*this) { memcpy(m_timing, m_i80286_timing, sizeof(m_i80286_timing)); @@ -222,6 +222,7 @@ void i80286_cpu_device::device_reset() void i80286_cpu_device::device_start() { i8086_common_cpu_device::device_start(); + save_item(NAME(m_trap_level)); save_item(NAME(m_msw)); save_item(NAME(m_base)); @@ -278,7 +279,7 @@ void i80286_cpu_device::device_start() state_add<uint32_t>( STATE_GENPCBASE, "CURPC", [this] { return m_base[CS] + m_prev_ip; }).mask(0xffffff).noshow(); state_add( I8086_HALT, "HALT", m_halt ).mask(1); - m_out_shutdown_func.resolve_safe(); + m_a20_callback.resolve_safe(0xffffff); } device_memory_interface::space_config_vector i80286_cpu_device::memory_space_config() const @@ -370,8 +371,9 @@ void i80286_cpu_device::state_string_export(const device_state_entry &entry, std } } -bool i80286_cpu_device::memory_translate(int spacenum, int intention, offs_t &address) +bool i80286_cpu_device::memory_translate(int spacenum, int intention, offs_t &address, address_space *&target_space) { + target_space = &space(spacenum); if(spacenum == AS_PROGRAM) address &= m_amask; @@ -393,7 +395,7 @@ void i80286_cpu_device::execute_set_input(int inptnum, int state) } } else if(inptnum == INPUT_LINE_A20) - m_amask = m_a20_callback.isnull() ? 0xffffff : m_a20_callback(state); + m_amask = m_a20_callback(state); else { m_irq_state = state; @@ -850,6 +852,7 @@ void i80286_cpu_device::code_descriptor(uint16_t selector, uint16_t offset, int if (SEGDESC(r) || (GATE(r) != TSSDESCIDLE)) throw TRAP(FAULT_GP,IDXTBL(selector)); + [[fallthrough]]; case TSSDESCIDLE: switch_task(selector, gate); load_flags(CompressFlags(), CPL); @@ -878,7 +881,7 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) if(number == -1) { - number = standard_irq_callback(0); + number = standard_irq_callback(0, update_pc() & m_amask); hwint = 1; } @@ -1090,8 +1093,8 @@ void i80286_cpu_device::execute_run() { if ( m_fire_trap >= 2 ) { - interrupt(1); m_fire_trap = 0; + interrupt(1); } else { @@ -1340,7 +1343,7 @@ m_limit[sreg] = LIMIT(desc); } LOADDESC(0x842, SS); LOADDESC(0x848, DS); #undef LOADDESC - // void cast supresses warning + // void cast suppresses warning #define LOADDESC(addr, reg, r) { desc[1] = read_word(addr); desc[2] = read_word(addr + 2); desc[0] = read_word(addr + 4); \ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } LOADDESC(0x84e, m_gdtr, 1); @@ -1888,7 +1891,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; } } - + [[fallthrough]]; default: if(!common_op(op)) { |