diff --git a/include/JSystem/JKernel/JKRAramPiece.h b/include/JSystem/JKernel/JKRAramPiece.h index 25f304f02b..130f81203b 100644 --- a/include/JSystem/JKernel/JKRAramPiece.h +++ b/include/JSystem/JKernel/JKRAramPiece.h @@ -27,8 +27,8 @@ public: /* 0x40 */ s32 mTransferDirection; /* 0x44 */ u32 mDataLength; - /* 0x48 */ u32 mSrc; - /* 0x4C */ u32 mDst; + /* 0x48 */ uintptr_t mSrc; + /* 0x4C */ uintptr_t mDst; /* 0x50 */ JKRAramBlock* mAramBlock; /* 0x54 */ u32 field_0x54; /* 0x58 */ AsyncCallback mCallback; @@ -63,15 +63,15 @@ public: static JSUList sAramPieceCommandList; public: - static JKRAMCommand* prepareCommand(int, u32, u32, u32, JKRAramBlock*, + static JKRAMCommand* prepareCommand(int, uintptr_t, uintptr_t, u32, JKRAramBlock*, JKRAMCommand::AsyncCallback); static void sendCommand(JKRAMCommand*); - static JKRAMCommand* orderAsync(int, u32, u32, u32, JKRAramBlock*, JKRAMCommand::AsyncCallback); + static JKRAMCommand* orderAsync(int, uintptr_t, uintptr_t, u32, JKRAramBlock*, JKRAMCommand::AsyncCallback); static BOOL sync(JKRAMCommand*, int); - static BOOL orderSync(int, u32, u32, u32, JKRAramBlock*); + static BOOL orderSync(int, uintptr_t, uintptr_t, u32, JKRAramBlock*); static void startDMA(JKRAMCommand*); - static void doneDMA(u32); + static void doneDMA(uintptr_t); private: static void lock() { OSLockMutex(&mMutex); } @@ -82,7 +82,7 @@ inline void JKRAramPcs_SendCommand(JKRAMCommand* command) { JKRAramPiece::sendCommand(command); } -inline BOOL JKRAramPcs(int direction, u32 source, u32 destination, u32 length, +inline BOOL JKRAramPcs(int direction, uintptr_t source, uintptr_t destination, u32 length, JKRAramBlock* block) { return JKRAramPiece::orderSync(direction, source, destination, length, block); } diff --git a/include/dolphin/ar.h b/include/dolphin/ar.h index 0a5d781a8f..46f163aef9 100644 --- a/include/dolphin/ar.h +++ b/include/dolphin/ar.h @@ -10,7 +10,7 @@ extern "C" { #endif -typedef void (*ARQCallback)(u32 pointerToARQRequest); +typedef void (*ARQCallback)(uintptr_t pointerToARQRequest); struct ARQRequest { /* 0x00 */ struct ARQRequest *next; @@ -59,7 +59,7 @@ void ARClear(u32 flag); // ARQ void ARQInit(void); void ARQReset(void); -void ARQPostRequest(ARQRequest* request, u32 owner, u32 type, u32 priority, u32 source, u32 dest, u32 length, ARQCallback callback); +void ARQPostRequest(ARQRequest* request, u32 owner, u32 type, u32 priority, uintptr_t source, uintptr_t dest, u32 length, ARQCallback callback); void ARQRemoveRequest(ARQRequest* request); void ARQRemoveOwnerRequest(u32 owner); void ARQFlushQueue(void); diff --git a/src/JSystem/JKernel/JKRAramPiece.cpp b/src/JSystem/JKernel/JKRAramPiece.cpp index e74cf5d5c7..d0b55ba07b 100644 --- a/src/JSystem/JKernel/JKRAramPiece.cpp +++ b/src/JSystem/JKernel/JKRAramPiece.cpp @@ -6,7 +6,7 @@ #include "JSystem/JUtility/JUTException.h" #include -JKRAMCommand* JKRAramPiece::prepareCommand(int direction, u32 src, u32 dst, u32 length, +JKRAMCommand* JKRAramPiece::prepareCommand(int direction, uintptr_t src, uintptr_t dst, u32 length, JKRAramBlock* block, JKRAMCommand::AsyncCallback callback) { JKRAMCommand* command = new (JKRGetSystemHeap(), -4) JKRAMCommand(); @@ -27,7 +27,7 @@ JSUList JKRAramPiece::sAramPieceCommandList; OSMutex JKRAramPiece::mMutex; -JKRAMCommand* JKRAramPiece::orderAsync(int direction, u32 source, u32 destination, u32 length, +JKRAMCommand* JKRAramPiece::orderAsync(int direction, uintptr_t source, uintptr_t destination, u32 length, JKRAramBlock* block, JKRAMCommand::AsyncCallback callback) { lock(); if ((source & 0x1f) != 0 || (destination & 0x1f) != 0) { @@ -73,7 +73,7 @@ BOOL JKRAramPiece::sync(JKRAMCommand* command, int is_non_blocking) { return TRUE; } -BOOL JKRAramPiece::orderSync(int direction, u32 source, u32 destination, u32 length, +BOOL JKRAramPiece::orderSync(int direction, uintptr_t source, uintptr_t destination, u32 length, JKRAramBlock* block) { lock(); @@ -97,7 +97,7 @@ void JKRAramPiece::startDMA(JKRAMCommand* command) { command->mDst, command->mDataLength, JKRAramPiece::doneDMA); } -void JKRAramPiece::doneDMA(u32 requestAddress) { +void JKRAramPiece::doneDMA(uintptr_t requestAddress) { JKRAMCommand* command = (JKRAMCommand*)requestAddress; if (command->mTransferDirection == 1) { diff --git a/src/JSystem/JKernel/JKRDvdAramRipper.cpp b/src/JSystem/JKernel/JKRDvdAramRipper.cpp index 3e07727a58..8b29459a9a 100644 --- a/src/JSystem/JKernel/JKRDvdAramRipper.cpp +++ b/src/JSystem/JKernel/JKRDvdAramRipper.cpp @@ -103,7 +103,7 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) { fileSize = ALIGN_NEXT(fileSize, 0x20); if (command->mExpandSwitch == 1) { u8 buffer[0x40]; - u8* bufPtr = (u8*)ALIGN_NEXT((u32)&buffer, 0x20); + u8* bufPtr = (u8*)ALIGN_NEXT((uintptr_t)&buffer, 0x20); while (true) { s32 result = DVDReadPrio(dvdFile->getFileInfo(), bufPtr, 0x20, 0, 2); if (result >= 0) { @@ -472,7 +472,7 @@ static u32 dmaBufferFlush(u32 param_1) { return 0; } u32 size = ALIGN_NEXT(dmaCurrent - dmaBuf, 0x20); - JKRAramPcs(0, (u32)dmaBuf, param_1, size, NULL); + JKRAramPcs(0, (uintptr_t)dmaBuf, param_1, size, NULL); dmaCurrent = dmaBuf; return size; } diff --git a/src/JSystem/JKernel/JKRDvdFile.cpp b/src/JSystem/JKernel/JKRDvdFile.cpp index 07bd9505a5..41eec5809d 100644 --- a/src/JSystem/JKernel/JKRDvdFile.cpp +++ b/src/JSystem/JKernel/JKRDvdFile.cpp @@ -124,7 +124,7 @@ s32 JKRDvdFile::sync(void) { void JKRDvdFile::doneProcess(s32 id, DVDFileInfo* fileInfo) { // fileInfo->field_0x3c looks like some kind of user pointer? - JKRDvdFile* dvdFile = *(JKRDvdFile**)((u8*)fileInfo + 0x3c); + JKRDvdFile* dvdFile = *(JKRDvdFile**)((u8*)fileInfo + (offsetof(JKRDvdFile, mDvdFile) - offsetof(JKRDvdFile, mFileInfo))); OSSendMessage(&dvdFile->mMessageQueue2, (OSMessage)id, OS_MESSAGE_NOBLOCK); } diff --git a/src/dusk/stubs.cpp b/src/dusk/stubs.cpp index 38e6b2716b..f8c84d498a 100644 --- a/src/dusk/stubs.cpp +++ b/src/dusk/stubs.cpp @@ -1297,7 +1297,7 @@ u32 ARInit(u32* stack_index_addr, u32 num_entries) { } #pragma mark ARQ -void ARQPostRequest(ARQRequest* request, u32 owner, u32 type, u32 priority, u32 source, u32 dest, +void ARQPostRequest(ARQRequest* request, u32 owner, u32 type, u32 priority, uintptr_t source, uintptr_t dest, u32 length, ARQCallback callback) { // Emulate ARAM DMA transfers using memcpy. // type 0 = MRAM -> ARAM, type 1 = ARAM -> MRAM @@ -1319,7 +1319,7 @@ void ARQPostRequest(ARQRequest* request, u32 owner, u32 type, u32 priority, u32 // Immediately invoke the callback (synchronous on PC, no DMA latency) if (callback) { - callback((u32)(uintptr_t)request); + callback((uintptr_t)request); } }