Morpheus XGA 1024x768 bitmap driver discussion
Bill Henning
Posts: 6,445
This thread is for discussing the XGA driver - suggesting improvements to it, extensions, and fixes.
XGA 1024
XGA 1024
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Unfortunately it's a bit more complicated than that.
The current version of the driver has to synchronize six cogs, in two sets of three. The only place where there is a bit of an issue is in synchronizing the video display circuitry in three cogs.
Here is my cog usage:
XMM_DEMO1 - the main test app
XMM_ADDR - address generation cog
XMM_READ - burst read cog, one of two
XMM_READ - second instance, offset by four clock cycles from first one
XGA_SYNC - video HSYNC and VSYNC generator
XGA_DISP - displays video even scan line information
XGA_DISP - second instance, displays odd scan line information
XMM_PASM - generic XMM read/write server cog, blocks during burst reads
(I will be merging XMM_ADDR and XMM_SYNC as soon as I have time, saving a cog)
My video synchronization code is based on Chip's VGA high resolution text driver's code, I tried to use exactly the same code to synchronize the three display generation cogs. I needed to use three as my 256 color VGA capability means that HSYNC and VSYNC have to be driven from a different video circuit as I use all eight bits to generate eight bit color (3R 3G 2B).
The problem is that some of the time the two XGA_DISP cogs don't synchronize - despite the counters/PLL's being programmed the same, despite allowing time for the PLL's to settle. I am at a loss - I either have had my nose buried in the problem too long, or there is some as yet undetermined reason for the issue.
I do have two ways of fixing it, as soon as time allows (soon after finishing the Morpheus System Architecture and Developer's Guide)
1) disable the PLL in the video generator, and stick to 40MHz dot clocks or lower
2) detect if the two DISP cogs are not sync'ed correctly to the SYNC cog, and keep retrying the sync code until they are perfectly in sync
Syncing up the memory burst engine was a piece of cake in comparison!
Driver Theory of Operation
The display engine is composed of a memory burst read engine, and an XGA display engine that displays the contents of two scan line buffers (even & odd)
XGA_SYNC generates HSYNC, VSYNC, and requests that XMM_ADDR generate addresses for the screen scan line it specifies
XMM_ADDR waits for the correct start time, and starts generating interleaved addresses for the two XMM_READ cogs
XMM_READ (2 cogs) cogs read from the bus, interleaved with each other, and assemble longs for the two scan line buffers
XMM_DISP (2 cogs) cogs flip between reading from the bus, and displaying a scan line buffer - when even cog reads, odd displays, and vica versa
The XGA engine therefore currently uses six cogs, but as I said, I will be merging XGA_SYNC and XMM_ADDR
Currently, XMM_DEMO1 writes bytes to the screen buffer one at a time, and the write blocks whenever the ADDR/READ cogs are active, currently using a very primitive one access per hsync.
A more detailed explanation is coming in the Developer's Guide [noparse]:)[/noparse]
That is how I manage to burst read/write my XMM at 20MB/sec!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Chip was pretty adamant that the cogs can syncronize to ~1ns, but I'm not so sure...
I think perhaps it works well with his drivers because each cog generates the horizontal sync pulse and only one cog outputs at a time.· I think the receiving VGA monitor must compensate somehow for any offsets in line-to-line sync offsets...
My guess is that your cogs will have to generate sync as well as color info...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
The mouse works in it's own cog and spans multiple horizontal lines and has a clean edge.
So, somehow the cogs are sync'd.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
I base this on there being a "window" in randevous times where I get a much higher percentage of correct syncing.
Fortunately a lot of interesting video modes can be made with a 40MHz dot clock, thus eliminating the need for the video PLL's for some drivers at least.
In other cases, by having the cogs "compare notes" on cnt values after they should be in sync, they can force a re-sync amongst themselves until they are in sync.
Both approaches should solve the issue, now I just need enough time to try and debug them [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
The time variance is in the order of +-1....4us, much larger than the potential delay you pointed out. I am sure the problem will be figured out, but even if it is not, there are two possible ways around it, and both should work.
Worst case: it may take a second or so to achieve "lock" when changing graphics drivers.
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Hey, I was only off by 3 orders of magnitude (assuming base 10)! [noparse][[/noparse]8^) When I get some free time I'll check out your code, thanks for posting!
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
Thanks for the suggestion though!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller