From e2ad753f4af59469ee6a4d969e0d210c2f206ed7 Mon Sep 17 00:00:00 2001 From: dingusdev <52434309+dingusdev@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:31:36 -0700 Subject: [PATCH] More clean-up --- .gitignore | 3 +++ cpu/ppc/ppcfpopcodes.cpp | 10 ++++++++++ cpu/ppc/ppcopcodes.cpp | 2 +- devices/common/scsi/scsibusctrl.cpp | 2 +- main.cpp | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 806a256..bf501f6 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ CMakeSettings.json *.vcxproj *.vcxproj.filters +# Ignore Visual Studio auto-save recovery folder +enc_temp_folder/ + # Ignore CodeLite configuration files *.workspace *.workspace.* diff --git a/cpu/ppc/ppcfpopcodes.cpp b/cpu/ppc/ppcfpopcodes.cpp index 346f072..6d36ac4 100644 --- a/cpu/ppc/ppcfpopcodes.cpp +++ b/cpu/ppc/ppcfpopcodes.cpp @@ -103,6 +103,12 @@ inline static void snan_double_check(int reg_a, int reg_b) { ppc_state.fpscr |= FX | VX | VXSNAN; } +inline static void max_double_check(double value_a, double value_b) { + if (((value_a == DBL_MAX) && (value_b == DBL_MAX)) || + ((value_a == -DBL_MAX) && (value_b == -DBL_MAX))) + ppc_state.fpscr |= FX | OX | XX | FI; +} + inline static bool check_qnan(int check_reg) { uint64_t check_int = ppc_state.fpr[check_reg].int64_r; return (((check_int & (0x7FFULL << 52)) == (0x7FFULL << 52)) && @@ -151,10 +157,12 @@ void dppc_interpreter::ppc_fadd() { ppc_grab_regsfpdab(ppc_cur_instruction); snan_double_check(reg_a, reg_b); + max_double_check(val_reg_a, val_reg_b); double ppc_dblresult64_d = val_reg_a + val_reg_b; ppc_store_dfpresult_flt(reg_d, ppc_dblresult64_d); fpresult_update(ppc_dblresult64_d); + ppc_update_fex(); if (rec) ppc_update_cr1(); @@ -170,6 +178,7 @@ void dppc_interpreter::ppc_fsub() { snan_double_check(reg_a, reg_b); double ppc_dblresult64_d = val_reg_a - val_reg_b; + ppc_store_dfpresult_flt(reg_d, ppc_dblresult64_d); fpresult_update(ppc_dblresult64_d); @@ -311,6 +320,7 @@ void dppc_interpreter::ppc_fsubs() { snan_double_check(reg_a, reg_b); double ppc_dblresult64_d = (float)(val_reg_a - val_reg_b); + ppc_store_sfpresult_flt(reg_d, ppc_dblresult64_d); fpresult_update(ppc_dblresult64_d); diff --git a/cpu/ppc/ppcopcodes.cpp b/cpu/ppc/ppcopcodes.cpp index 7c34ce2..65ef7d2 100644 --- a/cpu/ppc/ppcopcodes.cpp +++ b/cpu/ppc/ppcopcodes.cpp @@ -666,7 +666,7 @@ template void dppc_interpreter::ppc_srawi(); /** mask generator for rotate and shift instructions (ยง 4.2.1.4 PowerpC PEM) */ static inline uint32_t rot_mask(unsigned rot_mb, unsigned rot_me) { uint32_t m1 = 0xFFFFFFFFUL >> rot_mb; - uint32_t m2 = (uint32_t)(0xFFFFFFFFUL << (31 - rot_me)); + uint32_t m2 = uint32_t(0xFFFFFFFFUL << (31 - rot_me)); return ((rot_mb <= rot_me) ? m2 & m1 : m1 | m2); } diff --git a/devices/common/scsi/scsibusctrl.cpp b/devices/common/scsi/scsibusctrl.cpp index 146d488..18899cf 100644 --- a/devices/common/scsi/scsibusctrl.cpp +++ b/devices/common/scsi/scsibusctrl.cpp @@ -279,7 +279,7 @@ uint8_t ScsiBusController::fifo_pop() { if (this->fifo_pos) { data = this->data_fifo[0]; if (--this->fifo_pos) - std:memmove(this->data_fifo, &this->data_fifo[1], this->fifo_pos); + std::memmove(this->data_fifo, &this->data_fifo[1], this->fifo_pos); } // see if we need to refill FIFO diff --git a/main.cpp b/main.cpp index d1f58c0..ea34deb 100644 --- a/main.cpp +++ b/main.cpp @@ -253,6 +253,10 @@ void run_machine(std::string machine_str, std::string bootrom_path, uint32_t exe power_off_reason = po_starting_up; enter_debugger(); break; + case threaded_int: + power_off_reason = po_starting_up; + enter_debugger(); + break; case debugger: power_off_reason = po_enter_debugger; enter_debugger();