Desktop S4: Macro for DESKTOP_RELAY calls

This commit is contained in:
Joshua Bell 2017-12-30 21:03:33 -08:00
parent ac7639499b
commit 204d269421
3 changed files with 76 additions and 181 deletions

13
a2d.inc
View File

@ -588,16 +588,3 @@ end:
A2D_GLYPH_RETURN := $0D A2D_GLYPH_RETURN := $0D
A2D_GLYPH_OAPPLE := $1F A2D_GLYPH_OAPPLE := $1F
A2D_GLYPH_CAPPLE := $1E A2D_GLYPH_CAPPLE := $1E
;; Relay for main>aux A2D call (Y=call, X,A=params addr)
.macro A2D_RELAY_CALL call, addr
ldy #(call)
.if .paramcount > 1
lda #<(addr)
ldx #>(addr)
.else
lda #0
ldx #0
.endif
jsr desktop_A2D_RELAY
.endmacro

View File

@ -64,6 +64,40 @@ DESKTOP_REDRAW_ICONS := $0C ; Repaints desktop icons
.endif .endif
.endmacro .endmacro
;;; ==================================================
;; 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
;; Relay for main>aux DESKTOP call (Y=call, X,A=params addr)
DESKTOP_RELAY := $D040
.macro DESKTOP_RELAY_CALL call, addr
ldy #(call)
.if .paramcount > 1
lda #<(addr)
ldx #>(addr)
.else
lda #0
ldx #0
.endif
jsr DESKTOP_RELAY
.endmacro
;;; ================================================== ;;; ==================================================
;;; DeskTop Internals ;;; DeskTop Internals

View File

