uf-toys

toys and experiments with uf forth
git clone git://git.alexwennerberg.com/uf-toys
Log | Files | Refs | README

commit 837b610583335ce267de7c067c98fed0e926f640
parent 4f550425b1dde32c8b4aba0b6463a20448dfad17
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 18 Sep 2022 16:04:54 -0700

cleanup, add bump

Diffstat:
Mdvd.f | 36++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/dvd.f b/dvd.f @@ -10,36 +10,36 @@ variable hit-hor variable hit-ver create dvd_icn hex - 00 c, 1f c, 3f c, 38 c, 38 c, 38 c, 78 c, 7f c, 00 c, fe c, fe c, 7e c, 77 c, - 77 c, e3 c, c3 c, - 00 c, 0f c, 1f c, 3b c, 7b c, 77 c, e7 c, c7 c, 00 c, fc c, fe c, 8f c, - 87 c, 07 c, 0e c, fc c, 7f c, 00 c, 00 c, 0f c, ff c, 7f c, 07 c, 00 c, - 03 c, 01 c, 00 c, ff c, - f0 c, f8 c, ff c, 00 c, - 87 c, 00 c, 00 c, ff c, 7f c, 7f c, ff c, 00 c, f0 c, 00 c, 00 c, e0 c, fc c, - fc c, 80 c, 00 c, + 001f , 3f38 , 3838 , 787f , 00fe , fe7e , 7777 , e3c3 , + 000f , 1f3b , 7b77 , e7c7 , 00fc , fe8f , 8707 , 0efc , + 7f00 , 000f , ff7f , 0700 , 0301 , 00ff , f0f8 , ff00 , + 8700 , 00ff , 7f7f , ff00 , f000 , 00e0 , fcfc , 8000 , decimal : draw-dvd ( color -- ) dvd_icn spritedata dvd-x @ dvd-y @ position -sprite +sprite ; + +: check-hit ; : on-frame h# 00 draw-dvd +h# 01 dvd-x @ dup 00 = swap hit-hor @ = or if dvd-dx @ negate dvd-dx ! +drop h# 03 then dvd-y @ dup 00 = swap hit-ver @ = or if dvd-dy @ negate dvd-dy ! +drop h# 03 then dvd-dx @ dvd-x +! dvd-dy @ dvd-y +! -h# 01 draw-dvd -brk -; +draw-dvd +brk ; : boot h# 4cfd h# 4cf3 h# dcf2 colors @@ -48,13 +48,9 @@ screensize@ 10 - hit-ver ! h# 20 - hit-hor ! h# 36 auto h# 01 draw-dvd -1 dvd-x ! -1 dvd-y ! -1 dvd-dx ! -1 dvd-dy ! +1 dvd-x ! 1 dvd-y ! +1 dvd-dx ! 1 dvd-dy ! ['] on-frame svector brk -bye -; -save dvd.rom -bye +bye ; +save dvd.rom bye