PDA

View Full Version : [FYI] VGA, 128xH/P, quad cog, per cell colour ("Rainy Day" release)



kuroneko
04-02-2012, 03:02 AM
Not something I particularly wanted to do but as there was at least one request I did it anyway. It offered certain challenges so wasn't a total loss. The usual feature list applies:

per cell colour (foreground and background)
monochrome mode (when you're short on hub memory)

Note that this driver should definitely have a twin which uses indexed mode. If I'm not too busy this week it will be up soon. Timing is XGA 1024x768, 65MHz pixel clock.

'' mailbox layout (128xH, full colour)
''
'' long[par][0]: screen: [!Z]:addr = 16:16 -> zero (accepted)
'' long[par][1]: font: size:[!Z]:addr = 8:8:16 -> zero (accepted)
'' long[par][2]: colours: c/a:[!Z]:addr = 1:15:16 -> zero (accepted), optional colour [buffer]
'' long[par][3]: frame indicator/sync lock
''
'' colour [buffer] format
''
'' - (%0--//--0) address (full colour, word array)
'' - (%1--//---) colour value (waitvid 2 colour VGA format)
And for the indexed version:

'' mailbox layout (128xP, full/indexed colour)
''
'' long[par][0]: [!Z]:addr = 16:16 -> zero (accepted) screen buffer [command]
'' long[par][1]: size:[!Z]:addr = 8:8:16 -> zero (accepted) font descriptor [parameter]
'' long[par][2]: [!Z]:addr = 16:16 -> zero (accepted) cursor location [unused]
'' long[par][3]: frame indicator/sync lock
''
'' colour [buffer] format
''
'' - (%0--//--0) address (full colour, word array)
'' - (%1--//---) colour value (waitvid 2 colour VGA format)
''
'' background palette format
''
'' - %%RGB-RGB-RGB-RGB-, MSB holds index 0 (waitvid 4 colour VGA format)
The indexed driver has both 8x8 and 8x12 modes enabled which gives you text resolutions of 128x96 and 128x64 respectively. The 128xH driver is limited to mode 8x12 (128x64). Note that the command interface has changed for the indexed version (due to added cursor support).

References

VGA, 100xH/P, dual cog, per cell colour (full/indexed)
VGA, 50xH, single cog, per cell colour ("Despair and Hope" release)
Yet another 50 column VGA text driver (single cog)

Tubular
04-02-2012, 03:56 AM
Excellent work once again Kuroneko. Showed it to a work colleague who was also very impressed.

I don't know why but this driver appears clearer than the 100xH/P one. ie the text appears sharper. Perhaps its the native monitor resolution, or perhaps the higher refresh rate locks on better, or maybe its just having the entire ascii alphabet in neat columns.

regardless, brilliant work...

kuroneko
04-02-2012, 04:10 AM
@Tubular: I'm pleased that it works for you. Initially I had a 75MHz (70Hz) setup but that wasn't as stable as I'd hoped (the prop could handle it but my monitor wasn't too happy most of the time, jitter in fine details). So I took one step back and settled for 65Mhz (60Hz).

Rayman
04-02-2012, 10:35 AM
Another great driver, nice work. So, this one is also 8x12 pixel font but now with 128 columns and 64 rows, right?
That's a lot of characters... Does it need 2 bytes for every character (one for character, one for color)?

kuroneko
04-02-2012, 12:34 PM
Does it need 2 bytes for every character (one for character, one for color)?
The H version uses 3 bytes each. The indexed (P) version isn't finished yet. Otherwise yes, 128x64 with 8x12 characters.

Rayman
04-02-2012, 12:55 PM
Check my math... At 3 bytes per character, is that 24,576 bytes for the screen buffer? That's a lot...
Are the two color bytes, one for foreground and one for background?
If there were a way to reduce the color bits from 16 to 2 or 3 (4 or 8 possible combinations), you could save a lot of memory...
Is this what the P version will do?

kuroneko
04-02-2012, 01:19 PM
If there were a way to reduce the color bits from 16 to 2 or 3 (4 or 8 possible combinations), you could save a lot of memory... Is this what the P version will do?
That's the idea, e.g. the 100xP version uses 6 bits for foreground colour and 2 bits as in index into a 4 colour background palette (usually you have more ink colour requirements than paper colour). That's a total of two bytes per character (code and colour) so comes down as 16K for the 128xP version.

kuroneko
04-03-2012, 02:46 AM
The indexed driver version is now available.

kuroneko
04-07-2012, 06:53 AM
FWIW, I added a low level example (DDK) in case anyone wants to wrap their own UI around the drivers or simply embed them without much overhead.