summaryrefslogtreecommitdiff
path: root/home/map.asm
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-06-05 22:55:55 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2018-06-05 22:55:55 -0400
commit779eb6750d08504c9667eb10cd7c68f0e2e8498d (patch)
tree2736ac858597395ddfb7d66c66e650aeef6405de /home/map.asm
parent30f2d056f933fa8dda5ba751ea6645d1d634142a (diff)
parentd4a65343dada6f15a56818fdf6ddb000fb381a55 (diff)
Merge branch 'master' into rtc_fade
Diffstat (limited to 'home/map.asm')
-rw-r--r--home/map.asm35
1 files changed, 35 insertions, 0 deletions
diff --git a/home/map.asm b/home/map.asm
new file mode 100644
index 0000000..8ec34be
--- /dev/null
+++ b/home/map.asm
@@ -0,0 +1,35 @@
+INCLUDE "constants.asm"
+
+SECTION "Map functions", ROM0[$20FF]
+
+; Runs a map script indexed by wMapScriptNumber
+RunMapScript:: ; 20ff
+ push hl
+ push de
+ push bc
+ ld a, [wMapScriptNumber]
+ add a, a
+ add a, a
+ ld d, 0
+ ld e, a
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld de, .return
+ push de
+ jp hl
+
+.return
+ pop bc
+ pop de
+ pop hl
+ ret
+
+SECTION "ClearMapBuffer", ROM0[$2123]
+ClearMapBuffer:: ; 00:2123
+ ld hl, wMapBuffer
+ ld bc, wMapBufferEnd - wMapBuffer
+ ld a, 0
+ call ByteFill
+ ret