uf-toys

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.alexwennerberg.com/uf-toys
Log | Files | Refs | README

commit 6da5cc0bb7ebb4394ebeefe3dbe06eb1f9abfdfd
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 18 Sep 2022 14:17:52 -0700

initial commit + dvd

Diffstat:
A.gitignore | 1+
AREADME.md | 2++
Advd.f | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +*.rom diff --git a/README.md b/README.md @@ -0,0 +1,2 @@ +Toys and experiments in UF forth: +http://www.call-with-current-continuation.org/uf/uf.html diff --git a/dvd.f b/dvd.f @@ -0,0 +1,57 @@ +variable dvd-x +variable dvd-y +variable dvd-dx +variable dvd-dy + +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, +decimal + +: draw-dvd ( color -- ) +dvd_icn spritedata +dvd-x @ dvd-y @ position +sprite +; + +: on-frame +h# 00 draw-dvd +dvd-x @ dup 00 = swap hit-hor @ = or if +dvd-dx @ negate dvd-dx ! +then +dvd-y @ dup 00 = swap hit-ver @ = or if +dvd-dy @ negate dvd-dy ! +then + +dvd-dx @ dvd-x +! +dvd-dy @ dvd-y +! +h# 01 draw-dvd +brk +; + +: boot +h# 4cfd h# 4cf3 h# dcf2 colors +1 1 position +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 ! + +['] on-frame svector brk +bye +; +save dvd.rom +bye