Pull the rogue DeskTop segment 51F-DFF into DeskTop, update include files

This commit is contained in:
Joshua Bell 2018-01-20 10:40:48 -08:00
parent b9b5f2d469
commit a541023587
13 changed files with 522 additions and 545 deletions

51
a2d.inc
View File

@ -44,7 +44,7 @@ A2D_QUERY_SCREEN := $03 ; Get screen state
;; .byte vthick vertical pen thickness
;; .byte 0 ??? fill mode?
;; .byte tmask AND mask for text, default $7F
;; .addr font A2D_DEFAULT_FONT
;; .addr font
A2D_SET_STATE := $04 ; Set full drawing state
;; (input length 36 bytes)
@ -65,7 +65,7 @@ A2D_SET_STATE := $04 ; Set full drawing state
;; .byte vthick vertical pen thickness
;; .byte 0 ??? fill mode?
;; .byte tmask AND mask for text, default $7F
;; .addr font A2D_DEFAULT_FONT
;; .addr font
A2D_GET_STATE := $05 ; Get pointer to active drawing state
;; (input length 0 bytes)
@ -330,7 +330,7 @@ A2D_CREATE_WINDOW := $38
;; .byte vthick
;; .byte 0 ??? fill mode?
;; .byte tmask AND mask for text, default $7F
;; .addr font A2D_DEFAULT_FONT
;; .addr font
;; .addr next address of next lower window in stack (filled in by call)
A2D_DESTROY_WINDOW := $39
@ -539,48 +539,3 @@ end:
;;; px() has high bit clear, PX() has high bit set
.define px(bits) (((bits&$40)>>6)|((bits&$20)>>4)|((bits&$10)>>2)|(bits&$8)|((bits&$4)<<2)|((bits&$2)<<4)|((bits&$1)<<6))
.define PX(bits) (((bits&$40)>>6)|((bits&$20)>>4)|((bits&$10)>>2)|(bits&$8)|((bits&$4)<<2)|((bits&$2)<<4)|((bits&$1)<<6)|$80)
;;; ==================================================
;;; Internals
A2D_DEFAULT_FONT := $8800
font_flag := $8800 ; = $00 - if high bit set, glyphs are 2 bytes wide (???)
font_size_count := $8801 ; = $7F - max glyph number (count is this + 1)
font_height := $8802 ; 9 pixels
font_width_table := $8803 ; width in pixels, indexed by ASCII code
font_glyphs := $8883 ; $80 glyphs, organized by row, 9 bytes per
;; So glyph for A $41
;; width is at $8803 + $41 = $8844 which is 7
;; row0 is at $8883 + $41 + (0 * $80) = $88C4 ~ $1E = %00011110
;; row1 is at $8883 + $41 + (1 * $80) = $8944 ~ $33 = %00110011
;; etc
;;
;; Glyphs $00-$1F are useful symbols; some overlap with MouseText
;; (called out as MT:X in the table below)
;;
;; $00 = space $10 = TM left
;; $01 = folder left (MT:X) $11 = TM right
;; $02 = folder right (MT:Y) $12 = pound
;; $03 = hourglass (MT:C) $13 = pi
;; $04 = insertion pt $14 = divide
;; $05 = pointer (MT:B) $15 = rarrow (MT:U)
;; $06 = vbar (MT:_) $16 = tri
;; $07 = hbar (MT:S) $17 = open circ
;; $08 = larrow $18 = close (MT:])
;; $09 = left box $19 = gray odd (MT:W)
;; $0A = darrow (MT:J) $1A = gray even (MT:V)
;; $0B = uarrow (MT:K) $1B = solid circ
;; $0C = right box $1C = inv check (MT:E)
;; $0D = return (MT:M) $1D = check (MT:D)
;; $0E = (C) $1E = solid apple (MT:@)
;; $0F = (R) $1F = open apple (MT:A)
A2D_GLYPH_LARROW := $09
A2D_GLYPH_RARROW := $15
A2D_GLYPH_UARROW := $0B
A2D_GLYPH_DARROW := $0A
A2D_GLYPH_RETURN := $0D
A2D_GLYPH_OAPPLE := $1F
A2D_GLYPH_CAPPLE := $1E

View File

