Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the ability to unset VDP flags #82

Open
stevesims opened this issue Aug 4, 2023 · 2 comments
Open

Allow the ability to unset VDP flags #82

stevesims opened this issue Aug 4, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@stevesims
Copy link
Contributor

As communications with the VDP are asynchronous one needs to be able to wait until a command has been processed before the status/result of that command can be read.

The mechanism to do this is to check the VDP status flags in MOS, which can be read from BASIC using OSBYTE &A0. However these flags are only ever set by MOS on receipt from messages from the VDP. MOS itself does not provide a mechanism to clear these flags, so instead callers need to explicitly clear those flags. Examples of clearing appropriate flags can be seen in the BASIC assembler source code, like this.

Unfortunately this means that at present it's not possible to write BASIC code to synchronise comms with the VDP, as once a VDP status flag has been set it cannot be unset.

We therefore need a mechanism to allow us to clear these flags.

@stevesims
Copy link
Contributor Author

It's probably more sensible to implement clearing of VDP comms flags via a MOS call.

If we do that and also implement a SYS command as I've suggested in breakintoprogram/agon-bbc-basic#58 then it would be easy to reset these flags from BASIC code.

@breakintoprogram breakintoprogram added the enhancement New feature or request label Aug 13, 2023
@breakintoprogram breakintoprogram transferred this issue from breakintoprogram/agon-bbc-basic Aug 13, 2023
@breakintoprogram breakintoprogram added enhancement New feature or request and removed enhancement New feature or request labels Aug 13, 2023
@breakintoprogram
Copy link
Owner

I agree, probably sits better in MOS.

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: No status
Development

No branches or pull requests

2 participants