mirror of https://github.com/pmret/papermario.git
format
This commit is contained in:
parent
2cbb8e5712
commit
8a2bb470a9
|
@ -1654,7 +1654,8 @@ typedef struct struct802E1400 {
|
||||||
/* 0x03C */ union {
|
/* 0x03C */ union {
|
||||||
/* */ s16 s;
|
/* */ s16 s;
|
||||||
/* */ s8 b[2];
|
/* */ s8 b[2];
|
||||||
/* */ } unk_3C;
|
/* */
|
||||||
|
} unk_3C;
|
||||||
/* 0x03E */ char unk_3E[0x4D];
|
/* 0x03E */ char unk_3E[0x4D];
|
||||||
/* 0x08B */ u8 unk_8B[24];
|
/* 0x08B */ u8 unk_8B[24];
|
||||||
/* 0x0A3 */ char unk_A3; // padding?
|
/* 0x0A3 */ char unk_A3; // padding?
|
||||||
|
|
|
@ -31,7 +31,7 @@ typedef struct MapConfig {
|
||||||
} tattle;
|
} tattle;
|
||||||
} MapConfig; // size = 0x40
|
} MapConfig; // size = 0x40
|
||||||
|
|
||||||
typedef s32 (*MapInit)(void);
|
typedef s32(*MapInit)(void);
|
||||||
|
|
||||||
#define MAP_ID_MAX_LEN 7 ///< "xxx_yyy" excluding null terminator.
|
#define MAP_ID_MAX_LEN 7 ///< "xxx_yyy" excluding null terminator.
|
||||||
typedef struct Map {
|
typedef struct Map {
|
||||||
|
|
|
@ -65,9 +65,9 @@
|
||||||
#ifndef __GNUC_VA_LIST
|
#ifndef __GNUC_VA_LIST
|
||||||
#define __GNUC_VA_LIST
|
#define __GNUC_VA_LIST
|
||||||
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
|
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
|
||||||
typedef char *__gnuc_va_list;
|
typedef char* __gnuc_va_list;
|
||||||
#else
|
#else
|
||||||
typedef void *__gnuc_va_list;
|
typedef void* __gnuc_va_list;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ typedef void *__gnuc_va_list;
|
||||||
(AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
|
(AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
|
||||||
|
|
||||||
#undef va_end
|
#undef va_end
|
||||||
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
|
void va_end(__gnuc_va_list); /* Defined in libgcc.a */
|
||||||
#define va_end(AP) ((void)0)
|
#define va_end(AP) ((void)0)
|
||||||
|
|
||||||
/* We cast to void * and then to TYPE * because this avoids
|
/* We cast to void * and then to TYPE * because this avoids
|
||||||
|
|
|
@ -17,16 +17,16 @@
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Pointer to FP regs. */
|
/* Pointer to FP regs. */
|
||||||
char *__fp_regs;
|
char* __fp_regs;
|
||||||
/* Number of FP regs remaining. */
|
/* Number of FP regs remaining. */
|
||||||
int __fp_left;
|
int __fp_left;
|
||||||
/* Pointer to GP regs followed by stack parameters. */
|
/* Pointer to GP regs followed by stack parameters. */
|
||||||
char *__gp_regs;
|
char* __gp_regs;
|
||||||
} __gnuc_va_list;
|
} __gnuc_va_list;
|
||||||
|
|
||||||
#else /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
|
#else /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
|
||||||
|
|
||||||
typedef char * __gnuc_va_list;
|
typedef char* __gnuc_va_list;
|
||||||
|
|
||||||
#endif /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
|
#endif /* ! (defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
|
||||||
#endif /* not __GNUC_VA_LIST */
|
#endif /* not __GNUC_VA_LIST */
|
||||||
|
@ -165,7 +165,7 @@ enum {
|
||||||
#endif /* ! _STDARG_H */
|
#endif /* ! _STDARG_H */
|
||||||
|
|
||||||
#ifndef va_end
|
#ifndef va_end
|
||||||
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
|
void va_end(__gnuc_va_list); /* Defined in libgcc.a */
|
||||||
#endif
|
#endif
|
||||||
#define va_end(__AP) ((void)0)
|
#define va_end(__AP) ((void)0)
|
||||||
|
|
||||||
|
|
|
@ -97,9 +97,9 @@
|
||||||
#ifndef __GNUC_VA_LIST
|
#ifndef __GNUC_VA_LIST
|
||||||
#define __GNUC_VA_LIST
|
#define __GNUC_VA_LIST
|
||||||
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
|
#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
|
||||||
typedef char *__gnuc_va_list;
|
typedef char* __gnuc_va_list;
|
||||||
#else
|
#else
|
||||||
typedef void *__gnuc_va_list;
|
typedef void* __gnuc_va_list;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ s32 func_802E17A8(Entity* entity) {
|
||||||
f32 phi_f4;
|
f32 phi_f4;
|
||||||
s32 phi_s2 = 0;
|
s32 phi_s2 = 0;
|
||||||
|
|
||||||
switch(temp_s0->unk_10) {
|
switch (temp_s0->unk_10) {
|
||||||
case 0: // switch 1
|
case 0: // switch 1
|
||||||
temp_f6 = temp_s0->unk_14.z * 0.3;
|
temp_f6 = temp_s0->unk_14.z * 0.3;
|
||||||
temp_f4 = ((temp_s0->unk_14.x + temp_f6) - entity->scale.x) / 4.0;
|
temp_f4 = ((temp_s0->unk_14.x + temp_f6) - entity->scale.x) / 4.0;
|
||||||
|
@ -230,7 +230,7 @@ s32 func_802E17A8(Entity* entity) {
|
||||||
|
|
||||||
entity->scale.z = entity->scale.x;
|
entity->scale.z = entity->scale.x;
|
||||||
|
|
||||||
switch(temp_s0->unk_11) {
|
switch (temp_s0->unk_11) {
|
||||||
|
|
||||||
case 0: // switch 2
|
case 0: // switch 2
|
||||||
temp_f6 = temp_s0->unk_14.z * -0.5;
|
temp_f6 = temp_s0->unk_14.z * -0.5;
|
||||||
|
@ -334,7 +334,7 @@ void func_802E1EDC(Entity* entity) {
|
||||||
f32 phi_f4;
|
f32 phi_f4;
|
||||||
s32 phi_s2 = 0;
|
s32 phi_s2 = 0;
|
||||||
|
|
||||||
switch(temp_s0->unk_10) {
|
switch (temp_s0->unk_10) {
|
||||||
case 0:
|
case 0:
|
||||||
temp_f6 = temp_s0->unk_14.z * 0.3;
|
temp_f6 = temp_s0->unk_14.z * 0.3;
|
||||||
temp_f4 = ((temp_s0->unk_14.x + temp_f6) - entity->scale.x) / 4.0;
|
temp_f4 = ((temp_s0->unk_14.x + temp_f6) - entity->scale.x) / 4.0;
|
||||||
|
@ -551,7 +551,7 @@ void func_802E2BA4(s32 entityIndex) {
|
||||||
y_inv = -entity->position.y;
|
y_inv = -entity->position.y;
|
||||||
z_inv = -entity->position.z;
|
z_inv = -entity->position.z;
|
||||||
phi_fp = temp_s4->unk_34;
|
phi_fp = temp_s4->unk_34;
|
||||||
for(i = 0; i < 24; i++) {
|
for (i = 0; i < 24; i++) {
|
||||||
if (temp_s4->unk_3C.s == 0xFF) {
|
if (temp_s4->unk_3C.s == 0xFF) {
|
||||||
gDPSetRenderMode(temp_s2++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
gDPSetRenderMode(temp_s2++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
|
||||||
gDPSetCombineMode(temp_s2++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
gDPSetCombineMode(temp_s2++, G_CC_MODULATEIA, G_CC_MODULATEIA);
|
||||||
|
|
|
@ -213,13 +213,13 @@ s32 func_802E3BA4(Entity* entity) {
|
||||||
bVar1 = entity->unk_06;
|
bVar1 = entity->unk_06;
|
||||||
if ((bVar1 & 4) != 0) {
|
if ((bVar1 & 4) != 0) {
|
||||||
s32 type = get_entity_type(entity->listIndex);
|
s32 type = get_entity_type(entity->listIndex);
|
||||||
if((type == 0xC)) {
|
if ((type == 0xC)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((type >= 0xC)) {
|
if ((type >= 0xC)) {
|
||||||
if((type < 0x1b)) {
|
if ((type < 0x1b)) {
|
||||||
if((type > 0x14)) {
|
if ((type > 0x14)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ s32 func_802E3BA4(Entity* entity) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(get_entity_type(entity->listIndex)) {
|
switch (get_entity_type(entity->listIndex)) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
case 0x15:
|
case 0x15:
|
||||||
|
@ -273,8 +273,8 @@ s32 func_802E3BA4(Entity* entity) {
|
||||||
if (!bVar2) {
|
if (!bVar2) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
func_8010FBC0(entity,&D_802E9E80);
|
func_8010FBC0(entity, &D_802E9E80);
|
||||||
play_sound_at_position(0x14f, 0, entity->position.x, entity->position.y ,entity->position.z);
|
play_sound_at_position(0x14f, 0, entity->position.x, entity->position.y, entity->position.z);
|
||||||
break;
|
break;
|
||||||
case 0x16:
|
case 0x16:
|
||||||
case 0x19:
|
case 0x19:
|
||||||
|
@ -288,16 +288,16 @@ s32 func_802E3BA4(Entity* entity) {
|
||||||
if (!bVar2) {
|
if (!bVar2) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
func_8010FBC0(entity,&D_802E9E80);
|
func_8010FBC0(entity, &D_802E9E80);
|
||||||
play_sound_at_position(0x150, 0, entity->position.x, entity->position.y ,entity->position.z);
|
play_sound_at_position(0x150, 0, entity->position.x, entity->position.y, entity->position.z);
|
||||||
break;
|
break;
|
||||||
case 0x17:
|
case 0x17:
|
||||||
case 0x1a:
|
case 0x1a:
|
||||||
if (gPlayerData.hammerLevel < '\x02') {
|
if (gPlayerData.hammerLevel < '\x02') {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
func_8010FBC0(entity,&D_802E9E80);
|
func_8010FBC0(entity, &D_802E9E80);
|
||||||
play_sound_at_position(0x151, 0, entity->position.x, entity->position.y ,entity->position.z);
|
play_sound_at_position(0x151, 0, entity->position.x, entity->position.y, entity->position.z);
|
||||||
break;
|
break;
|
||||||
case 0x1b:
|
case 0x1b:
|
||||||
case 0x1c:
|
case 0x1c:
|
||||||
|
|
|
@ -39,7 +39,7 @@ INCLUDE_ASM(s32, "code_1b40_len_20b0", gfx_draw_frame);
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
void load_engine_data(void) {
|
void load_engine_data(void) {
|
||||||
GameStatus *phi_s0;
|
GameStatus* phi_s0;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
dma_copy(D_000FEE30, D_000FEE30_end, D_802DBD40);
|
dma_copy(D_000FEE30, D_000FEE30_end, D_802DBD40);
|
||||||
|
@ -98,8 +98,7 @@ void load_engine_data(void) {
|
||||||
poll_rumble();
|
poll_rumble();
|
||||||
|
|
||||||
phi_s0 = GAME_STATUS;
|
phi_s0 = GAME_STATUS;
|
||||||
for(i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++) {
|
||||||
{
|
|
||||||
phi_s0->unk_50[i] = 3;
|
phi_s0->unk_50[i] = 3;
|
||||||
phi_s0->unk_48[i] = 0xC;
|
phi_s0->unk_48[i] = 0xC;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,13 @@ s32 render_effects(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
curEffectInst = &D_800B4398[0];
|
curEffectInst = &D_800B4398[0];
|
||||||
for(i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
for (i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
||||||
if ((curEffectInst[i] != NULL) && ((curEffectInst[i]->flags & 1) != 0) && ((curEffectInst[i]->flags & 8) != 0)) {
|
if ((curEffectInst[i] != NULL) && ((curEffectInst[i]->flags & 1) != 0) && ((curEffectInst[i]->flags & 8) != 0)) {
|
||||||
if(GAME_STATUS->isBattle) {
|
if (GAME_STATUS->isBattle) {
|
||||||
if((curEffectInst[i]->flags & 4) != 0) {
|
if ((curEffectInst[i]->flags & 4) != 0) {
|
||||||
curEffectInst[i]->effect->renderWorld(curEffectInst[i]);
|
curEffectInst[i]->effect->renderWorld(curEffectInst[i]);
|
||||||
}
|
}
|
||||||
} else if((curEffectInst[i]->flags & 4) == 0) {
|
} else if ((curEffectInst[i]->flags & 4) == 0) {
|
||||||
curEffectInst[i]->effect->renderWorld(curEffectInst[i]);
|
curEffectInst[i]->effect->renderWorld(curEffectInst[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,13 +57,13 @@ s32 render_effects(void) {
|
||||||
INCLUDE_ASM(s32, "code_341d0", func_80059F94);
|
INCLUDE_ASM(s32, "code_341d0", func_80059F94);
|
||||||
|
|
||||||
EffectInstance* func_8005A2BC(EffectBlueprint* effectBp) {
|
EffectInstance* func_8005A2BC(EffectBlueprint* effectBp) {
|
||||||
EffectInstance *newEffectInst;
|
EffectInstance* newEffectInst;
|
||||||
Effect* curEffect;
|
Effect* curEffect;
|
||||||
s32 i;
|
s32 i;
|
||||||
EffectInstance** temp = &D_800B4398[0];
|
EffectInstance** temp = &D_800B4398[0];
|
||||||
|
|
||||||
// Search for an unused instance
|
// Search for an unused instance
|
||||||
for(i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
for (i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
||||||
if (temp[i] == NULL) {
|
if (temp[i] == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ EffectInstance* func_8005A2BC(EffectBlueprint* effectBp) {
|
||||||
newEffectInst->flags = 1;
|
newEffectInst->flags = 1;
|
||||||
|
|
||||||
// Look for a loaded effect of the proper index
|
// Look for a loaded effect of the proper index
|
||||||
for(i = 0; i < ARRAY_COUNT(D_800A4000); i++) {
|
for (i = 0; i < ARRAY_COUNT(D_800A4000); i++) {
|
||||||
if ((curEffect->flags & EFFECT_LOADED) && (curEffect->effectIndex == effectBp->effectIndex)) {
|
if ((curEffect->flags & EFFECT_LOADED) && (curEffect->effectIndex == effectBp->effectIndex)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ void remove_effect(EffectInstance* arg0) {
|
||||||
s32 i;
|
s32 i;
|
||||||
EffectInstance** temp = &D_800B4398[0];
|
EffectInstance** temp = &D_800B4398[0];
|
||||||
|
|
||||||
for(i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
for (i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
||||||
if (temp[i] == arg0) {
|
if (temp[i] == arg0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -147,10 +147,10 @@ void remove_all_effects(void) {
|
||||||
s32 i;
|
s32 i;
|
||||||
EffectInstance** temp = &D_800B4398[0];
|
EffectInstance** temp = &D_800B4398[0];
|
||||||
|
|
||||||
for(i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
for (i = 0; i < ARRAY_COUNT(D_800B4398); i++) {
|
||||||
EffectInstance* temp2 = temp[i];
|
EffectInstance* temp2 = temp[i];
|
||||||
if (temp2 != NULL && temp2->flags & 4) {
|
if (temp2 != NULL && temp2->flags & 4) {
|
||||||
if(temp2->unk_0C != NULL) {
|
if (temp2->unk_0C != NULL) {
|
||||||
general_heap_free(temp2->unk_0C);
|
general_heap_free(temp2->unk_0C);
|
||||||
}
|
}
|
||||||
general_heap_free(temp2);
|
general_heap_free(temp2);
|
||||||
|
@ -176,7 +176,7 @@ s32 play_effect(s32 effectIndex) {
|
||||||
effectEntry = &effectTable[effectIndex];
|
effectEntry = &effectTable[effectIndex];
|
||||||
|
|
||||||
// Look for a loaded effect matching the desired index
|
// Look for a loaded effect matching the desired index
|
||||||
for(i = 0, curEffect = &D_800A4000[0]; i < ARRAY_COUNT(D_800A4000); i++) {
|
for (i = 0, curEffect = &D_800A4000[0]; i < ARRAY_COUNT(D_800A4000); i++) {
|
||||||
if ((curEffect->flags & EFFECT_LOADED) && (curEffect->effectIndex == effectIndex)) {
|
if ((curEffect->flags & EFFECT_LOADED) && (curEffect->effectIndex == effectIndex)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ s32 play_effect(s32 effectIndex) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a loaded effect wasn't found, look for the first empty space
|
// If a loaded effect wasn't found, look for the first empty space
|
||||||
for(i = 0, curEffect = &D_800A4000[0]; i < ARRAY_COUNT(D_800A4000); i++) {
|
for (i = 0, curEffect = &D_800A4000[0]; i < ARRAY_COUNT(D_800A4000); i++) {
|
||||||
if (!(curEffect->flags & EFFECT_LOADED)) {
|
if (!(curEffect->flags & EFFECT_LOADED)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue