DeskTop: more seg2 structuring

This commit is contained in:
Joshua Bell 2017-09-29 16:01:54 -04:00
parent 1ecac5b0f9
commit 1bbf77f8aa
2 changed files with 108 additions and 104 deletions

View File

@ -27,7 +27,9 @@ JUMP_TABLE_CUR_POINTER := $4039 ; Changes mouse cursor to pointer
JUMP_TABLE_CUR_WATCH := $403C ; Changes mouse cursor to watch JUMP_TABLE_CUR_WATCH := $403C ; Changes mouse cursor to watch
JUMP_TABLE_3F := $403F ; ??? JUMP_TABLE_3F := $403F ; ???
;; $D000 is relay for A2D call (Y=call, X,A=params addr) ;; Relay for A2D call (Y=call, X,A=params addr)
A2D_RELAY := $D000
;;; ================================================== ;;; ==================================================
;;; A2D Calls ;;; A2D Calls

View File

@ -9,6 +9,7 @@ L87F6 := $87F6
L8813 := $8813 L8813 := $8813
LB600 := $B600 LB600 := $B600
;; A2D call from aux>main, call in Y, params at (X,A)
.proc LD000 .proc LD000
sty addr-1 sty addr-1
sta addr sta addr
@ -21,24 +22,27 @@ LB600 := $B600
rts rts
.endproc .endproc
.scope
;; SET_POS with params at (X,A) followed by DRAW_TEXT call
.proc LD01C
sta addr sta addr
stx addr+1 stx addr+1
sta RAMRDON sta RAMRDON
sta RAMWRTON sta RAMWRTON
A2D_CALL $0E, 0, addr A2D_CALL A2D_SET_POS, 0, addr
ldy #$19 ldy #A2D_DRAW_TEXT
lda #$E9 lda #<text_buffer
ldx #$E6 ldx #>text_buffer
jsr LD000 jsr A2D_RELAY
tay tay
sta RAMRDOFF sta RAMRDOFF
sta RAMWRTOFF sta RAMWRTOFF
tya tya
rts rts
.endscope .endproc
.scope ;; DESKTOP call from aux>main, call in Y params at (X,A)
.proc LD040
sty addr-1 sty addr-1
sta addr sta addr
stx addr+1 stx addr+1
@ -50,28 +54,32 @@ LB600 := $B600
sta RAMWRTOFF sta RAMWRTOFF
tya tya
rts rts
.endscope .endproc
;; Find first 0 in AUX $1F80 ... $1F7F; if present,
;; mark it 1 and return index+1 in A
.proc LD05E
sta RAMRDON sta RAMRDON
sta RAMWRTON sta RAMWRTON
ldx #$00 ldx #0
LD066: lda $1F80,x loop: lda $1F80,x
beq LD071 beq :+
inx inx
cpx #$7F cpx #$7F
bne LD066 bne loop
rts rts
LD071: inx : inx
txa txa
dex dex
tay tay
lda #$01 lda #1
sta $1F80,x sta $1F80,x
sta RAMRDOFF sta RAMRDOFF
sta RAMWRTOFF sta RAMWRTOFF
tya tya
rts rts
.endproc
tay tay
sta RAMRDON sta RAMRDON
@ -189,7 +197,9 @@ LD14C: ora ($8D)
.byte 0,1,2,3,4,5,6,7 .byte 0,1,2,3,4,5,6,7
.byte $00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$15,$D2,$00 .byte $00,$00,$00,$00,$00
.addr buffer
buffer: .byte $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
@ -347,59 +357,24 @@ LD56D:
;; Looks like window param blocks starting here ;; Looks like window param blocks starting here
.byte $0F .byte $0F,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$96,$00,$32,$00,$F4,$01,$8C,$00,$4B,$00,$23,$00,$00,$20,$80,$00,$00,$00,$00,$00,$90,$01,$64,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$01,$01,$00,$7F,$00,$88,$00,$00
.byte $01,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$96,$00,$32,$00,$F4 .byte $12,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$96,$00,$32,$00,$F4,$01,$8C,$00,$19,$00,$14,$00,$00,$20,$80,$00,$00,$00,$00,$00,$F4,$01,$99,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$01,$01,$00,$7F,$00,$88,$00,$00
.byte $01,$8C,$00,$4B,$00,$23,$00,$00
.byte $20,$80,$00,$00,$00,$00,$00,$90 .byte $15,$01,$00,$00,$00,$C1,$00,$00,$03,$00,$00,$00,$64,$00,$46,$00,$64,$00,$46,$00,$35,$00,$32,$00,$00,$20,$80,$00,$00,$00,$00,$00,$7D,$00,$46,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$01,$01,$00,$7F,$00,$88,$00,$00
.byte $01,$64,$00,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$00,$00,$00,$00 .byte $18,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$96,$00,$32,$00,$F4,$01,$8C,$00,$50,$00,$28,$00,$00,$20,$80,$00,$00,$00,$00,$00,$90,$01,$6E,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$01,$01,$00,$7F,$00,$88,$00,$00
.byte $00,$01,$01,$00,$7F,$00,$88,$00
.byte $00,$12,$01,$00,$00,$00,$00,$00 .byte $1B,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$96,$00,$32,$00,$F4,$01,$8C,$00,$69,$00,$19,$00,$00,$20,$80,$00,$00,$00,$00,$00,$5E,$01,$6E,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$01,$01,$00,$7F,$00,$88,$00,$00
.byte $00,$00,$00,$00,$00,$96,$00,$32
.byte $00,$F4,$01,$8C,$00,$19,$00,$14 ;; Coordinates for labels?
.byte $00,$00,$20,$80,$00,$00,$00,$00 .byte $28,$00,$25,$00,$68,$01,$2F,$00,$2D,$00,$2E,$00,$28,$00,$3D,$00,$68,$01,$47,$00,$2D,$00,$46,$00,$00,$00,$12,$00,$28,$00,$12,$00,$28,$00,$23,$00,$28,$00,$00,$00
.byte $00,$F4,$01,$99,$00,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$00,$00 .word $4B, $23 ; left, top
.byte $00,$00,$00,$01,$01,$00,$7F,$00 .addr A2D_SCREEN_ADDR
.byte $88,$00,$00,$15,$01,$00,$00,$00 .word A2D_SCREEN_STRIDE
.byte $C1,$00,$00,$03,$00,$00,$00,$64 .word 0, 0 ; width, height
.byte $00,$46,$00,$64,$00,$46,$00,$35 .byte $66,$01,$64,$00,$00,$04,$00,$02,$00,$5A,$01,$6C,$00,$05,$00,$03,$00,$59,$01,$6B,$00,$06,$00,$16,$00,$58,$01,$16,$00,$06,$00,$59,$00,$58,$01,$59,$00,$D2,$00,$5C,$00,$36,$01,$67,$00,$28,$00,$5C,$00,$8C,$00,$67,$00,$D7,$00,$66,$00,$2D,$00,$66,$00,$82,$00,$07,$00,$DC,$00,$13,$00
.byte $00,$32,$00,$00,$20,$80,$00,$00
.byte $00,$00,$00,$7D,$00,$46,$00,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $00,$00,$00,$00,$00,$01,$01,$00
.byte $7F,$00,$88,$00,$00,$18,$01,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$96,$00,$32,$00,$F4,$01,$8C
.byte $00,$50,$00,$28,$00,$00,$20,$80
.byte $00,$00,$00,$00,$00,$90,$01,$6E
.byte $00,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$00,$00,$00,$00,$00,$01
.byte $01,$00,$7F,$00,$88,$00,$00,$1B
.byte $01,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$96,$00,$32,$00,$F4
.byte $01,$8C,$00,$69,$00,$19,$00,$00
.byte $20,$80,$00,$00,$00,$00,$00,$5E
.byte $01,$6E,$00,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$00,$00,$00,$00
.byte $00,$01,$01,$00,$7F,$00,$88,$00
.byte $00,$28,$00,$25,$00,$68,$01,$2F
.byte $00,$2D,$00,$2E,$00,$28,$00,$3D
.byte $00,$68,$01,$47,$00,$2D,$00,$46
.byte $00,$00,$00,$12,$00,$28,$00,$12
.byte $00,$28,$00,$23,$00,$28,$00,$00
.byte $00,$4B,$00,$23,$00,$00,$20,$80
.byte $00,$00,$00,$00,$00,$66,$01,$64
.byte $00,$00,$04,$00,$02,$00,$5A,$01
.byte $6C,$00,$05,$00,$03,$00,$59,$01
.byte $6B,$00,$06,$00,$16,$00,$58,$01
.byte $16,$00,$06,$00,$59,$00,$58,$01
.byte $59,$00,$D2,$00,$5C,$00,$36,$01
.byte $67,$00,$28,$00,$5C,$00,$8C,$00
.byte $67,$00,$D7,$00,$66,$00,$2D,$00
.byte $66,$00,$82,$00,$07,$00,$DC,$00
.byte $13,$00
PASCAL_STRING "Add an Entry ..." PASCAL_STRING "Add an Entry ..."
PASCAL_STRING "Edit an Entry ..." PASCAL_STRING "Edit an Entry ..."
@ -549,28 +524,58 @@ LDFA1: .addr $0000,$E723,$E76F,$E7BB,$E807,$E853,$E89F,$E8EB,$E937,$0000,$E98
.byte $00,$04,$00,$00,$00,$04,$00,$00 .byte $00,$04,$00,$00,$00,$04,$00,$00
.byte $04,$00,$00,$00,$00,$00,$04,$00 .byte $04,$00,$00,$00,$00,$00,$04,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $06,$E3,$40,$00,$13,$00,$00,$00
.byte $00,$00,$00,$00,$0C,$E3,$00,$00 .addr str_all
.byte $00,$00,$23,$E3,$00,$00,$00,$00
.byte $3A,$E3,$00,$00,$00,$00,$51,$E3 .byte $40,$00,$13,$00,$00,$00
.byte $00,$00,$00,$00,$68,$E3,$00,$00 .byte 0,0,0,0
.byte $00,$00,$7F,$E3,$00,$00,$00,$00 .addr sd0s
.byte $96,$E3,$00,$00,$00,$00,$AD,$E3 .byte 0,0,0,0
.byte $00,$00,$00,$00,$C4,$E3,$00,$00 .addr sd1s
.byte $00,$00,$DB,$E3,$00,$00,$00,$00 .byte 0,0,0,0
.byte $F2,$E3,$00,$00,$00,$00,$09,$E4 .addr sd2s
.byte $00,$00,$00,$00,$20,$E4,$00,$00 .byte 0,0,0,0
.byte $00,$00,$37,$E4,$07,$00,$00,$00 .addr sd3s
.byte $00,$00,$00,$00,$00,$00,$4C,$E4 .byte 0,0,0,0
.byte $00,$00,$00,$00,$54,$E4,$00,$00 .addr sd4s
.byte $00,$00,$5C,$E4,$00,$00,$00,$00 .byte 0,0,0,0
.byte $64,$E4,$00,$00,$00,$00,$6C,$E4 .addr sd5s
.byte $00,$00,$00,$00,$74,$E4,$00,$00 .byte 0,0,0,0
.addr sd6s
.byte 0,0,0,0
.addr sd7s
.byte 0,0,0,0
.addr sd8s
.byte 0,0,0,0
.addr sd9s
.byte 0,0,0,0
.addr sd10s
.byte 0,0,0,0
.addr sd11s
.byte 0,0,0,0
.addr sd12s
.byte 0,0,0,0
.addr sd13s
.byte $07,$00,$00,$00
.byte $00,$00 .byte $00,$00
.byte 0,0,0,0
.addr s00
.byte 0,0,0,0
.addr s01
.byte 0,0,0,0
.addr s02
.byte 0,0,0,0
.addr s03
.byte 0,0,0,0
.addr s04
.byte 0,0,0,0
.addr s05
.byte 0,0,0,0
.addr $E47C .addr $E47C
PASCAL_STRING "All" str_all:PASCAL_STRING "All"
sd0: A2D_DEFSTRING "Slot drive ", sd0s sd0: A2D_DEFSTRING "Slot drive ", sd0s
sd1: A2D_DEFSTRING "Slot drive ", sd1s sd1: A2D_DEFSTRING "Slot drive ", sd1s
@ -587,13 +592,13 @@ sd11: A2D_DEFSTRING "Slot drive ", sd11s
sd12: A2D_DEFSTRING "Slot drive ", sd12s sd12: A2D_DEFSTRING "Slot drive ", sd12s
sd13: A2D_DEFSTRING "Slot drive ", sd13s sd13: A2D_DEFSTRING "Slot drive ", sd13s
PASCAL_STRING "Slot 0 " s00: PASCAL_STRING "Slot 0 "
PASCAL_STRING "Slot 0 " s01: PASCAL_STRING "Slot 0 "
PASCAL_STRING "Slot 0 " s02: PASCAL_STRING "Slot 0 "
PASCAL_STRING "Slot 0 " s03: PASCAL_STRING "Slot 0 "
PASCAL_STRING "Slot 0 " s04: PASCAL_STRING "Slot 0 "
PASCAL_STRING "Slot 0 " s05: PASCAL_STRING "Slot 0 "
PASCAL_STRING "Slot 0 " s06: PASCAL_STRING "Slot 0 "
.addr sd0, sd1, sd2, sd3, sd4, sd5, sd6, sd7 .addr sd0, sd1, sd2, sd3, sd4, sd5, sd6, sd7
.addr sd8, sd9, sd10, sd11, sd12, sd13 .addr sd8, sd9, sd10, sd11, sd12, sd13
@ -649,16 +654,13 @@ LE4F2:
.byte $E8,$D9,$E8,$25,$E9,$71,$E9,$00 .byte $E8,$D9,$E8,$25,$E9,$71,$E9,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$70,$00,$00,$00,$8C .byte $00,$00,$00,$70,$00,$00,$00,$8C
.byte $00,$00,$00,$E7,$00,$00,$00,$EC .byte $00,$00,$00,$E7,$00,$00,$00
.byte $E6,$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
.proc text_buffer
.addr data
.byte 0
data: .res 55, 0
.endproc
; Looks like a bunch of window params starting here-ish ; Looks like a bunch of window params starting here-ish
.macro WIN_PARAMS_DEFN window_id, label, buflabel .macro WIN_PARAMS_DEFN window_id, label, buflabel