Skip to content

Refactor code for readability and maintainability#83

Closed
stevesims wants to merge 11 commits intobreakintoprogram:mainfrom
stevesims:refactor-upstream
Closed

Refactor code for readability and maintainability#83
stevesims wants to merge 11 commits intobreakintoprogram:mainfrom
stevesims:refactor-upstream

Conversation

@stevesims
Copy link
Copy Markdown
Contributor

Refactor of codebase to aid with readability and maintainability.

The code is mostly identical to the existing code but functions and data declarations have been moved into separate files. Some refactoring has been done to split functionality into separate functions to provide a cleaner separation.

In general, files named with a prefix of agon are responsible for hardware features, and those starting with vdu are handlers of the VDU byte stream. Other files provide higher level capabilities and abstractions and are named according to their function.

Incorporates the screen mode change fix from #80

This refactor mostly represents/mirrors the codebase that will form the basis of the VDP code for the Agon Console8. The only differences at present is the Console8 version of the VDP code already includes the audio enhancements from #76, and further audio enhancements to add frequency envelope support.

The refactoring in this PR will allow for easier further refactoring to help make better use of PSRAM, thus reducing the use of internal RAM on the VDP. This will enable work to be done on adding in various new features.

@breakintoprogram breakintoprogram added the enhancement New feature or request label Sep 4, 2023
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
@stevesims
Copy link
Copy Markdown
Contributor Author

This PR has been updated so that it will merge, rebasing it on the current main branch.

NB it is arguably superseded by #88 as that PR contains all of the changes from this, plus the frequency envelope support from #86 as well as significantly improved memory management.

This PR represents an earlier step along the way to the codebase in #88 - in principle it could be merged first, as all of these commits are present in that later PR. As noted in the description for this PR, there is very little in the way of actual code changes here - those came later.

@stevesims stevesims mentioned this pull request Sep 7, 2023
@breakintoprogram breakintoprogram added duplicate This issue or pull request already exists and removed enhancement New feature or request labels Sep 12, 2023
@breakintoprogram
Copy link
Copy Markdown
Owner

Closed as 'Won't Do' as this is now duplicated by #88

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

Labels

duplicate This issue or pull request already exists

Projects

Status: Won't Do

Development

Successfully merging this pull request may close these issues.

2 participants