diff --git a/asm/non_matchings/code/z_path/Path_GetByIndex.s b/asm/non_matchings/code/z_path/Path_GetByIndex.s deleted file mode 100644 index 8e04fac547..0000000000 --- a/asm/non_matchings/code/z_path/Path_GetByIndex.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel Path_GetByIndex -/* B05680 8008E4E0 AFA50004 */ sw $a1, 4($sp) -/* B05684 8008E4E4 AFA60008 */ sw $a2, 8($sp) -/* B05688 8008E4E8 00063400 */ sll $a2, $a2, 0x10 -/* B0568C 8008E4EC 00052C00 */ sll $a1, $a1, 0x10 -/* B05690 8008E4F0 00052C03 */ sra $a1, $a1, 0x10 -/* B05694 8008E4F4 00063403 */ sra $a2, $a2, 0x10 -/* B05698 8008E4F8 10A60007 */ beq $a1, $a2, .L8008E518 -/* B0569C 8008E4FC 00001825 */ move $v1, $zero -/* B056A0 8008E500 3C0E0001 */ lui $t6, 1 -/* B056A4 8008E504 01C47021 */ addu $t6, $t6, $a0 -/* B056A8 8008E508 8DCE1E08 */ lw $t6, 0x1e08($t6) -/* B056AC 8008E50C 000578C0 */ sll $t7, $a1, 3 -/* B056B0 8008E510 03E00008 */ jr $ra -/* B056B4 8008E514 01CF1021 */ addu $v0, $t6, $t7 -.L8008E518: -/* B056B8 8008E518 03E00008 */ jr $ra -/* B056BC 8008E51C 00601025 */ move $v0, $v1 diff --git a/src/code/z_path.c b/src/code/z_path.c index 7b54d58c2f..011421bd6d 100644 --- a/src/code/z_path.c +++ b/src/code/z_path.c @@ -1,7 +1,17 @@ #include #include -#pragma GLOBAL_ASM("asm/non_matchings/code/z_path/Path_GetByIndex.s") +Path* Path_GetByIndex(GlobalContext* globalCtx, s16 index, s16 max) { + Path* path; + + if (index != max) { + path = &globalCtx->setupPathList[index]; + } else { + path = NULL; + } + + return path; +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_path/Path_OrientAndGetDistSq.s")