Skip to content

Commit

Permalink
API doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash committed Jan 26, 2025
1 parent 170c1a0 commit 0523bc6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
11 changes: 11 additions & 0 deletions desk.acc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ Calls into other toolkits (Button TK, Line Edit TK) directly from Main
are not currently supported. (But this is straightforward to add, if
needed.)

The other `JUMP_TABLE_XYZ` calls defined in
[../desktop/desktop.inc](../desktop/desktop.inc) and documented in
[../desktop/APIs.md](../desktop/APIs.md) provide access to DeskTop
state such as icon selection and window paths, and expose some common
functions like reading persisted settings and accelerator control.

### Execution from Aux Memory

DAs can make toolkit calls directly by using macros. The entry points
Expand All @@ -106,12 +112,17 @@ required by the macros are defined automatically by the
* MGTK: use `MGTK_CALL`
* Button TK: use `BTK_CALL`
* LineEdit TK: use `LETK_CALL`
* ListBox TK: use `LBTK_CALL`

ProDOS MLI calls directly from Aux memory are _not supported_. DAs
running from Aux memory need to implement helper methods in Main which
they can call to do file operations, and any loaded data needs to
be proxied back to Aux memory using `AUXMOVE`.

In addition, `ReadSetting` and `WriteSetting` are defined which allow
for convenient access to persisted settings from aux memory. Call with
X = `DeskTopSettings::*` byte index, and A = input/output value.

## UI Lifecycle

See [Creating Applications and DeskTop Desk Accessories](../mgtk/MGTK.md#creating-applications-and-desktop-desk-accessories) for full details about the lifecycle of an MGTK-based application or desk accessory. In summary, though:
Expand Down
21 changes: 19 additions & 2 deletions desktop/APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Desk Accessories:
* [Icon ToolKit](../toolkits/IconTK.md)
* [LineEdit ToolKit](../toolkits/LETK.md)
* [Button TookKit](../toolkits/BTK.md)
* [ListBox TookKit](../toolkits/LBTK.md)
* DeskTop Jump Table - simple JSR calls starting at $4003 MAIN, no arguments
* Aux Entry Points

<!-- ============================================================ -->

Expand Down Expand Up @@ -47,7 +49,7 @@ Use the `JUMP_TABLE_MLI_CALL` macro (yes, same name) for convenience.

#### `JUMP_TABLE_CLEAR_UPDATES` *

Clear update events - i.e. redraw windows as needed after move/resize/close.
Tell DeskTop to process update events - i.e. redraw the desktop (volume icons) and directory windows as needed after move/resize/close. DeskTop will only redraw its own windows; Desk Accessories must redraw their own window.

#### `JUMP_TABLE_YIELD_LOOP` *

Expand All @@ -73,7 +75,7 @@ NOTE: This will use Aux $E00...$1FFF to save the alert background; be careful wh

Show alert, with custom parameters.

A,X is the address of an `AlertParams` structure; see `common.inc`.
A,X is the address of an `AlertParams` structure; see `../common.inc`.

NOTE: This will use Aux $E00...$1FFF to save the alert background; be careful when calling from a Desk Accessory, which may run from the same area.

Expand Down Expand Up @@ -159,3 +161,18 @@ Input: A,X = Path buffer.
#### `JUMP_TABLE_BELL` *

Play the alert sound, as specified in settings.

#### `JUMP_TABLE_SLOW_SPEED` *

Slow system accelerator; see `../lib/speed.s` for notes.

#### `JUMP_TABLE_RESUME_SPEED` *

Resume system accelerator; see `../lib/speed.s` for notes.

#### `JUMP_TABLE_READ_SETTING` *

Load a byte from the persisted settings defined by `DeskTopSettings` in `../common.inc`.

Input: X = DeskTopSetting::* index
Output: A = value, X = unchanged (handy for loading multi-byte values)

0 comments on commit 0523bc6

Please sign in to comment.