Showing changes from revision #0 to #1:
Added | Removed | Changed
VDU save areas allow for the state of the VDU to be preserved while certain operations are performed, for example when screen output is redirected to a sprite via OS_SpriteOp 60.
The basic steps for using a save area are as follows:
During step 5 the kernel will save the current VDU state to your save area. If you were to redirect output to your sprite again, using the same save area, then the corresponding VDU state will be restored. This can be useful if you want to split lengthy tasks up into smaller chunks, e.g. for multitasking in the Wimp.
There’s another important function that save areas enable. If, during step 4, another piece of code was to attempt to redirect output to a sprite, then the kernel will save the VDU state to your save area. When the other code has finished and restores the previous screen output, the contents of your save area will be automatically restored. This makes the use of screen redirection by the other code completely transparent to your code. Conversely, if you’d failed to set up a save area in steps 1-3, then the VDU state would have been reset to default, potentially resulting in your code corrupting the graphics it was producing. This is the reason why it’s recommended to always use save areas when you’re given the opportunity to do so.
VDU save areas store the following state: