Shop OBEX P1 Docs P2 Docs Learn Events
1080p tiled GUI (with mixed signal scope demo) — Parallax Forums

1080p tiled GUI (with mixed signal scope demo)

RaymanRayman Posts: 14,633
edited 2023-05-08 18:47 in Propeller 2
Based on 1080p VGA driver from this thread: http://forums.parallax.com/discussion/171133/1080p-tile-driver-p1-style/p1

Putting together a GUI.
Got the basic elements drawn (see attached).

Still experimental, but things are looking good so far...
It's a fair balance of resources, uses half the cogs and less than half the HUB RAM (currently at 207 kB).

This is using the P1 ROM font and P1 style graphics with 16x16 pixel tiles.
Update: Used this for Mixed Signal Scope (code posted)
Note: See around page 3 for source code for various version of the mixed signal scope.
2016 x 1512 - 611K
4032 x 3024 - 2M
«134

Comments

  • jmgjmg Posts: 15,173
    Impressive, What sysclk does that use ?
  • msrobotsmsrobots Posts: 3,709
    edited 2020-02-17 20:39
    Very nice!

    Is this fastspin or Spin2?

    Mike
  • cgraceycgracey Posts: 14,151
    Looks really good, Rayman!
  • Wow!
  • RaymanRayman Posts: 14,633
    The clock setting is one reason I'm calling this "experimental".
    Clock is overclocked at 297 MHz. The basic driver can run at 297/2 MHz. But this one, with the cursor and dynamic color sets needs at least 260 MHz as is.
    And, you really need a 297 MHz clock to get all the pixels to come out right.

    If for some reason, 297 MHz turns out to not be a viable solution, then I could stay at 1080p and work with block cursor and reduced color options.
    Or, I could drop down to something like 720p and keep everything as is.
  • RaymanRayman Posts: 14,633
    It compiles with FastSpin 4.1.3

    Files are attached. Assumes you have A/V board on basepin 0. You will need to change the USB base pin if you want to test the cursor.


    It can presumably be made to work under Spin2. May attempt that again one day...
  • RaymanRayman Posts: 14,633
    edited 2020-02-18 19:13
    I just remembered another trick from P1...
    Actually, I guess I just invented this trick as P1 font was in ROM...

    I put the custom 2bpp graphics just after the ROM Font.
    Now, they just work like part of the font, just with character numbers beyond 255.

    This could be very helpful for setting up a remote graphical interface, maybe over serial connection.
    Would be faster than something like Remote Desktop or VNC, because only need to send font once and then just the character numbers and colors numbers for every tile to update the screen...
  • RaymanRayman Posts: 14,633
    edited 2020-02-27 16:56
    Yay! Feels like I pulled off a minor miracle here!

    I now have P1 graphics back and this time it doesn't need a cog.
    Ok, so you can still use a free cog if you want, but you don't have to.

    This driver uses three cogs to do video and one of them was not fully utilized.
    It has about 10% free time.

    So, I copied over the Graphics PASM, moved it to Hubexec.
    Now, the actual job this cog does runs as an interrupt service routine.

    Graphics is interrupted continuously, so it really gets slowed down.
    The graphics demo looks to be about 1/2 or so the speed of the P1 original now.

    If you really wanted to do a graphics demo, you'd want to use the version with it's own cog.
    But, if you are doing more or less static graphics, this could be very, very useful.

    Also, the colors are not quite as perfect a match as before because it now uses the 256-color palette described earlier instead of custom colors.
    Still, it's not so bad...
    2016 x 1512 - 1M
    2016 x 1512 - 631K
  • RaymanRayman Posts: 14,633
    Here's a video:



    You can see it's slow, but doesn't need a cog!
    There are only 8 cogs, so it could be very important to conserve cogs in some applications...
  • RaymanRayman Posts: 14,633
    Using it's own cog it takes the graphics driver between 1.7 and 2.2 million clocks to process a frame of this graphics demo.
    It's just slightly less than 10X that for the cog-less version.
  • Very cool, Ray!
  • That's great progress Ray!
  • Cluso99Cluso99 Posts: 18,069
    Congratulations Ray :smiley:
  • Excellent work! The graphics at that speed are still useful.
  • RaymanRayman Posts: 14,633
    edited 2020-02-28 17:35
    Here's the latest version.
    It compiles with FastSpin 4.1.3 but the binary and PASM is here too.

    This may be the last version that includes the graphics demo.
    It actually responds to left and right mouse buttons and cursor position correctly now.
    But, it is too sluggish (due to this version of graphics not having it's own cog) to keep it for this driver development.

    It is set for Eval Board with A/V accessory board on P0 and mouse on lower port of USB accessory board on P16.
  • DaveJensonDaveJenson Posts: 375
    edited 2020-02-28 19:03
    Rayman,

    I get unknown or corrupt image file when I try to unzip this.

    (nevermind)
  • RaymanRayman Posts: 14,633
    I made the mouse cursor wider, looks much better now.
    Also, buttons can actually work now.

    And, the "Pin Monitor" button brings up this window where you can see all I/O pin values.
    You can click on any of the DIR/OUT to toggle the value...
    1280 x 960 - 399K
  • Ray,

    I added a little code (1080p_TileDriver_Test5e.spin2) to better display the mouse X & Y as well as button presses:
    PUB ShowMouse()|oldx,oldy       
        repeat
            oldx:=mousex
            oldy:=mousey
            CheckMouse()
            VSync() 'reduce flicker
            'show diagnostic info
            if oldx<>mousex
                vga.setcol(6)
                vga.setrow(61)
                vga.print_string(string("Mouse X:                        "))
                vga.setcol(14)
                vga.setrow(61)
                vga.dec(mousex)'/16)
            vga.setcol(6)
            vga.setrow(63)
            vga.print_string(string("Mouse Y:                        "))    
            vga.setcol(14)
            vga.setrow(63)    
            vga.dec(mousey/16)
    
    PUB UpdateMouse()|oldx,oldy       
            oldx:=mousex
            oldy:=mousey
            CheckMouse()
            'show diagnostic info
            if oldx<>mousex
                vga.setcol(6)
                vga.setrow(61)
                vga.print_string(string("Mouse X:                        "))
                vga.setcol(14)
                vga.setrow(61)
                vga.dec(mousex)'/16)
            vga.setcol(6)
            vga.setrow(63)
            vga.print_string(string("Mouse Y:                        "))    
            vga.setcol(14)
            vga.setrow(63)    
            vga.dec(mousey/16)
    
            vga.setcol(18)
            vga.setrow(63)
            if(bLeftButtonDown == 0)    
                vga.print_string(string("Left button not pressed "))    
            else	    
                vga.print_string(string("Left button pressed     "))  
    
            vga.setcol(42)
            vga.setrow(63)
            if(bRightButtonDown == 0)    
                vga.print_string(string("Right button not pressed "))    
            else	    
                vga.print_string(string("Right button pressed     "))
    


    dgately
  • RaymanRayman Posts: 14,633
    Nice. I may have to think more about VSync usage later...
    There may be many things that want to use VSync but only want one wait...
  • RaymanRayman Posts: 14,633
    edited 2020-03-02 20:56
    Added 3 more forms for graphics demo's
    Can do cogless, cogged, or Super Graphics Demo (4x the area)
    I had to make some changes to "Graphics.spin" due to "bases" being only a word array...

    BTW: I think line width might be limited to 15 pixels wide. Might want change to allow wider...
    2016 x 1512 - 686K
  • cgraceycgracey Posts: 14,151
    Rayman, you've got that thing looking awesome now! I like the higher-res a lot.

    Have you thought about making this whole thing 16-color, instead of 2-color? That would make it very versatile.
  • RaymanRayman Posts: 14,633
    I have a 16-color version already:
    https://forums.parallax.com/discussion/165487/4-bit-gui-testing-now-with-ws2812b-rgb-led-test-example/p1
    But, it's not tiled...

    16-color tiles might be interesting. The cursor might be easier...
    Definitely something to consider. You'd pay the 2x the price for graphics, but they'd look better...

    Here are the files for the current version:

  • RaymanRayman Posts: 14,633
    edited 2020-03-02 21:38
    Actually, I thought about it a couple seconds more and I think there'd be trouble doing the colors they way I am now...
    Right now every tile can have it's own set of 4 colors from a 256 color palette.
    That won't work at 4bpp. You'd have to select from 1 of 32 sets of 16 colors for each tile.
    That might not be so bad though....

    Would save a cog, might be a big advantage sometimes...
  • RaymanRayman Posts: 14,633
    Thinking about 4bpp some more...
    You probably could have many colors for text by building a scan line like this one does.

    Worth considering some more.
  • potatoheadpotatohead Posts: 10,261
    edited 2020-03-03 06:17
    32 sets of 16 colors is a lot! Just saying. And one gets color redirection. Good for pop up images, and or under or overlay for free (on a reduced set)
  • RaymanRayman Posts: 14,633
    I can't think of a way to use more than a few of those colors for text tiles.
    I guess you could get up to 32 different combinations of foreground/background color.
    But, you'd also need some of those sets for 4-bit graphics. Is this enough? Maybe...

    Also, doing the cursor would be a pain unless you reserved two colors in each set for the cursor.

    I think I'll just stick to this driver...
  • cgraceycgracey Posts: 14,151
    If the four colors can change for each tile, that's plenty.
  • RaymanRayman Posts: 14,633
    I just did a quick check and it looks like my scanline builder would need an extra cog for 4bpp.
    That'd mean 4 cogs total...
  • Rayman wrote: »
    I just did a quick check and it looks like my scanline builder would need an extra cog for 4bpp.
    That'd mean 4 cogs total...

    This is looking really good, but please stop when you've reached 8 cogs, okay? :smile:

  • ErNaErNa Posts: 1,752
    Rayman wrote: »
    I just did a quick check and it looks like my scanline builder would need an extra cog for 4bpp.
    That'd mean 4 cogs total...

    This is looking really good, but please stop when you've reached 8 cogs, okay? :smile:

    You could still run Tachyon in a shadow cog ;-)
Sign In or Register to comment.