@ -7,7 +7,7 @@
.include "../inc/prodos.inc"
.include "../a2d.inc"
.include "../desktop.inc" ; needed to redraw DeskTop icons after window move
.include "../desktop.inc" ; redraw icons after window move; font
.org $800
@ -798,7 +798,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte 0
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
create_window_params_top := create_window_params::top

View File

@ -7,7 +7,7 @@
.include "../inc/prodos.inc"
.include "../a2d.inc"
.include "../desktop.inc" ; needed to redraw DeskTop icons after window mode
.include "../desktop.inc" ; redraw icons after window move, font
.org $800
@ -806,7 +806,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7f
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
create_window_params_top := create_window_params::top

View File

@ -6,7 +6,7 @@
.include "../inc/auxmem.inc"
.include "../a2d.inc"
.include "../desktop.inc" ; needed to redraw DeskTop icons after window move
.include "../desktop.inc" ; redraw icons after window move; font; glyphs
.org $800
@ -288,7 +288,7 @@ hthick: .byte 4
vthick: .byte 2
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
@ -760,13 +760,13 @@ date_rect:
.word $20,$0F,$9A,$23
label_ok:
A2D_DEFSTRING {"OK ",A2D_GLYPH_RETURN} ;
A2D_DEFSTRING {"OK ",GLYPH_RETURN} ;
label_cancel:
A2D_DEFSTRING "Cancel ESC"
label_uparrow:
A2D_DEFSTRING A2D_GLYPH_UARROW
A2D_DEFSTRING GLYPH_UARROW
label_downarrow:
A2D_DEFSTRING A2D_GLYPH_DARROW
A2D_DEFSTRING GLYPH_DARROW
label_cancel_pos:
.word $15,$38

View File

@ -6,7 +6,7 @@
.include "../inc/prodos.inc"
.include "../a2d.inc"
.include "../desktop.inc" ; needed to redraw DeskTop icons after window mode
.include "../desktop.inc" ; redraw icons after window move, font
.org $800
@ -625,7 +625,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
@ -648,7 +648,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
.byte 0,0 ; ???
.endproc

View File

@ -6,7 +6,7 @@
.include "../inc/auxmem.inc"
.include "../a2d.inc"
.include "../desktop.inc" ; needed to get DeskTop selection
.include "../desktop.inc" ; get selection, font
.org $800
@ -229,7 +229,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc

View File

@ -6,7 +6,7 @@
.include "../inc/auxmem.inc"
.include "../a2d.inc"
.include "../desktop.inc" ; needed to get/clear DeskTop selection
.include "../desktop.inc" ; get/clear selection, font
.org $800
@ -338,7 +338,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc

View File

