From 72e55efcb441ee3d7bfe5395ae1ae955b137ccf8 Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Thu, 22 Jun 2023 15:13:36 -0400 Subject: [PATCH] New Match 52% + A LOT OF RENAMES (#397) * Remove separate RODATA declarations for debug strings. * Migrate thread1 stack * func_80031F88 WIP * Match func_80031F88 * Rename some funcs using JFG as basis. * Rename unknown_032760 to lights, and move asm files around. * More names, and a slightly better score for setup_lights * Couple of possible names. * Support expansion pak without resorting to fake matches. * Rename and move bcmp to a libultra folder and leave it as asm. * Rename unknown_0255E0 to tracks * Rename unknown_078050 to rcp. * Update score --- README.md | 22 +-- .../func_80031CAC.s | 0 .../func_80032424.s | 0 .../func_80032C7C.s | 4 +- .../func_800337E4.s | 0 .../func_80031BB8.s => lights/setup_lights.s} | 4 +- .../func_80036040.s | 0 .../func_8003F2E8.s | 0 .../obj_init_butterfly.s | 0 .../obj_init_fish.s | 0 .../obj_init_midifade.s | 0 .../obj_loop_animator.s | 0 .../obj_loop_butterfly.s | 0 .../obj_loop_char_select.s | 0 .../obj_loop_door.s | 0 .../obj_loop_effectbox.s | 0 .../obj_loop_fish.s | 0 .../obj_loop_texscroll.s | 0 .../obj_loop_weaponballoon.s | 0 asm/non_matchings/objects/spawn_object.s | 2 +- .../{unknown_078050 => rcp}/func_80078190.s | 0 .../func_800249F0.s | 0 .../func_80025510.s | 0 .../func_8002581C.s | 0 .../func_80026070.s | 0 .../func_80026430.s | 0 .../func_80026C14.s | 0 .../func_80026E54.s | 0 .../func_80027184.s | 0 .../func_80027568.s | 0 .../func_800278E8.s | 0 .../func_80028050.s | 0 .../func_8002B0F4.s | 0 .../func_8002BAB0.s | 0 .../func_8002C0C4.s | 0 .../func_8002CC30.s | 0 .../func_8002DE30.s | 0 .../func_8002E234.s | 0 .../func_8002E904.s | 0 .../func_8002EEEC.s | 0 .../func_8002F2AC.s | 0 .../func_8002F440.s | 0 .../func_8002FA64.s | 0 .../func_8002FD74.s | 0 .../func_8002FF6C.s | 0 .../func_800304C8.s | 0 .../func_80030664.s | 0 .../func_80030DE0.s | 0 .../unknown_032760/func_80031F88.s | 172 ------------------ include/config.h | 2 +- include/structs.h | 23 ++- .../unknown_0CEC50/_bcmp.s => bcmp.s} | 11 +- src/camera.c | 2 +- src/game.c | 10 +- src/game_ui.c | 6 +- src/{unknown_032760.c => lights.c} | 134 +++++++++++--- src/{unknown_032760.h => lights.h} | 31 +++- src/main.c | 11 +- src/memory.c | 10 +- src/memory.h | 6 +- src/menu.c | 5 +- src/object_functions.c | 30 +-- src/object_models.c | 3 +- src/objects.c | 12 +- src/objects.h | 3 +- src/particles.c | 2 +- src/printf.c | 2 +- src/racer.c | 2 +- src/{unknown_078050.c => rcp.c} | 4 +- src/{unknown_078050.h => rcp.h} | 0 src/save_data.c | 5 +- src/save_data.h | 1 + src/textures_sprites.c | 2 +- src/thread3_main.c | 21 +-- src/{unknown_0255E0.c => tracks.c} | 56 +++--- src/{unknown_0255E0.h => tracks.h} | 4 +- src/unknown_008C40.c | 2 +- src/unknown_0CEC50.c | 11 -- src/unknown_0CEC50.h | 12 -- src/weather.c | 2 +- 80 files changed, 283 insertions(+), 346 deletions(-) rename asm/non_matchings/{unknown_032760 => lights}/func_80031CAC.s (100%) rename asm/non_matchings/{unknown_032760 => lights}/func_80032424.s (100%) rename asm/non_matchings/{unknown_032760 => lights}/func_80032C7C.s (99%) rename asm/non_matchings/{unknown_032760 => lights}/func_800337E4.s (100%) rename asm/non_matchings/{unknown_032760/func_80031BB8.s => lights/setup_lights.s} (97%) rename asm/non_matchings/{unknown_032760 => object_functions}/func_80036040.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/func_8003F2E8.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_init_butterfly.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_init_fish.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_init_midifade.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_animator.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_butterfly.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_char_select.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_door.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_effectbox.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_fish.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_texscroll.s (100%) rename asm/non_matchings/{unknown_032760 => object_functions}/obj_loop_weaponballoon.s (100%) rename asm/non_matchings/{unknown_078050 => rcp}/func_80078190.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_800249F0.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80025510.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002581C.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80026070.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80026430.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80026C14.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80026E54.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80027184.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80027568.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_800278E8.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80028050.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002B0F4.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002BAB0.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002C0C4.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002CC30.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002DE30.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002E234.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002E904.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002EEEC.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002F2AC.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002F440.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002FA64.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002FD74.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_8002FF6C.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_800304C8.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80030664.s (100%) rename asm/non_matchings/{unknown_0255E0 => tracks}/func_80030DE0.s (100%) delete mode 100644 asm/non_matchings/unknown_032760/func_80031F88.s rename lib/asm/{non_matchings/unknown_0CEC50/_bcmp.s => bcmp.s} (92%) rename src/{unknown_032760.c => lights.c} (77%) rename src/{unknown_032760.h => lights.h} (76%) rename src/{unknown_078050.c => rcp.c} (99%) rename src/{unknown_078050.h => rcp.h} (100%) rename src/{unknown_0255E0.c => tracks.c} (98%) rename src/{unknown_0255E0.h => tracks.h} (99%) delete mode 100644 src/unknown_0CEC50.c delete mode 100644 src/unknown_0CEC50.h diff --git a/README.md b/README.md index 453d1b14..d80208a3 100644 --- a/README.md +++ b/README.md @@ -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. -As of May 19, 2023, this is our current score: +As of June 22, 2023, this is our current score: -    Decomp progress: 51.99% +    Decomp progress: 52.10% -    Documentation progress: 26.52% +    Documentation progress: 26.72% --- @@ -128,25 +128,25 @@ s32 is_drumstick_unlocked(void) { ``` -As of April 28, 2023, this is our current score: +As of June 22, 2023, this is our current score: ``` ================================================= ADVENTURE ONE (ASM -> C Decompilation) - ---------------- 51.99% Complete ---------------- - # Decompiled functions: 1507 - # GLOBAL_ASM remaining: 325 + ---------------- 52.10% Complete ---------------- + # Decompiled functions: 1508 + # GLOBAL_ASM remaining: 323 # NON_MATCHING functions: 12 # 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 ------------------------------------------------- - We are racing the octopus boss Bubbler. (Lap 1/3) + We are racing the octopus boss Bubbler. (Lap 2/3) ================================================= ADVENTURE TWO (Cleanup & Documentation) - ---------------- 26.52% Complete ---------------- - # Documented functions: 568 - # Undocumented remaining: 996 + ---------------- 26.72% Complete ---------------- + # Documented functions: 573 + # Undocumented remaining: 990 ------------------ Game Status ------------------ Balloons: 13/47, Keys: 1/4, Trophies: 1/5 T.T. Amulets: 1/4, Wizpig Amulets: 1/4 diff --git a/asm/non_matchings/unknown_032760/func_80031CAC.s b/asm/non_matchings/lights/func_80031CAC.s similarity index 100% rename from asm/non_matchings/unknown_032760/func_80031CAC.s rename to asm/non_matchings/lights/func_80031CAC.s diff --git a/asm/non_matchings/unknown_032760/func_80032424.s b/asm/non_matchings/lights/func_80032424.s similarity index 100% rename from asm/non_matchings/unknown_032760/func_80032424.s rename to asm/non_matchings/lights/func_80032424.s diff --git a/asm/non_matchings/unknown_032760/func_80032C7C.s b/asm/non_matchings/lights/func_80032C7C.s similarity index 99% rename from asm/non_matchings/unknown_032760/func_80032C7C.s rename to asm/non_matchings/lights/func_80032C7C.s index 7b7a983c..c5feea9b 100644 --- a/asm/non_matchings/unknown_032760/func_80032C7C.s +++ b/asm/non_matchings/lights/func_80032C7C.s @@ -240,7 +240,7 @@ glabel func_80032C7C /* 033C18 80033018 24010002 */ li $at, 2 /* 033C1C 8003301C 15810006 */ bne $t4, $at, .L80033038 /* 033C20 80033020 02002025 */ move $a0, $s0 -/* 033C24 80033024 0C00CF02 */ jal func_80033C08 +/* 033C24 80033024 0C00CF02 */ jal light_direction_calc /* 033C28 80033028 AFA20068 */ sw $v0, 0x68($sp) /* 033C2C 8003302C 8FA20068 */ lw $v0, 0x68($sp) /* 033C30 80033030 10000002 */ b .L8003303C @@ -252,7 +252,7 @@ glabel func_80032C7C /* 033C40 80033040 02002025 */ move $a0, $s0 /* 033C44 80033044 4500008C */ bc1f .L80033278 /* 033C48 80033048 00000000 */ nop -/* 033C4C 8003304C 0C00CE85 */ jal func_80033A14 +/* 033C4C 8003304C 0C00CE85 */ jal light_distance_calc /* 033C50 80033050 AFA20068 */ sw $v0, 0x68($sp) /* 033C54 80033054 4600A502 */ mul.s $f20, $f20, $f0 /* 033C58 80033058 8FA20068 */ lw $v0, 0x68($sp) diff --git a/asm/non_matchings/unknown_032760/func_800337E4.s b/asm/non_matchings/lights/func_800337E4.s similarity index 100% rename from asm/non_matchings/unknown_032760/func_800337E4.s rename to asm/non_matchings/lights/func_800337E4.s diff --git a/asm/non_matchings/unknown_032760/func_80031BB8.s b/asm/non_matchings/lights/setup_lights.s similarity index 97% rename from asm/non_matchings/unknown_032760/func_80031BB8.s rename to asm/non_matchings/lights/setup_lights.s index 31a4379b..40d5ab61 100644 --- a/asm/non_matchings/unknown_032760/func_80031BB8.s +++ b/asm/non_matchings/lights/setup_lights.s @@ -1,7 +1,7 @@ -glabel func_80031BB8 +glabel setup_lights /* 0327B8 80031BB8 27BDFFE8 */ addiu $sp, $sp, -0x18 /* 0327BC 80031BBC AFBF0014 */ sw $ra, 0x14($sp) -/* 0327C0 80031BC0 0C00C6D8 */ jal func_80031B60 +/* 0327C0 80031BC0 0C00C6D8 */ jal free_lights /* 0327C4 80031BC4 AFA40018 */ sw $a0, 0x18($sp) /* 0327C8 80031BC8 8FAE0018 */ lw $t6, 0x18($sp) /* 0327CC 80031BCC 3C06800E */ lui $a2, %hi(D_800DC958) # $a2, 0x800e diff --git a/asm/non_matchings/unknown_032760/func_80036040.s b/asm/non_matchings/object_functions/func_80036040.s similarity index 100% rename from asm/non_matchings/unknown_032760/func_80036040.s rename to asm/non_matchings/object_functions/func_80036040.s diff --git a/asm/non_matchings/unknown_032760/func_8003F2E8.s b/asm/non_matchings/object_functions/func_8003F2E8.s similarity index 100% rename from asm/non_matchings/unknown_032760/func_8003F2E8.s rename to asm/non_matchings/object_functions/func_8003F2E8.s diff --git a/asm/non_matchings/unknown_032760/obj_init_butterfly.s b/asm/non_matchings/object_functions/obj_init_butterfly.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_init_butterfly.s rename to asm/non_matchings/object_functions/obj_init_butterfly.s diff --git a/asm/non_matchings/unknown_032760/obj_init_fish.s b/asm/non_matchings/object_functions/obj_init_fish.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_init_fish.s rename to asm/non_matchings/object_functions/obj_init_fish.s diff --git a/asm/non_matchings/unknown_032760/obj_init_midifade.s b/asm/non_matchings/object_functions/obj_init_midifade.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_init_midifade.s rename to asm/non_matchings/object_functions/obj_init_midifade.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_animator.s b/asm/non_matchings/object_functions/obj_loop_animator.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_animator.s rename to asm/non_matchings/object_functions/obj_loop_animator.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_butterfly.s b/asm/non_matchings/object_functions/obj_loop_butterfly.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_butterfly.s rename to asm/non_matchings/object_functions/obj_loop_butterfly.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_char_select.s b/asm/non_matchings/object_functions/obj_loop_char_select.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_char_select.s rename to asm/non_matchings/object_functions/obj_loop_char_select.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_door.s b/asm/non_matchings/object_functions/obj_loop_door.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_door.s rename to asm/non_matchings/object_functions/obj_loop_door.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_effectbox.s b/asm/non_matchings/object_functions/obj_loop_effectbox.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_effectbox.s rename to asm/non_matchings/object_functions/obj_loop_effectbox.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_fish.s b/asm/non_matchings/object_functions/obj_loop_fish.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_fish.s rename to asm/non_matchings/object_functions/obj_loop_fish.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_texscroll.s b/asm/non_matchings/object_functions/obj_loop_texscroll.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_texscroll.s rename to asm/non_matchings/object_functions/obj_loop_texscroll.s diff --git a/asm/non_matchings/unknown_032760/obj_loop_weaponballoon.s b/asm/non_matchings/object_functions/obj_loop_weaponballoon.s similarity index 100% rename from asm/non_matchings/unknown_032760/obj_loop_weaponballoon.s rename to asm/non_matchings/object_functions/obj_loop_weaponballoon.s diff --git a/asm/non_matchings/objects/spawn_object.s b/asm/non_matchings/objects/spawn_object.s index e786c9d2..3c327a2f 100644 --- a/asm/non_matchings/objects/spawn_object.s +++ b/asm/non_matchings/objects/spawn_object.s @@ -822,7 +822,7 @@ glabel L8000EDE0 /* 010200 8000F600 00000000 */ nop /* 010204 8000F604 19C00003 */ blez $t6, .L8000F614 /* 010208 8000F608 00000000 */ nop -/* 01020C 8000F60C 0C003DD6 */ jal lightSetupLightSources +/* 01020C 8000F60C 0C003DD6 */ jal light_setup_light_sources /* 010210 8000F610 02402025 */ move $a0, $s2 .L8000F614: /* 010214 8000F614 0C01867D */ jal func_800619F4 diff --git a/asm/non_matchings/unknown_078050/func_80078190.s b/asm/non_matchings/rcp/func_80078190.s similarity index 100% rename from asm/non_matchings/unknown_078050/func_80078190.s rename to asm/non_matchings/rcp/func_80078190.s diff --git a/asm/non_matchings/unknown_0255E0/func_800249F0.s b/asm/non_matchings/tracks/func_800249F0.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_800249F0.s rename to asm/non_matchings/tracks/func_800249F0.s diff --git a/asm/non_matchings/unknown_0255E0/func_80025510.s b/asm/non_matchings/tracks/func_80025510.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80025510.s rename to asm/non_matchings/tracks/func_80025510.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002581C.s b/asm/non_matchings/tracks/func_8002581C.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002581C.s rename to asm/non_matchings/tracks/func_8002581C.s diff --git a/asm/non_matchings/unknown_0255E0/func_80026070.s b/asm/non_matchings/tracks/func_80026070.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80026070.s rename to asm/non_matchings/tracks/func_80026070.s diff --git a/asm/non_matchings/unknown_0255E0/func_80026430.s b/asm/non_matchings/tracks/func_80026430.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80026430.s rename to asm/non_matchings/tracks/func_80026430.s diff --git a/asm/non_matchings/unknown_0255E0/func_80026C14.s b/asm/non_matchings/tracks/func_80026C14.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80026C14.s rename to asm/non_matchings/tracks/func_80026C14.s diff --git a/asm/non_matchings/unknown_0255E0/func_80026E54.s b/asm/non_matchings/tracks/func_80026E54.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80026E54.s rename to asm/non_matchings/tracks/func_80026E54.s diff --git a/asm/non_matchings/unknown_0255E0/func_80027184.s b/asm/non_matchings/tracks/func_80027184.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80027184.s rename to asm/non_matchings/tracks/func_80027184.s diff --git a/asm/non_matchings/unknown_0255E0/func_80027568.s b/asm/non_matchings/tracks/func_80027568.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80027568.s rename to asm/non_matchings/tracks/func_80027568.s diff --git a/asm/non_matchings/unknown_0255E0/func_800278E8.s b/asm/non_matchings/tracks/func_800278E8.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_800278E8.s rename to asm/non_matchings/tracks/func_800278E8.s diff --git a/asm/non_matchings/unknown_0255E0/func_80028050.s b/asm/non_matchings/tracks/func_80028050.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80028050.s rename to asm/non_matchings/tracks/func_80028050.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002B0F4.s b/asm/non_matchings/tracks/func_8002B0F4.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002B0F4.s rename to asm/non_matchings/tracks/func_8002B0F4.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002BAB0.s b/asm/non_matchings/tracks/func_8002BAB0.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002BAB0.s rename to asm/non_matchings/tracks/func_8002BAB0.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002C0C4.s b/asm/non_matchings/tracks/func_8002C0C4.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002C0C4.s rename to asm/non_matchings/tracks/func_8002C0C4.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002CC30.s b/asm/non_matchings/tracks/func_8002CC30.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002CC30.s rename to asm/non_matchings/tracks/func_8002CC30.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002DE30.s b/asm/non_matchings/tracks/func_8002DE30.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002DE30.s rename to asm/non_matchings/tracks/func_8002DE30.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002E234.s b/asm/non_matchings/tracks/func_8002E234.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002E234.s rename to asm/non_matchings/tracks/func_8002E234.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002E904.s b/asm/non_matchings/tracks/func_8002E904.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002E904.s rename to asm/non_matchings/tracks/func_8002E904.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002EEEC.s b/asm/non_matchings/tracks/func_8002EEEC.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002EEEC.s rename to asm/non_matchings/tracks/func_8002EEEC.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002F2AC.s b/asm/non_matchings/tracks/func_8002F2AC.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002F2AC.s rename to asm/non_matchings/tracks/func_8002F2AC.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002F440.s b/asm/non_matchings/tracks/func_8002F440.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002F440.s rename to asm/non_matchings/tracks/func_8002F440.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002FA64.s b/asm/non_matchings/tracks/func_8002FA64.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002FA64.s rename to asm/non_matchings/tracks/func_8002FA64.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002FD74.s b/asm/non_matchings/tracks/func_8002FD74.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002FD74.s rename to asm/non_matchings/tracks/func_8002FD74.s diff --git a/asm/non_matchings/unknown_0255E0/func_8002FF6C.s b/asm/non_matchings/tracks/func_8002FF6C.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_8002FF6C.s rename to asm/non_matchings/tracks/func_8002FF6C.s diff --git a/asm/non_matchings/unknown_0255E0/func_800304C8.s b/asm/non_matchings/tracks/func_800304C8.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_800304C8.s rename to asm/non_matchings/tracks/func_800304C8.s diff --git a/asm/non_matchings/unknown_0255E0/func_80030664.s b/asm/non_matchings/tracks/func_80030664.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80030664.s rename to asm/non_matchings/tracks/func_80030664.s diff --git a/asm/non_matchings/unknown_0255E0/func_80030DE0.s b/asm/non_matchings/tracks/func_80030DE0.s similarity index 100% rename from asm/non_matchings/unknown_0255E0/func_80030DE0.s rename to asm/non_matchings/tracks/func_80030DE0.s diff --git a/asm/non_matchings/unknown_032760/func_80031F88.s b/asm/non_matchings/unknown_032760/func_80031F88.s deleted file mode 100644 index 8552f765..00000000 --- a/asm/non_matchings/unknown_032760/func_80031F88.s +++ /dev/null @@ -1,172 +0,0 @@ -glabel func_80031F88 -/* 032B88 80031F88 3C03800E */ lui $v1, %hi(D_800DC95C) # $v1, 0x800e -/* 032B8C 80031F8C 2463C95C */ addiu $v1, %lo(D_800DC95C) # addiu $v1, $v1, -0x36a4 -/* 032B90 80031F90 3C0E800E */ lui $t6, %hi(D_800DC958) # $t6, 0x800e -/* 032B94 80031F94 8DCEC958 */ lw $t6, %lo(D_800DC958)($t6) -/* 032B98 80031F98 8C620000 */ lw $v0, ($v1) -/* 032B9C 80031F9C 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* 032BA0 80031FA0 004E082A */ slt $at, $v0, $t6 -/* 032BA4 80031FA4 AFBF0014 */ sw $ra, 0x14($sp) -/* 032BA8 80031FA8 10200095 */ beqz $at, .L80032200 -/* 032BAC 80031FAC 00003025 */ move $a2, $zero -/* 032BB0 80031FB0 3C0F800E */ lui $t7, %hi(D_800DC950) # $t7, 0x800e -/* 032BB4 80031FB4 8DEFC950 */ lw $t7, %lo(D_800DC950)($t7) -/* 032BB8 80031FB8 0002C080 */ sll $t8, $v0, 2 -/* 032BBC 80031FBC 01F8C821 */ addu $t9, $t7, $t8 -/* 032BC0 80031FC0 8F260000 */ lw $a2, ($t9) -/* 032BC4 80031FC4 24480001 */ addiu $t0, $v0, 1 -/* 032BC8 80031FC8 AC680000 */ sw $t0, ($v1) -/* 032BCC 80031FCC 8CA90008 */ lw $t1, 8($a1) -/* 032BD0 80031FD0 3401FFFF */ li $at, 65535 -/* 032BD4 80031FD4 00095702 */ srl $t2, $t1, 0x1c -/* 032BD8 80031FD8 A0CA0000 */ sb $t2, ($a2) -/* 032BDC 80031FDC 90AB0009 */ lbu $t3, 9($a1) -/* 032BE0 80031FE0 00000000 */ nop -/* 032BE4 80031FE4 A0CB0001 */ sb $t3, 1($a2) -/* 032BE8 80031FE8 90AC000B */ lbu $t4, 0xb($a1) -/* 032BEC 80031FEC 00000000 */ nop -/* 032BF0 80031FF0 A0CC0002 */ sb $t4, 2($a2) -/* 032BF4 80031FF4 90AD000A */ lbu $t5, 0xa($a1) -/* 032BF8 80031FF8 00000000 */ nop -/* 032BFC 80031FFC A0CD0003 */ sb $t5, 3($a2) -/* 032C00 80032000 90AE0008 */ lbu $t6, 8($a1) -/* 032C04 80032004 ACC4000C */ sw $a0, 0xc($a2) -/* 032C08 80032008 31CF000F */ andi $t7, $t6, 0xf -/* 032C0C 8003200C A0CF0004 */ sb $t7, 4($a2) -/* 032C10 80032010 84B8000C */ lh $t8, 0xc($a1) -/* 032C14 80032014 00000000 */ nop -/* 032C18 80032018 A4D80006 */ sh $t8, 6($a2) -/* 032C1C 8003201C 84B9000E */ lh $t9, 0xe($a1) -/* 032C20 80032020 84C90006 */ lh $t1, 6($a2) -/* 032C24 80032024 A4D90008 */ sh $t9, 8($a2) -/* 032C28 80032028 84A80010 */ lh $t0, 0x10($a1) -/* 032C2C 8003202C 84CA0008 */ lh $t2, 8($a2) -/* 032C30 80032030 A4C8000A */ sh $t0, 0xa($a2) -/* 032C34 80032034 84CB000A */ lh $t3, 0xa($a2) -/* 032C38 80032038 44892000 */ mtc1 $t1, $f4 -/* 032C3C 8003203C 448A4000 */ mtc1 $t2, $f8 -/* 032C40 80032040 448B8000 */ mtc1 $t3, $f16 -/* 032C44 80032044 468021A0 */ cvt.s.w $f6, $f4 -/* 032C48 80032048 468042A0 */ cvt.s.w $f10, $f8 -/* 032C4C 8003204C E4C60010 */ swc1 $f6, 0x10($a2) -/* 032C50 80032050 468084A0 */ cvt.s.w $f18, $f16 -/* 032C54 80032054 E4CA0014 */ swc1 $f10, 0x14($a2) -/* 032C58 80032058 E4D20018 */ swc1 $f18, 0x18($a2) -/* 032C5C 8003205C 90AC0002 */ lbu $t4, 2($a1) -/* 032C60 80032060 ACC0002C */ sw $zero, 0x2c($a2) -/* 032C64 80032064 000C6C00 */ sll $t5, $t4, 0x10 -/* 032C68 80032068 ACCD001C */ sw $t5, 0x1c($a2) -/* 032C6C 8003206C A4C0003C */ sh $zero, 0x3c($a2) -/* 032C70 80032070 90AE0003 */ lbu $t6, 3($a1) -/* 032C74 80032074 ACC00030 */ sw $zero, 0x30($a2) -/* 032C78 80032078 000E7C00 */ sll $t7, $t6, 0x10 -/* 032C7C 8003207C ACCF0020 */ sw $t7, 0x20($a2) -/* 032C80 80032080 A4C0003E */ sh $zero, 0x3e($a2) -/* 032C84 80032084 90B80004 */ lbu $t8, 4($a1) -/* 032C88 80032088 ACC00034 */ sw $zero, 0x34($a2) -/* 032C8C 8003208C 0018CC00 */ sll $t9, $t8, 0x10 -/* 032C90 80032090 ACD90024 */ sw $t9, 0x24($a2) -/* 032C94 80032094 A4C00040 */ sh $zero, 0x40($a2) -/* 032C98 80032098 90A80005 */ lbu $t0, 5($a1) -/* 032C9C 8003209C ACC00038 */ sw $zero, 0x38($a2) -/* 032CA0 800320A0 00084C00 */ sll $t1, $t0, 0x10 -/* 032CA4 800320A4 ACC90028 */ sw $t1, 0x28($a2) -/* 032CA8 800320A8 A4C00042 */ sh $zero, 0x42($a2) -/* 032CAC 800320AC 94A40006 */ lhu $a0, 6($a1) -/* 032CB0 800320B0 00000000 */ nop -/* 032CB4 800320B4 1081001C */ beq $a0, $at, .L80032128 -/* 032CB8 800320B8 00000000 */ nop -/* 032CBC 800320BC AFA50024 */ sw $a1, 0x24($sp) -/* 032CC0 800320C0 0C0078A7 */ jal get_misc_asset -/* 032CC4 800320C4 AFA60018 */ sw $a2, 0x18($sp) -/* 032CC8 800320C8 8FA60018 */ lw $a2, 0x18($sp) -/* 032CCC 800320CC 8FA50024 */ lw $a1, 0x24($sp) -/* 032CD0 800320D0 ACC20044 */ sw $v0, 0x44($a2) -/* 032CD4 800320D4 8C4A0000 */ lw $t2, ($v0) -/* 032CD8 800320D8 244B0014 */ addiu $t3, $v0, 0x14 -/* 032CDC 800320DC 3144FFFF */ andi $a0, $t2, 0xffff -/* 032CE0 800320E0 00001825 */ move $v1, $zero -/* 032CE4 800320E4 A4C0004A */ sh $zero, 0x4a($a2) -/* 032CE8 800320E8 A4C0004C */ sh $zero, 0x4c($a2) -/* 032CEC 800320EC A4C0004E */ sh $zero, 0x4e($a2) -/* 032CF0 800320F0 ACCB0044 */ sw $t3, 0x44($a2) -/* 032CF4 800320F4 1880000D */ blez $a0, .L8003212C -/* 032CF8 800320F8 A4CA0048 */ sh $t2, 0x48($a2) -/* 032CFC 800320FC 01601025 */ move $v0, $t3 -.L80032100: -/* 032D00 80032100 94CC004E */ lhu $t4, 0x4e($a2) -/* 032D04 80032104 8C4D0004 */ lw $t5, 4($v0) -/* 032D08 80032108 24630001 */ addiu $v1, $v1, 1 -/* 032D0C 8003210C 0064082A */ slt $at, $v1, $a0 -/* 032D10 80032110 018D7021 */ addu $t6, $t4, $t5 -/* 032D14 80032114 A4CE004E */ sh $t6, 0x4e($a2) -/* 032D18 80032118 1420FFF9 */ bnez $at, .L80032100 -/* 032D1C 8003211C 24420008 */ addiu $v0, $v0, 8 -/* 032D20 80032120 10000003 */ b .L80032130 -/* 032D24 80032124 94AF0012 */ lhu $t7, 0x12($a1) -.L80032128: -/* 032D28 80032128 ACC00044 */ sw $zero, 0x44($a2) -.L8003212C: -/* 032D2C 8003212C 94AF0012 */ lhu $t7, 0x12($a1) -.L80032130: -/* 032D30 80032130 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 032D34 80032134 448F2000 */ mtc1 $t7, $f4 -/* 032D38 80032138 05E10004 */ bgez $t7, .L8003214C -/* 032D3C 8003213C 468021A0 */ cvt.s.w $f6, $f4 -/* 032D40 80032140 44814000 */ mtc1 $at, $f8 -/* 032D44 80032144 00000000 */ nop -/* 032D48 80032148 46083180 */ add.s $f6, $f6, $f8 -.L8003214C: -/* 032D4C 8003214C E4C6005C */ swc1 $f6, 0x5c($a2) -/* 032D50 80032150 94B80014 */ lhu $t8, 0x14($a1) -/* 032D54 80032154 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 032D58 80032158 44985000 */ mtc1 $t8, $f10 -/* 032D5C 8003215C 07010004 */ bgez $t8, .L80032170 -/* 032D60 80032160 46805420 */ cvt.s.w $f16, $f10 -/* 032D64 80032164 44819000 */ mtc1 $at, $f18 -/* 032D68 80032168 00000000 */ nop -/* 032D6C 8003216C 46128400 */ add.s $f16, $f16, $f18 -.L80032170: -/* 032D70 80032170 E4D00060 */ swc1 $f16, 0x60($a2) -/* 032D74 80032174 94B90016 */ lhu $t9, 0x16($a1) -/* 032D78 80032178 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000 -/* 032D7C 8003217C 44992000 */ mtc1 $t9, $f4 -/* 032D80 80032180 07210004 */ bgez $t9, .L80032194 -/* 032D84 80032184 46802220 */ cvt.s.w $f8, $f4 -/* 032D88 80032188 44813000 */ mtc1 $at, $f6 -/* 032D8C 8003218C 00000000 */ nop -/* 032D90 80032190 46064200 */ add.s $f8, $f8, $f6 -.L80032194: -/* 032D94 80032194 3C013F80 */ li $at, 0x3F800000 # 1.000000 -/* 032D98 80032198 C4C0005C */ lwc1 $f0, 0x5c($a2) -/* 032D9C 8003219C 44819000 */ mtc1 $at, $f18 -/* 032DA0 800321A0 46000282 */ mul.s $f10, $f0, $f0 -/* 032DA4 800321A4 00000000 */ nop -/* 032DA8 800321A8 46009403 */ div.s $f16, $f18, $f0 -/* 032DAC 800321AC E4C80064 */ swc1 $f8, 0x64($a2) -/* 032DB0 800321B0 240C0001 */ li $t4, 1 -/* 032DB4 800321B4 E4CA0068 */ swc1 $f10, 0x68($a2) -/* 032DB8 800321B8 00C02025 */ move $a0, $a2 -/* 032DBC 800321BC E4D0006C */ swc1 $f16, 0x6c($a2) -/* 032DC0 800321C0 90A80000 */ lbu $t0, ($a1) -/* 032DC4 800321C4 A4C00074 */ sh $zero, 0x74($a2) -/* 032DC8 800321C8 00084A00 */ sll $t1, $t0, 8 -/* 032DCC 800321CC A4C90070 */ sh $t1, 0x70($a2) -/* 032DD0 800321D0 A4C00078 */ sh $zero, 0x78($a2) -/* 032DD4 800321D4 90AA0001 */ lbu $t2, 1($a1) -/* 032DD8 800321D8 A4C00076 */ sh $zero, 0x76($a2) -/* 032DDC 800321DC 000A5A00 */ sll $t3, $t2, 8 -/* 032DE0 800321E0 A4CB0072 */ sh $t3, 0x72($a2) -/* 032DE4 800321E4 A4C0007A */ sh $zero, 0x7a($a2) -/* 032DE8 800321E8 A0CC0005 */ sb $t4, 5($a2) -/* 032DEC 800321EC AFA60018 */ sw $a2, 0x18($sp) -/* 032DF0 800321F0 0C00C909 */ jal func_80032424 -/* 032DF4 800321F4 00002825 */ move $a1, $zero -/* 032DF8 800321F8 8FA60018 */ lw $a2, 0x18($sp) -/* 032DFC 800321FC 00000000 */ nop -.L80032200: -/* 032E00 80032200 8FBF0014 */ lw $ra, 0x14($sp) -/* 032E04 80032204 27BD0020 */ addiu $sp, $sp, 0x20 -/* 032E08 80032208 03E00008 */ jr $ra -/* 032E0C 8003220C 00C01025 */ move $v0, $a2 - diff --git a/include/config.h b/include/config.h index fdccf88e..db16fa0b 100644 --- a/include/config.h +++ b/include/config.h @@ -4,6 +4,6 @@ /*** This file should contain defines used for modded repos. ***/ /* -------------------------Memory------------------------ */ -//#define EXPANSION_PAK_SUPPORT // Allow the game to use the expansion pak if it's inserted. +#define EXPANSION_PAK_SUPPORT 0 // Allow the game to use the expansion pak if it's inserted. #endif // CONFIG_H diff --git a/include/structs.h b/include/structs.h index 99b0f620..674d4861 100644 --- a/include/structs.h +++ b/include/structs.h @@ -644,7 +644,28 @@ typedef struct ObjHeaderParticleEntry { // Size: 0x18 bytes typedef struct ObjectHeader24 { - u8 pad0[0x18]; + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; + u8 unk4; + u8 unk5; + u16 unk6; //Misc Asset Id? + union { + u32 unk8; + struct { + u8 unk8A; + u8 unk9; + u8 unkA; + u8 unkB; + }; + }; + s16 unkC; + s16 unkE; + s16 unk10; + u16 unk12; + u16 unk14; + u16 unk16; } ObjectHeader24; typedef struct ObjectHeader { diff --git a/lib/asm/non_matchings/unknown_0CEC50/_bcmp.s b/lib/asm/bcmp.s similarity index 92% rename from lib/asm/non_matchings/unknown_0CEC50/_bcmp.s rename to lib/asm/bcmp.s index 35b20eec..5fa610a5 100644 --- a/lib/asm/non_matchings/unknown_0CEC50/_bcmp.s +++ b/lib/asm/bcmp.s @@ -1,4 +1,13 @@ -glabel _bcmp +/* The comment below is needed for this file to be picked up by generate_ld */ +/* RAM_POS: 0x800CE050 */ + +.include "macros.inc" + +.set noat # allow manual use of $at +.set noreorder # dont insert nops after branches +.set gp=64 # 64-bit instructions are used + +glabel bcmp /* Official name: _bcmp */ /* 0CEC50 800CE050 28C10010 */ slti $at, $a2, 0x10 /* 0CEC54 800CE054 14200037 */ bnez $at, .L800CE134 /* 0CEC58 800CE058 00851026 */ xor $v0, $a0, $a1 diff --git a/src/camera.c b/src/camera.c index 61c4391d..82f9140d 100644 --- a/src/camera.c +++ b/src/camera.c @@ -5,7 +5,7 @@ #include "audio.h" #include "objects.h" #include "game.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "video.h" #include "lib/src/libc/rmonPrintf.h" #include "math_util.h" diff --git a/src/game.c b/src/game.c index 8841b10d..40533ebe 100644 --- a/src/game.c +++ b/src/game.c @@ -25,17 +25,17 @@ #include "objects.h" #include "camera.h" #include "save_data.h" -#include "unknown_078050.h" +#include "rcp.h" #include "audiosfx.h" #include "audiomgr.h" -#include "unknown_032760.h" +#include "lights.h" #include "textures_sprites.h" #include "PR/os_internal.h" #include "printf.h" #include "fade_transition.h" #include "borders.h" #include "unknown_008C40.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "game_text.h" #include "game_ui.h" #include "main.h" @@ -499,7 +499,7 @@ void load_level(s32 levelId, s32 numberOfPlayers, s32 entranceId, Vehicle vehicl } set_music_player_voice_limit(gCurrentLevelHeader->voiceLimit); func_80000CBC(); - func_80031BB8(0x20); + setup_lights(0x20); var_s0 = VEHICLE_CAR; if (vehicleId >= VEHICLE_CAR && vehicleId < NUMBER_OF_PLAYER_VEHICLES) { var_s0 = gCurrentLevelHeader->unk4F[vehicleId]; @@ -681,7 +681,7 @@ void clear_audio_and_track(void) { func_80001844(); func_800018E0(); func_800012E8(); - func_80031B60(); + free_lights(); free_track(); func_80008174(); adjust_audio_volume(VOLUME_NORMAL); diff --git a/src/game_ui.c b/src/game_ui.c index 779f8079..5492e3f8 100644 --- a/src/game_ui.c +++ b/src/game_ui.c @@ -15,8 +15,8 @@ #include "objects.h" #include "game_text.h" #include "object_models.h" -#include "unknown_0255E0.h" -#include "unknown_078050.h" +#include "tracks.h" +#include "rcp.h" #include "audiosfx.h" #include "printf.h" #include "unknown_008C40.h" @@ -288,7 +288,7 @@ s32 D_80127190; s32 D_80127194; s32 D_80127198[6]; -// Not sure why this ended up here, and not in unknown_078050.c along with the rest of the task data. +// Not sure why this ended up here, and not in rcp.c along with the rest of the task data. u8 gGfxTaskYieldData[OS_YIELD_DATA_SIZE]; /******************************/ diff --git a/src/unknown_032760.c b/src/lights.c similarity index 77% rename from src/unknown_032760.c rename to src/lights.c index d200cd23..d0705649 100644 --- a/src/unknown_032760.c +++ b/src/lights.c @@ -1,11 +1,12 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x80031B60 */ -#include "unknown_032760.h" +#include "lights.h" #include "memory.h" #include "types.h" #include "macros.h" +#include "objects.h" /************ .data ************/ @@ -28,7 +29,10 @@ f32 D_8011D4CC; /*******************************/ -void func_80031B60(void) { +/** + * Official Name: freeLights + */ +void free_lights(void) { if (D_800DC950 != NULL) { free_from_memory_pool(D_800DC950); D_800DC950 = NULL; @@ -40,32 +44,110 @@ void func_80031B60(void) { D_800DC958 = 0; } -#ifdef NON_MATCHING // Regalloc issues -void func_80031BB8(s32 count) { +#ifdef NON_MATCHING +/** + * Official Name: setupLights + */ +void setup_lights(s32 count) { s32 i; - func_80031B60(); + s32 newCount; + unk800DC950 **temp_v0; + + free_lights(); D_800DC958 = count; - D_800DC950 = (unk800DC950 **) allocate_from_main_pool_safe(D_800DC958 * (sizeof(s32 *) + sizeof(unk800DC950) + sizeof(unk800DC960) + sizeof(unk800DC964)), COLOUR_TAG_MAGENTA); - D_800DC954 = (unk800DC950 *) &D_800DC950[D_800DC958]; - D_800DC960 = (unk800DC960 *) &D_800DC954[D_800DC958]; - D_800DC964 = (unk800DC964 *) &D_800DC960[D_800DC958]; + temp_v0 = (unk800DC950 **) allocate_from_main_pool_safe(D_800DC958 * (sizeof(s32 *) + sizeof(unk800DC950) + sizeof(unk800DC960) + sizeof(unk800DC964)), COLOUR_TAG_MAGENTA); + newCount = D_800DC958; + D_800DC950 = temp_v0; + D_800DC954 = (unk800DC950 *) &temp_v0[newCount]; + D_800DC960 = (unk800DC960 *) &D_800DC954[newCount]; + D_800DC964 = (unk800DC964 *) &D_800DC960[newCount]; for (i = 0; i < D_800DC958; i++) { D_800DC950[i] = &D_800DC954[i]; } } #else -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_80031BB8.s") +GLOBAL_ASM("asm/non_matchings/lights/setup_lights.s") #endif -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_80031CAC.s") +GLOBAL_ASM("asm/non_matchings/lights/func_80031CAC.s") -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_80031F88.s") +/** + * Official Name: addObjectLight + */ +unk800DC950 *add_object_light(Object *arg0, ObjectHeader24 *arg1) { + s32 i; + unk800DC950 *temp_a2; + MiscAssetObjectHeader24 *miscAsset; + temp_a2 = NULL; + if (D_800DC95C < D_800DC958) { + temp_a2 = D_800DC950[D_800DC95C++]; + temp_a2->unk0 = arg1->unk8 >> 0x1C; + temp_a2->unk1 = arg1->unk9; + temp_a2->unk2 = arg1->unkB; + temp_a2->unk3 = arg1->unkA; + temp_a2->unk4 = arg1->unk8A & 0xF; + temp_a2->unkC = arg0; + temp_a2->unk6 = arg1->unkC; + temp_a2->unk8 = arg1->unkE; + temp_a2->unkA = arg1->unk10; + temp_a2->unk10 = temp_a2->unk6; + temp_a2->unk14 = temp_a2->unk8; + temp_a2->unk18 = temp_a2->unkA; + temp_a2->unk1C = arg1->unk2 << 16; + temp_a2->unk2C = 0; + temp_a2->unk3C = 0; + temp_a2->unk20 = arg1->unk3 << 16; + temp_a2->unk30 = 0; + temp_a2->unk3E = 0; + temp_a2->unk24 = arg1->unk4 << 16; + temp_a2->unk34 = 0; + temp_a2->unk40 = 0; + temp_a2->unk28 = arg1->unk5 << 16; + temp_a2->unk38 = 0; + temp_a2->unk42 = 0; + if (arg1->unk6 != 0xFFFF) { + miscAsset = (MiscAssetObjectHeader24 *) get_misc_asset(arg1->unk6); + temp_a2->unk44 = miscAsset; + temp_a2->unk48 = miscAsset->unk0; + temp_a2->unk4A = 0; + temp_a2->unk4C = 0; + temp_a2->unk4E = 0; + temp_a2->unk44 = &miscAsset->unk14; + for (i = 0; i < temp_a2->unk48 ; i++) { \ + temp_a2->unk4E += temp_a2->unk44[i].unk4; //Must be on one line! + } + } else { + temp_a2->unk44 = 0; + } + temp_a2->unk5C = arg1->unk12; + temp_a2->unk60 = arg1->unk14; + temp_a2->unk64 = arg1->unk16; + temp_a2->unk68 = temp_a2->unk5C * temp_a2->unk5C; + temp_a2->unk6C = 1.0f / temp_a2->unk5C; + temp_a2->unk70 = arg1->unk0 << 8; + temp_a2->unk74 = 0; + temp_a2->unk78 = 0; + temp_a2->unk72 = arg1->unk1 << 8; + temp_a2->unk76 = 0; + temp_a2->unk7A = 0; + temp_a2->unk5 = 1; + func_80032424(temp_a2, 0); + } + return temp_a2; +} + +/** + * Official Name: turnLightOff? +*/ UNUSED void func_80032210(unk800DC950 *arg0) { arg0->unk4 = 0; } +/** + * Official Name: turnLightOn? +*/ UNUSED void func_80032218(unk800DC950 *arg0) { arg0->unk4 = 1; } @@ -107,8 +189,11 @@ void lightUpdateLights(s32 arg0) { } } -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_80032424.s") +GLOBAL_ASM("asm/non_matchings/lights/func_80032424.s") +/** + * Official Name: killLight? +*/ void func_80032BAC(unk800DC950 *arg0) { unk800DC950 *entry = NULL; s32 i; @@ -126,12 +211,14 @@ void func_80032BAC(unk800DC950 *arg0) { } } +/** + * Official Name: lightGetLights? +*/ s32 func_80032C6C(void) { return D_800DC95C; } #ifdef NON_EQUIVALENT - // Close to matching. Should be functionally equivalent. void func_80032C7C(Object *object) { s16 sp82; @@ -187,12 +274,12 @@ void func_80032C7C(Object *object) { D_8011D4C0 = (D_8011D4C4 * D_8011D4C4) + (D_8011D4C8 * D_8011D4C8) + (D_8011D4CC * D_8011D4CC); if (D_8011D4C0 < entry->unk68) { if (entry->unk1 == 2) { - f20 = func_80033C08(entry); + f20 = light_direction_calc(entry); } else { f20 = 1.0f; } if (f20 > 0.0f) { - f20 *= func_80033A14(entry); + f20 *= light_distance_calc(entry); if (f20 > 0.0f) { if (object->segment.header->unk71 != 0) { if (D_8011D4C0 > 0.0f) { @@ -287,11 +374,10 @@ void func_80032C7C(Object *object) { } } #else -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_80032C7C.s") +GLOBAL_ASM("asm/non_matchings/lights/func_80032C7C.s") #endif #ifdef NON_EQUIVALENT - // Has regalloc issues void func_800337E4(void) { s32 i; @@ -326,10 +412,13 @@ void func_800337E4(void) { } } #else -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_800337E4.s") +GLOBAL_ASM("asm/non_matchings/lights/func_800337E4.s") #endif -f32 func_80033A14(unk800DC950 *arg0) { +/** + * Official Name: lightDistanceCalc +*/ +f32 light_distance_calc(unk800DC950 *arg0) { f32 out; f32 temp; @@ -361,7 +450,10 @@ f32 func_80033A14(unk800DC950 *arg0) { return out; } -f32 func_80033C08(unk800DC950 *arg0) { +/** + * Official Name: lightDirectionCalc +*/ +f32 light_direction_calc(unk800DC950 *arg0) { f32 temp_f2; f32 phi_f12; diff --git a/src/unknown_032760.h b/src/lights.h similarity index 76% rename from src/unknown_032760.h rename to src/lights.h index 6f2e50d6..9616916a 100644 --- a/src/unknown_032760.h +++ b/src/lights.h @@ -1,10 +1,21 @@ -#ifndef _UNKNOWN_032760_H_ -#define _UNKNOWN_032760_H_ +#ifndef _LIGHTS_H_ +#define _LIGHTS_H_ #include "types.h" #include "structs.h" #include "libc/math.h" +typedef struct SubMiscAssetObjectHeader24 { + s32 unk0; + s32 unk4; +} SubMiscAssetObjectHeader24; + +typedef struct MiscAssetObjectHeader24 { + s32 unk0; + u8 pad2[16]; + SubMiscAssetObjectHeader24 *unk14; +} MiscAssetObjectHeader24; + /* Size: 0x88 bytes */ typedef struct unk800DC950 { u8 unk0; @@ -16,7 +27,7 @@ typedef struct unk800DC950 { s16 unk6; s16 unk8; s16 unkA; - s32 unkC; + Object *unkC; f32 unk10; f32 unk14; f32 unk18; @@ -32,11 +43,11 @@ typedef struct unk800DC950 { s16 unk3E; s16 unk40; s16 unk42; - s32 unk44; - s16 unk48; + SubMiscAssetObjectHeader24 *unk44; + u16 unk48; s16 unk4A; s16 unk4C; - s16 unk4E; + u16 unk4E; s16 unk50; s16 unk52; s16 unk54; @@ -79,7 +90,7 @@ extern unk800DC950 **D_800DC950; f32 coss_f(s16); //? -void func_80031B60(void); +void free_lights(void); void func_80032210(unk800DC950 *arg0); void func_80032218(unk800DC950 *arg0); void func_80032224(unk800DC950 *arg0); @@ -88,12 +99,12 @@ void func_80032344(unk800DC950 *arg0, s32 arg1, s32 arg2); void lightUpdateLights(s32 arg0); void func_80032BAC(unk800DC950 *arg0); s32 func_80032C6C(void); -f32 func_80033A14(unk800DC950 *arg0); -f32 func_80033C08(unk800DC950 *arg0); +f32 light_distance_calc(unk800DC950 *arg0); +f32 light_direction_calc(unk800DC950 *arg0); Object_64 *func_80031CAC(Object *, LevelObjectEntry_RgbaLight *entry); //Non Matching -void func_80031BB8(s32 count); +void setup_lights(s32 count); void func_80032C7C(Object *object); void func_800337E4(void); void func_80032424(unk800DC950 *arg0, s32 arg1); diff --git a/src/main.c b/src/main.c index ce08525d..16eda03c 100644 --- a/src/main.c +++ b/src/main.c @@ -8,12 +8,11 @@ /************ .bss ************/ -u64 *gThread1StackPointer; // stack pointer for thread 1 -u64 gThread3Stack[0x400]; -u64 *gThread3StackPointer; // stack pointer for thread 3 +u64 gThread1Stack[0x21]; +u64 gThread3Stack[0x401]; OSThread gThread1; // OSThread for thread 1 OSThread gThread3; // OSThread for thread 3 -UNUSED u64 gUnusedThreadStack[0x200]; //Thread1 stack? +UNUSED u64 gUnusedThreadStack[0x200]; /******************************/ @@ -25,7 +24,7 @@ UNUSED u64 gUnusedThreadStack[0x200]; //Thread1 stack? */ void main(void) { osInitialize(); - osCreateThread(&gThread1, 1, &thread1_main, 0, &gThread1StackPointer, OS_PRIORITY_IDLE); + osCreateThread(&gThread1, 1, &thread1_main, 0, &gThread1Stack[0x20], OS_PRIORITY_IDLE); osStartThread(&gThread1); } @@ -36,7 +35,7 @@ void main(void) { */ void thread1_main(UNUSED void *unused) { thread0_create(); - osCreateThread(&gThread3, 3, &thread3_main, 0, &gThread3StackPointer, 10); + osCreateThread(&gThread3, 3, &thread3_main, 0, &gThread3Stack[0x400], 10); gThread3Stack[0x400] = 0; gThread3Stack[0] = 0; osStartThread(&gThread3); diff --git a/src/memory.c b/src/memory.c index 534152b5..32e5c75b 100644 --- a/src/memory.c +++ b/src/memory.c @@ -50,9 +50,15 @@ extern MemoryPoolSlot gMainMemoryPool; * Official Name: mmInit */ void init_main_memory_pool(void) { + s32 ramEnd; + gNumberOfMemoryPools = -1; - if (1) {} // Fakematch - new_memory_pool(&gMainMemoryPool, RAM_END - (s32)(&gMainMemoryPool), MAIN_POOL_SLOT_COUNT); + if (EXPANSION_PAK_SUPPORT) { + ramEnd = EXPANSION_RAM_END; + } else { + ramEnd = RAM_END; + } + new_memory_pool(&gMainMemoryPool, ramEnd - (s32)(&gMainMemoryPool), MAIN_POOL_SLOT_COUNT); set_free_queue_state(2); gFreeQueueCount = 0; } diff --git a/src/memory.h b/src/memory.h index 6c27f9ed..3601f356 100644 --- a/src/memory.h +++ b/src/memory.h @@ -6,12 +6,8 @@ #include "macros.h" #include "config.h" -#ifdef EXPANSION_PAK_SUPPORT -#define RAM_END 0x80800000 -#else #define RAM_END 0x80400000 -#endif - +#define EXPANSION_RAM_END 0x80800000 #define MAIN_POOL_SLOT_COUNT 1600 // Animation related? diff --git a/src/menu.c b/src/menu.c index b31eecc4..d99977c4 100644 --- a/src/menu.c +++ b/src/menu.c @@ -22,13 +22,12 @@ #include "thread30_track_loading.h" #include "objects.h" #include "game.h" -#include "unknown_078050.h" +#include "rcp.h" #include "save_data.h" #include "object_functions.h" #include "audiosfx.h" #include "racer.h" -#include "unknown_078050.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "lib/src/mips1/al/alSynStartVoiceParams.h" #include "controller.h" diff --git a/src/object_functions.c b/src/object_functions.c index 78f4eb8c..102ad9cf 100644 --- a/src/object_functions.c +++ b/src/object_functions.c @@ -17,9 +17,9 @@ #include "unknown_008C40.h" #include "objects.h" #include "particles.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "font.h" -#include "unknown_032760.h" +#include "lights.h" #include "game_ui.h" #include "waves.h" #include "audiosfx.h" @@ -585,7 +585,7 @@ void obj_loop_effectbox(Object *obj, UNUSED s32 updateRate) { } } #else -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_effectbox.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_effectbox.s") #endif /** @@ -1127,7 +1127,7 @@ void obj_loop_characterflag(Object *obj, UNUSED s32 updateRate) { } } -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_80036040.s") +GLOBAL_ASM("asm/non_matchings/object_functions/func_80036040.s") /** * Hub world T.T init behaviour. @@ -1378,8 +1378,8 @@ void play_tt_voice_clip(u16 soundID, s32 interrupt) { } } -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_init_fish.s") -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_fish.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_init_fish.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_fish.s") /** * Lava Spurt init behaviour. @@ -1545,7 +1545,7 @@ void obj_loop_animator(Object *obj, s32 updateRate) { } #else -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_animator.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_animator.s") #endif void obj_init_animation(Object *obj, LevelObjectEntry_Animation *entry, s32 arg2) { @@ -1792,7 +1792,7 @@ void obj_loop_snowball(Object *obj, s32 updateRate) { UNUSED void obj_init_char_select(UNUSED s32 arg0, UNUSED s32 arg1) { } -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_char_select.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_char_select.s") void obj_loop_animcamera(Object *obj, s32 updateRate) { s32 temp_v0; @@ -3119,7 +3119,7 @@ void obj_init_door(Object *obj, LevelObjectEntry_Door *entry) { } } -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_door.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_door.s") void obj_init_ttdoor(Object *obj, LevelObjectEntry_TTDoor *entry) { Object_TTDoor *obj64; @@ -4106,7 +4106,7 @@ void obj_loop_weaponballoon(Object *obj, s32 updateRate) { } } #else -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_weaponballoon.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_weaponballoon.s") #endif /** @@ -4473,7 +4473,7 @@ void play_rocket_trailing_sound(Object *obj, struct Object_Weapon *weapon, u16 s } } -GLOBAL_ASM("asm/non_matchings/unknown_032760/func_8003F2E8.s") +GLOBAL_ASM("asm/non_matchings/object_functions/func_8003F2E8.s") void func_8003FC44(f32 x, f32 y, f32 z, s32 objectID, s32 soundID, f32 scale, s32 arg6) { LevelObjectEntry8003FC44 spawnObj; @@ -4579,7 +4579,7 @@ void obj_init_texscroll(Object *obj, LevelObjectEntry_TexScroll *entry, s32 arg2 } } -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_texscroll.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_texscroll.s") /* Official name: rgbalightInit */ void obj_init_rgbalight(Object *obj, LevelObjectEntry_RgbaLight *entry, UNUSED s32 arg2) { @@ -4826,12 +4826,12 @@ void obj_init_butterfly(Object *obj, LevelObjectEntry_Butterfly *entry, s32 arg2 #else -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_init_butterfly.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_init_butterfly.s") #endif -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_loop_butterfly.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_loop_butterfly.s") -GLOBAL_ASM("asm/non_matchings/unknown_032760/obj_init_midifade.s") +GLOBAL_ASM("asm/non_matchings/object_functions/obj_init_midifade.s") void obj_init_midifadepoint(Object *obj, LevelObjectEntry_MidiFadePoint *entry) { Object_MidiFadePoint *obj64; diff --git a/src/object_models.c b/src/object_models.c index 6d55384f..4f1b2da9 100644 --- a/src/object_models.c +++ b/src/object_models.c @@ -5,7 +5,7 @@ #include "macros.h" #include "memory.h" #include "asset_enums.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "asset_loading.h" #include "textures_sprites.h" #include "racer.h" @@ -40,7 +40,6 @@ s16 *gAnimationTable; s32 *gObjectAnimationTable; s32 D_8011D640; s32 D_8011D644; -UNUSED s32 D_8011D648[66]; // Appears to have no effect when removed entirely? /******************************/ diff --git a/src/objects.c b/src/objects.c index b5388212..447ce5f6 100644 --- a/src/objects.c +++ b/src/objects.c @@ -16,13 +16,13 @@ #include "game.h" #include "racer.h" #include "particles.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "math_util.h" #include "camera.h" #include "waves.h" #include "object_functions.h" #include "object_models.h" -#include "unknown_032760.h" +#include "lights.h" #include "game_ui.h" #include "unknown_008C40.h" #include "controller.h" @@ -832,11 +832,13 @@ void objFreeAssets(Object *obj, s32 count, s32 objType) { } } } - -void lightSetupLightSources(Object *obj) { +/** + * Official Name: lightSetupLightSources + */ +void light_setup_light_sources(Object *obj) { s32 i; for(i = 0; i < obj->segment.header->unk5A; i++) { - obj->unk70[i] = func_80031F88(obj, &obj->segment.header->unk24[i]); + obj->unk70[i] = add_object_light(obj, &obj->segment.header->unk24[i]); } } diff --git a/src/objects.h b/src/objects.h index d6668168..2a640b16 100644 --- a/src/objects.h +++ b/src/objects.h @@ -7,6 +7,7 @@ #include "object_functions.h" #include "libc/math.h" #include "camera.h" +#include "lights.h" enum ObjectBehaviours { BHV_NONE, @@ -403,7 +404,7 @@ void func_800245B4(s16 arg0); void object_do_player_tumble(Object *this); f32 catmull_rom_interpolation(f32*, s32, f32); f32 cubic_spline_interpolation(f32 *data, s32 index, f32 x, f32 *derivative); -s32 func_80031F88(Object*, ObjectHeader24 *); +unk800DC950 *add_object_light(Object*, ObjectHeader24 *); s16 func_8001C418(f32 yPos); void func_80021400(s32 arg0); s32 func_8001B668(s32 arg0); diff --git a/src/particles.c b/src/particles.c index 8edad952..5542db55 100644 --- a/src/particles.c +++ b/src/particles.c @@ -11,7 +11,7 @@ #include "objects.h" #include "asset_loading.h" #include "math_util.h" -#include "unknown_0255E0.h" +#include "tracks.h" /************ .rodata ************/ diff --git a/src/printf.c b/src/printf.c index 00209fd2..991c5e9d 100644 --- a/src/printf.c +++ b/src/printf.c @@ -8,7 +8,7 @@ #include "thread0_epc.h" #include "stdarg.h" #include "textures_sprites.h" -#include "unknown_078050.h" +#include "rcp.h" /************ .data ************/ diff --git a/src/racer.c b/src/racer.c index 89936a8a..298f109d 100644 --- a/src/racer.c +++ b/src/racer.c @@ -18,7 +18,7 @@ #include "game.h" #include "printf.h" #include "math_util.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "weather.h" #include "vehicle_misc.h" #include "unknown_005740.h" diff --git a/src/unknown_078050.c b/src/rcp.c similarity index 99% rename from src/unknown_078050.c rename to src/rcp.c index 695ab16b..20682dfe 100644 --- a/src/unknown_078050.c +++ b/src/rcp.c @@ -1,7 +1,7 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x80077450 */ -#include "unknown_078050.h" +#include "rcp.h" #include "types.h" #include "structs.h" #include "macros.h" @@ -604,7 +604,7 @@ void func_80078190(Gfx **dlist) { gDPPipeSync((*dlist)++); } #else -GLOBAL_ASM("asm/non_matchings/unknown_078050/func_80078190.s") +GLOBAL_ASM("asm/non_matchings/rcp/func_80078190.s") #endif /** diff --git a/src/unknown_078050.h b/src/rcp.h similarity index 100% rename from src/unknown_078050.h rename to src/rcp.h diff --git a/src/save_data.c b/src/save_data.c index 30511168..c2579028 100644 --- a/src/save_data.c +++ b/src/save_data.c @@ -11,7 +11,6 @@ #include "objects.h" #include "game.h" #include "thread3_main.h" -#include "unknown_0CEC50.h" #include "controller.h" /************ .data ************/ @@ -671,10 +670,10 @@ SIDeviceStatus get_file_extension(s32 controllerIndex, s32 fileType, char *fileE continue; } if (fileType == 3) { - if((_bcmp((u8 *) fileNames[fileNum], (char *) sDKRacingAdv1, strlen((char *) sDKRacingAdv2)) != 0)) { + if((bcmp((u8 *) fileNames[fileNum], (char *) sDKRacingAdv1, strlen((char *) sDKRacingAdv2)) != 0)) { continue; } - } else if((_bcmp((u8 *) fileNames[fileNum], (char *) sDKRacingTimes1, strlen((char *) sDKRacingTimes2)) != 0)) { + } else if((bcmp((u8 *) fileNames[fileNum], (char *) sDKRacingTimes1, strlen((char *) sDKRacingTimes2)) != 0)) { continue; } diff --git a/src/save_data.h b/src/save_data.h index d304842b..00671357 100644 --- a/src/save_data.h +++ b/src/save_data.h @@ -40,6 +40,7 @@ extern s8 *D_800DE440; extern u8 gN64FontCodes[68]; extern s32 D_800DE48C; extern OSPfs pfs[MAXCONTROLLERS]; +extern int bcmp(const void *, const void *, int); size_t strlen(const char *str); u8 func_80072250(s32 arg0); diff --git a/src/textures_sprites.c b/src/textures_sprites.c index 113d40d6..dfb37d16 100644 --- a/src/textures_sprites.c +++ b/src/textures_sprites.c @@ -6,7 +6,7 @@ #include "asset_loading.h" #include "memory.h" #include "math_util.h" -#include "unknown_0255E0.h" +#include "tracks.h" #define TEX_HEADER_COUNT 175 #define TEX_SPRITE_COUNT 50 diff --git a/src/thread3_main.c b/src/thread3_main.c index 31249b58..af7a86f5 100644 --- a/src/thread3_main.c +++ b/src/thread3_main.c @@ -25,17 +25,17 @@ #include "objects.h" #include "camera.h" #include "save_data.h" -#include "unknown_078050.h" +#include "rcp.h" #include "audiosfx.h" #include "audiomgr.h" -#include "unknown_032760.h" +#include "lights.h" #include "textures_sprites.h" #include "PR/os_internal.h" #include "printf.h" #include "fade_transition.h" #include "borders.h" #include "unknown_008C40.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "game_text.h" #include "game_ui.h" #include "main.h" @@ -50,9 +50,12 @@ UNUSED const char sLevelErrorString[] = "LOADLEVEL Error: Level out of range\n"; UNUSED const char sBossErrorString[] = "BossLev problem\n"; UNUSED const char sAITableErrorString[] = "AITABLE Error: Table out of range\n"; -UNUSED const char sDebugVersionInfoString[] = "1.1605"; -UNUSED const char sDebugBuildDateString[] = "02/10/97 16:03"; -UNUSED const char sDebugUsernameString[] = "pmountain"; + +UNUSED char *sDebugRomBuildInfo[] = { + "1.1605", + "02/10/97 16:03", + "pmountain" +}; const char D_800E7134[] = "BBB\n"; // Functionally unused. UNUSED const char sDebugCarString[] = "CAR"; @@ -64,12 +67,6 @@ UNUSED const char sDebugVehicleSwapString[] = "Swapping\n"; /************ .data ************/ -UNUSED char *sDebugRomBuildInfo[3] = { - (char *)sDebugVersionInfoString, - (char *)sDebugBuildDateString, - (char *)sDebugUsernameString -}; - UNUSED char gBuildString[40] = "Version 7.7 29/09/97 15.00 L.Schuneman"; s8 sAntiPiracyTriggered = 0; diff --git a/src/unknown_0255E0.c b/src/tracks.c similarity index 98% rename from src/unknown_0255E0.c rename to src/tracks.c index bd51c8df..a22113e7 100644 --- a/src/unknown_0255E0.c +++ b/src/tracks.c @@ -1,7 +1,7 @@ /* The comment below is needed for this file to be picked up by generate_ld */ /* RAM_POS: 0x800249E0 */ -#include "unknown_0255E0.h" +#include "tracks.h" #include "types.h" #include "macros.h" @@ -269,7 +269,7 @@ void func_800249F0(u32 arg0, u32 arg1, s32 arg2, Vehicle vehicle, u32 arg4, u32 } } #else -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_800249F0.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_800249F0.s") #endif /** @@ -434,7 +434,7 @@ void render_scene(Gfx **dList, MatrixS **mtx, Vertex **vtx, TriangleList **tris, *tris = gSceneCurrTriList; } -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80025510.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80025510.s") void func_800257D0(void) { if (D_800DC924 != 0) { @@ -612,16 +612,16 @@ void func_8002581C(u8 *segmentIds, s32 numberOfSegments, s32 viewportIndex) { } } #else -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002581C.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002581C.s") #endif -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80026070.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80026430.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80026C14.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80026E54.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80027184.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80027568.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_800278E8.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80026070.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80026430.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80026C14.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80026E54.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80027184.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80027568.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_800278E8.s") void func_80027E24(s32 updateRate) { s32 segmentNumber, batchNumber; @@ -689,7 +689,7 @@ void set_skydome_visbility(s32 renderSky) { } //https://decomp.me/scratch/jmbc1 -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80028050.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80028050.s") /** * Instead of drawing the skydome with textures, draw a solid coloured background. @@ -1619,7 +1619,7 @@ s32 get_wave_properties(f32 yPos, f32 *waterHeight, Vec3f *rotation) { return gTrackWaves[index]->type; } -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002B0F4.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002B0F4.s") s32 func_8002B9BC(Object *obj, f32 *arg1, f32 *arg2, s32 arg3) { LevelModelSegment *seg; @@ -1642,7 +1642,7 @@ s32 func_8002B9BC(Object *obj, f32 *arg1, f32 *arg2, s32 arg3) { } } -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002BAB0.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002BAB0.s") #ifdef NON_MATCHING // Loads a level track from the index in the models table. @@ -1740,7 +1740,7 @@ void func_8002C0C4(s32 modelId) { set_texture_colour_tag(COLOUR_TAG_MAGENTA); } #else -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002C0C4.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002C0C4.s") #endif void func_8002C71C(LevelModelSegment *segment) { @@ -1882,7 +1882,7 @@ void func_8002C954(LevelModelSegment *segment, LevelModelSegmentBoundingBox *bbo } } -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002CC30.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002CC30.s") typedef struct unk8002D30C_a0 { u8 pad00[0x04]; @@ -2240,18 +2240,18 @@ loop_6: } } #else -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002DE30.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002DE30.s") #endif -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002E234.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002E904.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002EEEC.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002F2AC.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002F440.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002FA64.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002FD74.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_8002FF6C.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002E234.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002E904.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002EEEC.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002F2AC.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002F440.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002FA64.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002FD74.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_8002FF6C.s") -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_800304C8.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_800304C8.s") #ifdef NON_EQUIVALENT @@ -2291,7 +2291,7 @@ void func_80030664(s32 arg0, s16 arg1, s16 arg2, u8 arg3, u8 arg4, u8 arg5) { } #else -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80030664.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80030664.s") #endif /** @@ -2487,7 +2487,7 @@ void func_80030DE0(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s entry->fogChanger = 0; } #else -GLOBAL_ASM("asm/non_matchings/unknown_0255E0/func_80030DE0.s") +GLOBAL_ASM("asm/non_matchings/tracks/func_80030DE0.s") #endif /** diff --git a/src/unknown_0255E0.h b/src/tracks.h similarity index 99% rename from src/unknown_0255E0.h rename to src/tracks.h index 5e9035e0..a5dfe625 100644 --- a/src/unknown_0255E0.h +++ b/src/tracks.h @@ -1,5 +1,5 @@ -#ifndef _UNKNOWN_0255E0_H_ -#define _UNKNOWN_0255E0_H_ +#ifndef _TRACKS_H_ +#define _TRACKS_H_ #include "types.h" #include "structs.h" diff --git a/src/unknown_008C40.c b/src/unknown_008C40.c index 9e763c40..d7d49959 100644 --- a/src/unknown_008C40.c +++ b/src/unknown_008C40.c @@ -11,7 +11,7 @@ #include "textures_sprites.h" #include "objects.h" #include "audiosfx.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "math_util.h" /************ .data ************/ diff --git a/src/unknown_0CEC50.c b/src/unknown_0CEC50.c deleted file mode 100644 index 90e97f3a..00000000 --- a/src/unknown_0CEC50.c +++ /dev/null @@ -1,11 +0,0 @@ -/* The comment below is needed for this file to be picked up by generate_ld */ -/* RAM_POS: 0x800CE050 */ - -#include "types.h" -#include "macros.h" -#include "unknown_0CEC50.h" - -//Takes a char pointer, the string to populate it with, and the length of that string. -//Example: -//_bcmp(&gameName, "DKRACING-ADV", strlen("DKRACING-ADV")); -GLOBAL_ASM("lib/asm/non_matchings/unknown_0CEC50/_bcmp.s") diff --git a/src/unknown_0CEC50.h b/src/unknown_0CEC50.h deleted file mode 100644 index fc45916f..00000000 --- a/src/unknown_0CEC50.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _UNKNOWN_0CEC50_H_ -#define _UNKNOWN_0CEC50_H_ - -#include "types.h" -#include "structs.h" - -//Compares two strings to check for equality -//Example: -//_bcmp(&gameName, "DKRACING-ADV", strlen("DKRACING-ADV")); -extern int _bcmp(const void *, const void *, int); - -#endif diff --git a/src/weather.c b/src/weather.c index 31cc22f7..efe5f0b7 100644 --- a/src/weather.c +++ b/src/weather.c @@ -8,7 +8,7 @@ #include "f3ddkr.h" #include "PR/libultra.h" #include "camera.h" -#include "unknown_0255E0.h" +#include "tracks.h" #include "unknown_008C40.h" #include "textures_sprites.h" #include "math_util.h"