More clean-up

This commit is contained in:
dingusdev 2024-09-15 18:31:36 -07:00
parent 2ab23546ea
commit e2ad753f4a
5 changed files with 19 additions and 2 deletions

3
.gitignore vendored
View File

@ -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.*

View File

@ -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);

View File

@ -666,7 +666,7 @@ template void dppc_interpreter::ppc_srawi<RC1>();
/** 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);
}

View File

@ -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

View File

@ -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();