2018-02-19 19:33:13 +00:00
|
|
|
# Desk Accessory API
|
|
|
|
|
|
|
|
Desk Accessories for DeskTop have general access to the Mouse Graphics
|
|
|
|
Tool Kit MLI, ProDOS MLI, and DeskTop APIs. Special considerations for
|
|
|
|
DAs are documented here.
|
|
|
|
|
|
|
|
### Desk Accessory Lifecycle
|
|
|
|
|
2019-07-28 23:54:06 +00:00
|
|
|
* DAs are loaded/invoked at $800 Main
|
|
|
|
* Up to $1C00 Main is available
|
|
|
|
* But Aux $1B00 and on must be preserved.
|
2018-02-19 19:33:13 +00:00
|
|
|
* Save stack pointer
|
2019-07-28 23:54:06 +00:00
|
|
|
* Copy DA code from Main to Aux (e.g. using `AUXMOVE`) at same address.
|
|
|
|
* Needed if any MGTK resources will be used (bitmaps, etc)
|
|
|
|
* Transfer control to the Aux copy (`RAMRDON`/`RAMWRTON`)
|
|
|
|
* This allows direct access to MGTK/IconTK MLI
|
|
|
|
* Retaining a copy in Main allows easy access to ProDOS MLI
|
|
|
|
* Turn on ALTZP and LCBANK1 (should already be the case)
|
2018-02-19 19:33:13 +00:00
|
|
|
* Create window (`OpenWindow`)
|
|
|
|
* Draw everything
|
|
|
|
* Flush event queue (`FlushEvents`)
|
|
|
|
* Run an event Loop (`GetEvent`, and subsequent processing, per MGTK)
|
|
|
|
* Normal event processing per MGTK
|
|
|
|
* In addition, following a window drag/resize, DeskTop calls must be made:
|
2019-07-28 23:54:06 +00:00
|
|
|
* `JUMP_TABLE_REDRAW_ALL` - redraw all windows
|
|
|
|
* `IconTK::REDRAW_ICONS` - redraw desktop (volume) icons
|
2018-02-19 19:33:13 +00:00
|
|
|
* ...
|
|
|
|
* Destroy window (`CloseWindow`)
|
2019-07-28 23:54:06 +00:00
|
|
|
* Tell DeskTop to redraw desktop icons (`IconTK::REDRAW_ICONS`)
|
|
|
|
* Switch control back to Main (`RAMRDOFF`/`RAMWRTOFF`)
|
2018-04-28 03:40:39 +00:00
|
|
|
* Ensure ALTZP and LCBANK1 are still on
|
2018-02-19 19:33:13 +00:00
|
|
|
* Restore stack pointer
|
|
|
|
* `rts`
|