aboutsummaryrefslogtreecommitdiffstats
path: root/engine/overworld/clear_variables.asm
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-12-31 17:23:54 -0800
committerYamaArashi <shadow962@live.com>2016-12-31 17:23:54 -0800
commitbf67f7174d8e3f1348c786618ee5a3a076d1eff8 (patch)
tree41dfcd420ce30d4b077d2055e096ea40e4a229a5 /engine/overworld/clear_variables.asm
parentuse hardware constants in pic.asm (diff)
downloadpokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.tar.gz
pokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.tar.xz
pokeyellow-bf67f7174d8e3f1348c786618ee5a3a076d1eff8.zip
split code out of main.asm
Diffstat (limited to 'engine/overworld/clear_variables.asm')
-rw-r--r--engine/overworld/clear_variables.asm20
1 files changed, 20 insertions, 0 deletions
diff --git a/engine/overworld/clear_variables.asm b/engine/overworld/clear_variables.asm
new file mode 100644
index 00000000..9a59cc7c
--- /dev/null
+++ b/engine/overworld/clear_variables.asm
@@ -0,0 +1,20 @@
+ClearVariablesOnEnterMap:
+ ld a, SCREEN_HEIGHT_PIXELS
+ ld [hWY], a
+ ld [rWY], a
+ xor a
+ ld [H_AUTOBGTRANSFERENABLED], a
+ ld [wStepCounter], a
+ ld [wLoneAttackNo], a
+ ld [hJoyPressed], a
+ ld [hJoyReleased], a
+ ld [hJoyHeld], a
+ ld [wActionResultOrTookBattleTurn], a
+ ld [wUnusedD5A3], a
+ ld hl, wCardKeyDoorY
+ ld [hli], a
+ ld [hl], a
+ ld hl, wWhichTrade
+ ld bc, wStandingOnWarpPadOrHole - wWhichTrade
+ call FillMemory
+ ret