Misc Cleanup 3 (#1268)

* begin more cleanup

* more enums

* typo

* ==

* fix go.h

* fix RaceDogInfo struct

* PR Review

* PR Suggestions

* missed one

* missed even more

* fix params

* fix number
This commit is contained in:
engineer124
2023-06-06 08:57:45 +10:00
committed by GitHub
parent 8cabbb1a2b
commit f92a61db27
254 changed files with 765 additions and 767 deletions
+2 -2
View File
@@ -122,8 +122,8 @@ OPTFLAGS := -O2 -g3
ASFLAGS := -march=vr4300 -32 -Iinclude
MIPS_VERSION := -mips2
# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff.
CFLAGS += -G 0 -non_shared -fullwarn -verbose -Xcpluscomm $(IINC) -nostdinc -Wab,-r4300_mul -woff 624,649,838,712,516
# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Suppress the warnings with -woff.
CFLAGS += -G 0 -non_shared -fullwarn -verbose -Xcpluscomm $(IINC) -nostdinc -Wab,-r4300_mul -woff 649,838,712,516
# Use relocations and abi fpr names in the dump
OBJDUMP_FLAGS := --disassemble --reloc --disassemble-zeroes -Mreg-names=32
+9 -9
View File
@@ -657,7 +657,7 @@ typedef struct {
#define FLASHROM_REQUEST_WRITE 1
#define FLASHROM_REQUEST_READ 2
enum fram_command {
typedef enum framCommand {
/* Does nothing for FRAM_COMMAND_SET_MODE_READ_AND_STATUS, FRAM_MODE_NOP, FRAM_COMMAND_SET_MODE_STATUS_AND_STATUS
Initializes fram to 0xFF in FRAM_MODE_ERASE
Writes Contents in FLASHRAM_MODE_WRITE
@@ -681,15 +681,15 @@ enum fram_command {
FRAM_COMMAND_SET_MODE_READ_AND_STATUS = 0xF0000000,
/* unk */
FRAM_COMMAND_UNK_ERASE_OPERATION = 0x3C000000
};
} framCommand;
enum fram_mode {
FRAM_MODE_NOP = 0,
FRAM_MODE_ERASE,
FRAM_MODE_WRITE,
FRAM_MODE_READ,
FRAM_MODE_STATUS
};
typedef enum framMode {
/* 0 */ FRAM_MODE_NOP,
/* 1 */ FRAM_MODE_ERASE,
/* 2 */ FRAM_MODE_WRITE,
/* 3 */ FRAM_MODE_READ,
/* 4 */ FRAM_MODE_STATUS
} framMode;
typedef enum {
/* 0 */ VI_MODE_EDIT_STATE_INACTIVE,
+1 -1
View File
@@ -317,7 +317,7 @@ typedef struct EnAObj {
typedef enum {
/* 0 */ AOBJ_SIGNPOST_OBLONG,
/* 1 */ AOBJ_SIGNPOST_ARROW,
/* 1 */ AOBJ_SIGNPOST_ARROW
} AObjType;
#define AOBJ_GET_TEXTID(thisx) ((((thisx)->params >> 8) & 0xFF) | 0x300)
+1 -1
View File
@@ -105,7 +105,7 @@ typedef enum {
/* 1 */ SOUNDMODE_HEADSET,
/* 2 */ SOUNDMODE_SURROUND_EXTERNAL,
/* 3 */ SOUNDMODE_MONO,
/* 4 */ SOUNDMODE_SURROUND,
/* 4 */ SOUNDMODE_SURROUND
} SoundMode;
typedef enum {
+1 -1
View File
@@ -361,7 +361,7 @@ typedef enum {
/* 0x12 */ CAM_DATA_18,
/* 0x13 */ CAM_DATA_19,
/* 0x14 */ CAM_DATA_20,
/* 0x15 */ CAM_DATA_21,
/* 0x15 */ CAM_DATA_21
} CameraDataType;
/*================================
+1 -1
View File
@@ -19,7 +19,7 @@ typedef enum {
/* 2 */ EQUIP_VALUE_SWORD_RAZOR,
/* 3 */ EQUIP_VALUE_SWORD_GILDED,
/* 4 */ EQUIP_VALUE_SWORD_DIETY,
/* 5 */ EQUIP_VALUE_SWORD_MAX,
/* 5 */ EQUIP_VALUE_SWORD_MAX
} EquipValueSword;
typedef enum {
+2 -2
View File
@@ -105,13 +105,13 @@ typedef VecSphGeo VecGeo;
typedef enum {
/* 0 */ OLIB_ADD_COPY, // Copy `b` to dest
/* 1 */ OLIB_ADD_OFFSET, // Add `a` and `b` to dest, and also add the yaw of `a` to the dest
/* 2 */ OLIB_ADD, // Add `a` and `b` to dest
/* 2 */ OLIB_ADD // Add `a` and `b` to dest
} OlibVec3fAdd;
typedef enum {
/* 0 */ OLIB_DIFF_COPY, // Copy `b` to dest
/* 1 */ OLIB_DIFF_OFFSET, // Sub `a` and `b` to dest, and also subs the yaw of `a` to the dest
/* 2 */ OLIB_DIFF, // Sub `a` and `b` to dest
/* 2 */ OLIB_DIFF // Sub `a` and `b` to dest
} OlibVec3fDiff;
#define LERPIMP(v0, v1, t) ((v0) + (((v1) - (v0)) * (t)))
+1 -1
View File
@@ -962,7 +962,7 @@ typedef enum PlayerUnkAA5 {
/* 2 */ PLAYER_UNKAA5_2,
/* 3 */ PLAYER_UNKAA5_3,
/* 4 */ PLAYER_UNKAA5_4,
/* 5 */ PLAYER_UNKAA5_5,
/* 5 */ PLAYER_UNKAA5_5
} PlayerUnkAA5;
typedef void (*PlayerActionFunc)(struct Player* this, struct PlayState* play);
+2 -2
View File
@@ -87,7 +87,7 @@ typedef enum {
/* 5 */ TIMER_ID_ENV_HAZARD, // environmental hazard timer (underwater or hot room)
/* 6 */ TIMER_ID_GORON_RACE_UNUSED,
/* 7 */ TIMER_ID_MAX,
/* 99 */ TIMER_ID_NONE = 99,
/* 99 */ TIMER_ID_NONE = 99
} TimerId;
typedef enum {
@@ -1569,7 +1569,7 @@ typedef enum {
/* 0 */ DUNGEON_INDEX_WOODFALL_TEMPLE,
/* 1 */ DUNGEON_INDEX_SNOWHEAD_TEMPLE,
/* 2 */ DUNGEON_INDEX_GREAT_BAY_TEMPLE,
/* 3 */ DUNGEON_INDEX_STONE_TOWER_TEMPLE, // Also applies to Inverted Stone Tower Temple
/* 3 */ DUNGEON_INDEX_STONE_TOWER_TEMPLE // Also applies to Inverted Stone Tower Temple
} DungeonIndex;
void Sram_ActivateOwl(u8 owlId);
+2 -2
View File
@@ -50,13 +50,13 @@ typedef enum {
/* 0x0F */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_S, // Branches if the current time is less than the command time, short range branch
/* 0x10 */ SCHEDULE_CMD_ID_CHECK_BEFORE_TIME_L, // Branches if the current time is less than the command time, long range branch
/* 0x11 */ SCHEDULE_CMD_ID_BRANCH_S, // Always branch, short range branch
/* 0x12 */ SCHEDULE_CMD_ID_BRANCH_L, // Always branch, long range branch
/* 0x12 */ SCHEDULE_CMD_ID_BRANCH_L // Always branch, long range branch
} ScheduleCommandId;
typedef enum {
/* 0 */ SCHEDULE_CHECK_MISC_ROOM_KEY,
/* 1 */ SCHEDULE_CHECK_MISC_LETTER_TO_KAFEI,
/* 2 */ SCHEDULE_CHECK_MISC_MASK_ROMANI,
/* 2 */ SCHEDULE_CHECK_MISC_MASK_ROMANI
} ScheduleCheckMisc;
typedef struct {
+1 -1
View File
@@ -68,7 +68,7 @@ typedef struct {
typedef enum {
/* 1 */ TRANS_INSTANCE_TYPE_FILL_OUT = 1,
/* 2 */ TRANS_INSTANCE_TYPE_FILL_IN,
/* 2 */ TRANS_INSTANCE_TYPE_FILL_IN
} TransitionInstanceType;
#define TRANS_INSTANCE_TYPE_FADE_FLASH 3
+1 -1
View File
@@ -61,7 +61,7 @@ typedef enum FireState {
/* 0 */ FIRE_STATE_GROWING,
/* 1 */ FIRE_STATE_SHRINKING,
/* 2 */ FIRE_STATE_FULLY_LIT,
/* 3 */ FIRE_STATE_NOT_LIT,
/* 3 */ FIRE_STATE_NOT_LIT
} FireState;
#define FIRE_FLAG_WATER_EXTINGUISHABLE (1 << 0)
+3 -3
View File
@@ -9,7 +9,7 @@ typedef struct {
/* 0x0 */ Vec3f* pos;
/* 0x4 */ f32 freqScale;
/* 0x8 */ s8 reverbAdd;
} SfxSettings; // size = 0x9
} SfxSettings; // size = 0xC
typedef struct {
/* 0x0 */ f32 volume;
@@ -20,7 +20,7 @@ typedef struct {
/* 0xB */ u8 filter;
/* 0xC */ u8 combFilterGain;
/* 0xD */ u8 zVolume;
} SfxChannelState; // size = 0xE
} SfxChannelState; // size = 0x10
typedef enum {
/* 0x0 */ SFX_CHANNEL_PLAYER0, // SfxPlayerBank
@@ -50,7 +50,7 @@ typedef enum {
/* 0x4 */ SEQ_PLAYER_IO_PORT_4,
/* 0x5 */ SEQ_PLAYER_IO_PORT_5,
/* 0x6 */ SEQ_PLAYER_IO_PORT_6,
/* 0x7 */ SEQ_PLAYER_IO_PORT_7,
/* 0x7 */ SEQ_PLAYER_IO_PORT_7
} SeqPlayerIOPort;
typedef struct {
+5 -5
View File
@@ -1386,11 +1386,11 @@ void AudioHeap_DiscardSampleCaches(void) {
}
typedef struct {
uintptr_t oldAddr;
uintptr_t newAddr;
size_t size;
u8 newMedium;
} StorageChange;
/* 0x0 */ uintptr_t oldAddr;
/* 0x4 */ uintptr_t newAddr;
/* 0x8 */ size_t size;
/* 0xC */ u8 newMedium;
} StorageChange; // size = 0x10
void AudioHeap_ChangeStorage(StorageChange* change, Sample* sample) {
if ((sample != NULL) && ((sample->medium == change->newMedium) || (D_801FD120 != 1)) &&
+4 -4
View File
@@ -80,10 +80,10 @@ typedef enum {
#define OS_MESG_PRI_HIGH 1
typedef struct {
u16 numInstruments;
u16 numDrums;
u16 numSfx;
} UnloadedFonts;
/* 0x0 */ u16 numInstruments;
/* 0x2 */ u16 numDrums;
/* 0x4 */ u16 numSfx;
} UnloadedFonts; // size = 0x6
OSMesgQueue sScriptLoadQueue;
OSMesg sScriptLoadMesgBuf[0x10];
+5 -5
View File
@@ -58,11 +58,11 @@ void* Yaz0_NextDMA(void* curSrcPos) {
}
typedef struct {
/* 0x00 */ u32 magic; // Yaz0
/* 0x04 */ u32 decSize;
/* 0x08 */ u32 compInfoOffset; // only used in mio0
/* 0x0C */ u32 uncompDataOffset; // only used in mio0
} Yaz0Header; // size = 0x10
/* 0x0 */ u32 magic; // Yaz0
/* 0x4 */ u32 decSize;
/* 0x8 */ u32 compInfoOffset; // only used in mio0
/* 0xC */ u32 uncompDataOffset; // only used in mio0
} Yaz0Header; // size = 0x10
#define YAZ0_MAGIC 0x59617A30 // "Yaz0"
+2 -2
View File
@@ -2,7 +2,7 @@
#include "system_malloc.h"
typedef struct {
union {
/* 0x0 */ union {
u32 dmaWord[2];
u32 dataStart;
u32 dataSize;
@@ -11,7 +11,7 @@ typedef struct {
u32 end;
} offset;
};
} CmpDmaBuffer;
} CmpDmaBuffer; // size = 0x8
CmpDmaBuffer sDmaBuffer;
+3 -3
View File
@@ -115,9 +115,9 @@ void GetItem_DrawWallet(PlayState* play, s16 drawId);
void GetItem_DrawRemains(PlayState* play, s16 drawId);
typedef struct {
/* 0x00 */ void (*drawFunc)(PlayState*, s16);
/* 0x04 */ void* drawResources[8]; // Either display lists (Gfx*) or matrices (Mtx*)
} DrawItemTableEntry; // size = 0x24
/* 0x0 */ void (*drawFunc)(PlayState*, s16);
/* 0x4 */ void* drawResources[8]; // Either display lists (Gfx*) or matrices (Mtx*)
} DrawItemTableEntry; // size = 0x24
static DrawItemTableEntry sDrawItemTable[] = {
// GID_BOTTLE, OBJECT_GI_BOTTLE
+1 -1
View File
@@ -36,7 +36,7 @@ ActorCutscene sGlobalCutsceneList[] = {
typedef enum {
/* 0 */ CS_START_0,
/* 1 */ CS_START_1,
/* 2 */ CS_START_2,
/* 2 */ CS_START_2
} ActorCutsceneStartMethod;
typedef struct {
+1 -1
View File
@@ -2,7 +2,7 @@
typedef enum {
/* 0 */ TRANS_CIRCLE_DIR_IN,
/* 1 */ TRANS_CIRCLE_DIR_OUT,
/* 1 */ TRANS_CIRCLE_DIR_OUT
} TransitionCircleDirection;
Gfx sTransCircleSetupDL[] = {

Some files were not shown because too many files have changed in this diff Show More