Skip to content

Console8 VDP code#88

Merged
breakintoprogram merged 37 commits intobreakintoprogram:mainfrom
stevesims:console8-sync
Sep 12, 2023
Merged

Console8 VDP code#88
breakintoprogram merged 37 commits intobreakintoprogram:mainfrom
stevesims:console8-sync

Conversation

@stevesims
Copy link
Copy Markdown
Contributor

@stevesims stevesims commented Sep 7, 2023

This PR syncs with the current main branch of AgonConsole8/agon-vdp as of 2023-09-07

This 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++ auto type is used where appropriate. (This made some small contributions to the lower memory footprint.)

VDU command processing has been moved into a VDUStreamProcessor class. 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").

stevesims and others added 30 commits August 14, 2023 10:07
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
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
both `_VGAController` and `canvas` should be unique, so make them so
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)
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
@breakintoprogram breakintoprogram added the enhancement New feature or request label Sep 12, 2023
@breakintoprogram breakintoprogram merged commit a699458 into breakintoprogram:main Sep 12, 2023
@breakintoprogram
Copy link
Copy Markdown
Owner

Merged with main branch of Agon. Thank you!

@stevesims
Copy link
Copy Markdown
Contributor Author

Awesome - there's more to come (buffered commands, and today I rewrote the PLOT support so we can do as much as is practical on vdp-gl) so it's great that this has been merged in.

I'll raise more PRs soon with these new features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

2 participants