summaryrefslogtreecommitdiff
path: root/src/nw4r
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-08-20 20:55:56 +0200
committerrobojumper <robojumper@gmail.com>2025-08-20 20:55:56 +0200
commit50c32beaa74ad74efbb4ed8200f81eba63e91557 (patch)
treec62fd1fdcd8c9e39ed8185d2e1cd2600dc4fb196 /src/nw4r
parent897de53b2dd1c5a315a995db768b083b0267ff5d (diff)
Various exception/assert files
Diffstat (limited to 'src/nw4r')
-rw-r--r--src/nw4r/db/db_exception.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nw4r/db/db_exception.cpp b/src/nw4r/db/db_exception.cpp
index dccba52e..69f1d567 100644
--- a/src/nw4r/db/db_exception.cpp
+++ b/src/nw4r/db/db_exception.cpp
@@ -4,6 +4,7 @@
#include "nw4r/db/db_mapFile.h"
#include "rvl/GX.h" // IWYU pragma: export
#include "rvl/VI.h" // IWYU pragma: export
+#include "rvl/OS/OSError.h"
#include "string.h"
@@ -63,12 +64,13 @@ void Exception_Init() {
OSCreateThread(&sException.thread, RunThread_, nullptr, sThreadBuffer + 0x4000, 0x4000, 0, 1);
OSInitMessageQueue(&sException.queue, sMessageBuffer, 1);
OSResumeThread(&sException.thread);
- OSSetErrorHandler(2, ErrorHandler_);
- OSSetErrorHandler(3, ErrorHandler_);
- OSSetErrorHandler(5, ErrorHandler_);
- OSSetErrorHandler(15, ErrorHandler_);
+ // UB: casting non-variadic function to variadic (and letting OS invoke it)
+ OSSetErrorHandler(OS_ERR_DSI, (OSErrorHandler)ErrorHandler_);
+ OSSetErrorHandler(OS_ERR_ISI, (OSErrorHandler)ErrorHandler_);
+ OSSetErrorHandler(OS_ERR_ALIGNMENT, (OSErrorHandler)ErrorHandler_);
+ OSSetErrorHandler(OS_ERR_PROTECTION, (OSErrorHandler)ErrorHandler_);
__OSFpscrEnableBits = 0;
- OSSetErrorHandler(16, nullptr);
+ OSSetErrorHandler(OS_ERR_FP_EXCEPTION, nullptr);
}
extern "C" u32 PPCMfmsr();
extern "C" void PPCMtmsr(u32);