GameBoy test ROMs for Plip.
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.
 
 

28 lines
482 B

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