diff options
author | 2021-01-02 16:49:28 +0100 | |
---|---|---|
committer | 2021-01-02 16:49:59 +0100 | |
commit | b74111a0b27e1239ffde9f9d8a7e901fb93bc9fa (patch) | |
tree | 3511dadeea6b8d2ef73e7f0ad205d48e0cac47dc /src | |
parent | ca01e891e1110d4d707add641aa759fcfd9bcf0e (diff) |
odyssey2: fix loading games with -cart not working
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/bus/odyssey2/slot.cpp | 7 | ||||
-rw-r--r-- | src/devices/cpu/mcs48/mcs48.cpp | 35 | ||||
-rw-r--r-- | src/devices/cpu/mcs48/mcs48.h | 1 |
3 files changed, 31 insertions, 12 deletions
diff --git a/src/devices/bus/odyssey2/slot.cpp b/src/devices/bus/odyssey2/slot.cpp index 50bc7ce20c3..0545ea118b4 100644 --- a/src/devices/bus/odyssey2/slot.cpp +++ b/src/devices/bus/odyssey2/slot.cpp @@ -154,6 +154,11 @@ image_init_result o2_cart_slot_device::call_load() u32 size = length(); fread(m_cart->m_rom, size); + m_cart->m_rom_size = size; + m_cart->m_exrom_size = 0; + m_cart->m_voice_size = 0; + m_b = 0; + m_type = (size == 0x4000) ? O2_RALLY : O2_STD; } @@ -181,8 +186,6 @@ std::string o2_cart_slot_device::get_default_card_software(get_default_card_soft int type = (size == 0x4000) ? O2_RALLY : O2_STD; slot_string = o2_get_slot(type); - //printf("type: %s\n", slot_string); - return std::string(slot_string); } diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index 7aabcc4348a..11b524e4524 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -1096,20 +1096,34 @@ void mcs48_cpu_device::device_config_complete() void mcs48_cpu_device::device_start() { - /* External access line - * EA=1 : read from external rom - * EA=0 : read from internal rom - */ + // zerofill + m_prevpc = 0; + m_pc = 0; m_a = 0; + m_psw = 0; + m_p1 = 0; + m_p2 = 0; m_timer = 0; m_prescaler = 0; m_t1_history = 0; m_dbbi = 0; m_dbbo = 0; - m_irq_state = 0; - /* FIXME: Current implementation suboptimal */ + m_irq_state = false; + m_irq_polled = false; + m_irq_in_progress = false; + m_timer_overflow = false; + m_timer_flag = false; + m_tirq_enabled = false; + m_xirq_enabled = false; + m_timecount_enabled = 0; + m_flags_enabled = false; + m_dma_enabled = false; + m_a11 = 0; + + // External access line, EA=1: read from external rom, EA=0: read from internal rom + // FIXME: Current implementation suboptimal m_ea = (m_int_rom_size ? 0 : 1); space(AS_PROGRAM).cache(m_program); @@ -1125,7 +1139,10 @@ void mcs48_cpu_device::device_start() m_test_in_cb.resolve_all_safe(0); m_prog_out_cb.resolve_safe(); - /* set up the state table */ + // ensure that regptr is valid before get_info gets called + update_regptr(); + + // set up the state table { state_add(MCS48_PC, "PC", m_pc).mask(0xfff); state_add(STATE_GENPC, "GENPC", m_pc).mask(0xfff).noshow(); @@ -1157,9 +1174,7 @@ void mcs48_cpu_device::device_start() } - /* ensure that regptr is valid before get_info gets called */ - update_regptr(); - + // register for savestates save_item(NAME(m_prevpc)); save_item(NAME(m_pc)); diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h index 024c084c7f4..a2a093d3c36 100644 --- a/src/devices/cpu/mcs48/mcs48.h +++ b/src/devices/cpu/mcs48/mcs48.h @@ -147,6 +147,7 @@ protected: virtual void device_start() override; virtual void device_config_complete() override; virtual void device_reset() override; + virtual void device_post_load() override { update_regptr(); } // device_execute_interface overrides virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const noexcept override { return (clocks + 15 - 1) / 15; } |