diff options
author | Vas Crabb <vas@vastheman.com> | 2019-11-01 00:47:41 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2019-11-01 00:47:41 +1100 |
commit | 6f4c1f6e5b2525ac8b700b3a0754f5e99c4223e1 (patch) | |
tree | 4b0e0ac5cf1c3a7fd518a7d8f4d12f39291b2629 /src/devices/cpu | |
parent | 0be348c7fbc8c0478f724ba098dabeb9eb3aab8c (diff) |
Spring cleaning:
* Changed emu_fatalerror to use util::string_format semantics
* Fixed some incorrectly marked up stuff in build scripts
* Make internal layout compression type a scoped enum (only zlib is supported still, but at least the values aren't magic numbers now)
* Fixed memory leaks in Xbox USB
* There can only be one "perfect quantum" device - enforce that only the root machine can set it, as allowing subdevices to will cause weird issues with slot cards overiding it
* Allow multiple devices to set maximum quantum and use the most restrictive one (it's maximum quantum, it would be minimum interleave)
* Got rid of device_slot_card_interface as it wasn't providing value
* Added a helper template to reduce certain kinds of boilerplate in slots/buses
* Cleaned up some particularly bad slot code (plenty more of that to do), and made some slots more idiomatic
Diffstat (limited to 'src/devices/cpu')
-rw-r--r-- | src/devices/cpu/alto2/a2emu.cpp | 14 | ||||
-rw-r--r-- | src/devices/cpu/alto2/a2ram.cpp | 22 | ||||
-rw-r--r-- | src/devices/cpu/alto2/alto2cpu.cpp | 32 | ||||
-rw-r--r-- | src/devices/cpu/alto2/alto2cpu.h | 14 |
4 files changed, 36 insertions, 46 deletions
diff --git a/src/devices/cpu/alto2/a2emu.cpp b/src/devices/cpu/alto2/a2emu.cpp index a7ea40a6aca..22aaaadcb68 100644 --- a/src/devices/cpu/alto2/a2emu.cpp +++ b/src/devices/cpu/alto2/a2emu.cpp @@ -267,13 +267,13 @@ void alto2_cpu_device::f1_early_emu_block() CPU_CLR_TASK_WAKEUP(m_task); LOG((this,LOG_EMU,2, " BLOCK %02o:%s\n", m_task, task_name(m_task))); #elif 0 - fatal(1, "Emulator task want's to BLOCK.\n" \ - "%s-%04o: r:%02o af:%02o bs:%02o f1:%02o f2:%02o" \ - " t:%o l:%o next:%05o next2:%05o cycle:%lld\n", - task_name(m_task), m_mpc, - m_rsel, m_daluf, m_dbs, m_df1, mdf2, - m_dloadt, m_dloatl, m_next, m_next2, - ntime() / CPU_MICROCYCLE_TIME); + throw emu_fatalerror(1, "Emulator task want's to BLOCK.\n" \ + "%s-%04o: r:%02o af:%02o bs:%02o f1:%02o f2:%02o" \ + " t:%o l:%o next:%05o next2:%05o cycle:%lld\n", + task_name(m_task), m_mpc, + m_rsel, m_daluf, m_dbs, m_df1, mdf2, + m_dloadt, m_dloatl, m_next, m_next2, + ntime() / CPU_MICROCYCLE_TIME); #else /* just ignore (?) */ #endif diff --git a/src/devices/cpu/alto2/a2ram.cpp b/src/devices/cpu/alto2/a2ram.cpp index 3aab054871d..a9babb97900 100644 --- a/src/devices/cpu/alto2/a2ram.cpp +++ b/src/devices/cpu/alto2/a2ram.cpp @@ -246,7 +246,7 @@ void alto2_cpu_device::f1_late_swmode() branch_ROM("RAM0", 0); break; default: - fatal(1, "Impossible current mpc %u\n", page); + throw emu_fatalerror(1, "Impossible current mpc %u\n", page); } break; @@ -262,7 +262,7 @@ void alto2_cpu_device::f1_late_swmode() branch_ROM("ROM0", 1); break; default: - fatal(1, "Impossible next %u\n", next); + throw emu_fatalerror(1, "Impossible next %u\n", next); } break; case 1: /* ROM1 to ROM0 or RAM0 */ @@ -274,7 +274,7 @@ void alto2_cpu_device::f1_late_swmode() branch_RAM("ROM1", 0); break; default: - fatal(1, "Impossible next %u\n", next); + throw emu_fatalerror(1, "Impossible next %u\n", next); } break; case 2: /* RAM0 to ROM0 or ROM1 */ @@ -286,11 +286,11 @@ void alto2_cpu_device::f1_late_swmode() branch_ROM("RAM0", 1); break; default: - fatal(1, "Impossible next %u\n", next); + throw emu_fatalerror(1, "Impossible next %u\n", next); } break; default: - fatal(1, "Impossible current mpc %u\n", page); + throw emu_fatalerror(1, "Impossible current mpc %u\n", page); } break; @@ -313,7 +313,7 @@ void alto2_cpu_device::f1_late_swmode() branch_RAM("ROM0", 0); break; default: - fatal(1, "Impossible next %u\n", next); + throw emu_fatalerror(1, "Impossible next %u\n", next); } break; case 1: /* RAM0 to ROM0, RAM2, RAM1, RAM1 */ @@ -331,7 +331,7 @@ void alto2_cpu_device::f1_late_swmode() branch_RAM("RAM0", 1); break; default: - fatal(1, "Impossible next %u\n", next); + throw emu_fatalerror(1, "Impossible next %u\n", next); } break; case 2: /* RAM1 to ROM0, RAM2, RAM0, RAM0 */ @@ -349,7 +349,7 @@ void alto2_cpu_device::f1_late_swmode() branch_RAM("RAM1", 0); break; default: - fatal(1, "Impossible next %u\n", next); + throw emu_fatalerror(1, "Impossible next %u\n", next); } break; case 3: /* RAM2 to ROM0, RAM1, RAM0, RAM0 */ @@ -367,15 +367,15 @@ void alto2_cpu_device::f1_late_swmode() branch_RAM("RAM2", 0); break; default: - fatal(1, "Impossible next %u\n", next); + throw emu_fatalerror(1, "Impossible next %u\n", next); } break; default: - fatal(1, "Impossible current mpc %u\n", page); + throw emu_fatalerror(1, "Impossible current mpc %u\n", page); } break; default: - fatal(1, "Impossible control ROM/RAM config %u (%u CROM pages, %u CRAM pages)\n", + throw emu_fatalerror(1, "Impossible control ROM/RAM config %u (%u CROM pages, %u CRAM pages)\n", m_cram_config, m_ucode_rom_pages, m_ucode_ram_pages); } } diff --git a/src/devices/cpu/alto2/alto2cpu.cpp b/src/devices/cpu/alto2/alto2cpu.cpp index 57ed58ddc03..bffe5071192 100644 --- a/src/devices/cpu/alto2/alto2cpu.cpp +++ b/src/devices/cpu/alto2/alto2cpu.cpp @@ -1093,14 +1093,6 @@ void alto2_cpu_device::execute_set_input(int inputnum, int state) { } -void alto2_cpu_device::fatal(int exitcode, const char *format, ...) -{ - va_list ap; - va_start(ap, format); - emu_fatalerror error(exitcode, format, ap); - va_end(ap); -} - /** @brief task names */ const char* alto2_cpu_device::task_name(int task) { @@ -1268,42 +1260,42 @@ void alto2_cpu_device::watch_write(uint32_t addr, uint32_t data) /** @brief fatal exit on unitialized dynamic phase BUS source */ void alto2_cpu_device::bs_early_bad() { - fatal(9,"fatal: bad early bus source pointer for task %s, mpc:%05o bs:%s\n", - task_name(m_task), m_mpc, bs_name(bs())); + throw emu_fatalerror(9,"fatal: bad early bus source pointer for task %s, mpc:%05o bs:%s\n", + task_name(m_task), m_mpc, bs_name(bs())); } /** @brief fatal exit on unitialized latching phase BUS source */ void alto2_cpu_device::bs_late_bad() { - fatal(9,"fatal: bad late bus source pointer for task %s, mpc:%05o bs: %s\n", - task_name(m_task), m_mpc, bs_name(bs())); + throw emu_fatalerror(9,"fatal: bad late bus source pointer for task %s, mpc:%05o bs: %s\n", + task_name(m_task), m_mpc, bs_name(bs())); } /** @brief fatal exit on unitialized dynamic phase F1 function */ void alto2_cpu_device::f1_early_bad() { - fatal(9,"fatal: bad early f1 function pointer for task %s, mpc:%05o f1: %s\n", - task_name(m_task), m_mpc, f1_name(f1())); + throw emu_fatalerror(9,"fatal: bad early f1 function pointer for task %s, mpc:%05o f1: %s\n", + task_name(m_task), m_mpc, f1_name(f1())); } /** @brief fatal exit on unitialized latching phase F1 function */ void alto2_cpu_device::f1_late_bad() { - fatal(9,"fatal: bad late f1 function pointer for task %s, mpc:%05o f1: %s\n", - task_name(m_task), m_mpc, f1_name(f1())); + throw emu_fatalerror(9,"fatal: bad late f1 function pointer for task %s, mpc:%05o f1: %s\n", + task_name(m_task), m_mpc, f1_name(f1())); } /** @brief fatal exit on unitialized dynamic phase F2 function */ void alto2_cpu_device::f2_early_bad() { - fatal(9,"fatal: bad early f2 function pointer for task %s, mpc:%05o f2: %s\n", - task_name(m_task), m_mpc, f2_name(f2())); + throw emu_fatalerror(9,"fatal: bad early f2 function pointer for task %s, mpc:%05o f2: %s\n", + task_name(m_task), m_mpc, f2_name(f2())); } /** @brief fatal exit on unitialized latching phase F2 function */ void alto2_cpu_device::f2_late_bad() { - fatal(9,"fatal: bad late f2 function pointer for task %s, mpc:%05o f2: %s\n", + throw emu_fatalerror(9,"fatal: bad late f2 function pointer for task %s, mpc:%05o f2: %s\n", task_name(m_task), m_mpc, f2_name(f2())); } @@ -1768,7 +1760,7 @@ void alto2_cpu_device::f1_early_task() return; } } - fatal(3, "no tasks requesting service\n"); + throw emu_fatalerror(3, "no tasks requesting service\n"); #endif /* !USE_PRIO_F9318 */ } diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h index e0fbc075895..c701ab59a77 100644 --- a/src/devices/cpu/alto2/alto2cpu.h +++ b/src/devices/cpu/alto2/alto2cpu.h @@ -235,8 +235,6 @@ protected: virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; private: - void fatal(int level, const char *format, ...); - devcb_read16 m_kb_read_callback; devcb_write16 m_utilout_callback; @@ -868,14 +866,14 @@ private: void hard_reset(); //!< reset the various registers void soft_reset(); //!< soft reset - void bs_early_bad(); //! bs dummy early function - void bs_late_bad(); //! bs dummy late function + [[noreturn]] void bs_early_bad(); //! bs dummy early function + [[noreturn]] void bs_late_bad(); //! bs dummy late function - void f1_early_bad(); //! f1 dummy early function - void f1_late_bad(); //! f1 dummy late function + [[noreturn]] void f1_early_bad(); //! f1 dummy early function + [[noreturn]] void f1_late_bad(); //! f1 dummy late function - void f2_early_bad(); //! f2 dummy early function - void f2_late_bad(); //! f2 dummy late function + [[noreturn]] void f2_early_bad(); //! f2 dummy early function + [[noreturn]] void f2_late_bad(); //! f2 dummy late function DECLARE_READ16_MEMBER( noop_r ); //!< read open bus (0177777) DECLARE_WRITE16_MEMBER( noop_w ); //!< write open bus |