PR Matching func_80086074 (#707)

* Commit unpr'd matches

* fix compile

* Commit matching func_80086074
This commit is contained in:
MegaMech 2025-05-08 16:03:42 -06:00 committed by GitHub
parent daab4f501f
commit 6d900d30ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 113 additions and 82 deletions

View File

@ -1,40 +0,0 @@
glabel func_80086074
/* 086C74 80086074 00057880 */ sll $t7, $a1, 2
/* 086C78 80086078 01E57823 */ subu $t7, $t7, $a1
/* 086C7C 8008607C 3C19800E */ lui $t9, %hi(D_800E6734) # $t9, 0x800e
/* 086C80 80086080 27396734 */ addiu $t9, %lo(D_800E6734) # addiu $t9, $t9, 0x6734
/* 086C84 80086084 000FC080 */ sll $t8, $t7, 2
/* 086C88 80086088 03191021 */ addu $v0, $t8, $t9
/* 086C8C 8008608C 3C018019 */ lui $at, %hi(xOrientation) # $at, 0x8019
/* 086C90 80086090 C426D01C */ lwc1 $f6, %lo(xOrientation)($at)
/* 086C94 80086094 C4440000 */ lwc1 $f4, ($v0)
/* 086C98 80086098 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 086C9C 8008609C AFA50024 */ sw $a1, 0x24($sp)
/* 086CA0 800860A0 46062202 */ mul.s $f8, $f4, $f6
/* 086CA4 800860A4 AFBF001C */ sw $ra, 0x1c($sp)
/* 086CA8 800860A8 AFA40020 */ sw $a0, 0x20($sp)
/* 086CAC 800860AC 8C460004 */ lw $a2, 4($v0)
/* 086CB0 800860B0 8C470008 */ lw $a3, 8($v0)
/* 086CB4 800860B4 44054000 */ mfc1 $a1, $f8
/* 086CB8 800860B8 0C022DF5 */ jal set_obj_origin_pos
/* 086CBC 800860BC 00000000 */ nop
/* 086CC0 800860C0 8FA80024 */ lw $t0, 0x24($sp)
/* 086CC4 800860C4 3C0A0600 */ lui $t2, %hi(d_course_rainbow_road_static_tluts) # $t2, 0x600
/* 086CC8 800860C8 3C0C0601 */ lui $t4, %hi(d_course_rainbow_road_static_textures) # $t4, 0x601
/* 086CCC 800860CC 258CB000 */ addiu $t4, %lo(d_course_rainbow_road_static_textures) # addiu $t4, $t4, -0x5000
/* 086CD0 800860D0 254A7200 */ addiu $t2, %lo(d_course_rainbow_road_static_tluts) # addiu $t2, $t2, 0x7200
/* 086CD4 800860D4 240D0040 */ li $t5, 64
/* 086CD8 800860D8 00084A40 */ sll $t1, $t0, 9
/* 086CDC 800860DC 00085B00 */ sll $t3, $t0, 0xc
/* 086CE0 800860E0 016C3021 */ addu $a2, $t3, $t4
/* 086CE4 800860E4 012A2821 */ addu $a1, $t1, $t2
/* 086CE8 800860E8 AFAD0010 */ sw $t5, 0x10($sp)
/* 086CEC 800860EC 8FA40020 */ lw $a0, 0x20($sp)
/* 086CF0 800860F0 0C01CD11 */ jal init_texture_object
/* 086CF4 800860F4 24070040 */ li $a3, 64
/* 086CF8 800860F8 0C0216ED */ jal func_80085BB4
/* 086CFC 800860FC 8FA40020 */ lw $a0, 0x20($sp)
/* 086D00 80086100 8FBF001C */ lw $ra, 0x1c($sp)
/* 086D04 80086104 27BD0020 */ addiu $sp, $sp, 0x20
/* 086D08 80086108 03E00008 */ jr $ra
/* 086D0C 8008610C 00000000 */ nop

View File

@ -1487,28 +1487,38 @@ u8 d_course_rainbow_road_neon_boo_tlut_list[][512] = {
},
};
u8 d_course_rainbow_road_static_tluts[][512] = {
{
#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonPeach.inc.c"
},
{
#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonLuigi.inc.c"
},
{
#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonDonkeyKong.inc.c"
},
{
#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonYoshi.inc.c"
},
{
#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonBowser.inc.c"
},
{
#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonWario.inc.c"
},
{
#include "assets/courses/rainbow_road/gTLUTRainbowRoadNeonToad.inc.c"
},
u16 d_course_rainbow_road_static_tluts[] = {
#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonPeach.rgba16.inc.c"
};
/* @warning array oob func_80086074 */
u16 d_tlut_rainbow_road_neon_luigi[] = {
#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonLuigi.rgba16.inc.c"
};
/* @warning array oob func_80086074 */
u16 d_tlut_rainbow_road_neon_dk[] = {
#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonDonkeyKong.rgba16.inc.c"
};
/* @warning array oob func_80086074 */
u16 d_tlut_rainbow_road_neon_yoshi[] = {
#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonYoshi.rgba16.inc.c"
};
/* @warning array oob func_80086074 */
u16 d_tlut_rainbow_road_neon_bowser[] = {
#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonBowser.rgba16.inc.c"
};
/* @warning array oob func_80086074 */
u16 d_tlut_rainbow_road_neon_wario[] = {
#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonWario.rgba16.inc.c"
};
/* @warning array oob func_80086074 */
u16 d_tlut_rainbow_road_neon_toad[] = {
#include "assets/code/rainbow_road_tluts/gTLUTRainbowRoadNeonToad.rgba16.inc.c"
};
u8 d_course_rainbow_road_neon_mushroom[] = {

View File

@ -63,7 +63,7 @@ extern TrackPathPoint d_course_rainbow_road_track_path[];
extern u8 d_course_rainbow_road_neon_mushroom_tlut_list[][512];
extern u8 d_course_rainbow_road_neon_mario_tlut_list[][512];
extern u8 d_course_rainbow_road_neon_boo_tlut_list[][512];
extern u8 d_course_rainbow_road_static_tluts[][512];
extern u16 d_course_rainbow_road_static_tluts[];
extern u8 d_course_rainbow_road_neon_mushroom[];
extern u8 d_course_rainbow_road_neon_mario[];
extern u8 d_course_rainbow_road_neon_boo[];

View File

@ -224,7 +224,7 @@ extern CrabSpawn gCrabSpawns[];
#define NUM_THWOMPS_150CC 12
// pos x,y,z
extern Vec3f D_800E6734[];
extern float D_800E6734[];
typedef struct {
/* 0x0 */ s16 startX;

View File

@ -665,10 +665,15 @@ SplineData* D_800E6724[] = { &D_800E641C, &D_800E64D8 };
SplineData* D_800E672C[] = { &D_800E659C, &D_800E6668 };
// I believe they're the positions of the static neon signs in rainbow road
Vec3f D_800E6734[] = {
{ 1443.0, 1044.0, -5478.0 }, { 1678.0, 1012.0, -4840.0 }, { -3924.0, 921.0, 2566.0 }, { -3311.0, 790.0, 3524.0 },
{ -1284.0, 1341.0, 4527.0 }, { 2268.0, 1041.0, 4456.0 }, { 2820.0, 1109.0, 1985.0 },
// Positions of the neon signs in rainbow road
float D_800E6734[] = {
1443.0, 1044.0, -5478.0,
1678.0, 1012.0, -4840.0,
-3924.0, 921.0, 2566.0,
-3311.0, 790.0, 3524.0,
-1284.0, 1341.0, 4527.0,
2268.0, 1041.0, 4456.0,
2820.0, 1109.0, 1985.0,
};
// This should really be `extern Vec3s gTorchSpawns[];`

View File

@ -67,7 +67,7 @@ extern SplineData D_800E659C;
extern SplineData D_800E6668;
extern SplineData* D_800E6724[];
extern SplineData* D_800E672C[];
extern Vec3f D_800E6734[];
extern float D_800E6734[];
// This should really be `extern Vec3s gTorchSpawns[];`
extern s16 gTorchSpawns[];
extern SplineData D_800E67B8;

View File

@ -7813,22 +7813,12 @@ void func_80085F74(s32 objectIndex) {
}
}
#ifdef NON_MATCHING
/**
* arg1 is pushed onto the stack prior to set_obj_origin_pos, which is correct.
* But then it get popped back into v0 when its supposed to be popped into t0.
* I really, really don't get why that's happening and the permuter hasn't found anything
**/
void func_80086074(s32 objectIndex, s32 arg1) {
set_obj_origin_pos(objectIndex, D_800E6734[arg1][0] * xOrientation, D_800E6734[arg1][1], D_800E6734[arg1][2]);
init_texture_object(objectIndex, d_course_rainbow_road_static_tluts[arg1],
d_course_rainbow_road_static_textures[arg1], 64, 64);
set_obj_origin_pos(objectIndex, D_800E6734[arg1 * 3 + 0] * xOrientation, D_800E6734[arg1 * 3 + 1], D_800E6734[arg1 * 3 + 2]);
init_texture_object(objectIndex, &d_course_rainbow_road_static_tluts[arg1 * 256],
&d_course_rainbow_road_static_textures[arg1], 64, 64);
func_80085BB4(objectIndex);
}
#else
GLOBAL_ASM("asm/non_matchings/update_objects/func_80086074.s")
#endif
void func_80086110(s32 objectIndex, s32 arg1) {
switch (gObjectList[objectIndex].state) {

View File

@ -0,0 +1,66 @@
# This file is only used for compilation
# Because u16 output is required.
# The png output in assets/courses/ is from the identical .json extraction file
:config:
segments:
- [0x06, 0x872A00]
header:
code:
- '#include <macros.h>'
- '#include <defines.h>'
gTLUTRainbowRoadNeonPeach:
symbol: gTLUTRainbowRoadNeonPeach
type: texture
ctype: u16
width: 16
height: 16
offset: 0x07200
format: rgba16
gTLUTRainbowRoadNeonLuigi:
symbol: gTLUTRainbowRoadNeonLuigi
type: texture
ctype: u16
width: 16
height: 16
offset: 0x07400
format: rgba16
gTLUTRainbowRoadNeonDonkeyKong:
symbol: gTLUTRainbowRoadNeonDonkeyKong
type: texture
ctype: u16
width: 16
height: 16
offset: 0x07600
format: rgba16
gTLUTRainbowRoadNeonYoshi:
symbol: gTLUTRainbowRoadNeonYoshi
type: texture
ctype: u16
width: 16
height: 16
offset: 0x07800
format: rgba16
gTLUTRainbowRoadNeonBowser:
symbol: gTLUTRainbowRoadNeonBowser
type: texture
ctype: u16
width: 16
height: 16
offset: 0x07A00
format: rgba16
gTLUTRainbowRoadNeonWario:
symbol: gTLUTRainbowRoadNeonWario
type: texture
ctype: u16
width: 16
height: 16
offset: 0x07C00
format: rgba16
gTLUTRainbowRoadNeonToad:
symbol: gTLUTRainbowRoadNeonToad
type: texture
ctype: u16
width: 16
height: 16
offset: 0x07E00
format: rgba16