diff options
author | 2023-06-13 23:15:00 +1000 | |
---|---|---|
committer | 2023-06-13 23:15:00 +1000 | |
commit | 9ca073b15974f894e12cdae46ce8f8d8607720a3 (patch) | |
tree | 8f43f9ad78a79decfcdae00f6598ec9900aa3619 /src/devices/cpu/i86/i286.cpp | |
parent | 92640b67cc5ea189f4d86f854a54f565bbac2607 (diff) |
emu/devdelegate.h: Added resolve_safe and resolve_all_safe helpers.
Uses decay rules, so if a delegate returns a reference and you want to
supply a referene to an object you don't want copied as the default
result, remember to use std::ref.
Updated a few devices to use resolve_safe on device delegates to
streamline code.
Diffstat (limited to 'src/devices/cpu/i86/i286.cpp')
-rw-r--r-- | src/devices/cpu/i86/i286.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index 2562dcc85b9..c13985bf2eb 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -171,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)); @@ -221,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)); @@ -277,6 +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_a20_callback.resolve_safe(0xffffff); m_out_shutdown_func.resolve_safe(); } @@ -393,7 +396,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; |