@ -70,52 +70,76 @@ DESKTOP_REDRAW_ICONS := $0C ; Repaints desktop icons
.endif
.endmacro
;;; ==================================================
;;; $D000 routines/pointers (called from MAIN)
;;; These are used by the MAIN (and sometimes AUX) halves of DeskTop itself,
;;; since this bank can be accessed from both AUX and MAIN.
;; Listed here as they are used by weird DeskTop block in A2D space
;; Relay for main>aux A2D call (Y=call, X,A=params addr)
A2D_RELAY := $D000
.macro A2D_RELAY_CALL call, addr
ldy #(call)
.if .paramcount > 1
lda #<(addr)
ldx #>(addr)
.else
lda #0
ldx #0
.endif
jsr A2D_RELAY
.endmacro
DESKTOP_FIND_SPACE := $D05E ; Find space in AUX $1F80 table
;;; ==================================================
;;; DeskTop Internals
;;; Internals - Windows (paths) and Icons (files)
;;; NOTE: Some of these are used by Desk Accessories
;; These are DeskTop internals, but it appears there is no
;; API for getting the selected file.
file_selected := $DF21 ; 0 if no selection, 1 otherwise
path_index := $DF20 ; index of selected window (used to get prefix)
path_table := $DFB3 ; window address table
;; each entry is 65 bytes long
;; length-prefixed path string (no trailing /)
file_index := $DF22 ; index of selected file (global, not w/in window)
file_table := $DD9F ; file address table
;; each entry is 27 bytes long
;; .byte ??
;; .byte ??
;; .byte type/icon (bits 4,5,6 clear = directory)
;; .word iconx (pixels)
;; .word icony (pixels)
;; .byte ??
;; .byte ??
;; .byte len, name (length-prefixed, spaces before/after; 17 byte buffer)
;; These are DeskTop internals, but it appears there is no
;; API for getting the selected file.
file_selected := $DF21 ; 0 if no selection, 1 otherwise
path_index := $DF20 ; index of selected window (used to get prefix)
path_table := $DFB3 ; window address table
;; each entry is 65 bytes long
;; length-prefixed path string (no trailing /)
file_index := $DF22 ; index of selected file (global, not w/in window)
file_table := $DD9F ; file address table
;; each entry is 27 bytes long
;; .byte ??
;; .byte ??
;; .byte type/icon (bits 4,5,6 clear = directory)
;; .word iconx (pixels)
;; .word icony (pixels)
;; .byte ??
;; .byte ??
;; .byte len, name (length-prefixed, spaces before/after; 17 byte buffer)
;;; ==================================================
;;; Internals - Default Font
DEFAULT_FONT := $8800
font_flag := $8800 ; = $00 - if high bit set, glyphs are 2 bytes wide (???)
font_size_count := $8801 ; = $7F - max glyph number (count is this + 1)
font_height := $8802 ; 9 pixels
font_width_table := $8803 ; width in pixels, indexed by ASCII code
font_glyphs := $8883 ; $80 glyphs, organized by row, 9 bytes per
;;; So glyph for A $41
;;; width is at $8803 + $41 = $8844 which is 7
;;; row0 is at $8883 + $41 + (0 * $80) = $88C4 ~ $1E = %00011110
;;; row1 is at $8883 + $41 + (1 * $80) = $8944 ~ $33 = %00110011
;;; etc
;;; Control Character Glyphs
;;; Glyphs $00-$1F are useful symbols; some overlap with MouseText
;;; (called out as MT:X in the table below)
;;;
;;; $00 = space $10 = TM left
;;; $01 = folder left (MT:X) $11 = TM right
;;; $02 = folder right (MT:Y) $12 = pound
;;; $03 = hourglass (MT:C) $13 = pi
;;; $04 = insertion pt $14 = divide
;;; $05 = pointer (MT:B) $15 = rarrow (MT:U)
;;; $06 = vbar (MT:_) $16 = tri
;;; $07 = hbar (MT:S) $17 = open circ
;;; $08 = larrow $18 = close (MT:])
;;; $09 = left box $19 = gray odd (MT:W)
;;; $0A = darrow (MT:J) $1A = gray even (MT:V)
;;; $0B = uarrow (MT:K) $1B = solid circ
;;; $0C = right box $1C = inv check (MT:E)
;;; $0D = return (MT:M) $1D = check (MT:D)
;;; $0E = (C) $1E = solid apple (MT:@)
;;; $0F = (R) $1F = open apple (MT:A)
GLYPH_LARROW := $09
GLYPH_RARROW := $15
GLYPH_UARROW := $0B
GLYPH_DARROW := $0A
GLYPH_RETURN := $0D
GLYPH_OAPPLE := $1F
GLYPH_CAPPLE := $1E

View File

