Shop OBEX P1 Docs P2 Docs Learn Events
[FYI] VGA, 128xH/P, quad cog, per cell colour ("Rainy Day" release) — Parallax Forums

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

kuronekokuroneko Posts: 3,623
edited 2012-04-06 23:53 in Propeller 1
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
  1. [thread=138654]VGA, 100xH/P, dual cog, per cell colour (full/indexed)[/thread]
  2. [thread=136666]VGA, 50xH, single cog, per cell colour ("Despair and Hope" release)[/thread]
  3. [thread=136617]Yet another 50 column VGA text driver (single cog)[/thread]

Comments

  • TubularTubular Posts: 4,706
    edited 2012-04-01 20:56
    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...
  • kuronekokuroneko Posts: 3,623
    edited 2012-04-01 21:10
    @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).
  • RaymanRayman Posts: 14,842
    edited 2012-04-02 03:35
    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)?
  • kuronekokuroneko Posts: 3,623
    edited 2012-04-02 05:34
    Rayman wrote: »
    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.
  • RaymanRayman Posts: 14,842
    edited 2012-04-02 05:55
    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?
  • kuronekokuroneko Posts: 3,623
    edited 2012-04-02 06:19
    Rayman wrote: »
    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.
  • kuronekokuroneko Posts: 3,623
    edited 2012-04-02 19:46
    The [post=1087280]indexed driver[/post] version is now available.
  • kuronekokuroneko Posts: 3,623
    edited 2012-04-06 23:53
    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.
Sign In or Register to comment.