AgonConsole8 / agon-vdp

Official Firmware for the Agon Console8: ESP32 VDP
MIT License
43 stars 17 forks source link

Implement more of Acorn's GXR VDU calls #32

Open stevesims opened 1 year ago

stevesims commented 1 year ago

Acorn's Graphical eXtension Rom (GXR) contained several more graphical primitives that we don't yet support.

It would be good to try to add some more of them.

This will be practically limited by the underlying features of FabGL - altho by the looks of it most of the primitives are present.

(Thanks to @julianregel for reminding me of the existence of the GXR :grin: )

julianregel commented 1 year ago

I think you will find this interesting: https://tobylobster.github.io/GXR-pages/gxr/index.html

:-)

stevesims commented 1 year ago

Some further analysis...

some of the GXR calls would be hard to implement on top of fab-gl, and arguably are not practical. these are primarily the dot-dash line commands, and colour patterns. the "logical inverse colour" plot variants are likely not doable - fab-gl does support a NOT paint option, but that is only implemented for straight lines and non-filled rectangles.

the fill commands (flood fill, and "line fill left/right to (non-)background/foreground") are maybe just about possible, but would be very hard. without delving deep into fab-gl and rewriting sections of it, those would likely involve pixel-by-pixel calls, and be inefficient.

some GXR calls are tricky, but potentially doable. those include the solid line calls that omit first/last/both points. implementing these would either involve re-calculating points so that pixels get omitted, or more likely grabbing the appropriate pixel(s) from screen before drawing and then re-drawing them after the line has been drawn.

some call should be relatively easy, as they are built into fab-gl. examples would be filled circles, filled rectangles, copy rectangle. The parallelogram fill should be doable as a fill path. Circular arcs, segments, sectors and ellipses may be possible but will need some investigation to understand their behaviour.

command variants of relative vs absolute coordinates should be doable for all commands. similarly variants that choose to plot in current foreground/background should be easy.

stevesims commented 1 year ago

As much of GXR as practical (with the exception of "sprite"/bitmap) calls were implemented in #43

No support for NOT was included, however this should be added in a future PR, as there is partial support for that present in fab-gl for straight line plotting

stevesims commented 11 months ago

support for horizontal line fill plot calls was added via #104

to be made more efficient, a different implementation for those calls is needed inside vdp-gl.

the horizontal line fill calls form the basis of Acorn's flood fill system. we can look to implementing flood fill when the line-fill operations are supported inside vdp-gl

as per earlier analysis, pretty much everything else requires implementation inside vdp-gl.

stevesims commented 10 months ago

NOT operation is coming in #148

stevesims commented 8 months ago

dotted lines is implemented in #163

arcs, segments and sectors are implemented in #173

stevesims commented 5 months ago

bitmap plot code was added quite some time ago

what remains of GXR PLOT codes are the two flood fill, and two ellipse operations.

Acorn systems also supported pattern fills