@ -10,28 +10,32 @@ the rest to a RAM card (if available), then invoking the main app.
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.
$FFFF (except for I/O space and ProDOS), and still having more code
segments swapped in dynamically.
The file is broken down into multiple segments:
* segment 0: load - A$2000-$257F, L$0580, mark $000000 (Loader)
* segment 1: aux1 - A$4000-$BFFF, L$8000, mark $000580 (A2D, part of DeskTop)
* segment 2: aux2 - A$D000-$ECFF, L$1D00, mark $008580 (More of DeskTop)
* segment 3: aux3 - A$FB00-$FFFF, L$0500, mark $00A280 (More of DeskTop)
* segment 4: main - A$4000-$BEFF, L$7F00, mark $00A780 (More of DeskTop)
* segment 5: main - A$0800-$0FFF, L$0800, mark $012680 (Initializer)
* segment 6: main - A$0290-$03EF, L$0160, mark $012E80 (Invoker)
* segment 0: load - A$2000-$257F, L$0580, mark $000000 (Loader)
* segment 1: aux - A$4000-$BFFF, L$8000, mark $000580 (A2D, DeskTop)
* segment 2: auxlc - A$D000-$ECFF, L$1D00, mark $008580 (DeskTop)
* segment 3: auxlc - A$FB00-$FFFF, L$0500, mark $00A280 (DeskTop)
* segment 4: main - A$4000-$BEFF, L$7F00, mark $00A780 (DeskTop)
* segment 5: main - A$0800-$0FFF, L$0800, mark $012680 (Initializer)
* segment 6: main - A$0290-$03EF, L$0160, mark $012E80 (Invoker)
* segments dynamically loaded for these actions:
* disk copy - A$0800, L$0200, mark $012FE0
* format/erase - A$0800, L$1400, mark $0160E0
* selector - A$9000, L$1000, mark $0174E0
* helpers - A$5000, L$2000, mark $0184E0 (used by selector, copy, delete)
* common - A$5000, L$2000, mark $0184E0 (used by selector, copy, delete)
* file copy - A$7000, L$0800, mark $01A4E0
* file delete - A$7000, L$0800, mark $01ACE0
* selector - A$7000, L$0800, mark $01B4E0
* (EOF is $01BCE0)
The DeskTop segments loaded into the Aux bank switched ("language
card") memory can be used from both main and aux, so contain relay
routines, resources, and buffers. More details below.
## Structure
### Loader
@ -77,25 +81,22 @@ run.
`a2d.s`
AUX $4000-$8DFF is the GUI library used for the DeskTop application
AUX $4000-$851E 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
* Aux $851F-$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:
...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
@ -103,6 +104,11 @@ DeskTop application code is in the lower 48k of both Aux and Main:
($C000-$CFFF is reserved for I/O, and main $BF page and language card is ProDOS)
Interactive commands including disk copy/format/erase, file
copy/delete, and Selector add/edit/delete/run all dynamically load
main memory code segments into one or more of: $800-$1FFF,
$5000-$6FFF, $7000-$77FF, and $9000-$9FFF. When complete, any original
code above $4000 is reloaded.
```
Main Aux ROM
@ -125,20 +131,31 @@ $BF00 +-------------+ | App Code |
| | | |
| | | |
| | | |
$A000 | +------+ | |
| | Seg | | |
| | | | |
| | | | |
$9000 | +------+ | |
| | | |
$8800 | | | Font |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
$8E00 | | +-------------+
$851F | | +-------------+
| | | A2D GUI |
| | | Library |
| | | |
| | | |
| | | |
| | | |
$7800 | +------+ | |
| | Seg | | |
$7000 | +------+ | |
| | Seg | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
$5000 | +------+ | |
| | | |
| | | |
| | | |
@ -152,11 +169,10 @@ $4000 +-------------+ +-------------+
| | | |
| | | |
| | | |
| | | |
$2000 +-------------+ +-------------+
| Initializer | | Desk Acc |
| & Desk Acc | | |
| | | |
| & Segments | | |
| | | |
$0800 +-------------+ +-------------+
| Text | | Text |

View File

@ -8532,7 +8532,6 @@ L837A: cmp $CB
L8380: inc set_input_params::unk
clc
lda #$08
L8388 := *+2
bit set_input_params::modifiers
bpl L838D
lda #$40
@ -8776,386 +8775,4 @@ mouse_firmware_hi: ; e.g. if mouse is in slot 4, this is $C4
mouse_operand: ; e.g. if mouse is in slot 4, this is $40
.byte 0
;;; ==================================================
;;; TODO: This section behaves almost like part of DeskTop, not A2D ???
;; Is this actually needed, or a coincidence?
desktop_win18_state := $D63F
.byte $03
.addr $85E9
L8522: php
lda $E904,x
sta $09
ldy #$14
ldx #$00
L852C: lda ($08),y
sta L8590,x
iny
inx
cpx #$04
bne L852C
ldy #$1C
ldx #$00
L853B: lda ($08),y
sta L8594,x
iny
inx
cpx #$04
bne L853B
ldy #$03
lda ($06),y
sec
sbc L8590
sta ($06),y
iny
lda ($06),y
sbc L8591
sta ($06),y
iny
lda ($06),y
sec
sbc L8592
sta ($06),y
iny
lda ($06),y
sbc L8593
sta ($06),y
ldy #$03
lda ($06),y
clc
adc L8594
sta ($06),y
iny
lda ($06),y
adc L8595
sta ($06),y
iny
lda ($06),y
clc
adc L8596
sta ($06),y
iny
lda ($06),y
adc L8597
sta ($06),y
jsr L83A5
rts
L8590: .byte $24
L8591: .byte $00
L8592: .byte $23
L8593: .byte $00
L8594: .byte $00
L8595: .byte $00
L8596: .byte $00
L8597: .byte $00
lda #$00
ldx #$00
L859C: sta $D409,x
sta $D401,x
sta $D40D
inx
cpx #$04
bne L859C
lda #$0A
sta $D40D
sta $D40F
A2D_RELAY_CALL A2D_SET_STATE, $D401
rts
lda #$39
ldx #$1A
jsr L6B17
ldx $D5CA
txs
rts
lda #$56
ldx #$1A
jsr L6B17
ldx $D5CA
txs
rts
lda #$71
ldx #$1A
jsr L6B17
ldx $D5CA
txs
rts
cmp #$27
bne L85F2
lda #$22
ldx #$1B
jsr L6B17
ldx $D5CA
txs
jmp L8625
L85F2: cmp #$45
bne L8604
lda #$3B
ldx #$1B
jsr L6B17
ldx $D5CA
txs
jmp L8625
L8604: cmp #$52
bne L8616
lda #$5B
ldx #$1B
jsr L6B17
ldx $D5CA
txs
jmp L8625
L8616: cmp #$57
bne L8625
lda #$7C
ldx #$1B
jsr L6B17
ldx $D5CA
txs
L8625: A2D_RELAY_CALL $33, desktop_win18_state
rts
lda #$9C
ldx #$1B
jsr L6B17
ldx $D5CA
txs
A2D_RELAY_CALL $33, desktop_win18_state
rts
lda #$BF
ldx #$1B
jsr L6B17
ldx $D5CA
txs
A2D_RELAY_CALL $33, desktop_win18_state
rts
sta L8737
sty L8738
and #$F0
sta online_params_unit
sta ALTZPOFF
MLI_CALL ON_LINE, online_params
sta ALTZPON
beq L867B
L8672: pha
dec $EF8A
dec $EF88
pla
rts
L867B: lda online_params_buffer
beq L8672
jsr L8388 ; ??? This is the middle of an instruction?
jsr DESKTOP_FIND_SPACE ; AUX > MAIN call???
ldy L8738
sta $D464,y
asl a
tax
lda $F13A,x
sta $06
lda $F13B,x
sta $07
ldx #$00
ldy #$09
lda #$20
L869E: sta ($06),y
iny
inx
cpx #$12
bne L869E
ldy #$09
lda online_params_buffer
and #$0F
sta online_params_buffer
sta ($06),y
ldx #$00
ldy #$0B
L86B6: lda online_params_buffer+1,x
cmp #$41
bcc L86C4
cmp #$5F
bcs L86C4
clc
adc #$20
L86C4: sta ($06),y
iny
inx
cpx online_params_buffer
bne L86B6
ldy #$09
lda ($06),y
clc
adc #$02
sta ($06),y
lda L8737
and #$0F
cmp #$04
bne L86ED
ldy #$07
lda #$B4
sta ($06),y
iny
lda #$14
sta ($06),y
jmp L870A
L86ED: cmp #$0B
bne L86FF
ldy #$07
lda #$70
sta ($06),y
iny
lda #$14
sta ($06),y
jmp L870A
L86FF: ldy #$07
lda #$40
sta ($06),y
iny
lda #$14
sta ($06),y
L870A: ldy #$02
lda #$00
sta ($06),y
inc L8738
lda L8738
asl a
asl a
tax
ldy #$03
L871B: lda L8739,x
sta ($06),y
inx
iny
cpy #$07
bne L871B
ldx $EF8A
dex
ldy #$00
lda ($06),y
sta $EF8B,x
jsr L83A5
lda #$00
rts
L8737: rts
L8738: .byte $04
L8739: .byte $00,$00,$00,$00
;; Desktop icon placements?
.word 500, 16
.word 500, 41
.word 500, 66
.word 500, 91
.word 500, 116
.word 440, 16
.word 440, 41
.word 440, 66
.word 440, 91
.word 440, 116
.word 440, 141
.word 400, 16
.word 400, 41
.word 400, 66
.proc online_params
count: .byte 2
unit: .byte $60 ; Slot 6 Drive 1
buffer: .addr online_params_buffer
.endproc
online_params_unit := online_params::unit
;; Per ProDOS TRM this should be 256 bytes!
online_params_buffer:
.byte $0B
.byte "GRAPHICS.TK",$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$C8
;;; ==================================================
.include "font.inc"
;;; ==================================================
;; ???
.byte $00,$00,$00,$00,$77,$30,$01
.byte $00,$00,$7F,$00,$00,$7F,$00,$00
.byte $00,$00,$00,$7A,$00,$00,$00,$00
.byte $00,$14,$55,$2A,$00,$7F,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$01,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $0E,$00,$00,$07,$00,$00,$00,$00
.byte $00,$03,$18,$00,$00,$00,$00,$00
.byte $00,$00,$0E,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00
.endproc ; a2d

View File

@ -11,6 +11,7 @@
;;; DeskTop - the actual application
;;; ==================================================
INVOKER := $290 ; Invoke other programs
INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set)
@ -53,12 +54,378 @@ INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set)
.word top
.endmacro
.macro A2D_RELAY_CALL call, addr
ldy #(call)
.if .paramcount > 1
lda #<(addr)
ldx #>(addr)
.else
lda #0
ldx #0
.endif
jsr A2D_RELAY
.endmacro
;;; ==================================================
;;; Segment loaded into AUX $8E00-$BFFF (follows A2D)
;;; Segment loaded into AUX $851F-$BFFF (follows A2D)
;;; ==================================================
.proc desktop_aux
.org $8E00
.org $851F
;;; ==================================================
;;; This chunk of code appears to be used by one or more
;;; of the dynamically loaded segments.
.byte $03
.addr $85E9
L8522: php
lda $E904,x
sta $09
ldy #$14
ldx #$00
L852C: lda ($08),y
sta L8590,x
iny
inx
cpx #$04
bne L852C
ldy #$1C
ldx #$00
L853B: lda ($08),y
sta L8594,x
iny
inx
cpx #$04
bne L853B
ldy #$03
lda ($06),y
sec
sbc L8590
sta ($06),y
iny
lda ($06),y
sbc L8591
sta ($06),y
iny
lda ($06),y
sec
sbc L8592
sta ($06),y
iny
lda ($06),y
sbc L8593
sta ($06),y
ldy #$03
lda ($06),y
clc
adc L8594
sta ($06),y
iny
lda ($06),y
adc L8595
sta ($06),y
iny
lda ($06),y
clc
adc L8596
sta ($06),y
iny
lda ($06),y
adc L8597
sta ($06),y
jsr $83A5
rts
L8590: .byte $24
L8591: .byte $00
L8592: .byte $23
L8593: .byte $00
L8594: .byte $00
L8595: .byte $00
L8596: .byte $00
L8597: .byte $00
lda #$00
ldx #$00
L859C: sta $D409,x
sta $D401,x
sta $D40D
inx
cpx #$04
bne L859C
lda #$0A
sta $D40D
sta $D40F
A2D_RELAY_CALL A2D_SET_STATE, $D401
rts
lda #$39
ldx #$1A
jsr $6B17
ldx $D5CA
txs
rts
lda #$56
ldx #$1A
jsr $6B17
ldx $D5CA
txs
rts
lda #$71
ldx #$1A
jsr $6B17
ldx $D5CA
txs
rts
cmp #$27
bne L85F2
lda #$22
ldx #$1B
jsr $6B17
ldx $D5CA
txs
jmp L8625
L85F2: cmp #$45
bne L8604
lda #$3B
ldx #$1B
jsr $6B17
ldx $D5CA
txs
jmp L8625
L8604: cmp #$52
bne L8616
lda #$5B
ldx #$1B
jsr $6B17
ldx $D5CA
txs
jmp L8625
L8616: cmp #$57
bne L8625
lda #$7C
ldx #$1B
jsr $6B17
ldx $D5CA
txs
L8625: A2D_RELAY_CALL $33, win18_state
rts
lda #$9C
ldx #$1B
jsr $6B17
ldx $D5CA
txs
A2D_RELAY_CALL $33, win18_state
rts
lda #$BF
ldx #$1B
jsr $6B17
ldx $D5CA
txs
A2D_RELAY_CALL $33, win18_state
rts
sta L8737
sty L8738
and #$F0
sta online_params_unit
sta ALTZPOFF
MLI_CALL ON_LINE, online_params
sta ALTZPON
beq L867B
L8672: pha
dec $EF8A
dec $EF88
pla
rts
L867B: lda online_params_buffer
beq L8672
jsr $8388 ; into dynamically loaded code???
jsr DESKTOP_FIND_SPACE ; AUX > MAIN call???
ldy L8738
sta $D464,y
asl a
tax
lda $F13A,x
sta $06
lda $F13B,x
sta $07
ldx #$00
ldy #$09
lda #$20
L869E: sta ($06),y
iny
inx
cpx #$12
bne L869E
ldy #$09
lda online_params_buffer
and #$0F
sta online_params_buffer
sta ($06),y
ldx #$00
ldy #$0B
L86B6: lda online_params_buffer+1,x
cmp #$41
bcc L86C4
cmp #$5F
bcs L86C4
clc
adc #$20
L86C4: sta ($06),y
iny
inx
cpx online_params_buffer
bne L86B6
ldy #$09
lda ($06),y
clc
adc #$02
sta ($06),y
lda L8737
and #$0F
cmp #$04
bne L86ED
ldy #$07
lda #$B4
sta ($06),y
iny
lda #$14
sta ($06),y
jmp L870A
L86ED: cmp #$0B
bne L86FF
ldy #$07
lda #$70
sta ($06),y
iny
lda #$14
sta ($06),y
jmp L870A
L86FF: ldy #$07
lda #$40
sta ($06),y
iny
lda #$14
sta ($06),y
L870A: ldy #$02
lda #$00
sta ($06),y
inc L8738
lda L8738
asl a
asl a
tax
ldy #$03
L871B: lda L8739,x
sta ($06),y
inx
iny
cpy #$07
bne L871B
ldx $EF8A
dex
ldy #$00
lda ($06),y
sta $EF8B,x
jsr $83A5
lda #$00
rts
L8737: rts
L8738: .byte $04
L8739: .byte $00,$00,$00,$00
;; Desktop icon placements?
L873D: .word 500, 16
.word 500, 41
.word 500, 66
.word 500, 91
.word 500, 116
.word 440, 16
.word 440, 41
.word 440, 66
.word 440, 91
.word 440, 116
.word 440, 141
.word 400, 16
.word 400, 41
.word 400, 66
.proc online_params
count: .byte 2
unit: .byte $60 ; Slot 6 Drive 1
buffer: .addr online_params_buffer
.endproc
online_params_unit := online_params::unit
;; Per ProDOS TRM this should be 256 bytes!
online_params_buffer:
.byte $0B
.byte "GRAPHICS.TK",$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$C8
;;; ==================================================
.include "font.inc"
;;; ==================================================
;; ???
L8C83: .byte $00,$00,$00,$00,$77,$30,$01
.byte $00,$00,$7F,$00,$00,$7F,$00,$00
.byte $00,$00,$00,$7A,$00,$00,$00,$00
.byte $00,$14,$55,$2A,$00,$7F,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$01,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $0E,$00,$00,$07,$00,$00,$00,$00
.byte $00,$03,$18,$00,$00,$00,$00,$00
.byte $00,$00,$0E,$00,$00,$00,$00,$00
;; Pad to $8E00
.res $8E00 - *, 0
;;; ==================================================
;; Entry point for "DESKTOP"
.assert * = DESKTOP, error, "DESKTOP entry point must be at $8E00"
@ -269,7 +636,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte $96 ; ???
tmask: .byte 0
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
.endproc
.proc query_state_params
@ -3006,7 +3373,7 @@ trash_pixels:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
label_apple:
PASCAL_STRING A2D_GLYPH_CAPPLE
PASCAL_STRING GLYPH_CAPPLE
label_file:
PASCAL_STRING "File"
label_view:
@ -3163,7 +3530,7 @@ LAE30: DEFINE_RECT 260,81,300,92
LAE38: DEFINE_RECT 320,81,360,92
str_ok_label:
PASCAL_STRING {"OK ",A2D_GLYPH_RETURN}
PASCAL_STRING {"OK ",GLYPH_RETURN}
LAE50: DEFINE_POINT $109,$5B
LAE54: DEFINE_POINT $2D,$5B
@ -3422,7 +3789,7 @@ LB6E0: .byte $01
LB6E1: .byte $37,$00
ok_label:
PASCAL_STRING {"OK ",A2D_GLYPH_RETURN}
PASCAL_STRING {"OK ",GLYPH_RETURN}
try_again_rect:
.word $14,$25,$78,$30
@ -4068,7 +4435,7 @@ addr: .addr 0
.endproc
;; Pad to $C000
.res $C000 - *, 0
.res $C000 - *, 0
.assert * = $C000, error, "Segment length mismatch"
.endproc ; desktop_aux
@ -4084,8 +4451,8 @@ addr: .addr 0
;;; ==================================================
;;; A2D call from main>aux, call in Y, params at (X,A)
.proc A2D_RELAY_IMPL
.assert * = A2D_RELAY, error, "Entry point mismatch"
.proc A2D_RELAY
.assert * = $D000, error, "Entry point mismatch"
sty addr-1
sta addr
stx addr+1
@ -4101,7 +4468,6 @@ addr: .addr 0
;;; SET_POS with params at (X,A) followed by DRAW_TEXT call
.proc SETPOS_RELAY
.assert * = SETPOS_RELAY, error, "Entry point mismatch"
sta addr
stx addr+1
sta RAMRDON
@ -4125,7 +4491,6 @@ addr: .addr 0
;;; DESKTOP call from main>aux, call in Y params at (X,A)
.proc DESKTOP_RELAY
.assert * = DESKTOP_RELAY, error, "Entry point mismatch"
sty addr-1
sta addr
stx addr+1
@ -4155,8 +4520,7 @@ addr: .addr 0
;;; Find first 0 in AUX $1F80 ... $1F7F; if present,
;;; mark it 1 and return index+1 in A
.proc DESKTOP_FIND_SPACE_IMPL
.assert * = DESKTOP_FIND_SPACE, error, "Entry point mismatch"
.proc DESKTOP_FIND_SPACE
sta RAMRDON
sta RAMWRTON
ldx #0
@ -4453,7 +4817,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte 0
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
.endproc
.byte $FF,$FF,$FF,$FF,$FF
@ -4643,7 +5007,7 @@ hthick: .byte 1
vthick: .byte 1
fill: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
@ -4679,7 +5043,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
@ -4715,7 +5079,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
@ -4752,9 +5116,10 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
win18_state := win18::state
.proc win1B
id: .byte $1B
@ -4788,7 +5153,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
@ -4818,12 +5183,12 @@ LD760: PASCAL_STRING "Run list"
PASCAL_STRING "Enter the full pathname of the run list file:"
PASCAL_STRING "Enter the name (14 characters max) you wish to appear in the run list"
PASCAL_STRING "Add a new entry to the:"
PASCAL_STRING {A2D_GLYPH_OAPPLE,"1 Run list"}
PASCAL_STRING {A2D_GLYPH_OAPPLE,"2 Other Run list"}
PASCAL_STRING {GLYPH_OAPPLE,"1 Run list"}
PASCAL_STRING {GLYPH_OAPPLE,"2 Other Run list"}
PASCAL_STRING "Down load:"
PASCAL_STRING {A2D_GLYPH_OAPPLE,"3 at first boot"}
PASCAL_STRING {A2D_GLYPH_OAPPLE,"4 at first use"}
PASCAL_STRING {A2D_GLYPH_OAPPLE,"5 never"}
PASCAL_STRING {GLYPH_OAPPLE,"3 at first boot"}
PASCAL_STRING {GLYPH_OAPPLE,"4 at first use"}
PASCAL_STRING {GLYPH_OAPPLE,"5 never"}
PASCAL_STRING "Enter the full pathname of the run list file:"
.byte $00,$00,$00,$00,$00,$00,$00
@ -4909,7 +5274,7 @@ LD90A: .byte $00
.byte $64,$00,$81,$D3,$00
.word $C6,$63
PASCAL_STRING {"OK ",A2D_GLYPH_RETURN}
PASCAL_STRING {"OK ",GLYPH_RETURN}
.word $C6,$44
PASCAL_STRING "Close"
@ -5229,7 +5594,7 @@ hthick: .byte 1
vthick: .byte 1
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
font: .addr DEFAULT_FONT
next: .addr 0
.endproc
buflabel:.res 18, 0
@ -5635,7 +6000,7 @@ app_mask:
.byte px(%0000000),px(%0000000),px(%0000000),px(%0000000),px(%0000000)
;; Pad to $10000
.res $10000 - *, 0
.res $10000 - *, 0
.assert * = $10000, error, "Segment length mismatch"
;;; ==================================================

Binary file not shown.

Binary file not shown.