Buffered command support#90
Merged
breakintoprogram merged 10 commits intobreakintoprogram:mainfrom Sep 15, 2023
Merged
Conversation
also include temporary experimental call to check this works
adds a set of commands for buffered VDP operations, effectively allowing for both packetted comms to VDP, and stored functions on the VDP
allows for more command buffers to be used this may help when using buffers for logic and programming - being limited to 256 buffers could have proven too restrictive. moving to a 16-bit identifier gives room to breath and space out bufferIds also add support for clearing all buffers by sending the “clear buffer” command with a buffer ID of 65535
VDUStreamProcessor now handles input and output streams separately. They’re now stored using shared_ptr for safer memory management set output buffer command added, allowing output to be redirected to a buffer instead of only to the ez80. this allows, for instance, capturing mode information in a buffer for use in stored functions VDP side WritableBufferStream added, which supports `write` - buffers created with the new “buffer create” use this class, whereas other buffers do not. this makes it harder to overwrite command buffers with information packets
optimise how getBuffer works so it doesn’t need to iterate over all buffers on every call
incomplete adjust command - supports basic add, set, and not operations. also supports getting operand values from a buffer+offset other operations will be added once “multi” variants have been worked out
Contributor
Author
|
hey @breakintoprogram thanks for merging this in. this merge actually puts Quark ahead of my Console8 fork 😀 sorry for not raising a PR yet with docs. I've got most of the commands documented, but need to improve them a bit and write some more examples. I'd hoped to make more progress, but I've caught a cold and just haven't fancied trying to write anything. 😀 I expect I'll get back to it after the weekend. |
Owner
|
No worries - thanks for all the contributions so far! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for buffered VDU commands
This is achieved thru
VDU 23, 0, &A0, bufferId; command, <args>There are commands to write a stream to a given buffer ID, "call" the VDU stream with a given buffer ID (send it to a VDU stream processor), clear a buffer ID, and to adjust the contents of a buffer.
This system allows for multiple streams to be stored against a given buffer ID. This allows for data to be sent over in multiple packets, of variable size. A bitmap or sound sample can therefore be sent over in multiple packets, rather than having to be sent over in a single data packet. When a stream is written to a buffer ID it is retained, and is not cleared after the buffer has been "called". Therefore if your intent is to use this functionality purely for packeted comms with the VDP you will need to explicitly clear a buffer after using it.
Commands are also present to allow for adjusting values within buffers, conditionally calling buffers (if conditions are met) and allowing data packets that would otherwise have been sent from the VDP to the eZ80 to be captured into a buffer. These essentially allow for reasonably complex functions to be able to be run on the VDP.
Another PR will come soon that provides documentation and examples for this command set. (Some limited documentation is already present in the code.)