Merge pull request #22 from nanaian/type-apocalypse

rename types
This commit is contained in:
Ethan Roseman 2020-08-17 13:10:17 -04:00 committed by GitHub
commit 38a0eacf66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
97 changed files with 2849 additions and 2877 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,11 +9,11 @@ void osCleanupThread(void);
void clone_model(u16 srcModelID, u16 newModelID);
void update_collider_transform(s16 colliderID);
s32 get_variable(script_context* script, bytecode var);
s32 set_variable(script_context* script, bytecode var, s32 value);
f32 get_float_variable(script_context* script, bytecode var);
f32 set_float_variable(script_context* script, bytecode var, f32 value);
void set_script_timescale(script_context* script, f32 timescale);
s32 get_variable(ScriptInstance* script, Bytecode var);
s32 set_variable(ScriptInstance* script, Bytecode var, s32 value);
f32 get_float_variable(ScriptInstance* script, Bytecode var);
f32 set_float_variable(ScriptInstance* script, Bytecode var, f32 value);
void set_script_timescale(ScriptInstance* script, f32 timescale);
f32 sin_deg(f32 x);
f32 cos_deg(f32 x);
f32 atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
@ -30,11 +30,11 @@ void func_80137E4C(s32, s32, s32, s32);
s32 rand_int(s32);
void sort_items(void);
s32 is_ability_active(s32 arg0);
f32 update_lerp(EASING easing, f32 start, f32 end, s32 elapsed, s32 duration);
f32 update_lerp(Easing easing, f32 start, f32 end, s32 elapsed, s32 duration);
npc* get_npc_safe(s32 npcID);
npc* get_npc_unsafe(s32 npcID);
npc* resolve_npc(script_context* script, NPC npcID);
Npc* get_npc_safe(NpcId npcId);
Npc* get_npc_unsafe(NpcId npcId);
Npc* resolve_npc(ScriptInstance* script, NpcId npcIdOrPtr);
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by);
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz);

View File

@ -1,8 +1,22 @@
#ifndef _SI_H_
#define _SI_H
#define _SI_H_
#define SI_VAR_0 0xFE363C80
// TODO
/* Return type of si_execute_next_command */
#define SI_CONTINUE 0 /* Continue to next command */
#define SI_ABORT 1 /* Quit execution */
#define SI_FINISH 255 /* Return from script */
/* Return type of script API functions */
typedef s32 ApiStatus;
#define ApiStatus_BLOCK 0 /* Call again next frame */
#define ApiStatus_DONE1 1 /* Unconditional. Probably only exists to return a bool from functions */
#define ApiStatus_DONE2 2 /* Conditional on ScriptInstance->disableScripts */
#define ApiStatus_REPEAT 3 /* Call again immediately */
#define ApiStatus_FINISH 255 /* Corresponds to SI_FINISH */
#define API_FUN(NAME) ApiStatus (*NAME)(struct ScriptInstance* script, s32 isInitialCall)
#define INCLUDE_API_ASM(FOLDER, NAME) ApiStatus INCLUDE_ASM(FOLDER, NAME, struct ScriptInstance* script, s32 isInitialCall)
#endif

View File

@ -8,6 +8,6 @@
#define UNK_FUN_PTR(name) void(*name)(void)
#define UNK_ARGS
typedef s32 bytecode;
typedef s32 Bytecode;
#endif

View File

@ -5,15 +5,40 @@
#include "common_structs.h"
#include "types.h"
extern ui_status gUIStatus;
extern player_data gPlayerData;
extern player_status gPlayerStatus;
extern game_status* gGameStatusPtr[1];
extern item_table_entry gItemTable[364];
extern UiStatus gUIStatus;
extern PlayerData gPlayerData;
extern PlayerStatus gPlayerStatus;
extern GameStatus* gGameStatusPtr[1];
extern StaticItem gItemTable[364];
extern s16 gMainGameState; /* 0 = battle, 1 = pause, 2 = world */
extern UNK_FUN_PTR(gCurrentUpdateFunction);
extern script_context* gWorldScriptList[128];
extern script_context* gBattleScriptList[128];
extern script_context** gCurrentScriptListPtr[128];
extern ScriptInstance* gWorldScriptList[128];
extern ScriptInstance* gBattleScriptList[128];
extern ScriptInstance** gCurrentScriptListPtr[128];
extern s32 gScriptIdList[128];
extern s32 gScriptIndexList[128];
extern Model* gWorldModelList[256];
extern Model* gBattleModelList[256];
extern Model** gCurrentModelListPtr[256];
extern u32* gWorldModelSpecialDls[32];
extern u32* gBattleModelSpecialDls[32];
extern u32** gCurrentModelSpecialDlsPtr[32];
extern Entity* gWorldEntityList[30];
extern Entity* gBattleEntityList[30];
extern Entity** gCurrentEntityListPtr[30];
extern UNK_TYPE* gWorldDynamicEntityList[16];
extern UNK_TYPE* gBattleDynamicEntityList[16];
extern UNK_TYPE** gCurrentDynamicEntityListPtr[16];
extern Shadow* gWorldShadowList[60];
extern Shadow* gBattleShadowList[60];
extern Shadow** gCurrentShadowListPtr[60];
extern f32 gGlobalTimeSpace;
@ -24,17 +49,17 @@ extern s16 D_8010CD12;
extern s32 D_801595A0;
extern char gCloudyFlowerFieldsBg[]; // "fla_bg"
extern char gSunnyFlowerFieldsBg[]; // "flb_bg"
extern bg_header gBackgroundImage;
extern BackgroundHeader gBackgroundImage;
extern s8 D_8014F12F;
extern print_context* gCurrentPrintContext;
extern print_context* D_802DB268;
extern PrintContext* gCurrentPrintContext;
extern PrintContext* D_802DB268;
// Triggers
/* 0x80151334 */ extern s16 gTriggerCount;
/* 0x80159190 */ extern trigger gTriggerList1[64];
/* 0x80159290 */ extern trigger gTriggerList2[64];
/* 0x80159390 */ extern trigger** gCurrentTriggerListPtr[64];
/* 0x80159190 */ extern Trigger gTriggerList1[64];
/* 0x80159290 */ extern Trigger gTriggerList2[64];
/* 0x80159390 */ extern Trigger** gCurrentTriggerListPtr[64];
extern u16 gMapTransitionAlpha;
extern u16 D_800A0942;

View File

