AgonConsole8 / agon-vdp

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

add support for copy-screen-to-bitmap #103

Closed stevesims closed 11 months ago

stevesims commented 11 months ago

adds support for Acorn GXR style “copy screen to bitmap” command sequence

this is supported on both VDU 23,27,1,n,0,0,0 to define bitmap n from the last two graphics cursor positions, using an 8-bit bitmap ID and also VDU 23,27,&21,n;0; using a 16-bit bitmap/buffer ID

these commands are compatible with the existing VDU 23,27,1 and VDU 23,27,&21 commands - the system can tell the difference as these variants require a zero “height” value

if the buffer specified already exists then it will be deleted/cleared before the new bitmap is created from the screen. the resultant bitmap data will be in vdp-gl’s Bitmap::Native format

the original Acorn command documentation specifies that a few more zeros should be sent. you can safely send additional zeros, as per Acorn’s documentation, as they will just be ignored.

it should be noted that VDU 23,27,&21 when pointing to an existing buffer to set it to be a bitmap also usually expects a format byte, but this isn’t required/supported/needed for copying screen to bitmap, i.e. this command variant requires one less byte to be sent

requires an updated/custom vdp-gl