You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
482 B
29 lines
482 B
4 years ago
|
SECTION "functions", ROM0[$2000]
|
||
|
; Wait for vblank without using interrupts.
|
||
|
waitVBlank:
|
||
|
push af
|
||
|
.waitVBlankLoop:
|
||
|
ldh a, [$ff44]
|
||
|
cp $90
|
||
|
jr nz, .waitVBlankLoop
|
||
|
pop af
|
||
|
ret
|
||
|
|
||
|
; Writes a value across 16 bytes, starting at HL. Intended to fill a single tile.
|
||
|
; Parameters:
|
||
|
; B - The value to set the bytes to.
|
||
|
; Modifies:
|
||
|
; HL - End result: HL + 16
|
||
|
fillTile:
|
||
|
push af
|
||
|
push de
|
||
|
ld d, 16
|
||
|
ld a, b
|
||
|
.fillTileLoop:
|
||
|
ld [hli], a
|
||
|
dec d
|
||
|
jr nz, .fillTileLoop
|
||
|
pop de
|
||
|
pop af
|
||
|
ret
|