Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stevesims
Copy link
Contributor

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, and can thus currently only be built using PlatformIO

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
fixes issue with capturing bitmap to buffer zero
(the `createBuffer` call was preventing creation of buffer with ID 0, as it can’t be used as a place to redirect output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant