From 23de219c07071c7ce917e9bc273160eca7d681c6 Mon Sep 17 00:00:00 2001 From: Jdog Date: Sat, 15 Aug 2020 13:11:31 -0700 Subject: [PATCH] Match SpeakToPlayer, remove uneccessary comment, add WIP SetNpcSpeed --- .../code_f4c60_len_4300/SpeakToPlayer.s | 13 ------------- src/code_f2470_len_27f0.c | 16 +++++++++++++++- src/code_f4c60_len_4300.c | 4 +++- 3 files changed, 18 insertions(+), 15 deletions(-) delete mode 100644 asm/nonmatchings/code_f4c60_len_4300/SpeakToPlayer.s diff --git a/asm/nonmatchings/code_f4c60_len_4300/SpeakToPlayer.s b/asm/nonmatchings/code_f4c60_len_4300/SpeakToPlayer.s deleted file mode 100644 index f3b29c0137..0000000000 --- a/asm/nonmatchings/code_f4c60_len_4300/SpeakToPlayer.s +++ /dev/null @@ -1,13 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - - -glabel SpeakToPlayer -/* 0F4C60 802D02B0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* 0F4C64 802D02B4 AFBF0010 */ sw $ra, 0x10($sp) -/* 0F4C68 802D02B8 0C0B40C8 */ jal _show_message -/* 0F4C6C 802D02BC 0000302D */ daddu $a2, $zero, $zero -/* 0F4C70 802D02C0 8FBF0010 */ lw $ra, 0x10($sp) -/* 0F4C74 802D02C4 03E00008 */ jr $ra -/* 0F4C78 802D02C8 27BD0018 */ addiu $sp, $sp, 0x18 - diff --git a/src/code_f2470_len_27f0.c b/src/code_f2470_len_27f0.c index 7d78c6de95..4d570999da 100644 --- a/src/code_f2470_len_27f0.c +++ b/src/code_f2470_len_27f0.c @@ -20,7 +20,7 @@ s32 GetNpcPointer(script_context* script, s32 initialCall) { bytecode npcID = get_variable(script, *ptrReadPos++); bytecode varNPC = *ptrReadPos; - set_variable(script, varNPC, get_npc_safe(npcID)); // removed * + set_variable(script, varNPC, get_npc_safe(npcID)); return 2; } @@ -33,6 +33,20 @@ INCLUDE_ASM(code_f2470_len_27f0, SetNpcScale); INCLUDE_ASM(code_f2470_len_27f0, SetNpcCollisionSize); INCLUDE_ASM(code_f2470_len_27f0, SetNpcSpeed); +// TODO: Fix issue with BNEZL vs BNEZ +/* +s32 SetNpcSpeed(script_context* script, s32 initialCall) { + bytecode* ptrReadPos = script->ptrReadPos; + bytecode npcID = get_variable(script, *ptrReadPos++); + f32 speed = get_float_variable(script, *ptrReadPos); + npc* npcPtr = resolve_npc(script, npcID); + + npcPtr->moveSpeed = speed; + if(npcPtr != NULL) { + return 2; + } +} +*/ INCLUDE_ASM(code_f2470_len_27f0, SetNpcJumpscale); diff --git a/src/code_f4c60_len_4300.c b/src/code_f4c60_len_4300.c index 2a5cf0f34a..c3b3bb1749 100644 --- a/src/code_f4c60_len_4300.c +++ b/src/code_f4c60_len_4300.c @@ -1,6 +1,8 @@ #include "common.h" -INCLUDE_ASM(code_f4c60_len_4300, SpeakToPlayer); +void SpeakToPlayer(script_context* script, s32 initialCall) { + _show_message(script, initialCall, 0); +} INCLUDE_ASM(code_f4c60_len_4300, EndSpeech);