You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 easily unset.
We therefore need a mechanism to allow us to clear these flags.
It might be worth considering also adding a "wait for flag" API call. this should probably have a timeout
it is probably best to not combine that with a "clear" in one API, as what one should do is clear a flag, send a command to the VDP, and then wait for the flag bit to get set. an all-in-one "clear and wait" would need to get called after sending the command, which stands a chance of getting a response before the "clear and wait" gets executed.
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 easily unset.
We therefore need a mechanism to allow us to clear these flags.
Originally filed against Quark MOS as breakintoprogram/agon-mos#82
The text was updated successfully, but these errors were encountered: