Lots of Labelling (#394)

* Update Makefile

* rename object stack tracing

* no

* name the timer of pure unadulterated rage

* rename rendering

* So much

* Label boss racer anims

* organise boss racers

* remove some unused funcs from headers

* dialogue

* there we go

* Update vehicle_bluey.c

* Update README.md

* quick fixes

* quicker fixes
This commit is contained in:
Fazana
2023-05-20 23:03:06 +01:00
committed by GitHub
parent df514e5f4e
commit 4d668a1ef4
43 changed files with 1755 additions and 1634 deletions
+1
View File
@@ -350,6 +350,7 @@ endif
clean_src: clean_lib
ifneq ($(wildcard $(BUILD_DIR)/src/.*),)
rm -r $(BUILD_DIR)/src/*.o
rm -rf dkr.ld
else
@echo "/build/lib directory has already been deleted."
endif
+12 -12
View File
@@ -5,11 +5,11 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the
Currently, only the US 1.0 version of the game is supported. US 1.1, EU 1.0, EU 1.1, and JP are not supported at this time.
<!-- README_SCORE_SUMMARY_BEGIN -->
As of April 24, 2023, this is our current score:
As of May 19, 2023, this is our current score:
&emsp;&emsp;&emsp;&emsp;Decomp progress: 51.18%
&emsp;&emsp;&emsp;&emsp;Decomp progress: 51.99%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 24.34%
&emsp;&emsp;&emsp;&emsp;Documentation progress: 26.52%
<!-- README_SCORE_SUMMARY_END -->
---
@@ -132,11 +132,11 @@ As of April 28, 2023, this is our current score:
```
=================================================
ADVENTURE ONE (ASM -> C Decompilation)
---------------- 51.57% Complete ----------------
# Decompiled functions: 1503
# GLOBAL_ASM remaining: 329
---------------- 51.99% Complete ----------------
# Decompiled functions: 1507
# GLOBAL_ASM remaining: 325
# NON_MATCHING functions: 12
# NON_EQUIVALENT WIP functions: 64
# NON_EQUIVALENT WIP functions: 65
------------------ Game Status ------------------
Balloons: 26/47, Keys: 3/4, Trophies: 2/5
T.T. Amulets: 2/4, Wizpig Amulets: 2/4
@@ -144,14 +144,14 @@ As of April 28, 2023, this is our current score:
We are racing the octopus boss Bubbler. (Lap 1/3)
=================================================
ADVENTURE TWO (Cleanup & Documentation)
---------------- 25.60% Complete ----------------
# Documented functions: 541
# Undocumented remaining: 1023
---------------- 26.52% Complete ----------------
# Documented functions: 568
# Undocumented remaining: 996
------------------ Game Status ------------------
Balloons: 12/47, Keys: 1/4, Trophies: 1/5
Balloons: 13/47, Keys: 1/4, Trophies: 1/5
T.T. Amulets: 1/4, Wizpig Amulets: 1/4
-------------------------------------------------
We are racing Taj in the Car Challenge. (Lap 3/3)
We are racing in Everfrost Peak. (Lap 2/3)
=================================================
```
<!-- README_SCORE_END -->
+1 -1
View File
@@ -583,7 +583,7 @@ glabel func_800AA600
/* 0ABA8C 800AAE8C 24846CFC */ addiu $a0, %lo(gHUDCurrDisplayList) # addiu $a0, $a0, 0x6cfc
/* 0ABA90 800AAE90 A0E0003A */ sb $zero, 0x3a($a3)
/* 0ABA94 800AAE94 A0EE0039 */ sb $t6, 0x39($a3)
/* 0ABA98 800AAE98 0C004B57 */ jal func_80012D5C
/* 0ABA98 800AAE98 0C004B57 */ jal render_object
/* 0ABA9C 800AAE9C E4E60008 */ swc1 $f6, 8($a3)
/* 0ABAA0 800AAEA0 10000018 */ b .L800AAF04
/* 0ABAA4 800AAEA4 86080006 */ lh $t0, 6($s0)
+1 -1
View File
@@ -61,7 +61,7 @@ glabel func_8009CA60
/* 09D74C 8009CB4C A159003A */ sb $t9, 0x3a($t2)
.L8009CB50:
/* 09D750 8009CB50 8D8CF764 */ lw $t4, %lo(sMenuGuiOpacity)($t4)
/* 09D754 8009CB54 0C004B57 */ jal func_80012D5C
/* 09D754 8009CB54 0C004B57 */ jal render_object
/* 09D758 8009CB58 A0EC0039 */ sb $t4, 0x39($a3)
/* 09D75C 8009CB5C 10000084 */ b .L8009CD70
/* 09D760 8009CB60 8FBF0024 */ lw $ra, 0x24($sp)
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -356,9 +356,9 @@ glabel func_80012F94
/* 01406C 8001346C 3C018012 */ lui $at, %hi(D_8011AD28) # $at, 0x8012
/* 014070 80013470 8FBF001C */ lw $ra, 0x1c($sp)
/* 014074 80013474 E420AD28 */ swc1 $f0, %lo(D_8011AD28)($at)
/* 014078 80013478 3C018012 */ lui $at, %hi(D_8011AD30) # $at, 0x8012
/* 014078 80013478 3C018012 */ lui $at, %hi(gCurrentLightIntensity) # $at, 0x8012
/* 01407C 8001347C 8FB00018 */ lw $s0, 0x18($sp)
/* 014080 80013480 E42EAD30 */ swc1 $f14, %lo(D_8011AD30)($at)
/* 014080 80013480 E42EAD30 */ swc1 $f14, %lo(gCurrentLightIntensity)($at)
/* 014084 80013484 03E00008 */ jr $ra
/* 014088 80013488 27BD0050 */ addiu $sp, $sp, 0x50
+2 -2
View File
@@ -30,8 +30,8 @@ glabel func_800159C8
/* 0165EC 800159EC 460A4001 */ sub.s $f0, $f8, $f10
/* 0165F0 800159F0 44814000 */ mtc1 $at, $f8
/* 0165F4 800159F4 C4A60014 */ lwc1 $f6, 0x14($a1)
/* 0165F8 800159F8 3C018012 */ lui $at, %hi(D_8011ADA8) # $at, 0x8012
/* 0165FC 800159FC C42AADA8 */ lwc1 $f10, %lo(D_8011ADA8)($at)
/* 0165F8 800159F8 3C018012 */ lui $at, %hi(gObjectUpdateRateF) # $at, 0x8012
/* 0165FC 800159FC C42AADA8 */ lwc1 $f10, %lo(gObjectUpdateRateF)($at)
/* 016600 80015A00 46043381 */ sub.s $f14, $f6, $f4
/* 016604 80015A04 8CA6004C */ lw $a2, 0x4c($a1)
/* 016608 80015A08 460A4183 */ div.s $f6, $f8, $f10
+3 -3
View File
@@ -21,7 +21,7 @@ glabel spawn_object
/* 00F68C 8000EA8C 0018C840 */ sll $t9, $t8, 1
/* 00F690 8000EA90 01D92825 */ or $a1, $t6, $t9
/* 00F694 8000EA94 AFA50064 */ sw $a1, 0x64($sp)
/* 00F698 8000EA98 0C02DDAE */ jal func_800B76B8
/* 00F698 8000EA98 0C02DDAE */ jal update_object_stack_trace
/* 00F69C 8000EA9C 00002025 */ move $a0, $zero
/* 00F6A0 8000EAA0 8FA3006C */ lw $v1, 0x6c($sp)
/* 00F6A4 8000EAA4 3C0F8012 */ lui $t7, %hi(gAssetsObjectHeadersTableLength) # $t7, 0x8012
@@ -89,7 +89,7 @@ glabel spawn_object
/* 00F784 8000EB84 31AF0001 */ andi $t7, $t5, 1
/* 00F788 8000EB88 11E00006 */ beqz $t7, .L8000EBA4
/* 00F78C 8000EB8C 8FA20068 */ lw $v0, 0x68($sp)
/* 00F790 8000EB90 0C02DDAE */ jal func_800B76B8
/* 00F790 8000EB90 0C02DDAE */ jal update_object_stack_trace
/* 00F794 8000EB94 2405FFFF */ li $a1, -1
/* 00F798 8000EB98 100002A4 */ b .L8000F62C
/* 00F79C 8000EB9C 00001025 */ move $v0, $zero
@@ -828,7 +828,7 @@ glabel L8000EDE0
/* 010214 8000F614 0C01867D */ jal func_800619F4
/* 010218 8000F618 00002025 */ move $a0, $zero
/* 01021C 8000F61C 00002025 */ move $a0, $zero
/* 010220 8000F620 0C02DDAE */ jal func_800B76B8
/* 010220 8000F620 0C02DDAE */ jal update_object_stack_trace
/* 010224 8000F624 2405FFFF */ li $a1, -1
/* 010228 8000F628 02401025 */ move $v0, $s2
.L8000F62C:
+1 -1
View File
@@ -2152,7 +2152,7 @@ glabel func_80046524
/* 048FDC 800483DC 02202025 */ move $a0, $s1
/* 048FE0 800483E0 8FA60128 */ lw $a2, 0x128($sp)
/* 048FE4 800483E4 02002825 */ move $a1, $s0
/* 048FE8 800483E8 0C0156A1 */ jal func_80055A84
/* 048FE8 800483E8 0C0156A1 */ jal onscreen_ai_racer_physics
/* 048FEC 800483EC AFA800C4 */ sw $t0, 0xc4($sp)
/* 048FF0 800483F0 8FA800C4 */ lw $t0, 0xc4($sp)
/* 048FF4 800483F4 10000008 */ b .L80048418
+1 -1
View File
@@ -2492,7 +2492,7 @@ glabel func_80049794
/* 04C710 8004BB10 02202025 */ move $a0, $s1
/* 04C714 8004BB14 02002825 */ move $a1, $s0
/* 04C718 8004BB18 AFA800B8 */ sw $t0, 0xb8($sp)
/* 04C71C 8004BB1C 0C0156A1 */ jal func_80055A84
/* 04C71C 8004BB1C 0C0156A1 */ jal onscreen_ai_racer_physics
/* 04C720 8004BB20 E7AC00EC */ swc1 $f12, 0xec($sp)
/* 04C724 8004BB24 8FA800B8 */ lw $t0, 0xb8($sp)
/* 04C728 8004BB28 C7AC00EC */ lwc1 $f12, 0xec($sp)
+1 -1
View File
@@ -553,7 +553,7 @@ glabel func_8004CC20
/* 04E018 8004D418 02202025 */ move $a0, $s1
/* 04E01C 8004D41C 8FA600D8 */ lw $a2, 0xd8($sp)
/* 04E020 8004D420 02202025 */ move $a0, $s1
/* 04E024 8004D424 0C0156A1 */ jal func_80055A84
/* 04E024 8004D424 0C0156A1 */ jal onscreen_ai_racer_physics
/* 04E028 8004D428 02002825 */ move $a1, $s0
/* 04E02C 8004D42C 10000004 */ b .L8004D440
/* 04E030 8004D430 3C013F80 */ li $at, 0x3F800000 # 1.000000
+1 -1
View File
@@ -732,7 +732,7 @@ glabel func_8004F7F4
/* 050E38 80050238 02202025 */ move $a0, $s1
/* 050E3C 8005023C 8FA600C0 */ lw $a2, 0xc0($sp)
/* 050E40 80050240 02202025 */ move $a0, $s1
/* 050E44 80050244 0C0156A1 */ jal func_80055A84
/* 050E44 80050244 0C0156A1 */ jal onscreen_ai_racer_physics
/* 050E48 80050248 02002825 */ move $a1, $s0
/* 050E4C 8005024C 10000005 */ b .L80050264
/* 050E50 80050250 3C013F80 */ lui $at, 0x3f80
@@ -33,8 +33,8 @@ glabel func_800B71B0
/* 0B7E20 800B7220 00000000 */ nop
/* 0B7E24 800B7224 10990081 */ beq $a0, $t9, .L800B742C
/* 0B7E28 800B7228 00000000 */ nop
/* 0B7E2C 800B722C 3C028013 */ lui $v0, %hi(D_80129FB0) # $v0, 0x8013
/* 0B7E30 800B7230 24429FB0 */ addiu $v0, %lo(D_80129FB0) # addiu $v0, $v0, -0x6050
/* 0B7E2C 800B722C 3C028013 */ lui $v0, %hi(gObjectStackTrace) # $v0, 0x8013
/* 0B7E30 800B7230 24429FB0 */ addiu $v0, %lo(gObjectStackTrace) # addiu $v0, $v0, -0x6050
/* 0B7E34 800B7234 8C480000 */ lw $t0, ($v0)
/* 0B7E38 800B7238 00E02025 */ move $a0, $a3
/* 0B7E3C 800B723C 44882000 */ mtc1 $t0, $f4
@@ -10,8 +10,8 @@ glabel func_800B7460
/* 0B8080 800B7480 27A40840 */ addiu $a0, $sp, 0x840
/* 0B8084 800B7484 0C034138 */ jal bzero
/* 0B8088 800B7488 240501B0 */ li $a1, 432
/* 0B808C 800B748C 3C028013 */ lui $v0, %hi(D_80129FB0) # $v0, 0x8013
/* 0B8090 800B7490 24429FB0 */ addiu $v0, %lo(D_80129FB0) # addiu $v0, $v0, -0x6050
/* 0B808C 800B748C 3C028013 */ lui $v0, %hi(gObjectStackTrace) # $v0, 0x8013
/* 0B8090 800B7490 24429FB0 */ addiu $v0, %lo(gObjectStackTrace) # addiu $v0, $v0, -0x6050
/* 0B8094 800B7494 8C580000 */ lw $t8, ($v0)
/* 0B8098 800B7498 8C590004 */ lw $t9, 4($v0)
/* 0B809C 800B749C 8C480008 */ lw $t0, 8($v0)
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -634,7 +634,7 @@ typedef enum {
OBJECT_MODEL_TYPE_SPRITE_BILLBOARD,
OBJECT_MODEL_TYPE_VEHICLE_PART,
OBJECT_MODEL_TYPE_UNKNOWN3,
OBJECT_MODEL_TYPE_UNKNOWN4
OBJECT_MODEL_TYPE_MISC
} ObjectModelType;
typedef struct ObjHeaderParticleEntry {
@@ -1037,7 +1037,7 @@ typedef struct Object_Racer {
/* 0x003 */ s8 characterId; // Affects minimap color, horn, voice, etc.
/* 0x004 */ s32 unk4;
/* 0x008 */ f32 forwardVel;
/* 0x00C */ f32 unkC;
/* 0x00C */ f32 animationSpeed;
/* 0x010 */ s32 unk10;
/* 0x014 */ s32 unk14;
/* 0x018 */ s32 unk18;
@@ -1225,7 +1225,7 @@ typedef struct Object_Racer {
/* 0x201 */ s8 unk201;
/* 0x202 */ s8 silverCoinCount;
/* 0x203 */ s8 boostType;
/* 0x204 */ s16 unk204;
/* 0x204 */ s16 bubbleTrapTimer;
/* 0x206 */ s16 unk206;
/* 0x208 */ s8 unk208;
/* 0x209 */ u8 unk209;
@@ -1671,7 +1671,7 @@ typedef struct Object {
/* 0x0044 */ unk800B0698_44 *unk44_0;
};
/* 0x0048 */ s16 behaviorId;
/* 0x004A */ s16 unk4A;
/* 0x004A */ s16 unk4A; // Upper byte is object ID, lower byte is object size.
/* 0x004C */ ObjectInteraction *interactObj; //player + 0x318
/* 0x0050 */ ShadowData *shadow; //player + 0x2F4
/* 0x0054 */ Object_54 *unk54; //player + 0x2C0
+1 -2
View File
@@ -84,7 +84,6 @@ void func_800660C0(void);
void func_800660D0(void);
UNUSED f32 get_current_camera_fov(void);
void update_camera_fov(f32 camFieldOfView);
UNUSED void calculate_camera_perspective(void);
Matrix *func_80066204(void);
s32 get_viewport_count(void);
s32 get_current_viewport(void);
@@ -123,7 +122,7 @@ void set_camera_shake(f32 magnitude);
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);
void camera_push_model_mtx(Gfx **arg0, MatrixS **arg1, ObjectTransform *arg2, f32 arg3, f32 arg4);
void camera_push_model_mtx(Gfx **arg0, MatrixS **arg1, ObjectTransform *arg2, f32 scale, f32 scaleY);
void set_viewport_scissor(Gfx **dlist);
void func_80069A40(Gfx **dlist);
void copy_viewports_to_stack(void);
-3
View File
@@ -171,9 +171,6 @@ void move_dialogue_box_to_front(s32 dialogueBoxID, DialogueBox *box);
void assign_dialogue_box_id(s32 dialogueBoxID);
void open_dialogue_box(s32 dialogueBoxID);
void close_dialogue_box(s32 dialogueBoxID);
UNUSED void set_dialogue_box_unused_flag(s32 dialogueBoxID);
UNUSED void dialogue_box_clear_flags(s32 dialogueBoxID);
UNUSED void enable_dialogue_box_vertices(s32 dialogueBoxID);
void func_800C56D0(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);
+2 -2
View File
@@ -209,7 +209,7 @@ void func_800C30CC(void) {
D_800E3670 = 0;
D_8012A789 = 0;
for (i = 0; i < 10; i++) {
func_8009CFB0();
try_close_dialogue_box();
};
func_800C2AB4();
}
@@ -323,7 +323,7 @@ void func_800C3440(s32 arg0) {
D_8012A784 = 1;
}
}
func_8009CFEC(3);
npc_dialogue_loop(DIALOGUE_CHALLENGE);
}
}
}
+24 -9
View File
@@ -8213,6 +8213,9 @@ void func_8009BD5C(void) {
void func_8009BE54() {
}
/**
* Reset all menu related joystick inputs for each player.
*/
void reset_controller_sticks(void) {
s32 i;
for (i = 0; i < 4; i++) {
@@ -8228,6 +8231,10 @@ void reset_controller_sticks(void) {
#define STICK_DEADZONE 35
#define STICK_DELAY_AMOUNT 15
/**
* Reads the stick inputs, then with the aid of a maximum range and a deadzone, writes it to the menu inputs.
* Stick input delay is not time corrected, meaning holding the stick is slower at lower framerates.
*/
void update_controller_sticks(void) {
s32 XClamp, YClamp;
s32 i;
@@ -8608,7 +8615,11 @@ void func_8009CF68(s32 arg0) {
}
}
void func_8009CFB0(void) {
/**
* If the call to close dialogue has been made, this will begin hiding it.
* It then also resets the menus stick inputs.
*/
void try_close_dialogue_box(void) {
if (gNeedToCloseDialogueBox) {
gNeedToCloseDialogueBox = FALSE;
close_dialogue_box(1);
@@ -8616,17 +8627,21 @@ void func_8009CFB0(void) {
}
}
s32 func_8009CFEC(u32 dialogueOption) {
/**
* Top level function for controlling dialogue with NPC's.
* Returning nonzero will trigger those NPC's to stop dialogue.
*/
s32 npc_dialogue_loop(u32 dialogueOption) {
s32 result;
D_800DF4E4[dialogueOption] = 0;
if ((func_800C3400() != 0) && (dialogueOption != DIALOG_CHALLENGE)) {
if ((func_800C3400() != 0) && (dialogueOption != DIALOGUE_CHALLENGE)) {
return 0;
}
if (gNeedToCloseDialogueBox) {
return 0;
}
if (dialogueOption != DIALOG_CHALLENGE) {
if (dialogueOption != DIALOGUE_CHALLENGE) {
func_8006F388(1);
}
result = 0;
@@ -8636,19 +8651,19 @@ s32 func_8009CFEC(u32 dialogueOption) {
set_current_dialogue_background_colour(1, 0, 0, 0, 128);
func_8001F450();
switch (dialogueOption) {
case DIALOG_TAJ:
case DIALOGUE_TAJ:
result = taj_menu_loop(); // Taj menu
break;
case DIALOG_TT:
case DIALOGUE_TT:
result = tt_menu_loop(); // T.T. menu
break;
case DIALOG_CHALLENGE:
case DIALOGUE_CHALLENGE:
result = func_800C3564(); // Taj challenge completed/failed menu
break;
case DIALOG_TROPHY:
case DIALOGUE_TROPHY:
result = trophy_race_cabinet_menu_loop(); // Trophy race cabinet menu
break;
case DIALOG_RACERESULT:
case DIALOGUE_RACERESULT:
result = dialogue_race_defeat();
break;
}

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