Shop OBEX P1 Docs P2 Docs Learn Events
64 column VGA text driver in one cog - 48/40/32/30/24/20...rows! (RELEASED) — Parallax Forums

64 column VGA text driver in one cog - 48/40/32/30/24/20...rows! (RELEASED)

Bill HenningBill Henning Posts: 6,445
edited 2011-04-03 19:09 in Propeller 1
For quite a while now I've wanted to make a high resolution VGA text driver for the Propeller.

My initial impetus was trying to free a cog on PropCade - I did not like using two cogs for a text driver!

It took quite a while to figure it out, but I got it working. Now I need other people to test it and send me best timing settings for their monitors, as I will submit this object to OBEX and GOLD OBEX later.

I present:

MikronautsVGA64 - 64 column driver, requires 5MHz crystal for 80MHz prop clock speed

I guess this answers the more chars thread :)

http://forums.parallax.com/showthread.php?129470-more-chars-with-VGA_Text.spin

(updated) I added VGA_Text like methods, so it should be a drop in replacement (except for palette handling).

I am MIT licensing the driver. Please don't change the file names so at least I get some exposure out of it :)

The archive contains five fonts, and the number of times each scan line is displayed can be set in the driver, so this one driver provides the following text modes:

64x60, 64x48, 64x40, 64x32, 64x30, 64x24, 64x20, 64x16, 64x15, 64x12, 64x10, 64x8, 64x6, 64x5

It is a regular "text mode" driver, and as such, uses one byte per character in the screen buffer.

The first 128 characters contain 32 graphic elements, then 96 ASCII characters, and the second 128 characters normally contain the inverse of the first 128 characters. The font is interleaved - this was the only way I could get the driver to work fast enough to get 64 columns!

I have two other variations of the driver that I will be posting that also need to be tested:

MikronautsVGA80 - 80 column driver, requires 6.25MHz crystal for 100MHz prop clock speed
MikronautsSVGA50 - 50 column driver, requires 5MHz crystal for 80MHz prop clock speed

Apr.3/2011 Update:

I added kuroneko's sync patch, which fixed the waitvid hub sync issue - the driver seems solid now! I will be fixing the extra pixel problem he found in the 8x8 font tomorrow.

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2011-02-19 15:05
    Nice work Bill!
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-02-20 08:24
    Thanks!

    I updated the driver in the first post - the new version adds untested port of the VGA_Text methods, however the color changing methods are ignored as my driver can only provide unique foreground/background colors for each scan line.

    I also added methods so that parent objects can retrieve the addresses of the screen buffer, color palette and font base.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-02-21 07:47
    If your monitor is having trouble syncing to the display generated by this driver you will have to tweak the following settings in the CON section of the driver:

    hf = 12' 'horizontal front porch pixels, scaled by .8
    hs = 76' 'horizontal sync pixels, scaled by .8
    hb = 40' 'horizontal back porch pixels, scaled by .8

    The above values are approximately 0.8x the VESA values for 640x480@60Hz, which is the correct scaling given how I am generating 64 columns at 80MHz.

    I've found it best to adjust the values in 4 dot clock periods, and do not reduce hb below 32 or the waitvid's won't be synced properly
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-21 21:10
    Something is right on the threshold for displaying on my CRT monitor. Using the 12/76/40 numbers I get nothing on the display, but if I uncomment the last line
      repeat
        repeat 10000
        vga.scroll
    

    I got it to work about 20% of the time. So the scrolling is maybe making the monitor more likely to sync?
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-02-22 06:29
    Thanks for the info; I am trying to fix it - there is more information in the 50 column thread.

    It appears to be a boundary condition with WAITVID where it is not displaying what it is supposed to be displaying :(
    Dr_Acula wrote: »
    Something is right on the threshold for displaying on my CRT monitor. Using the 12/76/40 numbers I get nothing on the display, but if I uncomment the last line
      repeat
        repeat 10000
        vga.scroll
    

    I got it to work about 20% of the time. So the scrolling is maybe making the monitor more likely to sync?
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-04-03 19:09
    Thanks to kuroneko's hub sync patch this driver now works quite well!

    I uploaded the v1.01 object into the first post.
Sign In or Register to comment.