summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2018-03-14 13:28:36 +0100
committermid-kid <esteve.varela@gmail.com>2018-03-14 13:28:36 +0100
commit97c511cd2f271252cbc9e9746668081422231ca5 (patch)
tree35ef1cb72e871ef34e2b0011e514edae2b9cbcb7 /engine/overworld
parentbaa0dc5a963a79843b37888bcfe1d2dfe833ade9 (diff)
Organize the engine/ directory, take 2
Renamed `game` to `games` and `menu` to `menus`. Moved some functions from `engine/routines/` to their fitting subdirectories. Made two new subdirectories: * engine/rtc: Contains all RTC-related things. Menus, hardware, misc functions. * engine/items: Contains all item-related things. Pack, item effects, other item handlers.
Diffstat (limited to 'engine/overworld')
-rw-r--r--engine/overworld/loadmappart.asm36
1 files changed, 36 insertions, 0 deletions
diff --git a/engine/overworld/loadmappart.asm b/engine/overworld/loadmappart.asm
new file mode 100644
index 000000000..2184ebf7e
--- /dev/null
+++ b/engine/overworld/loadmappart.asm
@@ -0,0 +1,36 @@
+_LoadMapPart:: ; 4d15b
+ ld hl, wMisc
+ ld a, [wMetatileStandingY]
+ and a
+ jr z, .top_row
+ ld bc, WMISC_WIDTH * 2
+ add hl, bc
+
+.top_row
+ ld a, [wMetatileStandingX]
+ and a
+ jr z, .left_column
+ inc hl
+ inc hl
+
+.left_column
+ decoord 0, 0
+ ld b, SCREEN_HEIGHT
+.loop
+ ld c, SCREEN_WIDTH
+.loop2
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec c
+ jr nz, .loop2
+ ld a, l
+ add 4
+ ld l, a
+ jr nc, .carry
+ inc h
+
+.carry
+ dec b
+ jr nz, .loop
+ ret