mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
game_ui.c rework (#493)
* got overzealous with the alignments * small knowledge improvement on models * true * add enum size entries for easy ref * bgload names I forgot to merge in * transition memes * absinthe * brug * anguish * hell * getting there * misery * Update README.md * Update include/structs.h Co-authored-by: Ryan Myers <ryan.p.myers@gmail.com> * format moment * Delete object_animate.s * Update obj_animate.s * remembered to rename this --------- Co-authored-by: Ryan Myers <ryan.p.myers@gmail.com>
This commit is contained in:
@@ -275,7 +275,6 @@ $(GCC_SAFE_FILES): CFLAGS := -DNDEBUG -DAVOID_UB -DNON_MATCHING -O2 $(INCLUDE_CF
|
||||
-fno-zero-initialized-in-bss \
|
||||
-fsingle-precision-constant \
|
||||
-funsigned-char \
|
||||
-mips3 \
|
||||
-fwrapv \
|
||||
-falign-functions=16 \
|
||||
-G 0
|
||||
|
||||
@@ -5,11 +5,11 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the
|
||||
All versions are supported, and the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fda38e533b9fe63bb9670) of the game is the default if not specified.
|
||||
|
||||
<!-- README_SCORE_SUMMARY_BEGIN -->
|
||||
As of March 20, 2025, this is our current score:
|
||||
As of March 28, 2025, this is our current score:
|
||||
|
||||
    Decomp progress: 75.88%
|
||||
    Decomp progress: 76.84%
|
||||
|
||||
    Documentation progress: 50.30%
|
||||
    Documentation progress: 49.86%
|
||||
<!-- README_SCORE_SUMMARY_END -->
|
||||
|
||||
---
|
||||
@@ -117,30 +117,30 @@ s32 is_drumstick_unlocked(void) {
|
||||
```
|
||||
|
||||
<!-- README_SCORE_BEGIN -->
|
||||
As of March 20, 2025, this is our current score:
|
||||
As of March 28, 2025, this is our current score:
|
||||
```
|
||||
=======================================================================
|
||||
ADVENTURE ONE (ASM -> C Decompilation)
|
||||
---------------- 75.88% Complete (78.10% NON_MATCHING) ----------------
|
||||
# Decompiled functions: 1831
|
||||
# GLOBAL_ASM remaining: 110
|
||||
# NON_MATCHING functions: 13
|
||||
# NON_EQUIVALENT WIP functions: 36
|
||||
---------------- 76.84% Complete (79.45% NON_MATCHING) ----------------
|
||||
# Decompiled functions: 1837
|
||||
# GLOBAL_ASM remaining: 114
|
||||
# NON_MATCHING functions: 14
|
||||
# NON_EQUIVALENT WIP functions: 35
|
||||
----------------------------- Game Status -----------------------------
|
||||
Balloons: 36/47, Keys: 4/4, Trophies: 3/5
|
||||
T.T. Amulets: 4/4, Wizpig Amulets: 3/4
|
||||
-----------------------------------------------------------------------
|
||||
We are collecting silver coins in Greenwood Village. (0/8 silver coins)
|
||||
We are collecting silver coins in Greenwood Village. (6/8 silver coins)
|
||||
=======================================================================
|
||||
ADVENTURE TWO (Cleanup & Documentation)
|
||||
--------------------------- 50.30% Complete ---------------------------
|
||||
# Documented functions: 1092
|
||||
# Undocumented remaining: 555
|
||||
--------------------------- 49.86% Complete ---------------------------
|
||||
# Documented functions: 1088
|
||||
# Undocumented remaining: 566
|
||||
----------------------------- Game Status -----------------------------
|
||||
Balloons: 25/47, Keys: 3/4, Trophies: 2/5
|
||||
Balloons: 24/47, Keys: 3/4, Trophies: 2/5
|
||||
T.T. Amulets: 2/4, Wizpig Amulets: 2/4
|
||||
-----------------------------------------------------------------------
|
||||
We are racing in Treasure Caves. (Lap 1/3)
|
||||
We are racing in Pirate Lagoon. (Lap 3/3)
|
||||
=======================================================================
|
||||
```
|
||||
<!-- README_SCORE_END -->
|
||||
|
||||
+63
-21
@@ -55,7 +55,9 @@ typedef enum AssetSectionsEnum {
|
||||
ASSET_BINARY_46,
|
||||
ASSET_BINARY_47,
|
||||
ASSET_TTGHOSTS_TABLE,
|
||||
ASSET_TTGHOSTS
|
||||
ASSET_TTGHOSTS,
|
||||
|
||||
ASSET_SECTIONS_COUNT
|
||||
} AssetSectionsEnum;
|
||||
|
||||
/********** ASSET_AI_BEHAVIOUR **********/
|
||||
@@ -70,7 +72,9 @@ typedef enum AssetAiBehaviourEnum {
|
||||
ASSET_AI_BEHAVIOUR_6,
|
||||
ASSET_AI_BEHAVIOUR_7,
|
||||
ASSET_AI_BEHAVIOUR_8,
|
||||
ASSET_AI_BEHAVIOUR_9
|
||||
ASSET_AI_BEHAVIOUR_9,
|
||||
|
||||
ASSET_AI_BEHAVIOUR_COUNT
|
||||
} AssetAiBehaviourEnum;
|
||||
|
||||
/********** ASSET_TEXTURES_3D **********/
|
||||
@@ -1476,7 +1480,9 @@ typedef enum AssetTextures3dEnum {
|
||||
ASSET_TEX3D_COMMON_SAND6,
|
||||
ASSET_TEX3D_TROPICAL_PALMTREESHADOWLONG,
|
||||
ASSET_TEX3D_COMMON_DEBUGBLACKWHITE,
|
||||
ASSET_TEX3D_SPACE_RAREWARESIGNNONBLINKING
|
||||
ASSET_TEX3D_SPACE_RAREWARESIGNNONBLINKING,
|
||||
|
||||
ASSET_TEXTURES_3D_COUNT
|
||||
} AssetTextures3dEnum;
|
||||
|
||||
/********** ASSET_TEXTURES_2D **********/
|
||||
@@ -2387,7 +2393,9 @@ typedef enum AssetTextures2dEnum {
|
||||
ASSET_TEX2D_MENU_ICONTTAMULET3_0,
|
||||
ASSET_TEX2D_MENU_ICONTTAMULET3_1,
|
||||
ASSET_TEX2D_MENU_ICONTTAMULET4_0,
|
||||
ASSET_TEX2D_MENU_ICONTTAMULET4_1
|
||||
ASSET_TEX2D_MENU_ICONTTAMULET4_1,
|
||||
|
||||
ASSET_TEXTURES_2D_COUNT
|
||||
} AssetTextures2dEnum;
|
||||
|
||||
/********** ASSET_GAME_TEXT **********/
|
||||
@@ -2647,7 +2655,9 @@ typedef enum AssetGameTextEnum {
|
||||
ASSET_GAME_TEXT_251,
|
||||
ASSET_GAME_TEXT_252,
|
||||
ASSET_GAME_TEXT_253,
|
||||
ASSET_GAME_TEXT_254
|
||||
ASSET_GAME_TEXT_254,
|
||||
|
||||
ASSET_GAME_TEXT_COUNT
|
||||
} AssetGameTextEnum;
|
||||
|
||||
/********** ASSET_MENU_TEXT **********/
|
||||
@@ -2845,7 +2855,9 @@ typedef enum AssetMenuTextIdsEnum {
|
||||
ASSET_MENU_TEXT_SUBTITLESON,
|
||||
ASSET_MENU_TEXT_SUBTITLESOFF,
|
||||
ASSET_MENU_TEXT_CORRUPTDATA_0,
|
||||
ASSET_MENU_TEXT_CORRUPTDATA_1
|
||||
ASSET_MENU_TEXT_CORRUPTDATA_1,
|
||||
|
||||
ASSET_MENU_TEXT_COUNT
|
||||
} AssetMenuTextIdsEnum;
|
||||
|
||||
/********** ASSET_SPRITES **********/
|
||||
@@ -3043,7 +3055,9 @@ typedef enum AssetSpritesEnum {
|
||||
ASSET_SPRITE_MENU_ICONTROPHY,
|
||||
ASSET_SPRITE_MENU_ICONKEY,
|
||||
ASSET_SPRITE_MENU_ICONWIZPIGAMULET,
|
||||
ASSET_SPRITE_MENU_ICONTTAMULET
|
||||
ASSET_SPRITE_MENU_ICONTTAMULET,
|
||||
|
||||
ASSET_SPRITES_COUNT
|
||||
} AssetSpritesEnum;
|
||||
|
||||
/********** ASSET_MISC **********/
|
||||
@@ -3118,7 +3132,9 @@ typedef enum AssetMiscEnum {
|
||||
ASSET_MISC_TITLE_SCREEN_DEMO_IDS,
|
||||
ASSET_MISC_67,
|
||||
ASSET_MISC_68,
|
||||
ASSET_MISC_69
|
||||
ASSET_MISC_69,
|
||||
|
||||
ASSET_MISC_COUNT
|
||||
} AssetMiscEnum;
|
||||
|
||||
/********** ASSET_LEVEL_OBJECT_MAPS **********/
|
||||
@@ -3261,7 +3277,9 @@ typedef enum AssetLevelObjectMapsEnum {
|
||||
ASSET_LEVEL_OBJECT_MAPS_134,
|
||||
ASSET_LEVEL_OBJECT_MAPS_135,
|
||||
ASSET_LEVEL_OBJECT_MAPS_136,
|
||||
ASSET_LEVEL_OBJECT_MAPS_137
|
||||
ASSET_LEVEL_OBJECT_MAPS_137,
|
||||
|
||||
ASSET_LEVEL_OBJECT_MAPS_COUNT
|
||||
} AssetLevelObjectMapsEnum;
|
||||
|
||||
/********** ASSET_LEVEL_HEADERS **********/
|
||||
@@ -3331,7 +3349,9 @@ typedef enum AssetLevelHeadersEnum {
|
||||
ASSET_LEVEL_BUBBLERANIM,
|
||||
ASSET_LEVEL_WIZPIG2ANIM,
|
||||
ASSET_LEVEL_LASTBIT,
|
||||
ASSET_LEVEL_LASTBITB
|
||||
ASSET_LEVEL_LASTBITB,
|
||||
|
||||
ASSET_LEVEL_HEADERS_COUNT
|
||||
} AssetLevelHeadersEnum;
|
||||
|
||||
/********** ASSET_LEVEL_NAMES **********/
|
||||
@@ -3401,7 +3421,9 @@ typedef enum AssetLevelNamesEnum {
|
||||
ASSET_LEVEL_BUBBLERANIM_NAME,
|
||||
ASSET_LEVEL_WIZPIG2ANIM_NAME,
|
||||
ASSET_LEVEL_LASTBIT_NAME,
|
||||
ASSET_LEVEL_LASTBITB_NAME
|
||||
ASSET_LEVEL_LASTBITB_NAME,
|
||||
|
||||
ASSET_LEVEL_NAMES_COUNT
|
||||
} AssetLevelNamesEnum;
|
||||
|
||||
/********** ASSET_LEVEL_MODELS **********/
|
||||
@@ -3461,7 +3483,9 @@ typedef enum AssetLevelModelsEnum {
|
||||
ASSET_LEVELMODEL_WIZPIG2ANIMATION,
|
||||
ASSET_LEVELMODEL_WIZPIG2,
|
||||
ASSET_LEVELMODEL_ENDINGPART1,
|
||||
ASSET_LEVELMODEL_ENDINGPART2
|
||||
ASSET_LEVELMODEL_ENDINGPART2,
|
||||
|
||||
ASSET_LEVEL_MODELS_COUNT
|
||||
} AssetLevelModelsEnum;
|
||||
|
||||
/********** ASSET_OBJECT_MODELS **********/
|
||||
@@ -3856,7 +3880,9 @@ typedef enum AssetObjectModelsEnum {
|
||||
ASSET_OBJECTMODEL_TTDOOR_2,
|
||||
ASSET_OBJECTMODEL_PIGLOG,
|
||||
ASSET_OBJECTMODEL_KEITHPIGDOOR,
|
||||
ASSET_OBJECTMODEL_MAGNETFX
|
||||
ASSET_OBJECTMODEL_MAGNETFX,
|
||||
|
||||
ASSET_OBJECT_MODELS_COUNT
|
||||
} AssetObjectModelsEnum;
|
||||
|
||||
/********** ASSET_OBJECT_ANIMATIONS **********/
|
||||
@@ -4331,7 +4357,9 @@ typedef enum AssetObjectAnimationsEnum {
|
||||
ASSET_OBJECT_ANIMATIONS_466,
|
||||
ASSET_OBJECT_ANIMATIONS_467,
|
||||
ASSET_OBJECT_ANIMATIONS_468,
|
||||
ASSET_OBJECT_ANIMATIONS_469
|
||||
ASSET_OBJECT_ANIMATIONS_469,
|
||||
|
||||
ASSET_OBJECT_ANIMATIONS_COUNT
|
||||
} AssetObjectAnimationsEnum;
|
||||
|
||||
/********** ASSET_OBJECTS **********/
|
||||
@@ -4640,7 +4668,9 @@ typedef enum AssetObjectsEnum {
|
||||
ASSET_OBJECT_LIGHTNING,
|
||||
ASSET_OBJECT_MIDIFADEPOINT,
|
||||
ASSET_OBJECT_LEVELNAME,
|
||||
ASSET_OBJECT_MIDICHSET
|
||||
ASSET_OBJECT_MIDICHSET,
|
||||
|
||||
ASSET_OBJECTS_COUNT
|
||||
} AssetObjectsEnum;
|
||||
|
||||
/********** ASSET_LEVEL_OBJECT_TRANSLATION_TABLE **********/
|
||||
@@ -4950,7 +4980,9 @@ typedef enum AssetLevelObjectTranslationTableEnum {
|
||||
NULL_OBJECT_301_ID,
|
||||
ASSET_OBJECT_ID_LIGHTHOUSE2,
|
||||
ASSET_OBJECT_ID_CHICKENCHARACTE,
|
||||
ASSET_OBJECT_ID_INFOPOINT
|
||||
ASSET_OBJECT_ID_INFOPOINT,
|
||||
|
||||
ASSET_LEVEL_OBJECT_TRANSLATION_TABLE_COUNT
|
||||
} AssetLevelObjectTranslationTableEnum;
|
||||
|
||||
/********** ASSET_AUDIO **********/
|
||||
@@ -4968,7 +5000,9 @@ typedef enum AssetAudioEnum {
|
||||
ASSET_AUDIO_9,
|
||||
ASSET_AUDIO_10,
|
||||
ASSET_AUDIO_11,
|
||||
ASSET_AUDIO_12
|
||||
ASSET_AUDIO_12,
|
||||
|
||||
ASSET_AUDIO_COUNT
|
||||
} AssetAudioEnum;
|
||||
|
||||
/********** ASSET_PARTICLES **********/
|
||||
@@ -5043,7 +5077,9 @@ typedef enum AssetParticlesEnum {
|
||||
ASSET_PARTICLES_66,
|
||||
ASSET_PARTICLES_67,
|
||||
ASSET_PARTICLES_68,
|
||||
ASSET_PARTICLES_69
|
||||
ASSET_PARTICLES_69,
|
||||
|
||||
ASSET_PARTICLES_COUNT
|
||||
} AssetParticlesEnum;
|
||||
|
||||
/********** ASSET_PARTICLE_BEHAVIORS **********/
|
||||
@@ -5123,7 +5159,9 @@ typedef enum AssetParticleBehaviorsEnum {
|
||||
ASSET_PARTICLE_BEHAVIORS_71,
|
||||
ASSET_PARTICLE_BEHAVIORS_72,
|
||||
ASSET_PARTICLE_BEHAVIORS_73,
|
||||
ASSET_PARTICLE_BEHAVIORS_74
|
||||
ASSET_PARTICLE_BEHAVIORS_74,
|
||||
|
||||
ASSET_PARTICLE_BEHAVIORS_COUNT
|
||||
} AssetParticleBehaviorsEnum;
|
||||
|
||||
/********** ASSET_FONTS **********/
|
||||
@@ -5132,7 +5170,9 @@ typedef enum AssetFontsEnum {
|
||||
ASSET_FONTS_FUNFONT,
|
||||
ASSET_FONTS_SMALLFONT,
|
||||
ASSET_FONTS_BIGFONT,
|
||||
ASSET_FONTS_SUBTITLEFONT
|
||||
ASSET_FONTS_SUBTITLEFONT,
|
||||
|
||||
ASSET_FONTS_COUNT
|
||||
} AssetFontsEnum;
|
||||
|
||||
/********** ASSET_TTGHOSTS **********/
|
||||
@@ -5157,7 +5197,9 @@ typedef enum AssetTtghostsEnum {
|
||||
ASSET_TTGHOSTS_TREASURECAVES,
|
||||
ASSET_TTGHOSTS_HAUNTEDWOODS,
|
||||
ASSET_TTGHOSTS_DARKMOONCAVERNS,
|
||||
ASSET_TTGHOSTS_STARCITY
|
||||
ASSET_TTGHOSTS_STARCITY,
|
||||
|
||||
ASSET_TTGHOSTS_COUNT
|
||||
} AssetTtghostsEnum;
|
||||
|
||||
#endif
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@ typedef enum Vehicle {
|
||||
VEHICLE_PLANE,
|
||||
VEHICLE_FLYING_CAR,
|
||||
VEHICLE_LOOPDELOOP,
|
||||
VEHICLE_TRICKY,
|
||||
VEHICLE_BOSSES,
|
||||
VEHICLE_TRICKY = VEHICLE_BOSSES,
|
||||
VEHICLE_BLUEY,
|
||||
VEHICLE_SMOKEY,
|
||||
VEHICLE_PTERODACTYL,
|
||||
|
||||
@@ -134,7 +134,7 @@ typedef struct SaveConfig {
|
||||
unsigned subtitles : 1;
|
||||
unsigned unk0 : 31;
|
||||
// unsigned checksum : 8; // For some reason, the struct becomes 12 bytes if this is there.
|
||||
} SaveConfig ALIGNED8;
|
||||
} SaveConfig;
|
||||
|
||||
typedef struct SaveFile {
|
||||
unsigned checksum : 16;
|
||||
@@ -207,13 +207,13 @@ typedef struct SaveFile {
|
||||
unsigned sceneWorld5Key : 1; // Unused
|
||||
|
||||
unsigned name : 15;
|
||||
} SaveFile ALIGNED8;
|
||||
} SaveFile;
|
||||
|
||||
typedef struct CourseRecords {
|
||||
u16 checksum;
|
||||
u16 padding;
|
||||
u32 courseTime[COURSE_RECORD_TOTAL];
|
||||
} CourseRecords ALIGNED8;
|
||||
} CourseRecords;
|
||||
|
||||
typedef struct SaveBuffer {
|
||||
SaveFile gameSave[NUMBER_OF_SAVE_FILES];
|
||||
|
||||
+31
-6
@@ -24,6 +24,16 @@ typedef struct Vec3f {
|
||||
};
|
||||
} Vec3f;
|
||||
|
||||
typedef struct Vec2f {
|
||||
union {
|
||||
struct {
|
||||
f32 x;
|
||||
f32 y;
|
||||
};
|
||||
f32 f[2];
|
||||
};
|
||||
} Vec2f;
|
||||
|
||||
typedef struct Vec3s {
|
||||
union {
|
||||
struct {
|
||||
@@ -40,6 +50,20 @@ typedef struct Vec3s {
|
||||
};
|
||||
} Vec3s;
|
||||
|
||||
typedef struct Vec2s {
|
||||
union {
|
||||
struct {
|
||||
s16 y_rotation;
|
||||
s16 x_rotation;
|
||||
};
|
||||
struct {
|
||||
s16 x;
|
||||
s16 y;
|
||||
};
|
||||
s16 s[2];
|
||||
};
|
||||
} Vec2s;
|
||||
|
||||
typedef struct Vec3i {
|
||||
union {
|
||||
struct {
|
||||
@@ -628,6 +652,7 @@ typedef struct ObjectModel {
|
||||
/* 0x4C */ s32 *unk4C;
|
||||
/* 0x50 */ s16 unk50;
|
||||
/* 0x52 */ s16 unk52;
|
||||
/* 0x54 */ u8 pad[0x2C];
|
||||
} ObjectModel;
|
||||
|
||||
/* Size: 0x44 bytes */
|
||||
@@ -1367,7 +1392,7 @@ typedef struct Object_Racer {
|
||||
/* 0x291 */ s8 indicator_timer;
|
||||
/* 0x1FA */ s8 drifting;
|
||||
/* 0x1FB */ s8 unk1FB;
|
||||
/* 0x1FC */ u8 unk1FC;
|
||||
/* 0x1FC */ u8 wrongWayCounter;
|
||||
/* 0x1FD */ s8 cameraIndex;
|
||||
/* 0x1FE */ u8 unk1FE;
|
||||
/* 0x1FF */ u8 unk1FF;
|
||||
@@ -1669,7 +1694,7 @@ typedef struct Object_68 {
|
||||
ObjectModel *objModel;
|
||||
TextureHeader *texHeader;
|
||||
};
|
||||
/* 0x04 */ Vertex *unk4[2];
|
||||
/* 0x04 */ Vertex *vertices[2];
|
||||
/* 0x0C */ s32 *unkC;
|
||||
/* 0x10 */ s16 animationID;
|
||||
/* 0x12 */ s16 animationFrame;
|
||||
@@ -1677,10 +1702,10 @@ typedef struct Object_68 {
|
||||
/* 0x16 */ s16 offsetX;
|
||||
/* 0x18 */ s16 offsetY;
|
||||
/* 0x1A */ s16 offsetZ;
|
||||
/* 0x1C */ s16 unk1C;
|
||||
/* 0x1E */ s8 unk1E;
|
||||
/* 0x1C */ s16 headTilt;
|
||||
/* 0x1E */ s8 modelType;
|
||||
/* 0x1F */ s8 animationTaskNum;
|
||||
/* 0x20 */ s8 unk20;
|
||||
/* 0x20 */ s8 animUpdateTimer;
|
||||
/* 0x21 */ s8 unk21;
|
||||
/* 0x22 */ s16 unk22;
|
||||
/* 0x24 */ s32 unk24;
|
||||
@@ -1882,7 +1907,7 @@ typedef struct Object_LightData {
|
||||
/* Size: 0x0630 bytes */
|
||||
typedef struct Object {
|
||||
/* 0x0000 */ ObjectSegment segment;
|
||||
/* 0x0044 */ Vertex *unk44;
|
||||
/* 0x0044 */ Vertex *curVertData;
|
||||
/* 0x0048 */ s16 behaviorId;
|
||||
/* 0x004A */ s16 objectID; // First 9 bits are object ID, last 7 bits are header size
|
||||
/* 0x004C */ ObjectInteraction *interactObj; //player + 0x318
|
||||
|
||||
+3
-3
@@ -483,7 +483,7 @@ void func_8000A2E8(s32 arg0) {
|
||||
* Generates and renders a coloured line visible from anywhere.
|
||||
* Allows use of a colour, that interpolates from bright to dark from the beginning to the end of the line.
|
||||
*/
|
||||
void debug_render_line(Gfx **dlist, Vertex **verts, Triangle **tris, floatXYZVals *coords, u8 red, u8 green, u8 blue) {
|
||||
void debug_render_line(Gfx **dList, Vertex **verts, Triangle **tris, floatXYZVals *coords, u8 red, u8 green, u8 blue) {
|
||||
Gfx *temp_dlist;
|
||||
Vertex *temp_verts;
|
||||
Triangle *temp_tris;
|
||||
@@ -500,7 +500,7 @@ void debug_render_line(Gfx **dlist, Vertex **verts, Triangle **tris, floatXYZVal
|
||||
x2 = coords->x2;
|
||||
y2 = coords->y2;
|
||||
z2 = coords->z2;
|
||||
temp_dlist = *dlist;
|
||||
temp_dlist = *dList;
|
||||
|
||||
temp_verts = *verts;
|
||||
temp_tris = *tris;
|
||||
@@ -559,7 +559,7 @@ void debug_render_line(Gfx **dlist, Vertex **verts, Triangle **tris, floatXYZVal
|
||||
temp_tris[1].uv2.v = 0;
|
||||
temp_tris += 2;
|
||||
|
||||
*dlist = temp_dlist;
|
||||
*dList = temp_dlist;
|
||||
*verts = temp_verts;
|
||||
*tris = temp_tris;
|
||||
}
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ void func_800095E8(u16 soundId, f32 x, f32 y, f32 z, u8 arg4, u8 arg5, f32 pitch
|
||||
void audioline_ambient_create(u8 arg0, u16 soundId, f32 x, f32 y, f32 z, u8 arg5, u8 arg6, u8 arg7, u8 arg8, u16 arg9,
|
||||
u8 argA, u8 lineID, u8 argC);
|
||||
s32 func_800099EC(u8 arg0);
|
||||
void debug_render_line(Gfx **dlist, Vertex **verts, Triangle **tris, floatXYZVals *coords, u8 red, u8 green, u8 blue);
|
||||
void debug_render_line(Gfx **dList, Vertex **verts, Triangle **tris, floatXYZVals *coords, u8 red, u8 green, u8 blue);
|
||||
void func_80006BFC(Object *obj, ObjectSegment *segment, Object *obj2, s32 updateRate);
|
||||
void update_spatial_audio_position(SoundMask *arg0, f32 x, f32 y, f32 z);
|
||||
s32 func_80009AB4(u8 arg0);
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ void divider_draw(Gfx **dList) {
|
||||
case VIEWPORTS_COUNT_3_PLAYERS:
|
||||
levelHeader = get_current_level_header();
|
||||
// Draw black square in the bottom-right corner.
|
||||
if (get_hud_setting() || (levelHeader->race_type & RACETYPE_CHALLENGE)) {
|
||||
if (hud_setting() || (levelHeader->race_type & RACETYPE_CHALLENGE)) {
|
||||
gDPFillRectangle((*dList)++, width >> 1, height >> 1, width, height);
|
||||
}
|
||||
// There is no break statement here. This is intentional.
|
||||
|
||||
+54
-54
@@ -609,7 +609,7 @@ UNUSED void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2)
|
||||
#define SCISSOR_INTERLACE G_SC_NON_INTERLACE
|
||||
|
||||
// viewport_main
|
||||
void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
void func_80066CDC(Gfx **dList, MatrixS **mats) {
|
||||
u32 y;
|
||||
u32 x;
|
||||
u32 pad0;
|
||||
@@ -639,13 +639,13 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
if (gScreenViewports[savedCameraID].flags & VIEWPORT_EXTRA_BG) {
|
||||
tempCameraID = gActiveCameraID;
|
||||
gActiveCameraID = savedCameraID;
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, gScreenViewports[gActiveCameraID].scissorX1,
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, gScreenViewports[gActiveCameraID].scissorX1,
|
||||
gScreenViewports[gActiveCameraID].scissorY1, gScreenViewports[gActiveCameraID].scissorX2,
|
||||
gScreenViewports[gActiveCameraID].scissorY2);
|
||||
viewport_rsp_set(dlist, 0, 0, 0, 0);
|
||||
viewport_rsp_set(dList, 0, 0, 0, 0);
|
||||
gActiveCameraID = tempCameraID;
|
||||
if (mats != NULL) {
|
||||
func_80067D3C(dlist, mats);
|
||||
func_80067D3C(dList, mats);
|
||||
}
|
||||
gActiveCameraID = originalCameraID;
|
||||
return;
|
||||
@@ -674,7 +674,7 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
// Fake match
|
||||
if (!gScreenViewports[gActiveCameraID].scissorX2) {}
|
||||
}
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, 0, 0, videoWidth, videoHeight);
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, 0, 0, videoWidth, videoHeight);
|
||||
posX = x;
|
||||
break;
|
||||
case VIEWPORTS_COUNT_2_PLAYERS:
|
||||
@@ -685,12 +685,12 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
if (osTvType == OS_TV_TYPE_PAL) {
|
||||
posY -= 12;
|
||||
}
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, 0, 0, videoWidth, y - (videoHeight >> 7));
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, 0, 0, videoWidth, y - (videoHeight >> 7));
|
||||
} else {
|
||||
// second player has bottom half
|
||||
posY = sp58_height;
|
||||
posY += videoHeight >> 2;
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, 0, y + (videoHeight >> 7), videoWidth,
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, 0, y + (videoHeight >> 7), videoWidth,
|
||||
videoHeight - (videoHeight >> 7));
|
||||
}
|
||||
posX = x;
|
||||
@@ -703,10 +703,10 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
// bottom right has map of race track
|
||||
if (gActiveCameraID == 0) {
|
||||
posX = videoWidth >> 2;
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, 0, 0, x - (videoWidth >> 8), videoHeight);
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, 0, 0, x - (videoWidth >> 8), videoHeight);
|
||||
} else {
|
||||
posX = x + (videoWidth >> 2);
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, x + (videoWidth >> 8), 0, videoWidth - (videoWidth >> 8),
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, x + (videoWidth >> 8), 0, videoWidth - (videoWidth >> 8),
|
||||
videoHeight);
|
||||
}
|
||||
break;
|
||||
@@ -719,12 +719,12 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
case 0:
|
||||
// Using posX and posY here is not smart since IDO can't optimize out the zero now.
|
||||
// Why here of all places did they do this instead of just setting zero like everywhere else?
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, posX, posY, x - (videoWidth >> 8),
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, posX, posY, x - (videoWidth >> 8),
|
||||
y - (videoHeight >> 7));
|
||||
break;
|
||||
case 1:
|
||||
posX = x;
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, x + (videoWidth >> 8), 0, (x + x) - (videoWidth >> 8),
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, x + (videoWidth >> 8), 0, (x + x) - (videoWidth >> 8),
|
||||
y - (videoHeight >> 7));
|
||||
|
||||
// Fake
|
||||
@@ -736,13 +736,13 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
break;
|
||||
case 2:
|
||||
posY = y;
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, 0, y + (videoHeight >> 7), x - (videoWidth >> 8),
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, 0, y + (videoHeight >> 7), x - (videoWidth >> 8),
|
||||
(y + y) - (videoHeight >> 7));
|
||||
break;
|
||||
case 3:
|
||||
posX = x;
|
||||
posY = y;
|
||||
gDPSetScissor((*dlist)++, SCISSOR_INTERLACE, x + (videoWidth >> 8), y + (videoHeight >> 7),
|
||||
gDPSetScissor((*dList)++, SCISSOR_INTERLACE, x + (videoWidth >> 8), y + (videoHeight >> 7),
|
||||
(x + x) - (videoWidth >> 8), (y + y) - (videoHeight >> 7));
|
||||
break;
|
||||
}
|
||||
@@ -766,9 +766,9 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
if (osTvType == OS_TV_TYPE_PAL) {
|
||||
posX -= 4;
|
||||
}
|
||||
viewport_rsp_set(dlist, sp54_width, sp58_height, posX, posY);
|
||||
viewport_rsp_set(dList, sp54_width, sp58_height, posX, posY);
|
||||
if (mats != NULL) {
|
||||
func_80067D3C(dlist, mats);
|
||||
func_80067D3C(dList, mats);
|
||||
}
|
||||
gActiveCameraID = originalCameraID;
|
||||
}
|
||||
@@ -780,7 +780,7 @@ void func_80066CDC(Gfx **dlist, MatrixS **mats) {
|
||||
* Takes the size of the screen as depicted by the active menu viewport, then sets the RDP scissor to match it.
|
||||
* Official Name: camSetScissor
|
||||
*/
|
||||
void viewport_scissor(Gfx **dlist) {
|
||||
void viewport_scissor(Gfx **dList) {
|
||||
s32 size;
|
||||
s32 lrx;
|
||||
s32 lry;
|
||||
@@ -863,17 +863,17 @@ void viewport_scissor(Gfx **dlist) {
|
||||
// clang-format on
|
||||
break;
|
||||
}
|
||||
gDPSetScissor((*dlist)++, 0, ulx, uly, lrx, lry);
|
||||
gDPSetScissor((*dList)++, 0, ulx, uly, lrx, lry);
|
||||
return;
|
||||
}
|
||||
gDPSetScissor((*dlist)++, 0, 0, 0, width, height);
|
||||
gDPSetScissor((*dList)++, 0, 0, 0, width, height);
|
||||
}
|
||||
|
||||
// Official Name: camGetPlayerProjMtx / camSetProjMtx - ??
|
||||
void func_80067D3C(Gfx **dlist, UNUSED MatrixS **mats) {
|
||||
void func_80067D3C(Gfx **dList, UNUSED MatrixS **mats) {
|
||||
s32 temp;
|
||||
|
||||
gSPPerspNormalize((*dlist)++, perspNorm);
|
||||
gSPPerspNormalize((*dList)++, perspNorm);
|
||||
|
||||
temp = gActiveCameraID;
|
||||
if (gCutsceneCameraActive) {
|
||||
@@ -927,7 +927,7 @@ void set_ortho_matrix_height(f32 value) {
|
||||
* Used for drawing triangles on screen as HUD.
|
||||
* Official Name: camStandardOrtho
|
||||
*/
|
||||
void set_ortho_matrix_view(Gfx **dlist, MatrixS **mtx) {
|
||||
void set_ortho_matrix_view(Gfx **dList, MatrixS **mtx) {
|
||||
u32 widthAndHeight;
|
||||
s32 width, height;
|
||||
s32 i, j;
|
||||
@@ -941,8 +941,8 @@ void set_ortho_matrix_view(Gfx **dlist, MatrixS **mtx) {
|
||||
gViewportStack[gActiveCameraID + 5].vp.vscale[1] = width * 2;
|
||||
gViewportStack[gActiveCameraID + 5].vp.vtrans[0] = width * 2;
|
||||
gViewportStack[gActiveCameraID + 5].vp.vtrans[1] = height * 2;
|
||||
gSPViewport((*dlist)++, OS_K0_TO_PHYSICAL(&gViewportStack[gActiveCameraID + 5]));
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||
gSPViewport((*dList)++, OS_K0_TO_PHYSICAL(&gViewportStack[gActiveCameraID + 5]));
|
||||
gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||
gModelMatrixStackPos = 0;
|
||||
gMatrixType = G_MTX_DKR_INDEX_0;
|
||||
|
||||
@@ -957,13 +957,13 @@ void set_ortho_matrix_view(Gfx **dlist, MatrixS **mtx) {
|
||||
}
|
||||
|
||||
// Official Name: camStandardPersp?
|
||||
void func_8006807C(Gfx **dlist, MatrixS **mtx) {
|
||||
void func_8006807C(Gfx **dList, MatrixS **mtx) {
|
||||
object_transform_to_matrix_2(gCurrentModelMatrixF, &D_800DD288);
|
||||
f32_matrix_mult(&gCurrentModelMatrixF, &gPerspectiveMatrixF, &gViewMatrixF);
|
||||
object_transform_to_matrix_2((float(*)[4]) gModelMatrixF[0], &D_800DD2A0);
|
||||
f32_matrix_mult(gModelMatrixF[0], &gViewMatrixF, &gCurrentModelMatrixF);
|
||||
f32_matrix_to_s16_matrix(&gCurrentModelMatrixF, *mtx);
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||
gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
|
||||
gModelMatrixStackPos = 0;
|
||||
gMatrixType = G_MTX_DKR_INDEX_0;
|
||||
}
|
||||
@@ -973,7 +973,7 @@ void func_8006807C(Gfx **dlist, MatrixS **mtx) {
|
||||
* Viewports have a centre position and a scale factor, rather than a standard four corners.
|
||||
* Official Name: camSetViewport
|
||||
*/
|
||||
void viewport_rsp_set(Gfx **dlist, s32 width, s32 height, s32 posX, s32 posY) {
|
||||
void viewport_rsp_set(Gfx **dList, s32 width, s32 height, s32 posX, s32 posY) {
|
||||
s32 tempWidth = (get_filtered_cheats() & CHEAT_MIRRORED_TRACKS) ? -width : width;
|
||||
#ifdef ANTI_TAMPER
|
||||
// Antipiracy measure. Flips the screen upside down.
|
||||
@@ -987,9 +987,9 @@ void viewport_rsp_set(Gfx **dlist, s32 width, s32 height, s32 posX, s32 posY) {
|
||||
gViewportStack[gActiveCameraID].vp.vtrans[1] = posY * 4;
|
||||
gViewportStack[gActiveCameraID].vp.vscale[0] = tempWidth * 4;
|
||||
gViewportStack[gActiveCameraID].vp.vscale[1] = height * 4;
|
||||
gSPViewport((*dlist)++, OS_PHYSICAL_TO_K0(&gViewportStack[gActiveCameraID]));
|
||||
gSPViewport((*dList)++, OS_PHYSICAL_TO_K0(&gViewportStack[gActiveCameraID]));
|
||||
} else {
|
||||
gSPViewport((*dlist)++, OS_PHYSICAL_TO_K0(&gViewportStack[gActiveCameraID + 10 + (gViewportWithBG * 5)]));
|
||||
gSPViewport((*dList)++, OS_PHYSICAL_TO_K0(&gViewportStack[gActiveCameraID + 10 + (gViewportWithBG * 5)]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -998,18 +998,18 @@ void viewport_rsp_set(Gfx **dlist, s32 width, s32 height, s32 posX, s32 posY) {
|
||||
* If in the track menu, or post-race, set it to a small screen view instead.
|
||||
* Official Name: camResetView?
|
||||
*/
|
||||
void viewport_reset(Gfx **dlist) {
|
||||
void viewport_reset(Gfx **dList) {
|
||||
u32 widthAndHeight, width, height;
|
||||
gActiveCameraID = 4;
|
||||
widthAndHeight = fb_size();
|
||||
height = GET_VIDEO_HEIGHT(widthAndHeight);
|
||||
width = GET_VIDEO_WIDTH(widthAndHeight);
|
||||
if (!(gScreenViewports[gActiveCameraID].flags & VIEWPORT_EXTRA_BG)) {
|
||||
gDPSetScissor((*dlist)++, G_SC_NON_INTERLACE, 0, 0, width - 1, height - 1);
|
||||
viewport_rsp_set(dlist, width >> 1, height >> 1, width >> 1, height >> 1);
|
||||
gDPSetScissor((*dList)++, G_SC_NON_INTERLACE, 0, 0, width - 1, height - 1);
|
||||
viewport_rsp_set(dList, width >> 1, height >> 1, width >> 1, height >> 1);
|
||||
} else {
|
||||
viewport_scissor(dlist);
|
||||
viewport_rsp_set(dlist, 0, 0, 0, 0);
|
||||
viewport_scissor(dList);
|
||||
viewport_rsp_set(dList, 0, 0, 0, 0);
|
||||
}
|
||||
gActiveCameraID = 0;
|
||||
}
|
||||
@@ -1021,12 +1021,12 @@ UNUSED const char D_800E6F44[] = "cameraPushSprMtx: model stack overflow!!\n";
|
||||
* Used when the next thing rendered relies on there not being any matrix offset.
|
||||
* Official Name: camOffsetZero?
|
||||
*/
|
||||
void matrix_world_origin(Gfx **dlist, MatrixS **mtx) {
|
||||
void matrix_world_origin(Gfx **dList, MatrixS **mtx) {
|
||||
f32_matrix_from_position(gModelMatrixF[gModelMatrixStackPos], 0.0f, 0.0f, 0.0f);
|
||||
f32_matrix_mult(gModelMatrixF[gModelMatrixStackPos], &gViewMatrixF, &gCurrentModelMatrixF);
|
||||
f32_matrix_to_s16_matrix(&gCurrentModelMatrixF, *mtx);
|
||||
gModelMatrixS[gModelMatrixStackPos] = *mtx;
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), gMatrixType << 6);
|
||||
gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), gMatrixType << 6);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1040,7 +1040,7 @@ void sprite_anim_off(s32 setting) {
|
||||
/**
|
||||
* Calculates angle from object to camera, then renders the sprite as a billboard, facing the camera.
|
||||
*/
|
||||
s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4,
|
||||
s32 render_sprite_billboard(Gfx **dList, MatrixS **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4,
|
||||
s32 flags) {
|
||||
f32 diffX;
|
||||
f32 diffY;
|
||||
@@ -1107,8 +1107,8 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj
|
||||
f32_matrix_mult(gModelMatrixF[gModelMatrixStackPos], &gViewMatrixF, &gCurrentModelMatrixF);
|
||||
f32_matrix_to_s16_matrix(&gCurrentModelMatrixF, *mtx);
|
||||
gModelMatrixS[gModelMatrixStackPos] = *mtx;
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gSPVertexDKR((*dlist)++, OS_K0_TO_PHYSICAL(&gVehiclePartVertex), 1, 0);
|
||||
gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gSPVertexDKR((*dList)++, OS_K0_TO_PHYSICAL(&gVehiclePartVertex), 1, 0);
|
||||
} else {
|
||||
v = *vertexList;
|
||||
v->x = obj->segment.trans.x_position;
|
||||
@@ -1118,7 +1118,7 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj
|
||||
v->g = 255;
|
||||
v->b = 255;
|
||||
v->a = 255;
|
||||
gSPVertexDKR((*dlist)++, OS_PHYSICAL_TO_K0(*vertexList), 1, 0);
|
||||
gSPVertexDKR((*dList)++, OS_PHYSICAL_TO_K0(*vertexList), 1, 0);
|
||||
(*vertexList)++;
|
||||
if (gCutsceneCameraActive == 0) {
|
||||
angleDiff =
|
||||
@@ -1133,8 +1133,8 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj
|
||||
obj->segment.trans.scale, gVideoAspectRatio);
|
||||
f32_matrix_to_s16_matrix(gModelMatrixF[gModelMatrixStackPos], *mtx);
|
||||
gModelMatrixS[gModelMatrixStackPos] = *mtx;
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gDkrEnableBillboard((*dlist)++);
|
||||
gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gDkrEnableBillboard((*dList)++);
|
||||
}
|
||||
if (gSpriteAnimOff == FALSE) {
|
||||
textureFrame = ((textureFrame & 0xFF) * arg4->textureCount) >> 8;
|
||||
@@ -1143,20 +1143,20 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj
|
||||
if (flags & RENDER_SEMI_TRANSPARENT) {
|
||||
flags |= RENDER_ANTI_ALIASING;
|
||||
}
|
||||
func_8007BF34(dlist, arg4->unk6 | (flags & (RENDER_FOG_ACTIVE | RENDER_SEMI_TRANSPARENT | RENDER_Z_COMPARE |
|
||||
func_8007BF34(dList, arg4->unk6 | (flags & (RENDER_FOG_ACTIVE | RENDER_SEMI_TRANSPARENT | RENDER_Z_COMPARE |
|
||||
RENDER_ANTI_ALIASING)));
|
||||
if (!(flags & RENDER_Z_UPDATE)) {
|
||||
gDPSetPrimColor((*dlist)++, 0, 0, 255, 255, 255, 255);
|
||||
gDPSetPrimColor((*dList)++, 0, 0, 255, 255, 255, 255);
|
||||
}
|
||||
gSPDisplayList((*dlist)++, arg4->unk8[textureFrame + 1]);
|
||||
gSPDisplayList((*dList)++, arg4->unk8[textureFrame + 1]);
|
||||
gModelMatrixStackPos--;
|
||||
if (gModelMatrixStackPos == 0) {
|
||||
textureFrame = 0;
|
||||
} else {
|
||||
textureFrame = 1;
|
||||
}
|
||||
gDkrInsertMatrix((*dlist)++, 0, textureFrame << 6);
|
||||
gDkrDisableBillboard((*dlist)++);
|
||||
gDkrInsertMatrix((*dList)++, 0, textureFrame << 6);
|
||||
gDkrDisableBillboard((*dList)++);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1393,7 +1393,7 @@ void camera_push_model_mtx(Gfx **dList, MatrixS **mtx, ObjectTransform *trans, f
|
||||
/**
|
||||
* Calculate the rotation matrix for an actors head, then run it.
|
||||
*/
|
||||
void apply_head_turning_matrix(Gfx **dlist, MatrixS **mtx, Object_68 *objGfx, s16 headAngle) {
|
||||
void apply_head_turning_matrix(Gfx **dList, MatrixS **mtx, Object_68 *objGfx, s16 headAngle) {
|
||||
f32 coss_headAngle;
|
||||
f32 sins_headAngle;
|
||||
f32 offsetX;
|
||||
@@ -1407,8 +1407,8 @@ void apply_head_turning_matrix(Gfx **dlist, MatrixS **mtx, Object_68 *objGfx, s1
|
||||
offsetX = (f32) objGfx->offsetX;
|
||||
offsetY = (f32) objGfx->offsetY;
|
||||
offsetZ = (f32) objGfx->offsetZ;
|
||||
coss_unk1C = coss_f(objGfx->unk1C);
|
||||
sins_unk1C = sins_f(objGfx->unk1C);
|
||||
coss_unk1C = coss_f(objGfx->headTilt);
|
||||
sins_unk1C = sins_f(objGfx->headTilt);
|
||||
coss_headAngle = coss_f(headAngle);
|
||||
sins_headAngle = sins_f(headAngle);
|
||||
headMtxF[0][0] = (coss_headAngle * coss_unk1C);
|
||||
@@ -1431,8 +1431,8 @@ void apply_head_turning_matrix(Gfx **dlist, MatrixS **mtx, Object_68 *objGfx, s1
|
||||
headMtxF[3][3] = 1.0f;
|
||||
f32_matrix_mult(&headMtxF, &gCurrentModelMatrixS, &rotationMtxF);
|
||||
f32_matrix_to_s16_matrix(&rotationMtxF, *mtx);
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gDkrInsertMatrix((*dlist)++, G_MWO_MATRIX_XX_XY_I, G_MTX_DKR_INDEX_1);
|
||||
gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gDkrInsertMatrix((*dList)++, G_MWO_MATRIX_XX_XY_I, G_MTX_DKR_INDEX_1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1448,7 +1448,7 @@ UNUSED void get_modelmatrix_vector(f32 *x, f32 *y, f32 *z) {
|
||||
* Run a matrix from the top of the stack and pop it.
|
||||
* If the stack pos is less than zero, add a matrix instead.
|
||||
*/
|
||||
void apply_matrix_from_stack(Gfx **dlist) {
|
||||
void apply_matrix_from_stack(Gfx **dList) {
|
||||
gCameraMatrixPos--;
|
||||
gModelMatrixStackPos--;
|
||||
|
||||
@@ -1463,9 +1463,9 @@ void apply_matrix_from_stack(Gfx **dlist) {
|
||||
} // Fakematch
|
||||
|
||||
if (gModelMatrixStackPos > 0) {
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0(gModelMatrixS[gModelMatrixStackPos]), G_MTX_DKR_INDEX_1);
|
||||
gSPMatrix((*dList)++, OS_PHYSICAL_TO_K0(gModelMatrixS[gModelMatrixStackPos]), G_MTX_DKR_INDEX_1);
|
||||
} else {
|
||||
gDkrInsertMatrix((*dlist)++, G_MWO_MATRIX_XX_XY_I, G_MTX_DKR_INDEX_0);
|
||||
gDkrInsertMatrix((*dList)++, G_MWO_MATRIX_XX_XY_I, G_MTX_DKR_INDEX_0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -105,11 +105,11 @@ s32 copy_viewport_background_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1,
|
||||
void copy_viewport_frame_size_to_coords(s32 viewPortIndex, s32 *x1, s32 *y1, s32 *x2, s32 *y2);
|
||||
void copy_framebuffer_size_to_coords(s32 *x1, s32 *y1, s32 *x2, s32 *y2);
|
||||
void set_ortho_matrix_height(f32 value);
|
||||
void set_ortho_matrix_view(Gfx **dlist, MatrixS **mtx);
|
||||
void func_8006807C(Gfx **dlist, MatrixS **mtx);
|
||||
void viewport_rsp_set(Gfx **dlist, s32 width, s32 height, s32 posX, s32 posY);
|
||||
void viewport_reset(Gfx **dlist);
|
||||
void matrix_world_origin(Gfx **dlist, MatrixS **mtx);
|
||||
void set_ortho_matrix_view(Gfx **dList, MatrixS **mtx);
|
||||
void func_8006807C(Gfx **dList, MatrixS **mtx);
|
||||
void viewport_rsp_set(Gfx **dList, s32 width, s32 height, s32 posX, s32 posY);
|
||||
void viewport_reset(Gfx **dList);
|
||||
void matrix_world_origin(Gfx **dList, MatrixS **mtx);
|
||||
void sprite_anim_off(s32 setting);
|
||||
ObjectSegment *get_active_camera_segment_no_cutscenes(void);
|
||||
ObjectSegment *get_active_camera_segment(void);
|
||||
@@ -120,18 +120,18 @@ Matrix *get_camera_matrix(void);
|
||||
f32 get_distance_to_camera(f32 x, f32 y, f32 z);
|
||||
void set_camera_shake_by_distance(f32 x, f32 y, f32 z, f32 dist, f32 magnitude);
|
||||
void set_camera_shake(f32 magnitude);
|
||||
void func_80067D3C(Gfx **dlist, MatrixS **mats);
|
||||
void func_80067D3C(Gfx **dList, MatrixS **mats);
|
||||
void render_ortho_triangle_image(Gfx **dList, MatrixS **mtx, Vertex **vtx, ObjectSegment *segment, Sprite *sprite, s32 flags);
|
||||
s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags);
|
||||
s32 render_sprite_billboard(Gfx **dList, MatrixS **mtx, Vertex **vertexList, Object *obj, unk80068514_arg4 *arg4, s32 flags);
|
||||
void camera_push_model_mtx(Gfx **dList, MatrixS **mtx, ObjectTransform *trans, f32 scale, f32 scaleY);
|
||||
void viewport_scissor(Gfx **dlist);
|
||||
void apply_matrix_from_stack(Gfx **dlist);
|
||||
void viewport_scissor(Gfx **dList);
|
||||
void apply_matrix_from_stack(Gfx **dList);
|
||||
void copy_viewports_to_stack(void);
|
||||
void apply_head_turning_matrix(Gfx **dlist, MatrixS **mtx, Object_68 *objGfx, s16 headAngle);
|
||||
void apply_head_turning_matrix(Gfx **dList, MatrixS **mtx, Object_68 *objGfx, s16 headAngle);
|
||||
void apply_object_shear_matrix(Gfx **dList, MatrixS **mtx, Object *arg2, Object *arg3, f32 shear);
|
||||
|
||||
// Non Matching
|
||||
void camera_init(void);
|
||||
void func_80066CDC(Gfx **dlist, MatrixS **mats);
|
||||
void func_80066CDC(Gfx **dList, MatrixS **mats);
|
||||
|
||||
#endif
|
||||
|
||||
+77
-78
@@ -38,22 +38,22 @@ Gfx dTransitionFadeSettings[] = {
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
s16 gTransitionBarnHorizontalData[28] = {
|
||||
0xFE20, 0x0078, 0xFEC0, 0x0078, 0xFF60, 0x0078, 0x0000, 0x0078, 0x00A0, 0x0078, 0x0140, 0x0078, 0x01E0, 0x0078,
|
||||
0xFE20, 0xFF88, 0xFEC0, 0xFF88, 0xFF60, 0xFF88, 0x0000, 0xFF88, 0x00A0, 0xFF88, 0x0140, 0xFF88, 0x01E0, 0xFF88,
|
||||
Vec2s gTransitionBarnHorizontalCoords[14] = {
|
||||
{ -480, 120 }, { -320, 120 }, { -160, 120 }, { 0, 120 }, { 160, 120 }, { 320, 120 }, { 480, 120 },
|
||||
{ -480, -120 }, { -320, -120 }, { -160, -120 }, { 0, -120 }, { 160, -120 }, { 320, -120 }, { 480, -120 },
|
||||
};
|
||||
|
||||
s16 gTransitionBarnVerticalData[28] = {
|
||||
0xFF60, 0x0168, 0xFF60, 0x00F0, 0xFF60, 0x0078, 0xFF60, 0x0000, 0xFF60, 0xFF88, 0xFF60, 0xFF10, 0xFF60, 0xFF10,
|
||||
0x00A0, 0x0168, 0x00A0, 0x00F0, 0x00A0, 0x0078, 0x00A0, 0x0000, 0x00A0, 0xFF88, 0x00A0, 0xFF10, 0x00A0, 0xFF10,
|
||||
Vec2s gTransitionBarnVerticalCoords[14] = {
|
||||
{ -160, 360 }, { -160, 240 }, { -160, 120 }, { -160, 0 }, { -160, -120 }, { -160, -240 }, { -160, -240 },
|
||||
{ 160, 360 }, { 160, 240 }, { 160, 120 }, { 160, 0 }, { 160, -120 }, { 160, -240 }, { 160, -240 },
|
||||
};
|
||||
|
||||
u8 D_800E32A0[12] = {
|
||||
0x00, 0x02, 0x04, 0x0E, 0x10, 0x12, 0x08, 0x0A, 0x0C, 0x16, 0x18, 0x1A,
|
||||
TriangleList D_800E32A0[12] = {
|
||||
0, 2, 4, 14, 16, 18, 8, 10, 12, 22, 24, 26,
|
||||
};
|
||||
|
||||
u8 D_800E32AC[12] = {
|
||||
0x04, 0x06, 0x08, 0x12, 0x14, 0x16, 0x04, 0x06, 0x08, 0x12, 0x14, 0x16,
|
||||
TriangleList D_800E32AC[12] = {
|
||||
4, 6, 8, 18, 20, 22, 4, 6, 8, 18, 20, 22,
|
||||
};
|
||||
|
||||
TriangleList gTransitionBarnDoorTris[24] = {
|
||||
@@ -64,16 +64,16 @@ u8 gTransitionBarnDoorAlpha[12] = {
|
||||
255, 255, 0, 255, 255, 0, 0, 255, 255, 0, 255, 255,
|
||||
};
|
||||
|
||||
s16 gTransitionBarnDiagData[24] = {
|
||||
0xFCE0, 0x0078, 0xFE20, 0x0078, 0xFF60, 0x0078, 0x00A0, 0x0078, 0x01E0, 0x0078, 0x0320, 0x0078,
|
||||
0xFCE0, 0xFF88, 0xFE20, 0xFF88, 0xFF60, 0xFF88, 0x00A0, 0xFF88, 0x01E0, 0xFF88, 0x0320, 0xFF88,
|
||||
Vec2s gTransitionBarnDiagCoords[12] = {
|
||||
{ -800, 120 }, { -480, 120 }, { -160, 120 }, { 160, 120 }, { 480, 120 }, { 800, 120 },
|
||||
{ -800, -120 }, { -480, -120 }, { -160, -120 }, { 160, -120 }, { 480, -120 }, { 800, -120 },
|
||||
};
|
||||
|
||||
u8 D_800E330C[12] = {
|
||||
TriangleList D_800E330C[12] = {
|
||||
0, 2, 4, 12, 14, 8, 10, 18, 20, 22, 0, 0,
|
||||
};
|
||||
|
||||
u8 D_800E3318[12] = {
|
||||
TriangleList D_800E3318[12] = {
|
||||
4, 6, 8, 16, 18, 4, 6, 14, 16, 18, 0, 0,
|
||||
};
|
||||
|
||||
@@ -85,32 +85,30 @@ u8 gTransitionBarnDoorDiagAlpha[12] = {
|
||||
255, 255, 0, 255, 0, 0, 255, 0, 255, 255, 0, 0,
|
||||
};
|
||||
|
||||
s16 gTransitionWaveData[126] = {
|
||||
0xFF60, 0x00A0, 0xFF70, 0x00A0, 0xFF80, 0x00A0, 0xFF90, 0x00A0, 0xFFA0, 0x00A0, 0xFFB0, 0x00A0, 0xFFC0, 0x00A0,
|
||||
0xFFD0, 0x00A0, 0xFFE0, 0x00A0, 0xFFF0, 0x00A0, 0x0000, 0x00A0, 0x0010, 0x00A0, 0x0020, 0x00A0, 0x0030, 0x00A0,
|
||||
0x0040, 0x00A0, 0x0050, 0x00A0, 0x0060, 0x00A0, 0x0070, 0x00A0, 0x0080, 0x00A0, 0x0090, 0x00A0, 0x00A0, 0x00A0,
|
||||
0xFF60, 0xFF38, 0xFF70, 0xFF60, 0xFF80, 0xFF74, 0xFF90, 0xFF7E, 0xFFA0, 0xFF74, 0xFFB0, 0xFF38, 0xFFC0, 0xFF10,
|
||||
0xFFD0, 0xFEFC, 0xFFE0, 0xFEF2, 0xFFF0, 0xFEFC, 0x0000, 0xFF24, 0x0010, 0xFF2E, 0x0020, 0xFF38, 0x0030, 0xFF2E,
|
||||
0x0040, 0xFF24, 0x0050, 0xFEFC, 0x0060, 0xFEF2, 0x0070, 0xFEFC, 0x0080, 0xFF24, 0x0090, 0xFF60, 0x00A0, 0xFF74,
|
||||
0xFF60, 0xFEE8, 0xFF70, 0xFEE8, 0xFF80, 0xFEE8, 0xFF90, 0xFEE8, 0xFFA0, 0xFEE8, 0xFFB0, 0xFEE8, 0xFFC0, 0xFEE8,
|
||||
0xFFD0, 0xFEE8, 0xFFE0, 0xFEE8, 0xFFF0, 0xFEE8, 0x0000, 0xFEE8, 0x0010, 0xFEE8, 0x0020, 0xFEE8, 0x0030, 0xFEE8,
|
||||
0x0040, 0xFEE8, 0x0050, 0xFEE8, 0x0060, 0xFEE8, 0x0070, 0xFEE8, 0x0080, 0xFEE8, 0x0090, 0xFEE8, 0x00A0, 0xFEE8,
|
||||
Vec2s gTransitionWaveCoords[63] = {
|
||||
{ -160, 160 }, { -144, 160 }, { -128, 160 }, { -112, 160 }, { -96, 160 }, { -80, 160 }, { -64, 160 },
|
||||
{ -48, 160 }, { -32, 160 }, { -16, 160 }, { 0, 160 }, { 16, 160 }, { 32, 160 }, { 48, 160 },
|
||||
{ 64, 160 }, { 80, 160 }, { 96, 160 }, { 112, 160 }, { 128, 160 }, { 144, 160 }, { 160, 160 },
|
||||
{ -160, -200 }, { -144, -160 }, { -128, -140 }, { -112, -130 }, { -96, -140 }, { -80, -200 }, { -64, -240 },
|
||||
{ -48, -260 }, { -32, -270 }, { -16, -260 }, { 0, -220 }, { 16, -210 }, { 32, -200 }, { 48, -210 },
|
||||
{ 64, -220 }, { 80, -260 }, { 96, -270 }, { 112, -260 }, { 128, -220 }, { 144, -160 }, { 160, -140 },
|
||||
{ -160, -280 }, { -144, -280 }, { -128, -280 }, { -112, -280 }, { -96, -280 }, { -80, -280 }, { -64, -280 },
|
||||
{ -48, -280 }, { -32, -280 }, { -16, -280 }, { 0, -280 }, { 16, -280 }, { 32, -280 }, { 48, -280 },
|
||||
{ 64, -280 }, { 80, -280 }, { 96, -280 }, { 112, -280 }, { 128, -280 }, { 144, -280 }, { 160, -280 }
|
||||
};
|
||||
|
||||
u8 D_800E3440[92] = {
|
||||
0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x0E, 0x10, 0x12,
|
||||
0x14, 0x16, 0x18, 0x1A, 0x0E, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1A, 0x1C, 0x1E, 0x20, 0x22, 0x24, 0x26, 0x28,
|
||||
0x1A, 0x1C, 0x1E, 0x20, 0x22, 0x24, 0x26, 0x28, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x54, 0x56, 0x58,
|
||||
0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x0E, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x62, 0x64, 0x66, 0x68, 0x6A, 0x6C, 0x6E,
|
||||
0x1A, 0x1C, 0x1E, 0x20, 0x22, 0x24, 0x26, 0x28, 0x6E, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C,
|
||||
0, 2, 4, 6, 8, 10, 12, 14, 0, 2, 4, 6, 8, 10, 12, 14, 14, 16, 18, 20, 22, 24, 26,
|
||||
14, 16, 18, 20, 22, 24, 26, 26, 28, 30, 32, 34, 36, 38, 40, 26, 28, 30, 32, 34, 36, 38, 40,
|
||||
0, 2, 4, 6, 8, 10, 12, 14, 84, 86, 88, 90, 92, 94, 96, 98, 14, 16, 18, 20, 22, 24, 26,
|
||||
98, 100, 102, 104, 106, 108, 110, 26, 28, 30, 32, 34, 36, 38, 40, 110, 112, 114, 116, 118, 120, 122, 124,
|
||||
};
|
||||
|
||||
u8 D_800E349C[92] = {
|
||||
0x2A, 0x2C, 0x2E, 0x30, 0x32, 0x34, 0x36, 0x38, 0x54, 0x56, 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x38, 0x3A, 0x3C,
|
||||
0x3E, 0x40, 0x42, 0x44, 0x62, 0x64, 0x66, 0x68, 0x6A, 0x6C, 0x6E, 0x44, 0x46, 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52,
|
||||
0x6E, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C, 0x54, 0x56, 0x58, 0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x54, 0x56, 0x58,
|
||||
0x5A, 0x5C, 0x5E, 0x60, 0x62, 0x62, 0x64, 0x66, 0x68, 0x6A, 0x6C, 0x6E, 0x62, 0x64, 0x66, 0x68, 0x6A, 0x6C, 0x6E,
|
||||
0x6E, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C, 0x6E, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7A, 0x7C,
|
||||
42, 44, 46, 48, 50, 52, 54, 56, 84, 86, 88, 90, 92, 94, 96, 98, 56, 58, 60, 62, 64, 66, 68,
|
||||
98, 100, 102, 104, 106, 108, 110, 68, 70, 72, 74, 76, 78, 80, 82, 110, 112, 114, 116, 118, 120, 122, 124,
|
||||
84, 86, 88, 90, 92, 94, 96, 98, 84, 86, 88, 90, 92, 94, 96, 98, 98, 100, 102, 104, 106, 108, 110,
|
||||
98, 100, 102, 104, 106, 108, 110, 110, 112, 114, 116, 118, 120, 122, 124, 110, 112, 114, 116, 118, 120, 122, 124,
|
||||
};
|
||||
|
||||
u8 gTransitionWaveAlpha[92] = {
|
||||
@@ -234,27 +232,28 @@ s32 transition_begin(FadeTransition *transition) {
|
||||
transition_fullscreen_start(transition);
|
||||
break;
|
||||
case FADE_BARNDOOR_HORIZONTAL:
|
||||
init_transition_shape(transition, 12, 8, gTransitionBarnHorizontalData, D_800E32A0, D_800E32AC,
|
||||
gTransitionBarnDoorAlpha, gTransitionBarnDoorAlpha, gTransitionBarnDoorTris);
|
||||
transition_init_shape(transition, 12, 8, (s16 *) gTransitionBarnHorizontalCoords, D_800E32A0,
|
||||
D_800E32AC, gTransitionBarnDoorAlpha, gTransitionBarnDoorAlpha,
|
||||
gTransitionBarnDoorTris);
|
||||
break;
|
||||
case FADE_BARNDOOR_VERTICAL:
|
||||
init_transition_shape(transition, 12, 8, gTransitionBarnVerticalData, D_800E32A0, D_800E32AC,
|
||||
transition_init_shape(transition, 12, 8, (s16 *) gTransitionBarnVerticalCoords, D_800E32A0, D_800E32AC,
|
||||
gTransitionBarnDoorAlpha, gTransitionBarnDoorAlpha, gTransitionBarnDoorTris);
|
||||
break;
|
||||
case FADE_CIRCLE:
|
||||
func_800C15D4(transition);
|
||||
transition_init_circle(transition);
|
||||
break;
|
||||
case FADE_WAVES:
|
||||
init_transition_shape(transition, 92, 80, gTransitionWaveData, D_800E349C, D_800E3440,
|
||||
transition_init_shape(transition, 92, 80, (s16 *) gTransitionWaveCoords, D_800E349C, D_800E3440,
|
||||
gTransitionWaveAlpha, gTransitionWaveAlpha, gTransitionWaveTris);
|
||||
break;
|
||||
case FADE_BARNDOOR_DIAGONAL:
|
||||
init_transition_shape(transition, 10, 6, gTransitionBarnDiagData, D_800E330C, D_800E3318,
|
||||
transition_init_shape(transition, 10, 6, (s16 *) gTransitionBarnDiagCoords, D_800E330C, D_800E3318,
|
||||
gTransitionBarnDoorDiagAlpha, gTransitionBarnDoorDiagAlpha,
|
||||
gTransitionBarnDoorDiagTris);
|
||||
break;
|
||||
case FADE_DISABLED:
|
||||
init_transition_blank(transition);
|
||||
transition_init_blank(transition);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -266,7 +265,7 @@ s32 transition_begin(FadeTransition *transition) {
|
||||
* Afterwards, it will return the transition status. The condition where this function is called wants a nonzero
|
||||
* return, which will then call the bit that renders the transitions.
|
||||
*/
|
||||
s32 handle_transitions(s32 updateRate) {
|
||||
s32 transition_update(s32 updateRate) {
|
||||
if (sLevelTransitionDelayTimer) {
|
||||
sLevelTransitionDelayTimer--;
|
||||
updateRate = LOGIC_NULL;
|
||||
@@ -287,19 +286,19 @@ s32 handle_transitions(s32 updateRate) {
|
||||
}
|
||||
switch (gCurFadeTransition) {
|
||||
case FADE_FULLSCREEN:
|
||||
process_transition_fullscreen(updateRate);
|
||||
transition_update_fullscreen(updateRate);
|
||||
break;
|
||||
case FADE_BARNDOOR_HORIZONTAL:
|
||||
case FADE_BARNDOOR_VERTICAL:
|
||||
case FADE_WAVES:
|
||||
case FADE_BARNDOOR_DIAGONAL:
|
||||
process_transition_shape(updateRate);
|
||||
transition_update_shape(updateRate);
|
||||
break;
|
||||
case FADE_CIRCLE:
|
||||
func_800C1EE8(updateRate);
|
||||
transition_update_circle(updateRate);
|
||||
break;
|
||||
case FADE_DISABLED:
|
||||
process_transition_disabled(updateRate);
|
||||
transition_update_blank(updateRate);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -311,40 +310,40 @@ s32 handle_transitions(s32 updateRate) {
|
||||
* The rendering portion of transitions.
|
||||
* First establishes an orthogonal matrix, then renders a transition effect onscreen.
|
||||
*/
|
||||
void render_fade_transition(Gfx **dList, MatrixS **mats, Vertex **verts) {
|
||||
void transition_render(Gfx **dList, MatrixS **mtx, Vertex **vtx) {
|
||||
if (sTransitionStatus != TRANSITION_NONE) {
|
||||
if (osTvType == OS_TV_TYPE_PAL) {
|
||||
set_ortho_matrix_height(1.4f);
|
||||
} else {
|
||||
set_ortho_matrix_height(1.2f);
|
||||
}
|
||||
set_ortho_matrix_view(dList, mats);
|
||||
set_ortho_matrix_view(dList, mtx);
|
||||
set_ortho_matrix_height(1.0f);
|
||||
switch (gCurFadeTransition) {
|
||||
case FADE_FULLSCREEN:
|
||||
render_fade_fullscreen(dList, mats, verts);
|
||||
transition_render_fullscreen(dList, mtx, vtx);
|
||||
break;
|
||||
case FADE_BARNDOOR_HORIZONTAL:
|
||||
render_fade_barndoor_horizontal(dList, mats, verts);
|
||||
transition_render_barndoor_hor(dList, mtx, vtx);
|
||||
break;
|
||||
case FADE_BARNDOOR_VERTICAL:
|
||||
render_fade_barndoor_vertical(dList, mats, verts);
|
||||
transition_render_barndoor_vert(dList, mtx, vtx);
|
||||
break;
|
||||
case FADE_CIRCLE:
|
||||
render_fade_circle(dList, mats, verts);
|
||||
transition_render_circle(dList, mtx, vtx);
|
||||
break;
|
||||
case FADE_WAVES:
|
||||
render_fade_waves(dList, mats, verts);
|
||||
transition_render_waves(dList, mtx, vtx);
|
||||
break;
|
||||
case FADE_BARNDOOR_DIAGONAL:
|
||||
render_fade_barndoor_diagonal(dList, mats, verts);
|
||||
transition_render_barndoor_diag(dList, mtx, vtx);
|
||||
break;
|
||||
case FADE_DISABLED:
|
||||
render_fade_disabled(dList, mats, verts);
|
||||
transition_render_blank(dList, mtx, vtx);
|
||||
break;
|
||||
}
|
||||
|
||||
func_80066CDC(dList, mats);
|
||||
func_80066CDC(dList, mtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +380,7 @@ void transition_fullscreen_start(FadeTransition *transition) {
|
||||
/**
|
||||
* Slowly dade in or out by increasing or decreasing opacity.
|
||||
*/
|
||||
void process_transition_fullscreen(s32 updateRate) {
|
||||
void transition_update_fullscreen(s32 updateRate) {
|
||||
s32 var_v0;
|
||||
do {
|
||||
var_v0 = TRUE;
|
||||
@@ -425,7 +424,7 @@ void process_transition_fullscreen(s32 updateRate) {
|
||||
/**
|
||||
* Draws a simple fillrect covering the whole screen that fades in or out.
|
||||
*/
|
||||
void render_fade_fullscreen(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **verts) {
|
||||
void transition_render_fullscreen(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx) {
|
||||
s32 screenSize = fb_size();
|
||||
gSPDisplayList((*dList)++, dTransitionFadeSettings);
|
||||
gDPSetPrimColor((*dList)++, 0, 0, gCurFadeRed, gCurFadeGreen, gCurFadeBlue, gCurFadeAlpha);
|
||||
@@ -438,7 +437,7 @@ void render_fade_fullscreen(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **
|
||||
* Allocate space for the new transitions vertices and triangles, then build the geometry based on the vertex and
|
||||
* triangle shapes given.
|
||||
*/
|
||||
void init_transition_shape(FadeTransition *transition, s32 numVerts, s32 numTris, s16 *coords, u8 *nextPos,
|
||||
void transition_init_shape(FadeTransition *transition, s32 numVerts, s32 numTris, s16 *coords, u8 *nextPos,
|
||||
u8 *targetPos, u8 *nextAlpha, u8 *targetAlpha, u8 *vertIndices) {
|
||||
UNUSED s32 pad;
|
||||
u8 *swap;
|
||||
@@ -494,7 +493,7 @@ void init_transition_shape(FadeTransition *transition, s32 numVerts, s32 numTris
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
for (j = 0; j < numTris; j++) {
|
||||
sTransitionTris[i][j].flags = 0x40;
|
||||
sTransitionTris[i][j].flags = BACKFACE_DRAW;
|
||||
sTransitionTris[i][j].vi0 = vertIndices[(j * 3) + 0];
|
||||
sTransitionTris[i][j].uv0.u = 0;
|
||||
sTransitionTris[i][j].uv0.v = 0;
|
||||
@@ -515,7 +514,7 @@ void init_transition_shape(FadeTransition *transition, s32 numVerts, s32 numTris
|
||||
* Slowly update the vertices of the transition based on what the next frames target is.
|
||||
* That target is set based on a velocity.
|
||||
*/
|
||||
void process_transition_shape(s32 updateRate) {
|
||||
void transition_update_shape(s32 updateRate) {
|
||||
s32 i;
|
||||
f32 updateRateF;
|
||||
|
||||
@@ -553,7 +552,7 @@ void process_transition_shape(s32 updateRate) {
|
||||
/**
|
||||
* Renders a transition effect on screen that will close in from both sides horizonally.
|
||||
*/
|
||||
void render_fade_barndoor_horizontal(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **verts) {
|
||||
void transition_render_barndoor_hor(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx) {
|
||||
reset_render_settings(dList);
|
||||
gSPDisplayList((*dList)++, dTransitionShapeSettings);
|
||||
gSPVertexDKR((*dList)++, OS_PHYSICAL_TO_K0(sTransitionVtx[sTransitionTaskNum]), 12, 0);
|
||||
@@ -565,7 +564,7 @@ void render_fade_barndoor_horizontal(Gfx **dList, UNUSED MatrixS **mats, UNUSED
|
||||
* Renders a transition effect on screen that will close in from both sides vertically.
|
||||
* Codewise, exactly the same as above, but uses a different vertex layout to make the difference.
|
||||
*/
|
||||
void render_fade_barndoor_vertical(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **verts) {
|
||||
void transition_render_barndoor_vert(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx) {
|
||||
reset_render_settings(dList);
|
||||
gSPDisplayList((*dList)++, dTransitionShapeSettings);
|
||||
gSPVertexDKR((*dList)++, OS_PHYSICAL_TO_K0(sTransitionVtx[sTransitionTaskNum]), 12, 0);
|
||||
@@ -573,7 +572,7 @@ void render_fade_barndoor_vertical(Gfx **dList, UNUSED MatrixS **mats, UNUSED Ve
|
||||
reset_render_settings(dList);
|
||||
}
|
||||
|
||||
void func_800C15D4(FadeTransition *transition) {
|
||||
void transition_init_circle(FadeTransition *transition) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 k;
|
||||
@@ -677,7 +676,7 @@ void func_800C15D4(FadeTransition *transition) {
|
||||
sTransitionStatus = TRANSITION_ACTIVE;
|
||||
}
|
||||
|
||||
void func_800C1EE8(s32 updateRate) {
|
||||
void transition_update_circle(s32 updateRate) {
|
||||
f32 temp_f20;
|
||||
f32 temp_f2;
|
||||
f32 temp_f16;
|
||||
@@ -733,7 +732,7 @@ void func_800C1EE8(s32 updateRate) {
|
||||
/**
|
||||
* Render a circle shape transition onscreen using previously allocated geometry.
|
||||
*/
|
||||
void render_fade_circle(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **verts) {
|
||||
void transition_render_circle(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx) {
|
||||
Vertex *vertsToRender;
|
||||
Triangle *trisToRender;
|
||||
Gfx *gfx;
|
||||
@@ -760,13 +759,13 @@ void render_fade_circle(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **vert
|
||||
/**
|
||||
* Render the wavy transition onscreen using the vertex data allocated earlier.
|
||||
*/
|
||||
void render_fade_waves(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts) {
|
||||
void transition_render_waves(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx) {
|
||||
Gfx *gfx;
|
||||
s32 i;
|
||||
Vertex *v;
|
||||
Triangle *t;
|
||||
reset_render_settings(dlist);
|
||||
gfx = *dlist;
|
||||
reset_render_settings(dList);
|
||||
gfx = *dList;
|
||||
v = (Vertex *) sTransitionVtx[sTransitionTaskNum];
|
||||
t = (Triangle *) sTransitionTris[sTransitionTaskNum];
|
||||
gSPDisplayList(gfx++, dTransitionShapeSettings);
|
||||
@@ -791,14 +790,14 @@ void render_fade_waves(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts
|
||||
t += 14;
|
||||
}
|
||||
}
|
||||
*dlist = gfx;
|
||||
reset_render_settings(dlist);
|
||||
*dList = gfx;
|
||||
reset_render_settings(dList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a transition effect on screen that will close in from the opposite corners of the screen.
|
||||
*/
|
||||
void render_fade_barndoor_diagonal(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **verts) {
|
||||
void transition_render_barndoor_diag(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx) {
|
||||
reset_render_settings(dList);
|
||||
gSPDisplayList((*dList)++, dTransitionShapeSettings);
|
||||
gSPVertexDKR((*dList)++, OS_PHYSICAL_TO_K0(sTransitionVtx[sTransitionTaskNum]), 10, 0);
|
||||
@@ -809,7 +808,7 @@ void render_fade_barndoor_diagonal(Gfx **dList, UNUSED MatrixS **mats, UNUSED Ve
|
||||
/**
|
||||
* Set the transition colour target, then set the velocity for the colour to fade to.
|
||||
*/
|
||||
void init_transition_blank(UNUSED FadeTransition *transition) {
|
||||
void transition_init_blank(UNUSED FadeTransition *transition) {
|
||||
gLastFadeRed <<= 16;
|
||||
gLastFadeGreen <<= 16;
|
||||
gLastFadeBlue <<= 16;
|
||||
@@ -825,8 +824,8 @@ void init_transition_blank(UNUSED FadeTransition *transition) {
|
||||
/**
|
||||
* Shifts the colours of the transition over time while the timer ticks down.
|
||||
*/
|
||||
void process_transition_disabled(s32 updateRate) {
|
||||
s32 var_v0;
|
||||
void transition_update_blank(s32 updateRate) {
|
||||
s32 var_v0 = FALSE;
|
||||
do {
|
||||
var_v0 = TRUE;
|
||||
if (sTransitionFadeTimer > 0) {
|
||||
@@ -856,11 +855,11 @@ void process_transition_disabled(s32 updateRate) {
|
||||
/**
|
||||
* Fill the whole screen with a solid colour.
|
||||
*/
|
||||
void render_fade_disabled(Gfx **dList, UNUSED MatrixS **mats, UNUSED Vertex **verts) {
|
||||
void transition_render_blank(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx) {
|
||||
s32 screenSize = fb_size();
|
||||
gSPDisplayList((*dList)++, dTransitionFadeSettings);
|
||||
gDPSetPrimColor((*dList)++, 0, 0, (gLastFadeRed >> 16), (gLastFadeGreen >> 16), (gLastFadeBlue >> 16), 255);
|
||||
gDPSetCombineMode((*dList)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
|
||||
gDPFillRectangle((*dList)++, 0, 0, screenSize & 0x3FF, (screenSize >> 16) & 0x3FF);
|
||||
gDPFillRectangle((*dList)++, 0, 0, GET_VIDEO_WIDTH(screenSize), GET_VIDEO_HEIGHT(screenSize) & 0x3FF);
|
||||
reset_render_settings(dList);
|
||||
}
|
||||
|
||||
+18
-17
@@ -22,6 +22,8 @@
|
||||
#define FADE_COLOR_BLACK FADE_COLOR(0, 0, 0)
|
||||
#define FADE_COLOR_WHITE FADE_COLOR(255, 255, 255)
|
||||
|
||||
#define FADE_STAY 0xFFFF // Transition will stay until manually removed.
|
||||
|
||||
/**
|
||||
* type: Transition type
|
||||
* flags: Transition flags
|
||||
@@ -51,25 +53,24 @@ void enable_new_screen_transitions(void);
|
||||
void disable_new_screen_transitions(void);
|
||||
u32 check_fadeout_transition(void);
|
||||
void transition_end(void);
|
||||
s32 handle_transitions(s32 updateRate);
|
||||
void render_fade_transition(Gfx **dList, MatrixS **mats, Vertex **verts);
|
||||
void render_fade_fullscreen(Gfx **dList, MatrixS **mats, Vertex **verts);
|
||||
void render_fade_barndoor_horizontal(Gfx **dList, MatrixS **mats, Vertex **verts);
|
||||
void render_fade_barndoor_vertical(Gfx **dList, MatrixS **mats, Vertex **verts);
|
||||
void render_fade_barndoor_diagonal(Gfx **dList, MatrixS **mats, Vertex **verts);
|
||||
void render_fade_disabled(Gfx **dList, MatrixS **mats, Vertex **verts);
|
||||
s32 transition_update(s32 updateRate);
|
||||
void transition_render(Gfx **dList, MatrixS **mtx, Vertex **vtx);
|
||||
void transition_render_fullscreen(Gfx **dList, MatrixS **mtx, Vertex **vtx);
|
||||
void transition_render_barndoor_hor(Gfx **dList, MatrixS **mtx, Vertex **vtx);
|
||||
void transition_render_barndoor_vert(Gfx **dList, MatrixS **mtx, Vertex **vtx);
|
||||
void transition_render_barndoor_diag(Gfx **dList, MatrixS **mtx, Vertex **vtx);
|
||||
void transition_render_blank(Gfx **dList, MatrixS **mtx, Vertex **vtx);
|
||||
void transition_fullscreen_start(FadeTransition *transition);
|
||||
void init_transition_blank(FadeTransition *transition);
|
||||
void process_transition_fullscreen(s32 updateRate);
|
||||
void process_transition_disabled(s32 updateRate);
|
||||
void transition_init_blank(FadeTransition *transition);
|
||||
void transition_update_fullscreen(s32 updateRate);
|
||||
void transition_update_blank(s32 updateRate);
|
||||
s32 transition_begin(FadeTransition *transition);
|
||||
void render_fade_circle(Gfx **dList, MatrixS **mats, Vertex **verts);
|
||||
void process_transition_shape(s32 updateRate);
|
||||
void init_transition_shape(FadeTransition *transition, s32 numVerts, s32 numTris, s16 *coords, u8 *nextPos,
|
||||
void transition_render_circle(Gfx **dList, MatrixS **mtx, Vertex **vtx);
|
||||
void transition_update_shape(s32 updateRate);
|
||||
void transition_init_shape(FadeTransition *transition, s32 numVerts, s32 numTris, s16 *coords, u8 *nextPos,
|
||||
u8 *targetPos, u8 *nextAlpha, u8 *targetAlpha, u8 *vertIndices);
|
||||
void func_800C1EE8(s32 updateRate);
|
||||
void render_fade_waves(Gfx **dlist, UNUSED MatrixS **mats, UNUSED Vertex **verts);
|
||||
|
||||
void func_800C15D4(FadeTransition *transition); //Non Matching
|
||||
void transition_update_circle(s32 updateRate);
|
||||
void transition_render_waves(Gfx **dList, UNUSED MatrixS **mtx, UNUSED Vertex **vtx);
|
||||
void transition_init_circle(FadeTransition *transition);
|
||||
|
||||
#endif
|
||||
|
||||
+38
-38
@@ -110,7 +110,7 @@ typedef struct Unk8012C2D4_JP {
|
||||
char unk0;
|
||||
char unk1;
|
||||
u16 unk2;
|
||||
Gfx *dlist;
|
||||
Gfx *dList;
|
||||
} Unk8012C2D4_JP;
|
||||
|
||||
FontData_JP *D_8012C2A4_EE5E4;
|
||||
@@ -1120,7 +1120,7 @@ void clear_dialogue_box_open_flag(s32 dialogueBoxID) {
|
||||
* when the player exits out of one.
|
||||
* Official Name: fontWindowsDraw
|
||||
*/
|
||||
void render_dialogue_boxes(Gfx **dlist, MatrixS **mat, Vertex **verts) {
|
||||
void render_dialogue_boxes(Gfx **dList, MatrixS **mat, Vertex **verts) {
|
||||
s32 i;
|
||||
|
||||
if (sDialogueBoxIsOpen) {
|
||||
@@ -1134,9 +1134,9 @@ void render_dialogue_boxes(Gfx **dlist, MatrixS **mat, Vertex **verts) {
|
||||
for (i = 1; i < DIALOGUEBOXBACKGROUND_COUNT; i++) {
|
||||
if (gDialogueBoxBackground[i].flags & DIALOGUE_BOX_OPEN) {
|
||||
if (gDialogueBoxBackground[i].flags & DIALOGUE_BOX_VERTS) {
|
||||
render_dialogue_box(dlist, mat, verts, i);
|
||||
render_dialogue_box(dList, mat, verts, i);
|
||||
} else {
|
||||
render_dialogue_box(dlist, NULL, NULL, i);
|
||||
render_dialogue_box(dList, NULL, NULL, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1190,7 +1190,7 @@ void s32_to_string(char **outString, s32 number) {
|
||||
* ulx, uly = upper-left position
|
||||
* lrx, lry = lower-right position
|
||||
*/
|
||||
void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
void render_fill_rectangle(Gfx **dList, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
u32 widthAndHeight = fb_size();
|
||||
u32 width = GET_VIDEO_WIDTH(widthAndHeight);
|
||||
u32 height = GET_VIDEO_HEIGHT(widthAndHeight);
|
||||
@@ -1202,7 +1202,7 @@ void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
if (uly < 0) {
|
||||
uly = 0;
|
||||
}
|
||||
gDPFillRectangle((*dlist)++, ulx, uly, lrx, lry);
|
||||
gDPFillRectangle((*dList)++, ulx, uly, lrx, lry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1210,7 +1210,7 @@ void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry) {
|
||||
* Render the selected dialogue box. Background first, then text.
|
||||
* Official Name: fontWindowDraw
|
||||
*/
|
||||
void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogueBoxID) {
|
||||
void render_dialogue_box(Gfx **dList, MatrixS **mat, Vertex **verts, s32 dialogueBoxID) {
|
||||
DialogueBoxBackground *dialogueBox;
|
||||
DialogueBox *dialogueTextBox;
|
||||
s32 i;
|
||||
@@ -1222,24 +1222,24 @@ void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogu
|
||||
|
||||
// Render dialogue box background.
|
||||
if (dialogueBox->backgroundColourA != 0) {
|
||||
gSPDisplayList((*dlist)++, dDialogueBoxBegin);
|
||||
gDkrDmaDisplayList((*dlist)++, OS_K0_TO_PHYSICAL(&dDialogueBoxDrawModes[1]), 2);
|
||||
gDPSetEnvColor((*dlist)++, 0, 0, 0, 0);
|
||||
gSPDisplayList((*dList)++, dDialogueBoxBegin);
|
||||
gDkrDmaDisplayList((*dList)++, OS_K0_TO_PHYSICAL(&dDialogueBoxDrawModes[1]), 2);
|
||||
gDPSetEnvColor((*dList)++, 0, 0, 0, 0);
|
||||
if (dialogueBox->x2 - dialogueBox->x1 < 10 || dialogueBox->y2 - dialogueBox->y1 < 10) {
|
||||
render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y1 - 2, dialogueBox->x2 + 2,
|
||||
render_fill_rectangle(dList, dialogueBox->x1 - 2, dialogueBox->y1 - 2, dialogueBox->x2 + 2,
|
||||
dialogueBox->y2 + 2);
|
||||
} else {
|
||||
render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y1 + 2, dialogueBox->x1 + 2,
|
||||
render_fill_rectangle(dList, dialogueBox->x1 - 2, dialogueBox->y1 + 2, dialogueBox->x1 + 2,
|
||||
dialogueBox->y2 - 2);
|
||||
render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y1 - 2, dialogueBox->x2 + 2,
|
||||
render_fill_rectangle(dList, dialogueBox->x1 - 2, dialogueBox->y1 - 2, dialogueBox->x2 + 2,
|
||||
dialogueBox->y1 + 2);
|
||||
render_fill_rectangle(dlist, dialogueBox->x2 - 2, dialogueBox->y1 + 2, dialogueBox->x2 + 2,
|
||||
render_fill_rectangle(dList, dialogueBox->x2 - 2, dialogueBox->y1 + 2, dialogueBox->x2 + 2,
|
||||
dialogueBox->y2 - 2);
|
||||
render_fill_rectangle(dlist, dialogueBox->x1 - 2, dialogueBox->y2 - 2, dialogueBox->x2 + 2,
|
||||
render_fill_rectangle(dList, dialogueBox->x1 - 2, dialogueBox->y2 - 2, dialogueBox->x2 + 2,
|
||||
dialogueBox->y2 + 2);
|
||||
}
|
||||
gDPPipeSync((*dlist)++);
|
||||
gDPSetEnvColor((*dlist)++, dialogueBox->backgroundColourR, dialogueBox->backgroundColourG,
|
||||
gDPPipeSync((*dList)++);
|
||||
gDPSetEnvColor((*dList)++, dialogueBox->backgroundColourR, dialogueBox->backgroundColourG,
|
||||
dialogueBox->backgroundColourB, dialogueBox->backgroundColourA);
|
||||
// Loops through sDialogueBoxDimensions, rendering fillrects until it forms a rounded rectangle.
|
||||
// The array determines the width and height of each entry before drawing it.
|
||||
@@ -1250,9 +1250,9 @@ void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogu
|
||||
x2 = dialogueBox->x2 - sDialogueBoxDimensions[i];
|
||||
y2 = (sDialogueBoxDimensions[i + 3]) ? sDialogueBoxDimensions[i + 4] + dialogueBox->y2
|
||||
: sDialogueBoxDimensions[i + 4] + dialogueBox->y1;
|
||||
render_fill_rectangle(dlist, x1, y1, x2, y2);
|
||||
render_fill_rectangle(dList, x1, y1, x2, y2);
|
||||
}
|
||||
gDPPipeSync((*dlist)++);
|
||||
gDPPipeSync((*dList)++);
|
||||
}
|
||||
if (mat != NULL && verts != NULL) {
|
||||
if (sDialogueBoxIsOpen == FALSE) {
|
||||
@@ -1260,7 +1260,7 @@ void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogu
|
||||
sDialogueBoxIsOpen = TRUE;
|
||||
}
|
||||
sDialogueBoxCloseTimer = 2;
|
||||
dialogue_ortho(dialogueBox, dlist, mat, verts);
|
||||
dialogue_ortho(dialogueBox, dList, mat, verts);
|
||||
}
|
||||
// Set and render the text portions of the dialogue box.
|
||||
dialogueTextBox = dialogueBox->textBox;
|
||||
@@ -1278,7 +1278,7 @@ void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogu
|
||||
dialogueBox->opacity = dialogueTextBox->opacity;
|
||||
dialogueBox->font = dialogueTextBox->font;
|
||||
parse_string_with_number(dialogueTextBox->text, text, dialogueTextBox->textNum);
|
||||
render_text_string(dlist, dialogueBox, text, 0, 1.0f);
|
||||
render_text_string(dList, dialogueBox, text, 0, 1.0f);
|
||||
dialogueTextBox = dialogueTextBox->nextBox;
|
||||
}
|
||||
}
|
||||
@@ -1339,7 +1339,7 @@ void func_800C6464_C7064(void) {
|
||||
D_8012C2CC_EE60C = mempool_alloc_safe(0x9000, COLOUR_TAG_RED);
|
||||
for (i = 0, charIndex = 0; i < 128; i++) {
|
||||
D_8012C2C8_EE608[i].unk0 = 0;
|
||||
D_8012C2C8_EE608[i].dlist = &D_8012C2C4_EE604[charIndex];
|
||||
D_8012C2C8_EE608[i].dList = &D_8012C2C4_EE604[charIndex];
|
||||
if (i & 1) {
|
||||
charIndex += 10;
|
||||
} else {
|
||||
@@ -1384,7 +1384,7 @@ void func_800C663C_C723C(void) {
|
||||
var_v0 = 0;
|
||||
for (i = 0; i < 0x80; i++) {
|
||||
D_8012C2D4_EE614[i].unk0 = 0;
|
||||
D_8012C2D4_EE614[i].dlist = &D_8012C2D0_EE610[var_v0];
|
||||
D_8012C2D4_EE614[i].dList = &D_8012C2D0_EE610[var_v0];
|
||||
if (i & 1) {
|
||||
var_v0 += 10;
|
||||
} else {
|
||||
@@ -1480,7 +1480,7 @@ s32 func_800C68CC_C74CC(u16 arg0) {
|
||||
D_8012C2A4_EE5E4[D_8012C2B8_EE5F8].offsetToData +
|
||||
(D_8012C2A4_EE5E4[D_8012C2B8_EE5F8].bytesPerCharacter * arg0),
|
||||
D_8012C2A4_EE5E4[D_8012C2B8_EE5F8].bytesPerCharacter);
|
||||
func_800C6DD4_C79D4((*D_8012C2BC_EE5FC)[curIndex].dlist, asset, D_8012C2A4_EE5E4[D_8012C2B8_EE5F8].x,
|
||||
func_800C6DD4_C79D4((*D_8012C2BC_EE5FC)[curIndex].dList, asset, D_8012C2A4_EE5E4[D_8012C2B8_EE5F8].x,
|
||||
D_8012C2A4_EE5E4[D_8012C2B8_EE5F8].y);
|
||||
}
|
||||
|
||||
@@ -1488,7 +1488,7 @@ s32 func_800C68CC_C74CC(u16 arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
void func_800C6DD4_C79D4(Gfx *dList, Asset46 *asset, s32 width, s32 height) {
|
||||
if (asset->unk0 != -1) {
|
||||
asset->unk0 = (s32) asset + asset->unk0;
|
||||
} else {
|
||||
@@ -1501,7 +1501,7 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
}
|
||||
|
||||
if (asset->unk4 != NULL) {
|
||||
gDPLoadTextureBlockS(dlist++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_RGBA, G_IM_SIZ_16b, width, height,
|
||||
gDPLoadTextureBlockS(dList++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_RGBA, G_IM_SIZ_16b, width, height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cmt
|
||||
@@ -1510,7 +1510,7 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD, // shifts
|
||||
G_TX_NOLOD); // shiftt
|
||||
|
||||
gDPLoadMultiBlock_4bS(dlist++, OS_PHYSICAL_TO_K0(asset->unk4), 0x100, 1, G_IM_FMT_I, width, height,
|
||||
gDPLoadMultiBlock_4bS(dList++, OS_PHYSICAL_TO_K0(asset->unk4), 0x100, 1, G_IM_FMT_I, width, height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cmt
|
||||
@@ -1519,12 +1519,12 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD, // shifts
|
||||
G_TX_NOLOD); // shiftt
|
||||
|
||||
gDkrDmaDisplayList(dlist++, OS_K0_TO_PHYSICAL(&dDialogueBoxDrawModes[2]),
|
||||
gDkrDmaDisplayList(dList++, OS_K0_TO_PHYSICAL(&dDialogueBoxDrawModes[2]),
|
||||
numberOfGfxCommands(dDialogueBoxDrawModes[1]));
|
||||
} else {
|
||||
switch (asset->unk8) {
|
||||
case 0: // RGBA32
|
||||
gDPLoadTextureBlockS(dlist++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_RGBA, G_IM_SIZ_32b, width,
|
||||
gDPLoadTextureBlockS(dList++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_RGBA, G_IM_SIZ_32b, width,
|
||||
height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
@@ -1535,7 +1535,7 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD); // shiftt
|
||||
break;
|
||||
case 1: // RGBA16
|
||||
gDPLoadTextureBlockS(dlist++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_RGBA, G_IM_SIZ_16b, width,
|
||||
gDPLoadTextureBlockS(dList++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_RGBA, G_IM_SIZ_16b, width,
|
||||
height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
@@ -1546,7 +1546,7 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD); // shiftt
|
||||
break;
|
||||
case 5: // IA8
|
||||
gDPLoadTextureBlockS(dlist++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_IA, G_IM_SIZ_8b, width, height,
|
||||
gDPLoadTextureBlockS(dList++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_IA, G_IM_SIZ_8b, width, height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cmt
|
||||
@@ -1556,7 +1556,7 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD); // shiftt
|
||||
break;
|
||||
case 6: // IA4
|
||||
gDPLoadTextureBlock_4bS(dlist++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_IA, width, height,
|
||||
gDPLoadTextureBlock_4bS(dList++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_IA, width, height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cmt
|
||||
@@ -1566,7 +1566,7 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD); // shiftt
|
||||
break;
|
||||
case 3: // I4
|
||||
gDPLoadTextureBlock_4bS(dlist++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_I, width, height,
|
||||
gDPLoadTextureBlock_4bS(dList++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_I, width, height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cmt
|
||||
@@ -1576,7 +1576,7 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD); // shiftt
|
||||
break;
|
||||
case 2: // I8
|
||||
gDPLoadTextureBlockS(dlist++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_I, G_IM_SIZ_8b, width, height,
|
||||
gDPLoadTextureBlockS(dList++, OS_PHYSICAL_TO_K0(asset->unk0), G_IM_FMT_I, G_IM_SIZ_8b, width, height,
|
||||
0, // palette
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cms
|
||||
G_TX_NOMIRROR | G_TX_WRAP, // cmt
|
||||
@@ -1586,19 +1586,19 @@ void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height) {
|
||||
G_TX_NOLOD); // shiftt
|
||||
break;
|
||||
}
|
||||
gDkrDmaDisplayList(dlist++, OS_K0_TO_PHYSICAL(&dDialogueBoxDrawModes[0]),
|
||||
gDkrDmaDisplayList(dList++, OS_K0_TO_PHYSICAL(&dDialogueBoxDrawModes[0]),
|
||||
numberOfGfxCommands(dDialogueBoxDrawModes[1]));
|
||||
}
|
||||
gSPEndDisplayList(dlist++);
|
||||
gSPEndDisplayList(dList++);
|
||||
}
|
||||
|
||||
s32 func_800C7744_C8344(Gfx **dlist, u16 charIndex, s32 *outLeft, s32 *outTop, s32 *outRight, s32 *outBottom) {
|
||||
s32 func_800C7744_C8344(Gfx **dList, u16 charIndex, s32 *outLeft, s32 *outTop, s32 *outRight, s32 *outBottom) {
|
||||
s32 index;
|
||||
JpCharHeader *jpChar;
|
||||
|
||||
index = func_800C68CC_C74CC(charIndex);
|
||||
if (index >= 0) {
|
||||
gSPDisplayList((*dlist)++, (*D_8012C2BC_EE5FC)[index].dlist);
|
||||
gSPDisplayList((*dList)++, (*D_8012C2BC_EE5FC)[index].dList);
|
||||
jpChar = D_8012C2C0_EE600[index];
|
||||
*outLeft = jpChar->left;
|
||||
*outTop = jpChar->top;
|
||||
|
||||
+5
-5
@@ -175,9 +175,9 @@ void dialogue_clear(s32 dialogueBoxID);
|
||||
void open_dialogue_box(s32 dialogueBoxID);
|
||||
void dialogue_close(s32 dialogueBoxID);
|
||||
void clear_dialogue_box_open_flag(s32 dialogueBoxID);
|
||||
void render_dialogue_boxes(Gfx **dlist, MatrixS **mat, Vertex **verts);
|
||||
void render_fill_rectangle(Gfx **dlist, s32 ulx, s32 uly, s32 lrx, s32 lry);
|
||||
void render_dialogue_box(Gfx **dlist, MatrixS **mat, Vertex **verts, s32 dialogueBoxID);
|
||||
void render_dialogue_boxes(Gfx **dList, MatrixS **mat, Vertex **verts);
|
||||
void render_fill_rectangle(Gfx **dList, s32 ulx, s32 uly, s32 lrx, s32 lry);
|
||||
void render_dialogue_box(Gfx **dList, MatrixS **mat, Vertex **verts, s32 dialogueBoxID);
|
||||
void parse_string_with_number(char *input, char *output, s32 number);
|
||||
void s32_to_string(char **outString, s32 number);
|
||||
void load_font(s32 fontID);
|
||||
@@ -193,8 +193,8 @@ void func_800C663C_C723C(void);
|
||||
void func_800C6870_C7470(void);
|
||||
void func_800C67F4_C73F4(void);
|
||||
s32 func_800C68CC_C74CC(u16 arg0);
|
||||
void func_800C6DD4_C79D4(Gfx *dlist, Asset46 *asset, s32 width, s32 height);
|
||||
s32 func_800C7744_C8344(Gfx **dlist, u16 charIndex, s32 *outLeft, s32 *outTop, s32 *outRight, s32 *outBottom);
|
||||
void func_800C6DD4_C79D4(Gfx *dList, Asset46 *asset, s32 width, s32 height);
|
||||
s32 func_800C7744_C8344(Gfx **dList, u16 charIndex, s32 *outLeft, s32 *outTop, s32 *outRight, s32 *outBottom);
|
||||
void func_800C7804_C8404(s32 arg0);
|
||||
void func_800C7864_C8464(char *inString, char *outString);
|
||||
void func_800C78E0_C84E0(void);
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#include "gzip.h"
|
||||
#include "printf.h"
|
||||
#include "thread0_epc.h"
|
||||
#include "thread30_track_loading.h"
|
||||
#include "thread30_bgload.h"
|
||||
#include "weather.h"
|
||||
#include "audio.h"
|
||||
#include "objects.h"
|
||||
|
||||
+1090
-1048
File diff suppressed because it is too large
Load Diff
+238
-125
@@ -10,10 +10,49 @@
|
||||
#define HUD_ELEMENT_SPRITE 0x8000
|
||||
#define HUD_ELEMENT_TEXTURE 0xC000
|
||||
|
||||
#define HUD_ELEMENT_COUNT (sizeof(struct HudData) / sizeof(struct HudElement))
|
||||
|
||||
#define HUD_EGG_TOTAL 3
|
||||
|
||||
typedef enum RaceFinishStages {
|
||||
HUD_RACEFINISH_MUTE,
|
||||
HUD_RACEFINISH_TEXT_IN,
|
||||
HUD_RACEFINISH_TEXT_OUT,
|
||||
HUD_RACEFINISH_IDLE
|
||||
} RaceFinishStages;
|
||||
|
||||
typedef enum TimeTrialFinishStages {
|
||||
TIMETRIAL_FINISH_INIT, // Init necessary vars, then advance.
|
||||
TIMETRIAL_FINISH_IN, // Slide in the text.
|
||||
TIMETRIAL_FINISH_SHOW, // Keep the text onscreen for a few seconds.
|
||||
TIMETRIAL_FINISH_OUT, // Slide out the text.
|
||||
TIMETRIAL_FINISH_IDLE, // Text is offscreen, reset a few vars then advance.
|
||||
TIMETRIAL_FINISH_IDLE_2 // Do nothing.
|
||||
} TimeTrialFinishStages;
|
||||
|
||||
typedef enum WrongWayStages {
|
||||
WRONGWAY_HIDE,
|
||||
WRONGWAY_SHOW
|
||||
} WrongWayStages;
|
||||
|
||||
typedef enum LapTextStages {
|
||||
LAPTEXT_IDLE,
|
||||
LAPTEXT_UNK1,
|
||||
LAPTEXT_UNK2,
|
||||
LAPTEXT_UNK3
|
||||
} LapTextStages;
|
||||
|
||||
typedef enum LapTextDirection {
|
||||
LAPTEXT_IN = -1,
|
||||
LAPTEXT_OUT = 1
|
||||
} LapTextDirection;
|
||||
|
||||
// Consistently inconsistent, courtesy of Rare.
|
||||
typedef enum WrongWayDirection {
|
||||
WRONGWAY_OUT = -1,
|
||||
WRONGWAY_IN = 1
|
||||
} WrongWayDirection;
|
||||
|
||||
|
||||
|
||||
enum CourseIndicatorArrows {
|
||||
INDICATOR_NONE,
|
||||
INDICATOR_LEFT,
|
||||
@@ -70,6 +109,70 @@ enum HudElementNames {
|
||||
HUD_ELEMENT_UNK_27
|
||||
};
|
||||
|
||||
enum HudTypes {
|
||||
HUD_RACE_POSITION,
|
||||
HUD_RACE_POSITION_END,
|
||||
HUD_WEAPON_DISPLAY,
|
||||
HUD_LAP_COUNT_LABEL,
|
||||
HUD_LAP_COUNT_CURRENT,
|
||||
HUD_LAP_COUNT_SEPERATOR,
|
||||
HUD_LAP_COUNT_TOTAL,
|
||||
HUD_BANANA_COUNT_ICON_SPIN,
|
||||
HUD_BANANA_COUNT_NUMBER_1,
|
||||
HUD_BANANA_COUNT_NUMBER_2,
|
||||
HUD_RACE_TIME_LABEL,
|
||||
HUD_RACE_TIME_NUMBER,
|
||||
HUD_RACE_START_GO,
|
||||
HUD_RACE_START_READY,
|
||||
HUD_RACE_END_FINISH,
|
||||
HUD_MINIMAP_MARKER,
|
||||
HUD_LAP_COUNT_FLAG,
|
||||
HUD_MAGNET_RETICLE,
|
||||
HUD_BANANA_COUNT_X,
|
||||
HUD_BALLOON_COUNT_ICON,
|
||||
HUD_BALLOON_COUNT_X,
|
||||
HUD_BALLOON_COUNT_NUMBER_1,
|
||||
HUD_BALLOON_COUNT_NUMBER_2,
|
||||
HUD_LAP_TIME_TEXT,
|
||||
HUD_TIME_TRIAL_LAP_TEXT,
|
||||
HUD_TIME_TRIAL_LAP_NUMBER,
|
||||
HUD_STOPWATCH_HANDS,
|
||||
HUD_BANANA_COUNT_ICON_STATIC,
|
||||
HUD_BANANA_COUNT_SPARKLE,
|
||||
HUD_LAP_TEXT_FINAL,
|
||||
HUD_LAP_TEXT_LAP,
|
||||
HUD_LAP_TEXT_TWO,
|
||||
HUD_TREASURE_METRE,
|
||||
HUD_COURSE_ARROWS,
|
||||
HUD_STOPWATCH,
|
||||
HUD_WRONGWAY_1,
|
||||
HUD_WRONGWAY_2,
|
||||
HUD_PRO_AM_LOGO,
|
||||
HUD_SPEEDOMETRE_ARROW,
|
||||
HUD_SPEEDOMETRE_0,
|
||||
HUD_SPEEDOMETRE_30,
|
||||
HUD_SPEEDOMETRE_60,
|
||||
HUD_SPEEDOMETRE_90,
|
||||
HUD_SPEEDOMETRE_120,
|
||||
HUD_SPEEDOMETRE_150,
|
||||
HUD_SPEEDOMETRE_BG,
|
||||
HUD_SILVER_COIN_TALLY,
|
||||
HUD_CHALLENGE_FINISH_POS_1,
|
||||
HUD_CHALLENGE_FINISH_POS_2,
|
||||
HUD_WEAPON_QUANTITY,
|
||||
HUD_CHALLENGE_PORTRAIT,
|
||||
HUD_EGG_CHALLENGE_ICON,
|
||||
HUD_BATTLE_BANANA_ICON,
|
||||
HUD_BATTLE_BANANA_X,
|
||||
HUD_BATTLE_BANANA_COUNT_1,
|
||||
HUD_BATTLE_BANANA_COUNT_2,
|
||||
HUD_RACE_FINISH_POS_1,
|
||||
HUD_TWO_PLAYER_ADV_PORTRAIT,
|
||||
HUD_RACE_FINISH_POS_2,
|
||||
|
||||
HUD_ELEMENT_COUNT
|
||||
};
|
||||
|
||||
enum HudAssets {
|
||||
HUD_ASSET_0,
|
||||
HUD_SPRITE_WEAPONS,
|
||||
@@ -80,10 +183,10 @@ enum HudAssets {
|
||||
HUD_ASSET_6,
|
||||
HUD_SPRITE_GO_BIG,
|
||||
HUD_SPRITE_BANANA_ANIM,
|
||||
HUD_ASSET_9,
|
||||
HUD_ASSET_10,
|
||||
HUD_ASSET_11,
|
||||
HUD_ASSET_12,
|
||||
HUD_ASSET_NUMBERS,
|
||||
HUD_ASSET_NUMBERS_SMALL,
|
||||
HUD_ASSET_SEPERATOR,
|
||||
HUD_ASSET_SEPERATOR_SMALL,
|
||||
HUD_ASSET_13,
|
||||
HUD_SPRITE_MAP_DOT,
|
||||
HUD_ASSET_15,
|
||||
@@ -155,98 +258,108 @@ typedef struct HudElementBase {
|
||||
s16 spriteOffset;
|
||||
} HudElementBase;
|
||||
|
||||
typedef struct HudElement {
|
||||
s16 y_rotation;
|
||||
s16 x_rotation;
|
||||
s16 z_rotation;
|
||||
s16 spriteID;
|
||||
f32 scale;
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
s16 spriteOffset;
|
||||
s8 unk1A;
|
||||
s8 unk1B;
|
||||
s8 unk1C;
|
||||
s8 unk1D;
|
||||
s8 unk1E;
|
||||
s8 unk1F;
|
||||
} HudElement;
|
||||
typedef struct HudElement_ChallengeEggs {
|
||||
s8 alphaTimer; // Counts up, wrapping between s8 bounds, used for setting the alpha.
|
||||
} HudElement_ChallengeEggs;
|
||||
|
||||
typedef struct HudElementArray {
|
||||
s16 y_rotation;
|
||||
s16 x_rotation;
|
||||
s16 z_rotation;
|
||||
typedef struct HudElement_RaceStartGo {
|
||||
s8 musicStartTimer[4]; // Counts up to 60 frames (1 second) before starting the music
|
||||
} HudElement_RaceStartGo;
|
||||
|
||||
typedef struct HudElement_BananaCountIconSpin {
|
||||
s8 spinCounter; // Number of remaining times the icon will spin
|
||||
s8 visualCounter; // Previously known banana value.
|
||||
} HudElement_BananaCountIconSpin;
|
||||
|
||||
typedef struct HudElement_BananaCountSparkle {
|
||||
s8 sparkleTimer; // Delay timer before starting a new sparkle
|
||||
s8 sparkleCounter; // Number of remaining times the icon will sparkle
|
||||
} HudElement_BananaCountSparkle;
|
||||
|
||||
typedef struct HudElement_SilverCoinTally {
|
||||
s8 soundPlayed; // Whether the sound has been played
|
||||
s8 soundTimer; // Delay timer before playing the sound
|
||||
s8 offsetY; // Offset for the hud, utilised for two players.
|
||||
} HudElement_SilverCoinTally;
|
||||
|
||||
typedef struct HudElement_RaceFinishPos {
|
||||
s8 status; // Which behaviour to do
|
||||
s8 textOutTimer; // Delay timer in frames, increases ticks at 120 before getting set to -120
|
||||
s8 textOutTicks; // Number of times delay timer has reached 120. This is because the timer is only 8 bits.
|
||||
s8 targetPos; // Target X offset for the element;
|
||||
} HudElement_RaceFinishPos;
|
||||
|
||||
typedef struct HudElement_RacePosition {
|
||||
s8 active; // Whether the scale effect is active.
|
||||
s8 scaleCounter; // Ranges from -128 to 127, plus 129 then multiplied to 127 to get a 16 bit range for the trig func.
|
||||
s8 baseScale; // The initial scale value used. Lets you have smaller baseline scales.
|
||||
} HudElement_RacePosition;
|
||||
|
||||
typedef struct HudElement_LapCountFlag {
|
||||
s8 visualCounter; // Counter that sets the sprite offset when above 6.
|
||||
} HudElement_LapCountFlag;
|
||||
|
||||
typedef struct HudElement_LapText {
|
||||
s8 status; // Which behaviour to do
|
||||
s8 direction; // Direction to slide the text
|
||||
s8 targetPos; // Target X offset for the element
|
||||
s8 soundPlayed; // Whether the sound has been played
|
||||
} HudElement_LapText;
|
||||
|
||||
typedef struct HudElement_Timer {
|
||||
s8 minutes; // Minutes elapsed
|
||||
s8 seconds; // Seconds elapsed
|
||||
s8 hundredths; // Hundredths of a second elapsed
|
||||
s8 unk1D;
|
||||
} HudElement_Timer;
|
||||
|
||||
typedef struct HudElement_FinishText {
|
||||
s8 status; // Which behaviour to do
|
||||
s8 fadeTimer; // Timer that signals sliding the text offscreen when it hits 120
|
||||
s8 unk1C; // Unused
|
||||
s8 targetPos; // Target X offset for the element
|
||||
} HudElement_FinishText;
|
||||
|
||||
typedef struct HudElement_WeaponDisplay {
|
||||
s8 hideTimer; // Value that counts down when having fewer than 3 quantity.
|
||||
s8 rotation; // s8 rotation representation. Wraps from 0-16, then multiplied by 0x1000
|
||||
s8 scale; // s8 scale representation. A new weapon grows larger until reaching full size. Ranges from 0 - 120
|
||||
s8 prevLevel; // Previous known weapon level, for starting the visual effects upon collecting another.
|
||||
} HudElement_WeaponDisplay;
|
||||
|
||||
typedef struct HudElement_RaceTimeLabel {
|
||||
s8 hideTimer; // Counter that's used for having the text flicker.
|
||||
s8 hundredths; // Rounds hundredths to the next tenth, but functionally unused.
|
||||
} HudElement_RaceTimeLabel;
|
||||
|
||||
typedef struct HudElement {
|
||||
Vec3s rotation;
|
||||
s16 spriteID;
|
||||
f32 scale;
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
Vec3f pos;
|
||||
s16 spriteOffset;
|
||||
s8 unk1A[6];
|
||||
} HudElementArray;
|
||||
union {
|
||||
u8 filler[4]; // Ensures this union is 6 bytes, since Rare never actually use more than four.
|
||||
HudElement_ChallengeEggs challengeEggs;
|
||||
HudElement_RaceStartGo raceStartGo;
|
||||
HudElement_BananaCountIconSpin bananaCountIconSpin;
|
||||
HudElement_BananaCountSparkle bananaCountSparkle;
|
||||
HudElement_SilverCoinTally silverCoinTally;
|
||||
HudElement_RaceFinishPos raceFinishPos;
|
||||
HudElement_RacePosition racePosition;
|
||||
HudElement_LapCountFlag lapCountFlag;
|
||||
HudElement_LapText lapText;
|
||||
HudElement_Timer timer;
|
||||
HudElement_FinishText finishText;
|
||||
HudElement_WeaponDisplay weaponDisplay;
|
||||
HudElement_RaceTimeLabel raceTimeLabel;
|
||||
};
|
||||
|
||||
} HudElement;
|
||||
|
||||
// Size: 0x760
|
||||
typedef struct HudData {
|
||||
/* 0x0000 */ HudElement racePostion;
|
||||
/* 0x0020 */ HudElement racePositionEnd;
|
||||
/* 0x0040 */ HudElement weaponDisplay;
|
||||
/* 0x0060 */ HudElement lapCountLabel;
|
||||
/* 0x0080 */ HudElement lapCountCurrent;
|
||||
/* 0x00A0 */ HudElement lapCountSeperator;
|
||||
/* 0x00C0 */ HudElement lapCountTotal;
|
||||
/* 0x00E0 */ HudElement bananaCountIconSpin;
|
||||
/* 0x0100 */ HudElement bananaCountNumber1;
|
||||
/* 0x0120 */ HudElement bananaCountNumber2;
|
||||
/* 0x0140 */ HudElement raceTimeLabel;
|
||||
/* 0x0160 */ HudElement raceTimeNumber;
|
||||
/* 0x0180 */ HudElementArray raceStartGo;
|
||||
/* 0x01A0 */ HudElement raceStartReady;
|
||||
/* 0x01C0 */ HudElement raceEndFinish;
|
||||
/* 0x01E0 */ HudElement minimapMarker;
|
||||
/* 0x0200 */ HudElement lapCountFlag;
|
||||
/* 0x0200 */ HudElement magnetReticle;
|
||||
/* 0x0240 */ HudElement bananaCountX;
|
||||
/* 0x0260 */ HudElement balloonCountIcon;
|
||||
/* 0x0280 */ HudElement balloonCountX;
|
||||
/* 0x02A0 */ HudElement balloonCountNumber1;
|
||||
/* 0x02C0 */ HudElement balloonCountNumber2;
|
||||
/* 0x02E0 */ HudElement lapTimeText;
|
||||
/* 0x0300 */ HudElement timeTrialLapText;
|
||||
/* 0x0320 */ HudElement timeTrialLapNumber;
|
||||
/* 0x0340 */ HudElement stopwatchHands;
|
||||
/* 0x0360 */ HudElement bananaCountIconStatic;
|
||||
/* 0x0380 */ HudElement bananaCountSparkle;
|
||||
/* 0x03A0 */ HudElement lapTextFinal;
|
||||
/* 0x03C0 */ HudElement lapTextLap;
|
||||
/* 0x03E0 */ HudElement lapTextTwo;
|
||||
/* 0x03E0 */ HudElement treasureMetre;
|
||||
/* 0x0440 */ HudElement courseArrows;
|
||||
/* 0x0440 */ HudElement stopwatch;
|
||||
/* 0x0460 */ HudElement wrongWay1;
|
||||
/* 0x0480 */ HudElement wrongWay2;
|
||||
/* 0x04A0 */ HudElement unk4A0;
|
||||
/* 0x04C0 */ HudElement speedometreArrow;
|
||||
/* 0x04E0 */ HudElement speedometreNumber0;
|
||||
/* 0x0500 */ HudElement speedometreNumber30;
|
||||
/* 0x0520 */ HudElement speedometreNumber60;
|
||||
/* 0x0540 */ HudElement speedometreNumber90;
|
||||
/* 0x0560 */ HudElement speedometreNumber120;
|
||||
/* 0x0580 */ HudElement speedometreNumber150;
|
||||
/* 0x05A0 */ HudElement speedometreBG;
|
||||
/* 0x05C0 */ HudElement silverCoinTally;
|
||||
/* 0x05E0 */ HudElement challengeFinishPosition1;
|
||||
/* 0x0600 */ HudElement challengeFinishPosition2;
|
||||
/* 0x0620 */ HudElement weaponQuantity;
|
||||
/* 0x0640 */ HudElement challengePortrait;
|
||||
/* 0x0660 */ HudElement eggChallengeIcon;
|
||||
/* 0x0680 */ HudElement battleBananaIcon;
|
||||
/* 0x06A0 */ HudElement battleBananaX;
|
||||
/* 0x06C0 */ HudElement battleBananaCount1;
|
||||
/* 0x06E0 */ HudElement battleBananaCount2;
|
||||
/* 0x0700 */ HudElement raceFinishPosition1;
|
||||
/* 0x0720 */ HudElement twoPlayerAdvPortrait;
|
||||
/* 0x0740 */ HudElement raceFinishPosition2;
|
||||
/* 0x0000 */ HudElement entry[HUD_ELEMENT_COUNT];
|
||||
} HudData;
|
||||
|
||||
/* Size: 0x10 bytes */
|
||||
@@ -270,55 +383,55 @@ extern u8 gGfxTaskYieldData[OS_YIELD_DATA_SIZE];
|
||||
|
||||
u8 race_starting(void);
|
||||
void hud_audio_init(void);
|
||||
void render_hud_race(s32 countdown, Object *obj, s32 updateRate);
|
||||
void render_hud_challenge_eggs(s32 countdown, Object *obj, s32 updateRate);
|
||||
void render_hud_race_boss(s32 countdown, Object *obj, s32 updateRate);
|
||||
void render_hud_taj_race(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_main_race(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_main_eggs(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_main_boss(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_main_taj(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_speedometre_reset(void);
|
||||
void play_time_trial_end_message(s16 *playerID);
|
||||
void hud_time_trial_message(s16 *playerID);
|
||||
void hud_sound_play_delayed(u16 soundID, f32 delay, s32 playerIndex);
|
||||
void hud_sound_stop(u16 soundID, s32 playerIndex);
|
||||
void minimap_init(LevelModel *model);
|
||||
s8 get_hud_setting(void);
|
||||
s8 hud_setting(void);
|
||||
void minimap_fade(s32 setting);
|
||||
void minimap_opacity_set(s32 setting);
|
||||
void func_800AB1C8(void);
|
||||
void hud_visibility(u8 setting);
|
||||
void render_race_time(Object_Racer *racer, s32 updateRate);
|
||||
void render_wrong_way_text(Object_Racer *obj, s32 updateRate);
|
||||
void render_course_indicator_arrows(Object_Racer *racer, s32 updateRate);
|
||||
void render_hud_hubworld(Object *obj, s32 updateRate);
|
||||
void render_hud(Gfx **dList, MatrixS **mtx, Vertex **vertexList, Object *obj, s32 updateRate);
|
||||
void render_weapon_hud(Object *obj, s32 updateRate);
|
||||
void render_race_start(s32 countdown, s32 updateRate);
|
||||
void render_racer_bananas(Object_Racer *racer, s32 updateRate);
|
||||
void render_race_finish_position(Object_Racer *racer, s32 updateRate);
|
||||
void render_speedometer(Object *obj, s32 updateRate);
|
||||
void render_lap_count(Object_Racer *racer, s32 updateRate);
|
||||
void render_minimap_and_misc_hud(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 updateRate);
|
||||
void init_hud(s32 viewportCount);
|
||||
void render_hud_battle(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_draw_lives(Object_Racer *racer, s32 updateRate);
|
||||
void free_hud(void);
|
||||
void set_stopwatch_face(u8, u8, u8, u8, u8);
|
||||
void hud_race_time(Object_Racer *racer, s32 updateRate);
|
||||
void hud_wrong_way(Object_Racer *obj, s32 updateRate);
|
||||
void hud_course_arrows(Object_Racer *racer, s32 updateRate);
|
||||
void hud_main_hub(Object *obj, s32 updateRate);
|
||||
void hud_render_player(Gfx **dList, MatrixS **mtx, Vertex **vertexList, Object *obj, s32 updateRate);
|
||||
void hud_weapon(Object *obj, s32 updateRate);
|
||||
void hud_race_start(s32 countdown, s32 updateRate);
|
||||
void hud_bananas(Object_Racer *racer, s32 updateRate);
|
||||
void hud_race_finish_1player(Object_Racer *racer, s32 updateRate);
|
||||
void hud_speedometre(Object *obj, s32 updateRate);
|
||||
void hud_lap_count(Object_Racer *racer, s32 updateRate);
|
||||
void hud_render_general(Gfx **dList, MatrixS **mtx, Vertex **vtx, s32 updateRate);
|
||||
void hud_init(s32 viewportCount);
|
||||
void hud_main_battle(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_lives_render(Object_Racer *racer, s32 updateRate);
|
||||
void hud_free(void);
|
||||
void hud_stopwatch_face(u8, u8, u8, u8, u8);
|
||||
void hud_audio_update(s32 updateRate);
|
||||
void render_silver_coin_counter(Object_Racer *racer, s32 updateRate);
|
||||
void render_magnet_reticle(Object *racerObj);
|
||||
void render_time_trial_finish(Object_Racer *racer, s32 updateRate);
|
||||
void hud_silver_coins(Object_Racer *racer, s32 updateRate);
|
||||
void hud_magnet_reticle(Object *racerObj);
|
||||
void hud_time_trial_finish(Object_Racer *racer, s32 updateRate);
|
||||
void hud_eggs_portrait(Object_Racer *racer, s32 updateRate);
|
||||
void hud_draw_eggs(Object *racerObj, s32 updateRate);
|
||||
void render_race_position(Object_Racer *racer, s32 updateRate);
|
||||
void render_hud_banana_challenge(s32 countdown, Object *obj, s32 updateRate);
|
||||
void render_balloon_count(Object_Racer *racer);
|
||||
void render_treasure_hud(Object_Racer *racer);
|
||||
void hud_race_position(Object_Racer *racer, s32 updateRate);
|
||||
void hud_main_treasure(s32 countdown, Object *obj, s32 updateRate);
|
||||
void hud_balloons(Object_Racer *racer);
|
||||
void hud_treasure(Object_Racer *racer);
|
||||
void minimap_marker_pos(f32 x, f32 z, f32 angleSin, f32 angleCos, f32 modelAspectRatio);
|
||||
void render_timer(s32 x, s32 y, s32 minutes, s32 seconds, s32 hundredths, s32 smallFont);
|
||||
void hud_timer_render(s32 x, s32 y, s32 minutes, s32 seconds, s32 hundredths, s32 smallFont);
|
||||
void hud_draw_model(ObjectModel *objModel);
|
||||
|
||||
// Non Matching
|
||||
void func_800AA600(Gfx **dList, MatrixS **mtx, Vertex **vtxList, HudElement *arg3);
|
||||
void func_800A277C(s32, Object*, s32);
|
||||
void func_800A6254(Object_Racer *racer, s32 updateRate);
|
||||
void hud_element_render(Gfx **dList, MatrixS **mtx, Vertex **vtxList, HudElement *arg3);
|
||||
void hud_main_time_trial(s32, Object*, s32);
|
||||
void hud_race_finish_multiplayer(Object_Racer *racer, s32 updateRate);
|
||||
void func_800A1E48(Object*, s32 updateRate);
|
||||
void func_8009F034(void);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/* Generated by spimdisasm 1.30.0 */
|
||||
|
||||
leaf object_animate
|
||||
leaf obj_animate
|
||||
/* 62930 80061D30 27BDFFF8 */ addiu $sp, $sp, -0x8
|
||||
/* 62934 80061D34 AFB10004 */ sw $s1, 0x4($sp)
|
||||
/* 62938 80061D38 AFB00000 */ sw $s0, 0x0($sp)
|
||||
@@ -380,4 +380,4 @@ leaf object_animate
|
||||
/* 62E80 80062280 8FB10004 */ lw $s1, 0x4($sp)
|
||||
/* 62E84 80062284 03E00008 */ jr $ra
|
||||
/* 62E88 80062288 27BD0008 */ addiu $sp, $sp, 0x8
|
||||
.end object_animate
|
||||
.end obj_animate
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/* Generated by spimdisasm 1.30.0 */
|
||||
|
||||
leaf func_800245F0
|
||||
leaf obj_shade_fast
|
||||
/* 251F0 800245F0 8CA70054 */ lw $a3, 0x54($a1)
|
||||
/* 251F4 800245F4 10E00051 */ beqz $a3, .L8002473C
|
||||
/* 251F8 800245F8 00000000 */ nop
|
||||
@@ -102,7 +102,7 @@ leaf func_800245F0
|
||||
.L8002473C:
|
||||
/* 2533C 8002473C 03E00008 */ jr $ra
|
||||
/* 25340 80024740 00000000 */ nop
|
||||
.end func_800245F0
|
||||
.end obj_shade_fast
|
||||
|
||||
leaf calc_dynamic_lighting_for_object_2
|
||||
/* 25344 80024744 27BDFF80 */ addiu $sp, $sp, -0x80
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user