@ -5,6 +5,7 @@
.include "../inc/auxmem.inc" .include "../inc/auxmem.inc"
.include "../inc/prodos.inc" .include "../inc/prodos.inc"
.include "../a2d.inc" .include "../a2d.inc"
.include "../desktop.inc"
L0000 := $0000 L0000 := $0000
L0006 := $0006 L0006 := $0006
@ -17,11 +18,7 @@ L0D14 := $0D14
L2710 := $2710 L2710 := $2710
;; Various Main>Aux relays and routines ;; Various Main>Aux relays and routines
A2D_RELAY := $D000
desktop_A2D_RELAY := $D000
LD01C := $D01C LD01C := $D01C
DESKTOP_RELAY := $D040
LD05E := $D05E LD05E := $D05E
LD082 := $D082 LD082 := $D082
LD096 := $D096 LD096 := $D096
@ -185,10 +182,7 @@ L412B: lda #$00
jsr L4244 jsr L4244
L4143: bit L40F1 L4143: bit L40F1
bpl L4151 bpl L4151
ldy #$0C DESKTOP_RELAY_CALL $0C, $0000
lda #$00
ldx #$00
jsr DESKTOP_RELAY
L4151: rts L4151: rts
L4152: brk L4152: brk
@ -271,15 +265,9 @@ L41FE: lda L4241
tax tax
lda $DEA1,x lda $DEA1,x
sta $E22F sta $E22F
ldy #$0D DESKTOP_RELAY_CALL $0D, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
beq L4221 beq L4221
ldy #$03 DESKTOP_RELAY_CALL $03, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
L4221: inc L4241 L4221: inc L4241
jmp L41FE jmp L41FE
@ -322,15 +310,9 @@ L4270: lda L42C3
lda $DF22,x lda $DF22,x
sta $E22F sta $E22F
jsr L8915 jsr L8915
ldy #$0D DESKTOP_RELAY_CALL $0D, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
beq L4296 beq L4296
ldy #$03 DESKTOP_RELAY_CALL $03, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
L4296: lda $E22F L4296: lda $E22F
jsr L8893 jsr L8893
inc L42C3 inc L42C3
@ -344,10 +326,7 @@ L42A5: lda L42C3
tax tax
lda $DF22,x lda $DF22,x
sta $E22F sta $E22F
ldy #$03 DESKTOP_RELAY_CALL $03, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
inc L42C3 inc L42C3
jmp L42A5 jmp L42A5
@ -451,10 +430,7 @@ L43E7: tsx
sta $D2AA sta $D2AA
lda #$00 lda #$00
sta $D20E sta $D20E
ldy #$09 DESKTOP_RELAY_CALL $09, $D209
lda #$09
ldx #$D2
jsr DESKTOP_RELAY
lda $D20D lda $D20D
beq L4415 beq L4415
jmp L67D7 jmp L67D7
@ -516,10 +492,7 @@ L445D: jsr L6D2B
and #$0F and #$0F
sta L445C sta L445C
jsr L8997 jsr L8997
ldy #$02 DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
jsr L4510 jsr L4510
lda L445C lda L445C
sta $DF20 sta $DF20
@ -564,10 +537,7 @@ L4510: A2D_RELAY_CALL A2D_QUERY_SCREEN, $D239
rts rts
L4523: jsr L40F2 L4523: jsr L40F2
ldy #$0C DESKTOP_RELAY_CALL $0C, $0000
lda #$00
ldx #$00
jsr DESKTOP_RELAY
rts rts
L4530: ldx #$00 L4530: ldx #$00
@ -828,10 +798,7 @@ L4748: cmp #$FF
beq L4755 beq L4755
lda #$FA lda #$FA
jsr L4802 jsr L4802
L4755: ldy #$06 L4755: DESKTOP_RELAY_CALL $06, $0000
lda #$00
ldx #$00
jsr DESKTOP_RELAY
A2D_RELAY_CALL $3A ; ??? A2D_RELAY_CALL $3A ; ???
A2D_RELAY_CALL A2D_SET_MENU, $E680 A2D_RELAY_CALL A2D_SET_MENU, $E680
ldx $D355 ldx $D355
@ -1639,10 +1606,7 @@ L4E78: jsr L6D2B
dex dex
lda $E6D1,x lda $E6D1,x
bmi L4EB4 bmi L4EB4
ldy #$07 DESKTOP_RELAY_CALL $07, $EC25
lda #$25
ldx #$EC
jsr DESKTOP_RELAY
lda $DD9E lda $DD9E
sec sec
sbc $DEA0 sbc $DEA0
@ -1683,10 +1647,7 @@ L4EC3: sta $DEA0
and #$0F and #$0F
sta $DF20 sta $DF20
jsr L8997 jsr L8997
ldy #$02 DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
jsr L4510 jsr L4510
lda #$01 lda #$01
sta $DF21 sta $DF21
@ -1703,10 +1664,7 @@ L4EC3: sta $DEA0
A2D_RELAY_CALL A2D_QUERY_TOP, $EC25 A2D_RELAY_CALL A2D_QUERY_TOP, $EC25
lda $EC25 lda $EC25
bne L4F3C bne L4F3C
ldy #$0C DESKTOP_RELAY_CALL $0C, $0000
lda #$00
ldx #$00
jsr DESKTOP_RELAY
L4F3C: lda #$00 L4F3C: lda #$00
sta $E269 sta $E269
A2D_RELAY_CALL $36, $E267 ; ??? A2D_RELAY_CALL $36, $E267 ; ???
@ -1964,10 +1922,7 @@ L51C0: ldx L51EF
sta $E22F sta $E22F
jsr L8915 jsr L8915
jsr L6E8E jsr L6E8E
ldy #$02 DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
lda $E22F lda $E22F
jsr L8893 jsr L8893
dec L51EF dec L51EF
@ -2108,10 +2063,7 @@ L52DF: lda #$00
A2D_RELAY_CALL $36, $E267 ; ??? A2D_RELAY_CALL $36, $E267 ; ???
rts rts
L5302: ldy #$07 L5302: DESKTOP_RELAY_CALL $07, $EC25
lda #$25
ldx #$EC
jsr DESKTOP_RELAY
lda $EC25 lda $EC25
sta $DE9F sta $DE9F
jsr LD09A jsr LD09A
@ -2307,10 +2259,7 @@ L5485: cpx $DEA0
lda $DEA1,x lda $DEA1,x
sta $E22F sta $E22F
jsr L8915 jsr L8915
ldy #$0D DESKTOP_RELAY_CALL $0D, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
pha pha
lda $E22F lda $E22F
jsr L8893 jsr L8893
@ -2482,10 +2431,7 @@ L55F0: ldx L544A
jsr L56F9 jsr L56F9
lda $E22F lda $E22F
jsr L8915 jsr L8915
L5614: ldy #$02 L5614: DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
lda $D212 lda $D212
beq L562B beq L562B
lda $E22F lda $E22F
@ -2505,10 +2451,7 @@ L562C: lda $E22F
jsr L56F9 jsr L56F9
lda $E22F lda $E22F
jsr L8915 jsr L8915
L564A: ldy #$0B L564A: DESKTOP_RELAY_CALL $0B, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
lda $D212 lda $D212
beq L5661 beq L5661
lda $E22F lda $E22F
@ -2560,10 +2503,7 @@ L56B4: ldx L56F8
beq L56CF beq L56CF
lda $E22B lda $E22B
jsr L8915 jsr L8915
L56CF: ldy #$02 L56CF: DESKTOP_RELAY_CALL $02, $E22B
lda #$2B
ldx #$E2
jsr DESKTOP_RELAY
lda $E22C lda $E22C
beq L56E3 beq L56E3
lda $E22B lda $E22B
@ -2849,10 +2789,7 @@ L5916: lda $DEA1,x
sta $E22F sta $E22F
lda #$00 lda #$00
sta $DEA1,x sta $DEA1,x
ldy #$04 DESKTOP_RELAY_CALL $04, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
lda $E22F lda $E22F
jsr LD082 jsr LD082
dec $DEA0 dec $DEA0
@ -2995,10 +2932,7 @@ L5A4C: jsr L4523
lda $E22F lda $E22F
jsr LD082 jsr LD082
jsr L4510 jsr L4510
ldy #$04 DESKTOP_RELAY_CALL $04, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
L5A7F: lda $DEA0 L5A7F: lda $DEA0
sta L5AC6 sta L5AC6
inc $DEA0 inc $DEA0
@ -3257,10 +3191,7 @@ L5CB7: bit L5B1B
L5CBF: lda $EC25 L5CBF: lda $EC25
sta $D20E sta $D20E
ldy #$09 DESKTOP_RELAY_CALL $09, $D209
lda #$09
ldx #$D2
jsr DESKTOP_RELAY
lda $D20D lda $D20D
bne L5CDA bne L5CDA
jsr L5F13 jsr L5F13
@ -3302,10 +3233,7 @@ L5D0B: ldx $DF21
sta $E22F sta $E22F
jsr L8915 jsr L8915
jsr L6E8E jsr L6E8E
ldy #$02 DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
lda $EC25 lda $EC25
sta $D212 sta $D212
jsr L44F2 jsr L44F2
@ -3318,10 +3246,7 @@ L5D0B: ldx $DF21
L5D55: lda L5CD9 L5D55: lda L5CD9
sta $EBFC sta $EBFC
ldy #$0A DESKTOP_RELAY_CALL $0A, $EBFC
lda #$FC
ldx #$EB
jsr DESKTOP_RELAY
tax tax
lda $EBFC lda $EBFC
beq L5DA6 beq L5DA6
@ -3369,10 +3294,7 @@ L5DC4: txa
pha pha
lda $DF22,x lda $DF22,x
sta $E22E sta $E22E
ldy #$03 DESKTOP_RELAY_CALL $03, $E22E
lda #$2E
ldx #$E2
jsr DESKTOP_RELAY
pla pla
tax tax
dex dex
@ -3570,15 +3492,9 @@ L5F88: txa
lda $DEA1,x lda $DEA1,x
sta $E22F sta $E22F
jsr L8915 jsr L8915
ldy #$0D DESKTOP_RELAY_CALL $0D, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
beq L5FB9 beq L5FB9
ldy #$02 DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
ldx $DF21 ldx $DF21
inc $DF21 inc $DF21
lda $E22F lda $E22F
@ -3823,10 +3739,7 @@ L61DC: lda $EC25
sec sec
sbc $DEA0 sbc $DEA0
sta $DD9E sta $DD9E
ldy #$07 DESKTOP_RELAY_CALL $07, $EC25
lda #$25
ldx #$EC
jsr DESKTOP_RELAY
ldx #$00 ldx #$00
L6206: cpx $DEA0 L6206: cpx $DEA0
beq L6215 beq L6215
@ -3865,10 +3778,7 @@ L6227: sta $DEA0
and #$0F and #$0F
sta $DF20 sta $DF20
jsr L8997 jsr L8997
ldy #$02 DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
jsr L4510 jsr L4510
lda #$01 lda #$01
sta $DF21 sta $DF21
@ -4457,10 +4367,7 @@ L67F6: bit $C061
bpl L6818 bpl L6818
lda $DF20 lda $DF20
bne L6818 bne L6818
ldy #$02 DESKTOP_RELAY_CALL $02, $D20D
lda #$0D
ldx #$D2
jsr DESKTOP_RELAY
ldx $DF21 ldx $DF21
lda $D20D lda $D20D
sta $DF22,x sta $DF22,x
@ -4468,10 +4375,7 @@ L67F6: bit $C061
jmp L6834 jmp L6834
L6818: jsr L6D2B L6818: jsr L6D2B
L681B: ldy #$02 L681B: DESKTOP_RELAY_CALL $02, $D20D
lda #$0D
ldx #$D2
jsr DESKTOP_RELAY
lda #$01 lda #$01
sta $DF21 sta $DF21
lda $D20D lda $D20D
@ -4482,10 +4386,7 @@ L6834: bit $D2AA
bpl L6880 bpl L6880
lda $D20D lda $D20D
sta $EBFC sta $EBFC
ldy #$0A DESKTOP_RELAY_CALL $0A, $EBFC
lda #$FC
ldx #$EB
jsr DESKTOP_RELAY
tax tax
lda $EBFC lda $EBFC
beq L6878 beq L6878
@ -4528,10 +4429,7 @@ L6893: txa
pha pha
lda $DF22,x lda $DF22,x
sta $E22D sta $E22D
ldy #$03 DESKTOP_RELAY_CALL $03, $E22D
lda #$2D
ldx #$E2
jsr DESKTOP_RELAY
pla pla
tax tax
dex dex
@ -4575,15 +4473,9 @@ L6904: txa
pha pha
lda $DEA1,x lda $DEA1,x
sta $E22F sta $E22F
ldy #$0D DESKTOP_RELAY_CALL $0D, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
beq L692C beq L692C
ldy #$02 DESKTOP_RELAY_CALL $02, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
ldx $DF21 ldx $DF21
inc $DF21 inc $DF21
lda $E22F lda $E22F
@ -4772,10 +4664,7 @@ L6AA7: stx $DE9F
jsr L44F2 jsr L44F2
lda $E6BE lda $E6BE
jsr L8915 jsr L8915
L6AD8: ldy #$03 L6AD8: DESKTOP_RELAY_CALL $03, $E6BE
lda #$BE
ldx #$E6
jsr DESKTOP_RELAY
lda $D212 lda $D212
beq L6AEF beq L6AEF
lda $E6BE lda $E6BE
@ -4855,10 +4744,7 @@ L6B68: lda #$01
jsr L6E8E jsr L6E8E
lda $E6BE lda $E6BE
jsr L8915 jsr L8915
L6BA1: ldy #$03 L6BA1: DESKTOP_RELAY_CALL $03, $E6BE
lda #$BE
ldx #$E6
jsr DESKTOP_RELAY
lda $D212 lda $D212
beq L6BB8 beq L6BB8
lda $E6BE lda $E6BE
@ -5008,15 +4894,9 @@ L6D09: txa
pha pha
lda $DEA1,x lda $DEA1,x
sta $E22F sta $E22F
ldy #$0D DESKTOP_RELAY_CALL $0D, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
beq L6D25 beq L6D25
ldy #$03 DESKTOP_RELAY_CALL $03, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
L6D25: pla L6D25: pla
tax tax
inx inx
@ -5047,10 +4927,7 @@ L6D56: lda L6DB0
lda $DF22,x lda $DF22,x
sta $E22F sta $E22F
jsr L8915 jsr L8915
ldy #$0B DESKTOP_RELAY_CALL $0B, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
lda $E22F lda $E22F
jsr L8893 jsr L8893
inc L6DB0 inc L6DB0
@ -5062,10 +4939,7 @@ L6D7D: lda L6DB0
tax tax
lda $DF22,x lda $DF22,x
sta $E22F sta $E22F
ldy #$0B DESKTOP_RELAY_CALL $0B, $E22F
lda #$2F
ldx #$E2
jsr DESKTOP_RELAY
inc L6DB0 inc L6DB0
jmp L6D7D jmp L6D7D