Make JKRAramPiece trap on invalid pointers

This commit is contained in:
PJB3005
2026-03-12 12:46:54 +01:00
parent 3c83c98887
commit d48b8196eb
+10
View File
@@ -27,6 +27,10 @@ JSUList<JKRAMCommand> JKRAramPiece::sAramPieceCommandList;
OSMutex JKRAramPiece::mMutex;
#if DEBUG && TARGET_PC
volatile u8 forceRead;
#endif
JKRAMCommand* JKRAramPiece::orderAsync(int direction, uintptr_t source, uintptr_t destination, u32 length,
JKRAramBlock* block, JKRAMCommand::AsyncCallback callback) {
lock();
@@ -45,6 +49,12 @@ JKRAMCommand* JKRAramPiece::orderAsync(int direction, uintptr_t source, uintptr_
JKRAramPiece::prepareCommand(direction, source, destination, length, block, callback);
message->setting(1, command);
#if DEBUG && TARGET_PC
if (direction == ARAM_DIR_MRAM_TO_ARAM) {
forceRead = *reinterpret_cast<u8*>(source);
}
#endif
OSSendMessage(&JKRAram::sMessageQueue, message, OS_MESSAGE_BLOCK);
if (command->mCallback != NULL) {
sAramPieceCommandList.append(&command->mPieceLink);