Created
August 15, 2023 18:40
-
-
Save jarikomppa/8aa4b1d1022cee25b006660fa81f5cbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
push ix | |
push iy | |
push hl | |
push bc | |
push de | |
ld ix,#0 ; set up ix to point at stack | |
add ix,sp | |
ld d, 15 (ix) ; aY | |
ld e, 14 (ix) | |
ld hl, #(_yofs) | |
add hl, de | |
add hl, de | |
push hl | |
pop iy | |
ld h, 13 (ix) ; aX | |
ld l, 12 (ix) | |
; divide aX by 8 | |
srl h | |
rr l | |
srl h | |
rr l | |
srl h | |
rr l | |
push hl | |
pop bc | |
ld sp, iy ; set stack to point at yofs table | |
; Setup done | |
pop hl | |
add hl, bc ; add x-offset | |
; skip, background completely visible | |
inc hl | |
ld a, (hl) | |
and #143 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
; skip, background completely visible | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #254 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
inc hl | |
ld a, (hl) | |
and #1 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
; skip, background completely visible | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #252 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
inc hl | |
ld (hl), #0 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #127 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #252 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
inc hl | |
ld (hl), #238 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #63 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #252 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
inc hl | |
ld (hl), #247 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #31 | |
or #128 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #240 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
inc hl | |
ld (hl), #253 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #31 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #240 | |
or #3 | |
ld (hl), a | |
inc hl | |
ld (hl), #255 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #31 | |
or #128 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #240 | |
or #3 | |
ld (hl), a | |
inc hl | |
ld (hl), #191 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #31 | |
or #128 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #240 | |
or #7 | |
ld (hl), a | |
inc hl | |
ld (hl), #255 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #63 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #224 | |
or #3 | |
ld (hl), a | |
inc hl | |
ld (hl), #254 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #127 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #224 | |
or #3 | |
ld (hl), a | |
inc hl | |
ld (hl), #250 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #127 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #224 | |
or #2 | |
ld (hl), a | |
inc hl | |
ld (hl), #254 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #127 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #240 | |
or #3 | |
ld (hl), a | |
inc hl | |
ld (hl), #190 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #127 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #248 | |
or #1 | |
ld (hl), a | |
inc hl | |
ld (hl), #156 ; shortcut: background completely masked | |
inc hl | |
ld a, (hl) | |
and #127 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #248 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
inc hl | |
ld (hl), #0 ; shortcut: background completely masked | |
; skip, background completely visible | |
pop hl | |
add hl, bc ; add x-offset | |
ld a, (hl) | |
and #252 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
inc hl | |
ld a, (hl) | |
and #103 | |
; skip or:ing since value was 0 | |
ld (hl), a | |
; skip, background completely visible | |
ld sp, ix ; Restore stack pointer | |
pop de | |
pop bc | |
pop hl | |
pop iy | |
pop ix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment