FabGL/MBASIC Easy 8x8 monochrome sprites

32 views
Skip to first unread message

Eightbitswide

unread,
Jan 20, 2023, 12:15:13 PM1/20/23
to Programming on CP/M
I've been playing with some ideas for generating simple monochrome sprites in BASIC for FabGL.   There is probably a better way to handle this, but I wanted to be able to see the sprite in binary in the code for easy editing.   BASIC has a nice HEX$ command, but no BINARY$ command, so I wrote one.

I'll probably migrate to PASCAL going forward just for the better editor. ;)

8b
IMG_20230120_120844471~2.jpgIMG_20230120_120512225~2.jpg
SSPRITE.BAS

Fred Weigel

unread,
Jan 20, 2023, 5:22:25 PM1/20/23
to Programming on CP/M
8b

I was interested in simple graphics... but tried to go as "portable" as I could. I noted that UTF-8 has 4x4 cell graphics, and that every terminal
supporting UTF-8 should support this. Effectively gives an 80x24 terminal 160x48 graphics... or so. I was hoping for 3x2 cell graphics, but
that isn't in. I do wonder what the UTF-8 mapping for petsci is! Then, I could display petsci on xterm, gnome terminal, etc.

Back to the 2x2 cell mapping -- back in the day, an article was published which was a circuit that allowed drawing characters on an oscilloscope.  Just one line..  This was published in August 1974 by Popular Electronics. That had a ROM based font -- I call it the "Scopewriter font".  I wote the Scopewriter emulator in MBASIC, and then translated to XYBasic (XYBasic has binary constants!)


Its called halfg for "half cell graphics". Its known to work on xterm (of course), gnome terminal,  Also runs on cool-retro-term.
I wrote it as a teaching exercise for BASIC beginners -- so I left a bug (or three) in the code. Just good fun!

You may find that code of interest!

FredW
Reply all
Reply to author
Forward
0 new messages