Convert tabs to spaces (#1012)

This commit is contained in:
Marijn van der Werf 2023-04-10 20:06:19 +02:00 committed by GitHub
parent 3e3558a37f
commit 1213a4adf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 285 additions and 285 deletions

View File

@ -25,23 +25,23 @@ typedef u8* WaveData;
#define SAMPLE184(delta) (((delta) + (SAMPLES / 2)) / SAMPLES) * SAMPLES #define SAMPLE184(delta) (((delta) + (SAMPLES / 2)) / SAMPLES) * SAMPLES
#define FIXED_SAMPLE SAMPLES #define FIXED_SAMPLE SAMPLES
#define N_AL_DECODER_IN 0 #define N_AL_DECODER_IN 0
#define N_AL_RESAMPLER_OUT 0 #define N_AL_RESAMPLER_OUT 0
#define N_AL_TEMP_0 0 #define N_AL_TEMP_0 0
#define N_AL_DECODER_OUT 0x170 #define N_AL_DECODER_OUT 0x170
#define N_AL_TEMP_1 0x170 #define N_AL_TEMP_1 0x170
#define N_AL_TEMP_2 0x2E0 #define N_AL_TEMP_2 0x2E0
#define N_AL_MAIN_L_OUT 0x4E0 #define N_AL_MAIN_L_OUT 0x4E0
#define N_AL_MAIN_R_OUT 0x650 #define N_AL_MAIN_R_OUT 0x650
#define N_AL_AUX_L_OUT 0x7C0 #define N_AL_AUX_L_OUT 0x7C0
#define N_AL_AUX_R_OUT 0x930 #define N_AL_AUX_R_OUT 0x930
#define ALIGN16_(val) (((val) + 0xF) & 0xFFF0) #define ALIGN16_(val) (((val) + 0xF) & 0xFFF0)
#define AU_FILE_RELATIVE(base,offset) ((void*)((s32)(offset) + (s32)(base))) #define AU_FILE_RELATIVE(base,offset) ((void*)((s32)(offset) + (s32)(base)))
#define AUDIO_HEAP_SIZE 0x56000 #define AUDIO_HEAP_SIZE 0x56000
// NU_AU_AUDIO_SAMPLES ? // NU_AU_AUDIO_SAMPLES ?
#define AUDIO_SAMPLES 184 #define AUDIO_SAMPLES 184
#define AUDIO_COMMAND_LIST_BUFFER_SIZE 0x4000 #define AUDIO_COMMAND_LIST_BUFFER_SIZE 0x4000
#define ADPCMFBYTES 9 #define ADPCMFBYTES 9

View File

@ -1,8 +1,8 @@
typedef unsigned int UQItype __attribute__ ((mode (QI))); typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef int SItype __attribute__ ((mode (SI))); typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI))); typedef unsigned int USItype __attribute__ ((mode (SI)));
typedef int DItype __attribute__ ((mode (DI))); typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UDItype __attribute__ ((mode (DI))); typedef unsigned int UDItype __attribute__ ((mode (DI)));
typedef int word_type __attribute__ ((mode (__word__))); typedef int word_type __attribute__ ((mode (__word__)));
#define BITS_PER_UNIT 8 #define BITS_PER_UNIT 8
@ -24,11 +24,11 @@ typedef union {
#define __ll_highpart(t) ((USItype) (t) / __ll_B) #define __ll_highpart(t) ((USItype) (t) / __ll_B)
#ifndef OLD_GCC #ifndef OLD_GCC
#define umul_ppmm(w1, w0, u, v) \ #define umul_ppmm(w1, w0, u, v) \
do { \ do { \
UDItype __x = (UDItype) (USItype) (u) * (USItype) (v); \ UDItype __x = (UDItype) (USItype) (u) * (USItype) (v); \
(w1) = (USItype) (__x >> 32); \ (w1) = (USItype) (__x >> 32); \
(w0) = (USItype) (__x); \ (w0) = (USItype) (__x); \
} while (0) } while (0)
#else #else
#define umul_ppmm(w1, w0, u, v) \ #define umul_ppmm(w1, w0, u, v) \
@ -40,70 +40,70 @@ typedef union {
#endif #endif
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
do { \ do { \
USItype __x; \ USItype __x; \
__x = (al) - (bl); \ __x = (al) - (bl); \
(sh) = (ah) - (bh) - (__x > (al)); \ (sh) = (ah) - (bh) - (__x > (al)); \
(sl) = __x; \ (sl) = __x; \
} while (0) } while (0)
#define udiv_qrnnd(q, r, n1, n0, d) \ #define udiv_qrnnd(q, r, n1, n0, d) \
do { \ do { \
USItype __d1, __d0, __q1, __q0; \ USItype __d1, __d0, __q1, __q0; \
USItype __r1, __r0, __m; \ USItype __r1, __r0, __m; \
__d1 = __ll_highpart (d); \ __d1 = __ll_highpart (d); \
__d0 = __ll_lowpart (d); \ __d0 = __ll_lowpart (d); \
\ \
__r1 = (n1) % __d1; \ __r1 = (n1) % __d1; \
__q1 = (n1) / __d1; \ __q1 = (n1) / __d1; \
__m = (USItype) __q1 * __d0; \ __m = (USItype) __q1 * __d0; \
__r1 = __r1 * __ll_B | __ll_highpart (n0); \ __r1 = __r1 * __ll_B | __ll_highpart (n0); \
if (__r1 < __m) { \ if (__r1 < __m) { \
__q1--, __r1 += (d); \ __q1--, __r1 += (d); \
if (__r1 >= (d)) { /* i.e. we didn't get carry when adding to __r1 */ \ if (__r1 >= (d)) { /* i.e. we didn't get carry when adding to __r1 */ \
if (__r1 < __m) { \ if (__r1 < __m) { \
__q1--, __r1 += (d); \ __q1--, __r1 += (d); \
} \ } \
} \ } \
} \ } \
__r1 -= __m; \ __r1 -= __m; \
\ \
__r0 = __r1 % __d1; \ __r0 = __r1 % __d1; \
__q0 = __r1 / __d1; \ __q0 = __r1 / __d1; \
__m = (USItype) __q0 * __d0; \ __m = (USItype) __q0 * __d0; \
__r0 = __r0 * __ll_B | __ll_lowpart (n0); \ __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
if (__r0 < __m) { \ if (__r0 < __m) { \
__q0--, __r0 += (d); \ __q0--, __r0 += (d); \
if (__r0 >= (d)) { \ if (__r0 >= (d)) { \
if (__r0 < __m) { \ if (__r0 < __m) { \
__q0--, __r0 += (d); \ __q0--, __r0 += (d); \
} \ } \
} \ } \
} \ } \
__r0 -= __m; \ __r0 -= __m; \
\ \
(q) = (USItype) __q1 * __ll_B | __q0; \ (q) = (USItype) __q1 * __ll_B | __q0; \
(r) = __r0; \ (r) = __r0; \
} while (0) } while (0)
#define count_leading_zeros(count, x) \ #define count_leading_zeros(count, x) \
do { \ do { \
USItype __xr = (x); \ USItype __xr = (x); \
USItype __a; \ USItype __a; \
\ \
if (SI_TYPE_SIZE <= 32) { \ if (SI_TYPE_SIZE <= 32) { \
__a = __xr < ((USItype)1<<2*__BITS4) \ __a = __xr < ((USItype)1<<2*__BITS4) \
? (__xr < ((USItype)1<<__BITS4) ? 0 : __BITS4) \ ? (__xr < ((USItype)1<<__BITS4) ? 0 : __BITS4) \
: (__xr < ((USItype)1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \ : (__xr < ((USItype)1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \
} else { \ } else { \
for (__a = SI_TYPE_SIZE - 8; __a > 0; __a -= 8) { \ for (__a = SI_TYPE_SIZE - 8; __a > 0; __a -= 8) { \
if (((__xr >> __a) & 0xff) != 0) { \ if (((__xr >> __a) & 0xff) != 0) { \
break; \ break; \
} \ } \
} \ } \
} \ } \
\ \
(count) = SI_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \ (count) = SI_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \
} while (0) } while (0)
static inline DItype __negdi2(DItype u) { static inline DItype __negdi2(DItype u) {
@ -168,7 +168,7 @@ static inline UDItype __udivmoddi4(UDItype n, UDItype d, UDItype *rp) {
/* qq = NN / 0d */ /* qq = NN / 0d */
if (d0 == 0) { if (d0 == 0) {
d0 = 1 / d0; /* Divide intentionally by zero. */ d0 = 1 / d0; /* Divide intentionally by zero. */
} }
count_leading_zeros (bm, d0); count_leading_zeros (bm, d0);

View File

@ -265,23 +265,23 @@ extern HudScript* wPartnerHudScripts[];
/// Basic HudScript used for static CI images, setting size with hs_SetTileSize /// Basic HudScript used for static CI images, setting size with hs_SetTileSize
#define HES_TEMPLATE_CI_ENUM_SIZE(name, sizeX, sizeY) \ #define HES_TEMPLATE_CI_ENUM_SIZE(name, sizeX, sizeY) \
{ \ { \
hs_SetVisible \ hs_SetVisible \
hs_SetTileSize(HUD_ELEMENT_SIZE_##sizeX##x##sizeY) \ hs_SetTileSize(HUD_ELEMENT_SIZE_##sizeX##x##sizeY) \
hs_Loop \ hs_Loop \
hs_SetCI(60, name) \ hs_SetCI(60, name) \
hs_Restart \ hs_Restart \
hs_End \ hs_End \
} }
/// Basic HudScript used for static CI images, setting size with hs_SetCustomSize /// Basic HudScript used for static CI images, setting size with hs_SetCustomSize
#define HES_TEMPLATE_CI_CUSTOM_SIZE(name, sizeX, sizeY) \ #define HES_TEMPLATE_CI_CUSTOM_SIZE(name, sizeX, sizeY) \
{ \ { \
hs_SetVisible \ hs_SetVisible \
hs_SetCustomSize(sizeX, sizeY) \ hs_SetCustomSize(sizeX, sizeY) \
hs_Loop \ hs_Loop \
hs_SetCI(60, name) \ hs_SetCI(60, name) \
hs_Restart \ hs_Restart \
hs_End \ hs_End \
} }
void hud_element_load_script(HudElement* hudElement, HudScript* anim); void hud_element_load_script(HudElement* hudElement, HudScript* anim);

View File

@ -18,18 +18,18 @@ OSPiHandle *osCartRomInit(void)
__osPiGetAccess(); __osPiGetAccess();
if (!first) { if (!first) {
__osPiRelAccess(); __osPiRelAccess();
return &__CartRomHandle; return &__CartRomHandle;
} }
first = 0; first = 0;
__CartRomHandle.type = DEVICE_TYPE_CART; __CartRomHandle.type = DEVICE_TYPE_CART;
__CartRomHandle.baseAddress = PHYS_TO_K1(PI_DOM1_ADDR2); __CartRomHandle.baseAddress = PHYS_TO_K1(PI_DOM1_ADDR2);
__CartRomHandle.domain = PI_DOMAIN1; __CartRomHandle.domain = PI_DOMAIN1;
__CartRomHandle.speed = 0; __CartRomHandle.speed = 0;
bzero(&__CartRomHandle.transferInfo, sizeof(__OSTranxInfo)); bzero(&__CartRomHandle.transferInfo, sizeof(__OSTranxInfo));
while (stat = IO_READ(PI_STATUS_REG), stat & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) { while (stat = IO_READ(PI_STATUS_REG), stat & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY)) {
; ;
@ -56,11 +56,11 @@ OSPiHandle *osCartRomInit(void)
IO_WRITE(PI_BSD_DOM1_RLS_REG, relDuration); IO_WRITE(PI_BSD_DOM1_RLS_REG, relDuration);
IO_WRITE(PI_BSD_DOM1_PWD_REG, pulse); IO_WRITE(PI_BSD_DOM1_PWD_REG, pulse);
saveMask = __osDisableInt(); saveMask = __osDisableInt();
__CartRomHandle.next = __osPiTable; __CartRomHandle.next = __osPiTable;
__osPiTable = &__CartRomHandle; __osPiTable = &__CartRomHandle;
__osRestoreInt(saveMask); __osRestoreInt(saveMask);
__osPiRelAccess(); __osPiRelAccess();
return &__CartRomHandle; return &__CartRomHandle;
} }

View File

@ -15,25 +15,25 @@ s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer) {
ptr = (u8 *)(&__osPfsPifRam); ptr = (u8 *)(&__osPfsPifRam);
if (__osContLastCmd != CONT_CMD_READ_MEMPACK || __osPfsLastChannel != channel) { if (__osContLastCmd != CONT_CMD_READ_MEMPACK || __osPfsLastChannel != channel) {
__osContLastCmd = CONT_CMD_READ_MEMPACK; __osContLastCmd = CONT_CMD_READ_MEMPACK;
__osPfsLastChannel = channel; __osPfsLastChannel = channel;
for (i = 0; i < channel; i++) { for (i = 0; i < channel; i++) {
*ptr++ = 0; *ptr++ = 0;
} }
__osPfsPifRam.pifstatus = CONT_CMD_EXE; __osPfsPifRam.pifstatus = CONT_CMD_EXE;
((__OSContRamReadFormat *)ptr)->dummy = 0xff; ((__OSContRamReadFormat *)ptr)->dummy = 0xff;
((__OSContRamReadFormat *)ptr)->txsize = 3; ((__OSContRamReadFormat *)ptr)->txsize = 3;
((__OSContRamReadFormat *)ptr)->rxsize = 33; ((__OSContRamReadFormat *)ptr)->rxsize = 33;
((__OSContRamReadFormat *)ptr)->cmd = CONT_CMD_READ_MEMPACK; ((__OSContRamReadFormat *)ptr)->cmd = CONT_CMD_READ_MEMPACK;
((__OSContRamReadFormat *)ptr)->datacrc = 0xff; ((__OSContRamReadFormat *)ptr)->datacrc = 0xff;
ptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END; ptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END;
} else { } else {
ptr += channel; ptr += channel;
} }
((__OSContRamReadFormat *)ptr)->addrh = address >> 3; ((__OSContRamReadFormat *)ptr)->addrh = address >> 3;
((__OSContRamReadFormat *)ptr)->addrl = (address << 5) | __osContAddressCrc(address) ; ((__OSContRamReadFormat *)ptr)->addrl = (address << 5) | __osContAddressCrc(address) ;
__osSiRawStartDma(OS_WRITE, &__osPfsPifRam); __osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
osRecvMesg(mq, NULL, OS_MESG_BLOCK); osRecvMesg(mq, NULL, OS_MESG_BLOCK);
__osSiRawStartDma(OS_READ, &__osPfsPifRam); __osSiRawStartDma(OS_READ, &__osPfsPifRam);
@ -45,9 +45,9 @@ s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer) {
ret = __osPfsGetStatus(mq, channel); ret = __osPfsGetStatus(mq, channel);
if (ret != 0) { if (ret != 0) {
break; break;
} else { } else {
ret = PFS_ERR_CONTRFAIL; ret = PFS_ERR_CONTRFAIL;
} }
} else { } else {
bcopy(((__OSContRamReadFormat *)ptr)->data, buffer, BLOCKSIZE); bcopy(((__OSContRamReadFormat *)ptr)->data, buffer, BLOCKSIZE);
} }

View File

@ -20,25 +20,25 @@ s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int
ptr = (u8 *)(&__osPfsPifRam); ptr = (u8 *)(&__osPfsPifRam);
if (__osContLastCmd != CONT_CMD_WRITE_MEMPACK || __osPfsLastChannel != channel) { if (__osContLastCmd != CONT_CMD_WRITE_MEMPACK || __osPfsLastChannel != channel) {
__osContLastCmd = CONT_CMD_WRITE_MEMPACK; __osContLastCmd = CONT_CMD_WRITE_MEMPACK;
__osPfsLastChannel = channel; __osPfsLastChannel = channel;
for (i = 0; i < channel; i++) { for (i = 0; i < channel; i++) {
*ptr++ = 0; *ptr++ = 0;
} }
__osPfsPifRam.pifstatus = CONT_CMD_EXE; __osPfsPifRam.pifstatus = CONT_CMD_EXE;
((__OSContRamReadFormat *)ptr)->dummy = 0xff; ((__OSContRamReadFormat *)ptr)->dummy = 0xff;
((__OSContRamReadFormat *)ptr)->txsize = 35; ((__OSContRamReadFormat *)ptr)->txsize = 35;
((__OSContRamReadFormat *)ptr)->rxsize = 1; ((__OSContRamReadFormat *)ptr)->rxsize = 1;
((__OSContRamReadFormat *)ptr)->cmd = CONT_CMD_WRITE_MEMPACK; ((__OSContRamReadFormat *)ptr)->cmd = CONT_CMD_WRITE_MEMPACK;
((__OSContRamReadFormat *)ptr)->datacrc = 0xff; ((__OSContRamReadFormat *)ptr)->datacrc = 0xff;
ptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END; ptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END;
} else { } else {
ptr += channel; ptr += channel;
} }
((__OSContRamReadFormat *)ptr)->addrh = address >> 3; ((__OSContRamReadFormat *)ptr)->addrh = address >> 3;
((__OSContRamReadFormat *)ptr)->addrl = (address << 5) | __osContAddressCrc(address); ((__OSContRamReadFormat *)ptr)->addrl = (address << 5) | __osContAddressCrc(address);
bcopy(buffer, ((__OSContRamReadFormat *)ptr)->data, BLOCKSIZE); bcopy(buffer, ((__OSContRamReadFormat *)ptr)->data, BLOCKSIZE);
@ -54,9 +54,9 @@ s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int
ret = __osPfsGetStatus(mq, channel); ret = __osPfsGetStatus(mq, channel);
if (ret != 0) { if (ret != 0) {
break; break;
} else { } else {
ret = PFS_ERR_CONTRFAIL; ret = PFS_ERR_CONTRFAIL;
} }
} }
} else { } else {
ret = PFS_ERR_NOPACK; ret = PFS_ERR_NOPACK;

View File

@ -23,7 +23,7 @@ void guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float
void guOrtho(Mtx* m, float l, float r, float b, float t, float n, float f, float scale) { void guOrtho(Mtx* m, float l, float r, float b, float t, float n, float f, float scale) {
float mf[4][4]; float mf[4][4];
guOrthoF(mf, l, r, b, t, n, f, scale); guOrthoF(mf, l, r, b, t, n, f, scale);
guMtxF2L(mf, m); guMtxF2L(mf, m);
} }

View File

@ -4,47 +4,47 @@ f32 sin_rad(f32 x);
f32 cos_rad(f32 x); f32 cos_rad(f32 x);
void guRotateF(float mf[4][4], float a, float x, float y, float z) { void guRotateF(float mf[4][4], float a, float x, float y, float z) {
static float dtor = 3.1415926 / 180.0; static float dtor = 3.1415926 / 180.0;
float sine; float sine;
float cosine; float cosine;
float ab, bc, ca, t; float ab, bc, ca, t;
float xs, ys, zs; float xs, ys, zs;
guNormalize(&x, &y, &z); guNormalize(&x, &y, &z);
a *= dtor; a *= dtor;
sine = sin_rad(a); sine = sin_rad(a);
cosine = cos_rad(a); cosine = cos_rad(a);
t = 1.0f - cosine; t = 1.0f - cosine;
ab = x * y * t; ab = x * y * t;
bc = y * z * t; bc = y * z * t;
ca = z * x * t; ca = z * x * t;
guMtxIdentF(mf); guMtxIdentF(mf);
ys = y * sine; ys = y * sine;
xs = x * sine; xs = x * sine;
zs = z * sine; zs = z * sine;
t = x * x; t = x * x;
mf[0][0] = t + cosine * (1.0f - t); mf[0][0] = t + cosine * (1.0f - t);
mf[2][1] = bc - xs; mf[2][1] = bc - xs;
mf[1][2] = bc + xs; mf[1][2] = bc + xs;
t = y * y; t = y * y;
mf[1][1] = t + cosine * (1.0f - t); mf[1][1] = t + cosine * (1.0f - t);
mf[2][0] = ca + ys; mf[2][0] = ca + ys;
mf[0][2] = ca - ys; mf[0][2] = ca - ys;
t = z * z; t = z * z;
mf[2][2] = t + cosine * (1.0f - t); mf[2][2] = t + cosine * (1.0f - t);
mf[1][0] = ab - zs; mf[1][0] = ab - zs;
mf[0][1] = ab + zs; mf[0][1] = ab + zs;
} }
void guRotate(Mtx *m, float a, float x, float y, float z) { void guRotate(Mtx *m, float a, float x, float y, float z) {
float mf[4][4]; float mf[4][4];
guRotateF(mf, a, x, y, z); guRotateF(mf, a, x, y, z);
guMtxF2L(mf, m); guMtxF2L(mf, m);
} }

View File

@ -135,7 +135,7 @@ static s32 contReadNW(NUSiCommonMesg* mesg) {
} }
if(nuContReadFunc != NULL) { if(nuContReadFunc != NULL) {
(*nuContReadFunc)(mesg->mesg); (*nuContReadFunc)(mesg->mesg);
} }
return rtn; return rtn;

View File

@ -13,7 +13,7 @@ void nuGfxSetCfb(u16** framebuf, u32 framebufnum) {
nuScSetFrameBufferNum(framebufnum); nuScSetFrameBufferNum(framebufnum);
if (framebufnum > 1) { if (framebufnum > 1) {
s32 i; s32 i;
for (i = 0; i < framebufnum - 1; i++) { for (i = 0; i < framebufnum - 1; i++) {
if (nuGfxCfb[i] != nuGfxCfb[i+1]) { if (nuGfxCfb[i] != nuGfxCfb[i+1]) {

View File

@ -71,7 +71,7 @@ void nuScExecuteAudio(void) {
NUScTask* gfxTask; NUScTask* gfxTask;
NUScTask* audioTask; NUScTask* audioTask;
OSMesg msg; OSMesg msg;
u32 yieldFlag; u32 yieldFlag;
while (TRUE) { while (TRUE) {
osRecvMesg(&nusched.audioRequestMQ, (OSMesg *) &audioTask, OS_MESG_BLOCK); osRecvMesg(&nusched.audioRequestMQ, (OSMesg *) &audioTask, OS_MESG_BLOCK);
@ -222,8 +222,8 @@ s32 nuScGetFrameRate(void) {
} }
void nuScEventHandler(void) { void nuScEventHandler(void) {
OSMesg msg; OSMesg msg;
s32 beforeResetFrame; s32 beforeResetFrame;
nuScRetraceCounter = 0; nuScRetraceCounter = 0;
@ -326,7 +326,7 @@ void nuScWaitTaskReady(NUScTask* task) {
while (osViGetCurrentFramebuffer() == fb || osViGetNextFramebuffer() == fb) { while (osViGetCurrentFramebuffer() == fb || osViGetNextFramebuffer() == fb) {
nuScAddClient_inline(&client, &nusched.waitMQ, NU_SC_RETRACE_MSG); nuScAddClient_inline(&client, &nusched.waitMQ, NU_SC_RETRACE_MSG);
osRecvMesg(&nusched.waitMQ, NULL, OS_MESG_BLOCK); osRecvMesg(&nusched.waitMQ, NULL, OS_MESG_BLOCK);
nuScRemoveClient_inline(&client); nuScRemoveClient_inline(&client);
} }
} }

View File

@ -6,19 +6,19 @@ extern OSMesg piAccessBuf[PI_Q_BUF_LEN];
extern OSMesgQueue __osPiAccessQueue; extern OSMesgQueue __osPiAccessQueue;
void __osPiCreateAccessQueue(void) { void __osPiCreateAccessQueue(void) {
__osPiAccessQueueEnabled = 1; __osPiAccessQueueEnabled = 1;
osCreateMesgQueue(&__osPiAccessQueue, piAccessBuf, PI_Q_BUF_LEN); osCreateMesgQueue(&__osPiAccessQueue, piAccessBuf, PI_Q_BUF_LEN);
osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK); osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK);
} }
void __osPiGetAccess(void) { void __osPiGetAccess(void) {
OSMesg dummyMesg; OSMesg dummyMesg;
if (!__osPiAccessQueueEnabled) { if (!__osPiAccessQueueEnabled) {
__osPiCreateAccessQueue(); __osPiCreateAccessQueue();
} }
osRecvMesg(&__osPiAccessQueue, &dummyMesg, OS_MESG_BLOCK); osRecvMesg(&__osPiAccessQueue, &dummyMesg, OS_MESG_BLOCK);
} }
void __osPiRelAccess(void) { void __osPiRelAccess(void) {
osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK); osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK);
} }

View File

@ -3,11 +3,11 @@
u32 __osPreNMI = 0; u32 __osPreNMI = 0;
void osSetEventMesg(OSEvent event, OSMesgQueue *mq, OSMesg msg) { void osSetEventMesg(OSEvent event, OSMesgQueue *mq, OSMesg msg) {
register u32 saveMask = __osDisableInt(); register u32 saveMask = __osDisableInt();
__OSEventState *es = &__osEventStateTab[event]; __OSEventState *es = &__osEventStateTab[event];
es->messageQueue = mq; es->messageQueue = mq;
es->message = msg; es->message = msg;
if (event == OS_EVENT_PRENMI) { if (event == OS_EVENT_PRENMI) {
if (__osShutdown && !__osPreNMI) { if (__osShutdown && !__osPreNMI) {
@ -16,5 +16,5 @@ void osSetEventMesg(OSEvent event, OSMesgQueue *mq, OSMesg msg) {
__osPreNMI = TRUE; __osPreNMI = TRUE;
} }
__osRestoreInt(saveMask); __osRestoreInt(saveMask);
} }

View File

@ -6,19 +6,19 @@ extern OSMesg siAccessBuf[SI_Q_BUF_LEN];
extern OSMesgQueue __osSiAccessQueue; extern OSMesgQueue __osSiAccessQueue;
void __osSiCreateAccessQueue(void) { void __osSiCreateAccessQueue(void) {
__osSiAccessQueueEnabled = 1; __osSiAccessQueueEnabled = 1;
osCreateMesgQueue(&__osSiAccessQueue, siAccessBuf, SI_Q_BUF_LEN); osCreateMesgQueue(&__osSiAccessQueue, siAccessBuf, SI_Q_BUF_LEN);
osSendMesg(&__osSiAccessQueue, NULL, OS_MESG_NOBLOCK); osSendMesg(&__osSiAccessQueue, NULL, OS_MESG_NOBLOCK);
} }
void __osSiGetAccess(void) { void __osSiGetAccess(void) {
OSMesg dummyMesg; OSMesg dummyMesg;
if (!__osSiAccessQueueEnabled) { if (!__osSiAccessQueueEnabled) {
__osSiCreateAccessQueue(); __osSiCreateAccessQueue();
} }
osRecvMesg(&__osSiAccessQueue, &dummyMesg, OS_MESG_BLOCK); osRecvMesg(&__osSiAccessQueue, &dummyMesg, OS_MESG_BLOCK);
} }
void __osSiRelAccess(void) { void __osSiRelAccess(void) {
osSendMesg(&__osSiAccessQueue, NULL, OS_MESG_NOBLOCK); osSendMesg(&__osSiAccessQueue, NULL, OS_MESG_NOBLOCK);
} }

View File

@ -23,28 +23,28 @@ OSViMode osViModePalLan1 = {
}; };
void __osViInit(void) { void __osViInit(void) {
bzero(vi, sizeof(vi)); bzero(vi, sizeof(vi));
__osViCurr = &vi[0]; __osViCurr = &vi[0];
__osViNext = &vi[1]; __osViNext = &vi[1];
__osViNext->retraceCount = 1; __osViNext->retraceCount = 1;
__osViCurr->retraceCount = 1; __osViCurr->retraceCount = 1;
__osViNext->framep = (void*)K0BASE; __osViNext->framep = (void*)K0BASE;
__osViCurr->framep = (void*)K0BASE; __osViCurr->framep = (void*)K0BASE;
if (osTvType == OS_TV_TYPE_PAL) { if (osTvType == OS_TV_TYPE_PAL) {
__osViNext->modep = &osViModePalLan1; __osViNext->modep = &osViModePalLan1;
} else if (osTvType == OS_TV_TYPE_MPAL) { } else if (osTvType == OS_TV_TYPE_MPAL) {
__osViNext->modep = &osViModeMpalLan1; __osViNext->modep = &osViModeMpalLan1;
} else { } else {
__osViNext->modep = &osViModeNtscLan1; __osViNext->modep = &osViModeNtscLan1;
} }
__osViNext->state = VI_STATE_BLACK; __osViNext->state = VI_STATE_BLACK;
__osViNext->control = __osViNext->modep->comRegs.ctrl; __osViNext->control = __osViNext->modep->comRegs.ctrl;
while (IO_READ(VI_CURRENT_REG) > 10) { //wait for vsync? while (IO_READ(VI_CURRENT_REG) > 10) { //wait for vsync?
} }
IO_WRITE(VI_CONTROL_REG, 0); //pixel size blank (no data, no sync) IO_WRITE(VI_CONTROL_REG, 0); //pixel size blank (no data, no sync)
__osViSwapContext(); __osViSwapContext();
} }

View File

@ -36,7 +36,7 @@ static const double pows[] = {10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L
#define _D2 2 #define _D2 2
#define _D3 3 #define _D3 3
#define ALIGN(s, align) (((u32)(s) + ((align)-1)) & ~((align)-1)) #define ALIGN(s, align) (((u32)(s) + ((align)-1)) & ~((align)-1))
void _Ldtob(_Pft* px, char code) { void _Ldtob(_Pft* px, char code) {
char buff[BUFF_LEN]; char buff[BUFF_LEN];

View File

@ -396,88 +396,88 @@ s32 gPauseMessages[] = {
[PAUSE_MSG_NONE] MSG_NONE, [PAUSE_MSG_NONE] MSG_NONE,
[PAUSE_MSG_TUT_NAME_BADGES] MSG_MenuTip_BadgeTutorial_01, [PAUSE_MSG_TUT_NAME_BADGES] MSG_MenuTip_BadgeTutorial_01,
[PAUSE_MSG_TUT_UNUSED_1] MSG_MenuTip_002B, [PAUSE_MSG_TUT_UNUSED_1] MSG_MenuTip_002B,
[PAUSE_MSG_TUT_UNUSED_2] MSG_MenuTip_002C, [PAUSE_MSG_TUT_UNUSED_2] MSG_MenuTip_002C,
[PAUSE_MSG_TUT_UNUSED_3] MSG_MenuTip_002D, [PAUSE_MSG_TUT_UNUSED_3] MSG_MenuTip_002D,
[PAUSE_MSG_TUT_UNUSED_4] MSG_MenuTip_002E, [PAUSE_MSG_TUT_UNUSED_4] MSG_MenuTip_002E,
[PAUSE_MSG_TUT_UNUSED_5] MSG_MenuTip_002F, [PAUSE_MSG_TUT_UNUSED_5] MSG_MenuTip_002F,
[PAUSE_MSG_TUT_UNUSED_6] MSG_MenuTip_0030, [PAUSE_MSG_TUT_UNUSED_6] MSG_MenuTip_0030,
[PAUSE_MSG_TUT_UNUSED_7] MSG_MenuTip_0031, [PAUSE_MSG_TUT_UNUSED_7] MSG_MenuTip_0031,
[PAUSE_MSG_TUT_DESC_1] MSG_MenuTip_BadgeTutorial_02, [PAUSE_MSG_TUT_DESC_1] MSG_MenuTip_BadgeTutorial_02,
[PAUSE_MSG_TUT_DESC_2] MSG_MenuTip_BadgeTutorial_03, [PAUSE_MSG_TUT_DESC_2] MSG_MenuTip_BadgeTutorial_03,
[PAUSE_MSG_TUT_DESC_3] MSG_MenuTip_BadgeTutorial_04, [PAUSE_MSG_TUT_DESC_3] MSG_MenuTip_BadgeTutorial_04,
[PAUSE_MSG_TUT_DESC_4] MSG_MenuTip_BadgeTutorial_05, [PAUSE_MSG_TUT_DESC_4] MSG_MenuTip_BadgeTutorial_05,
[PAUSE_MSG_TUT_DESC_5] MSG_MenuTip_BadgeTutorial_06, [PAUSE_MSG_TUT_DESC_5] MSG_MenuTip_BadgeTutorial_06,
[PAUSE_MSG_TUT_DESC_6] MSG_MenuTip_BadgeTutorial_07, [PAUSE_MSG_TUT_DESC_6] MSG_MenuTip_BadgeTutorial_07,
[PAUSE_MSG_TUT_DESC_7] MSG_MenuTip_BadgeTutorial_08, [PAUSE_MSG_TUT_DESC_7] MSG_MenuTip_BadgeTutorial_08,
[PAUSE_MSG_TUT_CMD_1] MSG_MenuTip_BadgeTutorial_09, [PAUSE_MSG_TUT_CMD_1] MSG_MenuTip_BadgeTutorial_09,
[PAUSE_MSG_TUT_CMD_2] MSG_MenuTip_BadgeTutorial_10, [PAUSE_MSG_TUT_CMD_2] MSG_MenuTip_BadgeTutorial_10,
[PAUSE_MSG_TUT_CMD_3] MSG_MenuTip_BadgeTutorial_11, [PAUSE_MSG_TUT_CMD_3] MSG_MenuTip_BadgeTutorial_11,
[PAUSE_MSG_TUT_CMD_4] MSG_MenuTip_BadgeTutorial_12, [PAUSE_MSG_TUT_CMD_4] MSG_MenuTip_BadgeTutorial_12,
[PAUSE_MSG_TUT_CMD_5] MSG_MenuTip_BadgeTutorial_13, [PAUSE_MSG_TUT_CMD_5] MSG_MenuTip_BadgeTutorial_13,
[PAUSE_MSG_TUT_CMD_6] MSG_MenuTip_BadgeTutorial_14, [PAUSE_MSG_TUT_CMD_6] MSG_MenuTip_BadgeTutorial_14,
[PAUSE_MSG_TUT_CMD_7] MSG_MenuTip_BadgeTutorial_15, [PAUSE_MSG_TUT_CMD_7] MSG_MenuTip_BadgeTutorial_15,
[PAUSE_MSG_17] (s32) gPauseMsg_17, [PAUSE_MSG_17] (s32) gPauseMsg_17,
[PAUSE_MSG_18] (s32) gPauseMsg_18, [PAUSE_MSG_18] (s32) gPauseMsg_18,
[PAUSE_MSG_19] (s32) gPauseMsg_19, [PAUSE_MSG_19] (s32) gPauseMsg_19,
[PAUSE_MSG_1A] (s32) gPauseMsg_1A, [PAUSE_MSG_1A] (s32) gPauseMsg_1A,
[PAUSE_MSG_TAB_STATS] MSG_MenuTip_StatsTab, [PAUSE_MSG_TAB_STATS] MSG_MenuTip_StatsTab,
[PAUSE_MSG_TAB_BADGES] MSG_MenuTip_BadgesTab, [PAUSE_MSG_TAB_BADGES] MSG_MenuTip_BadgesTab,
[PAUSE_MSG_TAB_ITEMS] MSG_MenuTip_ItemsTab, [PAUSE_MSG_TAB_ITEMS] MSG_MenuTip_ItemsTab,
[PAUSE_MSG_TAB_PARTY] MSG_MenuTip_PartyTab, [PAUSE_MSG_TAB_PARTY] MSG_MenuTip_PartyTab,
[PAUSE_MSG_TAB_SPIRITS] MSG_MenuTip_SpiritsTab, [PAUSE_MSG_TAB_SPIRITS] MSG_MenuTip_SpiritsTab,
[PAUSE_MSG_TAB_MAP] MSG_MenuTip_MapTab, [PAUSE_MSG_TAB_MAP] MSG_MenuTip_MapTab,
[PAUSE_MSG_TIP_CONTROLS] MSG_MenuTip_ControllingMario, [PAUSE_MSG_TIP_CONTROLS] MSG_MenuTip_ControllingMario,
[PAUSE_MSG_TIP_HP] MSG_MenuTip_HeartPoints, [PAUSE_MSG_TIP_HP] MSG_MenuTip_HeartPoints,
[PAUSE_MSG_TIP_FP] MSG_MenuTip_FlowerPoints, [PAUSE_MSG_TIP_FP] MSG_MenuTip_FlowerPoints,
[PAUSE_MSG_TIP_BP] MSG_MenuTip_BadgePoints, [PAUSE_MSG_TIP_BP] MSG_MenuTip_BadgePoints,
[PAUSE_MSG_TIP_BOOTS_1] MSG_MenuTip_Boots1, [PAUSE_MSG_TIP_BOOTS_1] MSG_MenuTip_Boots1,
[PAUSE_MSG_TIP_BOOTS_2] MSG_MenuTip_Boots2, [PAUSE_MSG_TIP_BOOTS_2] MSG_MenuTip_Boots2,
[PAUSE_MSG_TIP_BOOTS_3] MSG_MenuTip_Boots3, [PAUSE_MSG_TIP_BOOTS_3] MSG_MenuTip_Boots3,
[PAUSE_MSG_TIP_HAMMER_0] MSG_MenuTip_Hammer0, [PAUSE_MSG_TIP_HAMMER_0] MSG_MenuTip_Hammer0,
[PAUSE_MSG_TIP_HAMMER_1] MSG_MenuTip_Hammer1, [PAUSE_MSG_TIP_HAMMER_1] MSG_MenuTip_Hammer1,
[PAUSE_MSG_TIP_HAMMER_2] MSG_MenuTip_Hammer2, [PAUSE_MSG_TIP_HAMMER_2] MSG_MenuTip_Hammer2,
[PAUSE_MSG_TIP_HAMMER_3] MSG_MenuTip_Hammer3, [PAUSE_MSG_TIP_HAMMER_3] MSG_MenuTip_Hammer3,
[PAUSE_MSG_TIP_STAR_POWER] MSG_MenuTip_StarPower, [PAUSE_MSG_TIP_STAR_POWER] MSG_MenuTip_StarPower,
[PAUSE_MSG_TIP_STAR_POINTS] MSG_MenuTip_StarPoints, [PAUSE_MSG_TIP_STAR_POINTS] MSG_MenuTip_StarPoints,
[PAUSE_MSG_TIP_COINS] MSG_MenuTip_Coins, [PAUSE_MSG_TIP_COINS] MSG_MenuTip_Coins,
[PAUSE_MSG_TIP_SECRETS] MSG_MenuTip_Secrets, [PAUSE_MSG_TIP_SECRETS] MSG_MenuTip_Secrets,
[PAUSE_MSG_TIP_STAR_PIECES] MSG_MenuTip_StarPieces, [PAUSE_MSG_TIP_STAR_PIECES] MSG_MenuTip_StarPieces,
[PAUSE_MSG_TIP_TIME] MSG_MenuTip_Time, [PAUSE_MSG_TIP_TIME] MSG_MenuTip_Time,
[PAUSE_MSG_LBL_COINS] (s32) gPauseMsg_32, [PAUSE_MSG_LBL_COINS] (s32) gPauseMsg_32,
[PAUSE_MSG_LBL_STAR_POINTS] (s32) gPauseMsg_33, [PAUSE_MSG_LBL_STAR_POINTS] (s32) gPauseMsg_33,
[PAUSE_MSG_LBL_STAR_PIECES] (s32) gPauseMsg_34, [PAUSE_MSG_LBL_STAR_PIECES] (s32) gPauseMsg_34,
[PAUSE_MSG_LBL_TIME] (s32) gPauseMsg_35, [PAUSE_MSG_LBL_TIME] (s32) gPauseMsg_35,
[PAUSE_MSG_LBL_HP] (s32) gPauseMsg_36, [PAUSE_MSG_LBL_HP] (s32) gPauseMsg_36,
[PAUSE_MSG_LBL_FP] (s32) gPauseMsg_37, [PAUSE_MSG_LBL_FP] (s32) gPauseMsg_37,
[PAUSE_MSG_LBL_BP] (s32) gPauseMsg_38, [PAUSE_MSG_LBL_BP] (s32) gPauseMsg_38,
[PAUSE_MSG_SLASH] (s32) gPauseMsg_39, [PAUSE_MSG_SLASH] (s32) gPauseMsg_39,
[PAUSE_MSG_DOT] (s32) gPauseMsg_3A, [PAUSE_MSG_DOT] (s32) gPauseMsg_3A,
[PAUSE_MSG_3B] (s32) gPauseMsg_3B, [PAUSE_MSG_3B] (s32) gPauseMsg_3B,
[PAUSE_MSG_3C] (s32) gPauseMsg_3C, [PAUSE_MSG_3C] (s32) gPauseMsg_3C,
[PAUSE_MSG_3D] (s32) gPauseMsg_3D, [PAUSE_MSG_3D] (s32) gPauseMsg_3D,
[PAUSE_MSG_3E] (s32) gPauseMsg_3E, [PAUSE_MSG_3E] (s32) gPauseMsg_3E,
[PAUSE_MSG_3F] (s32) gPauseMsg_3F, [PAUSE_MSG_3F] (s32) gPauseMsg_3F,
[PAUSE_MSG_40] (s32) gPauseMsg_40, [PAUSE_MSG_40] (s32) gPauseMsg_40,
[PAUSE_MSG_41] (s32) gPauseMsg_41, [PAUSE_MSG_41] (s32) gPauseMsg_41,
[PAUSE_MSG_42] (s32) gPauseMsg_42, [PAUSE_MSG_42] (s32) gPauseMsg_42,
[PAUSE_MSG_MARIO] (s32) gPauseMsg_43, [PAUSE_MSG_MARIO] (s32) gPauseMsg_43,
[PAUSE_MSG_LEVEL] (s32) gPauseMsg_44, [PAUSE_MSG_LEVEL] (s32) gPauseMsg_44,
[PAUSE_MSG_NO_BADGE] MSG_MenuTip_None, [PAUSE_MSG_NO_BADGE] MSG_MenuTip_None,
[PAUSE_MSG_BADGE_BP] (s32) gPauseMsg_46, [PAUSE_MSG_BADGE_BP] (s32) gPauseMsg_46,
[PAUSE_MSG_ALL_BADGES] (s32) gPauseMsg_47, [PAUSE_MSG_ALL_BADGES] (s32) gPauseMsg_47,
[PAUSE_MSG_ACTIVE] (s32) gPauseMsg_48, [PAUSE_MSG_ACTIVE] (s32) gPauseMsg_48,
[PAUSE_MSG_BADGES] (s32) gPauseMsg_49, [PAUSE_MSG_BADGES] (s32) gPauseMsg_49,
[PAUSE_MSG_NOT_ENOUGH_BP] (s32) gPauseMsg_4A, [PAUSE_MSG_NOT_ENOUGH_BP] (s32) gPauseMsg_4A,
[PAUSE_MSG_DONT_WEAR_MORE] (s32) gPauseMsg_4B, [PAUSE_MSG_DONT_WEAR_MORE] (s32) gPauseMsg_4B,
[PAUSE_MSG_BAGDE_DESC_ALL] MSG_MenuTip_BadgeTab_All, [PAUSE_MSG_BAGDE_DESC_ALL] MSG_MenuTip_BadgeTab_All,
[PAUSE_MSG_BAGDE_DESC_ACTIVE] MSG_MenuTip_BadgeTab_Equipped, [PAUSE_MSG_BAGDE_DESC_ACTIVE] MSG_MenuTip_BadgeTab_Equipped,
[PAUSE_MSG_BAGDE_DESC_NONE] MSG_MenuTip_None, [PAUSE_MSG_BAGDE_DESC_NONE] MSG_MenuTip_None,
[PAUSE_MSG_KEY_ITEMS] (s32) gPauseMsg_4F, [PAUSE_MSG_KEY_ITEMS] (s32) gPauseMsg_4F,
[PAUSE_MSG_CONSUMABLES] (s32) gPauseMsg_50, [PAUSE_MSG_CONSUMABLES] (s32) gPauseMsg_50,
[PAUSE_MSG_DESC_CONSUMABLES] MSG_MenuTip_ItemTab_Consumables, [PAUSE_MSG_DESC_CONSUMABLES] MSG_MenuTip_ItemTab_Consumables,
[PAUSE_MSG_DESC_KEY_ITEMS] MSG_MenuTip_ItemTab_KeyItems, [PAUSE_MSG_DESC_KEY_ITEMS] MSG_MenuTip_ItemTab_KeyItems,
[PAUSE_MSG_PARTNER_HP] (s32) gPauseMsg_53, [PAUSE_MSG_PARTNER_HP] (s32) gPauseMsg_53,
[PAUSE_MSG_PARTNER_FP] (s32) gPauseMsg_54, [PAUSE_MSG_PARTNER_FP] (s32) gPauseMsg_54,
[PAUSE_MSG_PARTNER_ABILITIES] (s32) gPauseMsg_55, [PAUSE_MSG_PARTNER_ABILITIES] (s32) gPauseMsg_55,
[PAUSE_MSG_UNKNOWN_SPIRIT] (s32) gPauseMsg_56, [PAUSE_MSG_UNKNOWN_SPIRIT] (s32) gPauseMsg_56,
}; };