1080p tiled GUI (with mixed signal scope demo)
Rayman
Posts: 14,633
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.
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.
Comments
Is this fastspin or Spin2?
Mike
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.
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...
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...
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...
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...
It's just slightly less than 10X that for the cog-less 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.
I get unknown or corrupt image file when I try to unzip this.
(nevermind)
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...
I added a little code (1080p_TileDriver_Test5e.spin2) to better display the mouse X & Y as well as button presses:
dgately
There may be many things that want to use VSync but only want one wait...
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...
Have you thought about making this whole thing 16-color, instead of 2-color? That would make it very versatile.
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:
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...
You probably could have many colors for text by building a scan line like this one does.
Worth considering some more.
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...
That'd mean 4 cogs total...
This is looking really good, but please stop when you've reached 8 cogs, okay?
You could still run Tachyon in a shadow cog ;-)