From d26cab56bcde791ccdf07fd5e9af69cb1b8cd273 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 21 Nov 2020 01:15:27 +1000 Subject: [PATCH] Decompile chrFindWaypointWithinPosQuadrant --- src/files/setup/setupsho.c | 6 +- src/game/chr/chraction.c | 184 ++++++++---------------- src/game/chr/chrai.c | 2 +- src/game/chr/chraicommands.c | 4 +- src/game/data/ailists.c | 8 +- src/game/padhalllv.c | 4 +- src/game/training.c | 14 +- src/include/commands.h | 18 ++- src/include/constants.h | 7 + src/include/game/chr/chraction.h | 6 +- src/include/game/chr/chraicommands.h | 2 +- src/include/game/padhalllv.h | 4 +- src/include/types.h | 205 +-------------------------- src/lib/lib_16110.c | 4 +- 14 files changed, 116 insertions(+), 352 deletions(-) diff --git a/src/files/setup/setupsho.c b/src/files/setup/setupsho.c index 87300e064..a22cdae04 100644 --- a/src/files/setup/setupsho.c +++ b/src/files/setup/setupsho.c @@ -2116,9 +2116,9 @@ u8 func040d_king_combat[] = { endloop(0x68) label(0x2d) - try_set_target_pad_to_something2(0x01, /*goto*/ 0x2d) - try_set_target_pad_to_something2(0x02, /*goto*/ 0x2d) - try_set_target_pad_to_something2(0x04, /*goto*/ 0x2d) + try_set_padpreset_to_target_quadrant(QUADRANT_BACK, /*goto*/ 0x2d) + try_set_padpreset_to_target_quadrant(QUADRANT_SIDE1, /*goto*/ 0x2d) + try_set_padpreset_to_target_quadrant(QUADRANT_SIDE2, /*goto*/ 0x2d) goto_next(0x88) label(0x2d) diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 5e941d79b..072f35652 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -24977,7 +24977,7 @@ bool chrCanHearAlarm(struct chrdata *chr) } GLOBAL_ASM( -glabel func0f04a2d4 +glabel waypointIsWithin90DegreesOfPosAngle .late_rodata glabel var7f1a93e4 .word 0x40c907a9 @@ -25033,122 +25033,62 @@ glabel var7f1a93ec /* f04a378: 27bd0080 */ addiu $sp,$sp,0x80 ); -GLOBAL_ASM( -glabel func0f04a37c -.late_rodata -glabel var7f1a93f0 -.word 0x404907a9 -glabel var7f1a93f4 -.word 0x3fc907a9 -glabel var7f1a93f8 -.word 0x4096c5bf -glabel var7f1a93fc -.word 0x40c907a9 -.text -/* f04a37c: 27bdffc8 */ addiu $sp,$sp,-56 -/* f04a380: f7b40018 */ sdc1 $f20,0x18($sp) -/* f04a384: 4486a000 */ mtc1 $a2,$f20 -/* f04a388: afbf0034 */ sw $ra,0x34($sp) -/* f04a38c: afb40030 */ sw $s4,0x30($sp) -/* f04a390: afb00020 */ sw $s0,0x20($sp) -/* f04a394: 30f000ff */ andi $s0,$a3,0xff -/* f04a398: 0080a025 */ or $s4,$a0,$zero -/* f04a39c: afb3002c */ sw $s3,0x2c($sp) -/* f04a3a0: afb20028 */ sw $s2,0x28($sp) -/* f04a3a4: afb10024 */ sw $s1,0x24($sp) -/* f04a3a8: 0fc45095 */ jal waypointFindClosestToPos -/* f04a3ac: afa70044 */ sw $a3,0x44($sp) -/* f04a3b0: 10400044 */ beqz $v0,.L0f04a4c4 -/* f04a3b4: 00409825 */ or $s3,$v0,$zero -/* f04a3b8: 24010001 */ addiu $at,$zero,0x1 -/* f04a3bc: 1201000a */ beq $s0,$at,.L0f04a3e8 -/* f04a3c0: 02602025 */ or $a0,$s3,$zero -/* f04a3c4: 24010002 */ addiu $at,$zero,0x2 -/* f04a3c8: 1201000b */ beq $s0,$at,.L0f04a3f8 -/* f04a3cc: 24010004 */ addiu $at,$zero,0x4 -/* f04a3d0: 1201000d */ beq $s0,$at,.L0f04a408 -/* f04a3d4: 24010008 */ addiu $at,$zero,0x8 -/* f04a3d8: 1201000e */ beq $s0,$at,.L0f04a414 -/* f04a3dc: 00000000 */ nop -/* f04a3e0: 1000000c */ b .L0f04a414 -/* f04a3e4: 00000000 */ nop -.L0f04a3e8: -/* f04a3e8: 3c017f1b */ lui $at,%hi(var7f1a93f0) -/* f04a3ec: c42493f0 */ lwc1 $f4,%lo(var7f1a93f0)($at) -/* f04a3f0: 10000008 */ b .L0f04a414 -/* f04a3f4: 4604a500 */ add.s $f20,$f20,$f4 -.L0f04a3f8: -/* f04a3f8: 3c017f1b */ lui $at,%hi(var7f1a93f4) -/* f04a3fc: c42693f4 */ lwc1 $f6,%lo(var7f1a93f4)($at) -/* f04a400: 10000004 */ b .L0f04a414 -/* f04a404: 4606a500 */ add.s $f20,$f20,$f6 -.L0f04a408: -/* f04a408: 3c017f1b */ lui $at,%hi(var7f1a93f8) -/* f04a40c: c42893f8 */ lwc1 $f8,%lo(var7f1a93f8)($at) -/* f04a410: 4608a500 */ add.s $f20,$f20,$f8 -.L0f04a414: -/* f04a414: 3c017f1b */ lui $at,%hi(var7f1a93fc) -/* f04a418: c42093fc */ lwc1 $f0,%lo(var7f1a93fc)($at) -/* f04a41c: 4614003e */ c.le.s $f0,$f20 -/* f04a420: 00000000 */ nop -/* f04a424: 45020003 */ bc1fl .L0f04a434 -/* f04a428: 4406a000 */ mfc1 $a2,$f20 -/* f04a42c: 4600a501 */ sub.s $f20,$f20,$f0 -/* f04a430: 4406a000 */ mfc1 $a2,$f20 -.L0f04a434: -/* f04a434: 0fc128b5 */ jal func0f04a2d4 -/* f04a438: 02802825 */ or $a1,$s4,$zero -/* f04a43c: 50400004 */ beqzl $v0,.L0f04a450 -/* f04a440: 8e6e0004 */ lw $t6,0x4($s3) -/* f04a444: 10000020 */ b .L0f04a4c8 -/* f04a448: 8e620000 */ lw $v0,0x0($s3) -/* f04a44c: 8e6e0004 */ lw $t6,0x4($s3) -.L0f04a450: -/* f04a450: 3c12800a */ lui $s2,%hi(g_StageSetup) -/* f04a454: 2652d030 */ addiu $s2,$s2,%lo(g_StageSetup) -/* f04a458: 8dd00000 */ lw $s0,0x0($t6) -/* f04a45c: 00008825 */ or $s1,$zero,$zero -/* f04a460: 06000018 */ bltz $s0,.L0f04a4c4 -/* f04a464: 320f8000 */ andi $t7,$s0,0x8000 -.L0f04a468: -/* f04a468: 15e0000f */ bnez $t7,.L0f04a4a8 -/* f04a46c: 32183fff */ andi $t8,$s0,0x3fff -/* f04a470: 8e480000 */ lw $t0,0x0($s2) -/* f04a474: 0018c900 */ sll $t9,$t8,0x4 -/* f04a478: 4406a000 */ mfc1 $a2,$f20 -/* f04a47c: 03008025 */ or $s0,$t8,$zero -/* f04a480: 02802825 */ or $a1,$s4,$zero -/* f04a484: 0fc128b5 */ jal func0f04a2d4 -/* f04a488: 03282021 */ addu $a0,$t9,$t0 -/* f04a48c: 50400007 */ beqzl $v0,.L0f04a4ac -/* f04a490: 8e6c0004 */ lw $t4,0x4($s3) -/* f04a494: 8e490000 */ lw $t1,0x0($s2) -/* f04a498: 00105100 */ sll $t2,$s0,0x4 -/* f04a49c: 012a5821 */ addu $t3,$t1,$t2 -/* f04a4a0: 10000009 */ b .L0f04a4c8 -/* f04a4a4: 8d620000 */ lw $v0,0x0($t3) -.L0f04a4a8: -/* f04a4a8: 8e6c0004 */ lw $t4,0x4($s3) -.L0f04a4ac: -/* f04a4ac: 26310001 */ addiu $s1,$s1,0x1 -/* f04a4b0: 00116880 */ sll $t5,$s1,0x2 -/* f04a4b4: 018d7021 */ addu $t6,$t4,$t5 -/* f04a4b8: 8dd00000 */ lw $s0,0x0($t6) -/* f04a4bc: 0603ffea */ bgezl $s0,.L0f04a468 -/* f04a4c0: 320f8000 */ andi $t7,$s0,0x8000 -.L0f04a4c4: -/* f04a4c4: 2402ffff */ addiu $v0,$zero,-1 -.L0f04a4c8: -/* f04a4c8: 8fbf0034 */ lw $ra,0x34($sp) -/* f04a4cc: d7b40018 */ ldc1 $f20,0x18($sp) -/* f04a4d0: 8fb00020 */ lw $s0,0x20($sp) -/* f04a4d4: 8fb10024 */ lw $s1,0x24($sp) -/* f04a4d8: 8fb20028 */ lw $s2,0x28($sp) -/* f04a4dc: 8fb3002c */ lw $s3,0x2c($sp) -/* f04a4e0: 8fb40030 */ lw $s4,0x30($sp) -/* f04a4e4: 03e00008 */ jr $ra -/* f04a4e8: 27bd0038 */ addiu $sp,$sp,0x38 -); +/** + * Attempt to find a waypoint near pos which is in a particular quadrant to pos, + * then return its padnum. + * + * For example, pos is typically the player's position, angle is the direction + * the player is facing, and quadrant is which quadrant (front/back/left/right) + * that is desired relative to the player's position and angle. + * + * The function starts by finding the closest waypoint to the pos. If it's not + * in the quadrant then its neighouring waypoints are checked too. If none of + * those are in the quadrant then no further checks are made and the function + * returns -1. + */ +s32 chrFindWaypointWithinPosQuadrant(struct coord *pos, s16 *rooms, f32 angle, u8 quadrant) +{ + struct waypoint *waypoint = waypointFindClosestToPos(pos, rooms); + s32 neighbournum; + s32 i; + + if (waypoint) { + switch (quadrant) { + case QUADRANT_BACK: + angle += M_BADPI; + break; + case QUADRANT_SIDE1: + angle += 1.5705462694168f; + break; + case QUADRANT_SIDE2: + angle += 4.7116389274597f; + break; + case QUADRANT_FRONT: + break; + } + + if (angle >= M_BADTAU) { + angle -= M_BADTAU; + } + + if (waypointIsWithin90DegreesOfPosAngle(waypoint, pos, angle)) { + return waypoint->padnum; + } + + for (i = 0; (neighbournum = waypoint->neighbours[i]) >= 0; i++) { + if ((neighbournum & 0x8000) == 0) { + neighbournum &= 0x3fff; + + if (waypointIsWithin90DegreesOfPosAngle(&g_StageSetup.waypoints[neighbournum], pos, angle)) { + return g_StageSetup.waypoints[neighbournum].padnum; + } + } + + } + } + + return -1; +} GLOBAL_ASM( glabel func0f04a4ec @@ -25240,7 +25180,7 @@ glabel func0f04a4ec /* f04a634: 44060000 */ mfc1 $a2,$f0 /* f04a638: 320700ff */ andi $a3,$s0,0xff /* f04a63c: 24440008 */ addiu $a0,$v0,0x8 -/* f04a640: 0fc128df */ jal func0f04a37c +/* f04a640: 0fc128df */ jal chrFindWaypointWithinPosQuadrant /* f04a644: 24450028 */ addiu $a1,$v0,0x28 /* f04a648: 04420005 */ bltzl $v0,.L0f04a660 /* f04a64c: 00001025 */ or $v0,$zero,$zero @@ -25257,14 +25197,14 @@ glabel func0f04a4ec /* f04a670: 27bd0050 */ addiu $sp,$sp,0x50 ); -bool func0f04a674(struct chrdata *chr, u8 arg1) +bool chrSetPadPresetToWaypointWithinTargetQuadrant(struct chrdata *chr, u8 quadrant) { f32 angle; s32 padnum; struct prop *prop; - if (arg1 == 0x10 || arg1 == 0x20) { - return func0f04a4ec(chr, arg1); + if (quadrant == QUADRANT_10 || quadrant == QUADRANT_20) { + return func0f04a4ec(chr, quadrant); } angle = 0; @@ -25276,7 +25216,7 @@ bool func0f04a674(struct chrdata *chr, u8 arg1) angle = chrGetInverseTheta(prop->chr); } - padnum = func0f04a37c(&prop->pos, prop->rooms, angle, arg1); + padnum = chrFindWaypointWithinPosQuadrant(&prop->pos, prop->rooms, angle, quadrant); if (padnum >= 0) { chr->padpreset1 = padnum; diff --git a/src/game/chr/chrai.c b/src/game/chr/chrai.c index f8133cd04..66704f67e 100644 --- a/src/game/chr/chrai.c +++ b/src/game/chr/chrai.c @@ -136,7 +136,7 @@ bool (*g_CommandPointers[])(void) = { /*0x0073*/ aiIfObjectiveComplete, /*0x0074*/ aiIfObjectiveFailed, /*0x0075*/ ai0075, - /*0x0076*/ ai0076, + /*0x0076*/ aiSetPadPresetToTargetQuadrant, /*0x0077*/ aiIfDifficultyLessThan, /*0x0078*/ aiIfDifficultyGreaterThan, /*0x0079*/ aiIfUptimeLessThan, diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 4508fa161..b68e3464f 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -2613,11 +2613,11 @@ bool ai0075(void) /** * @cmd 0076 */ -bool ai0076(void) +bool aiSetPadPresetToTargetQuadrant(void) { u8 *cmd = g_Vars.ailist + g_Vars.aioffset; - if (func0f04a674(g_Vars.chrdata, cmd[2])) { + if (chrSetPadPresetToWaypointWithinTargetQuadrant(g_Vars.chrdata, cmd[2])) { g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[3]); } else { g_Vars.aioffset += 4; diff --git a/src/game/data/ailists.c b/src/game/data/ailists.c index 5665a6e96..e91db2673 100644 --- a/src/game/data/ailists.c +++ b/src/game/data/ailists.c @@ -5301,25 +5301,25 @@ u8 func0020_place_coop_buddy[] = { // Try to move chr to one of four pads until it works label(0x03) yield - try_set_target_pad_to_something2(0x01, /*goto*/ 0xfa) + try_set_padpreset_to_target_quadrant(QUADRANT_BACK, /*goto*/ 0xfa) goto_next(0xf3) label(0xfa) chr_move_to_pad(CHR_SELF, PAD_PRESET, 0x01, /*goto*/ 0x13) label(0xf3) - try_set_target_pad_to_something2(0x02, /*goto*/ 0xfa) + try_set_padpreset_to_target_quadrant(QUADRANT_SIDE1, /*goto*/ 0xfa) goto_next(0xf3) label(0xfa) chr_move_to_pad(CHR_SELF, PAD_PRESET, 0x01, /*goto*/ 0x13) label(0xf3) - try_set_target_pad_to_something2(0x04, /*goto*/ 0xfa) + try_set_padpreset_to_target_quadrant(QUADRANT_SIDE2, /*goto*/ 0xfa) goto_next(0xf3) label(0xfa) chr_move_to_pad(CHR_SELF, PAD_PRESET, 0x01, /*goto*/ 0x13) label(0xf3) - try_set_target_pad_to_something2(0x08, /*goto*/ 0xfa) + try_set_padpreset_to_target_quadrant(QUADRANT_FRONT, /*goto*/ 0xfa) goto_next(0xf3) label(0xfa) diff --git a/src/game/padhalllv.c b/src/game/padhalllv.c index 36a3daf8d..ab9ffbe75 100644 --- a/src/game/padhalllv.c +++ b/src/game/padhalllv.c @@ -1782,7 +1782,7 @@ glabel func0f11594c ); GLOBAL_ASM( -glabel func0f115a48 +glabel waypointDisableSegment /* f115a48: 27bdffe8 */ addiu $sp,$sp,-24 /* f115a4c: afbf0014 */ sw $ra,0x14($sp) /* f115a50: afa40018 */ sw $a0,0x18($sp) @@ -1798,7 +1798,7 @@ glabel func0f115a48 ); GLOBAL_ASM( -glabel func0f115a78 +glabel waypointEnableSegment /* f115a78: 27bdffe8 */ addiu $sp,$sp,-24 /* f115a7c: afbf0014 */ sw $ra,0x14($sp) /* f115a80: afa40018 */ sw $a0,0x18($sp) diff --git a/src/game/training.c b/src/game/training.c index b66f43a8d..7283bb2bf 100644 --- a/src/game/training.c +++ b/src/game/training.c @@ -5008,7 +5008,7 @@ void func0f1a2198(void) void htBegin(void) { - struct stagesetup00 *setup00 = g_StageSetup.unk00; + struct waypoint *waypoints = g_StageSetup.waypoints; g_HoloTrainingData.intraining = true; g_HoloTrainingData.timetaken = 0; @@ -5016,7 +5016,10 @@ void htBegin(void) chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_SUCCESS); chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_FAILURE); chrSetStageFlag(NULL, func0f1a25c0(htGetIndexBySlot(var80088bb4))); - func0f115a48(&setup00->unk200, &setup00->unk310); + + // Disable segment leading out of the door + waypointDisableSegment(&waypoints[0x20], &waypoints[0x31]); + g_Vars.currentplayer->training = true; playersSetPassiveMode(false); chrSetStageFlag(NULL, STAGEFLAG_CI_IN_TRAINING); @@ -5028,13 +5031,16 @@ void htEnd(void) s16 *propnum; s16 propnums[256]; s16 rooms[5] = { 0x0016, 0x0017, 0x0018, 0x0019, -1 }; - struct stagesetup00 *setup00 = g_StageSetup.unk00; + struct waypoint *waypoints = g_StageSetup.waypoints; g_HoloTrainingData.intraining = false; chrSetStageFlag(NULL, STAGEFLAG_CI_HOLO_ABORTING); chrUnsetStageFlag(NULL, STAGEFLAG_CI_TRIGGER_HOLO_FAILURE); chrUnsetStageFlag(NULL, func0f1a25c0(htGetIndexBySlot(var80088bb4))); - func0f115a78(&setup00->unk200, &setup00->unk310); + + // Enable segment leading out of the door + waypointEnableSegment(&waypoints[0x20], &waypoints[0x31]); + g_Vars.currentplayer->training = false; roomGetProps(rooms, propnums, 256); propnum = &propnums[0]; diff --git a/src/include/commands.h b/src/include/commands.h index 8a71a8fa1..c767806e2 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -1074,13 +1074,21 @@ label, /** - * Only ever called with values 1, 2, 4 and 8. The value is related to circles, - * perhaps specifying a certain side of the target chr. - * If u1 were 0x10 or 0x20, some other logic would be used (same as previous). + * Attempts to find a waypoint within the given quadrant of the current chr's + * target then sets the chr's padpreset to the given waypoint's pad number. + * + * If no waypoint is found, the padpreset is left unchanged and the label is not + * followed. + * + * The exact formula for finding the waypoint is: + * 1. Find the closest waypoint to the target regardless of direction + * 2. Check if that waypoint or any of its direct neighbours are in the quadrant + * + * No further checks are done. */ -#define try_set_target_pad_to_something2(u1, label) \ +#define try_set_padpreset_to_target_quadrant(quadrant, label) \ mkshort(0x0076), \ - u1, \ + quadrant, \ label, /** diff --git a/src/include/constants.h b/src/include/constants.h index 0fb547596..a4ca51295 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -2443,6 +2443,13 @@ #define PROPTYPE_EXPLOSION 7 #define PROPTYPE_EFFECT 8 +#define QUADRANT_BACK 0x01 +#define QUADRANT_SIDE1 0x02 +#define QUADRANT_SIDE2 0x04 +#define QUADRANT_FRONT 0x08 +#define QUADRANT_10 0x10 +#define QUADRANT_20 0x20 + #define QUIP_ATTACK1 0 #define QUIP_ATTACK2 1 #define QUIP_GOTOCOVER1 2 diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 2d6b7d46b..15c025d73 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -185,10 +185,10 @@ f32 chrGetTimer(struct chrdata *chr); bool chrCanSeeTargetWithExtraCheck(struct chrdata *chr); bool chrSawInjury(struct chrdata *chr, u8 arg1); bool chrSawDeath(struct chrdata *chr, u8 arg1); -u32 func0f04a2d4(void); -s16 func0f04a37c(struct coord *pos, s16 *rooms, f32 angle, u8 arg3); +bool waypointIsWithin90DegreesOfPosAngle(struct waypoint *waypoint, struct coord *pos, f32 angle); +s32 chrFindWaypointWithinPosQuadrant(struct coord *pos, s16 *rooms, f32 angle, u8 quadrant); u32 func0f04a4ec(struct chrdata *chr, u8 arg1); -bool func0f04a674(struct chrdata *chr, u8 arg1); +bool chrSetPadPresetToWaypointWithinTargetQuadrant(struct chrdata *chr, u8 arg1); bool func0f04a7dc(u32 chrnum, struct chrdata *chr, f32 distance, s32 padnum); bool func0f04a848(u8 chrnum, struct chrdata *chr, f32 distance, struct coord *pos, s16 *room); u32 chrIsInLoadedRoom(struct chrdata *chr); diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index c613c0ca1..ca8e76663 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -120,7 +120,7 @@ /*0x0073*/ bool aiIfObjectiveComplete(void); /*0x0074*/ bool aiIfObjectiveFailed(void); /*0x0075*/ bool ai0075(void); -/*0x0076*/ bool ai0076(void); +/*0x0076*/ bool aiSetPadPresetToTargetQuadrant(void); /*0x0077*/ bool aiIfDifficultyLessThan(void); /*0x0078*/ bool aiIfDifficultyGreaterThan(void); /*0x0079*/ bool aiIfUptimeLessThan(void); diff --git a/src/include/game/padhalllv.h b/src/include/game/padhalllv.h index 0a91dd27d..99433e0dc 100644 --- a/src/include/game/padhalllv.h +++ b/src/include/game/padhalllv.h @@ -24,7 +24,7 @@ u32 func0f1154cc(void); u32 func0f1155e0(void); u32 func0f115784(void); u32 func0f11594c(void); -void func0f115a48(u32 *arg0, u32 *arg1); -void func0f115a78(u32 *arg0, u32 *arg1); +void waypointDisableSegment(struct waypoint *a, struct waypoint *b); +void waypointEnableSegment(struct waypoint *a, struct waypoint *b); #endif diff --git a/src/include/types.h b/src/include/types.h index 14ccfec85..4d246703f 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -340,6 +340,9 @@ struct modeldata_headspot { // type 0x17 struct waypoint { s32 padnum; + s32 *neighbours; // most significant two bits are booleans, remaining bits are waypoint index + s32 groupnum; + s32 terminator; // always zero }; struct aibot014 { @@ -2808,206 +2811,6 @@ struct player { /*0x1c64*/ s32 unk1c64; }; -struct stagesetup00 { - /*0x000*/ u32 unk000; - /*0x004*/ u32 unk004; - /*0x008*/ u32 unk008; - /*0x00c*/ u32 unk00c; - /*0x010*/ u32 unk010; - /*0x014*/ u32 unk014; - /*0x018*/ u32 unk018; - /*0x01c*/ u32 unk01c; - /*0x020*/ u32 unk020; - /*0x024*/ u32 unk024; - /*0x028*/ u32 unk028; - /*0x02c*/ u32 unk02c; - /*0x030*/ u32 unk030; - /*0x034*/ u32 unk034; - /*0x038*/ u32 unk038; - /*0x03c*/ u32 unk03c; - /*0x040*/ u32 unk040; - /*0x044*/ u32 unk044; - /*0x048*/ u32 unk048; - /*0x04c*/ u32 unk04c; - /*0x050*/ u32 unk050; - /*0x054*/ u32 unk054; - /*0x058*/ u32 unk058; - /*0x05c*/ u32 unk05c; - /*0x060*/ u32 unk060; - /*0x064*/ u32 unk064; - /*0x068*/ u32 unk068; - /*0x06c*/ u32 unk06c; - /*0x070*/ u32 unk070; - /*0x074*/ u32 unk074; - /*0x078*/ u32 unk078; - /*0x07c*/ u32 unk07c; - /*0x080*/ u32 unk080; - /*0x084*/ u32 unk084; - /*0x088*/ u32 unk088; - /*0x08c*/ u32 unk08c; - /*0x090*/ u32 unk090; - /*0x094*/ u32 unk094; - /*0x098*/ u32 unk098; - /*0x09c*/ u32 unk09c; - /*0x0a0*/ u32 unk0a0; - /*0x0a4*/ u32 unk0a4; - /*0x0a8*/ u32 unk0a8; - /*0x0ac*/ u32 unk0ac; - /*0x0b0*/ u32 unk0b0; - /*0x0b4*/ u32 unk0b4; - /*0x0b8*/ u32 unk0b8; - /*0x0bc*/ u32 unk0bc; - /*0x0c0*/ u32 unk0c0; - /*0x0c4*/ u32 unk0c4; - /*0x0c8*/ u32 unk0c8; - /*0x0cc*/ u32 unk0cc; - /*0x0d0*/ u32 unk0d0; - /*0x0d4*/ u32 unk0d4; - /*0x0d8*/ u32 unk0d8; - /*0x0dc*/ u32 unk0dc; - /*0x0e0*/ u32 unk0e0; - /*0x0e4*/ u32 unk0e4; - /*0x0e8*/ u32 unk0e8; - /*0x0ec*/ u32 unk0ec; - /*0x0f0*/ u32 unk0f0; - /*0x0f4*/ u32 unk0f4; - /*0x0f8*/ u32 unk0f8; - /*0x0fc*/ u32 unk0fc; - /*0x100*/ u32 unk100; - /*0x104*/ u32 unk104; - /*0x108*/ u32 unk108; - /*0x10c*/ u32 unk10c; - /*0x110*/ u32 unk110; - /*0x114*/ u32 unk114; - /*0x118*/ u32 unk118; - /*0x11c*/ u32 unk11c; - /*0x120*/ u32 unk120; - /*0x124*/ u32 unk124; - /*0x128*/ u32 unk128; - /*0x12c*/ u32 unk12c; - /*0x130*/ u32 unk130; - /*0x134*/ u32 unk134; - /*0x138*/ u32 unk138; - /*0x13c*/ u32 unk13c; - /*0x140*/ u32 unk140; - /*0x144*/ u32 unk144; - /*0x148*/ u32 unk148; - /*0x14c*/ u32 unk14c; - /*0x150*/ u32 unk150; - /*0x154*/ u32 unk154; - /*0x158*/ u32 unk158; - /*0x15c*/ u32 unk15c; - /*0x160*/ u32 unk160; - /*0x164*/ u32 unk164; - /*0x168*/ u32 unk168; - /*0x16c*/ u32 unk16c; - /*0x170*/ u32 unk170; - /*0x174*/ u32 unk174; - /*0x178*/ u32 unk178; - /*0x17c*/ u32 unk17c; - /*0x180*/ u32 unk180; - /*0x184*/ u32 unk184; - /*0x188*/ u32 unk188; - /*0x18c*/ u32 unk18c; - /*0x190*/ u32 unk190; - /*0x194*/ u32 unk194; - /*0x198*/ u32 unk198; - /*0x19c*/ u32 unk19c; - /*0x1a0*/ u32 unk1a0; - /*0x1a4*/ u32 unk1a4; - /*0x1a8*/ u32 unk1a8; - /*0x1ac*/ u32 unk1ac; - /*0x1b0*/ u32 unk1b0; - /*0x1b4*/ u32 unk1b4; - /*0x1b8*/ u32 unk1b8; - /*0x1bc*/ u32 unk1bc; - /*0x1c0*/ u32 unk1c0; - /*0x1c4*/ u32 unk1c4; - /*0x1c8*/ u32 unk1c8; - /*0x1cc*/ u32 unk1cc; - /*0x1d0*/ u32 unk1d0; - /*0x1d4*/ u32 unk1d4; - /*0x1d8*/ u32 unk1d8; - /*0x1dc*/ u32 unk1dc; - /*0x1e0*/ u32 unk1e0; - /*0x1e4*/ u32 unk1e4; - /*0x1e8*/ u32 unk1e8; - /*0x1ec*/ u32 unk1ec; - /*0x1f0*/ u32 unk1f0; - /*0x1f4*/ u32 unk1f4; - /*0x1f8*/ u32 unk1f8; - /*0x1fc*/ u32 unk1fc; - /*0x200*/ u32 unk200; - /*0x204*/ u32 unk204; - /*0x208*/ u32 unk208; - /*0x20c*/ u32 unk20c; - /*0x210*/ u32 unk210; - /*0x214*/ u32 unk214; - /*0x218*/ u32 unk218; - /*0x21c*/ u32 unk21c; - /*0x220*/ u32 unk220; - /*0x224*/ u32 unk224; - /*0x228*/ u32 unk228; - /*0x22c*/ u32 unk22c; - /*0x230*/ u32 unk230; - /*0x234*/ u32 unk234; - /*0x238*/ u32 unk238; - /*0x23c*/ u32 unk23c; - /*0x240*/ u32 unk240; - /*0x244*/ u32 unk244; - /*0x248*/ u32 unk248; - /*0x24c*/ u32 unk24c; - /*0x250*/ u32 unk250; - /*0x254*/ u32 unk254; - /*0x258*/ u32 unk258; - /*0x25c*/ u32 unk25c; - /*0x260*/ u32 unk260; - /*0x264*/ u32 unk264; - /*0x268*/ u32 unk268; - /*0x26c*/ u32 unk26c; - /*0x270*/ u32 unk270; - /*0x274*/ u32 unk274; - /*0x278*/ u32 unk278; - /*0x27c*/ u32 unk27c; - /*0x280*/ u32 unk280; - /*0x284*/ u32 unk284; - /*0x288*/ u32 unk288; - /*0x28c*/ u32 unk28c; - /*0x290*/ u32 unk290; - /*0x294*/ u32 unk294; - /*0x298*/ u32 unk298; - /*0x29c*/ u32 unk29c; - /*0x2a0*/ u32 unk2a0; - /*0x2a4*/ u32 unk2a4; - /*0x2a8*/ u32 unk2a8; - /*0x2ac*/ u32 unk2ac; - /*0x2b0*/ u32 unk2b0; - /*0x2b4*/ u32 unk2b4; - /*0x2b8*/ u32 unk2b8; - /*0x2bc*/ u32 unk2bc; - /*0x2c0*/ u32 unk2c0; - /*0x2c4*/ u32 unk2c4; - /*0x2c8*/ u32 unk2c8; - /*0x2cc*/ u32 unk2cc; - /*0x2d0*/ u32 unk2d0; - /*0x2d4*/ u32 unk2d4; - /*0x2d8*/ u32 unk2d8; - /*0x2dc*/ u32 unk2dc; - /*0x2e0*/ u32 unk2e0; - /*0x2e4*/ u32 unk2e4; - /*0x2e8*/ u32 unk2e8; - /*0x2ec*/ u32 unk2ec; - /*0x2f0*/ u32 unk2f0; - /*0x2f4*/ u32 unk2f4; - /*0x2f8*/ u32 unk2f8; - /*0x2fc*/ u32 unk2fc; - /*0x300*/ u32 unk300; - /*0x304*/ u32 unk304; - /*0x308*/ u32 unk308; - /*0x30c*/ u32 unk30c; - /*0x310*/ u32 unk310; -}; - struct ailist { u8 *list; s32 id; @@ -3035,7 +2838,7 @@ struct cover { }; struct stagesetup { - /*0x00*/ struct stagesetup00 *unk00; + /*0x00*/ struct waypoint *waypoints; /*0x04*/ void *unk04; /*0x08*/ struct coverdefinition *cover; /*0x0c*/ s32 *intro; diff --git a/src/lib/lib_16110.c b/src/lib/lib_16110.c index 01d10fb29..e793e47bb 100644 --- a/src/lib/lib_16110.c +++ b/src/lib/lib_16110.c @@ -2489,7 +2489,7 @@ glabel func000185d0 /* 18620: 00194100 */ sll $t0,$t9,0x4 /* 18624: 00095100 */ sll $t2,$t1,0x4 /* 18628: 01432821 */ addu $a1,$t2,$v1 -/* 1862c: 0fc4569e */ jal func0f115a78 +/* 1862c: 0fc4569e */ jal waypointEnableSegment /* 18630: 01032021 */ addu $a0,$t0,$v1 /* 18634: 1000000f */ b .L00018674 /* 18638: 8fbf0014 */ lw $ra,0x14($sp) @@ -2500,7 +2500,7 @@ glabel func000185d0 /* 18648: 000b6100 */ sll $t4,$t3,0x4 /* 1864c: 000d7100 */ sll $t6,$t5,0x4 /* 18650: 01c32821 */ addu $a1,$t6,$v1 -/* 18654: 0fc45692 */ jal func0f115a48 +/* 18654: 0fc45692 */ jal waypointDisableSegment /* 18658: 01832021 */ addu $a0,$t4,$v1 /* 1865c: 10000005 */ b .L00018674 /* 18660: 8fbf0014 */ lw $ra,0x14($sp)