Skip to content

Commit 48cb8da

Browse files
committed
Merge branch 'main' of https://github.com/zeldaret/tp into cargo
2 parents 63754f7 + 6a48380 commit 48cb8da

File tree

169 files changed

+1842
-1811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+1842
-1811
lines changed

include/JSystem/J2DGraph/J2DAnimation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class J2DAnmVtxColor : public J2DAnmBase {
5959
J2DAnmVtxColor() {
6060
mKind = KIND_VTX_COLOR;
6161
for (int i = 0; i < ARRAY_SIZE(mAnmTableNum); i++) {
62-
mAnmTableNum[i] = NULL;
62+
mAnmTableNum[i] = 0;
6363
}
6464
for (int i = 0; i < ARRAY_SIZE(mVtxColorIndexData); i++) {
6565
mVtxColorIndexData[i] = NULL;

include/JSystem/JAudio2/JAISeMgr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct JASNonCopyable {
1515
JASNonCopyable() {}
1616
~JASNonCopyable() {}
1717

18-
/* 0x0 */ int field_0x0;
18+
/* 0x0 */ void* field_0x0;
1919
}; // Size: 0x4
2020

2121
/**
@@ -56,7 +56,7 @@ class JAISeCategoryMgr : public JAISeqDataUser, public JASNonCopyable {
5656
mParams.init();
5757
mMaxActiveSe = 0;
5858
mMaxInactiveSe = 0;
59-
field_0x0 = 0;
59+
field_0x0 = NULL;
6060
}
6161

6262
virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);

include/JSystem/JAudio2/JAISound.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "JSystem/JAudio2/JAIAudible.h"
66
#include "JSystem/JUtility/JUTAssert.h"
77
#include "global.h"
8+
#include <cstdint>
89

910
class JAISound;
1011

@@ -134,7 +135,7 @@ struct JAISoundStatus_ {
134135
u8 flag8 : 1;
135136
} flags;
136137
} state;
137-
/* 0x4 */ u32 userdata_;
138+
/* 0x4 */ uintptr_t userdata_;
138139
}; // Size: 0x8
139140

140141
/**
@@ -294,8 +295,8 @@ class JAISound {
294295
void setAnimationState(u32 state) {
295296
status_.state.flags.animationState = state;
296297
}
297-
u32 getUserData() const { return status_.userdata_; }
298-
void setUserData(u32 userData) { status_.userdata_ = userData; }
298+
uintptr_t getUserData() const { return status_.userdata_; }
299+
void setUserData(uintptr_t userData) { status_.userdata_ = userData; }
299300
JAIAudible* getAudible() { return audible_; }
300301
bool isHandleAttached() const { return handle_ != NULL; }
301302
bool hasLifeTime() const { return status_.field_0x1.flags.flag2; }

include/JSystem/JAudio2/JASDSPInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ namespace JASDsp {
112112
void invalChannelAll();
113113
void initBuffer();
114114
int setFXLine(u8, s16*, JASDsp::FxlineConfig_*);
115-
BOOL changeFXLineParam(u8, u8, u32);
115+
BOOL changeFXLineParam(u8, u8, uintptr_t);
116116

117117
extern u8 const DSPADPCM_FILTER[64];
118118
extern u32 const DSPRES_FILTER[320];

include/JSystem/JAudio2/JASResArcLoader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ namespace JASResArcLoader {
88
size_t getResSize(JKRArchive const*, u16);
99
size_t getResMaxSize(JKRArchive const*);
1010
static void loadResourceCallback(void*);
11-
int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, u32), u32);
11+
int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, uintptr_t), uintptr_t);
1212

1313
// from pikmin2
14-
typedef void (*LoadCallback)(u32, u32);
14+
typedef void (*LoadCallback)(u32, uintptr_t);
1515

1616
struct TLoadResInfo {
1717
inline TLoadResInfo(JKRArchive* archive, u16 id, void* buf, u32 size)
@@ -30,7 +30,7 @@ namespace JASResArcLoader {
3030
void* mBuffer; // _08
3131
u32 mBufferSize; // _0C
3232
LoadCallback mCallback; // _10
33-
u32 mCallbackArg; // _14, arg to pass to mCallback along with readResource result
33+
uintptr_t mCallbackArg; // _14, arg to pass to mCallback along with readResource result
3434
OSMessageQueue* mQueue; // _18
3535
};
3636
};

include/JSystem/JKernel/JKRHeap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <dolphin/os.h>
66
#include "global.h"
77
#include <new>
8+
#include <cstdint>
89

910
class JKRHeap;
1011
typedef void (*JKRErrorHandler)(void*, u32, int);
@@ -66,7 +67,7 @@ class JKRHeap : public JKRDisposer {
6667
JKRHeap* find(void* ptr) const;
6768
JKRHeap* findAllHeap(void* ptr) const;
6869

69-
void dispose_subroutine(u32 start, u32 end);
70+
void dispose_subroutine(uintptr_t start, uintptr_t end);
7071
bool dispose(void* ptr, u32 size);
7172
void dispose(void* begin, void* end);
7273
void dispose();

include/JSystem/JStudio/JStudio/fvb-data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern const char ga4cSignature[4];
1414

1515
const int PARAGRAPH_DATA = 1;
1616

17-
typedef enum TEComposite {
17+
enum TEComposite {
1818
/* 0x0 */ COMPOSITE_NONE,
1919
/* 0x1 */ COMPOSITE_RAW,
2020
/* 0x2 */ COMPOSITE_IDX,

include/JSystem/JStudio/JStudio/stb.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "JSystem/JStudio/JStudio/object-id.h"
66
#include "JSystem/JStudio/JStudio/stb-data-parse.h"
77
#include <dolphin/os.h>
8+
#include <cstdint>
89

910
namespace JStudio {
1011
class TObject;
@@ -86,7 +87,7 @@ class TObject : public object::TObject_ID {
8687
const void* getSequence() const { return pSequence; }
8788
void setSequence_(const void* arg1) { pSequence = arg1; }
8889
const void* getSequence_offset(s32 i_no) const {
89-
int s32Val = (s32)getSequence();
90+
intptr_t s32Val = (intptr_t)getSequence();
9091
return (const void*)(s32Val + i_no);
9192
}
9293
const void* getSequence_next() const { return pSequence_next; }

include/JSystem/JSupport/JSUOutputStream.h

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,24 @@ class JSUOutputStream : public JSUIosBase {
1818
s32 write(const void*, s32);
1919
void write(const char*);
2020

21-
JSUOutputStream& operator<<(u32 param_0) {
22-
write(&param_0, sizeof(u32));
23-
return *this;
24-
}
25-
26-
JSUOutputStream& operator<<(s32 param_0) {
27-
write(&param_0, sizeof(s32));
28-
return *this;
29-
}
30-
31-
JSUOutputStream& operator<<(s16 param_0) {
32-
write(&param_0, sizeof(s16));
33-
return *this;
34-
}
35-
36-
JSUOutputStream& operator<<(u16 param_0) {
37-
write(&param_0, sizeof(u16));
38-
return *this;
21+
#define JSU_OUTPUTSTREAM_OPERATOR(T) \
22+
JSUOutputStream& operator<<(T val) { \
23+
write(&val, sizeof(T)); \
24+
return *this; \
3925
}
4026

41-
JSUOutputStream& operator<<(u8 param_0) {
42-
write(&param_0, sizeof(u8));
43-
return *this;
44-
}
27+
JSU_OUTPUTSTREAM_OPERATOR(signed char)
28+
JSU_OUTPUTSTREAM_OPERATOR(unsigned char)
29+
JSU_OUTPUTSTREAM_OPERATOR(signed short)
30+
JSU_OUTPUTSTREAM_OPERATOR(unsigned short)
31+
JSU_OUTPUTSTREAM_OPERATOR(int)
32+
JSU_OUTPUTSTREAM_OPERATOR(unsigned int)
33+
JSU_OUTPUTSTREAM_OPERATOR(signed long)
34+
JSU_OUTPUTSTREAM_OPERATOR(unsigned long)
35+
JSU_OUTPUTSTREAM_OPERATOR(signed long long)
36+
JSU_OUTPUTSTREAM_OPERATOR(unsigned long long)
37+
38+
#undef JSU_OUTPUTSTREAM_OPERATOR
4539

4640
JSUOutputStream& operator<<(const char* param_0) {
4741
write(param_0);

include/JSystem/JSupport/JSupport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ T* JSUConvertOffsetToPtr(const void* ptr, uintptr_t offset) {
2020
template <typename T>
2121
T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) {
2222
T* ret;
23-
if (offset == NULL) {
23+
if (offset == 0) {
2424
ret = NULL;
2525
} else {
2626
ret = (T*)((intptr_t)ptr + (intptr_t)offset);

0 commit comments

Comments
 (0)