summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorISSOtm <eldredhabert0@gmail.com>2018-06-06 00:43:42 +0200
committerISSOtm <eldredhabert0@gmail.com>2018-06-06 00:44:41 +0200
commita9519e401db0c8db0b96cee3c0130c3fe8a4a58b (patch)
tree846df4dbab2f7ac99d429af9dc0312901e4fe4ae /home
parente9a8f8a769f77c289a4aa38423a39e00425b4813 (diff)
Disassemble map script function
Part 1 of disassembling map loading functions
Diffstat (limited to 'home')
-rw-r--r--home/map.asm26
1 files changed, 26 insertions, 0 deletions
diff --git a/home/map.asm b/home/map.asm
new file mode 100644
index 0000000..2583643
--- /dev/null
+++ b/home/map.asm
@@ -0,0 +1,26 @@
+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