Console8 VDP code#88
Merged
breakintoprogram merged 37 commits intobreakintoprogram:mainfrom Sep 12, 2023
Merged
Conversation
WIP - still needs support for working out the frequency
also fixes bug where elapsed phases weren’t adjusting frequency
removes USE_HWFLOW as we’re always enabling hardware flow control
created: cursor.h - cursor handling viewport.h - viewport handling vdu.h - generic VDU handing vdu_sys.h - VDU 23 handling still to come: refactor of graphics, text, and screen code
fixes an issue whereby attempting to change into a screen mode where we have insufficient RAM would fail to restore the previous screen mode correctly
also formatting tweaks for consistency
also enhance waitPlotCompletion to allow for a future “wait for VSYNC” command support
wasn’t passing on escape
Audio enhancements, including frequency envelope support
Updated README.md for the Agon Console8
rationalises data types, ensuring we use more appropriate data types across the codebase results in a slight memory savings, so that’s a win
adds a (lightly modified) types.h file from Dave Plummer’s NightDriver project, which gives us a new allocator
Refactor codebase
use PreferPSRAMAlloc Also fix bug whereby attempting to select a non-existant sample would throw and thus crash the VDP
ensures that VGA controllers are disposed of when they’re no longer needed, rather than keeping instances hanging around this significantly reduces internal memory usage on the VDP and fixes an issue whereby mode 0 wouldn’t actually be able to work
fixes an issue whereby an un-cleared buffer is shown on changing into a double-buffered screen mode
Improved data types and memory usage
both `_VGAController` and `canvas` should be unique, so make them so
fix mode changes and screen memory usage
encapsulate stream processing first step - need to move actual stream processing into this class
Lots of moving around of functions so they’re in more logical places Audio is particularly re-arranged, so vdu_audio file is now solely about handling VDU stream Some minor tweaking of audio code to do some slightly better memory handling (unique_ptr instead of shared_ptr for things that should be unique)
Refactor VDU command handling
This reverts commit 66a8e70.
fixes an issue observed where occasionally bytes read from an SD card as part of an upload stream would get timed out. 10ms was too fast - 100ms seems to be fine
fixes an issue whereby if the z80 kept the VDP busy then keyboard input wouldn’t be picked up. this meant that a BASIC program that had a loop continually drawing to the screen couldnt be escaped from
Closed
Owner
|
Merged with main branch of Agon. Thank you! |
Contributor
Author
|
Awesome - there's more to come (buffered commands, and today I rewrote the I'll raise more PRs soon with these new features |
This was referenced Sep 12, 2023
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.
This PR syncs with the current
mainbranch of AgonConsole8/agon-vdp as of 2023-09-07This includes the frequency envelope support added in #86 as well as the structural refactoring in #83
There are further improvements in this codebase around memory management. Significantly less RAM is needed for the screen system, fixing issues that prevent some screen modes from being used (see #75), and optimisations have been made to the memory usage in the audio system making much better use of PSRAM. Some other minor leaks have been plugged. These changes leave significantly more internal RAM available on the VDP.
Quite some care and attention has been paid to the use of data types in this code. Plain C++ types have been preferred over Arduino aliases, appropriate sizes of data have been chosen throughout the codebase, and the C++
autotype is used where appropriate. (This made some small contributions to the lower memory footprint.)VDU command processing has been moved into a
VDUStreamProcessorclass. This is in preparation for the addition of "buffered command" support (AgonPlatform/agon-vdp#30). This new feature will allow for both packet-based communication from the z80 to the VDP, and also stored procedures (aka "display lists").