This commit is contained in:
dark-samus 2021-01-15 12:18:27 -05:00
parent 2cbb8e5712
commit 8a2bb470a9
10 changed files with 193 additions and 193 deletions

View File

@ -792,7 +792,7 @@ typedef struct EffectBlueprint {
/* 0x08 */ void (*init)(EffectInstance* effectInst); /* 0x08 */ void (*init)(EffectInstance* effectInst);
/* 0x0C */ void (*update)(EffectInstance* effectInst); /* 0x0C */ void (*update)(EffectInstance* effectInst);
/* 0x10 */ void (*renderWorld)(EffectInstance* effectInst); /* 0x10 */ void (*renderWorld)(EffectInstance* effectInst);
/* 0x14 */ void (*unk_14)(EffectInstance* effectInst); /* 0x14 */ void (*unk_14)(EffectInstance* effectInst);
} EffectBlueprint; // size = 0x18 } EffectBlueprint; // size = 0x18
typedef struct Effect { typedef struct Effect {
@ -802,7 +802,7 @@ typedef struct Effect {
/* 0x0C */ s32 unk_0C; /* 0x0C */ s32 unk_0C;
/* 0x10 */ void (*update)(EffectInstance* effectInst); /* 0x10 */ void (*update)(EffectInstance* effectInst);
/* 0x14 */ void (*renderWorld)(EffectInstance* effectInst); /* 0x14 */ void (*renderWorld)(EffectInstance* effectInst);
/* 0x18 */ void (*unk_18)(EffectInstance* effectInst); /* 0x18 */ void (*unk_18)(EffectInstance* effectInst);
/* 0x1C */ void* unk_1C; /* 0x1C */ void* unk_1C;
} Effect; // size = 0x20 } Effect; // size = 0x20
@ -1652,9 +1652,10 @@ typedef struct struct802E1400 {
/* 0x034 */ struct802E2BA4* unk_34; /* 0x034 */ struct802E2BA4* unk_34;
/* 0x038 */ f32 unk_38; /* 0x038 */ f32 unk_38;
/* 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?

View File

@ -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 {

View File

@ -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
@ -86,28 +86,28 @@ typedef void *__gnuc_va_list;
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#endif #endif
#define va_start(AP, LASTARG) \ #define va_start(AP, LASTARG) \
(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
a warning about increasing the alignment requirement. */ a warning about increasing the alignment requirement. */
#if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__) #if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
/* This is for little-endian machines; small args are padded upward. */ /* This is for little-endian machines; small args are padded upward. */
#define va_arg(AP, TYPE) \ #define va_arg(AP, TYPE) \
(AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
*((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
#else /* big-endian */ #else /* big-endian */
/* This is for big-endian machines; small args are padded downward. */ /* This is for big-endian machines; small args are padded downward. */
#define va_arg(AP, TYPE) \ #define va_arg(AP, TYPE) \
(AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
*((TYPE *) (void *) ((char *) (AP) \ *((TYPE *) (void *) ((char *) (AP) \
- ((sizeof (TYPE) < __va_rounded_size (char) \ - ((sizeof (TYPE) < __va_rounded_size (char) \
? sizeof (TYPE) : __va_rounded_size (TYPE)))))) ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
#endif /* big-endian */ #endif /* big-endian */
/* Copy __gnuc_va_list into another variable of this type. */ /* Copy __gnuc_va_list into another variable of this type. */
@ -136,7 +136,7 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
/* Define va_list, if desired, from __gnuc_va_list. */ /* Define va_list, if desired, from __gnuc_va_list. */
/* We deliberately do not define va_list when called from /* We deliberately do not define va_list when called from
stdio.h, because ANSI C says that stdio.h is not supposed to define stdio.h, because ANSI C says that stdio.h is not supposed to define
va_list. stdio.h needs to have access to that data type, va_list. stdio.h needs to have access to that data type,
but must not use that name. It should use the name __gnuc_va_list, but must not use that name. It should use the name __gnuc_va_list,
which is safe because it is reserved for the implementation. */ which is safe because it is reserved for the implementation. */

View File

@ -16,17 +16,17 @@
#if defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float) #if defined (__mips_eabi) && ! defined (__mips_soft_float) && ! defined (__mips_single_float)
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 */
@ -38,26 +38,26 @@ typedef char * __gnuc_va_list;
#ifndef _VA_MIPS_H_ENUM #ifndef _VA_MIPS_H_ENUM
#define _VA_MIPS_H_ENUM #define _VA_MIPS_H_ENUM
enum { enum {
__no_type_class = -1, __no_type_class = -1,
__void_type_class, __void_type_class,
__integer_type_class, __integer_type_class,
__char_type_class, __char_type_class,
__enumeral_type_class, __enumeral_type_class,
__boolean_type_class, __boolean_type_class,
__pointer_type_class, __pointer_type_class,
__reference_type_class, __reference_type_class,
__offset_type_class, __offset_type_class,
__real_type_class, __real_type_class,
__complex_type_class, __complex_type_class,
__function_type_class, __function_type_class,
__method_type_class, __method_type_class,
__record_type_class, __record_type_class,
__union_type_class, __union_type_class,
__array_type_class, __array_type_class,
__string_type_class, __string_type_class,
__set_type_class, __set_type_class,
__file_type_class, __file_type_class,
__lang_type_class __lang_type_class
}; };
#endif #endif
@ -93,28 +93,28 @@ enum {
#if defined (__mips_eabi) #if defined (__mips_eabi)
#if ! defined (__mips_soft_float) && ! defined (__mips_single_float) #if ! defined (__mips_soft_float) && ! defined (__mips_single_float)
#ifdef __mips64 #ifdef __mips64
#define va_start(__AP, __LASTARG) \ #define va_start(__AP, __LASTARG) \
(__AP.__gp_regs = ((char *) __builtin_next_arg (__LASTARG) \ (__AP.__gp_regs = ((char *) __builtin_next_arg (__LASTARG) \
- (__builtin_args_info (2) < 8 \ - (__builtin_args_info (2) < 8 \
? (8 - __builtin_args_info (2)) * __va_reg_size \ ? (8 - __builtin_args_info (2)) * __va_reg_size \
: 0)), \ : 0)), \
__AP.__fp_left = 8 - __builtin_args_info (3), \ __AP.__fp_left = 8 - __builtin_args_info (3), \
__AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * __va_reg_size) __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * __va_reg_size)
#else /* ! defined (__mips64) */ #else /* ! defined (__mips64) */
#define va_start(__AP, __LASTARG) \ #define va_start(__AP, __LASTARG) \
(__AP.__gp_regs = ((char *) __builtin_next_arg (__LASTARG) \ (__AP.__gp_regs = ((char *) __builtin_next_arg (__LASTARG) \
- (__builtin_args_info (2) < 8 \ - (__builtin_args_info (2) < 8 \
? (8 - __builtin_args_info (2)) * __va_reg_size \ ? (8 - __builtin_args_info (2)) * __va_reg_size \
: 0)), \ : 0)), \
__AP.__fp_left = (8 - __builtin_args_info (3)) / 2, \ __AP.__fp_left = (8 - __builtin_args_info (3)) / 2, \
__AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * 8, \ __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * 8, \
__AP.__fp_regs = (char *) ((int) __AP.__fp_regs & -8)) __AP.__fp_regs = (char *) ((int) __AP.__fp_regs & -8))
#endif /* ! defined (__mips64) */ #endif /* ! defined (__mips64) */
#else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float) ) */ #else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float) ) */
#define va_start(__AP, __LASTARG) \ #define va_start(__AP, __LASTARG) \
(__AP = ((__gnuc_va_list) __builtin_next_arg (__LASTARG) \ (__AP = ((__gnuc_va_list) __builtin_next_arg (__LASTARG) \
- (__builtin_args_info (2) >= 8 ? 0 \ - (__builtin_args_info (2) >= 8 ? 0 \
: (8 - __builtin_args_info (2)) * __va_reg_size))) : (8 - __builtin_args_info (2)) * __va_reg_size)))
#endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float) ) */ #endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float) ) */
#else /* ! defined (__mips_eabi) */ #else /* ! defined (__mips_eabi) */
#define va_start(__AP, __LASTARG) \ #define va_start(__AP, __LASTARG) \
@ -131,33 +131,33 @@ enum {
#if defined (__mips_eabi) #if defined (__mips_eabi)
#if ! defined (__mips_soft_float) && ! defined (__mips_single_float) #if ! defined (__mips_soft_float) && ! defined (__mips_single_float)
#ifdef __mips64 #ifdef __mips64
#define va_start(__AP) \ #define va_start(__AP) \
(__AP.__gp_regs = ((char *) __builtin_next_arg () \ (__AP.__gp_regs = ((char *) __builtin_next_arg () \
- (__builtin_args_info (2) < 8 \ - (__builtin_args_info (2) < 8 \
? (8 - __builtin_args_info (2)) * __va_reg_size \ ? (8 - __builtin_args_info (2)) * __va_reg_size \
: __va_reg_size)), \ : __va_reg_size)), \
__AP.__fp_left = 8 - __builtin_args_info (3), \ __AP.__fp_left = 8 - __builtin_args_info (3), \
__AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * __va_reg_size) __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * __va_reg_size)
#else /* ! defined (__mips64) */ #else /* ! defined (__mips64) */
#define va_start(__AP) \ #define va_start(__AP) \
(__AP.__gp_regs = ((char *) __builtin_next_arg () \ (__AP.__gp_regs = ((char *) __builtin_next_arg () \
- (__builtin_args_info (2) < 8 \ - (__builtin_args_info (2) < 8 \
? (8 - __builtin_args_info (2)) * __va_reg_size \ ? (8 - __builtin_args_info (2)) * __va_reg_size \
: __va_reg_size)), \ : __va_reg_size)), \
__AP.__fp_left = (8 - __builtin_args_info (3)) / 2, \ __AP.__fp_left = (8 - __builtin_args_info (3)) / 2, \
__AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * 8, \ __AP.__fp_regs = __AP.__gp_regs - __AP.__fp_left * 8, \
__AP.__fp_regs = (char *) ((int) __AP.__fp_regs & -8)) __AP.__fp_regs = (char *) ((int) __AP.__fp_regs & -8))
#endif /* ! defined (__mips64) */ #endif /* ! defined (__mips64) */
#else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */ #else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
#define va_start(__AP) \ #define va_start(__AP) \
(__AP = ((__gnuc_va_list) __builtin_next_arg () \ (__AP = ((__gnuc_va_list) __builtin_next_arg () \
- (__builtin_args_info (2) >= 8 ? __va_reg_size \ - (__builtin_args_info (2) >= 8 ? __va_reg_size \
: (8 - __builtin_args_info (2)) * __va_reg_size))) : (8 - __builtin_args_info (2)) * __va_reg_size)))
#endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */ #endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
/* Need alternate code for _MIPS_SIM_ABI64. */ /* Need alternate code for _MIPS_SIM_ABI64. */
#elif defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32) #elif defined(_MIPS_SIM) && (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
#define va_start(__AP) \ #define va_start(__AP) \
(__AP = (__gnuc_va_list) __builtin_next_arg () \ (__AP = (__gnuc_va_list) __builtin_next_arg () \
+ (__builtin_args_info (2) >= 8 ? -8 : 0)) + (__builtin_args_info (2) >= 8 ? -8 : 0))
#else #else
#define va_start(__AP) __AP = (char *) &__builtin_va_alist #define va_start(__AP) __AP = (char *) &__builtin_va_alist
@ -165,67 +165,67 @@ 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)
#if defined (__mips_eabi) #if defined (__mips_eabi)
#if ! defined (__mips_soft_float) && ! defined (__mips_single_float) #if ! defined (__mips_soft_float) && ! defined (__mips_single_float)
#ifdef __mips64 #ifdef __mips64
#define __va_next_addr(__AP, __type) \ #define __va_next_addr(__AP, __type) \
((__builtin_classify_type (*(__type *) 0) == __real_type_class \ ((__builtin_classify_type (*(__type *) 0) == __real_type_class \
&& __AP.__fp_left > 0) \ && __AP.__fp_left > 0) \
? (--__AP.__fp_left, (__AP.__fp_regs += 8) - 8) \ ? (--__AP.__fp_left, (__AP.__fp_regs += 8) - 8) \
: (__AP.__gp_regs += __va_reg_size) - __va_reg_size) : (__AP.__gp_regs += __va_reg_size) - __va_reg_size)
#else #else
#define __va_next_addr(__AP, __type) \ #define __va_next_addr(__AP, __type) \
((__builtin_classify_type (*(__type *) 0) == __real_type_class \ ((__builtin_classify_type (*(__type *) 0) == __real_type_class \
&& __AP.__fp_left > 0) \ && __AP.__fp_left > 0) \
? (--__AP.__fp_left, (__AP.__fp_regs += 8) - 8) \ ? (--__AP.__fp_left, (__AP.__fp_regs += 8) - 8) \
: (((__builtin_classify_type (* (__type *) 0) < __record_type_class \ : (((__builtin_classify_type (* (__type *) 0) < __record_type_class \
&& __alignof__ (__type) > 4) \ && __alignof__ (__type) > 4) \
? __AP.__gp_regs = (char *) (((int) __AP.__gp_regs + 8 - 1) & -8) \ ? __AP.__gp_regs = (char *) (((int) __AP.__gp_regs + 8 - 1) & -8) \
: (char *) 0), \ : (char *) 0), \
(__builtin_classify_type (* (__type *) 0) >= __record_type_class \ (__builtin_classify_type (* (__type *) 0) >= __record_type_class \
? (__AP.__gp_regs += __va_reg_size) - __va_reg_size \ ? (__AP.__gp_regs += __va_reg_size) - __va_reg_size \
: ((__AP.__gp_regs += __va_rounded_size (__type)) \ : ((__AP.__gp_regs += __va_rounded_size (__type)) \
- __va_rounded_size (__type))))) - __va_rounded_size (__type)))))
#endif #endif
#else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */ #else /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
#ifdef __mips64 #ifdef __mips64
#define __va_next_addr(__AP, __type) \ #define __va_next_addr(__AP, __type) \
((__AP += __va_reg_size) - __va_reg_size) ((__AP += __va_reg_size) - __va_reg_size)
#else #else
#define __va_next_addr(__AP, __type) \ #define __va_next_addr(__AP, __type) \
(((__builtin_classify_type (* (__type *) 0) < __record_type_class \ (((__builtin_classify_type (* (__type *) 0) < __record_type_class \
&& __alignof__ (__type) > 4) \ && __alignof__ (__type) > 4) \
? __AP = (char *) (((int) __AP + 8 - 1) & -8) \ ? __AP = (char *) (((int) __AP + 8 - 1) & -8) \
: (char *) 0), \ : (char *) 0), \
(__builtin_classify_type (* (__type *) 0) >= __record_type_class \ (__builtin_classify_type (* (__type *) 0) >= __record_type_class \
? (__AP += __va_reg_size) - __va_reg_size \ ? (__AP += __va_reg_size) - __va_reg_size \
: ((__AP += __va_rounded_size (__type)) \ : ((__AP += __va_rounded_size (__type)) \
- __va_rounded_size (__type)))) - __va_rounded_size (__type))))
#endif #endif
#endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */ #endif /* ! (! defined (__mips_soft_float) && ! defined (__mips_single_float)) */
#ifdef __MIPSEB__ #ifdef __MIPSEB__
#define va_arg(__AP, __type) \ #define va_arg(__AP, __type) \
((__va_rounded_size (__type) <= __va_reg_size) \ ((__va_rounded_size (__type) <= __va_reg_size) \
? *(__type *) (void *) (__va_next_addr (__AP, __type) \ ? *(__type *) (void *) (__va_next_addr (__AP, __type) \
+ __va_reg_size \ + __va_reg_size \
- sizeof (__type)) \ - sizeof (__type)) \
: (__builtin_classify_type (*(__type *) 0) >= __record_type_class \ : (__builtin_classify_type (*(__type *) 0) >= __record_type_class \
? **(__type **) (void *) (__va_next_addr (__AP, __type) \ ? **(__type **) (void *) (__va_next_addr (__AP, __type) \
+ __va_reg_size \ + __va_reg_size \
- sizeof (char *)) \ - sizeof (char *)) \
: *(__type *) (void *) __va_next_addr (__AP, __type))) : *(__type *) (void *) __va_next_addr (__AP, __type)))
#else #else
#define va_arg(__AP, __type) \ #define va_arg(__AP, __type) \
((__va_rounded_size (__type) <= __va_reg_size) \ ((__va_rounded_size (__type) <= __va_reg_size) \
? *(__type *) (void *) __va_next_addr (__AP, __type) \ ? *(__type *) (void *) __va_next_addr (__AP, __type) \
: (__builtin_classify_type (* (__type *) 0) >= __record_type_class \ : (__builtin_classify_type (* (__type *) 0) >= __record_type_class \
? **(__type **) (void *) __va_next_addr (__AP, __type) \ ? **(__type **) (void *) __va_next_addr (__AP, __type) \
: *(__type *) (void *) __va_next_addr (__AP, __type))) : *(__type *) (void *) __va_next_addr (__AP, __type)))
#endif #endif
@ -241,11 +241,11 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#ifdef __MIPSEB__ #ifdef __MIPSEB__
#define va_arg(__AP, __type) \ #define va_arg(__AP, __type) \
((__type *) (void *) (__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ ((__type *) (void *) (__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \
+ __va_rounded_size (__type))))[-1] + __va_rounded_size (__type))))[-1]
#else #else
#define va_arg(__AP, __type) \ #define va_arg(__AP, __type) \
((__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \ ((__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \
+ __va_rounded_size (__type))), \ + __va_rounded_size (__type))), \
*(__type *) (void *) (__AP - __va_rounded_size (__type))) *(__type *) (void *) (__AP - __va_rounded_size (__type)))
#endif #endif
@ -253,19 +253,19 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#ifdef __MIPSEB__ #ifdef __MIPSEB__
/* For big-endian machines. */ /* For big-endian machines. */
#define va_arg(__AP, __type) \ #define va_arg(__AP, __type) \
((__AP = (char *) ((__alignof__ (__type) > 4 \ ((__AP = (char *) ((__alignof__ (__type) > 4 \
? ((int)__AP + 8 - 1) & -8 \ ? ((int)__AP + 8 - 1) & -8 \
: ((int)__AP + 4 - 1) & -4) \ : ((int)__AP + 4 - 1) & -4) \
+ __va_rounded_size (__type))), \ + __va_rounded_size (__type))), \
*(__type *) (void *) (__AP - __va_rounded_size (__type))) *(__type *) (void *) (__AP - __va_rounded_size (__type)))
#else #else
/* For little-endian machines. */ /* For little-endian machines. */
#define va_arg(__AP, __type) \ #define va_arg(__AP, __type) \
((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \ ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \
? ((int)__AP + 8 - 1) & -8 \ ? ((int)__AP + 8 - 1) & -8 \
: ((int)__AP + 4 - 1) & -4) \ : ((int)__AP + 4 - 1) & -4) \
+ __va_rounded_size(__type))))[-1] + __va_rounded_size(__type))))[-1]
#endif #endif
#endif #endif
#endif /* ! defined (__mips_eabi) */ #endif /* ! defined (__mips_eabi) */

View File

@ -65,7 +65,7 @@
#ifdef _ANSI_STDARG_H_ #ifdef _ANSI_STDARG_H_
#define _VA_LIST_ #define _VA_LIST_
#endif #endif
#define _ANSI_STDARG_H_ #define _ANSI_STDARG_H_
#undef va_alist #undef va_alist
#undef va_dcl #undef va_dcl
@ -97,15 +97,15 @@
#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
#define va_start(AP) AP=(char *) &__builtin_va_alist #define va_start(AP) AP=(char *) &__builtin_va_alist
#define va_end(AP) ((void)0) #define va_end(AP) ((void)0)
#if defined(sysV68) #if defined(sysV68)
#define __va_rounded_size(TYPE) \ #define __va_rounded_size(TYPE) \
@ -117,16 +117,16 @@ typedef void *__gnuc_va_list;
#if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__) #if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
/* This is for little-endian machines; small args are padded upward. */ /* This is for little-endian machines; small args are padded upward. */
#define va_arg(AP, TYPE) \ #define va_arg(AP, TYPE) \
(AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
*((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
#else /* big-endian */ #else /* big-endian */
/* This is for big-endian machines; small args are padded downward. */ /* This is for big-endian machines; small args are padded downward. */
#define va_arg(AP, TYPE) \ #define va_arg(AP, TYPE) \
(AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
*((TYPE *) (void *) ((char *) (AP) \ *((TYPE *) (void *) ((char *) (AP) \
- ((sizeof (TYPE) < __va_rounded_size (char) \ - ((sizeof (TYPE) < __va_rounded_size (char) \
? sizeof (TYPE) : __va_rounded_size (TYPE)))))) ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
#endif /* big-endian */ #endif /* big-endian */
/* Copy __gnuc_va_list into another variable of this type. */ /* Copy __gnuc_va_list into another variable of this type. */

View File

@ -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);

View File

@ -200,12 +200,12 @@ extern s32 D_802E9E80;
#ifdef NON_MATCHING #ifdef NON_MATCHING
s32 func_802E3BA4(Entity* entity) { s32 func_802E3BA4(Entity* entity) {
u8 bVar1; u8 bVar1;
s32 bVar2; s32 bVar2;
s32 iVar3; s32 iVar3;
s32 uVar4; s32 uVar4;
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
if ((entity->alpha == 0) && ((entity->unk_06 & 1) != 0)) { if ((entity->alpha == 0) && ((entity->unk_06 & 1) != 0)) {
return 0; return 0;
} }
@ -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;
} }
} }
@ -232,8 +232,8 @@ s32 func_802E3BA4(Entity* entity) {
return 1; return 1;
} }
if ((bVar1 & 0x80) != 0) { if ((bVar1 & 0x80) != 0) {
func_8010FD68(entity); func_8010FD68(entity);
return 1; return 1;
} }
bVar2 = FALSE; bVar2 = FALSE;
@ -256,9 +256,9 @@ 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:
case 0x18: case 0x18:
if (bVar2) { if (bVar2) {
@ -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,28 +288,28 @@ 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:
case 0x1d: case 0x1d:
case 0x1e: case 0x1e:
case 0x1f: case 0x1f:
func_80110678(entity); func_80110678(entity);
func_8010FD68(entity); func_8010FD68(entity);
return 1; return 1;
case 0xb: case 0xb:
func_80110678(entity); func_80110678(entity);
break; break;
} }
return 1; return 1;
} }

View File

@ -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;
} }

View File

@ -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);
@ -166,7 +166,7 @@ extern TlbMappablePage D_80197000;
extern EffectTableEntry D_8007F210[135]; extern EffectTableEntry D_8007F210[135];
s32 play_effect(s32 effectIndex) { s32 play_effect(s32 effectIndex) {
EffectTableEntry* effectTable = &D_8007F210[0]; EffectTableEntry* effectTable = &D_8007F210[0];
EffectTableEntry* effectEntry; EffectTableEntry* effectEntry;
Effect* curEffect; Effect* curEffect;
@ -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;
} }

View File

@ -111,7 +111,7 @@ ApiStatus si_handle_sleep_seconds(ScriptInstance* script) {
if (script->functionTemp[0].s == 0) { if (script->functionTemp[0].s == 0) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
script->functionTemp[0].s -= 1; script->functionTemp[0].s -= 1;
return !script->functionTemp[0].s; return !script->functionTemp[0].s;
} }