GithubHelp home page GithubHelp logo

Comments (3)

stevesims avatar stevesims commented on August 24, 2024

Curiously I wrote a comment on this very functionality earlier today on the AgonConsole8/agon-vdp repo 😁

I've been thinking about implementing this functionality for a little while now. Recent changes to how bitmaps are handled make this much more practical to implement. A few brief notes...

Generally our VDU commands follow Acorn's lead.

Acorn used VDU 23, 27, 1, n, 0, 0, 0, 0, 0, 0 to define a bitmap (what they called a sprite). We have used this command instead to define a bitmap...

The Acorn version of this command takes the last two graphics cursor positions to define the rectangle of screen to grab.

On the surface, there's a conflict here with the command we have on the Agon. Acorn's command includes the bitmap number, whereas the command we currently have doesn't, and instead that byte is half of our width 16-bit value.

However - we can potentially implement Acorn's version, pretty much exactly as-is.

Our interpreter for VDU 23, 27, 1 could look to see if there's a height of 0 sent - and from that it could trigger "define bitmap from screen" mode.

Some further notes...

The bitmap system was recently update to use the buffers system added in the buffered commands API for storage, which opens up lots of possibilities for bitmap processing. See #97 for more info on the features that adds.

The new buffer-backed bitmap system maps the existing 8-bit bitmap IDs to 16-bit buffer IDs that are in the range of &FA00-FAFF, or 64000-64255.

VDU 23, 27, 32 is already command that selects a bitmap using a full 16-bit ID, allowing more than 255 bitmaps to be used (again, see #97 ). (Yeah - I'd have put a gap between the bitmap and sprite operations too 😁 )

Flipping bitmaps is quite easily done using the buffered commands API. (Flipping is slightly easier, conceptually, when you're using 8-bit bitmaps rather than 32-bit ones, which are now supported. I'm pretty sure I wrote examples in the docs.)

Clearing a single bitmap is now possible - just delete the buffer that it's stored in with the buffered command API.

Your ideas around sending data back to the eZ80 are also on my radar. That would most likely be done by sending data from a buffer. There's details to be worked out for this tho, so that might take a bit longer.

In conclusion - there's no need to define a new command for the "define bitmap from screen" functionality - the command is already there, it just hasn't been implemented yet. 😁

Also at least some of the other things you've mentioned are already there. 😁

from agon-vdp.

stevesims avatar stevesims commented on August 24, 2024

see AgonConsole8/agon-vdp#103

needs some enhancements to vdp-gl, but I believe I have something that's working

from agon-vdp.

stevesims avatar stevesims commented on August 24, 2024

the "copy screen to bitmap" feature was included in AgonConsole8 agon-vdp 2.2.0 release

PR #153 adds support for this for Quark. NB this requires an updated/revised vdp-gl

from agon-vdp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.