|
|
|
@ -46,6 +46,7 @@ clearLogo:
|
|
|
|
|
; Writes a value across 16 bytes, starting at HL. Intended to fill a single tile. |
|
|
|
|
; Parameters: |
|
|
|
|
; B - The value to set the bytes to. |
|
|
|
|
; HL - Destintion location. |
|
|
|
|
; Modifies: |
|
|
|
|
; HL - End result: HL + 16 |
|
|
|
|
fillTile: |
|
|
|
@ -55,6 +56,60 @@ fillTile:
|
|
|
|
|
pop de |
|
|
|
|
ret |
|
|
|
|
|
|
|
|
|
; Fills a 16 byte block with a specific pattern. Intended to fill a single tile |
|
|
|
|
; with a specific grayscale or color shade. |
|
|
|
|
; Parameters: |
|
|
|
|
; B - The pattern to write: |
|
|
|
|
; $00: $00 $00 |
|
|
|
|
; $01: $FF $00 |
|
|
|
|
; $02: $00 $FF |
|
|
|
|
; $03: $FF $FF |
|
|
|
|
; HL - Destintion location. |
|
|
|
|
; Modifies: |
|
|
|
|
; B - Set to $00 or $FF. |
|
|
|
|
; HL - End result: HL + 16 |
|
|
|
|
fillTileEx: |
|
|
|
|
push af |
|
|
|
|
ld a, b |
|
|
|
|
ld b, %11 |
|
|
|
|
and b |
|
|
|
|
jr nz, _check3 |
|
|
|
|
|
|
|
|
|
; b = $00. Fill with plette entry 0. |
|
|
|
|
ld b, $00 |
|
|
|
|
call fillTile |
|
|
|
|
pop af |
|
|
|
|
ret |
|
|
|
|
|
|
|
|
|
_check3: |
|
|
|
|
cp b |
|
|
|
|
jr nz, _handleAlt |
|
|
|
|
|
|
|
|
|
; b = $ff. Fill with palette entry 3. |
|
|
|
|
ld b, $ff |
|
|
|
|
call fillTile |
|
|
|
|
pop af |
|
|
|
|
ret |
|
|
|
|
|
|
|
|
|
_handleAlt: |
|
|
|
|
push de |
|
|
|
|
ld b, %01 |
|
|
|
|
ld d, 16 |
|
|
|
|
ld e, $ff |
|
|
|
|
cp b |
|
|
|
|
ld a, 0 |
|
|
|
|
jr nz, _fillLoop |
|
|
|
|
xor e |
|
|
|
|
_fillLoop: |
|
|
|
|
ld [hli], a |
|
|
|
|
xor e |
|
|
|
|
dec d |
|
|
|
|
jr nz, _fillLoop |
|
|
|
|
|
|
|
|
|
pop de |
|
|
|
|
pop af |
|
|
|
|
ret |
|
|
|
|
|
|
|
|
|
; Copies up to 256 bytes of memory to another location. |
|
|
|
|
; Parameter: |
|
|
|
|
; BC - Source location. |
|
|
|
|