@ -14,7 +14,7 @@ INCLUDE_ASM(code_111f0_len_860, func_80035E54);
INCLUDE_ASM(code_111f0_len_860, func_80035EEC);
void func_800360FC(void) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
if (gameStatus->loadMenuState == 2) {
func_800E973C();
@ -22,7 +22,7 @@ void func_800360FC(void) {
}
void func_80036130(void) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
gMapTransitionAlpha = 0x00;
D_800A0942 = 0x14;
@ -48,7 +48,7 @@ s32 func_800363FC(void) {
}
s32 func_80036430(void) {
player_status* pPlayerStatus = &gPlayerStatus;
PlayerStatus* pPlayerStatus = &gPlayerStatus;
gMapTransitionAlpha = 0xFF;
D_800A0942 = 0x14;

View File

@ -42,9 +42,9 @@ INCLUDE_ASM(code_13870_len_6980, render_npcs);
INCLUDE_ASM(code_13870_len_6980, npc_move_heading);
npc* INCLUDE_ASM(code_13870_len_6980, get_npc_unsafe, s32 npcID);
Npc* INCLUDE_ASM(code_13870_len_6980, get_npc_unsafe, NpcId npcId);
npc* INCLUDE_ASM(code_13870_len_6980, get_npc_safe, s32 npcID);
Npc* INCLUDE_ASM(code_13870_len_6980, get_npc_safe, NpcId npcId);
INCLUDE_ASM(code_13870_len_6980, enable_npc_shadow);

View File

@ -98,9 +98,9 @@ INCLUDE_ASM(code_16c8e0, func_80245440);
INCLUDE_ASM(code_16c8e0, func_802456B0);
INCLUDE_ASM(code_16c8e0, EnablePartnerBlur);
INCLUDE_API_ASM(code_16c8e0, EnablePartnerBlur);
INCLUDE_ASM(code_16c8e0, DisablePartnerBlur);
INCLUDE_API_ASM(code_16c8e0, DisablePartnerBlur);
INCLUDE_ASM(code_16c8e0, update_swap_partner);
@ -174,25 +174,25 @@ INCLUDE_ASM(code_16c8e0, unfreeze_cam);
INCLUDE_ASM(code_16c8e0, func_8024E60C);
INCLUDE_ASM(code_16c8e0, UseCamPreset);
INCLUDE_API_ASM(code_16c8e0, UseCamPreset);
INCLUDE_ASM(code_16c8e0, SetBattleCamTarget);
INCLUDE_API_ASM(code_16c8e0, SetBattleCamTarget);
INCLUDE_ASM(code_16c8e0, SetBattleCamOffsetZ);
INCLUDE_API_ASM(code_16c8e0, SetBattleCamOffsetZ);
INCLUDE_ASM(code_16c8e0, AddBattleCamOffsetZ);
INCLUDE_API_ASM(code_16c8e0, AddBattleCamOffsetZ);
INCLUDE_ASM(code_16c8e0, SetBattleCamYaw);
INCLUDE_API_ASM(code_16c8e0, SetBattleCamYaw);
INCLUDE_ASM(code_16c8e0, BattleCamTargetActor);
INCLUDE_API_ASM(code_16c8e0, BattleCamTargetActor);
INCLUDE_ASM(code_16c8e0, MoveBattleCamOver);
INCLUDE_API_ASM(code_16c8e0, MoveBattleCamOver);
INCLUDE_ASM(code_16c8e0, SetBattleCamZoom);
INCLUDE_API_ASM(code_16c8e0, SetBattleCamZoom);
INCLUDE_ASM(code_16c8e0, AddBattleCamZoom);
INCLUDE_API_ASM(code_16c8e0, AddBattleCamZoom);
INCLUDE_ASM(code_16c8e0, FreezeBattleCam);
INCLUDE_API_ASM(code_16c8e0, FreezeBattleCam);
INCLUDE_ASM(code_16c8e0, func_8024EDC0);
@ -226,17 +226,17 @@ INCLUDE_ASM(code_16c8e0, close_action_command_instruction_popup);
INCLUDE_ASM(code_16c8e0, show_message_popup);
INCLUDE_ASM(code_16c8e0, ShowMessageBox);
INCLUDE_API_ASM(code_16c8e0, ShowMessageBox);
INCLUDE_ASM(code_16c8e0, ShowVariableMessageBox);
INCLUDE_API_ASM(code_16c8e0, ShowVariableMessageBox);
INCLUDE_ASM(code_16c8e0, IsMessageBoxDisplayed);
INCLUDE_API_ASM(code_16c8e0, IsMessageBoxDisplayed);
INCLUDE_ASM(code_16c8e0, WaitForMessageBoxDone);
INCLUDE_API_ASM(code_16c8e0, WaitForMessageBoxDone);
INCLUDE_ASM(code_16c8e0, ForceCloseMessageBox);
INCLUDE_API_ASM(code_16c8e0, ForceCloseMessageBox);
INCLUDE_ASM(code_16c8e0, SetMessageBoxDuration);
INCLUDE_API_ASM(code_16c8e0, SetMessageBoxDuration);
INCLUDE_ASM(code_16c8e0, func_80251474);
@ -244,31 +244,31 @@ INCLUDE_ASM(code_16c8e0, calc_item_check_hit);
INCLUDE_ASM(code_16c8e0, calc_item_damage_enemy);
INCLUDE_ASM(code_16c8e0, ItemDamageEnemy);
INCLUDE_API_ASM(code_16c8e0, ItemDamageEnemy);
INCLUDE_ASM(code_16c8e0, ItemAfflictEnemy);
INCLUDE_API_ASM(code_16c8e0, ItemAfflictEnemy);
INCLUDE_ASM(code_16c8e0, ItemCheckHit);
INCLUDE_API_ASM(code_16c8e0, ItemCheckHit);
INCLUDE_ASM(code_16c8e0, ActorSpeak);
INCLUDE_API_ASM(code_16c8e0, ActorSpeak);
INCLUDE_ASM(code_16c8e0, EndActorSpeech);
INCLUDE_API_ASM(code_16c8e0, EndActorSpeech);
INCLUDE_ASM(code_16c8e0, ShowBattleChoice);
INCLUDE_API_ASM(code_16c8e0, ShowBattleChoice);
INCLUDE_ASM(code_16c8e0, OverrideBattleDmaDest);
INCLUDE_API_ASM(code_16c8e0, OverrideBattleDmaDest);
INCLUDE_ASM(code_16c8e0, LoadBattleDmaData);
INCLUDE_API_ASM(code_16c8e0, LoadBattleDmaData);
INCLUDE_ASM(code_16c8e0, PlaySoundAtActor);
INCLUDE_API_ASM(code_16c8e0, PlaySoundAtActor);
INCLUDE_ASM(code_16c8e0, PlaySoundAtPart);
INCLUDE_API_ASM(code_16c8e0, PlaySoundAtPart);
INCLUDE_ASM(code_16c8e0, SetForegroundModelsVisibleUnchecked);
INCLUDE_API_ASM(code_16c8e0, SetForegroundModelsVisibleUnchecked);
INCLUDE_ASM(code_16c8e0, SetForegroundModelsVisible);
INCLUDE_API_ASM(code_16c8e0, SetForegroundModelsVisible);
INCLUDE_ASM(code_16c8e0, MakeStatusField);
INCLUDE_API_ASM(code_16c8e0, MakeStatusField);
INCLUDE_ASM(code_16c8e0, is_actor_hp_bar_visible);
@ -278,15 +278,15 @@ INCLUDE_ASM(code_16c8e0, save_tattle_flags);
INCLUDE_ASM(code_16c8e0, load_tattle_flags);
INCLUDE_ASM(code_16c8e0, MultiplyByActorScale);
INCLUDE_API_ASM(code_16c8e0, MultiplyByActorScale);
INCLUDE_ASM(code_16c8e0, MultiplyVec2ByActorScale);
INCLUDE_API_ASM(code_16c8e0, MultiplyVec2ByActorScale);
INCLUDE_ASM(code_16c8e0, MultiplyVec3ByActorScale);
INCLUDE_API_ASM(code_16c8e0, MultiplyVec3ByActorScale);
INCLUDE_ASM(code_16c8e0, ApplyShrinkFromOwner);
INCLUDE_API_ASM(code_16c8e0, ApplyShrinkFromOwner);
INCLUDE_ASM(code_16c8e0, StartRumble);
INCLUDE_API_ASM(code_16c8e0, StartRumble);
INCLUDE_ASM(code_16c8e0, func_80254250);
@ -448,15 +448,15 @@ INCLUDE_ASM(code_16c8e0, func_80260A60);
INCLUDE_ASM(code_16c8e0, activate_defend_command);
INCLUDE_ASM(code_16c8e0, HasMerleeCastsLeft);
INCLUDE_API_ASM(code_16c8e0, HasMerleeCastsLeft);
INCLUDE_ASM(code_16c8e0, FXRecoverHP);
INCLUDE_API_ASM(code_16c8e0, FXRecoverHP);
INCLUDE_ASM(code_16c8e0, FXRecoverFP);
INCLUDE_API_ASM(code_16c8e0, FXRecoverFP);
INCLUDE_ASM(code_16c8e0, IncrementPlayerHP);
INCLUDE_API_ASM(code_16c8e0, IncrementPlayerHP);
INCLUDE_ASM(code_16c8e0, IncrementPlayerFP);
INCLUDE_API_ASM(code_16c8e0, IncrementPlayerFP);
INCLUDE_ASM(code_16c8e0, create_target_list);
@ -606,17 +606,17 @@ INCLUDE_ASM(code_16c8e0, hide_foreground_models);
INCLUDE_ASM(code_16c8e0, show_foreground_models);
INCLUDE_ASM(code_16c8e0, StartRumbleWithParams);
INCLUDE_API_ASM(code_16c8e0, StartRumbleWithParams);
INCLUDE_ASM(code_16c8e0, start_rumble_type);
INCLUDE_ASM(code_16c8e0, LoadItemScript);
INCLUDE_API_ASM(code_16c8e0, LoadItemScript);
INCLUDE_ASM(code_16c8e0, LoadFreeItemScript);
INCLUDE_API_ASM(code_16c8e0, LoadFreeItemScript);
INCLUDE_ASM(code_16c8e0, LoadMoveScript);
INCLUDE_API_ASM(code_16c8e0, LoadMoveScript);
INCLUDE_ASM(code_16c8e0, LoadActionCommand);
INCLUDE_API_ASM(code_16c8e0, LoadActionCommand);
INCLUDE_ASM(code_16c8e0, func_80268284);
@ -626,15 +626,15 @@ INCLUDE_ASM(code_16c8e0, func_80268E88);
INCLUDE_ASM(code_16c8e0, check_block_input);
INCLUDE_ASM(code_16c8e0, GetActionSuccess);
INCLUDE_API_ASM(code_16c8e0, GetActionSuccess);
INCLUDE_ASM(code_16c8e0, SetActionSuccess);
INCLUDE_API_ASM(code_16c8e0, SetActionSuccess);
INCLUDE_ASM(code_16c8e0, CloseActionCommandInfo);
INCLUDE_API_ASM(code_16c8e0, CloseActionCommandInfo);
INCLUDE_ASM(code_16c8e0, GetActionSuccessCopy);
INCLUDE_API_ASM(code_16c8e0, GetActionSuccessCopy);
INCLUDE_ASM(code_16c8e0, GetBlockResult);
INCLUDE_API_ASM(code_16c8e0, GetBlockResult);
INCLUDE_ASM(code_16c8e0, count_targets);
@ -652,257 +652,257 @@ INCLUDE_ASM(code_16c8e0, set_actor_home_position);
INCLUDE_ASM(code_16c8e0, get_actor);
INCLUDE_ASM(code_16c8e0, LoadBattleSection);
INCLUDE_API_ASM(code_16c8e0, LoadBattleSection);
INCLUDE_ASM(code_16c8e0, GetBattlePhase);
INCLUDE_API_ASM(code_16c8e0, GetBattlePhase);
INCLUDE_ASM(code_16c8e0, GetLastElement);
INCLUDE_API_ASM(code_16c8e0, GetLastElement);
INCLUDE_ASM(code_16c8e0, SetGoalToHome);
INCLUDE_API_ASM(code_16c8e0, SetGoalToHome);
INCLUDE_ASM(code_16c8e0, SetIdleGoalToHome);
INCLUDE_API_ASM(code_16c8e0, SetIdleGoalToHome);
INCLUDE_ASM(code_16c8e0, SetGoalToIndex);
INCLUDE_API_ASM(code_16c8e0, SetGoalToIndex);
INCLUDE_ASM(code_16c8e0, GetIndexFromPos);
INCLUDE_API_ASM(code_16c8e0, GetIndexFromPos);
INCLUDE_ASM(code_16c8e0, GetIndexFromHome);
INCLUDE_API_ASM(code_16c8e0, GetIndexFromHome);
INCLUDE_ASM(code_16c8e0, CountPlayerTargets);
INCLUDE_API_ASM(code_16c8e0, CountPlayerTargets);
INCLUDE_ASM(code_16c8e0, ForceHomePos);
INCLUDE_API_ASM(code_16c8e0, ForceHomePos);
INCLUDE_ASM(code_16c8e0, SetHomePos);
INCLUDE_API_ASM(code_16c8e0, SetHomePos);
INCLUDE_ASM(code_16c8e0, SetGoalToTarget);
INCLUDE_API_ASM(code_16c8e0, SetGoalToTarget);
INCLUDE_ASM(code_16c8e0, SetPartGoalToTarget);
INCLUDE_API_ASM(code_16c8e0, SetPartGoalToTarget);
INCLUDE_ASM(code_16c8e0, SetGoalToFirstTarget);
INCLUDE_API_ASM(code_16c8e0, SetGoalToFirstTarget);
INCLUDE_ASM(code_16c8e0, SetGoalPos);
INCLUDE_API_ASM(code_16c8e0, SetGoalPos);
INCLUDE_ASM(code_16c8e0, SetIdleGoal);
INCLUDE_API_ASM(code_16c8e0, SetIdleGoal);
INCLUDE_ASM(code_16c8e0, AddGoalPos);
INCLUDE_API_ASM(code_16c8e0, AddGoalPos);
INCLUDE_ASM(code_16c8e0, GetGoalPos);
INCLUDE_API_ASM(code_16c8e0, GetGoalPos);
INCLUDE_ASM(code_16c8e0, GetIdleGoal);
INCLUDE_API_ASM(code_16c8e0, GetIdleGoal);
INCLUDE_ASM(code_16c8e0, GetPartTarget);
INCLUDE_API_ASM(code_16c8e0, GetPartTarget);
INCLUDE_ASM(code_16c8e0, GetActorPos);
INCLUDE_API_ASM(code_16c8e0, GetActorPos);
INCLUDE_ASM(code_16c8e0, GetPartOffset);
INCLUDE_API_ASM(code_16c8e0, GetPartOffset);
INCLUDE_ASM(code_16c8e0, GetPartPos);
INCLUDE_API_ASM(code_16c8e0, GetPartPos);
INCLUDE_ASM(code_16c8e0, GetHomePos);
INCLUDE_API_ASM(code_16c8e0, GetHomePos);
INCLUDE_ASM(code_16c8e0, SetActorPos);
INCLUDE_API_ASM(code_16c8e0, SetActorPos);
INCLUDE_ASM(code_16c8e0, SetPartPos);
INCLUDE_API_ASM(code_16c8e0, SetPartPos);
INCLUDE_ASM(code_16c8e0, SetEnemyTargetOffset);
INCLUDE_API_ASM(code_16c8e0, SetEnemyTargetOffset);
INCLUDE_ASM(code_16c8e0, SetAnimation);
INCLUDE_API_ASM(code_16c8e0, SetAnimation);
INCLUDE_ASM(code_16c8e0, GetAnimation);
INCLUDE_API_ASM(code_16c8e0, GetAnimation);
INCLUDE_ASM(code_16c8e0, SetAnimationRate);
INCLUDE_API_ASM(code_16c8e0, SetAnimationRate);
INCLUDE_ASM(code_16c8e0, SetActorYaw);
INCLUDE_API_ASM(code_16c8e0, SetActorYaw);
INCLUDE_ASM(code_16c8e0, GetActorYaw);
INCLUDE_API_ASM(code_16c8e0, GetActorYaw);
INCLUDE_ASM(code_16c8e0, SetPartYaw);
INCLUDE_API_ASM(code_16c8e0, SetPartYaw);
INCLUDE_ASM(code_16c8e0, GetPartYaw);
INCLUDE_API_ASM(code_16c8e0, GetPartYaw);
INCLUDE_ASM(code_16c8e0, SetActorJumpGravity);
INCLUDE_API_ASM(code_16c8e0, SetActorJumpGravity);
INCLUDE_ASM(code_16c8e0, SetActorIdleJumpGravity);
INCLUDE_API_ASM(code_16c8e0, SetActorIdleJumpGravity);
INCLUDE_ASM(code_16c8e0, SetActorSpeed);
INCLUDE_API_ASM(code_16c8e0, SetActorSpeed);
INCLUDE_ASM(code_16c8e0, SetActorIdleSpeed);
INCLUDE_API_ASM(code_16c8e0, SetActorIdleSpeed);
INCLUDE_ASM(code_16c8e0, SetPartJumpGravity);
INCLUDE_API_ASM(code_16c8e0, SetPartJumpGravity);
INCLUDE_ASM(code_16c8e0, SetPartMoveSpeed);
INCLUDE_API_ASM(code_16c8e0, SetPartMoveSpeed);
INCLUDE_ASM(code_16c8e0, SetJumpAnimations);
INCLUDE_API_ASM(code_16c8e0, SetJumpAnimations);
INCLUDE_ASM(code_16c8e0, AddActorPos);
INCLUDE_API_ASM(code_16c8e0, AddActorPos);
INCLUDE_ASM(code_16c8e0, SetActorDispOffset);
INCLUDE_API_ASM(code_16c8e0, SetActorDispOffset);
INCLUDE_ASM(code_16c8e0, GetPartDispOffset);
INCLUDE_API_ASM(code_16c8e0, GetPartDispOffset);
INCLUDE_ASM(code_16c8e0, SetPartDispOffset);
INCLUDE_API_ASM(code_16c8e0, SetPartDispOffset);
INCLUDE_ASM(code_16c8e0, AddPartDispOffset);
INCLUDE_API_ASM(code_16c8e0, AddPartDispOffset);
INCLUDE_ASM(code_16c8e0, GetActorVar);
INCLUDE_API_ASM(code_16c8e0, GetActorVar);
INCLUDE_ASM(code_16c8e0, SetActorVar);
INCLUDE_API_ASM(code_16c8e0, SetActorVar);
INCLUDE_ASM(code_16c8e0, AddActorVar);
INCLUDE_API_ASM(code_16c8e0, AddActorVar);
INCLUDE_ASM(code_16c8e0, GetPartMovementVar);
INCLUDE_API_ASM(code_16c8e0, GetPartMovementVar);
INCLUDE_ASM(code_16c8e0, SetPartMovementVar);
INCLUDE_API_ASM(code_16c8e0, SetPartMovementVar);
INCLUDE_ASM(code_16c8e0, AddPartMovementVar);
INCLUDE_API_ASM(code_16c8e0, AddPartMovementVar);
INCLUDE_ASM(code_16c8e0, SetActorRotation);
INCLUDE_API_ASM(code_16c8e0, SetActorRotation);
INCLUDE_ASM(code_16c8e0, SetActorRotationOffset);
INCLUDE_API_ASM(code_16c8e0, SetActorRotationOffset);
INCLUDE_ASM(code_16c8e0, GetActorRotation);
INCLUDE_API_ASM(code_16c8e0, GetActorRotation);
INCLUDE_ASM(code_16c8e0, SetPartRotation);
INCLUDE_API_ASM(code_16c8e0, SetPartRotation);
INCLUDE_ASM(code_16c8e0, SetPartRotationOffset);
INCLUDE_API_ASM(code_16c8e0, SetPartRotationOffset);
INCLUDE_ASM(code_16c8e0, GetPartRotation);
INCLUDE_API_ASM(code_16c8e0, GetPartRotation);
INCLUDE_ASM(code_16c8e0, SetActorScale);
INCLUDE_API_ASM(code_16c8e0, SetActorScale);
INCLUDE_ASM(code_16c8e0, SetActorScaleModifier);
INCLUDE_API_ASM(code_16c8e0, SetActorScaleModifier);
INCLUDE_ASM(code_16c8e0, GetActorScale);
INCLUDE_API_ASM(code_16c8e0, GetActorScale);
INCLUDE_ASM(code_16c8e0, SetPartScale);
INCLUDE_API_ASM(code_16c8e0, SetPartScale);
INCLUDE_ASM(code_16c8e0, GetPartScale);
INCLUDE_API_ASM(code_16c8e0, GetPartScale);
INCLUDE_ASM(code_16c8e0, GetBattleFlags);
INCLUDE_API_ASM(code_16c8e0, GetBattleFlags);
INCLUDE_ASM(code_16c8e0, SetBattleFlagBits);
INCLUDE_API_ASM(code_16c8e0, SetBattleFlagBits);
INCLUDE_ASM(code_16c8e0, GetBattleFlags2);
INCLUDE_API_ASM(code_16c8e0, GetBattleFlags2);
INCLUDE_ASM(code_16c8e0, SetBattleFlagBits2);
INCLUDE_API_ASM(code_16c8e0, SetBattleFlagBits2);
INCLUDE_ASM(code_16c8e0, SetActorFlags);
INCLUDE_API_ASM(code_16c8e0, SetActorFlags);
INCLUDE_ASM(code_16c8e0, SetActorFlagBits);
INCLUDE_API_ASM(code_16c8e0, SetActorFlagBits);
INCLUDE_ASM(code_16c8e0, GetActorFlags);
INCLUDE_API_ASM(code_16c8e0, GetActorFlags);
INCLUDE_ASM(code_16c8e0, SetPartFlags);
INCLUDE_API_ASM(code_16c8e0, SetPartFlags);
INCLUDE_ASM(code_16c8e0, SetPartFlagBits);
INCLUDE_API_ASM(code_16c8e0, SetPartFlagBits);
INCLUDE_ASM(code_16c8e0, SetPartTargetFlags);
INCLUDE_API_ASM(code_16c8e0, SetPartTargetFlags);
INCLUDE_ASM(code_16c8e0, SetPartTargetFlagBits);
INCLUDE_API_ASM(code_16c8e0, SetPartTargetFlagBits);
INCLUDE_ASM(code_16c8e0, GetPartFlags);
INCLUDE_API_ASM(code_16c8e0, GetPartFlags);
INCLUDE_ASM(code_16c8e0, GetPartTargetFlags);
INCLUDE_API_ASM(code_16c8e0, GetPartTargetFlags);
INCLUDE_ASM(code_16c8e0, SetPartEventFlags);
INCLUDE_API_ASM(code_16c8e0, SetPartEventFlags);
INCLUDE_ASM(code_16c8e0, SetPartEventBits);
INCLUDE_API_ASM(code_16c8e0, SetPartEventBits);
INCLUDE_ASM(code_16c8e0, GetPartEventFlags);
INCLUDE_API_ASM(code_16c8e0, GetPartEventFlags);
INCLUDE_ASM(code_16c8e0, HPBarToHome);
INCLUDE_API_ASM(code_16c8e0, HPBarToHome);
INCLUDE_ASM(code_16c8e0, HPBarToCurrent);
INCLUDE_API_ASM(code_16c8e0, HPBarToCurrent);
INCLUDE_ASM(code_16c8e0, SummonEnemy);
INCLUDE_API_ASM(code_16c8e0, SummonEnemy);
INCLUDE_ASM(code_16c8e0, GetOwnerID);
INCLUDE_API_ASM(code_16c8e0, GetOwnerID);
INCLUDE_ASM(code_16c8e0, SetOwnerID);
INCLUDE_API_ASM(code_16c8e0, SetOwnerID);
INCLUDE_ASM(code_16c8e0, ActorExists);
INCLUDE_API_ASM(code_16c8e0, ActorExists);
INCLUDE_ASM(code_16c8e0, SetBattleInputMask);
INCLUDE_API_ASM(code_16c8e0, SetBattleInputMask);
INCLUDE_ASM(code_16c8e0, SetBattleInputButtons);
INCLUDE_API_ASM(code_16c8e0, SetBattleInputButtons);
INCLUDE_ASM(code_16c8e0, CheckButtonPress);
INCLUDE_API_ASM(code_16c8e0, CheckButtonPress);
INCLUDE_ASM(code_16c8e0, CheckButtonHeld);
INCLUDE_API_ASM(code_16c8e0, CheckButtonHeld);
INCLUDE_ASM(code_16c8e0, CheckButtonDown);
INCLUDE_API_ASM(code_16c8e0, CheckButtonDown);
INCLUDE_ASM(code_16c8e0, GetBattleState);
INCLUDE_API_ASM(code_16c8e0, GetBattleState);
INCLUDE_ASM(code_16c8e0, PlayerCreateTargetList);
INCLUDE_API_ASM(code_16c8e0, PlayerCreateTargetList);
INCLUDE_ASM(code_16c8e0, EnemyCreateTargetList);
INCLUDE_API_ASM(code_16c8e0, EnemyCreateTargetList);
INCLUDE_ASM(code_16c8e0, InitTargetIterator);
INCLUDE_API_ASM(code_16c8e0, InitTargetIterator);
INCLUDE_ASM(code_16c8e0, SetOwnerTarget);
INCLUDE_API_ASM(code_16c8e0, SetOwnerTarget);
INCLUDE_ASM(code_16c8e0, ChooseNextTarget);
INCLUDE_API_ASM(code_16c8e0, ChooseNextTarget);
INCLUDE_ASM(code_16c8e0, GetTargetListLength);
INCLUDE_API_ASM(code_16c8e0, GetTargetListLength);
INCLUDE_ASM(code_16c8e0, GetOwnerTarget);
INCLUDE_API_ASM(code_16c8e0, GetOwnerTarget);
INCLUDE_ASM(code_16c8e0, GetPlayerActorID);
INCLUDE_API_ASM(code_16c8e0, GetPlayerActorID);
INCLUDE_ASM(code_16c8e0, GetDistanceToGoal);
INCLUDE_API_ASM(code_16c8e0, GetDistanceToGoal);
INCLUDE_ASM(code_16c8e0, AddActorDecoration);
INCLUDE_API_ASM(code_16c8e0, AddActorDecoration);
INCLUDE_ASM(code_16c8e0, RemoveActorDecoration);
INCLUDE_API_ASM(code_16c8e0, RemoveActorDecoration);
INCLUDE_ASM(code_16c8e0, ModifyActorDecoration);
INCLUDE_API_ASM(code_16c8e0, ModifyActorDecoration);
INCLUDE_ASM(code_16c8e0, UseIdleAnimation);
INCLUDE_API_ASM(code_16c8e0, UseIdleAnimation);
INCLUDE_ASM(code_16c8e0, GetStatusFlags);
INCLUDE_API_ASM(code_16c8e0, GetStatusFlags);
INCLUDE_ASM(code_16c8e0, RemovePlayerBuffs);
INCLUDE_API_ASM(code_16c8e0, RemovePlayerBuffs);
INCLUDE_ASM(code_16c8e0, SetPartAlpha);
INCLUDE_API_ASM(code_16c8e0, SetPartAlpha);
INCLUDE_ASM(code_16c8e0, CreatePartShadow);
INCLUDE_API_ASM(code_16c8e0, CreatePartShadow);
INCLUDE_ASM(code_16c8e0, RemovePartShadow);
INCLUDE_API_ASM(code_16c8e0, RemovePartShadow);
INCLUDE_ASM(code_16c8e0, SetBattleVar);
INCLUDE_API_ASM(code_16c8e0, SetBattleVar);
INCLUDE_ASM(code_16c8e0, GetBattleVar);
INCLUDE_API_ASM(code_16c8e0, GetBattleVar);
INCLUDE_ASM(code_16c8e0, ResetAllActorSounds);
INCLUDE_API_ASM(code_16c8e0, ResetAllActorSounds);
INCLUDE_ASM(code_16c8e0, SetActorSounds);
INCLUDE_API_ASM(code_16c8e0, SetActorSounds);
INCLUDE_ASM(code_16c8e0, ResetActorSounds);
INCLUDE_API_ASM(code_16c8e0, ResetActorSounds);
INCLUDE_ASM(code_16c8e0, SetPartSounds);
INCLUDE_API_ASM(code_16c8e0, SetPartSounds);
INCLUDE_ASM(code_16c8e0, SetActorType);
INCLUDE_API_ASM(code_16c8e0, SetActorType);
INCLUDE_ASM(code_16c8e0, ShowShockEffect);
INCLUDE_API_ASM(code_16c8e0, ShowShockEffect);
INCLUDE_ASM(code_16c8e0, GetActorAttackBoost);
INCLUDE_API_ASM(code_16c8e0, GetActorAttackBoost);
INCLUDE_ASM(code_16c8e0, GetActorDefenseBoost);
INCLUDE_API_ASM(code_16c8e0, GetActorDefenseBoost);
INCLUDE_ASM(code_16c8e0, BoostAttack);
INCLUDE_API_ASM(code_16c8e0, BoostAttack);
INCLUDE_ASM(code_16c8e0, BoostDefense);
INCLUDE_API_ASM(code_16c8e0, BoostDefense);
INCLUDE_ASM(code_16c8e0, VanishActor);
INCLUDE_API_ASM(code_16c8e0, VanishActor);
INCLUDE_ASM(code_16c8e0, ElectrifyActor);
INCLUDE_API_ASM(code_16c8e0, ElectrifyActor);
INCLUDE_ASM(code_16c8e0, HealActor);
INCLUDE_API_ASM(code_16c8e0, HealActor);
INCLUDE_ASM(code_16c8e0, WaitForBuffDone);
INCLUDE_API_ASM(code_16c8e0, WaitForBuffDone);
INCLUDE_ASM(code_16c8e0, CopyBuffs);
INCLUDE_API_ASM(code_16c8e0, CopyBuffs);
INCLUDE_ASM(code_16c8e0, dispatch_event_player);
@ -918,29 +918,29 @@ INCLUDE_ASM(code_16c8e0, dispatch_damage_event_player_0);
INCLUDE_ASM(code_16c8e0, dispatch_damage_event_player_1);
INCLUDE_ASM(code_16c8e0, GetMenuSelection);
INCLUDE_API_ASM(code_16c8e0, GetMenuSelection);
INCLUDE_ASM(code_16c8e0, PlayerFallToGoal);
INCLUDE_API_ASM(code_16c8e0, PlayerFallToGoal);
INCLUDE_ASM(code_16c8e0, PlayerLandJump);
INCLUDE_API_ASM(code_16c8e0, PlayerLandJump);
INCLUDE_ASM(code_16c8e0, PlayerRunToGoal);
INCLUDE_API_ASM(code_16c8e0, PlayerRunToGoal);
INCLUDE_ASM(code_16c8e0, CancelablePlayerRunToGoal);
INCLUDE_API_ASM(code_16c8e0, CancelablePlayerRunToGoal);
INCLUDE_ASM(code_16c8e0, GetPlayerHP);
INCLUDE_API_ASM(code_16c8e0, GetPlayerHP);
INCLUDE_ASM(code_16c8e0, PlayerDamageEnemy);
INCLUDE_API_ASM(code_16c8e0, PlayerDamageEnemy);
INCLUDE_ASM(code_16c8e0, PlayerPowerBounceEnemy);
INCLUDE_API_ASM(code_16c8e0, PlayerPowerBounceEnemy);
INCLUDE_ASM(code_16c8e0, PlayerTestEnemy);
INCLUDE_API_ASM(code_16c8e0, PlayerTestEnemy);
INCLUDE_ASM(code_16c8e0, DispatchDamagePlayerEvent);
INCLUDE_API_ASM(code_16c8e0, DispatchDamagePlayerEvent);
INCLUDE_ASM(code_16c8e0, EnablePlayerBlur);
INCLUDE_API_ASM(code_16c8e0, EnablePlayerBlur);
INCLUDE_ASM(code_16c8e0, DidActionSucceed);
INCLUDE_API_ASM(code_16c8e0, DidActionSucceed);
INCLUDE_ASM(code_16c8e0, func_80276F50);
@ -960,111 +960,111 @@ INCLUDE_ASM(code_16c8e0, dispatch_damage_event_actor_0);
INCLUDE_ASM(code_16c8e0, dispatch_damage_event_actor_1);
INCLUDE_ASM(code_16c8e0, BindTakeTurn);
INCLUDE_API_ASM(code_16c8e0, BindTakeTurn);
INCLUDE_ASM(code_16c8e0, PauseTakeTurn);
INCLUDE_API_ASM(code_16c8e0, PauseTakeTurn);
INCLUDE_ASM(code_16c8e0, ResumeTakeTurn);
INCLUDE_API_ASM(code_16c8e0, ResumeTakeTurn);
INCLUDE_ASM(code_16c8e0, BindIdle);
INCLUDE_API_ASM(code_16c8e0, BindIdle);
INCLUDE_ASM(code_16c8e0, EnableIdleScript);
INCLUDE_API_ASM(code_16c8e0, EnableIdleScript);
INCLUDE_ASM(code_16c8e0, BindHandleEvent);
INCLUDE_API_ASM(code_16c8e0, BindHandleEvent);
INCLUDE_ASM(code_16c8e0, BindNextTurn);
INCLUDE_API_ASM(code_16c8e0, BindNextTurn);
INCLUDE_ASM(code_16c8e0, JumpToGoal);
INCLUDE_API_ASM(code_16c8e0, JumpToGoal);
INCLUDE_ASM(code_16c8e0, IdleJumpToGoal);
INCLUDE_API_ASM(code_16c8e0, IdleJumpToGoal);
INCLUDE_ASM(code_16c8e0, JumpToGoalSimple2);
INCLUDE_API_ASM(code_16c8e0, JumpToGoalSimple2);
INCLUDE_ASM(code_16c8e0, JumpWithBounce);
INCLUDE_API_ASM(code_16c8e0, JumpWithBounce);
INCLUDE_ASM(code_16c8e0, LandJump);
INCLUDE_API_ASM(code_16c8e0, LandJump);
INCLUDE_ASM(code_16c8e0, FallToGoal);
INCLUDE_API_ASM(code_16c8e0, FallToGoal);
INCLUDE_ASM(code_16c8e0, RunToGoal);
INCLUDE_API_ASM(code_16c8e0, RunToGoal);
INCLUDE_ASM(code_16c8e0, IdleRunToGoal);
INCLUDE_API_ASM(code_16c8e0, IdleRunToGoal);
INCLUDE_ASM(code_16c8e0, JumpPartTo);
INCLUDE_API_ASM(code_16c8e0, JumpPartTo);
INCLUDE_ASM(code_16c8e0, FallPartTo);
INCLUDE_API_ASM(code_16c8e0, FallPartTo);
INCLUDE_ASM(code_16c8e0, LandJumpPart);
INCLUDE_API_ASM(code_16c8e0, LandJumpPart);
INCLUDE_ASM(code_16c8e0, RunPartTo);
INCLUDE_API_ASM(code_16c8e0, RunPartTo);
INCLUDE_ASM(code_16c8e0, update_lerp_battle);
INCLUDE_ASM(code_16c8e0, FlyToGoal);
INCLUDE_API_ASM(code_16c8e0, FlyToGoal);
INCLUDE_ASM(code_16c8e0, IdleFlyToGoal);
INCLUDE_API_ASM(code_16c8e0, IdleFlyToGoal);
INCLUDE_ASM(code_16c8e0, FlyPartTo);
INCLUDE_API_ASM(code_16c8e0, FlyPartTo);
INCLUDE_ASM(code_16c8e0, GetLastEvent);
INCLUDE_API_ASM(code_16c8e0, GetLastEvent);
INCLUDE_ASM(code_16c8e0, SetTargetActor);
INCLUDE_API_ASM(code_16c8e0, SetTargetActor);
INCLUDE_ASM(code_16c8e0, SetEnemyHP);
INCLUDE_API_ASM(code_16c8e0, SetEnemyHP);
INCLUDE_ASM(code_16c8e0, GetActorHP);
INCLUDE_API_ASM(code_16c8e0, GetActorHP);
INCLUDE_ASM(code_16c8e0, GetEnemyMaxHP);
INCLUDE_API_ASM(code_16c8e0, GetEnemyMaxHP);
INCLUDE_ASM(code_16c8e0, RemoveActor);
INCLUDE_API_ASM(code_16c8e0, RemoveActor);
INCLUDE_ASM(code_16c8e0, DropStarPoints);
INCLUDE_API_ASM(code_16c8e0, DropStarPoints);
INCLUDE_ASM(code_16c8e0, SetDefenseTable);
INCLUDE_API_ASM(code_16c8e0, SetDefenseTable);
INCLUDE_ASM(code_16c8e0, SetStatusTable);
INCLUDE_API_ASM(code_16c8e0, SetStatusTable);
INCLUDE_ASM(code_16c8e0, SetIdleAnimations);
INCLUDE_API_ASM(code_16c8e0, SetIdleAnimations);
INCLUDE_ASM(code_16c8e0, EnemyDamageTarget);
INCLUDE_API_ASM(code_16c8e0, EnemyDamageTarget);
INCLUDE_ASM(code_16c8e0, EnemyFollowupAfflictTarget);
INCLUDE_API_ASM(code_16c8e0, EnemyFollowupAfflictTarget);
INCLUDE_ASM(code_16c8e0, EnemyTestTarget);
INCLUDE_API_ASM(code_16c8e0, EnemyTestTarget);
INCLUDE_ASM(code_16c8e0, DispatchDamageEvent);
INCLUDE_API_ASM(code_16c8e0, DispatchDamageEvent);
INCLUDE_ASM(code_16c8e0, DispatchEvent);
INCLUDE_API_ASM(code_16c8e0, DispatchEvent);
INCLUDE_ASM(code_16c8e0, SetTargetOffset);
INCLUDE_API_ASM(code_16c8e0, SetTargetOffset);
INCLUDE_ASM(code_16c8e0, EnableActorBlur);
INCLUDE_API_ASM(code_16c8e0, EnableActorBlur);
INCLUDE_ASM(code_16c8e0, AfflictActor);
INCLUDE_API_ASM(code_16c8e0, AfflictActor);
INCLUDE_ASM(code_16c8e0, GetEncounterState);
INCLUDE_API_ASM(code_16c8e0, GetEncounterState);
INCLUDE_ASM(code_16c8e0, YieldTurn);
INCLUDE_API_ASM(code_16c8e0, YieldTurn);
INCLUDE_ASM(code_16c8e0, SetActorSize);
INCLUDE_API_ASM(code_16c8e0, SetActorSize);
INCLUDE_ASM(code_16c8e0, GetActorSize);
INCLUDE_API_ASM(code_16c8e0, GetActorSize);
INCLUDE_ASM(code_16c8e0, SetPartSize);
INCLUDE_API_ASM(code_16c8e0, SetPartSize);
INCLUDE_ASM(code_16c8e0, GetOriginalActorType);
INCLUDE_API_ASM(code_16c8e0, GetOriginalActorType);
INCLUDE_ASM(code_16c8e0, GetCurrentActorType);
INCLUDE_API_ASM(code_16c8e0, GetCurrentActorType);
INCLUDE_ASM(code_16c8e0, GetLastDamage);
INCLUDE_API_ASM(code_16c8e0, GetLastDamage);
INCLUDE_ASM(code_16c8e0, EnableActorGlow);
INCLUDE_API_ASM(code_16c8e0, EnableActorGlow);
INCLUDE_ASM(code_16c8e0, WasStatusInflicted);
INCLUDE_API_ASM(code_16c8e0, WasStatusInflicted);
INCLUDE_ASM(code_16c8e0, CopyStatusEffects);
INCLUDE_API_ASM(code_16c8e0, CopyStatusEffects);
INCLUDE_ASM(code_16c8e0, ClearStatusEffects);
INCLUDE_API_ASM(code_16c8e0, ClearStatusEffects);
INCLUDE_ASM(code_16c8e0, dispatch_event_partner);
@ -1080,22 +1080,22 @@ INCLUDE_ASM(code_16c8e0, dispatch_damage_event_partner_0);
INCLUDE_ASM(code_16c8e0, dispatch_damage_event_partner_1);
INCLUDE_ASM(code_16c8e0, MakeOwnerTargetIndex);
INCLUDE_API_ASM(code_16c8e0, MakeOwnerTargetIndex);
INCLUDE_ASM(code_16c8e0, GetActorLevel);
INCLUDE_API_ASM(code_16c8e0, GetActorLevel);
INCLUDE_ASM(code_16c8e0, PartnerDamageEnemy);
INCLUDE_API_ASM(code_16c8e0, PartnerDamageEnemy);
INCLUDE_ASM(code_16c8e0, PartnerAfflictEnemy);
INCLUDE_API_ASM(code_16c8e0, PartnerAfflictEnemy);
INCLUDE_ASM(code_16c8e0, PartnerPowerBounceEnemy);
INCLUDE_API_ASM(code_16c8e0, PartnerPowerBounceEnemy);
INCLUDE_ASM(code_16c8e0, PartnerTestEnemy);
INCLUDE_API_ASM(code_16c8e0, PartnerTestEnemy);
INCLUDE_ASM(code_16c8e0, DeletePartner);
INCLUDE_API_ASM(code_16c8e0, DeletePartner);
INCLUDE_ASM(code_16c8e0, GetDamageIntensity);
INCLUDE_API_ASM(code_16c8e0, GetDamageIntensity);
INCLUDE_ASM(code_16c8e0, ActorAddMovePos);
INCLUDE_API_ASM(code_16c8e0, ActorAddMovePos);
INCLUDE_ASM(code_16c8e0, LoadStarPowerScript);
INCLUDE_API_ASM(code_16c8e0, LoadStarPowerScript);

View File

@ -4,13 +4,13 @@ INCLUDE_ASM(code_1a1f0_len_5390, get_defeated);
INCLUDE_ASM(code_1a1f0_len_5390, set_defeated);
INCLUDE_ASM(code_1a1f0_len_5390, GetCamLookAtObjVector);
INCLUDE_API_ASM(code_1a1f0_len_5390, GetCamLookAtObjVector);
INCLUDE_ASM(code_1a1f0_len_5390, HasMerleeCasts);
INCLUDE_API_ASM(code_1a1f0_len_5390, HasMerleeCasts);
INCLUDE_ASM(code_1a1f0_len_5390, OnDefeatEnemy);
INCLUDE_API_ASM(code_1a1f0_len_5390, OnDefeatEnemy);
INCLUDE_ASM(code_1a1f0_len_5390, OnFleeBattleDrops);
INCLUDE_API_ASM(code_1a1f0_len_5390, OnFleeBattleDrops);
INCLUDE_ASM(code_1a1f0_len_5390, func_8003F7CC);

View File

@ -1,94 +1,94 @@
#include "common.h"
INCLUDE_ASM(code_1f580_len_1940, SetEncounterStatusFlags);
INCLUDE_API_ASM(code_1f580_len_1940, SetEncounterStatusFlags);
s32 LoadDemoBattle(script_context* script) {
ApiStatus LoadDemoBattle(ScriptInstance* script, s32 isInitialCall) {
load_demo_battle(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
// ???
s32 func_80044290(script_context* script) {
return 2;
ApiStatus func_80044290(ScriptInstance* script, s32 isInitialCall) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_1f580_len_1940, MakeNpcs);
INCLUDE_API_ASM(code_1f580_len_1940, MakeNpcs);
INCLUDE_ASM(code_1f580_len_1940, RemoveNpc);
INCLUDE_API_ASM(code_1f580_len_1940, RemoveNpc);
INCLUDE_ASM(code_1f580_len_1940, RemoveEncounter);
INCLUDE_API_ASM(code_1f580_len_1940, RemoveEncounter);
INCLUDE_ASM(code_1f580_len_1940, GetBattleOutcome);
INCLUDE_API_ASM(code_1f580_len_1940, GetBattleOutcome);
s32 GetOwnerEncountered(script_context* script) {
ApiStatus GetOwnerEncountered(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, script->ownerActorID->encountered);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_1f580_len_1940, DoNpcDefeat);
INCLUDE_API_ASM(code_1f580_len_1940, DoNpcDefeat);
INCLUDE_ASM(code_1f580_len_1940, start_battle);
s32 StartBattle(script_context* script) {
ApiStatus StartBattle(ScriptInstance* script, s32 isInitialCall) {
start_battle(script, -1);
return 1;
return ApiStatus_DONE1;
}
s32 StartBattleWith(script_context* script) {
ApiStatus StartBattleWith(ScriptInstance* script, s32 isInitialCall) {
start_battle(script, get_variable(script, *script->ptrReadPos));
return 1;
return ApiStatus_DONE1;
}
INCLUDE_ASM(code_1f580_len_1940, StartBossBattle);
INCLUDE_API_ASM(code_1f580_len_1940, StartBossBattle);
INCLUDE_ASM(code_1f580_len_1940, SetBattleMusic);
INCLUDE_API_ASM(code_1f580_len_1940, SetBattleMusic);
INCLUDE_ASM(code_1f580_len_1940, BindNpcAI);
INCLUDE_API_ASM(code_1f580_len_1940, BindNpcAI);
INCLUDE_ASM(code_1f580_len_1940, BindNpcIdle);
INCLUDE_API_ASM(code_1f580_len_1940, BindNpcIdle);
INCLUDE_ASM(code_1f580_len_1940, RestartNpcAI);
INCLUDE_API_ASM(code_1f580_len_1940, RestartNpcAI);
INCLUDE_ASM(code_1f580_len_1940, EnableNpcAI);
INCLUDE_API_ASM(code_1f580_len_1940, EnableNpcAI);
INCLUDE_ASM(code_1f580_len_1940, SetNpcAux);
INCLUDE_API_ASM(code_1f580_len_1940, SetNpcAux);
INCLUDE_ASM(code_1f580_len_1940, BindNpcAux);
INCLUDE_API_ASM(code_1f580_len_1940, BindNpcAux);
INCLUDE_ASM(code_1f580_len_1940, RestartNpcAux);
INCLUDE_API_ASM(code_1f580_len_1940, RestartNpcAux);
INCLUDE_ASM(code_1f580_len_1940, EnableNpcAux);
INCLUDE_API_ASM(code_1f580_len_1940, EnableNpcAux);
INCLUDE_ASM(code_1f580_len_1940, BindNpcInteract);
INCLUDE_API_ASM(code_1f580_len_1940, BindNpcInteract);
INCLUDE_ASM(code_1f580_len_1940, BindNpcHit);
INCLUDE_API_ASM(code_1f580_len_1940, BindNpcHit);
INCLUDE_ASM(code_1f580_len_1940, BindNpcDefeat);
INCLUDE_API_ASM(code_1f580_len_1940, BindNpcDefeat);
INCLUDE_ASM(code_1f580_len_1940, SetSelfVar);
INCLUDE_API_ASM(code_1f580_len_1940, SetSelfVar);
INCLUDE_ASM(code_1f580_len_1940, GetSelfVar);
INCLUDE_API_ASM(code_1f580_len_1940, GetSelfVar);
INCLUDE_ASM(code_1f580_len_1940, SetNpcVar);
INCLUDE_API_ASM(code_1f580_len_1940, SetNpcVar);
INCLUDE_ASM(code_1f580_len_1940, GetNpcVar);
INCLUDE_API_ASM(code_1f580_len_1940, GetNpcVar);
INCLUDE_ASM(code_1f580_len_1940, SetSelfRotation);
INCLUDE_API_ASM(code_1f580_len_1940, SetSelfRotation);
s32 SetSelfEnemyFlags(script_context* script) {
ApiStatus SetSelfEnemyFlags(ScriptInstance* script, s32 isInitialCall) {
script->ownerActorID->flags = *script->ptrReadPos;
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_1f580_len_1940, SetSelfEnemyFlagBits);
INCLUDE_API_ASM(code_1f580_len_1940, SetSelfEnemyFlagBits);
s32 GetSelfNpcID(script_context* script) {
ApiStatus GetSelfNpcID(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, script->ownerActorID->npcID);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_1f580_len_1940, ClearDefeatedEnemies);
INCLUDE_API_ASM(code_1f580_len_1940, ClearDefeatedEnemies);
INCLUDE_ASM(code_1f580_len_1940, SetEnemyFlagBits);
INCLUDE_API_ASM(code_1f580_len_1940, SetEnemyFlagBits);
INCLUDE_ASM(code_1f580_len_1940, GetSelfAnimationFromTable);
INCLUDE_API_ASM(code_1f580_len_1940, GetSelfAnimationFromTable);

View File

@ -112,7 +112,7 @@ INCLUDE_ASM(code_20ec0_len_5040, func_8004A124);
INCLUDE_ASM(code_20ec0_len_5040, func_8004A3E8);
INCLUDE_ASM(code_20ec0_len_5040, DoBasicAI);
INCLUDE_API_ASM(code_20ec0_len_5040, DoBasicAI);
INCLUDE_ASM(code_20ec0_len_5040, func_8004A73C);

View File

@ -2,12 +2,12 @@
INCLUDE_ASM(code_25f00_len_940, func_8004AB00);
INCLUDE_ASM(code_25f00_len_940, nuAuDmaCallBack);
INCLUDE_API_ASM(code_25f00_len_940, nuAuDmaCallBack);
INCLUDE_ASM(code_25f00_len_940, nuAuDmaNew);
INCLUDE_API_ASM(code_25f00_len_940, nuAuDmaNew);
INCLUDE_ASM(code_25f00_len_940, nuAuCleanDMABuffers);
INCLUDE_API_ASM(code_25f00_len_940, nuAuCleanDMABuffers);
INCLUDE_ASM(code_25f00_len_940, alRename1);
INCLUDE_API_ASM(code_25f00_len_940, alRename1);
INCLUDE_ASM(code_25f00_len_940, alRename2);
INCLUDE_API_ASM(code_25f00_len_940, alRename2);

View File

@ -92,7 +92,7 @@ INCLUDE_ASM(code_303c0_len_3e10, func_80056228);
INCLUDE_ASM(code_303c0_len_3e10, func_80056250);
INCLUDE_ASM(code_303c0_len_3e10, alRename4);
INCLUDE_API_ASM(code_303c0_len_3e10, alRename4);
INCLUDE_ASM(code_303c0_len_3e10, func_80056D34);
@ -136,7 +136,7 @@ INCLUDE_ASM(code_303c0_len_3e10, func_80057ED0);
INCLUDE_ASM(code_303c0_len_3e10, func_80057F20);
INCLUDE_ASM(code_303c0_len_3e10, alRename3);
INCLUDE_API_ASM(code_303c0_len_3e10, alRename3);
INCLUDE_ASM(code_303c0_len_3e10, func_80057FD8);

View File

@ -8,7 +8,7 @@ INCLUDE_ASM(code_42e0_len_1f60, func_80028F8C);
INCLUDE_ASM(code_42e0_len_1f60, func_80028FE0);
INCLUDE_ASM(code_42e0_len_1f60, length2D);
INCLUDE_API_ASM(code_42e0_len_1f60, length2D);
INCLUDE_ASM(code_42e0_len_1f60, _heap_create);
@ -20,9 +20,9 @@ INCLUDE_ASM(code_42e0_len_1f60, _heap_free);
INCLUDE_ASM(code_42e0_len_1f60, _heap_realloc);
INCLUDE_ASM(code_42e0_len_1f60, cosine);
INCLUDE_API_ASM(code_42e0_len_1f60, cosine);
INCLUDE_ASM(code_42e0_len_1f60, sign);
INCLUDE_API_ASM(code_42e0_len_1f60, sign);
INCLUDE_ASM(code_42e0_len_1f60, int_to_string);
@ -44,9 +44,9 @@ INCLUDE_ASM(code_42e0_len_1f60, func_80029994);
s32 INCLUDE_ASM(code_42e0_len_1f60, rand_int, s32 arg0);
INCLUDE_ASM(code_42e0_len_1f60, signF);
INCLUDE_API_ASM(code_42e0_len_1f60, signF);
INCLUDE_ASM(code_42e0_len_1f60, round);
INCLUDE_API_ASM(code_42e0_len_1f60, round);
f32 INCLUDE_ASM(code_42e0_len_1f60, clamp_angle, f32 theta);
@ -78,7 +78,7 @@ f32 INCLUDE_ASM(code_42e0_len_1f60, sin_deg, f32 x);
f32 INCLUDE_ASM(code_42e0_len_1f60, cos_deg, f32 x);
f32 INCLUDE_ASM(code_42e0_len_1f60, update_lerp, EASING easing, f32 start, f32 end, s32 elapsed, s32 duration);
f32 INCLUDE_ASM(code_42e0_len_1f60, update_lerp, Easing easing, f32 start, f32 end, s32 elapsed, s32 duration);
INCLUDE_ASM(code_42e0_len_1f60, func_8002A904);

View File

@ -2,4 +2,4 @@
INCLUDE_ASM(code_7E2AA0, func_80281C20);
INCLUDE_ASM(code_7E2AA0, MakeDoorAdvanced);
INCLUDE_API_ASM(code_7E2AA0, MakeDoorAdvanced);

View File

@ -2,14 +2,14 @@
INCLUDE_ASM(code_7E3700, func_80282880);
INCLUDE_ASM(code_7E3700, CheckActionState);
INCLUDE_API_ASM(code_7E3700, CheckActionState);
INCLUDE_ASM(code_7E3700, CreatePushBlockGrid);
INCLUDE_API_ASM(code_7E3700, CreatePushBlockGrid);
INCLUDE_ASM(code_7E3700, SetPushBlock);
INCLUDE_API_ASM(code_7E3700, SetPushBlock);
INCLUDE_ASM(code_7E3700, GetPushBlock);
INCLUDE_API_ASM(code_7E3700, GetPushBlock);
INCLUDE_ASM(code_7E3700, GetGridIndexFromPos);
INCLUDE_API_ASM(code_7E3700, GetGridIndexFromPos);
INCLUDE_ASM(code_7E3700, SetPushBlockFallEffect);
INCLUDE_API_ASM(code_7E3700, SetPushBlockFallEffect);

View File

@ -18,40 +18,40 @@ INCLUDE_ASM(code_7e0e80, func_80280AC4);
INCLUDE_ASM(code_7e0e80, func_80280B44);
INCLUDE_ASM(code_7e0e80, BtlBringPartnerOut);
INCLUDE_API_ASM(code_7e0e80, BtlBringPartnerOut);
INCLUDE_ASM(code_7e0e80, func_80280B78);
INCLUDE_ASM(code_7e0e80, CamPreset_B);
INCLUDE_API_ASM(code_7e0e80, CamPreset_B);
INCLUDE_ASM(code_7e0e80, CamPreset_F);
INCLUDE_API_ASM(code_7e0e80, CamPreset_F);
INCLUDE_ASM(code_7e0e80, CamPreset_M);
INCLUDE_API_ASM(code_7e0e80, CamPreset_M);
INCLUDE_ASM(code_7e0e80, CamPreset_G);
INCLUDE_API_ASM(code_7e0e80, CamPreset_G);
INCLUDE_ASM(code_7e0e80, CamPreset_I);
INCLUDE_API_ASM(code_7e0e80, CamPreset_I);
INCLUDE_ASM(code_7e0e80, CamPreset_H);
INCLUDE_API_ASM(code_7e0e80, CamPreset_H);
INCLUDE_ASM(code_7e0e80, CamPreset_N);
INCLUDE_API_ASM(code_7e0e80, CamPreset_N);
INCLUDE_ASM(code_7e0e80, CamPreset_C);
INCLUDE_API_ASM(code_7e0e80, CamPreset_C);
INCLUDE_ASM(code_7e0e80, CamPreset_D);
INCLUDE_API_ASM(code_7e0e80, CamPreset_D);
INCLUDE_ASM(code_7e0e80, CamPreset_E);
INCLUDE_API_ASM(code_7e0e80, CamPreset_E);
INCLUDE_ASM(code_7e0e80, CamPreset_J);
INCLUDE_API_ASM(code_7e0e80, CamPreset_J);
INCLUDE_ASM(code_7e0e80, CamPreset_K);
INCLUDE_API_ASM(code_7e0e80, CamPreset_K);
INCLUDE_ASM(code_7e0e80, CamPreset_L);
INCLUDE_API_ASM(code_7e0e80, CamPreset_L);
INCLUDE_ASM(code_7e0e80, CamPreset_A);
INCLUDE_API_ASM(code_7e0e80, CamPreset_A);
INCLUDE_ASM(code_7e0e80, draw_shop_items);
INCLUDE_ASM(code_7e0e80, MakeShop);
INCLUDE_API_ASM(code_7e0e80, MakeShop);
INCLUDE_ASM(code_7e0e80, MakeShopOwner);
INCLUDE_API_ASM(code_7e0e80, MakeShopOwner);

View File

@ -1,7 +1,7 @@
#include "common.h"
void clear_player_data(void) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i;
D_8010CD10 = 0;
@ -95,12 +95,12 @@ void clear_player_data(void) {
playerData->smashGameRecord = 0;
}
player_data* get_player_data(void) {
PlayerData* get_player_data(void) {
return &gPlayerData;
}
s32 add_item(s32 itemID) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i;
sort_items();
@ -120,7 +120,7 @@ s32 add_item(s32 itemID) {
}
s32 get_item_count(void) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i = 0;
s32 sum = 0;
@ -138,8 +138,8 @@ s32 get_item_empty_count(void) {
}
s32 find_item(s32 itemID) {
player_data* playerData = &gPlayerData;
item_table_entry* item = &gItemTable[itemID];
PlayerData* playerData = &gPlayerData;
StaticItem* item = &gItemTable[itemID];
s32 i;
if ((item->typeFlags & 8) != 0) {
@ -170,7 +170,7 @@ s32 find_item(s32 itemID) {
}
void sort_items(void) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
int j;
int i;
@ -189,8 +189,8 @@ void sort_items(void) {
}
s32 add_badge(s32 itemID) {
player_data* playerData = &gPlayerData;
item_table_entry* item = &gItemTable[itemID];
PlayerData* playerData = &gPlayerData;
StaticItem* item = &gItemTable[itemID];
s32 i;
if ((item->typeFlags & 0x40) == 0) {
@ -212,7 +212,7 @@ s32 add_badge(s32 itemID) {
}
s32 store_item(s32 itemID) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i;
for (i = 0; i < ARRAY_COUNT(gPlayerData.storedItems); i++) {
@ -231,7 +231,7 @@ s32 store_item(s32 itemID) {
}
s32 get_stored_count(void) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i = 0;
s32 sum = 0;
@ -249,8 +249,8 @@ s32 get_stored_empty_count(void) {
}
void enforce_hpfp_limits(void) {
player_data* playerData = &gPlayerData;
player_data* playerData2 = &gPlayerData;
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
playerData->curMaxHP = playerData->hardMaxHP + (is_ability_active(4) * 5);
if (playerData->curMaxHP > 75) {
@ -278,7 +278,7 @@ INCLUDE_ASM(code_80850_len_3060, status_menu_draw_stat);
INCLUDE_ASM(code_80850_len_3060, update_status_menu);
void coin_counter_draw_content(UNK_TYPE arg0, s32 posX, s32 posY) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
s32 iconIndex;
if ((gPlayerData.coins != uiStatus->displayCoins) && (((*gGameStatusPtr)->frameCounter % 3) == 0)) {
@ -297,8 +297,8 @@ void coin_counter_draw_content(UNK_TYPE arg0, s32 posX, s32 posY) {
}
void update_coin_counter(void) {
ui_status* uiStatus = &gUIStatus;
player_data* playerData = &gPlayerData;
UiStatus* uiStatus = &gUIStatus;
PlayerData* playerData = &gPlayerData;
do {} while(0); // Needed to match
@ -337,7 +337,7 @@ void update_coin_counter(void) {
}
void show_coin_counter(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
s16* coinCounterUnk = &D_8010CD10;
s32 index;
@ -378,7 +378,7 @@ void show_coin_counter(void) {
}
void hide_coin_counter(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) {
uiStatus->unk_6C[0] = 60;
@ -386,20 +386,21 @@ void hide_coin_counter(void) {
}
void func_800E96C8(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) {
uiStatus->unk_6C[0]= 1;
}
}
s32 ShowCoinCounter(script_context* script) {
ApiStatus ShowCoinCounter(ScriptInstance* script, s32 isInitialCall) {
if (get_variable(script, *script->ptrReadPos)) {
show_coin_counter();
} else {
hide_coin_counter();
}
return 2;
return ApiStatus_DONE2;
}
void func_800E973C(void) {
@ -408,7 +409,7 @@ void func_800E973C(void) {
}
void open_status_menu_long(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->hidden) {
uiStatus->showTimer = 210;
@ -418,7 +419,7 @@ void open_status_menu_long(void) {
}
void open_status_menu_short(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->hidden) {
uiStatus->showTimer = 105;
@ -428,7 +429,7 @@ void open_status_menu_short(void) {
}
void func_800E97B8(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->hidden != 1) {
uiStatus->hidden = 1;
@ -438,7 +439,7 @@ void func_800E97B8(void) {
}
void func_800E97E4(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
uiStatus->drawPosY = -100;
uiStatus->ignoreChanges = 0;
@ -449,7 +450,7 @@ void func_800E97E4(void) {
}
void func_800E9810(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
uiStatus->showTimer = 210;
uiStatus->drawPosY = 0;
@ -468,8 +469,8 @@ void func_800E984C(void) {
}
s32 func_800E9860(void) {
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
s32 ret = 1 - uiStatus->unk_45[0];
if (uiStatus->unk_45[1] != 0) {
@ -486,7 +487,7 @@ void status_menu_enable_ignore_changes(void) {
}
void func_800E98A8(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
uiStatus->ignoreChanges = 1;
uiStatus->drawPosY = 18;
@ -497,7 +498,7 @@ void status_menu_disable_ignore_changes(void) {
}
s32 func_800E98D4(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
return uiStatus->unk_45[1] + uiStatus->ignoreChanges;
}
@ -515,9 +516,9 @@ s32 is_status_menu_visible(void) {
}
void status_menu_start_blinking_hp(void) {
game_status* gameStatus = (*gGameStatusPtr);
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
GameStatus* gameStatus = (*gGameStatusPtr);
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
if (gameStatus->isBattle == 0) {
uiStatus->hpBlinkTimer = 120;
@ -530,7 +531,7 @@ void status_menu_start_blinking_hp(void) {
}
void status_menu_stop_blinking_hp(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->hpBlinking != 0) {
uiStatus->hpBlinking = 0;
@ -540,9 +541,9 @@ void status_menu_stop_blinking_hp(void) {
}
void status_menu_start_blinking_fp(void) {
game_status* gameStatus = (*gGameStatusPtr);
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
GameStatus* gameStatus = (*gGameStatusPtr);
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
if (gameStatus->isBattle == 0) {
uiStatus->fpBlinkTimer = 120;
@ -555,7 +556,7 @@ void status_menu_start_blinking_fp(void) {
}
void status_menu_stop_blinking_fp(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->fpBlinking != 0) {
uiStatus->fpBlinking = 0;
@ -564,9 +565,9 @@ void status_menu_stop_blinking_fp(void) {
}
void status_menu_start_blinking_coins(void) {
game_status* gameStatus = (*gGameStatusPtr);
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
GameStatus* gameStatus = (*gGameStatusPtr);
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
if (gameStatus->isBattle == 0) {
uiStatus->coinsBlinkTimer = 120;
@ -579,7 +580,7 @@ void status_menu_start_blinking_coins(void) {
}
void status_menu_stop_blinking_coins(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->coinsBlinking != 0) {
uiStatus->coinsBlinking = 0;
@ -589,8 +590,8 @@ void status_menu_stop_blinking_coins(void) {
}
void status_menu_start_blinking_sp(void) {
player_data* playerData = &gPlayerData;
ui_status* uiStatus = &gUIStatus;
PlayerData* playerData = &gPlayerData;
UiStatus* uiStatus = &gUIStatus;
uiStatus->spBarsToBlink = playerData->maxStarPower;
if (uiStatus->spBlinking != 1) {
@ -600,7 +601,7 @@ void status_menu_start_blinking_sp(void) {
}
void status_menu_stop_blinking_sp(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->spBlinking != 0) {
uiStatus->spBlinking = 0;
@ -609,7 +610,7 @@ void status_menu_stop_blinking_sp(void) {
}
void status_menu_start_blinking_sp_bars(s8 numBarsToBlink) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
uiStatus->spBarsToBlink = numBarsToBlink;
if (uiStatus->spBlinking != 1) {
@ -619,7 +620,7 @@ void status_menu_start_blinking_sp_bars(s8 numBarsToBlink) {
}
void status_menu_start_blinking_starpoints(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->starpointsBlinking != 1) {
uiStatus->starpointsBlinking = 1;
@ -628,7 +629,7 @@ void status_menu_start_blinking_starpoints(void) {
}
void status_menu_stop_blinking_starpoints(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->starpointsBlinking != 0) {
uiStatus->starpointsBlinking = 0;
@ -637,7 +638,7 @@ void status_menu_stop_blinking_starpoints(void) {
}
void decrement_status_menu_disabled(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
if (uiStatus->disabled > 0) {
uiStatus->disabled--;
@ -645,14 +646,14 @@ void decrement_status_menu_disabled(void) {
}
void increment_status_menu_disabled(void) {
ui_status* uiStatus = &gUIStatus;
UiStatus* uiStatus = &gUIStatus;
uiStatus->disabled++;
}
void sync_status_menu(void) {
player_data* playerData = &gPlayerData;
ui_status* uiStatus = &gUIStatus;
PlayerData* playerData = &gPlayerData;
UiStatus* uiStatus = &gUIStatus;
uiStatus->displayHP = playerData->curHP;
uiStatus->displayFP = playerData->curFP;
@ -662,8 +663,8 @@ void sync_status_menu(void) {
}
void reset_status_menu(void) {
player_data* playerData = &gPlayerData;
ui_status* uiStatus = &gUIStatus;
PlayerData* playerData = &gPlayerData;
UiStatus* uiStatus = &gUIStatus;
s32 i;
uiStatus->drawPosX = 12;
@ -703,7 +704,7 @@ void reset_status_menu(void) {
for (i = 0; i < 2; i++) {
func_801452B4(uiStatus->fpIconIndexes[i], uiStatus->fpIconIndexes[i]);
}
func_801452B4(uiStatus->coinIconIndex, uiStatus->coinIconIndex);
func_801452B4(uiStatus->coinIconIndex2, uiStatus->coinIconIndex2);
func_801452B4(uiStatus->starpointsIconIndex, uiStatus->starpointsIconIndex);
@ -971,7 +972,7 @@ s32 is_partner_ability_active(void) {
}
s16 add_coins(s32 amt) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s16 newCoins = playerData->coins + amt;
playerData->coins = newCoins;
@ -992,8 +993,8 @@ s16 add_coins(s32 amt) {
}
s8 add_star_points(s32 amt) {
player_data* playerData = &gPlayerData;
player_data* playerData2 = &gPlayerData;
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s8 newSP = playerData->starPoints + amt;
// TODO: probably a macro!
@ -1011,8 +1012,8 @@ s8 add_star_points(s32 amt) {
}
u8 add_star_pieces(s32 amt) {
player_data* playerData = &gPlayerData;
player_data* playerData2 = &gPlayerData;
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
s32 newSP = playerData->starPieces;
newSP += amt;
@ -1032,24 +1033,24 @@ u8 add_star_pieces(s32 amt) {
}
void increment_max_SP() {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
playerData->maxStarPower++;
playerData->specialBarsFilled = playerData->maxStarPower * 256;
}
void set_max_SP(s8 newMaxSP) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
playerData->maxStarPower = newMaxSP;
playerData->specialBarsFilled = newMaxSP * 256;
}
void add_SP(s32 amt) {
player_data* playerData = &gPlayerData;
player_data* playerData2 = &gPlayerData;
ui_status* uiStatus = &gUIStatus;
ui_status* uiStatus2 = &gUIStatus;
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData;
UiStatus* uiStatus = &gUIStatus;
UiStatus* uiStatus2 = &gUIStatus;
s32 phi_v1;
s32 blah;
@ -1073,7 +1074,7 @@ void add_SP(s32 amt) {
}
s32 recover_fp(s32 amt) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 newFP = playerData->curFP;
s32 ret;
@ -1095,7 +1096,7 @@ s32 recover_fp(s32 amt) {
}
s32 recover_hp(s32 amt) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 newHP = playerData->curHP;
s32 ret;
@ -1117,7 +1118,7 @@ s32 recover_hp(s32 amt) {
}
void subtract_hp(s32 amt) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 newHP = playerData->curHP;
if (amt > 0) {
@ -1130,27 +1131,27 @@ void subtract_hp(s32 amt) {
}
s8 has_full_hp(void) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
return playerData->curMaxHP == playerData->curHP;
}
s8 has_full_fp(void) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
return playerData->curMaxFP == playerData->curFP;
}
s8 add_fortress_keys(s32 amt) {
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
playerData->fortressKeyCount += amt;
return playerData->fortressKeyCount;
}
s8 subtract_fortress_keys(s8 amt) {
player_data* playerData = &gPlayerData;
player_data* playerData2 = &gPlayerData; // required to match
PlayerData* playerData = &gPlayerData;
PlayerData* playerData2 = &gPlayerData; // required to match
playerData->fortressKeyCount -= amt;
if (playerData->fortressKeyCount < 0) {

View File

@ -1,14 +1,14 @@
#include "common.h"
INCLUDE_ASM(code_8230_len_1ae0, nuSiMgrInit);
INCLUDE_API_ASM(code_8230_len_1ae0, nuSiMgrInit);
INCLUDE_ASM(code_8230_len_1ae0, nuSiSendMesg);
INCLUDE_API_ASM(code_8230_len_1ae0, nuSiSendMesg);
INCLUDE_ASM(code_8230_len_1ae0, nuSiMgrStop);
INCLUDE_API_ASM(code_8230_len_1ae0, nuSiMgrStop);
INCLUDE_ASM(code_8230_len_1ae0, nuSiMgrRestart);
INCLUDE_API_ASM(code_8230_len_1ae0, nuSiMgrRestart);
INCLUDE_ASM(code_8230_len_1ae0, nuSiMgrThread);
INCLUDE_API_ASM(code_8230_len_1ae0, nuSiMgrThread);
INCLUDE_ASM(code_8230_len_1ae0, func_8002D160);

View File

@ -72,19 +72,19 @@ INCLUDE_ASM(code_a5dd0_len_114e0, create_entity);
INCLUDE_ASM(code_a5dd0_len_114e0, create_shadow_from_data);
INCLUDE_ASM(code_a5dd0_len_114e0, MakeEntity);
INCLUDE_API_ASM(code_a5dd0_len_114e0, MakeEntity);
INCLUDE_ASM(code_a5dd0_len_114e0, AssignScript);
INCLUDE_API_ASM(code_a5dd0_len_114e0, AssignScript);
INCLUDE_ASM(code_a5dd0_len_114e0, AssignAreaFlag);
INCLUDE_API_ASM(code_a5dd0_len_114e0, AssignAreaFlag);
INCLUDE_ASM(code_a5dd0_len_114e0, AssignBlockFlag);
INCLUDE_API_ASM(code_a5dd0_len_114e0, AssignBlockFlag);
INCLUDE_ASM(code_a5dd0_len_114e0, AssignFlag);
INCLUDE_API_ASM(code_a5dd0_len_114e0, AssignFlag);
INCLUDE_ASM(code_a5dd0_len_114e0, AssignPanelFlag);
INCLUDE_API_ASM(code_a5dd0_len_114e0, AssignPanelFlag);
INCLUDE_ASM(code_a5dd0_len_114e0, AssignCrateFlag);
INCLUDE_API_ASM(code_a5dd0_len_114e0, AssignCrateFlag);
INCLUDE_ASM(code_a5dd0_len_114e0, create_entity_shadow);

View File

@ -23,7 +23,7 @@ INCLUDE_ASM(code_dbd70_len_700, create_trigger);
INCLUDE_ASM(code_dbd70_len_700, update_triggers);
void delete_trigger(trigger* toDelete) {
void delete_trigger(Trigger* toDelete) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gCurrentTriggerListPtr); i++) {
@ -41,7 +41,7 @@ void delete_trigger(trigger* toDelete) {
INCLUDE_ASM(code_dbd70_len_700, is_trigger_bound);
//INCLUDE_ASM(code_dbd70_len_700, get_trigger_by_id);
trigger* get_trigger_by_id(s32 triggerID) {
Trigger* get_trigger_by_id(s32 triggerID) {
return (*gCurrentTriggerListPtr)[triggerID];
}
@ -55,7 +55,7 @@ INCLUDE_ASM(code_dbd70_len_700, func_80145CE8);
}
for (i = 0; i < ARRAY_COUNT(gCurrentTriggerListPtr); i++) {
if (((*gCurrentTriggerListPtr)[i] == NULL) ||
if (((*gCurrentTriggerListPtr)[i] == NULL) ||
((*gCurrentTriggerListPtr)[i]->unk_30 == 0) ||
((*gCurrentTriggerListPtr)[i]->colliderID != arg0) ||
((*gCurrentTriggerListPtr)[i]->genericFlagIndex & 0x100) == 0) {

View File

@ -23,16 +23,16 @@ void load_map_bg(char* optAssetName) {
}
void func_80145DF8(void) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
D_801595A0 = 0;
D_8014F12F = 0;
gameStatus->unk_15C = 0xB4;
gameStatus->enableBackground &= 0xF0;
}
void read_background_size(bg_header *bg) {
game_status* gameStatus = *gGameStatusPtr;
void read_background_size(BackgroundHeader *bg) {
GameStatus* gameStatus = *gGameStatusPtr;
gameStatus->backgroundMaxW = bg->width;
gameStatus->backgroundMaxH = bg->height;
@ -44,7 +44,7 @@ void read_background_size(bg_header *bg) {
}
void set_background_size(s16 startX, s16 startY, s16 sizeX, s16 sizeY) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
gameStatus->enableBackground &= ~1;
gameStatus->backgroundMaxW = startX;

View File

@ -21,7 +21,7 @@ INCLUDE_ASM(code_e79b0_len_1920, func_802C39F8);
INCLUDE_ASM(code_e79b0_len_1920, restart_script);
// TODO: Find out why things break when script->timeScale = 1 goes after the previous lines
/*
script_context* restart_script(script_context* script) {
ScriptInstance* restart_script(ScriptInstance* script) {
script->loopDepth = -1;
script->switchDepth = -1;
script->currentOpcode = 0;
@ -50,7 +50,7 @@ INCLUDE_ASM(code_e79b0_len_1920, kill_script);
void* kill_script_by_ID(s32 id) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -62,7 +62,7 @@ void* kill_script_by_ID(s32 id) {
s32 kill_all_scripts(void) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -75,7 +75,7 @@ s32 kill_all_scripts(void) {
s32 does_script_exist(s32 id) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -86,7 +86,7 @@ s32 does_script_exist(s32 id) {
return 0;
}
s32 does_script_exist_by_ref(script_context* script) {
s32 does_script_exist_by_ref(ScriptInstance* script) {
s32 i;
for(i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
@ -97,11 +97,11 @@ s32 does_script_exist_by_ref(script_context* script) {
return 0;
}
void set_script_priority(script_context* script, s8 priority) {
void set_script_priority(ScriptInstance* script, s8 priority) {
script->priority = priority;
}
void set_script_timescale(script_context* script, f32 timeScale) {
void set_script_timescale(ScriptInstance* script, f32 timeScale) {
script->timeScale = timeScale * gGlobalTimeSpace;
}
@ -122,7 +122,7 @@ f32 get_global_timespace(void) {
}
*/
void set_script_group(script_context* script, s8 groupFlags) {
void set_script_group(ScriptInstance* script, s8 groupFlags) {
script->groupFlags = groupFlags;
}
@ -130,10 +130,10 @@ INCLUDE_ASM(code_e79b0_len_1920, bind_trigger);
INCLUDE_ASM(code_e79b0_len_1920, bind_trigger_1);
void suspend_group_script(script_context* script, s32 groupFlags) {
void suspend_group_script(ScriptInstance* script, s32 groupFlags) {
int i;
script_context* scriptContextPtr;
script_context* childScript = script->childScript;
ScriptInstance* scriptContextPtr;
ScriptInstance* childScript = script->childScript;
if (childScript != NULL) {
suspend_group_script(childScript, groupFlags);
@ -151,10 +151,10 @@ void suspend_group_script(script_context* script, s32 groupFlags) {
}
}
void resume_group_script(script_context* script, s32 groupFlags) {
void resume_group_script(ScriptInstance* script, s32 groupFlags) {
int i;
script_context* scriptContextPtr;
script_context* childScript = script->childScript;
ScriptInstance* scriptContextPtr;
ScriptInstance* childScript = script->childScript;
if (childScript != NULL) {
resume_group_script(childScript, groupFlags);
@ -174,7 +174,7 @@ void resume_group_script(script_context* script, s32 groupFlags) {
s32 suspend_all_script(s32 id) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -186,7 +186,7 @@ s32 suspend_all_script(s32 id) {
s32 resume_all_script(s32 id) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -198,7 +198,7 @@ s32 resume_all_script(s32 id) {
void suspend_group_script_index(s32 id, s32 groupFlags) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -210,7 +210,7 @@ void suspend_group_script_index(s32 id, s32 groupFlags) {
void resume_group_script_index(s32 id, s32 groupFlags) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -222,7 +222,7 @@ void resume_group_script_index(s32 id, s32 groupFlags) {
s32 suspend_all_group(s32 groupFlags) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -234,7 +234,7 @@ s32 suspend_all_group(s32 groupFlags) {
s32 resume_all_group(s32 groupFlags) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -247,7 +247,7 @@ s32 resume_all_group(s32 groupFlags) {
void suspend_group_others(s32 script, s32 groupFlags) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -259,7 +259,7 @@ void suspend_group_others(s32 script, s32 groupFlags) {
void resume_group_others(s32 script, s32 groupFlags) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
scriptContextPtr = (*gCurrentScriptListPtr)[i];
@ -269,13 +269,13 @@ void resume_group_others(s32 script, s32 groupFlags) {
}
}
script_context* get_script_by_index(s32 index) {
ScriptInstance* get_script_by_index(s32 index) {
return (*gCurrentScriptListPtr)[index];
}
script_context* get_script_by_id(s32 id) {
ScriptInstance* get_script_by_id(s32 id) {
s32 i;
script_context* scriptContextPtr;
ScriptInstance* scriptContextPtr;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
if ((*gCurrentScriptListPtr)[i] != NULL) {
@ -288,10 +288,10 @@ script_context* get_script_by_id(s32 id) {
return 0;
}
void set_script_flags(script_context* script, s32 flags) {
void set_script_flags(ScriptInstance* script, s32 flags) {
int i;
script_context* scriptContextPtr;
script_context* childScript = script->childScript;
ScriptInstance* scriptContextPtr;
ScriptInstance* childScript = script->childScript;
script->state |= flags;
if (childScript != NULL) {
@ -309,10 +309,10 @@ void set_script_flags(script_context* script, s32 flags) {
INCLUDE_ASM(code_e79b0_len_1920, clear_script_flags);
/*
// TODO: Really close but some weirdness is going on
void clear_script_flags(script_context* script, s32 flags) {
void clear_script_flags(ScriptInstance* script, s32 flags) {
int i;
script_context* scriptContextPtr;
script_context* childScript = script->childScript;
ScriptInstance* scriptContextPtr;
ScriptInstance* childScript = script->childScript;
script->state &= ~flags;
if (childScript != NULL) {

View File

@ -13,31 +13,31 @@ INCLUDE_ASM(code_e92d0_len_5da0, float_to_fixed_var);
return (s32)(arg0 * (f32)1024.0f) + -230000000;
}*/
s32 si_handle_return(script_context* script) {
ApiStatus si_handle_return(ScriptInstance* script) {
kill_script(script);
return 255;
return ApiStatus_FINISH;
}
s32 si_handle_label(script_context* script) {
return 2;
ApiStatus si_handle_label(ScriptInstance* script) {
return ApiStatus_DONE2;
}
s32 si_handle_goto(script_context* script) {
ApiStatus si_handle_goto(ScriptInstance* script) {
script->ptrNextLine = si_goto_label(script, get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_Loop);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_loop);
s32 si_handle_break_loop(script_context* script) {
ApiStatus si_handle_break_loop(ScriptInstance* script) {
if (script->loopDepth < 0) {
while (1) {}; // todo INF_LOOP
}
script->ptrNextLine = si_goto_end_loop(script);
script->loopDepth -= 1;
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_wait);
@ -56,7 +56,7 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_less_equal);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_greater_equal);
s32 si_handle_if_AND(script_context* script) {
ApiStatus si_handle_if_AND(ScriptInstance* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
@ -65,13 +65,13 @@ s32 si_handle_if_AND(script_context* script) {
if ((get_variable(script, var1) & *ptrReadPos) == 0) {
script->ptrNextLine = si_skip_if(script);
return 2;
return ApiStatus_DONE2;
}
return 2;
return ApiStatus_DONE2;
}
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_if_not_AND);
s32 si_handle_if_not_AND(script_context* script) {
ApiStatus si_handle_if_not_AND(ScriptInstance* script) {
s32 var1;
s32 *ptrReadPos = script->ptrReadPos;
@ -80,33 +80,33 @@ s32 si_handle_if_not_AND(script_context* script) {
if ((get_variable(script, var1) & *ptrReadPos) != 0) {
script->ptrNextLine = si_skip_if(script);
return 2;
return ApiStatus_DONE2;
}
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_else(script_context* script) {
ApiStatus si_handle_else(ScriptInstance* script) {
script->ptrNextLine = si_skip_else(script);
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_end_if(script_context* script) {
return 2;
ApiStatus si_handle_end_if(ScriptInstance* script) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_switch_const);
/*s32 si_handle_switch_const(script_context* script) {
/*ApiStatus si_handle_switch_const(ScriptInstance* script) {
s32 ptrReadPos = *script->ptrReadPos;
s8 switchDepth = script->switchDepth + 1;
if (switchDepth >= 8) {
inf_loop: goto inf_loop; //todo
}
script->switchBlockValue[script->switchDepth + 1] = ptrReadPos;
script->switchBlockState[script->switchDepth + 1] = 1;
return 2;
return ApiStatus_DONE2;
}*/
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal);
@ -133,46 +133,46 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_case_equal_AND);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end_case_group);
s32 si_handle_break_case(script_context* script) {
ApiStatus si_handle_break_case(ScriptInstance* script) {
if (script->switchDepth < 0) {
while (1) {}; //todo INF_LOOP
}
script->ptrNextLine = si_goto_end_case(script);
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_end_switch(script_context* script) {
ApiStatus si_handle_end_switch(ScriptInstance* script) {
s32 switchDepth = script->switchDepth;
if (switchDepth < 0) {
inf_loop: goto inf_loop; // todo macro? how to do without label
}
script->switchBlockState[script->switchDepth] = 0;
script->switchDepth -= 1;
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_var(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus si_handle_set_var(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, get_variable(script, ptrReadPos[1]));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_const(script_context* script) {
ApiStatus si_handle_set_const(ScriptInstance* script) {
set_variable(script, *script->ptrReadPos, script->ptrReadPos[1]);
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_float(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus si_handle_set_float(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_float_variable(script, curPtrReadPos, get_float_variable(script, ptrReadPos[1]));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_add);
@ -193,22 +193,22 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_multiplyF);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_divideF);
s32 si_handle_set_int_buffer_ptr(script_context* script) {
ApiStatus si_handle_set_int_buffer_ptr(ScriptInstance* script) {
script->buffer = get_variable(script, *script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_float_buffer_ptr(script_context* script) {
ApiStatus si_handle_set_float_buffer_ptr(ScriptInstance* script) {
script->buffer = get_variable(script, *script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_get_1_word(script_context* script) {
ApiStatus si_handle_get_1_word(ScriptInstance* script) {
s32 ptrReadPos = *script->ptrReadPos;
s32 buffer = *script->buffer++;
set_variable(script, ptrReadPos, buffer);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_2_word);
@ -217,12 +217,12 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_3_word);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_word);
s32 si_handle_get_Nth_word(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus si_handle_get_Nth_word(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 curPtrReadPos = ptrReadPos[0];
set_variable(script, curPtrReadPos, script->buffer[get_variable(script, ptrReadPos[1])]);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_1_float);
@ -235,14 +235,14 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_4_float);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_get_Nth_float);
s32 si_handle_set_array(script_context* script) {
ApiStatus si_handle_set_array(ScriptInstance* script) {
script->array = get_variable(script, *script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_flag_array(script_context* script) {
ApiStatus si_handle_set_flag_array(ScriptInstance* script) {
script->flagArray = get_variable(script, *script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_allocate_array);
@ -250,8 +250,8 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_allocate_array);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_AND_const);
s32 si_handle_AND_const(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus si_handle_AND_const(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
@ -259,14 +259,14 @@ s32 si_handle_AND_const(script_context* script) {
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 & get_variable(script, temp_s2));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR);
//INCLUDE_ASM(code_e92d0_len_5da0, si_handle_OR_const);
s32 si_handle_OR_const(script_context* script) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus si_handle_OR_const(ScriptInstance* script) {
Bytecode* ptrReadPos = script->ptrReadPos;
// todo ???
s32 temp_s0 = ptrReadPos[0];
s32 temp_s2 = ptrReadPos[0];
@ -274,7 +274,7 @@ s32 si_handle_OR_const(script_context* script) {
temp_s0 = ptrReadPos[1];
// end todo
set_variable(script, temp_s2, temp_s0 | get_variable(script, temp_s2));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_call);
@ -283,116 +283,116 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec1);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_exec2);
s32 si_handle_exec_wait(script_context* script) {
ApiStatus si_handle_exec_wait(ScriptInstance* script) {
start_child_script(script, get_variable(script, *script->ptrReadPos), 0);
script->currentOpcode = 0;
return 0xFF;
}
s32 si_handle_jump(script_context* script) {
ApiStatus si_handle_jump(ScriptInstance* script) {
script->ptrFirstLine = get_variable(script, *script->ptrReadPos);
restart_script(script);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, _bound_script_trigger_handler);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind);
s32 DeleteTrigger(script_context* script) {
ApiStatus DeleteTrigger(ScriptInstance* script, s32 isInitialCall) {
delete_trigger(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_unbind(script_context* script) {
ApiStatus si_handle_unbind(ScriptInstance* script) {
delete_trigger(script->ownerID);
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_kill(script_context* script) {
ApiStatus si_handle_kill(ScriptInstance* script) {
kill_script_by_ID(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_priority(script_context* script) {
ApiStatus si_handle_set_priority(ScriptInstance* script) {
set_script_priority(script, get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_timescale(script_context* script) {
ApiStatus si_handle_set_timescale(ScriptInstance* script) {
set_script_timescale(script, get_float_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_set_group(script_context* script) {
ApiStatus si_handle_set_group(ScriptInstance* script) {
set_script_group(script, get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_suspend_all(script_context* script) {
ApiStatus si_handle_suspend_all(ScriptInstance* script) {
suspend_all_group(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_resume_all(script_context* script) {
ApiStatus si_handle_resume_all(ScriptInstance* script) {
resume_all_group(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_suspend_others(script_context* script) {
ApiStatus si_handle_suspend_others(ScriptInstance* script) {
suspend_group_others(script, get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_resume_others(script_context* script) {
ApiStatus si_handle_resume_others(ScriptInstance* script) {
resume_group_others(script, get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_suspend(script_context* script) {
ApiStatus si_handle_suspend(ScriptInstance* script) {
suspend_all_script(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 si_handle_resume(script_context* script) {
ApiStatus si_handle_resume(ScriptInstance* script) {
resume_all_script(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_does_script_exist);
ApiStatus INCLUDE_ASM(code_e92d0_len_5da0, si_handle_does_script_exist);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind_lock);
ApiStatus INCLUDE_ASM(code_e92d0_len_5da0, si_handle_bind_lock);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_thread);
ApiStatus INCLUDE_ASM(code_e92d0_len_5da0, si_handle_thread);
s32 si_handle_end_thread(script_context* script) {
ApiStatus si_handle_end_thread(ScriptInstance* script) {
kill_script(script);
return 255;
return ApiStatus_FINISH;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_child_thread);
ApiStatus INCLUDE_ASM(code_e92d0_len_5da0, si_handle_child_thread);
s32 si_handle_end_child_thread(script_context* script) {
ApiStatus si_handle_end_child_thread(ScriptInstance* script) {
kill_script(script);
return 0;
return ApiStatus_BLOCK;
}
s32 func_802C6E14(script_context* script) {
return 2;
ApiStatus func_802C6E14(ScriptInstance* script) {
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_print_debug_var);
ApiStatus INCLUDE_ASM(code_e92d0_len_5da0, si_handle_print_debug_var);
s32 func_802C739C(script_context* script) {
ApiStatus func_802C739C(ScriptInstance* script) {
script->ptrSavedPosition = *script->ptrReadPos;
return 2;
return ApiStatus_DONE2;
}
s32 func_802C73B0(script_context* script) {
return 2;
ApiStatus func_802C73B0(ScriptInstance* script) {
return ApiStatus_DONE2;
}
s32 func_802C73B8(script_context* script) {
s32 func_802C73B8(ScriptInstance* script) {
s32 i;
for (i = 0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
@ -407,17 +407,17 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_execute_next_command);
INCLUDE_ASM(code_e92d0_len_5da0, si_handle_end);
s32 INCLUDE_ASM(code_e92d0_len_5da0, get_variable, script_context* script, bytecode var);
s32 INCLUDE_ASM(code_e92d0_len_5da0, get_variable, ScriptInstance* script, Bytecode var);
INCLUDE_ASM(code_e92d0_len_5da0, get_variable_index);
INCLUDE_ASM(code_e92d0_len_5da0, get_variable_index_alt);
s32 INCLUDE_ASM(code_e92d0_len_5da0, set_variable, script_context* script, bytecode var, s32 value);
s32 INCLUDE_ASM(code_e92d0_len_5da0, set_variable, ScriptInstance* script, Bytecode var, s32 value);
f32 INCLUDE_ASM(code_e92d0_len_5da0, get_float_variable, script_context* script, bytecode var);
f32 INCLUDE_ASM(code_e92d0_len_5da0, get_float_variable, ScriptInstance* script, Bytecode var);
f32 INCLUDE_ASM(code_e92d0_len_5da0, set_float_variable, script_context* script, bytecode var, f32 value);
f32 INCLUDE_ASM(code_e92d0_len_5da0, set_float_variable, ScriptInstance* script, Bytecode var, f32 value);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_label);
@ -431,100 +431,100 @@ INCLUDE_ASM(code_e92d0_len_5da0, si_goto_next_case);
INCLUDE_ASM(code_e92d0_len_5da0, si_goto_end_loop);
INCLUDE_ASM(code_e92d0_len_5da0, TranslateModel);
INCLUDE_API_ASM(code_e92d0_len_5da0, TranslateModel);
INCLUDE_ASM(code_e92d0_len_5da0, RotateModel);
INCLUDE_API_ASM(code_e92d0_len_5da0, RotateModel);
INCLUDE_ASM(code_e92d0_len_5da0, ScaleModel);
INCLUDE_API_ASM(code_e92d0_len_5da0, ScaleModel);
INCLUDE_ASM(code_e92d0_len_5da0, GetModelIndex);
INCLUDE_API_ASM(code_e92d0_len_5da0, GetModelIndex);
s32 CloneModel(script_context* script) {
s32* thisPos = script->ptrReadPos;
ApiStatus CloneModel(ScriptInstance* script, s32 isInitialCall) {
Bytecode* thisPos = script->ptrReadPos;
s32 srcModelID = get_variable(script, *thisPos++);
s32 newModelID = get_variable(script, *thisPos++);
clone_model(srcModelID, newModelID);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, GetModelCenter);
INCLUDE_API_ASM(code_e92d0_len_5da0, GetModelCenter);
INCLUDE_ASM(code_e92d0_len_5da0, SetTexPanner);
INCLUDE_API_ASM(code_e92d0_len_5da0, SetTexPanner);
INCLUDE_ASM(code_e92d0_len_5da0, SetModelFlag10);
INCLUDE_API_ASM(code_e92d0_len_5da0, SetModelFlag10);
INCLUDE_ASM(code_e92d0_len_5da0, EnableTexPanning);
INCLUDE_API_ASM(code_e92d0_len_5da0, EnableTexPanning);
INCLUDE_ASM(code_e92d0_len_5da0, EnableModel);
INCLUDE_API_ASM(code_e92d0_len_5da0, EnableModel);
INCLUDE_ASM(code_e92d0_len_5da0, SetGroupEnabled);
INCLUDE_API_ASM(code_e92d0_len_5da0, SetGroupEnabled);
INCLUDE_ASM(code_e92d0_len_5da0, SetTexPanOffset);
INCLUDE_API_ASM(code_e92d0_len_5da0, SetTexPanOffset);
INCLUDE_ASM(code_e92d0_len_5da0, SetModelFlags);
INCLUDE_API_ASM(code_e92d0_len_5da0, SetModelFlags);
INCLUDE_ASM(code_e92d0_len_5da0, func_802C95A0);
INCLUDE_ASM(code_e92d0_len_5da0, TranslateGroup);
INCLUDE_API_ASM(code_e92d0_len_5da0, TranslateGroup);
INCLUDE_ASM(code_e92d0_len_5da0, RotateGroup);
INCLUDE_API_ASM(code_e92d0_len_5da0, RotateGroup);
INCLUDE_ASM(code_e92d0_len_5da0, ScaleGroup);
INCLUDE_API_ASM(code_e92d0_len_5da0, ScaleGroup);
INCLUDE_ASM(code_e92d0_len_5da0, EnableGroup);
INCLUDE_API_ASM(code_e92d0_len_5da0, EnableGroup);
INCLUDE_ASM(code_e92d0_len_5da0, modify_collider_family_flags);
INCLUDE_ASM(code_e92d0_len_5da0, ModifyColliderFlags);
INCLUDE_API_ASM(code_e92d0_len_5da0, ModifyColliderFlags);
INCLUDE_ASM(code_e92d0_len_5da0, ResetFromLava);
INCLUDE_API_ASM(code_e92d0_len_5da0, ResetFromLava);
INCLUDE_ASM(code_e92d0_len_5da0, GetColliderCenter);
INCLUDE_API_ASM(code_e92d0_len_5da0, GetColliderCenter);
INCLUDE_ASM(code_e92d0_len_5da0, ParentColliderToModel);
INCLUDE_API_ASM(code_e92d0_len_5da0, ParentColliderToModel);
s32 UpdateColliderTransform(script_context* script) {
ApiStatus UpdateColliderTransform(ScriptInstance* script, s32 isInitialCall) {
update_collider_transform(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, func_802CA1B8);
INCLUDE_ASM(code_e92d0_len_5da0, goto_map);
s32 GotoMap(script_context* script) {
ApiStatus GotoMap(ScriptInstance* script, s32 isInitialCall) {
goto_map(script, 0);
return 1;
return ApiStatus_DONE1;
}
s32 GotoMapSpecial(script_context* script) {
ApiStatus GotoMapSpecial(ScriptInstance* script, s32 isInitialCall) {
goto_map(script, 1);
return 1;
return ApiStatus_DONE1;
}
s32 GotoMapByID(script_context* script) {
ApiStatus GotoMapByID(ScriptInstance* script, s32 isInitialCall) {
goto_map(script, 2);
return 1;
return ApiStatus_DONE1;
}
s32 GetEntryID(script_context* script) {
ApiStatus GetEntryID(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->entryID);
return 2;
return ApiStatus_DONE2;
}
s32 GetMapID(script_context* script, s32 initialCall) {
ApiStatus GetMapID(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->mapID);
return 2;
return ApiStatus_DONE2;
}
s32 GetLoadType(script_context* script, s32 initialCall) {
ApiStatus GetLoadType(ScriptInstance* script, s32 isInitialCall) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->loadType != 0);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_e92d0_len_5da0, SetRenderMode);
INCLUDE_API_ASM(code_e92d0_len_5da0, SetRenderMode);
INCLUDE_ASM(code_e92d0_len_5da0, PlaySoundAtModel);
INCLUDE_API_ASM(code_e92d0_len_5da0, PlaySoundAtModel);
INCLUDE_ASM(code_e92d0_len_5da0, PlaySoundAtCollider);
INCLUDE_API_ASM(code_e92d0_len_5da0, PlaySoundAtCollider);

View File

@ -1,13 +1,13 @@
#include "common.h"
void func_800337D0(s16 new_alpha) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
gameStatus->bootAlpha = new_alpha;
}
void func_800337E0(s16 arg0) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
gameStatus->bootRed = arg0;
gameStatus->bootGreen = arg0;
@ -15,7 +15,7 @@ void func_800337E0(s16 arg0) {
}
s16 func_800337F8(subtract_val) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
if (gameStatus->bootAlpha != 0) {
gameStatus->bootAlpha -= subtract_val;
@ -29,7 +29,7 @@ s16 func_800337F8(subtract_val) {
}
s16 func_80033830(add_val) {
game_status* gameStatus = *gGameStatusPtr;
GameStatus* gameStatus = *gGameStatusPtr;
if (gameStatus->bootAlpha != 0xFF) {
gameStatus->bootAlpha += add_val;

View File

@ -1,86 +1,86 @@
#include "common.h"
INCLUDE_ASM(code_ef070_len_3400, SetCamEnabled);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamEnabled);
INCLUDE_ASM(code_ef070_len_3400, SetCamFlag80);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamFlag80);
INCLUDE_ASM(code_ef070_len_3400, SetCamPerspective);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamPerspective);
INCLUDE_ASM(code_ef070_len_3400, SetCamViewport);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamViewport);
INCLUDE_ASM(code_ef070_len_3400, SetCamBGColor);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamBGColor);
INCLUDE_ASM(code_ef070_len_3400, SetCamTarget);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamTarget);
INCLUDE_ASM(code_ef070_len_3400, ShakeCam);
INCLUDE_API_ASM(code_ef070_len_3400, ShakeCam);
INCLUDE_ASM(code_ef070_len_3400, exec_ShakeCam1);
INCLUDE_ASM(code_ef070_len_3400, exec_ShakeCamX);
INCLUDE_ASM(code_ef070_len_3400, SetCamLeadPlayer);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamLeadPlayer);
INCLUDE_ASM(code_ef070_len_3400, PanToTarget);
INCLUDE_API_ASM(code_ef070_len_3400, PanToTarget);
INCLUDE_ASM(code_ef070_len_3400, UseSettingsFrom);
INCLUDE_API_ASM(code_ef070_len_3400, UseSettingsFrom);
INCLUDE_ASM(code_ef070_len_3400, LoadSettings);
INCLUDE_API_ASM(code_ef070_len_3400, LoadSettings);
INCLUDE_ASM(code_ef070_len_3400, SetCamType);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamType);
INCLUDE_ASM(code_ef070_len_3400, SetCamPitch);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamPitch);
INCLUDE_ASM(code_ef070_len_3400, SetCamDistance);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamDistance);
INCLUDE_ASM(code_ef070_len_3400, SetCamPosA);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamPosA);
INCLUDE_ASM(code_ef070_len_3400, SetCamPosB);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamPosB);
INCLUDE_ASM(code_ef070_len_3400, SetCamPosC);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamPosC);
INCLUDE_ASM(code_ef070_len_3400, SetPanTarget);
INCLUDE_API_ASM(code_ef070_len_3400, SetPanTarget);
INCLUDE_ASM(code_ef070_len_3400, SetCamSpeed);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamSpeed);
INCLUDE_ASM(code_ef070_len_3400, GetCamType);
INCLUDE_API_ASM(code_ef070_len_3400, GetCamType);
INCLUDE_ASM(code_ef070_len_3400, GetCamPitch);
INCLUDE_API_ASM(code_ef070_len_3400, GetCamPitch);
INCLUDE_ASM(code_ef070_len_3400, GetCamDistance);
INCLUDE_API_ASM(code_ef070_len_3400, GetCamDistance);
INCLUDE_ASM(code_ef070_len_3400, GetCamPosA);
INCLUDE_API_ASM(code_ef070_len_3400, GetCamPosA);
INCLUDE_ASM(code_ef070_len_3400, GetCamPosB);
INCLUDE_API_ASM(code_ef070_len_3400, GetCamPosB);
INCLUDE_ASM(code_ef070_len_3400, GetCamPosC);
INCLUDE_API_ASM(code_ef070_len_3400, GetCamPosC);
INCLUDE_ASM(code_ef070_len_3400, GetCamPosition);
INCLUDE_API_ASM(code_ef070_len_3400, GetCamPosition);
INCLUDE_ASM(code_ef070_len_3400, WaitForCam);
INCLUDE_API_ASM(code_ef070_len_3400, WaitForCam);
INCLUDE_ASM(code_ef070_len_3400, SetCamProperties);
INCLUDE_API_ASM(code_ef070_len_3400, SetCamProperties);
INCLUDE_ASM(code_ef070_len_3400, AdjustCam);
INCLUDE_API_ASM(code_ef070_len_3400, AdjustCam);
INCLUDE_ASM(code_ef070_len_3400, ResetCam);
INCLUDE_API_ASM(code_ef070_len_3400, ResetCam);
INCLUDE_ASM(code_ef070_len_3400, draw_anim_models);
INCLUDE_ASM(code_ef070_len_3400, LoadModelAnimation);
INCLUDE_API_ASM(code_ef070_len_3400, LoadModelAnimation);
INCLUDE_ASM(code_ef070_len_3400, PlayModelAnimation);
INCLUDE_API_ASM(code_ef070_len_3400, PlayModelAnimation);
INCLUDE_ASM(code_ef070_len_3400, ChangeModelAnimation);
INCLUDE_API_ASM(code_ef070_len_3400, ChangeModelAnimation);
INCLUDE_ASM(code_ef070_len_3400, SetAnimModelPosition);
INCLUDE_API_ASM(code_ef070_len_3400, SetAnimModelPosition);
INCLUDE_ASM(code_ef070_len_3400, GetAnimModelPosition);
INCLUDE_API_ASM(code_ef070_len_3400, GetAnimModelPosition);
INCLUDE_ASM(code_ef070_len_3400, AddAnimModelPosition);
INCLUDE_API_ASM(code_ef070_len_3400, AddAnimModelPosition);
INCLUDE_ASM(code_ef070_len_3400, SetAnimModelRotation);
INCLUDE_API_ASM(code_ef070_len_3400, SetAnimModelRotation);
INCLUDE_ASM(code_ef070_len_3400, SetAnimModelScale);
INCLUDE_API_ASM(code_ef070_len_3400, SetAnimModelScale);
INCLUDE_ASM(code_ef070_len_3400, func_802CD4B4);

View File

@ -1,111 +1,111 @@
#include "common.h"
npc* resolve_npc(script_context* script, NPC npcID) {
if (npcID == NPC_SELF) {
Npc* resolve_npc(ScriptInstance* script, NpcId npcIdOrPtr) {
if (npcIdOrPtr == NpcId_SELF) {
return get_npc_safe(script->ownerID);
} else if (npcID >= -270000000) {
return get_npc_safe(npcID);
} else if (npcIdOrPtr >= -270000000) {
return get_npc_safe(npcIdOrPtr);
} else {
return (npc*) npcID;
return (Npc*) npcIdOrPtr;
}
}
INCLUDE_ASM(code_f2470_len_27f0, set_npc_animation);
s32 DeleteNpc(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
npc* npcPtr = get_npc_unsafe(get_variable(script, *ptrReadPos++));
ApiStatus DeleteNpc(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
Npc* npcPtr = get_npc_unsafe(get_variable(script, *ptrReadPos++));
if (npcPtr) {
free_npc(npcPtr);
return 2;
return ApiStatus_DONE2;
}
return 2;
return ApiStatus_DONE2;
}
s32 GetNpcPointer(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
bytecode npcID = get_variable(script, *ptrReadPos++);
bytecode varNPC = *ptrReadPos++;
ApiStatus GetNpcPointer(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
NpcId npcID = get_variable(script, *ptrReadPos++);
Bytecode varNPC = *ptrReadPos++;
set_variable(script, varNPC, get_npc_safe(npcID));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_f2470_len_27f0, SetNpcPos);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcPos);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcRotation);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcRotation);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcScale);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcScale);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcCollisionSize);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcCollisionSize);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcSpeed);
INCLUDE_API_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++);
ApiStatus SetNpcSpeed(ScriptInstance* script, s32 isInitialCall) {
Vytecode* ptrReadPos = script->ptrReadPos;
NpcId npcID = get_variable(script, *ptrReadPos++);
f32 speed = get_float_variable(script, *ptrReadPos);
npc* npcPtr = resolve_npc(script, npcID);
Npc* npcPtr = resolve_npc(script, npcID);
npcPtr->moveSpeed = speed;
if(npcPtr != NULL) {
return 2;
return ApiStatus_DONE2;
}
}
*/
INCLUDE_ASM(code_f2470_len_27f0, SetNpcJumpscale);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcJumpscale);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcAnimation);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcAnimation);
INCLUDE_ASM(code_f2470_len_27f0, GetNpcAnimation);
INCLUDE_API_ASM(code_f2470_len_27f0, GetNpcAnimation);
INCLUDE_ASM(code_f2470_len_27f0, NpcMoveTo);
INCLUDE_API_ASM(code_f2470_len_27f0, NpcMoveTo);
INCLUDE_ASM(code_f2470_len_27f0, _npc_jump_to);
INCLUDE_ASM(code_f2470_len_27f0, NpcJump0);
INCLUDE_API_ASM(code_f2470_len_27f0, NpcJump0);
INCLUDE_ASM(code_f2470_len_27f0, NpcJump1);
INCLUDE_API_ASM(code_f2470_len_27f0, NpcJump1);
INCLUDE_ASM(code_f2470_len_27f0, NpcFlyTo);
INCLUDE_API_ASM(code_f2470_len_27f0, NpcFlyTo);
INCLUDE_ASM(code_f2470_len_27f0, GetNpcYaw);
INCLUDE_API_ASM(code_f2470_len_27f0, GetNpcYaw);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcYaw);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcYaw);
INCLUDE_ASM(code_f2470_len_27f0, InterpNpcYaw);
INCLUDE_API_ASM(code_f2470_len_27f0, InterpNpcYaw);
INCLUDE_ASM(code_f2470_len_27f0, NpcFacePlayer);
INCLUDE_API_ASM(code_f2470_len_27f0, NpcFacePlayer);
INCLUDE_ASM(code_f2470_len_27f0, NpcFaceNpc);
INCLUDE_API_ASM(code_f2470_len_27f0, NpcFaceNpc);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcFlagBits);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcFlagBits);
INCLUDE_ASM(code_f2470_len_27f0, GetNpcPos);
INCLUDE_API_ASM(code_f2470_len_27f0, GetNpcPos);
INCLUDE_ASM(code_f2470_len_27f0, EnableNpcShadow);
INCLUDE_API_ASM(code_f2470_len_27f0, EnableNpcShadow);
INCLUDE_ASM(code_f2470_len_27f0, EnableNpcBlur);
INCLUDE_API_ASM(code_f2470_len_27f0, EnableNpcBlur);
INCLUDE_ASM(code_f2470_len_27f0, ClearPartnerMoveHistory);
INCLUDE_API_ASM(code_f2470_len_27f0, ClearPartnerMoveHistory);
INCLUDE_ASM(code_f2470_len_27f0, NpcSetHomePosToCurrent);
INCLUDE_API_ASM(code_f2470_len_27f0, NpcSetHomePosToCurrent);
INCLUDE_ASM(code_f2470_len_27f0, GetPartnerPos);
INCLUDE_API_ASM(code_f2470_len_27f0, GetPartnerPos);
INCLUDE_ASM(code_f2470_len_27f0, DisablePartnerAI);
INCLUDE_API_ASM(code_f2470_len_27f0, DisablePartnerAI);
INCLUDE_ASM(code_f2470_len_27f0, EnablePartnerAI);
INCLUDE_API_ASM(code_f2470_len_27f0, EnablePartnerAI);
INCLUDE_ASM(code_f2470_len_27f0, BringPartnerOut);
INCLUDE_API_ASM(code_f2470_len_27f0, BringPartnerOut);
INCLUDE_ASM(code_f2470_len_27f0, PutPartnerAway);
INCLUDE_API_ASM(code_f2470_len_27f0, PutPartnerAway);
INCLUDE_ASM(code_f2470_len_27f0, GetCurrentPartnerID);
INCLUDE_API_ASM(code_f2470_len_27f0, GetCurrentPartnerID);
INCLUDE_ASM(code_f2470_len_27f0, SetNpcEffect);
INCLUDE_API_ASM(code_f2470_len_27f0, SetNpcEffect);
INCLUDE_ASM(code_f2470_len_27f0, PlaySoundAtNpc);
INCLUDE_API_ASM(code_f2470_len_27f0, PlaySoundAtNpc);

View File

@ -1,166 +1,166 @@
#include "common.h"
s32 SpeakToPlayer(script_context* script, s32 initialCall) {
return _show_message(script, initialCall, 0);
ApiStatus SpeakToPlayer(ScriptInstance* script, s32 isInitialCall) {
return _show_message(script, isInitialCall, 0);
}
s32 EndSpeech(script_context* script, s32 initialCall) {
return _show_message(script, initialCall, 1);
ApiStatus EndSpeech(ScriptInstance* script, s32 isInitialCall) {
return _show_message(script, isInitialCall, 1);
}
s32 ContinueSpeech(script_context* script, s32 initialCall) {
return _show_message(script, initialCall, 2);
ApiStatus ContinueSpeech(ScriptInstance* script, s32 isInitialCall) {
return _show_message(script, isInitialCall, 2);
}
s32 SpeakToNpc(script_context* script, s32 initialCall) {
return _show_message(script, initialCall, 3);
ApiStatus SpeakToNpc(ScriptInstance* script, s32 isInitialCall) {
return _show_message(script, isInitialCall, 3);
}
INCLUDE_ASM(code_f4c60_len_4300, _show_message);
INCLUDE_ASM(code_f4c60_len_4300, ShowMessageAtScreenPos);
INCLUDE_API_ASM(code_f4c60_len_4300, ShowMessageAtScreenPos);
INCLUDE_ASM(code_f4c60_len_4300, ShowMessageAtWorldPos);
INCLUDE_API_ASM(code_f4c60_len_4300, ShowMessageAtWorldPos);
INCLUDE_ASM(code_f4c60_len_4300, CloseMessage);
INCLUDE_API_ASM(code_f4c60_len_4300, CloseMessage);
INCLUDE_ASM(code_f4c60_len_4300, SwitchMessage);
INCLUDE_API_ASM(code_f4c60_len_4300, SwitchMessage);
INCLUDE_ASM(code_f4c60_len_4300, ShowChoice);
INCLUDE_API_ASM(code_f4c60_len_4300, ShowChoice);
s32 CloseChoice(script_context* script, s32 initialCall) {
ApiStatus CloseChoice(ScriptInstance* script, s32 isInitialCall) {
close_message(D_802DB268);
return 1;
return ApiStatus_DONE1;
}
s32 CancelMessage(script_context* script, s32 initialCall) {
ApiStatus CancelMessage(ScriptInstance* script, s32 isInitialCall) {
cancel_message(gCurrentPrintContext);
return 2;
return ApiStatus_DONE2;
}
s32 CancelMessageAndBlock(script_context* script, s32 initialCall) {
ApiStatus CancelMessageAndBlock(ScriptInstance* script, s32 isInitialCall) {
cancel_message(gCurrentPrintContext);
return 0;
return ApiStatus_BLOCK;
}
s32 SetMessageImages(script_context* script, s32 initialCall) {
ApiStatus SetMessageImages(ScriptInstance* script, s32 isInitialCall) {
set_message_images(*script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
s32 func_802D0C94(script_context* script, s32 initialCall) {
ApiStatus func_802D0C94(ScriptInstance* script, s32 initialCall) {
if (get_variable(script, *script->ptrReadPos) == 0) {
D_8009A650[0] |= 0x10;
} else {
D_8009A650[0] &= ~0x10;
}
return 2;
return ApiStatus_DONE2;
}
s32 SetMessageString(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
bytecode string = get_variable(script, *ptrReadPos++);
bytecode index = get_variable(script, *ptrReadPos++);
ApiStatus SetMessageString(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
Bytecode string = get_variable(script, *ptrReadPos++);
Bytecode index = get_variable(script, *ptrReadPos++);
set_message_string(string, index);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_f4c60_len_4300, SetMessageValue);
INCLUDE_API_ASM(code_f4c60_len_4300, SetMessageValue);
// TODO: Figure out why there's an extra NOP after this function
// It's probably because of a file split issue
/*
s32 SetMessageValue(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
bytecode value = get_variable(script, *ptrReadPos++);
bytecode index = get_variable(script, *ptrReadPos);
ApiStatus SetMessageValue(ScriptInstance* script, s32 initialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
Bytecode value = get_variable(script, *ptrReadPos++);
Bytecode index = get_variable(script, *ptrReadPos);
set_message_value(value, index);
return 2;
return ApiStatus_DONE2;
}
*/
INCLUDE_ASM(code_f4c60_len_4300, HidePlayerShadow);
INCLUDE_API_ASM(code_f4c60_len_4300, HidePlayerShadow);
INCLUDE_ASM(code_f4c60_len_4300, DisablePlayerPhysics);
INCLUDE_API_ASM(code_f4c60_len_4300, DisablePlayerPhysics);
INCLUDE_ASM(code_f4c60_len_4300, DisablePlayerInput);
INCLUDE_API_ASM(code_f4c60_len_4300, DisablePlayerInput);
INCLUDE_ASM(code_f4c60_len_4300, SetPlayerPos);
INCLUDE_API_ASM(code_f4c60_len_4300, SetPlayerPos);
INCLUDE_ASM(code_f4c60_len_4300, SetPlayerCollisionSize);
INCLUDE_API_ASM(code_f4c60_len_4300, SetPlayerCollisionSize);
INCLUDE_ASM(code_f4c60_len_4300, SetPlayerSpeed);
INCLUDE_API_ASM(code_f4c60_len_4300, SetPlayerSpeed);
INCLUDE_ASM(code_f4c60_len_4300, SetPlayerJumpscale);
INCLUDE_API_ASM(code_f4c60_len_4300, SetPlayerJumpscale);
INCLUDE_ASM(code_f4c60_len_4300, SetPlayerAnimation);
INCLUDE_API_ASM(code_f4c60_len_4300, SetPlayerAnimation);
INCLUDE_ASM(code_f4c60_len_4300, SetPlayerActionState);
INCLUDE_API_ASM(code_f4c60_len_4300, SetPlayerActionState);
INCLUDE_ASM(code_f4c60_len_4300, MovePlayerTo);
INCLUDE_API_ASM(code_f4c60_len_4300, MovePlayerTo);
INCLUDE_ASM(code_f4c60_len_4300, player_jump);
INCLUDE_ASM(code_f4c60_len_4300, PlayerJump);
INCLUDE_API_ASM(code_f4c60_len_4300, PlayerJump);
INCLUDE_ASM(code_f4c60_len_4300, PlayerJump1);
INCLUDE_API_ASM(code_f4c60_len_4300, PlayerJump1);
INCLUDE_ASM(code_f4c60_len_4300, PlayerJump2);
INCLUDE_API_ASM(code_f4c60_len_4300, PlayerJump2);
INCLUDE_ASM(code_f4c60_len_4300, InterpPlayerYaw);
INCLUDE_API_ASM(code_f4c60_len_4300, InterpPlayerYaw);
INCLUDE_ASM(code_f4c60_len_4300, PlayerFaceNpc);
INCLUDE_API_ASM(code_f4c60_len_4300, PlayerFaceNpc);
INCLUDE_ASM(code_f4c60_len_4300, GetPlayerTargetYaw);
INCLUDE_API_ASM(code_f4c60_len_4300, GetPlayerTargetYaw);
INCLUDE_ASM(code_f4c60_len_4300, SetPlayerFlagBits);
INCLUDE_API_ASM(code_f4c60_len_4300, SetPlayerFlagBits);
INCLUDE_ASM(code_f4c60_len_4300, GetPlayerActionState);
INCLUDE_API_ASM(code_f4c60_len_4300, GetPlayerActionState);
INCLUDE_ASM(code_f4c60_len_4300, GetPlayerPos);
INCLUDE_API_ASM(code_f4c60_len_4300, GetPlayerPos);
INCLUDE_ASM(code_f4c60_len_4300, GetPlayerAnimation);
INCLUDE_API_ASM(code_f4c60_len_4300, GetPlayerAnimation);
INCLUDE_ASM(code_f4c60_len_4300, FullyRestoreHPandFP);
INCLUDE_API_ASM(code_f4c60_len_4300, FullyRestoreHPandFP);
INCLUDE_ASM(code_f4c60_len_4300, FullyRestoreSP);
INCLUDE_API_ASM(code_f4c60_len_4300, FullyRestoreSP);
INCLUDE_ASM(code_f4c60_len_4300, EnablePartner);
INCLUDE_API_ASM(code_f4c60_len_4300, EnablePartner);
INCLUDE_ASM(code_f4c60_len_4300, DisablePartner);
INCLUDE_API_ASM(code_f4c60_len_4300, DisablePartner);
INCLUDE_ASM(code_f4c60_len_4300, ForceExitHeading);
INCLUDE_API_ASM(code_f4c60_len_4300, ForceExitHeading);
INCLUDE_ASM(code_f4c60_len_4300, UseExitHeading);
INCLUDE_API_ASM(code_f4c60_len_4300, UseExitHeading);
INCLUDE_ASM(code_f4c60_len_4300, func_802D23F8);
INCLUDE_ASM(code_f4c60_len_4300, DisablePulseStone);
INCLUDE_API_ASM(code_f4c60_len_4300, DisablePulseStone);
INCLUDE_ASM(code_f4c60_len_4300, GetCurrentPartner);
INCLUDE_API_ASM(code_f4c60_len_4300, GetCurrentPartner);
INCLUDE_ASM(code_f4c60_len_4300, Disable8bitMario);
INCLUDE_API_ASM(code_f4c60_len_4300, Disable8bitMario);
INCLUDE_ASM(code_f4c60_len_4300, PlaySoundAtPlayer);
INCLUDE_API_ASM(code_f4c60_len_4300, PlaySoundAtPlayer);
INCLUDE_ASM(code_f4c60_len_4300, func_802D2D30);
INCLUDE_ASM(code_f4c60_len_4300, func_802D2F34);
INCLUDE_ASM(code_f4c60_len_4300, CreateImageObj);
INCLUDE_API_ASM(code_f4c60_len_4300, CreateImageObj);
INCLUDE_ASM(code_f4c60_len_4300, RemoveImageObj);
INCLUDE_API_ASM(code_f4c60_len_4300, RemoveImageObj);
INCLUDE_ASM(code_f4c60_len_4300, SetObjPosition);
INCLUDE_API_ASM(code_f4c60_len_4300, SetObjPosition);
INCLUDE_ASM(code_f4c60_len_4300, SetObjRotation);
INCLUDE_API_ASM(code_f4c60_len_4300, SetObjRotation);
INCLUDE_ASM(code_f4c60_len_4300, SetObjScale);
INCLUDE_API_ASM(code_f4c60_len_4300, SetObjScale);
INCLUDE_ASM(code_f4c60_len_4300, SetObjJumpScale);
INCLUDE_API_ASM(code_f4c60_len_4300, SetObjJumpScale);
INCLUDE_ASM(code_f4c60_len_4300, JumpObj);
INCLUDE_API_ASM(code_f4c60_len_4300, JumpObj);
INCLUDE_ASM(code_f4c60_len_4300, func_802D4164);

View File

@ -1,7 +1,7 @@
#include "common.h"
s32 MakeLerp(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus MakeLerp(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
script->varTable[0xC] = get_variable(script, *ptrReadPos++); // start
script->varTable[0xD] = get_variable(script, *ptrReadPos++); // end
@ -9,10 +9,10 @@ s32 MakeLerp(script_context* script, s32 initialCall) {
script->varTable[0xB] = get_variable(script, *ptrReadPos++); // easing type
script->varTable[0xE] = 0; // elapsed
return 2;
return ApiStatus_DONE2;
}
s32 UpdateLerp(script_context* script, s32 initialCall) {
ApiStatus UpdateLerp(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0x0] = (s32) update_lerp(
script->varTable[0xB],
script->varTable[0xC],
@ -28,63 +28,63 @@ s32 UpdateLerp(script_context* script, s32 initialCall) {
}
script->varTable[0xE]++;
return 2;
return ApiStatus_DONE2;
}
s32 RandInt(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus RandInt(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 max = get_variable(script, *ptrReadPos++);
bytecode outVar = *ptrReadPos++;
Bytecode outVar = *ptrReadPos++;
set_variable(script, outVar, rand_int(max));
return 2;
return ApiStatus_DONE2;
}
s32 GetAngleBetweenNPCs(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus GetAngleBetweenNPCs(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
NPC aID = get_variable(script, *ptrReadPos++);
NPC bID = get_variable(script, *ptrReadPos++);
bytecode outVar = *ptrReadPos++;
NpcId aID = get_variable(script, *ptrReadPos++);
NpcId bID = get_variable(script, *ptrReadPos++);
Bytecode outVar = *ptrReadPos++;
npc* a = resolve_npc(script, aID);
npc* b = resolve_npc(script, bID);
Npc* a = resolve_npc(script, aID);
Npc* b = resolve_npc(script, bID);
set_variable(script, outVar, atan2(a->pos.x, a->pos.z, b->pos.x, b->pos.z));
return 2;
return ApiStatus_DONE2;
}
s32 GetAngleToNPC(script_context* script, s32 initialCall) {
player_status* playerStatus = &gPlayerStatus;
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus GetAngleToNPC(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* ptrReadPos = script->ptrReadPos;
NPC npcID = get_variable(script, *ptrReadPos++);
bytecode outVar = *ptrReadPos++;
NpcId npcID = get_variable(script, *ptrReadPos++);
Bytecode outVar = *ptrReadPos++;
npc* npc = resolve_npc(script, npcID);
Npc* npc = resolve_npc(script, npcID);
set_variable(script, outVar, atan2(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z));
return 2;
return ApiStatus_DONE2;
}
s32 GetAngleToPlayer(script_context* script, s32 initialCall) {
player_status* playerStatus = &gPlayerStatus;
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus GetAngleToPlayer(ScriptInstance* script, s32 isInitialCall) {
PlayerStatus* playerStatus = &gPlayerStatus;
Bytecode* ptrReadPos = script->ptrReadPos;
NPC npcID = get_variable(script, *ptrReadPos++);
bytecode outVar = *ptrReadPos++;
NpcId npcID = get_variable(script, *ptrReadPos++);
Bytecode outVar = *ptrReadPos++;
npc* npc = resolve_npc(script, npcID);
Npc* npc = resolve_npc(script, npcID);
set_variable(script, outVar, atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z));
return 2;
return ApiStatus_DONE2;
}
s32 AwaitPlayerApproach(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
player_status* playerStatus = &gPlayerStatus;
ApiStatus AwaitPlayerApproach(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
s32* targetX = &script->functionTemp[0];
s32* targetZ = &script->functionTemp[1];
@ -92,7 +92,7 @@ s32 AwaitPlayerApproach(script_context* script, s32 initialCall) {
f32 distance;
if (initialCall) {
if (isInitialCall) {
*targetX = get_variable(script, *ptrReadPos++);
*targetZ = get_variable(script, *ptrReadPos++);
*distanceRequired = get_variable(script, *ptrReadPos++);
@ -104,24 +104,24 @@ s32 AwaitPlayerApproach(script_context* script, s32 initialCall) {
);
if (distance < *distanceRequired) {
return 2;
return ApiStatus_DONE2;
} else {
return 0;
return ApiStatus_BLOCK;
}
}
s32 IsPlayerWithin(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
player_status* playerStatus = &gPlayerStatus;
ApiStatus IsPlayerWithin(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
s32* targetX = &script->functionTemp[0];
s32* targetZ = &script->functionTemp[1];
s32* distanceRequired = &script->functionTemp[2];
f32 distance;
bytecode outVar = SI_VAR_0;
Bytecode outVar = SI_VAR_0;
if (initialCall) {
if (isInitialCall) {
*targetX = get_variable(script, *ptrReadPos++);
*targetZ = get_variable(script, *ptrReadPos++);
*distanceRequired = get_variable(script, *ptrReadPos++);
@ -138,12 +138,12 @@ s32 IsPlayerWithin(script_context* script, s32 initialCall) {
set_variable(script, outVar, 1);
}
return 2;
return ApiStatus_DONE2;
}
s32 AwaitPlayerLeave(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
player_status* playerStatus = &gPlayerStatus;
ApiStatus AwaitPlayerLeave(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
PlayerStatus* playerStatus = &gPlayerStatus;
s32* targetX = &script->functionTemp[0];
s32* targetZ = &script->functionTemp[1];
@ -151,7 +151,7 @@ s32 AwaitPlayerLeave(script_context* script, s32 initialCall) {
f32 distance;
if (initialCall) {
if (isInitialCall) {
*targetX = get_variable(script, *ptrReadPos++);
*targetZ = get_variable(script, *ptrReadPos++);
*distanceRequired = get_variable(script, *ptrReadPos++);
@ -163,19 +163,19 @@ s32 AwaitPlayerLeave(script_context* script, s32 initialCall) {
);
if (distance > *distanceRequired) {
return 2;
return ApiStatus_DONE2;
} else {
return 0;
return ApiStatus_BLOCK;
}
}
s32 AddVectorPolar(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus AddVectorPolar(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
bytecode xVar = *ptrReadPos++;
Bytecode xVar = *ptrReadPos++;
f32 x = get_float_variable(script, xVar);
bytecode yVar = *ptrReadPos++;
Bytecode yVar = *ptrReadPos++;
f32 y = get_float_variable(script, yVar);
f32 r = get_float_variable(script, *ptrReadPos++);
@ -185,12 +185,12 @@ s32 AddVectorPolar(script_context* script, s32 initialCall) {
set_float_variable(script, xVar, x);
set_float_variable(script, yVar, y);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_f8f60_len_1560, func_802D4BDC);
INCLUDE_API_ASM(code_f8f60_len_1560, func_802D4BDC);
/*
s32 func_802D4BDC(script_context* script, s32 initialCall) {
ApiStatus func_802D4BDC(ScriptInstance* script, s32 initialCall) {
s32* t0 = &script->functionTemp[0];
s32* t1 = &script->functionTemp[1];
s32 t1v;
@ -211,7 +211,7 @@ s32 func_802D4BDC(script_context* script, s32 initialCall) {
t1v = 0xFF;
func_80137DA4(0xA, (f32) *t1);
} else {
return 2;
return ApiStatus_DONE2;
}
}
@ -220,11 +220,11 @@ s32 func_802D4BDC(script_context* script, s32 initialCall) {
*/
// Very similar to func_802D4BDC
INCLUDE_ASM(code_f8f60_len_1560, func_802D4C4C);
INCLUDE_API_ASM(code_f8f60_len_1560, func_802D4C4C);
INCLUDE_ASM(code_f8f60_len_1560, func_802D4CC4);
INCLUDE_API_ASM(code_f8f60_len_1560, func_802D4CC4);
/*
s32 func_802D4CC4(script_context* script, s32 initialCall) {
ApiStatus func_802D4CC4(ScriptInstance* script, s32 initialCall) {
s32 value = get_variable(script, *script->ptrReadPos);
if (value < 0) {
func_80137DA4(0xFF, -1.0f);
@ -232,37 +232,37 @@ s32 func_802D4CC4(script_context* script, s32 initialCall) {
func_80137DA4(0xA, value);
}
return 2;
return ApiStatus_DONE2;
}
*/
s32 func_802D4D18(script_context* script, s32 initialCall) {
ApiStatus func_802D4D18(ScriptInstance* script, s32 initialCall) {
s32 value = get_float_variable(script, *script->ptrReadPos);
func_80137E4C(0, 0, 0xC, 0x14);
func_80137E4C(0, 1, 0x134, 0xDC);
func_80137D88(0xC, value);
return 2;
return ApiStatus_DONE2;
}
s32 func_802D4D88(script_context* script, s32 initialCall) {
ApiStatus func_802D4D88(ScriptInstance* script, s32 initialCall) {
func_80137D88(0xC, 0);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_f8f60_len_1560, setup_path_data);
INCLUDE_ASM(code_f8f60_len_1560, func_802D5270);
INCLUDE_ASM(code_f8f60_len_1560, LoadPath);
INCLUDE_API_ASM(code_f8f60_len_1560, LoadPath);
INCLUDE_ASM(code_f8f60_len_1560, GetNextPathPos);
INCLUDE_API_ASM(code_f8f60_len_1560, GetNextPathPos);
s32 GetDist2D(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus GetDist2D(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
bytecode outVar = *ptrReadPos++;
Bytecode outVar = *ptrReadPos++;
set_float_variable(script, outVar, dist2D(
get_float_variable(script, *ptrReadPos++),
get_float_variable(script, *ptrReadPos++),
@ -270,16 +270,16 @@ s32 GetDist2D(script_context* script, s32 initialCall) {
get_float_variable(script, *ptrReadPos++)
));
return 2;
return ApiStatus_DONE2;
}
s32 func_802D5830(script_context* script, s32 initialCall) {
ApiStatus func_802D5830(ScriptInstance* script, s32 initialCall) {
func_80027088(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 func_802D585C(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus func_802D585C(ScriptInstance* script, s32 initialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 setMode = get_variable(script, *ptrReadPos++);
s32 flags = get_variable(script, *ptrReadPos++);
@ -291,41 +291,41 @@ s32 func_802D585C(script_context* script, s32 initialCall) {
D_8009A650[0] &= ~flags;
}
return 2;
return ApiStatus_DONE2;
}
s32 SetValueByRef(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus SetValueByRef(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 dest = get_variable(script, *ptrReadPos++); /* Reference */
s32 src = get_variable(script, *ptrReadPos++);
set_variable(script, dest, src);
return 2;
return ApiStatus_DONE2;
}
s32 GetValueByRef(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus GetValueByRef(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 src = get_variable(script, *ptrReadPos++); /* Reference */
bytecode dest = *ptrReadPos++;
Bytecode dest = *ptrReadPos++;
set_variable(script, dest, get_variable(script, src));
return 2;
return ApiStatus_DONE2;
}
s32 EnableStatusMenu(script_context* script, s32 initialCall) {
ApiStatus EnableStatusMenu(ScriptInstance* script, s32 isInitialCall) {
if (get_variable(script, *script->ptrReadPos) != 0) {
decrement_status_menu_disabled();
} else {
increment_status_menu_disabled();
}
return 2;
return ApiStatus_DONE2;
}
s32 ShowStatusMenu(script_context* script, s32 initialCall) {
ApiStatus ShowStatusMenu(ScriptInstance* script, s32 isInitialCall) {
if (get_variable(script, *script->ptrReadPos) != 0) {
status_menu_enable_ignore_changes();
func_800E97B8();
@ -333,29 +333,29 @@ s32 ShowStatusMenu(script_context* script, s32 initialCall) {
status_menu_disable_ignore_changes();
}
return 2;
return ApiStatus_DONE2;
}
s32 SetGameMode(script_context* script, s32 initialCall) {
ApiStatus SetGameMode(ScriptInstance* script, s32 isInitialCall) {
set_game_mode(
// Clear upper half
(get_variable(script, *script->ptrReadPos) << 0x10) >> 0x10
);
return 2;
return ApiStatus_DONE2;
}
s32 ClampAngleInt(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus ClampAngleInt(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
set_variable(script, *ptrReadPos, clamp_angle(get_variable(script, *ptrReadPos)));
return 2;
return ApiStatus_DONE2;
}
s32 ClampAngleFloat(script_context* script, s32 initialCall) {
bytecode* ptrReadPos = script->ptrReadPos;
ApiStatus ClampAngleFloat(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
set_float_variable(script, *ptrReadPos, clamp_angle(get_float_variable(script, *ptrReadPos)));
return 2;
return ApiStatus_DONE2;
}

View File

@ -2,16 +2,16 @@
INCLUDE_ASM(code_fa4c0_len_3bf0, func_802D5B10);
s32 FadeOutMusic(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus FadeOutMusic(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = ptrReadPos++;
return (set_music_track(itemID, -1, 0, get_variable(script, *ptrNextPos++), 8) != 0) * 2;
}
s32 SetMusicTrack(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus SetMusicTrack(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 musicPlayer = get_variable(script, *ptrReadPos++);
s32 songID = get_variable(script, *ptrReadPos++);
s32 variation = get_variable(script, *ptrReadPos++);
@ -20,34 +20,34 @@ s32 SetMusicTrack(script_context* script, s32 initialCall) {
return (set_music_track(musicPlayer, songID, variation, 0x1F4, volume) != 0) * 2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, FadeInMusic);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, FadeInMusic);
s32 PlayAmbientSounds(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus PlayAmbientSounds(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 soundID = get_variable(script, *ptrReadPos++);
return (play_ambient_sounds(soundID, 0xFA) != 0) * 2;
}
s32 PlaySound(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus PlaySound(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 soundID = get_variable(script, *ptrReadPos++);
play_sound(soundID);
return 2;
return ApiStatus_DONE2;
}
s32 func_802D617C(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus func_802D617C(ScriptInstance* script, s32 initialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 soundID = get_variable(script, *ptrReadPos++);
s32 value2 = get_variable(script, *ptrReadPos++);
_play_sound(soundID, value2 & 0xFF, 0, 0);
return 2;
return ApiStatus_DONE2;
}
s32 PlaySoundAt(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus PlaySoundAt(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 soundID = get_variable(script, *ptrReadPos++);
s32 value2 = get_variable(script, *ptrReadPos++);
s32 x = get_variable(script, *ptrReadPos++);
@ -55,68 +55,68 @@ s32 PlaySoundAt(script_context* script, s32 initialCall) {
s32 z = get_variable(script, *ptrReadPos++);
play_sound_at_position(soundID, value2, x, y, z);
return 2;
return ApiStatus_DONE2;
}
s32 StopSound(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus StopSound(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
stop_sound(get_variable(script, *ptrReadPos++));
return 2;
return ApiStatus_DONE2;
}
s32 func_802D62E4(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus func_802D62E4(ScriptInstance* script, s32 initialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
func_80149A6C(get_variable(script, *ptrReadPos++), 1);
return 2;
return ApiStatus_DONE2;
}
s32 UseDoorSounds(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus UseDoorSounds(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
gCurrentDoorSoundsSet = get_variable(script, *ptrReadPos++);
return 2;
return ApiStatus_DONE2;
}
s32 func_802D6340(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus func_802D6340(ScriptInstance* script, s32 initialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
D_80151308 = get_variable(script, *ptrReadPos++);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, PlaySoundAtF);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, PlaySoundAtF);
s32 RemoveKeyItemAt(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus RemoveKeyItemAt(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 index = get_variable(script, *ptrReadPos++);
s16* ptrKeyItems = (s16 *) &gPlayerData.keyItems;
ptrKeyItems[index] = 0;
return 2;
return ApiStatus_DONE2;
}
s32 RemoveItemAt(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus RemoveItemAt(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 index = get_variable(script, *ptrReadPos++);
s16* ptrInvItems = (s16 *) &gPlayerData.invItems;
ptrInvItems[index] = 0;
sort_items();
return 2;
return ApiStatus_DONE2;
}
s32 AddKeyItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus AddKeyItem(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 value = *ptrReadPos++;
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 itemID = get_variable(script, value);
s32 i;
if (itemID == ITEM_FORTRESS_KEY) {
if (itemID == ItemId_FORTRESS_KEY) {
playerData->fortressKeyCount++;
return 2;
return ApiStatus_DONE2;
}
for (i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
@ -128,38 +128,38 @@ s32 AddKeyItem(script_context* script, s32 initialCall) {
if (i < ARRAY_COUNT(playerData->keyItems)) {
playerData->keyItems[i] = itemID;
}
return 2;
return ApiStatus_DONE2;
}
s32 func_802D6954(void) {
ApiStatus func_802D6954(ScriptInstance* script, s32 isInitialCall) {
func_800E01A4();
disable_player_physics();
func_800EF600();
D_8009A650[0] &= ~0x40;
return 2;
return ApiStatus_DONE2;
}
s32 HasKeyItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus HasKeyItem(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32 value = *ptrReadPos++;
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i;
for(i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
if (playerData->keyItems[i] == itemID) {
break;
}
}
set_variable(script, value, i < ARRAY_COUNT(playerData->keyItems));
return 2;
return ApiStatus_DONE2;
}
s32 FindKeyItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus FindKeyItem(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32 value = *ptrReadPos++;
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i;
s32 itemIndex;
@ -175,28 +175,28 @@ s32 FindKeyItem(script_context* script, s32 initialCall) {
}
set_variable(script, value, itemIndex);
return 2;
return ApiStatus_DONE2;
}
s32 AddItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus AddItem(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = (s32 *) *ptrReadPos++;
set_variable(script, ptrNextPos, add_item(itemID));
return 2;
return ApiStatus_DONE2;
}
s32 func_802D6AF0(script_context* script, s32 initialCall) {
ApiStatus func_802D6AF0(ScriptInstance* script, s32 initialCall) {
set_variable(script, *script->ptrReadPos, 0);
return 2;
return ApiStatus_DONE2;
}
s32 FindItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus FindItem(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32 value = *ptrReadPos++;
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i;
s32 itemIndex;
@ -212,14 +212,14 @@ s32 FindItem(script_context* script, s32 initialCall) {
}
set_variable(script, value, itemIndex);
return 2;
return ApiStatus_DONE2;
}
s32 RemoveItem(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus RemoveItem(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32 value = *ptrReadPos++;
player_data* playerData = &gPlayerData;
PlayerData* playerData = &gPlayerData;
s32 i;
s32 itemIndex;
@ -242,32 +242,32 @@ s32 RemoveItem(script_context* script, s32 initialCall) {
sort_items();
set_variable(script, value, itemIndex);
return 2;
return ApiStatus_DONE2;
}
s32 CountFortressKeys(script_context* script, s32 initialCall) {
ApiStatus CountFortressKeys(ScriptInstance* script, s32 isInitialCall) {
s32 outVar = *script->ptrReadPos;
set_variable(script, outVar, get_fortress_key_count());
return 2;
return ApiStatus_DONE2;
}
s32 RemoveFortressKeys(script_context* script, s32 initialCall) {
ApiStatus RemoveFortressKeys(ScriptInstance* script, s32 isInitialCall) {
s32 num = get_variable(script, *script->ptrReadPos);
subtract_fortress_keys(num);
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, MakeItemEntity);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, MakeItemEntity);
INCLUDE_ASM(code_fa4c0_len_3bf0, DropItemEntity);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, DropItemEntity);
INCLUDE_ASM(code_fa4c0_len_3bf0, DropItemEntityB);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, DropItemEntityB);
/*
// Close to working
s32 DropItemEntityB(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus DropItemEntityB(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32 x = get_variable(script, *ptrReadPos++);
s32 y = get_variable(script, *ptrReadPos++);
@ -277,32 +277,32 @@ s32 DropItemEntityB(script_context* script, s32 initialCall) {
script->varTable[0] = make_item_entity_nodelay(itemID, x, y, z);
set_item_entity_flags(script, 0x4000);
return 2;
return ApiStatus_DONE2;
}
*/
s32 RemoveItemEntity(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus RemoveItemEntity(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemEntityIndex = get_variable(script, *ptrReadPos++);
remove_item_entity_by_index(itemEntityIndex);
return 2;
return ApiStatus_DONE2;
}
s32 AddBadge(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus AddBadge(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = (s32 *) *ptrReadPos++;
set_variable(script, ptrNextPos, add_badge(itemID));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, RemoveBadge);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, RemoveBadge);
s32 SetItemPos(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
item_entity* ptrItemEntity;
ApiStatus SetItemPos(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
ItemEntity* ptrItemEntity;
s32 itemEntityIndex;
s32 x, y, z;
@ -311,96 +311,96 @@ s32 SetItemPos(script_context* script, s32 initialCall) {
y = get_variable(script, *ptrReadPos++);
z = get_variable(script, *ptrReadPos++);
ptrItemEntity = (item_entity *) get_item_entity(itemEntityIndex);
ptrItemEntity = (ItemEntity *) get_item_entity(itemEntityIndex);
ptrItemEntity->position.x = x;
ptrItemEntity->position.y = y;
ptrItemEntity->position.z = z;
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, SetItemFlags);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, SetItemFlags);
s32 AddCoin(script_context* script, s32 initialCall) {
ApiStatus AddCoin(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = add_coins(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 AddStarPoints(script_context* script, s32 initialCall) {
ApiStatus AddStarPoints(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = add_star_points(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
s32 AddStarPieces(script_context* script, s32 initialCall) {
ApiStatus AddStarPieces(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = add_star_pieces(get_variable(script, *script->ptrReadPos));
return 2;
return ApiStatus_DONE2;
}
INCLUDE_ASM(code_fa4c0_len_3bf0, GetItemPower);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, GetItemPower);
/*
// Close to working
s32 GetItemPower(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus GetItemPower(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32 itemID = get_variable(script, *ptrReadPos++);
s32* ptrNextPos = ptrReadPos++;
item_table_entry* item = &gItemTable[itemID];
set_variable(script, ptrNextPos++, item->potencyA);
set_variable(script, ptrNextPos++, item->potencyB);
return 2;
return ApiStatus_DONE2;
}
*/
INCLUDE_ASM(code_fa4c0_len_3bf0, ShowGotItem);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, ShowGotItem);
INCLUDE_ASM(code_fa4c0_len_3bf0, func_802D7460);
INCLUDE_ASM(code_fa4c0_len_3bf0, func_802D74C0);
INCLUDE_ASM(code_fa4c0_len_3bf0, ShowEmote);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, ShowEmote);
INCLUDE_ASM(code_fa4c0_len_3bf0, RemoveEffect);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, RemoveEffect);
/*
// Works
s32 RemoveEffect(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus RemoveEffect(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
remove_effect(get_variable(script, *ptrReadPos++));
return 2;
return ApiStatus_DONE2;
}
// Works
s32 func_802D7B10(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus func_802D7B10(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32* ptrValue = get_variable(script, *ptrReadPos++);
*ptrValue |= 0x10;
return 2;
return ApiStatus_DONE2;
}
// Works
s32 func_802D7B44(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus func_802D7B44(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32* ptrValue = get_variable(script, *ptrReadPos++);
s32* ptrTemp = ptrValue[3];
ptrTemp[5] = 10;
return 2;
return ApiStatus_DONE2;
}
// Works
s32 func_802D7B74(script_context* script, s32 initialCall) {
s32* ptrReadPos = script->ptrReadPos;
ApiStatus func_802D7B74(ScriptInstance* script, s32 isInitialCall) {
Bytecode* ptrReadPos = script->ptrReadPos;
s32* ptrValue = get_variable(script, *ptrReadPos++);
s32* ptrTemp = ptrValue[3];
ptrTemp[11] = 5;
return 2;
return ApiStatus_DONE2;
}
// More functions still in RemoveEffect.s but the ones above are matching properly
*/
INCLUDE_ASM(code_fa4c0_len_3bf0, ShowSleepBubble);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, ShowSleepBubble);
INCLUDE_ASM(code_fa4c0_len_3bf0, PlayEffect);
INCLUDE_API_ASM(code_fa4c0_len_3bf0, PlayEffect);

View File

@ -1,37 +1,37 @@
#include "common.h"
INCLUDE_ASM(code_fe0b0_len_5a0, SetSpriteShading);
INCLUDE_API_ASM(code_fe0b0_len_5a0, SetSpriteShading);
s32 EnableSpriteShading(script_context* script) {
ApiStatus EnableSpriteShading(ScriptInstance* script, s32 isInitialCall) {
if (get_variable(script, *script->ptrReadPos) != 0) {
*D_80151328 |= 1;
} else {
*D_80151328 &= ~1;
}
return 2;
return ApiStatus_DONE2;
}
s32 getDemoState(script_context* script) {
s32 getDemoState(ScriptInstance* script) {
set_variable(script, *script->ptrReadPos, (*gGameStatusPtr)->demoState);
return 2;
return ApiStatus_DONE2;
}
s32 DemoPressButton(script_context* script) {
ApiStatus DemoPressButton(ScriptInstance* script, s32 isInitialCall) {
(*gGameStatusPtr)->demoButtonInput |= get_variable(script, *script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
s32 DemoReleaseButton(script_context* script) {
ApiStatus DemoReleaseButton(ScriptInstance* script, s32 isInitialCall) {
(*gGameStatusPtr)->demoButtonInput &= ~get_variable(script, *script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
s32 DemoSetButtons(script_context* script) {
ApiStatus DemoSetButtons(ScriptInstance* script, s32 isInitialCall) {
(*gGameStatusPtr)->demoButtonInput = get_variable(script, *script->ptrReadPos);
return 2;
return ApiStatus_DONE2;
}
s32 DemoJoystickRadial(script_context* script) {
ApiStatus DemoJoystickRadial(ScriptInstance* script, s32 isInitialCall) {
f32 a;
f32 b;
s32* thisPos = script->ptrReadPos;
@ -42,10 +42,10 @@ s32 DemoJoystickRadial(script_context* script) {
(*gGameStatusPtr)->demoStickX = a * sin_deg(b);
(*gGameStatusPtr)->demoStickY = a * cos_deg(b);
return 2;
return ApiStatus_DONE2;
}
s32 DemoJoystickXY(script_context* script) {
ApiStatus DemoJoystickXY(ScriptInstance* script, s32 isInitialCall) {
f32 x;
f32 y;
s32* thisPos = script->ptrReadPos;
@ -56,5 +56,5 @@ s32 DemoJoystickXY(script_context* script) {
(*gGameStatusPtr)->demoStickX = x;
(*gGameStatusPtr)->demoStickY = y;
return 2;
return ApiStatus_DONE2;
}

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_39cb0_len_100, nuBoot);
INCLUDE_API_ASM(os/code_39cb0_len_100, nuBoot);
INCLUDE_ASM(os/code_39cb0_len_100, boot_idle);

View File

@ -1,27 +1,27 @@
#include "common.h"
INCLUDE_ASM(os/code_39db0_len_8a0, nuScCreateScheduler);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScCreateScheduler);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScExecuteAudio);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScExecuteAudio);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScExecuteGraphics);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScExecuteGraphics);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScAddClient);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScAddClient);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScRemoveClient);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScRemoveClient);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScResetClientMesgType);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScResetClientMesgType);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScGetGfxMQ);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScGetGfxMQ);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScGetAudioMQ);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScGetAudioMQ);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScSetFrameBufferNum);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScSetFrameBufferNum);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScGetFrameRate);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScGetFrameRate);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScEventHandler);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScEventHandler);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScEventBroadcast);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScEventBroadcast);
INCLUDE_ASM(os/code_39db0_len_8a0, nuScWaitTaskReady);
INCLUDE_API_ASM(os/code_39db0_len_8a0, nuScWaitTaskReady);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3a650_len_40, nuGfxFuncSet);
INCLUDE_API_ASM(os/code_3a650_len_40, nuGfxFuncSet);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3a690_len_40, nuGfxPreNMIFuncSet);
INCLUDE_API_ASM(os/code_3a690_len_40, nuGfxPreNMIFuncSet);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3a6d0_len_20, nuGfxTaskAllEndWait);
INCLUDE_API_ASM(os/code_3a6d0_len_20, nuGfxTaskAllEndWait);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3a6f0_len_110, nuGfxSetCfb);
INCLUDE_API_ASM(os/code_3a6f0_len_110, nuGfxSetCfb);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3a800_len_30, nuGfxDisplayOff);
INCLUDE_API_ASM(os/code_3a800_len_30, nuGfxDisplayOff);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3a830_len_20, nuGfxDisplayOn);
INCLUDE_API_ASM(os/code_3a830_len_20, nuGfxDisplayOn);

View File

@ -1,44 +1,44 @@
#include "common.h"
INCLUDE_ASM(os/code_3a850_le_a40, nuPiInit);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuPiInit);
INCLUDE_ASM(os/code_3a850_le_a40, nuPiReadRom);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuPiReadRom);
INCLUDE_ASM(os/code_3a850_le_a40, nuGfxInit);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuGfxInit);
INCLUDE_ASM(os/code_3a850_le_a40, nuContInit);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuContInit);
INCLUDE_ASM(os/code_3a850_le_a40, nuContDataGet);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuContDataGet);
INCLUDE_ASM(os/code_3a850_le_a40, nuContPakMgrInit);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuContPakMgrInit);
INCLUDE_ASM(os/code_3a850_le_a40, nuContPakMgrRemove);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuContPakMgrRemove);
INCLUDE_ASM(os/code_3a850_le_a40, contPakOpen);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakOpen);
INCLUDE_ASM(os/code_3a850_le_a40, contPakFree);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakFree);
INCLUDE_ASM(os/code_3a850_le_a40, contPakFileReadWrite);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakFileReadWrite);
INCLUDE_ASM(os/code_3a850_le_a40, contPakFileOpen);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakFileOpen);
INCLUDE_ASM(os/code_3a850_le_a40, contPakFileDelete);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakFileDelete);
INCLUDE_ASM(os/code_3a850_le_a40, contPakFileState);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakFileState);
INCLUDE_ASM(os/code_3a850_le_a40, contPakFileNum);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakFileNum);
INCLUDE_ASM(os/code_3a850_le_a40, contPakRepairId);
INCLUDE_API_ASM(os/code_3a850_le_a40, contPakRepairId);
#undef osMotorStop
s32 INCLUDE_ASM(os/code_3a850_le_a40, osMotorStop, OSPfs* unk);
INCLUDE_ASM(os/code_3a850_le_a40, contRmbControl);
INCLUDE_API_ASM(os/code_3a850_le_a40, contRmbControl);
INCLUDE_ASM(os/code_3a850_le_a40, nuContRmbMgrInit);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuContRmbMgrInit);
INCLUDE_ASM(os/code_3a850_le_a40, nuContRmbMgrRemove);
INCLUDE_API_ASM(os/code_3a850_le_a40, nuContRmbMgrRemove);
INCLUDE_ASM(os/code_3a850_le_a40, contRmbCheckMesg);
INCLUDE_API_ASM(os/code_3a850_le_a40, contRmbCheckMesg);
INCLUDE_ASM(os/code_3a850_le_a40, contRmbStartMesg);
INCLUDE_API_ASM(os/code_3a850_le_a40, contRmbStartMesg);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_3b290_len_100, nuContRmbStart);
INCLUDE_API_ASM(os/code_3b290_len_100, nuContRmbStart);
INCLUDE_ASM(os/code_3b290_len_100, nuContRmbCheck);
INCLUDE_API_ASM(os/code_3b290_len_100, nuContRmbCheck);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3b390_len_110, nuContRmbModeSet);
INCLUDE_API_ASM(os/code_3b390_len_110, nuContRmbModeSet);

View File

@ -1,11 +1,11 @@
#include "common.h"
INCLUDE_ASM(os/code_3b4a0_len_270, nuContRmbForceStop);
INCLUDE_API_ASM(os/code_3b4a0_len_270, nuContRmbForceStop);
INCLUDE_ASM(os/code_3b4a0_len_270, nuContRmbForceStopEnd);
INCLUDE_API_ASM(os/code_3b4a0_len_270, nuContRmbForceStopEnd);
INCLUDE_ASM(os/code_3b4a0_len_270, nuPiReadRomOverlay);
INCLUDE_API_ASM(os/code_3b4a0_len_270, nuPiReadRomOverlay);
INCLUDE_ASM(os/code_3b4a0_len_270, nuGfxThreadStart);
INCLUDE_API_ASM(os/code_3b4a0_len_270, nuGfxThreadStart);
INCLUDE_ASM(os/code_3b4a0_len_270, nuGfxThread);
INCLUDE_API_ASM(os/code_3b4a0_len_270, nuGfxThread);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3b710_len_40, nuGfxSwapCfbFuncSet);
INCLUDE_API_ASM(os/code_3b710_len_40, nuGfxSwapCfbFuncSet);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3b770_len_80, nuGfxRetraceWait);
INCLUDE_API_ASM(os/code_3b770_len_80, nuGfxRetraceWait);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_3b7f0_len_120, nuSiCallBackAdd);
INCLUDE_API_ASM(os/code_3b7f0_len_120, nuSiCallBackAdd);
INCLUDE_ASM(os/code_3b7f0_len_120, nuSiCallBackRemove);
INCLUDE_API_ASM(os/code_3b7f0_len_120, nuSiCallBackRemove);

View File

@ -1,21 +1,21 @@
#include "common.h"
INCLUDE_ASM(os/code_3b910_len_410, nuContMgrInit);
INCLUDE_API_ASM(os/code_3b910_len_410, nuContMgrInit);
INCLUDE_ASM(os/code_3b910_len_410, nuContMgrRemove);
INCLUDE_API_ASM(os/code_3b910_len_410, nuContMgrRemove);
INCLUDE_ASM(os/code_3b910_len_410, nuContDataClose);
INCLUDE_API_ASM(os/code_3b910_len_410, nuContDataClose);
INCLUDE_ASM(os/code_3b910_len_410, nuContDataOpen);
INCLUDE_API_ASM(os/code_3b910_len_410, nuContDataOpen);
INCLUDE_ASM(os/code_3b910_len_410, contRetrace);
INCLUDE_API_ASM(os/code_3b910_len_410, contRetrace);
INCLUDE_ASM(os/code_3b910_len_410, contReadData);
INCLUDE_API_ASM(os/code_3b910_len_410, contReadData);
INCLUDE_ASM(os/code_3b910_len_410, contReadNW);
INCLUDE_API_ASM(os/code_3b910_len_410, contReadNW);
INCLUDE_ASM(os/code_3b910_len_410, contQuery);
INCLUDE_API_ASM(os/code_3b910_len_410, contQuery);
INCLUDE_ASM(os/code_3b910_len_410, nuContDataLock);
INCLUDE_API_ASM(os/code_3b910_len_410, nuContDataLock);
INCLUDE_ASM(os/code_3b910_len_410, nuContDataUnLock);
INCLUDE_API_ASM(os/code_3b910_len_410, nuContDataUnLock);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_3bd20_len_c0, nuContQueryRead);
INCLUDE_API_ASM(os/code_3bd20_len_c0, nuContQueryRead);
OSIntMask INCLUDE_ASM(os/code_3bd20_len_c0, osSetIntMask, OSIntMask mask);

View File

@ -2,6 +2,6 @@
void INCLUDE_ASM(os/code_3bde0_len_3e0, osCreatePiManager, OSPri prio, OSMesgQueue* queue, OSMesg* mesg, s32 unk);
INCLUDE_ASM(os/code_3bde0_len_3e0, osEPiRawStartDma);
INCLUDE_API_ASM(os/code_3bde0_len_3e0, osEPiRawStartDma);
s32 INCLUDE_ASM(os/code_3bde0_len_3e0, osEPiWriteIo, OSPiHandle* handle, u32 unk1, u32 unk2);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3c490_len_3c0, osDevMgrMain);
INCLUDE_API_ASM(os/code_3c490_len_3c0, osDevMgrMain);

View File

@ -1,7 +1,7 @@
#include "common.h"
INCLUDE_ASM(os/code_3c850_len_f0, osPiCreateAccessQueue);
INCLUDE_API_ASM(os/code_3c850_len_f0, osPiCreateAccessQueue);
INCLUDE_ASM(os/code_3c850_len_f0, osPiGetAccess);
INCLUDE_API_ASM(os/code_3c850_len_f0, osPiGetAccess);
INCLUDE_ASM(os/code_3c850_len_f0, osPiRelAccess);
INCLUDE_API_ASM(os/code_3c850_len_f0, osPiRelAccess);

View File

@ -8,12 +8,12 @@ s32 INCLUDE_ASM(os/code_3cd00_len_5f0, osContStartReadData, OSMesgQueue* queue);
void INCLUDE_ASM(os/code_3cd00_len_5f0, osContGetReadData, OSContPad* pad);
INCLUDE_ASM(os/code_3cd00_len_5f0, osPackReadData);
INCLUDE_API_ASM(os/code_3cd00_len_5f0, osPackReadData);
s32 INCLUDE_ASM(os/code_3cd00_len_5f0, osContInit, OSMesgQueue* queue, u8* unk, OSContStatus* status);
INCLUDE_ASM(os/code_3cd00_len_5f0, osContGetInitData);
INCLUDE_API_ASM(os/code_3cd00_len_5f0, osContGetInitData);
INCLUDE_ASM(os/code_3cd00_len_5f0, osPackRequestData);
INCLUDE_API_ASM(os/code_3cd00_len_5f0, osPackRequestData);
u32 INCLUDE_ASM(os/code_3cd00_len_5f0, osVirtualToPhysical, void* virt);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_3d2f0_len_10, sqrtf);
INCLUDE_API_ASM(os/code_3d2f0_len_10, sqrtf);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_3f6d0_len_320, guRotateAnglesF);
INCLUDE_API_ASM(os/code_3f6d0_len_320, guRotateAnglesF);
INCLUDE_ASM(os/code_3f6d0_len_320, guRotateAngles);
INCLUDE_API_ASM(os/code_3f6d0_len_320, guRotateAngles);

View File

@ -4,11 +4,11 @@ void INCLUDE_ASM(os/code_3fa50_len_f60, bcopy, const void* src, void* dst, int s
void INCLUDE_ASM(os/code_3fa50_len_f60, bzero, void* buf, int size);
INCLUDE_ASM(os/code_3fa50_len_f60, strchr);
INCLUDE_API_ASM(os/code_3fa50_len_f60, strchr);
INCLUDE_ASM(os/code_3fa50_len_f60, strlen);
INCLUDE_API_ASM(os/code_3fa50_len_f60, strlen);
INCLUDE_ASM(os/code_3fa50_len_f60, memcpy);
INCLUDE_API_ASM(os/code_3fa50_len_f60, memcpy);
INCLUDE_ASM(os/code_3fa50_len_f60, _Printf);
@ -16,6 +16,6 @@ INCLUDE_ASM(os/code_3fa50_len_f60, _Putfld);
int INCLUDE_ASM(os/code_3fa50_len_f60, sprintf, char* s, const char* fmt, ...);
INCLUDE_ASM(os/code_3fa50_len_f60, proutSprintf);
INCLUDE_API_ASM(os/code_3fa50_len_f60, proutSprintf);
void INCLUDE_ASM(os/code_3fa50_len_f60, osCreateMesgQueue, OSMesgQueue* queue, OSMesg* mesg, s32 unk);

View File

@ -4,4 +4,4 @@ void INCLUDE_ASM(os/code_41050_len_120, osSpTaskYield, void);
OSYieldResult INCLUDE_ASM(os/code_41050_len_120, osSpTaskYielded, OSTask* tp);
INCLUDE_ASM(os/code_41050_len_120, osSiRawStartDma);
INCLUDE_API_ASM(os/code_41050_len_120, osSiRawStartDma);

View File

@ -1,7 +1,7 @@
#include "common.h"
INCLUDE_ASM(os/code_41170_len_f0, osSiCreateAccessQueue);
INCLUDE_API_ASM(os/code_41170_len_f0, osSiCreateAccessQueue);
INCLUDE_ASM(os/code_41170_len_f0, osSiGetAccess);
INCLUDE_API_ASM(os/code_41170_len_f0, osSiGetAccess);
INCLUDE_ASM(os/code_41170_len_f0, osSiRelAccess);
INCLUDE_API_ASM(os/code_41170_len_f0, osSiRelAccess);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_41600_len_40, osDequeueThread);
INCLUDE_API_ASM(os/code_41600_len_40, osDequeueThread);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_41690_len_10, osGetActiveQueue);
INCLUDE_API_ASM(os/code_41690_len_10, osGetActiveQueue);

View File

@ -3,10 +3,10 @@
int INCLUDE_ASM(os/code_41750_len_450, osSetTimer, OSTimer* timer, OSTime start, OSTime end, OSMesgQueue* queue,
OSMesg mesg);
INCLUDE_ASM(os/code_41750_len_450, osTimerServicesInit);
INCLUDE_API_ASM(os/code_41750_len_450, osTimerServicesInit);
INCLUDE_ASM(os/code_41750_len_450, osTimerInterrupt);
INCLUDE_API_ASM(os/code_41750_len_450, osTimerInterrupt);
INCLUDE_ASM(os/code_41750_len_450, osSetTimerIntr);
INCLUDE_API_ASM(os/code_41750_len_450, osSetTimerIntr);
INCLUDE_ASM(os/code_41750_len_450, osInsertTimer);
INCLUDE_API_ASM(os/code_41750_len_450, osInsertTimer);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_41c60_len_c0, osProbeTLB);
INCLUDE_API_ASM(os/code_41c60_len_c0, osProbeTLB);

View File

@ -2,4 +2,4 @@
void INCLUDE_ASM(os/code_41e70_len_340, osCreateViManager, OSPri pri);
INCLUDE_ASM(os/code_41e70_len_340, viMgrMain);
INCLUDE_API_ASM(os/code_41e70_len_340, viMgrMain);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_42470_len_310, osViSwapContext);
INCLUDE_API_ASM(os/code_42470_len_310, osViSwapContext);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_42d60_len_80, guMtxCat);
INCLUDE_API_ASM(os/code_42d60_len_80, guMtxCat);

View File

@ -1,10 +1,10 @@
#include "common.h"
INCLUDE_ASM(os/code_43200_len_7c0, osMotorAccess);
INCLUDE_API_ASM(os/code_43200_len_7c0, osMotorAccess);
s32 INCLUDE_ASM(os/code_43200_len_7c0, osMotorInit, OSMesgQueue* queue, OSPfs* pfs, int unk);
s32 INCLUDE_ASM(os/code_43200_len_7c0, osPfsAllocateFile, OSPfs* pfs, u16 unk1, u32 unk2, u8* unk3, u8* unk4,
int unk5, s32* unk6);
INCLUDE_ASM(os/code_43200_len_7c0, osPfsDeclearPage);
INCLUDE_API_ASM(os/code_43200_len_7c0, osPfsDeclearPage);

View File

@ -2,4 +2,4 @@
s32 INCLUDE_ASM(os/code_439c0_len_220, osPfsDeleteFile, OSPfs* pfs, u16 unk1, u32 unk2, u8* unk3, u8* unk4);
INCLUDE_ASM(os/code_439c0_len_220, osPfsReleasePages);
INCLUDE_API_ASM(os/code_439c0_len_220, osPfsReleasePages);

View File

@ -6,4 +6,4 @@ s32 INCLUDE_ASM(os/code_44380_len_4e0, osPfsNumFiles, OSPfs* pfs, s32* unk1, s32
s32 INCLUDE_ASM(os/code_44380_len_4e0, osPfsInitPak, OSMesgQueue* queue, OSPfs* pfs, int unk1);
INCLUDE_ASM(os/code_44380_len_4e0, osPfsCheckRamArea);
INCLUDE_API_ASM(os/code_44380_len_4e0, osPfsCheckRamArea);

View File

@ -1,7 +1,7 @@
#include "common.h"
INCLUDE_ASM(os/code_448c0_len_210, osPfsGetStatus);
INCLUDE_API_ASM(os/code_448c0_len_210, osPfsGetStatus);
INCLUDE_ASM(os/code_448c0_len_210, osPfsRequestOneChannel);
INCLUDE_API_ASM(os/code_448c0_len_210, osPfsRequestOneChannel);
INCLUDE_ASM(os/code_448c0_len_210, osPfsGetOneChannelData);
INCLUDE_API_ASM(os/code_448c0_len_210, osPfsGetOneChannelData);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_44ad0_len_70, osPfsSelectBank);
INCLUDE_API_ASM(os/code_44ad0_len_70, osPfsSelectBank);

View File

@ -1,15 +1,15 @@
#include "common.h"
INCLUDE_ASM(os/code_44b40_len_a90, osSumcalc);
INCLUDE_API_ASM(os/code_44b40_len_a90, osSumcalc);
INCLUDE_ASM(os/code_44b40_len_a90, osIdCheckSum);
INCLUDE_API_ASM(os/code_44b40_len_a90, osIdCheckSum);
INCLUDE_ASM(os/code_44b40_len_a90, osRepairPackId);
INCLUDE_API_ASM(os/code_44b40_len_a90, osRepairPackId);
INCLUDE_ASM(os/code_44b40_len_a90, osCheckPackId);
INCLUDE_API_ASM(os/code_44b40_len_a90, osCheckPackId);
INCLUDE_ASM(os/code_44b40_len_a90, osGetId);
INCLUDE_API_ASM(os/code_44b40_len_a90, osGetId);
INCLUDE_ASM(os/code_44b40_len_a90, osCheckId);
INCLUDE_API_ASM(os/code_44b40_len_a90, osCheckId);
INCLUDE_ASM(os/code_44b40_len_a90, osPfsRWInode);
INCLUDE_API_ASM(os/code_44b40_len_a90, osPfsRWInode);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_455d0_len_1f0, osContRamRead);
INCLUDE_API_ASM(os/code_455d0_len_1f0, osContRamRead);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_457c0_len_270, osContRamWrite);
INCLUDE_API_ASM(os/code_457c0_len_270, osContRamWrite);

View File

@ -2,13 +2,13 @@
INCLUDE_ASM(os/code_45df0_len_970, func_8006A9F0);
INCLUDE_ASM(os/code_45df0_len_970, osExceptionPreamble);
INCLUDE_API_ASM(os/code_45df0_len_970, osExceptionPreamble);
INCLUDE_ASM(os/code_45df0_len_970, savecontext);
INCLUDE_API_ASM(os/code_45df0_len_970, savecontext);
INCLUDE_ASM(os/code_45df0_len_970, savercp);
INCLUDE_API_ASM(os/code_45df0_len_970, savercp);
INCLUDE_ASM(os/code_45df0_len_970, endrcp);
INCLUDE_API_ASM(os/code_45df0_len_970, endrcp);
INCLUDE_ASM(os/code_45df0_len_970, handle_interrupt);
@ -18,41 +18,41 @@ INCLUDE_ASM(os/code_45df0_len_970, IP6_Hdlr);
INCLUDE_ASM(os/code_45df0_len_970, IP7_Hdlr);
INCLUDE_ASM(os/code_45df0_len_970, counter);
INCLUDE_API_ASM(os/code_45df0_len_970, counter);
INCLUDE_ASM(os/code_45df0_len_970, cart);
INCLUDE_API_ASM(os/code_45df0_len_970, cart);
INCLUDE_ASM(os/code_45df0_len_970, rcp);
INCLUDE_API_ASM(os/code_45df0_len_970, rcp);
INCLUDE_ASM(os/code_45df0_len_970, sp_other_break);
INCLUDE_ASM(os/code_45df0_len_970, vi);
INCLUDE_API_ASM(os/code_45df0_len_970, vi);
INCLUDE_ASM(os/code_45df0_len_970, ai);
INCLUDE_API_ASM(os/code_45df0_len_970, ai);
INCLUDE_ASM(os/code_45df0_len_970, si);
INCLUDE_API_ASM(os/code_45df0_len_970, si);
INCLUDE_ASM(os/code_45df0_len_970, pi);
INCLUDE_API_ASM(os/code_45df0_len_970, pi);
INCLUDE_ASM(os/code_45df0_len_970, dp);
INCLUDE_API_ASM(os/code_45df0_len_970, dp);
INCLUDE_ASM(os/code_45df0_len_970, NoMoreRcpInts);
INCLUDE_API_ASM(os/code_45df0_len_970, NoMoreRcpInts);
INCLUDE_ASM(os/code_45df0_len_970, prenmi);
INCLUDE_API_ASM(os/code_45df0_len_970, prenmi);
INCLUDE_ASM(os/code_45df0_len_970, firstnmi);
INCLUDE_API_ASM(os/code_45df0_len_970, firstnmi);
INCLUDE_ASM(os/code_45df0_len_970, sw2);
INCLUDE_API_ASM(os/code_45df0_len_970, sw2);
INCLUDE_ASM(os/code_45df0_len_970, sw1);
INCLUDE_API_ASM(os/code_45df0_len_970, sw1);
INCLUDE_ASM(os/code_45df0_len_970, handle_break);
INCLUDE_ASM(os/code_45df0_len_970, redispatch);
INCLUDE_API_ASM(os/code_45df0_len_970, redispatch);
INCLUDE_ASM(os/code_45df0_len_970, enqueueRunning);
INCLUDE_API_ASM(os/code_45df0_len_970, enqueueRunning);
INCLUDE_ASM(os/code_45df0_len_970, panic);
INCLUDE_API_ASM(os/code_45df0_len_970, panic);
INCLUDE_ASM(os/code_45df0_len_970, send_mesg);
@ -60,18 +60,18 @@ INCLUDE_ASM(os/code_45df0_len_970, send_done);
INCLUDE_ASM(os/code_45df0_len_970, handle_CPU);
INCLUDE_ASM(os/code_45df0_len_970, osEnqueueAndYield);
INCLUDE_API_ASM(os/code_45df0_len_970, osEnqueueAndYield);
INCLUDE_ASM(os/code_45df0_len_970, noEnqueue);
INCLUDE_API_ASM(os/code_45df0_len_970, noEnqueue);
INCLUDE_ASM(os/code_45df0_len_970, osEnqueueThread);
INCLUDE_API_ASM(os/code_45df0_len_970, osEnqueueThread);
INCLUDE_ASM(os/code_45df0_len_970, osPopThread);
INCLUDE_API_ASM(os/code_45df0_len_970, osPopThread);
INCLUDE_ASM(os/code_45df0_len_970, osNop);
INCLUDE_API_ASM(os/code_45df0_len_970, osNop);
INCLUDE_ASM(os/code_45df0_len_970, osDispatchThread);
INCLUDE_API_ASM(os/code_45df0_len_970, osDispatchThread);
INCLUDE_ASM(os/code_45df0_len_970, osDispatchThreadSave);
INCLUDE_API_ASM(os/code_45df0_len_970, osDispatchThreadSave);
void INCLUDE_ASM(os/code_45df0_len_970, osCleanupThread, void);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_467f0_len_90, osSetGlobalIntMask);
INCLUDE_API_ASM(os/code_467f0_len_90, osSetGlobalIntMask);
INCLUDE_ASM(os/code_467f0_len_90, osResetGlobalIntMask);
INCLUDE_API_ASM(os/code_467f0_len_90, osResetGlobalIntMask);

View File

@ -1,7 +1,7 @@
#include "common.h"
INCLUDE_ASM(os/code_46880_len_260, osPiRawStartDma);
INCLUDE_API_ASM(os/code_46880_len_260, osPiRawStartDma);
INCLUDE_ASM(os/code_46880_len_260, osPiGetCmdQueue);
INCLUDE_API_ASM(os/code_46880_len_260, osPiGetCmdQueue);
INCLUDE_ASM(os/code_46880_len_260, osEPiRawReadIo);
INCLUDE_API_ASM(os/code_46880_len_260, osEPiRawReadIo);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_46ae0_len_170, osEPiRawWriteIo);
INCLUDE_API_ASM(os/code_46ae0_len_170, osEPiRawWriteIo);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_46c50_len_20, osAiDeviceBusy);
INCLUDE_API_ASM(os/code_46c50_len_20, osAiDeviceBusy);

View File

@ -10,4 +10,4 @@ INCLUDE_ASM(os/code_46c70_len_e00, _Ldunscale);
INCLUDE_ASM(os/code_46c70_len_e00, _Genld);
INCLUDE_ASM(os/code_46c70_len_e00, osGetCause);
INCLUDE_API_ASM(os/code_46c70_len_e00, osGetCause);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_47a70_len_10, osGetSR);
INCLUDE_API_ASM(os/code_47a70_len_10, osGetSR);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_47a80_len_10, osSetCompare);
INCLUDE_API_ASM(os/code_47a80_len_10, osSetCompare);

View File

@ -1,9 +1,9 @@
#include "common.h"
INCLUDE_ASM(os/code_47a90_len_50, osSetFpcCsr);
INCLUDE_API_ASM(os/code_47a90_len_50, osSetFpcCsr);
INCLUDE_ASM(os/code_47a90_len_50, osSetSR);
INCLUDE_API_ASM(os/code_47a90_len_50, osSetSR);
INCLUDE_ASM(os/code_47a90_len_50, osSetWatchLo);
INCLUDE_API_ASM(os/code_47a90_len_50, osSetWatchLo);
INCLUDE_ASM(os/code_47a90_len_50, osSpDeviceBusy);
INCLUDE_API_ASM(os/code_47a90_len_50, osSpDeviceBusy);

View File

@ -1,9 +1,9 @@
#include "common.h"
INCLUDE_ASM(os/code_47ae0_len_e0, osSpGetStatus);
INCLUDE_API_ASM(os/code_47ae0_len_e0, osSpGetStatus);
INCLUDE_ASM(os/code_47ae0_len_e0, osSpSetStatus);
INCLUDE_API_ASM(os/code_47ae0_len_e0, osSpSetStatus);
INCLUDE_ASM(os/code_47ae0_len_e0, osSpSetPc);
INCLUDE_API_ASM(os/code_47ae0_len_e0, osSpSetPc);
INCLUDE_ASM(os/code_47ae0_len_e0, osSpRawStartDma);
INCLUDE_API_ASM(os/code_47ae0_len_e0, osSpRawStartDma);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_47bc0_len_50, osSiRawReadIo);
INCLUDE_API_ASM(os/code_47bc0_len_50, osSiRawReadIo);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_47c10_len_50, osSiRawWriteIo);
INCLUDE_API_ASM(os/code_47c10_len_50, osSiRawWriteIo);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_47c60_len_f0, osContAddressCrc);
INCLUDE_API_ASM(os/code_47c60_len_f0, osContAddressCrc);
INCLUDE_ASM(os/code_47c60_len_f0, osContDataCrc);
INCLUDE_API_ASM(os/code_47c60_len_f0, osContDataCrc);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_47e90_len_110, osViInit);
INCLUDE_API_ASM(os/code_47e90_len_110, osViInit);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_47fa0_len_20, osViGetCurrentContext);
INCLUDE_API_ASM(os/code_47fa0_len_20, osViGetCurrentContext);

View File

@ -4,10 +4,10 @@ s32 INCLUDE_ASM(os/code_48020_len_a00, osPfsChecker, OSPfs* pfs);
INCLUDE_ASM(os/code_48020_len_a00, corrupted_init);
INCLUDE_ASM(os/code_48020_len_a00, corrupted);
INCLUDE_API_ASM(os/code_48020_len_a00, corrupted);
s32 INCLUDE_ASM(os/code_48020_len_a00, osPfsIsPlug, OSMesgQueue* queue, u8* unk);
INCLUDE_ASM(os/code_48020_len_a00, osPfsRequestData);
INCLUDE_API_ASM(os/code_48020_len_a00, osPfsRequestData);
INCLUDE_ASM(os/code_48020_len_a00, osPfsGetInitData);
INCLUDE_API_ASM(os/code_48020_len_a00, osPfsGetInitData);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_48a20_len_1c0, ldiv);
INCLUDE_API_ASM(os/code_48a20_len_1c0, ldiv);
INCLUDE_ASM(os/code_48a20_len_1c0, lldiv);
INCLUDE_API_ASM(os/code_48a20_len_1c0, lldiv);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_48be0_len_20, osSiDeviceBusy);
INCLUDE_API_ASM(os/code_48be0_len_20, osSiDeviceBusy);

View File

@ -1,5 +1,5 @@
#include "common.h"
INCLUDE_ASM(os/code_4a140_len_70, strcpy);
INCLUDE_API_ASM(os/code_4a140_len_70, strcpy);
INCLUDE_ASM(os/code_4a140_len_70, strcmp);
INCLUDE_API_ASM(os/code_4a140_len_70, strcmp);

View File

@ -1,3 +1,3 @@
#include "common.h"
INCLUDE_ASM(os/code_4a1b0_len_40, memset);
INCLUDE_API_ASM(os/code_4a1b0_len_40, memset);

View File

@ -2,20 +2,20 @@
INCLUDE_ASM(os/code_4a360_len_930, func_8008EF60);
INCLUDE_ASM(os/code_4a360_len_930, osFlashInit);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashInit);
INCLUDE_ASM(os/code_4a360_len_930, osFlashReadStatus);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashReadStatus);
INCLUDE_ASM(os/code_4a360_len_930, osFlashReadId);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashReadId);
INCLUDE_ASM(os/code_4a360_len_930, osFlashClearStatus);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashClearStatus);
INCLUDE_ASM(os/code_4a360_len_930, osFlashAllErase);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashAllErase);
INCLUDE_ASM(os/code_4a360_len_930, osFlashSectorErase);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashSectorErase);
INCLUDE_ASM(os/code_4a360_len_930, osFlashWriteBuffer);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashWriteBuffer);
INCLUDE_ASM(os/code_4a360_len_930, osFlashWriteArray);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashWriteArray);
INCLUDE_ASM(os/code_4a360_len_930, osFlashReadArray);
INCLUDE_API_ASM(os/code_4a360_len_930, osFlashReadArray);

View File

@ -1,7 +1,7 @@
#include "common.h"
INCLUDE_ASM(os/code_7e40_len_3f0, nuGfxTaskMgr);
INCLUDE_API_ASM(os/code_7e40_len_3f0, nuGfxTaskMgr);
INCLUDE_ASM(os/code_7e40_len_3f0, nuGfxTaskMgrInit);
INCLUDE_API_ASM(os/code_7e40_len_3f0, nuGfxTaskMgrInit);
INCLUDE_ASM(os/code_7e40_len_3f0, nuGfxTaskStart);
INCLUDE_API_ASM(os/code_7e40_len_3f0, nuGfxTaskStart);

View File

@ -3,7 +3,7 @@
import os
import re
from glob import glob
from stringcase import constcase # pip install stringcase
from stringcase import constcase, pascalcase # pip install stringcase
DIR = os.path.dirname(__file__)
SR_DATABASE = os.path.join(DIR, "star-rod/database")
@ -19,7 +19,7 @@ with open(os.path.join(DIR, "../include/enums.h"), "w") as h:
#define _ENUMS_H_
#include "ultra64.h"
#include "types.h"
#include "types.h"
""")
@ -28,10 +28,27 @@ with open(os.path.join(DIR, "../include/enums.h"), "w") as h:
lines = file.readlines()
# Get enum attributes
namespace = constcase(re.match(r"[^ \t]*", lines[0]).group(0))
namespace = pascalcase(re.match(r"[^ \t]*", lines[0]).group(0))
library_name = re.match(r"[^ \t]*", lines[1]).group(0)
reverse = True if re.match(r"[^ \t]*", lines[2]).group(0) == "true" else False
# Renamed namespaces
if namespace == "Item": namespace = "ItemId"
if namespace == "Sound": namespace = "SoundId"
if namespace == "Partner": namespace = "PartnerId"
if namespace == "Sprite": namespace = "SpriteId"
if namespace == "Outcome": namespace = "EncounterOutcome"
#if namespace == "Phase": namespace = "BattlePhase"
if namespace == "Actor": namespace = "ActorId"
#if namespace == "Status": namespace = "ActorStatus"
#if namespace == "StatusFlags": namespace = "ActorStatusFlags"
#if namespace == "Event": namespace = "BattleEvent"
if namespace == "Decoration": namespace = "DecorationId"
if namespace == "Npc": namespace = "NpcId"
if namespace == "Trigger": namespace = "TriggerFlags"
if namespace == "Anim": continue
if namespace == "Entity": continue # just ram addresses
# Get a list of tuples containing (name, value)
items = []
name_max_len = 0
@ -51,8 +68,9 @@ with open(os.path.join(DIR, "../include/enums.h"), "w") as h:
str_value = f"{value}"
else:
str_value = "0x" + f"{value:08x}".upper()
name = constcase(name)
if name.upper() != name:
name = constcase(name)
items.append((name, str_value))
name_max_len = max(len(name), name_max_len)
elif "/%" in line:
@ -66,4 +84,4 @@ with open(os.path.join(DIR, "../include/enums.h"), "w") as h:
h.write(f"#define {namespace}_{name.ljust(name_max_len)} {value}\n")
h.write("\n")
h.write("#endif\n")
h.write("#endif\n")

View File

@ -10,10 +10,10 @@ gGlobalTimeSpace = 0x802D9CA8;
D_80147574 = 0x80147574;
gMapTransitionAlpha = 0x800A0940;
D_800E92D8 = 0x800E92D8;
D_80147474 = 0x80147474;
D_80109270 = 0x80109270;
D_80108558 = 0x80108558;
D_800E92D8 = 0x800E92D8;
D_80147474 = 0x80147474;
D_80109270 = 0x80109270;
D_80108558 = 0x80108558;
D_800A0940 = 0x800A0940;
D_800A0942 = 0x800A0942;
D_800A0944 = 0x800A0944;
@ -76,6 +76,32 @@ gCurrentTriggerListPtr = 0x80159390;
D_801595A0 = 0x801595A0;
D_8015C7C0 = 0x8015C7C0;
gWorldModelList = 0x80151770;
gBattleModelList = 0x80151B70;
gCurrentModelListPtr = 0x801512CC;
gWorldModelSpecialDls = 0x8015F90;
gBattleModelSpecialDls = 0x80152010;
gCurrentModelSpecialDlsPtr = 0x801512E8;
gWorldEntityList = 0x80151380;
gWorldBattleEntityList = 0x801513F8;
gCurrentEntityListPtr = 0x80151470;
gWorldShadowList = 0x80151478;
gBattleShadowList = 0x80151568;
gCurrentShadowListPtr = 0x80151658;
gMainGameState = 0x80151700;
gCurrentUpdateFunction = 0x8015170C;
gWorldDynamicEntityList = 0x801543A0;
gBattleDynamicEntityList = 0x801543E0;
gCurrentDynamicEntityListPtr = 0x80154420;
gScriptIdList = 0x802D1898;
gScriptIndexList = 0x802DAA98;
func_802A91F8 = 0x802A91F8;
func_802A9208 = 0x802A9208;
func_802A9228 = 0x802A9228;