diff --git a/Makefile b/Makefile index 9775e9bef5..1370db57bb 100644 --- a/Makefile +++ b/Makefile @@ -129,8 +129,15 @@ O_FILES := $(foreach f,$(S_FILES:.s=.o),build/$f) \ # create build directories $(shell mkdir -p build/baserom $(foreach dir,$(SRC_DIRS) $(ASM_DIRS) $(TEXTURE_DIRS) $(TEXTURE_BIN_DIRS) $(SCENE_DIRS),build/$(dir))) + build/src/libultra_boot_O1/%.o: OPTFLAGS := -O1 build/src/libultra_boot_O2/%.o: OPTFLAGS := -O2 +build/src/libultra_code_O1/%.o: OPTFLAGS := -O1 +build/src/libultra_code_O2/%.o: OPTFLAGS := -O2 +build/src/libultra_code_O2_g3/%.o: OPTFLAGS := -O2 -g3 + +build/src/libultra_code_O1/llcvt.o: MIPS_VERSION := -mips3 -32 + build/src/code/fault.o: CFLAGS += -trapuv build/src/code/fault.o: OPTFLAGS := -O2 -g3 build/src/code/fault_drawer.o: CFLAGS += -trapuv @@ -140,18 +147,12 @@ build/src/code/code_801068B0.o: OPTFLAGS := -g build/src/code/code_80106860.o: OPTFLAGS := -g build/src/code/code_801067F0.o: OPTFLAGS := -g -# Todo: split libultra_code into libultra_code_O1, etc.. -build/src/libultra_code/sqrt.o: OPTFLAGS := -O2 -g3 -build/src/libultra_code/absf.o: OPTFLAGS := -O2 -g3 -build/src/libultra_code/osSetTimer.o: OPTFLAGS := -O1 -build/src/libultra_code/osStopTimer.o: OPTFLAGS := -O1 -build/src/libultra_code/llcvt.o: OPTFLAGS := -O1 -build/src/libultra_code/llcvt.o: MIPS_VERSION := -mips3 -32 - build/src/libultra_boot_O1/%.o: CC := $(CC_OLD) build/src/libultra_boot_O2/%.o: CC := $(CC_OLD) +build/src/libultra_code_O1/%.o: CC := python3 tools/asm_processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) -- +build/src/libultra_code_O2/%.o: CC := python3 tools/asm_processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) -- +build/src/libultra_code_O2_g3/%.o: CC := python3 tools/asm_processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) -- -build/src/libultra_code/%.o: CC := python3 tools/asm_processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) -- build/src/code/jpegutils.o: CC := python3 tools/asm_processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) -- build/src/code/jpegdecoder.o: CC := python3 tools/asm_processor/build.py $(CC_OLD) -- $(AS) $(ASFLAGS) -- @@ -229,7 +230,7 @@ build/src/%.o: src/%.c $(CC_CHECK) $^ @$(OBJDUMP) -d $@ > $(@:.o=.s) -build/src/libultra_code/llcvt.o: src/libultra_code/llcvt.c +build/src/libultra_code_O1/llcvt.o: src/libultra_code_O1/llcvt.c $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $^ $(CC_CHECK) $^ python3 tools/set_o32abi_bit.py $@ diff --git a/include/PR/abi.h b/include/PR/abi.h deleted file mode 100644 index 8545be3bb3..0000000000 --- a/include/PR/abi.h +++ /dev/null @@ -1,622 +0,0 @@ -#ifndef _ABI_H_ -#define _ABI_H_ - -/************************************************************************** - * * - * Copyright (C) 1994, Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs contain * - * unpublished proprietary information of Silicon Graphics, Inc., and * - * are protected by Federal copyright law. They may not be disclosed * - * to third parties or copied or duplicated in any form, in whole or * - * in part, without the prior written consent of Silicon Graphics, Inc. * - * * - **************************************************************************/ - -/************************************************************************** - * - * $Revision: 1.32 $ - * $Date: 1997/02/11 08:16:37 $ - * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/abi.h,v $ - * - **************************************************************************/ - -/* - * Header file for the Audio Binary Interface. - * This is included in the Media Binary Interface file - * mbi.h. - * - * This file follows the framework used for graphics. - * - */ - -/* Audio commands: */ -#define A_SPNOOP 0 -#define A_ADPCM 1 -#define A_CLEARBUFF 2 -#define A_ENVMIXER 3 -#define A_LOADBUFF 4 -#define A_RESAMPLE 5 -#define A_SAVEBUFF 6 -#define A_SEGMENT 7 -#define A_SETBUFF 8 -#define A_SETVOL 9 -#define A_DMEMMOVE 10 -#define A_LOADADPCM 11 -#define A_MIXER 12 -#define A_INTERLEAVE 13 -#define A_POLEF 14 -#define A_SETLOOP 15 - -#define ACMD_SIZE 32 -/* - * Audio flags - */ - -#define A_INIT 0x01 -#define A_CONTINUE 0x00 -#define A_LOOP 0x02 -#define A_OUT 0x02 -#define A_LEFT 0x02 -#define A_RIGHT 0x00 -#define A_VOL 0x04 -#define A_RATE 0x00 -#define A_AUX 0x08 -#define A_NOAUX 0x00 -#define A_MAIN 0x00 -#define A_MIX 0x10 - -/* - * BEGIN C-specific section: (typedef's) - */ -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/* - * Data Structures. - */ - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int gain:16; - unsigned int addr; -} Aadpcm; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int gain:16; - unsigned int addr; -} Apolef; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int pad1:16; - unsigned int addr; -} Aenvelope; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:8; - unsigned int dmem:16; - unsigned int pad2:16; - unsigned int count:16; -} Aclearbuff; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:8; - unsigned int pad2:16; - unsigned int inL:16; - unsigned int inR:16; -} Ainterleave; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:24; - unsigned int addr; -} Aloadbuff; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int pad1:16; - unsigned int addr; -} Aenvmixer; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int gain:16; - unsigned int dmemi:16; - unsigned int dmemo:16; -} Amixer; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int dmem2:16; - unsigned int addr; -} Apan; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int pitch:16; - unsigned int addr; -} Aresample; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int pad1:16; - unsigned int addr; -} Areverb; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:24; - unsigned int addr; -} Asavebuff; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:24; - unsigned int pad2:2; - unsigned int number:4; - unsigned int base:24; -} Asegment; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int dmemin:16; - unsigned int dmemout:16; - unsigned int count:16; -} Asetbuff; - -typedef struct { - unsigned int cmd:8; - unsigned int flags:8; - unsigned int vol:16; - unsigned int voltgt:16; - unsigned int volrate:16; -} Asetvol; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:8; - unsigned int dmemin:16; - unsigned int dmemout:16; - unsigned int count:16; -} Admemmove; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:8; - unsigned int count:16; - unsigned int addr; -} Aloadadpcm; - -typedef struct { - unsigned int cmd:8; - unsigned int pad1:8; - unsigned int pad2:16; - unsigned int addr; -} Asetloop; - -/* - * Generic Acmd Packet - */ - -typedef struct { - uintptr_t w0; - uintptr_t w1; -} Awords; - -typedef union { - Awords words; -#if IS_BIG_ENDIAN && !IS_64_BIT - Aadpcm adpcm; - Apolef polef; - Aclearbuff clearbuff; - Aenvelope envelope; - Ainterleave interleave; - Aloadbuff loadbuff; - Aenvmixer envmixer; - Aresample resample; - Areverb reverb; - Asavebuff savebuff; - Asegment segment; - Asetbuff setbuff; - Asetvol setvol; - Admemmove dmemmove; - Aloadadpcm loadadpcm; - Amixer mixer; - Asetloop setloop; -#endif - long long int force_union_align; /* dummy, force alignment */ -} Acmd; - -/* - * ADPCM State - */ -typedef short ADPCM_STATE[16]; - -/* - * Pole filter state - */ -typedef short POLEF_STATE[4]; - -/* - * Resampler state - */ -typedef short RESAMPLE_STATE[16]; - -/* - * Resampler constants - */ -#define UNITY_PITCH 0x8000 -#define MAX_RATIO 1.99996 /* within .03 cents of +1 octave */ - -/* - * Enveloper/Mixer state - */ -typedef short ENVMIX_STATE[40]; - -/* - * Macros to assemble the audio command list - */ - -/* - * Info about parameters: - * - * A "count" in the following macros is always measured in bytes. - * - * All volumes/gains are in Q1.15 signed fixed point numbers: - * 0x8000 is the minimum volume (-100%), negating the audio curve. - * 0x0000 is silent. - * 0x7fff is maximum volume (99.997%). - * - * All DRAM addresses refer to segmented addresses. A segment table shall - * first be set up by calling aSegment for each segment. When a DRAM - * address is later used as parameter, the 8 high bits will be an index - * to the segment table and the lower 24 bits are added to the base address - * stored in the segment table for this entry. The result is the physical address. - * - * Transfers to/from DRAM are executed using DMA and hence follow these restrictions: - * All DRAM addresses should be aligned by 8 bytes, or they will be - * rounded down to the nearest multiple of 8 bytes. - * All DRAM lengths should be aligned by 8 bytes, or they will be - * rounded up to the nearest multiple of 8 bytes. - */ - -/* - * Decompresses ADPCM data. - * Possible flags: A_INIT and A_LOOP. - * - * First set up internal data in DMEM: - * aLoadADPCM(cmd++, nEntries * 16, physicalAddressOfBook) - * aSetLoop(cmd++, physicalAddressOfLoopState) (if A_LOOP is set) - * - * Then before this command, call: - * aSetBuffer(cmd++, 0, in, out, count) - * - * Note: count will be rounded up to the nearest multiple of 32 bytes. - * - * ADPCM decompression works on a block of 16 (uncompressed) samples. - * The previous 2 samples and 9 bytes of input are decompressed to - * 16 new samples using the code book previously loaded. - * - * Before the algorithm starts, the previous 16 samples are loaded according to flag: - * A_INIT: all zeros - * A_LOOP: the address set by aSetLoop - * no flags: the DRAM address in the s parameter - * These 16 samples are immediately copied to the destination address. - * - * The result of "count" bytes will be written after these 16 initial samples. - * The last 16 samples written to the destination will also be written to - * the state address in DRAM. - */ -#define aADPCMdec(pkt, f, s) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(f, 16, 8); \ - _a->words.w1 = (uintptr_t)(s); \ -} - -/* - * Not used in SM64. - */ -#define aPoleFilter(pkt, f, g, s) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \ - _SHIFTL(g, 0, 16)); \ - _a->words.w1 = (uintptr_t)(s); \ -} - -/* - * Clears DMEM data, where d is address and c is count, by writing zeros. - * - * Note: c is rounded up to the nearest multiple of 16 bytes. - */ -#define aClearBuffer(pkt, d, c) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \ - _a->words.w1 = (uintptr_t)(c); \ -} - -/* - * Mixes an envelope with mono sound into 2 or 4 channels. - * Possible flags: A_INIT, A_AUX (indicates that 4 channels should be used). - * - * Before this command, call: - * aSetBuffer(cmd++, 0, inBuf, dryLeft, count) - * aSetBuffer(cmd++, A_AUX, dryRight, wetLeft, wetRight) - * - * The first time (A_INIT is set), volume also needs to be set: - * aSetVolume(cmd++, A_VOL | A_LEFT, initialVolumeLeft, 0, 0) - * aSetVolume(cmd++, A_VOL | A_RIGHT, initialVolumeRight, 0, 0) - * aSetVolume32(cmd++, A_RATE | A_LEFT, targetVolumeLeft, rampLeft) - * aSetVolume32(cmd++, A_RATE | A_RIGHT, targetVolumeRight, rampRight) - * aSetVolume(cmd++, A_AUX, dryVolume, 0, wetVolume) - * - * This command will now mix samples in inBuf into the destination buffers (dry and wet), - * but with the volume increased (or decreased) from initial volumes to target volumes, - * with the specified ramp rate. Once the target volume is reached, the volume stays - * at that level. Before the samples are finally mixed (added) into the destination - * buffers (dry and wet), the volume is changed according to dryVolume and wetVolume. - * - * Note: count will be rounded up to the nearest multiple of 16 bytes. - * Note: the wet channels are used for reverb. - * - */ -#define aEnvMixer(pkt, f, s) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \ - _a->words.w1 = (uintptr_t)(s); \ -} - -/* - * Interleaves two mono channels into stereo. - * - * First call: - * aSetBuffer(cmd++, 0, 0, output, count) - * - * The count refers to the size of the output. - * A left sample will be placed before the right sample. - * - * Note: count will be rounded up to the nearest multiple of 16 bytes. - */ -#define aInterleave(pkt, l, r) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \ - _a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \ -} - -/* - * Loads a buffer from DRAM to DMEM. - * - * First call: - * aSetBuffer(cmd++, 0, in, 0, count) - * - * The in parameter to aSetBuffer is the destination in DMEM and the - * s parameter to this command is the source in DRAM. - */ -#define aLoadBuffer(pkt, s) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \ - _a->words.w1 = (uintptr_t)(s); \ -} - -/* - * Mixes audio. - * Possible flags: no flags used, although parameter present. - * - * First call: - * aSetBuffer(cmd++, 0, 0, 0, count) - * - * Input and output addresses are taken from the i and o parameters. - * The volume with which the input is changed is taken from the g parameter. - * After the volume of the input samples have been changed, the result - * is added to the output. - * - * Note: count will be rounded up to the nearest multiple of 32 bytes. - */ -#define aMix(pkt, f, g, i, o) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = (_SHIFTL(A_MIXER, 24, 8) | _SHIFTL(f, 16, 8) | \ - _SHIFTL(g, 0, 16)); \ - _a->words.w1 = _SHIFTL(i,16, 16) | _SHIFTL(o, 0, 16); \ -} - -// Not present in the audio microcode. -#define aPan(pkt, f, d, s) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = (_SHIFTL(A_PAN, 24, 8) | _SHIFTL(f, 16, 8) | \ - _SHIFTL(d, 0, 16)); \ - _a->words.w1 = (uintptr_t)(s); \ -} - -/* - * Resamples audio. - * Possible flags: A_INIT, A_OUT? (not used in SM64). - * - * First call: - * aSetBuffer(cmd++, 0, in, out, count) - * - * This command resamples the audio using the given frequency ratio (pitch) - * using a filter that uses a window of 4 source samples. This can be used - * either for just resampling audio to be able to be played back at a different - * sample rate, or to change the pitch if the result is played back at - * the same sample rate as the input. - * - * The frequency ratio is given in UQ1.15 fixed point format. - * For no change in frequency, use pitch 0x8000. - * For 1 octave up or downsampling to (roughly) half number of samples, use pitch 0xffff. - * For 1 octave down or upsampling to double as many samples, use pitch 0x4000. - * - * Note: count represents the number of output samples and is rounded up to - * the nearest multiple of 16 bytes. - * - * The state consists of the four following source samples when the algorithm stopped as - * well as a fractional position, and is initialized to all zeros if A_INIT is given. - * Otherwise it is loaded from DRAM at address s. - * - * The algorithm starts by writing the four source samples from the state (or zero) - * to just before the input address given. It then creates one output sample by examining - * the four next source samples and then moving the source position zero or more - * samples forward. The first output sample (when A_INIT is given) is always 0. - * - * When "count" samples have been written, the following four source samples - * are written to the state in DRAM as well as a fractional position. - */ -#define aResample(pkt, f, p, s) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(f, 16, 8) |\ - _SHIFTL(p, 0, 16)); \ - _a->words.w1 = (uintptr_t)(s); \ -} - -/* - * Stores a buffer in DMEM to DRAM. - * - * First call: - * aSetBuffer(cmd++, 0, 0, out, count) - * - * The out parameter to aSetBuffer is the source in DMEM and the - * s parameter to this command is the destination in DRAM. - */ -#define aSaveBuffer(pkt, s) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \ - _a->words.w1 = (uintptr_t)(s); \ -} - -/* - * Sets up an entry in the segment table. - * - * The s parameter is a segment index, 0 to 15. - * The b parameter is the base offset. - */ -#define aSegment(pkt, s, b) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_SEGMENT, 24, 8); \ - _a->words.w1 = _SHIFTL(s, 24, 8) | _SHIFTL(b, 0, 24); \ -} - -/* - * Sets internal DMEM buffer addresses used for later commands. - * See each command for how to use aSetBuffer. - */ -#define aSetBuffer(pkt, f, i, o, c) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = (_SHIFTL(A_SETBUFF, 24, 8) | _SHIFTL(f, 16, 8) | \ - _SHIFTL(i, 0, 16)); \ - _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \ -} - -/* - * Sets internal volume parameters. - * See aEnvMixer for more info. - */ -#define aSetVolume(pkt, f, v, t, r) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \ - _SHIFTL(v, 0, 16)); \ - _a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \ -} - -/* - * Sets the address to ADPCM loop state. - * - * The a parameter is a DRAM address. - * See aADPCMdec for more info. - */ -#define aSetLoop(pkt, a) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - _a->words.w0 = _SHIFTL(A_SETLOOP, 24, 8); \ - _a->words.w1 = (uintptr_t)(a); \ -} - -/* - * Copies memory in DMEM. - * - * Copies c bytes from address i to address o. - * - * Note: count is rounded up to the nearest multiple of 16 bytes. - * - * Note: This acts as memcpy where 16 bytes are moved at a time, therefore - * if input and output overlap, output address should be less than input address. - */ -#define aDMEMMove(pkt, i, o, c) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_DMEMMOVE, 24, 8) | _SHIFTL(i, 0, 24); \ - _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \ -} - -/* - * Loads ADPCM book from DRAM into DMEM. - * - * This command loads ADPCM table entries from DRAM to DMEM. - * - * The count parameter c should be a multiple of 16 bytes. - * The d parameter is a DRAM address. - */ -#define aLoadADPCM(pkt, c, d) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \ - _a->words.w1 = (uintptr_t) d; \ -} - -// This is a version of aSetVolume which takes a single 32-bit parameter -// instead of two 16-bit ones. According to AziAudio, it is used to set -// ramping values when neither bit 4 nor bit 8 is set in the flags parameter. -// It does not appear in the official abi.h header. -/* - * Sets internal volume parameters. - * See aEnvMixer for more info. - */ -#define aSetVolume32(pkt, f, v, tr) \ -{ \ - Acmd *_a = (Acmd *)pkt; \ - \ - _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \ - _SHIFTL(v, 0, 16)); \ - _a->words.w1 = (uintptr_t)(tr); \ -} - -#endif /* _LANGUAGE_C */ - -#endif /* !_ABI_H_ */ diff --git a/include/PR/gs2dex.h b/include/PR/gs2dex.h deleted file mode 100644 index ced468555a..0000000000 --- a/include/PR/gs2dex.h +++ /dev/null @@ -1,392 +0,0 @@ -/*--------------------------------------------------------------------- - Copyright (C) 1997, Nintendo. - - File gs2dex.h - Coded by Yoshitaka Yasumoto. Jul 31, 1997. - Modified by - Comments Header file for S2DEX ucode. - - $Id: gs2dex.h,v 1.21 1998/05/28 00:14:49 has Exp $ - ---------------------------------------------------------------------*/ - -#ifndef _GS2DEX_H_ -#define _GS2DEX_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -/*===========================================================================* - * Macro - *===========================================================================*/ -#define GS_CALC_DXT(line) (((1<< G_TX_DXT_FRAC)-1)/(line)+1) -#define GS_PIX2TMEM(pix, siz) ((pix)>>(4-(siz))) -#define GS_PIX2DXT(pix, siz) GS_CALC_DXT(GS_PIX2TMEM((pix), (siz))) - -/*===========================================================================* - * Data structures for S2DEX microcode - *===========================================================================*/ - -/*---------------------------------------------------------------------------* - * Background - *---------------------------------------------------------------------------*/ -#define G_BGLT_LOADBLOCK 0x0033 -#define G_BGLT_LOADTILE 0xfff4 - -#define G_BG_FLAG_FLIPS 0x01 -#define G_BG_FLAG_FLIPT 0x10 - -/* Non scalable background plane */ -typedef struct { - u16 imageX; /* x-coordinate of upper-left position of texture (u10.5) */ - u16 imageW; /* width of the texture (u10.2) */ - s16 frameX; /* upper-left position of transferred frame (s10.2) */ - u16 frameW; /* width of transferred frame (u10.2) */ - - u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */ - u16 imageH; /* height of the texture (u10.2) */ - s16 frameY; /* upper-left position of transferred frame (s10.2) */ - u16 frameH; /* height of transferred frame (u10.2) */ - - u64 *imagePtr; /* texture source address on DRAM */ - u16 imageLoad; /* which to use, LoadBlock or LoadTile */ - u8 imageFmt; /* format of texel - G_IM_FMT_* */ - u8 imageSiz; /* size of texel - G_IM_SIZ_* */ - u16 imagePal; /* pallet number */ - u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */ - - /* The following is set in the initialization routine guS2DInitBg(). There is no need for the user to set it. */ - u16 tmemW; /* TMEM width and Word size of frame 1 line. - At LoadBlock, GS_PIX2TMEM(imageW/4,imageSiz) - At LoadTile GS_PIX2TMEM(frameW/4,imageSiz)+1 */ - u16 tmemH; /* height of TMEM loadable at a time (s13.2) 4 times value - When the normal texture, 512/tmemW*4 - When the CI texture, 256/tmemW*4 */ - u16 tmemLoadSH; /* SH value - At LoadBlock, tmemSize/2-1 - At LoadTile, tmemW*16-1 */ - u16 tmemLoadTH; /* TH value or Stride value - At LoadBlock, GS_CALC_DXT(tmemW) - At LoadTile, tmemH-1 */ - u16 tmemSizeW; /* skip value of imagePtr for image 1-line - At LoadBlock, tmemW*2 - At LoadTile, GS_PIX2TMEM(imageW/4,imageSiz)*2 */ - u16 tmemSize; /* skip value of imagePtr for 1-loading - = tmemSizeW*tmemH */ -} uObjBg_t; /* 40 bytes */ - -/* Scalable background plane */ -typedef struct { - u16 imageX; /* x-coordinate of upper-left position of texture (u10.5) */ - u16 imageW; /* width of texture (u10.2) */ - s16 frameX; /* upper-left position of transferred frame (s10.2) */ - u16 frameW; /* width of transferred frame (u10.2) */ - - u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */ - u16 imageH; /* height of texture (u10.2) */ - s16 frameY; /* upper-left position of transferred frame (s10.2) */ - u16 frameH; /* height of transferred frame (u10.2) */ - - u64 *imagePtr; /* texture source address on DRAM */ - u16 imageLoad; /* Which to use, LoadBlock or LoadTile? */ - u8 imageFmt; /* format of texel - G_IM_FMT_* */ - u8 imageSiz; /* size of texel - G_IM_SIZ_* */ - u16 imagePal; /* pallet number */ - u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */ - - u16 scaleW; /* scale value of X-direction (u5.10) */ - u16 scaleH; /* scale value of Y-direction (u5.10) */ - s32 imageYorig; /* start point of drawing on image (s20.5) */ - - u8 padding[4]; - -} uObjScaleBg_t; /* 40 bytes */ - -typedef union { - uObjBg_t b; - uObjScaleBg_t s; - long long int force_structure_alignment; -} uObjBg; - -/*---------------------------------------------------------------------------* - * 2D Objects - *---------------------------------------------------------------------------*/ -#define G_OBJ_FLAG_FLIPS 1<<0 /* inversion to S-direction */ -#define G_OBJ_FLAG_FLIPT 1<<4 /* nversion to T-direction */ - -typedef struct { - s16 objX; /* s10.2 OBJ x-coordinate of upper-left end */ - u16 scaleW; /* u5.10 Scaling of u5.10 width direction */ - u16 imageW; /* u10.5 width of u10.5 texture (length of S-direction) */ - u16 paddingX; /* Unused - Always 0 */ - s16 objY; /* s10.2 OBJ y-coordinate of s10.2 OBJ upper-left end */ - u16 scaleH; /* u5.10 Scaling of u5.10 height direction */ - u16 imageH; /* u10.5 height of u10.5 texture (length of T-direction) */ - u16 paddingY; /* Unused - Always 0 */ - u16 imageStride; /* folding width of texel (In units of 64bit word) */ - u16 imageAdrs; /* texture header position in TMEM (In units of 64bit word) */ - u8 imageFmt; /* format of texel - G_IM_FMT_* */ - u8 imageSiz; /* size of texel - G_IM_SIZ_* */ - u8 imagePal; /* pallet number (0-7) */ - u8 imageFlags; /* The display flag - G_OBJ_FLAG_FLIP* */ -} uObjSprite_t; /* 24 bytes */ - -typedef union { - uObjSprite_t s; - long long int force_structure_alignment; -} uObjSprite; - -/*---------------------------------------------------------------------------* - * 2D Matrix - *---------------------------------------------------------------------------*/ -typedef struct { - s32 A, B, C, D; /* s15.16 */ - s16 X, Y; /* s10.2 */ - u16 BaseScaleX; /* u5.10 */ - u16 BaseScaleY; /* u5.10 */ -} uObjMtx_t; /* 24 bytes */ - -typedef union { - uObjMtx_t m; - long long int force_structure_alignment; -} uObjMtx; - -typedef struct { - s16 X, Y; /* s10.2 */ - u16 BaseScaleX; /* u5.10 */ - u16 BaseScaleY; /* u5.10 */ -} uObjSubMtx_t; /* 8 bytes */ - -typedef union { - uObjSubMtx_t m; - long long int force_structure_alignment; -} uObjSubMtx; - -/*---------------------------------------------------------------------------* - * Loading into TMEM - *---------------------------------------------------------------------------*/ -#define G_OBJLT_TXTRBLOCK 0x00001033 -#define G_OBJLT_TXTRTILE 0x00fc1034 -#define G_OBJLT_TLUT 0x00000030 - -#define GS_TB_TSIZE(pix,siz) (GS_PIX2TMEM((pix),(siz))-1) -#define GS_TB_TLINE(pix,siz) (GS_CALC_DXT(GS_PIX2TMEM((pix),(siz)))) - -typedef struct { - u32 type; /* G_OBJLT_TXTRBLOCK divided into types */ - u64 *image; /* texture source address on DRAM */ - u16 tmem; /* loaded TMEM word address (8byteWORD) */ - u16 tsize; /* Texture size, Specified by macro GS_TB_TSIZE() */ - u16 tline; /* width of Texture 1-line, Specified by macro GS_TB_TLINE() */ - u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */ - u32 flag; /* STATE flag */ - u32 mask; /* STATE mask */ -} uObjTxtrBlock_t; /* 24 bytes */ - -#define GS_TT_TWIDTH(pix,siz) ((GS_PIX2TMEM((pix), (siz))<<2)-1) -#define GS_TT_THEIGHT(pix,siz) (((pix)<<2)-1) - -typedef struct { - u32 type; /* G_OBJLT_TXTRTILE divided into types */ - u64 *image; /* texture source address on DRAM */ - u16 tmem; /* loaded TMEM word address (8byteWORD)*/ - u16 twidth; /* width of Texture (Specified by macro GS_TT_TWIDTH()) */ - u16 theight; /* height of Texture (Specified by macro GS_TT_THEIGHT()) */ - u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */ - u32 flag; /* STATE flag */ - u32 mask; /* STATE mask */ -} uObjTxtrTile_t; /* 24 bytes */ - -#define GS_PAL_HEAD(head) ((head)+256) -#define GS_PAL_NUM(num) ((num)-1) - -typedef struct { - u32 type; /* G_OBJLT_TLUT divided into types */ - u64 *image; /* texture source address on DRAM */ - u16 phead; /* pallet number of load header (Between 256 and 511) */ - u16 pnum; /* loading pallet number -1 */ - u16 zero; /* Assign 0 all the time */ - u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12)*/ - u32 flag; /* STATE flag */ - u32 mask; /* STATE mask */ -} uObjTxtrTLUT_t; /* 24 bytes */ - -typedef union { - uObjTxtrBlock_t block; - uObjTxtrTile_t tile; - uObjTxtrTLUT_t tlut; - long long int force_structure_alignment; -} uObjTxtr; - -/*---------------------------------------------------------------------------* - * Loading into TMEM & 2D Objects - *---------------------------------------------------------------------------*/ -typedef struct { - uObjTxtr txtr; - uObjSprite sprite; -} uObjTxSprite; /* 48 bytes */ - -/*===========================================================================* - * GBI Commands for S2DEX microcode - *===========================================================================*/ -/* GBI Header */ -#ifdef F3DEX_GBI_2 -#define G_OBJ_RECTANGLE_R 0xda -#define G_OBJ_MOVEMEM 0xdc -#define G_RDPHALF_0 0xe4 -#define G_OBJ_RECTANGLE 0x01 -#define G_OBJ_SPRITE 0x02 -#define G_SELECT_DL 0x04 -#define G_OBJ_LOADTXTR 0x05 -#define G_OBJ_LDTX_SPRITE 0x06 -#define G_OBJ_LDTX_RECT 0x07 -#define G_OBJ_LDTX_RECT_R 0x08 -#define G_BG_1CYC 0x09 -#define G_BG_COPY 0x0a -#define G_OBJ_RENDERMODE 0x0b -#else -#define G_BG_1CYC 0x01 -#define G_BG_COPY 0x02 -#define G_OBJ_RECTANGLE 0x03 -#define G_OBJ_SPRITE 0x04 -#define G_OBJ_MOVEMEM 0x05 -#define G_SELECT_DL 0xb0 -#define G_OBJ_RENDERMODE 0xb1 -#define G_OBJ_RECTANGLE_R 0xb2 -#define G_OBJ_LOADTXTR 0xc1 -#define G_OBJ_LDTX_SPRITE 0xc2 -#define G_OBJ_LDTX_RECT 0xc3 -#define G_OBJ_LDTX_RECT_R 0xc4 -#define G_RDPHALF_0 0xe4 -#endif - -/*---------------------------------------------------------------------------* - * Background wrapped screen - *---------------------------------------------------------------------------*/ -#define gSPBgRectangle(pkt, m, mptr) gDma0p((pkt),(m),(mptr),0) -#define gsSPBgRectangle(m, mptr) gsDma0p( (m),(mptr),0) -#define gSPBgRectCopy(pkt, mptr) gSPBgRectangle((pkt), G_BG_COPY, (mptr)) -#define gsSPBgRectCopy(mptr) gsSPBgRectangle( G_BG_COPY, (mptr)) -#define gSPBgRect1Cyc(pkt, mptr) gSPBgRectangle((pkt), G_BG_1CYC, (mptr)) -#define gsSPBgRect1Cyc(mptr) gsSPBgRectangle( G_BG_1CYC, (mptr)) - -/*---------------------------------------------------------------------------* - * 2D Objects - *---------------------------------------------------------------------------*/ -#define gSPObjSprite(pkt, mptr) gDma0p((pkt),G_OBJ_SPRITE, (mptr),0) -#define gsSPObjSprite(mptr) gsDma0p( G_OBJ_SPRITE, (mptr),0) -#define gSPObjRectangle(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE, (mptr),0) -#define gsSPObjRectangle(mptr) gsDma0p( G_OBJ_RECTANGLE, (mptr),0) -#define gSPObjRectangleR(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE_R,(mptr),0) -#define gsSPObjRectangleR(mptr) gsDma0p( G_OBJ_RECTANGLE_R,(mptr),0) - -/*---------------------------------------------------------------------------* - * 2D Matrix - *---------------------------------------------------------------------------*/ -#define gSPObjMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),0,23) -#define gsSPObjMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),0,23) -#define gSPObjSubMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),2, 7) -#define gsSPObjSubMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),2, 7) - -/*---------------------------------------------------------------------------* - * Loading into TMEM - *---------------------------------------------------------------------------*/ -#define gSPObjLoadTxtr(pkt, tptr) gDma0p((pkt),G_OBJ_LOADTXTR, (tptr),23) -#define gsSPObjLoadTxtr(tptr) gsDma0p( G_OBJ_LOADTXTR, (tptr),23) -#define gSPObjLoadTxSprite(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_SPRITE,(tptr),47) -#define gsSPObjLoadTxSprite(tptr) gsDma0p( G_OBJ_LDTX_SPRITE,(tptr),47) -#define gSPObjLoadTxRect(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT, (tptr),47) -#define gsSPObjLoadTxRect(tptr) gsDma0p( G_OBJ_LDTX_RECT, (tptr),47) -#define gSPObjLoadTxRectR(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT_R,(tptr),47) -#define gsSPObjLoadTxRectR(tptr) gsDma0p( G_OBJ_LDTX_RECT_R,(tptr),47) - -/*---------------------------------------------------------------------------* - * Select Display List - *---------------------------------------------------------------------------*/ -#define gSPSelectDL(pkt, mptr, sid, flag, mask) \ -{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ - gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); } -#define gsSPSelectDL(mptr, sid, flag, mask) \ -{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ - gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); } -#define gSPSelectBranchDL(pkt, mptr, sid, flag, mask) \ -{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ - gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); } -#define gsSPSelectBranchDL(mptr, sid, flag, mask) \ -{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ - gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); } - -/*---------------------------------------------------------------------------* - * Set general status - *---------------------------------------------------------------------------*/ -#define G_MW_GENSTAT 0x08 /* Note that it is the same value of G_MW_FOG */ - -#define gSPSetStatus(pkt, sid, val) \ - gMoveWd((pkt), G_MW_GENSTAT, (sid), (val)) -#define gsSPSetStatus(sid, val) \ - gsMoveWd( G_MW_GENSTAT, (sid), (val)) - -/*---------------------------------------------------------------------------* - * Set Object Render Mode - *---------------------------------------------------------------------------*/ -#define G_OBJRM_NOTXCLAMP 0x01 -#define G_OBJRM_XLU 0x02 /* Ignored */ -#define G_OBJRM_ANTIALIAS 0x04 /* Ignored */ -#define G_OBJRM_BILERP 0x08 -#define G_OBJRM_SHRINKSIZE_1 0x10 -#define G_OBJRM_SHRINKSIZE_2 0x20 -#define G_OBJRM_WIDEN 0x40 - -#define gSPObjRenderMode(pkt, mode) gImmp1((pkt),G_OBJ_RENDERMODE,(mode)) -#define gsSPObjRenderMode(mode) gsImmp1( G_OBJ_RENDERMODE,(mode)) - -/*===========================================================================* - * Render Mode Macro - *===========================================================================*/ -#define RM_RA_SPRITE(clk) \ - AA_EN | CVG_DST_CLAMP | \ - CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ - GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) - -#define G_RM_SPRITE G_RM_OPA_SURF -#define G_RM_SPRITE2 G_RM_OPA_SURF2 -#define G_RM_RA_SPRITE RM_RA_SPRITE(1) -#define G_RM_RA_SPRITE2 RM_RA_SPRITE(2) -#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR -#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2 -#define G_RM_XLU_SPRITE G_RM_XLU_SURF -#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2 -#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF -#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2 - -/*===========================================================================* - * External functions - *===========================================================================*/ -extern u64 gspS2DEX_fifoTextStart[], gspS2DEX_fifoTextEnd[]; -extern u64 gspS2DEX_fifoDataStart[], gspS2DEX_fifoDataEnd[]; -extern u64 gspS2DEX_fifo_dTextStart[], gspS2DEX_fifo_dTextEnd[]; -extern u64 gspS2DEX_fifo_dDataStart[], gspS2DEX_fifo_dDataEnd[]; -extern u64 gspS2DEX2_fifoTextStart[], gspS2DEX2_fifoTextEnd[]; -extern u64 gspS2DEX2_fifoDataStart[], gspS2DEX2_fifoDataEnd[]; -extern u64 gspS2DEX2_xbusTextStart[], gspS2DEX2_xbusTextEnd[]; -extern u64 gspS2DEX2_xbusDataStart[], gspS2DEX2_xbusDataEnd[]; -extern void guS2DInitBg(uObjBg *); - -#ifdef F3DEX_GBI_2 -# define guS2DEmuBgRect1Cyc guS2D2EmuBgRect1Cyc /*Wrapper*/ -# define guS2DEmuSetScissor guS2D2EmuSetScissor /*Wrapper*/ - extern void guS2D2EmuSetScissor(u32, u32, u32, u32, u8); - extern void guS2D2EmuBgRect1Cyc(Gfx **, uObjBg *); -#else - extern void guS2DEmuSetScissor(u32, u32, u32, u32, u8); - extern void guS2DEmuBgRect1Cyc(Gfx **, uObjBg *); -#endif - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif -#endif /* _GS2DEX_H_ */ - -/*======== End of gs2dex.h ========*/ diff --git a/include/PR/gu.h b/include/PR/gu.h deleted file mode 100644 index 6527777d9c..0000000000 --- a/include/PR/gu.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef _ULTRA64_GU_H_ -#define _ULTRA64_GU_H_ - -#include -#include - -#define GU_PI 3.1415926 -/* Functions */ - -void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, - float near, float far, float scale); -void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, - float far, float scale); -void guOrtho(Mtx *m, float left, float right, float bottom, float top, - float near, float far, float scale); -void guTranslate(Mtx *m, float x, float y, float z); -void guRotate(Mtx *m, float a, float x, float y, float z); -void guScale(Mtx *m, float x, float y, float z); -void guMtxF2L(float mf[4][4], Mtx *m); -void guMtxIdent(Mtx *m); -void guMtxIdentF(float mf[4][4]); -void guMtxL2F(float mf[4][4], Mtx *m); -void guNormalize(float *, float *, float *); - -/* Used only in Fast3DEX2 */ -void guLookAtReflect (Mtx *m, LookAt *l, float xEye, float yEye, float zEye, - float xAt, float yAt, float zAt, - float xUp, float yUp, float zUp); -#endif diff --git a/include/PR/libaudio.h b/include/PR/libaudio.h deleted file mode 100644 index c374a9ff30..0000000000 --- a/include/PR/libaudio.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _ULTRA64_LIBAUDIO_H_ -#define _ULTRA64_LIBAUDIO_H_ - -#include "abi.h" - -typedef struct -{ - u8 *offset; - s32 len; -} ALSeqData; - -typedef struct -{ - s16 revision; - s16 seqCount; - ALSeqData seqArray[1]; -} ALSeqFile; - -void alSeqFileNew(ALSeqFile *f, u8 *base); - -#endif diff --git a/include/PR/libultra.h b/include/PR/libultra.h deleted file mode 100644 index f0dab415f5..0000000000 --- a/include/PR/libultra.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _LIBULTRA_H -#define _LIBULTRA_H - -#define TV_TYPE_NTSC 1 -#define TV_TYPE_PAL 0 -#define TV_TYPE_MPAL 2 - -#define RESET_TYPE_COLD_RESET 0 -#define RESET_TYPE_NMI 1 -#define RESET_TYPE_BOOT_DISK 2 - -extern u32 osTvType; -extern u32 osRomBase; -extern u32 osResetType; -extern u32 osMemSize; -extern u8 osAppNmiBuffer[64]; - -#endif /* _LIBULTRA_H */ diff --git a/include/PR/mbi.h b/include/PR/mbi.h deleted file mode 100644 index 6b3cebfe4b..0000000000 --- a/include/PR/mbi.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef _MBI_H_ -#define _MBI_H_ - -#include "platform_info.h" - -/************************************************************************** - * * - * Copyright (C) 1994, Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs contain * - * unpublished proprietary information of Silicon Graphics, Inc., and * - * are protected by Federal copyright law. They may not be disclosed * - * to third parties or copied or duplicated in any form, in whole or * - * in part, without the prior written consent of Silicon Graphics, Inc. * - * * - **************************************************************************/ - -/************************************************************************** - * - * $Revision: 1.136 $ - * $Date: 1999/01/05 13:04:00 $ - * $Source: /hosts/gate3/exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/mbi.h,v $ - * - **************************************************************************/ - -/* - * Header file for the Media Binary Interface - * - * NOTE: This file is included by the RSP microcode, so any C-specific - * constructs must be bracketed by #ifdef _LANGUAGE_C - * - */ - - -/* - * the SHIFT macros are used to build display list commands, inserting - * bit-fields into a 32-bit word. They take a value, a shift amount, - * and a width. - * - * For the left shift, the lower bits of the value are masked, - * then shifted left. - * - * For the right shift, the value is shifted right, then the lower bits - * are masked. - * - * (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment) - * - */ -#define _SHIFTL(v, s, w) \ - ((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s))) -#define _SHIFTR(v, s, w) \ - ((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1))) - -#define _SHIFT _SHIFTL /* old, for compatibility only */ - -#define G_ON (1) -#define G_OFF (0) - -/************************************************************************** - * - * Graphics Binary Interface - * - **************************************************************************/ - -#include - -/************************************************************************** - * - * Audio Binary Interface - * - **************************************************************************/ - -#include - -/************************************************************************** - * - * Task list - * - **************************************************************************/ - -#define M_GFXTASK 1 -#define M_AUDTASK 2 -#define M_VIDTASK 3 -#define M_HVQTASK 6 -#define M_HVQMTASK 7 - -/************************************************************************** - * - * Segment macros and definitions - * - **************************************************************************/ - -#define NUM_SEGMENTS (16) -#define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff) -#define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28) -#define SEGMENT_ADDR(num, off) (((num) << 24) + (off)) - -#ifndef NULL -#define NULL 0 -#endif - -#endif /* !_MBI_H_ */ diff --git a/include/PR/os_ai.h b/include/PR/os_ai.h deleted file mode 100644 index f89d87cfe5..0000000000 --- a/include/PR/os_ai.h +++ /dev/null @@ -1,92 +0,0 @@ - -/*==================================================================== - * os_ai.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -/*---------------------------------------------------------------------* - Copyright (C) 1998 Nintendo. (Originated by SGI) - - $RCSfile: os_ai.h,v $ - $Revision: 1.1 $ - $Date: 1998/10/09 08:01:04 $ - *---------------------------------------------------------------------*/ - -#ifndef _OS_AI_H_ -#define _OS_AI_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* Audio interface (Ai) */ -extern u32 osAiGetStatus(void); -extern u32 osAiGetLength(void); -extern s32 osAiSetFrequency(u32); -extern s32 osAiSetNextBuffer(void *, u32); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_AI_H_ */ diff --git a/include/PR/os_cache.h b/include/PR/os_cache.h deleted file mode 100644 index 93d53c5f18..0000000000 --- a/include/PR/os_cache.h +++ /dev/null @@ -1,96 +0,0 @@ - -/*==================================================================== - * os_cache.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -/*---------------------------------------------------------------------* - Copyright (C) 1998 Nintendo. (Originated by SGI) - - $RCSfile: os_cache.h,v $ - $Revision: 1.1 $ - $Date: 1998/10/09 08:01:04 $ - *---------------------------------------------------------------------*/ - -#ifndef _OS_CACHE_H_ -#define _OS_CACHE_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - -#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10)) -#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10)) - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* Cache operations and macros */ - -extern void osInvalDCache(void *, size_t); -extern void osInvalICache(void *, size_t); -extern void osWritebackDCache(void *, size_t); -extern void osWritebackDCacheAll(void); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_CACHE_H_ */ diff --git a/include/PR/os_eeprom.h b/include/PR/os_eeprom.h deleted file mode 100644 index b3bca81444..0000000000 --- a/include/PR/os_eeprom.h +++ /dev/null @@ -1,107 +0,0 @@ - -/*==================================================================== - * os_eeprom.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -/*---------------------------------------------------------------------* - Copyright (C) 1998 Nintendo. (Originated by SGI) - - $RCSfile: os_eeprom.h,v $ - $Revision: 1.1 $ - $Date: 1998/10/09 08:01:06 $ - *---------------------------------------------------------------------*/ - -#ifndef _OS_EEPROM_H_ -#define _OS_EEPROM_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include -#include "os_message.h" - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - -/* EEPROM TYPE */ - -#define EEPROM_TYPE_4K 0x01 -#define EEPROM_TYPE_16K 0x02 - -/* definition for EEPROM */ - -#define EEPROM_MAXBLOCKS 64 -#define EEP16K_MAXBLOCKS 256 -#define EEPROM_BLOCK_SIZE 8 - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* EEPROM interface */ - -extern s32 osEepromProbe(OSMesgQueue *); -extern s32 osEepromRead(OSMesgQueue *, u8, u8 *); -extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *); -extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int); -extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_EEPROM_H_ */ diff --git a/include/PR/os_exception.h b/include/PR/os_exception.h deleted file mode 100644 index 245e5e6971..0000000000 --- a/include/PR/os_exception.h +++ /dev/null @@ -1,119 +0,0 @@ - -/*==================================================================== - * os_exception.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -/*---------------------------------------------------------------------* - Copyright (C) 1998 Nintendo. (Originated by SGI) - - $RCSfile: os_exception.h,v $ - $Revision: 1.1 $ - $Date: 1998/10/09 08:01:07 $ - *---------------------------------------------------------------------*/ - -#ifndef _OS_EXCEPTION_H_ -#define _OS_EXCEPTION_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - -typedef u32 OSIntMask; -typedef u32 OSHWIntr; - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - -/* Flags for debugging purpose */ - -#define OS_FLAG_CPU_BREAK 1 /* Break exception has occurred */ -#define OS_FLAG_FAULT 2 /* CPU fault has occurred */ - -/* Interrupt masks */ - -#define OS_IM_NONE 0x00000001 -#define OS_IM_SW1 0x00000501 -#define OS_IM_SW2 0x00000601 -#define OS_IM_CART 0x00000c01 -#define OS_IM_PRENMI 0x00001401 -#define OS_IM_RDBWRITE 0x00002401 -#define OS_IM_RDBREAD 0x00004401 -#define OS_IM_COUNTER 0x00008401 -#define OS_IM_CPU 0x0000ff01 -#define OS_IM_SP 0x00010401 -#define OS_IM_SI 0x00020401 -#define OS_IM_AI 0x00040401 -#define OS_IM_VI 0x00080401 -#define OS_IM_PI 0x00100401 -#define OS_IM_DP 0x00200401 -#define OS_IM_ALL 0x003fff01 -#define RCP_IMASK 0x003f0000 -#define RCP_IMASKSHIFT 16 - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* Interrupt operations */ - -extern OSIntMask osGetIntMask(void); -extern OSIntMask osSetIntMask(OSIntMask); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_EXCEPTION_H_ */ diff --git a/include/PR/os_internal.h b/include/PR/os_internal.h deleted file mode 100644 index a18e03674f..0000000000 --- a/include/PR/os_internal.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _ULTRA64_OS_INTERNAL_H_ -#define _ULTRA64_OS_INTERNAL_H_ - -/* Internal functions used by the operating system */ -/* Do not include this header in application code */ - -/* Variables */ - -//extern u64 osClockRate; - -/* Functions */ - -/*u32 __osProbeTLB(void *); -u32 __osDisableInt(void); -void __osRestoreInt(u32);*/ -OSThread *__osGetCurrFaultedThread(void); - -#endif diff --git a/include/PR/os_libc.h b/include/PR/os_libc.h deleted file mode 100644 index 94111c0b6c..0000000000 --- a/include/PR/os_libc.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _OS_LIBC_H_ -#define _OS_LIBC_H_ - -#include "ultratypes.h" - -// Old deprecated functions from strings.h, replaced by memcpy/memset. -extern void bcopy(const void *, void *, size_t); -extern void bzero(void *, size_t); - -#endif /* !_OS_LIBC_H_ */ diff --git a/include/PR/os_message.h b/include/PR/os_message.h deleted file mode 100644 index cd3df6569f..0000000000 --- a/include/PR/os_message.h +++ /dev/null @@ -1,155 +0,0 @@ - -/*==================================================================== - * os_message.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -#ifndef _OS_MESSAGE_H_ -#define _OS_MESSAGE_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - -typedef u32 OSEvent; - -/* - * Structure for message - */ -typedef void * OSMesg; - -/* - * Structure for message queue - */ -typedef struct OSMesgQueue_s { - OSThread *mtqueue; /* Queue to store threads blocked - on empty mailboxes (receive) */ - OSThread *fullqueue; /* Queue to store threads blocked - on full mailboxes (send) */ - s32 validCount; /* Contains number of valid message */ - s32 first; /* Points to first valid message */ - s32 msgCount; /* Contains total # of messages */ - OSMesg *msg; /* Points to message buffer array */ -} OSMesgQueue; - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - -/* Events */ -#ifdef _FINALROM -#define OS_NUM_EVENTS 15 -#else -#define OS_NUM_EVENTS 23 -#endif - -#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */ -#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */ -#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */ -#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */ -#define OS_EVENT_SP 4 /* SP task done interrupt */ -#define OS_EVENT_SI 5 /* SI (controller) interrupt */ -#define OS_EVENT_AI 6 /* AI interrupt */ -#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */ -#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */ -#define OS_EVENT_DP 9 /* DP full sync interrupt */ -#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */ -#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */ -#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */ -#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */ -#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */ -#ifndef _FINALROM -#define OS_EVENT_RDB_READ_DONE 15 /* RDB read ok event: used by rmon */ -#define OS_EVENT_RDB_LOG_DONE 16 /* read of log data complete */ -#define OS_EVENT_RDB_DATA_DONE 17 /* read of hostio data complete */ -#define OS_EVENT_RDB_REQ_RAMROM 18 /* host needs ramrom access */ -#define OS_EVENT_RDB_FREE_RAMROM 19 /* host is done with ramrom access */ -#define OS_EVENT_RDB_DBG_DONE 20 -#define OS_EVENT_RDB_FLUSH_PROF 21 -#define OS_EVENT_RDB_ACK_PROF 22 -#endif - -/* Flags to turn blocking on/off when sending/receiving message */ - -#define OS_MESG_NOBLOCK 0 -#define OS_MESG_BLOCK 1 - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - -/* Get count of valid messages in queue */ -#define MQ_GET_COUNT(mq) ((mq)->validCount) - -/* Figure out if message queue is empty or full */ -#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0) -#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount) - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* Message operations */ - -extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32); -extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32); -extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32); -extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32); - -/* Event operations */ - -extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_MESSAGE_H_ */ diff --git a/include/PR/os_misc.h b/include/PR/os_misc.h deleted file mode 100644 index 6b7f6e6136..0000000000 --- a/include/PR/os_misc.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _ULTRA64_OS_MISC_H_ -#define _ULTRA64_OS_MISC_H_ - -/* Miscellaneous OS functions */ - -void osInitialize(void); -u32 osGetCount(void); - -uintptr_t osVirtualToPhysical(void *); - -#endif diff --git a/include/PR/os_pi.h b/include/PR/os_pi.h deleted file mode 100644 index 1d4176fabf..0000000000 --- a/include/PR/os_pi.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef _ULTRA64_PI_H_ -#define _ULTRA64_PI_H_ - -/* Ultra64 Parallel Interface */ - -/* Types */ - -typedef struct -{ - u32 errStatus; - void *dramAddr; - void *C2Addr; - u32 sectorSize; - u32 C1ErrNum; - u32 C1ErrSector[4]; -} __OSBlockInfo; - -typedef struct -{ - u32 cmdType; - u16 transferMode; - u16 blockNum; - s32 sectorNum; - uintptr_t devAddr; - u32 bmCtlShadow; - u32 seqCtlShadow; - __OSBlockInfo block[2]; -} __OSTranxInfo; - -typedef struct OSPiHandle_s -{ - struct OSPiHandle_s *next; - u8 type; - u8 latency; - u8 pageSize; - u8 relDuration; - u8 pulse; - u8 domain; - u32 baseAddress; - u32 speed; - __OSTranxInfo transferInfo; -} OSPiHandle; - -typedef struct -{ - u8 type; - uintptr_t address; -} OSPiInfo; - -typedef struct -{ - u16 type; - u8 pri; - u8 status; - OSMesgQueue *retQueue; -} OSIoMesgHdr; - -typedef struct -{ - /*0x00*/ OSIoMesgHdr hdr; - /*0x08*/ void *dramAddr; - /*0x0C*/ uintptr_t devAddr; - /*0x10*/ size_t size; - //OSPiHandle *piHandle; //from the official definition -} OSIoMesg; - -/* Definitions */ - -#define OS_READ 0 // device -> RDRAM -#define OS_WRITE 1 // device <- RDRAM - -#define OS_MESG_PRI_NORMAL 0 -#define OS_MESG_PRI_HIGH 1 - -/* Functions */ - -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, - uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq); -void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, - s32 cmdMsgCnt); -OSMesgQueue *osPiGetCmdQueue(void); -s32 osPiWriteIo(uintptr_t devAddr, u32 data); -s32 osPiReadIo(uintptr_t devAddr, u32 *data); - -#endif diff --git a/include/PR/os_rdp.h b/include/PR/os_rdp.h deleted file mode 100644 index 6b3d288cef..0000000000 --- a/include/PR/os_rdp.h +++ /dev/null @@ -1,92 +0,0 @@ - -/*==================================================================== - * os_rdp.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -/*---------------------------------------------------------------------* - Copyright (C) 1998 Nintendo. (Originated by SGI) - - $RCSfile: os_rdp.h,v $ - $Revision: 1.1 $ - $Date: 1998/10/09 08:01:16 $ - *---------------------------------------------------------------------*/ - -#ifndef _OS_RDP_H_ -#define _OS_RDP_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* Display processor interface (Dp) */ -extern u32 osDpGetStatus(void); -extern void osDpSetStatus(u32); -extern void osDpGetCounters(u32 *); -extern s32 osDpSetNextBuffer(void *, u64); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_RDP_H_ */ diff --git a/include/PR/os_thread.h b/include/PR/os_thread.h deleted file mode 100644 index 791701c249..0000000000 --- a/include/PR/os_thread.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _ULTRA64_THREAD_H_ -#define _ULTRA64_THREAD_H_ - -/* Recommended priorities for system threads */ -#define OS_PRIORITY_MAX 255 -#define OS_PRIORITY_VIMGR 254 -#define OS_PRIORITY_RMON 250 -#define OS_PRIORITY_RMONSPIN 200 -#define OS_PRIORITY_PIMGR 150 -#define OS_PRIORITY_SIMGR 140 -#define OS_PRIORITY_APPMAX 127 -#define OS_PRIORITY_IDLE 0 - -#define OS_STATE_STOPPED 1 -#define OS_STATE_RUNNABLE 2 -#define OS_STATE_RUNNING 4 -#define OS_STATE_WAITING 8 - -/* Types */ - -typedef s32 OSPri; -typedef s32 OSId; - -typedef union -{ - struct {f32 f_odd; f32 f_even;} f; -} __OSfp; - -typedef struct -{ - /* registers */ - /*0x20*/ u64 at, v0, v1, a0, a1, a2, a3; - /*0x58*/ u64 t0, t1, t2, t3, t4, t5, t6, t7; - /*0x98*/ u64 s0, s1, s2, s3, s4, s5, s6, s7; - /*0xD8*/ u64 t8, t9, gp, sp, s8, ra; - /*0x108*/ u64 lo, hi; - /*0x118*/ u32 sr, pc, cause, badvaddr, rcp; - /*0x12C*/ u32 fpcsr; - __OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14; - __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30; -} __OSThreadContext; - -typedef struct -{ - u32 flag; - u32 count; - u64 time; -} __OSThreadprofile_s; - -typedef struct OSThread_s -{ - /*0x00*/ struct OSThread_s *next; - /*0x04*/ OSPri priority; - /*0x08*/ struct OSThread_s **queue; - /*0x0C*/ struct OSThread_s *tlnext; - /*0x10*/ u16 state; - /*0x12*/ u16 flags; - /*0x14*/ OSId id; - /*0x18*/ int fp; - /*0x1C*/ __OSThreadprofile_s *thprof; - /*0x20*/ __OSThreadContext context; -} OSThread; - - -/* Functions */ - -void osCreateThread(OSThread *thread, OSId id, void (*entry)(void *), - void *arg, void *sp, OSPri pri); -OSId osGetThreadId(OSThread *thread); -OSPri osGetThreadPri(OSThread *thread); -void osSetThreadPri(OSThread *thread, OSPri pri); -void osStartThread(OSThread *thread); -void osStopThread(OSThread *thread); - -#endif diff --git a/include/PR/os_time.h b/include/PR/os_time.h deleted file mode 100644 index 328e601500..0000000000 --- a/include/PR/os_time.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _ULTRA64_TIME_H_ -#define _ULTRA64_TIME_H_ - -#include -#include - -/* Types */ - -typedef struct OSTimer_str -{ - struct OSTimer_str *next; - struct OSTimer_str *prev; - u64 interval; - u64 remaining; - OSMesgQueue *mq; - OSMesg *msg; -} OSTimer; - -typedef u64 OSTime; - -/* Functions */ - -OSTime osGetTime(void); -void osSetTime(OSTime time); -u32 osSetTimer(OSTimer *, OSTime, u64, OSMesgQueue *, OSMesg); - -#endif diff --git a/include/PR/os_tlb.h b/include/PR/os_tlb.h deleted file mode 100644 index 2cdd5c9c6c..0000000000 --- a/include/PR/os_tlb.h +++ /dev/null @@ -1,107 +0,0 @@ - -/*==================================================================== - * os_tlb.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -/*---------------------------------------------------------------------* - Copyright (C) 1998 Nintendo. (Originated by SGI) - - $RCSfile: os_tlb.h,v $ - $Revision: 1.1 $ - $Date: 1998/10/09 08:01:20 $ - *---------------------------------------------------------------------*/ - -#ifndef _OS_TLB_H_ -#define _OS_TLB_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - -typedef u32 OSPageMask; - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - -/* - * Page size argument for TLB routines - */ -#define OS_PM_4K 0x0000000 -#define OS_PM_16K 0x0006000 -#define OS_PM_64K 0x001e000 -#define OS_PM_256K 0x007e000 -#define OS_PM_1M 0x01fe000 -#define OS_PM_4M 0x07fe000 -#define OS_PM_16M 0x1ffe000 - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* TLB management routines */ - -extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32); -extern void osMapTLBRdb(void); -extern void osUnmapTLB(s32); -extern void osUnmapTLBAll(void); -extern void osSetTLBASID(s32); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_TLB_H_ */ diff --git a/include/PR/os_vi.h b/include/PR/os_vi.h deleted file mode 100644 index 3578c9a31f..0000000000 --- a/include/PR/os_vi.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef _ULTRA64_VI_H_ -#define _ULTRA64_VI_H_ - -#include -#include - -/* Ultra64 Video Interface */ - - -/* Special Features */ -#define OS_VI_GAMMA_ON 0x0001 -#define OS_VI_GAMMA_OFF 0x0002 -#define OS_VI_GAMMA_DITHER_ON 0x0004 -#define OS_VI_GAMMA_DITHER_OFF 0x0008 -#define OS_VI_DIVOT_ON 0x0010 -#define OS_VI_DIVOT_OFF 0x0020 -#define OS_VI_DITHER_FILTER_ON 0x0040 -#define OS_VI_DITHER_FILTER_OFF 0x0080 - -#define OS_VI_GAMMA 0x08 -#define OS_VI_GAMMA_DITHER 0x04 -#define OS_VI_DIVOT 0x10 -#define OS_VI_DITHER_FILTER 0x10000 -#define OS_VI_UNK200 0x200 -#define OS_VI_UNK100 0x100 - - -/* Types */ - -typedef struct -{ - u32 ctrl; - u32 width; - u32 burst; - u32 vSync; - u32 hSync; - u32 leap; - u32 hStart; - u32 xScale; - u32 vCurrent; -} OSViCommonRegs; - -typedef struct -{ - u32 origin; - u32 yScale; - u32 vStart; - u32 vBurst; - u32 vIntr; -} OSViFieldRegs; - -typedef struct -{ - u8 type; - OSViCommonRegs comRegs; - OSViFieldRegs fldRegs[2]; -} OSViMode; - -typedef struct -{ - /* 0x00 */ u16 unk00; //some kind of flags. swap buffer sets to 0x10 - /* 0x02 */ u16 retraceCount; - /* 0x04 */ void* buffer; - /* 0x08 */ OSViMode *unk08; - /* 0x0c */ u32 features; - /* 0x10 */ OSMesgQueue *mq; - /* 0x14 */ OSMesg *msg; - /* 0x18 */ u32 unk18; - /* 0x1c */ u32 unk1c; - /* 0x20 */ u32 unk20; - /* 0x24 */ f32 unk24; - /* 0x28 */ u16 unk28; - /* 0x2c */ u32 unk2c; -} OSViContext; - -void osCreateViManager(OSPri pri); -void osViSetMode(OSViMode *mode); -void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount); -void osViBlack(u8 active); -void osViSetSpecialFeatures(u32 func); -void osViSwapBuffer(void *vaddr); - - -#define OS_VI_NTSC_LPN1 0 /* NTSC */ -#define OS_VI_NTSC_LPF1 1 -#define OS_VI_NTSC_LAN1 2 -#define OS_VI_NTSC_LAF1 3 -#define OS_VI_NTSC_LPN2 4 -#define OS_VI_NTSC_LPF2 5 -#define OS_VI_NTSC_LAN2 6 -#define OS_VI_NTSC_LAF2 7 -#define OS_VI_NTSC_HPN1 8 -#define OS_VI_NTSC_HPF1 9 -#define OS_VI_NTSC_HAN1 10 -#define OS_VI_NTSC_HAF1 11 -#define OS_VI_NTSC_HPN2 12 -#define OS_VI_NTSC_HPF2 13 - -#define OS_VI_PAL_LPN1 14 /* PAL */ -#define OS_VI_PAL_LPF1 15 -#define OS_VI_PAL_LAN1 16 -#define OS_VI_PAL_LAF1 17 -#define OS_VI_PAL_LPN2 18 -#define OS_VI_PAL_LPF2 19 -#define OS_VI_PAL_LAN2 20 -#define OS_VI_PAL_LAF2 21 -#define OS_VI_PAL_HPN1 22 -#define OS_VI_PAL_HPF1 23 -#define OS_VI_PAL_HAN1 24 -#define OS_VI_PAL_HAF1 25 -#define OS_VI_PAL_HPN2 26 -#define OS_VI_PAL_HPF2 27 - -extern OSViMode osViModeTable[]; /* Global VI mode table */ - - -#endif diff --git a/include/PR/sptask.h b/include/PR/sptask.h deleted file mode 100644 index 8f23c1b2d8..0000000000 --- a/include/PR/sptask.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef _ULTRA64_SPTASK_H_ -#define _ULTRA64_SPTASK_H_ - -/* Task Types */ -#define M_GFXTASK 1 -#define M_AUDTASK 2 -#define M_VIDTASK 3 -#define M_HVQTASK 6 -#define M_HVQMTASK 7 - -#if (defined(F3DEX_GBI) || defined(F3DLP_GBI) || defined(F3DEX_GBI_2)) -#define OS_YIELD_DATA_SIZE 0xc00 -#else -#define OS_YIELD_DATA_SIZE 0x900 -#endif -#define OS_YIELD_AUDIO_SIZE 0x400 - -/* Flags */ -#define M_TASK_FLAG0 1 -#define M_TASK_FLAG1 2 - -/* SpStatus */ -#define SPSTATUS_CLEAR_HALT 0x00000001 -#define SPSTATUS_SET_HALT 0x00000002 -#define SPSTATUS_CLEAR_BROKE 0x00000004 -#define SPSTATUS_CLEAR_INTR 0x00000008 -#define SPSTATUS_SET_INTR 0x00000010 -#define SPSTATUS_CLEAR_SSTEP 0x00000020 -#define SPSTATUS_SET_SSTEP 0x00000040 -#define SPSTATUS_CLEAR_INTR_ON_BREAK 0x00000080 -#define SPSTATUS_SET_INTR_ON_BREAK 0x00000100 -#define SPSTATUS_CLEAR_SIGNAL0 0x00000200 -#define SPSTATUS_SET_SIGNAL0 0x00000400 -#define SPSTATUS_CLEAR_SIGNAL1 0x00000800 -#define SPSTATUS_SET_SIGNAL1 0x00001000 -#define SPSTATUS_CLEAR_SIGNAL2 0x00002000 -#define SPSTATUS_SET_SIGNAL2 0x00004000 -#define SPSTATUS_CLEAR_SIGNAL3 0x00008000 -#define SPSTATUS_SET_SIGNAL3 0x00010000 -#define SPSTATUS_CLEAR_SIGNAL4 0x00020000 -#define SPSTATUS_SET_SIGNAL4 0x00040000 -#define SPSTATUS_CLEAR_SIGNAL5 0x00080000 -#define SPSTATUS_SET_SIGNAL5 0x00100000 -#define SPSTATUS_CLEAR_SIGNAL6 0x00200000 -#define SPSTATUS_SET_SIGNAL6 0x00800000 -#define SPSTATUS_CLEAR_SIGNAL7 0x01000000 -#define SPSTATUS_SET_SIGNAL7 0x02000000 - -#define SPSTATUS_HALT 0x0001 -#define SPSTATUS_BROKE 0x0002 -#define SPSTATUS_DMA_BUSY 0x0004 -#define SPSTATUS_DMA_FULL 0x0008 -#define SPSTATUS_IO_FULL 0x0010 -#define SPSTATUS_SINGLE_STEP 0x0020 -#define SPSTATUS_INTERRUPT_ON_BREAK 0x0040 -#define SPSTATUS_SIGNAL0_SET 0x0080 -#define SPSTATUS_SIGNAL1_SET 0x0100 -#define SPSTATUS_SIGNAL2_SET 0x0200 -#define SPSTATUS_SIGNAL3_SET 0x0400 -#define SPSTATUS_SIGNAL4_SET 0x0800 -#define SPSTATUS_SIGNAL5_SET 0x1000 -#define SPSTATUS_SIGNAL6_SET 0x2000 -#define SPSTATUS_SIGNAL7_SET 0x4000 - -/* Types */ -/* Types */ - -typedef struct -{ - /*0x00*/ u32 type; - /*0x04*/ u32 flags; - - /*0x08*/ u64 *ucode_boot; - /*0x0C*/ u32 ucode_boot_size; - - /*0x10*/ u64 *ucode; - /*0x14*/ u32 ucode_size; - - /*0x18*/ u64 *ucode_data; - /*0x1C*/ u32 ucode_data_size; - - /*0x20*/ u64 *dram_stack; - /*0x24*/ u32 dram_stack_size; - - /*0x28*/ u64 *output_buff; - /*0x2C*/ u64 *output_buff_size; - - /*0x30*/ u64 *data_ptr; - /*0x34*/ u32 data_size; - - /*0x38*/ u64 *yield_data_ptr; - /*0x3C*/ u32 yield_data_size; -} OSTask_t; // size = 0x40 - -typedef union { - OSTask_t t; - long long int force_structure_alignment; -} OSTask; - -typedef u32 OSYieldResult; - -/* Functions */ - -#define osSpTaskStart(p) \ - osSpTaskLoad(p); \ - osSpTaskStartGo(p); - -void osSpTaskLoad(OSTask *task); -void osSpTaskStartGo(OSTask *task); -void osSpTaskYield(void); -OSYieldResult osSpTaskYielded(OSTask *task); - -#endif diff --git a/include/PR/ucode.h b/include/PR/ucode.h deleted file mode 100644 index 37fd197754..0000000000 --- a/include/PR/ucode.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _ULTRA64_UCODE_H_ -#define _ULTRA64_UCODE_H_ - -#define SP_DRAM_STACK_SIZE8 0x400 -#define SP_UCODE_SIZE 0x1000 -#define SP_UCODE_DATA_SIZE 0x800 - -// standard boot ucode -extern u64 rspF3DBootStart[], rspF3DBootEnd[]; - -// F3D ucode -extern u64 rspF3DStart[], rspF3DEnd[]; - -// F3D ucode data -extern u64 rspF3DDataStart[], rspF3DDataEnd[]; - -// aspMain (audio) ucode -extern u64 rspAspMainStart[], rspAspMainEnd[]; - -// aspMain ucode data -extern u64 rspAspMainDataStart[], rspAspMainDataEnd[]; - -#endif diff --git a/include/PR/ultratypes.h b/include/PR/ultratypes.h deleted file mode 100644 index 1f0d3e012a..0000000000 --- a/include/PR/ultratypes.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _ULTRA64_TYPES_H_ -#define _ULTRA64_TYPES_H_ - -#ifndef NULL -#define NULL (void *)0 -#endif - -#define TRUE 1 -#define FALSE 0 - -typedef signed char s8; -typedef unsigned char u8; -typedef signed short int s16; -typedef unsigned short int u16; -typedef signed int s32; -typedef unsigned int u32; -typedef signed long long int s64; -typedef unsigned long long int u64; - -typedef volatile u8 vu8; -typedef volatile u16 vu16; -typedef volatile u32 vu32; -typedef volatile u64 vu64; -typedef volatile s8 vs8; -typedef volatile s16 vs16; -typedef volatile s32 vs32; -typedef volatile s64 vs64; - -typedef float f32; -typedef double f64; - -#ifdef TARGET_N64 -typedef u32 size_t; -typedef s32 ssize_t; -typedef u32 uintptr_t; -typedef s32 intptr_t; -typedef s32 ptrdiff_t; -#else -#include -#endif - -#endif diff --git a/include/alloca.h b/include/alloca.h index bb44ef0d2b..d7f0f268aa 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -1,7 +1,7 @@ #ifndef _ALLOCA_H_ #define _ALLOCA_H_ -void* alloca(unsigned int); +void* alloca(u32); #define alloca __builtin_alloca #endif diff --git a/include/fp.h b/include/fp.h index 7346d5e082..7fac5bfc10 100644 --- a/include/fp.h +++ b/include/fp.h @@ -1,6 +1,6 @@ #ifndef _FP_H_ #define _FP_H_ -#include +#include "ultra64.h" extern f32 qNaN0x3FFFFF; extern f32 qNaN0x10000; diff --git a/include/functions.h b/include/functions.h index c809471da3..87344620e5 100644 --- a/include/functions.h +++ b/include/functions.h @@ -3,11 +3,11 @@ #include "z64.h" -float fabsf(float f); +f32 fabsf(f32 f); #pragma intrinsic(fabsf) -float sqrtf(float f); +f32 sqrtf(f32 f); #pragma intrinsic(sqrtf) -double sqrt(double d); +f64 sqrt(f64 d); #pragma intrinsic(sqrt) void cleararena(void); @@ -27,7 +27,7 @@ void DmaMgr_ProcessMsg(DmaRequest* req); void DmaMgr_ThreadEntry(void* arg0); s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk, OSMesgQueue* queue, OSMesg msg); s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size); -void DmaMgr_Start(); +void DmaMgr_Init(); s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg, const char* file, s32 line); s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 line); @@ -55,8 +55,8 @@ void StackCheck_Cleanup(StackEntry* entry); StackStatus StackCheck_GetState(StackEntry* entry); u32 StackCheck_CheckAll(); u32 StackCheck_Check(StackEntry* entry); -float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, - float var2, const char* var3Name, float var3); +f32 LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, f32 var1, const char* var2Name, + f32 var2, const char* var3Name, f32 var3); s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, const char* var3Name, s32 var3); void LogUtils_LogHexDump(void* ptr, s32 size0); @@ -98,7 +98,7 @@ void osWritebackDCache(void* vaddr, s32 nbytes); void* osViGetNextFramebuffer(); void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt); void __osDevMgrMain(void* arg); -s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void* dram_addr, size_t size); +s32 __osPiRawStartDma(s32 dir, u32 cartAddr, void* dramAddr, size_t size); u32 osVirtualToPhysical(void* vaddr); void osViBlack(u8 active); s32 __osSiRawReadIo(void* a0, u32* a1); @@ -118,6 +118,7 @@ void osInvalICache(void* vaddr, s32 nbytes); void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count); void osInvalDCache(void* vaddr, s32 nbytes); s32 __osSiDeviceBusy(); +s32 osJamMesg(OSMesgQueue* mq, OSMesg mesg, s32 flag); void osSetThreadPri(OSThread* thread, OSPri pri); OSPri osGetThreadPri(OSThread* thread); s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data); @@ -146,13 +147,19 @@ void __osSetFpcCsr(u32); u32 __osGetFpcCsr(); s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); void osMapTLBRdb(void); +void osYieldThread(); u32 __osGetCause(); s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); +void _Litob(_Pft* args, u8 type); +ldiv_t ldiv(s32 num, s32 denom); +lldiv_t lldiv(s64 num, s64 denom); +void _Ldtob(_Pft* args, u8 type); +s32 __osSiRawWriteIo(void* a0, u32 a1); void osCreateViManager(OSPri pri); void viMgrMain(void* vargs); OSViContext* __osViGetCurrentContext(); void osStartThread(OSThread* thread); -void osViSetYScale(float scale); +void osViSetYScale(f32 scale); void osViSetXScale(f32 value); void __osSetHWIntrRoutine(s32 idx, OSMesgQueue* queue, OSMesg msg); void __osGetHWIntrRoutine(s32 idx, OSMesgQueue** outQueue, OSMesg* outMsg); @@ -1651,7 +1658,7 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr); void AudioMgr_HandlePRENMI(AudioMgr* audioMgr); void AudioMgr_ThreadEntry(void* arg0); void AudioMgr_Unlock(AudioMgr* audioMgr); -void AudioMgr_Start(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr); +void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr); void TitleSetup_InitImpl(GameState* gameState); void TitleSetup_Destroy(GameState* gameState); void TitleSetup_Init(GameState* gameState); @@ -1707,7 +1714,7 @@ void PadMgr_UnlockPadData(PadMgr* padmgr); void PadMgr_RumbleControl(PadMgr* padmgr); void PadMgr_RumbleStop(PadMgr* padmgr); void PadMgr_RumbleReset(PadMgr* padmgr); -void PadMgr_RumbleSet(PadMgr* padmgr, u8* ctrlr_rumbles); +void PadMgr_RumbleSet(PadMgr* padmgr, u8* ctrlrRumbles); void PadMgr_ProcessInputs(PadMgr* padmgr); void PadMgr_HandleRetraceMsg(PadMgr* padmgr); void PadMgr_HandlePreNMI(PadMgr* padmgr); @@ -1864,7 +1871,7 @@ void IrqMgr_HandlePRENMI480(IrqMgr* this); void IrqMgr_HandlePRENMI500(IrqMgr* this); void IrqMgr_HandleRetrace(IrqMgr* this); void IrqMgr_ThreadEntry(void* arg0); -void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount); +void IrqMgr_Init(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount); void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action); void* DebugArena_Malloc(u32 size); void* DebugArena_MallocDebug(u32 size, const char* file, s32 line); @@ -1919,7 +1926,7 @@ void Fault_ProcessClients(); void Fault_UpdatePad(); void Fault_ThreadEntry(void*); void Fault_SetFB(void*, u16, u16); -void Fault_Start(void); +void Fault_Init(void); void Fault_HangupFaultClient(const char*, const char*); void Fault_AddHungupAndCrashImpl(const char*, const char*); void Fault_AddHungupAndCrash(const char*, u32); @@ -2468,8 +2475,8 @@ void guScale(Mtx* m, f32 x, f32 y, f32 z); f32 sinf(f32); s16 sins(u16); // ? func_801004C0(?); -// ? osSpTaskLoad(?); -// ? osSpTaskStartGo(?); +void osSpTaskLoad(OSTask* task); +void osSpTaskStartGo(OSTask* task); s32 osSetRumble(OSPfs* pfs, u32 vibrate); void osSetUpMempakWrite(s32 channel, OSPifRam* buf); s32 osProbeRumblePak(OSMesgQueue* ctrlrqueue, OSPfs* pfs, u32 channel); @@ -2482,24 +2489,22 @@ void __osPackRequestData(u8 poll); s32 osContStartReadData(OSMesgQueue* mq); void osContGetReadData(OSContPad* pad); void __osPackReadData(); -// ? guPerspectiveF(?); -// ? guPerspective(?); -// ? __osSpRawStartDma(?); +void guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale); +void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale); +s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, u32 size); s32 __osSiRawStartDma(s32 dir, void* addr); -// ? osSpTaskYield(?); +void osSpTaskYield(void); s32 __osPfsGetNextPage(OSPfs* pfs, u8* bank, __OSInode* inode, __OSInodeUnit* page); s32 osPfsReadWriteFile(OSPfs* pfs, s32 fileNo, u8 flag, s32 offset, s32 size, u8* data); s32 __osPfsGetStatus(OSMesgQueue* queue, s32 channel); void __osPfsRequestOneChannel(s32 channel, u8 poll); void __osPfsGetOneChannelData(s32 channel, OSContStatus* contData); // ? guMtxIdentF(?); -void guLookAtF(float mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); +void guLookAtF(f32 mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); void guLookAt(Mtx*, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp); -s32 osPfsAllocateFile(OSPfs* pfs, u16 company_code, u32 game_code, u8* game_name, u8* ext_name, s32 length, - s32* file_no); -s32 __osPfsDeclearPage(OSPfs* pfs, __OSInode* inode, s32 fileSizeInPages, s32* startPage, u8 bank, s32* decleared, - s32* finalPage); -// ? osStopTimer(?); +s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 length, s32* fileNo); +s32 __osPfsDeclearPage(OSPfs* pfs, __OSInode* inode, s32 fileSizeInPages, s32* startPage, u8 bank, s32* decleared, s32* finalPage); +s32 osStopTimer(OSTimer* timer); u16 __osSumcalc(u8* ptr, s32 length); s32 __osIdCheckSum(u16* ptr, u16* csum, u16* icsum); s32 __osRepairPackId(OSPfs* pfs, __OSPackId* badid, __OSPackId* newid); @@ -2509,26 +2514,26 @@ s32 __osCheckId(OSPfs* pfs); s32 __osPfsRWInode(OSPfs* pfs, __OSInode* inode, u8 flag, u8 bank); // ? func_80102FA0(?); s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo); -// ? osAfterPreNMI(?); -// ? osContStartQuery(?); +s32 osAfterPreNMI(void); +s32 osContStartQuery(OSMesgQueue* mq); void osContGetQuery(OSContStatus* data); // ? guLookAtHiliteF(?); void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 hiliteWidth, s32 hiliteHeight); -// ? __osSpDeviceBusy(?); +u32 __osSpDeviceBusy(); // ? guMtxIdent(?); -// ? guPositionF(?); +void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z); void guPosition(Mtx*, f32, f32, f32, f32, f32, f32, f32); -// ? osSpTaskYielded(?); +OSYieldResult osSpTaskYielded(OSTask* task); // ? guRotateF(?); void guRotate(Mtx*, f32 angle, f32 x, f32 y, f32 z); s32 osAiSetFrequency(u32 frequency); -// ? __osGetActiveQueue(?); +OSThread* __osGetActiveQueue(); // ? guNormalize(?); u32 osDpGetStatus(void); void osDpSetStatus(u32 status); -s32 osPfsDeleteFile(OSPfs* pfs, u16 company_code, u32 game_code, u8* game_name, u8* ext_name); +s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName); s32 __osPfsReleasePages(OSPfs* pfs, __OSInode* inode, u8 initialPage, u8 bank, __OSInodeUnit* finalPage); void guOrthoF(f32[4][4], f32, f32, f32, f32, f32, f32, f32); void guOrtho(Mtx*, f32, f32, f32, f32, f32, f32, f32); @@ -2541,18 +2546,19 @@ void __osPfsGetInitData(u8* pattern, OSContStatus* contData); void guS2DInitBg(uObjBg* bg); s32 __osPfsSelectBank(OSPfs* pfs, u8 bank); s32 osContSetCh(u8 ch); -s32 osPfsFileState(OSPfs* pfs, s32 file_no, OSPfsState* state); +s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state); s32 osPfsInitPak(OSMesgQueue* mq, OSPfs* pfs, s32 channel); s32 __osPfsCheckRamArea(OSPfs* pfs); s32 osPfsChecker(OSPfs* pfs); s32 func_80105788(OSPfs* pfs, __OSInodeCache* cache); s32 func_80105A60(OSPfs* pfs, __OSInodeUnit fpage, __OSInodeCache* cache); -// ? osAiGetLength(?); +u32 osAiGetLength(void); void guTranslate(Mtx* m, f32 x, f32 y, f32 z); s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force); s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data); u8 __osContAddressCrc(u16 addr); u8 __osContDataCrc(u8* data); +s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg); u32 __osSpGetStatus(); void __osSpSetStatus(u32 status); void osWritebackDCacheAll(void); @@ -2567,7 +2573,7 @@ OSThread* __osGetCurrFaultedThread(); // ? __ull_to_d(?); // ? __ull_to_f(?); u32* osViGetCurrentFramebuffer(void); -// ? __osSpSetPc(?); +s32 __osSpSetPc(void* pc); f32 absf(f32); void* func_80106860(void* ptr, s32 val, size_t size); void* func_801068B0(void* dst, void* src, size_t size); diff --git a/include/macros.h b/include/macros.h index 7d370507c0..8ebfb26fbc 100644 --- a/include/macros.h +++ b/include/macros.h @@ -12,7 +12,6 @@ #define SQ(x) ((x)*(x)) #define ABS(x) ((x) >= 0 ? (x) : -(x)) -#define ULTRA_ABS(x) ((x) > 0) ? (x) : -(x) #define DECR(x) ((x) == 0 ? 0 : ((x) -= 1)) #define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) @@ -55,7 +54,9 @@ ? gSaveContext.equips.buttonItems[button + 1] \ : ITEM_NONE) -#define CHECK_PAD(state, combo) (~(state.in.button | ~(combo)) == 0) +#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) +#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0) + #define LOG(exp, value, format, file, line) \ do { \ diff --git a/include/math.h b/include/math.h index 4524283aa1..b0df65e56d 100644 --- a/include/math.h +++ b/include/math.h @@ -1,6 +1,8 @@ #ifndef _MATH_H_ #define _MATH_H_ +#include "ultra64/types.h" + #define M_PI 3.14159265358979323846f #define M_SQRT2 1.41421356237309504880f #define FLT_MAX 340282346638528859811704183484516925440.0f @@ -8,26 +10,20 @@ #define SHT_MINV (1.0f / SHT_MAX) #define DEGTORAD(x) (x * M_PI / 180.0f) -float sinf(float); -double sin(double); -float cosf(float); -double cos(double); -float sqrtf(float f); - typedef union { struct { - unsigned int hi; - unsigned int lo; + u32 hi; + u32 lo; } word; - double d; + f64 d; } du; typedef union { - unsigned int i; - float f; + u32 i; + f32 f; } fu; -extern float __libm_qnan_f; +extern f32 __libm_qnan_f; #endif diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 82aec4a79a..96089eed7a 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -1,7 +1,7 @@ #ifndef _SEGMENT_SYMBOLS_H_ #define _SEGMENT_SYMBOLS_H_ -#include +#include "z64.h" #define DECLARE_SEGMENT(name) \ extern u8 _##name##SegmentStart[]; \ diff --git a/include/stdarg.h b/include/stdarg.h index 3303fdcb83..0cd0fa1f44 100644 --- a/include/stdarg.h +++ b/include/stdarg.h @@ -1,8 +1,6 @@ #ifndef _STDARG_H_ #define _STDARG_H_ -#include - // When building with GCC, use the official vaarg macros to avoid warnings // and possibly bad codegen. #ifdef __GNUC__ @@ -12,31 +10,31 @@ #define va_end __builtin_va_end #else -typedef char *va_list; +typedef char* va_list; #define _FP 1 #define _INT 0 #define _STRUCT 2 #define _VA_FP_SAVE_AREA 0x10 -#define _VA_ALIGN(p, a) (((unsigned int)(((char *)p) + ((a) > 4 ? (a) : 4) - 1)) & -((a) > 4 ? (a) : 4)) +#define _VA_ALIGN(p, a) (((u32)(((char*)p) + ((a) > 4 ? (a) : 4) - 1)) & -((a) > 4 ? (a) : 4)) #define va_start(vp, parmN) (vp = ((va_list)&parmN + sizeof(parmN))) #define __va_stack_arg(list, mode) \ ( \ - ((list) = (char *)_VA_ALIGN(list, __builtin_alignof(mode)) + \ + ((list) = (char*)_VA_ALIGN(list, __builtin_alignof(mode)) + \ _VA_ALIGN(sizeof(mode), 4)), \ - (((char *)list) - (_VA_ALIGN(sizeof(mode), 4) - sizeof(mode)))) + (((char*)list) - (_VA_ALIGN(sizeof(mode), 4) - sizeof(mode)))) #define __va_double_arg(list, mode) \ ( \ - (((long)list & 0x1) /* 1 byte aligned? */ \ - ? (list = (char *)((long)list + 7), (char *)((long)list - 6 - _VA_FP_SAVE_AREA)) \ - : (((long)list & 0x2) /* 2 byte aligned? */ \ - ? (list = (char *)((long)list + 10), (char *)((long)list - 24 - _VA_FP_SAVE_AREA)) \ + (((s32)list & 0x1) /* 1 byte aligned? */ \ + ? (list = (char*)((s32)list + 7), (char*)((s32)list - 6 - _VA_FP_SAVE_AREA)) \ + : (((s32)list & 0x2) /* 2 byte aligned? */ \ + ? (list = (char*)((s32)list + 10), (char*)((s32)list - 24 - _VA_FP_SAVE_AREA)) \ : __va_stack_arg(list, mode)))) -#define va_arg(list, mode) ((mode *)(((__builtin_classof(mode) == _FP && \ - __builtin_alignof(mode) == sizeof(double)) \ +#define va_arg(list, mode) ((mode*)(((__builtin_classof(mode) == _FP && \ + __builtin_alignof(mode) == sizeof(f64)) \ ? __va_double_arg(list, mode) \ : __va_stack_arg(list, mode))))[-1] #define va_end(__list) diff --git a/include/stdlib.h b/include/stdlib.h index 81dc327572..5f014cb37c 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,17 +1,16 @@ #ifndef _STDLIB_H_ #define _STDLIB_H_ +#include "ultra64.h" + typedef struct lldiv_t { - long long quot; - long long rem; + s64 quot; + s64 rem; } lldiv_t; typedef struct ldiv_t { - long quot; - long rem; + s32 quot; + s32 rem; } ldiv_t; -lldiv_t lldiv(long long, long long); -ldiv_t ldiv(long, long); - #endif diff --git a/include/string.h b/include/string.h deleted file mode 100644 index 29ce60a57c..0000000000 --- a/include/string.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _STRING_H_ -#define _STRING_H_ - -#include - -void* memcpy(void*, const void*, size_t); -size_t strlen(const u8* str); -const u8* strchr(const u8* str, s32 ch); - -#endif diff --git a/include/ultra64.h b/include/ultra64.h index daf79835b5..2625e37ae8 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -1,25 +1,28 @@ #ifndef _ULTRA64_H_ #define _ULTRA64_H_ -#include -#include -#include -#include +#include "stddef.h" +#include "stdbool.h" +#include "math.h" +#include "unk.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ultra64/types.h" +#include "ultra64/interrupt.h" +#include "ultra64/rcp.h" +#include "ultra64/rdp.h" +#include "ultra64/rsp.h" +#include "ultra64/thread.h" +#include "ultra64/convert.h" +#include "ultra64/time.h" +#include "ultra64/message.h" +#include "ultra64/sptask.h" +#include "ultra64/gu.h" +#include "ultra64/vi.h" +#include "ultra64/pi.h" +#include "ultra64/hardware.h" +#include "ultra64/controller.h" +#include "ultra64/printf.h" +#include "ultra64/mbi.h" +#include "ultra64/pfs.h" #endif diff --git a/include/ultra64/abi.h b/include/ultra64/abi.h index 63d6b0f99a..f2949f53e1 100644 --- a/include/ultra64/abi.h +++ b/include/ultra64/abi.h @@ -1,5 +1,5 @@ -#ifndef _ABI_H_ -#define _ABI_H_ +#ifndef _ULTRA64_ABI_H_ +#define _ULTRA64_ABI_H_ /* Audio commands: */ #define A_SPNOOP 0 @@ -388,4 +388,4 @@ typedef short ENVMIX_STATE[40]; _a->words.w1 = (unsigned int)d; \ } -#endif /* !_ABI_H_ */ +#endif /* _ULTRA64_ABI_H_ */ diff --git a/include/ultra64/controller.h b/include/ultra64/controller.h index 18629225ac..b587996f9e 100644 --- a/include/ultra64/controller.h +++ b/include/ultra64/controller.h @@ -1,9 +1,8 @@ #ifndef _ULTRA64_CONTROLLER_H_ #define _ULTRA64_CONTROLLER_H_ -#include -#include -#include +#include "ultra64.h" +#include "ultra64/message.h" #define SIAccessQueueSize 2 #define BLOCKSIZE 32 @@ -40,14 +39,14 @@ #define CONT_CMD_END 0xFE // Indicates end of a command #define CONT_CMD_EXE 1 // Set pif ram status byte to this to do a command -#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */ -#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */ -#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */ -#define CONT_ERR_DEVICE PFS_ERR_DEVICE /* 11 */ -#define CONT_ERR_NOT_READY 12 -#define CONT_ERR_VOICE_MEMORY 13 -#define CONT_ERR_VOICE_WORD 14 -#define CONT_ERR_VOICE_NO_RESPONSE 15 +#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */ +#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */ +#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */ +#define CONT_ERR_DEVICE PFS_ERR_DEVICE /* 11 */ +#define CONT_ERR_NOT_READY 12 +#define CONT_ERR_VOICE_MEMORY 13 +#define CONT_ERR_VOICE_WORD 14 +#define CONT_ERR_VOICE_NO_RESPONSE 15 #define DIR_STATUS_EMPTY 0 @@ -66,155 +65,107 @@ #define CONT_OVERRUN_ERROR 0x4 /* Controller type */ - #define CONT_ABSOLUTE 0x0001 #define CONT_RELATIVE 0x0002 #define CONT_JOYPORT 0x0004 -#define CONT_EEPROM 0x8000 -#define CONT_EEP16K 0x4000 -#define CONT_TYPE_MASK 0x1F07 -#define CONT_TYPE_NORMAL 0x0005 -#define CONT_TYPE_MOUSE 0x0002 -#define CONT_TYPE_VOICE 0x0100 +#define CONT_EEPROM 0x8000 +#define CONT_EEP16K 0x4000 +#define CONT_TYPE_MASK 0x1F07 +#define CONT_TYPE_NORMAL 0x0005 +#define CONT_TYPE_MOUSE 0x0002 +#define CONT_TYPE_VOICE 0x0100 /* Controller status */ - #define CONT_CARD_ON 0x01 #define CONT_CARD_PULL 0x02 #define CONT_ADDR_CRC_ER 0x04 -#define CONT_EEPROM_BUSY 0x80 +#define CONT_EEPROM_BUSY 0x80 /* Buttons */ - -#define CONT_A 0x8000 -#define CONT_B 0x4000 -#define CONT_G 0x2000 -#define CONT_START 0x1000 -#define CONT_UP 0x0800 -#define CONT_DOWN 0x0400 -#define CONT_LEFT 0x0200 -#define CONT_RIGHT 0x0100 -#define CONT_L 0x0020 -#define CONT_R 0x0010 -#define CONT_E 0x0008 -#define CONT_D 0x0004 -#define CONT_C 0x0002 -#define CONT_F 0x0001 - -/* Nintendo's official button names */ - -#define A_BUTTON CONT_A -#define B_BUTTON CONT_B -#define L_TRIG CONT_L -#define R_TRIG CONT_R -#define Z_TRIG CONT_G -#define START_BUTTON CONT_START -#define U_JPAD CONT_UP -#define L_JPAD CONT_LEFT -#define R_JPAD CONT_RIGHT -#define D_JPAD CONT_DOWN -#define U_CBUTTONS CONT_E -#define L_CBUTTONS CONT_C -#define R_CBUTTONS CONT_F -#define D_CBUTTONS CONT_D - -typedef struct -{ - /* 0x00 */ union{ - u16 button; - struct{ - u16 a : 1; - u16 b : 1; - u16 z : 1; - u16 s : 1; - u16 du : 1; - u16 dd : 1; - u16 dl : 1; - u16 dr : 1; - u16 illegal_h : 1; - u16 illegal_l : 1; - u16 l : 1; - u16 r : 1; - u16 cu : 1; - u16 cd : 1; - u16 cl : 1; - u16 cr : 1; - }; - }; - /* 0x02 */ s8 x; - /* 0x03 */ s8 y; -} PadInput; // size = 0x4 +#define BTN_CRIGHT 0x0001 +#define BTN_CLEFT 0x0002 +#define BTN_CDOWN 0x0004 +#define BTN_CUP 0x0008 +#define BTN_R 0x0010 +#define BTN_L 0x0020 +#define BTN_DRIGHT 0x0100 +#define BTN_DLEFT 0x0200 +#define BTN_DDOWN 0x0400 +#define BTN_DUP 0x0800 +#define BTN_START 0x1000 +#define BTN_Z 0x2000 +#define BTN_B 0x4000 +#define BTN_A 0x8000 typedef struct { - u32 ram[15]; /* RAM */ - u32 status; -} OSPifRam; + /* 0x00 */ u32 ram[15]; + /* 0x3C */ u32 status; +} OSPifRam; // size = 0x40 typedef struct { - u16 type; /* Controller Type */ - u8 status; /* Controller status */ - u8 errno; -} OSContStatus; + /* 0x00 */ u16 type; + /* 0x02 */ u8 status; + /* 0x03 */ u8 errno; +} OSContStatus; // size = 0x04 typedef struct { - u16 button; - s8 stick_x; /* -80 <= stick_x <= 80 */ - s8 stick_y; /* -80 <= stick_y <= 80 */ - u8 errno; -} OSContPad; + /* 0x00 */ u16 button; + /* 0x02 */ s8 stick_x; + /* 0x03 */ s8 stick_y; + /* 0x04 */ u8 errno; +} OSContPad; // size = 0x06 typedef struct { - void *address; /* Ram pad Address: 11 bits */ - u8 databuffer[32]; /* address of the data buffer */ - u8 addressCrc; /* CRC code for address */ - u8 dataCrc; /* CRC code for data */ - u8 errno; -} OSContRamIo; + /* 0x00 */ void* address; + /* 0x04 */ u8 databuffer[32]; + /* 0x24 */ u8 addressCrc; + /* 0x25 */ u8 dataCrc; + /* 0x26 */ u8 errno; +} OSContRamIo; // size = 0x28 // Original name: __OSContRequesFormat typedef struct { - u8 align; - u8 txsize; - u8 rxsize; - u8 poll; - u8 typeh; - u8 typel; - u8 status; - u8 align1; -} __OSContRequestHeader; + /* 0x00 */ u8 align; + /* 0x01 */ u8 txsize; + /* 0x02 */ u8 rxsize; + /* 0x03 */ u8 poll; + /* 0x04 */ u8 typeh; + /* 0x05 */ u8 typel; + /* 0x06 */ u8 status; + /* 0x07 */ u8 align1; +} __OSContRequestHeader; // size = 0x8 // Original name: __OSContRequesHeaderFormatShort typedef struct { - u8 txsize; - u8 rxsize; - u8 poll; - u8 typeh; - u8 typel; - u8 status; -} __OSContRequestHeaderAligned; + /* 0x00 */ u8 txsize; + /* 0x01 */ u8 rxsize; + /* 0x02 */ u8 poll; + /* 0x03 */ u8 typeh; + /* 0x04 */ u8 typel; + /* 0x05 */ u8 status; +} __OSContRequestHeaderAligned; // size = 0x6 // Original Name: __OSContRamReadFormat typedef struct { - u8 unk_00; - u8 txsize; - u8 rxsize; - u8 poll; - u8 hi; - u8 lo; - u8 data[BLOCKSIZE]; - u8 datacrc; -} __OSContRamHeader; + /* 0x00 */ u8 unk_00; + /* 0x01 */ u8 txsize; + /* 0x02 */ u8 rxsize; + /* 0x03 */ u8 poll; + /* 0x04 */ u8 hi; + /* 0x05 */ u8 lo; + /* 0x06 */ u8 data[BLOCKSIZE]; + /* 0x26 */ u8 datacrc; +} __OSContRamHeader; // size = 0x27 // Original name: __OSContReadFormat typedef struct { - u8 align; - u8 txsize; - u8 rxsize; - u8 poll; - u16 button; - s8 joyX; - s8 joyY; -} __OSContReadHeader; + /* 0x00 */ u8 align; + /* 0x01 */ u8 txsize; + /* 0x02 */ u8 rxsize; + /* 0x03 */ u8 poll; + /* 0x04 */ u16 button; + /* 0x06 */ s8 joyX; + /* 0x07 */ s8 joyY; +} __OSContReadHeader; // size = 0x8 - -#endif //_ULTRA64_CONTROLLER_H_ +#endif diff --git a/include/ultra64/convert.h b/include/ultra64/convert.h index 260b58911f..e68a56576e 100644 --- a/include/ultra64/convert.h +++ b/include/ultra64/convert.h @@ -4,8 +4,6 @@ #define OS_CLOCK_RATE 62500000LL #define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4) -/* Macros */ - #define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL)) #define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL)) #define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL)) @@ -17,9 +15,4 @@ #define OS_PHYSICAL_TO_K0(x) (void*)(((u32)(x)+0x80000000)) #define OS_PHYSICAL_TO_K1(x) (void*)(((u32)(x)+0xA0000000)) -/* Functions */ - -extern u32 osVirtualToPhysical(void*); -extern void* osPhysicalToVirtual(u32); - #endif diff --git a/include/ultra64/gbi.h b/include/ultra64/gbi.h index 5f58904002..e87179f5e5 100644 --- a/include/ultra64/gbi.h +++ b/include/ultra64/gbi.h @@ -1,4 +1,4 @@ -#include "mbi.h" +#include "ultra64/mbi.h" #ifndef _ULTRA64_GBI_H_ #define _ULTRA64_GBI_H_ diff --git a/include/ultra64/gu.h b/include/ultra64/gu.h index 2fa10e5dd9..43b3339793 100644 --- a/include/ultra64/gu.h +++ b/include/ultra64/gu.h @@ -2,13 +2,7 @@ #define _ULTRA64_GU_H_ #define GU_PI 3.1415926 -/* Functions */ #define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5)) -void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, - float near, float far, float scale); -void guPerspective(Mtx *m, u16 *perspNorm, float fovy, float aspect, float near, - float far, float scale); - #endif diff --git a/include/ultra64/hardware.h b/include/ultra64/hardware.h index 1d94340015..ae9e30ce7e 100644 --- a/include/ultra64/hardware.h +++ b/include/ultra64/hardware.h @@ -1,7 +1,7 @@ #ifndef _ULTRA64_HARDWARE_H_ #define _ULTRA64_HARDWARE_H_ -#define HW_REG(reg, type) *(volatile type *)(reg | 0xa0000000) +#define HW_REG(reg, type) *(volatile type*)(reg | 0xa0000000) #define AI_DRAM_ADDR_REG 0x04500000 #define AI_LEN_REG 0x04500004 diff --git a/include/ultra64/internal.h b/include/ultra64/internal.h new file mode 100644 index 0000000000..15a2739624 --- /dev/null +++ b/include/ultra64/internal.h @@ -0,0 +1,28 @@ +#ifndef _ULTRA64_INTERNAL_H_ +#define _ULTRA64_INTERNAL_H_ + +typedef struct { + /* 0x00 */ u32 initialized; + /* 0x04 */ OSThread* mgrThread; + /* 0x08 */ OSMesgQueue* cmdQueue; + /* 0x0C */ OSMesgQueue* eventQueue; + /* 0x10 */ OSMesgQueue* acccessQueue; + /* 0x14 */ s32 (*piDmaCallback)(s32, u32, void*, size_t); + /* 0x18 */ s32 (*epiDmaCallback)(OSPiHandle*, s32, u32, void*, size_t); +} OSMgrArgs; // size = 0x1C + +typedef struct { + /* 0x00 */ OSMesgQueue* queue; + /* 0x04 */ OSMesg msg; +} __osHwInt; // size = 0x08 + +typedef struct { + /* 0x00 */ OSMesgQueue* queue; + /* 0x04 */ OSMesg msg; +} __OSEventState; // size = 0x08 + +extern OSMgrArgs __osPiDevMgr; +extern __osHwInt __osHwIntTable[]; +extern __OSEventState __osEventStateTab[]; + +#endif diff --git a/include/ultra64/interrupt.h b/include/ultra64/interrupt.h index 7eb8a4d79d..0516bcc9a3 100644 --- a/include/ultra64/interrupt.h +++ b/include/ultra64/interrupt.h @@ -1,14 +1,6 @@ #ifndef _ULTRA64_INTERRUPT_H_ #define _ULTRA64_INTERRUPT_H_ -/* Types */ - typedef u32 OSIntMask; - -/* Functions */ - -OSIntMask osGetIntMask(void); -OSIntMask osSetIntMask(OSIntMask); - #endif diff --git a/include/ultra64/mbi.h b/include/ultra64/mbi.h index f0e0029504..ea4edb7cb7 100644 --- a/include/ultra64/mbi.h +++ b/include/ultra64/mbi.h @@ -1,25 +1,5 @@ -#ifndef _MBI_H_ -#define _MBI_H_ - -/************************************************************************** - * * - * Copyright (C) 1994, Silicon Graphics, Inc. * - * * - * These coded instructions, statements, and computer programs contain * - * unpublished proprietary information of Silicon Graphics, Inc., and * - * are protected by Federal copyright law. They may not be disclosed * - * to third parties or copied or duplicated in any form, in whole or * - * in part, without the prior written consent of Silicon Graphics, Inc. * - * * - **************************************************************************/ - -/************************************************************************** - * - * $Revision: 1.136 $ - * $Date: 1999/01/05 13:04:00 $ - * $Source: /hosts/gate3/exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/mbi.h,v $ - * - **************************************************************************/ +#ifndef _ULTRA64_MBI_H_ +#define _ULTRA64_MBI_H_ /* * Header file for the Media Binary Interface @@ -44,57 +24,22 @@ * (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment) * */ -#define _SHIFTL(v, s, w) \ - ((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s))) -#define _SHIFTR(v, s, w) \ - ((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1))) +#define _SHIFTL(v, s, w) \ + ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s))) +#define _SHIFTR(v, s, w) \ + ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1))) -#define G_ON (1) -#define G_OFF (0) +#define _SHIFT _SHIFTL /* old, for compatibility only */ -/************************************************************************** - * - * Graphics Binary Interface - * - **************************************************************************/ +#define G_ON (1) +#define G_OFF (0) -#include +#include "ultra64/gbi.h" +#include "ultra64/abi.h" -/************************************************************************** - * - * Audio Binary Interface - * - **************************************************************************/ +#define NUM_SEGMENTS (16) +#define SEGMENT_OFFSET(a) ((u32)(a) & 0x00ffffff) +#define SEGMENT_NUMBER(a) (((u32)(a) << 4) >> 28) +#define SEGMENT_ADDR(num, off) (((num) << 24) + (off)) -#include - -/************************************************************************** - * - * Task list - * - **************************************************************************/ - -#define M_NULTASK 0 -#define M_GFXTASK 1 -#define M_AUDTASK 2 -#define M_VIDTASK 3 -#define M_NJPEGTASK 4 -#define M_HVQTASK 6 -#define M_HVQMTASK 7 - -/************************************************************************** - * - * Segment macros and definitions - * - **************************************************************************/ - -#define NUM_SEGMENTS (16) -#define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff) -#define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28) -#define SEGMENT_ADDR(num, off) (((num) << 24) + (off)) - -#ifndef NULL -#define NULL 0 #endif - -#endif /* !_MBI_H_ */ diff --git a/include/ultra64/message.h b/include/ultra64/message.h index e4811f1331..3f52482d83 100644 --- a/include/ultra64/message.h +++ b/include/ultra64/message.h @@ -1,31 +1,39 @@ #ifndef _ULTRA64_MESSAGE_H_ #define _ULTRA64_MESSAGE_H_ -/* Message Blocking Flags */ +#include "ultra64/types.h" #define OS_MESG_NOBLOCK 0 #define OS_MESG_BLOCK 1 -/* Types */ +typedef void* OSMesg; +typedef u32 OSEvent; -typedef void *OSMesg; +#define OS_NUM_EVENTS 15 -typedef struct OSMesgQueue_s -{ - OSThread *mtqueue; - OSThread *fullqueue; - s32 validCount; - s32 first; - s32 msgCount; - OSMesg *msg; -} OSMesgQueue; +#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */ +#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */ +#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */ +#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */ +#define OS_EVENT_SP 4 /* SP task done interrupt */ +#define OS_EVENT_SI 5 /* SI (controller) interrupt */ +#define OS_EVENT_AI 6 /* AI interrupt */ +#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */ +#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */ +#define OS_EVENT_DP 9 /* DP full sync interrupt */ +#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */ +#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */ +#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */ +#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */ +#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */ - -/* Functions */ - -void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32); -s32 osSendMesg(OSMesgQueue *, OSMesg, s32); -s32 osJamMesg(OSMesgQueue *, OSMesg, s32); -s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32); +typedef struct OSMesgQueue { + /* 0x00 */ OSThread* mtqueue; + /* 0x04 */ OSThread* fullqueue; + /* 0x08 */ s32 validCount; + /* 0x0C */ s32 first; + /* 0x10 */ s32 msgCount; + /* 0x14 */ OSMesg* msg; +} OSMesgQueue; // size = 0x18 #endif diff --git a/include/ultra64/os_internal.h b/include/ultra64/os_internal.h deleted file mode 100644 index a46f336f9e..0000000000 --- a/include/ultra64/os_internal.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _ULTRA64_OS_INTERNAL_H_ -#define _ULTRA64_OS_INTERNAL_H_ - -/* Internal functions used by the operating system */ -/* Do not include this header in application code */ - -/* Variables */ - -typedef struct -{ - u32 initialized; - OSThread *mgrThread; - OSMesgQueue *cmdQueue; - OSMesgQueue *eventQueue; - OSMesgQueue *acccessQueue; - s32 (*piDmaCallback)(s32, u32, void*, size_t); - s32 (*epiDmaCallback)(OSPiHandle *, s32, u32, void *, size_t); -} OSMgrArgs; - -typedef struct -{ - OSMesgQueue* queue; - OSMesg msg; -} __osHwInt; - -typedef struct -{ - OSMesgQueue* queue; - OSMesg msg; -} __OSEventState; - -/* Functions */ - -u32 __osProbeTLB(void *); -s32 __osDisableInt(void); -OSThread *__osPopThread(OSThread**); -void __osCleanupThread(void); - -#endif diff --git a/include/ultra64/os_message.h b/include/ultra64/os_message.h deleted file mode 100644 index 51ce59e923..0000000000 --- a/include/ultra64/os_message.h +++ /dev/null @@ -1,163 +0,0 @@ - -/*==================================================================== - * os_message.h - * - * Copyright 1995, Silicon Graphics, Inc. - * All Rights Reserved. - * - * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, - * Inc.; the contents of this file may not be disclosed to third - * parties, copied or duplicated in any form, in whole or in part, - * without the prior written permission of Silicon Graphics, Inc. - * - * RESTRICTED RIGHTS LEGEND: - * Use, duplication or disclosure by the Government is subject to - * restrictions as set forth in subdivision (c)(1)(ii) of the Rights - * in Technical Data and Computer Software clause at DFARS - * 252.227-7013, and/or in similar or successor clauses in the FAR, - * DOD or NASA FAR Supplement. Unpublished - rights reserved under the - * Copyright Laws of the United States. - *====================================================================*/ - -/*---------------------------------------------------------------------* - Copyright (C) 1998 Nintendo. (Originated by SGI) - - $RCSfile: os_message.h,v $ - $Revision: 1.1 $ - $Date: 1998/10/09 08:01:15 $ - *---------------------------------------------------------------------*/ - -#ifndef _OS_MESSAGE_H_ -#define _OS_MESSAGE_H_ - -#ifdef _LANGUAGE_C_PLUS_PLUS -extern "C" { -#endif - -#include - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Type definitions - * - */ - -typedef u32 OSEvent; - -/* - * Structure for message - */ -typedef void * OSMesg; - -/* - * Structure for message queue - */ -typedef struct OSMesgQueue_s { - OSThread *mtqueue; /* Queue to store threads blocked - on empty mailboxes (receive) */ - OSThread *fullqueue; /* Queue to store threads blocked - on full mailboxes (send) */ - s32 validCount; /* Contains number of valid message */ - s32 first; /* Points to first valid message */ - s32 msgCount; /* Contains total # of messages */ - OSMesg *msg; /* Points to message buffer array */ -} OSMesgQueue; - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -/************************************************************************** - * - * Global definitions - * - */ - -/* Events */ -#ifdef _FINALROM -#define OS_NUM_EVENTS 15 -#else -#define OS_NUM_EVENTS 23 -#endif - -#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */ -#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */ -#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */ -#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */ -#define OS_EVENT_SP 4 /* SP task done interrupt */ -#define OS_EVENT_SI 5 /* SI (controller) interrupt */ -#define OS_EVENT_AI 6 /* AI interrupt */ -#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */ -#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */ -#define OS_EVENT_DP 9 /* DP full sync interrupt */ -#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */ -#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */ -#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */ -#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */ -#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */ -#ifndef _FINALROM -#define OS_EVENT_RDB_READ_DONE 15 /* RDB read ok event: used by rmon */ -#define OS_EVENT_RDB_LOG_DONE 16 /* read of log data complete */ -#define OS_EVENT_RDB_DATA_DONE 17 /* read of hostio data complete */ -#define OS_EVENT_RDB_REQ_RAMROM 18 /* host needs ramrom access */ -#define OS_EVENT_RDB_FREE_RAMROM 19 /* host is done with ramrom access */ -#define OS_EVENT_RDB_DBG_DONE 20 -#define OS_EVENT_RDB_FLUSH_PROF 21 -#define OS_EVENT_RDB_ACK_PROF 22 -#endif - -/* Flags to turn blocking on/off when sending/receiving message */ - -#define OS_MESG_NOBLOCK 0 -#define OS_MESG_BLOCK 1 - - -#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) - -/************************************************************************** - * - * Macro definitions - * - */ - -/* Get count of valid messages in queue */ -#define MQ_GET_COUNT(mq) ((mq)->validCount) - -/* Figure out if message queue is empty or full */ -#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0) -#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount) - - -/************************************************************************** - * - * Extern variables - * - */ - - -/************************************************************************** - * - * Function prototypes - * - */ - -/* Message operations */ - -extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32); -extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32); -extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32); -extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32); - -/* Event operations */ - -extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg); - - -#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ - -#ifdef _LANGUAGE_C_PLUS_PLUS -} -#endif - -#endif /* !_OS_MESSAGE_H_ */ diff --git a/include/ultra64/os_misc.h b/include/ultra64/os_misc.h deleted file mode 100644 index 4e7353ba71..0000000000 --- a/include/ultra64/os_misc.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _ULTRA64_OS_MISC_H_ -#define _ULTRA64_OS_MISC_H_ - -/* Miscellaneous OS functions */ - -u32 osGetCount(void); - -#endif diff --git a/include/ultra64/os_pi.h b/include/ultra64/os_pi.h deleted file mode 100644 index e2bff353b9..0000000000 --- a/include/ultra64/os_pi.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef _ULTRA64_OS_PI_H_ -#define _ULTRA64_OS_PI_H_ - -/* Ultra64 Parallel Interface */ - -/* Types */ - -typedef struct -{ - /* 0x00 */ u32 errStatus; - /* 0x04 */ void *dramAddr; - /* 0x08 */ void *C2Addr; - /* 0x0C */ u32 sectorSize; - /* 0x10 */ u32 C1ErrNum; - /* 0x14 */ u32 C1ErrSector[4]; -} __OSBlockInfo; /* length: 0x24 */ - -typedef struct -{ - /* 0x00 */ u32 cmdType; - /* 0x04 */ u16 transferMode; - /* 0x06 */ u16 blockNum; - /* 0x08 */ s32 sectorNum; - /* 0x0C */ u32 devAddr; - /* 0x10 */ u32 bmCtlShadow; - /* 0x14 */ u32 seqCtlShadow; - /* 0x18 */ __OSBlockInfo block[2]; -} __OSTranxInfo; /* length: 0x60 */ - -typedef struct OSPiHandle_s -{ - /* 0x00 */ struct OSPiHandle_s *next; - /* 0x04 */ u8 type; - /* 0x05 */ u8 latency; - /* 0x06 */ u8 pageSize; - /* 0x07 */ u8 relDuration; - /* 0x08 */ u8 pulse; - /* 0x09 */ u8 domain; - /* 0x0A padding */ - /* 0x0B padding */ - /* 0x0C */ u32 baseAddress; - /* 0x10 */ u32 speed; - /* 0x14 */ __OSTranxInfo transferInfo; -} OSPiHandle; /* length: 0x74 */ - -typedef struct -{ - u8 type; - u32 address; -} OSPiInfo; - -typedef struct -{ - /* 0x00 */ u16 type; - /* 0x02 */ u8 pri; - /* 0x03 */ u8 status; - /* 0x04 */ OSMesgQueue *retQueue; -} OSIoMesgHdr; /* length: 0x8 */ - -typedef struct -{ - /*0x00*/ OSIoMesgHdr hdr; - /*0x08*/ void *dramAddr; - /*0x0C*/ u32 devAddr; - /*0x10*/ size_t size; - /*0x14*/ OSPiHandle* piHandle; //from the official definition -} OSIoMesg; /* length: 0x18 */ - -/* Definitions */ - -#define OS_READ 0 // device -> RDRAM -#define OS_WRITE 1 // device <- RDRAM - -#define OS_MESG_PRI_NORMAL 0 -#define OS_MESG_PRI_HIGH 1 - -/* Functions */ - -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, - u32 devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq); -void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, - s32 cmdMsgCnt); -OSMesgQueue *osPiGetCmdQueue(void); -s32 osPiWriteIo(u32 devAddr, u32 data); -s32 osPiReadIo(u32 devAddr, u32 *data); - -#endif diff --git a/include/ultra64/os_thread.h b/include/ultra64/os_thread.h deleted file mode 100644 index 791701c249..0000000000 --- a/include/ultra64/os_thread.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _ULTRA64_THREAD_H_ -#define _ULTRA64_THREAD_H_ - -/* Recommended priorities for system threads */ -#define OS_PRIORITY_MAX 255 -#define OS_PRIORITY_VIMGR 254 -#define OS_PRIORITY_RMON 250 -#define OS_PRIORITY_RMONSPIN 200 -#define OS_PRIORITY_PIMGR 150 -#define OS_PRIORITY_SIMGR 140 -#define OS_PRIORITY_APPMAX 127 -#define OS_PRIORITY_IDLE 0 - -#define OS_STATE_STOPPED 1 -#define OS_STATE_RUNNABLE 2 -#define OS_STATE_RUNNING 4 -#define OS_STATE_WAITING 8 - -/* Types */ - -typedef s32 OSPri; -typedef s32 OSId; - -typedef union -{ - struct {f32 f_odd; f32 f_even;} f; -} __OSfp; - -typedef struct -{ - /* registers */ - /*0x20*/ u64 at, v0, v1, a0, a1, a2, a3; - /*0x58*/ u64 t0, t1, t2, t3, t4, t5, t6, t7; - /*0x98*/ u64 s0, s1, s2, s3, s4, s5, s6, s7; - /*0xD8*/ u64 t8, t9, gp, sp, s8, ra; - /*0x108*/ u64 lo, hi; - /*0x118*/ u32 sr, pc, cause, badvaddr, rcp; - /*0x12C*/ u32 fpcsr; - __OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14; - __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30; -} __OSThreadContext; - -typedef struct -{ - u32 flag; - u32 count; - u64 time; -} __OSThreadprofile_s; - -typedef struct OSThread_s -{ - /*0x00*/ struct OSThread_s *next; - /*0x04*/ OSPri priority; - /*0x08*/ struct OSThread_s **queue; - /*0x0C*/ struct OSThread_s *tlnext; - /*0x10*/ u16 state; - /*0x12*/ u16 flags; - /*0x14*/ OSId id; - /*0x18*/ int fp; - /*0x1C*/ __OSThreadprofile_s *thprof; - /*0x20*/ __OSThreadContext context; -} OSThread; - - -/* Functions */ - -void osCreateThread(OSThread *thread, OSId id, void (*entry)(void *), - void *arg, void *sp, OSPri pri); -OSId osGetThreadId(OSThread *thread); -OSPri osGetThreadPri(OSThread *thread); -void osSetThreadPri(OSThread *thread, OSPri pri); -void osStartThread(OSThread *thread); -void osStopThread(OSThread *thread); - -#endif diff --git a/include/ultra64/os_vi.h b/include/ultra64/os_vi.h deleted file mode 100644 index b8d66a9a05..0000000000 --- a/include/ultra64/os_vi.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef _ULTRA64_VI_H_ -#define _ULTRA64_VI_H_ - -/* Ultra64 Video Interface */ - - -/* Special Features */ -#define OS_VI_GAMMA_ON 0x0001 -#define OS_VI_GAMMA_OFF 0x0002 -#define OS_VI_GAMMA_DITHER_ON 0x0004 -#define OS_VI_GAMMA_DITHER_OFF 0x0008 -#define OS_VI_DIVOT_ON 0x0010 -#define OS_VI_DIVOT_OFF 0x0020 -#define OS_VI_DITHER_FILTER_ON 0x0040 -#define OS_VI_DITHER_FILTER_OFF 0x0080 - -#define OS_VI_GAMMA 0x08 -#define OS_VI_GAMMA_DITHER 0x04 -#define OS_VI_DIVOT 0x10 -#define OS_VI_DITHER_FILTER 0x10000 -#define OS_VI_UNK200 0x200 -#define OS_VI_UNK100 0x100 - - -/* Types */ - -typedef struct -{ - u32 ctrl; - u32 width; - u32 burst; - u32 vSync; - u32 hSync; - u32 leap; - u32 hStart; - u32 xScale; - u32 vCurrent; -} OSViCommonRegs; - -typedef struct -{ - u32 origin; - u32 yScale; - u32 vStart; - u32 vBurst; - u32 vIntr; -} OSViFieldRegs; - -typedef struct -{ - u8 type; - OSViCommonRegs comRegs; - OSViFieldRegs fldRegs[2]; -} OSViMode; - -typedef struct { - /* 0x0 */ f32 factor; - /* 0x4 */ u16 offset; - /* 0x8 */ u32 scale; -} __OSViScale; - -typedef struct -{ - /* 0x00 */ u16 state; - /* 0x02 */ u16 retraceCount; - /* 0x04 */ void* buffer; - /* 0x08 */ OSViMode *modep; - /* 0x0c */ u32 features; - /* 0x10 */ OSMesgQueue *mq; - /* 0x14 */ OSMesg *msg; - /* 0x18 */ __OSViScale x; - /* 0x24 */ __OSViScale y; -} OSViContext; - -void osCreateViManager(OSPri pri); -void osViSetMode(OSViMode *mode); -void osViSetEvent(OSMesgQueue *mq, OSMesg msg, u32 retraceCount); -void osViBlack(u8 active); -void osViSetSpecialFeatures(u32 func); -void osViSwapBuffer(void *vaddr); - - -#define OS_VI_NTSC_LPN1 0 /* NTSC */ -#define OS_VI_NTSC_LPF1 1 -#define OS_VI_NTSC_LAN1 2 -#define OS_VI_NTSC_LAF1 3 -#define OS_VI_NTSC_LPN2 4 -#define OS_VI_NTSC_LPF2 5 -#define OS_VI_NTSC_LAN2 6 -#define OS_VI_NTSC_LAF2 7 -#define OS_VI_NTSC_HPN1 8 -#define OS_VI_NTSC_HPF1 9 -#define OS_VI_NTSC_HAN1 10 -#define OS_VI_NTSC_HAF1 11 -#define OS_VI_NTSC_HPN2 12 -#define OS_VI_NTSC_HPF2 13 - -#define OS_VI_PAL_LPN1 14 /* PAL */ -#define OS_VI_PAL_LPF1 15 -#define OS_VI_PAL_LAN1 16 -#define OS_VI_PAL_LAF1 17 -#define OS_VI_PAL_LPN2 18 -#define OS_VI_PAL_LPF2 19 -#define OS_VI_PAL_LAN2 20 -#define OS_VI_PAL_LAF2 21 -#define OS_VI_PAL_HPN1 22 -#define OS_VI_PAL_HPF1 23 -#define OS_VI_PAL_HAN1 24 -#define OS_VI_PAL_HAF1 25 -#define OS_VI_PAL_HPN2 26 -#define OS_VI_PAL_HPF2 27 - -extern OSViMode osViModeTable[]; /* Global VI mode table */ - - -#endif diff --git a/include/ultra64/pfs.h b/include/ultra64/pfs.h index d3d2928a1e..e86a2b738c 100644 --- a/include/ultra64/pfs.h +++ b/include/ultra64/pfs.h @@ -1,19 +1,19 @@ #ifndef _ULTRA64_PFS_H_ #define _ULTRA64_PFS_H_ -#include +#include "ultra64.h" /* File System size */ -#define OS_PFS_VERSION 0x0200 -#define OS_PFS_VERSION_HI (OS_PFS_VERSION >> 8) -#define OS_PFS_VERSION_LO (OS_PFS_VERSION & 255) +#define OS_PFS_VERSION 0x0200 +#define OS_PFS_VERSION_HI (OS_PFS_VERSION >> 8) +#define OS_PFS_VERSION_LO (OS_PFS_VERSION & 255) -#define PFS_INODE_SIZE_PER_PAGE 128 +#define PFS_INODE_SIZE_PER_PAGE 128 #define PFS_FILE_NAME_LEN 16 #define PFS_FILE_EXT_LEN 4 -#define BLOCKSIZE 32 -#define PFS_ONE_PAGE 8 -#define PFS_MAX_BANKS 62 +#define BLOCKSIZE 32 +#define PFS_ONE_PAGE 8 +#define PFS_MAX_BANKS 62 /* File System flag */ @@ -22,40 +22,40 @@ #define PFS_CREATE 2 /* File System status */ -#define PFS_INITIALIZED 0x1 -#define PFS_CORRUPTED 0x2 -#define PFS_ID_BROKEN 0x4 -#define PFS_MOTOR_INITIALIZED 0x8 -#define PFS_GBPAK_INITIALIZED 0x10 +#define PFS_INITIALIZED 0x1 +#define PFS_CORRUPTED 0x2 +#define PFS_ID_BROKEN 0x4 +#define PFS_MOTOR_INITIALIZED 0x8 +#define PFS_GBPAK_INITIALIZED 0x10 /* Definition for page usage */ -#define PFS_EOF 1 -#define PFS_PAGE_NOT_EXIST 2 -#define PFS_PAGE_NOT_USED 3 +#define PFS_EOF 1 +#define PFS_PAGE_NOT_EXIST 2 +#define PFS_PAGE_NOT_USED 3 /* File System error number */ -#define PFS_ERR_NOPACK 1 /* no memory card is plugged or */ -#define PFS_ERR_NEW_PACK 2 /* ram pack has been changed to a different one */ -#define PFS_ERR_INCONSISTENT 3 /* need to run Pfschecker*/ -#define PFS_ERR_CONTRFAIL CONT_OVERRUN_ERROR -#define PFS_ERR_INVALID 5 /* invalid parameter or file not exist*/ -#define PFS_ERR_BAD_DATA 6 /* the data read from pack are bad*/ -#define PFS_DATA_FULL 7 /* no free pages on ram pack*/ -#define PFS_DIR_FULL 8 /* no free directories on ram pack*/ -#define PFS_ERR_EXIST 9 /* file exists*/ -#define PFS_ERR_ID_FATAL 10 /* dead ram pack */ -#define PFS_ERR_DEVICE 11 /* wrong device type*/ -#define PFS_ERR_NO_GBCART 12 /* no gb cartridge (64GB-PAK) */ -#define PFS_ERR_NEW_GBCART 13 /* gb cartridge may be changed */ +#define PFS_ERR_NOPACK 1 /* no memory card is plugged or */ +#define PFS_ERR_NEW_PACK 2 /* ram pack has been changed to a different one */ +#define PFS_ERR_INCONSISTENT 3 /* need to run Pfschecker*/ +#define PFS_ERR_CONTRFAIL CONT_OVERRUN_ERROR +#define PFS_ERR_INVALID 5 /* invalid parameter or file not exist*/ +#define PFS_ERR_BAD_DATA 6 /* the data read from pack are bad*/ +#define PFS_DATA_FULL 7 /* no free pages on ram pack*/ +#define PFS_DIR_FULL 8 /* no free directories on ram pack*/ +#define PFS_ERR_EXIST 9 /* file exists*/ +#define PFS_ERR_ID_FATAL 10 /* dead ram pack */ +#define PFS_ERR_DEVICE 11 /* wrong device type*/ +#define PFS_ERR_NO_GBCART 12 /* no gb cartridge (64GB-PAK) */ +#define PFS_ERR_NEW_GBCART 13 /* gb cartridge may be changed */ /* Definition for bank */ -#define PFS_ID_BANK_256K 0 -#define PFS_ID_BANK_1M 4 -#define PFS_BANKS_256K 1 +#define PFS_ID_BANK_256K 0 +#define PFS_ID_BANK_1M 4 +#define PFS_BANKS_256K 1 -#define PFS_WRITTEN 2 -#define DEF_DIR_PAGES 2 +#define PFS_WRITTEN 2 +#define DEF_DIR_PAGES 2 #define PFS_ID_0AREA 1 #define PFS_ID_1AREA 3 @@ -64,74 +64,74 @@ #define PFS_LABEL_AREA 7 #define PFS_ID_PAGE PFS_ONE_PAGE * 0 -#define PFS_BANK_LAPPED_BY 8 /* => u8 */ -#define PFS_SECTOR_PER_BANK 32 -#define PFS_INODE_DIST_MAP (PFS_BANK_LAPPED_BY * PFS_SECTOR_PER_BANK) -#define PFS_SECTOR_SIZE (PFS_INODE_SIZE_PER_PAGE/PFS_SECTOR_PER_BANK) +#define PFS_BANK_LAPPED_BY 8 /* => u8 */ +#define PFS_SECTOR_PER_BANK 32 +#define PFS_INODE_DIST_MAP (PFS_BANK_LAPPED_BY * PFS_SECTOR_PER_BANK) +#define PFS_SECTOR_SIZE (PFS_INODE_SIZE_PER_PAGE/PFS_SECTOR_PER_BANK) typedef struct { - int status; - OSMesgQueue* queue; - int channel; - u8 id[32]; - u8 label[32]; - int version; - int dir_size; - int inode_table; /* block location */ - int minode_table; /* mirrioring inode_table */ - int dir_table; /* block location */ - int inodeStartPage; /* page # */ - u8 banks; - u8 activebank; -} OSPfs; + /* 0x00 */ s32 status; + /* 0x04 */ OSMesgQueue* queue; + /* 0x08 */ s32 channel; + /* 0x0C */ u8 id[32]; + /* 0x2C */ u8 label[32]; + /* 0x4C */ s32 version; + /* 0x50 */ s32 dir_size; + /* 0x54 */ s32 inode_table; /* block location */ + /* 0x58 */ s32 minode_table; /* mirrioring inode_table */ + /* 0x5C */ s32 dir_table; /* block location */ + /* 0x60 */ s32 inodeStartPage; /* page # */ + /* 0x64 */ u8 banks; + /* 0x65 */ u8 activebank; +} OSPfs; // size = 0x68 typedef struct { - u32 file_size; /* bytes */ - u32 game_code; - u16 company_code; - char ext_name[4]; - char game_name[16]; -} OSPfsState; + /* 0x00 */ u32 file_size; /* bytes */ + /* 0x04 */ u32 game_code; + /* 0x08 */ u16 company_code; + /* 0x0C */ char ext_name[4]; + /* 0x10 */ char game_name[16]; +} OSPfsState; // size = 0x20 typedef union { - struct { - u8 bank; - u8 page; - } inode_t; - u16 ipage; -} __OSInodeUnit; + struct { + /* 0x00 */ u8 bank; + /* 0x01 */ u8 page; + } inode_t; + /* 0x00 */ u16 ipage; +} __OSInodeUnit; // size = 0x02 typedef struct { - __OSInodeUnit inodePage[128]; -} __OSInode; + /* 0x00 */ __OSInodeUnit inodePage[128]; +} __OSInode; // size = 0x100 typedef struct { - u32 game_code; - u16 company_code; - __OSInodeUnit start_page; - u8 status; - s8 reserved; - u16 data_sum; - u8 ext_name[PFS_FILE_EXT_LEN]; - u8 game_name[PFS_FILE_NAME_LEN]; -} __OSDir; + /* 0x00 */ u32 game_code; + /* 0x04 */ u16 company_code; + /* 0x06 */ __OSInodeUnit start_page; + /* 0x08 */ u8 status; + /* 0x09 */ s8 reserved; + /* 0x0A */ u16 data_sum; + /* 0x0C */ u8 ext_name[PFS_FILE_EXT_LEN]; + /* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN]; +} __OSDir; // size = 0x20 typedef struct { - u32 repaired; - u32 random; - u64 serialMid; - u64 serialLow; - u16 deviceid; - u8 banks; - u8 version; - u16 checksum; - u16 invertedChecksum; -} __OSPackId; + /* 0x00 */ u32 repaired; + /* 0x04 */ u32 random; + /* 0x08 */ u64 serialMid; + /* 0x10 */ u64 serialLow; + /* 0x18 */ u16 deviceid; + /* 0x1A */ u8 banks; + /* 0x1B */ u8 version; + /* 0x1C */ u16 checksum; + /* 0x1E */ u16 invertedChecksum; +} __OSPackId; // size = 0x20 -typedef struct { - __OSInode inode; - u8 bank; - u8 map[PFS_INODE_DIST_MAP]; -} __OSInodeCache; +typedef struct { + /* 0x000 */ __OSInode inode; + /* 0x100 */ u8 bank; + /* 0x101 */ u8 map[PFS_INODE_DIST_MAP]; +} __OSInodeCache; // size = 0x202 #endif diff --git a/include/ultra64/pi.h b/include/ultra64/pi.h new file mode 100644 index 0000000000..d28dbc12d3 --- /dev/null +++ b/include/ultra64/pi.h @@ -0,0 +1,63 @@ +#ifndef _ULTRA64_PI_H_ +#define _ULTRA64_PI_H_ + +typedef struct { + /* 0x00 */ u32 errStatus; + /* 0x04 */ void* dramAddr; + /* 0x08 */ void* C2Addr; + /* 0x0C */ u32 sectorSize; + /* 0x10 */ u32 C1ErrNum; + /* 0x14 */ u32 C1ErrSector[4]; +} __OSBlockInfo; // size = 0x24 + +typedef struct { + /* 0x00 */ u32 cmdType; + /* 0x04 */ u16 transferMode; + /* 0x06 */ u16 blockNum; + /* 0x08 */ s32 sectorNum; + /* 0x0C */ u32 devAddr; + /* 0x10 */ u32 bmCtlShadow; + /* 0x14 */ u32 seqCtlShadow; + /* 0x18 */ __OSBlockInfo block[2]; +} __OSTranxInfo; // size = 0x60 + +typedef struct OSPiHandle { + /* 0x00 */ struct OSPiHandle* next; + /* 0x04 */ u8 type; + /* 0x05 */ u8 latency; + /* 0x06 */ u8 pageSize; + /* 0x07 */ u8 relDuration; + /* 0x08 */ u8 pulse; + /* 0x09 */ u8 domain; + /* 0x0C */ u32 baseAddress; + /* 0x10 */ u32 speed; + /* 0x14 */ __OSTranxInfo transferInfo; +} OSPiHandle; // size = 0x74 + +typedef struct { + /* 0x00 */ u8 type; + /* 0x04 */ u32 address; +} OSPiInfo; // size = 0x08 + +typedef struct { + /* 0x00 */ u16 type; + /* 0x02 */ u8 pri; + /* 0x03 */ u8 status; + /* 0x04 */ OSMesgQueue* retQueue; +} OSIoMesgHdr; // size = 0x08 + +typedef struct { + /* 0x00 */ OSIoMesgHdr hdr; + /* 0x08 */ void* dramAddr; + /* 0x0C */ u32 devAddr; + /* 0x10 */ size_t size; + /* 0x14 */ OSPiHandle* piHandle; +} OSIoMesg; // size = 0x18 + +#define OS_READ 0 // device -> RDRAM +#define OS_WRITE 1 // device <- RDRAM + +#define OS_MESG_PRI_NORMAL 0 +#define OS_MESG_PRI_HIGH 1 + +#endif diff --git a/include/ultra64/printf.h b/include/ultra64/printf.h index 6f4738addc..23718012a5 100644 --- a/include/ultra64/printf.h +++ b/include/ultra64/printf.h @@ -1,6 +1,6 @@ -#ifndef _PRINTF_H_ -#define _PRINTF_H_ -#include +#ifndef _ULTRA64_PRINTF_H_ +#define _ULTRA64_PRINTF_H_ +#include "stdarg.h" typedef struct { /* 0x0 */ union { @@ -19,7 +19,7 @@ typedef struct { /* 0x2C */ u32 nchar; /* 0x30 */ u32 flags; /* 0x34 */ u8 qual; -} _Pft; +} _Pft; // size = 0x38 #define FLAGS_SPACE 1 #define FLAGS_PLUS 2 @@ -27,8 +27,4 @@ typedef struct { #define FLAGS_HASH 8 #define FLAGS_ZERO 16 -s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args); -void _Litob(_Pft *args, u8 type); -void _Ldtob(_Pft *args, u8 type); - #endif diff --git a/include/ultra64/rcp.h b/include/ultra64/rcp.h index 29b652387a..6bd778ccfa 100644 --- a/include/ultra64/rcp.h +++ b/include/ultra64/rcp.h @@ -1,14 +1,14 @@ #ifndef _ULTRA64_RCP_H_ #define _ULTRA64_RCP_H_ -#define VI_NTSC_CLOCK 48681812 /* Hz = 48.681812 MHz */ -#define VI_PAL_CLOCK 49656530 /* Hz = 49.656530 MHz */ -#define VI_MPAL_CLOCK 48628316 /* Hz = 48.628316 MHz */ +#define VI_NTSC_CLOCK 48681812 /* Hz = 48.681812 MHz */ +#define VI_PAL_CLOCK 49656530 /* Hz = 49.656530 MHz */ +#define VI_MPAL_CLOCK 48628316 /* Hz = 48.628316 MHz */ -#define DEVICE_TYPE_CART 0 /* ROM cartridge */ -#define DEVICE_TYPE_BULK 1 /* ROM bulk */ -#define DEVICE_TYPE_64DD 2 /* 64 Disk Drive */ -#define DEVICE_TYPE_SRAM 3 /* SRAM */ -#define DEVICE_TYPE_INIT 7 /* initial value */ +#define DEVICE_TYPE_CART 0 /* ROM cartridge */ +#define DEVICE_TYPE_BULK 1 /* ROM bulk */ +#define DEVICE_TYPE_64DD 2 /* 64 Disk Drive */ +#define DEVICE_TYPE_SRAM 3 /* SRAM */ +#define DEVICE_TYPE_INIT 7 /* initial value */ #endif diff --git a/include/ultra64/rdp.h b/include/ultra64/rdp.h index 95bfc4884c..25aad6f9b3 100644 --- a/include/ultra64/rdp.h +++ b/include/ultra64/rdp.h @@ -5,54 +5,48 @@ #define DPC_REG_BASE 0xA4100000 -#define DPC_START_REG (*(vu32 *)(DPC_REG_BASE + 0x00)) -#define DPC_END_REG (*(vu32 *)(DPC_REG_BASE + 0x04)) -#define DPC_CURRENT_REG (*(vu32 *)(DPC_REG_BASE + 0x08)) -#define DPC_STATUS_REG (*(vu32 *)(DPC_REG_BASE + 0x0C)) -#define DPC_CLOCK_REG (*(vu32 *)(DPC_REG_BASE + 0x10)) -#define DPC_BUFBUSY_REG (*(vu32 *)(DPC_REG_BASE + 0x14)) -#define DPC_PIPEBUSY_REG (*(vu32 *)(DPC_REG_BASE + 0x18)) -#define DPC_TMEM_REG (*(vu32 *)(DPC_REG_BASE + 0x1C)) +#define DPC_START_REG (*(vu32*)(DPC_REG_BASE + 0x00)) +#define DPC_END_REG (*(vu32*)(DPC_REG_BASE + 0x04)) +#define DPC_CURRENT_REG (*(vu32*)(DPC_REG_BASE + 0x08)) +#define DPC_STATUS_REG (*(vu32*)(DPC_REG_BASE + 0x0C)) +#define DPC_CLOCK_REG (*(vu32*)(DPC_REG_BASE + 0x10)) +#define DPC_BUFBUSY_REG (*(vu32*)(DPC_REG_BASE + 0x14)) +#define DPC_PIPEBUSY_REG (*(vu32*)(DPC_REG_BASE + 0x18)) +#define DPC_TMEM_REG (*(vu32*)(DPC_REG_BASE + 0x1C)) /* DP Span Registers */ #define DPS_REG_BASE 0xA4200000 -#define DPS_TBIST_REG (*(vu32 *)(DPS_REG_BASE + 0x00)) -#define DPS_TEST_MODE_REG (*(vu32 *)(DPS_REG_BASE + 0x04)) -#define DPS_BUFTEST_ADDR_REG (*(vu32 *)(DPS_REG_BASE + 0x08)) -#define DPS_BUFTEST_DATA_REG (*(vu32 *)(DPS_REG_BASE + 0x0C)) +#define DPS_TBIST_REG (*(vu32*)(DPS_REG_BASE + 0x00)) +#define DPS_TEST_MODE_REG (*(vu32*)(DPS_REG_BASE + 0x04)) +#define DPS_BUFTEST_ADDR_REG (*(vu32*)(DPS_REG_BASE + 0x08)) +#define DPS_BUFTEST_DATA_REG (*(vu32*)(DPS_REG_BASE + 0x0C)) /* DP Status Read Flags */ -#define DPC_STATUS_XBUS_DMEM_DMA 0x001 -#define DPC_STATUS_FREEZE 0x002 -#define DPC_STATUS_FLUSH 0x004 -#define DPC_STATUS_START_GCLK 0x008 -#define DPC_STATUS_TMEM_BUSY 0x010 -#define DPC_STATUS_PIPE_BUSY 0x020 -#define DPC_STATUS_CMD_BUSY 0x040 -#define DPC_STATUS_CBUF_READY 0x080 -#define DPC_STATUS_DMA_BUSY 0x100 -#define DPC_STATUS_END_VALID 0x200 -#define DPC_STATUS_START_VALID 0x400 +#define DPC_STATUS_XBUS_DMEM_DMA 0x001 +#define DPC_STATUS_FREEZE 0x002 +#define DPC_STATUS_FLUSH 0x004 +#define DPC_STATUS_START_GCLK 0x008 +#define DPC_STATUS_TMEM_BUSY 0x010 +#define DPC_STATUS_PIPE_BUSY 0x020 +#define DPC_STATUS_CMD_BUSY 0x040 +#define DPC_STATUS_CBUF_READY 0x080 +#define DPC_STATUS_DMA_BUSY 0x100 +#define DPC_STATUS_END_VALID 0x200 +#define DPC_STATUS_START_VALID 0x400 /* DP Status Write Flags */ -#define DPC_CLR_XBUS_DMEM_DMA 0x0001 -#define DPC_SET_XBUS_DMEM_DMA 0x0002 -#define DPC_CLR_FREEZE 0x0004 -#define DPC_SET_FREEZE 0x0008 -#define DPC_CLR_FLUSH 0x0010 -#define DPC_SET_FLUSH 0x0020 -#define DPC_CLR_TMEM_CTR 0x0040 -#define DPC_CLR_PIPE_CTR 0x0080 -#define DPC_CLR_CMD_CTR 0x0100 -#define DPC_CLR_CLOCK_CTR 0x0200 - - -/* Functions */ - -u32 osDpGetStatus(void); -void osDpSetStatus(u32 status); +#define DPC_CLR_XBUS_DMEM_DMA 0x0001 +#define DPC_SET_XBUS_DMEM_DMA 0x0002 +#define DPC_CLR_FREEZE 0x0004 +#define DPC_SET_FREEZE 0x0008 +#define DPC_CLR_FLUSH 0x0010 +#define DPC_SET_FLUSH 0x0020 +#define DPC_CLR_TMEM_CTR 0x0040 +#define DPC_CLR_PIPE_CTR 0x0080 +#define DPC_CLR_CMD_CTR 0x0100 +#define DPC_CLR_CLOCK_CTR 0x0200 #endif diff --git a/include/ultra64/rsp.h b/include/ultra64/rsp.h index 002a0c4cc7..bc70ed938b 100644 --- a/include/ultra64/rsp.h +++ b/include/ultra64/rsp.h @@ -12,39 +12,39 @@ #define SP_STATUS_YIELD 0x080 #define SP_STATUS_YIELDED 0x100 #define SP_STATUS_TASKDONE 0x200 -//#define SP_STATUS_SIG0 0x080 -//#define SP_STATUS_SIG1 0x100 -//#define SP_STATUS_SIG2 0x200 +//#define SP_STATUS_SIG0 0x080 +//#define SP_STATUS_SIG1 0x100 +//#define SP_STATUS_SIG2 0x200 #define SP_STATUS_SIG3 0x400 #define SP_STATUS_SIG4 0x800 #define SP_STATUS_SIG5 0x1000 #define SP_STATUS_SIG6 0x2000 #define SP_STATUS_SIG7 0x4000 -#define SP_CLR_HALT 0x00001 -#define SP_SET_HALT 0x00002 -#define SP_CLR_BROKE 0x00004 -#define SP_CLR_INTR 0x00008 -#define SP_SET_INTR 0x00010 -#define SP_CLR_SSTEP 0x00020 -#define SP_SET_SSTEP 0x00040 -#define SP_CLR_INTR_BREAK 0x00080 -#define SP_SET_INTR_BREAK 0x00100 -#define SP_CLR_SIG0 0x00200 -#define SP_SET_SIG0 0x00400 -#define SP_CLR_SIG1 0x00800 -#define SP_SET_SIG1 0x01000 -#define SP_CLR_SIG2 0x02000 -#define SP_SET_SIG2 0x04000 -#define SP_CLR_SIG3 0x08000 -#define SP_SET_SIG3 0x10000 -#define SP_CLR_SIG4 0x20000 -#define SP_SET_SIG4 0x40000 -#define SP_CLR_SIG5 0x80000 -#define SP_SET_SIG5 0x100000 -#define SP_CLR_SIG6 0x200000 -#define SP_SET_SIG6 0x400000 -#define SP_CLR_SIG7 0x800000 -#define SP_SET_SIG7 0x1000000 +#define SP_CLR_HALT 0x00001 +#define SP_SET_HALT 0x00002 +#define SP_CLR_BROKE 0x00004 +#define SP_CLR_INTR 0x00008 +#define SP_SET_INTR 0x00010 +#define SP_CLR_SSTEP 0x00020 +#define SP_SET_SSTEP 0x00040 +#define SP_CLR_INTR_BREAK 0x00080 +#define SP_SET_INTR_BREAK 0x00100 +#define SP_CLR_SIG0 0x00200 +#define SP_SET_SIG0 0x00400 +#define SP_CLR_SIG1 0x00800 +#define SP_SET_SIG1 0x01000 +#define SP_CLR_SIG2 0x02000 +#define SP_SET_SIG2 0x04000 +#define SP_CLR_SIG3 0x08000 +#define SP_SET_SIG3 0x10000 +#define SP_CLR_SIG4 0x20000 +#define SP_SET_SIG4 0x40000 +#define SP_CLR_SIG5 0x80000 +#define SP_SET_SIG5 0x100000 +#define SP_CLR_SIG6 0x200000 +#define SP_SET_SIG6 0x400000 +#define SP_CLR_SIG7 0x800000 +#define SP_SET_SIG7 0x1000000 #endif diff --git a/include/ultra64/sptask.h b/include/ultra64/sptask.h index 9d74566a89..90a9626bb9 100644 --- a/include/ultra64/sptask.h +++ b/include/ultra64/sptask.h @@ -2,9 +2,11 @@ #define _ULTRA64_SPTASK_H_ /* Task Types */ +#define M_NULTASK 0 #define M_GFXTASK 1 #define M_AUDTASK 2 #define M_VIDTASK 3 +#define M_NJPEGTASK 4 #define M_HVQTASK 6 #define M_HVQMTASK 7 @@ -24,10 +26,7 @@ #define OS_YIELD_DATA_SIZE 0xC00 -/* Types */ - -typedef struct -{ +typedef struct { /* 0x00 */ u32 type; /* 0x04 */ u32 flags; @@ -61,15 +60,8 @@ typedef union typedef u32 OSYieldResult; -/* Functions */ - #define osSpTaskStart(p) \ osSpTaskLoad(p); \ osSpTaskStartGo(p); -void osSpTaskLoad(OSTask *task); -void osSpTaskStartGo(OSTask *task); -void osSpTaskYield(void); -OSYieldResult osSpTaskYielded(OSTask *task); - #endif diff --git a/include/ultra64/thread.h b/include/ultra64/thread.h index 962f0269a2..bea9dc8c96 100644 --- a/include/ultra64/thread.h +++ b/include/ultra64/thread.h @@ -1,57 +1,59 @@ #ifndef _ULTRA64_THREAD_H_ #define _ULTRA64_THREAD_H_ -/* Types */ +#define OS_PRIORITY_MAX 255 +#define OS_PRIORITY_VIMGR 254 +#define OS_PRIORITY_RMON 250 +#define OS_PRIORITY_RMONSPIN 200 +#define OS_PRIORITY_PIMGR 150 +#define OS_PRIORITY_SIMGR 140 +#define OS_PRIORITY_APPMAX 127 +#define OS_PRIORITY_IDLE 0 + +#define OS_STATE_STOPPED 1 +#define OS_STATE_RUNNABLE 2 +#define OS_STATE_RUNNING 4 +#define OS_STATE_WAITING 8 typedef s32 OSPri; typedef s32 OSId; -typedef union -{ - struct {f32 f_odd; f32 f_even;} f; -} __OSfp; +typedef union { + struct { + /* 0x00 */ f32 f_odd; + /* 0x04 */ f32 f_even; + } f; +} __OSfp; // size = 0x08 -typedef struct -{ - /* registers */ - /*0x20*/ u64 at, v0, v1, a0, a1, a2, a3; - /*0x58*/ u64 t0, t1, t2, t3, t4, t5, t6, t7; - /*0x98*/ u64 s0, s1, s2, s3, s4, s5, s6, s7; - /*0xD8*/ u64 t8, t9, gp, sp, s8, ra; - /*0x108*/ u64 lo, hi; - /*0x118*/ u32 sr, pc, cause, badvaddr, rcp; - /*0x12C*/ u32 fpcsr; - __OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14; - __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30; -} __OSThreadContext; +typedef struct { + /* 0x000 */ u64 at, v0, v1, a0, a1, a2, a3; + /* 0x038 */ u64 t0, t1, t2, t3, t4, t5, t6, t7; + /* 0x078 */ u64 s0, s1, s2, s3, s4, s5, s6, s7; + /* 0x0B8 */ u64 t8, t9, gp, sp, s8, ra; + /* 0x0E8 */ u64 lo, hi; + /* 0x0F8 */ u32 sr, pc, cause, badvaddr, rcp; + /* 0x10C */ u32 fpcsr; + /* 0x110 */ __OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14; + /* 0x150 */ __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30; +} __OSThreadContext; // size = 0x190 -typedef struct -{ - u32 flag; - u32 count; - u64 time; -} __OSThreadprofile_s; +typedef struct { + /* 0x00 */ u32 flag; + /* 0x04 */ u32 count; + /* 0x08 */ u64 time; +} __OSThreadprofile; // size = 0x10 -typedef struct OSThread_s -{ - /*0x00*/ struct OSThread_s *next; +typedef struct OSThread { + /*0x00*/ struct OSThread* next; /*0x04*/ OSPri priority; - /*0x08*/ struct OSThread_s **queue; - /*0x0C*/ struct OSThread_s *tlnext; + /*0x08*/ struct OSThread** queue; + /*0x0C*/ struct OSThread* tlnext; /*0x10*/ u16 state; /*0x12*/ u16 flags; /*0x14*/ OSId id; - /*0x18*/ int fp; - /*0x1C*/ __OSThreadprofile_s *thprof; + /*0x18*/ s32 fp; + /*0x1C*/ __OSThreadprofile* thprof; /*0x20*/ __OSThreadContext context; -} OSThread; - - -/* Functions */ - -OSId osGetThreadId(OSThread *thread); -OSPri osGetThreadPri(OSThread *thread); -void osStartThread(OSThread *thread); -void osStopThread(OSThread *thread); +} OSThread; // size = 0x1B0 #endif diff --git a/include/ultra64/time.h b/include/ultra64/time.h index ddce900b7e..8f2b7ce720 100644 --- a/include/ultra64/time.h +++ b/include/ultra64/time.h @@ -1,28 +1,17 @@ #ifndef _ULTRA64_TIME_H_ #define _ULTRA64_TIME_H_ -#include - -/* Types */ +#include "ultra64/message.h" typedef u64 OSTime; -typedef struct OSTimer_s -{ - struct OSTimer_s *next; - struct OSTimer_s *prev; - OSTime interval; - OSTime value; - OSMesgQueue *mq; - OSMesg msg; -} OSTimer; - - -/* Functions */ - -OSTime osGetTime(void); - -int osSetTimer(OSTimer *timer, OSTime countdown, OSTime interval, OSMesgQueue *mq, OSMesg msg); -s32 osStopTimer(OSTimer *timer); +typedef struct OSTimer { + /* 0x00 */ struct OSTimer* next; + /* 0x04 */ struct OSTimer* prev; + /* 0x08 */ OSTime interval; + /* 0x10 */ OSTime value; + /* 0x18 */ OSMesgQueue* mq; + /* 0x1C */ OSMesg msg; +} OSTimer; // size = 0x20 #endif diff --git a/include/ultra64/vi.h b/include/ultra64/vi.h new file mode 100644 index 0000000000..b2a84840ea --- /dev/null +++ b/include/ultra64/vi.h @@ -0,0 +1,95 @@ +#ifndef _ULTRA64_VI_H_ +#define _ULTRA64_VI_H_ + +/* Special Features */ +#define OS_VI_GAMMA_ON 0x0001 +#define OS_VI_GAMMA_OFF 0x0002 +#define OS_VI_GAMMA_DITHER_ON 0x0004 +#define OS_VI_GAMMA_DITHER_OFF 0x0008 +#define OS_VI_DIVOT_ON 0x0010 +#define OS_VI_DIVOT_OFF 0x0020 +#define OS_VI_DITHER_FILTER_ON 0x0040 +#define OS_VI_DITHER_FILTER_OFF 0x0080 + +#define OS_VI_GAMMA 0x08 +#define OS_VI_GAMMA_DITHER 0x04 +#define OS_VI_DIVOT 0x10 +#define OS_VI_DITHER_FILTER 0x10000 +#define OS_VI_UNK200 0x200 +#define OS_VI_UNK100 0x100 + +typedef struct { + /* 0x00 */ u32 ctrl; + /* 0x04 */ u32 width; + /* 0x08 */ u32 burst; + /* 0x0C */ u32 vSync; + /* 0x10 */ u32 hSync; + /* 0x14 */ u32 leap; + /* 0x18 */ u32 hStart; + /* 0x1C */ u32 xScale; + /* 0x20 */ u32 vCurrent; +} OSViCommonRegs; // size = 0x20 + +typedef struct { + /* 0x00 */ u32 origin; + /* 0x04 */ u32 yScale; + /* 0x08 */ u32 vStart; + /* 0x0C */ u32 vBurst; + /* 0x10 */ u32 vIntr; +} OSViFieldRegs; // size = 0x14 + +typedef struct { + /* 0x00 */ u8 type; + /* 0x04 */ OSViCommonRegs comRegs; + /* 0x24 */ OSViFieldRegs fldRegs[2]; +} OSViMode; // size = 0x4C + +typedef struct { + /* 0x0 */ f32 factor; + /* 0x4 */ u16 offset; + /* 0x8 */ u32 scale; +} __OSViScale; // size = 0x0C + +typedef struct { + /* 0x00 */ u16 state; + /* 0x02 */ u16 retraceCount; + /* 0x04 */ void* buffer; + /* 0x08 */ OSViMode* modep; + /* 0x0c */ u32 features; + /* 0x10 */ OSMesgQueue* mq; + /* 0x14 */ OSMesg* msg; + /* 0x18 */ __OSViScale x; + /* 0x24 */ __OSViScale y; +} OSViContext; // size = 0x30 + +#define OS_VI_NTSC_LPN1 0 /* NTSC */ +#define OS_VI_NTSC_LPF1 1 +#define OS_VI_NTSC_LAN1 2 +#define OS_VI_NTSC_LAF1 3 +#define OS_VI_NTSC_LPN2 4 +#define OS_VI_NTSC_LPF2 5 +#define OS_VI_NTSC_LAN2 6 +#define OS_VI_NTSC_LAF2 7 +#define OS_VI_NTSC_HPN1 8 +#define OS_VI_NTSC_HPF1 9 +#define OS_VI_NTSC_HAN1 10 +#define OS_VI_NTSC_HAF1 11 +#define OS_VI_NTSC_HPN2 12 +#define OS_VI_NTSC_HPF2 13 + +#define OS_VI_PAL_LPN1 14 /* PAL */ +#define OS_VI_PAL_LPF1 15 +#define OS_VI_PAL_LAN1 16 +#define OS_VI_PAL_LAF1 17 +#define OS_VI_PAL_LPN2 18 +#define OS_VI_PAL_LPF2 19 +#define OS_VI_PAL_LAN2 20 +#define OS_VI_PAL_LAF2 21 +#define OS_VI_PAL_HPN1 22 +#define OS_VI_PAL_HPF1 23 +#define OS_VI_PAL_HAN1 24 +#define OS_VI_PAL_HAF1 25 +#define OS_VI_PAL_HPN2 26 +#define OS_VI_PAL_HPF2 27 + +#endif diff --git a/include/variables.h b/include/variables.h index c13400a679..135d5c2e7a 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1,8 +1,8 @@ #ifndef _VARIABLES_H_ #define _VARIABLES_H_ -#include -#include +#include "z64.h" +#include "segment_symbols.h" extern u8 D_02000000[]; extern u8 D_02000400[]; @@ -90,7 +90,7 @@ extern u8 D_800093F0[]; extern s8 D_80009430; extern u32 D_80009460; extern u32 gDmaMgrDmaBuffSize; -extern volatile u8 gViConfigUseDefault; +extern vu8 gViConfigUseDefault; extern u8 gViConfigAdditionalScanLines; extern u32 gViConfigFeatures; extern f32 gViConfigXScale; @@ -103,13 +103,11 @@ extern u64 osClockRate; extern s32 osViClock; extern u32 __osShutdown; extern u32 __OSGlobalIntMask; -extern __osHwInt __osHwIntTable[]; extern OSThread* __osThreadTail[]; -extern OSThread *__osRunQueue; -extern OSThread *__osActiveQueue; -extern OSThread *__osRunningThread; +extern OSThread* __osRunQueue; +extern OSThread* __osActiveQueue; +extern OSThread* __osRunningThread; extern OSThread* __osFaultedThread; -extern OSMgrArgs __osPiDevMgr; extern OSPiHandle* __osPiTable; extern OSPiHandle* __osCurrentHandle[]; extern OSTimer* __osTimerList; @@ -130,7 +128,6 @@ extern OSMesgQueue __osPiAccessQueue; extern OSPiHandle __Dom1SpeedParam; extern OSPiHandle __Dom2SpeedParam; extern OSThread __osThreadSave; -extern __OSEventState __osEventStateTab[]; extern OSTimer __osBaseTimer; extern OSTime __osCurrentTime; extern u32 __osBaseCounter; @@ -578,7 +575,7 @@ extern Mtx gMtxClear; extern MtxF gMtxFClear; extern u8 D_8012DBB0; extern u32 D_8012DBC0; -extern volatile u32 gIrqMgrResetStatus; +extern vu32 gIrqMgrResetStatus; extern volatile OSTime gIrqMgrRetraceTime; extern s32 gDebugArenaLogSeverity; //extern ? sUCodeDisasGeometryModes; diff --git a/include/z64.h b/include/z64.h index 16ae69cfd3..bd7cb633a7 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1,30 +1,29 @@ #ifndef _Z64_H_ #define _Z64_H_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "ultra64.h" +#include "ultra64/gs2dex.h" +#include "z64light.h" +#include "z64actor.h" +#include "z64player.h" +#include "z64audio.h" +#include "z64object.h" +#include "z64cutscene.h" +#include "z64collision_check.h" +#include "z64scene.h" +#include "z64effect.h" +#include "z64item.h" +#include "z64animation.h" +#include "z64dma.h" +#include "z64math.h" +#include "z64transition.h" +#include "bgm.h" +#include "sfx.h" +#include "color.h" +#include "ichain.h" +#include "stdarg.h" +#include "stdlib.h" +#include "regs.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 @@ -34,6 +33,14 @@ #define REGION_JP 2 #define REGION_EU 3 +#define Z_PRIORITY_MAIN 10 +#define Z_PRIORITY_GRAPH 11 +#define Z_PRIORITY_AUDIOMGR 12 +#define Z_PRIORITY_PADMGR 14 +#define Z_PRIORITY_SCHED 15 +#define Z_PRIORITY_DMAMGR 16 +#define Z_PRIORITY_IRQMGR 17 + // NOTE: Once we start supporting other builds, this can be changed with an ifdef #define REGION_NATIVE REGION_EU @@ -301,36 +308,10 @@ typedef struct GraphicsContext { } GraphicsContext; // size = 0x300 typedef struct { - PadInput in; - union { - u16 status; - struct { - u8 errno; - u8 statusLo; - }; - }; -} PadState; - -typedef struct -{ - /* 0x00 */ PadState cur; - /* 0x06 */ PadState prev; - /* 0x0C */ PadState press; // X/Y store delta from last frame - /* 0x12 */ PadState rel; // X/Y store adjusted - /* The old version of this struct is: - RawInput raw; - u16 status; - RawInput rawPrev; - u16 statusPrev; - u16 padPressed; - s8 xDiff; - s8 yDiff; - char unk_10[0x02]; - u16 padReleased; - s8 xAdjusted; - s8 yAdjusted; - char unk_16[0x02]; - */ + /* 0x00 */ OSContPad cur; + /* 0x06 */ OSContPad prev; + /* 0x0C */ OSContPad press; // X/Y store delta from last frame + /* 0x12 */ OSContPad rel; // X/Y store adjusted } Input; // size = 0x18 typedef struct { @@ -1624,16 +1605,16 @@ typedef struct { /* 0x0078 */ IrqMgr* irqMgr; /* 0x0080 */ OSThread thread; /* 0x0230 */ Input inputs[4]; - /* 0x0290 */ PadState pads[4]; - /* 0x02A8 */ volatile u8 validCtrlrsMask; + /* 0x0290 */ OSContPad pads[4]; + /* 0x02A8 */ vu8 validCtrlrsMask; /* 0x02A9 */ u8 ncontrollers; /* 0x02AA */ u8 ctrlrIsConnected[4]; // "Key_switch" originally /* 0x02AE */ u8 pakType[4]; // 1 if rumble pack, 2 if mempak? - /* 0x02B2 */ volatile u8 rumbleEnable[4]; + /* 0x02B2 */ vu8 rumbleEnable[4]; /* 0x02B6 */ u8 rumbleCounter[4]; // not clear exact meaning /* 0x02BC */ OSPfs pfs[4]; - /* 0x045C */ volatile u8 rumbleOffFrames; - /* 0x045D */ volatile u8 rumbleOnFrames; + /* 0x045C */ vu8 rumbleOffFrames; + /* 0x045D */ vu8 rumbleOnFrames; /* 0x045E */ u8 preNMIShutdown; /* 0x0460 */ void (*retraceCallback)(void* padmgr, u32 unk464); /* 0x0464 */ u32 retraceCallbackValue; diff --git a/include/z64actor.h b/include/z64actor.h index 4630539cad..f370078f34 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -1,10 +1,10 @@ #ifndef _Z64ACTOR_H_ #define _Z64ACTOR_H_ -#include -#include -#include -#include +#include "z64dma.h" +#include "z64animation.h" +#include "z64math.h" +#include "z64collision_check.h" #define ACTOR_NUMBER_MAX 200 #define INVISIBLE_ACTOR_MAX 20 diff --git a/include/z64animation.h b/include/z64animation.h index 0fda78aa6b..a193785523 100755 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -1,10 +1,9 @@ #ifndef _Z64_ANIMATION_H #define _Z64_ANIMATION_H -#include -#include -#include -#include +#include "ultra64.h" +#include "z64dma.h" +#include "z64math.h" #define LINK_ANIMETION_OFFSET(addr,offset) (((u32)&_link_animetionSegmentRomStart)+((u32)addr)-((u32)&link_animetion_segment)+((u32)offset)) #define LIMB_DONE 0xFF @@ -200,7 +199,7 @@ typedef struct { typedef struct { /* 0x0000 */ u8* refIndex; - /* 0x0004 */ TransformData *transformData; + /* 0x0004 */ TransformData* transformData; /* 0x0008 */ s16* copyValues; /* 0x000C */ s16 unk_0C; /* 0x000E */ s16 unk_10; @@ -226,7 +225,7 @@ typedef struct { typedef struct { /* 0x0000 */ u8 limbCount; /* 0x0004 */ SkelCurveLimb** limbList; - /* 0x0008 */ TransformUpdateIndex *transUpdIdx; + /* 0x0008 */ TransformUpdateIndex* transUpdIdx; /* 0x000C */ f32 unk_0C; // seems to be unused /* 0x0010 */ f32 animFinalFrame; /* 0x0014 */ f32 animSpeed; diff --git a/include/z64audio.h b/include/z64audio.h index 68d3108bb3..bbd6b65c9e 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -459,7 +459,7 @@ typedef struct { // these bitfields should perhaps be merged into a single struct union { struct { - /*?0x00 */ volatile u8 enabled : 1; + /* 0x00 */ vu8 enabled : 1; /* 0x00 */ u8 needsInit : 1; /*?0x00 */ u8 finished : 1; /*?0x00 */ u8 envMixerNeedsInit : 1; diff --git a/include/z64collision_check.h b/include/z64collision_check.h index a510b0c9df..af8178e6c1 100644 --- a/include/z64collision_check.h +++ b/include/z64collision_check.h @@ -116,7 +116,7 @@ typedef struct { typedef struct { /* 0x00 */ Sphere16 modelSphere; // model space sphere /* 0x08 */ Sphere16 worldSphere; // world space sphere - /* 0x10 */ float scale; // world space sphere = model * scale * 0.01 + /* 0x10 */ f32 scale; // world space sphere = model * scale * 0.01 /* 0x14 */ u8 joint; } ColliderJntSphItemDim; // size = 0x18 diff --git a/include/z64cutscene.h b/include/z64cutscene.h index e8c2d32150..829af42a00 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -1,7 +1,7 @@ #ifndef _Z64CUTSCENE_H_ #define _Z64CUTSCENE_H_ -#include +#include "ultra64.h" typedef struct { /* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger diff --git a/include/z64cutscene_commands.h b/include/z64cutscene_commands.h index c11eee3c57..f09810de94 100644 --- a/include/z64cutscene_commands.h +++ b/include/z64cutscene_commands.h @@ -1,8 +1,8 @@ #ifndef _Z64CUTSCENE_CMMANDS_H_ #define _Z64CUTSCENE_CMMANDS_H_ -#include -#include +#include "command_macros_base.h" +#include "z64cutscene.h" /** * ARGS diff --git a/include/z64dma.h b/include/z64dma.h index 4c2beb37a4..e540a8633b 100755 --- a/include/z64dma.h +++ b/include/z64dma.h @@ -1,7 +1,7 @@ #ifndef _Z64_DMA_H_ #define _Z64_DMA_H_ -#include +#include "ultra64.h" typedef struct { /* 0x00 */ u32 vromAddr; // VROM address (source) diff --git a/include/z64effect.h b/include/z64effect.h index 9be304eace..dae18f92f9 100644 --- a/include/z64effect.h +++ b/include/z64effect.h @@ -1,7 +1,7 @@ #ifndef _Z64EFFECT_H_ #define _Z64EFFECT_H_ -#include +#include "color.h" struct GraphicsContext; struct GlobalContext; diff --git a/include/z64light.h b/include/z64light.h index 734ac23a7d..00f27942de 100644 --- a/include/z64light.h +++ b/include/z64light.h @@ -1,10 +1,10 @@ #ifndef _Z64LIGHT_H_ #define _Z64LIGHT_H_ -#include -#include -#include -#include +#include "ultra64.h" +#include "ultra64/gbi.h" +#include "z64math.h" +#include "color.h" typedef struct { /* 0x0 */ s16 x; diff --git a/include/z64math.h b/include/z64math.h index 099e945502..a34647a2da 100644 --- a/include/z64math.h +++ b/include/z64math.h @@ -1,7 +1,7 @@ #ifndef _Z64MATH_H_ #define _Z64MATH_H_ -#include +#include "ultra64.h" #define VEC_SET(V,X,Y,Z) V.x=X;V.y=Y;V.z=Z @@ -54,10 +54,10 @@ typedef struct { } Cylinder16; // size = 0x0C typedef struct { - f32 radius; - f32 height; - f32 yShift; - Vec3f pos; + /* 0x00 */ f32 radius; + /* 0x04 */ f32 height; + /* 0x08 */ f32 yShift; + /* 0x0C */ Vec3f pos; } Cylinderf; // size = 0x18 typedef struct { @@ -72,9 +72,9 @@ typedef struct { // Defines a point in the spherical coordinate system typedef struct { - f32 r; // radius - s16 pitch; // polar (zenith) angle - s16 yaw; // azimuthal angle + /* 0x00 */ f32 r; // radius + /* 0x04 */ s16 pitch; // polar (zenith) angle + /* 0x06 */ s16 yaw; // azimuthal angle } VecSph; // size = 0x08 #define IS_ZERO(f) (fabsf(f) < 0.008f) diff --git a/include/z64player.h b/include/z64player.h index 083cbf5c0f..7843f60886 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1,7 +1,7 @@ #ifndef _Z64PLAYER_H_ #define _Z64PLAYER_H_ -#include +#include "z64actor.h" struct Player; diff --git a/include/z64transition.h b/include/z64transition.h index ca010ec86e..563bd7eb23 100644 --- a/include/z64transition.h +++ b/include/z64transition.h @@ -1,8 +1,7 @@ #ifndef _Z64TRANSITION_H_ -#include -#include -#include +#include "ultra64.h" +#include "color.h" typedef struct { f32 unk_0; diff --git a/spec b/spec index 53f17574df..1ed41c6abb 100644 --- a/spec +++ b/spec @@ -411,8 +411,8 @@ beginseg include "build/src/code/code_800E11F0.o" include "build/data/code_800E11F0.data.o" include "build/data/code_800E11F0.rodata.o" - include "build/src/libultra_code/code_800E6840.o" - include "build/src/libultra_code/osAiSetNextBuffer.o" + include "build/src/libultra_code_O2/code_800E6840.o" + include "build/src/libultra_code_O2/osAiSetNextBuffer.o" include "build/src/code/audio_playback.o" include "build/src/code/audio_effects.o" include "build/data/audio_effects.data.o" @@ -442,71 +442,71 @@ beginseg include "build/src/code/sleep.o" include "build/src/code/jpegutils.o" include "build/src/code/jpegdecoder.o" - include "build/src/libultra_code/osPfsFreeBlocks.o" + include "build/src/libultra_code_O2/osPfsFreeBlocks.o" include "build/asm/guScale.o" - include "build/src/libultra_code/sinf.o" - include "build/src/libultra_code/sins.o" - include "build/src/libultra_code/sptask.o" - include "build/src/libultra_code/osRumblePak.o" - include "build/src/libultra_code/__osSiCreateAccessQueue.o" - include "build/src/libultra_code/osContInit.o" - include "build/src/libultra_code/osContStartReadData.o" - include "build/src/libultra_code/guPerspectiveF.o" - include "build/src/libultra_code/__osSpRawStartDma.o" - include "build/src/libultra_code/__osSiRawStartDma.o" - include "build/src/libultra_code/osSpTaskYield.o" - include "build/src/libultra_code/pfsreadwritefile.o" - include "build/src/libultra_code/__osPfsGetStatus.o" + include "build/src/libultra_code_O2/sinf.o" + include "build/src/libultra_code_O2/sins.o" + include "build/src/libultra_code_O2/sptask.o" + include "build/src/libultra_code_O2/osRumblePak.o" + include "build/src/libultra_code_O2/__osSiCreateAccessQueue.o" + include "build/src/libultra_code_O2/osContInit.o" + include "build/src/libultra_code_O2/osContStartReadData.o" + include "build/src/libultra_code_O2/guPerspectiveF.o" + include "build/src/libultra_code_O2/__osSpRawStartDma.o" + include "build/src/libultra_code_O2/__osSiRawStartDma.o" + include "build/src/libultra_code_O2/osSpTaskYield.o" + include "build/src/libultra_code_O2/pfsreadwritefile.o" + include "build/src/libultra_code_O2/__osPfsGetStatus.o" include "build/asm/guMtxIdentF.o" - include "build/src/libultra_code/guLookAt.o" - include "build/src/libultra_code/pfsallocatefile.o" - include "build/src/libultra_code/osStopTimer.o" - include "build/src/libultra_code/contpfs.o" - include "build/src/libultra_code/code_80102FA0.o" - include "build/src/libultra_code/osPfsFindFile.o" - include "build/src/libultra_code/sqrtf.o" - include "build/src/libultra_code/osAfterPreNMI.o" - include "build/src/libultra_code/contquery.o" - include "build/src/libultra_code/guLookAtHilite.o" - include "build/src/libultra_code/sp.o" + include "build/src/libultra_code_O2/guLookAt.o" + include "build/src/libultra_code_O2/pfsallocatefile.o" + include "build/src/libultra_code_O1/osStopTimer.o" + include "build/src/libultra_code_O2/contpfs.o" + include "build/src/libultra_code_O2/code_80102FA0.o" + include "build/src/libultra_code_O2/osPfsFindFile.o" + include "build/src/libultra_code_O2/sqrtf.o" + include "build/src/libultra_code_O2/osAfterPreNMI.o" + include "build/src/libultra_code_O2/contquery.o" + include "build/src/libultra_code_O2/guLookAtHilite.o" + include "build/src/libultra_code_O2/sp.o" include "build/asm/guMtxIdent.o" - include "build/src/libultra_code/guPosition.o" - include "build/src/libultra_code/osSpTaskYielded.o" - include "build/src/libultra_code/rotate.o" - include "build/src/libultra_code/osAiSetFrequency.o" - include "build/src/libultra_code/__osGetActiveQueue.o" + include "build/src/libultra_code_O2/guPosition.o" + include "build/src/libultra_code_O2/osSpTaskYielded.o" + include "build/src/libultra_code_O2/rotate.o" + include "build/src/libultra_code_O2/osAiSetFrequency.o" + include "build/src/libultra_code_O2/__osGetActiveQueue.o" include "build/asm/guNormalize.o" - include "build/src/libultra_code/osDpGetStatus.o" - include "build/src/libultra_code/osDpSetStatus.o" - include "build/src/libultra_code/osPfsDeleteFile.o" - include "build/src/libultra_code/ortho.o" - include "build/src/libultra_code/cosf.o" + include "build/src/libultra_code_O2/osDpGetStatus.o" + include "build/src/libultra_code_O2/osDpSetStatus.o" + include "build/src/libultra_code_O2/osPfsDeleteFile.o" + include "build/src/libultra_code_O2/ortho.o" + include "build/src/libultra_code_O2/cosf.o" include "build/data/__libm_qnan_f.rodata.o" - include "build/src/libultra_code/coss.o" - include "build/src/libultra_code/osViSetEvent.o" - include "build/src/libultra_code/osPfsIsPlug.o" - include "build/src/libultra_code/guS2DInitBg.o" - include "build/src/libultra_code/__osPfsSelectBank.o" - include "build/src/libultra_code/osContSetCh.o" - include "build/src/libultra_code/code_80104D60.o" - include "build/src/libultra_code/pfsinitpak.o" - include "build/src/libultra_code/pfschecker.o" - include "build/src/libultra_code/osAiGetLength.o" + include "build/src/libultra_code_O2/coss.o" + include "build/src/libultra_code_O2/osViSetEvent.o" + include "build/src/libultra_code_O2/osPfsIsPlug.o" + include "build/src/libultra_code_O2/guS2DInitBg.o" + include "build/src/libultra_code_O2/__osPfsSelectBank.o" + include "build/src/libultra_code_O2/osContSetCh.o" + include "build/src/libultra_code_O2/code_80104D60.o" + include "build/src/libultra_code_O2/pfsinitpak.o" + include "build/src/libultra_code_O2/pfschecker.o" + include "build/src/libultra_code_O2/osAiGetLength.o" include "build/asm/guTranslate.o" - include "build/src/libultra_code/__osContRamWrite.o" - include "build/src/libultra_code/__osContRamRead.o" - include "build/src/libultra_code/__osContAddressCrc.o" - include "build/src/libultra_code/osSetTimer.o" - include "build/src/libultra_code/__osSpGetStatus.o" - include "build/src/libultra_code/__osSpSetStatus.o" + include "build/src/libultra_code_O2/__osContRamWrite.o" + include "build/src/libultra_code_O2/__osContRamRead.o" + include "build/src/libultra_code_O2/__osContAddressCrc.o" + include "build/src/libultra_code_O1/osSetTimer.o" + include "build/src/libultra_code_O2/__osSpGetStatus.o" + include "build/src/libultra_code_O2/__osSpSetStatus.o" include "build/asm/osWritebackDCacheAll.o" - include "build/src/libultra_code/__osGetCurrFaultedThread.o" + include "build/src/libultra_code_O2/__osGetCurrFaultedThread.o" include "build/asm/guMtxF2L.o" - include "build/src/libultra_code/llcvt.o" - include "build/src/libultra_code/osViGetCurrentFramebuffer.o" - include "build/src/libultra_code/__osSpSetPc.o" - include "build/src/libultra_code/sqrt.o" - include "build/src/libultra_code/absf.o" + include "build/src/libultra_code_O1/llcvt.o" + include "build/src/libultra_code_O2/osViGetCurrentFramebuffer.o" + include "build/src/libultra_code_O2/__osSpSetPc.o" + include "build/src/libultra_code_O2_g3/sqrt.o" + include "build/src/libultra_code_O2_g3/absf.o" include "build/src/code/code_801067F0.o" include "build/src/code/code_80106860.o" include "build/src/code/code_801068B0.o" diff --git a/src/boot/assert.c b/src/boot/assert.c index 00dcd4f344..9ab6df2e12 100644 --- a/src/boot/assert.c +++ b/src/boot/assert.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void __assert(const char* exp, const char* file, s32 line) { char msg[256]; diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index 250060bcf7..b6d1ceeb3a 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" StackEntry sBootThreadInfo; OSThread sIdleThread; @@ -25,6 +24,6 @@ void bootproc(void) { Locale_Init(); StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, sIdleThreadStack + sizeof(sIdleThreadStack), 0, 256, "idle"); - osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack + sizeof(sIdleThreadStack), 10); + osCreateThread(&sIdleThread, 1, Idle_ThreadEntry, 0, sIdleThreadStack + sizeof(sIdleThreadStack), Z_PRIORITY_MAIN); osStartThread(&sIdleThread); } diff --git a/src/boot/idle.c b/src/boot/idle.c index 0a15c24396..7723b26333 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" OSThread gMainThread; u8 sMainStack[0x900]; @@ -11,7 +10,7 @@ OSViMode gViConfigMode; u8 D_80013960; s8 D_80009430 = 1; -u8 volatile gViConfigUseDefault = 1; +vu8 gViConfigUseDefault = 1; u8 gViConfigAdditionalScanLines = 0; u32 gViConfigFeatures = OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF; f32 gViConfigXScale = 1.0; @@ -21,7 +20,7 @@ void Main_ThreadEntry(void* arg0) { OSTime var1; osSyncPrintf("mainx 実行開始\n"); - DmaMgr_Start(); + DmaMgr_Init(); osSyncPrintf("codeセグメントロード中..."); var1 = osGetTime(); DmaMgr_SendRequest1(_codeSegmentStart, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart, @@ -50,7 +49,7 @@ void Idle_ThreadEntry(void* a0) { osSyncPrintf("オーディオヒープのサイズは %d キロバイトです\n", ((s32)gSystemHeap - (s32)gAudioHeap) / 1024); osSyncPrintf(VT_RST); - osCreateViManager(0xFE); + osCreateViManager(OS_PRIORITY_VIMGR); gViConfigFeatures = 0x42; gViConfigXScale = 1.0f; @@ -79,11 +78,11 @@ void Idle_ThreadEntry(void* a0) { ViConfig_UpdateVi(1); osViBlack(1); osViSwapBuffer(0x803DA80); //! @bug Invalid vram address (probably intended to be 0x803DA800) - osCreatePiManager(150, &gPiMgrCmdQ, sPiMgrCmdBuff, 50); + osCreatePiManager(OS_PRIORITY_PIMGR, &gPiMgrCmdQ, sPiMgrCmdBuff, 50); StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 0x400, "main"); - osCreateThread(&gMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), 10); + osCreateThread(&gMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), Z_PRIORITY_MAIN); osStartThread(&gMainThread); - osSetThreadPri(NULL, 0); + osSetThreadPri(NULL, OS_PRIORITY_IDLE); while (1) { ; diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index 6214545275..d24c5887f0 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" OSPiHandle* sISVHandle; // official name : is_Handle diff --git a/src/boot/logutils.c b/src/boot/logutils.c index 693109d324..e94b60dcc2 100644 --- a/src/boot/logutils.c +++ b/src/boot/logutils.c @@ -1,9 +1,8 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" -float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, - float var2, const char* var3Name, float var3) { +f32 LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, f32 var1, const char* var2Name, f32 var2, + const char* var3Name, f32 var3) { if (var1 < var2 || var3 < var1) { osSyncPrintf("%s %d: range error %s(%f) < %s(%f) < %s(%f)\n", exp, arg1, var2Name, var2, var1Name, var1, var3Name, var3); @@ -90,7 +89,6 @@ void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 } } -// check valid pointer void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line) { u32 ptr = (u32)ptr0; if (!ptr || ptr < 0x80000000U || (0x80000000U + osMemSize) <= ptr) { diff --git a/src/boot/stackcheck.c b/src/boot/stackcheck.c index 2ea3fad41b..fa7e958359 100644 --- a/src/boot/stackcheck.c +++ b/src/boot/stackcheck.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" StackEntry* sStackInfoListStart = NULL; StackEntry* sStackInfoListEnd = NULL; diff --git a/src/boot/viconfig.c b/src/boot/viconfig.c index a31aa45371..b394833963 100644 --- a/src/boot/viconfig.c +++ b/src/boot/viconfig.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" // this should probably go elsewhere but right now viconfig.o is the only object between idle and z_std_dma OSPiHandle* gCartHandle = 0; diff --git a/src/boot/yaz0.c b/src/boot/yaz0.c index 379d4ca467..ee304fce40 100644 --- a/src/boot/yaz0.c +++ b/src/boot/yaz0.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" u8 sYaz0DataBuffer[0x400]; u32 sYaz0CurDataEnd; diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index 900a94afac..09fff3b758 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" u32 gCurrentRegion = 0; LocaleCartInfo sCartInfo; diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index aec911a3d4..0ac63c3979 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" StackEntry sDmaMgrStackInfo; OSMesgQueue sDmaMgrMsgQueue; @@ -1815,9 +1814,9 @@ void DmaMgr_ProcessMsg(DmaRequest* req) { "圧縮されたセグメントの一部だけをDMA転送することはできません"); } - osSetThreadPri(NULL, 0x0A); + osSetThreadPri(NULL, Z_PRIORITY_MAIN); Yaz0_Decompress(romStart, ram, romSize); - osSetThreadPri(NULL, 0x10); + osSetThreadPri(NULL, Z_PRIORITY_DMAMGR); found = true; " Press ROM:%X RAM:%X SIZE:%X\n"; @@ -1910,7 +1909,7 @@ s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size) { return 0; } -void DmaMgr_Start() { +void DmaMgr_Init() { const char** name; s32 idx; DmaEntry* iter; @@ -1952,7 +1951,8 @@ void DmaMgr_Start() { osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, sizeof(sDmaMgrMsgs) / sizeof(sDmaMgrMsgs[0])); StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack + sizeof(sDmaMgrStack), 0, 0x100, "dmamgr"); - osCreateThread(&sDmaMgrThread, 0x12, &DmaMgr_ThreadEntry, 0, sDmaMgrStack + sizeof(sDmaMgrStack), 0x10); + osCreateThread(&sDmaMgrThread, 0x12, &DmaMgr_ThreadEntry, 0, sDmaMgrStack + sizeof(sDmaMgrStack), + Z_PRIORITY_DMAMGR); osStartThread(&sDmaMgrThread); } diff --git a/src/buffers/gfxbuffers.c b/src/buffers/gfxbuffers.c index 9a538bf311..13206fe2b5 100644 --- a/src/buffers/gfxbuffers.c +++ b/src/buffers/gfxbuffers.c @@ -1,4 +1,4 @@ -#include +#include "z64.h" // 0x18000 bytes u64 gGfxSPTaskOutputBuffer[0x3000]; diff --git a/src/buffers/heaps.c b/src/buffers/heaps.c index e5f9a99435..e39afc33f4 100644 --- a/src/buffers/heaps.c +++ b/src/buffers/heaps.c @@ -1,4 +1,4 @@ -#include +#include "z64.h" // 0x38000 bytes u8 gAudioHeap[0x38000]; diff --git a/src/buffers/zbuffer.c b/src/buffers/zbuffer.c index 49cf0d8d85..555d9fdd72 100644 --- a/src/buffers/zbuffer.c +++ b/src/buffers/zbuffer.c @@ -1,4 +1,4 @@ -#include +#include "z64.h" // 0x25800 bytes u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; diff --git a/src/code/PreRender.c b/src/code/PreRender.c index c0d0eb9232..94afbafb73 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void PreRender_SetValuesSave(PreRenderContext* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg) { this->widthSave = width; diff --git a/src/code/TwoHeadArena.c b/src/code/TwoHeadArena.c index 23cfa00f81..fa2a6aafd3 100644 --- a/src/code/TwoHeadArena.c +++ b/src/code/TwoHeadArena.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) { THA_Ct((TwoHeadArena*)thga, start, size); diff --git a/src/code/__osMalloc.c b/src/code/__osMalloc.c index 6b4d84eafe..5a304171bf 100644 --- a/src/code/__osMalloc.c +++ b/src/code/__osMalloc.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "vt.h" #define FILL_ALLOCBLOCK (1 << 0) #define FILL_FREEBLOCK (1 << 1) diff --git a/src/code/audioMgr.c b/src/code/audioMgr.c index cdec774cba..2d3a12248d 100644 --- a/src/code/audioMgr.c +++ b/src/code/audioMgr.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void func_800C3C80(AudioMgr* audioMgr) { Sub_AudioMgr_18* sub; @@ -91,7 +90,7 @@ void AudioMgr_Unlock(AudioMgr* audioMgr) { osRecvMesg(&audioMgr->unk_C8, NULL, OS_MESG_BLOCK); } -void AudioMgr_Start(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr) { +void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr) { bzero(audioMgr, sizeof(AudioMgr)); audioMgr->sched = sched; diff --git a/src/code/audio_effects.c b/src/code/audio_effects.c index 41f7277718..45d267fb07 100644 --- a/src/code/audio_effects.c +++ b/src/code/audio_effects.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" void Audio_SequenceChannelProcessSound(SequenceChannel* seqChannel, s32 recalculateVolume, s32 b) { f32 channelVolume; diff --git a/src/code/audio_heap.c b/src/code/audio_heap.c index 974f5eb561..9ecc9d29c3 100644 --- a/src/code/audio_heap.c +++ b/src/code/audio_heap.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" f32 func_800DDE20(f32 arg0) { return 256.0f * gAudioContext.gAudioBufferParameters.unkUpdatesPerFrameScaled / arg0; diff --git a/src/code/audio_playback.c b/src/code/audio_playback.c index d5e71ff9c6..e79e9e06be 100644 --- a/src/code/audio_playback.c +++ b/src/code/audio_playback.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void Audio_NoteSetVelPanReverb(Note* note, NoteSubEu* sub, Reverb* reverb) { f32 volRight, volLeft; diff --git a/src/code/audio_seqplayer.c b/src/code/audio_seqplayer.c index 0092249b20..dc13c246d7 100644 --- a/src/code/audio_seqplayer.c +++ b/src/code/audio_seqplayer.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #define PORTAMENTO_IS_SPECIAL(x) ((x).mode & 0x80) #define PORTAMENTO_MODE(x) ((x).mode & ~0x80) diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 0c15155b85..29eaae1e16 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_800430A0/func_800430A0.s") diff --git a/src/code/code_80043480.c b/src/code/code_80043480.c index ddd8d0e994..54f422a6f3 100644 --- a/src/code/code_80043480.c +++ b/src/code/code_80043480.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags) { dynaActor->dynaPolyId = -1; diff --git a/src/code/code_80069420.c b/src/code/code_80069420.c index ee9a179d7d..3d656cfb0b 100644 --- a/src/code/code_80069420.c +++ b/src/code/code_80069420.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void* MemCopy(void* dest, void* src, s32 size) { u8* destu = (u8*)dest; diff --git a/src/code/code_8006BA00.c b/src/code/code_8006BA00.c index ee5677ad33..768ece14f3 100644 --- a/src/code/code_8006BA00.c +++ b/src/code/code_8006BA00.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void func_8006BA00(GlobalContext* globalCtx) { SoundSource* sources = &globalCtx->soundSources[0]; diff --git a/src/code/code_8006C3A0.c b/src/code/code_8006C3A0.c index 7898695987..341a445956 100644 --- a/src/code/code_8006C3A0.c +++ b/src/code/code_8006C3A0.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void Flags_UnsetAllEnv(GlobalContext* globalCtx) { u8 i; diff --git a/src/code/code_8006C510.c b/src/code/code_8006C510.c index 8e9f28322a..833009e814 100644 --- a/src/code/code_8006C510.c +++ b/src/code/code_8006C510.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" f32 func_8006C510(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) { char pad[0x1C]; diff --git a/src/code/code_8008E6A0.c b/src/code/code_8008E6A0.c index 6a1fe8c319..47d437e987 100644 --- a/src/code/code_8008E6A0.c +++ b/src/code/code_8008E6A0.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void func_8008E6A0(SubGlobalContext7B8* this) { this->counter = 0; @@ -6,20 +6,20 @@ void func_8008E6A0(SubGlobalContext7B8* this) { } u32 func_8008E6AC(SubGlobalContext7B8* this, Input* input) { - if (CHECK_PAD(input->cur, R_TRIG) && CHECK_PAD(input->press, D_JPAD)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_R) && CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { this->toggle = !this->toggle; } if (!this->toggle) { goto ret_true; } - if (CHECK_PAD(input->cur, Z_TRIG)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_Z)) { - if (CHECK_PAD(input->press, R_TRIG)) { + if (CHECK_BTN_ALL(input->press.button, BTN_R)) { goto ret_true; } - if (CHECK_PAD(input->cur, R_TRIG)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_R)) { this->counter++; if (this->counter >= 9) { goto ret_true; diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index 882d422d1a..b61559de60 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // Bit Flag array in which gBitFlags[n] is literally (1 << n) u32 gBitFlags[] = { diff --git a/src/code/code_800A9D40.c b/src/code/code_800A9D40.c index c32d31d4e6..17660b74e8 100644 --- a/src/code/code_800A9D40.c +++ b/src/code/code_800A9D40.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" typedef struct { /* 0x00 */ OSPiHandle piHandle; diff --git a/src/code/code_800A9F30.c b/src/code/code_800A9F30.c index f7d16a56a2..fd8d220e2f 100644 --- a/src/code/code_800A9F30.c +++ b/src/code/code_800A9F30.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" UnkRumbleStruct D_80160FD0; diff --git a/src/code/code_800ACE70.c b/src/code/code_800ACE70.c index ebb93da34c..88e86014a9 100644 --- a/src/code/code_800ACE70.c +++ b/src/code/code_800ACE70.c @@ -1,4 +1,4 @@ -#include +#include "global.h" // Note : This file is related to z_vismono, the original name was probably z_vis diff --git a/src/code/code_800AD920.c b/src/code/code_800AD920.c index 5123960068..2fbd7c452c 100644 --- a/src/code/code_800AD920.c +++ b/src/code/code_800AD920.c @@ -1,4 +1,4 @@ -#include +#include "global.h" // Note : This file is related to z_vismono, the original name was probably z_vis diff --git a/src/code/code_800BB0A0.c b/src/code/code_800BB0A0.c index f5e8a21708..8d9f37b4a5 100644 --- a/src/code/code_800BB0A0.c +++ b/src/code/code_800BB0A0.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_800BB0A0/func_800BB0A0.s") diff --git a/src/code/code_800C3C20.c b/src/code/code_800C3C20.c index 714de72549..bfe37bdfb2 100644 --- a/src/code/code_800C3C20.c +++ b/src/code/code_800C3C20.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u8 D_8012D200[] = { 0, 1, 2, 3, 4, 5, 6, diff --git a/src/code/code_800D2E30.c b/src/code/code_800D2E30.c index e7e67f0a07..ebf03760e2 100644 --- a/src/code/code_800D2E30.c +++ b/src/code/code_800D2E30.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void func_800D2E30(UnkRumbleStruct* arg0) { s32 i; diff --git a/src/code/code_800D31A0.c b/src/code/code_800D31A0.c index ec5b7a9b05..4f6b9f8c0f 100644 --- a/src/code/code_800D31A0.c +++ b/src/code/code_800D31A0.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "vt.h" extern PadMgr gPadMgr; diff --git a/src/code/code_800DACC0.c b/src/code/code_800DACC0.c index 05fe08763c..10ebbce752 100644 --- a/src/code/code_800DACC0.c +++ b/src/code/code_800DACC0.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_800DACC0/pad_800DACB0.s") diff --git a/src/code/code_800E11F0.c b/src/code/code_800E11F0.c index 0cf0be4fac..3cf45a3ed7 100644 --- a/src/code/code_800E11F0.c +++ b/src/code/code_800E11F0.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" // like audio_load in sm64, but completely rewritten diff --git a/src/code/code_800EC960.c b/src/code/code_800EC960.c index d509867af6..962e73557b 100644 --- a/src/code/code_800EC960.c +++ b/src/code/code_800EC960.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_800EC960/func_800EC960.s") diff --git a/src/code/code_800F7260.c b/src/code/code_800F7260.c index c556781d85..e2f087821a 100644 --- a/src/code/code_800F7260.c +++ b/src/code/code_800F7260.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_800F7260/func_800F7260.s") diff --git a/src/code/code_800F9280.c b/src/code/code_800F9280.c index a00535ea15..347d8270d6 100644 --- a/src/code/code_800F9280.c +++ b/src/code/code_800F9280.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_800F9280/func_800F9280.s") diff --git a/src/code/code_800FBCE0.c b/src/code/code_800FBCE0.c index 2c17e6fa28..65156eda09 100644 --- a/src/code/code_800FBCE0.c +++ b/src/code/code_800FBCE0.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define printSpStatus(x, name) \ if (x & SP_STATUS_##name) \ diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c index 48fcf48a57..d1bb1f36d3 100644 --- a/src/code/code_800FC620.c +++ b/src/code/code_800FC620.c @@ -1,4 +1,4 @@ -#include +#include "global.h" typedef void (*arg3_800FC868)(void*); typedef void (*arg3_800FC8D8)(void*, u32); diff --git a/src/code/code_800FCE80.c b/src/code/code_800FCE80.c index 5180c24447..2acf1ed022 100644 --- a/src/code/code_800FCE80.c +++ b/src/code/code_800FCE80.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "fp.h" s32 use_cfrac; diff --git a/src/code/code_800FD970.c b/src/code/code_800FD970.c index ae2d5916d1..04d5f81188 100644 --- a/src/code/code_800FD970.c +++ b/src/code/code_800FD970.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // The latest generated random number, used to generate the next number in the sequence. static u32 sRandInt = 1; diff --git a/src/code/code_801067F0.c b/src/code/code_801067F0.c index b895ee360c..ae65e522ba 100644 --- a/src/code/code_801067F0.c +++ b/src/code/code_801067F0.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // fmodf? f32 func_801067F0(f32 arg0, f32 arg1) { diff --git a/src/code/code_80106860.c b/src/code/code_80106860.c index 9d862014fb..4c1b8480b5 100644 --- a/src/code/code_80106860.c +++ b/src/code/code_80106860.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // memset used in __osMalloc, z_quake, z_view, and z_camera void* func_80106860(void* ptr, s32 val, size_t size) { diff --git a/src/code/code_801068B0.c b/src/code/code_801068B0.c index bf3ae57447..da6f94883b 100644 --- a/src/code/code_801068B0.c +++ b/src/code/code_801068B0.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // memcpy used in __osMalloc.c void* func_801068B0(void* dst, void* src, size_t size) { diff --git a/src/code/code_80110450.c b/src/code/code_80110450.c index d312881ba9..828d757a2e 100644 --- a/src/code/code_80110450.c +++ b/src/code/code_80110450.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_80110450/func_80110450.s") diff --git a/src/code/db_camera.c b/src/code/db_camera.c index b693051d9a..fc97d1ebd6 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B3B50.s") diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index 69a4d93622..827f10a40d 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 diff --git a/src/code/fault.c b/src/code/fault.c index 7520165f4b..2dcea2667d 100644 --- a/src/code/fault.c +++ b/src/code/fault.c @@ -1,9 +1,6 @@ -#include -#include -#include -#include -#include -#include +#include "global.h" +#include "vt.h" +#include "alloca.h" // data const char* sExceptionNames[] = { @@ -72,7 +69,8 @@ void Fault_ProcessClientContext(FaultClientContext* ctx) { if (sFaultStructPtr->currClientThreadSp != 0) { thread = alloca(sizeof(OSThread)); - osCreateThread(thread, 2, Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, 0x7E); + osCreateThread(thread, 2, Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, + OS_PRIORITY_APPMAX - 1); osStartThread(thread); } else { Fault_ClientProcessThread(ctx); @@ -287,9 +285,9 @@ u32 Fault_WaitForInputImpl() { Fault_Sleep(0x10); Fault_UpdatePadImpl(); - kDown = curInput->press.in.button; + kDown = curInput->press.button; - if (kDown == L_TRIG) { + if (kDown == BTN_L) { sFaultStructPtr->faultActive = !sFaultStructPtr->faultActive; } @@ -298,19 +296,19 @@ u32 Fault_WaitForInputImpl() { return false; } } else { - if (kDown == A_BUTTON || kDown == R_JPAD) { + if (kDown == BTN_A || kDown == BTN_DRIGHT) { return false; } - if (kDown == L_JPAD) { + if (kDown == BTN_DLEFT) { return true; } - if (kDown == U_JPAD) { + if (kDown == BTN_DUP) { FaultDrawer_SetOsSyncPrintfEnabled(true); } - if (kDown == D_JPAD) { + if (kDown == BTN_DDOWN) { FaultDrawer_SetOsSyncPrintfEnabled(false); } } @@ -557,8 +555,8 @@ void Fault_WaitForButtonCombo() { Fault_Sleep(0x10); Fault_UpdatePadImpl(); - kDown = curInput->press.in.button; - kCur = curInput->cur.in.button; + kDown = curInput->press.button; + kCur = curInput->cur.button; if ((kCur == 0) && (s1 == s2)) { s1 = 0; @@ -569,20 +567,20 @@ void Fault_WaitForButtonCombo() { switch (state) { case 0: - if (kCur == (Z_TRIG | L_TRIG | R_TRIG) && kDown == Z_TRIG) { + if (kCur == (BTN_Z | BTN_L | BTN_R) && kDown == BTN_Z) { state = s2; s1 = s2; } break; case 1: - if (kDown == U_JPAD) { + if (kDown == BTN_DUP) { state = 2; } else { state = 0; } break; case 2: - if (kDown == D_CBUTTONS) { + if (kDown == BTN_CDOWN) { state = 3; s1 = s2; } else { @@ -590,14 +588,14 @@ void Fault_WaitForButtonCombo() { } break; case 3: - if (kDown == U_CBUTTONS) { + if (kDown == BTN_CUP) { state = 4; } else { state = 0; } break; case 4: - if (kDown == D_JPAD) { + if (kDown == BTN_DDOWN) { state = 5; s1 = s2; } else { @@ -605,14 +603,14 @@ void Fault_WaitForButtonCombo() { } break; case 5: - if (kDown == L_JPAD) { + if (kDown == BTN_DLEFT) { state = 6; } else { state = 0; } break; case 6: - if (kDown == L_CBUTTONS) { + if (kDown == BTN_CLEFT) { state = 7; s1 = s2; } else { @@ -620,14 +618,14 @@ void Fault_WaitForButtonCombo() { } break; case 7: - if (kDown == R_CBUTTONS) { + if (kDown == BTN_CRIGHT) { state = 8; } else { state = 0; } break; case 8: - if (kDown == R_JPAD) { + if (kDown == BTN_DRIGHT) { state = 9; s1 = s2; } else { @@ -635,32 +633,32 @@ void Fault_WaitForButtonCombo() { } break; case 9: - if (kDown == (A_BUTTON | B_BUTTON)) { + if (kDown == (BTN_A | BTN_B)) { state = 10; - } else if (kDown == A_BUTTON) { + } else if (kDown == BTN_A) { state = 0x5B; - } else if (kDown == B_BUTTON) { + } else if (kDown == BTN_B) { state = 0x5C; } else { state = 0; } break; case 0x5B: - if (kDown == B_BUTTON) { + if (kDown == BTN_B) { state = 10; } else { state = 0; } break; case 0x5C: - if (kDown == A_BUTTON) { + if (kDown == BTN_A) { state = 10; } else { state = 0; } break; case 10: - if (kDown == START_BUTTON) { + if (kDown == BTN_START) { state = 11; } else { state = 0; @@ -733,7 +731,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) { count--; Fault_Sleep(0x10); Fault_UpdatePadImpl(); - if (CHECK_PAD(curInput->press, L_TRIG)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_L)) { sFaultStructPtr->faultActive = false; } } @@ -741,40 +739,40 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) { do { Fault_Sleep(0x10); Fault_UpdatePadImpl(); - } while (curInput->press.in.button == 0); + } while (curInput->press.button == 0); - if (CHECK_PAD(curInput->press, START_BUTTON) || CHECK_PAD(curInput->cur, A_BUTTON)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_START) || CHECK_BTN_ALL(curInput->cur.button, BTN_A)) { return; } off = 0x10; - if (CHECK_PAD(curInput->cur, Z_TRIG)) { + if (CHECK_BTN_ALL(curInput->cur.button, BTN_Z)) { off = 0x100; } - if (CHECK_PAD(curInput->cur, B_BUTTON)) { + if (CHECK_BTN_ALL(curInput->cur.button, BTN_B)) { off <<= 8; } - if (CHECK_PAD(curInput->press, U_JPAD)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_DUP)) { addr -= off; } - if (CHECK_PAD(curInput->press, D_JPAD)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_DDOWN)) { addr += off; } - if (CHECK_PAD(curInput->press, U_CBUTTONS)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_CUP)) { addr = pc; } - if (CHECK_PAD(curInput->press, D_CBUTTONS)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_CDOWN)) { addr = sp; } - if (CHECK_PAD(curInput->press, L_CBUTTONS)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_CLEFT)) { addr = unk0; } - if (CHECK_PAD(curInput->press, R_CBUTTONS)) { + if (CHECK_BTN_ALL(curInput->press.button, BTN_CRIGHT)) { addr = unk1; } - } while (!CHECK_PAD(curInput->press, L_TRIG)); + } while (!CHECK_BTN_ALL(curInput->press.button, BTN_L)); sFaultStructPtr->faultActive = true; } @@ -1023,7 +1021,7 @@ void Fault_SetFB(void* fb, u16 w, u16 h) { FaultDrawer_SetDrawerFB(fb, w, h); } -void Fault_Start(void) { +void Fault_Init(void) { sFaultStructPtr = &gFaultStruct; bzero(sFaultStructPtr, sizeof(FaultThreadStruct)); FaultDrawer_SetDefault(); @@ -1038,7 +1036,8 @@ void Fault_Start(void) { gFaultStruct.faultHandlerEnabled = true; osCreateMesgQueue(&sFaultStructPtr->queue, &sFaultStructPtr->msg, 1); StackCheck_Init(&sFaultThreadInfo, &sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, "fault"); - osCreateThread(&sFaultStructPtr->thread, 2, &Fault_ThreadEntry, 0, sFaultStack + sizeof(sFaultStack), 0x7f); + osCreateThread(&sFaultStructPtr->thread, 2, &Fault_ThreadEntry, 0, sFaultStack + sizeof(sFaultStack), + OS_PRIORITY_APPMAX); osStartThread(&sFaultStructPtr->thread); } diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c index 9a4a81be1b..32c10cb888 100644 --- a/src/code/fault_drawer.c +++ b/src/code/fault_drawer.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" // rodata const u32 sFaultDrawerFont[] = { diff --git a/src/code/flg_set.c b/src/code/flg_set.c index 966c39ba2d..44707957ad 100644 --- a/src/code/flg_set.c +++ b/src/code/flg_set.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void FlagSet_Update(GlobalContext* globalCtx) { static s32 entryIdx = 0; @@ -76,35 +75,35 @@ void FlagSet_Update(GlobalContext* globalCtx) { } } - if (CHECK_PAD(input->press, L_JPAD)) { + if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { timer = 10; curBit++; } - if (CHECK_PAD(input->press, R_JPAD)) { + if (CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { curBit--; timer = 10; } if (timer == 0) { - if (CHECK_PAD(input->cur, L_JPAD)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) { curBit++; timer = 2; } - if (CHECK_PAD(input->cur, R_JPAD)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT)) { curBit--; timer = 2; } } curBit %= 16; - if (CHECK_PAD(input->press, U_JPAD)) { + if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) { entryIdx--; if (entryIdx < 0) { entryIdx = 0; } timer = 10; } - if (CHECK_PAD(input->press, D_JPAD)) { + if (CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { timer = 10; entryIdx++; if (!entries[entryIdx].value) { @@ -113,14 +112,14 @@ void FlagSet_Update(GlobalContext* globalCtx) { } if (timer == 0) { - if (CHECK_PAD(input->cur, U_JPAD)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_DUP)) { entryIdx--; timer = 2; if (entryIdx < 0) { entryIdx = 0; } } - if (CHECK_PAD(input->cur, D_JPAD)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_DDOWN)) { timer = 2; entryIdx++; if (!entries[entryIdx].value) { @@ -129,7 +128,7 @@ void FlagSet_Update(GlobalContext* globalCtx) { } } - if (CHECK_PAD(input->press, A_BUTTON)) { + if (CHECK_BTN_ALL(input->press.button, BTN_A)) { *entries[entryIdx].value ^= (1 << curBit); } @@ -145,7 +144,7 @@ void FlagSet_Update(GlobalContext* globalCtx) { oGfxCtx->polyOpa.p = gfx; } - if (CHECK_PAD(input->press, L_TRIG)) { + if (CHECK_BTN_ALL(input->press.button, BTN_L)) { globalCtx->pauseCtx.flag = 0; } diff --git a/src/code/game.c b/src/code/game.c index 8b53efabf6..bafc504696 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #include "vt.h" typedef struct { @@ -77,17 +77,17 @@ void func_800C4344(GameState* gameState) { if (HREG(80) == 0xC) { selectedInput = &gameState->input[HREG(81) < 4U ? HREG(81) : 0]; hReg82 = HREG(82); - HREG(83) = selectedInput->cur.in.button; - HREG(84) = selectedInput->press.in.button; - HREG(85) = selectedInput->rel.in.x; - HREG(86) = selectedInput->rel.in.y; - HREG(87) = selectedInput->rel.in.x; - HREG(88) = selectedInput->rel.in.y; - HREG(89) = selectedInput->cur.in.x; - HREG(90) = selectedInput->cur.in.y; - HREG(93) = (selectedInput->cur.in.button == hReg82); - HREG(94) = CHECK_PAD(selectedInput->cur, hReg82); - HREG(95) = CHECK_PAD(selectedInput->press, hReg82); + HREG(83) = selectedInput->cur.button; + HREG(84) = selectedInput->press.button; + HREG(85) = selectedInput->rel.stick_x; + HREG(86) = selectedInput->rel.stick_y; + HREG(87) = selectedInput->rel.stick_x; + HREG(88) = selectedInput->rel.stick_y; + HREG(89) = selectedInput->cur.stick_x; + HREG(90) = selectedInput->cur.stick_y; + HREG(93) = (selectedInput->cur.button == hReg82); + HREG(94) = CHECK_BTN_ALL(selectedInput->cur.button, hReg82); + HREG(95) = CHECK_BTN_ALL(selectedInput->press.button, hReg82); } if (D_8012DBC0 != 0) { @@ -158,7 +158,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) { GameState_SetFBFilter(&newDList); } - sLastButtonPressed = gameState->input[0].press.in.button | gameState->input[0].cur.in.button; + sLastButtonPressed = gameState->input[0].press.button | gameState->input[0].cur.button; if (R_DISABLE_INPUT_DISPLAY == 0) { GameState_DrawInputDisplay(sLastButtonPressed, &newDList); } diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c index 9ec6886b2f..960aeea982 100644 --- a/src/code/gamealloc.c +++ b/src/code/gamealloc.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void GameAlloc_Log(GameAlloc* this) { GameAllocEntry* iter; diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index 9b859c2129..91854f8fd0 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // .bss u8 D_801755F0; diff --git a/src/code/graph.c b/src/code/graph.c index dc958ff005..3ba23f9ff1 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,7 +1,5 @@ -#include -#include -#include -#include +#include "global.h" +#include "vt.h" #define GFXPOOL_HEAD_MAGIC 0x1234 #define GFXPOOL_TAIL_MAGIC 0x5678 @@ -392,8 +390,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { sGraphUpdateTime = time; } - if (D_8012DBC0 && CHECK_PAD(gameState->input[0].press, Z_TRIG) && - CHECK_PAD(gameState->input[0].cur, L_TRIG | R_TRIG)) { + if (D_8012DBC0 && CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) && + CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) { gSaveContext.gameMode = 0; SET_NEXT_GAMESTATE(gameState, Select_Init, SelectContext); gameState->running = false; diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index ba47ef40e3..1a8eeffec9 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -1,7 +1,7 @@ -#include -#include +#include "global.h" +#include "vt.h" -volatile u32 gIrqMgrResetStatus = 0; +vu32 gIrqMgrResetStatus = 0; volatile OSTime sIrqMgrResetTime = 0; volatile OSTime gIrqMgrRetraceTime = 0; u32 sIrqMgrRetraceCount = 0; @@ -212,7 +212,7 @@ void IrqMgr_ThreadEntry(void* arg0) { osSyncPrintf("IRQマネージャスレッド実行終了\n"); // End of IRQ manager thread execution } -void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) { +void IrqMgr_Init(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) { LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 346); LogUtils_CheckNullPointer("stack", stack, "../irqmgr.c", 347); this->clients = NULL; diff --git a/src/code/jpegdecoder.c b/src/code/jpegdecoder.c index 1f73a46263..cde91207c8 100644 --- a/src/code/jpegdecoder.c +++ b/src/code/jpegdecoder.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u8* sJpegBitStreamPtr; u32 sJpegBitStreamByteIdx; diff --git a/src/code/jpegutils.c b/src/code/jpegutils.c index 52b8612dd6..c532681b93 100644 --- a/src/code/jpegutils.c +++ b/src/code/jpegutils.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void JpegUtils_ProcessQuantizationTable(u8* dqt, JpegQuantizationTable* qt, u8 count) { u8 i; diff --git a/src/code/listalloc.c b/src/code/listalloc.c index b7d97281c7..b6aefeee23 100644 --- a/src/code/listalloc.c +++ b/src/code/listalloc.c @@ -1,4 +1,4 @@ -#include +#include "global.h" ListAlloc* ListAlloc_Init(ListAlloc* this) { this->prev = NULL; diff --git a/src/code/loadfragment2.c b/src/code/loadfragment2.c index 2a304bbeb8..d651ff4e6c 100644 --- a/src/code/loadfragment2.c +++ b/src/code/loadfragment2.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd) { void* allocatedVRamAddr; diff --git a/src/code/logseverity.c b/src/code/logseverity.c index 25bc68c46f..940aa87cc8 100644 --- a/src/code/logseverity.c +++ b/src/code/logseverity.c @@ -1,3 +1,3 @@ -#include +#include "global.h" s32 gOverlayLogSeverity = 2; diff --git a/src/code/main.c b/src/code/main.c index 6e08622873..cf74a8b57b 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "vt.h" s32 gScreenWidth = SCREEN_WIDTH; s32 gScreenHeight = SCREEN_HEIGHT; @@ -48,7 +48,7 @@ void Main(void* arg0) { gScreenHeight = SCREEN_HEIGHT; gAppNmiBufferPtr = (PreNmiBuff*)osAppNmiBuffer; PreNmiBuff_Init(gAppNmiBufferPtr); - Fault_Start(); + Fault_Init(); SysCfb_Init(0); sysHeap = (u32)gSystemHeap; fb = SysCfb_GetFbPtr(0); @@ -75,26 +75,26 @@ void Main(void* arg0) { osCreateMesgQueue(&irqMgrMsgQ, irqMgrMsgBuf, 0x3c); StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack + sizeof(sIrqMgrStack), 0, 0x100, "irqmgr"); - IrqMgr_Create(&gIrqMgr, &sGraphStackInfo, 0x11, 1); + IrqMgr_Init(&gIrqMgr, &sGraphStackInfo, Z_PRIORITY_IRQMGR, 1); osSyncPrintf("タスクスケジューラの初期化\n"); // Initialize the task scheduler StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack + sizeof(sSchedStack), 0, 0x100, "sched"); - Sched_Init(&gSchedContext, &sAudioStack, 0xf, D_80013960, 1, &gIrqMgr); + Sched_Init(&gSchedContext, &sAudioStack, Z_PRIORITY_SCHED, D_80013960, 1, &gIrqMgr); IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQ); StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack + sizeof(sAudioStack), 0, 0x100, "audio"); - AudioMgr_Start(&gAudioMgr, sAudioStack + sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr); + AudioMgr_Init(&gAudioMgr, sAudioStack + sizeof(sAudioStack), Z_PRIORITY_AUDIOMGR, 0xa, &gSchedContext, &gIrqMgr); StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack + sizeof(sPadMgrStack), 0, 0x100, "padmgr"); - PadMgr_Init(&gPadMgr, &sSiIntMsgQ, &gIrqMgr, 7, 0xe, &sIrqMgrStack); + PadMgr_Init(&gPadMgr, &sSiIntMsgQ, &gIrqMgr, 7, Z_PRIORITY_PADMGR, &sIrqMgrStack); AudioMgr_Unlock(&gAudioMgr); StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph"); - osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack + sizeof(sGraphStack), 0xb); + osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack + sizeof(sGraphStack), Z_PRIORITY_GRAPH); osStartThread(&sGraphThread); - osSetThreadPri(0, 0xf); + osSetThreadPri(0, Z_PRIORITY_SCHED); while (true) { msg = NULL; diff --git a/src/code/mempak.c b/src/code/mempak.c index 6478bb7256..9da4804eb6 100644 --- a/src/code/mempak.c +++ b/src/code/mempak.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSPfs sMempakPfsHandle; s32 sMempakFreeBytes; diff --git a/src/code/mtxuty-cvt.c b/src/code/mtxuty-cvt.c index 289e8649dd..345059dba3 100644 --- a/src/code/mtxuty-cvt.c +++ b/src/code/mtxuty-cvt.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void MtxConv_F2L(MatrixInternal* m1, MtxF* m2) { s32 i; diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 13266ab508..a3e32d584c 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -1,7 +1,5 @@ -#include -#include -#include -#include +#include "global.h" +#include "vt.h" s32 D_8012D280 = 1; @@ -206,7 +204,7 @@ void PadMgr_RumbleSet(PadMgr* padmgr, u8* ctrlrRumbles) { void PadMgr_ProcessInputs(PadMgr* padmgr) { s32 i; Input* input; - PadState* padnow1; // original name + OSContPad* padnow1; // original name s32 buttonDiff; PadMgr_LockPadData(padmgr); @@ -237,9 +235,9 @@ void PadMgr_ProcessInputs(PadMgr* padmgr) { osSyncPrintf(VT_RST); break; case 8: - input->cur.in.button = 0; - input->cur.in.x = 0; - input->cur.in.y = 0; + input->cur.button = 0; + input->cur.stick_x = 0; + input->cur.stick_y = 0; input->cur.errno = padnow1->errno; if (padmgr->ctrlrIsConnected[i]) { padmgr->ctrlrIsConnected[i] = false; @@ -255,12 +253,12 @@ void PadMgr_ProcessInputs(PadMgr* padmgr) { Fault_AddHungupAndCrash("../padmgr.c", 397); } - buttonDiff = input->prev.in.button ^ input->cur.in.button; - input->press.in.button |= (u16)(buttonDiff & input->cur.in.button); - input->rel.in.button |= (u16)(buttonDiff & input->prev.in.button); + buttonDiff = input->prev.button ^ input->cur.button; + input->press.button |= (u16)(buttonDiff & input->cur.button); + input->rel.button |= (u16)(buttonDiff & input->prev.button); PadUtils_UpdateRelXY(input); - input->press.in.x += (s8)(input->cur.in.x - input->prev.in.x); - input->press.in.y += (s8)(input->cur.in.y - input->prev.in.y); + input->press.stick_x += (s8)(input->cur.stick_x - input->prev.stick_x); + input->press.stick_y += (s8)(input->cur.stick_y - input->prev.stick_y); } PadMgr_UnlockPadData(padmgr); @@ -333,19 +331,19 @@ void PadMgr_RequestPadData(PadMgr* padmgr, Input* inputs, s32 mode) { for (i = 0; i < 4; i++) { if (mode != 0) { *newInput = *ogInput; - ogInput->press.in.button = 0; - ogInput->press.in.x = 0; - ogInput->press.in.y = 0; - ogInput->rel.in.button = 0; + ogInput->press.button = 0; + ogInput->press.stick_x = 0; + ogInput->press.stick_y = 0; + ogInput->rel.button = 0; } else { newInput->prev = newInput->cur; newInput->cur = ogInput->cur; - buttonDiff = newInput->prev.in.button ^ newInput->cur.in.button; - newInput->press.in.button = newInput->cur.in.button & buttonDiff; - newInput->rel.in.button = newInput->prev.in.button & buttonDiff; + buttonDiff = newInput->prev.button ^ newInput->cur.button; + newInput->press.button = newInput->cur.button & buttonDiff; + newInput->rel.button = newInput->prev.button & buttonDiff; PadUtils_UpdateRelXY(newInput); - newInput->press.in.x += (s8)(newInput->cur.in.x - newInput->prev.in.x); - newInput->press.in.y += (s8)(newInput->cur.in.y - newInput->prev.in.y); + newInput->press.stick_x += (s8)(newInput->cur.stick_x - newInput->prev.stick_x); + newInput->press.stick_y += (s8)(newInput->cur.stick_y - newInput->prev.stick_y); } ogInput++; newInput++; diff --git a/src/code/padsetup.c b/src/code/padsetup.c index 045724a515..745a324931 100644 --- a/src/code/padsetup.c +++ b/src/code/padsetup.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status) { s32 ret; diff --git a/src/code/padutils.c b/src/code/padutils.c index b19fdbf12f..564cfbf6fb 100644 --- a/src/code/padutils.c +++ b/src/code/padutils.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void PadUtils_Init(Input* input) { bzero(input, sizeof(Input)); @@ -8,53 +8,53 @@ void func_800FCB70() { } void PadUtils_ResetPressRel(Input* input) { - input->press.in.button = 0; - input->rel.in.button = 0; + input->press.button = 0; + input->rel.button = 0; } u32 PadUtils_CheckCurExact(Input* input, u16 value) { - return value == input->cur.in.button; + return value == input->cur.button; } u32 PadUtils_CheckCur(Input* input, u16 key) { - return key == (input->cur.in.button & key); + return key == (input->cur.button & key); } u32 PadUtils_CheckPressed(Input* input, u16 key) { - return key == (input->press.in.button & key); + return key == (input->press.button & key); } u32 PadUtils_CheckReleased(Input* input, u16 key) { - return key == (input->rel.in.button & key); + return key == (input->rel.button & key); } u16 PadUtils_GetCurButton(Input* input) { - return input->cur.in.button; + return input->cur.button; } u16 PadUtils_GetPressButton(Input* input) { - return input->press.in.button; + return input->press.button; } s8 PadUtils_GetCurX(Input* input) { - return input->cur.in.x; + return input->cur.stick_x; } s8 PadUtils_GetCurY(Input* input) { - return input->cur.in.y; + return input->cur.stick_y; } void PadUtils_SetRelXY(Input* input, s32 x, s32 y) { - input->rel.in.x = x; - input->rel.in.y = y; + input->rel.stick_x = x; + input->rel.stick_y = y; } s8 PadUtils_GetRelXImpl(Input* input) { - return input->rel.in.x; + return input->rel.stick_x; } s8 PadUtils_GetRelYImpl(Input* input) { - return input->rel.in.y; + return input->rel.stick_y; } s8 PadUtils_GetRelX(Input* input) { diff --git a/src/code/printutils.c b/src/code/printutils.c index 7cd00f71c4..043ed8782e 100644 --- a/src/code/printutils.c +++ b/src/code/printutils.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void PrintUtils_VPrintf(char** arg0, const char* fmt, va_list args) { _Printf(*arg0, arg0, fmt, args); diff --git a/src/code/relocation.c b/src/code/relocation.c index dccd6e1762..68f7ac7d03 100644 --- a/src/code/relocation.c +++ b/src/code/relocation.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void Overlay_Relocate(void* allocatedVRamAddress, OverlayRelocationSection* overlayInfo, void* vRamAddress) { u32 sections[4]; diff --git a/src/code/sched.c b/src/code/sched.c index 7bd13383a8..5b928cb1d2 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -1,12 +1,11 @@ -#include -#include +#include "global.h" #define RSP_DONE_MSG 667 #define RDP_DONE_MSG 668 #define ENTRY_MSG 670 // data -volatile s32 sLogScheduler = false; +vs32 sLogScheduler = false; // bss OSTime sRSPGFXStartTime; diff --git a/src/code/shrink_window.c b/src/code/shrink_window.c index 212195ce6e..c995b7c034 100644 --- a/src/code/shrink_window.c +++ b/src/code/shrink_window.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 D_8012CED0 = 0; diff --git a/src/code/sleep.c b/src/code/sleep.c index 31720a0dff..f08129701e 100644 --- a/src/code/sleep.c +++ b/src/code/sleep.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void Sleep_Cycles(OSTime cycles) { OSMesgQueue mq; diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c index 24b4e8d651..b1ee055a32 100644 --- a/src/code/speed_meter.c +++ b/src/code/speed_meter.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" volatile OSTime D_8016A520; volatile OSTime D_8016A528; diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 5ee8e857fa..aab3044653 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u32 sSysCfbFbPtr[2]; u32 sSysCfbEnd; diff --git a/src/code/sys_math.c b/src/code/sys_math.c index 994f664752..87a1eacd8c 100644 --- a/src/code/sys_math.c +++ b/src/code/sys_math.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" + f32 sFactorialTbl[] = { 1.0f, 1.0f, 2.0f, 6.0f, 24.0f, 120.0f, 720.0f, 5040.0f, 40320.0f, 362880.0f, 3628800.0f, 39916800.0f, 479001600.0f }; diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 141b27fd4f..4a0006c327 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" s32 Math3D_LineSegMakePerpLineSeg(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB, Vec3f* lineAIntersect, Vec3f* lineBIntersect); diff --git a/src/code/sys_math_atan.c b/src/code/sys_math_atan.c index ab62977d2e..b468818c81 100644 --- a/src/code/sys_math_atan.c +++ b/src/code/sys_math_atan.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" u16 sATan2Tbl[] = { 0x0000, 0x000A, 0x0014, 0x001F, 0x0029, 0x0033, 0x003D, 0x0047, 0x0051, 0x005C, 0x0066, 0x0070, 0x007A, 0x0084, diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index 87a1708f42..ec7b6f8ab5 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // clang-format off Mtx gMtxClear = { diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c index 6496217eb2..34e7823875 100644 --- a/src/code/sys_ucode.c +++ b/src/code/sys_ucode.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u32 D_8012DBA0 = (u32)&D_80155F50; u32 D_8012DBA4 = (u32)&D_80157580; diff --git a/src/code/system_malloc.c b/src/code/system_malloc.c index a9141043d9..be55cb76cd 100644 --- a/src/code/system_malloc.c +++ b/src/code/system_malloc.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 diff --git a/src/code/title_setup.c b/src/code/title_setup.c index 827987d33c..94c5366250 100644 --- a/src/code/title_setup.c +++ b/src/code/title_setup.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void TitleSetup_InitImpl(GameState* gameState) { // Zelda common data initalization diff --git a/src/code/ucode_disas.c b/src/code/ucode_disas.c index 1f4975799e..81301f2ccd 100644 --- a/src/code/ucode_disas.c +++ b/src/code/ucode_disas.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define F3DZEX_CONST(name) \ { name, #name } diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c index ab09cbac5a..a8e8a13fcb 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" void Overlay_LoadGameState(GameStateOverlay* overlayEntry) { if (overlayEntry->loadedRamAddr != NULL) { diff --git a/src/code/z_actor.c b/src/code/z_actor.c index e17084fd1a..b9638879b7 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,8 +1,7 @@ -#include -#include -#include -#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h" +#include "global.h" +#include "vt.h" +#include "overlays/actors/ovl_Arms_Hook/z_arms_hook.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3) { diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 42a153113a..a03019b723 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "initvars.h" #define ACTOR_OVERLAY(name, allocType) \ { \ diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 318dd4838a..75d078ab37 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038600.s") @@ -23,7 +22,7 @@ void func_800387FC(u32 uParm1, u32* puParm2) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003880C.s") -void func_80038870(int iParm1) { +void func_80038870(s32 iParm1) { *(u32*)(iParm1 + 4) = 0; } @@ -31,9 +30,9 @@ u32 func_80038878(s32 iParm1) { u32 uVar1; uVar1 = *(u32*)(iParm1 + 4) & 0xffff; - *(int*)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1; + *(s32*)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1; - if (*(int*)(iParm1 + 8) <= (int)uVar1) { + if (*(s32*)(iParm1 + 8) <= (s32)uVar1) { return 0xffff; } @@ -200,7 +199,7 @@ void func_8003E6E4(u16* a0) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E750.s") -void func_8003E804(int iParm1) { +void func_8003E804(s32 iParm1) { func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34); } @@ -231,7 +230,7 @@ void func_8003E8EC(u32 uParm1, u32* iParm2) { iParm2[0x0C] = iParm2[0x14]; - //int i; + //s32 i; //for (i = 0; i < 4; i++) { //iParm2[0x06 + (i * 2)] = iParm2[0x0E + (i * 2)]; //iParm2[0x07 + (i * 2)] = iParm2[0x0D + (i * 2)]; @@ -239,7 +238,7 @@ void func_8003E8EC(u32 uParm1, u32* iParm2) { } */ -u32 func_8003E934(int iParm1) { +u32 func_8003E934(s32 iParm1) { if (!((-1 < iParm1) && (iParm1 < 0x32))) { return 0; } @@ -338,13 +337,13 @@ void func_800418D0(CollisionContext* colCtx, GlobalContext* globalCtx) { } #ifdef NON_MATCHING -void func_80041978(int iParm1, int iParm2) { +void func_80041978(s32 iParm1, s32 iParm2) { u8* puVar1; puVar1 = *(u8**)(iParm1 + 8); if (puVar1 < puVar1 + iParm2) { *puVar1 = 0; - while (puVar1++ < (u8*)(*(int*)(iParm1 + 8) + iParm2)) { + while (puVar1++ < (u8*)(*(s32*)(iParm1 + 8) + iParm2)) { *puVar1 = 0; } } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 75c536b9f7..c0822b1ab5 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" typedef struct { s16 val; @@ -3328,19 +3327,19 @@ s32 func_80058D34(Camera* camera) { if (D_8011D394 == 0) { if (camera->globalCtx->activeCamera == 0) { - if (CHECK_PAD(D_8015BD7C->state.input[2].press, U_CBUTTONS)) { + if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CUP)) { osSyncPrintf("attention sound URGENCY\n"); func_80078884(NA_SE_SY_ATTENTION_URGENCY); } - if (CHECK_PAD(D_8015BD7C->state.input[2].press, D_CBUTTONS)) { + if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CDOWN)) { osSyncPrintf("attention sound NORMAL\n"); func_80078884(NA_SE_SY_ATTENTION_ON); } - if (CHECK_PAD(D_8015BD7C->state.input[2].press, R_CBUTTONS)) { + if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CRIGHT)) { phi_a2 = 1; } - if (CHECK_PAD(D_8015BD7C->state.input[2].press, L_CBUTTONS)) { + if (CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_CLEFT)) { phi_a2 = -1; } if (phi_a2 != 0) { diff --git a/src/code/z_cheap_proc.c b/src/code/z_cheap_proc.c index 518b2d359f..eb9ecfa53a 100644 --- a/src/code/z_cheap_proc.c +++ b/src/code/z_cheap_proc.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 214); diff --git a/src/code/z_collision_btltbls.c b/src/code/z_collision_btltbls.c index c56347e9a3..1b323dacfc 100644 --- a/src/code/z_collision_btltbls.c +++ b/src/code/z_collision_btltbls.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" DamageTable D_8011DB20[] = { { { diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 36aeadf5f1..0554c3d247 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" // draw red poly void func_8005B280(GraphicsContext* gfx, Vec3f* vA, Vec3f* vB, Vec3f* vC) { @@ -497,7 +496,7 @@ s32 Collider_DestroyTrisItemDim(GlobalContext* globalCtx, TriNorm* dim) { s32 Collider_SetTrisItemDim(GlobalContext* globalCtx, TriNorm* dest, ColliderTrisItemDimInit* src) { Vec3f* d; Vec3f* s; - float nx, ny, nz, nd; + f32 nx, ny, nz, nd; d = dest->vtx; s = src->vtx; @@ -1981,6 +1980,7 @@ void CollisionCheck_AC_CylVsQuad(GlobalContext* globalCtx, CollisionCheckContext } static s8 sBssDummy1; +static s8 sBssDummy2; static TriNorm D_8015E3A0; static TriNorm D_8015E3D8; @@ -2032,10 +2032,10 @@ void CollisionCheck_AC_QuadVsCyl(GlobalContext* globalCtx, CollisionCheckContext } } -static s8 sBssDummy2; static s8 sBssDummy3; static s8 sBssDummy4; static s8 sBssDummy5; +static s8 sBssDummy6; static Vec3f D_8015E420; @@ -2077,10 +2077,10 @@ void CollisionCheck_AC_TrisVsTris(GlobalContext* globalCtx, CollisionCheckContex } } -static s8 sBssDummy6; static s8 sBssDummy7; static s8 sBssDummy8; static s8 sBssDummy9; +static s8 sBssDummy10; static Vec3f D_8015E430; static TriNorm D_8015E440; @@ -2676,7 +2676,7 @@ void func_80061F64(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, C u32 flags; s32 i; f32 damage; - int tblLookup; + s32 tblLookup; if (collider->actor == NULL || !(collider->acFlags & 2)) { return; @@ -2910,10 +2910,10 @@ void func_8006285C(GlobalContext* globalCtx, ColliderTris* collider, s32 index, // In order to reproduce this behavior, we need a specific number of bss variables in the file before that point. // For this, we introduce a certain amount of dummy variables throughout the file, which we fit inside padding added // by the compiler between structs like TriNorm and/or Vec3f, so they don't take space in bss. -static s8 sBssDummy10; static s8 sBssDummy11; static s8 sBssDummy12; static s8 sBssDummy13; +static s8 sBssDummy14; void func_800628A4(s32 arg0, ColliderJntSph* collider) { static Vec3f D_8015E648; diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 53a2fa82d0..4923e56f17 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" SaveContext gSaveContext; u32 D_8015FA88; diff --git a/src/code/z_construct.c b/src/code/z_construct.c index f7970ac19b..15a8054e7c 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void func_80110990(GlobalContext* globalCtx) { Map_Destroy(globalCtx); diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 21e0eae031..0ee403868b 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" typedef struct { u8 x; @@ -15,7 +13,7 @@ typedef struct { } InputCombo; GameInfo* gGameInfo; -int D_8015FA94; // no known symbols +s32 D_8015FA94; // no known symbols PrintTextBuffer D_8015FA98[0x16]; s16 D_8011E0B0 = 0; // PrintTextBuffer index @@ -25,14 +23,12 @@ Color_RGBA8 printTextColors[] = { }; InputCombo inputCombos[REG_GROUPS] = { - { L_TRIG, U_CBUTTONS }, { L_TRIG, L_CBUTTONS }, { L_TRIG, D_CBUTTONS }, { L_TRIG, A_BUTTON }, - { R_TRIG, D_CBUTTONS }, { L_TRIG, R_CBUTTONS }, { L_TRIG, R_TRIG }, { L_TRIG, L_JPAD }, - { L_TRIG, R_JPAD }, { L_TRIG, U_JPAD }, { L_TRIG, B_BUTTON }, { L_TRIG, Z_TRIG }, - { L_TRIG, D_JPAD }, { R_TRIG, A_BUTTON }, { R_TRIG, B_BUTTON }, { R_TRIG, Z_TRIG }, - { R_TRIG, L_TRIG }, { R_TRIG, U_CBUTTONS }, { R_TRIG, R_CBUTTONS }, { R_TRIG, L_JPAD }, - { R_TRIG, L_CBUTTONS }, { R_TRIG, START_BUTTON }, { L_TRIG, START_BUTTON }, { R_TRIG, R_JPAD }, - { R_TRIG, U_JPAD }, { START_BUTTON, R_TRIG }, { START_BUTTON, A_BUTTON }, { START_BUTTON, B_BUTTON }, - { START_BUTTON, R_CBUTTONS }, + { BTN_L, BTN_CUP }, { BTN_L, BTN_CLEFT }, { BTN_L, BTN_CDOWN }, { BTN_L, BTN_A }, { BTN_R, BTN_CDOWN }, + { BTN_L, BTN_CRIGHT }, { BTN_L, BTN_R }, { BTN_L, BTN_DLEFT }, { BTN_L, BTN_DRIGHT }, { BTN_L, BTN_DUP }, + { BTN_L, BTN_B }, { BTN_L, BTN_Z }, { BTN_L, BTN_DDOWN }, { BTN_R, BTN_A }, { BTN_R, BTN_B }, + { BTN_R, BTN_Z }, { BTN_R, BTN_L }, { BTN_R, BTN_CUP }, { BTN_R, BTN_CRIGHT }, { BTN_R, BTN_DLEFT }, + { BTN_R, BTN_CLEFT }, { BTN_R, BTN_START }, { BTN_L, BTN_START }, { BTN_R, BTN_DRIGHT }, { BTN_R, BTN_DUP }, + { BTN_START, BTN_R }, { BTN_START, BTN_A }, { BTN_START, BTN_B }, { BTN_START, BTN_CRIGHT }, }; char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb"; @@ -114,11 +110,12 @@ void func_8006390C(Input* input) { s32 i; regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE; - dpad = input->cur.in.button & (U_JPAD | L_JPAD | R_JPAD | D_JPAD); - if (CHECK_PAD(input->cur, L_TRIG) || CHECK_PAD(input->cur, R_TRIG) || CHECK_PAD(input->cur, START_BUTTON)) { + dpad = input->cur.button & (BTN_DUP | BTN_DLEFT | BTN_DRIGHT | BTN_DDOWN); + if (CHECK_BTN_ALL(input->cur.button, BTN_L) || CHECK_BTN_ALL(input->cur.button, BTN_R) || + CHECK_BTN_ALL(input->cur.button, BTN_START)) { input_combo = inputCombos; for (i = 0; i < REG_GROUPS; i++) { - if (~(~input_combo->push | input->cur.in.button) || ~(~input_combo->held | input->press.in.button)) { + if (~(~input_combo->push | input->cur.button) || ~(~input_combo->held | input->press.button)) { input_combo++; } else { break; @@ -154,25 +151,27 @@ void func_8006390C(Input* input) { gGameInfo->dpadLast = dpad; } - increment = - (dpad & R_JPAD) - ? (CHECK_PAD(input->cur, A_BUTTON | B_BUTTON) - ? 1000 - : CHECK_PAD(input->cur, A_BUTTON) ? 100 : CHECK_PAD(input->cur, B_BUTTON) ? 10 : 1) - : (dpad & L_JPAD) - ? (CHECK_PAD(input->cur, A_BUTTON | B_BUTTON) - ? -1000 - : CHECK_PAD(input->cur, A_BUTTON) ? -100 - : CHECK_PAD(input->cur, B_BUTTON) ? -10 : -1) - : 0; + increment = (CHECK_BTN_ANY(dpad, BTN_DRIGHT)) + ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) + ? 1000 + : CHECK_BTN_ALL(input->cur.button, BTN_A) + ? 100 + : CHECK_BTN_ALL(input->cur.button, BTN_B) ? 10 : 1) + : (CHECK_BTN_ANY(dpad, BTN_DLEFT)) + ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) + ? -1000 + : CHECK_BTN_ALL(input->cur.button, BTN_A) + ? -100 + : CHECK_BTN_ALL(input->cur.button, BTN_B) ? -10 : -1) + : 0; gGameInfo->data[gGameInfo->regCur + regGroup] += increment; - if (dpad & U_JPAD) { + if (CHECK_BTN_ANY(dpad, BTN_DUP)) { gGameInfo->regCur--; if (gGameInfo->regCur < 0) { gGameInfo->regCur = REG_PER_PAGE - 1; } - } else if (dpad & D_JPAD) { + } else if (CHECK_BTN_ANY(dpad, BTN_DDOWN)) { gGameInfo->regCur++; if (gGameInfo->regCur >= REG_PER_PAGE) { gGameInfo->regCur = 0; diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index d029d25568..571bb82400 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" typedef struct { /* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 35dc743ff6..9210fe1d13 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" u16 D_8011E1C0 = 0; u16 D_8011E1C4 = 0; @@ -98,14 +96,15 @@ void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) { void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) { Input* pad1 = &globalCtx->state.input[0]; - if (CHECK_PAD(pad1->press, L_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4)) { + if (CHECK_BTN_ALL(pad1->press.button, BTN_DLEFT) && (csCtx->state == CS_STATE_IDLE) && + (gSaveContext.sceneSetupIndex >= 4)) { D_8015FCC8 = 0; gSaveContext.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneTrigger = 1; } - if (CHECK_PAD(pad1->press, U_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4) && - (D_8011D394 == 0)) { + if (CHECK_BTN_ALL(pad1->press.button, BTN_DUP) && (csCtx->state == CS_STATE_IDLE) && + (gSaveContext.sceneSetupIndex >= 4) && (D_8011D394 == 0)) { D_8015FCC8 = 1; gSaveContext.cutsceneIndex = 0xFFFD; gSaveContext.cutsceneTrigger = 1; @@ -442,15 +441,16 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) && (csCtx->frames > 20) && - (CHECK_PAD(globalCtx->state.input[0].press, A_BUTTON) || CHECK_PAD(globalCtx->state.input[0].press, B_BUTTON) || - CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON)) && + (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_A) || + CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B) || + CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START)) && (gSaveContext.fileNum != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); temp = 1; } if ((csCtx->frames == cmd->startFrame) || (temp != 0) || - ((csCtx->frames > 20) && CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON) && + ((csCtx->frames > 20) && CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) && (gSaveContext.fileNum != 0xFEDC))) { csCtx->state = CS_STATE_UNSKIPPABLE_EXEC; func_800F68BC(0); @@ -1522,7 +1522,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, return; } - if (CHECK_PAD(globalCtx->state.input[0].press, R_JPAD)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_DRIGHT)) { csCtx->state = CS_STATE_UNSKIPPABLE_INIT; return; } diff --git a/src/code/z_draw.c b/src/code/z_draw.c index 83f13ce076..885a4674f4 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // "Get Item" Model Draw Functions void func_800694E4(GlobalContext* globalCtx, s16 drawId); diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index 8f256bcc59..3624a2c9f8 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) { EffectBlureElement* elem; diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index 2d6763da15..a68c765612 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" static Vtx sVertices[5] = { VTX(-32, -32, 0, 0, 1024, 0xFF, 0xFF, 0xFF, 0xFF), diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index 77b7e3f2ba..6d4ef51ccc 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // original name: "spark" void EffectSpark_Init(void* thisx, void* initParamsx) { diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c index 5ac7774bc2..a6eeabeb86 100644 --- a/src/code/z_eff_ss_dead.c +++ b/src/code/z_eff_ss_dead.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void func_80026230(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3) { f32 cos; diff --git a/src/code/z_effect.c b/src/code/z_effect.c index a1077c13af..f035469e04 100644 --- a/src/code/z_effect.c +++ b/src/code/z_effect.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" EffectContext sEffectContext; diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 4fa2abb885..381a24f985 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info" diff --git a/src/code/z_effect_soft_sprite_dlftbls.c b/src/code/z_effect_soft_sprite_dlftbls.c index 8ecba2e1b5..bc7ec83b91 100644 --- a/src/code/z_effect_soft_sprite_dlftbls.c +++ b/src/code/z_effect_soft_sprite_dlftbls.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "initvars.h" #define EFFECT_SS_OVERLAY(name) \ { \ diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 4fd31db0fd..806ee878a0 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #include "overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h" #include "overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h" #include "overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h" diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index e188e1947e..d3552c419d 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // TODO: use macros to define elf messages once the format is fully documented ElfMessage sChildSariaMsgs[] = { diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 0847ad682d..34ca02864a 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 64a8dc4dc5..df18eb7f79 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" #define FLAGS 0x00000000 diff --git a/src/code/z_face_reaction.c b/src/code/z_face_reaction.c index 8bc9c6685d..56e40fd822 100644 --- a/src/code/z_face_reaction.c +++ b/src/code/z_face_reaction.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" u16 sReactionTextIds[][PLAYER_MASK_MAX] = { { 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 }, diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c index f8409a7edb..426231bcb3 100644 --- a/src/code/z_fbdemo.c +++ b/src/code/z_fbdemo.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" Gfx D_8012AFB0[] = { gsDPPipeSync(), diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index dfcf7e54a7..8ef9122780 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -1,4 +1,4 @@ -#include +#include "global.h" // unused Gfx sCircleNullDList[] = { diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c index 74d218caad..d0f99bed6b 100644 --- a/src/code/z_fbdemo_fade.c +++ b/src/code/z_fbdemo_fade.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "vt.h" static Gfx sRCPSetupFade[] = { gsDPPipeSync(), diff --git a/src/code/z_fbdemo_triforce.c b/src/code/z_fbdemo_triforce.c index 4c2d0a4756..d4c3d66558 100644 --- a/src/code/z_fbdemo_triforce.c +++ b/src/code/z_fbdemo_triforce.c @@ -1,4 +1,4 @@ -#include +#include "global.h" Gfx sTriforceDList[] = { gsDPPipeSync(), diff --git a/src/code/z_fbdemo_wipe1.c b/src/code/z_fbdemo_wipe1.c index 93b3a95118..3c0456ccea 100644 --- a/src/code/z_fbdemo_wipe1.c +++ b/src/code/z_fbdemo_wipe1.c @@ -1,4 +1,4 @@ -#include +#include "global.h" Vtx sWipeVtx[] = { VTX(-1299, 750, 0, 13653, 2048, 0xAD, 0x30, 0xB8, 0xFF), VTX(-750, 1299, 0, 15019, 2048, 0xD0, 0x53, 0xB8, 0xFF), diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c index 7e3500fc17..e5aa09dd9f 100644 --- a/src/code/z_fcurve_data_skelanime.c +++ b/src/code/z_fcurve_data_skelanime.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void SkelCurve_Clear(SkelAnimeCurve* skelCurve) { skelCurve->limbCount = 0; diff --git a/src/code/z_game_dlftbls.c b/src/code/z_game_dlftbls.c index c7bfa9dd67..d543640684 100644 --- a/src/code/z_game_dlftbls.c +++ b/src/code/z_game_dlftbls.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define GAMESTATE_OVERLAY(name, init, destroy, size) \ { \ diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 3764530dd3..3d02e175ef 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" s32 func_8006CFC0(s32 scene) { s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 }; diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index ee92e02cf9..019f682160 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" #define MARKER_SOI 0xD8 #define MARKER_SOF 0xC0 diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 861b81861d..6f80b3ae1f 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "vt.h" #define KALEIDO_OVERLAY(name) \ { \ diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index d7f42b7246..09eee556b1 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,9 +1,9 @@ -#include -#include +#include "global.h" +#include "vt.h" void (*sKaleidoScopeUpdateFunc)(GlobalContext*); void (*sKaleidoScopeDrawFunc)(GlobalContext*); -float D_80161398; +f32 D_80161398; u32 D_8016139C; void* D_801613A0; diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index ce5513bb43..10140553ee 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s16 sKaleidoSetupKscpPos0[] = { 2, @@ -48,11 +48,11 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) { gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 && (globalCtx->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(globalCtx, 0x38))) { - if (CHECK_PAD(input->cur, L_TRIG) && CHECK_PAD(input->press, U_CBUTTONS)) { + if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) { if (BREG(0)) { pauseCtx->flag = 3; } - } else if (CHECK_PAD(input->press, START_BUTTON)) { + } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { gSaveContext.unk_13EE = gSaveContext.unk_13EA; WREG(16) = -0xAF; WREG(17) = 0x9B; diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index fc2c0b1e8f..272c235f30 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_kanfont/func_8006EE60.s") diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 7caa221e5d..70b8e2c313 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_8006F0A0.s") diff --git a/src/code/z_lib.c b/src/code/z_lib.c index 01ea0ef866..a69770ca2d 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void Lib_MemSet(u8* dest, size_t size, u8 val) { u32 i; @@ -168,8 +167,8 @@ s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep) { } void func_80077D10(f32* arg0, s16* arg1, Input* input) { - f32 relX = input->rel.in.x; - f32 relY = input->rel.in.y; + f32 relX = input->rel.stick_x; + f32 relY = input->rel.stick_y; *arg0 = sqrtf(SQ(relX) + SQ(relY)); *arg0 = (60.0f < *arg0) ? 60.0f : *arg0; diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index 9faf690260..64fe2e53e9 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" extern s16 D_8011FF10[3]; extern s16 D_8011FF24[3]; diff --git a/src/code/z_lights.c b/src/code/z_lights.c index 5fc5b1b0d2..2f6c06a62c 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #define LIGHTS_BUFFER_SIZE 32 diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index ce9b1a5996..f992755a19 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define LOG_SEVERITY_NOLOG 0 #define LOG_SEVERITY_ERROR 2 diff --git a/src/code/z_map_data.c b/src/code/z_map_data.c index b0dbd6cace..f518a124ca 100644 --- a/src/code/z_map_data.c +++ b/src/code/z_map_data.c @@ -1,4 +1,4 @@ -#include +#include "global.h" static s16 sFloorTexIndexOffset[10][8] = { { 0, 0, 0, 0, 2, 4, 6, 8 }, { 0, 0, 0, 0, 0, 0, 0, 2 }, diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 9336c8a85a..c409d0cf8f 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" MapData* gMapData; @@ -403,7 +402,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { } } - if (CHECK_PAD(globalCtx->state.input[0].press, L_TRIG) && !Gameplay_InCsMode(globalCtx)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx)); // clang-format off if (!R_MINIMAP_TOGGLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, @@ -484,7 +483,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position } - if (CHECK_PAD(globalCtx->state.input[0].press, L_TRIG) && !Gameplay_InCsMode(globalCtx)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { // clang-format off if (!R_MINIMAP_TOGGLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 5597c77114..c8e447f641 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" typedef struct { /* 0x00 */ void* texture; diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index b8e4434355..1dd79776ca 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_801069B0.s") diff --git a/src/code/z_moji.c b/src/code/z_moji.c index 17886ba8b0..42f5704bc8 100644 --- a/src/code/z_moji.c +++ b/src/code/z_moji.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" u32 sFontColorRed = 255; u32 sFontColorGreen = 255; diff --git a/src/code/z_msgevent.c b/src/code/z_msgevent.c index 652d498994..d09ab08d3a 100644 --- a/src/code/z_msgevent.c +++ b/src/code/z_msgevent.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void MsgEvent_SendNullTask() { s32 pad[4]; diff --git a/src/code/z_olib.c b/src/code/z_olib.c index c9f278b0bb..b4b9899290 100644 --- a/src/code/z_olib.c +++ b/src/code/z_olib.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" /** * Calculates the distances between `a` and `b` diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index faf7ca6b7d..176a11f7a8 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" typedef struct { /* 0x00 */ u32 unk_00; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index ca8fc1d22d..97ef34dc45 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1,7 +1,5 @@ -#include -#include -#include -#include +#include "global.h" +#include "vt.h" typedef struct { /* 0x00 */ u8 scene; @@ -3920,13 +3918,13 @@ void Interface_Update(GlobalContext* globalCtx) { u16 action; Input* input = &globalCtx->state.input[2]; - if (CHECK_PAD(input->press, L_JPAD)) { + if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { gSaveContext.language = 0; osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); - } else if (CHECK_PAD(input->press, U_JPAD)) { + } else if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) { gSaveContext.language = 1; osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); - } else if (CHECK_PAD(input->press, R_JPAD)) { + } else if (CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { gSaveContext.language = 2; osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); } diff --git a/src/code/z_path.c b/src/code/z_path.c index 03dc6d6f60..f9bcac0848 100644 --- a/src/code/z_path.c +++ b/src/code/z_path.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" Path* Path_GetByIndex(GlobalContext* globalCtx, s16 index, s16 max) { Path* path; diff --git a/src/code/z_play.c b/src/code/z_play.c index 20c2567bd5..29cad25382 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" void* D_8012D1F0 = NULL; UNK_TYPE D_8012D1F4 = 0; // unused @@ -921,7 +920,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { } if (globalCtx->unk_1242B != 0) { - if (CHECK_PAD(input[0].press, U_CBUTTONS)) { + if (CHECK_BTN_ALL(input[0].press.button, BTN_CUP)) { if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) { // Translates to: "Changing viewpoint is prohibited due to the kaleidoscope" osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST); diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index e408cc9890..616f1e4b37 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define FLAGS 0x06000035 diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 7bdacf68b3..e5a87bb78b 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" typedef struct { /* 0x00 */ u8 flag; diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c index eeae441cea..678e393b09 100644 --- a/src/code/z_prenmi.c +++ b/src/code/z_prenmi.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" void func_80092320(PreNMIContext* prenmiCtx) { prenmiCtx->state.running = false; diff --git a/src/code/z_prenmi_buff.c b/src/code/z_prenmi_buff.c index 9c5924bc98..340309e697 100644 --- a/src/code/z_prenmi_buff.c +++ b/src/code/z_prenmi_buff.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #define COLD_RESET 0 #define NMI 1 diff --git a/src/code/z_quake.c b/src/code/z_quake.c index e8f31aa57f..9869fa6fb6 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "vt.h" QuakeRequest sQuakeRequest[4]; s16 D_80126250 = 1; diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 93fb384696..7af688f2e9 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" Gfx sSetupDL[] = { /* 0x00 */ diff --git a/src/code/z_room.c b/src/code/z_room.c index 388c41b742..9dbb122038 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags); void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags); diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 59ad5a59b3..d5383b3732 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -1,9 +1,7 @@ -#include -#include -#include +#include "global.h" void Sample_HandleStateChange(SampleContext* this) { - if (CHECK_PAD(this->state.input[0].press, START_BUTTON)) { + if (CHECK_BTN_ALL(this->state.input[0].press.button, BTN_START)) { SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext); this->state.running = false; } diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 733d08fa44..04bcb358c2 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" RomFile sNaviMsgFiles[]; diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 4473697d32..0ddb3ca5bd 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #define ENTRANCE(scene, spawn, continueBgm, displayTitleCard, fadeIn, fadeOut) \ { \ diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 2bccd4db10..a890c9a7f4 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" s32 func_800A3D70(GlobalContext*, SkelAnime*); s32 func_800A3E0C(GlobalContext*, SkelAnime*); diff --git a/src/code/z_skin.c b/src/code/z_skin.c index ca907bb17e..9d8f9004f1 100644 --- a/src/code/z_skin.c +++ b/src/code/z_skin.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin/func_800A57C0.s") diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c index 4e4530025f..b506d002fc 100644 --- a/src/code/z_skin_awb.c +++ b/src/code/z_skin_awb.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_awb/func_800A6460.s") diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c index 9920fe76ef..62513bc0e1 100644 --- a/src/code/z_skin_matrix.c +++ b/src/code/z_skin_matrix.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" // clang-format off MtxF sMtxFClear = { diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 0f2bcaa64f..06517245f3 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_sram/func_800A81A0.s") diff --git a/src/code/z_view.c b/src/code/z_view.c index 5ef8808dee..5807cc0fb7 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -1,8 +1,7 @@ -#include -#include -#include +#include "global.h" +#include "vt.h" -volatile u32 D_8012ABF0 = true; +vu32 D_8012ABF0 = true; void View_ViewportToVp(Vp* dest, Viewport* src) { s32 width = src->rightX - src->leftX; diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c index 1fa3ba4521..0dedd07924 100644 --- a/src/code/z_vimode.c +++ b/src/code/z_vimode.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_vimode/func_800AC030.s") diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c index 112f64c00d..be0600ba1d 100644 --- a/src/code/z_vismono.c +++ b/src/code/z_vismono.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" // (Note: 80 = SCREEN_HEIGHT/3, see VisMono_DrawTexture) // Did the devs forget to update this? 1+1+1+80*(7+2+2+3)+1+1 makes more sense diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c index 8008c6aca7..09c872365a 100644 --- a/src/code/z_vr_box.c +++ b/src/code/z_vr_box.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800ADBB0.s") diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c index b8cd7f3367..f08feaf929 100644 --- a/src/code/z_vr_box_draw.c +++ b/src/code/z_vr_box_draw.c @@ -1,4 +1,4 @@ -#include +#include "global.h" Mtx* sSkyboxDrawMatrix; diff --git a/src/libultra_boot_O1/__osDequeueThread.c b/src/libultra_boot_O1/__osDequeueThread.c index 50b6aeeff8..a29f007c90 100644 --- a/src/libultra_boot_O1/__osDequeueThread.c +++ b/src/libultra_boot_O1/__osDequeueThread.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void __osDequeueThread(OSThread** queue, OSThread* thread) { register OSThread** a2; diff --git a/src/libultra_boot_O1/__osGetHWIntrRoutine.c b/src/libultra_boot_O1/__osGetHWIntrRoutine.c index a9b633adb4..4ccfb032a3 100644 --- a/src/libultra_boot_O1/__osGetHWIntrRoutine.c +++ b/src/libultra_boot_O1/__osGetHWIntrRoutine.c @@ -1,4 +1,5 @@ -#include +#include "global.h" +#include "ultra64/internal.h" void __osGetHWIntrRoutine(s32 idx, OSMesgQueue** outQueue, OSMesg* outMsg) { *outQueue = __osHwIntTable[idx].queue; diff --git a/src/libultra_boot_O1/__osResetGlobalIntMask.c b/src/libultra_boot_O1/__osResetGlobalIntMask.c index 9479289fb1..bf5a2466f3 100644 --- a/src/libultra_boot_O1/__osResetGlobalIntMask.c +++ b/src/libultra_boot_O1/__osResetGlobalIntMask.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void __osResetGlobalIntMask(u32 mask) { register s32 prevInt; diff --git a/src/libultra_boot_O1/__osSetGlobalIntMask.c b/src/libultra_boot_O1/__osSetGlobalIntMask.c index 15200ac55e..4f46523f28 100644 --- a/src/libultra_boot_O1/__osSetGlobalIntMask.c +++ b/src/libultra_boot_O1/__osSetGlobalIntMask.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void __osSetGlobalIntMask(u32 mask) { register s32 prevInt; diff --git a/src/libultra_boot_O1/__osSetHWIntrRoutine.c b/src/libultra_boot_O1/__osSetHWIntrRoutine.c index 48f5a85dbb..03b6d974d2 100644 --- a/src/libultra_boot_O1/__osSetHWIntrRoutine.c +++ b/src/libultra_boot_O1/__osSetHWIntrRoutine.c @@ -1,7 +1,8 @@ -#include +#include "global.h" +#include "ultra64/internal.h" void __osSetHWIntrRoutine(s32 idx, OSMesgQueue* queue, OSMesg msg) { - register int prevInt; + register s32 prevInt; prevInt = __osDisableInt(); diff --git a/src/libultra_boot_O1/initialize.c b/src/libultra_boot_O1/initialize.c index 29d4846617..e850919f09 100644 --- a/src/libultra_boot_O1/initialize.c +++ b/src/libultra_boot_O1/initialize.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" typedef struct { u32 ins_00; // lui k0, 0x8000 diff --git a/src/libultra_boot_O1/osCreateMesgQueue.c b/src/libultra_boot_O1/osCreateMesgQueue.c index 3282c16ffe..31f1e2522e 100644 --- a/src/libultra_boot_O1/osCreateMesgQueue.c +++ b/src/libultra_boot_O1/osCreateMesgQueue.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count) { mq->mtqueue = __osThreadTail; diff --git a/src/libultra_boot_O1/osCreateThread.c b/src/libultra_boot_O1/osCreateThread.c index d62f0c2cc6..af14674148 100644 --- a/src/libultra_boot_O1/osCreateThread.c +++ b/src/libultra_boot_O1/osCreateThread.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSThread* __osThreadTail[2] = { NULL, (OSThread*)-1 }; OSThread* __osRunQueue = __osThreadTail; diff --git a/src/libultra_boot_O1/osDestroyThread.c b/src/libultra_boot_O1/osDestroyThread.c index 5fa3186647..079cd78e06 100644 --- a/src/libultra_boot_O1/osDestroyThread.c +++ b/src/libultra_boot_O1/osDestroyThread.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osDestroyThread(OSThread* thread) { register s32 int_disabled; diff --git a/src/libultra_boot_O1/osGetMemSize.c b/src/libultra_boot_O1/osGetMemSize.c index f1f175224a..00d180dc39 100644 --- a/src/libultra_boot_O1/osGetMemSize.c +++ b/src/libultra_boot_O1/osGetMemSize.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #define STEP 0x100000 diff --git a/src/libultra_boot_O1/osGetThreadId.c b/src/libultra_boot_O1/osGetThreadId.c index 5c2dd5d092..792229c9bf 100644 --- a/src/libultra_boot_O1/osGetThreadId.c +++ b/src/libultra_boot_O1/osGetThreadId.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSId osGetThreadId(OSThread* thread) { if (thread == NULL) { diff --git a/src/libultra_boot_O1/osGetThreadPri.c b/src/libultra_boot_O1/osGetThreadPri.c index d6a7c91607..6c36a7c3b1 100644 --- a/src/libultra_boot_O1/osGetThreadPri.c +++ b/src/libultra_boot_O1/osGetThreadPri.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSPri osGetThreadPri(OSThread* thread) { if (thread == NULL) { diff --git a/src/libultra_boot_O1/osGetTime.c b/src/libultra_boot_O1/osGetTime.c index 9cf6e53079..f053ba8192 100644 --- a/src/libultra_boot_O1/osGetTime.c +++ b/src/libultra_boot_O1/osGetTime.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSTime osGetTime(void) { u32 sp34; diff --git a/src/libultra_boot_O1/osJamMesg.c b/src/libultra_boot_O1/osJamMesg.c index 87c49979d2..c0aa9a4b12 100644 --- a/src/libultra_boot_O1/osJamMesg.c +++ b/src/libultra_boot_O1/osJamMesg.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag) { register s32 int_disabled; diff --git a/src/libultra_boot_O1/osRecvMesg.c b/src/libultra_boot_O1/osRecvMesg.c index f49716cd63..3cb5a8a47f 100644 --- a/src/libultra_boot_O1/osRecvMesg.c +++ b/src/libultra_boot_O1/osRecvMesg.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag) { register s32 s0 = __osDisableInt(); diff --git a/src/libultra_boot_O1/osSendMesg.c b/src/libultra_boot_O1/osSendMesg.c index 53b9147546..617d3bb127 100644 --- a/src/libultra_boot_O1/osSendMesg.c +++ b/src/libultra_boot_O1/osSendMesg.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 osSendMesg(OSMesgQueue* mq, OSMesg mesg, s32 flag) { register u32 s0 = __osDisableInt(); diff --git a/src/libultra_boot_O1/osSetEventMesg.c b/src/libultra_boot_O1/osSetEventMesg.c index 97123969de..615ee24457 100644 --- a/src/libultra_boot_O1/osSetEventMesg.c +++ b/src/libultra_boot_O1/osSetEventMesg.c @@ -1,6 +1,7 @@ -#include +#include "global.h" +#include "ultra64/internal.h" -__OSEventState __osEventStateTab[16]; +__OSEventState __osEventStateTab[OS_NUM_EVENTS + 1]; u32 __osPreNMI = 0; diff --git a/src/libultra_boot_O1/osSetThreadPri.c b/src/libultra_boot_O1/osSetThreadPri.c index 483488e507..b0134d27f1 100644 --- a/src/libultra_boot_O1/osSetThreadPri.c +++ b/src/libultra_boot_O1/osSetThreadPri.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osSetThreadPri(OSThread* thread, OSPri pri) { register u32 s0 = __osDisableInt(); diff --git a/src/libultra_boot_O1/osStartThread.c b/src/libultra_boot_O1/osStartThread.c index f64fa902d9..6b4a53de25 100644 --- a/src/libultra_boot_O1/osStartThread.c +++ b/src/libultra_boot_O1/osStartThread.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osStartThread(OSThread* thread) { register u32 s0 = __osDisableInt(); diff --git a/src/libultra_boot_O1/osStopThread.c b/src/libultra_boot_O1/osStopThread.c index 4d5db6afde..5f005d41a9 100644 --- a/src/libultra_boot_O1/osStopThread.c +++ b/src/libultra_boot_O1/osStopThread.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osStopThread(OSThread* thread) { register u32 s0 = __osDisableInt(); diff --git a/src/libultra_boot_O1/osViExtendVStart.c b/src/libultra_boot_O1/osViExtendVStart.c index 8a09b2ae9d..4808b0e29c 100644 --- a/src/libultra_boot_O1/osViExtendVStart.c +++ b/src/libultra_boot_O1/osViExtendVStart.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osViExtendVStart(u32 arg0) { __additional_scanline = arg0; diff --git a/src/libultra_boot_O1/osViModePalLan1.c b/src/libultra_boot_O1/osViModePalLan1.c index 30df53a7d2..2f69c8197b 100644 --- a/src/libultra_boot_O1/osViModePalLan1.c +++ b/src/libultra_boot_O1/osViModePalLan1.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSViMode osViModePalLan1 = { 0x10, // type diff --git a/src/libultra_boot_O1/osVirtualToPhysical.c b/src/libultra_boot_O1/osVirtualToPhysical.c index b7c118b4bc..30ada113c9 100644 --- a/src/libultra_boot_O1/osVirtualToPhysical.c +++ b/src/libultra_boot_O1/osVirtualToPhysical.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u32 osVirtualToPhysical(void* vaddr) { if ((u32)vaddr >= 0x80000000 && (u32)vaddr < 0xA0000000) { diff --git a/src/libultra_boot_O1/osYieldThread.c b/src/libultra_boot_O1/osYieldThread.c index e289cc9731..3c716032db 100644 --- a/src/libultra_boot_O1/osYieldThread.c +++ b/src/libultra_boot_O1/osYieldThread.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osYieldThread() { register u32 prevInt; diff --git a/src/libultra_boot_O1/piacs.c b/src/libultra_boot_O1/piacs.c index e48cfbcc0b..9a28659455 100644 --- a/src/libultra_boot_O1/piacs.c +++ b/src/libultra_boot_O1/piacs.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u32 __osPiAccessQueueEnabled = 0; diff --git a/src/libultra_boot_O1/timerintr.c b/src/libultra_boot_O1/timerintr.c index 83c882a3b2..f2209cc0d8 100644 --- a/src/libultra_boot_O1/timerintr.c +++ b/src/libultra_boot_O1/timerintr.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSTimer __osBaseTimer; OSTime __osCurrentTime; diff --git a/src/libultra_boot_O2/_Ldtob.c b/src/libultra_boot_O2/_Ldtob.c index 57a49cc8cc..68a9c5404e 100644 --- a/src/libultra_boot_O2/_Ldtob.c +++ b/src/libultra_boot_O2/_Ldtob.c @@ -1,14 +1,11 @@ -#include -#include -#include -#include +#include "global.h" #define BUFF_LEN 0x20 s16 _Ldunscale(s16*, _Pft*); void _Genld(_Pft*, u8, u8*, s16, s16); -const double D_800122E0[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L, 10e127L, 10e255L }; +const f64 D_800122E0[] = { 10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63L, 10e127L, 10e255L }; /* float properties */ #define _D0 0 @@ -161,8 +158,8 @@ void _Ldtob(_Pft* args, u8 type) { s16 _Ldunscale(s16* pex, _Pft* px) { - unsigned short* ps = (unsigned short*)px; - short xchar = (ps[_D0] & _DMASK) >> _DOFF; + u16* ps = (u16*)px; + s16 xchar = (ps[_D0] & _DMASK) >> _DOFF; if (xchar == _DMAX) { /* NaN or INF */ *pex = 0; return (s16)(ps[_D0] & _DFRAC || ps[_D1] || ps[_D2] || ps[_D3] ? NAN : INF); @@ -275,7 +272,7 @@ void _Genld(_Pft* px, u8 code, u8* p, s16 nsig, s16 xexp) { px->n2 = p - (u8*)&px->s[px->n1]; } if ((px->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { /* pad with leading zeros */ - int n = px->n0 + px->n1 + px->nz1 + px->n2 + px->nz2; + s32 n = px->n0 + px->n1 + px->nz1 + px->n2 + px->nz2; if (n < px->width) { px->nz0 = px->width - n; diff --git a/src/libultra_boot_O2/_Litob.c b/src/libultra_boot_O2/_Litob.c index 5b2329cd34..0f9452124f 100644 --- a/src/libultra_boot_O2/_Litob.c +++ b/src/libultra_boot_O2/_Litob.c @@ -1,7 +1,4 @@ -#include -#include -#include -#include +#include "global.h" #define BUFF_LEN 0x18 diff --git a/src/libultra_boot_O2/_Printf.c b/src/libultra_boot_O2/_Printf.c index a5f922d562..e8fa2c6961 100644 --- a/src/libultra_boot_O2/_Printf.c +++ b/src/libultra_boot_O2/_Printf.c @@ -1,7 +1,4 @@ -#include -#include -#include -#include +#include "global.h" #define ATOI(i, a) \ for (i = 0; *a >= '0' && *a <= '9'; a++) \ @@ -17,8 +14,8 @@ } #define _PAD(m, src, extracond) \ if (extracond && m > 0) { \ - int i; \ - int j; \ + s32 i; \ + s32 j; \ for (j = m; j > 0; j -= i) { \ if ((u32)j > 32) \ i = 32; \ @@ -203,7 +200,7 @@ void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac) { break; case 'p': - px->v.ll = (long)va_arg(*pap, void*); + px->v.ll = (s64)va_arg(*pap, void*); px->s = (char*)&ac[px->n0]; _Litob(px, 'x'); break; diff --git a/src/libultra_boot_O2/__osDevMgrMain.c b/src/libultra_boot_O2/__osDevMgrMain.c index 9065b903c0..e481c33fb1 100644 --- a/src/libultra_boot_O2/__osDevMgrMain.c +++ b/src/libultra_boot_O2/__osDevMgrMain.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "ultra64/internal.h" void __osDevMgrMain(void* arg) { OSIoMesg* ioMesg; diff --git a/src/libultra_boot_O2/__osEPiRawReadIo.c b/src/libultra_boot_O2/__osEPiRawReadIo.c index b1e9b88d00..6aa0bf0b68 100644 --- a/src/libultra_boot_O2/__osEPiRawReadIo.c +++ b/src/libultra_boot_O2/__osEPiRawReadIo.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data) { s32 status; diff --git a/src/libultra_boot_O2/__osEPiRawStartDma.c b/src/libultra_boot_O2/__osEPiRawStartDma.c index cc28a6ca9d..9246484486 100644 --- a/src/libultra_boot_O2/__osEPiRawStartDma.c +++ b/src/libultra_boot_O2/__osEPiRawStartDma.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size) { s32 status; diff --git a/src/libultra_boot_O2/__osEPiRawWriteIo.c b/src/libultra_boot_O2/__osEPiRawWriteIo.c index 08d817bfa3..7c5701e0d1 100644 --- a/src/libultra_boot_O2/__osEPiRawWriteIo.c +++ b/src/libultra_boot_O2/__osEPiRawWriteIo.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) { s32 status; diff --git a/src/libultra_boot_O2/__osPiRawStartDma.c b/src/libultra_boot_O2/__osPiRawStartDma.c index 589a63b3ba..d323a66b3b 100644 --- a/src/libultra_boot_O2/__osPiRawStartDma.c +++ b/src/libultra_boot_O2/__osPiRawStartDma.c @@ -1,16 +1,15 @@ -#include -#include +#include "global.h" -s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void* dram_addr, size_t size) { - register int status; +s32 __osPiRawStartDma(s32 dir, u32 cartAddr, void* dramAddr, size_t size) { + register s32 status; status = HW_REG(PI_STATUS_REG, u32); while (status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY | PI_STATUS_ERROR)) { status = HW_REG(PI_STATUS_REG, u32); } - HW_REG(PI_DRAM_ADDR_REG, void*) = (void*)osVirtualToPhysical(dram_addr); + HW_REG(PI_DRAM_ADDR_REG, void*) = (void*)osVirtualToPhysical(dramAddr); - HW_REG(PI_CART_ADDR_REG, void*) = (void*)((osRomBase | cart_addr) & 0x1fffffff); + HW_REG(PI_CART_ADDR_REG, void*) = (void*)((osRomBase | cartAddr) & 0x1fffffff); switch (dir) { case OS_READ: diff --git a/src/libultra_boot_O2/__osSiDeviceBusy.c b/src/libultra_boot_O2/__osSiDeviceBusy.c index 86833fd365..ec2462f83e 100644 --- a/src/libultra_boot_O2/__osSiDeviceBusy.c +++ b/src/libultra_boot_O2/__osSiDeviceBusy.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 __osSiDeviceBusy() { register u32 status; diff --git a/src/libultra_boot_O2/__osSiRawReadIo.c b/src/libultra_boot_O2/__osSiRawReadIo.c index fa26c8e2aa..b68f475e99 100644 --- a/src/libultra_boot_O2/__osSiRawReadIo.c +++ b/src/libultra_boot_O2/__osSiRawReadIo.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 __osSiRawReadIo(void* a0, u32* a1) { if (__osSiDeviceBusy()) { diff --git a/src/libultra_boot_O2/__osSiRawWriteIo.c b/src/libultra_boot_O2/__osSiRawWriteIo.c index 7658b5a97b..91d03f9708 100644 --- a/src/libultra_boot_O2/__osSiRawWriteIo.c +++ b/src/libultra_boot_O2/__osSiRawWriteIo.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 __osSiRawWriteIo(void* a0, u32 a1) { if (__osSiDeviceBusy()) { diff --git a/src/libultra_boot_O2/__osViGetCurrentContext.c b/src/libultra_boot_O2/__osViGetCurrentContext.c index fea88be8fd..f83a2d0ee0 100644 --- a/src/libultra_boot_O2/__osViGetCurrentContext.c +++ b/src/libultra_boot_O2/__osViGetCurrentContext.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSViContext* __osViGetCurrentContext() { return __osViCurr; diff --git a/src/libultra_boot_O2/__osViInit.c b/src/libultra_boot_O2/__osViInit.c index becce34ab9..43f2abb028 100644 --- a/src/libultra_boot_O2/__osViInit.c +++ b/src/libultra_boot_O2/__osViInit.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" OSViContext vi[2] = { 0 }; OSViContext* __osViCurr = &vi[0]; diff --git a/src/libultra_boot_O2/__osViSwapContext.c b/src/libultra_boot_O2/__osViSwapContext.c index 4dcc4c8703..8f202d17c3 100644 --- a/src/libultra_boot_O2/__osViSwapContext.c +++ b/src/libultra_boot_O2/__osViSwapContext.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void __osViSwapContext() { register OSViMode* s0; diff --git a/src/libultra_boot_O2/ldiv.c b/src/libultra_boot_O2/ldiv.c index 391fe79c47..8c53d3d4cc 100644 --- a/src/libultra_boot_O2/ldiv.c +++ b/src/libultra_boot_O2/ldiv.c @@ -1,7 +1,6 @@ -#include -#include +#include "global.h" -ldiv_t ldiv(long num, long denom) { +ldiv_t ldiv(s32 num, s32 denom) { ldiv_t ret; ret.quot = num / denom; @@ -14,7 +13,7 @@ ldiv_t ldiv(long num, long denom) { return ret; } -lldiv_t lldiv(long long num, long long denom) { +lldiv_t lldiv(s64 num, s64 denom) { lldiv_t ret; ret.quot = num / denom; diff --git a/src/libultra_boot_O2/osCartRomInit.c b/src/libultra_boot_O2/osCartRomInit.c index eef5be9fdb..a46e0e09b6 100644 --- a/src/libultra_boot_O2/osCartRomInit.c +++ b/src/libultra_boot_O2/osCartRomInit.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" OSPiHandle __CartRomHandle; diff --git a/src/libultra_boot_O2/osDriveRomInit.c b/src/libultra_boot_O2/osDriveRomInit.c index 4dd49a6299..83b3c9fc66 100644 --- a/src/libultra_boot_O2/osDriveRomInit.c +++ b/src/libultra_boot_O2/osDriveRomInit.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" OSPiHandle __DriveRomHandle; diff --git a/src/libultra_boot_O2/osEPiReadIo.c b/src/libultra_boot_O2/osEPiReadIo.c index 964330c305..d05604a589 100644 --- a/src/libultra_boot_O2/osEPiReadIo.c +++ b/src/libultra_boot_O2/osEPiReadIo.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data) { register s32 ret; diff --git a/src/libultra_boot_O2/osEPiStartDma.c b/src/libultra_boot_O2/osEPiStartDma.c index 83fc694a34..f1dccc8333 100644 --- a/src/libultra_boot_O2/osEPiStartDma.c +++ b/src/libultra_boot_O2/osEPiStartDma.c @@ -1,4 +1,5 @@ -#include +#include "global.h" +#include "ultra64/internal.h" s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction) { s32 ret; diff --git a/src/libultra_boot_O2/osEPiWriteIo.c b/src/libultra_boot_O2/osEPiWriteIo.c index 5d4f61a2fc..0547e69991 100644 --- a/src/libultra_boot_O2/osEPiWriteIo.c +++ b/src/libultra_boot_O2/osEPiWriteIo.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) { register s32 ret; diff --git a/src/libultra_boot_O2/osPiGetCmdQueue.c b/src/libultra_boot_O2/osPiGetCmdQueue.c index 1f097a9269..a4454ec825 100644 --- a/src/libultra_boot_O2/osPiGetCmdQueue.c +++ b/src/libultra_boot_O2/osPiGetCmdQueue.c @@ -1,4 +1,5 @@ -#include +#include "global.h" +#include "ultra64/internal.h" OSMesgQueue* osPiGetCmdQueue() { if (!__osPiDevMgr.initialized) { diff --git a/src/libultra_boot_O2/osViBlack.c b/src/libultra_boot_O2/osViBlack.c index 753619b8b1..3e877a387c 100644 --- a/src/libultra_boot_O2/osViBlack.c +++ b/src/libultra_boot_O2/osViBlack.c @@ -1,4 +1,4 @@ -#include +#include "global.h" // TODO: name magic constants void osViBlack(u8 active) { diff --git a/src/libultra_boot_O2/osViGetNextFramebuffer.c b/src/libultra_boot_O2/osViGetNextFramebuffer.c index a8b642603a..86f8549ab5 100644 --- a/src/libultra_boot_O2/osViGetNextFramebuffer.c +++ b/src/libultra_boot_O2/osViGetNextFramebuffer.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void* osViGetNextFramebuffer() { s32 prevInt = __osDisableInt(); diff --git a/src/libultra_boot_O2/osViModeFpalLan1.c b/src/libultra_boot_O2/osViModeFpalLan1.c index 357b5837aa..f3e7421bab 100644 --- a/src/libultra_boot_O2/osViModeFpalLan1.c +++ b/src/libultra_boot_O2/osViModeFpalLan1.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSViMode osViModeFpalLan1 = { 0x2C, // type diff --git a/src/libultra_boot_O2/osViModeMpalLan1.c b/src/libultra_boot_O2/osViModeMpalLan1.c index 5e75ea39aa..b872b897ec 100644 --- a/src/libultra_boot_O2/osViModeMpalLan1.c +++ b/src/libultra_boot_O2/osViModeMpalLan1.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSViMode osViModeMpalLan1 = { 0x1E, // type diff --git a/src/libultra_boot_O2/osViModeNtscLan1.c b/src/libultra_boot_O2/osViModeNtscLan1.c index 267c5eaf0d..80330f21e1 100644 --- a/src/libultra_boot_O2/osViModeNtscLan1.c +++ b/src/libultra_boot_O2/osViModeNtscLan1.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSViMode osViModeNtscLan1 = { 2, // type diff --git a/src/libultra_boot_O2/osViSetMode.c b/src/libultra_boot_O2/osViSetMode.c index 6b7a5e21a2..db3e7fc2a6 100644 --- a/src/libultra_boot_O2/osViSetMode.c +++ b/src/libultra_boot_O2/osViSetMode.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osViSetMode(OSViMode* mode) { register u32 int_disabled = __osDisableInt(); diff --git a/src/libultra_boot_O2/osViSetSpecialFeatures.c b/src/libultra_boot_O2/osViSetSpecialFeatures.c index ab949ba317..63e8ab5f31 100644 --- a/src/libultra_boot_O2/osViSetSpecialFeatures.c +++ b/src/libultra_boot_O2/osViSetSpecialFeatures.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osViSetSpecialFeatures(u32 func) { register u32 int_disabled = __osDisableInt(); diff --git a/src/libultra_boot_O2/osViSetXScale.c b/src/libultra_boot_O2/osViSetXScale.c index 3c3103c462..e6a9ec6bb6 100644 --- a/src/libultra_boot_O2/osViSetXScale.c +++ b/src/libultra_boot_O2/osViSetXScale.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osViSetXScale(f32 value) { register u32 nomValue; diff --git a/src/libultra_boot_O2/osViSetYScale.c b/src/libultra_boot_O2/osViSetYScale.c index 91f12fed2c..cde3b56b03 100644 --- a/src/libultra_boot_O2/osViSetYScale.c +++ b/src/libultra_boot_O2/osViSetYScale.c @@ -1,6 +1,6 @@ -#include +#include "global.h" -void osViSetYScale(float scale) { +void osViSetYScale(f32 scale) { register s32 prevInt; prevInt = __osDisableInt(); diff --git a/src/libultra_boot_O2/osViSwapBuffer.c b/src/libultra_boot_O2/osViSwapBuffer.c index c671a50f00..13995291de 100644 --- a/src/libultra_boot_O2/osViSwapBuffer.c +++ b/src/libultra_boot_O2/osViSwapBuffer.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osViSwapBuffer(void* vaddr) { u32 int_disabled = __osDisableInt(); diff --git a/src/libultra_boot_O2/pimgr.c b/src/libultra_boot_O2/pimgr.c index 581f66f480..4239f8f786 100644 --- a/src/libultra_boot_O2/pimgr.c +++ b/src/libultra_boot_O2/pimgr.c @@ -1,4 +1,5 @@ -#include +#include "global.h" +#include "ultra64/internal.h" OSMgrArgs __osPiDevMgr = { 0 }; diff --git a/src/libultra_boot_O2/sprintf.c b/src/libultra_boot_O2/sprintf.c index 2ff0b33e06..96698b79e1 100644 --- a/src/libultra_boot_O2/sprintf.c +++ b/src/libultra_boot_O2/sprintf.c @@ -1,4 +1,4 @@ -#include +#include "global.h" char* proutSprintf(char* dst, const char* fmt, size_t size) { return (char*)memcpy(dst, fmt, size) + size; diff --git a/src/libultra_boot_O2/string.c b/src/libultra_boot_O2/string.c index 529ba37d8f..cea07c2533 100644 --- a/src/libultra_boot_O2/string.c +++ b/src/libultra_boot_O2/string.c @@ -1,4 +1,4 @@ -#include +#include "global.h" const u8* strchr(const u8* str, s32 ch) { u8 c = ch; diff --git a/src/libultra_boot_O2/vimgr.c b/src/libultra_boot_O2/vimgr.c index d2839078ef..5525ec74f5 100644 --- a/src/libultra_boot_O2/vimgr.c +++ b/src/libultra_boot_O2/vimgr.c @@ -1,4 +1,5 @@ -#include +#include "global.h" +#include "ultra64/internal.h" typedef struct { u16 unk00; diff --git a/src/libultra_code/__osSpGetStatus.c b/src/libultra_code/__osSpGetStatus.c deleted file mode 100644 index cd68e408c7..0000000000 --- a/src/libultra_code/__osSpGetStatus.c +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include -#include - -u32 __osSpGetStatus() { - return HW_REG(SP_STATUS_REG, u32); -} diff --git a/src/libultra_code/libultra_internal.h b/src/libultra_code/libultra_internal.h deleted file mode 100644 index 6a6e7caacc..0000000000 --- a/src/libultra_code/libultra_internal.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _LIBULTRA_INTERNAL_H_ -#define _LIBULTRA_INTERNAL_H_ -#include - -// TODO: rename these -// SM64 OOT -s32 __osDisableInt(); -void __osRestoreInt(s32); -void __osEnqueueAndYield(OSThread**); -void __osDequeueThread(OSThread**, OSThread*); -void __osEnqueueThread(OSThread**, OSThread*); -OSThread* __osPopThread(OSThread**); -s32 __osSiRawStartDma(s32, void*); -void __osSiCreateAccessQueue(); -void __osSiGetAccess(); -void __osSiRelAccess(); -u32 __osProbeTLB(void*); -void __osPiCreateAccessQueue(); -void __osPiGetAccess(); -void __osSetSR(u32); -u32 __osGetSR(); -void __osSetFpcCsr(u32); -u32 __osGetFpcCsr(); -s32 __osSiRawReadIo(void*, u32*); -s32 __osSiRawWriteIo(void*, u32); -s32 osPiRawReadIo(u32 a0, u32 *a1); -void __osSpSetStatus(u32); -u32 __osSpGetStatus(); -s32 __osSpSetPc(void*); -s32 __osSpDeviceBusy(); -s32 __osSiDeviceBusy(); -s32 __osSpRawStartDma(u32 dir, void *sp_ptr, void *dram_ptr, size_t size); -void __osViInit(); -//OSViContext * __osViGetCurrentContext(); -void __osViSwapContext(); -void __osSetTimerIntr(OSTime); -OSTime __osInsertTimer(OSTimer *); -void __osSetCompare(u32); -s32 __osAiDeviceBusy(); -void __osDispatchThread(); -u32 __osGetCause(); -s32 __osAtomicDec(u32*); -#endif diff --git a/src/libultra_code/osAi.h b/src/libultra_code/osAi.h deleted file mode 100644 index 276fa071ad..0000000000 --- a/src/libultra_code/osAi.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _OSAI_H_ -#define _OSAI_H_ - -s32 osAiSetFrequency(u32); -s32 osAiSetNextBuffer(void *, u32); -u32 osAiGetLength(void); -#endif diff --git a/src/libultra_code/osAiGetLength.c b/src/libultra_code/osAiGetLength.c deleted file mode 100644 index cd37a222b6..0000000000 --- a/src/libultra_code/osAiGetLength.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libultra_internal.h" -#include "osAi.h" -#include - -u32 osAiGetLength() { - return HW_REG(AI_LEN_REG, u32); -} diff --git a/src/libultra_code/llcvt.c b/src/libultra_code_O1/llcvt.c similarity index 94% rename from src/libultra_code/llcvt.c rename to src/libultra_code_O1/llcvt.c index c3da2e49e1..c88d6f04fd 100644 --- a/src/libultra_code/llcvt.c +++ b/src/libultra_code_O1/llcvt.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s64 __d_to_ll(f64 d) { return d; diff --git a/src/libultra_code/osSetTimer.c b/src/libultra_code_O1/osSetTimer.c similarity index 97% rename from src/libultra_code/osSetTimer.c rename to src/libultra_code_O1/osSetTimer.c index fd78ba184b..90e31ecbeb 100644 --- a/src/libultra_code/osSetTimer.c +++ b/src/libultra_code_O1/osSetTimer.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg) { OSTime time; diff --git a/src/libultra_code/osStopTimer.c b/src/libultra_code_O1/osStopTimer.c similarity index 96% rename from src/libultra_code/osStopTimer.c rename to src/libultra_code_O1/osStopTimer.c index 6e8a94fc8d..627d57b75d 100644 --- a/src/libultra_code/osStopTimer.c +++ b/src/libultra_code_O1/osStopTimer.c @@ -1,4 +1,4 @@ -#include +#include "global.h" s32 osStopTimer(OSTimer* timer) { register s32 prevInt; diff --git a/src/libultra_code/__osContAddressCrc.c b/src/libultra_code_O2/__osContAddressCrc.c similarity index 85% rename from src/libultra_code/__osContAddressCrc.c rename to src/libultra_code_O2/__osContAddressCrc.c index 64b7749bde..9b0c779ec1 100644 --- a/src/libultra_code/__osContAddressCrc.c +++ b/src/libultra_code_O2/__osContAddressCrc.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" // Valid addr up to 0x7FF // It's the address of a block of 0x20 bytes in the mempak @@ -11,8 +9,8 @@ u8 __osContAddressCrc(u16 addr) { u32 bit; s32 i; - for (bit = 0x400; bit; bit /= 2) { - ret *= 2; + for (bit = 0x400; bit; bit >>= 1) { + ret <<= 1; if (addr32 & bit) { if (ret & 0x20) { ret ^= 0x14; @@ -41,8 +39,8 @@ u8 __osContDataCrc(u8* data) { ret = 0; for (byte = 0x20; byte; --byte, ++data) { - for (bit = 0x80; bit; bit /= 2) { - ret *= 2; + for (bit = 0x80; bit; bit >>= 1) { + ret <<= 1; if ((*data & bit) != 0) { if ((ret & 0x100) != 0) { ret ^= 0x84; @@ -57,7 +55,7 @@ u8 __osContDataCrc(u8* data) { } } do { - ret *= 2; + ret <<= 1; if (ret & 0x100) { ret ^= 0x85; } diff --git a/src/libultra_code/__osContRamRead.c b/src/libultra_code_O2/__osContRamRead.c similarity index 96% rename from src/libultra_code/__osContRamRead.c rename to src/libultra_code_O2/__osContRamRead.c index be6d3e2894..07c72e54b0 100644 --- a/src/libultra_code/__osContRamRead.c +++ b/src/libultra_code_O2/__osContRamRead.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" #define BLOCKSIZE 32 diff --git a/src/libultra_code/__osContRamWrite.c b/src/libultra_code_O2/__osContRamWrite.c similarity index 93% rename from src/libultra_code/__osContRamWrite.c rename to src/libultra_code_O2/__osContRamWrite.c index d26ca579ef..4c5c166962 100644 --- a/src/libultra_code/__osContRamWrite.c +++ b/src/libultra_code_O2/__osContRamWrite.c @@ -1,6 +1,5 @@ -#include -#include -#include +#include "ultra64.h" +#include "global.h" s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force) { s32 ret = 0; @@ -23,7 +22,7 @@ s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 __osPfsLastChannel = channel; // clang-format off - for (i = 0; i < channel; i++) { *ptr++ = 0; } + for (i = 0; i < channel; i++) { *ptr++ = 0; } // clang-format on pifMempakBuf.status = 1; diff --git a/src/libultra_code/__osGetActiveQueue.c b/src/libultra_code_O2/__osGetActiveQueue.c similarity index 76% rename from src/libultra_code/__osGetActiveQueue.c rename to src/libultra_code_O2/__osGetActiveQueue.c index a218582cfb..36919dc59a 100644 --- a/src/libultra_code/__osGetActiveQueue.c +++ b/src/libultra_code_O2/__osGetActiveQueue.c @@ -1,4 +1,4 @@ -#include +#include "global.h" OSThread* __osGetActiveQueue() { return __osActiveQueue; diff --git a/src/libultra_code/__osGetCurrFaultedThread.c b/src/libultra_code_O2/__osGetCurrFaultedThread.c similarity index 63% rename from src/libultra_code/__osGetCurrFaultedThread.c rename to src/libultra_code_O2/__osGetCurrFaultedThread.c index 23b73d853e..b10b5f5086 100644 --- a/src/libultra_code/__osGetCurrFaultedThread.c +++ b/src/libultra_code_O2/__osGetCurrFaultedThread.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" OSThread* __osGetCurrFaultedThread() { return __osFaultedThread; diff --git a/src/libultra_code/__osPfsGetStatus.c b/src/libultra_code_O2/__osPfsGetStatus.c similarity index 97% rename from src/libultra_code/__osPfsGetStatus.c rename to src/libultra_code_O2/__osPfsGetStatus.c index a05f722b16..aa2b8a6ff0 100644 --- a/src/libultra_code/__osPfsGetStatus.c +++ b/src/libultra_code_O2/__osPfsGetStatus.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" OSPifRam pifMempakBuf; diff --git a/src/libultra_code/__osPfsSelectBank.c b/src/libultra_code_O2/__osPfsSelectBank.c similarity index 87% rename from src/libultra_code/__osPfsSelectBank.c rename to src/libultra_code_O2/__osPfsSelectBank.c index 6e7acc82f9..d257e04911 100644 --- a/src/libultra_code/__osPfsSelectBank.c +++ b/src/libultra_code_O2/__osPfsSelectBank.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64/pfs.h" +#include "global.h" s32 __osPfsSelectBank(OSPfs* pfs, u8 bank) { u8 temp[BLOCKSIZE]; diff --git a/src/libultra_code/__osSiCreateAccessQueue.c b/src/libultra_code_O2/__osSiCreateAccessQueue.c similarity index 88% rename from src/libultra_code/__osSiCreateAccessQueue.c rename to src/libultra_code_O2/__osSiCreateAccessQueue.c index 5f886339d1..c46df56f62 100644 --- a/src/libultra_code/__osSiCreateAccessQueue.c +++ b/src/libultra_code_O2/__osSiCreateAccessQueue.c @@ -1,7 +1,4 @@ -#include -#include - -#include +#include "global.h" OSMesg osSiMesgBuff[SIAccessQueueSize]; OSMesgQueue gOSSiMessageQueue; diff --git a/src/libultra_code/__osSiRawStartDma.c b/src/libultra_code_O2/__osSiRawStartDma.c similarity index 90% rename from src/libultra_code/__osSiRawStartDma.c rename to src/libultra_code_O2/__osSiRawStartDma.c index d440366575..00b80b4b0a 100644 --- a/src/libultra_code/__osSiRawStartDma.c +++ b/src/libultra_code_O2/__osSiRawStartDma.c @@ -1,5 +1,4 @@ -#include "libultra_internal.h" -#include +#include "global.h" s32 __osSiRawStartDma(s32 dir, void* addr) { if (HW_REG(SI_STATUS_REG, u32) & (SI_STATUS_DMA_BUSY | SI_STATUS_IO_READ_BUSY)) { diff --git a/src/libultra_code_O2/__osSpGetStatus.c b/src/libultra_code_O2/__osSpGetStatus.c new file mode 100644 index 0000000000..8987b2414a --- /dev/null +++ b/src/libultra_code_O2/__osSpGetStatus.c @@ -0,0 +1,5 @@ +#include "global.h" + +u32 __osSpGetStatus() { + return HW_REG(SP_STATUS_REG, u32); +} diff --git a/src/libultra_code/__osSpRawStartDma.c b/src/libultra_code_O2/__osSpRawStartDma.c similarity index 59% rename from src/libultra_code/__osSpRawStartDma.c rename to src/libultra_code_O2/__osSpRawStartDma.c index 2b2a7fa3e1..6a1b01b2af 100644 --- a/src/libultra_code/__osSpRawStartDma.c +++ b/src/libultra_code_O2/__osSpRawStartDma.c @@ -1,12 +1,10 @@ -#include -#include -#include +#include "global.h" -s32 __osSpRawStartDma(s32 direction, u32 devAddr, void* dramAddr, u32 size) { +s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, u32 size) { if (__osSpDeviceBusy()) { return -1; } - HW_REG(SP_MEM_ADDR_REG, u32) = devAddr; + HW_REG(SP_MEM_ADDR_REG, u32) = (u32)devAddr; HW_REG(SP_DRAM_ADDR_REG, u32) = osVirtualToPhysical(dramAddr); if (direction == OS_READ) { HW_REG(SP_WR_LEN_REG, u32) = size - 1; diff --git a/src/libultra_code/__osSpSetPc.c b/src/libultra_code_O2/__osSpSetPc.c similarity index 75% rename from src/libultra_code/__osSpSetPc.c rename to src/libultra_code_O2/__osSpSetPc.c index 55f78259b8..2c3cc32ba0 100644 --- a/src/libultra_code/__osSpSetPc.c +++ b/src/libultra_code_O2/__osSpSetPc.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" s32 __osSpSetPc(void* pc) { register u32 spStatus = HW_REG(SP_STATUS_REG, u32); diff --git a/src/libultra_code/__osSpSetStatus.c b/src/libultra_code_O2/__osSpSetStatus.c similarity index 50% rename from src/libultra_code/__osSpSetStatus.c rename to src/libultra_code_O2/__osSpSetStatus.c index 01cf1adc1a..670dc1f3bc 100644 --- a/src/libultra_code/__osSpSetStatus.c +++ b/src/libultra_code_O2/__osSpSetStatus.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" void __osSpSetStatus(u32 a0) { HW_REG(SP_STATUS_REG, u32) = a0; diff --git a/src/libultra_code/code_800E6840.c b/src/libultra_code_O2/code_800E6840.c similarity index 93% rename from src/libultra_code/code_800E6840.c rename to src/libultra_code_O2/code_800E6840.c index 085f2acf55..b5099ce9f8 100644 --- a/src/libultra_code/code_800E6840.c +++ b/src/libultra_code_O2/code_800E6840.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void func_800E6840(void* buf, s32 size) { OSIntMask prevMask = osSetIntMask(1); diff --git a/src/libultra_code/code_80102FA0.c b/src/libultra_code_O2/code_80102FA0.c similarity index 64% rename from src/libultra_code/code_80102FA0.c rename to src/libultra_code_O2/code_80102FA0.c index cd2a089618..fe6c1d3ee2 100644 --- a/src/libultra_code/code_80102FA0.c +++ b/src/libultra_code_O2/code_80102FA0.c @@ -1,4 +1,4 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_80102FA0/func_80102FA0.s") diff --git a/src/libultra_code/code_80104D60.c b/src/libultra_code_O2/code_80104D60.c similarity index 65% rename from src/libultra_code/code_80104D60.c rename to src/libultra_code_O2/code_80104D60.c index 379ed79c29..12cb746a58 100644 --- a/src/libultra_code/code_80104D60.c +++ b/src/libultra_code_O2/code_80104D60.c @@ -1,4 +1,4 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/code/code_80104D60/osPfsFileState.s") diff --git a/src/libultra_code/contpfs.c b/src/libultra_code_O2/contpfs.c similarity index 99% rename from src/libultra_code/contpfs.c rename to src/libultra_code_O2/contpfs.c index 4f0aa41cea..a9b2028eee 100644 --- a/src/libultra_code/contpfs.c +++ b/src/libultra_code_O2/contpfs.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" extern __OSInode __osPfsInodeCache; // bss s32 __osPfsInodeCacheChannel = -1; diff --git a/src/libultra_code/contquery.c b/src/libultra_code_O2/contquery.c similarity index 94% rename from src/libultra_code/contquery.c rename to src/libultra_code_O2/contquery.c index 6f6def55bb..ffcdea0416 100644 --- a/src/libultra_code/contquery.c +++ b/src/libultra_code_O2/contquery.c @@ -1,5 +1,4 @@ -#include "libultra_internal.h" -#include +#include "global.h" /** * osContStartQuery: diff --git a/src/libultra_code/cosf.c b/src/libultra_code_O2/cosf.c similarity index 93% rename from src/libultra_code/cosf.c rename to src/libultra_code_O2/cosf.c index 75dce4efdd..56ef995c78 100644 --- a/src/libultra_code/cosf.c +++ b/src/libultra_code_O2/cosf.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" static const du P[] = { { 0x3FF00000, 0x00000000 }, { 0xBFC55554, 0xBC83656D }, { 0x3F8110ED, 0x3804C2A0 }, @@ -30,7 +30,7 @@ f32 cosf(f32 x) { if (xpt < 0x136) { - absx = ULTRA_ABS(x); + absx = (x > 0) ? x : -x; dx = absx; diff --git a/src/libultra_code/coss.c b/src/libultra_code_O2/coss.c similarity index 53% rename from src/libultra_code/coss.c rename to src/libultra_code_O2/coss.c index 1f2a260dd6..2dca0234b2 100644 --- a/src/libultra_code/coss.c +++ b/src/libultra_code_O2/coss.c @@ -1,5 +1,4 @@ -#include "libultra_internal.h" -#include +#include "global.h" s16 coss(u16 angle) { return sins(angle + 0x4000); diff --git a/src/libultra_code/guLookAt.c b/src/libultra_code_O2/guLookAt.c similarity index 97% rename from src/libultra_code/guLookAt.c rename to src/libultra_code_O2/guLookAt.c index 0c95c7f5ee..ca55602143 100644 --- a/src/libultra_code/guLookAt.c +++ b/src/libultra_code_O2/guLookAt.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void guLookAtF(f32 mf[4][4], f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp) { f32 length; diff --git a/src/libultra_code/guLookAtHilite.c b/src/libultra_code_O2/guLookAtHilite.c similarity index 98% rename from src/libultra_code/guLookAtHilite.c rename to src/libultra_code_O2/guLookAtHilite.c index a15dd7b54e..4af14abae5 100644 --- a/src/libultra_code/guLookAtHilite.c +++ b/src/libultra_code_O2/guLookAtHilite.c @@ -1,5 +1,4 @@ -#include "libultra_internal.h" -#include +#include "global.h" #define FTOFRAC8(x) ((s32)MIN(((x) * (128.0f)), 127.0f) & 0xff) diff --git a/src/libultra_code/guPerspectiveF.c b/src/libultra_code_O2/guPerspectiveF.c similarity index 65% rename from src/libultra_code/guPerspectiveF.c rename to src/libultra_code_O2/guPerspectiveF.c index 503bcc25a4..df69888cf6 100644 --- a/src/libultra_code/guPerspectiveF.c +++ b/src/libultra_code_O2/guPerspectiveF.c @@ -1,9 +1,9 @@ -#include "libultra_internal.h" +#include "global.h" -void guPerspectiveF(float mf[4][4], u16* perspNorm, float fovy, float aspect, float near, float far, float scale) { - float yscale; - int row; - int col; +void guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) { + f32 yscale; + s32 row; + s32 col; guMtxIdentF(mf); fovy *= GU_PI / 180.0; yscale = cosf(fovy / 2) / sinf(fovy / 2); @@ -22,15 +22,15 @@ void guPerspectiveF(float mf[4][4], u16* perspNorm, float fovy, float aspect, fl if (near + far <= 2.0) { *perspNorm = 65535; } else { - *perspNorm = (double)(1 << 17) / (near + far); + *perspNorm = (f64)(1 << 17) / (near + far); if (*perspNorm <= 0) { *perspNorm = 1; } } } } -void guPerspective(Mtx* m, u16* perspNorm, float fovy, float aspect, float near, float far, float scale) { - float mat[4][4]; +void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) { + f32 mat[4][4]; guPerspectiveF(mat, perspNorm, fovy, aspect, near, far, scale); guMtxF2L(mat, m); } diff --git a/src/libultra_code/guPosition.c b/src/libultra_code_O2/guPosition.c similarity index 97% rename from src/libultra_code/guPosition.c rename to src/libultra_code_O2/guPosition.c index 11eae1034d..25dfe5c8ef 100644 --- a/src/libultra_code/guPosition.c +++ b/src/libultra_code_O2/guPosition.c @@ -1,4 +1,4 @@ -#include "libultra_internal.h" +#include "global.h" /** * guPositionF diff --git a/src/libultra_code/guS2DInitBg.c b/src/libultra_code_O2/guS2DInitBg.c similarity index 97% rename from src/libultra_code/guS2DInitBg.c rename to src/libultra_code_O2/guS2DInitBg.c index 32c46f1693..0d75648f94 100644 --- a/src/libultra_code/guS2DInitBg.c +++ b/src/libultra_code_O2/guS2DInitBg.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void guS2DInitBg(uObjBg* bg) { u16 shift; diff --git a/src/libultra_code/ortho.c b/src/libultra_code_O2/ortho.c similarity index 94% rename from src/libultra_code/ortho.c rename to src/libultra_code_O2/ortho.c index 259aca5e71..70e64e9d20 100644 --- a/src/libultra_code/ortho.c +++ b/src/libultra_code_O2/ortho.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" void guOrthoF(f32 mf[4][4], f32 left, f32 right, f32 bottom, f32 top, f32 near, f32 far, f32 scale) { s32 i, j; diff --git a/src/libultra_code/osAfterPreNMI.c b/src/libultra_code_O2/osAfterPreNMI.c similarity index 57% rename from src/libultra_code/osAfterPreNMI.c rename to src/libultra_code_O2/osAfterPreNMI.c index 19ccdb6f69..b59814763f 100644 --- a/src/libultra_code/osAfterPreNMI.c +++ b/src/libultra_code_O2/osAfterPreNMI.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" s32 osAfterPreNMI(void) { return __osSpSetPc(0); diff --git a/src/libultra_code_O2/osAiGetLength.c b/src/libultra_code_O2/osAiGetLength.c new file mode 100644 index 0000000000..90be706cbc --- /dev/null +++ b/src/libultra_code_O2/osAiGetLength.c @@ -0,0 +1,5 @@ +#include "global.h" + +u32 osAiGetLength() { + return HW_REG(AI_LEN_REG, u32); +} diff --git a/src/libultra_code/osAiSetFrequency.c b/src/libultra_code_O2/osAiSetFrequency.c similarity index 89% rename from src/libultra_code/osAiSetFrequency.c rename to src/libultra_code_O2/osAiSetFrequency.c index f16d8cec3b..f0606809e4 100644 --- a/src/libultra_code/osAiSetFrequency.c +++ b/src/libultra_code_O2/osAiSetFrequency.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 osAiSetFrequency(u32 frequency) { u32 dacRate; diff --git a/src/libultra_code/osAiSetNextBuffer.c b/src/libultra_code_O2/osAiSetNextBuffer.c similarity index 91% rename from src/libultra_code/osAiSetNextBuffer.c rename to src/libultra_code_O2/osAiSetNextBuffer.c index 9896e55f0a..0669ee506c 100644 --- a/src/libultra_code/osAiSetNextBuffer.c +++ b/src/libultra_code_O2/osAiSetNextBuffer.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" s32 osAiSetNextBuffer(void* buf, u32 size) { static u8 D_80130500 = false; diff --git a/src/libultra_code/osContInit.c b/src/libultra_code_O2/osContInit.c similarity index 97% rename from src/libultra_code/osContInit.c rename to src/libultra_code_O2/osContInit.c index 8a0bd6b103..8f10e854df 100644 --- a/src/libultra_code/osContInit.c +++ b/src/libultra_code_O2/osContInit.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" OSPifRam __osPifInternalBuff; u8 __osContLastPoll; diff --git a/src/libultra_code_O2/osContQuery.c b/src/libultra_code_O2/osContQuery.c new file mode 100644 index 0000000000..ffcdea0416 --- /dev/null +++ b/src/libultra_code_O2/osContQuery.c @@ -0,0 +1,32 @@ +#include "global.h" + +/** + * osContStartQuery: + * Starts to read the values for SI device status and type which are connected to the controller port and joyport + * connector. + **/ + +s32 osContStartQuery(OSMesgQueue* mq) { + s32 ret; + ret = 0; + + __osSiGetAccess(); + if (__osContLastPoll != CONT_CMD_REQUEST_STATUS) { + __osPackRequestData(CONT_CMD_REQUEST_STATUS); + ret = __osSiRawStartDma(OS_WRITE, &__osPifInternalBuff); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + } + ret = __osSiRawStartDma(OS_READ, &__osPifInternalBuff); + __osContLastPoll = CONT_CMD_REQUEST_STATUS; + __osSiRelAccess(); + return ret; +} + +/** + * osContGetQuery: + * Returns the values from osContStartQuery to status. Both functions must be paired for use. + **/ +void osContGetQuery(OSContStatus* data) { + u8 pattern; + __osContGetInitData(&pattern, data); +} diff --git a/src/libultra_code/osContSetCh.c b/src/libultra_code_O2/osContSetCh.c similarity index 91% rename from src/libultra_code/osContSetCh.c rename to src/libultra_code_O2/osContSetCh.c index cd5c09de96..0e7502b0cf 100644 --- a/src/libultra_code/osContSetCh.c +++ b/src/libultra_code_O2/osContSetCh.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" /* * s32 osContSetCh(u8 ch) diff --git a/src/libultra_code/osContStartReadData.c b/src/libultra_code_O2/osContStartReadData.c similarity index 95% rename from src/libultra_code/osContStartReadData.c rename to src/libultra_code_O2/osContStartReadData.c index d45b07f6e8..59ead072c8 100644 --- a/src/libultra_code/osContStartReadData.c +++ b/src/libultra_code_O2/osContStartReadData.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" s32 osContStartReadData(OSMesgQueue* mq) { s32 ret; diff --git a/src/libultra_code/osDpGetStatus.c b/src/libultra_code_O2/osDpGetStatus.c similarity index 73% rename from src/libultra_code/osDpGetStatus.c rename to src/libultra_code_O2/osDpGetStatus.c index f9c87f1fb2..b5267b060d 100644 --- a/src/libultra_code/osDpGetStatus.c +++ b/src/libultra_code_O2/osDpGetStatus.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u32 osDpGetStatus(void) { return DPC_STATUS_REG; diff --git a/src/libultra_code/osDpSetStatus.c b/src/libultra_code_O2/osDpSetStatus.c similarity index 76% rename from src/libultra_code/osDpSetStatus.c rename to src/libultra_code_O2/osDpSetStatus.c index d57ca509e3..ecd3f77e07 100644 --- a/src/libultra_code/osDpSetStatus.c +++ b/src/libultra_code_O2/osDpSetStatus.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osDpSetStatus(u32 status) { DPC_STATUS_REG = status; diff --git a/src/libultra_code_O2/osMempakAddrCRC.c b/src/libultra_code_O2/osMempakAddrCRC.c new file mode 100644 index 0000000000..c902651bab --- /dev/null +++ b/src/libultra_code_O2/osMempakAddrCRC.c @@ -0,0 +1,65 @@ +#include "global.h" + +// Valid addr up to 0x7FF +// It's the address of a block of 0x20 bytes in the mempak +// So that means the whole mempak has a 16-bit address space +u8 __osContAddressCrc(u16 addr) { + u32 addr32 = addr; + u32 ret = 0; + u32 bit; + s32 i; + + for (bit = 0x400; bit; bit /= 2) { + ret *= 2; + if (addr32 & bit) { + if (ret & 0x20) { + ret ^= 0x14; + } else { + ++ret; + } + } else { + if (ret & 0x20) { + ret ^= 0x15; + } + } + } + for (i = 0; i < 5; ++i) { + ret <<= 1; + if (ret & 0x20) { + ret ^= 0x15; + } + } + return ret & 0x1f; +} + +u8 __osContDataCrc(u8* data) { + s32 ret; + u32 bit; + u32 byte; + + ret = 0; + for (byte = 0x20; byte; --byte, ++data) { + for (bit = 0x80; bit; bit /= 2) { + ret *= 2; + if ((*data & bit) != 0) { + if ((ret & 0x100) != 0) { + ret ^= 0x84; + } else { + ++ret; + } + } else { + if (ret & 0x100) { + ret ^= 0x85; + } + } + } + } + do { + ret *= 2; + if (ret & 0x100) { + ret ^= 0x85; + } + ++byte; + } while (byte < 8U); + return ret; +} diff --git a/src/libultra_code/osPfsDeleteFile.c b/src/libultra_code_O2/osPfsDeleteFile.c similarity index 85% rename from src/libultra_code/osPfsDeleteFile.c rename to src/libultra_code_O2/osPfsDeleteFile.c index e44a5633ce..b9ec018c20 100644 --- a/src/libultra_code/osPfsDeleteFile.c +++ b/src/libultra_code_O2/osPfsDeleteFile.c @@ -1,7 +1,7 @@ -#include -#include +#include "ultra64/pfs.h" +#include "global.h" -s32 osPfsDeleteFile(OSPfs* pfs, u16 company_code, u32 game_code, u8* game_name, u8* ext_name) { +s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName) { s32 file_no; s32 ret; @@ -11,10 +11,10 @@ s32 osPfsDeleteFile(OSPfs* pfs, u16 company_code, u32 game_code, u8* game_name, u8 startpage; u8 bank; - if ((company_code == 0) || (game_code == 0)) { + if ((companyCode == 0) || (gameCode == 0)) { return PFS_ERR_INVALID; } - if ((ret = osPfsFindFile(pfs, company_code, game_code, game_name, ext_name, &file_no)) != 0) { + if ((ret = osPfsFindFile(pfs, companyCode, gameCode, gameName, extName, &file_no)) != 0) { return ret; } if ((pfs->activebank != 0) && (ret = __osPfsSelectBank(pfs, 0)) != 0) { diff --git a/src/libultra_code/osPfsFindFile.c b/src/libultra_code_O2/osPfsFindFile.c similarity index 97% rename from src/libultra_code/osPfsFindFile.c rename to src/libultra_code_O2/osPfsFindFile.c index 4320aca4b3..0ee5e538d3 100644 --- a/src/libultra_code/osPfsFindFile.c +++ b/src/libultra_code_O2/osPfsFindFile.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo) { s32 j; diff --git a/src/libultra_code/osPfsFreeBlocks.c b/src/libultra_code_O2/osPfsFreeBlocks.c similarity index 92% rename from src/libultra_code/osPfsFreeBlocks.c rename to src/libultra_code_O2/osPfsFreeBlocks.c index 912af74157..c7e7adcbfe 100644 --- a/src/libultra_code/osPfsFreeBlocks.c +++ b/src/libultra_code_O2/osPfsFreeBlocks.c @@ -1,6 +1,6 @@ -#include -#include -#include +#include "ultra64.h" +#include "global.h" +#include "ultra64/pfs.h" s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes) { s32 j; diff --git a/src/libultra_code/osPfsIsPlug.c b/src/libultra_code_O2/osPfsIsPlug.c similarity index 98% rename from src/libultra_code/osPfsIsPlug.c rename to src/libultra_code_O2/osPfsIsPlug.c index bb221a07e2..329610ac50 100644 --- a/src/libultra_code/osPfsIsPlug.c +++ b/src/libultra_code_O2/osPfsIsPlug.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern) { s32 ret = 0; diff --git a/src/libultra_code_O2/osReadMempak.c b/src/libultra_code_O2/osReadMempak.c new file mode 100644 index 0000000000..07c72e54b0 --- /dev/null +++ b/src/libultra_code_O2/osReadMempak.c @@ -0,0 +1,60 @@ +#include "global.h" + +#define BLOCKSIZE 32 + +s32 __osPfsLastChannel = -1; + +s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data) { + s32 ret; + s32 i; + u8* bufptr; + s32 retryCount = 2; + + __osSiGetAccess(); + do { + bufptr = &pifMempakBuf; + if ((__osContLastPoll != 2) || (__osPfsLastChannel != channel)) { + + __osContLastPoll = 2; + __osPfsLastChannel = channel; + // clang-format off + for (i = 0; i < channel; i++) { *bufptr++ = 0; } + // clang-format on + pifMempakBuf.status = 1; + ((__OSContRamHeader*)bufptr)->unk_00 = 0xFF; + ((__OSContRamHeader*)bufptr)->txsize = 3; + ((__OSContRamHeader*)bufptr)->rxsize = 0x21; + ((__OSContRamHeader*)bufptr)->poll = CONT_CMD_READ_MEMPACK; // read mempak; send byte 0 + ((__OSContRamHeader*)bufptr)->datacrc = 0xFF; // read mempak; send byte 0 + // Received bytes are 6-26 inclusive + bufptr[sizeof(__OSContRamHeader)] = CONT_CMD_END; // End of commands + } else { + bufptr += channel; + } + ((__OSContRamHeader*)bufptr)->hi = addr >> 3; // send byte 1 + ((__OSContRamHeader*)bufptr)->lo = (s8)(__osContAddressCrc(addr) | (addr << 5)); // send byte 2 + __osSiRawStartDma(OS_WRITE, &pifMempakBuf); + osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK); + __osSiRawStartDma(OS_READ, &pifMempakBuf); + osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK); + ret = (((__OSContRamHeader*)bufptr)->rxsize & 0xC0) >> 4; + if (!ret) { + if (((__OSContRamHeader*)bufptr)->datacrc != __osContDataCrc(bufptr + 6)) { + ret = __osPfsGetStatus(ctrlrqueue, channel); + if (ret) { + break; + } + ret = 4; // Retry + } else { + bcopy(bufptr + 6, data, BLOCKSIZE); + } + } else { + ret = 1; // Error + } + if (ret != 4) { + break; + } + } while (0 <= retryCount--); + __osSiRelAccess(); + return ret; +} diff --git a/src/libultra_code/osRumblePak.c b/src/libultra_code_O2/osRumblePak.c similarity index 97% rename from src/libultra_code/osRumblePak.c rename to src/libultra_code_O2/osRumblePak.c index d71a066abe..96e86c4dfa 100644 --- a/src/libultra_code/osRumblePak.c +++ b/src/libultra_code_O2/osRumblePak.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" #define BANK_ADDR 0x400 #define MOTOR_ID 0x80 diff --git a/src/libultra_code/osSpTaskYield.c b/src/libultra_code_O2/osSpTaskYield.c similarity index 75% rename from src/libultra_code/osSpTaskYield.c rename to src/libultra_code_O2/osSpTaskYield.c index ec98ec332c..ab852cb71e 100644 --- a/src/libultra_code/osSpTaskYield.c +++ b/src/libultra_code_O2/osSpTaskYield.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void osSpTaskYield() { __osSpSetStatus(SP_STATUS_SIG3); diff --git a/src/libultra_code/osSpTaskYielded.c b/src/libultra_code_O2/osSpTaskYielded.c similarity index 94% rename from src/libultra_code/osSpTaskYielded.c rename to src/libultra_code_O2/osSpTaskYielded.c index ed151a6153..be1dcc09c3 100644 --- a/src/libultra_code/osSpTaskYielded.c +++ b/src/libultra_code_O2/osSpTaskYielded.c @@ -1,4 +1,4 @@ -#include +#include "global.h" u32 osSpTaskYielded(OSTask* task) { u32 ret; diff --git a/src/libultra_code/osViGetCurrentFramebuffer.c b/src/libultra_code_O2/osViGetCurrentFramebuffer.c similarity index 80% rename from src/libultra_code/osViGetCurrentFramebuffer.c rename to src/libultra_code_O2/osViGetCurrentFramebuffer.c index 03aa515aeb..f605f16836 100644 --- a/src/libultra_code/osViGetCurrentFramebuffer.c +++ b/src/libultra_code_O2/osViGetCurrentFramebuffer.c @@ -1,5 +1,4 @@ -#include -#include +#include "global.h" u32* osViGetCurrentFramebuffer() { register u32 sMask = __osDisableInt(); diff --git a/src/libultra_code/osViSetEvent.c b/src/libultra_code_O2/osViSetEvent.c similarity index 90% rename from src/libultra_code/osViSetEvent.c rename to src/libultra_code_O2/osViSetEvent.c index 1c042dc27d..0f29bc681d 100644 --- a/src/libultra_code/osViSetEvent.c +++ b/src/libultra_code_O2/osViSetEvent.c @@ -1,4 +1,4 @@ -#include "libultra_internal.h" +#include "global.h" extern OSViContext* __osViNext; diff --git a/src/libultra_code/pfsallocatefile.c b/src/libultra_code_O2/pfsallocatefile.c similarity index 98% rename from src/libultra_code/pfsallocatefile.c rename to src/libultra_code_O2/pfsallocatefile.c index 3cdc592187..03a87d0480 100644 --- a/src/libultra_code/pfsallocatefile.c +++ b/src/libultra_code_O2/pfsallocatefile.c @@ -1,6 +1,6 @@ -#include -#include -#include +#include "ultra64.h" +#include "global.h" +#include "ultra64/pfs.h" s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 fileSize, s32* fileNo) { s32 startPage, decleared, prevPage; diff --git a/src/libultra_code/pfschecker.c b/src/libultra_code_O2/pfschecker.c similarity index 98% rename from src/libultra_code/pfschecker.c rename to src/libultra_code_O2/pfschecker.c index abfcf41857..e4934a17ab 100644 --- a/src/libultra_code/pfschecker.c +++ b/src/libultra_code_O2/pfschecker.c @@ -1,6 +1,6 @@ -#include -#include -#include +#include "ultra64.h" +#include "global.h" +#include "ultra64/pfs.h" #define CHECK_IPAGE(p) \ (((p).ipage >= pfs->inodeStartPage) && ((p).inode_t.bank < pfs->banks) && ((p).inode_t.page >= 0x01) && \ diff --git a/src/libultra_code/pfsinitpak.c b/src/libultra_code_O2/pfsinitpak.c similarity index 98% rename from src/libultra_code/pfsinitpak.c rename to src/libultra_code_O2/pfsinitpak.c index a83619e597..377c4f6a5b 100644 --- a/src/libultra_code/pfsinitpak.c +++ b/src/libultra_code_O2/pfsinitpak.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel) { s32 ret; diff --git a/src/libultra_code/pfsreadwritefile.c b/src/libultra_code_O2/pfsreadwritefile.c similarity index 98% rename from src/libultra_code/pfsreadwritefile.c rename to src/libultra_code_O2/pfsreadwritefile.c index 7ef65736c5..4a6d7755c2 100644 --- a/src/libultra_code/pfsreadwritefile.c +++ b/src/libultra_code_O2/pfsreadwritefile.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" #define CHECK_IPAGE(p, pfs) \ (((p).ipage >= (pfs).inodeStartPage) && ((p).inode_t.bank < (pfs).banks) && ((p).inode_t.page >= 0x01) && \ diff --git a/src/libultra_code/rotate.c b/src/libultra_code_O2/rotate.c similarity index 97% rename from src/libultra_code/rotate.c rename to src/libultra_code_O2/rotate.c index 79752bfa60..a3fd9b978d 100644 --- a/src/libultra_code/rotate.c +++ b/src/libultra_code_O2/rotate.c @@ -1,4 +1,4 @@ -#include +#include "global.h" void guRotateF(f32 m[4][4], f32 a, f32 x, f32 y, f32 z) { static f32 D_80134D10 = M_PI / 180.0f; diff --git a/src/libultra_code/sinf.c b/src/libultra_code_O2/sinf.c similarity index 97% rename from src/libultra_code/sinf.c rename to src/libultra_code_O2/sinf.c index d38e128ad9..0ebc955ca2 100644 --- a/src/libultra_code/sinf.c +++ b/src/libultra_code_O2/sinf.c @@ -1,5 +1,5 @@ -#include -#include +#include "global.h" +#include "ultra64.h" static const du P[] = { { 0x3FF00000, 0x00000000 }, { 0xBFC55554, 0xBC83656D }, { 0x3F8110ED, 0x3804C2A0 }, diff --git a/src/libultra_code/sins.c b/src/libultra_code_O2/sins.c similarity index 92% rename from src/libultra_code/sins.c rename to src/libultra_code_O2/sins.c index ee69849204..4b538f67dc 100644 --- a/src/libultra_code/sins.c +++ b/src/libultra_code_O2/sins.c @@ -1,5 +1,4 @@ -#include - +#include "ultra64.h" #include "sintable.c" s16 sins(u16 x) { diff --git a/src/libultra_code/sintable.c b/src/libultra_code_O2/sintable.c similarity index 99% rename from src/libultra_code/sintable.c rename to src/libultra_code_O2/sintable.c index 705b609e3d..d430d65ae3 100644 --- a/src/libultra_code/sintable.c +++ b/src/libultra_code_O2/sintable.c @@ -1,4 +1,4 @@ -#include +#include "ultra64/types.h" static s16 sintable[0x400] = { 0x0000, 0x0032, 0x0064, 0x0096, 0x00C9, 0x00FB, 0x012D, 0x0160, 0x0192, 0x01C4, 0x01F7, 0x0229, 0x025B, 0x028E, diff --git a/src/libultra_code/sp.c b/src/libultra_code_O2/sp.c similarity index 74% rename from src/libultra_code/sp.c rename to src/libultra_code_O2/sp.c index 17474ae928..fcfb8880eb 100644 --- a/src/libultra_code/sp.c +++ b/src/libultra_code_O2/sp.c @@ -1,6 +1,4 @@ -#include -#include -#include +#include "global.h" u32 __osSpDeviceBusy() { register u32 status = HW_REG(SP_STATUS_REG, u32); diff --git a/src/libultra_code/sptask.c b/src/libultra_code_O2/sptask.c similarity index 96% rename from src/libultra_code/sptask.c rename to src/libultra_code_O2/sptask.c index 3766059da0..aecb41d225 100644 --- a/src/libultra_code/sptask.c +++ b/src/libultra_code_O2/sptask.c @@ -1,5 +1,4 @@ -#include "libultra_internal.h" -#include +#include "global.h" #define _osVirtualToPhysical(ptr) \ if (ptr != NULL) { \ diff --git a/src/libultra_code/sqrtf.c b/src/libultra_code_O2/sqrtf.c similarity index 86% rename from src/libultra_code/sqrtf.c rename to src/libultra_code_O2/sqrtf.c index 59ab57ce81..1e0ea1221a 100644 --- a/src/libultra_code/sqrtf.c +++ b/src/libultra_code_O2/sqrtf.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #ifndef __GNUC__ #pragma intrinsic(sqrtf) diff --git a/src/libultra_code/absf.c b/src/libultra_code_O2_g3/absf.c similarity index 67% rename from src/libultra_code/absf.c rename to src/libultra_code_O2_g3/absf.c index d78355af54..ebdbb72c08 100644 --- a/src/libultra_code/absf.c +++ b/src/libultra_code_O2_g3/absf.c @@ -1,4 +1,4 @@ -#include +#include "global.h" f32 absf(f32 a) { return fabsf(a); diff --git a/src/libultra_code/sqrt.c b/src/libultra_code_O2_g3/sqrt.c similarity index 86% rename from src/libultra_code/sqrt.c rename to src/libultra_code_O2_g3/sqrt.c index 98b338362f..d280fadd08 100644 --- a/src/libultra_code/sqrt.c +++ b/src/libultra_code_O2_g3/sqrt.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #ifndef __GNUC__ #pragma intrinsic(sqrt) diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 2c124b0d76..88c1aa326c 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -284,9 +284,8 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { return; } } - - if ((globalCtx->state.input[0].press.in.button & - (A_BUTTON | B_BUTTON | R_TRIG | U_CBUTTONS | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS))) { + if ((CHECK_BTN_ANY(globalCtx->state.input[0].press.button, + (BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)))) { this->timer = 0; } } diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h index e0793716e6..8ea380b180 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h @@ -1,8 +1,8 @@ #ifndef _Z_ARMS_HOOK_H_ #define _Z_ARMS_HOOK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ArmsHook; diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h index 37d4cab8f5..4176475aeb 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_ARROW_FIRE_H_ #define _Z_ARROW_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ArrowFire; diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h index 17e10502f5..afbbc9fb8c 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h @@ -1,8 +1,8 @@ #ifndef _Z_ARROW_ICE_H_ #define _Z_ARROW_ICE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ArrowIce; diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h index 75e8c897b1..ebaf18f9c8 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h @@ -1,8 +1,8 @@ #ifndef _Z_ARROW_LIGHT_H_ #define _Z_ARROW_LIGHT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ArrowLight; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h index b195ac52c0..299ddea9db 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_BDAN_OBJECTS_H_ #define _Z_BG_BDAN_OBJECTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgBdanObjects; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h index a02f5dcfa8..f42ddbcbfc 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_BDAN_SWITCH_H_ #define _Z_BG_BDAN_SWITCH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" // BgBdanSwitch.actor.params & 0xFF typedef enum { diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index 1fec36cb0e..573f6b1528 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -4,9 +4,9 @@ * Description: Bombchu Bowling Alley Walls */ +#include "vt.h" #include "z_bg_bom_guard.h" #include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" -#include #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h index 431b8caa68..4405a9073e 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_BOM_GUARD_H_ #define _Z_BG_BOM_GUARD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgBomGuard; diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h index d91a8b1715..92348d235e 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_BOMBWALL_H_ #define _Z_BG_BOMBWALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgBombwall; diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h index 792f82c0eb..d2cd7197a8 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_BOWL_WALL_H_ #define _Z_BG_BOWL_WALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgBowlWall; diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index bdcad1af30..b69110e8cb 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_BREAKWALL_H_ #define _Z_BG_BREAKWALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgBreakwall; diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h index 4da8716eaa..668d3b7503 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_DDAN_JD_H_ #define _Z_BG_DDAN_JD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgDdanJd; diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h index 7dd699f0a1..20225225ec 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_DDAN_KD_H_ #define _Z_BG_DDAN_KD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgDdanKd; diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h index e7e1dcca29..920949d9c7 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_DODOAGO_H_ #define _Z_BG_DODOAGO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgDodoago; diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h index 56cd8d891e..b4f77712df 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_DY_YOSEIZO_H_ #define _Z_BG_DY_YOSEIZO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgDyYoseizo; diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h index d552bb831e..f361718ed9 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GANON_OTYUKA_H_ #define _Z_BG_GANON_OTYUKA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGanonOtyuka; diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index eb7349eea6..27de2b09bc 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -4,8 +4,8 @@ * Description: Death Mountain Trail Gate */ +#include "vt.h" #include "z_bg_gate_shutter.h" -#include #define FLAGS 0x00000000 diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h index 830f8fd593..b773c1dd6e 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GATE_SHUTTER_H_ #define _Z_BG_GATE_SHUTTER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGateShutter; diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h index dc5eb1d86b..45b4d563c8 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GJYO_BRIDGE_H_ #define _Z_BG_GJYO_BRIDGE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGjyoBridge; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h index 49b6e48cd6..d457bee65c 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GND_DARKMEIRO_H_ #define _Z_BG_GND_DARKMEIRO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGndDarkmeiro; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h index af1ec630fe..eb863c37f9 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GND_FIREMEIRO_H_ #define _Z_BG_GND_FIREMEIRO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGndFiremeiro; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h index 531db41f6e..a80c4e0931 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GND_ICEBLOCK_H_ #define _Z_BG_GND_ICEBLOCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGndIceblock; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h index b468ef85e4..ec82a0e45f 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GND_NISEKABE_H_ #define _Z_BG_GND_NISEKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGndNisekabe; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h index 66d2ce2d58..41ae0cec57 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_GND_SOULMEIRO_H_ #define _Z_BG_GND_SOULMEIRO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgGndSoulmeiro; diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h index d801998cc5..4f6cc3b7a6 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_H_ #define _Z_BG_HAKA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHaka; diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h index 7ce8dde9f9..6f002cd170 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_GATE_H_ #define _Z_BG_HAKA_GATE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaGate; diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h index d14bf7c952..38903cff2e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_HUTA_H_ #define _Z_BG_HAKA_HUTA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaHuta; diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h index 71e7d075ed..9f2722437d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_MEGANE_H_ #define _Z_BG_HAKA_MEGANE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaMegane; diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h index ceacdb72b9..f407928cc6 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_MEGANEBG_H_ #define _Z_BG_HAKA_MEGANEBG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaMeganeBG; diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h index fb7232936d..c12ce4e33a 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_SGAMI_H_ #define _Z_BG_HAKA_SGAMI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaSgami; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h index 6a119d3b91..575e0a4bed 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_SHIP_H_ #define _Z_BG_HAKA_SHIP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaShip; diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h index c044d9d380..f7641d44c1 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_TRAP_H_ #define _Z_BG_HAKA_TRAP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef enum { /* 0x00 */ HAKA_TRAP_GUILLOTINE_SLOW, diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h index 944cee93b9..c03c53091f 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_TUBO_H_ #define _Z_BG_HAKA_TUBO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaTubo; diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h index 1bab8032b8..fc6989af26 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_WATER_H_ #define _Z_BG_HAKA_WATER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaWater; diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h index 2abba6d5c1..10f711a035 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HAKA_ZOU_H_ #define _Z_BG_HAKA_ZOU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHakaZou; diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index fc25e47c9b..1af709622d 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -5,7 +5,7 @@ */ #include "z_bg_heavy_block.h" -#include +#include "vt.h" #define FLAGS 0x00000000 diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h index 1dbdde6338..18e4175290 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HEAVY_BLOCK_H_ #define _Z_BG_HEAVY_BLOCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHeavyBlock; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h index ba5adcf94c..e985223292 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_CURTAIN_H_ #define _Z_BG_HIDAN_CURTAIN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanCurtain; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h index c4c7e0790d..1044a0b988 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_DALM_H_ #define _Z_BG_HIDAN_DALM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanDalm; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index 2209a41395..0f27e509bb 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_FIREWALL_H_ #define _Z_BG_HIDAN_FIREWALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanFirewall; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h index a6fa657d55..fe8cfa9ec0 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_FSLIFT_H_ #define _Z_BG_HIDAN_FSLIFT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanFslift; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h index 9140eff87e..864e97d5df 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_FWBIG_H_ #define _Z_BG_HIDAN_FWBIG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanFwbig; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h index 383d3f473d..2ae8ce6948 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_HAMSTEP_H_ #define _Z_BG_HIDAN_HAMSTEP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanHamstep; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h index 0f6c0afa26..213abcca92 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_HROCK_H_ #define _Z_BG_HIDAN_HROCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanHrock; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h index 24a348e083..76dca708c5 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_KOUSI_H_ #define _Z_BG_HIDAN_KOUSI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanKousi; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h index 283034ca93..3fe3504643 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_KOWARERUKABE_H_ #define _Z_BG_HIDAN_KOWARERUKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanKowarerukabe; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h index 14b65dd5a7..48d4abb715 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_ROCK_H_ #define _Z_BG_HIDAN_ROCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanRock; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h index 732e466e12..fd44d68ef9 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_RSEKIZOU_H_ #define _Z_BG_HIDAN_RSEKIZOU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanRsekizou; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h index c05c86798e..93e9198bff 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_SEKIZOU_H_ #define _Z_BG_HIDAN_SEKIZOU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanSekizou; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h index f28d087bdf..43d76eea3d 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_SIMA_H_ #define _Z_BG_HIDAN_SIMA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanSima; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h index 3ad6d2e862..a7b3964586 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_HIDAN_SYOKU_H_ #define _Z_BG_HIDAN_SYOKU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgHidanSyoku; diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h index 6ac928487c..4dd09357da 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_ICE_OBJECTS_H_ #define _Z_BG_ICE_OBJECTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgIceObjects; diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h index 9c64fac681..10b9692557 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_ICE_SHELTER_H_ #define _Z_BG_ICE_SHELTER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgIceShelter; diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h index 27a3dfb73d..3b57f1735b 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_ICE_SHUTTER_H_ #define _Z_BG_ICE_SHUTTER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgIceShutter; diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h index 07e6253bfc..c469cdaf2a 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_ICE_TURARA_H_ #define _Z_BG_ICE_TURARA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgIceTurara; diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h index bc90a7f8a3..f4f2fb97be 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_INGATE_H_ #define _Z_BG_INGATE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgIngate; diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h index a06c528113..36dc8540f6 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_1FLIFT_H_ #define _Z_BG_JYA_1FLIFT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJya1flift; diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h index db491bba61..b0915c8c2e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_AMISHUTTER_H_ #define _Z_BG_JYA_AMISHUTTER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaAmishutter; diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h index 9d8dcefef3..60c5ef5567 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_BIGMIRROR_H_ #define _Z_BG_JYA_BIGMIRROR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaBigmirror; diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h index 5095bc1ee1..f49470994d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_BLOCK_H_ #define _Z_BG_JYA_BLOCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaBlock; diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h index 27ff595318..2f9069976e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_BOMBCHUIWA_H_ #define _Z_BG_JYA_BOMBCHUIWA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaBombchuiwa; diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 604e17bacf..c6c2c796bc 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -1,6 +1,6 @@ #include "z_bg_jya_bombiwa.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" -#include +#include "vt.h" #define FLAGS 0x00000000 diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h index 416459889a..965c3a2ccd 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_BOMBIWA_H_ #define _Z_BG_JYA_BOMBIWA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaBombiwa; diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h index 3ab9087ec4..54ef603506 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_COBRA_H_ #define _Z_BG_JYA_COBRA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaCobra; diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h index e2b4435bdc..7859396a1e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_GOROIWA_H_ #define _Z_BG_JYA_GOROIWA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaGoroiwa; diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h index 2d111eacfa..1af8a965e8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_HAHENIRON_H_ #define _Z_BG_JYA_HAHENIRON_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaHaheniron; diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h index c358bd67d9..fbe1acc7d6 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_IRONOBJ_H_ #define _Z_BG_JYA_IRONOBJ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaIronobj; diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h index 0d7557c492..916ac54eb2 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_KANAAMI_H_ #define _Z_BG_JYA_KANAAMI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaKanaami; diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h index 6ec71f025e..6fc9b52aa5 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_LIFT_H_ #define _Z_BG_JYA_LIFT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaLift; typedef void (*BgJyaLiftActionFunc)(struct BgJyaLift*); diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h index f5ec4e6f2b..7a52d11a28 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_MEGAMI_H_ #define _Z_BG_JYA_MEGAMI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaMegami; diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 436e4c0c8b..477ce72967 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -5,8 +5,7 @@ */ #include "z_bg_jya_zurerukabe.h" - -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h index da59223c72..95c2881f88 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_JYA_ZURERUKABE_H_ #define _Z_BG_JYA_ZURERUKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgJyaZurerukabe; diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h index 6af6d75705..07b5fba7e9 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MENKURI_EYE_H_ #define _Z_BG_MENKURI_EYE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMenkuriEye; diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h index bf78d0cb08..347798058b 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h +++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MENKURI_KAITEN_H_ #define _Z_BG_MENKURI_KAITEN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMenkuriKaiten; diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h index 8a8a6bfff1..3554168611 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MENKURI_NISEKABE_H_ #define _Z_BG_MENKURI_NISEKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMenkuriNisekabe; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h index ab0b1bffe6..b282ea36bf 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MIZU_BWALL_H_ #define _Z_BG_MIZU_BWALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMizuBwall; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h index c9bbb06242..319d21b97a 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MIZU_MOVEBG_H_ #define _Z_BG_MIZU_MOVEBG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMizuMovebg; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index 879f4286c7..656e526b77 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MIZU_SHUTTER_H_ #define _Z_BG_MIZU_SHUTTER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMizuShutter; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h index 775d963ada..aa80a8d1c6 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MIZU_UZU_H_ #define _Z_BG_MIZU_UZU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMizuUzu; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h index a1f0b51889..628dd9acee 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MIZU_WATER_H_ #define _Z_BG_MIZU_WATER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMizuWater; diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h index 9d55c38e2a..77756d0a7d 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MJIN_H_ #define _Z_BG_MJIN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMjin; diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h index 0900447327..a7de2aa3d1 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_BIGST_H_ #define _Z_BG_MORI_BIGST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriBigst; diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h index 6467bb3a31..3b79053c0a 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_ELEVATOR_H_ #define _Z_BG_MORI_ELEVATOR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriElevator; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h index 12b6ff4bea..0cb728dd98 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_HASHIGO_H_ #define _Z_BG_MORI_HASHIGO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriHashigo; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h index 303c369ea6..d15ffe866f 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_HASHIRA4_H_ #define _Z_BG_MORI_HASHIRA4_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriHashira4; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h index ebc5e73951..3eb11ce29f 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_HINERI_H_ #define _Z_BG_MORI_HINERI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriHineri; diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h index 8e5bdda045..a4ebef8169 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_IDOMIZU_H_ #define _Z_BG_MORI_IDOMIZU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriIdomizu; diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h index 2c7ddf53ac..ac941f86ec 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_KAITENKABE_H_ #define _Z_BG_MORI_KAITENKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriKaitenkabe; diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h index b3a522f879..d6c07f2992 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_MORI_RAKKATENJO_H_ #define _Z_BG_MORI_RAKKATENJO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgMoriRakkatenjo; diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h index 304b3d0163..a908b42b48 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_PO_EVENT_H_ #define _Z_BG_PO_EVENT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgPoEvent; diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h index 27128ff372..f0f05bc5d3 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_PO_SYOKUDAI_H_ #define _Z_BG_PO_SYOKUDAI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgPoSyokudai; diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h index cc0de6a7de..3ccdc62d48 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_PUSHBOX_H_ #define _Z_BG_PUSHBOX_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgPushbox; diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h index 3310589f18..416d8c5488 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_RELAY_OBJECTS_H_ #define _Z_BG_RELAY_OBJECTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgRelayObjects; diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h index 63826359a1..85e4d03bad 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT00_BREAK_H #define _Z_BG_SPOT00_BREAK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot00Break; diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h index cc5c55d272..27a73d3806 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT00_HANEBASI_H_ #define _Z_BG_SPOT00_HANEBASI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot00Hanebasi; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h index 5460b62fe8..460a11506c 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT01_FUSYA_H_ #define _Z_BG_SPOT01_FUSYA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot01Fusya; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h index 56ac647996..d4e9aedba0 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT01_IDOHASHIRA_H_ #define _Z_BG_SPOT01_IDOHASHIRA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot01Idohashira; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h index 09a44114d0..8142d3fa70 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT01_IDOMIZU_H_ #define _Z_BG_SPOT01_IDOMIZU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot01Idomizu; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h index d939085284..cb826bc766 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT01_IDOSOKO_H_ #define _Z_BG_SPOT01_IDOSOKO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot01Idosoko; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h index f19ff5e22a..99c22b3dfb 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT01_OBJECTS2_H_ #define _Z_BG_SPOT01_OBJECTS2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot01Objects2; diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h index 052a83a98c..07ab1a2b79 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT02_OBJECTS_H_ #define _Z_BG_SPOT02_OBJECTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot02Objects; diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h index 73925fd8f0..e31e3ad9f9 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT03_TAKI_H_ #define _Z_BG_SPOT03_TAKI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot03Taki; diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h index 38382bc32f..7286599b01 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT05_SOKO_H_ #define _Z_BG_SPOT05_SOKO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot05Soko; diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h index 0315ca616e..03fb0b2f1c 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT06_OBJECTS_H_ #define _Z_BG_SPOT06_OBJECTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot06Objects; diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h index 9cbd7e916e..139ad9cc64 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT07_TAKI_H_ #define _Z_BG_SPOT07_TAKI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot07Taki; diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h index 86094995c4..65c6f28858 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT08_BAKUDANKABE_H_ #define _Z_BG_SPOT08_BAKUDANKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot08Bakudankabe; diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h index cae25cc2d7..0c7931ff0a 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT08_ICEBLOCK_H_ #define _Z_BG_SPOT08_ICEBLOCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot08Iceblock; diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h index 54eb977caa..3b41a4da18 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT09_OBJ_H_ #define _Z_BG_SPOT09_OBJ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot09Obj; diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h index 579a801476..b1242fd154 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT11_BAKUDANKABE_H_ #define _Z_BG_SPOT11_BAKUDANKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot11Bakudankabe; diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h index 87148d0d41..7f76bf30e4 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT11_OASIS_H_ #define _Z_BG_SPOT11_OASIS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot11Oasis; diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h index 4c05283071..db14e1d27a 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT12_GATE_H_ #define _Z_BG_SPOT12_GATE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot12Gate; diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h index 74fba23957..92ef07771f 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT12_SAKU_H_ #define _Z_BG_SPOT12_SAKU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot12Saku; diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h index a2c1762df8..b511d5bdb4 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT15_RRBOX_H_ #define _Z_BG_SPOT15_RRBOX_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot15Rrbox; diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h index 9410f33c94..13deb86b26 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT15_SAKU_H_ #define _Z_BG_SPOT15_SAKU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot15Saku; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h index 16b878ab32..90bd7e4f57 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT16_BOMBSTONE_H_ #define _Z_BG_SPOT16_BOMBSTONE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot16Bombstone; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index 2cf5dc520d..3f38bc6b94 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -5,7 +5,7 @@ */ #include "z_bg_spot16_doughnut.h" -#include +#include "vt.h" #define FLAGS 0x00000000 diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h index ae8048c24c..5bc0494f99 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT16_DOUGHNUT_H_ #define _Z_BG_SPOT16_DOUGHNUT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot16Doughnut; diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h index 2fd606a370..69f3db4fc2 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT17_BAKUDANKABE_H_ #define _Z_BG_SPOT17_BAKUDANKABE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot17Bakudankabe; diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h index 98194d57e9..b67f1a914f 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT17_FUNEN_H_ #define _Z_BG_SPOT17_FUNEN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot17Funen; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h index 3e76f3e8f7..12d44f5f08 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT18_BASKET_H_ #define _Z_BG_SPOT18_BASKET_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot18Basket; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h index c4a7cf9665..46bee16977 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT18_FUTA_H_ #define _Z_BG_SPOT18_FUTA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot18Futa; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h index 22f8c770d3..0fa9350394 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT18_OBJ_H_ #define _Z_BG_SPOT18_OBJ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot18Obj; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h index 003174c0ba..ae2e3b6c56 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SPOT18_SHUTTER_H_ #define _Z_BG_SPOT18_SHUTTER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSpot18Shutter; diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h index 5bb3066101..43b4453a30 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_SST_FLOOR_H_ #define _Z_BG_SST_FLOOR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgSstFloor; diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h index 82851b375d..e1df819d68 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_TOKI_HIKARI_H_ #define _Z_BG_TOKI_HIKARI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgTokiHikari; diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h index 13062ca365..1b52e64c17 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_TOKI_SWD_H_ #define _Z_BG_TOKI_SWD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgTokiSwd; diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c index ef0733075d..404b16c647 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_1.c @@ -1,5 +1,5 @@ #include "z_bg_toki_swd.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_808BB2F0[] = { diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c index b3f580a846..4f8eaa14fb 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_2.c @@ -1,5 +1,5 @@ #include "z_bg_toki_swd.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_808BB7A0[] = { diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c index e837c82de8..6159d36b02 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd_cutscene_data_3.c @@ -1,5 +1,5 @@ #include "z_bg_toki_swd.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_808BBD90[] = { diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h index f94157035d..b7f9c3ba01 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_TREEMOUTH_H_ #define _Z_BG_TREEMOUTH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgTreemouth; diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c index 9389675535..e6aba7a0b7 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c @@ -1,5 +1,5 @@ #include "z_bg_treemouth.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_808BCE20[] = { diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h index 13c37d91fb..0d8ace5fb9 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_UMAJUMP_H_ #define _Z_BG_UMAJUMP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgUmaJump; diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h index ee7666a6bf..3c296fa379 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_VB_SIMA_H_ #define _Z_BG_VB_SIMA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgVbSima; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h index 2dda84a36f..76ce339b3f 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_YDAN_HASI_H_ #define _Z_BG_YDAN_HASI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgYdanHasi; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h index 7c540bd584..4b6af1c4c4 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_YDAN_MARUTA_H_ #define _Z_BG_YDAN_MARUTA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgYdanMaruta; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h index edff5f0816..1511c8b72a 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_YDAN_SP_H_ #define _Z_BG_YDAN_SP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgYdanSp; diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index b7e1570283..f0090ba1f5 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -5,7 +5,7 @@ */ #include "z_bg_zg.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h index e1834e004b..28e60cd307 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h @@ -1,8 +1,8 @@ #ifndef _Z_BG_ZG_H_ #define _Z_BG_ZG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BgZg; diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h index 833e1362b4..8942325897 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_DODONGO_H_ #define _Z_BOSS_DODONGO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossDodongo; diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h index 9d587e3480..ea3351936a 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_FD_H_ #define _Z_BOSS_FD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossFd; diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h index 5593348d29..ef0f6f4016 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_FD2_H_ #define _Z_BOSS_FD2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossFd2; diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h index a488d4a602..45cfa96766 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_GANON_H_ #define _Z_BOSS_GANON_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossGanon; diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h index 06315b2d60..c062ef9143 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_GANON2_H_ #define _Z_BOSS_GANON2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossGanon2; diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h index b0d1fe1fb1..170111a4e8 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_GANONDROF_H_ #define _Z_BOSS_GANONDROF_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossGanondrof; diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h index 71664783ab..53033a5251 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_GOMA_H_ #define _Z_BOSS_GOMA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossGoma; diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h index c26e343d38..e9323a37c7 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_MO_H_ #define _Z_BOSS_MO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossMo; diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h index c97664cefa..7bd0085641 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_SST_H_ #define _Z_BOSS_SST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossSst; diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h index 64dbe156c5..ca60e98b9b 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_TW_H_ #define _Z_BOSS_TW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossTw; diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h index b9d6082a8a..1075d5037b 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.h +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.h @@ -1,8 +1,8 @@ #ifndef _Z_BOSS_VA_H_ #define _Z_BOSS_VA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct BossVa; diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h index 1be658e4a2..e637ad94b7 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_6K_H_ #define _Z_DEMO_6K_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct Demo6K; diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.h b/src/overlays/actors/ovl_Demo_Du/z_demo_du.h index 40ccf5302f..fb6adf8e6a 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.h +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_DU_H_ #define _Z_DEMO_DU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoDu; diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h index 7ad33e4385..ed55c4db7e 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_EC_H_ #define _Z_DEMO_EC_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoEc; diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h index 08887d1568..ddb094474a 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_EFFECT_H_ #define _Z_DEMO_EFFECT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoEffect; diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h index 7cd966c739..034b20bfca 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_EXT_H_ #define _Z_DEMO_EXT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoExt; diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index 1d1a13ca59..2b9eda1388 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -5,8 +5,7 @@ */ #include "z_demo_geff.h" - -#include +#include "vt.h" #define FLAGS 0x00000030 diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h index 5de1fdcab7..af8b2effe8 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_GEFF_H_ #define _Z_DEMO_GEFF_H_ -#include -#include +#include "ultra64.h" +#include "global.h" #include "../ovl_Demo_Gt/z_demo_gt.h" diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h index 0656d24a49..c750e4ec03 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_GJ_H_ #define _Z_DEMO_GJ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoGj; diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index ef55f10c0e..0fdba9cf02 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -5,8 +5,7 @@ */ #include "z_demo_go.h" - -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.h b/src/overlays/actors/ovl_Demo_Go/z_demo_go.h index 4edfcf2d2c..7ad2883ac2 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.h +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_GO_H_ #define _Z_DEMO_GO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoGo; diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h index 9647b64b76..cdd124404e 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_GT_H_ #define _Z_DEMO_GT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoGt; diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h index 24931721a2..941949cbec 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_IK_H_ #define _Z_DEMO_IK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoIk; diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index e0a893f5de..919cd22d40 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -6,7 +6,7 @@ #include "z_demo_im.h" -#include +#include "vt.h" #define FLAGS 0x00000011 diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h index f4f00fe254..4a3308f796 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.h +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_IM_H_ #define _Z_DEMO_IM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoIm; diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c index aa2ee5f028..b2d23f755c 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c @@ -1,5 +1,5 @@ #include "z_demo_im.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_8098786C[] = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h index 034b03d965..f16653a37f 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_KANKYO_H_ #define _Z_DEMO_KANKYO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoKankyo; diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h index ac761848b6..708eae610f 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_KEKKAI_H_ #define _Z_DEMO_KEKKAI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoKekkai; diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 97f8be83d3..ca22a7c17c 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -6,7 +6,7 @@ #include "z_demo_sa.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h index ac98e7c130..c291d012e2 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_SA_H_ #define _Z_DEMO_SA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoSa; diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.c index bc256a2228..d482cf53d0 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa_cutscene_data.c @@ -1,5 +1,5 @@ #include "z_demo_sa.h" -#include +#include "z64cutscene_commands.h" // clang-format off static CutsceneData D_8099010C[] = { diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h index 3e09bcbc48..14a902564b 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_SHD_H_ #define _Z_DEMO_SHD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoShd; diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c index 71e4b692dc..19b0a2e8a1 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c @@ -1,5 +1,5 @@ -#include -#include +#include "ultra64.h" +#include "global.h" UNK_TYPE D_80991680[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h index 3c01fe6915..431c093ee8 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h @@ -1,8 +1,8 @@ #ifndef _Z_DEMO_TRE_LGT_H_ #define _Z_DEMO_TRE_LGT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DemoTreLgt; diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h index b5df93c65a..5c3c55d85e 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.h +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.h @@ -1,8 +1,8 @@ #ifndef _Z_DOOR_ANA_H_ #define _Z_DOOR_ANA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DoorAna; diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h index 9ae55f6d67..ecb7148530 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h @@ -1,8 +1,8 @@ #ifndef _Z_DOOR_GERUDO_H_ #define _Z_DOOR_GERUDO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DoorGerudo; diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h index 91c80a7d66..d2223e4e25 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.h +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.h @@ -1,8 +1,8 @@ #ifndef _Z_DOOR_KILLER_H_ #define _Z_DOOR_KILLER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DoorKiller; diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index 67c2885ba8..9a586aa0c8 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -1,8 +1,8 @@ #ifndef _Z_DOOR_SHUTTER_H_ #define _Z_DOOR_SHUTTER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DoorShutter; diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.h b/src/overlays/actors/ovl_Door_Toki/z_door_toki.h index 332c64aad5..cf31fc28e9 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.h +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.h @@ -1,8 +1,8 @@ #ifndef _Z_DOOR_TOKI_H_ #define _Z_DOOR_TOKI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DoorToki; diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h index 83e4dff704..292587e80a 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h @@ -1,8 +1,8 @@ #ifndef _Z_DOOR_WARP1_H_ #define _Z_DOOR_WARP1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct DoorWarp1; diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h index 7aa8953e2c..60bdf9e1be 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h @@ -1,8 +1,8 @@ #ifndef _Z_EFC_ERUPC_H_ #define _Z_EFC_ERUPC_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EfcErupc; diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h index cd951ae0f3..6df1016812 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_DUST_H_ #define _Z_EFF_DUST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EffDust; diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 8f5584c501..a804a2b54b 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -5,7 +5,7 @@ */ #include "z_elf_msg.h" -#include +#include "vt.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h index 61830c3b38..a6ba75334b 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h @@ -1,8 +1,8 @@ #ifndef _Z_ELF_MSG_H_ #define _Z_ELF_MSG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ElfMsg; diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 33f130f6c0..3167138b41 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -5,7 +5,7 @@ */ #include "z_elf_msg2.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h index b299840e00..c12a56fa8a 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h @@ -1,8 +1,8 @@ #ifndef _Z_ELF_MSG2_H_ #define _Z_ELF_MSG2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ElfMsg2; diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.h b/src/overlays/actors/ovl_En_Am/z_en_am.h index fbe6c0c57c..132c6253e0 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.h +++ b/src/overlays/actors/ovl_En_Am/z_en_am.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_AM_H_ #define _Z_EN_AM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnAm; diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h index 522afcaddc..10a8930a5d 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ANI_H_ #define _Z_EN_ANI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnAni; diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h index bac6489e9d..53b2b01ead 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ANUBICE_H_ #define _Z_EN_ANUBICE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnAnubice; diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h index 79c42e5855..cfc447ca61 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ANUBICE_FIRE_H_ #define _Z_EN_ANUBICE_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnAnubiceFire; diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index 4dcbc8a58a..749651b72b 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -5,7 +5,7 @@ */ #include "z_en_anubice_tag.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h index 2182ff6870..df87858c3d 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ANUBICE_TAG_H_ #define _Z_EN_ANUBICE_TAG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" #include "overlays/actors/ovl_En_Anubice/z_en_anubice.h" struct EnAnubiceTag; diff --git a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h index a14116481a..c5268ee60c 100644 --- a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h +++ b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h @@ -1,9 +1,9 @@ #ifndef _Z_EN_AROW_TRAP_H_ #define _Z_EN_AROW_TRAP_H_ -#include -#include -#include +#include "ultra64.h" +#include "global.h" +#include "z64.h" struct EnArowTrap; diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h index b166157e5d..dc9e80202f 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ARROW_H_ #define _Z_EN_ARROW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnArrow; diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h index 552ca18b50..91346e15a0 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ATTACK_NIW_H_ #define _Z_EN_ATTACK_NIW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnAttackNiw; diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.h b/src/overlays/actors/ovl_En_Ba/z_en_ba.h index 0c8cba3560..bee5999806 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.h +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BA_H_ #define _Z_EN_BA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBa; diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/src/overlays/actors/ovl_En_Bb/z_en_bb.h index 518d6013c2..db269304b4 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BB_H_ #define _Z_EN_BB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBb; diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h index def74cb62c..a9a1d81691 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BDFIRE_H_ #define _Z_EN_BDFIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBdfire; diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h index c5ab344e8c..a35552521e 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BIGOKUTA_H_ #define _Z_EN_BIGOKUTA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBigokuta; diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.h b/src/overlays/actors/ovl_En_Bili/z_en_bili.h index f4f2f6dbce..176541c203 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.h +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BILI_H_ #define _Z_EN_BILI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBili; diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.h b/src/overlays/actors/ovl_En_Bird/z_en_bird.h index a111728320..8a2d75eabe 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.h +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BIRD_H_ #define _Z_EN_BIRD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBird; diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h index df3a7a4819..4104d578b7 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BLKOBJ_H_ #define _Z_EN_BLKOBJ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBlkobj; diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h index 18ae1f8d6f..6660253089 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BOM_H_ #define _Z_EN_BOM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBom; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h index 9ebe2a2854..d43056810e 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BOM_BOWL_MAN_H_ #define _Z_EN_BOM_BOWL_MAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBomBowlMan; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h index e041695f71..909dde98e5 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BOM_BOWL_PIT_H_ #define _Z_EN_BOM_BOWL_PIT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBomBowlPit; diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h index f90124d73e..0da3c24e09 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BOM_CHU_H_ #define _Z_EN_BOM_CHU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBomChu; diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h index d2c28f8f1a..3dbc7d6ec9 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BOMBF_H_ #define _Z_EN_BOMBF_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBombf; diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.h b/src/overlays/actors/ovl_En_Boom/z_en_boom.h index 80a84a7f88..d9c928d834 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.h +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BOOM_H_ #define _Z_EN_BOOM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBoom; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.h b/src/overlays/actors/ovl_En_Box/z_en_box.h index 7b847af326..8171438ae2 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BOX_H_ #define _Z_EN_BOX_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBox; diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.h b/src/overlays/actors/ovl_En_Brob/z_en_brob.h index e0790ce986..678911d1c3 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.h +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BROB_H_ #define _Z_EN_BROB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBrob; diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h index bec3a84a4e..253b4b3740 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BUBBLE_H_ #define _Z_EN_BUBBLE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBubble; diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.h b/src/overlays/actors/ovl_En_Butte/z_en_butte.h index bb5dc8d2d6..c6cae2f099 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.h +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BUTTE_H_ #define _Z_EN_BUTTE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnButte; diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.h b/src/overlays/actors/ovl_En_Bw/z_en_bw.h index 5b2777ce38..64c12492df 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.h +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BW_H_ #define _Z_EN_BW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBw; diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.h b/src/overlays/actors/ovl_En_Bx/z_en_bx.h index 304dc69e42..9dd47cb251 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.h +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_BX_H_ #define _Z_EN_BX_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnBx; diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.h b/src/overlays/actors/ovl_En_Changer/z_en_changer.h index 04d4441877..d36bdbe989 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.h +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_CHANGER_H_ #define _Z_EN_CHANGER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnChanger; diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h index 9406a6e842..28221ef39d 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_CLEAR_TAG_H_ #define _Z_EN_CLEAR_TAG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnClearTag; diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.h b/src/overlays/actors/ovl_En_Cow/z_en_cow.h index ab48c8db56..d8db141e6d 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.h +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_COW_H_ #define _Z_EN_COW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnCow; diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/src/overlays/actors/ovl_En_Crow/z_en_crow.h index 1aacbaa326..abaa36754a 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_CROW_H_ #define _Z_EN_CROW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnCrow; diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.h b/src/overlays/actors/ovl_En_Cs/z_en_cs.h index a7baf94618..ffd9592c35 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.h +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_CS_H_ #define _Z_EN_CS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnCs; diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h index 15bbd1f025..a7e02d36c2 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DAIKU_H_ #define _Z_EN_DAIKU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDaiku; diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h index f43d27166e..ec07a3a077 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DAIKU_KAKARIKO_H_ #define _Z_EN_DAIKU_KAKARIKO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDaikuKakariko; diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h index 39f73552fe..e68486c84a 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DEKUBABA_H_ #define _Z_EN_DEKUBABA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDekubaba; diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h index 386eeabdec..18a221aa12 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DEKUNUTS_H_ #define _Z_EN_DEKUNUTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDekunuts; diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.h b/src/overlays/actors/ovl_En_Dh/z_en_dh.h index 405c8cc562..8b0047e476 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.h +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DH_H_ #define _Z_EN_DH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDh; diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.h b/src/overlays/actors/ovl_En_Dha/z_en_dha.h index fddc3cbf80..e4eabe4f0b 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.h +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DHA_H_ #define _Z_EN_DHA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDha; diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h index 74f89ae22e..3100df5ea6 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DIVING_GAME_H_ #define _Z_EN_DIVING_GAME_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDivingGame; diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/src/overlays/actors/ovl_En_Dns/z_en_dns.h index 927d383056..473e43c835 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DNS_H_ #define _Z_EN_DNS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDns; diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h index 3f1f033a82..2bc1b3c54f 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DNT_DEMO_H_ #define _Z_EN_DNT_DEMO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDntDemo; diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h index 68c5c5f743..ecd923095b 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DNT_JIJI_H_ #define _Z_EN_DNT_JIJI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDntJiji; diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h index aa6204b7e4..a171658e0b 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DNT_NOMAL_H_ #define _Z_EN_DNT_NOMAL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDntNomal; diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h index 0573ab7a4b..b16146f1f3 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DODOJR_H_ #define _Z_EN_DODOJR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDodojr; diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h index 6349bcd482..83bd8bf5ae 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DODONGO_H_ #define _Z_EN_DODONGO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDodongo; diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.h b/src/overlays/actors/ovl_En_Dog/z_en_dog.h index 19e09a1157..a6f20e7f9f 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.h +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DOG_H_ #define _Z_EN_DOG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDog; diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index 1d43b30247..03e8f45625 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DOOR_H_ #define _Z_EN_DOOR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDoor; diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index dea5061fe1..351840fb95 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -158,7 +158,7 @@ void EnDs_OfferOddPotion(EnDs* this, GlobalContext* globalCtx) { } } -int EnDs_CheckRupeesAndBottle() { +s32 EnDs_CheckRupeesAndBottle() { if (gSaveContext.rupees < 100) { return 0; } else if (Inventory_HasEmptyBottle() == 0) { diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.h b/src/overlays/actors/ovl_En_Ds/z_en_ds.h index 345caf52aa..46d3e2ee21 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.h +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DS_H_ #define _Z_EN_DS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDs; @@ -17,7 +17,7 @@ typedef struct EnDs { /* 0x01BA */ char unk_1B8[0x1E]; /* 0x01D8 */ Vec3s unk_1D8; /* 0x01DE */ Vec3s unk_1DE; - /* 0x01E4 */ float unk_1E4; + /* 0x01E4 */ f32 unk_1E4; /* 0x01E8 */ u16 unk_1E8; /* 0x01EA */ u16 brewTimer; /* 0x01EC */ EnDsActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.h b/src/overlays/actors/ovl_En_Du/z_en_du.h index 906800b3a8..f2fe848d0b 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.h +++ b/src/overlays/actors/ovl_En_Du/z_en_du.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DU_H_ #define _Z_EN_DU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDu; diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h index b07de73e88..cd56529f8c 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_DY_EXTRA_H_ #define _Z_EN_DY_EXTRA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnDyExtra; diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index e838fd359c..1824e54abb 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -5,7 +5,7 @@ */ #include "z_en_eg.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.h b/src/overlays/actors/ovl_En_Eg/z_en_eg.h index a4da5acbd5..82569487ff 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.h +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_EG_H_ #define _Z_EN_EG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnEg; diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h index b79a7bf2b2..64275fe18f 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_EIYER_H_ #define _Z_EN_EIYER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnEiyer; diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.h b/src/overlays/actors/ovl_En_Elf/z_en_elf.h index ca88554b5d..bbb73f8b31 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.h +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ELF_H_ #define _Z_EN_ELF_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnElf; diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h index 0778b7b217..d7f37d33e7 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ENCOUNT1_H_ #define _Z_EN_ENCOUNT1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnEncount1; diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 12dca7338d..41e89c7247 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ENCOUNT2_H_ #define _Z_EN_ENCOUNT2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnEncount2; diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h index 2b3c072d1b..62c32cd7ae 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_EX_ITEM_H_ #define _Z_EN_EX_ITEM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnExItem; diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h index 74c8170b55..5679e100e3 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_EX_RUPPY_H_ #define _Z_EN_EX_RUPPY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnExRuppy; diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.h b/src/overlays/actors/ovl_En_Fd/z_en_fd.h index 031f8b6238..f475b31593 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.h +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FD_H_ #define _Z_EN_FD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFd; diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h index c07f031f1f..1ba4432c8a 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FD_FIRE_H_ #define _Z_EN_FD_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFdFire; diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h index 4b6e56c5d0..883af9c300 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FHG_FIRE_H_ #define _Z_EN_FHG_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFhgFire; diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h index 8dfa21d74f..262e01e39c 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FIRE_ROCK_H_ #define _Z_EN_FIRE_ROCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFireRock; diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h index c1c2fc2b61..4816c0b6a2 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FIREFLY_H_ #define _Z_EN_FIREFLY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFirefly; diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.h b/src/overlays/actors/ovl_En_Fish/z_en_fish.h index 0f60266431..f417220b68 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.h +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FISH_H_ #define _Z_EN_FISH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFish; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h index a4bcf5e032..23e3cbd8ee 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FLOORMAS_H_ #define _Z_EN_FLOORMAS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct EnFloormas EnFloormas; diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/src/overlays/actors/ovl_En_Fr/z_en_fr.h index 954173f9ce..1eb0b2bda9 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FR_H_ #define _Z_EN_FR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFr; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/src/overlays/actors/ovl_En_Fu/z_en_fu.h index 316ff1d94d..a4b65ba031 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FU_H_ #define _Z_EN_FU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFu; diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.h b/src/overlays/actors/ovl_En_Fw/z_en_fw.h index bcebd12e56..1b9a2df9e4 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.h +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FW_H_ #define _Z_EN_FW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFw; diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.h b/src/overlays/actors/ovl_En_Fz/z_en_fz.h index 80f75c6479..b5a354343a 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.h +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FZ_H_ #define _Z_EN_FZ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnFz; diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h index 1f1fa288c5..0db9de716b 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_G_SWITCH_H_ #define _Z_EN_G_SWITCH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGSwitch; diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h index 3c53d88616..c508289a4c 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GANON_MANT_H_ #define _Z_EN_GANON_MANT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGanonMant; diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h index 4e2f302755..2a66d06978 100644 --- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h +++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GANON_ORGAN_H_ #define _Z_EN_GANON_ORGAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGanonOrgan; diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.h b/src/overlays/actors/ovl_En_Gb/z_en_gb.h index f85342e06b..902dddf304 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.h +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GB_H_ #define _Z_EN_GB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGb; diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index f740dd0ef0..cd77352f22 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GE1_H_ #define _Z_EN_GE1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGe1; diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h index 57176472e8..2c758bc70f 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GE2_H_ #define _Z_EN_GE2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGe2; diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h index b5f8f5e50c..c35bb41ccf 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GE3_H_ #define _Z_EN_GE3_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGe3; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h index 90fc07ac95..226fc00531 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GELDB_H_ #define _Z_EN_GELDB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGeldB; diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index 648823a4c0..09f1e73611 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GIRLA_H_ #define _Z_EN_GIRLA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGirlA; diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/src/overlays/actors/ovl_En_Gm/z_en_gm.h index 55b75ddf32..4cf1f7885c 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GM_H_ #define _Z_EN_GM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGm; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.h b/src/overlays/actors/ovl_En_Go/z_en_go.h index f4cbace7a4..0cc54c7d78 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GO_H_ #define _Z_EN_GO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGo; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h index 613ae66038..c8a73d467c 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GO2_H_ #define _Z_EN_GO2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGo2; diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.h b/src/overlays/actors/ovl_En_Goma/z_en_goma.h index d4f8da102c..b44527e6ab 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.h +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GOMA_H_ #define _Z_EN_GOMA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGoma; diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 54122ebbdd..35aae79be3 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -7,7 +7,7 @@ #include "z_en_goroiwa.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h index 246d14eeec..03de3a9a11 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GOROIWA_H_ #define _Z_EN_GOROIWA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGoroiwa; diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h index e70d2bff14..04c45e9fcd 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GS_H_ #define _Z_EN_GS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGs; diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index dcee678078..2225c36d2e 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -5,7 +5,7 @@ */ #include "z_en_guest.h" -#include +#include "vt.h" #define FLAGS 0x00000019 diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.h b/src/overlays/actors/ovl_En_Guest/z_en_guest.h index c6183520cf..15e5f0df16 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.h +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_GUEST_H_ #define _Z_EN_GUEST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnGuest; diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/src/overlays/actors/ovl_En_Hata/z_en_hata.h index 027e255470..09e81f3e17 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.h +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HATA_H_ #define _Z_EN_HATA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x0000 */ DynaPolyActor dyna; diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 7b7668e01c..9962446b90 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -5,7 +5,7 @@ */ #include "z_en_heishi1.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h index 71e3778fef..b31c1026e1 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HEISHI1_H_ #define _Z_EN_HEISHI1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHeishi1; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index fb7ba8712c..da7958dffe 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -4,11 +4,11 @@ * Description: Hyrulian Guards */ +#include "vt.h" #include "z_en_heishi2.h" #include "overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h" -#include #define FLAGS 0x00000009 diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h index fbb32cdc4f..11bba414db 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HEISHI2_H_ #define _Z_EN_HEISHI2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHeishi2; diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 9acd6f230a..b7a03e0969 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -5,7 +5,7 @@ */ #include "z_en_heishi3.h" -#include +#include "vt.h" #define FLAGS 0x00000000 diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h index 4ae1a1cded..56cbd41dd1 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HEISHI3_H_ #define _Z_EN_HEISHI3_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHeishi3; diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h index c4e69dfff0..74a6bd595c 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HEISHI4_H_ #define _Z_EN_HEISHI4_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef enum { /* 0x00 */ HEISHI4_AT_KAKRIKO_ENTRANCE, diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h index aa97beb7a4..341d6f5738 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HINTNUTS_H_ #define _Z_EN_HINTNUTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHintnuts; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/src/overlays/actors/ovl_En_Holl/z_en_holl.h index d96d81a515..0602fa4ce3 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.h +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HOLL_H_ #define _Z_EN_HOLL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHoll; diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h index 862d898446..cd935a15cf 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HONOTRAP_H_ #define _Z_EN_HONOTRAP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHonotrap; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/src/overlays/actors/ovl_En_Horse/z_en_horse.h index 16791b6d89..646c688515 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HORSE_H_ #define _Z_EN_HORSE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHorse; diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h index f20aa87764..f99223e64e 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HORSE_GAME_CHECK_H_ #define _Z_EN_HORSE_GAME_CHECK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHorseGameCheck; diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h index cb2d91d943..6d6e7bdda7 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HORSE_GANON_H_ #define _Z_EN_HORSE_GANON_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHorseGanon; diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h index cde2bb8772..349ad61051 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HORSE_LINK_CHILD_H_ #define _Z_EN_HORSE_LINK_CHILD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHorseLinkChild; diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h index 0223fbf5ce..8ccc1357b2 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HORSE_NORMAL_H_ #define _Z_EN_HORSE_NORMAL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHorseNormal; diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h index a739413a3a..41b3ffb4af 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HORSE_ZELDA_H_ #define _Z_EN_HORSE_ZELDA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHorseZelda; diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.h b/src/overlays/actors/ovl_En_Hs/z_en_hs.h index d9ade04b3b..707a137c05 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.h +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HS_H_ #define _Z_EN_HS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHs; diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index a58fb00e0d..abfc9ae5fc 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -5,8 +5,7 @@ */ #include "z_en_hs2.h" - -#include +#include "vt.h" #define FLAGS 0x00000009 diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h index fc44277e0f..8684127d67 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HS2_H_ #define _Z_EN_HS2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHs2; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.h b/src/overlays/actors/ovl_En_Hy/z_en_hy.h index c89a6e3260..c0908015a7 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.h +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_HY_H_ #define _Z_EN_HY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnHy; diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h index 3836db99fd..680394613e 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ICE_HONO_H_ #define _Z_EN_ICE_HONO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnIceHono; diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index 2cebf9be92..484d8ca6ef 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_IK_H_ #define _Z_EN_IK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnIk; diff --git a/src/overlays/actors/ovl_En_In/z_en_in.h b/src/overlays/actors/ovl_En_In/z_en_in.h index f35244ffc0..c38e11c3d7 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/src/overlays/actors/ovl_En_In/z_en_in.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_IN_H_ #define _Z_EN_IN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnIn; diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 60958b8b1d..973c46a365 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -1,5 +1,5 @@ #include "z_en_insect.h" -#include +#include "vt.h" #define FLAGS 0x00000000 diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/src/overlays/actors/ovl_En_Insect/z_en_insect.h index d45d760559..44a524419c 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_INSECT_H_ #define _Z_EN_INSECT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" #include "overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h" struct EnInsect; diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 5035f3d72d..028f07ae2b 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ISHI_H_ #define _Z_EN_ISHI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnIshi; diff --git a/src/overlays/actors/ovl_En_It/z_en_it.h b/src/overlays/actors/ovl_En_It/z_en_it.h index 62a031ae6e..1bbb4218ac 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.h +++ b/src/overlays/actors/ovl_En_It/z_en_it.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_IT_H_ #define _Z_EN_IT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnIt; diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.h b/src/overlays/actors/ovl_En_Jj/z_en_jj.h index bba41b4903..2780a2ca91 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.h +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_JJ_H_ #define _Z_EN_JJ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnJj; diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.h b/src/overlays/actors/ovl_En_Js/z_en_js.h index 024dd3151d..d216d6c495 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.h +++ b/src/overlays/actors/ovl_En_Js/z_en_js.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_JS_H_ #define _Z_EN_JS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnJs; diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h index b6905a7316..a368d79c85 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_JSJUTAN_H_ #define _Z_EN_JSJUTAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnJsjutan; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h index 4a4543753e..be2d3ca0c2 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KAKASI_H_ #define _Z_EN_KAKASI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKakasi; diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h index 3c26c9051d..e8843604f2 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KAKASI2_H_ #define _Z_EN_KAKASI2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKakasi2; diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h index c3efd3a570..bae8c09ba8 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KAKASI3_H_ #define _Z_EN_KAKASI3_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKakasi3; diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h index a1d2138826..89d5fb2ed4 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KANBAN_H_ #define _Z_EN_KANBAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKanban; diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h index b1c2bd83ba..d9a4132ddf 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KAREBABA_H_ #define _Z_EN_KAREBABA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKarebaba; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.h b/src/overlays/actors/ovl_En_Ko/z_en_ko.h index faed45ed04..9f93a43b33 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.h +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KO_H_ #define _Z_EN_KO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKo; diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h index aa15f10d77..1d817db167 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KUSA_H_ #define _Z_EN_KUSA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKusa; diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.h b/src/overlays/actors/ovl_En_Kz/z_en_kz.h index 043b595e13..d9061da5e5 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.h +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_KZ_H_ #define _Z_EN_KZ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnKz; diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.h b/src/overlays/actors/ovl_En_Light/z_en_light.h index c780538f08..7b5301de2e 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.h +++ b/src/overlays/actors/ovl_En_Light/z_en_light.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_LIGHT_H_ #define _Z_EN_LIGHT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnLight; diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h index d42f5e6a8f..b0f9682804 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_LIGHTBOX_H_ #define _Z_EN_LIGHTBOX_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnLightbox; diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h index 5a0426ec18..985af26cb2 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_M_FIRE1_H_ #define _Z_EN_M_FIRE1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMFire1; diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h index 9a27b89c14..cb6db0d41f 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_M_THUNDER_H_ #define _Z_EN_M_THUNDER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMThunder; diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h index 70c9e1255c..c38f78ab74 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MA1_H_ #define _Z_EN_MA1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMa1; diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h index c759974a41..fea3e648dd 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MA2_H_ #define _Z_EN_MA2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMa2; diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h index 532d9e4ae5..068a0830e6 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MA3_H_ #define _Z_EN_MA3_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMa3; diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index d282c0a519..0261c146c9 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -115,9 +115,9 @@ void EnMag_Update(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.fileNum != 0xFEDC) { if (this->globalState < MAG_STATE_DISPLAY) { - if (CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON) || - CHECK_PAD(globalCtx->state.input[0].press, A_BUTTON) || - CHECK_PAD(globalCtx->state.input[0].press, B_BUTTON)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) || + CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_A) || + CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B)) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -142,9 +142,9 @@ void EnMag_Update(Actor* thisx, GlobalContext* globalCtx) { } } else if (this->globalState >= MAG_STATE_DISPLAY) { if (sDelayTimer == 0) { - if (CHECK_PAD(globalCtx->state.input[0].press, START_BUTTON) || - CHECK_PAD(globalCtx->state.input[0].press, A_BUTTON) || - CHECK_PAD(globalCtx->state.input[0].press, B_BUTTON)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) || + CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_A) || + CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B)) { if (globalCtx->sceneLoadFlag != 20) { func_800F68BC(0); diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.h b/src/overlays/actors/ovl_En_Mag/z_en_mag.h index 9ce947ffe7..9eba318aa8 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.h +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MAG_H_ #define _Z_EN_MAG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMag; diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.h b/src/overlays/actors/ovl_En_Mb/z_en_mb.h index da81a39def..d48d035ba1 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.h +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MB_H_ #define _Z_EN_MB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMb; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.h b/src/overlays/actors/ovl_En_Md/z_en_md.h index 08973c3d19..cb2c19c756 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.h +++ b/src/overlays/actors/ovl_En_Md/z_en_md.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MD_H_ #define _Z_EN_MD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMd; diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.h b/src/overlays/actors/ovl_En_Mk/z_en_mk.h index 8206f6f54a..4761131da9 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.h +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MK_H_ #define _Z_EN_MK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMk; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.h b/src/overlays/actors/ovl_En_Mm/z_en_mm.h index 581cc164a3..5aecded8b4 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.h +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MM_H_ #define _Z_EN_MM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMm; diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h index bfae3aaa7a..9c790601af 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MM2_H_ #define _Z_EN_MM2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMm2; diff --git a/src/overlays/actors/ovl_En_Ms/dlists.h b/src/overlays/actors/ovl_En_Ms/dlists.h index f2ce5d4393..3a9b6cf7fb 100644 --- a/src/overlays/actors/ovl_En_Ms/dlists.h +++ b/src/overlays/actors/ovl_En_Ms/dlists.h @@ -1,8 +1,8 @@ #ifndef _DLISTS_H_ #define _DLISTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" extern const ActorInit InitVars; diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.h b/src/overlays/actors/ovl_En_Ms/z_en_ms.h index 731adc45a6..2bdb12e7ff 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.h +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MS_H_ #define _Z_EN_MS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMs; diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.h b/src/overlays/actors/ovl_En_Mu/z_en_mu.h index aa7c75ffd0..4ddf949bb4 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.h +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_MU_H_ #define _Z_EN_MU_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnMu; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/src/overlays/actors/ovl_En_Nb/z_en_nb.h index a89c14b7ea..4f731845e8 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.h +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_NB_H_ #define _Z_EN_NB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnNb; diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.h b/src/overlays/actors/ovl_En_Niw/z_en_niw.h index 30c562089f..e75c7050bd 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.h +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_NIW_H_ #define _Z_EN_NIW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnNiw; diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index d60e9db362..846b433d01 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -5,7 +5,7 @@ */ #include "z_en_niw_girl.h" -#include +#include "vt.h" #define FLAGS 0x00000019 diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h index 73c9dc875e..284e58a870 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_NIW_GIRL_H_ #define _Z_EN_NIW_GIRL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" #include "../ovl_En_Niw/z_en_niw.h" struct EnNiwGirl; diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h index fc67a925dd..0a4afefaa6 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_NIW_LADY_H_ #define _Z_EN_NIW_LADY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnNiwLady; diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h index 732fbfd3e2..a43e9d47ac 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_NUTSBALL_H_ #define _Z_EN_NUTSBALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnNutsball; diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h index acec11d705..5d6871a3a4 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_NWC_H_ #define _Z_EN_NWC_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnNwc; diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.h b/src/overlays/actors/ovl_En_Ny/z_en_ny.h index 168ff96a94..db9e3235b3 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.h +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_NY_H_ #define _Z_EN_NY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnNy; diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.h b/src/overlays/actors/ovl_En_OE2/z_en_oe2.h index cfc985a7be..4945bedbea 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.h +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_OE2_H_ #define _Z_EN_OE2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnOE2; diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index 1302210f1c..7affec989f 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -5,7 +5,7 @@ */ #include "z_en_okarina_effect.h" -#include +#include "vt.h" #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h index 7a3f1361c3..575cc5ba84 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_OKARINA_EFFECT_H_ #define _Z_EN_OKARINA_EFFECT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnOkarinaEffect; diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 2fa9db91ff..e6afa9516c 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -5,7 +5,7 @@ */ #include "z_en_okarina_tag.h" -#include +#include "vt.h" #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h index 5ff95ab05a..d094261fd1 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_OKARINA_TAG_H_ #define _Z_EN_OKARINA_TAG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnOkarinaTag; diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c index 74b5604390..e4471236ea 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag_cutscene_data.c @@ -1,5 +1,5 @@ #include "z_en_okarina_tag.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_80ABF9D0[] = { diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h index 9e76b74b58..11bc2b3467 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_OKUTA_H_ #define _Z_EN_OKUTA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnOkuta; diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 22d9f0305e..429ef58466 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_OSSAN_H_ #define _Z_EN_OSSAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnOssan; diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.h b/src/overlays/actors/ovl_En_Owl/z_en_owl.h index 33465e36a5..f36a82090b 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.h +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_OWL_H_ #define _Z_EN_OWL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnOwl; diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.h b/src/overlays/actors/ovl_En_Part/z_en_part.h index 4324d34cba..92ce925578 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.h +++ b/src/overlays/actors/ovl_En_Part/z_en_part.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_PART_H_ #define _Z_EN_PART_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPart; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h index f7ee264615..c2dc45ddd2 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_PEEHAT_H_ #define _Z_EN_PEEHAT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPeehat; diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h index 77cc9615e0..260ff4eac9 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_PO_DESERT_H_ #define _Z_EN_PO_DESERT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPoDesert; diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h index 353693c849..752c0b56ae 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_PO_FIELD_H_ #define _Z_EN_PO_FIELD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPoField; diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h index 6062e004b4..b4fd76f1b0 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_PO_RELAY_H_ #define _Z_EN_PO_RELAY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPoRelay; diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h index 086ce50d9a..ca00287df5 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_PO_SISTERS_H_ #define _Z_EN_PO_SISTERS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPoSisters; diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/src/overlays/actors/ovl_En_Poh/z_en_poh.h index 915d7853d7..f3b50339fa 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_POH_H_ #define _Z_EN_POH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPoh; diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h index a8171a9a6f..e71346ac41 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_PU_BOX_H_ #define _Z_EN_PU_BOX_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnPubox; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 7fcfde0816..035d0fd94d 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_RD_H_ #define _Z_EN_RD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnRd; diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h index d6fed6b798..299d19bdf0 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_REEBA_H_ #define _Z_EN_REEBA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnReeba; diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h index 909925387c..31716d9dae 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_RIVER_SOUND_H_ #define _Z_EN_RIVER_SOUND_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnRiverSound; diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.h b/src/overlays/actors/ovl_En_Rl/z_en_rl.h index 2d7ebeb36f..c0ab9c7d6c 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.h +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_RL_H_ #define _Z_EN_RL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnRl; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.h b/src/overlays/actors/ovl_En_Rr/z_en_rr.h index 5a1321e3ac..fa57319c10 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.h +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_RR_H_ #define _Z_EN_RR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnRr; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 5a47e1cf75..676d93c4d9 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -5,8 +5,7 @@ */ #include "z_en_ru1.h" - -#include +#include "vt.h" #define FLAGS 0x04000011 diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index 01fc087e79..50b3e7ecb1 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -1,11 +1,11 @@ #ifndef _Z_EN_RU1_H_ #define _Z_EN_RU1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" -#include -#include +#include "overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h" +#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" struct EnRu1; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c index c6870e407e..3d606538f2 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c @@ -1,5 +1,5 @@ #include "z_en_ru1.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_80AF0880[] = { diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 1403bc1983..d92fbb4799 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -5,7 +5,7 @@ */ #include "z_en_ru2.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h index 82d0bee9bc..cad92e04f2 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_RU2_H_ #define _Z_EN_RU2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnRu2; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.c index 5f17537404..3b87d8988f 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2_cutscene_data.c @@ -1,5 +1,5 @@ #include "z_en_ru2.h" -#include +#include "z64cutscene_commands.h" // clang-format off static CutsceneData D_80AF411C[] = { diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.h b/src/overlays/actors/ovl_En_Sa/z_en_sa.h index 5d3435943b..568e3204c4 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.h +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SA_H_ #define _Z_EN_SA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSa; diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index da4772846b..057778140d 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -5,7 +5,7 @@ */ #include "z_en_sb.h" -#include +#include "vt.h" #define FLAGS 0x00000005 diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.h b/src/overlays/actors/ovl_En_Sb/z_en_sb.h index 1c2f3384bd..b35f79c850 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.h +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SB_H_ #define _Z_EN_SB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSb; diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h index 9b2b299fe8..1cbd0d1935 100644 --- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h +++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h @@ -1,8 +1,8 @@ #ifndef _Z_ITEM_SCENE_CHANGE_H_ #define _Z_ITEM_SCENE_CHANGE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSceneChange; diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.h b/src/overlays/actors/ovl_En_Sda/z_en_sda.h index 34cb558958..412297bec1 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.h +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SDA_H_ #define _Z_EN_SDA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSda; diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h index 87a7ab8626..a24899e53a 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SHOPNUTS_H_ #define _Z_EN_SHOPNUTS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnShopnuts; diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.h b/src/overlays/actors/ovl_En_Si/z_en_si.h index 3273c906b8..32dc0e9a8f 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.h +++ b/src/overlays/actors/ovl_En_Si/z_en_si.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SI_H_ #define _Z_EN_SI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSi; diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h index 3c7659bc6a..cf0762431e 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SIOFUKI_H_ #define _Z_EN_SIOFUKI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSiofuki; diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.h b/src/overlays/actors/ovl_En_Skb/z_en_skb.h index 5a454127d2..b8d4ff12e5 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.h +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SKB_H_ #define _Z_EN_SKB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSkb; diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.h b/src/overlays/actors/ovl_En_Skj/z_en_skj.h index a57754aa5c..8e459ceeb3 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.h +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SKJ_H_ #define _Z_EN_SKJ_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSkj; diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h index d68581d638..ec9830f5a2 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SKJNEEDLE_H_ #define _Z_EN_SKJNEEDLE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSkjneedle; diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index f33f1e476e..21563ce120 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SSH_H_ #define _Z_EN_SSH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSsh; diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index 78caadada4..ac9d0920ba 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ST_H_ #define _Z_EN_ST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSt; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.h b/src/overlays/actors/ovl_En_Sth/z_en_sth.h index 401ab7dbdb..3d78061fed 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_STH_H_ #define _Z_EN_STH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSth; diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.h b/src/overlays/actors/ovl_En_Stream/z_en_stream.h index 73f8418e4d..33faea46a0 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.h +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_STREAM_H_ #define _Z_EN_STREAM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnStream; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.h b/src/overlays/actors/ovl_En_Sw/z_en_sw.h index 948d64241d..2e83971bb7 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.h +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SW_H_ #define _Z_EN_SW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSw; diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h index dd78f0c1e0..3df19d7fc6 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SYATEKI_ITM_H_ #define _Z_EN_SYATEKI_ITM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSyatekiItm; diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h index bc00641550..2900f973cf 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SYATEKI_MAN_H_ #define _Z_EN_SYATEKI_MAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSyatekiMan; diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 750eaa35b4..4768bfb045 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -5,7 +5,7 @@ */ #include "z_en_syateki_niw.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h index 7e11735c31..1c61f9fa24 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_SYATEKI_NIW_H_ #define _Z_EN_SYATEKI_NIW_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnSyatekiNiw; diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.h b/src/overlays/actors/ovl_En_Ta/z_en_ta.h index c67f293141..9b9f63bf91 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.h +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TA_H_ #define _Z_EN_TA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTa; diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index ed105c4c9b..e07be92745 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -5,7 +5,7 @@ */ #include "z_en_takara_man.h" -#include +#include "vt.h" #define FLAGS 0x08000039 diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h index ba63a57a06..5ac82ad76e 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TAKARA_MAN_H_ #define _Z_EN_TAKARA_MAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTakaraMan; diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.h b/src/overlays/actors/ovl_En_Tana/z_en_tana.h index dfa5a606d0..8706ad47e4 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.h +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TANA_H_ #define _Z_EN_TANA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTana; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.h b/src/overlays/actors/ovl_En_Test/z_en_test.h index ec06fc3f13..941b9695d4 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.h +++ b/src/overlays/actors/ovl_En_Test/z_en_test.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TEST_H_ #define _Z_EN_TEST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTest; diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.h b/src/overlays/actors/ovl_En_Tg/z_en_tg.h index ac8ade4841..55e8b54423 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.h +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TG_H_ #define _Z_EN_TG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTg; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/src/overlays/actors/ovl_En_Tite/z_en_tite.h index 90a315f0e6..9bb4a4e3fe 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TITE_H_ #define _Z_EN_TITE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTite; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 60aec43288..5e08655d8f 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TK_H_ #define _Z_EN_TK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" /* Dirt particle effect */ struct EnTkEff; diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.h b/src/overlays/actors/ovl_En_Torch/z_en_torch.h index 84c7d7e4e2..e21290109b 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.h +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TORCH_H_ #define _Z_EN_TORCH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTorch; diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h index a3136641ac..8325eb3801 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TORCH2_H_ #define _Z_EN_TORCH2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" // Uses the Player struct (from z64player.h) diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h index e5b4cbc43c..c8913c7fb2 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TORYO_H_ #define _Z_EN_TORYO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnToryo; diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.h b/src/overlays/actors/ovl_En_Tp/z_en_tp.h index 6235e704d1..7bc4944eac 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.h +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TP_H_ #define _Z_EN_TP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTp; diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.h b/src/overlays/actors/ovl_En_Tr/z_en_tr.h index 5ec1b93924..1fed972c75 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.h +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TR_H_ #define _Z_EN_TR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTr; diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.h b/src/overlays/actors/ovl_En_Trap/z_en_trap.h index abddfd3d79..d09942829c 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.h +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TRAP_H_ #define _Z_EN_TRAP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTrap; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index fd96567ebc..65f2563080 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -6,8 +6,7 @@ #include "z_en_tubo_trap.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" - -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h index cad5552542..d9fd6f27d7 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_TUBO_TRAP_H_ #define _Z_EN_TUBO_TRAP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnTuboTrap; diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.h b/src/overlays/actors/ovl_En_Vali/z_en_vali.h index e7c4a90133..2d18a409d3 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.h +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_VALI_H_ #define _Z_EN_VALI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnVali; diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.h b/src/overlays/actors/ovl_En_Vase/z_en_vase.h index 1b2311928f..84dc6ecacd 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.h +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_VASE_H_ #define _Z_EN_VASE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnVase; diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h index f6967a6da9..11a60c04e3 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_VB_BALL_H_ #define _Z_EN_VB_BALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnVbBall; diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index fcc0325015..e1a9b82a1d 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_VIEWER_H_ #define _Z_EN_VIEWER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnViewer; diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.h b/src/overlays/actors/ovl_En_Vm/z_en_vm.h index f71fef04d4..a5c1175d98 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.h +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_VM_H_ #define _Z_EN_VM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnVm; diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h index e47bdfb494..9aab46d21d 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WALL_TUBO_H_ #define _Z_EN_WALL_TUBO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWallTubo; diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h index d640ebab90..2296b0f17b 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WALLMAS_H_ #define _Z_EN_WALLMAS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef enum { /* 0x00 */ WMT_TIMER, diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h index 19c1b7a2b7..ac427354d0 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WEATHER_TAG_H_ #define _Z_EN_WEATHER_TAG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWeatherTag; diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h index ed92ba81d5..16c33692d8 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WEIYER_H_ #define _Z_EN_WEIYER_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWeiyer; diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.h b/src/overlays/actors/ovl_En_Wf/z_en_wf.h index 37bf9dadfa..5163af3db3 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.h +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WF_H_ #define _Z_EN_WF_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWf; diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h index db6f66f668..d177e8dc5f 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WONDER_ITEM_H_ #define _Z_EN_WONDER_ITEM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWonderItem; diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index 435c66120f..fe2358205f 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -5,7 +5,7 @@ */ #include "z_en_wonder_talk.h" -#include +#include "vt.h" #define FLAGS 0x08000009 diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h index e7cb19f5c7..19082b6fdd 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WONDER_TALK_H_ #define _Z_EN_WONDER_TALK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWonderTalk; diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 636eca1455..81d44a3d9b 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -5,7 +5,7 @@ */ #include "z_en_wonder_talk2.h" -#include +#include "vt.h" #define FLAGS 0x08000009 diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h index c399e678ec..22f63096df 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WONDER_TALK2_H_ #define _Z_EN_WONDER_TALK2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWonderTalk2; diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h index 0fa0860d13..d74f86e321 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_WOOD02_H_ #define _Z_EN_WOOD02_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnWood02; diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.h b/src/overlays/actors/ovl_En_Xc/z_en_xc.h index 7e81be023a..65b94bb6ba 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.h +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_XC_H_ #define _Z_EN_XC_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnXc; diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h index c32f87eebc..6221fdba50 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_YABUSAME_MARK_H_ #define _Z_EN_YABUSAME_MARK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnYabusameMark; diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h index f335e4d1b4..d30e0836d1 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_YUKABYUN_H_ #define _Z_EN_YUKABYUN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnYukabyun; diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.h b/src/overlays/actors/ovl_En_Zf/z_en_zf.h index f20cce8675..89e1580230 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.h +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ZF_H_ #define _Z_EN_ZF_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnZf; diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h index 340bfb67d2..3fcd477bac 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ZL1_H_ #define _Z_EN_ZL1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnZl1; diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c index 1b7e1be53a..99acb3f9c8 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c @@ -1,5 +1,5 @@ #include "z_en_zl1.h" -#include +#include "z64cutscene_commands.h" // clang-format off CutsceneData D_80B4C5D0[] = { diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 91fc259add..b3d59cd962 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -5,7 +5,7 @@ */ #include "z_en_zl2.h" -#include +#include "vt.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h index 57fc6f7cda..6ec9d637a7 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ZL2_H_ #define _Z_EN_ZL2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnZl2; diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h index 1e23d17fee..d5a19812ec 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ZL3_H_ #define _Z_EN_ZL3_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnZl3; diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h index 4cba98ac4e..44dc3733b8 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ZL4_H_ #define _Z_EN_ZL4_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnZl4; diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/src/overlays/actors/ovl_En_Zo/z_en_zo.h index 02be99454e..c0ca0d51a2 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.h +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_ZO_H_ #define _Z_EN_ZO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnZo; diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h index 81f3311939..412ff6158f 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.h +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.h @@ -1,8 +1,8 @@ #ifndef _Z_EN_FHG_H_ #define _Z_EN_FHG_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EnfHG; diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.h b/src/overlays/actors/ovl_End_Title/z_end_title.h index 1b4bcbb960..4fbb39c8ef 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.h +++ b/src/overlays/actors/ovl_End_Title/z_end_title.h @@ -1,8 +1,8 @@ #ifndef _Z_END_TITLE_H_ #define _Z_END_TITLE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct EndTitle; diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.h b/src/overlays/actors/ovl_Fishing/z_fishing.h index 288dba5030..be047ba03a 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.h +++ b/src/overlays/actors/ovl_Fishing/z_fishing.h @@ -1,8 +1,8 @@ #ifndef _Z_FISHING_H_ #define _Z_FISHING_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct Fishing; diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h index 07eb7d855c..eef5467163 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h @@ -1,8 +1,8 @@ #ifndef _Z_ITEM_B_HEART_H_ #define _Z_ITEM_B_HEART_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ItemBHeart; diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h index bd8f2004fd..420680601e 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -1,8 +1,8 @@ #ifndef _Z_ITEM_ETCETERA_H_ #define _Z_ITEM_ETCETERA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ItemEtcetera; diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h index 4e72eb3904..1aee38f9df 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h @@ -1,8 +1,8 @@ #ifndef _Z_ITEM_INBOX_H_ #define _Z_ITEM_INBOX_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ItemInbox; diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h index a67e73cf3d..f7ba4236ea 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h @@ -1,8 +1,8 @@ #ifndef _Z_ITEM_OCARINA_H_ #define _Z_ITEM_OCARINA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ItemOcarina; diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.h b/src/overlays/actors/ovl_Item_Shield/z_item_shield.h index 2222f700c1..5a3bbaff88 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.h +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.h @@ -1,8 +1,8 @@ #ifndef _Z_ITEM_SHIELD_H_ #define _Z_ITEM_SHIELD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ItemShield; diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h index 9c97fbc3e6..d57f29109c 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h @@ -1,8 +1,8 @@ #ifndef _Z_MAGIC_DARK_H_ #define _Z_MAGIC_DARK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct MagicDark; diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h index 1ead62f48e..221c0fb01c 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_MAGIC_FIRE_H_ #define _Z_MAGIC_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct MagicFire; diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h index 0b76e7ac28..03f0374482 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h @@ -1,8 +1,8 @@ #ifndef _Z_MAGIC_WIND_H_ #define _Z_MAGIC_WIND_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct MagicWind; diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c index 7a6a03a4b4..d665e4a99d 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c @@ -1,4 +1,4 @@ -#include +#include "global.h" Vtx sCylinderVtx[] = { VTX(0, 0, -6000, 1024, 2048, 0xFF, 0xFF, 0xFF, 0xFF), diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h index 454b5202e7..4ca0bfa1d5 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -1,8 +1,8 @@ #ifndef _Z_MIR_RAY_H_ #define _Z_MIR_RAY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct MirRay; diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h index 4f48407f5b..5b97f7d3a7 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_BEAN_H_ #define _Z_OBJ_BEAN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjBean; diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h index b333617740..36de69821c 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_BLOCKSTOP_H_ #define _Z_OBJ_BLOCKSTOP_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjBlockstop; diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h index b8a537eda9..e1e9c0aa3b 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_BOMBIWA_H_ #define _Z_OBJ_BOMBIWA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjBombiwa; diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h index 89c8e50039..83945325bf 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_COMB_H_ #define _Z_OBJ_COMB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjComb; diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h index c3d20eca73..ac02c320c0 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_DEKUJR_H_ #define _Z_OBJ_DEKUJR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjDekujr; diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h index 03472a90d7..f9d4c99845 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_ELEVATOR_H_ #define _Z_OBJ_ELEVATOR_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjElevator; diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h index 221701bc9f..01987a8a10 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_HAMISHI_H_ #define _Z_OBJ_HAMISHI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjHamishi; diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h index cffc9036ad..5456525911 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_HANA_H_ #define _Z_OBJ_HANA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjHana; diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h index 36d614e849..3af7ff1cc9 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_HSBLOCK_H_ #define _Z_OBJ_HSBLOCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjHsblock; diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h index 7457dc2dfd..fc1894d80f 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_ICE_POLY_H_ #define _Z_OBJ_ICE_POLY_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjIcePoly; diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h index 37c0aac1b9..5bdb58faca 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_KIBAKO_H_ #define _Z_OBJ_KIBAKO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjKibako; diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h index 92521430f7..f7280fe446 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_KIBAKO2_H_ #define _Z_OBJ_KIBAKO2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjKibako2; diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h index 68e5043e4b..2ef2599f2d 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_LIFT_H_ #define _Z_OBJ_LIFT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjLift; diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index b4eadca98b..4ac979e121 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -5,7 +5,7 @@ */ #include "z_obj_lightswitch.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index 11d67f1f49..9a36dca8cb 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_LIGHTSWITCH_H_ #define _Z_OBJ_LIGHTSWITCH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjLightswitch; diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 5e59ca9c39..ac2020d8ca 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -5,7 +5,7 @@ */ #include "z_obj_makekinsuta.h" -#include +#include "vt.h" #define FLAGS 0x00000010 diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h index 4d6b421afe..a091c7fd34 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_MAKEKINSUTA_H_ #define _Z_OBJ_MAKEKINSUTA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjMakekinsuta; diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index ba07ee8888..796601ba1d 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -8,7 +8,7 @@ #include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h" -#include +#include "vt.h" #define FLAGS 0x00000020 diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h index 4f2b6e4ef3..ea0669b190 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_MAKEOSHIHIKI_H_ #define _Z_OBJ_MAKEOSHIHIKI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjMakeoshihiki; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h index a07043f806..6acb71fc0b 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_MURE_H_ #define _Z_OBJ_MURE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjMure; diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h index ccee5be788..38519365eb 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_MURE2_H_ #define _Z_OBJ_MURE2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjMure2; diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h index 13bfecba73..ec4fd273a6 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_MURE3_H_ #define _Z_OBJ_MURE3_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjMure3; diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h index fc0819c014..14677efb0b 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_OSHIHIKI_H_ #define _Z_OBJ_OSHIHIKI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjOshihiki; diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h index b3f37ce01f..d9d75322d1 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h @@ -1,9 +1,9 @@ #ifndef _Z_OBJ_ROOMTIMER_H_ #define _Z_OBJ_ROOMTIMER_H_ -#include -#include -#include +#include "ultra64.h" +#include "global.h" +#include "z64.h" struct ObjRoomtimer; diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index 372ff89e40..d13119ab1a 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_SWITCH_H_ #define _Z_OBJ_SWITCH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjSwitch; diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h index b5f0bbc55b..1c2a780889 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_SYOKUDAI_H_ #define _Z_OBJ_SYOKUDAI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjSyokudai; diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h index 0277c0f523..0a2cf9e406 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_TIMEBLOCK_H_ #define _Z_OBJ_TIMEBLOCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjTimeblock; diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h index cebf786a7c..9706d8f0ec 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_TSUBO_H_ #define _Z_OBJ_TSUBO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjTsubo; diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h index d4b5a3a3eb..e17d417e02 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJ_WARP2BLOCK_H_ #define _Z_OBJ_WARP2BLOCK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjWarp2block; diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h index 067fc6b851..5fad2a08d2 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h @@ -1,8 +1,8 @@ #ifndef _Z_OBJECT_KANKYO_H_ #define _Z_OBJECT_KANKYO_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ObjectKankyo; diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index 2bc500d698..040ffc1569 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -5,7 +5,7 @@ */ #include "z_oceff_spot.h" -#include +#include "vt.h" #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h index ab366c3478..4aedd62b1d 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h @@ -1,8 +1,8 @@ #ifndef _Z_OCEFF_SPOT_H_ #define _Z_OCEFF_SPOT_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct OceffSpot; diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h index 0ed633183b..e5ad561486 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h @@ -1,8 +1,8 @@ #ifndef _Z_OCEFF_STORM_H_ #define _Z_OCEFF_STORM_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct OceffStorm; diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index 29fbd18e02..92468a9f0c 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -5,7 +5,7 @@ */ #include "z_oceff_wipe.h" -#include +#include "vt.h" #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h index 2b3367a903..3a2950629b 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h @@ -1,8 +1,8 @@ #ifndef _Z_OCEFF_WIPE_H_ #define _Z_OCEFF_WIPE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct OceffWipe; diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index e68d3943c0..7e8b3b818b 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -5,7 +5,7 @@ */ #include "z_oceff_wipe2.h" -#include +#include "vt.h" #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h index d2f03ee51a..25b32f19d4 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h @@ -1,8 +1,8 @@ #ifndef _Z_OCEFF_WIPE2_H_ #define _Z_OCEFF_WIPE2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct OceffWipe2; diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index a3614affa4..eb26284df2 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -5,7 +5,7 @@ */ #include "z_oceff_wipe3.h" -#include +#include "vt.h" #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h index deb9da40ea..cb9324a23b 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h @@ -1,8 +1,8 @@ #ifndef _Z_OCEFF_WIPE3_H_ #define _Z_OCEFF_WIPE3_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct OceffWipe3; diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index e45621deea..d3449f812e 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -5,7 +5,7 @@ */ #include "z_oceff_wipe4.h" -#include +#include "vt.h" #define FLAGS 0x02000010 diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h index b53b8d1c0e..15e81f58e0 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h @@ -1,8 +1,8 @@ #ifndef _Z_OCEFF_WIPE4_H_ #define _Z_OCEFF_WIPE4_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct OceffWipe4; diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 14be022822..7dd9c5a98d 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -5,7 +5,7 @@ */ #include "z_shot_sun.h" -#include +#include "vt.h" #define FLAGS 0x00000009 diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h index d796e4cabe..70a6a4ffec 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h @@ -1,8 +1,8 @@ #ifndef _Z_SHOT_SUN_H_ #define _Z_SHOT_SUN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" struct ShotSun; diff --git a/src/overlays/actors/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/actors/ovl_kaleido_scope/z_kaleido_scope_PAL.c index f5d105f823..2e7edd60ff 100644 --- a/src/overlays/actors/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/actors/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1,4 +1,4 @@ -#include +#include "global.h" #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_8081F1F0.s") @@ -47,8 +47,8 @@ void KaleidoScope_Draw(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_scope_PAL.c", 3188); - pauseCtx->inputX = input->rel.in.x; - pauseCtx->inputY = input->rel.in.y; + pauseCtx->inputX = input->rel.stick_x; + pauseCtx->inputY = input->rel.stick_y; gSPSegment(oGfxCtx->polyOpa.p++, 0x02, interfaceCtx->parameterSegment); gSPSegment(oGfxCtx->polyOpa.p++, 0x07, pauseCtx->unk_13C); diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 43c4109f8e..049eacbed3 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -4,8 +4,8 @@ * Description: Link */ -#include -#include +#include "ultra64.h" +#include "global.h" #include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h" #include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h" @@ -1009,7 +1009,7 @@ LinkAnimetionEntry* D_80854378[] = { u8 D_80854380[2] = { 0x18, 0x19 }; u8 D_80854384[2] = { 0x1A, 0x1B }; -u16 D_80854388[] = { B_BUTTON, L_CBUTTONS, D_CBUTTONS, R_CBUTTONS }; +u16 D_80854388[] = { BTN_B, BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT }; u8 sMagicSpellCosts[] = { 12, 24, 24, 12, 24, 12 }; @@ -1309,7 +1309,7 @@ s32 func_80832594(Player* this, s32 arg1, s32 arg2) { this->unk_850 += arg1 + (s16)(ABS(temp) * fabsf(D_808535D4) * 2.5415802156203426e-06f); - if (sControlInput->press.in.button & (A_BUTTON | B_BUTTON)) { + if (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B)) { this->unk_850 += 5; } @@ -1949,7 +1949,7 @@ void func_80833DF8(Player* this, GlobalContext* globalCtx) { } for (i = 0; i < ARRAY_COUNT(D_80854388); i++) { - if (CHECK_PAD(sControlInput->press, D_80854388[i])) { + if (CHECK_BTN_ALL(sControlInput->press.button, D_80854388[i])) { break; } } @@ -1957,7 +1957,7 @@ void func_80833DF8(Player* this, GlobalContext* globalCtx) { item = func_80833CDC(globalCtx, i); if (item >= ITEM_NONE_FE) { for (i = 0; i < ARRAY_COUNT(D_80854388); i++) { - if (CHECK_PAD(sControlInput->cur, D_80854388[i])) { + if (CHECK_BTN_ALL(sControlInput->cur.button, D_80854388[i])) { break; } } @@ -2149,7 +2149,8 @@ s32 func_80834758(GlobalContext* globalCtx, Player* this) { if (!(this->stateFlags1 & 0x20C00000) && (globalCtx->unk_11E5C == 0) && (this->heldItemActionParam == this->itemActionParam) && (this->currentShield != PLAYER_SHIELD_NONE) && - !Player_IsChildWithHylianShield(this) && func_80833BCC(this) && CHECK_PAD(sControlInput->cur, R_TRIG)) { + !Player_IsChildWithHylianShield(this) && func_80833BCC(this) && + CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { anim = func_808346C4(globalCtx, this); frame = SkelAnime_GetFrameCount(&anim->genericHeader); @@ -2238,7 +2239,7 @@ s32 func_80834A2C(Player* this, GlobalContext* globalCtx) { s32 func_80834B5C(Player* this, GlobalContext* globalCtx) { func_800A3BC0(globalCtx, &this->skelAnime2); - if (!CHECK_PAD(sControlInput->cur, R_TRIG)) { + if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { func_80834894(this); return 1; } else { @@ -2308,13 +2309,13 @@ s32 func_80834D2C(Player* this, GlobalContext* globalCtx) { } s32 func_80834E44(GlobalContext* globalCtx) { - return (globalCtx->unk_11E5C > 0) && CHECK_PAD(sControlInput->press, B_BUTTON); + return (globalCtx->unk_11E5C > 0) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B); } s32 func_80834E7C(GlobalContext* globalCtx) { return (globalCtx->unk_11E5C != 0) && ((globalCtx->unk_11E5C < 0) || - (sControlInput->cur.in.button & (A_BUTTON | B_BUTTON | U_CBUTTONS | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS))); + CHECK_BTN_ANY(sControlInput->cur.button, BTN_A | BTN_B | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)); } s32 func_80834EB8(Player* this, GlobalContext* globalCtx) { @@ -3013,7 +3014,7 @@ s32 func_80836AB8(Player* this, s32 arg1) { void func_80836BEC(Player* this, GlobalContext* globalCtx) { s32 sp1C = 0; - s32 zTrigPressed = CHECK_PAD(sControlInput->cur, Z_TRIG); + s32 zTrigPressed = CHECK_BTN_ALL(sControlInput->cur.button, BTN_Z); Actor* actorToTarget; s32 pad; s32 holdTarget; @@ -3047,7 +3048,7 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { if (!cond) { if (!(this->stateFlags1 & 0x2000000) && ((this->heldItemActionParam != PLAYER_AP_FISHING_POLE) || (this->unk_860 == 0)) && - CHECK_PAD(sControlInput->press, Z_TRIG)) { + CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) { if (this->actor.type == ACTORTYPE_PLAYER) { actorToTarget = globalCtx->actorCtx.targetCtx.arrowPointedActor; @@ -3863,11 +3864,11 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { if ((this->actor.wallPolySource != 50) && (D_808535F0 & 0x40)) { if (this->unk_88D >= 6) { this->stateFlags2 |= 4; - if (CHECK_PAD(sControlInput->press, A_BUTTON)) { + if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { sp3C = 1; } } - } else if ((this->unk_88D >= 6) || CHECK_PAD(sControlInput->press, A_BUTTON)) { + } else if ((this->unk_88D >= 6) || CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { sp3C = 1; } @@ -4160,7 +4161,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { if ((this->doorType != 0) && (!(this->stateFlags1 & 0x800) || ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)))) { - if (CHECK_PAD(sControlInput->press, A_BUTTON) || (func_8084F9A0 == this->func_674)) { + if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (func_8084F9A0 == this->func_674)) { doorActor = this->doorActor; if (this->doorType < 0) { @@ -4913,7 +4914,7 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) { if (sp34 != NULL) { this->stateFlags2 |= 2; - if (CHECK_PAD(sControlInput->press, A_BUTTON) || (sp34->flags & 0x10000)) { + if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (sp34->flags & 0x10000)) { sp2C = NULL; } else if (sp2C == NULL) { return 0; @@ -4925,7 +4926,7 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) { this->stateFlags2 |= 0x200000; } - if (!CHECK_PAD(sControlInput->press, U_CBUTTONS) && !sp28) { + if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && !sp28) { return 0; } @@ -4977,8 +4978,9 @@ s32 func_8083B998(Player* this, GlobalContext* globalCtx) { if ((this->unk_664 != NULL) && (((this->unk_664->flags & 0x40001) == 0x40001) || (this->unk_664->naviEnemyId != 0xFF))) { this->stateFlags2 |= 0x200000; - } else if ((this->naviMessageId == 0) && !func_8008E9C4(this) && CHECK_PAD(sControlInput->press, U_CBUTTONS) && - (YREG(15) != 0x10) && (YREG(15) != 0x20) && !func_8083B8F4(this, globalCtx)) { + } else if ((this->naviMessageId == 0) && !func_8008E9C4(this) && + CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && (YREG(15) != 0x10) && (YREG(15) != 0x20) && + !func_8083B8F4(this, globalCtx)) { func_80078884(NA_SE_SY_ERROR); } @@ -5004,7 +5006,8 @@ void func_8083BA90(GlobalContext* globalCtx, Player* this, s32 arg2, f32 xzVeloc s32 func_8083BB20(Player* this) { if (!(this->stateFlags1 & 0x400000) && (Player_GetSwordHeld(this) != 0)) { - if (D_80853614 || ((this->actor.type != ACTORTYPE_PLAYER) && CHECK_PAD(sControlInput->press, B_BUTTON))) { + if (D_80853614 || + ((this->actor.type != ACTORTYPE_PLAYER) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B))) { return 1; } } @@ -5055,7 +5058,8 @@ void func_8083BCD0(Player* this, GlobalContext* globalCtx, s32 arg2) { s32 func_8083BDBC(Player* this, GlobalContext* globalCtx) { s32 sp2C; - if (CHECK_PAD(sControlInput->press, A_BUTTON) && (globalCtx->roomCtx.curRoom.unk_03 != 2) && (D_808535E4 != 7) && + if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (globalCtx->roomCtx.curRoom.unk_03 != 2) && + (D_808535E4 != 7) && (func_80041F7C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource) != 1)) { sp2C = this->unk_84B[this->unk_846]; @@ -5144,7 +5148,7 @@ void func_8083C148(Player* this, GlobalContext* globalCtx) { s32 func_8083C1DC(Player* this, GlobalContext* globalCtx) { if (!func_80833B54(this) && (D_808535E0 == 0) && !(this->stateFlags1 & 0x800000) && - CHECK_PAD(sControlInput->press, A_BUTTON)) { + CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { if (func_8083BC7C(this, globalCtx)) { return 1; } @@ -5163,7 +5167,7 @@ s32 func_8083C2B0(Player* this, GlobalContext* globalCtx) { f32 frame; if ((globalCtx->unk_11E5C == 0) && (this->currentShield != PLAYER_SHIELD_NONE) && - CHECK_PAD(sControlInput->cur, R_TRIG) && + CHECK_BTN_ALL(sControlInput->cur.button, BTN_R) && (Player_IsChildWithHylianShield(this) || (!func_80833B2C(this) && (this->unk_664 == NULL)))) { func_80832318(this); @@ -5221,13 +5225,13 @@ s32 func_8083C484(Player* this, f32* arg1, s16* arg2) { } void func_8083C50C(Player* this) { - if ((this->unk_844 > 0) && !CHECK_PAD(sControlInput->cur, B_BUTTON)) { + if ((this->unk_844 > 0) && !CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { this->unk_844 = -this->unk_844; } } s32 func_8083C544(Player* this, GlobalContext* globalCtx) { - if (CHECK_PAD(sControlInput->cur, B_BUTTON)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { if (!(this->stateFlags1 & 0x400000) && (Player_GetSwordHeld(this) != 0) && (this->unk_844 == 1) && (this->heldItemActionParam != PLAYER_AP_STICK)) { if ((this->heldItemActionParam != PLAYER_AP_SWORD_BGS) || (gSaveContext.swordHealth > 0.0f)) { @@ -5487,7 +5491,7 @@ void func_8083D0A8(GlobalContext* globalCtx, Player* this, f32 arg2) { s32 func_8083D12C(GlobalContext* globalCtx, Player* this, Input* arg2) { if (!(this->stateFlags1 & 0x400) && !(this->stateFlags2 & 0x400)) { - if ((arg2 == NULL) || (CHECK_PAD(arg2->press, A_BUTTON) && (ABS(this->unk_6C2) < 12000) && + if ((arg2 == NULL) || (CHECK_BTN_ALL(arg2->press.button, BTN_A) && (ABS(this->unk_6C2) < 12000) && (this->currentBoots != PLAYER_BOOTS_IRON))) { func_80835C58(globalCtx, this, func_8084DC48, 0); @@ -5808,7 +5812,7 @@ s32 func_8083E0FC(Player* this, GlobalContext* globalCtx) { f32 sp34; s32 temp; - if ((rideActor != NULL) && CHECK_PAD(sControlInput->press, A_BUTTON)) { + if ((rideActor != NULL) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { sp38 = Math_Coss(rideActor->actor.shape.rot.y); sp34 = Math_Sins(rideActor->actor.shape.rot.y); @@ -5955,7 +5959,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { func_8083E4C4(globalCtx, this, giEntry); this->getItemId = GI_NONE; } - } else if (CHECK_PAD(sControlInput->press, A_BUTTON) && !(this->stateFlags1 & 0x800) && + } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & 0x800) && !(this->stateFlags2 & 0x400)) { if (this->getItemId != GI_NONE) { GetItemEntry* giEntry = &sGetItemTable[-this->getItemId - 1]; @@ -6044,7 +6048,7 @@ s32 func_8083EAF0(Player* this, Actor* actor) { s32 func_8083EB44(Player* this, GlobalContext* globalCtx) { if ((this->stateFlags1 & 0x800) && (this->heldActor != NULL) && - (sControlInput->press.in.button & (A_BUTTON | B_BUTTON | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS))) { + CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { if (!func_80835644(globalCtx, this, this->heldActor)) { if (!func_8083EAF0(this, this->heldActor)) { func_80835C58(globalCtx, this, func_808464B0, 1); @@ -6218,7 +6222,7 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { this->stateFlags2 |= 0x10000; - if (CHECK_PAD(sControlInput->press, A_BUTTON)) { + if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { f32 sp38 = wallPoly->norm.x * (1.0f / 32767.0f); f32 sp34 = wallPoly->norm.z * (1.0f / 32767.0f); f32 sp30 = this->wallDistance; @@ -6356,7 +6360,7 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { this->stateFlags2 |= 1; - if (CHECK_PAD(sControlInput->cur, A_BUTTON)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)) { if ((this->actor.wallPolySource != 50) && ((wallPolyActor = DynaPolyInfo_GetActor(&globalCtx->colCtx, this->actor.wallPolySource)) != NULL)) { @@ -6392,7 +6396,8 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { } s32 func_8083F9D0(GlobalContext* globalCtx, Player* this) { - if ((this->actor.bgCheckFlags & 0x200) && ((this->stateFlags2 & 0x10) || CHECK_PAD(sControlInput->cur, A_BUTTON))) { + if ((this->actor.bgCheckFlags & 0x200) && + ((this->stateFlags2 & 0x10) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A))) { DynaPolyActor* wallPolyActor = NULL; if (this->actor.wallPolySource != 50) { @@ -6433,7 +6438,7 @@ void func_8083FB7C(Player* this, GlobalContext* globalCtx) { } s32 func_8083FBC0(Player* this, GlobalContext* globalCtx) { - if (!CHECK_PAD(sControlInput->press, A_BUTTON) && (this->actor.bgCheckFlags & 0x200) && + if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (this->actor.bgCheckFlags & 0x200) && ((D_808535F0 & 8) || (D_808535F0 & 2) || func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource))) { return 0; @@ -6479,7 +6484,7 @@ s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, GlobalContext* globalCtx) if (this->unk_664 != NULL) { func_8083DB98(this, 1); } else { - Math_SmoothScaleMaxMinS(&this->actor.posRot2.rot.x, sControlInput->rel.in.y * 240.0f, 14, 4000, 30); + Math_SmoothScaleMaxMinS(&this->actor.posRot2.rot.x, sControlInput->rel.stick_y * 240.0f, 14, 4000, 30); func_80836AB8(this, 1); } } else { @@ -7669,8 +7674,8 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { func_8083721C(this); if (this->unk_850 != 0) { - sp54 = sControlInput->rel.in.y * 100; - sp50 = sControlInput->rel.in.x * -120; + sp54 = sControlInput->rel.stick_y * 100; + sp50 = sControlInput->rel.stick_x * -120; sp4E = this->actor.shape.rot.y - func_8005A948(ACTIVE_CAM); sp40 = Math_Coss(sp4E); @@ -8033,7 +8038,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { Actor* heldActor = this->heldActor; if (!func_80835644(globalCtx, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) && - (sControlInput->press.in.button & (A_BUTTON | B_BUTTON | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS))) { + CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { func_8084409C(globalCtx, this, this->linearVelocity + 2.0f, this->actor.velocity.y + 2.0f); } } @@ -8259,7 +8264,7 @@ s32 func_80844BE4(Player* this, GlobalContext* globalCtx) { if (func_8083ADD4(globalCtx, this)) { this->stateFlags2 |= 0x20000; } else { - if (!CHECK_PAD(sControlInput->cur, B_BUTTON)) { + if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { if ((this->unk_858 >= 0.85f) || func_808375D8(this)) { temp = D_80854384[Player_HoldsTwoHandedWeapon(this)]; } else { @@ -8331,7 +8336,7 @@ void func_80844E68(Player* this, GlobalContext* globalCtx) { if (this->unk_858 >= 0.1f) { this->unk_845 = 0; this->unk_850 = 1; - } else if (!CHECK_PAD(sControlInput->cur, B_BUTTON)) { + } else if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { func_80844D68(this, globalCtx); } } else if (!func_80844BE4(this, globalCtx)) { @@ -8820,7 +8825,7 @@ void func_80846260(Player* this, GlobalContext* globalCtx) { return; } - } else if (sControlInput->press.in.button & (A_BUTTON | B_BUTTON | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS)) { + } else if (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)) { func_80835C58(globalCtx, this, func_80846358, 1); func_80832264(globalCtx, this, &D_040032B8); } @@ -10317,8 +10322,8 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) { } else { sp44 = globalCtx->state.input[0]; if (this->unk_88E != 0) { - sp44.cur.in.button &= ~(A_BUTTON | B_BUTTON | U_CBUTTONS); - sp44.press.in.button &= ~(A_BUTTON | B_BUTTON | U_CBUTTONS); + sp44.cur.button &= ~(BTN_A | BTN_B | BTN_CUP); + sp44.press.button &= ~(BTN_A | BTN_B | BTN_CUP); } } @@ -10533,22 +10538,22 @@ s16 func_8084ABD8(GlobalContext* globalCtx, Player* this, s32 arg2, s16 arg3) { s16 temp2; if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) { - temp2 = sControlInput->rel.in.y * 240.0f; + temp2 = sControlInput->rel.stick_y * 240.0f; Math_SmoothScaleMaxMinS(&this->actor.posRot2.rot.x, temp2, 14, 4000, 30); - temp2 = sControlInput->rel.in.x * -16.0f; + temp2 = sControlInput->rel.stick_x * -16.0f; temp2 = CLAMP(temp2, -3000, 3000); this->actor.posRot2.rot.y += temp2; } else { temp1 = (this->stateFlags1 & 0x800000) ? 3500 : 14000; - this->actor.posRot2.rot.x += (s32)((1.0f - Math_Coss(sControlInput->rel.in.y * 200)) * 1500.0f) * - ((sControlInput->rel.in.y >= 0) ? 1 : -1); + this->actor.posRot2.rot.x += (s32)((1.0f - Math_Coss(sControlInput->rel.stick_y * 200)) * 1500.0f) * + ((sControlInput->rel.stick_y >= 0) ? 1 : -1); this->actor.posRot2.rot.x = CLAMP(this->actor.posRot2.rot.x, -temp1, temp1); temp1 = 19114; temp2 = this->actor.posRot2.rot.y - this->actor.shape.rot.y; - temp2 += (s32)((1.0f - Math_Coss(sControlInput->rel.in.x * 200)) * -1500.0f) * - ((sControlInput->rel.in.x >= 0) ? 1 : -1); + temp2 += (s32)((1.0f - Math_Coss(sControlInput->rel.stick_x * 200)) * -1500.0f) * + ((sControlInput->rel.stick_x >= 0) ? 1 : -1); this->actor.posRot2.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; } @@ -10634,7 +10639,7 @@ void func_8084B000(Player* this) { void func_8084B158(GlobalContext* globalCtx, Player* this, Input* input, f32 arg3) { f32 temp; - if ((input != NULL) && (input->press.in.button & (A_BUTTON | B_BUTTON))) { + if ((input != NULL) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_B)) { temp = 1.0f; } else { temp = 0.5f; @@ -10664,10 +10669,11 @@ void func_8084B1D8(Player* this, GlobalContext* globalCtx) { if ((this->csMode != 0) || (this->unk_6AD == 0) || (this->unk_6AD >= 4) || func_80833B54(this) || (this->unk_664 != NULL) || !func_8083AD4C(globalCtx, this) || - (((this->unk_6AD == 2) && ((sControlInput->press.in.button & (A_BUTTON | B_BUTTON | R_TRIG)) || + (((this->unk_6AD == 2) && (CHECK_BTN_ANY(sControlInput->press.button, BTN_A | BTN_B | BTN_R) || func_80833B2C(this) || (!func_8002DD78(this) && !func_808334B4(this)))) || - ((this->unk_6AD == 1) && (sControlInput->press.in.button & (A_BUTTON | B_BUTTON | R_TRIG | U_CBUTTONS | - L_CBUTTONS | R_CBUTTONS | D_CBUTTONS))))) { + ((this->unk_6AD == 1) && + CHECK_BTN_ANY(sControlInput->press.button, + BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)))) { func_8083C148(this, globalCtx); func_80078884(NA_SE_SY_CAMERA_ZOOM_UP); } else if ((DECR(this->unk_850) == 0) || (this->unk_6AD != 2)) { @@ -10948,7 +10954,7 @@ void func_8084BBE4(Player* this, GlobalContext* globalCtx) { return; } - if (CHECK_PAD(sControlInput->cur, A_BUTTON) || (this->actor.shape.unk_15 != 0)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) || (this->actor.shape.unk_15 != 0)) { func_80837B60(this); if (this->unk_84F < 0) { this->linearVelocity = -0.8f; @@ -10996,8 +11002,8 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { LinkAnimetionEntry* sp54; LinkAnimetionEntry* sp50; - sp84 = sControlInput->rel.in.y; - sp80 = sControlInput->rel.in.x; + sp84 = sControlInput->rel.stick_y; + sp80 = sControlInput->rel.stick_x; this->fallStartHeight = this->actor.posRot.pos.y; this->stateFlags2 |= 0x40; @@ -11192,7 +11198,7 @@ void func_8084C760(Player* this, GlobalContext* globalCtx) { } if (!func_8083F570(this, globalCtx)) { - this->linearVelocity = sControlInput->rel.in.y * 0.03f; + this->linearVelocity = sControlInput->rel.stick_y * 0.03f; } } return; @@ -11275,7 +11281,7 @@ s32 func_8084C9BC(Player* this, GlobalContext* globalCtx) { this->stateFlags2 |= 0x400000; if (EN_HORSE_CHECK_1(rideActor) || - (EN_HORSE_CHECK_4(rideActor) && CHECK_PAD(sControlInput->press, A_BUTTON))) { + (EN_HORSE_CHECK_4(rideActor) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A))) { rideActor->actor.child = NULL; func_80835DAC(globalCtx, this, func_8084D3E4, 0); this->unk_878 = sp34 - rideActor->actor.posRot.pos.y; @@ -11473,7 +11479,8 @@ void func_8084CC98(Player* this, GlobalContext* globalCtx) { } if (this->stateFlags1 & 0x100000) { - if (!func_8083AD4C(globalCtx, this) || (sControlInput->press.in.button & A_BUTTON) || func_80833BCC(this)) { + if (!func_8083AD4C(globalCtx, this) || CHECK_BTN_ANY(sControlInput->press.button, BTN_A) || + func_80833BCC(this)) { this->unk_6AD = 0; this->stateFlags1 &= ~0x100000; } else { @@ -11726,7 +11733,7 @@ void func_8084DC48(Player* this, GlobalContext* globalCtx) { if (this->unk_84F == 0) { if (this->unk_850 == 0) { if (func_800A3BC0(globalCtx, &this->skelAnime) || - ((this->skelAnime.animCurrentFrame >= 22.0f) && !CHECK_PAD(sControlInput->cur, A_BUTTON))) { + ((this->skelAnime.animCurrentFrame >= 22.0f) && !CHECK_BTN_ALL(sControlInput->cur.button, BTN_A))) { func_8083D330(globalCtx, this); } else if (func_800A4530(&this->skelAnime, 20.0f) != 0) { this->actor.velocity.y = -2.0f; @@ -11739,7 +11746,7 @@ void func_8084DC48(Player* this, GlobalContext* globalCtx) { func_8084B158(globalCtx, this, sControlInput, this->actor.velocity.y); this->unk_6C2 = 16000; - if (CHECK_PAD(sControlInput->cur, A_BUTTON) && !func_8083E5A8(this, globalCtx) && + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) && !func_8083E5A8(this, globalCtx) && !(this->actor.bgCheckFlags & 1) && (this->actor.waterY < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) { func_8084DBC4(globalCtx, this, -2.0f); } else { @@ -12530,8 +12537,9 @@ void func_8084FBF4(Player* this, GlobalContext* globalCtx) { s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { sControlInput = &globalCtx->state.input[0]; - if ((CHECK_PAD(sControlInput->cur, A_BUTTON | L_TRIG | R_TRIG) && CHECK_PAD(sControlInput->press, B_BUTTON)) || - (CHECK_PAD(sControlInput->cur, L_TRIG) && CHECK_PAD(sControlInput->press, R_JPAD))) { + if ((CHECK_BTN_ALL(sControlInput->cur.button, BTN_A | BTN_L | BTN_R) && + CHECK_BTN_ALL(sControlInput->press.button, BTN_B)) || + (CHECK_BTN_ALL(sControlInput->cur.button, BTN_L) && CHECK_BTN_ALL(sControlInput->press.button, BTN_DRIGHT))) { D_808535D0 ^= 1; @@ -12543,7 +12551,7 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { if (D_808535D0) { f32 speed; - if (CHECK_PAD(sControlInput->cur, R_TRIG)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { speed = 100.0f; } else { speed = 20.0f; @@ -12551,24 +12559,24 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { func_8006375C(3, 2, "DEBUG MODE"); - if (!CHECK_PAD(sControlInput->cur, L_TRIG)) { - if (CHECK_PAD(sControlInput->cur, B_BUTTON)) { + if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_L)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { this->actor.posRot.pos.y += speed; - } else if (CHECK_PAD(sControlInput->cur, A_BUTTON)) { + } else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)) { this->actor.posRot.pos.y -= speed; } - if (sControlInput->cur.in.button & (U_JPAD | L_JPAD | D_JPAD | R_JPAD)) { + if (CHECK_BTN_ANY(sControlInput->cur.button, BTN_DUP | BTN_DLEFT | BTN_DDOWN | BTN_DRIGHT)) { s16 angle; s16 temp; angle = temp = func_8005A948(ACTIVE_CAM); - if (CHECK_PAD(sControlInput->cur, D_JPAD)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_DDOWN)) { angle = temp + 0x8000; - } else if (CHECK_PAD(sControlInput->cur, L_JPAD)) { + } else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_DLEFT)) { angle = temp + 0x4000; - } else if (CHECK_PAD(sControlInput->cur, R_JPAD)) { + } else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_DRIGHT)) { angle = temp - 0x4000; } @@ -12584,7 +12592,7 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actor.velocity.x = 0.0f; - if (CHECK_PAD(sControlInput->cur, L_TRIG) && CHECK_PAD(sControlInput->press, L_JPAD)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_L) && CHECK_BTN_ALL(sControlInput->press.button, BTN_DLEFT)) { Flags_SetTempClear(globalCtx, globalCtx->roomCtx.curRoom.num); } @@ -13645,7 +13653,7 @@ void func_808524B0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg } void func_808524D0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - sControlInput->press.in.button |= B_BUTTON; + sControlInput->press.button |= BTN_B; func_80844E68(this, globalCtx); } diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h index 0f92fdcc9d..f086f0c7e4 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h +++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_BLAST_H_ #define _Z_EFF_SS_BLAST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h index 3b16bd5609..95416414bc 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_BOMB_H_ #define _Z_EFF_SS_BOMB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h index bbcd141520..4c2412d30e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h +++ b/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_BOMB2_H_ #define _Z_EFF_SS_BOMB2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h index d1410d4e56..fef1d59e23 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h +++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_BUBBLE_H_ #define _Z_EFF_SS_BUBBLE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h index 07204b018b..905eb391b2 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_D_FIRE_H_ #define _Z_EFF_SS_D_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h index dad1b3731e..cf6f349282 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_DEAD_DB_H_ #define _Z_EFF_SS_DEAD_DB_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h index 8759565e9a..c3b2c39064 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_DEAD_DD_H_ #define _Z_EFF_SS_DEAD_DD_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h index c2111284d6..a7eb941be7 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_DEAD_DS_H_ #define _Z_EFF_SS_DEAD_DS_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h index 22314e3e3f..87cbcb76d5 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_DEAD_SOUND_H_ #define _Z_EFF_SS_DEAD_SOUND_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h index c1c0a0db20..9383066565 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_DT_BUBBLE_H_ #define _Z_EFF_SS_DT_BUBBLE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h index d92f6d5bb2..912909632c 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h +++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_DUST_H_ #define _Z_EFF_SS_DUST_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h index b5395f0802..c23fe43030 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_EN_FIRE_H_ #define _Z_EFF_SS_EN_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Actor* actor; diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h index 798d44664a..b3a352b5cb 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h +++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_EN_ICE_H_ #define _Z_EFF_SS_EN_ICE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Actor* actor; diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h index 3c5e893279..a62f82272d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_EXTRA_H_ #define _Z_EFF_SS_EXTRA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h index 8a3cf008b8..d4d9df8166 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h +++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_FCIRCLE_H_ #define _Z_EFF_SS_FCIRCLE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Actor* actor; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h index 7e280c202b..5c33ba2307 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_FHGFLASH_h_ #define _Z_EFF_SS_FHGFLASH_h_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h index 5368760edb..3d209d0721 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h +++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_FIRE_TAIL_H_ #define _Z_EFF_SS_FIRE_TAIL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Actor* actor; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h index 827b543cce..2155a4c54d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_G_FIRE_H_ #define _Z_EFF_SS_G_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h index 4191a88b0e..845c6aeb1a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_G_MAGMA_H_ #define _Z_EFF_SS_G_MAGMA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h index 8e77df9e1e..9bd0e89925 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_G_MAGMA2_H_ #define _Z_EFF_SS_G_MAGMA2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h index a98f270910..a012d09957 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_G_RIPPLE_H_ #define _Z_EFF_SS_G_RIPPLE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h index 7fa4239ab2..d3d75b5e3a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_G_SPK_H_ #define _Z_EFF_SS_G_SPK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Actor* actor; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h index eef432a958..ef6c065b3a 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h +++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_G_SPLASH_H_ #define _Z_EFF_SS_G_SPLASH_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h index 53bd9e3d61..24e62bc03e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_HAHEN_H_ #define _Z_EFF_SS_HAHEN_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h index a30ff596ba..92c0734c22 100644 --- a/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h +++ b/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_HITMARK_H_ #define _Z_EFF_SS_HITMARK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ s32 type; diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h index 50b156d520..dbe6d57420 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_ICE_PIECE_H_ #define _Z_EFF_SS_ICE_PIECE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h index f0ae42da4a..d7b44d9a56 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_ICE_SMOKE_H_ #define _Z_EFF_SS_ICE_SMOKE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h index 2324f0f4b5..281f786079 100644 --- a/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h +++ b/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_K_FIRE_H_ #define _Z_EFF_SS_K_FIRE_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h index 1727d5efb9..9bd6bf6aa8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_KAKERA_H_ #define _Z_EFF_SS_KAKERA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h index a8fe4c24d2..2a94edf076 100644 --- a/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h +++ b/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_KIRAKIRA_H_ #define _Z_EFF_SS_KIRAKIRA_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h index 6732075053..a02f56dc28 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h +++ b/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_LIGHTNING_H_ #define _Z_EFF_SS_LIGHTNING_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h index d95736a3ae..075562b8bc 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_SIBUKI_H_ #define _Z_EFF_SS_SIBUKI_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h index f35c531048..a6b9b1fd46 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_SIBUKI2_H_ #define _Z_EFF_SS_SIBUKI2_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h index 5e8ba8ecd7..ff0dc746d3 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_SOLDERSRCHBALL_H_ #define _Z_EFF_SS_SOLDERSRCHBALL_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h index 0e2b88dcd7..2da77cbe9e 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_STICK_H_ #define _Z_EFF_SS_STICK_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h index 12933eab7b..26b6c86962 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h +++ b/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h @@ -1,8 +1,8 @@ #ifndef _Z_EFF_SS_STONE1_H_ #define _Z_EFF_SS_STONE1_H_ -#include -#include +#include "ultra64.h" +#include "global.h" typedef struct { /* 0x00 */ Vec3f pos; diff --git a/src/overlays/gamestates/ovl_opening/z_opening.c b/src/overlays/gamestates/ovl_opening/z_opening.c index 84619ea824..149b1e2b73 100644 --- a/src/overlays/gamestates/ovl_opening/z_opening.c +++ b/src/overlays/gamestates/ovl_opening/z_opening.c @@ -4,8 +4,7 @@ * Description: Initializes the game into the title screen */ -#include -#include +#include "global.h" void Opening_SetupTitleScreen(OpeningContext* this) { gSaveContext.gameMode = 1; diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index fb9fb1b8ca..309139e03d 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -4,10 +4,10 @@ * Description: Debug Scene Select Menu */ -#include -#include -#include -#include +#include "ultra64.h" +#include "global.h" +#include "vt.h" +#include "alloca.h" void Select_LoadTitle(SelectContext* this) { this->state.running = false; @@ -181,14 +181,14 @@ void Select_UpdateMenu(SelectContext* this) { if (this->unk_21C == 0) { - if (CHECK_PAD(controller1->press, A_BUTTON) || CHECK_PAD(controller1->press, START_BUTTON)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_A) || CHECK_BTN_ALL(controller1->press.button, BTN_START)) { selectedScene = &this->scenes[this->currentScene]; if (selectedScene->loadFunc != NULL) { selectedScene->loadFunc(this, selectedScene->entranceIndex); } } - if (CHECK_PAD(controller1->press, B_BUTTON)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_B)) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { gSaveContext.linkAge = 1; } else { @@ -196,7 +196,7 @@ void Select_UpdateMenu(SelectContext* this) { } } - if (CHECK_PAD(controller1->press, Z_TRIG)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_Z)) { if (gSaveContext.cutsceneIndex == 0x8000) { gSaveContext.cutsceneIndex = 0; } else if (gSaveContext.cutsceneIndex == 0) { @@ -224,7 +224,7 @@ void Select_UpdateMenu(SelectContext* this) { } else if (gSaveContext.cutsceneIndex == 0xFFFA) { gSaveContext.cutsceneIndex = 0x8000; } - } else if (CHECK_PAD(controller1->press, R_TRIG)) { + } else if (CHECK_BTN_ALL(controller1->press.button, BTN_R)) { if (gSaveContext.cutsceneIndex == 0x8000) { gSaveContext.cutsceneIndex = 0xFFFA; } else if (gSaveContext.cutsceneIndex == 0) { @@ -260,14 +260,14 @@ void Select_UpdateMenu(SelectContext* this) { } // user can change "opt", but it doesn't do anything - if (CHECK_PAD(controller1->press, U_CBUTTONS)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_CUP)) { this->opt--; } - if (CHECK_PAD(controller1->press, D_CBUTTONS)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_CDOWN)) { this->opt++; } - if (CHECK_PAD(controller1->press, U_JPAD)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_DUP)) { if (this->unk_22C == 1) { this->unk_224 = 0; } @@ -279,12 +279,12 @@ void Select_UpdateMenu(SelectContext* this) { } } - if (CHECK_PAD(controller1->cur, U_JPAD) && this->unk_224 == 0) { + if (CHECK_BTN_ALL(controller1->cur.button, BTN_DUP) && this->unk_224 == 0) { Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_220 = SREG(30) * 3; } - if (CHECK_PAD(controller1->press, D_JPAD)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_DDOWN)) { if (this->unk_230 == 1) { this->unk_228 = 0; } @@ -296,23 +296,24 @@ void Select_UpdateMenu(SelectContext* this) { } } - if (CHECK_PAD(controller1->cur, D_JPAD) && (this->unk_228 == 0)) { + if (CHECK_BTN_ALL(controller1->cur.button, BTN_DDOWN) && (this->unk_228 == 0)) { Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_220 = -SREG(30) * 3; } - if (CHECK_PAD(controller1->press, L_JPAD) || CHECK_PAD(controller1->cur, L_JPAD)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_DLEFT) || CHECK_BTN_ALL(controller1->cur.button, BTN_DLEFT)) { Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_220 = SREG(30); } - if (CHECK_PAD(controller1->press, R_JPAD) || CHECK_PAD(controller1->cur, R_JPAD)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_DRIGHT) || + CHECK_BTN_ALL(controller1->cur.button, BTN_DRIGHT)) { Audio_PlaySoundGeneral(NA_SE_IT_SWORD_IMPACT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_220 = -SREG(30); } } - if (CHECK_PAD(controller1->press, L_TRIG)) { + if (CHECK_BTN_ALL(controller1->press.button, BTN_L)) { this->unk_1DC++; this->unk_1DC = (this->unk_1DC + 7) % 7; this->currentScene = this->unk_20C = this->unk_1E0[this->unk_1DC]; diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index 41cc66f636..ee1408768e 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -4,9 +4,8 @@ * Description: Displays the Nintendo Logo */ -#include -#include -#include +#include "global.h" +#include "alloca.h" extern Gfx D_01002720[]; extern u8 D_01001800[];