mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
7d4486e6a3
engine/routines/ stores isolated out-of-context routines as individual files. It might be preferable later to append them to their related engine/ files in unique little SECTIONs, relying on the linkerscript to place them appropriately; or some other organization method. In the meantime, they're now easily findable apart from main.asm's other content.
37 lines
423 B
NASM
37 lines
423 B
NASM
_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
|