Created
December 17, 2020 20:25
-
-
Save neuro-sys/bf640a1415df6a28f8036aa62867b17e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
; Transition effect 1 | |
nolist | |
org #7000 | |
jp start | |
fc ds 1 ; frame count | |
y1 ds 2 ; y pos counter | |
y2 ds 2 ; upper bound position | |
y3 ds 2 ; lower bound | |
palette1 db #44, #4a, 0 | |
palette0 db #54, #54, 0 | |
wvsync ld b, #f5 | |
wvsync1 in a, (c) | |
rra | |
ret c | |
jr wvsync1 | |
; IN A border ink (no hw mask) | |
setbordera ld bc, #7f10 | |
out (c), c | |
out (c), a | |
ret | |
; IN C pen | |
; A ink | |
setink ld b, #7f | |
out (c), c | |
or #40 | |
out (c), a | |
ret | |
; IN C pen | |
; A ink (without or hw mask) | |
setinka ld b, #7f | |
out (c), c | |
out (c), a | |
ret | |
macro SETPALETTE0 | |
ld a, #54 ; color | |
ld bc, #7f10 | |
out (c), c ; select border | |
out (c), a ; set color | |
ld e, 0 | |
out (c), e ; select ink | |
out (c), a ; set color | |
inc e | |
out (c), e | |
out (c), a | |
mend | |
macro SETPALETTE1 | |
ld a, #44 ; color | |
ld bc, #7f10 | |
out (c), c ; select border | |
out (c), a ; set color | |
ld e, 0 | |
out (c), e ; select ink | |
out (c), a ; set color | |
inc e | |
ld a, #4a | |
out (c), e | |
out (c), a | |
mend | |
screen1 | |
ld a, 0 | |
ld (fc), a | |
screen1frame | |
call wvsync | |
ei | |
halt ; synchronize beam | |
di | |
SETPALETTE0 | |
ld hl, 0 | |
ld (y1), hl | |
ld a, (fc) | |
ld l, a | |
ld h, 0 | |
add hl, hl | |
add hl, hl ; 4 bytes per element | |
ld de, sintab | |
add hl, de | |
ld e, (hl) | |
inc hl | |
ld d, (hl) | |
inc hl | |
ex de, hl | |
ld (y2), hl | |
ex de, hl | |
ld e, (hl) | |
inc hl | |
ld d, (hl) | |
ex de, hl | |
ld (y3), hl | |
repeat 52 | |
nop | |
rend | |
screen1w | |
repeat 64-30 | |
nop | |
rend | |
ld hl, (y1) ; 4 | |
inc hl ; 2 | |
ld (y1), hl ; 4 | |
ld e, l ; 1 | |
ld d, h ; 1 | |
ld hl, (y2) ; 4 | |
or a ; 1 | |
sbc hl, de ; 4 | |
add hl, de ; 3 | |
jp nc, screen1w ; 3 = 27 | |
SETPALETTE1 | |
screen2w | |
repeat 64-30 | |
nop | |
rend | |
ld hl, (y1) ; 4 | |
inc hl ; 2 | |
ld (y1), hl ; 4 | |
ld e, l ; 1 | |
ld d, h ; 1 | |
ld hl, (y3) ; 4 | |
or a ; 1 | |
sbc hl, de ; 4 | |
add hl, de ; 3 | |
jp nc, screen2w ; 3 = 27 | |
repeat 32 | |
nop | |
rend | |
SETPALETTE0 | |
ld hl, fc | |
inc (hl) | |
ld a, (hl) | |
or a | |
jp z, screen1end | |
jp screen1frame | |
screen1end ret | |
; entry point | |
start | |
di | |
ld hl, #c9fb | |
ld (#38), hl | |
ei | |
call screen1 | |
call #4000 ; cube | |
jp $ | |
sintab | |
read "..\utils\sintab.inc" |
Author
neuro-sys
commented
Dec 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment