Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split and match most functions at f8f60 #18

Merged
merged 22 commits into from
Aug 16, 2020
Merged

split and match most functions at f8f60 #18

merged 22 commits into from
Aug 16, 2020

Conversation

bates64
Copy link
Member

@bates64 bates64 commented Aug 15, 2020

Split and matched all functions in this file, other than:

  • Path-related functions - setup_path_data, for example, is huge!
  • func_802D4BDC, func_802D4C4C - has a redundant branch instruction that probably skipped a debug printf at one point. I don't know how to replicate this - the compiler optimises away the empty if block.
  • func_802D4CC4 - loads an f32 from 0xBF800000 - which is a reference to some DMA'd ROM data, I think.

Copy link
Member

@ethteck ethteck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks decent, awesome work!

Aside from my comments, wondering if we should start using the define for script function return values. Also we maybe should just shorten it to SI_ instead of SI_STATUS_

include/si_vars.h Outdated Show resolved Hide resolved
src/code_f8f60_len_1560.c Outdated Show resolved Hide resolved
include/common_structs.h Show resolved Hide resolved
include/common_structs.h Show resolved Hide resolved
include/variables.h Outdated Show resolved Hide resolved
src/code_f8f60_len_1560.c Outdated Show resolved Hide resolved
@bates64 bates64 mentioned this pull request Aug 15, 2020
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);

npc* get_npc_safe(NPC npcID);
npc* get_npc_unsafe(NPC npcID);
npc* resolve_npc(script_context* script, NPC npcID);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth declaring some kind of union for resolve_npc's second arg - e.g. union { npc* ptr; NPC special; u8 id }. AFAIK the get_npc don't check for NPC special and should just take a u8 id. We might even want to rename them - and suggest the same to Clover - to get_npc_by_id.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: changing the get_npc_ signatures to take a u8 rather than an s32 doesn't match.

include/types.h Outdated Show resolved Hide resolved
@ethteck ethteck merged commit 934bd5a into pmret:master Aug 16, 2020
@bates64 bates64 deleted the f8f60 branch August 16, 2020 02:53
z64a pushed a commit to z64a/papermario that referenced this pull request Mar 9, 2023
Added symbols and restructured game_status a little bit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants