a2d/desktop
2018-01-04 23:23:06 -08:00
..
infos Desktop: Improve s4 infos 2017-12-30 18:02:15 -08:00
orig DeskTop: Consolidate aux/main code into single source, split out GUI library 2018-01-04 14:18:24 -08:00
res Clean up directories, start work mapping DESKTOP2 2017-09-16 17:11:50 -07:00
.gitignore Add .gitignore for DeskTop dir 2017-09-18 20:31:16 -07:00
a2d.s DeskTop: Simplify some dynamic jumps 2018-01-04 20:27:15 -08:00
asm.cfg DeskTop: Consolidate aux/main code into single source, split out GUI library 2018-01-04 14:18:24 -08:00
desktop.s DeskTop: Identify window struct lurking in buffer 2018-01-04 21:15:20 -08:00
go.sh Desktop S4: Identify strings 2017-12-30 19:21:34 -08:00
loader.s DeskTop loader: figure out when the extra chunk is run 2018-01-04 23:23:06 -08:00
Makefile DeskTop: Consolidate aux/main code into single source, split out GUI library 2018-01-04 14:18:24 -08:00
README.md DeskTop loader: figure out when the extra chunk is run 2018-01-04 23:23:06 -08:00

DeskTop diassembly notes

DESKTOP.SYSTEM

A short (8k) loader program. This is likely responsible for copying the rest to a RAM card (if available), then invoking the main app.

DESKTOP2.$F1

This is large - 111k. It includes a loader, the DeskTop app (with both main memory and aux memory segments, filling everything from $4000 to $FFFF (except for I/O space and ProDOS), and still having more code - probably the disk copy code which is swapped in dynamically.

The file is broken down into multiple segments:

  • segment 0: load - offset $0000, length $0580, loaded at $2000
  • segment 1: aux1 - offset $0580, length $8000, loaded at $4000 (through $BFFF)
  • segment 2: aux2 - offset $8580, length $1D00, loaded at $D000 (through $ECFF)
  • segment 3: aux2 - offset $A280, length $0500, loaded at $FB00 (through $FFFF)
  • segment 4: main - offset $A780, length $7F00, loaded at $4000 (through $BEFF)
    • main $BF00-$BFFF is ProDOS buffers
    • main $C000-$CFFF is I/O space
    • main $D000-$FFFF is ProDOS
  • segment 5: TBD - 38k so must be further subdivided. Disk Copy???

Structure

Loader

loader.s

Invoked at $2000; patches the ProDOS QUIT routine (at LC2 $D100) then invokes it. That gets copied to $1000-$11FF and run by ProDOS.

The invoked code stashes the current prefix and re-patches ProDOS. It then (in a convoluted way) loads in the second $200 bytes of the system file at $2000 and invokes that.

GUI Library "A2D"

a2d.s

AUX $4000-$8DFF is the GUI library used for the DeskTop application and (presumably) for disk copy and Selector apps (TBD).

Entry point is $4000 with a ProDOS MLI-style calling convention

  • Font is at $8800

  • Part of $8500-$87FF looks like part of "DeskTop" (see below), dealing with online volumes.

"DeskTop" Application

desktop.s

DeskTop application code is in the lower 48k of both Aux and Main:

  • Aux $8E00-$BFFF - sitting above the GUI library
  • Main $4000-$BEFF

...and in the Aux language card area (accessible from both aux and main code) are relays, buffers and resources:

  • Aux $D000-$ECFF - relays and other aux/main helpers, resources (menus, strings, window)
  • Aux $ED00-$FAFF - hole for data buffer
  • Aux $FB00-$FFFF - more resources (file types, icons)

($C000-$CFFF is reserved for I/O, and main $BF page and language card is ProDOS)

       Main              Aux               ROM
$FFFF +------------+    +------------+    +------------+
      | ProDOS     |    | DeskTop    |    | Monitor    |
$F800 |            |    | Resources/ |    +------------+
      |            |    | Buffers    |    | Applesoft  |
      |            |    |            |    |            |
      |            |    |            |    |            |
      |            |    |            |    |            |
$D000 +------------+    +------------+    +------------+    +------------+
                                                            | I/O        |
                                                            |            |
$C000 +------------+    +------------+                      +------------+
      | ProDOS     |    | DeskTop    |
$BF00 +------------+    | App Code   |
      | DeskTop    |    |            |
      | App Code   |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
$8E00 |            |    +------------+
      |            |    | A2D GUI    |
      |            |    | Library    |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
$4000 +------------+    +------------+
      | Graphics   |    | Graphics   |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
      |            |    |            |
$2000 +------------+    +------------+
      | Desk Acc   |    | Desk Acc   |
      |            |    |            |
      |            |    |            |
$0800 +------------+    +------------+
      | Text       |    | Text       |
$0400 +------------+    +------------+
      |            |    |            |
$0300 +------------+    +------------+
      | Input Buf  |    | Input Buf  |
$0200 +------------+    +------------+
      | Stack      |    | Stack      |
$0100 +------------+    +------------+
      | Zero Page  |    | Zero Page  |
$0000 +------------+    +------------+