From 84a3b335aa119c536be8186a6c1b91a31a7963c1 Mon Sep 17 00:00:00 2001 From: "Colton G. Rushton" Date: Fri, 17 Jun 2022 23:30:53 -0300 Subject: [PATCH] Document that `farcall` returns `c` in `a` for some code (#937) --- engine/overworld/events.asm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index ffbd01dee..5ef11e7c6 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -1085,9 +1085,13 @@ TryTileCollisionEvent:: call GetFacingTileCoord ld [wFacingTileID], a ld c, a + ; CheckFacingTileForStdScript preserves c, and + ; farcall copies c back into a. farcall CheckFacingTileForStdScript jr c, .done + ; CheckCutTreeTile expects a == [wFacingTileID], which + ; it still is after the previous farcall. call CheckCutTreeTile jr nz, .whirlpool farcall TryCutOW