Skip to content

Implicit waitmovement 0 - #2322

Open
mrgriffin wants to merge 4 commits into
pret:masterfrom
mrgriffin:pret-applywaitmovement
Open

Implicit waitmovement 0#2322
mrgriffin wants to merge 4 commits into
pret:masterfrom
mrgriffin:pret-applywaitmovement

Conversation

@mrgriffin

Copy link
Copy Markdown
Collaborator

Convenience macros for eliminating some explicit waitmovement 0s:

  1. applywaitmovement: Fused applymovement and waitmovement 0.
  2. Implicit waitmovement 0 for moverotatingtileobjects and turnrotatingtileobjects.

It is possible to create a variadic applywaitmovements macro, but I didn't think it would be practical because the lines would become very long. The remaining waitmovements are now mostly:

  1. After special PlayerFaceTrainerAfterBattle (could not add an implicit waitmovement here because not all calls to that special immediately waitmovement).
  2. After two or more applymovements.

Migration script for applywaitmovement: migrate_applywaitmovement.py.
WARNING: if there's complex control flow the linear "is it appropriate to fuse the waitmovement with the previous applymovement" might fuse when there's technically two or more applymovements and an explicit waitmovement 0 would be more idiomatic. It should not produce an incorrect result, but as always try comparing the sha1sum of your ROM before/after migration.

Comment thread asm/macros/event.inc Outdated
Comment thread asm/macros/event.inc Outdated
@mrgriffin

Copy link
Copy Markdown
Collaborator Author

Applied review suggestions: no more implicit argument to waitmovemet :)

Applied to moverotatingtileobjects and turnrotatingtileobjects.
@mrgriffin
mrgriffin force-pushed the pret-applywaitmovement branch from 88a48ab to 654b7fa Compare June 18, 2026 14:22
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.

2 participants