Shop OBEX P1 Docs P2 Docs Learn Events
tTaqoz = Taqoz V2.8 with a compact Tile Driver — Parallax Forums

tTaqoz = Taqoz V2.8 with a compact Tile Driver

Less is more!

Taqoz V2.8 comes with a versatile VGA Bitmap Driver, which can do nice graphics. When I made my local Forth Editor it became clear, that color is quite desirable for syntax highlight and of course you want to see a lot of text at the same time. Unfortunately you also want to hold long texts in RAM.
Something like a dream would be to have multitasking with several screens. A keystroke brings you to another task, like OS9 on the coco3.

With the original Bitmap Driver, you need HW(Color=4) = 10 * 6 * 4=240 bits per Character, which is for 96 Lines and 128 columns 96 * 128 * 240 / 8=368.640 bytes.

There was a time, when microcomputers had limited RAM, so it was interresting to look at formats of old computers. A nice format is found for C128 for it's 80 columns screen. They used only one color for background for the entire screen.
Another inspiration comes from ZX80 and Amstrad CPC: To have a character set with 2*2 sub-tiles, which you can use to plot figures with 4 fold resolution.

Implementation "Tile12":
So the idea was to bring in a compact Tile Driver for VGA, which needs 12bits per Character. 8 Bits for the Char and 3 bits for 8 colors plus 1 bit for inverse. So we need 96 * 128 * 12 / 8=18.432 bytes per screen.
The driver is a variation and simplification of Eric Smiths Tile Driver, which comes with Flex. Of course Taqoz is by Peter Jakacky. Many thanks for both!

Tile12 has the screen buffer format:
EvenChar, ColorByte, OddChar; EvenChar, ColorByte, OddChar;….
ColorByte has the format: %ICCCiccc
The capitals stand for the bits for the odd char, the othes for the even char.

The Color Palette is dynamically reloaded, so you can manipulate the colors while the Driver is Running.
$80808000 tileColors 16 cells + ! - Will change the background color.
Also you can set a new screen buffer base address, which can give you several screens.

I did consider to implement the tile driver with own Taqoz's P2asm, but while this tool is very nice for small code words, it is not well suited for longer routines with lots of labels, which often point forward.
Also I did have a look at Taqoz V2.14, but I found myself not willing to rewrite my own code because of incompatibilities and I found no striking advantages.

So the driver is put into the end of the kernel in tTaqozC.SPIN2 (There is no Spin in it.) And only two new Forth words could be squeezed in:
TILEENTRY@ ( -- startaddress ) gives the address in hub ram of the driver
COGINITP ( to_ptra startaddr cognr -- ) can start assembler code using setq to pass a parameter in ptra to the cog.
tTaqoz.SPIN2 is compiled with FlexProp 6.9.1.
Be aware, that I put
_xinfreq = 25_000_000
for the Kiss board.

While the driver is part of the kernel, timing parameters, color palette, character set and handling routines are loaded with TileDrvC.fth. Order of Modules is:
Kernel - Extend-A.fth - File-A.fth - AutoT-A.fth - TileDrvC.fth

The base pin for the VGA output is set to 8 and the timings are for 1024x768 with 65MHz pixel frequency.
At the moment the character set (8x8) is the Parallax set but to have the graphics, the last 16 chars are patched. It would be nice to use the Amstrad CPC set, but I could not yet find a hex dump of it.

A nice feature of Forth and of Taqoz is the ability to redirect output. The word TILE redirects to the Tile driver, CON back to serial, CONTILE activates both.
tSetScrn ( 0-3 -- ) selects the active screen out 4.
^p will cycle through the screens

Have Fun

Sign In or Register to comment.