I have been working on developing TI-BASIC style GRAPHICS for CAMEL99 Forth.
My thoughts on the matter are to make these things work similar to TI-BASIC where possible.
For example the color values are the same, 1 through 16, even though the hardware wants 0 to 15.
I have replicated the simple things CLEAR, SCREEN, COLOR and even added a new one called COLORS
which changes background and foreground colors for the entire character set in one line.
Years ago something that was always a pain was developing graphics shapes for CALL CHAR.
Nowadays I see there is a great editor for the job that outputs BASIC code. Very cool.
The CALL CHAR sub-program tries to make it simpler for us by letting us input a hexadecimal string for the
character bits and a decimal number for the ASCII value. In Forth I could switch the radix wtih
HEX and DECIMAL and it would look like this:
HEX FFFF FFFF FFFF FFFF DECIMAL 128 CHARDEF
( I had to call it something different because CHAR is already a standard word in ANS Forth so I chose CHARDEF)
I didn't like that much so I automated the number conversion from HEX to DECIMAL by adding a word called HEX"
HEX" FFFF FFFF FFFF FFFF" 128 CHARDEF
That was good enough thought I... but what if I could input the bits as BINARY numbers?
So I created BIN"
And now with the help of the swap-byte operator '><' and the '+' operator I can do this:
BIN" 01111110" >< ( swap this byte to other side: 00FF becomes FF00 )
BIN" 10000001" + ( add this byte to the previous one to create a 16bit number)
BIN" 10100101" ><
BIN" 10000001" +
BIN" 10100101" ><
BIN" 10011001" +
BIN" 10000001" ><
BIN" 01111110" + 128 CHARDEF
It's not as nice as a real icon editor but sure is faster for me to code than using HEX numbers.