diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp index c9ae74b78..8a4eee5be 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp @@ -2724,7 +2724,7 @@ void R4300iOp::COP1_D_ADD() return; } - if (CheckFPUInputs64(*(double *)m_FPR_D[m_Opcode.fs],*(double *)m_FPR_UDW[m_Opcode.ft])) + if (CheckFPUInputs64(*(double *)m_FPR_D[m_Opcode.fs], *(double *)m_FPR_UDW[m_Opcode.ft])) { return; } @@ -2743,7 +2743,7 @@ void R4300iOp::COP1_D_SUB() return; } - if (CheckFPUInputs64(*(double *)m_FPR_D[m_Opcode.fs],*(double *)m_FPR_UDW[m_Opcode.ft])) + if (CheckFPUInputs64(*(double *)m_FPR_D[m_Opcode.fs], *(double *)m_FPR_UDW[m_Opcode.ft])) { return; } @@ -3374,20 +3374,17 @@ bool R4300iOp::CheckFPUInput32(const float & Value) bool R4300iOp::CheckFPUInputs32(const float & Value, const float & Value2) { bool Exception = false; - bool isNan[2] = - { + bool isNan[2] = { ((*((uint32_t *)&Value) & 0x7F800000) == 0x7F800000 && (*((uint32_t *)&Value) & 0x007FFFFF) != 0x00000000), - ((*((uint32_t *)&Value2) & 0x7F800000) == 0x7F800000 && (*((uint32_t *)&Value2) & 0x007FFFFF) != 0x00000000) + ((*((uint32_t *)&Value2) & 0x7F800000) == 0x7F800000 && (*((uint32_t *)&Value2) & 0x007FFFFF) != 0x00000000), }; - bool isQNan[2] = - { + bool isQNan[2] = { ((*(uint32_t *)&Value >= 0x7F800001 && *(uint32_t *)&Value < 0x7FC00000) || (*(uint32_t *)&Value >= 0xFF800001 && *(uint32_t *)&Value < 0xFFC00000)), - ((*(uint32_t *)&Value2 >= 0x7F800001 && *(uint32_t *)&Value2 < 0x7FC00000) || (*(uint32_t *)&Value2 >= 0xFF800001 && *(uint32_t *)&Value2 < 0xFFC00000)) + ((*(uint32_t *)&Value2 >= 0x7F800001 && *(uint32_t *)&Value2 < 0x7FC00000) || (*(uint32_t *)&Value2 >= 0xFF800001 && *(uint32_t *)&Value2 < 0xFFC00000)), }; - bool isSubNormal[2] = - { + bool isSubNormal[2] = { ((*((uint32_t *)&Value) & 0x7F800000) == 0x00000000 && (*((uint32_t *)&Value) & 0x007FFFFF) != 0x00000000), - ((*((uint32_t *)&Value2) & 0x7F800000) == 0x00000000 && (*((uint32_t *)&Value2) & 0x007FFFFF) != 0x00000000) + ((*((uint32_t *)&Value2) & 0x7F800000) == 0x00000000 && (*((uint32_t *)&Value2) & 0x007FFFFF) != 0x00000000), }; if (isSubNormal[0] || isSubNormal[1]) @@ -3483,20 +3480,17 @@ bool R4300iOp::CheckFPUInput64(const double & Value) bool R4300iOp::CheckFPUInputs64(const double & Value, const double & Value2) { - bool isNan[2] = - { + bool isNan[2] = { ((*((uint64_t *)&Value) & 0x7FF0000000000000ULL) == 0x7FF0000000000000ULL && (*((uint64_t *)&Value) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL), - ((*((uint64_t *)&Value2) & 0x7FF0000000000000ULL) == 0x7FF0000000000000ULL && (*((uint64_t *)&Value2) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL) + ((*((uint64_t *)&Value2) & 0x7FF0000000000000ULL) == 0x7FF0000000000000ULL && (*((uint64_t *)&Value2) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL), }; - bool isQNan[2] = - { + bool isQNan[2] = { ((*(uint64_t *)&Value >= 0x7FF0000000000001 && *(uint64_t *)&Value <= 0x7FF7FFFFFFFFFFFF) || (*(uint64_t *)&Value >= 0xFFF0000000000001 && *(uint64_t *)&Value <= 0xFFF7FFFFFFFFFFFF)), ((*(uint64_t *)&Value2 >= 0x7FF0000000000001 && *(uint64_t *)&Value2 <= 0x7FF7FFFFFFFFFFFF) || (*(uint64_t *)&Value2 >= 0xFFF0000000000001 && *(uint64_t *)&Value2 <= 0xFFF7FFFFFFFFFFFF)), }; - bool isSubNormal[2] = - { + bool isSubNormal[2] = { ((*((uint64_t *)&Value) & 0x7FF0000000000000ULL) == 0x0000000000000000ULL && (*((uint64_t *)&Value) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL), - ((*((uint64_t *)&Value2) & 0x7FF0000000000000ULL) == 0x0000000000000000ULL && (*((uint64_t *)&Value2) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL) + ((*((uint64_t *)&Value2) & 0x7FF0000000000000ULL) == 0x0000000000000000ULL && (*((uint64_t *)&Value2) & 0x000FFFFFFFFFFFFFULL) != 0x0000000000000000ULL), }; bool Exception = false; diff --git a/Source/Project64-core/N64System/MemoryHandler/PeripheralInterfaceHandler.cpp b/Source/Project64-core/N64System/MemoryHandler/PeripheralInterfaceHandler.cpp index 2e80d4b7e..2c0e99f68 100644 --- a/Source/Project64-core/N64System/MemoryHandler/PeripheralInterfaceHandler.cpp +++ b/Source/Project64-core/N64System/MemoryHandler/PeripheralInterfaceHandler.cpp @@ -434,7 +434,7 @@ void PeripheralInterfaceHandler::PI_DMA_WRITE() BlockLen = 0; } } - for (int32_t i = 0; i < BlockLen ; i++) + for (int32_t i = 0; i < BlockLen; i++) { Rdram[(PI_DRAM_ADDR_REG + i) ^ 3] = Block[i]; } diff --git a/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.cpp b/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.cpp index 52ffd4077..02aad6577 100644 --- a/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.cpp +++ b/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.cpp @@ -87,15 +87,15 @@ bool RDRAMRegistersHandler::Write32(uint32_t Address, uint32_t Value, uint32_t M { case 0x00: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].DeviceType", m_PC, Value, Mask, DeviceID); break; case 0x04: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].DeviceId", m_PC, Value, Mask, DeviceID); break; - case 0x08: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].Delay", m_PC, Value, Mask, DeviceID); break; - case 0x0C: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].Mode", m_PC, Value, Mask, DeviceID); break; - case 0x10: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].RefreshInterval", m_PC, Value, Mask, DeviceID); break; - case 0x14: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].RefreshRow", m_PC, Value, Mask, DeviceID); break; - case 0x18: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].RasInterval", m_PC, Value, Mask, DeviceID); break; - case 0x1C: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].MinInterval", m_PC, Value, Mask, DeviceID); break; - case 0x20: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].AddressSelect", m_PC, Value, Mask, DeviceID); break; - case 0x24: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].DeviceManufacturer", m_PC, Value, Mask, DeviceID); break; - case 0x28: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].CurrentControl", m_PC, Value, Mask, DeviceID); break; + case 0x08: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].Delay", m_PC, Value, Mask, DeviceID); break; + case 0x0C: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].Mode", m_PC, Value, Mask, DeviceID); break; + case 0x10: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].RefreshInterval", m_PC, Value, Mask, DeviceID); break; + case 0x14: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].RefreshRow", m_PC, Value, Mask, DeviceID); break; + case 0x18: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].RasInterval", m_PC, Value, Mask, DeviceID); break; + case 0x1C: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].MinInterval", m_PC, Value, Mask, DeviceID); break; + case 0x20: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].AddressSelect", m_PC, Value, Mask, DeviceID); break; + case 0x24: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].DeviceManufacturer", m_PC, Value, Mask, DeviceID); break; + case 0x28: LogMessage("%016llX: Writing 0x%08X (Mask: 0x%08X) to Device[%d].CurrentControl", m_PC, Value, Mask, DeviceID); break; default: if (HaveDebugger()) { diff --git a/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.h b/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.h index 5f07bca15..81dababae 100644 --- a/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.h +++ b/Source/Project64-core/N64System/MemoryHandler/RDRAMRegistersHandler.h @@ -50,6 +50,7 @@ class RDRAMRegistersHandler : uint32_t DeviceManufacturer; uint32_t CurrentControl; }; + public: RDRAMRegistersHandler(CRegisters & Reg);