mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-08 04:15:08 -04:00
Some u32/s32 -> uintptr_t/intptr_t
This commit is contained in:
@@ -134,7 +134,7 @@ struct JAISoundStatus_ {
|
||||
u8 flag8 : 1;
|
||||
} flags;
|
||||
} state;
|
||||
/* 0x4 */ u32 userdata_;
|
||||
/* 0x4 */ uintptr_t userdata_;
|
||||
}; // Size: 0x8
|
||||
|
||||
/**
|
||||
@@ -294,8 +294,8 @@ public:
|
||||
void setAnimationState(u32 state) {
|
||||
status_.state.flags.animationState = state;
|
||||
}
|
||||
u32 getUserData() const { return status_.userdata_; }
|
||||
void setUserData(u32 userData) { status_.userdata_ = userData; }
|
||||
uintptr_t getUserData() const { return status_.userdata_; }
|
||||
void setUserData(uintptr_t userData) { status_.userdata_ = userData; }
|
||||
JAIAudible* getAudible() { return audible_; }
|
||||
bool isHandleAttached() const { return handle_ != NULL; }
|
||||
bool hasLifeTime() const { return status_.field_0x1.flags.flag2; }
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace JASDsp {
|
||||
void invalChannelAll();
|
||||
void initBuffer();
|
||||
int setFXLine(u8, s16*, JASDsp::FxlineConfig_*);
|
||||
BOOL changeFXLineParam(u8, u8, u32);
|
||||
BOOL changeFXLineParam(u8, u8, uintptr_t);
|
||||
|
||||
extern u8 const DSPADPCM_FILTER[64];
|
||||
extern u32 const DSPRES_FILTER[320];
|
||||
|
||||
@@ -265,13 +265,13 @@ namespace JASKernel {
|
||||
void setupRootHeap(JKRSolidHeap*, u32);
|
||||
JKRHeap* getSystemHeap();
|
||||
JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* getCommandHeap();
|
||||
void setupAramHeap(u32, u32);
|
||||
void setupAramHeap(uintptr_t, u32);
|
||||
JASHeap* getAramHeap();
|
||||
u32 getAramFreeSize();
|
||||
u32 getAramSize();
|
||||
|
||||
extern JASHeap audioAramHeap;
|
||||
extern u32 sAramBase;
|
||||
extern uintptr_t sAramBase;
|
||||
extern JKRHeap* sSystemHeap;
|
||||
extern JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* sCommandHeap;
|
||||
};
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace JASResArcLoader {
|
||||
size_t getResSize(JKRArchive const*, u16);
|
||||
size_t getResMaxSize(JKRArchive const*);
|
||||
static void loadResourceCallback(void*);
|
||||
int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, u32), u32);
|
||||
int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, uintptr_t), uintptr_t);
|
||||
|
||||
// from pikmin2
|
||||
typedef void (*LoadCallback)(u32, u32);
|
||||
typedef void (*LoadCallback)(u32, uintptr_t);
|
||||
|
||||
struct TLoadResInfo {
|
||||
inline TLoadResInfo(JKRArchive* archive, u16 id, void* buf, u32 size)
|
||||
@@ -30,7 +30,7 @@ namespace JASResArcLoader {
|
||||
void* mBuffer; // _08
|
||||
u32 mBufferSize; // _0C
|
||||
LoadCallback mCallback; // _10
|
||||
u32 mCallbackArg; // _14, arg to pass to mCallback along with readResource result
|
||||
uintptr_t mCallbackArg; // _14, arg to pass to mCallback along with readResource result
|
||||
OSMessageQueue* mQueue; // _18
|
||||
};
|
||||
};
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
JKRHeap* find(void* ptr) const;
|
||||
JKRHeap* findAllHeap(void* ptr) const;
|
||||
|
||||
void dispose_subroutine(u32 start, u32 end);
|
||||
void dispose_subroutine(uintptr_t start, uintptr_t end);
|
||||
bool dispose(void* ptr, u32 size);
|
||||
void dispose(void* begin, void* end);
|
||||
void dispose();
|
||||
|
||||
@@ -4,14 +4,15 @@
|
||||
#include "f_op/f_op_scene_pause.h"
|
||||
#include "f_pc/f_pc_manager.h"
|
||||
#include "f_op/f_op_scene.h"
|
||||
#include <cstdint>
|
||||
|
||||
typedef struct base_process_class base_process_class;
|
||||
|
||||
scene_class* fopScnM_SearchByID(fpc_ProcID id);
|
||||
int fopScnM_ChangeReq(scene_class* i_scene, s16 i_procName, s16 param_3, u16 param_4);
|
||||
fpc_ProcID fopScnM_DeleteReq(scene_class* i_scene);
|
||||
int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, u32 i_data);
|
||||
u32 fopScnM_ReRequest(s16 i_procName, u32 i_data);
|
||||
int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, uintptr_t i_data);
|
||||
u32 fopScnM_ReRequest(s16 i_procName, uintptr_t i_data);
|
||||
void fopScnM_Management();
|
||||
void fopScnM_Init();
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ bool JASAramStream::start() {
|
||||
}
|
||||
|
||||
bool JASAramStream::stop(u16 param_0) {
|
||||
if (!OSSendMessage(&field_0x000, (OSMessage)(param_0 << 0x10 | 1), OS_MESSAGE_NOBLOCK)) {
|
||||
if (!OSSendMessage(&field_0x000, (OSMessage)(uintptr_t)(param_0 << 0x10 | 1), OS_MESSAGE_NOBLOCK)) {
|
||||
JUT_WARN(290, "%s", "OSSendMessage Failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ int JASDsp::setFXLine(u8 param_0, s16* buffer, JASDsp::FxlineConfig_* param_2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
BOOL JASDsp::changeFXLineParam(u8 param_0, u8 param_1, u32 param_2) {
|
||||
BOOL JASDsp::changeFXLineParam(u8 param_0, u8 param_1, uintptr_t param_2) {
|
||||
JUT_ASSERT(450, dspMutex);
|
||||
FxBuf* buf = &FX_BUF[param_0];
|
||||
switch (param_1) {
|
||||
|
||||
@@ -285,7 +285,7 @@ void JASGenericMemPool::free(void* ptr, u32 param_1) {
|
||||
freeMemCount++;
|
||||
}
|
||||
|
||||
u32 JASKernel::sAramBase;
|
||||
uintptr_t JASKernel::sAramBase;
|
||||
|
||||
JKRHeap* JASKernel::sSystemHeap;
|
||||
|
||||
@@ -310,7 +310,7 @@ JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* JASKernel::getCom
|
||||
|
||||
JASHeap JASKernel::audioAramHeap;
|
||||
|
||||
void JASKernel::setupAramHeap(u32 param_0, u32 param_1) {
|
||||
void JASKernel::setupAramHeap(uintptr_t param_0, u32 param_1) {
|
||||
#if !PLATFORM_GCN
|
||||
OSReport("setupAramHeap %x, %x, %x\n", param_0, ARGetBaseAddress(), param_1);
|
||||
param_0 = ARGetBaseAddress();
|
||||
|
||||
@@ -55,7 +55,7 @@ static void JASResArcLoader::loadResourceCallback(void* args) {
|
||||
}
|
||||
|
||||
|
||||
int JASResArcLoader::loadResourceAsync(JKRArchive* archive, u16 id, u8* buffer, u32 size, LoadCallback callback, u32 cbArg)
|
||||
int JASResArcLoader::loadResourceAsync(JKRArchive* archive, u16 id, u8* buffer, u32 size, LoadCallback callback, uintptr_t cbArg)
|
||||
{
|
||||
TLoadResInfo args(archive, id, buffer, size);
|
||||
args.mCallback = callback;
|
||||
|
||||
@@ -111,7 +111,7 @@ bool JAUDynamicSeqDataBlocks::appendDynamicSeqDataBlock(JAUSeqDataBlock* seqData
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void JAUDynamicSeqDataBlocks_receiveLoaded_(u32 param_0, u32 param_1) {
|
||||
static void JAUDynamicSeqDataBlocks_receiveLoaded_(u32 param_0, uintptr_t param_1) {
|
||||
JSULink<JAUSeqDataBlock>* link = (JSULink<JAUSeqDataBlock>*)param_1;
|
||||
JAUSeqDataBlock* seqDataBlock = link->getObject();
|
||||
if (param_0 != 0) {
|
||||
|
||||
@@ -125,7 +125,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 + (offsetof(JKRDvdFile, mDvdFile) - offsetof(JKRDvdFile, mFileInfo)));
|
||||
OSSendMessage(&dvdFile->mMessageQueue2, (OSMessage)id, OS_MESSAGE_NOBLOCK);
|
||||
OSSendMessage(&dvdFile->mMessageQueue2, (OSMessage)(intptr_t)id, OS_MESSAGE_NOBLOCK);
|
||||
}
|
||||
|
||||
s32 JKRDvdFile::getFileSize(void) const {
|
||||
|
||||
@@ -386,7 +386,7 @@ JKRHeap* JKRHeap::findAllHeap(void* ptr) const {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void JKRHeap::dispose_subroutine(u32 begin, u32 end) {
|
||||
void JKRHeap::dispose_subroutine(uintptr_t begin, uintptr_t end) {
|
||||
JSUListIterator<JKRDisposer> next_iterator((JSULink<JKRDisposer>*)NULL);
|
||||
JSUListIterator<JKRDisposer> it = mDisposerList.getFirst();
|
||||
while (it != mDisposerList.getEnd()) {
|
||||
|
||||
@@ -178,7 +178,7 @@ void JUTVideo::postRetraceProc(u32 retrace_count) {
|
||||
sManager->mPostCallback(retrace_count);
|
||||
}
|
||||
|
||||
OSSendMessage(&sManager->mMessageQueue, (OSMessage)VIGetRetraceCount(), OS_MESSAGE_NOBLOCK);
|
||||
OSSendMessage(&sManager->mMessageQueue, (OSMessage)(uintptr_t)VIGetRetraceCount(), OS_MESSAGE_NOBLOCK);
|
||||
}
|
||||
|
||||
void JUTVideo::setRenderMode(GXRenderModeObj const* pObj) {
|
||||
|
||||
@@ -3719,7 +3719,7 @@ BOOL daMP_WaitUntilPrepare() {
|
||||
}
|
||||
|
||||
void daMP_PrepareReady(BOOL msg) {
|
||||
OSSendMessage(&daMP_PrepareReadyQueue, (OSMessage)msg, 1);
|
||||
OSSendMessage(&daMP_PrepareReadyQueue, (OSMessage)(uintptr_t)msg, 1);
|
||||
}
|
||||
|
||||
static BOOL daMP_THPPlayerPrepare(s32 frame, s32 flag, s32 audioTrack) {
|
||||
|
||||
@@ -2270,7 +2270,7 @@ bool dMenu_Fmap_c::readFieldMapData(void** o_data, char const* i_path, bool para
|
||||
}
|
||||
|
||||
void dMenu_Fmap_c::decodeFieldMapData() {
|
||||
int field_data = (intptr_t)mpFieldDat;
|
||||
intptr_t field_data = (intptr_t)mpFieldDat;
|
||||
dMenu_Fmap_field_region_data_c* region_data
|
||||
= (dMenu_Fmap_field_region_data_c*)(field_data + mpFieldDat->mRegionDataOffset);
|
||||
dMenuMapCommon_c::Stage_c* stage_data
|
||||
|
||||
@@ -29,14 +29,14 @@ fpc_ProcID fopScnM_DeleteReq(scene_class* i_scene) {
|
||||
return fopScnRq_Request(1, i_scene, 0x7FFF, NULL, 0x7FFF, 0) != fpcM_ERROR_PROCESS_ID_e;
|
||||
}
|
||||
|
||||
int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, u32 i_data) {
|
||||
int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, uintptr_t i_data) {
|
||||
printf("[DIAG] fopScnM_CreateReq: procName=%d fade=%d\n", i_procName, param_2); fflush(stdout);
|
||||
fpc_ProcID result = fopScnRq_Request(0, 0, i_procName, (void*)i_data, param_2, param_3);
|
||||
printf("[DIAG] fopScnM_CreateReq: result=%d (error=%d)\n", result, fpcM_ERROR_PROCESS_ID_e); fflush(stdout);
|
||||
return result != fpcM_ERROR_PROCESS_ID_e;
|
||||
}
|
||||
|
||||
u32 fopScnM_ReRequest(s16 i_procName, u32 i_data) {
|
||||
u32 fopScnM_ReRequest(s16 i_procName, uintptr_t i_data) {
|
||||
if (l_scnRqID == fpcM_ERROR_PROCESS_ID_e) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "f_pc/f_pc_pause.h"
|
||||
#include "f_pc/f_pc_node.h"
|
||||
#include "f_pc/f_pc_layer_iter.h"
|
||||
#include <cstdint>
|
||||
|
||||
int fpcPause_IsEnable(void* i_proc, u8 i_flag) {
|
||||
if ((((base_process_class*)i_proc)->pause_flag & i_flag) == i_flag) {
|
||||
@@ -20,7 +21,7 @@ int fpcPause_Enable(void* i_proc, u8 i_flag) {
|
||||
|
||||
if (fpcBs_Is_JustOfType(g_fpcNd_type, ((base_process_class*)i_proc)->subtype)) {
|
||||
fpcLyIt_OnlyHere(&((process_node_class*)i_proc)->layer, (fpcLyIt_OnlyHereFunc)fpcPause_Enable,
|
||||
(void*)i_flag);
|
||||
(void*)(uintptr_t)i_flag);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -30,7 +31,7 @@ int fpcPause_Disable(void* i_proc, u8 i_flag) {
|
||||
((base_process_class*)i_proc)->pause_flag &= var_r31;
|
||||
|
||||
if (fpcBs_Is_JustOfType(g_fpcNd_type, ((base_process_class*)i_proc)->subtype)) {
|
||||
fpcLyIt_OnlyHere(&((process_node_class*)i_proc)->layer, (fpcLyIt_OnlyHereFunc)fpcPause_Disable, (void*)i_flag);
|
||||
fpcLyIt_OnlyHere(&((process_node_class*)i_proc)->layer, (fpcLyIt_OnlyHereFunc)fpcPause_Disable, (void*)(uintptr_t)i_flag);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -99,7 +99,7 @@ void mDoRst_reset(int reset, u32 resetCode, int forceMenu) {
|
||||
}
|
||||
|
||||
void checkDiskCallback(s32 result, DVDCommandBlock* block) {
|
||||
block->userData = (void*)result;
|
||||
block->userData = (void*)(intptr_t)result;
|
||||
}
|
||||
|
||||
void mDoRst_resetCallBack(int port, void*) {
|
||||
|
||||
@@ -586,7 +586,7 @@ static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) {
|
||||
JUTException* manager = JUTException::getManager();
|
||||
JUTConsole* exConsole = manager->getConsole();
|
||||
|
||||
u32 srr0 = p_context->srr0 & -4;
|
||||
uintptr_t srr0 = p_context->srr0 & -4;
|
||||
if (srr0 >= 0x8000000C && srr0 < 0x82FFFFFF) {
|
||||
exConsole->print_f("(SRR0-3):%08X %08X %08X %08X\n", *(u32*)(srr0 - 0xC),
|
||||
*(u32*)(srr0 - 0x8), *(u32*)(srr0 - 0x4), *(u32*)srr0);
|
||||
|
||||
Reference in New Issue
Block a user