mirror of
https://github.com/n64decomp/sm64
synced 2026-07-09 05:43:14 -04:00
Refresh 3
This commit is contained in:
+203
-2
@@ -269,6 +269,56 @@ 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; \
|
||||
@@ -277,6 +327,9 @@ typedef short ENVMIX_STATE[40];
|
||||
_a->words.w1 = (uintptr_t)(s); \
|
||||
}
|
||||
|
||||
/*
|
||||
* Not used in SM64.
|
||||
*/
|
||||
#define aPoleFilter(pkt, f, g, s) \
|
||||
{ \
|
||||
Acmd *_a = (Acmd *)pkt; \
|
||||
@@ -286,6 +339,11 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -294,6 +352,31 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -302,6 +385,17 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -310,6 +404,15 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -318,6 +421,20 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -327,6 +444,7 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -336,6 +454,39 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -345,6 +496,15 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -353,6 +513,12 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -361,6 +527,10 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -370,6 +540,10 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -379,13 +553,29 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -394,6 +584,14 @@ typedef short ENVMIX_STATE[40];
|
||||
_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; \
|
||||
@@ -406,7 +604,10 @@ typedef short ENVMIX_STATE[40];
|
||||
// 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; \
|
||||
|
||||
+241
-101
@@ -441,118 +441,147 @@
|
||||
* G_SETCOMBINE: color combine modes
|
||||
*/
|
||||
/* Color combiner constants: */
|
||||
#define G_CCMUX_COMBINED 0
|
||||
#define G_CCMUX_TEXEL0 1
|
||||
#define G_CCMUX_TEXEL1 2
|
||||
#define G_CCMUX_PRIMITIVE 3
|
||||
#define G_CCMUX_SHADE 4
|
||||
#define G_CCMUX_ENVIRONMENT 5
|
||||
#define G_CCMUX_CENTER 6
|
||||
#define G_CCMUX_SCALE 6
|
||||
#define G_CCMUX_COMBINED_ALPHA 7
|
||||
#define G_CCMUX_TEXEL0_ALPHA 8
|
||||
#define G_CCMUX_TEXEL1_ALPHA 9
|
||||
#define G_CCMUX_PRIMITIVE_ALPHA 10
|
||||
#define G_CCMUX_SHADE_ALPHA 11
|
||||
#define G_CCMUX_ENV_ALPHA 12
|
||||
#define G_CCMUX_LOD_FRACTION 13
|
||||
#define G_CCMUX_PRIM_LOD_FRAC 14
|
||||
#define G_CCMUX_NOISE 7
|
||||
#define G_CCMUX_K4 7
|
||||
#define G_CCMUX_K5 15
|
||||
#define G_CCMUX_1 6
|
||||
#define G_CCMUX_0 31
|
||||
#define G_CCMUX_COMBINED 0
|
||||
#define G_CCMUX_TEXEL0 1
|
||||
#define G_CCMUX_TEXEL1 2
|
||||
#define G_CCMUX_PRIMITIVE 3
|
||||
#define G_CCMUX_SHADE 4
|
||||
#define G_CCMUX_ENVIRONMENT 5
|
||||
#define G_CCMUX_CENTER 6
|
||||
#define G_CCMUX_SCALE 6
|
||||
#define G_CCMUX_COMBINED_ALPHA 7
|
||||
#define G_CCMUX_TEXEL0_ALPHA 8
|
||||
#define G_CCMUX_TEXEL1_ALPHA 9
|
||||
#define G_CCMUX_PRIMITIVE_ALPHA 10
|
||||
#define G_CCMUX_SHADE_ALPHA 11
|
||||
#define G_CCMUX_ENV_ALPHA 12
|
||||
#define G_CCMUX_LOD_FRACTION 13
|
||||
#define G_CCMUX_PRIM_LOD_FRAC 14
|
||||
#define G_CCMUX_NOISE 7
|
||||
#define G_CCMUX_K4 7
|
||||
#define G_CCMUX_K5 15
|
||||
#define G_CCMUX_1 6
|
||||
#define G_CCMUX_0 31
|
||||
|
||||
/* Alpha combiner constants: */
|
||||
#define G_ACMUX_COMBINED 0
|
||||
#define G_ACMUX_TEXEL0 1
|
||||
#define G_ACMUX_TEXEL1 2
|
||||
#define G_ACMUX_PRIMITIVE 3
|
||||
#define G_ACMUX_SHADE 4
|
||||
#define G_ACMUX_ENVIRONMENT 5
|
||||
#define G_ACMUX_COMBINED 0
|
||||
#define G_ACMUX_TEXEL0 1
|
||||
#define G_ACMUX_TEXEL1 2
|
||||
#define G_ACMUX_PRIMITIVE 3
|
||||
#define G_ACMUX_SHADE 4
|
||||
#define G_ACMUX_ENVIRONMENT 5
|
||||
#define G_ACMUX_LOD_FRACTION 0
|
||||
#define G_ACMUX_PRIM_LOD_FRAC 6
|
||||
#define G_ACMUX_1 6
|
||||
#define G_ACMUX_0 7
|
||||
#define G_ACMUX_1 6
|
||||
#define G_ACMUX_0 7
|
||||
|
||||
/* typical CC cycle 1 modes */
|
||||
#define G_CC_PRIMITIVE 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_SHADE 0, 0, 0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_MODULATEI TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE
|
||||
#define G_CC_MODULATEIA TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_MODULATEIDECALA TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0
|
||||
#define G_CC_MODULATERGB G_CC_MODULATEI
|
||||
#define G_CC_MODULATERGBA G_CC_MODULATEIA
|
||||
#define G_CC_MODULATERGBDECALA G_CC_MODULATEIDECALA
|
||||
#define G_CC_MODULATEI_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_MODULATEIA_PRIM TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0
|
||||
#define G_CC_MODULATEIDECALA_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0
|
||||
#define G_CC_MODULATERGB_PRIM G_CC_MODULATEI_PRIM
|
||||
#define G_CC_MODULATERGBA_PRIM G_CC_MODULATEIA_PRIM
|
||||
#define G_CC_MODULATERGBDECALA_PRIM G_CC_MODULATEIDECALA_PRIM
|
||||
#define G_CC_DECALRGB 0, 0, 0, TEXEL0, 0, 0, 0, SHADE
|
||||
#define G_CC_DECALRGBA 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0
|
||||
#define G_CC_BLENDI ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDIA ENVIRONMENT, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_BLENDIDECALA ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_BLENDRGBA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDRGBDECALA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_ADDRGB 1, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_ADDRGBDECALA 1, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_REFLECTRGB ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_REFLECTRGBDECALA ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_HILITERGB PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_HILITERGBA PRIMITIVE, SHADE, TEXEL0, SHADE, PRIMITIVE, SHADE, TEXEL0, SHADE
|
||||
#define G_CC_HILITERGBDECALA PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_SHADEDECALA 0, 0, 0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_BLENDPE PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_BLENDPEDECALA PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL0
|
||||
#define G_CC_PRIMITIVE 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_SHADE 0, 0, 0, SHADE, 0, 0, 0, SHADE
|
||||
|
||||
#define G_CC_MODULATEI TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE
|
||||
#define G_CC_MODULATEIDECALA TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0
|
||||
#define G_CC_MODULATEIFADE TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_MODULATERGB G_CC_MODULATEI
|
||||
#define G_CC_MODULATERGBDECALA G_CC_MODULATEIDECALA
|
||||
#define G_CC_MODULATERGBFADE G_CC_MODULATEIFADE
|
||||
|
||||
#define G_CC_MODULATEIA TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_MODULATEIFADEA TEXEL0, 0, SHADE, 0, TEXEL0, 0, ENVIRONMENT, 0
|
||||
|
||||
#define G_CC_MODULATEFADE TEXEL0, 0, SHADE, 0, ENVIRONMENT, 0, TEXEL0, 0
|
||||
|
||||
#define G_CC_MODULATERGBA G_CC_MODULATEIA
|
||||
#define G_CC_MODULATERGBFADEA G_CC_MODULATEIFADEA
|
||||
|
||||
#define G_CC_MODULATEI_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_MODULATEIA_PRIM TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0
|
||||
#define G_CC_MODULATEIDECALA_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_MODULATERGB_PRIM G_CC_MODULATEI_PRIM
|
||||
#define G_CC_MODULATERGBA_PRIM G_CC_MODULATEIA_PRIM
|
||||
#define G_CC_MODULATERGBDECALA_PRIM G_CC_MODULATEIDECALA_PRIM
|
||||
|
||||
#define G_CC_FADE SHADE, 0, ENVIRONMENT, 0, SHADE, 0, ENVIRONMENT, 0
|
||||
#define G_CC_FADEA TEXEL0, 0, ENVIRONMENT, 0, TEXEL0, 0, ENVIRONMENT, 0
|
||||
|
||||
#define G_CC_DECALRGB 0, 0, 0, TEXEL0, 0, 0, 0, SHADE
|
||||
#define G_CC_DECALRGBA 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0
|
||||
#define G_CC_DECALFADE 0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_DECALFADEA 0, 0, 0, TEXEL0, TEXEL0, 0, ENVIRONMENT, 0
|
||||
|
||||
#define G_CC_BLENDI ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDIA ENVIRONMENT, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_BLENDIDECALA ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_BLENDRGBA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDRGBDECALA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_BLENDRGBFADEA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_ADDRGB TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_ADDRGBDECALA TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_ADDRGBFADE TEXEL0, 0, TEXEL0, SHADE, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_REFLECTRGB ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_REFLECTRGBDECALA ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_HILITERGB PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_HILITERGBA PRIMITIVE, SHADE, TEXEL0, SHADE, PRIMITIVE, SHADE, TEXEL0, SHADE
|
||||
#define G_CC_HILITERGBDECALA PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
|
||||
|
||||
#define G_CC_SHADEDECALA 0, 0, 0, SHADE, 0, 0, 0, TEXEL0
|
||||
#define G_CC_SHADEFADEA 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT
|
||||
|
||||
#define G_CC_BLENDPE PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0
|
||||
#define G_CC_BLENDPEDECALA PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL0
|
||||
|
||||
/* oddball modes */
|
||||
#define _G_CC_BLENDPE ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, SHADE, 0
|
||||
#define _G_CC_BLENDPEDECALA ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0
|
||||
#define _G_CC_TWOCOLORTEX PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
#define _G_CC_BLENDPE ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, SHADE, 0
|
||||
#define _G_CC_BLENDPEDECALA ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0
|
||||
#define _G_CC_TWOCOLORTEX PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE
|
||||
/* used for 1-cycle sparse mip-maps, primitive color has color of lowest LOD */
|
||||
#define _G_CC_SPARSEST PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0, PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0
|
||||
#define G_CC_TEMPLERP TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0
|
||||
#define _G_CC_SPARSEST PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0, PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0
|
||||
#define G_CC_TEMPLERP TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0
|
||||
|
||||
/* typical CC cycle 1 modes, usually followed by other cycle 2 modes */
|
||||
#define G_CC_TRILERP TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0
|
||||
#define G_CC_INTERFERENCE TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0
|
||||
#define G_CC_TRILERP TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0
|
||||
#define G_CC_INTERFERENCE TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0
|
||||
|
||||
/*
|
||||
* One-cycle color convert operation
|
||||
*/
|
||||
#define G_CC_1CYUV2RGB TEXEL0, K4, K5, TEXEL0, 0, 0, 0, SHADE
|
||||
#define G_CC_1CYUV2RGB TEXEL0, K4, K5, TEXEL0, 0, 0, 0, SHADE
|
||||
|
||||
/*
|
||||
* NOTE: YUV2RGB expects TF step1 color conversion to occur in 2nd clock.
|
||||
* Therefore, CC looks for step1 results in TEXEL1
|
||||
*/
|
||||
#define G_CC_YUV2RGB TEXEL1, K4, K5, TEXEL1, 0, 0, 0, 0
|
||||
#define G_CC_YUV2RGB TEXEL1, K4, K5, TEXEL1, 0, 0, 0, 0
|
||||
|
||||
/* typical CC cycle 2 modes */
|
||||
#define G_CC_PASS2 0, 0, 0, COMBINED, 0, 0, 0, COMBINED
|
||||
#define G_CC_MODULATEI2 COMBINED, 0, SHADE, 0, 0, 0, 0, SHADE
|
||||
#define G_CC_MODULATEIA2 COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0
|
||||
#define G_CC_MODULATERGB2 G_CC_MODULATEI2
|
||||
#define G_CC_MODULATERGBA2 G_CC_MODULATEIA2
|
||||
#define G_CC_MODULATEI_PRIM2 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_MODULATEIA_PRIM2 COMBINED, 0, PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0
|
||||
#define G_CC_MODULATERGB_PRIM2 G_CC_MODULATEI_PRIM2
|
||||
#define G_CC_MODULATERGBA_PRIM2 G_CC_MODULATEIA_PRIM2
|
||||
#define G_CC_DECALRGB2 0, 0, 0, COMBINED, 0, 0, 0, SHADE
|
||||
#define G_CC_PASS2 0, 0, 0, COMBINED, 0, 0, 0, COMBINED
|
||||
#define G_CC_MODULATEI2 COMBINED, 0, SHADE, 0, 0, 0, 0, SHADE
|
||||
#define G_CC_MODULATEIA2 COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0
|
||||
#define G_CC_MODULATERGB2 G_CC_MODULATEI2
|
||||
#define G_CC_MODULATERGBA2 G_CC_MODULATEIA2
|
||||
#define G_CC_MODULATEI_PRIM2 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_MODULATEIA_PRIM2 COMBINED, 0, PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0
|
||||
#define G_CC_MODULATERGB_PRIM2 G_CC_MODULATEI_PRIM2
|
||||
#define G_CC_MODULATERGBA_PRIM2 G_CC_MODULATEIA_PRIM2
|
||||
#define G_CC_DECALRGB2 0, 0, 0, COMBINED, 0, 0, 0, SHADE
|
||||
/*
|
||||
* ?
|
||||
#define G_CC_DECALRGBA2 COMBINED, SHADE, COMBINED_ALPHA, SHADE, 0, 0, 0, SHADE
|
||||
*/
|
||||
#define G_CC_BLENDI2 ENVIRONMENT, SHADE, COMBINED, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDIA2 ENVIRONMENT, SHADE, COMBINED, SHADE, COMBINED, 0, SHADE, 0
|
||||
#define G_CC_CHROMA_KEY2 TEXEL0, CENTER, SCALE, 0, 0, 0, 0, 0
|
||||
#define G_CC_HILITERGB2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, SHADE
|
||||
#define G_CC_HILITERGBA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, ENVIRONMENT, COMBINED, TEXEL0, COMBINED
|
||||
#define G_CC_HILITERGBDECALA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, TEXEL0
|
||||
#define G_CC_HILITERGBPASSA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, COMBINED
|
||||
#define G_CC_BLENDI2 ENVIRONMENT, SHADE, COMBINED, SHADE, 0, 0, 0, SHADE
|
||||
#define G_CC_BLENDIA2 ENVIRONMENT, SHADE, COMBINED, SHADE, COMBINED, 0, SHADE, 0
|
||||
#define G_CC_CHROMA_KEY2 TEXEL0, CENTER, SCALE, 0, 0, 0, 0, 0
|
||||
#define G_CC_HILITERGB2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, SHADE
|
||||
#define G_CC_HILITERGBA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, ENVIRONMENT, COMBINED, TEXEL0, COMBINED
|
||||
#define G_CC_HILITERGBDECALA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, TEXEL0
|
||||
#define G_CC_HILITERGBPASSA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, COMBINED
|
||||
|
||||
/*
|
||||
* G_SETOTHERMODE_L sft: shift count
|
||||
@@ -902,6 +931,9 @@
|
||||
CVG_DST_CLAMP | ZMODE_OPA | \
|
||||
GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)
|
||||
|
||||
/* Custom version of RM_AA_ZB_XLU_SURF with Z_UPD */
|
||||
#define RM_CUSTOM_AA_ZB_XLU_SURF(clk) \
|
||||
RM_AA_ZB_XLU_SURF(clk) | Z_UPD
|
||||
|
||||
|
||||
#define G_RM_AA_ZB_OPA_SURF RM_AA_ZB_OPA_SURF(1)
|
||||
@@ -1000,6 +1032,9 @@
|
||||
#define G_RM_OPA_CI RM_OPA_CI(1)
|
||||
#define G_RM_OPA_CI2 RM_OPA_CI(2)
|
||||
|
||||
#define G_RM_CUSTOM_AA_ZB_XLU_SURF RM_CUSTOM_AA_ZB_XLU_SURF(1)
|
||||
#define G_RM_CUSTOM_AA_ZB_XLU_SURF2 RM_CUSTOM_AA_ZB_XLU_SURF(2)
|
||||
|
||||
|
||||
#define G_RM_FOG_SHADE_A GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA)
|
||||
#define G_RM_FOG_PRIM_A GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA)
|
||||
@@ -1132,7 +1167,7 @@ typedef struct {
|
||||
* First 8 words are integer portion of the 4x4 matrix
|
||||
* Last 8 words are the fraction portion of the 4x4 matrix
|
||||
*/
|
||||
typedef long Mtx_t[4][4];
|
||||
typedef s32 Mtx_t[4][4];
|
||||
|
||||
typedef union {
|
||||
Mtx_t m;
|
||||
@@ -1478,6 +1513,8 @@ typedef union {
|
||||
{ {{ {{0,0,0},0,{0,0,0},0,{rightx,righty,rightz},0}}, \
|
||||
{ {{0,0x80,0},0,{0,0x80,0},0,{upx,upy,upz},0}}} }
|
||||
|
||||
/* Don't declare these for F3D_OLD to avoid bss reordering */
|
||||
#ifndef F3D_OLD
|
||||
/*
|
||||
* Graphics DMA Packet
|
||||
*/
|
||||
@@ -1650,9 +1687,6 @@ typedef struct {
|
||||
unsigned int dtdy:16;/* Change in T per change in Y */
|
||||
} Gtexrect;
|
||||
|
||||
#define MakeTexRect(xh,yh,flip,tile,xl,yl,s,t,dsdx,dtdy) \
|
||||
G_TEXRECT, xh, yh, 0, flip, 0, tile, xl, yl, s, t, dsdx, dtdy
|
||||
|
||||
/*
|
||||
* Textured rectangles are 128 bits not 64 bits
|
||||
*/
|
||||
@@ -1662,6 +1696,10 @@ typedef struct {
|
||||
unsigned long w2;
|
||||
unsigned long w3;
|
||||
} TexRect;
|
||||
#endif
|
||||
|
||||
#define MakeTexRect(xh,yh,flip,tile,xl,yl,s,t,dsdx,dtdy) \
|
||||
G_TEXRECT, xh, yh, 0, flip, 0, tile, xl, yl, s, t, dsdx, dtdy
|
||||
|
||||
/*
|
||||
* Generic Gfx Packet
|
||||
@@ -1681,7 +1719,7 @@ typedef struct {
|
||||
*/
|
||||
typedef union {
|
||||
Gwords words;
|
||||
#if !defined(__x86_64__) && !defined(__i386__)
|
||||
#if !defined(F3D_OLD) && !defined(__x86_64__) && !defined(__i386__)
|
||||
Gdma dma;
|
||||
Gtri tri;
|
||||
Gline3D line;
|
||||
@@ -2159,7 +2197,15 @@ typedef union {
|
||||
__gsSP1Triangle_w1f(v00, v01, v02, flag0)), \
|
||||
__gsSP1Triangle_w1f(v10, v11, v12, flag1) \
|
||||
}}
|
||||
|
||||
#else
|
||||
#define gSP2Triangles(pkt, v00, v01, v02, flag0, v10, v11, v12, flag1) \
|
||||
{ \
|
||||
gSP1Triangle(pkt, v00, v01, v02, flag0); \
|
||||
gSP1Triangle(pkt, v10, v11, v12, flag1); \
|
||||
}
|
||||
#define gsSP2Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \
|
||||
gsSP1Triangle(v00, v01, v02, flag0), \
|
||||
gsSP1Triangle(v10, v11, v12, flag1)
|
||||
#endif /* F3DEX_GBI/F3DLP_GBI */
|
||||
|
||||
#if (defined(F3DEX_GBI)||defined(F3DLP_GBI))
|
||||
@@ -2797,8 +2843,23 @@ typedef union {
|
||||
}}
|
||||
#endif
|
||||
|
||||
#define gSPPerspNormalize(pkt, s) gMoveWd(pkt, G_MW_PERSPNORM, 0, (s))
|
||||
#define gsSPPerspNormalize(s) gsMoveWd( G_MW_PERSPNORM, 0, (s))
|
||||
#ifndef F3D_OLD
|
||||
# define gSPPerspNormalize(pkt, s) gMoveWd(pkt, G_MW_PERSPNORM, 0, (s))
|
||||
# define gsSPPerspNormalize(s) gsMoveWd( G_MW_PERSPNORM, 0, (s))
|
||||
#else
|
||||
# define gSPPerspNormalize(pkt, s) \
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = _SHIFTL(G_RDPHALF_1, 24, 8); \
|
||||
_g->words.w1 = (s); \
|
||||
}
|
||||
# define gsSPPerspNormalize(s) \
|
||||
{{ \
|
||||
_SHIFTL(G_RDPHALF_1, 24, 8), \
|
||||
(s) \
|
||||
}}
|
||||
#endif
|
||||
|
||||
#ifdef F3DEX_GBI_2
|
||||
# define gSPPopMatrixN(pkt, n, num) gDma2p((pkt),G_POPMTX,(num)*64,64,2,0)
|
||||
@@ -2849,7 +2910,7 @@ typedef union {
|
||||
#define gsSPClearGeometryMode(word) gsSPGeometryMode((word),0)
|
||||
#define gSPLoadGeometryMode(pkt, word) gSPGeometryMode((pkt),-1,(word))
|
||||
#define gsSPLoadGeometryMode(word) gsSPGeometryMode(-1,(word))
|
||||
|
||||
#define gsSPGeometryModeSetFirst(c, s) gsSPGeometryMode(c, s)
|
||||
#else /* F3DEX_GBI_2 */
|
||||
#define gSPSetGeometryMode(pkt, word) \
|
||||
{ \
|
||||
@@ -2876,6 +2937,18 @@ typedef union {
|
||||
{{ \
|
||||
_SHIFTL(G_CLEARGEOMETRYMODE, 24, 8), (unsigned int)(word) \
|
||||
}}
|
||||
|
||||
/*
|
||||
* gsSPGeometryMode
|
||||
* In Fast3DEX2 it is better to use this, as the RSP geometry mode
|
||||
* is able to be set and cleared in a single command.
|
||||
*/
|
||||
#define gsSPGeometryMode(c, s) \
|
||||
gsSPClearGeometryMode(c), \
|
||||
gsSPSetGeometryMode(s)
|
||||
#define gsSPGeometryModeSetFirst(c, s) \
|
||||
gsSPSetGeometryMode(s), \
|
||||
gsSPClearGeometryMode(c)
|
||||
#endif /* F3DEX_GBI_2 */
|
||||
|
||||
#ifdef F3DEX_GBI_2
|
||||
@@ -4482,13 +4555,73 @@ typedef union {
|
||||
_g->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \
|
||||
}
|
||||
|
||||
#ifdef F3D_OLD
|
||||
# define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \
|
||||
_SHIFTL(yh, 0, 12)); \
|
||||
_g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \
|
||||
_SHIFTL(yl, 0, 12)); \
|
||||
gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \
|
||||
gImmp1(pkt, G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)));\
|
||||
}
|
||||
|
||||
#define gsSPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{{(_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12)),\
|
||||
(_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \
|
||||
gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \
|
||||
gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)))
|
||||
gsImmp1(G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \
|
||||
gsImmp1(G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)))
|
||||
|
||||
#define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\
|
||||
/* like gSPTextureRectangle but accepts negative position arguments */
|
||||
# define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | \
|
||||
_SHIFTL(MAX((s16)(xh),0), 12, 12) | \
|
||||
_SHIFTL(MAX((s16)(yh),0), 0, 12)); \
|
||||
_g->words.w1 = (_SHIFTL((tile), 24, 3) | \
|
||||
_SHIFTL(MAX((s16)(xl),0), 12, 12) | \
|
||||
_SHIFTL(MAX((s16)(yl),0), 0, 12)); \
|
||||
gImmp1(pkt, G_RDPHALF_2, \
|
||||
(_SHIFTL(((s) - \
|
||||
(((s16)(xl) < 0) ? \
|
||||
(((s16)(dsdx) < 0) ? \
|
||||
(MAX((((s16)(xl)*(s16)(dsdx))>>7),0)) : \
|
||||
(MIN((((s16)(xl)*(s16)(dsdx))>>7),0))) : 0)), \
|
||||
16, 16) | \
|
||||
_SHIFTL(((t) - \
|
||||
(((yl) < 0) ? \
|
||||
(((s16)(dtdy) < 0) ? \
|
||||
(MAX((((s16)(yl)*(s16)(dtdy))>>7),0)) : \
|
||||
(MIN((((s16)(yl)*(s16)(dtdy))>>7),0))) : 0)), \
|
||||
0, 16))); \
|
||||
gImmp1(pkt, G_RDPHALF_CONT, (_SHIFTL((dsdx), 16, 16) | \
|
||||
_SHIFTL((dtdy), 0, 16))); \
|
||||
}
|
||||
|
||||
# define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{{(_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \
|
||||
_SHIFTL(yh, 0, 12)), \
|
||||
(_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \
|
||||
gsImmp1(G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \
|
||||
gsImmp1(G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)))
|
||||
|
||||
# define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
_g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) |\
|
||||
_SHIFTL(yh, 0, 12)); \
|
||||
_g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \
|
||||
_SHIFTL(yl, 0, 12)); \
|
||||
gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \
|
||||
gImmp1(pkt, G_RDPHALF_CONT, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))); \
|
||||
}
|
||||
#else
|
||||
# define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
@@ -4500,8 +4633,14 @@ typedef union {
|
||||
gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)));\
|
||||
}
|
||||
|
||||
#define gsSPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{{(_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12)),\
|
||||
(_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \
|
||||
gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \
|
||||
gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)))
|
||||
|
||||
/* like gSPTextureRectangle but accepts negative position arguments */
|
||||
#define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
# define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
@@ -4528,14 +4667,14 @@ typedef union {
|
||||
_SHIFTL((dtdy), 0, 16))); \
|
||||
}
|
||||
|
||||
#define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
# define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{{(_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \
|
||||
_SHIFTL(yh, 0, 12)), \
|
||||
(_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \
|
||||
gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \
|
||||
gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)))
|
||||
|
||||
#define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
# define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \
|
||||
{ \
|
||||
Gfx *_g = (Gfx *)(pkt); \
|
||||
\
|
||||
@@ -4546,6 +4685,7 @@ typedef union {
|
||||
gImmp1(pkt, G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \
|
||||
gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define gsDPWord(wordhi, wordlo) \
|
||||
gsImmp1(G_RDPHALF_1, (uintptr_t)(wordhi)), \
|
||||
|
||||
@@ -1,977 +0,0 @@
|
||||
/*
|
||||
* Graphics Binary Interface
|
||||
* This supports Fast3D, Fast3DEX, and Fast3DEX2.
|
||||
*/
|
||||
|
||||
/* Fast3DZEX support */
|
||||
.ifdef F3DZEX_GBI
|
||||
.set F3DEX_GBI_2, 1
|
||||
.endif
|
||||
|
||||
/* Macros */
|
||||
|
||||
.macro bytes4 byte1, byte2, byte3, byte4
|
||||
.word ((\byte1 & 0xFF) << 24) | ((\byte2 & 0xFF) << 16) | ((\byte3 & 0xFF) << 8) | (\byte4 & 0xFF)
|
||||
.endm
|
||||
|
||||
/* commands with no parameters */
|
||||
.macro f3d_noparam cmd
|
||||
.word (\cmd << 24)
|
||||
.word 0
|
||||
.endm
|
||||
|
||||
.macro gsImmp1 cmd, param
|
||||
.word (\cmd << 24)
|
||||
.word \param
|
||||
.endm
|
||||
|
||||
/* DMA helper */
|
||||
.macro gsDma1p cmd, segAddr, length, params
|
||||
.word (\cmd << 24) | ((\params & 0xFFFF) << 16) | (\length & 0xFFFF)
|
||||
.word \segAddr
|
||||
.endm
|
||||
|
||||
/* DMA helper 3*/
|
||||
.macro gsDma3p cmd, byte2, byte3, byte4, segAddr
|
||||
bytes4 \cmd, \byte2, \byte3, \byte4
|
||||
.word \segAddr
|
||||
.endm
|
||||
|
||||
/* Helper for RGBA colors. */
|
||||
.macro sDPRGBColor cmd r, g, b, a
|
||||
.word \cmd << 24
|
||||
bytes4 \r, \g, \b, \a
|
||||
.endm
|
||||
|
||||
/* Opcodes */
|
||||
|
||||
.ifdef F3DEX_GBI_2
|
||||
.set G_MTX, 0xDA
|
||||
.set G_MOVEMEM, 0xDC
|
||||
.set G_VTX, 0x01
|
||||
.set G_DL, 0xDE
|
||||
.set G_TRI2, 0x06
|
||||
.set G_RDPHALF_1, 0xE1
|
||||
.set G_RDPHALF_2, 0xF1
|
||||
.set G_GEOMETRYMODE, 0xD9 /* Fast3DEX2 uses one GeometryMode opcode. */
|
||||
.set G_ENDDL, 0xDF
|
||||
.set G_SETOTHERMODE_L, 0xE2
|
||||
.set G_SETOTHERMODE_H, 0xE3
|
||||
.set G_TEXTURE, 0xD7
|
||||
.set G_MOVEWORD, 0xDB
|
||||
.set G_TRI1, 0x05
|
||||
.set G_NOOP, 0xC0
|
||||
.set G_RDPLOADSYNC, 0xE6
|
||||
.set G_RDPPIPESYNC, 0xE7
|
||||
.set G_RDPTILESYNC, 0xE8
|
||||
.set G_RDPFULLSYNC, 0xE9
|
||||
.set G_LOADTLUT, 0xF0
|
||||
.set G_SETTILESIZE, 0xF2
|
||||
.set G_LOADBLOCK, 0xF3
|
||||
.set G_SETTILE, 0xF5
|
||||
.set G_SETFILLCOLOR, 0xF7
|
||||
.set G_SETFOGCOLOR, 0xF8
|
||||
.set G_SETBLENDCOLOR, 0xF9
|
||||
.set G_SETPRIMCOLOR, 0xFA
|
||||
.set G_SETENVCOLOR, 0xFB
|
||||
.set G_SETCOMBINE, 0xFC
|
||||
.set G_SETTIMG, 0xFD
|
||||
.set G_TEXRECT, 0xE4
|
||||
|
||||
.else /* F3D and F3DEX */
|
||||
.set G_MTX, 0x01
|
||||
.set G_MOVEMEM, 0x03
|
||||
.set G_VTX, 0x04
|
||||
.set G_DL, 0x06
|
||||
.set G_TRI2, 0xB1
|
||||
.set G_RDPHALF_CONT, 0xB2
|
||||
.set G_RDPHALF_2, 0xB3
|
||||
.set G_RDPHALF_1, 0xB4
|
||||
.set G_CLEARGEOMETRYMODE, 0xB6
|
||||
.set G_SETGEOMETRYMODE, 0xB7
|
||||
.set G_ENDDL, 0xB8
|
||||
.set G_SETOTHERMODE_L, 0xB9
|
||||
.set G_SETOTHERMODE_H, 0xBA
|
||||
.set G_TEXTURE, 0xBB
|
||||
.set G_MOVEWORD, 0xBC
|
||||
.set G_TRI1, 0xBF
|
||||
.set G_NOOP, 0xC0
|
||||
.set G_TEXRECT, 0xE4
|
||||
.set G_RDPLOADSYNC, 0xE6
|
||||
.set G_RDPPIPESYNC, 0xE7
|
||||
.set G_RDPTILESYNC, 0xE8
|
||||
.set G_RDPFULLSYNC, 0xE9
|
||||
.set G_LOADTLUT, 0xF0
|
||||
.set G_SETTILESIZE, 0xF2
|
||||
.set G_LOADBLOCK, 0xF3
|
||||
.set G_SETTILE, 0xF5
|
||||
.set G_FILLRECT, 0xF6
|
||||
.set G_SETFILLCOLOR, 0xF7
|
||||
.set G_SETFOGCOLOR, 0xF8
|
||||
.set G_SETBLENDCOLOR, 0xF9
|
||||
.set G_SETPRIMCOLOR, 0xFA
|
||||
.set G_SETENVCOLOR, 0xFB
|
||||
.set G_SETCOMBINE, 0xFC
|
||||
.set G_SETTIMG, 0xFD
|
||||
.endif
|
||||
|
||||
/* Arguments */
|
||||
|
||||
/* gSPMatrix */
|
||||
.ifdef F3DEX_GBI_2
|
||||
.set G_MTX_MODELVIEW, 0x00
|
||||
.set G_MTX_PROJECTION, 0x04
|
||||
.set G_MTX_MUL, 0x00
|
||||
.set G_MTX_LOAD, 0x02
|
||||
.set G_MTX_NOPUSH, 0x00
|
||||
.set G_MTX_PUSH, 0x01
|
||||
|
||||
.else /* F3D and F3DEX */
|
||||
.set G_MTX_MODELVIEW, 0x00
|
||||
.set G_MTX_PROJECTION, 0x01
|
||||
.set G_MTX_MUL, 0x00
|
||||
.set G_MTX_LOAD, 0x02
|
||||
.set G_MTX_NOPUSH, 0x00
|
||||
.set G_MTX_PUSH, 0x04
|
||||
.endif
|
||||
|
||||
/* gSPLight */
|
||||
.ifdef F3DEX_GBI_2
|
||||
.set G_MVO_L0, (2*24)
|
||||
.else
|
||||
.set G_MV_L0, 0x86
|
||||
.endif
|
||||
|
||||
/* gSPDisplayList / gSPBranchDisplayList */
|
||||
.set G_DL_PUSH, 0x00
|
||||
.set G_DL_NOPUSH, 0x01
|
||||
|
||||
/* gSPXGeometryMode */
|
||||
.ifdef F3DEX_GBI_2
|
||||
.set G_ZBUFFER, 0x00000001
|
||||
.set G_SHADE, 0x00000004
|
||||
.set G_SHADING_SMOOTH, 0x00200000
|
||||
.set G_CULL_FRONT, 0x00000200
|
||||
.set G_CULL_BACK, 0x00000400
|
||||
.set G_FOG, 0x00010000
|
||||
.set G_LIGHTING, 0x00020000
|
||||
.set G_TEXTURE_GEN, 0x00040000
|
||||
.set G_TEXTURE_GEN_LINEAR, 0x00080000
|
||||
|
||||
.else /* F3D and F3DEX */
|
||||
.set G_ZBUFFER, 0x00000001
|
||||
.set G_SHADE, 0x00000004
|
||||
.set G_SHADING_SMOOTH, 0x00000200
|
||||
.set G_CULL_FRONT, 0x00001000
|
||||
.set G_CULL_BACK, 0x00002000
|
||||
.set G_FOG, 0x00010000
|
||||
.set G_LIGHTING, 0x00020000
|
||||
.set G_TEXTURE_GEN, 0x00040000
|
||||
.set G_TEXTURE_GEN_LINEAR, 0x00080000
|
||||
.endif
|
||||
|
||||
/*
|
||||
* Used for matching F3DEX2-style geometry mode usage.
|
||||
* Ignored when building with Fast3DEX2.
|
||||
*/
|
||||
.set G_ORDER_SFIRST, 0
|
||||
.set G_ORDER_CFIRST, 1
|
||||
|
||||
/* gSPSetOtherMode (L) */
|
||||
.set G_MDSFT_ALPHACOMPARE, 0
|
||||
.set G_MDSFT_ZSRCSEL, 2
|
||||
.set G_MDSFT_RENDERMODE, 3
|
||||
.set G_MDSFT_BLENDER, 16
|
||||
|
||||
.set G_AC_NONE, (0 << G_MDSFT_ALPHACOMPARE)
|
||||
.set G_AC_THRESHOLD, (1 << G_MDSFT_ALPHACOMPARE)
|
||||
.set G_AC_DITHER, (3 << G_MDSFT_ALPHACOMPARE)
|
||||
|
||||
.set G_ZS_PIXEL, (0 << G_MDSFT_ZSRCSEL)
|
||||
.set G_ZS_PRIM, (1 << G_MDSFT_ZSRCSEL)
|
||||
|
||||
/************************* Set Render Mode *************************/
|
||||
|
||||
/* Cycle-Independent Blender Settings */
|
||||
|
||||
.set AA_EN, 0x8
|
||||
.set Z_CMP, 0x10
|
||||
.set Z_UPD, 0x20
|
||||
.set IM_RD, 0x40
|
||||
.set CLR_ON_CVG, 0x80
|
||||
.set CVG_DST_CLAMP, 0
|
||||
.set CVG_DST_WRAP, 0x100
|
||||
.set CVG_DST_FULL, 0x200
|
||||
.set CVG_DST_SAVE, 0x300
|
||||
.set ZMODE_OPA, 0
|
||||
.set ZMODE_INTER, 0x400
|
||||
.set ZMODE_XLU, 0x800
|
||||
.set ZMODE_DEC, 0xc00
|
||||
.set CVG_X_ALPHA, 0x1000
|
||||
.set ALPHA_CVG_SEL, 0x2000
|
||||
.set FORCE_BL, 0x4000
|
||||
.set TEX_EDGE, 0x0000 /* used to be 0x8000 */
|
||||
|
||||
/* Cycle-Dependent Blender Settings */
|
||||
/* Blender runs the formula: (P * A + M - B) / (A + B) */
|
||||
/* P and M values */
|
||||
.set G_BL_CLR_IN, 0 /* 1st cycle: get color from input pixel.
|
||||
2nd cycle: param is the numerator of the formula as computed for the first cycle. */
|
||||
.set G_BL_CLR_MEM, 1 /* Takes color from the framebuffer */
|
||||
.set G_BL_CLR_BL, 2 /* Takes color from the blend color register */
|
||||
.set G_BL_CLR_FOG, 3 /* Takes color from the fog color register */
|
||||
/* A values */
|
||||
.set G_BL_A_IN, 0 /* Parameter is alpha value of input pixel */
|
||||
.set G_BL_A_FOG, 1 /* Alpha value from the fog color register */
|
||||
.set G_BL_A_SHADE, 2 /* Calculated alpha value for the pixel, presumably */
|
||||
/* B values */
|
||||
.set G_BL_1MA, 0 /* 1.0 - source alpha */
|
||||
.set G_BL_A_MEM, 1 /* Framebuffer alpha value */
|
||||
.set G_BL_1, 2 /* Constant 1.0 */
|
||||
/* A and B values */
|
||||
.set G_BL_0, 3 /* Constant 0.0 */
|
||||
|
||||
.macro .BL_DEPENDENT_SETTING label, p, a, m, b
|
||||
.set \label\()_CYCLE1, ((\p << 30) | (\a << 26) | (\m << 22) | (\b << 18))
|
||||
.set \label\()_CYCLE2, ((\p << 28) | (\a << 24) | (\m << 20) | (\b << 16))
|
||||
.endm
|
||||
|
||||
.macro .BL_DEPENDENT_SETTING_CYCLE1_ONLY label, p, a, m, b
|
||||
.set \label, ((\p << 30) | (\a << 26) | (\m << 22) | (\b << 18))
|
||||
.endm
|
||||
|
||||
.BL_DEPENDENT_SETTING BL_DEP_SETTING_ZERO, G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_IN, G_BL_1MA /* Basically (0, 0, 0 ,0) */
|
||||
|
||||
/* Properly label these later! */
|
||||
.BL_DEPENDENT_SETTING BL_DEP_SETTING_1, G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM
|
||||
.BL_DEPENDENT_SETTING BL_DEP_SETTING_2, G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA
|
||||
.BL_DEPENDENT_SETTING BL_DEP_SETTING_3, G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1
|
||||
.BL_DEPENDENT_SETTING BL_DEP_SETTING_4, G_BL_CLR_IN, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_1
|
||||
.BL_DEPENDENT_SETTING BL_DEP_SETTING_5, G_BL_CLR_IN, G_BL_0, G_BL_CLR_BL, G_BL_A_MEM
|
||||
|
||||
.BL_DEPENDENT_SETTING_CYCLE1_ONLY BL_DEP_SETTING_FOG_SHADE_A, G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA
|
||||
.BL_DEPENDENT_SETTING_CYCLE1_ONLY BL_DEP_SETTING_FOG_PRIM_A, G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA
|
||||
.BL_DEPENDENT_SETTING_CYCLE1_ONLY BL_DEP_SETTING_PASS, G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1
|
||||
|
||||
.macro .SET_RENDER_MODE label, indeptSettings, deptSettings
|
||||
.set \label , (\indeptSettings | \deptSettings\()_CYCLE1)
|
||||
.set \label\()2 , (\indeptSettings | \deptSettings\()_CYCLE2)
|
||||
.endm
|
||||
|
||||
/* TODO: Make these more readable */
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_OPA_SURF, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_RA_ZB_OPA_SURF, (AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_XLU_SURF, (AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | ZMODE_XLU), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_OPA_DECAL, (AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | ALPHA_CVG_SEL | ZMODE_DEC), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_RA_ZB_OPA_DECAL, (AA_EN | Z_CMP | CVG_DST_WRAP | ALPHA_CVG_SEL | ZMODE_DEC), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_XLU_DECAL, (AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | ZMODE_DEC), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_OPA_INTER, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ALPHA_CVG_SEL | ZMODE_INTER), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_RA_ZB_OPA_INTER, (AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | ALPHA_CVG_SEL | ZMODE_INTER), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_XLU_INTER, (AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | ZMODE_INTER), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_XLU_LINE, (AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | ZMODE_XLU), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_DEC_LINE, (AA_EN | Z_CMP | IM_RD | CVG_DST_SAVE | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | ZMODE_DEC), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_TEX_EDGE, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_TEX_INTER, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_INTER | TEX_EDGE), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_SUB_SURF, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_PCL_SURF, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | G_AC_DITHER), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_OPA_TERR, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_TEX_TERR, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_ZB_SUB_TERR, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_OPA_SURF, (AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_RA_OPA_SURF, (AA_EN | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_XLU_SURF, (AA_EN | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | ZMODE_OPA), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_XLU_LINE, (AA_EN | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_DEC_LINE, (AA_EN | IM_RD | CVG_DST_FULL | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_TEX_EDGE, (AA_EN | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_SUB_SURF, (AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_AA_PCL_SURF, (AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | G_AC_DITHER), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_OPA_TERR, (AA_EN | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_TEX_TERR, (AA_EN | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_AA_SUB_TERR, (AA_EN | IM_RD | CVG_DST_FULL | ZMODE_OPA | ALPHA_CVG_SEL), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_ZB_OPA_SURF, (Z_CMP | Z_UPD | CVG_DST_FULL | ALPHA_CVG_SEL | ZMODE_OPA), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_ZB_XLU_SURF, (Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_XLU), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_ZB_OPA_DECAL, (Z_CMP | CVG_DST_FULL | ALPHA_CVG_SEL | ZMODE_DEC), BL_DEP_SETTING_1
|
||||
.SET_RENDER_MODE G_RM_ZB_XLU_DECAL, (Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_DEC), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_ZB_CLD_SURF, (Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_XLU), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_ZB_OVL_SURF, (Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_DEC), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_ZB_PCL_SURF, (Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | G_AC_DITHER), BL_DEP_SETTING_3
|
||||
.SET_RENDER_MODE G_RM_OPA_SURF, (CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA), BL_DEP_SETTING_3
|
||||
.SET_RENDER_MODE G_RM_XLU_SURF, (IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_OPA), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_TEX_EDGE, (CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA | TEX_EDGE | AA_EN), BL_DEP_SETTING_3
|
||||
.SET_RENDER_MODE G_RM_CLD_SURF, (IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA), BL_DEP_SETTING_2
|
||||
.SET_RENDER_MODE G_RM_PCL_SURF, (CVG_DST_FULL | FORCE_BL | ZMODE_OPA | G_AC_DITHER), BL_DEP_SETTING_3
|
||||
.SET_RENDER_MODE G_RM_ADD, (IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA), BL_DEP_SETTING_4
|
||||
.SET_RENDER_MODE G_RM_NOOP, (0), BL_DEP_SETTING_ZERO
|
||||
.SET_RENDER_MODE G_RM_VISCVG, (IM_RD | FORCE_BL), BL_DEP_SETTING_5
|
||||
.SET_RENDER_MODE G_RM_OPA_CI, (CVG_DST_CLAMP | ZMODE_OPA), BL_DEP_SETTING_3
|
||||
|
||||
/* Custom version of G_RM_AA_ZB_XLU_SURF with Z_UPD */
|
||||
.SET_RENDER_MODE G_RM_CUSTOM_AA_ZB_XLU_SURF, (AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | ZMODE_XLU), BL_DEP_SETTING_2
|
||||
|
||||
/* Special mode types only for mode 1 */
|
||||
.set G_RM_FOG_SHADE_A, BL_DEP_SETTING_FOG_SHADE_A
|
||||
.set G_RM_FOG_PRIM_A, BL_DEP_SETTING_FOG_PRIM_A
|
||||
.set G_RM_PASS, BL_DEP_SETTING_PASS
|
||||
|
||||
/*******************************************************************/
|
||||
|
||||
/* gSPSetOtherMode (H) */
|
||||
.set G_MDSFT_ALPHADITHER, 4
|
||||
.set G_MDSFT_RGBDITHER, 6
|
||||
.set G_MDSFT_COMBKEY, 8
|
||||
.set G_MDSFT_TEXTCONV, 9
|
||||
.set G_MDSFT_TEXTFILT, 12
|
||||
.set G_MDSFT_TEXTLUT, 14
|
||||
.set G_MDSFT_TEXTLOD, 16
|
||||
.set G_MDSFT_TEXTDETAIL, 17
|
||||
.set G_MDSFT_TEXTPERSP, 19
|
||||
.set G_MDSFT_CYCLETYPE, 20
|
||||
.set G_MDSFT_PIPELINE, 23
|
||||
|
||||
.set G_CYC_1CYCLE, (0 << G_MDSFT_CYCLETYPE)
|
||||
.set G_CYC_2CYCLE, (1 << G_MDSFT_CYCLETYPE)
|
||||
.set G_CYC_COPY, (2 << G_MDSFT_CYCLETYPE)
|
||||
.set G_CYC_FILL, (3 << G_MDSFT_CYCLETYPE)
|
||||
|
||||
.set G_TP_NONE, (0 << G_MDSFT_TEXTPERSP)
|
||||
.set G_TP_PERSP, (1 << G_MDSFT_TEXTPERSP)
|
||||
|
||||
.set G_TD_CLAMP, (0 << G_MDSFT_TEXTDETAIL)
|
||||
.set G_TD_SHARPEN, (1 << G_MDSFT_TEXTDETAIL)
|
||||
.set G_TD_DETAIL, (2 << G_MDSFT_TEXTDETAIL)
|
||||
|
||||
.set G_TL_TILE, (0 << G_MDSFT_TEXTLOD)
|
||||
.set G_TL_LOD, (1 << G_MDSFT_TEXTLOD)
|
||||
|
||||
.set G_TT_NONE, (0 << G_MDSFT_TEXTLUT)
|
||||
.set G_TT_RGBA16, (2 << G_MDSFT_TEXTLUT)
|
||||
.set G_TT_IA16, (3 << G_MDSFT_TEXTLUT)
|
||||
|
||||
.set G_TF_POINT, (0 << G_MDSFT_TEXTFILT)
|
||||
.set G_TF_AVERAGE, (3 << G_MDSFT_TEXTFILT)
|
||||
.set G_TF_BILERP, (2 << G_MDSFT_TEXTFILT)
|
||||
|
||||
.set G_TC_CONV, (0 << G_MDSFT_TEXTCONV)
|
||||
.set G_TC_FILTCONV, (5 << G_MDSFT_TEXTCONV)
|
||||
.set G_TC_FILT, (6 << G_MDSFT_TEXTCONV)
|
||||
|
||||
.set G_CK_NONE, (0 << G_MDSFT_COMBKEY)
|
||||
.set G_CK_KEY, (1 << G_MDSFT_COMBKEY)
|
||||
|
||||
.set G_CD_MAGICSQ, (0 << G_MDSFT_RGBDITHER)
|
||||
.set G_CD_BAYER, (1 << G_MDSFT_RGBDITHER)
|
||||
.set G_CD_NOISE, (2 << G_MDSFT_RGBDITHER)
|
||||
|
||||
/* gDPSetTile */
|
||||
.set G_TX_LOADTILE, 0x7
|
||||
.set G_TX_RENDERTILE, 0x0
|
||||
|
||||
/* axis clamp and mirror flags */
|
||||
.set G_TX_NOMIRROR, 0x0
|
||||
.set G_TX_WRAP, 0x0
|
||||
.set G_TX_MIRROR, 0x1
|
||||
.set G_TX_CLAMP, 0x2
|
||||
|
||||
/* mask flags */
|
||||
.set G_TX_NOMASK, 0x0
|
||||
|
||||
/* shift flags */
|
||||
.set G_TX_NOLOD, 0x0
|
||||
|
||||
/* gDPSetCombine */
|
||||
.set G_CCMUX_COMBINED, 0
|
||||
.set G_CCMUX_TEXEL0, 1
|
||||
.set G_CCMUX_TEXEL1, 2
|
||||
.set G_CCMUX_PRIMITIVE, 3
|
||||
.set G_CCMUX_SHADE, 4
|
||||
.set G_CCMUX_ENVIRONMENT, 5
|
||||
.set G_CCMUX_CENTER, 6
|
||||
.set G_CCMUX_SCALE, 6
|
||||
.set G_CCMUX_COMBINED_ALPHA, 7
|
||||
.set G_CCMUX_TEXEL0_ALPHA, 8
|
||||
.set G_CCMUX_TEXEL1_ALPHA, 9
|
||||
.set G_CCMUX_PRIMITIVE_ALPHA, 10
|
||||
.set G_CCMUX_SHADE_ALPHA, 11
|
||||
.set G_CCMUX_ENV_ALPHA, 12
|
||||
.set G_CCMUX_LOD_FRACTION, 13
|
||||
.set G_CCMUX_PRIM_LOD_FRAC, 14
|
||||
.set G_CCMUX_NOISE, 7
|
||||
.set G_CCMUX_K4, 7
|
||||
.set G_CCMUX_K5, 15
|
||||
.set G_CCMUX_1, 6
|
||||
.set G_CCMUX_0, 31
|
||||
|
||||
/* alpha combiner */
|
||||
.set G_ACMUX_COMBINED, 0
|
||||
.set G_ACMUX_TEXEL0, 1
|
||||
.set G_ACMUX_TEXEL1, 2
|
||||
.set G_ACMUX_PRIMITIVE, 3
|
||||
.set G_ACMUX_SHADE, 4
|
||||
.set G_ACMUX_ENVIRONMENT, 5
|
||||
.set G_ACMUX_LOD_FRACTION, 0
|
||||
.set G_ACMUX_PRIM_LOD_FRAC, 6
|
||||
.set G_ACMUX_1, 6
|
||||
.set G_ACMUX_0, 7
|
||||
|
||||
/* gDPSetTextureImage */
|
||||
/* fmt */
|
||||
.set G_IM_FMT_RGBA, 0x00
|
||||
.set G_IM_FMT_YUV, 0x01
|
||||
.set G_IM_FMT_CI, 0x02
|
||||
.set G_IM_FMT_IA, 0x03
|
||||
.set G_IM_FMT_I, 0x04
|
||||
|
||||
/* size */
|
||||
.set G_IM_SIZ_4b, 0x00
|
||||
.set G_IM_SIZ_8b, 0x01
|
||||
.set G_IM_SIZ_16b, 0x02
|
||||
.set G_IM_SIZ_32b, 0x03
|
||||
|
||||
.set G_TX_DXT_FRAC, 11
|
||||
.set G_TEXTURE_IMAGE_FRAC, 2
|
||||
|
||||
/* gDPLoadBlock*/
|
||||
.set G_TX_DXT_FRAC, 11
|
||||
.set G_TEXTURE_IMAGE_FRAC, 2
|
||||
|
||||
/* gSPNumLights / gSPFogFactor */
|
||||
|
||||
/* Index in DMEM table */
|
||||
.set G_MW_NUMLIGHT, 0x02
|
||||
.set G_MW_FOG, 0x08
|
||||
.set G_MW_PERSPNORM, 0x0E
|
||||
|
||||
/* Offsets in DMEM table */
|
||||
.set G_MWO_NUMLIGHT, 0x00
|
||||
.set G_MWO_FOG, 0x00
|
||||
|
||||
/* Parameter for gsSPNumLights; not really needed but is good for formality. */
|
||||
.set NUMLIGHTS_0, 1
|
||||
.set NUMLIGHTS_1, 1
|
||||
.set NUMLIGHTS_2, 2
|
||||
.set NUMLIGHTS_3, 3
|
||||
.set NUMLIGHTS_4, 4
|
||||
.set NUMLIGHTS_5, 5
|
||||
.set NUMLIGHTS_6, 6
|
||||
.set NUMLIGHTS_7, 7
|
||||
|
||||
/* GBI macros */
|
||||
|
||||
/* gsMoveWd */
|
||||
.macro gsMoveWd index, offset, data
|
||||
.ifdef F3DEX_GBI_2
|
||||
.word G_MOVEWORD << 24 | ((\index & 0xFF) << 16) | (\offset & 0xFFFF)
|
||||
.else
|
||||
.word G_MOVEWORD << 24 | ((\offset & 0xFFFF) << 8) | (\index & 0xFF)
|
||||
.endif
|
||||
.word \data
|
||||
.endm
|
||||
|
||||
.set G_MWO_NUMLIGHT, 0x00
|
||||
/*
|
||||
* gSPNumLights
|
||||
* Parameter:
|
||||
* n = NUMLIGHTS_* (ranges from 0 to 7)
|
||||
*/
|
||||
.macro gsSPNumLights n
|
||||
.ifdef F3DEX_GBI_2
|
||||
gsMoveWd G_MW_NUMLIGHT, G_MWO_NUMLIGHT, (\n * 24)
|
||||
.else
|
||||
gsMoveWd G_MW_NUMLIGHT, G_MWO_NUMLIGHT, ((\n + 1) * 32 + 0x80000000)
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPMatrix */
|
||||
.macro gsSPMatrix matrix, params
|
||||
.ifdef F3DEX_GBI_2
|
||||
gsDma3p G_MTX, 0x38, 0, (\params ^ G_MTX_PUSH), \matrix
|
||||
.else /* Fast3D and Fast3DEX */
|
||||
gsDma1p G_MTX, \matrix, 64, \params
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPLight */
|
||||
.macro gsSPLight light, num
|
||||
.ifdef F3DEX_GBI_2
|
||||
gsDma3p G_MOVEMEM, 8, ((G_MVO_L0+((\num-1)*24))/8), 10, \light
|
||||
.else /* Fast3D and Fast3DEX */
|
||||
gsDma1p G_MOVEMEM, \light, 16, ((\num)-1)*2+G_MV_L0
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPVertex */
|
||||
.macro gsSPVertex verts, num, index
|
||||
.ifdef F3DEX_GBI_2
|
||||
.word (G_VTX << 24) | ((\num & 0xFF) << 12) | (((\index+\num) & 0x7F) << 1)
|
||||
.word \verts
|
||||
.else /* Fast3D and Fast3DEX */
|
||||
.ifdef F3DEX_GBI
|
||||
gsDma1p G_VTX, \verts, (\num)<<10|(16*(\num)-1), (2*\index)
|
||||
.else /* Fast3D */
|
||||
gsDma1p G_VTX, \verts, 16*\num, ((\num)-1)<<4|(\index)
|
||||
.endif
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gSPGeometryMode
|
||||
* In Fast3DEX2 it is better to use this, as the RSP geometry mode
|
||||
* is able to be set and cleared in a single command.
|
||||
*/
|
||||
.macro gsSPGeometryMode cc, ff, order
|
||||
.ifdef F3DEX_GBI_2
|
||||
.word (G_GEOMETRYMODE << 24) | ((~(\cc)) & 0x00FFFFFF)
|
||||
.word \ff
|
||||
.else
|
||||
.if \order == 0
|
||||
gsSPSetGeometryMode \ff
|
||||
gsSPClearGeometryMode \cc
|
||||
.else
|
||||
gsSPClearGeometryMode \cc
|
||||
gsSPSetGeometryMode \ff
|
||||
.endif
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPSetGeometryMode */
|
||||
.macro gsSPSetGeometryMode, flags
|
||||
.ifdef F3DEX_GBI_2
|
||||
.word (G_GEOMETRYMODE << 24) | 0x00FFFFFF
|
||||
.word \flags
|
||||
.else /* Fast3D and Fast3DEX */
|
||||
.word G_SETGEOMETRYMODE << 24
|
||||
.word \flags
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPClearGeometryMode */
|
||||
.macro gsSPClearGeometryMode, flags
|
||||
.ifdef F3DEX_GBI_2
|
||||
.word (G_GEOMETRYMODE << 24) | ((~(\flags)) & 0x00FFFFFF)
|
||||
.word 0
|
||||
.else /* Fast3D and Fast3DEX */
|
||||
.word G_CLEARGEOMETRYMODE << 24
|
||||
.word \flags
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPPerspNormalize */
|
||||
.macro gsSPPerspNormalize, perspNorm
|
||||
.ifndef F3D_OLD
|
||||
gsMoveWd G_MW_PERSPNORM, 0, \perspNorm
|
||||
.else
|
||||
gsImmp1 G_RDPHALF_1, \perspNorm
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPEndDisplayList */
|
||||
.macro gsSPEndDisplayList
|
||||
f3d_noparam G_ENDDL
|
||||
.endm
|
||||
|
||||
/* gSPSetOtherMode */
|
||||
.macro gsSPSetOtherMode cmd, sft, len, data
|
||||
.ifdef F3DEX_GBI_2
|
||||
.word ((\cmd & 0xFF) << 24) | ((32 - (\sft & 0xFF) - (\len & 0xFF)) << 8) | ((\len-1) & 0xFF)
|
||||
.word \data
|
||||
.else /* Fast3D and Fast3DEX2 */
|
||||
.word ((\cmd & 0xFF) << 24) | ((\sft & 0xFF) << 8) | (\len & 0xFF)
|
||||
.word \data
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro gsSPTexture scaleS, scaleT, level, tile, enable
|
||||
.ifdef F3DEX_GBI_2
|
||||
.word (G_TEXTURE << 24) | ((\level & 0x7) << 11) | ((\tile & 0x7) << 8) | (\enable*2)
|
||||
.word ((\scaleS & 0xFFFF) << 16) | (\scaleT & 0xFFFF)
|
||||
.else /* Fast3D and Fast3DEX */
|
||||
.word (G_TEXTURE << 24) | ((\level & 0x7) << 11) | ((\tile & 0x7) << 8) | \enable
|
||||
.word ((\scaleS & 0xFFFF) << 16) | (\scaleT & 0xFFFF)
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gSPSetRenderMode */
|
||||
.macro gsDPSetRenderMode cycle1Mode, cycle2Mode
|
||||
gsSPSetOtherMode G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, 29, \cycle1Mode | \cycle2Mode
|
||||
.endm
|
||||
|
||||
/* gDPSetTexturePersp */
|
||||
.macro gsDPSetTexturePersp type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_TEXTPERSP, 1, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetCycleType */
|
||||
.macro gsDPSetCycleType type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_CYCLETYPE, 2, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetTextureDetail */
|
||||
.macro gsDPSetTextureDetail type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_TEXTDETAIL, 2, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetTextureLOD*/
|
||||
.macro gsDPSetTextureLOD type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_TEXTLOD, 1, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetTextureTLUT */
|
||||
.macro gsDPSetTextureLUT type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_TEXTLUT, 2, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetTextureFilter */
|
||||
.macro gsDPSetTextureFilter type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_TEXTFILT, 2, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetTextureConvert */
|
||||
.macro gsDPSetTextureConvert type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_TEXTCONV, 3, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetCombineKey */
|
||||
.macro gsDPSetCombineKey type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_COMBKEY, 1, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetColorDither */
|
||||
.macro gsDPSetColorDither mode
|
||||
gsSPSetOtherMode G_SETOTHERMODE_H, G_MDSFT_RGBDITHER, 2, \mode
|
||||
.endm
|
||||
|
||||
/* gsDPSetAlphaCompare */
|
||||
.macro gsDPSetAlphaCompare type
|
||||
gsSPSetOtherMode G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 2, \type
|
||||
.endm
|
||||
|
||||
/* gDPSetDepthSource */
|
||||
.macro gsDPSetDepthSource src
|
||||
gsSPSetOtherMode G_SETOTHERMODE_L, G_MDSFT_ZSRCSEL, 1, \src
|
||||
.endm
|
||||
|
||||
/* gSPDisplayList */
|
||||
.macro gsSPDisplayList dl
|
||||
gsDma1p G_DL, \dl, 0, G_DL_PUSH
|
||||
.endm
|
||||
|
||||
/* gSPBranchDisplayList */
|
||||
.macro gsSPBranchList dl
|
||||
gsDma1p G_DL, \dl, 0, G_DL_NOPUSH
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gSP1Triangle
|
||||
* Note: flag has no effect on this implementation of gSP1Triangle.
|
||||
*/
|
||||
.macro gsSP1Triangle v0, v1, v2, flag
|
||||
.ifndef F3DEX_GBI_2
|
||||
.word G_TRI1 << 24
|
||||
.ifdef F3DEX_GBI /* Fast3DEX */
|
||||
.word (\v0*2 << 16) | (\v1*2 << 8) | \v2*2
|
||||
.else /* Fast3D */
|
||||
.word (\v0*10 << 16) | (\v1*10 << 8) | \v2*10
|
||||
.endif
|
||||
.else /* Fast3DEX2 */
|
||||
bytes4 G_TRI1, \v0*2, \v1*2, \v2*2
|
||||
.word 0
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gSP2Triangles
|
||||
* Note: flag has no effect on this implementation of gSP2Triangles.
|
||||
*/
|
||||
.macro gsSP2Triangles v0, v1, v2, flag0, v3, v4, v5, flag1
|
||||
.ifdef F3DEX_GBI_SHARED /* Fast3DEX and Fast3DEX2 have the same G_TRI2 syntax. */
|
||||
.word (G_TRI2 << 24) | (\v0*2 << 16) | (\v1*2 << 8) | \v2*2
|
||||
.word (0x00 << 24) | (\v3*2 << 16) | (\v4*2 << 8) | \v5*2
|
||||
.else /* Backwards compatibility with Fast3D. */
|
||||
gsSP1Triangle \v0, \v1, \v2, \flag0
|
||||
gsSP1Triangle \v3, \v4, \v5, \flag1
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* gDPNoOp */
|
||||
.macro gsDPNoOp
|
||||
f3d_noparam G_NOOP
|
||||
.endm
|
||||
|
||||
/* gSPTextureRectangle */
|
||||
.macro gsSPTextureRectangle xl, yl, xh, yh, tile, s, t, dsdx, dtdy
|
||||
.word (G_TEXRECT << 24) | (\xh << 12) | \yh
|
||||
.word (\tile << 24) | (\xl << 12) | \yl
|
||||
.ifdef F3D_OLD
|
||||
.word (G_RDPHALF_2 << 24)
|
||||
.else
|
||||
.word (G_RDPHALF_1 << 24)
|
||||
.endif
|
||||
.word (\s << 16) | \t
|
||||
.ifdef F3D_OLD
|
||||
.word (G_RDPHALF_CONT << 24)
|
||||
.else
|
||||
.word (G_RDPHALF_2 << 24)
|
||||
.endif
|
||||
.word (\dsdx << 16) | \dtdy
|
||||
.endm
|
||||
|
||||
/* gDPLoadSync */
|
||||
.macro gsDPLoadSync
|
||||
f3d_noparam G_RDPLOADSYNC
|
||||
.endm
|
||||
|
||||
/* gDPPipeSync*/
|
||||
.macro gsDPPipeSync
|
||||
f3d_noparam G_RDPPIPESYNC
|
||||
.endm
|
||||
|
||||
/* gDPFullSync*/
|
||||
.macro gsDPFullSync
|
||||
f3d_noparam G_RDPFULLSYNC
|
||||
.endm
|
||||
|
||||
/* gDPLoadTLUTCmd */
|
||||
.macro gsDPLoadTLUTCmd tile, count
|
||||
.word G_LOADTLUT << 24
|
||||
.word ((\tile & 0x7) << 24) | ((\count - 1) & 0x3FF) << 14
|
||||
.endm
|
||||
|
||||
/* gDPTileSync */
|
||||
.macro gsDPTileSync
|
||||
f3d_noparam G_RDPTILESYNC
|
||||
.endm
|
||||
|
||||
/* gDPSetTileSize */
|
||||
.macro gsDPSetTileSize tile, uls, ult, lrs, lrt
|
||||
.word (G_SETTILESIZE << 24) | ((\uls & 0x0FFF) << 12) | (\ult & 0x0FFF)
|
||||
.word ((\tile & 0x7) << 24) | ((\lrs & 0x0FFF) << 12) | (\lrt & 0x0FFF)
|
||||
.endm
|
||||
|
||||
/* gsDPLoadBlock */
|
||||
.macro gsDPLoadBlock tile, uls, ult, lrs, dxt
|
||||
.word (G_LOADBLOCK << 24) | ((\uls & 0x0FFF) << 12) | (\ult & 0x0FFF)
|
||||
.word ((\tile & 0x7) << 24) | ((\lrs & 0x0FFF) << 12) | (\dxt & 0x0FFF)
|
||||
.endm
|
||||
|
||||
/* gDPSetTile */
|
||||
.macro gsDPSetTile fmt, siz, line, tmem, tile, palette, cmt, maskt, shiftt, cms, masks, shifts
|
||||
.word (G_SETTILE << 24) | ((\fmt & 0x7) << 21) | ((\siz & 0x3) << 19) | ((\line & 0x1FF) << 9) | (\tmem & 0x1FF)
|
||||
.word ((\tile & 0x7) << 24) | ((\palette & 0xF) << 20) | ((\cmt & 0x3) << 18) | ((\maskt & 0xF) << 14) | ((\shiftt & 0xF) << 10) | ((\cms & 0x3) << 8) | ((\masks & 0xF) << 4) | (\shifts & 0xF)
|
||||
.endm
|
||||
|
||||
/* gDPFillRectangle */
|
||||
.macro gsDPFillRectangle ulx, uly, lrx, lry
|
||||
.word (G_FILLRECT << 24) | ((\lrx & 0x3FF) << 14) | ((\lry & 0x3FF) << 2)
|
||||
.word ((\ulx & 0x3FF) << 14) | ((\uly & 0x3FF) << 2)
|
||||
.endm
|
||||
|
||||
/* gDPSetFillColor */
|
||||
.macro gsDPSetFillColor fillValue
|
||||
.word G_SETFILLCOLOR << 24
|
||||
.word \fillValue
|
||||
.endm
|
||||
|
||||
/* gDPSetFogColor */
|
||||
.macro gsDPSetFogColor r, g, b, a
|
||||
sDPRGBColor G_SETFOGCOLOR, \r, \g, \b, \a
|
||||
.endm
|
||||
|
||||
/* gDPSetBlendColor */
|
||||
.macro gsDPSetBlendColor r, g, b, a
|
||||
sDPRGBColor G_SETBLENDCOLOR, \r, \g, \b, \a
|
||||
.endm
|
||||
|
||||
/* gDPSetPrimColor */
|
||||
.macro gsDPSetPrimColor m, l, r, g, b, a
|
||||
.word (G_SETPRIMCOLOR << 24) | ((\m & 0xFF) << 8) | (\l & 0xFF)
|
||||
.word (\r << 24) | (\g << 16) | (\b << 8) | \a
|
||||
.endm
|
||||
|
||||
/* gDPSetEnvColor */
|
||||
.macro gsDPSetEnvColor r, g, b, a
|
||||
sDPRGBColor G_SETENVCOLOR, \r, \g, \b, \a
|
||||
.endm
|
||||
|
||||
/* gDPSetCombine */
|
||||
.macro gsDPSetCombine muxs0, muxs1
|
||||
.word (G_SETCOMBINE << 24) | (\muxs0 & 0x00FFFFFF)
|
||||
.word \muxs1
|
||||
.endm
|
||||
|
||||
/* gDPSetCombineMode */
|
||||
.macro gsDPSetCombineModeLERP a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1
|
||||
.word (G_SETCOMBINE << 24) | ((\a0 & 0xF) << 20) | ((\c0 & 0x1F) << 15) | ((\Aa0 & 0x7) << 12) | ((\Ac0 & 0x7) << 9) | ((\a1 & 0xF) << 5) | (\c1 & 0x1F)
|
||||
.word ((\b0 & 0xF) << 28) | ((\b1 & 0xF) << 24) | ((\Aa1 & 0x7) << 21) | ((\Ac1 & 0x7) << 18) | ((\d0 & 0x7) << 15) | ((\Ab0 & 0x7) << 12) | ((\Ad0 & 0x7) << 9) | ((\d1 & 0x7) << 6) | ((\Ab1 & 0x7) << 3) | (\Ad1 & 0x7)
|
||||
.endm
|
||||
|
||||
/* gDPSetCombineMode1Cycle */
|
||||
.macro gsDPSetCombineModeLERP1Cycle a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0
|
||||
gsDPSetCombineModeLERP \a0, \b0, \c0, \d0, \Aa0, \Ab0, \Ac0, \Ad0, \a0, \b0, \c0, \d0, \Aa0, \Ab0, \Ac0, \Ad0
|
||||
.endm
|
||||
|
||||
/* gDPSetTextureImage */
|
||||
.macro gsDPSetTextureImage fmt, size, width, segAddr
|
||||
.word (G_SETTIMG << 24) | ((\fmt & 0x7) << 21) | ((\size & 0x3) << 19) | ((\width-1) & 0x0FFF)
|
||||
.word \segAddr
|
||||
.endm
|
||||
|
||||
/* gDPLoadTextureBlock */
|
||||
/* Calculate gDPLoadBlock for 8, 16, and 32 bit textures */
|
||||
.macro _calc_gsDPLoadBlockNot4b width, height, shift, incr, byteSize
|
||||
.if (((\width * \byteSize) / 8) > 1) /* result of TXL2WORDS is greater than 1 */
|
||||
gsDPLoadBlock G_TX_LOADTILE, 0, 0, (((\width * \height) + \incr) >> \shift) - 1, (((1 << G_TX_DXT_FRAC) + ((\width * \byteSize) / 8) - 1) / ((\width * \byteSize) / 8))
|
||||
.else /* result of TXL2WORDS is 1 */
|
||||
gsDPLoadBlock G_TX_LOADTILE, 0, 0, (((\width * \height) + \incr) >> \shift) - 1, (1 << G_TX_DXT_FRAC)
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* Calculate gDPLoadBlock for 4-bit textures */
|
||||
.macro _calc_gsDPLoadBlock4b width, height
|
||||
.if ((\width / 16) > 1) /* result of TXL2WORDS_4b is greater than 1 */
|
||||
gsDPLoadBlock G_TX_LOADTILE, 0, 0, (((\width * \height) + 3) >> 2) - 1, (((1 << G_TX_DXT_FRAC) + (\width / 16) - 1) / (\width / 16))
|
||||
.else /* result of TXL2WORDS_4b is 1 */
|
||||
gsDPLoadBlock G_TX_LOADTILE, 0, 0, (((\width * \height) + 3) >> 2) - 1, (1 << G_TX_DXT_FRAC)
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* Calculate gDPLoadBlock using texture bit size, width, and height */
|
||||
.macro _calc_gsDPLoadBlock siz, width, height
|
||||
.if (\siz == G_IM_SIZ_4b)
|
||||
_calc_gsDPLoadBlock4b \width, \height
|
||||
.elseif (\siz == G_IM_SIZ_8b)
|
||||
_calc_gsDPLoadBlockNot4b \width, \height, 1, 1, 1
|
||||
.elseif (\siz == G_IM_SIZ_16b)
|
||||
_calc_gsDPLoadBlockNot4b \width, \height, 0, 0, 2
|
||||
.elseif (\siz == G_IM_SIZ_32b)
|
||||
_calc_gsDPLoadBlockNot4b \width, \height, 0, 0, 4
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gDPLoadTextureBlock is a macro that allows you to easily load a texture in the f3d family of ucodes
|
||||
* Parameters:
|
||||
* timg = label to the texture data
|
||||
* fmt = image format (G_IM_FMT_RGBA, G_IM_FMT_CI, G_IM_FMT_IA, G_IM_FMT_I, or G_IM_FMT_YUV)
|
||||
* siz = bits per pixel (G_IM_SIZ_4b, G_IM_SIZ_8b, G_IM_SIZ_16b, or G_IM_SIZ_32b)
|
||||
* width = width of the texture in pixels
|
||||
* height = height of the texture in pixels
|
||||
* pal = palette id to use if using G_IM_FMT_CI, otherwise it should be 0.
|
||||
* cms = Clamp & Mirror flags for the S axis
|
||||
* cmt = Clamp & Mirror flags for the T axis
|
||||
* masks = Sets how much of the S axis is shown before clamping. This is usually just log2(width).
|
||||
* maskt = Sets how much of the T axis is shown before clamping. This is usually just log2(height).
|
||||
* shifts = Sets the amount to shift S axis values after perspective division. This is usually G_TX_NOLOD.
|
||||
* shiftt = Sets the amount to shift T axis values after perspective division. This is usually G_TX_NOLOD.
|
||||
*/
|
||||
.macro gsDPLoadTextureBlock timg, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt
|
||||
.if (\siz == G_IM_SIZ_32b)
|
||||
gsDPSetTextureImage \fmt, \siz, 1, \timg
|
||||
gsDPSetTile \fmt, \siz, 0, 0, G_TX_LOADTILE, 0, \cmt, \maskt, \shiftt, \cms, \masks, \shifts
|
||||
.else
|
||||
gsDPSetTextureImage \fmt, G_IM_SIZ_16b, 1, \timg
|
||||
gsDPSetTile \fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \cmt, \maskt, \shiftt, \cms, \masks, \shifts
|
||||
.endif
|
||||
|
||||
gsDPLoadSync
|
||||
_calc_gsDPLoadBlock \siz, \width, \height
|
||||
gsDPPipeSync
|
||||
|
||||
.if (\siz == G_IM_SIZ_4b)
|
||||
gsDPSetTile \fmt, \siz, (7 >> 3), 0, G_TX_RENDERTILE, \pal, \cmt, \maskt, \shiftt, \cms, \masks, \shifts
|
||||
.elseif (\siz == G_IM_SIZ_8b)
|
||||
gsDPSetTile \fmt, \siz, ((\width + 7) >> 3), 0, G_TX_RENDERTILE, \pal, \cmt, \maskt, \shiftt, \cms, \masks, \shifts
|
||||
.else
|
||||
gsDPSetTile \fmt, \siz, (((\width * 2) + 7) >> 3), 0, G_TX_RENDERTILE, \pal, \cmt, \maskt, \shiftt, \cms, \masks, \shifts
|
||||
.endif
|
||||
|
||||
gsDPSetTileSize G_TX_RENDERTILE, 0, 0, ((\width - 1) << G_TEXTURE_IMAGE_FRAC), ((\height - 1) << G_TEXTURE_IMAGE_FRAC)
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gDPLoadTLUT_pal16, loads 16 colors into the TLUT
|
||||
* Parameters:
|
||||
* pal = palette number to use.
|
||||
* timg_pal = label to palette data
|
||||
*/
|
||||
.macro gsDPLoadTLUT_pal16 pal, timg_pal
|
||||
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, \timg_pal
|
||||
gsDPTileSync
|
||||
gsDPSetTile 0, 0, 0, (256+(((\pal)&0xf)*16)), G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0
|
||||
gsDPLoadSync
|
||||
gsDPLoadTLUTCmd G_TX_LOADTILE, 16
|
||||
gsDPPipeSync
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gDPLoadTLUT_pal256, loads 256 colors into the TLUT
|
||||
* Parameters:
|
||||
* timg_pal = label to palette data
|
||||
*/
|
||||
.macro gsDPLoadTLUT_pal256 timg_pal
|
||||
gsDPSetTextureImage G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, \timg_pal
|
||||
gsDPTileSync
|
||||
gsDPSetTile 0, 0, 0, 256, G_TX_LOADTILE, 0, 0, 0, 0, 0, 0, 0
|
||||
gsDPLoadSync
|
||||
gsDPLoadTLUTCmd G_TX_LOADTILE, 256
|
||||
gsDPPipeSync
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gDPLoadTextureBlock_4b is a macro that allows you to easily load a 4-bit texture in the Fast3D family of ucodes.
|
||||
* Parameters:
|
||||
* timg = label to the texture data
|
||||
* fmt = image format (G_IM_FMT_RGBA, G_IM_FMT_CI, G_IM_FMT_IA, G_IM_FMT_I, or G_IM_FMT_YUV)
|
||||
* width = width of the texture in pixels
|
||||
* height = height of the texture in pixels
|
||||
* pal = palette id to use if using G_IM_FMT_CI, otherwise it should be 0.
|
||||
* cms = Clamp & Mirror flags for the S axis
|
||||
* cmt = Clamp & Mirror flags for the T axis
|
||||
* masks = Sets how much of the S axis is shown before clamping. This is usually just log2(width).
|
||||
* maskt = Sets how much of the T axis is shown before clamping. This is usually just log2(height).
|
||||
* shifts = Sets the amount to shift S axis values after perspective division. This is usually G_TX_NOLOD.
|
||||
* shiftt = Sets the amount to shift T axis values after perspective division. This is usually G_TX_NOLOD.
|
||||
*/
|
||||
|
||||
.macro gsDPLoadTextureBlock_4b timg, fmt, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt
|
||||
gsDPSetTextureImage \fmt, G_IM_SIZ_16b, 1, \timg
|
||||
gsDPSetTile \fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \cmt, \maskt, \shiftt, \cms, \masks, \shifts
|
||||
gsDPLoadSync
|
||||
_calc_gsDPLoadBlock4b \width, \height
|
||||
gsDPPipeSync
|
||||
gsDPSetTile \fmt, G_IM_SIZ_4b, ((((\width) >> 1) + 7) >> 3), 0, G_TX_RENDERTILE, \pal, \cmt, \maskt, \shiftt, \cms, \masks, \shifts
|
||||
gsDPSetTileSize G_TX_RENDERTILE, 0, 0, ((\width) - 1) << G_TEXTURE_IMAGE_FRAC, ((\height) - 1) << G_TEXTURE_IMAGE_FRAC
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gSPFogFactor
|
||||
* Parameters:
|
||||
* fm = z multiplier
|
||||
* fo = z offset
|
||||
*
|
||||
* FOG FORMULA: alpha(fog) = (eyespace z) * fm + fo (CLAMPED 0 to 255)
|
||||
* note: (eyespace z) ranges [-1, 1]
|
||||
*/
|
||||
.macro gsSPFogFactor fm, fo
|
||||
gsMoveWd G_MW_FOG, G_MWO_FOG, ((\fm & 0xFFFF) << 16) | (\fo & 0xFFFF)
|
||||
.endm
|
||||
|
||||
/*
|
||||
* gSPFogPosition
|
||||
* Parameters:
|
||||
* min = Place where fog starts (0 at the near plane, and 1000 at the far plane)
|
||||
* max = Place where fog saturates (0 at the near plane, and 1000 at the far plane)
|
||||
*
|
||||
* This macro will throw an error if min or max is outside the range [0, 1000]
|
||||
*
|
||||
* Note: The min can be larger than max, as that just makes objects fade when they
|
||||
* get closer to the camera.
|
||||
*/
|
||||
.macro gsSPFogPosition min, max
|
||||
.if (\min >= 0 && \min <= 1000 && \max >= 0 && \max <= 1000)
|
||||
gsMoveWd G_MW_FOG, G_MWO_FOG, (((128000 / (\max - \min)) & 0xFFFF) << 16) | ((((500 - \min) * 256) / (\max - \min)) & 0xFFFF)
|
||||
.elseif \min < 0 || \min > 1000
|
||||
.error "[gsSPFogPosition]: min should be in the range [0, 1000]"
|
||||
.elseif \max < 0 || \max > 1000
|
||||
.error "[gsSPFogPosition]: max should be in the range [0, 1000]"
|
||||
.endif
|
||||
.endm
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,11 +60,7 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef F3D_OLD
|
||||
#include <PR/gbi_old.h>
|
||||
#else
|
||||
#include <PR/gbi.h>
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
||||
+5
-93
@@ -1,98 +1,10 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_libc.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_libc.h,v $
|
||||
$Revision: 1.3 $
|
||||
$Date: 1999/07/13 01:43:47 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_LIBC_H_
|
||||
#define _OS_LIBC_H_
|
||||
#define _OS_LIBC_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "ultratypes.h"
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#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
|
||||
*
|
||||
*/
|
||||
|
||||
/* byte string operations */
|
||||
|
||||
|
||||
extern void bcopy(const void *, void *, int);
|
||||
extern int bcmp(const void *, const void *, int);
|
||||
extern void bzero(void *, int);
|
||||
|
||||
/* Printf */
|
||||
|
||||
extern int sprintf(char *s, const char *fmt, ...);
|
||||
extern void osSyncPrintf(const char *fmt, ...);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
// 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_ */
|
||||
|
||||
+31
-32
@@ -66,13 +66,13 @@
|
||||
#define SOUND_TERRAIN_ICE 6
|
||||
#define SOUND_TERRAIN_SAND 7
|
||||
|
||||
#define SOUND_ACTION_TERRAIN_JUMP SOUND_ARG_LOAD(0, 4, 0x00, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_LANDING SOUND_ARG_LOAD(0, 4, 0x08, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_STEP SOUND_ARG_LOAD(0, 6, 0x10, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_BODY_HIT_GROUND SOUND_ARG_LOAD(0, 4, 0x18, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_STEP_TIPTOE SOUND_ARG_LOAD(0, 6, 0x20, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_STUCK_IN_GROUND SOUND_ARG_LOAD(0, 4, 0x48, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_HEAVY_LANDING SOUND_ARG_LOAD(0, 4, 0x60, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_JUMP SOUND_ARG_LOAD(0, 4, 0x00, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_LANDING SOUND_ARG_LOAD(0, 4, 0x08, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_STEP SOUND_ARG_LOAD(0, 6, 0x10, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_BODY_HIT_GROUND SOUND_ARG_LOAD(0, 4, 0x18, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_STEP_TIPTOE SOUND_ARG_LOAD(0, 6, 0x20, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_STUCK_IN_GROUND SOUND_ARG_LOAD(0, 4, 0x48, 0x80, 8)
|
||||
#define SOUND_ACTION_TERRAIN_HEAVY_LANDING SOUND_ARG_LOAD(0, 4, 0x60, 0x80, 8)
|
||||
|
||||
#define SOUND_ACTION_METAL_JUMP SOUND_ARG_LOAD(0, 4, 0x28, 0x90, 8)
|
||||
#define SOUND_ACTION_METAL_LANDING SOUND_ARG_LOAD(0, 4, 0x29, 0x90, 8)
|
||||
@@ -85,44 +85,44 @@
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN430 SOUND_ARG_LOAD(0, 4, 0x30, 0xC0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN431 SOUND_ARG_LOAD(0, 4, 0x31, 0x60, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN432 SOUND_ARG_LOAD(0, 4, 0x32, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN433 SOUND_ARG_LOAD(0, 4, 0x33, 0x80, 8)
|
||||
#define SOUND_ACTION_SWIM SOUND_ARG_LOAD(0, 4, 0x33, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN434 SOUND_ARG_LOAD(0, 4, 0x34, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN435 SOUND_ARG_LOAD(0, 4, 0x35, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_SWISH1 SOUND_ARG_LOAD(0, 4, 0x36, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_SWISH2 SOUND_ARG_LOAD(0, 4, 0x37, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_SWISH2_2 SOUND_ARG_LOAD(0, 4, 0x38, 0x80, 8)
|
||||
#define SOUND_ACTION_THROW SOUND_ARG_LOAD(0, 4, 0x35, 0x80, 8)
|
||||
#define SOUND_ACTION_KEY_SWISH SOUND_ARG_LOAD(0, 4, 0x36, 0x80, 8)
|
||||
#define SOUND_ACTION_SPIN SOUND_ARG_LOAD(0, 4, 0x37, 0x80, 8)
|
||||
#define SOUND_ACTION_TWIRL SOUND_ARG_LOAD(0, 4, 0x38, 0x80, 8) // same sound as spin
|
||||
/* not verified */ #define SOUND_ACTION_CLIMB_UP_TREE SOUND_ARG_LOAD(0, 4, 0x3A, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_CLIMB_DOWN_TREE 0x003B
|
||||
/* not verified */ #define SOUND_ACTION_UNK3C 0x003C
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN43D SOUND_ARG_LOAD(0, 4, 0x3D, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN43E SOUND_ARG_LOAD(0, 4, 0x3E, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_PAT_BACK SOUND_ARG_LOAD(0, 4, 0x3F, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_BRUSH_HAIR SOUND_ARG_LOAD(0, 4, 0x40, 0x80, 8)
|
||||
#define SOUND_ACTION_BRUSH_HAIR SOUND_ARG_LOAD(0, 4, 0x40, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_CLIMB_UP_POLE SOUND_ARG_LOAD(0, 4, 0x41, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN442 SOUND_ARG_LOAD(0, 4, 0x42, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN443 SOUND_ARG_LOAD(0, 4, 0x43, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN444 SOUND_ARG_LOAD(0, 4, 0x44, 0xC0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN444_2 SOUND_ARG_LOAD(0, 4, 0x44, 0xB0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN444_3 SOUND_ARG_LOAD(0, 4, 0x44, 0xA0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN445 SOUND_ARG_LOAD(0, 4, 0x45, 0xA0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN446 SOUND_ARG_LOAD(0, 4, 0x46, 0xA0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN447 SOUND_ARG_LOAD(0, 4, 0x47, 0xA0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN450 SOUND_ARG_LOAD(0, 4, 0x50, 0x90, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN451 SOUND_ARG_LOAD(0, 4, 0x51, 0x90, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN452 SOUND_ARG_LOAD(0, 4, 0x52, 0x90, 8)
|
||||
#define SOUND_ACTION_METAL_BONK SOUND_ARG_LOAD(0, 4, 0x42, 0x80, 8)
|
||||
#define SOUND_ACTION_UNSTUCK_FROM_GROUND SOUND_ARG_LOAD(0, 4, 0x43, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_HIT SOUND_ARG_LOAD(0, 4, 0x44, 0xC0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_HIT_2 SOUND_ARG_LOAD(0, 4, 0x44, 0xB0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_HIT_3 SOUND_ARG_LOAD(0, 4, 0x44, 0xA0, 8)
|
||||
#define SOUND_ACTION_BONK SOUND_ARG_LOAD(0, 4, 0x45, 0xA0, 8)
|
||||
#define SOUND_ACTION_SHRINK_INTO_BBH SOUND_ARG_LOAD(0, 4, 0x46, 0xA0, 8)
|
||||
#define SOUND_ACTION_SWIM_FAST SOUND_ARG_LOAD(0, 4, 0x47, 0xA0, 8)
|
||||
#define SOUND_ACTION_METAL_JUMP_WATER SOUND_ARG_LOAD(0, 4, 0x50, 0x90, 8)
|
||||
#define SOUND_ACTION_METAL_LAND_WATER SOUND_ARG_LOAD(0, 4, 0x51, 0x90, 8)
|
||||
#define SOUND_ACTION_METAL_STEP_WATER SOUND_ARG_LOAD(0, 4, 0x52, 0x90, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNK53 0x0053
|
||||
/* not verified */ #define SOUND_ACTION_UNK54 0x0054
|
||||
/* not verified */ #define SOUND_ACTION_UNK55 0x0055
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN456 SOUND_ARG_LOAD(0, 4, 0x56, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN457 SOUND_ARG_LOAD(0, 4, 0x57, 0xC0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_FLYING_FAST SOUND_ARG_LOAD(0, 4, 0x56, 0x80, 8) // "swoop"?
|
||||
#define SOUND_ACTION_TELEPORT SOUND_ARG_LOAD(0, 4, 0x57, 0xC0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN458 SOUND_ARG_LOAD(0, 4, 0x58, 0xA0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN459 SOUND_ARG_LOAD(0, 4, 0x59, 0xB0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN45A SOUND_ARG_LOAD(0, 4, 0x5A, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN45B SOUND_ARG_LOAD(0, 4, 0x5B, 0xFF, 8)
|
||||
/* not verified */ #define SOUND_ACTION_BOUNCE_OFF_OBJECT SOUND_ARG_LOAD(0, 4, 0x59, 0xB0, 8)
|
||||
/* not verified */ #define SOUND_ACTION_SIDE_FLIP_UNK SOUND_ARG_LOAD(0, 4, 0x5A, 0x80, 8)
|
||||
#define SOUND_ACTION_READ_SIGN SOUND_ARG_LOAD(0, 4, 0x5B, 0xFF, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN45C SOUND_ARG_LOAD(0, 4, 0x5C, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNK5D 0x005D
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN45E SOUND_ARG_LOAD(0, 4, 0x5E, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_UNKNOWN45F SOUND_ARG_LOAD(0, 4, 0x5F, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_INTRO_UNK45E SOUND_ARG_LOAD(0, 4, 0x5E, 0x80, 8)
|
||||
/* not verified */ #define SOUND_ACTION_INTRO_UNK45F SOUND_ARG_LOAD(0, 4, 0x5F, 0x80, 8)
|
||||
|
||||
/* Moving Sound Effects */
|
||||
|
||||
@@ -492,7 +492,6 @@
|
||||
#define SOUND_MENU_CAMERA_TURN SOUND_ARG_LOAD(7, 0, 0x0F, 0x00, 8)
|
||||
/* not verified */ #define SOUND_MENU_UNK10 0x7010
|
||||
#define SOUND_MENU_CLICK_FILE_SELECT SOUND_ARG_LOAD(7, 0, 0x11, 0x00, 8)
|
||||
/* not verified */ #define SOUND_MENU_READ_SIGN 0x7012
|
||||
/* not verified */ #define SOUND_MENU_MESSAGE_NEXT_PAGE SOUND_ARG_LOAD(7, 0, 0x13, 0x00, 8)
|
||||
#define SOUND_MENU_COIN_ITS_A_ME_MARIO SOUND_ARG_LOAD(7, 0, 0x14, 0x00, 8)
|
||||
#define SOUND_MENU_YOSHI_GAIN_LIVES SOUND_ARG_LOAD(7, 0, 0x15, 0x00, 8)
|
||||
|
||||
+539
-536
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
#ifndef COMMAND_MACROS_BASE_H
|
||||
#define COMMAND_MACROS_BASE_H
|
||||
|
||||
#include "platform_info.h"
|
||||
|
||||
#if IS_BIG_ENDIAN
|
||||
#if IS_64_BIT
|
||||
#define CMD_BBBB(a, b, c, d) ((uintptr_t)(_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8)) << 32)
|
||||
#define CMD_BBH(a, b, c) ((uintptr_t)(_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16)) << 32)
|
||||
#define CMD_HH(a, b) ((uintptr_t)(_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16)) << 32)
|
||||
#define CMD_W(a) ((uintptr_t)(a) << 32)
|
||||
#else
|
||||
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))
|
||||
#define CMD_BBH(a, b, c) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16))
|
||||
#define CMD_HH(a, b) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16))
|
||||
#define CMD_W(a) (a)
|
||||
#endif
|
||||
#else
|
||||
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 8) | _SHIFTL(d, 24, 8))
|
||||
#define CMD_BBH(a, b, c) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 16))
|
||||
#define CMD_HH(a, b) (_SHIFTL(a, 0, 16) | _SHIFTL(b, 16, 16))
|
||||
#define CMD_W(a) (a)
|
||||
#endif
|
||||
#define CMD_PTR(a) ((uintptr_t)(a))
|
||||
|
||||
#define CMD_HHHHHH(a, b, c, d, e, f) CMD_HH(a, b), CMD_HH(c, d), CMD_HH(e, f)
|
||||
|
||||
#endif
|
||||
+9
-5
@@ -9,15 +9,19 @@
|
||||
|
||||
// Bug Fixes
|
||||
// --| Categories
|
||||
/// Turn on bug fixes for really bad, C standard breaking code. As these bugs
|
||||
/// have caused compilation issues with modern GCC, these bug fixes are
|
||||
/// automatically enabled when compiling with GCC
|
||||
#define BUGFIXES_CRITICAL (0 || __GNUC__)
|
||||
/// Turn on bug fixes for really bad, C standard breaking code. This is
|
||||
/// enabled automatically when building with non-IDO compilers, or if
|
||||
/// NON_MATCHING is set.
|
||||
#if !defined(__sgi) || defined(NON_MATCHING)
|
||||
#define BUGFIXES_CRITICAL 1
|
||||
#else
|
||||
#define BUGFIXES_CRITICAL 0
|
||||
#endif
|
||||
|
||||
// --| US Version Nintendo Bug Fixes
|
||||
/// Fixes bug where obtaining over 999 coins sets the number of lives to 999 (or -25)
|
||||
#define BUGFIX_MAX_LIVES (0 || VERSION_US || VERSION_EU)
|
||||
/// Fixes bug where the Boss music won't fade out after defeating King Bob-omb
|
||||
/// Fixes bug where the Boss music won't fade out after defeating King Bob-omb
|
||||
#define BUGFIX_KING_BOB_OMB_FADE_MUSIC (0 || VERSION_US || VERSION_EU)
|
||||
/// Fixes bug in Bob-Omb Battlefield where entering a warp stops the Koopa race music
|
||||
#define BUGFIX_KOOPA_RACE_MUSIC (0 || VERSION_US || VERSION_EU)
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
#ifndef GEO_COMMANDS_H
|
||||
#define GEO_COMMANDS_H
|
||||
|
||||
#include "command_macros_base.h"
|
||||
|
||||
#include "game/shadow.h"
|
||||
#include "game/object_helpers.h"
|
||||
#include "game/object_helpers2.h"
|
||||
#include "game/behavior_actions.h"
|
||||
#include "game/segment2.h"
|
||||
#include "game/mario_misc.h"
|
||||
#include "game/mario_actions_cutscene.h"
|
||||
|
||||
// sky background params
|
||||
#define BACKGROUND_OCEAN_SKY 0
|
||||
#define BACKGROUND_FLAMING_SKY 1
|
||||
#define BACKGROUND_UNDERWATER_CITY 2
|
||||
#define BACKGROUND_BELOW_CLOUDS 3
|
||||
#define BACKGROUND_SNOW_MOUNTAINS 4
|
||||
#define BACKGROUND_DESERT 5
|
||||
#define BACKGROUND_HAUNTED 6
|
||||
#define BACKGROUND_GREEN_SKY 7
|
||||
#define BACKGROUND_ABOVE_CLOUDS 8
|
||||
#define BACKGROUND_PURPLE_SKY 9
|
||||
|
||||
// geo layout macros
|
||||
|
||||
/**
|
||||
* 0x00: Branch and store return address
|
||||
* 0x04: scriptTarget, segment address of geo layout
|
||||
*/
|
||||
#define GEO_BRANCH_AND_LINK(scriptTarget) \
|
||||
CMD_BBH(0x00, 0x00, 0x0000), \
|
||||
CMD_PTR(scriptTarget)
|
||||
|
||||
/**
|
||||
* 0x01: Terminate geo layout
|
||||
* 0x01-0x03: unused
|
||||
*/
|
||||
#define GEO_END() \
|
||||
CMD_BBH(0x01, 0x00, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x02: Branch
|
||||
* 0x01: if 1, store next geo layout address on stack
|
||||
* 0x02-0x03: unused
|
||||
* 0x04: scriptTarget, segment address of geo layout
|
||||
*/
|
||||
#define GEO_BRANCH(type, scriptTarget) \
|
||||
CMD_BBH(0x02, type, 0x0000), \
|
||||
CMD_PTR(scriptTarget)
|
||||
|
||||
/**
|
||||
* 0x03: Return from branch
|
||||
* 0x01-0x03: unused
|
||||
*/
|
||||
#define GEO_RETURN() \
|
||||
CMD_BBH(0x03, 0x00, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x04: Open node
|
||||
* 0x01-0x03: unused
|
||||
*/
|
||||
#define GEO_OPEN_NODE() \
|
||||
CMD_BBH(0x04, 0x00, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x05: Close node
|
||||
* 0x01-0x03: unused
|
||||
*/
|
||||
#define GEO_CLOSE_NODE() \
|
||||
CMD_BBH(0x05, 0x00, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x06: Register the current node at the given index in the gGeoViews array
|
||||
* 0x01: unused
|
||||
* 0x02: s16 index
|
||||
*/
|
||||
#define GEO_ASSIGN_AS_VIEW(index) \
|
||||
CMD_BBH(0x06, 0x00, index)
|
||||
|
||||
/**
|
||||
* 0x07: Update current scene graph node flags
|
||||
* 0x01: u8 operation (0 = reset, 1 = set, 2 = clear)
|
||||
* 0x02: s16 bits
|
||||
*/
|
||||
#define GEO_UPDATE_NODE_FLAGS(operation, flagBits) \
|
||||
CMD_BBH(0x07, operation, flagBits)
|
||||
|
||||
/**
|
||||
* 0x08: Create screen area scene graph node
|
||||
* 0x01: unused
|
||||
* 0x02: s16 num entries (+2) to allocate
|
||||
* 0x04: s16 x
|
||||
* 0x06: s16 y
|
||||
* 0x08: s16 width
|
||||
* 0x0A: s16 height
|
||||
*/
|
||||
#define GEO_NODE_SCREEN_AREA(numEntries, x, y, width, height) \
|
||||
CMD_BBH(0x08, 0x00, numEntries), \
|
||||
CMD_HH(x, y), \
|
||||
CMD_HH(width, height)
|
||||
|
||||
/**
|
||||
* 0x09: Create orthographic projection scene graph node
|
||||
* 0x02: s16 scale as percentage
|
||||
*/
|
||||
#define GEO_NODE_ORTHO(scale) \
|
||||
CMD_BBH(0x09, 0x00, scale)
|
||||
|
||||
/**
|
||||
* 0x0A: Create camera frustum scene graph node
|
||||
* 0x01: u8 if nonzero, enable function field
|
||||
* 0x02: s16 field of view
|
||||
* 0x04: s16 near
|
||||
* 0x06: s16 far
|
||||
* 0x08: [GraphNodeFunc function]
|
||||
*/
|
||||
#define GEO_CAMERA_FRUSTUM(fov, near, far) \
|
||||
CMD_BBH(0x0A, 0x00, fov), \
|
||||
CMD_HH(near, far)
|
||||
#define GEO_CAMERA_FRUSTUM_WITH_FUNC(fov, near, far, func) \
|
||||
CMD_BBH(0x0A, 0x01, fov), \
|
||||
CMD_HH(near, far), \
|
||||
CMD_PTR(func)
|
||||
|
||||
/**
|
||||
* 0x0B: Create a root scene graph node
|
||||
* 0x01-0x03: unused
|
||||
*/
|
||||
#define GEO_NODE_START() \
|
||||
CMD_BBH(0x0B, 0x00, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x0C: Create zbuffer-toggling scene graph node
|
||||
* 0x01: u8 enableZBuffer (1 = on, 0 = off)
|
||||
* 0x02-0x03: unused
|
||||
*/
|
||||
#define GEO_ZBUFFER(enable) \
|
||||
CMD_BBH(0x0C, enable, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x0D: Create render range scene graph node
|
||||
* 0x01-0x03: unused
|
||||
* 0x04: s16 minDistance
|
||||
* 0x06: s16 maxDistance
|
||||
*/
|
||||
#define GEO_RENDER_RANGE(minDistance, maxDistance) \
|
||||
CMD_BBH(0x0D, 0x00, 0x0000), \
|
||||
CMD_HH(minDistance, maxDistance)
|
||||
|
||||
/**
|
||||
* 0x0E: Create switch-case scene graph node
|
||||
* 0x01: unused
|
||||
* 0x02: s16 numCases
|
||||
* 0x04: GraphNodeFunc caseSelectorFunc
|
||||
*/
|
||||
#define GEO_SWITCH_CASE(count, function) \
|
||||
CMD_BBH(0x0E, 0x00, count), \
|
||||
CMD_PTR(function)
|
||||
|
||||
/**
|
||||
* 0x0F: Create a camera scene graph node.
|
||||
* 0x01: unused
|
||||
* 0x02: s16 camera type
|
||||
* 0x04: s16 fromX
|
||||
* 0x06: s16 fromY
|
||||
* 0x08: s16 fromZ
|
||||
* 0x0A: s16 toX
|
||||
* 0x0C: s16 toY
|
||||
* 0x0E: s16 toZ
|
||||
* 0x10: GraphNodeFunc function
|
||||
*/
|
||||
#define GEO_CAMERA(type, x1, y1, z1, x2, y2, z2, function) \
|
||||
CMD_BBH(0x0F, 0x00, type), \
|
||||
CMD_HHHHHH(x1, y1, z1, x2, y2, z2), \
|
||||
CMD_PTR(function)
|
||||
|
||||
/**
|
||||
* 0x10: Create translation & rotation scene graph node with optional display list
|
||||
* Four different versions of 0x10
|
||||
* cmd+0x01: u8 params
|
||||
* 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
* 0b0111_0000: fieldLayout (determines how rest of data is formatted
|
||||
* 0b0000_1111: drawingLayer
|
||||
*
|
||||
* fieldLayout = 0: Translate & Rotate
|
||||
* 0x04: s16 xTranslation
|
||||
* 0x06: s16 yTranslation
|
||||
* 0x08: s16 zTranslation
|
||||
* 0x0A: s16 xRotation
|
||||
* 0x0C: s16 yRotation
|
||||
* 0x0E: s16 zRotation
|
||||
* 0x10: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
*/
|
||||
#define GEO_TRANSLATE_ROTATE(layer, tx, ty, tz, rx, ry, rz) \
|
||||
CMD_BBH(0x10, (0x00 | layer), 0x0000), \
|
||||
CMD_HHHHHH(tx, ty, tz, rx, ry, rz)
|
||||
#define GEO_TRANSLATE_ROTATE_WITH_DL(layer, tx, ty, tz, rx, ry, rz, displayList) \
|
||||
CMD_BBH(0x10, (0x00 | layer | 0x80), 0x0000), \
|
||||
CMD_HHHHHH(tx, ty, tz, rx, ry, rz), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* fieldLayout = 1: Translate
|
||||
* 0x02: s16 xTranslation
|
||||
* 0x04: s16 yTranslation
|
||||
* 0x06: s16 zTranslation
|
||||
* 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
*/
|
||||
#define GEO_TRANSLATE(layer, tx, ty, tz) \
|
||||
CMD_BBH(0x10, (0x10 | layer), tx), \
|
||||
CMD_HH(ty, tz)
|
||||
#define GEO_TRANSLATE_WITH_DL(layer, tx, ty, tz, displayList) \
|
||||
CMD_BBH(0x10, (0x10 | layer | 0x80), tx), \
|
||||
CMD_HH(ty, tz), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* fieldLayout = 2: Rotate
|
||||
* 0x02: s16 xRotation
|
||||
* 0x04: s16 yRotation
|
||||
* 0x06: s16 zRotation
|
||||
* 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
*/
|
||||
#define GEO_ROTATE(layer, rx, ry, rz) \
|
||||
CMD_BBH(0x10, (0x20 | layer), rx), \
|
||||
CMD_HH(ry, rz)
|
||||
#define GEO_ROTATE_WITH_DL(layer, rx, ry, rz, displayList) \
|
||||
CMD_BBH(0x10, (0x20 | layer | 0x80), rx), \
|
||||
CMD_HH(ry, rz), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* fieldLayout = 3: Rotate Y
|
||||
* 0x02: s16 yRotation
|
||||
* 0x04: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
*/
|
||||
#define GEO_ROTATE_Y(layer, ry) \
|
||||
CMD_BBH(0x10, (0x30 | layer), ry)
|
||||
#define GEO_ROTATE_Y_WITH_DL(layer, ry, displayList) \
|
||||
CMD_BBH(0x10, (0x30 | layer | 0x80), ry), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* 0x11: Create translation scene graph node with optional display list
|
||||
* 0x01: u8 params
|
||||
* 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
* 0b0000_1111: drawingLayer
|
||||
* 0x02: s16 translationX
|
||||
* 0x04: s16 translationY
|
||||
* 0x06: s16 translationZ
|
||||
* 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
*/
|
||||
#define GEO_TRANSLATE_NODE(layer, ux, uy, uz) \
|
||||
CMD_BBH(0x11, layer, ux), \
|
||||
CMD_HH(uy, uz)
|
||||
#define GEO_TRANSLATE_NODE_WITH_DL(layer, ux, uy, uz, displayList) \
|
||||
CMD_BBH(0x11, (layer | 0x80), ux), \
|
||||
CMD_HH(uy, uz), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* 0x12: Create rotation scene graph node with optional display list
|
||||
* 0x01: u8 params
|
||||
* 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
* 0b0000_1111: drawingLayer
|
||||
* 0x02: s16 rotationX
|
||||
* 0x04: s16 rotationY
|
||||
* 0x06: s16 rotationZ
|
||||
* 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
*/
|
||||
#define GEO_ROTATION_NODE(layer, ux, uy, uz) \
|
||||
CMD_BBH(0x12, layer, ux), \
|
||||
CMD_HH(uy, uz)
|
||||
#define GEO_ROTATION_NODE_WITH_DL(layer, ux, uy, uz, displayList) \
|
||||
CMD_BBH(0x12, (layer | 0x80), ux), \
|
||||
CMD_HH(uy, uz), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* 0x13: Create a scene graph node that is rotated by the object's animation.
|
||||
* 0x01: u8 drawingLayer
|
||||
* 0x02: s16 xTranslation
|
||||
* 0x04: s16 yTranslation
|
||||
* 0x06: s16 zTranslation
|
||||
* 0x08: u32 displayList: dislay list segmented address
|
||||
*/
|
||||
#define GEO_ANIMATED_PART(layer, x, y, z, displayList) \
|
||||
CMD_BBH(0x13, layer, x), \
|
||||
CMD_HH(y, z), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* 0x14: Create billboarding node with optional display list
|
||||
* 0x01: u8 params
|
||||
* 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
* 0b0000_1111: drawingLayer
|
||||
* 0x02: s16 xTranslation
|
||||
* 0x04: s16 yTranslation
|
||||
* 0x06: s16 zTranslation
|
||||
* 0x08: [u32 displayList: if MSbit of params is set, display list segmented address]
|
||||
*/
|
||||
#define GEO_BILLBOARD_WITH_PARAMS(layer, tx, ty, tz) \
|
||||
CMD_BBH(0x14, layer, tx), \
|
||||
CMD_HH(ty, tz)
|
||||
#define GEO_BILLBOARD_WITH_PARAMS_AND_DL(layer, tx, ty, tz, displayList) \
|
||||
CMD_BBH(0x14, (layer | 0x80), tx), \
|
||||
CMD_HH(ty, tz), \
|
||||
CMD_PTR(displayList)
|
||||
#define GEO_BILLBOARD() \
|
||||
GEO_BILLBOARD_WITH_PARAMS(0, 0, 0, 0)
|
||||
|
||||
/**
|
||||
* 0x15: Create plain display list scene graph node
|
||||
* 0x01: u8 drawingLayer
|
||||
* 0x02-0x03: unused
|
||||
* 0x04: u32 displayList: display list segmented address
|
||||
*/
|
||||
#define GEO_DISPLAY_LIST(layer, displayList) \
|
||||
CMD_BBH(0x15, layer, 0x0000), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* 0x16: Create shadow scene graph node
|
||||
* 0x01: unused
|
||||
* 0x02: s16 shadowType (cast to u8)
|
||||
* 0x04: s16 shadowSolidity (cast to u8)
|
||||
* 0x06: s16 shadowScale
|
||||
*/
|
||||
#define GEO_SHADOW(type, solidity, scale) \
|
||||
CMD_BBH(0x16, 0x00, type), \
|
||||
CMD_HH(solidity, scale)
|
||||
|
||||
/**
|
||||
* 0x17: Create render object scene graph node
|
||||
* 0x01-0x03: unused
|
||||
*/
|
||||
#define GEO_RENDER_OBJ() \
|
||||
CMD_BBH(0x17, 0x00, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x18: Create dynamically generated displaylist scene graph node
|
||||
* 0x01: unused
|
||||
* 0x02: s16 parameter
|
||||
* 0x04: GraphNodeFunc function
|
||||
*/
|
||||
#define GEO_ASM(param, function) \
|
||||
CMD_BBH(0x18, 0x00, param), \
|
||||
CMD_PTR(function)
|
||||
|
||||
/**
|
||||
* 0x19: Create background scene graph node
|
||||
* 0x02: s16 background: background ID, or RGBA5551 color if backgroundFunc is null
|
||||
* 0x04: GraphNodeFunc backgroundFunc
|
||||
*/
|
||||
#define GEO_BACKGROUND(background, function) \
|
||||
CMD_BBH(0x19, 0x00, background), \
|
||||
CMD_PTR(function)
|
||||
#define GEO_BACKGROUND_COLOR(background) \
|
||||
GEO_BACKGROUND(background, NULL)
|
||||
|
||||
/**
|
||||
* 0x1A: No operation
|
||||
*/
|
||||
#define GEO_NOP_1A() \
|
||||
CMD_BBH(0x1A, 0x00, 0x0000), \
|
||||
CMD_HH(0x0000, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x1B: Copy the shared children from an object parent node from a specific view
|
||||
* to a newly created object parent.
|
||||
* 0x02: s16 index of array
|
||||
*/
|
||||
#define GEO_COPY_VIEW(index) \
|
||||
CMD_BBH(0x1B, 0x00, index)
|
||||
|
||||
/**
|
||||
* 0x1C: Create a held object scene graph node
|
||||
* cmd+0x01: u8 unused
|
||||
* cmd+0x02: s16 offsetX
|
||||
* cmd+0x04: s16 offsetY
|
||||
* cmd+0x06: s16 offsetZ
|
||||
* cmd+0x08: GraphNodeFunc nodeFunc
|
||||
*/
|
||||
#define GEO_HELD_OBJECT(param, ux, uy, uz, nodeFunc) \
|
||||
CMD_BBH(0x1C, param, ux), \
|
||||
CMD_HH(uy, uz), \
|
||||
CMD_PTR(nodeFunc)
|
||||
|
||||
/**
|
||||
* 0x1D: Create scale scene graph node with optional display list
|
||||
* 0x01: u8 params
|
||||
* 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
* 0b0000_1111: drawingLayer
|
||||
* 0x02-0x03: unused
|
||||
* 0x04: u32 scale (0x10000 = 1.0)
|
||||
* 0x08: [u32 displayList: if MSbit of params is set, display list segment address]
|
||||
*/
|
||||
#define GEO_SCALE(layer, scale) \
|
||||
CMD_BBH(0x1D, layer, 0x0000), \
|
||||
CMD_W(scale)
|
||||
#define GEO_SCALE_WITH_DL(layer, scale, displayList) \
|
||||
CMD_BBH(0x1D, (layer | 0x80), 0x0000), \
|
||||
CMD_W(scale), \
|
||||
CMD_PTR(displayList)
|
||||
|
||||
/**
|
||||
* 0x1E: No operation
|
||||
*/
|
||||
#define GEO_NOP_1E() \
|
||||
CMD_BBH(0x1E, 0x00, 0x0000), \
|
||||
CMD_HH(0x0000, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x1F: No operation
|
||||
*/
|
||||
#define GEO_NOP_1F() \
|
||||
CMD_BBH(0x1F, 0x00, 0x0000), \
|
||||
CMD_HH(0x0000, 0x0000), \
|
||||
CMD_HH(0x0000, 0x0000), \
|
||||
CMD_HH(0x0000, 0x0000)
|
||||
|
||||
/**
|
||||
* 0x20: Create a scene graph node that specifies for an object the radius that
|
||||
* is used for frustum culling.
|
||||
* 0x01: unused
|
||||
* 0x02: s16 cullingRadius
|
||||
*/
|
||||
#define GEO_CULLING_RADIUS(cullingRadius) \
|
||||
CMD_BBH(0x20, 0x00, cullingRadius)
|
||||
|
||||
#endif
|
||||
@@ -1,444 +0,0 @@
|
||||
# drawing layers
|
||||
.set LAYER_FORCE, 0
|
||||
.set LAYER_OPAQUE, 1
|
||||
.set LAYER_OPAQUE_DECAL, 2
|
||||
.set LAYER_OPAQUE_INTER, 3
|
||||
.set LAYER_ALPHA, 4
|
||||
.set LAYER_TRANSPARENT, 5
|
||||
.set LAYER_TRANSPARENT_DECAL, 6
|
||||
.set LAYER_TRANSPARENT_INTER, 7
|
||||
|
||||
# sky background params
|
||||
.set BACKGROUND_OCEAN_SKY, 0
|
||||
.set BACKGROUND_FLAMING_SKY, 1
|
||||
.set BACKGROUND_UNDERWATER_CITY, 2
|
||||
.set BACKGROUND_BELOW_CLOUDS, 3
|
||||
.set BACKGROUND_SNOW_MOUNTAINS, 4
|
||||
.set BACKGROUND_DESERT, 5
|
||||
.set BACKGROUND_HAUNTED, 6
|
||||
.set BACKGROUND_GREEN_SKY, 7
|
||||
.set BACKGROUND_ABOVE_CLOUDS, 8
|
||||
.set BACKGROUND_PURPLE_SKY, 9
|
||||
|
||||
# geo layout macros
|
||||
|
||||
# 0x00: Branch and store return address
|
||||
# 0x04: scriptTarget, segment address of geo layout
|
||||
.macro geo_branch_and_link scriptTarget
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.word \scriptTarget
|
||||
.endm
|
||||
|
||||
# 0x01: Terminate geo layout
|
||||
# 0x01-0x03: unused
|
||||
.macro geo_end
|
||||
.byte 0x01, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x02: Branch
|
||||
# 0x01: if 1, store next geo layout address on stack
|
||||
# 0x02-0x03: unused
|
||||
# 0x04: scriptTarget, segment address of geo layout
|
||||
.macro geo_branch type, scriptTarget
|
||||
.byte 0x02, \type, 0x00, 0x00
|
||||
.word \scriptTarget
|
||||
.endm
|
||||
|
||||
# 0x03: Return from branch
|
||||
# 0x01-0x03: unused
|
||||
.macro geo_return
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x04: Open node
|
||||
# 0x01-0x03: unused
|
||||
.macro geo_open_node
|
||||
.byte 0x04, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x05: Close node
|
||||
# 0x01-0x03: unused
|
||||
.macro geo_close_node
|
||||
.byte 0x05, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x06: Register the current node at the given index in the gGeoViews array
|
||||
# 0x01: unused
|
||||
# 0x02: s16 index
|
||||
.macro geo_assign_as_view param
|
||||
.byte 0x06, 0x00
|
||||
.hword \param
|
||||
.endm
|
||||
|
||||
# 0x07: Update current scene graph node flags
|
||||
# 0x01: u8 operation (0 = reset, 1 = set, 2 = clear)
|
||||
# 0x02: s16 bits
|
||||
.macro geo_update_node_flags operation, flagBits
|
||||
.byte 0x07, \operation
|
||||
.hword \flagBits
|
||||
.endm
|
||||
|
||||
# 0x08: Create screen area scene graph node
|
||||
# 0x01: unused
|
||||
# 0x02: s16 num entries (+2) to allocate
|
||||
# 0x04: s16 x
|
||||
# 0x06: s16 y
|
||||
# 0x08: s16 width
|
||||
# 0x0A: s16 height
|
||||
.macro geo_node_screen_area numEntries, x, y, width, height
|
||||
.byte 0x08, 0x00
|
||||
.hword \numEntries
|
||||
.hword \x, \y, \width, \height
|
||||
.endm
|
||||
|
||||
# 0x09: Create orthographic projection scene graph node
|
||||
# 0x02: s16 scale as percentage
|
||||
.macro geo_node_ortho param
|
||||
.byte 0x09, 0x00
|
||||
.hword \param
|
||||
.endm
|
||||
|
||||
# 0x0A: Create camera frustum scene graph node
|
||||
# 0x01: u8 if nonzero, enable function field
|
||||
# 0x02: s16 field of view
|
||||
# 0x04: s16 near
|
||||
# 0x06: s16 far
|
||||
# 0x08: [GraphNodeFunc function]
|
||||
.macro geo_camera_frustum fov, near, far, function=0
|
||||
.byte 0x0A
|
||||
.if (\function != 0)
|
||||
.byte 0x01
|
||||
.else
|
||||
.byte 0x00
|
||||
.endif
|
||||
.hword \fov, \near, \far
|
||||
.if (\function != 0)
|
||||
.word \function
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# 0x0B: Create a root scene graph node
|
||||
# 0x01-0x03: unused
|
||||
.macro geo_node_start
|
||||
.byte 0x0B, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x0C: Create zbuffer-toggling scene graph node
|
||||
# 0x01: u8 enableZBuffer (1 = on, 0 = off)
|
||||
# 0x02-0x03: unused
|
||||
.macro geo_zbuffer enable
|
||||
.byte 0x0C, \enable, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x0D: Create render range scene graph node
|
||||
# 0x01-0x03: unused
|
||||
# 0x04: s16 minDistance
|
||||
# 0x06: s16 maxDistance
|
||||
.macro geo_render_range minDistance, maxDistance
|
||||
.byte 0x0D, 0x00, 0x00, 0x00
|
||||
.hword \minDistance, \maxDistance
|
||||
.endm
|
||||
|
||||
# 0x0E: Create switch-case scene graph node
|
||||
# 0x01: unused
|
||||
# 0x02: s16 numCases
|
||||
# 0x04: GraphNodeFunc caseSelectorFunc
|
||||
.macro geo_switch_case count, function
|
||||
.byte 0x0E, 0x00
|
||||
.hword \count
|
||||
.word \function
|
||||
.endm
|
||||
|
||||
# 0x0F: Create a camera scene graph node.
|
||||
# 0x01: unused
|
||||
# 0x02: s16 camera type
|
||||
# 0x04: s16 fromX
|
||||
# 0x06: s16 fromY
|
||||
# 0x08: s16 fromZ
|
||||
# 0x0A: s16 toX
|
||||
# 0x0C: s16 toY
|
||||
# 0x0E: s16 toZ
|
||||
# 0x10: GraphNodeFunc function
|
||||
.macro geo_camera type, x1, y1, z1, x2, y2, z2, function
|
||||
.byte 0x0F, 0x00
|
||||
.hword \type, \x1, \y1, \z1, \x2, \y2, \z2
|
||||
.word \function
|
||||
.endm
|
||||
|
||||
# 0x10: Create translation & rotation scene graph node with optional display list
|
||||
# Four different versions of 0x10
|
||||
# cmd+0x01: u8 params
|
||||
# 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
# 0b0111_0000: fieldLayout (determines how rest of data is formatted
|
||||
# 0b0000_1111: drawingLayer
|
||||
#
|
||||
# fieldLayout = 0: Translate & Rotate
|
||||
# 0x04: s16 xTranslation
|
||||
# 0x06: s16 xTranslation
|
||||
# 0x08: s16 xTranslation
|
||||
# 0x0A: s16 xRotation
|
||||
# 0x0C: s16 xRotation
|
||||
# 0x0E: s16 xRotation
|
||||
# 0x10: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
.macro geo_translate_rotate layer, tx, ty, tz, rx, ry, rz, displayList=0
|
||||
.byte 0x10
|
||||
.if (\displayList != 0)
|
||||
.byte 0x00 | \layer | 0x80
|
||||
.else
|
||||
.byte 0x00 | \layer
|
||||
.endif
|
||||
.hword 0x0000
|
||||
.hword \tx, \ty, \tz
|
||||
.hword \rx, \ry, \rz
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# fieldLayout = 1: Translate
|
||||
# 0x02: s16 xTranslation
|
||||
# 0x04: s16 yTranslation
|
||||
# 0x06: s16 zTranslation
|
||||
# 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
.macro geo_translate layer, tx, ty, tz, displayList=0
|
||||
.byte 0x10
|
||||
.if (\displayList != 0)
|
||||
.byte 0x10 | \layer | 0x80
|
||||
.else
|
||||
.byte 0x10 | \layer
|
||||
.endif
|
||||
.hword \tx, \ty, \tz
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# fieldLayout = 2: Rotate
|
||||
# 0x02: s16 xRotation
|
||||
# 0x04: s16 yRotation
|
||||
# 0x06: s16 zRotation
|
||||
# 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
.macro geo_rotate layer, rx, ry, rz, displayList=0
|
||||
.byte 0x10
|
||||
.if (\displayList != 0)
|
||||
.byte 0x20 | \layer | 0x80
|
||||
.else
|
||||
.byte 0x20 | \layer
|
||||
.endif
|
||||
.hword \rx, \ry, \rz
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# fieldLayout = 3: Rotate Y
|
||||
# 0x02: s16 yRotation
|
||||
# 0x04: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
.macro geo_rotate_y layer, ry, displayList=0
|
||||
.byte 0x10
|
||||
.if (\displayList != 0)
|
||||
.byte 0x30 | \layer | 0x80
|
||||
.else
|
||||
.byte 0x30 | \layer
|
||||
.endif
|
||||
.hword \ry
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# 0x11: Create translation scene graph node with optional display list
|
||||
# 0x01: u8 params
|
||||
# 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
# 0b0000_1111: drawingLayer
|
||||
# 0x02: s16 translationX
|
||||
# 0x04: s16 translationY
|
||||
# 0x06: s16 translationZ
|
||||
# 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
.macro geo_translate_node layer, ux, uy, uz, displayList=0
|
||||
.byte 0x11
|
||||
.if (\displayList != 0)
|
||||
.byte 0x80 | \layer
|
||||
.else
|
||||
.byte 0x00
|
||||
.endif
|
||||
.hword \ux, \uy, \uz
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# 0x12: Create rotation scene graph node with optional display list
|
||||
# 0x01: u8 params
|
||||
# 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
# 0b0000_1111: drawingLayer
|
||||
# 0x02: s16 rotationX
|
||||
# 0x04: s16 rotationY
|
||||
# 0x06: s16 rotationZ
|
||||
# 0x08: [u32 displayList: if MSbit of params set, display list segmented address]
|
||||
.macro geo_rotation_node layer, ux, uy, uz, displayList=0
|
||||
.byte 0x12
|
||||
.if (\displayList != 0)
|
||||
.byte 0x80 | \layer
|
||||
.else
|
||||
.byte 0x00
|
||||
.endif
|
||||
.hword \ux, \uy, \uz
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# 0x13: Create a scene graph node that is rotated by the object's animation.
|
||||
# 0x01: u8 drawingLayer
|
||||
# 0x02: s16 xTranslation
|
||||
# 0x04: s16 yTranslation
|
||||
# 0x06: s16 zTranslation
|
||||
# 0x08: u32 displayList: dislay list segmented address
|
||||
.macro geo_animated_part layer, x, y, z, displayList=0
|
||||
.byte 0x13, \layer
|
||||
.hword \x, \y, \z
|
||||
.word \displayList
|
||||
.endm
|
||||
|
||||
# 0x14: Create billboarding node with optional display list
|
||||
# 0x01: u8 params
|
||||
# 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
# 0b0000_1111: drawingLayer
|
||||
# 0x02: s16 xTranslation
|
||||
# 0x04: s16 yTranslation
|
||||
# 0x06: s16 zTranslation
|
||||
# 0x08: [u32 displayList: if MSbit of params is set, display list segmented address]
|
||||
.macro geo_billboard layer=0, tx=0, ty=0, tz=0, displayList=0
|
||||
.byte 0x14
|
||||
.if (\displayList != 0)
|
||||
.byte 0x80 | \layer
|
||||
.else
|
||||
.byte 0x00
|
||||
.endif
|
||||
.hword \tx, \ty, \tz
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# 0x15: Create plain display list scene graph node
|
||||
# 0x01: u8 drawingLayer
|
||||
# 0x02=0x03: unused
|
||||
# 0x04: u32 displayList: display list segmented address
|
||||
.macro geo_display_list layer, displayList
|
||||
.byte 0x15, \layer, 0x00, 0x00
|
||||
.word \displayList
|
||||
.endm
|
||||
|
||||
# 0x16: Create shadow scene graph node
|
||||
# 0x01: unused
|
||||
# 0x02: s16 shadowType (cast to u8)
|
||||
# 0x04: s16 shadowSolidity (cast to u8)
|
||||
# 0x06: s16 shadowScale
|
||||
.set SHADOW_CIRCLE_9_VERTS, 0x00
|
||||
.set SHADOW_CIRCLE_4_VERTS, 0x01
|
||||
.set SHADOW_CIRCLE_4_VERTS_FLAT_UNUSED, 0x02 # unused shadow type
|
||||
.set SHADOW_SQUARE_PERMANENT, 0x0A # square shadow that never disappears
|
||||
.set SHADOW_SQUARE_SCALABLE, 0x0B # square shadow, shrinks with distance
|
||||
.set SHADOW_SQUARE_TOGGLABLE, 0x0C # square shadow, disappears with distance
|
||||
.set SHADOW_CIRCLE_PLAYER, 0x63 # player (Mario) shadow
|
||||
.set SHADOW_RECTANGLE_HARDCODED_OFFSET, 0x32 # offset of hard-coded shadows
|
||||
.macro geo_shadow type, solidity, scale
|
||||
.byte 0x16, 0x00
|
||||
.hword \type, \solidity, \scale
|
||||
.endm
|
||||
|
||||
# 0x17: TODO Create render object scene graph node
|
||||
# 0x01-0x03: unused
|
||||
.macro geo_render_obj
|
||||
.byte 0x17, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x18: Create dynamically generated displaylist scene graph node
|
||||
# 0x01: unused
|
||||
# 0x02: s16 parameter
|
||||
# 0x04: GraphNodeFunc function
|
||||
.macro geo_asm param, function
|
||||
.byte 0x18, 0x00
|
||||
.hword \param
|
||||
.word \function
|
||||
.endm
|
||||
|
||||
# 0x19: Create background scene graph node
|
||||
# 0x02: s16 background: background ID, or RGBA5551 color if backgroundFunc is null
|
||||
# 0x04: GraphNodeFunc backgroundFunc
|
||||
.macro geo_background param, function=0
|
||||
.byte 0x19, 0x00
|
||||
.hword \param
|
||||
.word \function
|
||||
.endm
|
||||
|
||||
# 0x1A: No operation
|
||||
.macro geo_nop_1A
|
||||
.byte 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x1B: Copy the shared children from an object parent node from a specific view
|
||||
# to a newly created object parent.
|
||||
# 0x02: s16 index of array
|
||||
.macro geo_copy_view param
|
||||
.byte 0x1B, 0x00
|
||||
.hword \param
|
||||
.endm
|
||||
|
||||
# 0x1C: Create a held object scene graph node
|
||||
# cmd+0x01: u8 unused
|
||||
# cmd+0x02: s16 offsetX
|
||||
# cmd+0x04: s16 offsetY
|
||||
# cmd+0x06: s16 offsetZ
|
||||
# cmd+0x08: GraphNodeFunc nodeFunc
|
||||
.macro geo_held_object param, ux, uy, uz, nodeFunc
|
||||
.byte 0x1C, \param
|
||||
.hword \ux, \uy, \uz
|
||||
.word \nodeFunc
|
||||
.endm
|
||||
|
||||
# 0x1D: Create scale scene graph node with optional display list
|
||||
# 0x01: u8 params
|
||||
# 0b1000_0000: if set, enable displayList field and drawingLayer
|
||||
# 0b0000_1111: drawingLayer
|
||||
# 0x02-0x03: unused
|
||||
# 0x04: u32 scale (0x10000 = 1.0)
|
||||
# 0x08: [u32 displayList: if MSbit of params is set, display list segment address]
|
||||
.macro geo_scale layer, scale, displayList=0
|
||||
.byte 0x1D
|
||||
.if (\displayList != 0)
|
||||
.byte 0x80 | \layer
|
||||
.else
|
||||
.byte 0x00
|
||||
.endif
|
||||
.byte 0x00, 0x00
|
||||
.word32 \scale
|
||||
.if (\displayList != 0)
|
||||
.word \displayList
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# 0x1E: No operation
|
||||
.macro geo_nop_1E
|
||||
.byte 0x1E, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x1F: No operation
|
||||
.macro geo_nop_1F
|
||||
.byte 0x1F, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.byte 0x00, 0x00, 0x00, 0x00
|
||||
.endm
|
||||
|
||||
# 0x20: Create a scene graph node that specifies for an object the radius that
|
||||
# is used for frustum culling.
|
||||
# 0x01: unused
|
||||
# 0x02: s16 cullingRadius
|
||||
.macro geo_culling_radius cullingRadius
|
||||
.byte 0x20, 0x00
|
||||
.hword \cullingRadius
|
||||
.endm
|
||||
@@ -0,0 +1,276 @@
|
||||
#ifndef LEVEL_COMMANDS_H
|
||||
#define LEVEL_COMMANDS_H
|
||||
|
||||
#include "command_macros_base.h"
|
||||
|
||||
#define OP_AND 0
|
||||
#define OP_NAND 1
|
||||
#define OP_EQ 2
|
||||
#define OP_NEQ 3
|
||||
#define OP_LT 4
|
||||
#define OP_LEQ 5
|
||||
#define OP_GT 6
|
||||
#define OP_GEQ 7
|
||||
|
||||
#define OP_SET 0
|
||||
#define OP_GET 1
|
||||
|
||||
#define VAR_CURR_SAVE_FILE_NUM 0
|
||||
#define VAR_CURR_COURSE_NUM 1
|
||||
#define VAR_CURR_ACT_NUM 2
|
||||
#define VAR_CURR_LEVEL_NUM 3
|
||||
#define VAR_CURR_AREA_INDEX 4
|
||||
|
||||
#define WARP_CHECKPOINT 0x80
|
||||
#define WARP_NO_CHECKPOINT 0x00
|
||||
|
||||
#define WHIRLPOOL_COND_ALWAYS 0
|
||||
#define WHIRLPOOL_COND_BOWSER2_BEATEN 2
|
||||
#define WHIRLPOOL_COND_AT_LEAST_SECOND_STAR 3
|
||||
|
||||
// Head defines
|
||||
#define REGULAR_FACE 0x0002
|
||||
#define DIZZY_FACE 0x0003
|
||||
|
||||
#define EXECUTE(seg, script, scriptEnd, entry) \
|
||||
CMD_BBH(0x00, 0x10, seg), \
|
||||
CMD_PTR(script), \
|
||||
CMD_PTR(scriptEnd), \
|
||||
CMD_PTR(entry)
|
||||
|
||||
#define EXIT_AND_EXECUTE(seg, script, scriptEnd, entry) \
|
||||
CMD_BBH(0x01, 0x10, seg), \
|
||||
CMD_PTR(script), \
|
||||
CMD_PTR(scriptEnd), \
|
||||
CMD_PTR(entry)
|
||||
|
||||
#define EXIT() \
|
||||
CMD_BBH(0x02, 0x04, 0x0000)
|
||||
|
||||
#define SLEEP(frames) \
|
||||
CMD_BBH(0x03, 0x04, frames)
|
||||
|
||||
#define SLEEP_BEFORE_EXIT(frames) \
|
||||
CMD_BBH(0x04, 0x04, frames)
|
||||
|
||||
#define JUMP(target) \
|
||||
CMD_BBH(0x05, 0x08, 0x0000), \
|
||||
CMD_PTR(target)
|
||||
|
||||
#define JUMP_LINK(target) \
|
||||
CMD_BBH(0x06, 0x08, 0x0000), \
|
||||
CMD_PTR(target)
|
||||
|
||||
#define RETURN() \
|
||||
CMD_BBH(0x07, 0x04, 0x0000)
|
||||
|
||||
#define JUMP_LINK_PUSH_ARG(arg) \
|
||||
CMD_BBH(0x08, 0x04, arg)
|
||||
|
||||
#define JUMP_N_TIMES() \
|
||||
CMD_BBH(0x09, 0x04, 0x0000)
|
||||
|
||||
#define LOOP_BEGIN() \
|
||||
CMD_BBH(0x0A, 0x04, 0x0000)
|
||||
|
||||
#define LOOP_UNTIL(op, arg) \
|
||||
CMD_BBBB(0x0B, 0x08, op, 0x00), \
|
||||
CMD_W(arg)
|
||||
|
||||
#define JUMP_IF(op, arg, target) \
|
||||
CMD_BBBB(0x0C, 0x0C, op, 0x00), \
|
||||
CMD_W(arg), \
|
||||
CMD_PTR(target)
|
||||
|
||||
#define JUMP_LINK_IF(op, arg, target) \
|
||||
CMD_BBBB(0x0D, 0x0C, op, 0x00), \
|
||||
CMD_W(arg), \
|
||||
CMD_PTR(target)
|
||||
|
||||
|
||||
#define SKIP_IF(op, arg) \
|
||||
CMD_BBBB(0x0E, 0x08, op, 0) \
|
||||
CMD_W(arg)
|
||||
|
||||
#define SKIP() \
|
||||
CMD_BBH(0x0F, 0x04, 0x0000)
|
||||
|
||||
#define SKIP_NOP() \
|
||||
CMD_BBH(0x10, 0x04, 0x0000)
|
||||
|
||||
#define CALL(arg, func) \
|
||||
CMD_BBH(0x11, 0x08, arg), \
|
||||
CMD_PTR(func)
|
||||
|
||||
#define CALL_LOOP(arg, func) \
|
||||
CMD_BBH(0x12, 0x08, arg), \
|
||||
CMD_PTR(func)
|
||||
|
||||
#define SET_REG(value) \
|
||||
CMD_BBH(0x13, 0x04, value)
|
||||
|
||||
#define PUSH_POOL() \
|
||||
CMD_BBH(0x14, 0x04, 0x0000)
|
||||
|
||||
#define POP_POOL() \
|
||||
CMD_BBH(0x15, 0x04, 0x0000)
|
||||
|
||||
#define FIXED_LOAD(loadAddr, romStart, romEnd) \
|
||||
CMD_BBH(0x16, 0x10, 0x0000), \
|
||||
CMD_PTR(loadAddr), \
|
||||
CMD_PTR(romStart), \
|
||||
CMD_PTR(romEnd)
|
||||
|
||||
#define LOAD_RAW(seg, romStart, romEnd) \
|
||||
CMD_BBH(0x17, 0x0C, seg), \
|
||||
CMD_PTR(romStart), \
|
||||
CMD_PTR(romEnd)
|
||||
|
||||
#define LOAD_MIO0(seg, romStart, romEnd) \
|
||||
CMD_BBH(0x18, 0x0C, seg), \
|
||||
CMD_PTR(romStart), \
|
||||
CMD_PTR(romEnd)
|
||||
|
||||
#define LOAD_MARIO_HEAD(sethead) \
|
||||
CMD_BBH(0x19, 0x04, sethead)
|
||||
|
||||
#define LOAD_MIO0_TEXTURE(seg, romStart, romEnd) \
|
||||
CMD_BBH(0x1A, 0x0C, seg), \
|
||||
CMD_PTR(romStart), \
|
||||
CMD_PTR(romEnd)
|
||||
|
||||
#define INIT_LEVEL() \
|
||||
CMD_BBH(0x1B, 0x04, 0x0000)
|
||||
|
||||
#define CLEAR_LEVEL() \
|
||||
CMD_BBH(0x1C, 0x04, 0x0000)
|
||||
|
||||
#define ALLOC_LEVEL_POOL() \
|
||||
CMD_BBH(0x1D, 0x04, 0x0000)
|
||||
|
||||
#define FREE_LEVEL_POOL() \
|
||||
CMD_BBH(0x1E, 0x04, 0x0000)
|
||||
|
||||
#define AREA(index, geo) \
|
||||
CMD_BBBB(0x1F, 0x08, index, 0), \
|
||||
CMD_PTR(geo)
|
||||
|
||||
#define END_AREA() \
|
||||
CMD_BBH(0x20, 0x04, 0x0000)
|
||||
|
||||
#define LOAD_MODEL_FROM_DL(model, dl, layer) \
|
||||
CMD_BBH(0x21, 0x08, ((layer << 12) | model)), \
|
||||
CMD_PTR(dl)
|
||||
|
||||
#define LOAD_MODEL_FROM_GEO(model, geo) \
|
||||
CMD_BBH(0x22, 0x08, model), \
|
||||
CMD_PTR(geo)
|
||||
|
||||
// unk8 is float, but doesn't really matter since CMD23 is unused
|
||||
#define CMD23(model, unk4, unk8) \
|
||||
CMD_BBH(0x22, 0x08, model), \
|
||||
CMD_PTR(unk4), \
|
||||
CMD_W(unk8)
|
||||
|
||||
#define OBJECT_WITH_ACTS(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, acts) \
|
||||
CMD_BBBB(0x24, 0x18, acts, model), \
|
||||
CMD_HHHHHH(posX, posY, posZ, angleX, angleY, angleZ), \
|
||||
CMD_W(behParam), \
|
||||
CMD_PTR(beh)
|
||||
|
||||
#define OBJECT(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh) \
|
||||
OBJECT_WITH_ACTS(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, 0x1F)
|
||||
|
||||
#define MARIO(unk3, behArg, beh) \
|
||||
CMD_BBBB(0x25, 0x0C, 0x00, unk3), \
|
||||
CMD_W(behArg), \
|
||||
CMD_PTR(beh)
|
||||
|
||||
#define WARP_NODE(id, destLevel, destArea, destNode, flags) \
|
||||
CMD_BBBB(0x26, 0x08, id, destLevel), \
|
||||
CMD_BBBB(destArea, destNode, flags, 0x00)
|
||||
|
||||
#define PAINTING_WARP_NODE(id, destLevel, destArea, destNode, flags) \
|
||||
CMD_BBBB(0x27, 0x08, id, destLevel), \
|
||||
CMD_BBBB(destArea, destNode, flags, 0x00)
|
||||
|
||||
#define INSTANT_WARP(index, destArea, displaceX, displaceY, displaceZ) \
|
||||
CMD_BBBB(0x28, 0x0C, index, destArea), \
|
||||
CMD_HH(displaceX, displaceY), \
|
||||
CMD_HH(displaceZ, 0x0000)
|
||||
|
||||
#define LOAD_AREA(area) \
|
||||
CMD_BBBB(0x29, 0x04, area, 0x00)
|
||||
|
||||
#define CMD2A(unk2) \
|
||||
CMD_BBBB(0x2A, 0x04, unk2, 0x00)
|
||||
|
||||
#define MARIO_POS(area, yaw, posX, posY, posZ) \
|
||||
CMD_BBBB(0x2B, 0x0C, area, 0x00), \
|
||||
CMD_HH(yaw, posX), \
|
||||
CMD_HH(posY, posZ)
|
||||
|
||||
// unused
|
||||
#define CMD2C() \
|
||||
CMD_BBH(0x2C, 0x04, 0x0000)
|
||||
|
||||
// unused
|
||||
#define CMD2D() \
|
||||
CMD_BBH(0x2D, 0x04, 0x0000)
|
||||
|
||||
#define TERRAIN(terrainData) \
|
||||
CMD_BBH(0x2E, 0x08, 0x0000), \
|
||||
CMD_PTR(terrainData)
|
||||
|
||||
#define ROOMS(surfaceRooms) \
|
||||
CMD_BBH(0x2F, 0x08, 0x0000), \
|
||||
CMD_PTR(surfaceRooms)
|
||||
|
||||
#define SHOW_DIALOG(index, dialogId) \
|
||||
CMD_BBBB(0x30, 0x04, index, dialogId)
|
||||
|
||||
#define TERRAIN_TYPE(terrainType) \
|
||||
CMD_BBH(0x31, 0x04, terrainType)
|
||||
|
||||
#define NOP() \
|
||||
CMD_BBH(0x32, 0x04, 0x0000)
|
||||
|
||||
#define TRANSITION(transType, time, colorR, colorG, colorB) \
|
||||
CMD_BBBB(0x33, 0x08, transType, time), \
|
||||
CMD_BBBB(colorR, colorG, colorB, 0x00)
|
||||
|
||||
#define BLACKOUT(active) \
|
||||
CMD_BBBB(0x34, 0x04, active, 0x00)
|
||||
|
||||
#define GAMMA(enabled) \
|
||||
CMD_BBBB(0x35, 0x04, enabled, 0x00)
|
||||
|
||||
#define SET_BACKGROUND_MUSIC(settingsPreset, seq) \
|
||||
CMD_BBH(0x36, 0x08, settingsPreset), \
|
||||
CMD_HH(seq, 0x0000)
|
||||
|
||||
#define SET_MENU_MUSIC(seq) \
|
||||
CMD_BBH(0x37, 0x04, seq)
|
||||
|
||||
#define STOP_MUSIC(fadeOutTime) \
|
||||
CMD_BBH(0x38, 0x04, fadeOutTime)
|
||||
|
||||
#define MACRO_OBJECTS(objList) \
|
||||
CMD_BBH(0x39, 0x08, 0x0000), \
|
||||
CMD_PTR(objList)
|
||||
|
||||
// unused
|
||||
#define CMD3A(unk2, unk4, unk6, unk8, unk10) \
|
||||
CMD_BBH(0x3A, 0x0C, unk2), \
|
||||
CMD_HH(unk6, unk8), \
|
||||
CMD_HH(unk10, 0x0000)
|
||||
|
||||
#define WHIRLPOOL(index, condition, posX, posY, posZ, strength) \
|
||||
CMD_BBBB(0x3B, 0x0C, index, condition), \
|
||||
CMD_HH(posX, posY), \
|
||||
CMD_HH(posZ, strength)
|
||||
|
||||
#define GET_OR_SET(op, var) \
|
||||
CMD_BBBB(0x3C, 0x04, op, var)
|
||||
|
||||
#endif
|
||||
@@ -1,415 +0,0 @@
|
||||
.include "model_ids.inc"
|
||||
.include "seq_ids.inc"
|
||||
|
||||
.set OP_AND, 0
|
||||
.set OP_NAND, 1
|
||||
.set OP_EQ, 2
|
||||
.set OP_NEQ, 3
|
||||
.set OP_LT, 4
|
||||
.set OP_LEQ, 5
|
||||
.set OP_GT, 6
|
||||
.set OP_GEQ, 7
|
||||
|
||||
.set OP_SET, 0
|
||||
.set OP_GET, 1
|
||||
|
||||
.set VAR_CURR_SAVE_FILE_NUM, 0
|
||||
.set VAR_CURR_COURSE_NUM, 1
|
||||
.set VAR_CURR_ACT_NUM, 2
|
||||
.set VAR_CURR_LEVEL_NUM, 3
|
||||
.set VAR_CURR_AREA_INDEX, 4
|
||||
|
||||
|
||||
.macro execute seg, script, scriptEnd, entry
|
||||
.byte 0x00, 0x04 + 3 * PTR_WIDTH
|
||||
.hword \seg
|
||||
.word \script
|
||||
.word \scriptEnd
|
||||
.word \entry
|
||||
.endm
|
||||
|
||||
.macro exit_and_execute seg, script, scriptEnd, entry
|
||||
.byte 0x01, 0x04 + 3 * PTR_WIDTH
|
||||
.hword \seg
|
||||
.word \script
|
||||
.word \scriptEnd
|
||||
.word \entry
|
||||
.endm
|
||||
|
||||
.macro exit
|
||||
.byte 0x02, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro sleep frames
|
||||
.byte 0x03, 0x04
|
||||
.hword \frames
|
||||
.endm
|
||||
|
||||
.macro sleep_before_exit frames
|
||||
.byte 0x04, 0x04
|
||||
.hword \frames
|
||||
.endm
|
||||
|
||||
.macro jump target
|
||||
.byte 0x05, 0x04 + PTR_WIDTH
|
||||
.hword 0
|
||||
.word \target
|
||||
.endm
|
||||
|
||||
.macro jump_link target
|
||||
.byte 0x06, 0x04 + PTR_WIDTH
|
||||
.hword 0
|
||||
.word \target
|
||||
.endm
|
||||
|
||||
.macro return
|
||||
.byte 0x07, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro jump_link_push_arg arg
|
||||
.byte 0x08, 0x04
|
||||
.hword \arg
|
||||
.endm
|
||||
|
||||
.macro jump_n_times
|
||||
.byte 0x09, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro loop_begin
|
||||
.byte 0x0A, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro loop_until op, arg
|
||||
.byte 0x0B, 0x04 + PTR_WIDTH
|
||||
.byte \op
|
||||
.byte 0
|
||||
.word \arg
|
||||
.endm
|
||||
|
||||
.macro jump_if op, arg, target
|
||||
.byte 0x0C, 0x08 + PTR_WIDTH
|
||||
.byte \op
|
||||
.byte 0
|
||||
.word32 \arg
|
||||
.word \target
|
||||
.endm
|
||||
|
||||
.macro jump_link_if op, arg, target
|
||||
.byte 0x0D, 0x08 + PTR_WIDTH
|
||||
.byte \op
|
||||
.byte 0
|
||||
.word32 \arg
|
||||
.word \target
|
||||
.endm
|
||||
|
||||
.macro skip_if op, arg
|
||||
.byte 0x0E, 0x08
|
||||
.byte \op
|
||||
.byte 0
|
||||
.word32 \arg
|
||||
.endm
|
||||
|
||||
.macro skip
|
||||
.byte 0x0F, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro skip_nop
|
||||
.byte 0x10, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro call arg, func
|
||||
.byte 0x11, 0x04 + PTR_WIDTH
|
||||
.hword \arg
|
||||
.word \func
|
||||
.endm
|
||||
|
||||
.macro call_loop arg, func
|
||||
.byte 0x12, 0x04 + PTR_WIDTH
|
||||
.hword \arg
|
||||
.word \func
|
||||
.endm
|
||||
|
||||
.macro set_reg value
|
||||
.byte 0x13, 0x04
|
||||
.hword \value
|
||||
.endm
|
||||
|
||||
.macro push_pool
|
||||
.byte 0x14, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro pop_pool
|
||||
.byte 0x15, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro fixed_load loadAddr, romStart, romEnd
|
||||
.byte 0x16, 0x04 + 3 * PTR_WIDTH
|
||||
.hword 0
|
||||
.word \loadAddr
|
||||
.word \romStart
|
||||
.word \romEnd
|
||||
.endm
|
||||
|
||||
.macro load_raw seg, romStart, romEnd
|
||||
.byte 0x17, 0x04 + 2 * PTR_WIDTH
|
||||
.hword \seg
|
||||
.word \romStart
|
||||
.word \romEnd
|
||||
.endm
|
||||
|
||||
.macro load_mio0 seg, romStart, romEnd
|
||||
.byte 0x18, 0x04 + 2 * PTR_WIDTH
|
||||
.hword \seg
|
||||
.word \romStart
|
||||
.word \romEnd
|
||||
.endm
|
||||
|
||||
.macro load_mario_head sethead
|
||||
.byte 0x19, 0x04
|
||||
.hword \sethead
|
||||
.endm
|
||||
|
||||
.macro load_mio0_texture seg, romStart, romEnd
|
||||
.byte 0x1A, 0x04 + 2 * PTR_WIDTH
|
||||
.hword \seg
|
||||
.word \romStart
|
||||
.word \romEnd
|
||||
.endm
|
||||
|
||||
.macro init_level
|
||||
.byte 0x1B, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro clear_level
|
||||
.byte 0x1C, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro alloc_level_pool
|
||||
.byte 0x1D, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro free_level_pool
|
||||
.byte 0x1E, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro area index, geo
|
||||
.byte 0x1F, 0x04 + PTR_WIDTH
|
||||
.byte \index
|
||||
.byte 0
|
||||
.word \geo
|
||||
.endm
|
||||
|
||||
.macro end_area
|
||||
.byte 0x20, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro load_model_from_dl model, dl, layer
|
||||
.byte 0x21, 0x04 + PTR_WIDTH
|
||||
.hword (\layer << 12) | \model
|
||||
.word \dl
|
||||
.endm
|
||||
|
||||
.macro load_model_from_geo model, geo
|
||||
.byte 0x22, 0x04 + PTR_WIDTH
|
||||
.hword \model
|
||||
.word \geo
|
||||
.endm
|
||||
|
||||
.macro cmd23 model, unk4, unk8
|
||||
.byte 0x23, 0x08 + PTR_WIDTH
|
||||
.hword \model
|
||||
.word \unk4
|
||||
.float \unk8
|
||||
.endm
|
||||
|
||||
.macro object model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, acts=0x1F
|
||||
.byte 0x24, 0x14 + PTR_WIDTH
|
||||
.byte \acts
|
||||
.byte \model
|
||||
.hword \posX
|
||||
.hword \posY
|
||||
.hword \posZ
|
||||
.hword \angleX
|
||||
.hword \angleY
|
||||
.hword \angleZ
|
||||
.word32 \behParam
|
||||
.word \beh
|
||||
.endm
|
||||
|
||||
.macro mario unk3, behArg, beh
|
||||
.byte 0x25, 0x08 + PTR_WIDTH
|
||||
.byte 0
|
||||
.byte \unk3
|
||||
.word32 \behArg
|
||||
.word \beh
|
||||
.endm
|
||||
|
||||
.macro warp_node id, destLevel, destArea, destNode, unk6
|
||||
.byte 0x26, 0x08
|
||||
.byte \id, \destLevel, \destArea, \destNode
|
||||
.hword \unk6
|
||||
.endm
|
||||
|
||||
.macro painting_warp_node id, destLevel, destArea, destNode, unk6
|
||||
.byte 0x27, 0x08
|
||||
.byte \id, \destLevel, \destArea, \destNode
|
||||
.hword \unk6
|
||||
.endm
|
||||
|
||||
.macro instant_warp index, destArea, displaceX, displaceY, displaceZ
|
||||
.byte 0x28, 0x0C
|
||||
.byte \index
|
||||
.byte \destArea
|
||||
.hword \displaceX
|
||||
.hword \displaceY
|
||||
.hword \displaceZ
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro load_area area
|
||||
.byte 0x29, 0x04
|
||||
.byte \area
|
||||
.byte 0
|
||||
.endm
|
||||
|
||||
.macro cmd2A unk2
|
||||
.byte 0x2A, 0x04
|
||||
.byte \unk2
|
||||
.byte 0
|
||||
.endm
|
||||
|
||||
.macro mario_pos area, yaw, posX, posY, posZ
|
||||
.byte 0x2B, 0x0C
|
||||
.byte \area
|
||||
.byte 0
|
||||
.hword \yaw
|
||||
.hword \posX
|
||||
.hword \posY
|
||||
.hword \posZ
|
||||
.endm
|
||||
|
||||
.macro cmd2C
|
||||
.byte 0x2C, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro cmd2D
|
||||
.byte 0x2D, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro terrain terrainData
|
||||
.byte 0x2E, 0x04 + PTR_WIDTH
|
||||
.hword 0
|
||||
.word \terrainData
|
||||
.endm
|
||||
|
||||
.macro rooms surfaceRooms
|
||||
.byte 0x2F, 0x04 + PTR_WIDTH
|
||||
.hword 0
|
||||
.word \surfaceRooms
|
||||
.endm
|
||||
|
||||
.macro show_dialog unk2, unk3
|
||||
.byte 0x30, 0x04
|
||||
.byte \unk2
|
||||
.byte \unk3
|
||||
.endm
|
||||
|
||||
.macro terrain_type terrainType
|
||||
.byte 0x31, 0x04
|
||||
.hword \terrainType
|
||||
.endm
|
||||
|
||||
.macro nop
|
||||
.byte 0x32, 0x04
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro transition unk2, unk3, colorR, colorG, colorB
|
||||
.byte 0x33, 0x08
|
||||
.byte \unk2
|
||||
.byte \unk3
|
||||
.byte \colorR
|
||||
.byte \colorG
|
||||
.byte \colorB
|
||||
.byte 0
|
||||
.endm
|
||||
|
||||
.macro blackout active
|
||||
.byte 0x34, 0x04
|
||||
.byte \active
|
||||
.byte 0
|
||||
.endm
|
||||
|
||||
.macro gamma enabled
|
||||
.byte 0x35, 0x04
|
||||
.byte \enabled
|
||||
.byte 0
|
||||
.endm
|
||||
|
||||
.macro set_background_music unk2, seq
|
||||
.byte 0x36, 0x08
|
||||
.hword \unk2
|
||||
.hword \seq
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
.macro set_menu_music seq
|
||||
.byte 0x37, 0x04
|
||||
.hword \seq
|
||||
.endm
|
||||
|
||||
.macro cmd38 unk2
|
||||
.byte 0x38, 0x04
|
||||
.hword \unk2
|
||||
.endm
|
||||
|
||||
.macro macro_objects objList
|
||||
.byte 0x39, 0x04 + PTR_WIDTH
|
||||
.hword 0
|
||||
.word \objList
|
||||
.endm
|
||||
|
||||
.macro cmd3A unk2, unk4, unk6, unk8, unk10
|
||||
.byte 0x3A, 0x0C
|
||||
.hword \unk2
|
||||
.hword \unk4
|
||||
.hword \unk6
|
||||
.hword \unk8
|
||||
.hword \unk10
|
||||
.endm
|
||||
|
||||
.macro whirlpool unk2, unk3, posX, posY, posZ, strength
|
||||
.byte 0x3B, 0x0C
|
||||
.byte \unk2
|
||||
.byte \unk3
|
||||
.hword \posX
|
||||
.hword \posY
|
||||
.hword \posZ
|
||||
.hword \strength
|
||||
.endm
|
||||
|
||||
.macro get_or_set op, var
|
||||
.byte 0x3C, 0x04
|
||||
.byte \op
|
||||
.byte \var
|
||||
.endm
|
||||
|
||||
/* Head Defines */
|
||||
|
||||
.set REGULAR_FACE, 0x0002
|
||||
.set DIZZY_FACE, 0x0003
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef LEVEL_MISC_MACROS_H
|
||||
#define LEVEL_MISC_MACROS_H
|
||||
|
||||
#define MACRO_OBJECT_WITH_BEH_PARAM(preset, yaw, posX, posY, posZ, behParam) \
|
||||
(((yaw * 0x10 / 45) << 9) | (preset + 0x1F)), posX, posY, posZ, behParam
|
||||
|
||||
#define MACRO_OBJECT(preset, yaw, posX, posY, posZ) \
|
||||
MACRO_OBJECT_WITH_BEH_PARAM(preset, yaw, posX, posY, posZ, 0)
|
||||
|
||||
#define MACRO_OBJECT_END() \
|
||||
0x001E
|
||||
|
||||
#define SPECIAL_OBJECT(preset, posX, posY, posZ) \
|
||||
preset, posX, posY, posZ
|
||||
|
||||
#define SPECIAL_OBJECT_WITH_YAW(preset, posX, posY, posZ, yaw) \
|
||||
preset, posX, posY, posZ, yaw
|
||||
|
||||
#define SPECIAL_OBJECT_WITH_YAW_AND_PARAM(preset, posX, posY, posZ, yaw, param) \
|
||||
preset, posX, posY, posZ, yaw, param
|
||||
|
||||
#define TRAJECTORY_POS(trajId, x, y, z) \
|
||||
trajId, x, y, z
|
||||
|
||||
#define TRAJECTORY_END() \
|
||||
-1
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _MATH_H_
|
||||
#define _MATH_H_
|
||||
#ifndef MATH_H
|
||||
#define MATH_H
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
#ifndef _STDARG_H_
|
||||
#define _STDARG_H_
|
||||
#ifndef STDARG_H
|
||||
#define STDARG_H
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
// When building with GCC, use the official vaarg macros to avoid warnings
|
||||
// and possibly bad codegen.
|
||||
#ifdef __GNUC__
|
||||
// When not building with IDO, use the builtin vaarg macros for portability.
|
||||
#ifndef __sgi
|
||||
#define va_list __builtin_va_list
|
||||
#define va_start __builtin_va_start
|
||||
#define va_arg __builtin_va_arg
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef STDDEF_H
|
||||
#define STDDEF_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
#ifndef offsetof
|
||||
#define offsetof(st, m) ((size_t)&(((st *)0)->m))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef STDIO_H
|
||||
#define STDIO_H
|
||||
|
||||
extern int sprintf(char *s, const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _STDLIB_H_
|
||||
#define _STDLIB_H_
|
||||
#ifndef STDLIB_H
|
||||
#define STDLIB_H
|
||||
|
||||
typedef struct lldiv_t
|
||||
{
|
||||
@@ -13,7 +13,7 @@ typedef struct ldiv_t
|
||||
long rem;
|
||||
} ldiv_t;
|
||||
|
||||
lldiv_t lldiv(long long, long long);
|
||||
ldiv_t ldiv(long, long);
|
||||
lldiv_t lldiv(long long num, long long denom);
|
||||
ldiv_t ldiv(long num, long denom);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
void *memcpy(void *dst, const void *src, size_t size);
|
||||
size_t strlen(const char *str);
|
||||
char *strchr(const char *str, s32 ch);
|
||||
|
||||
#endif
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
struct MacroPreset
|
||||
{
|
||||
/*0x00*/ u32 *beh;
|
||||
/*0x00*/ const BehaviorScript *beh;
|
||||
/*0x04*/ s16 model;
|
||||
/*0x06*/ s16 param;
|
||||
};
|
||||
@@ -169,7 +169,7 @@ struct MacroPreset MacroObjectPresets[] = {
|
||||
{bhvMontyMoleHole, MODEL_DL_MONTY_MOLE_HOLE, 0},
|
||||
{bhvFlyGuy, MODEL_FLYGUY, 0},
|
||||
{bhvYellowCoin, MODEL_YELLOW_COIN, 0},
|
||||
{bhvWiggler, MODEL_WIGGLER, 0}, // unused
|
||||
{bhvWigglerHead, MODEL_WIGGLER_HEAD, 0}, // unused
|
||||
{bhvYellowCoin, MODEL_YELLOW_COIN, 0},
|
||||
{bhvYellowCoin, MODEL_YELLOW_COIN, 0},
|
||||
{bhvYellowCoin, MODEL_YELLOW_COIN, 0},
|
||||
|
||||
@@ -1,375 +0,0 @@
|
||||
# TODO: Don't do this at all, instead find a way to use the labels in hud.data.s so that changing those has an effect on these.
|
||||
|
||||
.set PRESET_ID, 0
|
||||
|
||||
.macro define_preset name
|
||||
.set \name, PRESET_ID
|
||||
.set PRESET_ID, PRESET_ID + 1
|
||||
.endm
|
||||
|
||||
define_preset macro_yellow_coin
|
||||
define_preset macro_yellow_coin_2
|
||||
define_preset macro_moving_blue_coin
|
||||
define_preset macro_sliding_blue_coin
|
||||
define_preset macro_red_coin
|
||||
define_preset macro_empty_5
|
||||
define_preset macro_coin_line_horizontal
|
||||
define_preset macro_coin_ring_horizontal
|
||||
define_preset macro_coin_arrow
|
||||
define_preset macro_coin_line_horizontal_flying
|
||||
define_preset macro_coin_line_vertical
|
||||
define_preset macro_coin_ring_horizontal_flying
|
||||
define_preset macro_coin_ring_vertical
|
||||
define_preset macro_coin_arrow_flying
|
||||
define_preset macro_hidden_star_trigger
|
||||
define_preset macro_empty_15
|
||||
define_preset macro_empty_16
|
||||
define_preset macro_empty_17
|
||||
define_preset macro_empty_18
|
||||
define_preset macro_empty_19
|
||||
define_preset macro_fake_star
|
||||
define_preset macro_wooden_signpost
|
||||
define_preset macro_cannon_closed
|
||||
define_preset macro_bobomb_buddy_opens_cannon
|
||||
define_preset macro_butterfly
|
||||
define_preset macro_bouncing_fireball_copy
|
||||
define_preset macro_fish_group_3
|
||||
define_preset macro_fish_group
|
||||
define_preset macro_unknown_28
|
||||
define_preset macro_hidden_1up_in_pole
|
||||
define_preset macro_huge_goomba
|
||||
define_preset macro_tiny_goomba
|
||||
define_preset macro_goomba_triplet_spawner
|
||||
define_preset macro_goomba_quintuplet_spawner
|
||||
define_preset macro_sign_on_wall
|
||||
define_preset macro_chuckya
|
||||
define_preset macro_cannon_open
|
||||
define_preset macro_goomba
|
||||
define_preset macro_homing_amp
|
||||
define_preset macro_circling_amp
|
||||
define_preset macro_unknown_40
|
||||
define_preset macro_unknown_41
|
||||
define_preset macro_free_bowling_ball
|
||||
define_preset macro_snufit
|
||||
define_preset macro_recovery_heart
|
||||
define_preset macro_1up_sliding
|
||||
define_preset macro_1up
|
||||
define_preset macro_1up_jump_on_approach
|
||||
define_preset macro_hidden_1up
|
||||
define_preset macro_hidden_1up_trigger
|
||||
define_preset macro_1up_2
|
||||
define_preset macro_1up_3
|
||||
define_preset macro_empty_52
|
||||
define_preset macro_blue_coin_switch
|
||||
define_preset macro_hidden_blue_coin
|
||||
define_preset macro_wing_cap_switch
|
||||
define_preset macro_metal_cap_switch
|
||||
define_preset macro_vanish_cap_switch
|
||||
define_preset macro_yellow_cap_switch
|
||||
define_preset macro_unknown_59
|
||||
define_preset macro_box_wing_cap
|
||||
define_preset macro_box_metal_cap
|
||||
define_preset macro_box_vanish_cap
|
||||
define_preset macro_box_koopa_shell
|
||||
define_preset macro_box_one_coin
|
||||
define_preset macro_box_three_coins
|
||||
define_preset macro_box_ten_coins
|
||||
define_preset macro_box_1up
|
||||
define_preset macro_box_star_1
|
||||
define_preset macro_breakable_box_no_coins
|
||||
define_preset macro_breakable_box_three_coins
|
||||
define_preset macro_pushable_metal_box
|
||||
define_preset macro_breakable_box_small
|
||||
define_preset macro_floor_switch_hidden_objects
|
||||
define_preset macro_hidden_box
|
||||
define_preset macro_hidden_object_2
|
||||
define_preset macro_hidden_object_3
|
||||
define_preset macro_breakable_box_giant
|
||||
define_preset macro_koopa_shell_underwater
|
||||
define_preset macro_box_1up_running_away
|
||||
define_preset macro_empty_80
|
||||
define_preset macro_bullet_bill_cannon
|
||||
define_preset macro_heave_ho
|
||||
define_preset macro_empty_83
|
||||
define_preset macro_thwomp
|
||||
define_preset macro_fire_spitter
|
||||
define_preset macro_fire_fly_guy
|
||||
define_preset macro_jumping_box
|
||||
define_preset macro_butterfly_triplet
|
||||
define_preset macro_butterfly_triplet_2
|
||||
define_preset macro_empty_90
|
||||
define_preset macro_empty_91
|
||||
define_preset macro_empty_92
|
||||
define_preset macro_bully
|
||||
define_preset macro_bully_2
|
||||
define_preset macro_empty_95
|
||||
define_preset macro_unknown_96
|
||||
define_preset macro_bouncing_fireball
|
||||
define_preset macro_flamethrower
|
||||
define_preset macro_empty_99
|
||||
define_preset macro_empty_100
|
||||
define_preset macro_empty_101
|
||||
define_preset macro_empty_102
|
||||
define_preset macro_empty_103
|
||||
define_preset macro_empty_104
|
||||
define_preset macro_empty_105
|
||||
define_preset macro_wooden_post
|
||||
define_preset macro_water_bomb_spawner
|
||||
define_preset macro_enemy_lakitu
|
||||
define_preset macro_bob_koopa_the_quick
|
||||
define_preset macro_koopa_race_endpoint
|
||||
define_preset macro_bobomb
|
||||
define_preset macro_water_bomb_cannon_copy
|
||||
define_preset macro_bobomb_buddy_opens_cannon_copy
|
||||
define_preset macro_water_bomb_cannon
|
||||
define_preset macro_bobomb_still
|
||||
define_preset macro_empty_116
|
||||
define_preset macro_empty_117
|
||||
define_preset macro_empty_118
|
||||
define_preset macro_empty_119
|
||||
define_preset macro_empty_120
|
||||
define_preset macro_empty_121
|
||||
define_preset macro_empty_122
|
||||
define_preset macro_unknown_123
|
||||
define_preset macro_empty_124
|
||||
define_preset macro_unagi
|
||||
define_preset macro_sushi
|
||||
define_preset macro_empty_127
|
||||
define_preset macro_empty_128
|
||||
define_preset macro_empty_129
|
||||
define_preset macro_empty_130
|
||||
define_preset macro_empty_131
|
||||
define_preset macro_empty_132
|
||||
define_preset macro_empty_133
|
||||
define_preset macro_empty_134
|
||||
define_preset macro_empty_135
|
||||
define_preset macro_empty_136
|
||||
define_preset macro_unknown_137
|
||||
define_preset macro_tornado
|
||||
define_preset macro_pokey
|
||||
define_preset macro_pokey_copy
|
||||
define_preset macro_tox_box
|
||||
define_preset macro_empty_142
|
||||
define_preset macro_empty_143
|
||||
define_preset macro_empty_144
|
||||
define_preset macro_empty_145
|
||||
define_preset macro_empty_146
|
||||
define_preset macro_empty_147
|
||||
define_preset macro_empty_148
|
||||
define_preset macro_empty_149
|
||||
define_preset macro_empty_150
|
||||
define_preset macro_monty_mole_2
|
||||
define_preset macro_monty_mole
|
||||
define_preset macro_monty_mole_hole
|
||||
define_preset macro_fly_guy
|
||||
define_preset macro_empty_155
|
||||
define_preset macro_wiggler
|
||||
define_preset macro_empty_157
|
||||
define_preset macro_empty_158
|
||||
define_preset macro_empty_159
|
||||
define_preset macro_empty_160
|
||||
define_preset macro_empty_161
|
||||
define_preset macro_empty_162
|
||||
define_preset macro_empty_163
|
||||
define_preset macro_empty_164
|
||||
define_preset macro_spindrift
|
||||
define_preset macro_mr_blizzard
|
||||
define_preset macro_mr_blizzard_copy
|
||||
define_preset macro_empty_168
|
||||
define_preset macro_small_penguin
|
||||
define_preset macro_tuxies_mother
|
||||
define_preset macro_tuxies_mother_copy
|
||||
define_preset macro_mr_blizzard_2
|
||||
define_preset macro_empty_173
|
||||
define_preset macro_empty_174
|
||||
define_preset macro_empty_175
|
||||
define_preset macro_empty_176
|
||||
define_preset macro_empty_177
|
||||
define_preset macro_empty_178
|
||||
define_preset macro_empty_179
|
||||
define_preset macro_empty_180
|
||||
define_preset macro_empty_181
|
||||
define_preset macro_empty_182
|
||||
define_preset macro_empty_183
|
||||
define_preset macro_empty_184
|
||||
define_preset macro_empty_185
|
||||
define_preset macro_empty_186
|
||||
define_preset macro_empty_187
|
||||
define_preset macro_empty_188
|
||||
define_preset macro_haunted_chair_copy
|
||||
define_preset macro_haunted_chair
|
||||
define_preset macro_haunted_chair_copy2
|
||||
define_preset macro_boo
|
||||
define_preset macro_boo_copy
|
||||
define_preset macro_boo_group
|
||||
define_preset macro_boo_with_cage
|
||||
define_preset macro_beta_key
|
||||
define_preset macro_empty_197
|
||||
define_preset macro_empty_198
|
||||
define_preset macro_empty_199
|
||||
define_preset macro_empty_200
|
||||
define_preset macro_empty_201
|
||||
define_preset macro_empty_202
|
||||
define_preset macro_empty_203
|
||||
define_preset macro_empty_204
|
||||
define_preset macro_empty_205
|
||||
define_preset macro_empty_206
|
||||
define_preset macro_empty_207
|
||||
define_preset macro_empty_208
|
||||
define_preset macro_empty_209
|
||||
define_preset macro_empty_210
|
||||
define_preset macro_empty_211
|
||||
define_preset macro_empty_212
|
||||
define_preset macro_empty_213
|
||||
define_preset macro_empty_214
|
||||
define_preset macro_empty_215
|
||||
define_preset macro_empty_216
|
||||
define_preset macro_empty_217
|
||||
define_preset macro_empty_218
|
||||
define_preset macro_empty_219
|
||||
define_preset macro_empty_220
|
||||
define_preset macro_empty_221
|
||||
define_preset macro_empty_222
|
||||
define_preset macro_empty_223
|
||||
define_preset macro_empty_224
|
||||
define_preset macro_empty_225
|
||||
define_preset macro_empty_226
|
||||
define_preset macro_empty_227
|
||||
define_preset macro_empty_228
|
||||
define_preset macro_empty_229
|
||||
define_preset macro_empty_230
|
||||
define_preset macro_empty_231
|
||||
define_preset macro_empty_232
|
||||
define_preset macro_empty_233
|
||||
define_preset macro_chirp_chirp
|
||||
define_preset macro_seaweed_bundle
|
||||
define_preset macro_beta_chest
|
||||
define_preset macro_water_mine
|
||||
define_preset macro_fish_group_4
|
||||
define_preset macro_fish_group_2
|
||||
define_preset macro_jet_stream_ring_spawner
|
||||
define_preset macro_jet_stream_ring_spawner_copy
|
||||
define_preset macro_skeeter
|
||||
define_preset macro_clam_shell
|
||||
define_preset macro_empty_244
|
||||
define_preset macro_empty_245
|
||||
define_preset macro_empty_246
|
||||
define_preset macro_empty_247
|
||||
define_preset macro_empty_248
|
||||
define_preset macro_empty_249
|
||||
define_preset macro_empty_250
|
||||
define_preset macro_ukiki
|
||||
define_preset macro_ukiki_2
|
||||
define_preset macro_piranha_plant
|
||||
define_preset macro_empty_254
|
||||
define_preset macro_whomp
|
||||
define_preset macro_chain_chomp
|
||||
define_preset macro_empty_257
|
||||
define_preset macro_koopa
|
||||
define_preset macro_koopa_shellless
|
||||
define_preset macro_wooden_post_copy
|
||||
define_preset macro_fire_piranha_plant
|
||||
define_preset macro_fire_piranha_plant_2
|
||||
define_preset macro_thi_koopa_the_quick
|
||||
define_preset macro_empty_264
|
||||
define_preset macro_empty_265
|
||||
define_preset macro_empty_266
|
||||
define_preset macro_empty_267
|
||||
define_preset macro_empty_268
|
||||
define_preset macro_empty_269
|
||||
define_preset macro_empty_270
|
||||
define_preset macro_empty_271
|
||||
define_preset macro_empty_272
|
||||
define_preset macro_empty_273
|
||||
define_preset macro_empty_274
|
||||
define_preset macro_empty_275
|
||||
define_preset macro_empty_276
|
||||
define_preset macro_empty_277
|
||||
define_preset macro_empty_278
|
||||
define_preset macro_empty_279
|
||||
define_preset macro_empty_280
|
||||
define_preset macro_moneybag
|
||||
define_preset macro_empty_282
|
||||
define_preset macro_empty_283
|
||||
define_preset macro_empty_284
|
||||
define_preset macro_empty_285
|
||||
define_preset macro_empty_286
|
||||
define_preset macro_empty_287
|
||||
define_preset macro_empty_288
|
||||
define_preset macro_swoop
|
||||
define_preset macro_swoop_2
|
||||
define_preset macro_mr_i
|
||||
define_preset macro_scuttlebug_spawner
|
||||
define_preset macro_scuttlebug
|
||||
define_preset macro_empty_294
|
||||
define_preset macro_empty_295
|
||||
define_preset macro_empty_296
|
||||
define_preset macro_empty_297
|
||||
define_preset macro_empty_298
|
||||
define_preset macro_empty_299
|
||||
define_preset macro_empty_300
|
||||
define_preset macro_empty_301
|
||||
define_preset macro_empty_302
|
||||
define_preset macro_unknown_303
|
||||
define_preset macro_empty_304
|
||||
define_preset macro_empty_305
|
||||
define_preset macro_empty_306
|
||||
define_preset macro_empty_307
|
||||
define_preset macro_empty_308
|
||||
define_preset macro_empty_309
|
||||
define_preset macro_empty_310
|
||||
define_preset macro_empty_311
|
||||
define_preset macro_empty_312
|
||||
define_preset macro_ttc_rotating_cube
|
||||
define_preset macro_ttc_rotating_prism
|
||||
define_preset macro_ttc_pendulum
|
||||
define_preset macro_ttc_large_treadmill
|
||||
define_preset macro_ttc_small_treadmill
|
||||
define_preset macro_ttc_push_block
|
||||
define_preset macro_ttc_rotating_hexagon
|
||||
define_preset macro_ttc_rotating_triangle
|
||||
define_preset macro_ttc_pit_block
|
||||
define_preset macro_ttc_pit_block_2
|
||||
define_preset macro_ttc_elevator_platform
|
||||
define_preset macro_ttc_clock_hand
|
||||
define_preset macro_ttc_spinner
|
||||
define_preset macro_ttc_small_gear
|
||||
define_preset macro_ttc_large_gear
|
||||
define_preset macro_ttc_large_treadmill_2
|
||||
define_preset macro_ttc_small_treadmill_2
|
||||
define_preset macro_empty_330
|
||||
define_preset macro_empty_331
|
||||
define_preset macro_empty_332
|
||||
define_preset macro_empty_333
|
||||
define_preset macro_empty_334
|
||||
define_preset macro_empty_335
|
||||
define_preset macro_empty_336
|
||||
define_preset macro_empty_337
|
||||
define_preset macro_empty_338
|
||||
define_preset macro_box_star_2
|
||||
define_preset macro_box_star_3
|
||||
define_preset macro_box_star_4
|
||||
define_preset macro_box_star_5
|
||||
define_preset macro_box_star_6
|
||||
define_preset macro_empty_344
|
||||
define_preset macro_empty_345
|
||||
define_preset macro_empty_346
|
||||
define_preset macro_empty_347
|
||||
define_preset macro_empty_348
|
||||
define_preset macro_empty_349
|
||||
define_preset macro_bits_sliding_platform
|
||||
define_preset macro_bits_twin_sliding_platforms
|
||||
define_preset macro_bits_unknown_352
|
||||
define_preset macro_bits_octagonal_platform
|
||||
define_preset macro_bits_staircase
|
||||
define_preset macro_empty_355
|
||||
define_preset macro_empty_356
|
||||
define_preset macro_bits_ferris_wheel_axle
|
||||
define_preset macro_bits_arrow_platform
|
||||
define_preset macro_bits_seesaw_platform
|
||||
define_preset macro_bits_tilting_w_platform
|
||||
define_preset macro_empty_361
|
||||
define_preset macro_empty_362
|
||||
define_preset macro_empty_363
|
||||
define_preset macro_empty_364
|
||||
define_preset macro_empty_365
|
||||
+16
-5
@@ -1,6 +1,8 @@
|
||||
#ifndef _MACROS_H_
|
||||
#define _MACROS_H_
|
||||
|
||||
#include "platform_info.h"
|
||||
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
#define GLUE(a, b) a ## b
|
||||
@@ -13,11 +15,6 @@
|
||||
#define UNUSED
|
||||
#endif
|
||||
|
||||
// Ignore GLOBAL_ASM blocks when syntax-checking with GCC
|
||||
#ifdef __GNUC__
|
||||
#define GLOBAL_ASM(...)
|
||||
#endif
|
||||
|
||||
// Static assertions
|
||||
#ifdef __GNUC__
|
||||
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
|
||||
@@ -25,6 +22,20 @@
|
||||
#define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
|
||||
#endif
|
||||
|
||||
// Align to 8-byte boundary for DMA requirements
|
||||
#ifdef __GNUC__
|
||||
#define ALIGNED8 __attribute__((aligned(8)))
|
||||
#else
|
||||
#define ALIGNED8
|
||||
#endif
|
||||
|
||||
// Align to 16-byte boundary for audio lib requirements
|
||||
#ifdef __GNUC__
|
||||
#define ALIGNED16 __attribute__((aligned(16)))
|
||||
#else
|
||||
#define ALIGNED16
|
||||
#endif
|
||||
|
||||
// convert a virtual address to physical.
|
||||
#define VIRTUAL_TO_PHYSICAL(addr) ((uintptr_t)(addr) & 0x1FFFFFFF)
|
||||
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
# Assembly Macros
|
||||
|
||||
.set NULL, 0
|
||||
.set FALSE, 0
|
||||
.set TRUE, 1
|
||||
|
||||
.set K0BASE, 0x80000000
|
||||
.set K1BASE, 0xA0000000
|
||||
.set K2BASE, 0xC0000000
|
||||
.set SCREEN_WIDTH, 320
|
||||
.set SCREEN_HEIGHT, 240
|
||||
.set PTR_WIDTH, 4
|
||||
|
||||
.macro glabel label
|
||||
.global \label
|
||||
@@ -20,99 +13,3 @@
|
||||
.macro .word32 x
|
||||
.word \x
|
||||
.endm
|
||||
|
||||
# F3D vertex
|
||||
.macro vertex x, y, z, u, v, r=0xFF, g=0xFF, b=0xFF, a=0xFF
|
||||
.hword \x, \y, \z, 0, \u, \v
|
||||
.byte \r, \g, \b, \a
|
||||
.endm
|
||||
|
||||
# Beginning of trajectory
|
||||
.macro trajectory_init
|
||||
.set TRAJ_ID, 0
|
||||
.endm
|
||||
|
||||
# Entry in trajectory
|
||||
.macro trajectory_pos x, y, z
|
||||
.hword TRAJ_ID, \x, \y, \z
|
||||
.set TRAJ_ID, TRAJ_ID + 1
|
||||
.endm
|
||||
|
||||
# Skips an ID (used for CCM)
|
||||
.macro trajectory_skip
|
||||
.set TRAJ_ID, TRAJ_ID + 1
|
||||
.endm
|
||||
|
||||
# End of trajectory
|
||||
.macro trajectory_end
|
||||
.hword -1
|
||||
.endm
|
||||
|
||||
.macro macro_object preset, yaw, x, y, z, bparam=0
|
||||
.hword ((\yaw * 0x10 / 45) << 9) | (\preset + 0x1F), \x, \y, \z, \bparam
|
||||
.endm
|
||||
|
||||
# General special object macro
|
||||
.macro special_object preset, posX, posY, posZ, rotY=-1, param=-1
|
||||
.if (\param != -1) && (\rotY != -1) # 11 byte
|
||||
.hword \preset, \posX, \posY, \posZ, \rotY, \param
|
||||
.endif
|
||||
.if (\param == -1) && (\rotY != -1) # 10 byte
|
||||
.hword \preset, \posX, \posY, \posZ, \rotY
|
||||
.endif
|
||||
.if (\param == -1) && (\rotY == -1) # 8 byte
|
||||
.hword \preset, \posX, \posY, \posZ
|
||||
.endif
|
||||
.endm
|
||||
|
||||
# Actor include
|
||||
.macro actor name
|
||||
.include "actors/\name\()/model.s"
|
||||
.include "actors/\name\()/collision.s"
|
||||
binid
|
||||
.endm
|
||||
|
||||
# Actor include (no binid), needed for mario bin (TODO: Better solution?)
|
||||
.macro rawactor name
|
||||
.include "actors/\name\()/model.s"
|
||||
.include "actors/\name\()/collision.s"
|
||||
.endm
|
||||
|
||||
# Actor geo include
|
||||
.macro actorgeo name
|
||||
.include "actors/\name\()/geo.s"
|
||||
.endm
|
||||
|
||||
.macro initbinid
|
||||
.set BINID, 0
|
||||
.endm
|
||||
|
||||
.macro binid
|
||||
.dword BINID
|
||||
.set BINID, BINID + 1
|
||||
.endm
|
||||
|
||||
.macro leveldata name
|
||||
.section .seg07, "a"
|
||||
.align 4
|
||||
.incbin "mio0/\name\()/leveldata.mio0"
|
||||
.align 4
|
||||
.endm
|
||||
|
||||
.macro levelscript name
|
||||
.section .level, "a"
|
||||
.include "levels/\name\()/script.s"
|
||||
.endm
|
||||
|
||||
.macro levelgeo name
|
||||
.align 4
|
||||
.include "levels/\name\()/geo.s"
|
||||
.align 4
|
||||
.endm
|
||||
|
||||
.macro dialog_entry w1, w2, w3, w4
|
||||
.word32 \w1
|
||||
.byte (\w2 >> 24), 0x00
|
||||
.hword (\w2 & 0xFFFF), (\w3 >> 16), 0x0000
|
||||
.word \w4
|
||||
.endm
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef MAKE_CONST_NONCONST_H
|
||||
#define MAKE_CONST_NONCONST_H
|
||||
|
||||
#ifdef __sgi
|
||||
// IDO sometimes puts const variables in .rodata and sometimes in .data, which breaks ordering.
|
||||
// This makes sure all variables are put into the same section (.data).
|
||||
#define const
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+13
-3
@@ -1,7 +1,17 @@
|
||||
#ifndef _MODEL_IDS_H
|
||||
#define _MODEL_IDS_H
|
||||
#define ACT_1 (1 << 0)
|
||||
#define ACT_2 (1 << 1)
|
||||
#define ACT_3 (1 << 2)
|
||||
#define ACT_4 (1 << 3)
|
||||
#define ACT_5 (1 << 4)
|
||||
#define ACT_6 (1 << 5)
|
||||
|
||||
// Don't worry about formatting here, this file should be deleted and replaced with model_ids.inc.
|
||||
// If an object is set as active for the first 5 acts only, it is treated as always active.
|
||||
// It's possible that there were only planned to be 5 acts per level early in development.
|
||||
// Hence, they added a macro so they wouldn't have to change the acts for every object.
|
||||
#define ALL_ACTS_MACRO ACT_1 | ACT_2 | ACT_3 | ACT_4 | ACT_5
|
||||
#define ALL_ACTS ACT_1 | ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6
|
||||
|
||||
#define COIN_FORMATION_FLAG_VERTICAL (1 << 0)
|
||||
#define COIN_FORMATION_FLAG_RING (1 << 1)
|
||||
@@ -389,8 +399,8 @@
|
||||
#define MODEL_ENEMY_LAKITU 0x54 // enemy_lakitu_geo
|
||||
#define MODEL_SPINY_BALL 0x55 // spiny_ball_geo
|
||||
#define MODEL_SPINY 0x56 // spiny_geo
|
||||
#define MODEL_WIGGLER 0x57 // wiggler_geo
|
||||
#define MODEL_WIGGLER_BODY_PART 0x58 // wiggler_body_part_geo
|
||||
#define MODEL_WIGGLER_HEAD 0x57 // wiggler_head_geo
|
||||
#define MODEL_WIGGLER_BODY 0x58 // wiggler_body_geo
|
||||
#define MODEL_BUBBA 0x59 // bubba_geo
|
||||
|
||||
// referenced in macro presets. Unknown usage.
|
||||
|
||||
@@ -1,576 +0,0 @@
|
||||
|
||||
# TODO: find a way to include this file in .c files.
|
||||
|
||||
|
||||
.set ACT_1, (1 << 0)
|
||||
.set ACT_2, (1 << 1)
|
||||
.set ACT_3, (1 << 2)
|
||||
.set ACT_4, (1 << 3)
|
||||
.set ACT_5, (1 << 4)
|
||||
.set ACT_6, (1 << 5)
|
||||
|
||||
# If an object is set as active for the first 5 acts only, it is treated as always active.
|
||||
# It's possible that there were only planned to be 5 acts per level early in development.
|
||||
# Hence, they added a macro so they wouldn't have to change the acts for every object.
|
||||
.set ALL_ACTS_MACRO, ACT_1 | ACT_2 | ACT_3 | ACT_4 | ACT_5
|
||||
.set ALL_ACTS, ACT_1 | ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6
|
||||
|
||||
|
||||
.set COIN_FORMATION_FLAG_VERTICAL, (1 << 0)
|
||||
.set COIN_FORMATION_FLAG_RING, (1 << 1)
|
||||
.set COIN_FORMATION_FLAG_ARROW, (1 << 2)
|
||||
.set COIN_FORMATION_FLAG_FLYING, (1 << 4)
|
||||
|
||||
|
||||
# SAME CONTENT AS model_ids.h
|
||||
|
||||
.set MODEL_NONE, 0x00
|
||||
|
||||
# Global models that are loaded for every level
|
||||
|
||||
# player IDs
|
||||
.set MODEL_MARIO, 0x01 # mario_geo
|
||||
.set MODEL_LUIGI, 0x02 # unused
|
||||
|
||||
# level geometry IDs
|
||||
.set MODEL_LEVEL_GEOMETRY_03, 0x03
|
||||
.set MODEL_LEVEL_GEOMETRY_04, 0x04
|
||||
.set MODEL_LEVEL_GEOMETRY_05, 0x05
|
||||
.set MODEL_LEVEL_GEOMETRY_06, 0x06
|
||||
.set MODEL_LEVEL_GEOMETRY_07, 0x07
|
||||
.set MODEL_LEVEL_GEOMETRY_08, 0x08
|
||||
.set MODEL_LEVEL_GEOMETRY_09, 0x09
|
||||
.set MODEL_LEVEL_GEOMETRY_0A, 0x0A
|
||||
.set MODEL_LEVEL_GEOMETRY_0B, 0x0B
|
||||
.set MODEL_LEVEL_GEOMETRY_0C, 0x0C
|
||||
.set MODEL_LEVEL_GEOMETRY_0D, 0x0D
|
||||
.set MODEL_LEVEL_GEOMETRY_0E, 0x0E
|
||||
.set MODEL_LEVEL_GEOMETRY_0F, 0x0F
|
||||
.set MODEL_LEVEL_GEOMETRY_10, 0x10
|
||||
.set MODEL_LEVEL_GEOMETRY_11, 0x11
|
||||
.set MODEL_LEVEL_GEOMETRY_12, 0x12
|
||||
.set MODEL_LEVEL_GEOMETRY_13, 0x13
|
||||
.set MODEL_LEVEL_GEOMETRY_14, 0x14
|
||||
.set MODEL_LEVEL_GEOMETRY_15, 0x15
|
||||
.set MODEL_LEVEL_GEOMETRY_16, 0x16
|
||||
|
||||
# globals
|
||||
.set MODEL_BOB_BUBBLY_TREE, 0x17 # bubbly_tree_geo
|
||||
.set MODEL_WDW_BUBBLY_TREE, 0x17 # bubbly_tree_geo
|
||||
.set MODEL_CASTLE_GROUNDS_BUBBLY_TREE, 0x17 # bubbly_tree_geo
|
||||
.set MODEL_WF_BUBBLY_TREE, 0x17 # bubbly_tree_geo
|
||||
.set MODEL_THI_BUBBLY_TREE, 0x17 # bubbly_tree_geo
|
||||
.set MODEL_COURTYARD_SPIKY_TREE, 0x18 # spiky_tree_geo
|
||||
.set MODEL_CCM_SNOW_TREE, 0x19 # snow_tree_geo
|
||||
.set MODEL_SL_SNOW_TREE, 0x19 # snow_tree_geo
|
||||
.set MODEL_UNKNOWN_TREE_1A, 0x1A # referenced in special presets, undefined
|
||||
.set MODEL_SSL_PALM_TREE, 0x1B # palm_tree_geo
|
||||
.set MODEL_CASTLE_CASTLE_DOOR_UNUSED, 0x1C # castle_door_geo - unused, original id
|
||||
.set MODEL_CASTLE_WOODEN_DOOR_UNUSED, 0x1D # wooden_door_geo - unused, original id
|
||||
.set MODEL_BBH_HAUNTED_DOOR, 0x1D # haunted_door_geo
|
||||
.set MODEL_HMC_WOODEN_DOOR, 0x1D # wooden_door_geo
|
||||
.set MODEL_UNKNOWN_DOOR_1E, 0x1E # referenced in special presets, undefined
|
||||
.set MODEL_HMC_METAL_DOOR, 0x1F # metal_door_geo
|
||||
.set MODEL_HMC_HAZY_MAZE_DOOR, 0x20 # hazy_maze_door_geo
|
||||
.set MODEL_UNKNOWN_DOOR_21, 0x21 # referenced in special presets, undefined
|
||||
.set MODEL_CASTLE_DOOR_0_STARS, 0x22 # castle_door_0_star_geo
|
||||
.set MODEL_CASTLE_DOOR_1_STAR, 0x23 # castle_door_1_star_geo
|
||||
.set MODEL_CASTLE_DOOR_3_STARS, 0x24 # castle_door_3_stars_geo
|
||||
.set MODEL_CASTLE_KEY_DOOR, 0x25 # key_door_geo
|
||||
.set MODEL_CASTLE_CASTLE_DOOR, 0x26 # castle_door_geo - used duplicate
|
||||
.set MODEL_CASTLE_GROUNDS_CASTLE_DOOR, 0x26 # castle_door_geo - used duplicate
|
||||
.set MODEL_CASTLE_WOODEN_DOOR, 0x27 # wooden_door_geo
|
||||
.set MODEL_COURTYARD_WOODEN_DOOR, 0x27 # wooden_door_geo
|
||||
.set MODEL_CCM_CABIN_DOOR, 0x27 # cabin_door_geo
|
||||
.set MODEL_UNKNOWN_DOOR_28, 0x28 # referenced in special presets, undefined
|
||||
.set MODEL_CASTLE_METAL_DOOR, 0x29 # metal_door_geo
|
||||
.set MODEL_CASTLE_GROUNDS_METAL_DOOR, 0x29 # metal_door_geo
|
||||
.set MODEL_UNKNOWN_DOOR_2A, 0x2A # referenced in special presets, undefined
|
||||
.set MODEL_UNKNOWN_DOOR_2B, 0x2B # referenced in special presets, undefined
|
||||
.set MODEL_WF_TOWER_TRAPEZOID_PLATORM, 0x2C # wf_geo_000AF8 - unused
|
||||
.set MODEL_WF_TOWER_SQUARE_PLATORM, 0x2D # wf_geo_000B10
|
||||
.set MODEL_WF_TOWER_SQUARE_PLATORM_UNUSED, 0x2E # wf_geo_000B38 - unused & duplicated
|
||||
.set MODEL_WF_TOWER_SQUARE_PLATORM_ELEVATOR, 0x2F # wf_geo_000B60 - elevator platorm
|
||||
|
||||
# level model IDs
|
||||
|
||||
# BBH
|
||||
.set MODEL_BBH_STAIRCASE_STEP, 0x35 # geo_bbh_0005B0
|
||||
.set MODEL_BBH_TILTING_FLOOR_PLATFORM, 0x36 # geo_bbh_0005C8
|
||||
.set MODEL_BBH_TUMBLING_PLATFORM, 0x37 # geo_bbh_0005E0
|
||||
.set MODEL_BBH_TUMBLING_PLATFORM_PART, 0x38 # geo_bbh_0005F8
|
||||
.set MODEL_BBH_MOVING_BOOKSHELF, 0x39 # geo_bbh_000610
|
||||
.set MODEL_BBH_MESH_ELEVATOR, 0x3A # geo_bbh_000628
|
||||
.set MODEL_BBH_MERRY_GO_ROUND, 0x3B # geo_bbh_000640
|
||||
.set MODEL_BBH_WOODEN_TOMB, 0x3C # geo_bbh_000658
|
||||
|
||||
# ccm
|
||||
.set MODEL_CCM_ROPEWAY_LIFT, 0x36 # ccm_geo_0003D0
|
||||
.set MODEL_CCM_SNOWMAN_HEAD, 0x37 # ccm_geo_00040C
|
||||
|
||||
# castle
|
||||
.set MODEL_CASTLE_BOWSER_TRAP, 0x35 # castle_geo_000F18
|
||||
.set MODEL_CASTLE_WATER_LEVEL_PILLAR, 0x36 # castle_geo_001940
|
||||
.set MODEL_CASTLE_CLOCK_MINUTE_HAND, 0x37 # castle_geo_001530
|
||||
.set MODEL_CASTLE_CLOCK_HOUR_HAND, 0x38 # castle_geo_001548
|
||||
.set MODEL_CASTLE_CLOCK_PENDULUM, 0x39 # castle_geo_001518
|
||||
|
||||
# hmc
|
||||
.set MODEL_HMC_METAL_PLATFORM, 0x36 # hmc_geo_0005A0
|
||||
.set MODEL_HMC_METAL_ARROW_PLATFORM, 0x37 # hmc_geo_0005B8
|
||||
.set MODEL_HMC_ELEVATOR_PLATFORM, 0x38 # hmc_geo_0005D0
|
||||
.set MODEL_HMC_ROLLING_ROCK, 0x39 # hmc_geo_000548
|
||||
.set MODEL_HMC_ROCK_PIECE, 0x3A # hmc_geo_000570 - unused
|
||||
.set MODEL_HMC_ROCK_SMALL_PIECE, 0x3B # hmc_geo_000588 - unused
|
||||
.set MODEL_HMC_RED_GRILLS, 0x3C # hmc_geo_000530
|
||||
|
||||
# ssl
|
||||
.set MODEL_SSL_PYRAMID_TOP, 0x3A # ssl_geo_000618
|
||||
.set MODEL_SSL_GRINDEL, 0x36 # ssl_geo_000734
|
||||
.set MODEL_SSL_SPINDEL, 0x37 # ssl_geo_000764
|
||||
.set MODEL_SSL_MOVING_PYRAMID_WALL, 0x38 # ssl_geo_000794
|
||||
.set MODEL_SSL_PYRAMID_ELEVATOR, 0x39 # ssl_geo_0007AC
|
||||
|
||||
# bob
|
||||
.set MODEL_BOB_CHAIN_CHOMP_GATE, 0x36 # bob_geo_000440
|
||||
.set MODEL_BOB_SEESAW_PLATFORM, 0x37 # bob_geo_000458
|
||||
.set MODEL_BOB_BARS_GRILLS, 0x38 # bob_geo_000470
|
||||
|
||||
# sl
|
||||
.set MODEL_SL_SNOW_TRIANGLE, 0x36 # sl_geo_000390
|
||||
.set MODEL_SL_CRACKED_ICE, 0x37 # sl_geo_000360 - unused
|
||||
.set MODEL_SL_CRACKED_ICE_CHUNK, 0x38 # sl_geo_000378 - unused
|
||||
|
||||
# wdw
|
||||
.set MODEL_WDW_SQUARE_FLOATING_PLATFORM, 0x36 # wdw_geo_000580
|
||||
.set MODEL_WDW_ARROW_LIFT, 0x37 # wdw_geo_000598
|
||||
.set MODEL_WDW_WATER_LEVEL_DIAMOND, 0x38 # wdw_geo_0005C0
|
||||
.set MODEL_WDW_HIDDEN_PLATFORM, 0x39 # wdw_geo_0005E8
|
||||
.set MODEL_WDW_EXPRESS_ELEVATOR, 0x3A # wdw_geo_000610
|
||||
.set MODEL_WDW_RECTANGULAR_FLOATING_PLATFORM, 0x3B # wdw_geo_000628
|
||||
.set MODEL_WDW_ROTATING_PLATFORM, 0x3C # wdw_geo_000640
|
||||
|
||||
# jrb
|
||||
.set MODEL_JRB_SHIP_LEFT_HALF_PART, 0x35 # jrb_geo_000978
|
||||
.set MODEL_JRB_SHIP_BACK_LEFT_PART, 0x36 # jrb_geo_0009B0
|
||||
.set MODEL_JRB_SHIP_RIGHT_HALF_PART, 0x37 # jrb_geo_0009E8
|
||||
.set MODEL_JRB_SHIP_BACK_RIGHT_PART, 0x38 # jrb_geo_000A00
|
||||
.set MODEL_JRB_SUNKEN_SHIP, 0x39 # jrb_geo_000990
|
||||
.set MODEL_JRB_SUNKEN_SHIP_BACK, 0x3A # jrb_geo_0009C8
|
||||
.set MODEL_JRB_ROCK, 0x3B # jrb_geo_000930
|
||||
.set MODEL_JRB_SLIDING_BOX, 0x3C # jrb_geo_000960
|
||||
.set MODEL_JRB_FALLING_PILLAR, 0x3D # jrb_geo_000900
|
||||
.set MODEL_JRB_FALLING_PILLAR_BASE, 0x3E # jrb_geo_000918
|
||||
.set MODEL_JRB_FLOATING_PLATFORM, 0x3F # jrb_geo_000948
|
||||
|
||||
# thi
|
||||
.set MODEL_THI_HUGE_ISLAND_TOP, 0x36 # thi_geo_0005B0
|
||||
.set MODEL_THI_TINY_ISLAND_TOP, 0x37 # thi_geo_0005C8
|
||||
|
||||
# ttc
|
||||
.set MODEL_TTC_ROTATING_CUBE, 0x36 # ttc_geo_000240
|
||||
.set MODEL_TTC_ROTATING_PRISM, 0x37 # ttc_geo_000258
|
||||
.set MODEL_TTC_PENDULUM, 0x38 # ttc_geo_000270
|
||||
.set MODEL_TTC_LARGE_TREADMILL, 0x39 # ttc_geo_000288
|
||||
.set MODEL_TTC_SMALL_TREADMILL, 0x3A # ttc_geo_0002A8
|
||||
.set MODEL_TTC_PUSH_BLOCK, 0x3B # ttc_geo_0002C8
|
||||
.set MODEL_TTC_ROTATING_HEXAGON, 0x3C # ttc_geo_0002E0
|
||||
.set MODEL_TTC_ROTATING_TRIANGLE, 0x3D # ttc_geo_0002F8
|
||||
.set MODEL_TTC_PIT_BLOCK, 0x3E # ttc_geo_000310 - has 2 vertical stripes
|
||||
.set MODEL_TTC_PIT_BLOCK_UNUSED, 0x3F # ttc_geo_000328 - has 3 vertical stripes, unused
|
||||
.set MODEL_TTC_ELEVATOR_PLATFORM, 0x40 # ttc_geo_000340
|
||||
.set MODEL_TTC_CLOCK_HAND, 0x41 # ttc_geo_000358
|
||||
.set MODEL_TTC_SPINNER, 0x42 # ttc_geo_000370
|
||||
.set MODEL_TTC_SMALL_GEAR, 0x43 # ttc_geo_000388
|
||||
.set MODEL_TTC_LARGE_GEAR, 0x44 # ttc_geo_0003A0
|
||||
|
||||
# rr
|
||||
.set MODEL_RR_SLIDING_PLATFORM, 0x36 # rr_geo_0008C0
|
||||
.set MODEL_RR_FLYING_CARPET, 0x37 # rr_geo_000848
|
||||
.set MODEL_RR_OCTAGONAL_PLATFORM, 0x38 # rr_geo_0008A8
|
||||
.set MODEL_RR_ROTATING_BRIDGE_PLATFORM, 0x39 # rr_geo_000878
|
||||
.set MODEL_RR_TRIANGLE_PLATFORM, 0x3A # rr_geo_0008D8 - unused
|
||||
.set MODEL_RR_CRUISER_WING, 0x3B # rr_geo_000890
|
||||
.set MODEL_RR_SEESAW_PLATFORM, 0x3C # rr_geo_000908
|
||||
.set MODEL_RR_L_SHAPED_PLATFORM, 0x3D # rr_geo_000940 - unused
|
||||
.set MODEL_RR_SWINGING_PLATFORM, 0x3E # rr_geo_000860
|
||||
.set MODEL_RR_DONUT_PLATFORM, 0x3F # rr_geo_000920
|
||||
.set MODEL_RR_ELEVATOR_PLATFORM, 0x40 # rr_geo_0008F0
|
||||
.set MODEL_RR_TRICKY_TRIANGLES, 0x41 # rr_geo_000958
|
||||
.set MODEL_RR_TRICKY_TRIANGLES_FRAME1, 0x42 # rr_geo_000970
|
||||
.set MODEL_RR_TRICKY_TRIANGLES_FRAME2, 0x43 # rr_geo_000988
|
||||
.set MODEL_RR_TRICKY_TRIANGLES_FRAME3, 0x44 # rr_geo_0009A0
|
||||
.set MODEL_RR_TRICKY_TRIANGLES_FRAME4, 0x45 # rr_geo_0009B8
|
||||
|
||||
# bitdw
|
||||
.set MODEL_BITDW_SQUARE_PLATFORM, 0x36 # geo_bitdw_000558
|
||||
.set MODEL_BITDW_SEESAW_PLATFORM, 0x37 # geo_bitdw_000540
|
||||
.set MODEL_BITDW_SLIDING_PLATFORM, 0x38 # geo_bitdw_000528
|
||||
.set MODEL_BITDW_FERRIS_WHEEL_AXLE, 0x39 # geo_bitdw_000570
|
||||
.set MODEL_BITDW_BLUE_PLATFORM, 0x3A # geo_bitdw_000588
|
||||
.set MODEL_BITDW_STAIRCASE_FRAME4, 0x3B # geo_bitdw_0005A0
|
||||
.set MODEL_BITDW_STAIRCASE_FRAME3, 0x3C # geo_bitdw_0005B8
|
||||
.set MODEL_BITDW_STAIRCASE_FRAME2, 0x3D # geo_bitdw_0005D0
|
||||
.set MODEL_BITDW_STAIRCASE_FRAME1, 0x3E # geo_bitdw_0005E8
|
||||
.set MODEL_BITDW_STAIRCASE, 0x3F # geo_bitdw_000600
|
||||
|
||||
# vcutm
|
||||
.set MODEL_VCUTM_SEESAW_PLATFORM, 0x36 # vcutm_geo_0001F0
|
||||
.set MODEL_VCUTM_CHECKERBOARD_PLATFORM_SPAWNER, 0x37 #! this object doesn't have a geo associated with it, yet is placed in vcutm.
|
||||
# This causes a crash when the player quickly looks towards the
|
||||
# checkerboard platforms after spawning but before it is unloaded.
|
||||
|
||||
# bitfs
|
||||
.set MODEL_BITFS_PLATFORM_ON_TRACK, 0x36 # bitfs_geo_000758
|
||||
.set MODEL_BITFS_TILTING_SQUARE_PLATFORM, 0x37 # bitfs_geo_0006C0
|
||||
.set MODEL_BITFS_SINKING_PLATFORMS, 0x38 # bitfs_geo_000770
|
||||
.set MODEL_BITFS_BLUE_POLE, 0x39 # bitfs_geo_0006A8
|
||||
.set MODEL_BITFS_SINKING_CAGE_PLATFORM, 0x3A # bitfs_geo_000690
|
||||
.set MODEL_BITFS_ELEVATOR, 0x3B # bitfs_geo_000678
|
||||
.set MODEL_BITFS_STRETCHING_PLATFORMS, 0x3C # bitfs_geo_000708
|
||||
.set MODEL_BITFS_SEESAW_PLATFORM, 0x3D # bitfs_geo_000788
|
||||
.set MODEL_BITFS_MOVING_SQUARE_PLATFORM, 0x3E # bitfs_geo_000728
|
||||
.set MODEL_BITFS_SLIDING_PLATFORM, 0x3F # bitfs_geo_000740
|
||||
.set MODEL_BITFS_TUMBLING_PLATFORM_PART, 0x40 # bitfs_geo_0006D8
|
||||
.set MODEL_BITFS_TUMBLING_PLATFORM, 0x41 # bitfs_geo_0006F0
|
||||
|
||||
# bits
|
||||
.set MODEL_BITS_SLIDING_PLATFORM, 0x36 # bits_geo_0005E0
|
||||
.set MODEL_BITS_TWIN_SLIDING_PLATFORMS, 0x37 # bits_geo_0005F8
|
||||
.set MODEL_BITS_OCTAGONAL_PLATFORM, 0x39 # bits_geo_000610
|
||||
.set MODEL_BITS_BLUE_PLATFORM, 0x3C # bits_geo_000628
|
||||
.set MODEL_BITS_FERRIS_WHEEL_AXLE, 0x3D # bits_geo_000640
|
||||
.set MODEL_BITS_ARROW_PLATFORM, 0x3E # bits_geo_000658
|
||||
.set MODEL_BITS_SEESAW_PLATFORM, 0x3F # bits_geo_000670
|
||||
.set MODEL_BITS_TILTING_W_PLATFORM, 0x40 # bits_geo_000688
|
||||
.set MODEL_BITS_STAIRCASE, 0x41 # bits_geo_0006A0
|
||||
.set MODEL_BITS_STAIRCASE_FRAME1, 0x42 # bits_geo_0006B8
|
||||
.set MODEL_BITS_STAIRCASE_FRAME2, 0x43 # bits_geo_0006D0
|
||||
.set MODEL_BITS_STAIRCASE_FRAME3, 0x44 # bits_geo_0006E8
|
||||
.set MODEL_BITS_STAIRCASE_FRAME4, 0x45 # bits_geo_000700
|
||||
.set MODEL_BITS_WARP_PIPE, 0x49 # warp_pipe_geo
|
||||
|
||||
# lll
|
||||
.set MODEL_LLL_DRAWBRIDGE_PART, 0x38 # lll_geo_000B20
|
||||
.set MODEL_LLL_ROTATING_BLOCK_FIRE_BARS, 0x3A # lll_geo_000B38
|
||||
.set MODEL_LLL_ROTATING_HEXAGONAL_RING, 0x3E # lll_geo_000BB0
|
||||
.set MODEL_LLL_SINKING_RECTANGULAR_PLATFORM, 0x3F # lll_geo_000BC8
|
||||
.set MODEL_LLL_SINKING_SQUARE_PLATFORMS, 0x40 # lll_geo_000BE0
|
||||
.set MODEL_LLL_TILTING_SQUARE_PLATFORM, 0x41 # lll_geo_000BF8
|
||||
.set MODEL_LLL_BOWSER_PIECE_1, 0x43 # lll_geo_000C10
|
||||
.set MODEL_LLL_BOWSER_PIECE_2, 0x44 # lll_geo_000C30
|
||||
.set MODEL_LLL_BOWSER_PIECE_3, 0x45 # lll_geo_000C50
|
||||
.set MODEL_LLL_BOWSER_PIECE_4, 0x46 # lll_geo_000C70
|
||||
.set MODEL_LLL_BOWSER_PIECE_5, 0x47 # lll_geo_000C90
|
||||
.set MODEL_LLL_BOWSER_PIECE_6, 0x48 # lll_geo_000CB0
|
||||
.set MODEL_LLL_BOWSER_PIECE_7, 0x49 # lll_geo_000CD0
|
||||
.set MODEL_LLL_BOWSER_PIECE_8, 0x4A # lll_geo_000CF0
|
||||
.set MODEL_LLL_BOWSER_PIECE_9, 0x4B # lll_geo_000D10
|
||||
.set MODEL_LLL_BOWSER_PIECE_10, 0x4C # lll_geo_000D30
|
||||
.set MODEL_LLL_BOWSER_PIECE_11, 0x4D # lll_geo_000D50
|
||||
.set MODEL_LLL_BOWSER_PIECE_12, 0x4E # lll_geo_000D70
|
||||
.set MODEL_LLL_BOWSER_PIECE_13, 0x4F # lll_geo_000D90
|
||||
.set MODEL_LLL_BOWSER_PIECE_14, 0x50 # lll_geo_000DB0
|
||||
.set MODEL_LLL_MOVING_OCTAGONAL_MESH_PLATFORM, 0x36 # lll_geo_000B08
|
||||
.set MODEL_LLL_SINKING_ROCK_BLOCK, 0x37 # lll_geo_000DD0
|
||||
.set MODEL_LLL_ROLLING_LOG, 0x39 # lll_geo_000DE8
|
||||
.set MODEL_LLL_WOOD_BRIDGE, 0x35 # lll_geo_000B50
|
||||
.set MODEL_LLL_LARGE_WOOD_BRIDGE, 0x3B # lll_geo_000B68
|
||||
.set MODEL_LLL_FALLING_PLATFORM, 0x3C # lll_geo_000B80
|
||||
.set MODEL_LLL_LARGE_FALLING_PLATFORM, 0x3D # lll_geo_000B98
|
||||
.set MODEL_LLL_VOLCANO_FALLING_TRAP, 0x53 # lll_geo_000EA8
|
||||
|
||||
# ddd
|
||||
.set MODEL_DDD_BOWSER_SUB_DOOR, 0x36 # ddd_geo_000478
|
||||
.set MODEL_DDD_BOWSER_SUB, 0x37 # ddd_geo_0004A0
|
||||
.set MODEL_DDD_POLE, 0x38 # ddd_geo_000450
|
||||
|
||||
# wf
|
||||
.set MODEL_WF_BREAKABLE_WALL_RIGHT, 0x36 # wf_geo_000B78
|
||||
.set MODEL_WF_BREAKABLE_WALL_LEFT, 0x37 # wf_geo_000B90
|
||||
.set MODEL_WF_KICKABLE_BOARD, 0x38 # wf_geo_000BA8
|
||||
.set MODEL_WF_TOWER_DOOR, 0x39 # wf_geo_000BE0
|
||||
.set MODEL_WF_KICKABLE_BOARD_FELLED, 0x3A # wf_geo_000BC8
|
||||
|
||||
# castle grounds
|
||||
.set MODEL_CASTLE_GROUNDS_VCUTM_GRILL, 0x36 # castle_grounds_geo_00070C
|
||||
.set MODEL_CASTLE_GROUNDS_FLAG, 0x37 # castle_grounds_geo_000660
|
||||
.set MODEL_CASTLE_GROUNDS_CANNON_GRILL, 0x38 # castle_grounds_geo_000724
|
||||
|
||||
# bowser 2
|
||||
.set MODEL_BOWSER_2_TILTING_ARENA, 0x36 # bowser_2_geo_000170
|
||||
|
||||
# bowser 3
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_1, 0x36 # bowser_3_geo_000290
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_2, 0x37 # bowser_3_geo_0002A8
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_3, 0x38 # bowser_3_geo_0002C0
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_4, 0x39 # bowser_3_geo_0002D8
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_5, 0x3A # bowser_3_geo_0002F0
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_6, 0x3B # bowser_3_geo_000308
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_7, 0x3C # bowser_3_geo_000320
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_8, 0x3D # bowser_3_geo_000338
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_9, 0x3E # bowser_3_geo_000350
|
||||
.set MODEL_BOWSER_3_FALLING_PLATFORM_10, 0x3F # bowser_3_geo_000368
|
||||
|
||||
# ttm
|
||||
.set MODEL_TTM_ROLLING_LOG, 0x35 # ttm_geo_000730
|
||||
.set MODEL_TTM_STAR_CAGE, 0x36 # ttm_geo_000710
|
||||
.set MODEL_TTM_BLUE_SMILEY, 0x37 # ttm_geo_000D14
|
||||
.set MODEL_TTM_YELLOW_SMILEY, 0x38 # ttm_geo_000D4C
|
||||
.set MODEL_TTM_STAR_SMILEY, 0x39 # ttm_geo_000D84
|
||||
.set MODEL_TTM_MOON_SMILEY, 0x3A # ttm_geo_000DBC
|
||||
|
||||
# actor model IDs
|
||||
|
||||
# first set of actor bins (0x54-0x63)
|
||||
# group 1
|
||||
.set MODEL_BULLET_BILL, 0x54 # bullet_bill_geo
|
||||
.set MODEL_YELLOW_SPHERE, 0x55 # yellow_sphere_geo
|
||||
.set MODEL_HOOT, 0x56 # hoot_geo
|
||||
.set MODEL_YOSHI_EGG, 0x57 # yoshi_egg_geo
|
||||
.set MODEL_THWOMP, 0x58 # thwomp_geo
|
||||
.set MODEL_HEAVE_HO, 0x59 # heave_ho_geo
|
||||
|
||||
# group 2
|
||||
.set MODEL_BLARGG, 0x54 # blargg_geo
|
||||
.set MODEL_BULLY, 0x56 # bully_geo
|
||||
.set MODEL_BULLY_BOSS, 0x57 # bully_boss_geo
|
||||
|
||||
# group 3
|
||||
.set MODEL_WATER_BOMB, 0x54 # water_bomb_geo
|
||||
.set MODEL_WATER_BOMB_SHADOW, 0x55 # water_bomb_shadow_geo
|
||||
.set MODEL_KING_BOBOMB, 0x56 # king_bobomb_geo
|
||||
|
||||
# group 4
|
||||
.set MODEL_MANTA_RAY, 0x54 # manta_seg5_geo_05008D14
|
||||
.set MODEL_UNAGI, 0x55 # unagi_geo
|
||||
.set MODEL_SUSHI, 0x56 # sushi_geo
|
||||
.set MODEL_DL_WHIRLPOOL, 0x57 # whirlpool_seg5_dl_05013CB8
|
||||
.set MODEL_CLAM_SHELL, 0x58 # clam_shell_geo
|
||||
|
||||
# group 5
|
||||
.set MODEL_POKEY_HEAD, 0x54 # pokey_head_geo
|
||||
.set MODEL_POKEY_BODY_PART, 0x55 # pokey_body_part_geo
|
||||
.set MODEL_TORNADO, 0x56 # tornado_seg5_geo_05014630
|
||||
.set MODEL_KLEPTO, 0x57 # klepto_geo
|
||||
.set MODEL_EYEROK_LEFT_HAND, 0x58 # eyerok_left_hand_geo
|
||||
.set MODEL_EYEROK_RIGHT_HAND, 0x59 # eyerok_right_hand_geo
|
||||
|
||||
# group 6
|
||||
.set MODEL_DL_MONTY_MOLE_HOLE, 0x54 # monty_mole_hole_seg5_dl_05000840
|
||||
.set MODEL_MONTY_MOLE, 0x55 # monty_mole_geo
|
||||
.set MODEL_UKIKI, 0x56 # ukiki_geo
|
||||
.set MODEL_FWOOSH, 0x57 # fwoosh_geo
|
||||
|
||||
# group 7
|
||||
.set MODEL_SPINDRIFT, 0x54 # spindrift_geo
|
||||
.set MODEL_MR_BLIZZARD_HIDDEN, 0x55 # mr_blizzard_hidden_geo
|
||||
.set MODEL_MR_BLIZZARD, 0x56 # mr_blizzard_geo
|
||||
.set MODEL_PENGUIN, 0x57 # penguin_geo
|
||||
|
||||
# group 8
|
||||
.set MODEL_CAP_SWITCH_EXCLAMATION, 0x54 # cap_switch_exclamation_seg5_dl_05002E00
|
||||
.set MODEL_CAP_SWITCH, 0x55 # cap_switch_geo
|
||||
.set MODEL_CAP_SWITCH_BASE, 0x56 # cap_switch_base_seg5_dl_05003120
|
||||
|
||||
# group 9
|
||||
.set MODEL_BOO, 0x54 # boo_geo
|
||||
.set MODEL_BETA_BOO_KEY, 0x55 # small_key_geo
|
||||
.set MODEL_HAUNTED_CHAIR, 0x56 # haunted_chair_geo
|
||||
.set MODEL_MAD_PIANO, 0x57 # mad_piano_geo
|
||||
.set MODEL_BOOKEND_PART, 0x58 # bookend_part_geo
|
||||
.set MODEL_BOOKEND, 0x59 # bookend_geo
|
||||
.set MODEL_HAUNTED_CAGE, 0x5A # haunted_cage_geo
|
||||
|
||||
# group 10
|
||||
.set MODEL_BIRDS, 0x54 # birds_geo
|
||||
.set MODEL_YOSHI, 0x55 # yoshi_geo
|
||||
|
||||
# group 11
|
||||
.set MODEL_ENEMY_LAKITU, 0x54 # enemy_lakitu_geo
|
||||
.set MODEL_SPINY_BALL, 0x55 # spiny_ball_geo
|
||||
.set MODEL_SPINY, 0x56 # spiny_geo
|
||||
.set MODEL_WIGGLER, 0x57 # wiggler_geo
|
||||
.set MODEL_WIGGLER_BODY_PART, 0x58 # wiggler_body_part_geo
|
||||
.set MODEL_BUBBA, 0x59 # bubba_geo
|
||||
|
||||
# referenced in macro presets. Unknown usage.
|
||||
.set MODEL_UNKNOWN_54, 0x54
|
||||
.set MODEL_UNKNOWN_58, 0x58
|
||||
|
||||
# second set of actor bins, (0x64-0x73)
|
||||
# group 12
|
||||
.set MODEL_BOWSER, 0x64 # bowser_geo - 2nd geo loaded is bowser_geo_000424, starts with shadow command
|
||||
.set MODEL_BOWSER_BOMB_CHILD_OBJ, 0x65 # bowser_bomb_geo - Spawns as a chill object in bowser's behavior command, causing an explosion if it touches a bomb
|
||||
.set MODEL_BOWSER_SMOKE, 0x66 # bowser_impact_smoke_geo
|
||||
.set MODEL_BOWSER_FLAMES, 0x67 # bowser_flames_geo
|
||||
.set MODEL_BOWSER_WAVE, 0x68 # invisible_bowser_accessory_geo
|
||||
.set MODEL_BOWSER2, 0x69 # bowser2_geo - 2nd geo loaded is bowser_geo_000770, starts with node command, only difference
|
||||
|
||||
# group 13
|
||||
.set MODEL_BUB, 0x64 # bub_geo
|
||||
.set MODEL_TREASURE_CHEST_BASE, 0x65 # treasure_chest_base_geo
|
||||
.set MODEL_TREASURE_CHEST_LID, 0x66 # treasure_chest_lid_geo
|
||||
.set MODEL_CYAN_FISH, 0x67 # cyan_fish_geo
|
||||
.set MODEL_WATER_RING, 0x68 # water_ring_geo
|
||||
.set MODEL_SKEETER, 0x69 # skeeter_geo
|
||||
|
||||
# group 14
|
||||
.set MODEL_PIRANHA_PLANT, 0x64 # piranha_plant_geo
|
||||
.set MODEL_WHOMP, 0x67 # whomp_geo
|
||||
.set MODEL_KOOPA_WITH_SHELL, 0x68 # koopa_with_shell_geo
|
||||
.set MODEL_METALLIC_BALL, 0x65 # metallic_ball_geo
|
||||
.set MODEL_CHAIN_CHOMP, 0x66 # chain_chomp
|
||||
.set MODEL_KOOPA_FLAG, 0x6A # koopa_flag_geo
|
||||
.set MODEL_WOODEN_POST, 0x6B # wooden_post_geo
|
||||
|
||||
# group 15
|
||||
.set MODEL_MIPS, 0x64 # mips_geo
|
||||
.set MODEL_BOO_CASTLE, 0x65 # boo_castle_geo
|
||||
.set MODEL_LAKITU, 0x66 # lakitu_geo
|
||||
|
||||
# group 16
|
||||
.set MODEL_CHILL_BULLY, 0x64 # chilly_chief_geo
|
||||
.set MODEL_BIG_CHILL_BULLY, 0x65 # chilly_chief_big_geo
|
||||
.set MODEL_MONEYBAG, 0x66 # moneybag_geo
|
||||
|
||||
# group 17
|
||||
.set MODEL_SWOOP, 0x64 # swoop_geo
|
||||
.set MODEL_SCUTTLEBUG, 0x65 # scuttlebug_geo
|
||||
.set MODEL_MR_I_IRIS, 0x66 # mr_i_iris_geo
|
||||
.set MODEL_MR_I, 0x67 # mr_i_geo
|
||||
.set MODEL_DORRIE, 0x68 # dorrie_geo
|
||||
|
||||
# shared models are (0x30 - 0x53 and 0x54 - 0x73) and are below the list.
|
||||
.set MODEL_YELLOW_COIN, 0x74 # yellow_coin_geo
|
||||
.set MODEL_YELLOW_COIN_NO_SHADOW, 0x75 # yellow_coin_no_shadow_geo
|
||||
.set MODEL_BLUE_COIN, 0x76 # blue_coin_geo
|
||||
.set MODEL_BLUE_COIN_NO_SHADOW, 0x77 # blue_coin_no_shadow_geo
|
||||
.set MODEL_HEART, 0x78 # heart_geo
|
||||
.set MODEL_TRANSPARENT_STAR, 0x79 # transparent_star_geo
|
||||
.set MODEL_STAR, 0x7A # star_geo
|
||||
.set MODEL_TTM_SLIDE_EXIT_PODIUM, 0x7B # ttm_geo_000DF4
|
||||
.set MODEL_WOODEN_SIGNPOST, 0x7C # wooden_signpost_geo
|
||||
.set MODEL_UNKNOWN_7D, 0x7D # referenced in macro presets. Unknown usage
|
||||
# find me
|
||||
.set MODEL_CANNON_BARREL, 0x7F # cannon_barrel_geo
|
||||
.set MODEL_CANNON_BASE, 0x80 # cannon_base_geo
|
||||
.set MODEL_BREAKABLE_BOX, 0x81 # breakable_box_geo
|
||||
.set MODEL_BREAKABLE_BOX_SMALL, 0x82 # breakable_box_small_geo
|
||||
.set MODEL_EXCLAMATION_BOX_OUTLINE, 0x83 # exclamation_box_outline_geo
|
||||
.set MODEL_EXCLAMATION_POINT, 0x84 # exclamation_point_seg8_dl_08025F08
|
||||
.set MODEL_MARIOS_WINGED_METAL_CAP, 0x85 # marios_winged_metal_cap_geo
|
||||
.set MODEL_MARIOS_METAL_CAP, 0x86 # marios_metal_cap_geo
|
||||
.set MODEL_MARIOS_WING_CAP, 0x87 # marios_wing_cap_geo
|
||||
.set MODEL_MARIOS_CAP, 0x88 # marios_cap_geo
|
||||
.set MODEL_EXCLAMATION_BOX, 0x89 # exclamation_box_geo
|
||||
.set MODEL_DIRT_ANIMATION, 0x8A # dirt_animation_geo
|
||||
.set MODEL_CARTOON_STAR, 0x8B # cartoon_star_geo
|
||||
.set MODEL_BLUE_COIN_SWITCH, 0x8C # blue_coin_switch_geo
|
||||
# find me
|
||||
.set MODEL_MIST, 0x8E # mist_geo
|
||||
.set MODEL_SPARKLES_ANIMATION, 0x8F # sparkles_animation_geo
|
||||
.set MODEL_RED_FLAME, 0x90 # red_flame_geo
|
||||
.set MODEL_BLUE_FLAME, 0x91 # blue_flame_geo
|
||||
# find me
|
||||
# find me
|
||||
.set MODEL_BURN_SMOKE, 0x94 # burn_smoke_geo
|
||||
.set MODEL_SPARKLES, 0x95 # sparkles_geo
|
||||
.set MODEL_SMOKE, 0x96 # smoke_geo
|
||||
# find me
|
||||
# find me
|
||||
# find me
|
||||
# find me
|
||||
# find me
|
||||
.set MODEL_BURN_SMOKE_UNUSED, 0x9C # burn_smoke_geo - unused & duplicated
|
||||
# find me
|
||||
.set MODEL_WHITE_PARTICLE_DL, 0x9E # white_particle_dl
|
||||
.set MODEL_SAND_DUST, 0x9F # sand_seg3_dl_0302BCD0
|
||||
.set MODEL_WHITE_PARTICLE, 0xA0 # white_particle_geo
|
||||
.set MODEL_PEBBLE, 0xA1 # pebble_seg3_dl_0301CB00
|
||||
.set MODEL_LEAVES, 0xA2 # leaves_geo
|
||||
.set MODEL_WATER_WAVES, 0xA3 # water_waves_geo
|
||||
.set MODEL_WHITE_PARTICLE_SMALL, 0xA4 # white_particle_small_dl
|
||||
.set MODEL_SPOT_ON_GROUND, 0xA5 # spot_on_ground_geo
|
||||
.set MODEL_WATER_WAVES_SURF, 0xA6 # water_waves_surface_geo
|
||||
.set MODEL_WATER_SPLASH, 0xA7 # water_splash_geo
|
||||
.set MODEL_BUBBLE, 0xA8 # bubble_geo
|
||||
# find me
|
||||
.set MODEL_PURPLE_MARBLE, 0xAA # purple_marble_geo
|
||||
# find me
|
||||
.set MODEL_WF_SLIDING_PLATFORM, 0xAD # wf_geo_000A98
|
||||
.set MODEL_WF_SMALL_BOMP, 0xAE # wf_geo_000A00
|
||||
.set MODEL_WF_ROTATING_WOODEN_PLATFORM, 0xAF # wf_geo_000A58
|
||||
.set MODEL_WF_TUMBLING_BRIDGE_PART, 0xB0 # wf_geo_000AB0
|
||||
.set MODEL_WF_LARGE_BOMP, 0xB1 # wf_geo_000A40
|
||||
.set MODEL_WF_TUMBLING_BRIDGE, 0xB2 # wf_geo_000AC8
|
||||
.set MODEL_BOWSER_BOMB, 0xB3 # bowser_bomb_geo
|
||||
.set MODEL_WATER_MINE, 0xB3 # water_mine_geo
|
||||
.set MODEL_BOWLING_BALL, 0xB4 # bowling_ball_geo
|
||||
.set MODEL_TRAMPOLINE, 0xB5 # springboard_top_geo (unused)
|
||||
.set MODEL_TRAMPOLINE_CENTER, 0xB6 # springboard_spring_geo (unused)
|
||||
.set MODEL_TRAMPOLINE_BASE, 0xB7 # springboard_bottom_geo (unused)
|
||||
.set MODEL_UNKNOWN_B8, 0xB8 # referenced in special presets as a static object. Unknown usage
|
||||
.set MODEL_FISH, 0xB9 # fish_geo - fish without shadow, used
|
||||
.set MODEL_FISH_SHADOW, 0xBA # fish_shadow_geo - fish with shadow, unused
|
||||
.set MODEL_BUTTERFLY, 0xBB # butterfly_geo
|
||||
.set MODEL_BLACK_BOBOMB, 0xBC # black_bobomb_geo
|
||||
# find me
|
||||
.set MODEL_KOOPA_SHELL, 0xBE # koopa_shell_geo
|
||||
.set MODEL_KOOPA_WITHOUT_SHELL, 0xBF # koopa_without_shell_geo
|
||||
.set MODEL_GOOMBA, 0xC0 # goomba_geo
|
||||
.set MODEL_SEAWEED, 0xC1 # seaweed_geo
|
||||
.set MODEL_AMP, 0xC2 # amp_geo
|
||||
.set MODEL_BOBOMB_BUDDY, 0xC3 # bobomb_buddy_geo
|
||||
# find me
|
||||
# find me
|
||||
# find me
|
||||
.set MODEL_SSL_TOX_BOX, 0xC7 # ssl_geo_000630
|
||||
.set MODEL_BOWSER_KEY_CUTSCENE, 0xC8 # bowser_key_cutscene_geo
|
||||
.set MODEL_DL_CANNON_LID, 0xC9 # cannon_closed_seg8_dl_080048E0
|
||||
.set MODEL_CHECKERBOARD_PLATFORM, 0xCA # checkerboard_platform_geo
|
||||
.set MODEL_RED_FLAME_SHADOW, 0xCB # red_flame_shadow_geo
|
||||
.set MODEL_BOWSER_KEY, 0xCC # bowser_key_geo
|
||||
.set MODEL_EXPLOSION, 0xCD # explosion_geo
|
||||
.set MODEL_SNUFIT, 0xCE # snufit_geo
|
||||
.set MODEL_PURPLE_SWITCH, 0xCF # purple_switch_geo
|
||||
.set MODEL_CASTLE_STAR_DOOR_30_STARS, 0xD0 # castle_geo_000F00
|
||||
.set MODEL_CASTLE_STAR_DOOR_50_STARS, 0xD1 # castle_geo_000F00
|
||||
.set MODEL_CCM_SNOWMAN_BASE, 0xD2 # ccm_geo_0003F0
|
||||
# find me
|
||||
.set MODEL_1UP, 0xD4 # mushroom_1up_geo
|
||||
.set MODEL_CASTLE_STAR_DOOR_8_STARS, 0xD5 # castle_geo_000F00
|
||||
.set MODEL_CASTLE_STAR_DOOR_70_STARS, 0xD6 # castle_geo_000F00
|
||||
.set MODEL_RED_COIN, 0xD7 # red_coin_geo
|
||||
.set MODEL_RED_COIN_NO_SHADOW, 0xD8 # red_coin_no_shadow_geo
|
||||
.set MODEL_METAL_BOX, 0xD9 # metal_box_geo
|
||||
.set MODEL_METAL_BOX_DL, 0xDA # metal_box_dl
|
||||
.set MODEL_NUMBER, 0xDB # number_geo
|
||||
.set MODEL_FLYGUY, 0xDC # shyguy_geo
|
||||
.set MODEL_TOAD, 0xDD # toad_geo
|
||||
.set MODEL_PEACH, 0xDE # peach_geo
|
||||
.set MODEL_CHUCKYA, 0xDF # chuckya_geo
|
||||
.set MODEL_WHITE_PUFF, 0xE0 # white_puff_geo
|
||||
.set MODEL_TRAJECTORY_MARKER_BALL, 0xE1 # bowling_ball_track_geo - duplicate used in SSL Pyramid small sized and as a track ball
|
||||
|
||||
# Menu Models (overwrites Level Geometry IDs)
|
||||
.set MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, MODEL_LEVEL_GEOMETRY_03 # main_menu_geo_0001D0
|
||||
.set MODEL_MAIN_MENU_RED_ERASE_BUTTON, MODEL_LEVEL_GEOMETRY_04 # main_menu_geo_000290
|
||||
.set MODEL_MAIN_MENU_BLUE_COPY_BUTTON, MODEL_LEVEL_GEOMETRY_05 # main_menu_geo_0002B8
|
||||
.set MODEL_MAIN_MENU_YELLOW_FILE_BUTTON, MODEL_LEVEL_GEOMETRY_06 # main_menu_geo_0002E0
|
||||
.set MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, MODEL_LEVEL_GEOMETRY_07 # main_menu_geo_000308
|
||||
.set MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, MODEL_LEVEL_GEOMETRY_08 # main_menu_geo_000200
|
||||
.set MODEL_MAIN_MENU_MARIO_NEW_BUTTON, MODEL_LEVEL_GEOMETRY_09 # main_menu_geo_000230
|
||||
.set MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, MODEL_LEVEL_GEOMETRY_0A # main_menu_geo_000260
|
||||
.set MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, MODEL_LEVEL_GEOMETRY_0B # main_menu_geo_000330
|
||||
.set MODEL_MAIN_MENU_GENERIC_BUTTON, MODEL_LEVEL_GEOMETRY_0C # main_menu_geo_000358
|
||||
|
||||
# level model aliases to level geometry IDs. Possibly a relic from an older level
|
||||
# format that used to rely on level geometry objects. (seen in WF, LLL, etc)
|
||||
.set MODEL_LLL_ROTATING_HEXAGONAL_PLATFORM, MODEL_LEVEL_GEOMETRY_09 # lll_geo_000A78
|
||||
.set MODEL_WF_GIANT_POLE, MODEL_LEVEL_GEOMETRY_0D # wf_geo_000AE0
|
||||
.set MODEL_WF_ROTATING_PLATFORM, MODEL_LEVEL_GEOMETRY_10 # wf_geo_0009B8
|
||||
.set MODEL_BITDW_WARP_PIPE, MODEL_LEVEL_GEOMETRY_12 # warp_pipe_geo
|
||||
.set MODEL_THI_WARP_PIPE, MODEL_LEVEL_GEOMETRY_16 # warp_pipe_geo
|
||||
.set MODEL_VCUTM_WARP_PIPE, MODEL_LEVEL_GEOMETRY_16 # warp_pipe_geo
|
||||
.set MODEL_CASTLE_GROUNDS_WARP_PIPE, MODEL_LEVEL_GEOMETRY_16 # warp_pipe_geo
|
||||
@@ -1,96 +0,0 @@
|
||||
# From gMovingTextureIdList
|
||||
.set TEXTURE_WATER, 0
|
||||
.set TEXTURE_MIST, 1
|
||||
.set TEXTURE_JRB_WATER, 2
|
||||
.set TEXTURE_UNK_WATER, 3
|
||||
.set TEXTURE_LAVA, 4
|
||||
.set TEX_QUICKSAND_SSL, 5
|
||||
.set TEX_PYRAMID_SAND_SSL, 6
|
||||
.set TEX_YELLOW_TRI_TTC, 7
|
||||
|
||||
# Moving Texture rotations
|
||||
.set ROTATE_CLOCKWISE, 0
|
||||
.set ROTATE_COUNTER_CLOCKWISE, 1
|
||||
|
||||
# Moving texture load quad tris start
|
||||
.macro movTexInitLoad, amount
|
||||
.hword \amount
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
# Short Triangle of moving texture with only 4 triangles with x and z
|
||||
.macro movTex4BoxTris, x, z
|
||||
.hword \x, \z
|
||||
.endm
|
||||
|
||||
# Moving texture miniTri define texture from MovingTextureList
|
||||
.macro movTexDefine, text
|
||||
.hword \text
|
||||
.endm
|
||||
|
||||
# Moving texture start with speed
|
||||
.macro movTexSpd, speed
|
||||
.hword \speed
|
||||
.endm
|
||||
|
||||
# Rotation speed of moving texture
|
||||
.macro movTexRotSpeed, rotspeed
|
||||
.hword \rotspeed
|
||||
.endm
|
||||
|
||||
# Rotation scale of moving texture that goes back and forth
|
||||
.macro movTexRotScale, rotscale
|
||||
.hword \rotscale
|
||||
.endm
|
||||
|
||||
# Rotation of moving texture
|
||||
.macro movTexRot, rot
|
||||
.hword \rot
|
||||
.endm
|
||||
|
||||
# Alpha of moving texture
|
||||
.macro movTexAlpha, alpha
|
||||
.hword \alpha
|
||||
.endm
|
||||
|
||||
# Triangle of moving texture
|
||||
.macro movTexTris, x, y, z, param1, param2
|
||||
.hword \x, \y, \z, \param1, \param2
|
||||
.endm
|
||||
|
||||
# 2 Triangles of moving texture
|
||||
.macro movTexRotTris, x, y, z, rotx, roty, rotz, param1, param2
|
||||
.hword \x, \y, \z, \rotx, \roty, \rotz, \param1, \param2
|
||||
.endm
|
||||
|
||||
# Triangle of moving texture with light
|
||||
.macro movTexLightTris, x, y, z, light, param1, param2
|
||||
.hword \x, \y, \z, 0, \light, 0, \param1, \param2
|
||||
.endm
|
||||
|
||||
# Jump to a moving texture tri
|
||||
.macro movTexJump, id, addr
|
||||
.hword \id, 0
|
||||
.word \addr
|
||||
.endm
|
||||
|
||||
# Moving texture load quad tris stop
|
||||
.macro movTexEndLoad
|
||||
.hword -1
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
# End of moving texture jump addr
|
||||
.macro movTexEndJump
|
||||
.word 0x0
|
||||
.endm
|
||||
|
||||
# End of moving texture load
|
||||
.macro movTexEnd
|
||||
.hword 0
|
||||
.endm
|
||||
|
||||
# End of moving texture load if movTexRotTris was used, only used in SSL
|
||||
.macro movTexRotEnd
|
||||
.hword 0, 0
|
||||
.endm
|
||||
@@ -0,0 +1,72 @@
|
||||
#ifndef MOVING_TEXTURE_MACROS_H
|
||||
#define MOVING_TEXTURE_MACROS_H
|
||||
|
||||
#include "game/moving_texture.h"
|
||||
|
||||
// From gMovingTextureIdList
|
||||
#define TEXTURE_WATER 0
|
||||
#define TEXTURE_MIST 1
|
||||
#define TEXTURE_JRB_WATER 2
|
||||
#define TEXTURE_UNK_WATER 3
|
||||
#define TEXTURE_LAVA 4
|
||||
#define TEX_QUICKSAND_SSL 5
|
||||
#define TEX_PYRAMID_SAND_SSL 6
|
||||
#define TEX_YELLOW_TRI_TTC 7
|
||||
|
||||
// Moving Texture rotations
|
||||
#define ROTATE_CLOCKWISE 0
|
||||
#define ROTATE_COUNTER_CLOCKWISE 1
|
||||
|
||||
// Moving texture load quad tris start
|
||||
#define MOV_TEX_INIT_LOAD(amount) \
|
||||
amount, 0
|
||||
|
||||
// Short Triangle of moving texture with only 4 triangles with x and z
|
||||
#define MOV_TEX_4_BOX_TRIS(x, z) \
|
||||
x, z
|
||||
|
||||
// Moving texture miniTri define texture from MovingTextureList
|
||||
#define MOV_TEX_DEFINE(text) \
|
||||
text
|
||||
|
||||
// Moving texture start with speed
|
||||
#define MOV_TEX_SPD(speed) \
|
||||
speed
|
||||
|
||||
// Rotation speed of moving texture
|
||||
#define MOV_TEX_ROT_SPEED(rotspeed) \
|
||||
rotspeed
|
||||
|
||||
// Rotation scale of moving texture that goes back and forth
|
||||
#define MOV_TEX_ROT_SCALE(rotscale) \
|
||||
rotscale
|
||||
|
||||
// Rotation of moving texture
|
||||
#define MOV_TEX_ROT(rot) \
|
||||
rot
|
||||
|
||||
// Alpha of moving texture
|
||||
#define MOV_TEX_ALPHA(alpha) \
|
||||
alpha
|
||||
|
||||
// Triangle of moving texture
|
||||
#define MOV_TEX_TRIS(x, y, z, param1, param2) \
|
||||
x, y, z, param1, param2
|
||||
|
||||
// 2 Triangles of moving texture
|
||||
#define MOV_TEX_ROT_TRIS(x, y, z, rotx, roty, rotz, param1, param2) \
|
||||
x, y, z, rotx, roty, rotz, param1, param2
|
||||
|
||||
// Triangle of moving texture with light
|
||||
#define MOV_TEX_LIGHT_TRIS(x, y, z, light, param1, param2) \
|
||||
x, y, z, 0, light, 0, param1, param2
|
||||
|
||||
// End of moving texture load
|
||||
#define MOV_TEX_END() \
|
||||
0
|
||||
|
||||
// End of moving texture load if movTexRotTris was used, only used in SSL
|
||||
#define MOV_TEX_ROT_END() \
|
||||
0, 0
|
||||
|
||||
#endif
|
||||
+45
-15
@@ -7,11 +7,26 @@
|
||||
* object type. These macros provide access to these fields.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef OBJECT_FIELDS_INDEX_DIRECTLY
|
||||
#define OBJECT_FIELD_U32(index) index
|
||||
#define OBJECT_FIELD_S32(index) index
|
||||
#define OBJECT_FIELD_S16(index, subIndex) index
|
||||
#define OBJECT_FIELD_F32(index) index
|
||||
#define OBJECT_FIELD_S16P(index) index
|
||||
#define OBJECT_FIELD_S32P(index) index
|
||||
#define OBJECT_FIELD_ANIMS(index) index
|
||||
#define OBJECT_FIELD_WAYPOINT(index) index
|
||||
#define OBJECT_FIELD_CHAIN_SEGMENT(index) index
|
||||
#define OBJECT_FIELD_OBJ(index) index
|
||||
#define OBJECT_FIELD_SURFACE(index) index
|
||||
#define OBJECT_FIELD_VPTR(index) index
|
||||
#define OBJECT_FIELD_CVPTR(index) index
|
||||
#else
|
||||
#define OBJECT_FIELD_U32(index) rawData.asU32[index]
|
||||
#define OBJECT_FIELD_S32(index) rawData.asS32[index]
|
||||
#define OBJECT_FIELD_S16(index, subIndex) rawData.asS16[index][subIndex]
|
||||
#define OBJECT_FIELD_F32(index) rawData.asF32[index]
|
||||
#if !IS_64_BIT
|
||||
#define OBJECT_FIELD_S16P(index) rawData.asS16P[index]
|
||||
#define OBJECT_FIELD_S32P(index) rawData.asS32P[index]
|
||||
#define OBJECT_FIELD_ANIMS(index) rawData.asAnims[index]
|
||||
@@ -20,13 +35,27 @@
|
||||
#define OBJECT_FIELD_OBJ(index) rawData.asObject[index]
|
||||
#define OBJECT_FIELD_SURFACE(index) rawData.asSurface[index]
|
||||
#define OBJECT_FIELD_VPTR(index) rawData.asVoidPtr[index]
|
||||
#define OBJECT_FIELD_CVPTR(index) rawData.asConstVoidPtr[index]
|
||||
#else
|
||||
#define OBJECT_FIELD_S16P(index) ptrData.asS16P[index]
|
||||
#define OBJECT_FIELD_S32P(index) ptrData.asS32P[index]
|
||||
#define OBJECT_FIELD_ANIMS(index) ptrData.asAnims[index]
|
||||
#define OBJECT_FIELD_WAYPOINT(index) ptrData.asWaypoint[index]
|
||||
#define OBJECT_FIELD_CHAIN_SEGMENT(index) ptrData.asChainSegment[index]
|
||||
#define OBJECT_FIELD_OBJ(index) ptrData.asObject[index]
|
||||
#define OBJECT_FIELD_SURFACE(index) ptrData.asSurface[index]
|
||||
#define OBJECT_FIELD_VPTR(index) ptrData.asVoidPtr[index]
|
||||
#define OBJECT_FIELD_CVPTR(index) ptrData.asConstVoidPtr[index]
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// 0x088 (0x00), the first field, is object-specific and defined below the common fields.
|
||||
/* Common fields */
|
||||
#define /*0x08C*/ oFlags OBJECT_FIELD_U32(0x01)
|
||||
#define /*0x090*/ oDialogResponse OBJECT_FIELD_S16(0x02, 0)
|
||||
#define /*0x092*/ oDialogState OBJECT_FIELD_S16(0x02, 1)
|
||||
// 0x94/0x98 unused/removed.
|
||||
#define /*0x094*/ oUnk94 OBJECT_FIELD_U32(0x03)
|
||||
// 0x98 unused/removed.
|
||||
#define /*0x09C*/ oIntangibleTimer OBJECT_FIELD_S32(0x05)
|
||||
#define /*0x0A0*/ O_POS_INDEX 0x06
|
||||
#define /*0x0A0*/ oPosX OBJECT_FIELD_F32(O_POS_INDEX + 0)
|
||||
@@ -160,7 +189,8 @@
|
||||
#define /*0x0FC*/ oHomingAmpAvgY OBJECT_FIELD_F32(0x1D)
|
||||
|
||||
/* Arrow Lift */
|
||||
#define /*0x0F4*/ oArrowLiftDisplacement OBJECT_FIELD_F32(0x1B)
|
||||
#define /*0x0F4*/ oArrowLiftDisplacement OBJECT_FIELD_F32(0x1B)
|
||||
#define /*0x100*/ oArrowLiftUnk100 OBJECT_FIELD_S32(0x1E)
|
||||
|
||||
/* Back-and-Forth Platform */
|
||||
#define /*0x0F4*/ oBackAndForthPlatformUnkF4 OBJECT_FIELD_F32(0x1B)
|
||||
@@ -624,14 +654,14 @@
|
||||
#define /*0x100*/ oEnemyLakituFaceForwardCountdown OBJECT_FIELD_S32(0x1E)
|
||||
|
||||
/* Intro Cutscene Lakitu */
|
||||
#define /*0x0F8*/ oIntroLakituUnkF8 OBJECT_FIELD_F32(0x1C)
|
||||
#define /*0x0FC*/ oIntroLakituUnkFC OBJECT_FIELD_F32(0x1D)
|
||||
#define /*0x100*/ oIntroLakituUnk100 OBJECT_FIELD_F32(0x1E)
|
||||
#define /*0x104*/ oIntroLakituUnk104 OBJECT_FIELD_F32(0x1F)
|
||||
#define /*0x108*/ oIntroLakituUnk108 OBJECT_FIELD_F32(0x20)
|
||||
#define /*0x10C*/ oIntroLakituUnk10C OBJECT_FIELD_F32(0x21)
|
||||
#define /*0x110*/ oIntroLakituUnk110 OBJECT_FIELD_F32(0x22)
|
||||
#define /*0x1AC*/ oIntroLakituUnk1AC OBJECT_FIELD_OBJ(0x49)
|
||||
#define /*0x0F8*/ oIntroLakituSplineSegmentProgress OBJECT_FIELD_F32(0x1C)
|
||||
#define /*0x0FC*/ oIntroLakituSplineSegment OBJECT_FIELD_F32(0x1D)
|
||||
#define /*0x100*/ oIntroLakituUnk100 OBJECT_FIELD_F32(0x1E)
|
||||
#define /*0x104*/ oIntroLakituUnk104 OBJECT_FIELD_F32(0x1F)
|
||||
#define /*0x108*/ oIntroLakituUnk108 OBJECT_FIELD_F32(0x20)
|
||||
#define /*0x10C*/ oIntroLakituUnk10C OBJECT_FIELD_F32(0x21)
|
||||
#define /*0x110*/ oIntroLakituUnk110 OBJECT_FIELD_F32(0x22)
|
||||
#define /*0x1AC*/ oIntroLakituCloud OBJECT_FIELD_OBJ(0x49)
|
||||
|
||||
/* Main Menu Button */
|
||||
#define /*0x0F4*/ oMenuButtonState OBJECT_FIELD_S32(0x1B)
|
||||
@@ -695,16 +725,16 @@
|
||||
/* Object Respawner */
|
||||
#define /*0x0F4*/ oRespawnerModelToRespawn OBJECT_FIELD_S32(0x1B)
|
||||
#define /*0x0F8*/ oRespawnerMinSpawnDist OBJECT_FIELD_F32(0x1C)
|
||||
#define /*0x0FC*/ oRespawnerBehaviorToRespawn OBJECT_FIELD_VPTR(0x1D)
|
||||
#define /*0x0FC*/ oRespawnerBehaviorToRespawn OBJECT_FIELD_CVPTR(0x1D)
|
||||
|
||||
/* Openable Grill */
|
||||
#define /*0x088*/ oOpenableGrillUnk88 OBJECT_FIELD_S32(0x00)
|
||||
#define /*0x0F4*/ oOpenableGrillUnkF4 OBJECT_FIELD_OBJ(0x1B)
|
||||
|
||||
/* Intro Cutscene Peach */
|
||||
#define /*0x108*/ oIntroPeachUnk108 OBJECT_FIELD_F32(0x20)
|
||||
#define /*0x10C*/ oIntroPeachUnk10C OBJECT_FIELD_F32(0x21)
|
||||
#define /*0x110*/ oIntroPeachUnk110 OBJECT_FIELD_F32(0x22)
|
||||
#define /*0x108*/ oIntroPeachYawFromFocus OBJECT_FIELD_F32(0x20)
|
||||
#define /*0x10C*/ oIntroPeachPitchFromFocus OBJECT_FIELD_F32(0x21)
|
||||
#define /*0x110*/ oIntroPeachDistToCamera OBJECT_FIELD_F32(0x22)
|
||||
|
||||
/* Racing Penguin */
|
||||
#define /*0x0F4*/ oRacingPenguinInitTextCooldown OBJECT_FIELD_S32(0x1B)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
.set RIPPLE_SHAPE_WAVE, 0
|
||||
.set RIPPLE_SHAPE_CONCENTRIC, 1
|
||||
.set RIPPLE_TRIGGER_PROXIMITY, 10
|
||||
.set RIPPLE_TRIGGER_CONTINUOUS, 20
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef PLATFORM_INFO_H
|
||||
#define PLATFORM_INFO_H
|
||||
|
||||
#if defined(__sgi) || defined(TARGET_N64)
|
||||
#define IS_64_BIT 0
|
||||
#define IS_BIG_ENDIAN 1
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#define IS_64_BIT (UINTPTR_MAX == 0xFFFFFFFFFFFFFFFFU)
|
||||
#define IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||
#endif
|
||||
|
||||
#define DOUBLE_SIZE_ON_64_BIT(size) ((size) * (sizeof(void *) / 4))
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,105 @@
|
||||
#ifndef SEGMENT_SYMBOLS_H
|
||||
#define SEGMENT_SYMBOLS_H
|
||||
|
||||
#define DECLARE_SEGMENT(name) \
|
||||
extern u8 _##name##SegmentRomStart[]; \
|
||||
extern u8 _##name##SegmentRomEnd[];
|
||||
|
||||
#define DECLARE_ACTOR_SEGMENT(name) \
|
||||
DECLARE_SEGMENT(name##_mio0) \
|
||||
DECLARE_SEGMENT(name##_geo)
|
||||
|
||||
#define DECLARE_LEVEL_SEGMENT(name) \
|
||||
DECLARE_SEGMENT(name) \
|
||||
DECLARE_SEGMENT(name##_segment_7)
|
||||
|
||||
DECLARE_ACTOR_SEGMENT(common0)
|
||||
DECLARE_ACTOR_SEGMENT(common1)
|
||||
DECLARE_ACTOR_SEGMENT(group0)
|
||||
DECLARE_ACTOR_SEGMENT(group1)
|
||||
DECLARE_ACTOR_SEGMENT(group2)
|
||||
DECLARE_ACTOR_SEGMENT(group3)
|
||||
DECLARE_ACTOR_SEGMENT(group4)
|
||||
DECLARE_ACTOR_SEGMENT(group5)
|
||||
DECLARE_ACTOR_SEGMENT(group6)
|
||||
DECLARE_ACTOR_SEGMENT(group7)
|
||||
DECLARE_ACTOR_SEGMENT(group8)
|
||||
DECLARE_ACTOR_SEGMENT(group9)
|
||||
DECLARE_ACTOR_SEGMENT(group10)
|
||||
DECLARE_ACTOR_SEGMENT(group11)
|
||||
DECLARE_ACTOR_SEGMENT(group12)
|
||||
DECLARE_ACTOR_SEGMENT(group13)
|
||||
DECLARE_ACTOR_SEGMENT(group14)
|
||||
DECLARE_ACTOR_SEGMENT(group15)
|
||||
DECLARE_ACTOR_SEGMENT(group16)
|
||||
DECLARE_ACTOR_SEGMENT(group17)
|
||||
|
||||
DECLARE_SEGMENT(behavior)
|
||||
DECLARE_SEGMENT(scripts)
|
||||
DECLARE_SEGMENT(goddard)
|
||||
extern u8 _goddardSegmentStart[];
|
||||
|
||||
DECLARE_LEVEL_SEGMENT(menu)
|
||||
DECLARE_LEVEL_SEGMENT(intro)
|
||||
DECLARE_LEVEL_SEGMENT(ending)
|
||||
DECLARE_LEVEL_SEGMENT(bbh)
|
||||
DECLARE_LEVEL_SEGMENT(ccm)
|
||||
DECLARE_LEVEL_SEGMENT(castle_inside)
|
||||
DECLARE_LEVEL_SEGMENT(hmc)
|
||||
DECLARE_LEVEL_SEGMENT(ssl)
|
||||
DECLARE_LEVEL_SEGMENT(bob)
|
||||
DECLARE_LEVEL_SEGMENT(sl)
|
||||
DECLARE_LEVEL_SEGMENT(wdw)
|
||||
DECLARE_LEVEL_SEGMENT(jrb)
|
||||
DECLARE_LEVEL_SEGMENT(thi)
|
||||
DECLARE_LEVEL_SEGMENT(ttc)
|
||||
DECLARE_LEVEL_SEGMENT(rr)
|
||||
DECLARE_LEVEL_SEGMENT(castle_grounds)
|
||||
DECLARE_LEVEL_SEGMENT(bitdw)
|
||||
DECLARE_LEVEL_SEGMENT(vcutm)
|
||||
DECLARE_LEVEL_SEGMENT(bitfs)
|
||||
DECLARE_LEVEL_SEGMENT(sa)
|
||||
DECLARE_LEVEL_SEGMENT(bits)
|
||||
DECLARE_LEVEL_SEGMENT(lll)
|
||||
DECLARE_LEVEL_SEGMENT(ddd)
|
||||
DECLARE_LEVEL_SEGMENT(wf)
|
||||
DECLARE_LEVEL_SEGMENT(ending)
|
||||
DECLARE_LEVEL_SEGMENT(castle_courtyard)
|
||||
DECLARE_LEVEL_SEGMENT(pss)
|
||||
DECLARE_LEVEL_SEGMENT(cotmc)
|
||||
DECLARE_LEVEL_SEGMENT(totwc)
|
||||
DECLARE_LEVEL_SEGMENT(bowser_1)
|
||||
DECLARE_LEVEL_SEGMENT(wmotr)
|
||||
DECLARE_LEVEL_SEGMENT(bowser_2)
|
||||
DECLARE_LEVEL_SEGMENT(bowser_3)
|
||||
DECLARE_LEVEL_SEGMENT(ttm)
|
||||
|
||||
DECLARE_SEGMENT(water_skybox_mio0)
|
||||
DECLARE_SEGMENT(ccm_skybox_mio0)
|
||||
DECLARE_SEGMENT(clouds_skybox_mio0)
|
||||
DECLARE_SEGMENT(bitfs_skybox_mio0)
|
||||
DECLARE_SEGMENT(wdw_skybox_mio0)
|
||||
DECLARE_SEGMENT(cloud_floor_skybox_mio0)
|
||||
DECLARE_SEGMENT(ssl_skybox_mio0)
|
||||
DECLARE_SEGMENT(bbh_skybox_mio0)
|
||||
DECLARE_SEGMENT(bidw_skybox_mio0)
|
||||
DECLARE_SEGMENT(bits_skybox_mio0)
|
||||
|
||||
DECLARE_SEGMENT(fire_mio0)
|
||||
DECLARE_SEGMENT(spooky_mio0)
|
||||
DECLARE_SEGMENT(generic_mio0)
|
||||
DECLARE_SEGMENT(water_mio0)
|
||||
DECLARE_SEGMENT(sky_mio0)
|
||||
DECLARE_SEGMENT(snow_mio0)
|
||||
DECLARE_SEGMENT(cave_mio0)
|
||||
DECLARE_SEGMENT(machine_mio0)
|
||||
DECLARE_SEGMENT(mountain_mio0)
|
||||
DECLARE_SEGMENT(grass_mio0)
|
||||
DECLARE_SEGMENT(outside_mio0)
|
||||
DECLARE_SEGMENT(inside_mio0)
|
||||
DECLARE_SEGMENT(effect_mio0)
|
||||
DECLARE_SEGMENT(title_screen_bg_mio0)
|
||||
|
||||
DECLARE_SEGMENT(debug_level_select_mio0)
|
||||
|
||||
#endif
|
||||
@@ -1,42 +0,0 @@
|
||||
|
||||
/* Music Defines */
|
||||
|
||||
.set SEQ_VARIATION, 0x80
|
||||
|
||||
.set SEQ_SOUND_PLAYER, 0x0000
|
||||
.set SEQ_EVENT_CUTSCENE_COLLECT_STAR, 0x0001
|
||||
.set SEQ_MENU_TITLE_SCREEN, 0x0002
|
||||
.set SEQ_LEVEL_GRASS, 0x0003
|
||||
.set SEQ_LEVEL_INSIDE_CASTLE, 0x0004
|
||||
.set SEQ_LEVEL_WATER, 0x0005
|
||||
.set SEQ_LEVEL_HOT, 0x0006
|
||||
.set SEQ_LEVEL_BOSS_KOOPA, 0x0007
|
||||
.set SEQ_LEVEL_SNOW, 0x0008
|
||||
.set SEQ_LEVEL_SLIDE, 0x0009
|
||||
.set SEQ_LEVEL_SPOOKY, 0x000A
|
||||
.set SEQ_EVENT_PIRANHA_PLANT, 0x000B
|
||||
.set SEQ_LEVEL_UNDERGROUND, 0x000C
|
||||
.set SEQ_MENU_STAR_SELECT, 0x000D
|
||||
.set SEQ_EVENT_POWERUP, 0x000E
|
||||
.set SEQ_EVENT_METAL_CAP, 0x000F
|
||||
.set SEQ_EVENT_KOOPA_MESSAGE, 0x0010
|
||||
.set SEQ_LEVEL_KOOPA_ROAD, 0x0011
|
||||
.set SEQ_EVENT_HIGH_SCORE, 0x0012
|
||||
.set SEQ_EVENT_MERRY_GO_ROUND, 0x0013
|
||||
.set SEQ_EVENT_RACE, 0x0014
|
||||
.set SEQ_EVENT_CUTSCENE_STAR_SPAWN, 0x0015
|
||||
.set SEQ_EVENT_BOSS, 0x0016
|
||||
.set SEQ_EVENT_CUTSCENE_COLLECT_KEY, 0x0017
|
||||
.set SEQ_EVENT_ENDLESS_STAIRS, 0x0018
|
||||
.set SEQ_LEVEL_BOSS_KOOPA_FINAL, 0x0019
|
||||
.set SEQ_EVENT_CUTSCENE_CREDITS, 0x001A
|
||||
.set SEQ_EVENT_SOLVE_PUZZLE, 0x001B
|
||||
.set SEQ_EVENT_TOAD_MESSAGE, 0x001C
|
||||
.set SEQ_EVENT_PEACH_MESSAGE, 0x001D
|
||||
.set SEQ_EVENT_CUTSCENE_INTRO, 0x001E
|
||||
.set SEQ_EVENT_CUTSCENE_VICTORY, 0x001F
|
||||
.set SEQ_EVENT_CUTSCENE_ENDING, 0x0020
|
||||
.set SEQ_MENU_FILE_SELECT, 0x0021
|
||||
.ifndef VERSION_JP
|
||||
.set SEQ_EVENT_CUTSCENE_LAKITU, 0x0022
|
||||
.endif
|
||||
@@ -43,7 +43,8 @@ enum SpecialPresets {
|
||||
special_rotating_counter_clockwise,
|
||||
special_wf_tumbling_bridge,
|
||||
special_large_bomp,
|
||||
special_level_geo_03,
|
||||
|
||||
special_level_geo_03 = 0x65,
|
||||
special_level_geo_04,
|
||||
special_level_geo_05,
|
||||
special_level_geo_06,
|
||||
@@ -68,23 +69,25 @@ enum SpecialPresets {
|
||||
special_snow_tree,
|
||||
special_unknown_tree,
|
||||
special_palm_tree,
|
||||
special_castle_door,
|
||||
special_wooden_door,
|
||||
special_haunted_door = special_wooden_door,
|
||||
special_unknown_door,
|
||||
special_metal_door,
|
||||
special_hmc_door,
|
||||
special_unknown2_door,
|
||||
special_0stars_door,
|
||||
special_1star_door,
|
||||
special_3star_door,
|
||||
special_key_door,
|
||||
special_castle_door_warp,
|
||||
special_wooden_door_warp,
|
||||
special_unknown1_door_warp,
|
||||
special_metal_door_warp,
|
||||
special_unknown2_door_warp,
|
||||
special_unknown3_door_warp,
|
||||
special_null_end
|
||||
special_castle_door_warp,
|
||||
special_castle_door,
|
||||
special_0stars_door,
|
||||
special_1star_door,
|
||||
special_3star_door,
|
||||
special_key_door,
|
||||
|
||||
special_null_end = 0xFF
|
||||
};
|
||||
|
||||
#endif // _SPECIAL_PRESET_NAMES_H
|
||||
|
||||
@@ -18,7 +18,7 @@ struct SpecialPreset
|
||||
/*01*/ u8 type; // Determines whether object is 8, 10, 12 or 14 bytes long.
|
||||
/*02*/ u8 defParam; // Default parameter, only used when type is SPTYPE_DEF_PARAM_AND_YROT
|
||||
/*03*/ u8 model;
|
||||
/*04*/ u32 *behavior;
|
||||
/*04*/ const BehaviorScript *behavior;
|
||||
};
|
||||
|
||||
// Some Models ID's are missing their names because they are probably unused
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
.set special_null_start, 0x00
|
||||
.set special_yellow_coin, 0x01
|
||||
.set special_yellow_coin_2, 0x02
|
||||
.set special_unknown_3, 0x03
|
||||
.set special_boo, 0x04
|
||||
.set special_unknown_5, 0x05
|
||||
.set special_lll_moving_octagonal_mesh_platform, 0x06
|
||||
.set special_snow_ball, 0x07
|
||||
.set special_lll_drawbridge_spawner, 0x08
|
||||
.set special_empty_9, 0x09
|
||||
.set special_lll_rotating_block_with_fire_bars, 0x0A
|
||||
.set special_lll_floating_wood_bridge, 0x0B
|
||||
.set special_tumbling_platform, 0x0C
|
||||
.set special_lll_rotating_hexagonal_ring, 0x0D
|
||||
.set special_lll_sinking_rectangular_platform, 0x0E
|
||||
.set special_lll_sinking_square_platforms, 0x0F
|
||||
.set special_lll_tilting_square_platform, 0x10
|
||||
.set special_lll_bowser_puzzle, 0x11
|
||||
.set special_mr_i, 0x12
|
||||
.set special_small_bully, 0x13
|
||||
.set special_big_bully, 0x14
|
||||
.set special_empty_21, 0x15
|
||||
.set special_empty_22, 0x16
|
||||
.set special_empty_23, 0x17
|
||||
.set special_empty_24, 0x18
|
||||
.set special_empty_25, 0x19
|
||||
.set special_moving_blue_coin, 0x1A
|
||||
.set special_jrb_chest, 0x1B
|
||||
.set special_water_ring, 0x1C
|
||||
.set special_mine, 0x1D
|
||||
.set special_empty_30, 0x1E
|
||||
.set special_empty_31, 0x1F
|
||||
.set special_butterfly, 0x20
|
||||
.set special_bowser, 0x21
|
||||
.set special_wf_rotating_wooden_platform, 0x22
|
||||
.set special_small_bomp, 0x23
|
||||
.set special_wf_sliding_platform, 0x24
|
||||
.set special_tower_platform_group, 0x25
|
||||
.set special_rotating_counter_clockwise, 0x26
|
||||
.set special_wf_tumbling_bridge, 0x27
|
||||
.set special_large_bomp, 0x28
|
||||
.set special_level_geo_03, 0x65
|
||||
.set special_level_geo_04, 0x66
|
||||
.set special_level_geo_05, 0x67
|
||||
.set special_level_geo_06, 0x68
|
||||
.set special_level_geo_07, 0x69
|
||||
.set special_level_geo_08, 0x6A
|
||||
.set special_level_geo_09, 0x6B
|
||||
.set special_level_geo_0A, 0x6C
|
||||
.set special_level_geo_0B, 0x6D
|
||||
.set special_level_geo_0C, 0x6E
|
||||
.set special_level_geo_0D, 0x6F
|
||||
.set special_level_geo_0E, 0x70
|
||||
.set special_level_geo_0F, 0x71
|
||||
.set special_level_geo_10, 0x72
|
||||
.set special_level_geo_11, 0x73
|
||||
.set special_level_geo_12, 0x74
|
||||
.set special_level_geo_13, 0x75
|
||||
.set special_level_geo_14, 0x76
|
||||
.set special_level_geo_15, 0x77
|
||||
.set special_level_geo_16, 0x78
|
||||
.set special_bubble_tree, 0x79
|
||||
.set special_spiky_tree, 0x7A
|
||||
.set special_snow_tree, 0x7B
|
||||
.set special_unknown_tree, 0x7C
|
||||
.set special_palm_tree, 0x7D
|
||||
.set special_castle_door, 0x89
|
||||
.set special_wooden_door, 0x7E
|
||||
.set special_unknown_door, 0x7F
|
||||
.set special_metal_door, 0x80
|
||||
.set special_hmc_door, 0x81
|
||||
.set special_unknown2_door, 0x82
|
||||
.set special_0stars_door, 0x8A
|
||||
.set special_1star_door, 0x8B
|
||||
.set special_3star_door, 0x8C
|
||||
.set special_key_door, 0x8D
|
||||
.set special_castle_door_warp, 0x88
|
||||
.set special_wooden_door_warp, 0x83
|
||||
.set special_unknown1_door_warp, 0x84
|
||||
.set special_metal_door_warp, 0x85
|
||||
.set special_unknown2_door_warp, 0x86
|
||||
.set special_unknown3_door_warp, 0x87
|
||||
.set special_null_end, 0xFF
|
||||
|
||||
# bbh
|
||||
|
||||
.set special_haunted_door, 0x7E
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#ifndef _STRING_H_
|
||||
#define _STRING_H_
|
||||
#include "PR/ultratypes.h"
|
||||
void* memcpy(void*, const void*, size_t);
|
||||
size_t strlen(const u8 *str);
|
||||
const u8 *strchr(const u8 *str, s32 ch);
|
||||
|
||||
#endif
|
||||
@@ -9,14 +9,18 @@
|
||||
#define SURFACE_SLOW 0x0009 // Slow down Mario, unused
|
||||
#define SURFACE_DEATH_PLANE 0x000A // Death floor
|
||||
#define SURFACE_CLOSE_CAMERA 0x000B // Close camera
|
||||
#define SURFACE_WATER 0x000D // Water, has no action, used on some waterboxes below
|
||||
#define SURFACE_FLOWING_WATER 0x000E // Water (flowing), has parameters
|
||||
#define SURFACE_INTANGIBLE 0x0012 // Intangible (Separates BBH mansion from merry-go-round, for room usage)
|
||||
#define SURFACE_VERY_SLIPPERY 0x0013 // Very slippery, mostly used for slides
|
||||
#define SURFACE_SLIPPERY 0x0014 // Slippery
|
||||
#define SURFACE_NOT_SLIPPERY 0x0015 // Non-slippery, climbable
|
||||
#define SURFACE_TTM_VINES 0x0016 // TTM vines, has no action defined
|
||||
#define SURFACE_MGR_MUSIC 0x001A // Plays the Merry go round music, see handle_merry_go_round_music in bbh_merry_go_round.inc.c for more details
|
||||
#define SURFACE_INSTANT_WARP_1B 0x001B // Instant warp to another area, used to warp between areas in WDW and the endless stairs to warp back
|
||||
#define SURFACE_INSTANT_WARP_1C 0x001C // Instant warp to another area, used to warp between areas in WDW
|
||||
#define SURFACE_INSTANT_WARP_1D 0x001D // Instant warp to another area, used to warp between areas in DDD, SSL and TTM
|
||||
#define SURFACE_INSTANT_WARP_1E 0x001E // Instant warp to another area, used to warp between areas in DDD, SSL and TTM
|
||||
#define SURFACE_SHALLOW_QUICKSAND 0x0021 // Shallow Quicksand (depth of 10 units)
|
||||
#define SURFACE_DEEP_QUICKSAND 0x0022 // Quicksand (lethal, slow, depth of 160 units)
|
||||
#define SURFACE_INSTANT_QUICKSAND 0x0023 // Quicksand (lethal, instant)
|
||||
@@ -41,6 +45,7 @@
|
||||
#define SURFACE_VERTICAL_WIND 0x0038 // Death at bottom with vertical wind
|
||||
#define SURFACE_BOSS_FIGHT_CAMERA 0x0065 // Wide camera for BOB and WF bosses
|
||||
#define SURFACE_CAMERA_FREE_ROAM 0x0066 // Free roam camera for THI and TTC
|
||||
#define SURFACE_THI3_WALLKICK 0x0068 // Surface where there's a wall kick section in THI 3rd area, has no action defined
|
||||
#define SURFACE_CAMERA_PLATFORM 0x0069 // Surface that enables far camera for platforms, used in THI
|
||||
#define SURFACE_CAMERA_MIDDLE 0x006E // Surface camera that returns to the middle, used on the 4 pillars of SSL
|
||||
#define SURFACE_CAMERA_ROTATE_RIGHT 0x006F // Surface camera that rotates to the right (Bowser 1 & THI)
|
||||
@@ -58,13 +63,92 @@
|
||||
#define SURFACE_PAINTING_WOBBLE_A6 0x00A6 // Painting wobble (BOB Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_A7 0x00A7 // Painting wobble (BOB Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_A8 0x00A8 // Painting wobble (BOB Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_A9 0x00A9 // Painting wobble (CCM Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_AA 0x00AA // Painting wobble (CCM Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_AB 0x00AB // Painting wobble (CCM Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_AC 0x00AC // Painting wobble (WF Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_AD 0x00AD // Painting wobble (WF Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_AE 0x00AE // Painting wobble (WF Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_AF 0x00AF // Painting wobble (JRB Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_B0 0x00B0 // Painting wobble (JRB Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_B1 0x00B1 // Painting wobble (JRB Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_B2 0x00B2 // Painting wobble (LLL Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_B3 0x00B3 // Painting wobble (LLL Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_B4 0x00B4 // Painting wobble (LLL Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_B5 0x00B5 // Painting wobble (SSL Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_B6 0x00B6 // Painting wobble (SSL Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_B7 0x00B7 // Painting wobble (SSL Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_B8 0x00B8 // Painting wobble (Unused - Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_B9 0x00B9 // Painting wobble (Unused - Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_BA 0x00BA // Painting wobble (Unused - Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_BB 0x00BB // Painting wobble (DDD - Left), makes the painting wobble if touched
|
||||
#define SURFACE_PAINTING_WOBBLE_BC 0x00BC // Painting wobble (Unused, DDD - Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_BD 0x00BD // Painting wobble (Unused, DDD - Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_BE 0x00BE // Painting wobble (WDW Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_BF 0x00BF // Painting wobble (WDW Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_C0 0x00C0 // Painting wobble (WDW Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_C1 0x00C1 // Painting wobble (THI Tiny - Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_C2 0x00C2 // Painting wobble (THI Tiny - Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_C3 0x00C3 // Painting wobble (THI Tiny - Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_C4 0x00C4 // Painting wobble (TTM Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_C5 0x00C5 // Painting wobble (TTM Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_C6 0x00C6 // Painting wobble (TTM Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_C7 0x00C7 // Painting wobble (Unused, TTC - Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_C8 0x00C8 // Painting wobble (Unused, TTC - Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_C9 0x00C9 // Painting wobble (Unused, TTC - Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_CA 0x00CA // Painting wobble (Unused, SL - Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_CB 0x00CB // Painting wobble (Unused, SL - Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_CC 0x00CC // Painting wobble (Unused, SL - Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_CD 0x00CD // Painting wobble (THI Huge - Left)
|
||||
#define SURFACE_PAINTING_WOBBLE_CE 0x00CE // Painting wobble (THI Huge - Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_CF 0x00CF // Painting wobble (THI Huge - Right)
|
||||
#define SURFACE_PAINTING_WOBBLE_D0 0x00D0 // Painting wobble (HMC & COTMC - Left), makes the painting wobble if touched
|
||||
#define SURFACE_PAINTING_WOBBLE_D1 0x00D1 // Painting wobble (Unused, HMC & COTMC - Middle)
|
||||
#define SURFACE_PAINTING_WOBBLE_D2 0x00D2 // Painting wobble (Unused, HMC & COTMC - Right)
|
||||
#define SURFACE_PAINTING_WARP_D3 0x00D3 // Painting warp (BOB Left)
|
||||
#define SURFACE_PAINTING_WARP_D4 0x00D4 // Painting warp (BOB Middle)
|
||||
#define SURFACE_PAINTING_WARP_D5 0x00D5 // Painting warp (BOB Right)
|
||||
#define SURFACE_PAINTING_WARP_D6 0x00D6 // Painting warp (CCM Left)
|
||||
#define SURFACE_PAINTING_WARP_D7 0x00D7 // Painting warp (CCM Middle)
|
||||
#define SURFACE_PAINTING_WARP_D8 0x00D8 // Painting warp (CCM Right)
|
||||
#define SURFACE_PAINTING_WARP_D9 0x00D9 // Painting warp (WF Left)
|
||||
#define SURFACE_PAINTING_WARP_DA 0x00DA // Painting warp (WF Middle)
|
||||
#define SURFACE_PAINTING_WARP_DB 0x00DB // Painting warp (WF Right)
|
||||
#define SURFACE_PAINTING_WARP_DC 0x00DC // Painting warp (JRB Left)
|
||||
#define SURFACE_PAINTING_WARP_DD 0x00DD // Painting warp (JRB Middle)
|
||||
#define SURFACE_PAINTING_WARP_DE 0x00DE // Painting warp (JRB Right)
|
||||
#define SURFACE_PAINTING_WARP_DF 0x00DF // Painting warp (LLL Left)
|
||||
#define SURFACE_PAINTING_WARP_E0 0x00E0 // Painting warp (LLL Middle)
|
||||
#define SURFACE_PAINTING_WARP_E1 0x00E1 // Painting warp (LLL Right)
|
||||
#define SURFACE_PAINTING_WARP_E2 0x00E2 // Painting warp (SSL Left)
|
||||
#define SURFACE_PAINTING_WARP_E3 0x00E3 // Painting warp (SSL Medium)
|
||||
#define SURFACE_PAINTING_WARP_E4 0x00E4 // Painting warp (SSL Right)
|
||||
#define SURFACE_PAINTING_WARP_E5 0x00E5 // Painting warp (Unused - Left)
|
||||
#define SURFACE_PAINTING_WARP_E6 0x00E6 // Painting warp (Unused - Medium)
|
||||
#define SURFACE_PAINTING_WARP_E7 0x00E7 // Painting warp (Unused - Right)
|
||||
#define SURFACE_PAINTING_WARP_E8 0x00E8 // Painting warp (DDD - Left)
|
||||
#define SURFACE_PAINTING_WARP_E9 0x00E9 // Painting warp (DDD - Middle)
|
||||
#define SURFACE_PAINTING_WARP_EA 0x00EA // Painting warp (DDD - Right)
|
||||
#define SURFACE_PAINTING_WARP_EB 0x00EB // Painting warp (WDW Left)
|
||||
#define SURFACE_PAINTING_WARP_EC 0x00EC // Painting warp (WDW Middle)
|
||||
#define SURFACE_PAINTING_WARP_ED 0x00ED // Painting warp (WDW Right)
|
||||
#define SURFACE_PAINTING_WARP_EE 0x00EE // Painting warp (THI Tiny - Left)
|
||||
#define SURFACE_PAINTING_WARP_EF 0x00EF // Painting warp (THI Tiny - Middle)
|
||||
#define SURFACE_PAINTING_WARP_F0 0x00F0 // Painting warp (THI Tiny - Right)
|
||||
#define SURFACE_PAINTING_WARP_F1 0x00F1 // Painting warp (TTM Left)
|
||||
#define SURFACE_PAINTING_WARP_F2 0x00F2 // Painting warp (TTM Middle)
|
||||
#define SURFACE_PAINTING_WARP_F3 0x00F3 // Painting warp (TTM Right)
|
||||
#define SURFACE_TTC_PAINTING_1 0x00F4 // Painting warp (TTC Left)
|
||||
#define SURFACE_TTC_PAINTING_2 0x00F5 // Painting warp (TTC Medium)
|
||||
#define SURFACE_TTC_PAINTING_3 0x00F6 // Painting warp (TTC Right)
|
||||
#define SURFACE_PAINTING_WARP_F7 0x00F7 // Painting warp (SL Left)
|
||||
#define SURFACE_PAINTING_WARP_F8 0x00F8 // Painting warp (SL Middle)
|
||||
#define SURFACE_PAINTING_WARP_F9 0x00F9 // Painting warp (SL Right)
|
||||
#define SURFACE_PAINTING_WARP_FA 0x00FA // Painting warp (THI Tiny - Left)
|
||||
#define SURFACE_PAINTING_WARP_FB 0x00FB // Painting warp (THI Tiny - Middle)
|
||||
#define SURFACE_PAINTING_WARP_FC 0x00FC // Painting warp (THI Tiny - Right)
|
||||
#define SURFACE_WOBBLING_WARP 0x00FD // Pool warp (HMC & DDD)
|
||||
#define SURFACE_TRAPDOOR 0x00FF // Bowser Left trapdoor, has no action defined
|
||||
|
||||
#define SURFACE_IS_QUICKSAND(cmd) (cmd >= 0x21 && cmd < 0x28) // Doesn't include SURFACE_INSTANT_MOVING_QUICKSAND
|
||||
#define SURFACE_IS_NOT_HARD(cmd) (cmd != SURFACE_HARD && \
|
||||
@@ -91,6 +175,7 @@
|
||||
#define TERRAIN_LOAD_IS_SURFACE_TYPE_LOW(cmd) (cmd < 0x40)
|
||||
#define TERRAIN_LOAD_IS_SURFACE_TYPE_HIGH(cmd) (cmd >= 0x65)
|
||||
|
||||
// Terrain types defined by the level script command terrain_type (cmd_31)
|
||||
#define TERRAIN_GRASS 0x0000
|
||||
#define TERRAIN_STONE 0x0001
|
||||
#define TERRAIN_SNOW 0x0002
|
||||
@@ -100,4 +185,39 @@
|
||||
#define TERRAIN_SLIDE 0x0006
|
||||
#define TERRAIN_MASK 0x0007
|
||||
|
||||
// These collision commands are unique "surface" types like those defined higher
|
||||
|
||||
// Collision Data Routine Initiate
|
||||
#define COL_INIT() TERRAIN_LOAD_VERTICES
|
||||
|
||||
// Collision Vertices Read Initiate
|
||||
#define COL_VERTEX_INIT(vtxNum) vtxNum
|
||||
|
||||
// Collision Vertex
|
||||
#define COL_VERTEX(x, y, z) x, y, z
|
||||
|
||||
// Collision Tris Initiate
|
||||
#define COL_TRI_INIT(surfType, triNum) surfType, triNum
|
||||
|
||||
// Collision Tri
|
||||
#define COL_TRI(v1, v2, v3) v1, v2, v3
|
||||
|
||||
// Collision Tri With Special Params
|
||||
#define COL_TRI_SPECIAL(v1, v2, v3, param) v1, v2, v3, param
|
||||
|
||||
// Collision Tris Stop Loading
|
||||
#define COL_TRI_STOP() TERRAIN_LOAD_CONTINUE
|
||||
|
||||
// End Collision Data
|
||||
#define COL_END() TERRAIN_LOAD_END
|
||||
|
||||
// Special Object Initiate
|
||||
#define COL_SPECIAL_INIT(num) TERRAIN_LOAD_OBJECTS, num
|
||||
|
||||
// Water Boxes Initiate
|
||||
#define COL_WATER_BOX_INIT(num) TERRAIN_LOAD_ENVIRONMENT, num
|
||||
|
||||
// Water Box
|
||||
#define COL_WATER_BOX(id, x1, z1, x2, z2, y) id, x1, z1, x2, z2, y
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
# Surface Types
|
||||
.set SURFACE_DEFAULT, 0x0000 # Environment default
|
||||
.set SURFACE_BURNING, 0x0001 # Lava / Frostbite (in SL), but is used mostly for Lava
|
||||
.set SURFACE_0004, 0x0004 # Unused, has no function and has parameters
|
||||
.set SURFACE_HANGABLE, 0x0005 # Ceiling that Mario can climb on
|
||||
.set SURFACE_SLOW, 0x0009 # Slow down Mario, unused
|
||||
.set SURFACE_DEATH_PLANE, 0x000A # Death floor
|
||||
.set SURFACE_CLOSE_CAMERA, 0x000B # Close camera
|
||||
.set SURFACE_WATER, 0x000D # Water, has no action, used on some waterboxes below
|
||||
.set SURFACE_WATER_FLOWING, 0x000E # Water (flowing), has parameters
|
||||
.set SURFACE_INTANGIBLE, 0x0012 # Intangible (Separates BBH mansion from merry-go-round, for room usage)
|
||||
.set SURFACE_VERY_SLIPPERY, 0x0013 # Very slippery, mostly used for slides
|
||||
.set SURFACE_SLIPPERY, 0x0014 # Slippery
|
||||
.set SURFACE_NO_SLIPPERY, 0x0015 # Non-slippery, climbable
|
||||
.set SURFACE_TTM_VINES, 0x0016 # TTM vines, has no action defined
|
||||
.set SURFACE_MGR_MUSIC, 0x001A # Plays the Merry go round music, see handle_merry_go_round_music in bbh_merry_go_round.inc.c for more details
|
||||
.set SURFACE_INST_WARP_1B, 0x001B # Instant warp to another area, used to warp between areas in WDW and the endless stairs to warp back
|
||||
.set SURFACE_INST_WARP_1C, 0x001C # Instant warp to another area, used to warp between areas in WDW
|
||||
.set SURFACE_INST_WARP_1D, 0x001D # Instant warp to another area, used to warp between areas in DDD, SSL and TTM
|
||||
.set SURFACE_INST_WARP_1E, 0x001E # Instant warp to another area, used to warp between areas in DDD, SSL and TTM
|
||||
.set SURFACE_QUICKSAND_21, 0x0021 # Shallow Quicksand (depth of 10 units)
|
||||
.set SURFACE_QUICKSAND_22, 0x0022 # Quicksand (lethal, slow, depth of 160 units)
|
||||
.set SURFACE_QUICKSAND_23, 0x0023 # Quicksand (lethal, instant)
|
||||
.set SURFACE_QUICKSAND_24, 0x0024 # Moving quicksand (flowing, depth of 160 units)
|
||||
.set SURFACE_QUICKSAND_25, 0x0025 # Moving quicksand (flowing, depth of 25 units)
|
||||
.set SURFACE_QUICKSAND_26, 0x0026 # Moving quicksand (60 units)
|
||||
.set SURFACE_QUICKSAND_27, 0x0027 # Moving quicksand (flowing, depth of 60 units)
|
||||
.set SURFACE_WALL_MISC, 0x0028 # Used for some walls, Cannon to adjust the camera, and some objects like Warp Pipe
|
||||
.set SURFACE_NOISE_DEFAULT, 0x0029 # Default floor with noise
|
||||
.set SURFACE_NOISE_SLIPPERY, 0x002A # Slippery floor with noise
|
||||
.set SURFACE_H_WIND, 0x002C # Horizontal wind, has parameters
|
||||
.set SURFACE_QUICKSAND_2D, 0x002D # Quicksand (lethal, flowing)
|
||||
.set SURFACE_ICE, 0x002E # Slippery Ice, in snow levels and THI's water floor
|
||||
.set SURFACE_LOOK_UP_WARP, 0x002F # Look up and warp (Wing cap entrance)
|
||||
.set SURFACE_HARD_FLOOR, 0x0030 # Hard floor (Always has fall damage)
|
||||
.set SURFACE_WARP, 0x0032 # Surface warp
|
||||
.set SURFACE_TIMER_START, 0x0033 # Timer start (Peach's secret slide)
|
||||
.set SURFACE_TIMER_STOP, 0x0034 # Timer stop (Peach's secret slide)
|
||||
.set SURFACE_HARD_SLIP, 0x0035 # Hard and slippery (Always has fall damage)
|
||||
.set SURFACE_HARD_VERY_SLIP, 0x0036 # Hard and very slippery (Always has fall damage)
|
||||
.set SURFACE_HARD_NO_SLIP, 0x0037 # Hard and Non-slippery (Always has fall damage)
|
||||
.set SURFACE_V_WIND, 0x0038 # Death at bottom with vertical wind
|
||||
.set SURFACE_WIDE_CAMERA, 0x0065 # Wide camera for BOB and WF bosses
|
||||
.set SURFACE_FREE_ROAM_CAM, 0x0066 # Free roam camera for THI and TTC
|
||||
.set SURFACE_THI3_WALLKICK, 0x0068 # Surface where there's a wall kick section in THI 3rd area, has no action defined
|
||||
.set SURFACE_CAM_PLATFORM, 0x0069 # Surface that enables far camera for platforms, used in THI
|
||||
.set SURFACE_CAM_MIDDLE, 0x006E # Surface camera that returns to the middle, used on the 4 pillars of SSL
|
||||
.set SURFACE_CAM_ROT_RIGHT, 0x006F # Surface camera that rotates to the right (BITDW & THI)
|
||||
.set SURFACE_CAM_ROT_LEFT, 0x0070 # Surface camera that rotates to the left (BOB & TTM)
|
||||
.set SURFACE_CAM_BOUNDARY, 0x0072 # Intangible Area, only used to restrict camera movement
|
||||
.set SURFACE_NOISE_SLIP_73, 0x0073 # Very slippery floor with noise, unused
|
||||
.set SURFACE_NOISE_SLIP_74, 0x0074 # Very slippery floor with noise, unused
|
||||
.set SURFACE_NOISE_SLIP_75, 0x0075 # Very slippery floor with noise, used in CCM
|
||||
.set SURFACE_CAM_NO_COL, 0x0076 # Surface with no cam collision flag
|
||||
.set SURFACE_CAM_NO_COL_77, 0x0077 # Surface with no cam collision flag, unused
|
||||
.set SURFACE_VERY_SLIP_78, 0x0078 # Surface with no cam collision flag, very slippery with noise (THI)
|
||||
.set SURFACE_SLIPPERY_79, 0x0079 # Surface with no cam collision flag, slippery with noise (CCM, PSS and TTM slides)
|
||||
.set SURFACE_SWITCH, 0x007A # Surface with no cam collision flag, non-slippery with noise, used by switches and Dorrie
|
||||
.set SURFACE_VAN_CAP_WALL, 0x007B # Vanish cap walls, pass through them with Vanish Cap
|
||||
.set SURFACE_PAINT_WOOBLE_A6, 0x00A6 # Painting wobble (BOB, TTM Slide - Left)
|
||||
.set SURFACE_PAINT_WOOBLE_A7, 0x00A7 # Painting wobble (BOB, TTM Slide - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_A8, 0x00A8 # Painting wobble (BOB, TTM Slide - Right)
|
||||
.set SURFACE_PAINT_WOOBLE_A9, 0x00A9 # Painting wobble (CCM Left)
|
||||
.set SURFACE_PAINT_WOOBLE_AA, 0x00AA # Painting wobble (CCM Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_AB, 0x00AB # Painting wobble (CCM Right)
|
||||
.set SURFACE_PAINT_WOOBLE_AC, 0x00AC # Painting wobble (WF Left)
|
||||
.set SURFACE_PAINT_WOOBLE_AD, 0x00AD # Painting wobble (WF Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_AE, 0x00AE # Painting wobble (WF Right)
|
||||
.set SURFACE_PAINT_WOOBLE_AF, 0x00AF # Painting wobble (JRB Left)
|
||||
.set SURFACE_PAINT_WOOBLE_B0, 0x00B0 # Painting wobble (JRB Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_B1, 0x00B1 # Painting wobble (JRB Right)
|
||||
.set SURFACE_PAINT_WOOBLE_B2, 0x00B2 # Painting wobble (LLL Left)
|
||||
.set SURFACE_PAINT_WOOBLE_B3, 0x00B3 # Painting wobble (LLL Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_B4, 0x00B4 # Painting wobble (LLL Right)
|
||||
.set SURFACE_PAINT_WOOBLE_B5, 0x00B5 # Painting wobble (SSL Left)
|
||||
.set SURFACE_PAINT_WOOBLE_B6, 0x00B6 # Painting wobble (SSL Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_B7, 0x00B7 # Painting wobble (SSL Right)
|
||||
.set SURFACE_PAINT_WOOBLE_B8, 0x00B8 # Painting wobble (Unused - Left)
|
||||
.set SURFACE_PAINT_WOOBLE_B9, 0x00B9 # Painting wobble (Unused - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_BA, 0x00BA # Painting wobble (Unused - Right)
|
||||
.set SURFACE_PAINT_WOOBLE_BB, 0x00BB # Painting wobble (DDD - Left), makes the painting wobble if touched
|
||||
.set SURFACE_PAINT_WOOBLE_BC, 0x00BC # Painting wobble (Unused, DDD - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_BD, 0x00BD # Painting wobble (Unused, DDD - Right)
|
||||
.set SURFACE_PAINT_WOOBLE_BE, 0x00BE # Painting wobble (WDW Left)
|
||||
.set SURFACE_PAINT_WOOBLE_BF, 0x00BF # Painting wobble (WDW Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_C0, 0x00C0 # Painting wobble (WDW Right)
|
||||
.set SURFACE_PAINT_WOOBLE_C1, 0x00C1 # Painting wobble (THI Tiny - Left)
|
||||
.set SURFACE_PAINT_WOOBLE_C2, 0x00C2 # Painting wobble (THI Tiny - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_C3, 0x00C3 # Painting wobble (THI Tiny - Right)
|
||||
.set SURFACE_PAINT_WOOBLE_C4, 0x00C4 # Painting wobble (TTM Left)
|
||||
.set SURFACE_PAINT_WOOBLE_C5, 0x00C5 # Painting wobble (TTM Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_C6, 0x00C6 # Painting wobble (TTM Right)
|
||||
.set SURFACE_PAINT_WOOBLE_C7, 0x00C7 # Painting wobble (Unused, TTC - Left)
|
||||
.set SURFACE_PAINT_WOOBLE_C8, 0x00C8 # Painting wobble (Unused, TTC - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_C9, 0x00C9 # Painting wobble (Unused, TTC - Right)
|
||||
.set SURFACE_PAINT_WOOBLE_CA, 0x00CA # Painting wobble (Unused, SL - Left)
|
||||
.set SURFACE_PAINT_WOOBLE_CB, 0x00CB # Painting wobble (Unused, SL - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_CC, 0x00CC # Painting wobble (Unused, SL - Right)
|
||||
.set SURFACE_PAINT_WOOBLE_CD, 0x00CD # Painting wobble (THI Huge - Left)
|
||||
.set SURFACE_PAINT_WOOBLE_CE, 0x00CE # Painting wobble (THI Huge - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_CF, 0x00CF # Painting wobble (THI Huge - Right)
|
||||
.set SURFACE_PAINT_WOOBLE_D0, 0x00D0 # Painting wobble (HMC & COTMC - Left), makes the painting wobble if touched
|
||||
.set SURFACE_PAINT_WOOBLE_D1, 0x00D1 # Painting wobble (Unused, HMC & COTMC - Middle)
|
||||
.set SURFACE_PAINT_WOOBLE_D2, 0x00D2 # Painting wobble (Unused, HMC & COTMC - Right)
|
||||
.set SURFACE_PAINT_WARP_D3, 0x00D3 # Painting warp (BOB, TTM Slide - Left)
|
||||
.set SURFACE_PAINT_WARP_D4, 0x00D4 # Painting warp (BOB, TTM Slide - Middle)
|
||||
.set SURFACE_PAINT_WARP_D5, 0x00D5 # Painting warp (BOB, TTM Slide - Right)
|
||||
.set SURFACE_PAINT_WARP_D6, 0x00D6 # Painting warp (CCM Left)
|
||||
.set SURFACE_PAINT_WARP_D7, 0x00D7 # Painting warp (CCM Middle)
|
||||
.set SURFACE_PAINT_WARP_D8, 0x00D8 # Painting warp (CCM Right)
|
||||
.set SURFACE_PAINT_WARP_D9, 0x00D9 # Painting warp (WF Left)
|
||||
.set SURFACE_PAINT_WARP_DA, 0x00DA # Painting warp (WF Middle)
|
||||
.set SURFACE_PAINT_WARP_DB, 0x00DB # Painting warp (WF Right)
|
||||
.set SURFACE_PAINT_WARP_DC, 0x00DC # Painting warp (JRB Left)
|
||||
.set SURFACE_PAINT_WARP_DD, 0x00DD # Painting warp (JRB Middle)
|
||||
.set SURFACE_PAINT_WARP_DE, 0x00DE # Painting warp (JRB Right)
|
||||
.set SURFACE_PAINT_WARP_DF, 0x00DF # Painting warp (LLL Left)
|
||||
.set SURFACE_PAINT_WARP_E0, 0x00E0 # Painting warp (LLL Middle)
|
||||
.set SURFACE_PAINT_WARP_E1, 0x00E1 # Painting warp (LLL Right)
|
||||
.set SURFACE_PAINT_WARP_E2, 0x00E2 # Painting warp (SSL Left)
|
||||
.set SURFACE_PAINT_WARP_E3, 0x00E3 # Painting warp (SSL Medium)
|
||||
.set SURFACE_PAINT_WARP_E4, 0x00E4 # Painting warp (SSL Right)
|
||||
.set SURFACE_PAINT_WARP_E5, 0x00E5 # Painting warp (Unused - Left)
|
||||
.set SURFACE_PAINT_WARP_E6, 0x00E6 # Painting warp (Unused - Medium)
|
||||
.set SURFACE_PAINT_WARP_E7, 0x00E7 # Painting warp (Unused - Right)
|
||||
.set SURFACE_PAINT_WARP_E8, 0x00E8 # Painting warp (DDD - Left)
|
||||
.set SURFACE_PAINT_WARP_E9, 0x00E9 # Painting warp (DDD - Middle)
|
||||
.set SURFACE_PAINT_WARP_EA, 0x00EA # Painting warp (DDD - Right)
|
||||
.set SURFACE_PAINT_WARP_EB, 0x00EB # Painting warp (WDW Left)
|
||||
.set SURFACE_PAINT_WARP_EC, 0x00EC # Painting warp (WDW Middle)
|
||||
.set SURFACE_PAINT_WARP_ED, 0x00ED # Painting warp (WDW Right)
|
||||
.set SURFACE_PAINT_WARP_EE, 0x00EE # Painting warp (THI Tiny - Left)
|
||||
.set SURFACE_PAINT_WARP_EF, 0x00EF # Painting warp (THI Tiny - Middle)
|
||||
.set SURFACE_PAINT_WARP_F0, 0x00F0 # Painting warp (THI Tiny - Right)
|
||||
.set SURFACE_PAINT_WARP_F1, 0x00F1 # Painting warp (TTM Left)
|
||||
.set SURFACE_PAINT_WARP_F2, 0x00F2 # Painting warp (TTM Middle)
|
||||
.set SURFACE_PAINT_WARP_F3, 0x00F3 # Painting warp (TTM Right)
|
||||
.set SURFACE_PAINT_WARP_F4, 0x00F4 # Painting warp (TTC Left)
|
||||
.set SURFACE_PAINT_WARP_F5, 0x00F5 # Painting warp (TTC Middle)
|
||||
.set SURFACE_PAINT_WARP_F6, 0x00F6 # Painting warp (TTC Right)
|
||||
.set SURFACE_PAINT_WARP_F7, 0x00F7 # Painting warp (SL Left)
|
||||
.set SURFACE_PAINT_WARP_F8, 0x00F8 # Painting warp (SL Middle)
|
||||
.set SURFACE_PAINT_WARP_F9, 0x00F9 # Painting warp (SL Right)
|
||||
.set SURFACE_PAINT_WARP_FA, 0x00FA # Painting warp (THI Tiny - Left)
|
||||
.set SURFACE_PAINT_WARP_FB, 0x00FB # Painting warp (THI Tiny - Middle)
|
||||
.set SURFACE_PAINT_WARP_FC, 0x00FC # Painting warp (THI Tiny - Right)
|
||||
.set SURFACE_WOBBLING_WARP, 0x00FD # Pool warp (HMC & DDD)
|
||||
.set SURFACE_TRAPDOOR, 0x00FF # Bowser Left trapdoor, has no action defined
|
||||
|
||||
# These collision commands are unique "surface" types like those defined higher
|
||||
|
||||
# Collision Data Routine Initiate
|
||||
.macro colInit
|
||||
.hword 0x0040
|
||||
.endm
|
||||
|
||||
# Collision Vertices Read Initiate
|
||||
.macro colVertexInit vtxNum
|
||||
.hword \vtxNum
|
||||
.endm
|
||||
|
||||
# Collision Vertex
|
||||
.macro colVertex x, y, z
|
||||
.hword \x, \y, \z
|
||||
.endm
|
||||
|
||||
# Collision Tris Initiate
|
||||
.macro colTriInit surfType, triNum
|
||||
.hword \surfType
|
||||
.hword \triNum
|
||||
.endm
|
||||
|
||||
# Collision Tri
|
||||
.macro colTri v1, v2, v3
|
||||
.hword \v1, \v2, \v3
|
||||
.endm
|
||||
|
||||
# Collision Tri With Special Params
|
||||
.macro colTriSpecial v1, v2, v3, param
|
||||
.hword \v1, \v2, \v3, \param
|
||||
.endm
|
||||
|
||||
# Collision Tris Stop Loading
|
||||
.macro colTriStop
|
||||
.hword 0x0041
|
||||
.endm
|
||||
|
||||
# End Collision Data
|
||||
.macro colEnd
|
||||
.hword 0x0042
|
||||
.endm
|
||||
|
||||
# Special Object Initiate
|
||||
.macro colSpecialInit num
|
||||
.hword 0x0043
|
||||
.hword \num
|
||||
.endm
|
||||
|
||||
# Water Boxes Initiate
|
||||
.macro colWaterBoxInit num
|
||||
.hword 0x0044
|
||||
.hword \num
|
||||
.endm
|
||||
|
||||
# Water Box
|
||||
.macro colWaterBox id, x1, z1, x2, z2, y
|
||||
.hword \id
|
||||
.hword \x1, \z1
|
||||
.hword \x2, \z2
|
||||
.hword \y
|
||||
.endm
|
||||
|
||||
# Terrain types defined by the level script command terrain_type (cmd_31)
|
||||
.set TERRAIN_GRASS, 0x0000
|
||||
.set TERRAIN_STONE, 0x0001
|
||||
.set TERRAIN_SNOW, 0x0002
|
||||
.set TERRAIN_SAND, 0x0003
|
||||
.set TERRAIN_SPOOKY, 0x0004
|
||||
.set TERRAIN_WATER, 0x0005
|
||||
.set TERRAIN_SLIDE, 0x0006
|
||||
.set TERRAIN_MASK, 0x0007
|
||||
@@ -0,0 +1,284 @@
|
||||
#ifndef TEXTURES_H
|
||||
#define TEXTURES_H
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
// cave
|
||||
extern const u8 cave_09000000[];
|
||||
extern const u8 cave_09001000[];
|
||||
extern const u8 cave_09001800[];
|
||||
extern const u8 cave_09002000[];
|
||||
extern const u8 cave_09002800[];
|
||||
extern const u8 cave_09003000[];
|
||||
extern const u8 cave_09003800[];
|
||||
extern const u8 cave_09004800[];
|
||||
extern const u8 cave_09005800[];
|
||||
extern const u8 cave_09006800[];
|
||||
extern const u8 cave_09007000[];
|
||||
extern const u8 cave_09007800[];
|
||||
extern const u8 cave_09008800[];
|
||||
extern const u8 cave_09009800[];
|
||||
extern const u8 cave_0900A000[];
|
||||
extern const u8 cave_0900A800[];
|
||||
extern const u8 cave_0900B800[];
|
||||
extern const u8 cave_0900C000[];
|
||||
|
||||
// fire
|
||||
extern const u8 fire_09000000[];
|
||||
extern const u8 fire_09000800[];
|
||||
extern const u8 fire_09001000[];
|
||||
extern const u8 fire_09001800[];
|
||||
extern const u8 fire_09002000[];
|
||||
extern const u8 fire_09002800[];
|
||||
extern const u8 fire_09003000[];
|
||||
extern const u8 fire_09003800[];
|
||||
extern const u8 fire_09004000[];
|
||||
extern const u8 fire_09004800[];
|
||||
extern const u8 fire_09005000[];
|
||||
extern const u8 fire_09005800[];
|
||||
extern const u8 fire_09006000[];
|
||||
extern const u8 fire_09006800[];
|
||||
extern const u8 fire_09007000[];
|
||||
extern const u8 fire_09007800[];
|
||||
extern const u8 fire_09008000[];
|
||||
extern const u8 fire_09008800[];
|
||||
extern const u8 fire_09009000[];
|
||||
extern const u8 fire_09009800[];
|
||||
extern const u8 fire_0900A000[];
|
||||
extern const u8 fire_0900A800[];
|
||||
extern const u8 fire_0900B000[];
|
||||
extern const u8 fire_0900B800[];
|
||||
|
||||
// generic
|
||||
extern const u8 generic_09000000[];
|
||||
extern const u8 generic_09000800[];
|
||||
extern const u8 generic_09001000[];
|
||||
extern const u8 generic_09001800[];
|
||||
extern const u8 generic_09002000[];
|
||||
extern const u8 generic_09002800[];
|
||||
extern const u8 generic_09003000[];
|
||||
extern const u8 generic_09003800[];
|
||||
extern const u8 generic_09004000[];
|
||||
extern const u8 generic_09004800[];
|
||||
extern const u8 generic_09005000[];
|
||||
extern const u8 generic_09005800[];
|
||||
extern const u8 generic_09006000[];
|
||||
extern const u8 generic_09007000[];
|
||||
extern const u8 generic_09007800[];
|
||||
extern const u8 generic_09008000[];
|
||||
extern const u8 generic_09008800[];
|
||||
extern const u8 generic_09009000[];
|
||||
extern const u8 generic_09009800[];
|
||||
extern const u8 generic_0900A000[];
|
||||
extern const u8 generic_0900A800[];
|
||||
extern const u8 generic_0900B000[];
|
||||
|
||||
// grass
|
||||
extern const u8 grass_09000000[];
|
||||
extern const u8 grass_09000800[];
|
||||
extern const u8 grass_09001000[];
|
||||
extern const u8 grass_09001800[];
|
||||
extern const u8 grass_09002000[];
|
||||
extern const u8 grass_09002800[];
|
||||
extern const u8 grass_09003000[];
|
||||
extern const u8 grass_09003800[];
|
||||
extern const u8 grass_09004000[];
|
||||
extern const u8 grass_09004800[];
|
||||
extern const u8 grass_09005000[];
|
||||
extern const u8 grass_09005800[];
|
||||
extern const u8 grass_09006000[];
|
||||
extern const u8 grass_09006800[];
|
||||
extern const u8 grass_09007000[];
|
||||
extern const u8 grass_09007800[];
|
||||
extern const u8 grass_09008000[];
|
||||
extern const u8 grass_09008800[];
|
||||
extern const u8 grass_09009000[];
|
||||
extern const u8 grass_09009800[];
|
||||
extern const u8 grass_0900A000[];
|
||||
extern const u8 grass_0900A800[];
|
||||
extern const u8 grass_0900B000[];
|
||||
extern const u8 grass_0900B800[];
|
||||
|
||||
// inside
|
||||
extern const u8 inside_09000000[];
|
||||
extern const u8 inside_09001000[];
|
||||
extern const u8 inside_09002000[];
|
||||
extern const u8 inside_09003000[];
|
||||
extern const u8 inside_09003800[];
|
||||
extern const u8 inside_09004000[];
|
||||
extern const u8 inside_09004800[];
|
||||
extern const u8 inside_09005000[];
|
||||
extern const u8 inside_09005800[];
|
||||
extern const u8 inside_09006000[];
|
||||
extern const u8 inside_09007000[];
|
||||
extern const u8 inside_09008000[];
|
||||
extern const u8 inside_09008800[];
|
||||
extern const u8 inside_09009000[];
|
||||
extern const u8 inside_09009800[];
|
||||
extern const u8 inside_0900A000[];
|
||||
extern const u8 inside_0900B000[];
|
||||
extern const u8 inside_0900B800[];
|
||||
|
||||
// machine
|
||||
extern const u8 machine_09000000[];
|
||||
extern const u8 machine_09000800[];
|
||||
extern const u8 machine_09001000[];
|
||||
extern const u8 machine_09001800[];
|
||||
extern const u8 machine_09002000[];
|
||||
extern const u8 machine_09002800[];
|
||||
extern const u8 machine_09003000[];
|
||||
extern const u8 machine_09003800[];
|
||||
extern const u8 machine_09004000[];
|
||||
extern const u8 machine_09005000[];
|
||||
extern const u8 machine_09005800[];
|
||||
extern const u8 machine_09006000[];
|
||||
extern const u8 machine_09006800[];
|
||||
extern const u8 machine_09007000[];
|
||||
extern const u8 machine_09007800[];
|
||||
extern const u8 machine_09008000[];
|
||||
extern const u8 machine_09008400[];
|
||||
|
||||
// mountain
|
||||
extern const u8 mountain_09000000[];
|
||||
extern const u8 mountain_09000800[];
|
||||
extern const u8 mountain_09001800[];
|
||||
extern const u8 mountain_09002000[];
|
||||
extern const u8 mountain_09002800[];
|
||||
extern const u8 mountain_09003000[];
|
||||
extern const u8 mountain_09003800[];
|
||||
extern const u8 mountain_09004000[];
|
||||
extern const u8 mountain_09004800[];
|
||||
extern const u8 mountain_09005000[];
|
||||
extern const u8 mountain_09005800[];
|
||||
extern const u8 mountain_09006000[];
|
||||
extern const u8 mountain_09006800[];
|
||||
extern const u8 mountain_09007000[];
|
||||
extern const u8 mountain_09007800[];
|
||||
extern const u8 mountain_09008000[];
|
||||
extern const u8 mountain_09008800[];
|
||||
extern const u8 mountain_09009800[];
|
||||
extern const u8 mountain_0900A000[];
|
||||
extern const u8 mountain_0900A800[];
|
||||
extern const u8 mountain_0900B000[];
|
||||
extern const u8 mountain_0900B800[];
|
||||
extern const u8 mountain_0900C000[];
|
||||
|
||||
// outside
|
||||
extern const u8 outside_09000000[];
|
||||
extern const u8 outside_09000800[];
|
||||
extern const u8 outside_09001000[];
|
||||
extern const u8 outside_09002000[];
|
||||
extern const u8 outside_09003000[];
|
||||
extern const u8 outside_09003800[];
|
||||
extern const u8 outside_09004000[];
|
||||
extern const u8 outside_09004800[];
|
||||
extern const u8 outside_09005800[];
|
||||
extern const u8 outside_09006000[];
|
||||
extern const u8 outside_09006800[];
|
||||
extern const u8 outside_09007800[];
|
||||
extern const u8 outside_09008000[];
|
||||
extern const u8 outside_09008800[];
|
||||
extern const u8 outside_09009000[];
|
||||
extern const u8 outside_09009800[];
|
||||
extern const u8 outside_0900A000[];
|
||||
extern const u8 outside_0900A800[];
|
||||
extern const u8 outside_0900B000[];
|
||||
extern const u8 outside_0900B400[];
|
||||
extern const u8 outside_0900BC00[];
|
||||
|
||||
// sky
|
||||
extern const u8 sky_09000000[];
|
||||
extern const u8 sky_09000800[];
|
||||
extern const u8 sky_09001000[];
|
||||
extern const u8 sky_09001800[];
|
||||
extern const u8 sky_09002000[];
|
||||
extern const u8 sky_09003000[];
|
||||
extern const u8 sky_09003800[];
|
||||
extern const u8 sky_09004800[];
|
||||
extern const u8 sky_09005000[];
|
||||
extern const u8 sky_09005800[];
|
||||
extern const u8 sky_09006000[];
|
||||
extern const u8 texture_metal_hole[];
|
||||
extern const u8 sky_09007000[];
|
||||
extern const u8 sky_09007800[];
|
||||
extern const u8 sky_09008000[];
|
||||
|
||||
// snow
|
||||
extern const u8 snow_09000000[];
|
||||
extern const u8 snow_09000800[];
|
||||
extern const u8 snow_09001000[];
|
||||
extern const u8 snow_09002000[];
|
||||
extern const u8 snow_09002800[];
|
||||
extern const u8 snow_09003000[];
|
||||
extern const u8 snow_09003800[];
|
||||
extern const u8 snow_09004000[];
|
||||
extern const u8 snow_09004800[];
|
||||
extern const u8 snow_09005000[];
|
||||
extern const u8 snow_09005800[];
|
||||
extern const u8 snow_09006000[];
|
||||
extern const u8 snow_09006800[];
|
||||
extern const u8 snow_09007000[];
|
||||
extern const u8 snow_09008000[];
|
||||
extern const u8 snow_09008800[];
|
||||
extern const u8 snow_09009000[];
|
||||
extern const u8 snow_09009800[];
|
||||
|
||||
// spooky
|
||||
extern const u8 spooky_09000000[];
|
||||
extern const u8 spooky_09000800[];
|
||||
extern const u8 spooky_09001000[];
|
||||
extern const u8 spooky_09001800[];
|
||||
extern const u8 spooky_09002800[];
|
||||
extern const u8 spooky_09003800[];
|
||||
extern const u8 spooky_09004800[];
|
||||
extern const u8 spooky_09005000[];
|
||||
extern const u8 spooky_09006000[];
|
||||
extern const u8 spooky_09006800[];
|
||||
extern const u8 spooky_09007000[];
|
||||
extern const u8 spooky_09008000[];
|
||||
extern const u8 spooky_09008800[];
|
||||
extern const u8 spooky_09009000[];
|
||||
extern const u8 spooky_0900A000[];
|
||||
extern const u8 spooky_0900A800[];
|
||||
extern const u8 spooky_0900B000[];
|
||||
extern const u8 spooky_0900B800[];
|
||||
|
||||
// water
|
||||
extern const u8 water_09000000[];
|
||||
extern const u8 water_09000800[];
|
||||
extern const u8 water_09001800[];
|
||||
extern const u8 water_09002800[];
|
||||
extern const u8 water_09003800[];
|
||||
extern const u8 water_09004800[];
|
||||
extern const u8 water_09005800[];
|
||||
extern const u8 water_09006000[];
|
||||
extern const u8 water_09006800[];
|
||||
extern const u8 water_09007800[];
|
||||
extern const u8 water_09008800[];
|
||||
extern const u8 water_09009000[];
|
||||
extern const u8 water_0900A000[];
|
||||
extern const u8 water_0900A800[];
|
||||
extern const u8 water_0900B800[];
|
||||
|
||||
// effect
|
||||
extern const u8 *const flower_bubbles_textures_ptr_0B002008[];
|
||||
extern const u8 *const lava_bubble_ptr_0B006020[];
|
||||
extern const u8 *const bubble_ptr_0B006848[];
|
||||
extern const Gfx tiny_bubble_dl_0B006A50[];
|
||||
extern const Gfx tiny_bubble_dl_0B006AB0[];
|
||||
extern const Gfx tiny_bubble_dl_0B006CD8[];
|
||||
extern const Gfx tiny_bubble_dl_0B006D38[];
|
||||
extern const Gfx tiny_bubble_dl_0B006D68[];
|
||||
|
||||
// title_screen_bg
|
||||
extern const Gfx title_screen_bg_dl_0A000100[];
|
||||
extern const Gfx title_screen_bg_dl_0A000118[];
|
||||
extern const Gfx title_screen_bg_dl_0A000130[];
|
||||
extern const Gfx title_screen_bg_dl_0A000148[];
|
||||
extern const Gfx title_screen_bg_dl_0A000160[];
|
||||
extern const Gfx title_screen_bg_dl_0A000178[];
|
||||
extern const Gfx title_screen_bg_dl_0A000190[];
|
||||
extern const u8 *const mario_title_texture_table[];
|
||||
extern const u8 *const game_over_texture_table[];
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
+37
-16
@@ -5,6 +5,7 @@
|
||||
// have an appropriate header.
|
||||
|
||||
#include <ultra64.h>
|
||||
#include "macros.h"
|
||||
|
||||
struct Controller
|
||||
{
|
||||
@@ -28,6 +29,15 @@ typedef s16 Vec4s[4];
|
||||
|
||||
typedef f32 Mat4[4][4];
|
||||
|
||||
typedef uintptr_t GeoLayout;
|
||||
typedef uintptr_t LevelScript;
|
||||
typedef s16 Movtex;
|
||||
typedef s16 MacroObject;
|
||||
typedef s16 Collision;
|
||||
typedef s16 Trajectory;
|
||||
typedef s16 PaintingData;
|
||||
typedef uintptr_t BehaviorScript;
|
||||
|
||||
enum SpTaskState {
|
||||
SPTASK_STATE_NOT_STARTED,
|
||||
SPTASK_STATE_RUNNING,
|
||||
@@ -50,9 +60,6 @@ struct VblankHandler
|
||||
OSMesg msg;
|
||||
};
|
||||
|
||||
// NOTE: Since ObjectNode is the first member of Object, it is difficult to determine
|
||||
// whether some of these pointers point to ObjectNode or Object.
|
||||
|
||||
#define ANIM_FLAG_NOLOOP (1 << 0) // 0x01
|
||||
#define ANIM_FLAG_FORWARD (1 << 1) // 0x02
|
||||
#define ANIM_FLAG_2 (1 << 2) // 0x04
|
||||
@@ -69,11 +76,13 @@ struct Animation {
|
||||
/*0x06*/ s16 unk06;
|
||||
/*0x08*/ s16 unk08;
|
||||
/*0x0A*/ s16 unk0A;
|
||||
/*0x0C*/ void *values;
|
||||
/*0x10*/ void *index;
|
||||
/*0x0C*/ const s16 *values;
|
||||
/*0x10*/ const u16 *index;
|
||||
/*0x14*/ u32 length; // only used with Mario animations to determine how much to load. 0 otherwise.
|
||||
};
|
||||
|
||||
#define ANIMINDEX_NUMPARTS(animindex) (sizeof(animindex) / sizeof(u16) / 6 - 1)
|
||||
|
||||
struct GraphNode
|
||||
{
|
||||
/*0x00*/ s16 type; // structure type
|
||||
@@ -96,7 +105,6 @@ struct GraphNodeObject_sub
|
||||
/*0x10 0x48*/ s32 animAccel;
|
||||
};
|
||||
|
||||
// TODO this is the first member of ObjectNode/Object
|
||||
struct GraphNodeObject
|
||||
{
|
||||
/*0x00*/ struct GraphNode node;
|
||||
@@ -119,6 +127,9 @@ struct ObjectNode
|
||||
struct ObjectNode *prev;
|
||||
};
|
||||
|
||||
// NOTE: Since ObjectNode is the first member of Object, it is difficult to determine
|
||||
// whether some of these pointers point to ObjectNode or Object.
|
||||
|
||||
struct Object
|
||||
{
|
||||
/*0x000*/ struct ObjectNode header;
|
||||
@@ -136,6 +147,7 @@ struct Object
|
||||
s32 asS32[0x50];
|
||||
s16 asS16[0x50][2];
|
||||
f32 asF32[0x50];
|
||||
#if !IS_64_BIT
|
||||
s16 *asS16P[0x50];
|
||||
s32 *asS32P[0x50];
|
||||
struct Animation **asAnims[0x50];
|
||||
@@ -144,9 +156,24 @@ struct Object
|
||||
struct Object *asObject[0x50];
|
||||
struct Surface *asSurface[0x50];
|
||||
void *asVoidPtr[0x50];
|
||||
const void *asConstVoidPtr[0x50];
|
||||
#endif
|
||||
} rawData;
|
||||
#if IS_64_BIT
|
||||
union {
|
||||
s16 *asS16P[0x50];
|
||||
s32 *asS32P[0x50];
|
||||
struct Animation **asAnims[0x50];
|
||||
struct Waypoint *asWaypoint[0x50];
|
||||
struct ChainSegment *asChainSegment[0x50];
|
||||
struct Object *asObject[0x50];
|
||||
struct Surface *asSurface[0x50];
|
||||
void *asVoidPtr[0x50];
|
||||
const void *asConstVoidPtr[0x50];
|
||||
} ptrData;
|
||||
#endif
|
||||
/*0x1C8*/ u32 unused1;
|
||||
/*0x1CC*/ uintptr_t *behScript;
|
||||
/*0x1CC*/ const BehaviorScript *behScript;
|
||||
/*0x1D0*/ u32 stackIndex;
|
||||
/*0x1D4*/ uintptr_t stack[8];
|
||||
/*0x1F4*/ s16 unk1F4;
|
||||
@@ -156,7 +183,7 @@ struct Object
|
||||
/*0x200*/ f32 hurtboxRadius;
|
||||
/*0x204*/ f32 hurtboxHeight;
|
||||
/*0x208*/ f32 hitboxDownOffset;
|
||||
/*0x20C*/ void *behavior;
|
||||
/*0x20C*/ const BehaviorScript *behavior;
|
||||
/*0x210*/ u32 unused2;
|
||||
/*0x214*/ struct Object *platform;
|
||||
/*0x218*/ void *collisionData;
|
||||
@@ -219,7 +246,7 @@ struct MarioBodyState
|
||||
u8 padding[4];
|
||||
};
|
||||
|
||||
struct MarioAnimSub
|
||||
struct OffsetSizePair
|
||||
{
|
||||
u32 offset;
|
||||
u32 size;
|
||||
@@ -229,7 +256,7 @@ struct MarioAnimDmaRelatedThing
|
||||
{
|
||||
u32 count;
|
||||
u8 *srcAddr;
|
||||
struct MarioAnimSub anim[1]; // dynamic size
|
||||
struct OffsetSizePair anim[1]; // dynamic size
|
||||
};
|
||||
|
||||
struct MarioAnimation
|
||||
@@ -304,10 +331,4 @@ struct MarioState
|
||||
/*0xC4*/ f32 unkC4;
|
||||
};
|
||||
|
||||
struct StructGeo802D2360
|
||||
{
|
||||
s32 unk0;
|
||||
s32 *unk4;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef _LANGUAGE_C
|
||||
#define _LANGUAGE_C
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/os_exception.h>
|
||||
#include <PR/os_misc.h>
|
||||
|
||||
Reference in New Issue
Block a user