diff --git a/a2d.inc b/a2d.inc index 27d76e8..632788d 100644 --- a/a2d.inc +++ b/a2d.inc @@ -588,3 +588,11 @@ end: A2D_GLYPH_RETURN := $0D A2D_GLYPH_OAPPLE := $1F A2D_GLYPH_CAPPLE := $1E + + ;; Relay for main>aux A2D call (Y=call, X,A=params addr) +.macro A2D_RELAY_CALL call, addr + ldy #(call) + lda #<(addr) + ldx #>(addr) + jsr desktop_A2D_RELAY +.endmacro diff --git a/desktop/s123_aux.s b/desktop/s123_aux.s index 06f811e..80a838c 100644 --- a/desktop/s123_aux.s +++ b/desktop/s123_aux.s @@ -8860,14 +8860,6 @@ L859C: sta $D409,x sta $D40D sta $D40F - ;; Relay for main>aux A2D call (Y=call, X,A=params addr) -.macro A2D_RELAY_CALL call, addr - ldy #(call) - lda #<(addr) - ldx #>(addr) - jsr desktop_A2D_RELAY -.endmacro - A2D_RELAY_CALL A2D_SET_STATE, $D401 rts diff --git a/desktop/s4_main1.s b/desktop/s4_main1.s index dd40ff8..5b3e3a6 100644 --- a/desktop/s4_main1.s +++ b/desktop/s4_main1.s @@ -16,7 +16,10 @@ L0CF9 := $0CF9 L0D14 := $0D14 L2710 := $2710 + ;; Various Main>Aux relays and routines A2D_RELAY := $D000 +desktop_A2D_RELAY := $D000 + LD01C := $D01C DESKTOP_RELAY := $D040 LD05E := $D05E @@ -165,16 +168,10 @@ L4100: jsr L48F0 L410D: jsr L4113 jmp L4100 -L4113: ldy #$3E - lda #$09 - ldx #$D2 - jsr A2D_RELAY +L4113: A2D_RELAY_CALL $3E, $D209 bne L4151 jsr L4153 - ldy #$3F - lda #$00 - ldx #$00 - jsr A2D_RELAY + A2D_RELAY_CALL $3F, $0000 rts L412B: lda #$00 @@ -415,10 +412,7 @@ L4394: lda $D209 beq L43A1 lda #$01 L43A1: sta $E25D - ldy #$32 - lda #$5A - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $32, $E25A L43AD: ldx $E25A bne L43B3 rts @@ -440,10 +434,7 @@ L43B3: dex lda L42C5,x sta L43E6 jsr L43E0 - ldy #$33 - lda #$5A - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $33, $E25A rts L43E0: tsx @@ -453,10 +444,7 @@ L43E5: .byte $34 L43E6: .byte $12 L43E7: tsx stx $E256 - ldy #$40 - lda #$09 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $40, $D209 lda $D20D bne L4418 jsr L85FC @@ -475,10 +463,7 @@ L4415: jmp L68AA L4418: cmp #$01 bne L4428 - ldy #$31 - lda #$5A - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $31, $E25A jmp L43AD L4428: pha @@ -542,10 +527,7 @@ L445D: jsr L6D2B sta $DF21 lda $E22F sta $DF22 -L44A6: ldy #$42 - lda #$0E - ldx #$D2 - jsr A2D_RELAY +L44A6: A2D_RELAY_CALL $42, $D20E lda $D20E sta $EC25 sta $DE9F @@ -556,10 +538,7 @@ L44B8: jsr LD09A jsr LD09A lda #$00 sta $E269 - ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $36, $E267 ldx $EC25 dex lda $E6D1,x @@ -568,38 +547,20 @@ L44B8: jsr LD09A inc $E268 lda #$01 sta $E269 - ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $36, $E267 rts -L44F2: ldy #$3C - lda #$12 - ldx #$D2 - jsr A2D_RELAY - ldy #$04 - lda #$15 - ldx #$D2 - jsr A2D_RELAY +L44F2: A2D_RELAY_CALL $3C, $D212 + A2D_RELAY_CALL $04, $D215 rts -L4505: ldy #$3C - lda #$12 - ldx #$D2 - jsr A2D_RELAY +L4505: A2D_RELAY_CALL $3C, $D212 rts rts -L4510: ldy #$03 - lda #$39 - ldx #$D2 - jsr A2D_RELAY - ldy #$04 - lda #$39 - ldx #$D2 - jsr A2D_RELAY +L4510: A2D_RELAY_CALL $03, $D239 + A2D_RELAY_CALL $04, $D239 rts L4523: jsr L40F2 @@ -871,14 +832,8 @@ L4755: ldy #$06 lda #$00 ldx #$00 jsr DESKTOP_RELAY - ldy #$3A - lda #$00 - ldx #$00 - jsr A2D_RELAY - ldy #$30 - lda #$80 - ldx #$E6 - jsr A2D_RELAY + A2D_RELAY_CALL $3A, $0000 + A2D_RELAY_CALL $30, $E680 ldx $D355 L4773: lda $D355,x sta $0220,x @@ -951,11 +906,9 @@ L4808: cpx #$01 jmp L47D2 L4816: .byte $00 -L4817: .byte 12, "Basic.system",$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 +L4817: PASCAL_STRING "Basic.system" + .res 30, 0 + L4842: sta L0006 stx $07 ldy #$00 @@ -982,31 +935,19 @@ L4860: .byte $D0,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00,$00,$00 .byte $00,$00 L488A: jsr L48AA - ldy #$24 - lda #$11 - ldx #$D3 - jsr A2D_RELAY + A2D_RELAY_CALL $24, $D311 jsr L48B4 rts L489A: jsr L48AA - ldy #$24 - lda #$AD - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $24, $D2AD jsr L48B4 rts -L48AA: ldy #$26 - lda #$00 - ldx #$00 - jsr A2D_RELAY +L48AA: A2D_RELAY_CALL $26, $0000 rts -L48B4: ldy #$25 - lda #$00 - ldx #$00 - jsr A2D_RELAY +L48B4: A2D_RELAY_CALL $25, $0000 rts L48BE: ldx $E196 @@ -1031,28 +972,16 @@ L48CC: sta $D2AC .byte $4C L48E4: .byte $34 L48E5: .byte $12 -L48E6: ldy #$2A - lda #$08 - ldx #$D2 - jsr A2D_RELAY +L48E6: A2D_RELAY_CALL $2A, $D208 rts -L48F0: ldy #$2C - lda #$08 - ldx #$D2 - jsr A2D_RELAY +L48F0: A2D_RELAY_CALL $2C, $D208 rts -L48FA: ldy #$07 - lda #$02 - ldx #$D2 - jsr A2D_RELAY +L48FA: A2D_RELAY_CALL $07, $D202 rts -L4904: ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY +L4904: A2D_RELAY_CALL $07, $D200 rts L490E: rts @@ -1425,19 +1354,10 @@ L4C07: lda L4C7C sta L4CA1 jsr L489A jsr L4510 - ldy #$1A - lda #$A7 - ldx #$D2 - jsr A2D_RELAY - ldy #$1A - lda #$BE - ldx #$4B - jsr A2D_RELAY + A2D_RELAY_CALL $1A, $D2A7 + A2D_RELAY_CALL $1A, $4BBE jsr L0800 - ldy #$1A - lda #$A7 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $1A, $D2A7 lda #$00 sta L4CA1 jsr L4510 @@ -1472,9 +1392,8 @@ L4C6D: ldy #$CC L4C7C: .byte $00,$04 L4C7E: .byte $00,$00,$08,$00,$14,$00,$00,$01 L4C86: .byte $00,$09 -L4C88: .byte $09,"Desk.acc/",$00,$00,$00,$00,$00,$00 - .byte $00,$00,$00,$00,$00,$00,$00,$00 - .byte $00 +L4C88: PASCAL_STRING "Desk.acc/" + .res 15, 0 L4CA1: .byte $00 jsr L488A lda #$03 @@ -1749,10 +1668,7 @@ L4EC3: sta $DEA0 lda #$00 sta $DE9F jsr LD09A - ldy #$39 - lda #$25 - ldx #$EC - jsr A2D_RELAY + A2D_RELAY_CALL $39, $EC25 ldx $EC25 dex lda $EC26,x @@ -1784,10 +1700,7 @@ L4EC3: sta $DEA0 dex lda #$00 sta $EC26,x - ldy #$41 - lda #$25 - ldx #$EC - jsr A2D_RELAY + A2D_RELAY_CALL $41, $EC25 lda $EC25 bne L4F3C ldy #$0C @@ -1796,10 +1709,7 @@ L4EC3: sta $DEA0 jsr DESKTOP_RELAY L4F3C: lda #$00 sta $E269 - ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $36, $E267 jsr L66A2 jmp L4510 @@ -1998,10 +1908,7 @@ L511E: sta $DEA0 jsr L4505 jsr L6E8E jsr L4904 - ldy #$11 - lda #$1D - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $11, $D21D lda $EC25 jsr L7D5D sta L51EB @@ -2087,10 +1994,7 @@ L51F0: ldx $EC25 jsr L4505 jsr L6E8E jsr L4904 - ldy #$11 - lda #$1D - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $11, $D21D lda $EC25 jsr L7D5D sta L5263 @@ -2196,18 +2100,12 @@ L52D7: jsr L52DF L52DF: lda #$00 sta $E269 - ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $36, $E267 lda $E25B sta $E268 lda #$01 sta $E269 - ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $36, $E267 rts L5302: ldy #$07 @@ -2754,16 +2652,10 @@ L578B: rts L578C: brk L578D: brk -L578E: ldy #$22 - lda #$00 - ldx #$00 - jsr A2D_RELAY +L578E: A2D_RELAY_CALL $22, $0000 jmp L619B -L579A: ldy #$22 - lda #$00 - ldx #$00 - jsr A2D_RELAY +L579A: A2D_RELAY_CALL $22, $0000 jmp L60DB L57A6: jsr L5803 @@ -3197,10 +3089,7 @@ L5B31: lda $EBFD,x sta $D209,x dex bpl L5B31 - ldy #$48 - lda #$09 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $48, $D209 lda $D20D bne L5B4B jmp L5CB7 @@ -3316,10 +3205,7 @@ L5C26: jsr LD096 L5C31: lda $D20D sta $D208 - ldy #$4A - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $4A, $D208 lda $D20E bne L5C46 rts @@ -3332,10 +3218,7 @@ L5C46: jsr L5C54 L5C54: lda $D20D sta $D209 - ldy #$4B - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $4B, $D208 jsr L6523 jsr L84D1 bit L5B1B @@ -3344,10 +3227,7 @@ L5C54: lda $D20D L5C71: lda $EC25 sta $D212 jsr L44F2 - ldy #$11 - lda #$1D - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $11, $D21D jsr L4510 jmp L6C19 @@ -3359,10 +3239,7 @@ L5C89: sta L5CB6 L5C96: lda #$FF rts -L5C99: ldy #$48 - lda #$09 - ldx #$D2 - jsr A2D_RELAY +L5C99: A2D_RELAY_CALL $48, $D209 lda $D20D beq L5C96 cmp #$03 @@ -3591,10 +3468,7 @@ L5E8F: lda $EC25 sta $D212 jsr L44F2 jsr L4904 - ldy #$11 - lda #$1D - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $11, $D21D ldx $EC25 dex lda $EC26,x @@ -3680,18 +3554,12 @@ L5F50: lda L5F0B,x dex bpl L5F50 jsr L48FA - ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $12, $E230 L5F6B: jsr L48F0 lda $D208 cmp #$04 beq L5FC5 - ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $12, $E230 ldx #$00 L5F80: cpx $DEA0 bne L5F88 @@ -3759,10 +3627,7 @@ L600E: lda L60CB bcs L601F jmp L5F6B -L601F: ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY +L601F: A2D_RELAY_CALL $12, $E230 ldx #$03 L602A: lda $D209,x sta L60CF,x @@ -3820,10 +3685,7 @@ L60AE: lda $D20B sta $E237 lda #$00 sta L60D4 -L60BF: ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY +L60BF: A2D_RELAY_CALL $12, $E230 jmp L5F6B L60CB: brk @@ -3843,16 +3705,10 @@ L60DB: jmp L60DE L60DE: lda $EC25 sta $D208 - ldy #$41 - lda #$25 - ldx #$EC - jsr A2D_RELAY + A2D_RELAY_CALL $41, $EC25 lda $EC25 jsr L8855 - ldy #$44 - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $44, $D208 lda $EC25 jsr L86EF sta L0006 @@ -3936,10 +3792,7 @@ L6199: brk L619A: brk L619B: lda $EC25 sta $D208 - ldy #$45 - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $45, $D208 jsr L4523 lda $EC25 sta $DE9F @@ -3953,10 +3806,7 @@ L619B: lda $EC25 jmp L4510 L61CA: lda $EC25 - ldy #$43 - lda #$A8 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $43, $D2A8 lda $D2A8 bne L61DC rts @@ -3996,10 +3846,7 @@ L621B: sta $DEA1,x L6227: sta $DEA0 jsr LD096 - ldy #$39 - lda #$25 - ldx #$EC - jsr A2D_RELAY + A2D_RELAY_CALL $39, $EC25 ldx $EC25 dex lda $EC26,x @@ -4041,19 +3888,13 @@ L6276: ldx $EC25 lda #$00 sta $EC26,x sta $E6D1,x - ldy #$41 - lda #$25 - ldx #$EC - jsr A2D_RELAY + A2D_RELAY_CALL $41, $EC25 lda #$00 sta $DE9F jsr LD09A lda #$00 sta $E269 - ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $36, $E267 jsr L66A2 jmp L4523 @@ -4352,10 +4193,7 @@ L654C: lda $D21D,x L6556: bit L5B1B bmi L655E jsr L6E6E -L655E: ldy #$11 - lda #$1D - ldx #$D2 - jsr A2D_RELAY +L655E: A2D_RELAY_CALL $11, $D21D jsr L4510 jmp L6C19 @@ -4412,10 +4250,7 @@ L65EB: jsr L62BC L65EE: sta $D209 lda #$02 sta $D208 - ldy #$4B - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $4B, $D208 rts L6600: brk @@ -4478,10 +4313,7 @@ L668A: jsr L62BC L668D: sta $D209 lda #$01 sta $D208 - ldy #$4B - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $4B, $D208 rts L669F: brk @@ -4493,32 +4325,20 @@ L66A2: ldx $EC25 L66AA: lda #$01 sta $E26B - ldy #$34 - lda #$6A - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $34, $E26A lda #$01 sta $E26E lda #$02 sta $E26C lda #$01 sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C lda #$04 sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C lda #$05 sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C lda #$00 sta L4359 rts @@ -4531,10 +4351,7 @@ L66F2: dex stx $E268 lda #$01 sta $E269 - ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $36, $E267 rts L670C: lda #$01 @@ -4558,10 +4375,7 @@ L670C: lda #$01 rts L673A: sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C rts L6747: lda #$00 @@ -4585,10 +4399,7 @@ L6747: lda #$00 rts L6775: sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C rts L6782: lda #$00 @@ -4601,10 +4412,7 @@ L678F: lda #$02 sta $E26C lda #$0B sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C rts L67A3: lda #$01 @@ -4626,10 +4434,7 @@ L67B0: lda #$03 rts L67CA: sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C rts L67D7: lda $DF21 @@ -4751,23 +4556,14 @@ L68B8: lda $D209,x beq L68CF rts -L68CF: ldy #$08 - lda #$93 - ldx #$D2 - jsr A2D_RELAY +L68CF: A2D_RELAY_CALL $08, $D293 jsr L48FA - ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $12, $E230 L68E4: jsr L48F0 lda $D208 cmp #$04 beq L6932 - ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $12, $E230 ldx #$00 L68F9: cpx $DEA0 bne L6904 @@ -4831,10 +4627,7 @@ L6978: lda L6A35 bcs L6989 jmp L68E4 -L6989: ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY +L6989: A2D_RELAY_CALL $12, $E230 ldx #$03 L6994: lda $D209,x sta L6A39,x @@ -4892,10 +4685,7 @@ L6A18: lda $D20B sta $E237 lda #$00 sta L6A3E -L6A29: ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY +L6A29: A2D_RELAY_CALL $12, $E230 jmp L68E4 L6A35: brk @@ -4999,10 +4789,7 @@ L6AF6: cmp $E1F2,x dex bpl L6AF6 jsr L7054 -L6B01: ldy #$42 - lda #$9F - ldx #$DE - jsr A2D_RELAY +L6B01: A2D_RELAY_CALL $42, $DE9F lda $DE9F sta $EC25 jsr L6C19 @@ -5111,10 +4898,7 @@ L6BF4: lda $DE9F jmp L4510 L6C0E: brk -L6C0F: ldy #$36 - lda #$67 - ldx #$E2 - jsr A2D_RELAY +L6C0F: A2D_RELAY_CALL $36, $E267 rts L6C19: ldx $DE9F @@ -5356,10 +5140,7 @@ L6E38: lda #$01 jsr L6E48 jmp L6604 -L6E48: ldy #$4C - lda #$08 - ldx #$D2 - jsr A2D_RELAY +L6E48: A2D_RELAY_CALL $4C, $D208 rts L6E52: lda #$00 @@ -5410,41 +5191,26 @@ L6E90: sta L6EC4 sta $D220 bit L6EC4 bmi L6EC3 - ldy #$04 - lda #$15 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $04, $D215 L6EC3: rts L6EC4: brk L6EC5: lda #$00 sta $E26B - ldy #$34 - lda #$6A - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $34, $E26A lda #$00 sta $E26E lda #$02 sta $E26C lda #$01 sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C lda #$04 sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C lda #$05 sta $E26D - ldy #$35 - lda #$6C - ldx #$E2 - jsr A2D_RELAY + A2D_RELAY_CALL $35, $E26C lda #$80 sta L4359 rts @@ -6645,19 +6411,13 @@ L78EF: lda $D21D adc #$00 sta $EBC1 sta $EBC5 - ldy #$0E - lda #$BE - ldx #$EB - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $EBBE lda $D221 sta $EBC2 lda $D222 sta $EBC3 jsr L48FA - ldy #$10 - lda #$C2 - ldx #$EB - jsr A2D_RELAY + A2D_RELAY_CALL $10, $EBC2 lda $EBC0 clc adc #$02 @@ -6667,14 +6427,8 @@ L78EF: lda $D21D adc #$00 sta $EBC1 sta $EBC5 - ldy #$0E - lda #$BE - ldx #$EB - jsr A2D_RELAY - ldy #$10 - lda #$C2 - ldx #$EB - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $EBBE + A2D_RELAY_CALL $10, $EBC2 lda $D21F clc adc #$0A @@ -6689,10 +6443,7 @@ L78EF: lda $D21D cmp #$02 bcs L798A dec $EBB3 -L798A: ldy #$0E - lda #$BA - ldx #$EB - jsr A2D_RELAY +L798A: A2D_RELAY_CALL $0E, $EBBA jsr L7AD7 lda #$B3 ldx #$EB @@ -6713,10 +6464,7 @@ L79A7: jsr L79F7 tax tya jsr L7AE0 - ldy #$0E - lda #$EB - ldx #$EB - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $EBEB jsr L7AD7 lda #$C6 ldx #$EB @@ -6732,10 +6480,7 @@ L79A7: jsr L79F7 tax tya jsr L7AE0 - ldy #$0E - lda #$EF - ldx #$EB - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $EBEF jsr L7AD7 lda #$D0 ldx #$EB @@ -8295,10 +8040,7 @@ L8780: sta L0006 inc L0006 bne L8792 inc $07 -L8792: ldy #$19 - lda #$06 - ldx #$00 - jsr A2D_RELAY +L8792: A2D_RELAY_CALL $19, $0006 L879B: rts sta L0006 @@ -8309,10 +8051,7 @@ L879B: rts inc L0006 bne L87AC inc $07 -L87AC: ldy #$18 - lda #$06 - ldx #$00 - jsr A2D_RELAY +L87AC: A2D_RELAY_CALL $18, $0006 lda $09 ldx $0A rts @@ -8611,10 +8350,7 @@ L899A: sta $D265,x inx cpx #$04 bne L899A - ldy #$04 - lda #$5D - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $04, $D25D rts .byte $02 @@ -9039,10 +8775,7 @@ L8D57: brk L8D58: lda #$00 sta L8DB2 jsr L4510 - ldy #$08 - lda #$93 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $08, $D293 jsr L48FA L8D6C: lda L8DB2 cmp #$0C @@ -9087,10 +8820,7 @@ L8DB2: brk L8DB3: lda #$0B sta L8E0F jsr L4510 - ldy #$08 - lda #$93 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $08, $D293 jsr L48FA L8DC7: lda L8E0F bmi L8DE4 @@ -9135,10 +8865,7 @@ L8E04: dec L8E0F rts L8E0F: brk -L8E10: ldy #$12 - lda #$30 - ldx #$E2 - jsr A2D_RELAY +L8E10: A2D_RELAY_CALL $12, $E230 rts L8E1A: .byte $E0 @@ -11934,10 +11661,7 @@ LA567: lda $D8E8 jsr LB8F5 lda #$14 sta $D8E9 -LA579: ldy #$2A - lda #$08 - ldx #$D2 - jsr A2D_RELAY +LA579: A2D_RELAY_CALL $2A, $D208 lda $D208 cmp #$01 bne LA58C @@ -11949,10 +11673,7 @@ LA58C: cmp #$03 LA593: lda $D8E8 beq LA567 - ldy #$40 - lda #$09 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $40, $D209 lda $D20D bne LA5A9 jmp LA567 @@ -11966,18 +11687,9 @@ LA5B4: lda $D57D jsr LB7B9 lda $D57D sta $D208 - ldy #$46 - lda #$08 - ldx #$D2 - jsr A2D_RELAY - ldy #$0E - lda #$0D - ldx #$D2 - jsr A2D_RELAY -LA5D2: ldy #$13 - lda #$AB - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $46, $D208 + A2D_RELAY_CALL $0E, $D20D +LA5D2: A2D_RELAY_CALL $13, $D6AB cmp #$80 bne LA5E5 jsr LB3D8 @@ -11987,10 +11699,7 @@ LA5E5: jsr LB3CA LA5E8: jsr LBEB1 jmp LA567 -LA5EE: ldy #$40 - lda #$09 - ldx #$D2 - jsr A2D_RELAY +LA5EE: A2D_RELAY_CALL $40, $D209 lda $D20D bne LA5FF lda #$FF @@ -12013,79 +11722,49 @@ LA614: lda $D57D jsr LB7B9 lda $D57D sta $D208 - ldy #$46 - lda #$08 - ldx #$D2 - jsr A2D_RELAY - ldy #$0E - lda #$0D - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $46, $D208 + A2D_RELAY_CALL $0E, $D20D bit $D8E7 bvc LA63A jmp LA65E -LA63A: ldy #$13 - lda #$20 - ldx #$AE - jsr A2D_RELAY +LA63A: A2D_RELAY_CALL $13, $AE20 cmp #$80 beq LA64A jmp LA6C1 LA64A: jsr LB43B - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE20 jsr LB7CF bmi LA65D lda #$00 LA65D: rts -LA65E: ldy #$13 - lda #$28 - ldx #$AE - jsr A2D_RELAY +LA65E: A2D_RELAY_CALL $13, $AE28 cmp #$80 bne LA67F jsr LB43B - ldy #$11 - lda #$28 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE28 jsr LB7D9 bmi LA67E lda #$02 LA67E: rts -LA67F: ldy #$13 - lda #$30 - ldx #$AE - jsr A2D_RELAY +LA67F: A2D_RELAY_CALL $13, $AE30 cmp #$80 bne LA6A0 jsr LB43B - ldy #$11 - lda #$30 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE30 jsr LB7DE bmi LA69F lda #$03 LA69F: rts -LA6A0: ldy #$13 - lda #$38 - ldx #$AE - jsr A2D_RELAY +LA6A0: A2D_RELAY_CALL $13, $AE38 cmp #$80 bne LA6C1 jsr LB43B - ldy #$11 - lda #$38 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE38 jsr LB7E3 bmi LA6C0 lda #$04 @@ -12096,19 +11775,13 @@ LA6C1: bit $D8E7 lda #$FF rts -LA6C9: ldy #$13 - lda #$10 - ldx #$AE - jsr A2D_RELAY +LA6C9: A2D_RELAY_CALL $13, $AE10 cmp #$80 beq LA6D9 jmp LA6ED LA6D9: jsr LB43B - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE10 jsr LB7D4 bmi LA6EC lda #$01 @@ -12247,26 +11920,17 @@ LA7E5: lda #$FF rts LA7E8: jsr LB43B - ldy #$11 - lda #$28 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE28 lda #$02 rts LA7F7: jsr LB43B - ldy #$11 - lda #$30 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE30 lda #$03 rts LA806: jsr LB43B - ldy #$11 - lda #$38 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE38 lda #$04 rts @@ -12305,28 +11969,16 @@ LA84E: lda #$FF LA851: lda $D57D jsr LB7B9 jsr LB43B - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE20 + A2D_RELAY_CALL $11, $AE20 lda #$00 rts LA86F: lda $D57D jsr LB7B9 jsr LB43B - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE10 + A2D_RELAY_CALL $11, $AE10 lda #$01 rts @@ -12341,21 +11993,12 @@ LA895: lda #$FF LA899: .byte $4C LA89A: brk LA89B: brk - ldy #$38 - lda #$2B - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $38, $D62B lda $D62B jsr LB7B9 jsr LB43B - ldy #$12 - lda #$DD - ldx #$AE - jsr A2D_RELAY - ldy #$12 - lda #$E5 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $12, $AEDD + A2D_RELAY_CALL $12, $AEE5 lda #$ED ldx #$AE jsr LB723 @@ -12399,10 +12042,7 @@ LA89B: brk sta $D6C3 lda #$00 sta $D6C4 -LA923: ldy #$2A - lda #$08 - ldx #$D2 - jsr A2D_RELAY +LA923: A2D_RELAY_CALL $2A, $D208 lda $D208 cmp #$01 beq LA947 @@ -12416,10 +12056,7 @@ LA923: ldy #$2A bne LA923 jmp LA947 -LA947: ldy #$39 - lda #$2B - ldx #$D6 - jsr A2D_RELAY +LA947: A2D_RELAY_CALL $39, $D62B jsr LBEB1 jsr LB3CA rts @@ -12481,10 +12118,7 @@ LA9B5: ldy #$01 jsr LBDDF lda $D57D jsr LB7B9 - ldy #$0E - lda #$B6 - ldx #$B0 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B0B6 lda #$01 ldx #$D9 jsr LB708 @@ -12514,10 +12148,7 @@ LA9E6: ldy #$01 sta $07 stx L0006 jsr LBE63 - ldy #$0E - lda #$7E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $AE7E lda #$02 ldx #$D4 jsr LB708 @@ -12530,10 +12161,7 @@ LA9E6: ldy #$01 sta $07 stx L0006 jsr LBE78 - ldy #$0E - lda #$82 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $AE82 lda #$43 ldx #$D4 .byte $20 @@ -12548,10 +12176,7 @@ LAA48: smb3 $A0 rts LAA5A: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 rts @@ -12567,14 +12192,8 @@ LAA7F: jsr LA567 bmi LAA7F pha jsr LB687 - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$76 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE76 pla rts @@ -12590,14 +12209,8 @@ LAAB1: jsr LA567 bmi LAAB1 pha jsr LB6D0 - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$76 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE76 pla rts @@ -12662,10 +12275,7 @@ LAB38: ldy #$01 jsr LBDDF lda $D57D jsr LB7B9 - ldy #$0E - lda #$B6 - ldx #$B0 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B0B6 lda #$01 ldx #$D9 jsr LB708 @@ -12694,27 +12304,18 @@ LAB69: ldy #$01 sta $07 stx L0006 jsr LBE63 - ldy #$0E - lda #$7E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $AE7E lda #$02 ldx #$D4 jsr LB708 - ldy #$0E - lda #$BA - ldx #$B0 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B0BA lda #$01 ldx #$D9 jsr LB708 rts LABB8: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 rts @@ -12730,14 +12331,8 @@ LABDD: jsr LA567 bmi LABDD pha jsr LB6FB - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$76 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE76 pla rts @@ -12821,10 +12416,7 @@ LAC3D: ldy #$01 rts LAC9E: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 rts @@ -12833,14 +12425,8 @@ LACAE: lda $D57D jsr LB6E6 LACB7: jsr LA567 bmi LACB7 - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$6E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE6E jsr LB6FB lda #$00 rts @@ -12902,16 +12488,10 @@ LAD2A: ldy #$01 jsr LB7B9 lda LAD1F LAD46: bne LAD54 - ldy #$0E - lda #$6A - ldx #$B1 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B16A jmp LAD5D -LAD54: ldy #$0E - lda #$72 - ldx #$B1 - jsr A2D_RELAY +LAD54: A2D_RELAY_CALL $0E, $B172 LAD5D: lda #$01 ldx #$D9 jsr LB708 @@ -12940,17 +12520,11 @@ LAD6C: ldy #$01 sta $07 stx L0006 jsr LBE63 - ldy #$0E - lda #$7E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $AE7E lda #$02 ldx #$D4 jsr LB708 - ldy #$0E - lda #$6E - ldx #$B1 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B16E lda #$01 ldx #$D9 jsr LB708 @@ -12962,14 +12536,8 @@ LADBB: lda $D57D LADC4: jsr LA567 bmi LADC4 bne LADF4 - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$6E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE6E jsr LB6D0 ldy #$02 lda #$0E @@ -12983,10 +12551,7 @@ LADC4: jsr LA567 LADF4: rts LADF5: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 rts @@ -13001,14 +12566,8 @@ LAE17: jsr LA567 bmi LAE17 pha jsr LB687 - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$76 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE76 pla rts @@ -13034,10 +12593,7 @@ LAE49: lda #$80 ldx #$B1 jsr LB723 jsr LB43B - ldy #$12 - lda #$AB - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $12, $D6AB rts LAE70: lda #$80 @@ -13116,10 +12672,7 @@ LAEFF: inx rts LAF16: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 lda #$01 rts @@ -13233,10 +12786,7 @@ LB006: jsr LA567 bmi LB006 pha jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB3CA pla rts @@ -13291,17 +12841,11 @@ LB068: ldy #$01 jsr LBDDF lda $D57D jsr LB7B9 - ldy #$0E - lda #$31 - ldx #$B2 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B231 lda #$01 ldx #$D9 jsr LB708 - ldy #$0E - lda #$39 - ldx #$B2 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B239 lda #$FB ldx #$D8 jsr LB708 @@ -13327,17 +12871,11 @@ LB0A2: ldy #$01 sta $07 stx L0006 jsr LBE63 - ldy #$0E - lda #$7E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $AE7E lda #$02 ldx #$D4 jsr LB708 - ldy #$0E - lda #$41 - ldx #$B2 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B241 lda #$01 ldx #$D9 jsr LB708 @@ -13349,22 +12887,10 @@ LB0F1: lda $D57D LB0FA: jsr LA567 bmi LB0FA bne LB139 - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$6E - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE6E + A2D_RELAY_CALL $11, $AE20 + A2D_RELAY_CALL $11, $AE10 ldy #$02 lda #$0E ldx #$B1 @@ -13377,10 +12903,7 @@ LB0FA: jsr LA567 LB139: rts LB13A: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 rts @@ -13425,17 +12948,11 @@ LB186: ldy #$01 jsr LBDDF lda $D57D jsr LB7B9 - ldy #$0E - lda #$2D - ldx #$B2 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B22D lda #$01 ldx #$D9 jsr LB708 - ldy #$0E - lda #$35 - ldx #$B2 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B235 lda #$FB ldx #$D8 jsr LB708 @@ -13461,17 +12978,11 @@ LB1C0: ldy #$01 sta $07 stx L0006 jsr LBE63 - ldy #$0E - lda #$7E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $AE7E lda #$02 ldx #$D4 jsr LB708 - ldy #$0E - lda #$3D - ldx #$B2 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $B23D lda #$01 ldx #$D9 jsr LB708 @@ -13483,22 +12994,10 @@ LB20F: lda $D57D LB218: jsr LA567 bmi LB218 bne LB257 - ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY - ldy #$11 - lda #$6E - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $07, $D200 + A2D_RELAY_CALL $11, $AE6E + A2D_RELAY_CALL $11, $AE20 + A2D_RELAY_CALL $11, $AE10 ldy #$02 lda #$0E ldx #$B1 @@ -13511,10 +13010,7 @@ LB218: jsr LA567 LB257: rts LB258: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 rts @@ -13542,10 +13038,7 @@ LB27D: jsr LBD75 ldx #$B1 jsr LB723 jsr LB43B - ldy #$12 - lda #$AB - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $12, $D6AB ldy #$02 lda #$B3 ldx #$B1 @@ -13597,28 +13090,19 @@ LB2FD: jsr LA567 rts LB313: jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 lda #$01 rts - ldy #$26 - lda #$00 - ldx #$00 - jsr A2D_RELAY + A2D_RELAY_CALL $26, $0000 jsr LB55F lda $D57D jsr LB7B9 lda #$B3 ldx #$B4 jsr LB723 - ldy #$25 - lda #$00 - ldx #$00 - jsr A2D_RELAY + A2D_RELAY_CALL $25, $0000 jsr LB3BF ldy #$00 lda (L0006),y @@ -13657,10 +13141,7 @@ LB385: jsr LA567 bmi LB385 pha jsr LBEB1 - ldy #$39 - lda #$7D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $39, $D57D jsr LB403 pla rts @@ -13693,52 +13174,22 @@ LB3D8: bit LB3E6 LB3E5: rts LB3E6: brk - ldy #$26 - lda #$00 - ldx #$00 - jsr A2D_RELAY - ldy #$24 - lda #$11 - ldx #$D3 - jsr A2D_RELAY - ldy #$25 - lda #$00 - ldx #$00 - jsr A2D_RELAY + A2D_RELAY_CALL $26, $0000 + A2D_RELAY_CALL $24, $D311 + A2D_RELAY_CALL $25, $0000 rts -LB403: ldy #$26 - lda #$00 - ldx #$00 - jsr A2D_RELAY - ldy #$24 - lda #$AD - ldx #$D2 - jsr A2D_RELAY - ldy #$25 - lda #$00 - ldx #$00 - jsr A2D_RELAY +LB403: A2D_RELAY_CALL $26, $0000 + A2D_RELAY_CALL $24, $D2AD + A2D_RELAY_CALL $25, $0000 rts -LB41F: ldy #$26 - lda #$00 - ldx #$00 - jsr A2D_RELAY - ldy #$24 - lda #$DF - ldx #$D2 - jsr A2D_RELAY - ldy #$25 - lda #$00 - ldx #$00 - jsr A2D_RELAY +LB41F: A2D_RELAY_CALL $26, $0000 + A2D_RELAY_CALL $24, $D2DF + A2D_RELAY_CALL $25, $0000 rts -LB43B: ldy #$07 - lda #$02 - ldx #$D2 - jsr A2D_RELAY +LB43B: A2D_RELAY_CALL $07, $D202 rts ldx #$03 @@ -13761,10 +13212,7 @@ LB46C: lda LB501 bne LB476 lda LB500 beq LB4B7 -LB476: ldy #$2C - lda #$08 - ldx #$D2 - jsr A2D_RELAY +LB476: A2D_RELAY_CALL $2C, $D208 jsr LB4BA bmi LB4B7 lda #$FF @@ -13777,18 +13225,12 @@ LB476: ldy #$2C beq LB45F cmp #$02 bne LB4A7 - ldy #$2A - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $2A, $D208 jmp LB45F LB4A7: cmp #$01 bne LB4B7 - ldy #$2A - lda #$08 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $2A, $D208 lda #$00 rts @@ -13843,57 +13285,30 @@ LB509: sta $D8E7 jsr LB64E jmp LB526 -LB51A: ldy #$12 - lda #$20 - ldx #$AE - jsr A2D_RELAY +LB51A: A2D_RELAY_CALL $12, $AE20 jsr LB5F9 LB526: bit $D8E7 bmi LB537 - ldy #$12 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $12, $AE10 jsr LB60A LB537: jmp LBEB1 -LB53A: ldy #$38 - lda #$7D - ldx #$D5 - jsr A2D_RELAY +LB53A: A2D_RELAY_CALL $38, $D57D lda $D57D jsr LB7B9 jsr LB43B - ldy #$12 - lda #$00 - ldx #$AE - jsr A2D_RELAY - ldy #$12 - lda #$08 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $12, $AE00 + A2D_RELAY_CALL $12, $AE08 rts -LB55F: ldy #$38 - lda #$7D - ldx #$D5 - jsr A2D_RELAY +LB55F: A2D_RELAY_CALL $38, $D57D lda $D57D jsr LB7B9 jsr LBEA7 - ldy #$14 - lda #$6D - ldx #$D5 - jsr A2D_RELAY + A2D_RELAY_CALL $14, $D56D jsr LB43B - ldy #$12 - lda #$00 - ldx #$AE - jsr A2D_RELAY - ldy #$12 - lda #$08 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $12, $AE00 + A2D_RELAY_CALL $12, $AE08 rts LB590: stx $07 @@ -13913,10 +13328,7 @@ LB59A: tya sta $09 jsr LBD7B sta $0A - ldy #$18 - lda #$08 - ldx #$00 - jsr A2D_RELAY + A2D_RELAY_CALL $18, $0008 lsr $0C ror $0B lda #$C8 @@ -13939,10 +13351,7 @@ LB5CC: dey lda $D6C2 adc #$00 sta $D6C6 - ldy #$0E - lda #$C3 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $D6C3 lda L0006 ldx $07 jsr LB708 @@ -13951,68 +13360,41 @@ LB5CC: dey sta $D6C3 rts -LB5F9: ldy #$0E - lda #$50 - ldx #$AE - jsr A2D_RELAY +LB5F9: A2D_RELAY_CALL $0E, $AE50 lda #$40 ldx #$AE jsr LB708 rts -LB60A: ldy #$0E - lda #$54 - ldx #$AE - jsr A2D_RELAY +LB60A: A2D_RELAY_CALL $0E, $AE54 lda #$96 ldx #$AE jsr LB708 rts -LB61B: ldy #$0E - lda #$58 - ldx #$AE - jsr A2D_RELAY +LB61B: A2D_RELAY_CALL $0E, $AE58 lda #$A8 ldx #$AE jsr LB708 rts -LB62C: ldy #$0E - lda #$5C - ldx #$AE - jsr A2D_RELAY +LB62C: A2D_RELAY_CALL $0E, $AE5C lda #$AD ldx #$AE jsr LB708 rts -LB63D: ldy #$0E - lda #$60 - ldx #$AE - jsr A2D_RELAY +LB63D: A2D_RELAY_CALL $0E, $AE60 lda #$B1 ldx #$AE jsr LB708 rts LB64E: jsr LB43B - ldy #$12 - lda #$28 - ldx #$AE - jsr A2D_RELAY - ldy #$12 - lda #$30 - ldx #$AE - jsr A2D_RELAY - ldy #$12 - lda #$38 - ldx #$AE - jsr A2D_RELAY - ldy #$12 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $12, $AE28 + A2D_RELAY_CALL $12, $AE30 + A2D_RELAY_CALL $12, $AE38 + A2D_RELAY_CALL $12, $AE10 jsr LB61B jsr LB62C jsr LB63D @@ -14022,33 +13404,15 @@ LB64E: jsr LB43B rts LB687: jsr LBEA7 - ldy #$11 - lda #$28 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$30 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$38 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE28 + A2D_RELAY_CALL $11, $AE30 + A2D_RELAY_CALL $11, $AE38 + A2D_RELAY_CALL $11, $AE10 rts LB6AF: jsr LB43B - ldy #$12 - lda #$20 - ldx #$AE - jsr A2D_RELAY - ldy #$12 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $12, $AE20 + A2D_RELAY_CALL $12, $AE10 jsr LB5F9 jsr LB60A lda #$00 @@ -14056,31 +13420,19 @@ LB6AF: jsr LB43B rts LB6D0: jsr LBEA7 - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE20 + A2D_RELAY_CALL $11, $AE10 rts LB6E6: jsr LB43B - ldy #$12 - lda #$20 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $12, $AE20 jsr LB5F9 lda #$80 sta $D8E7 rts LB6FB: jsr LBEA7 - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE20 rts LB708: sta L0006 @@ -14091,10 +13443,7 @@ LB708: sta L0006 inc L0006 bne LB719 inc $07 -LB719: ldy #$19 - lda #$06 - ldx #$00 - jsr A2D_RELAY +LB719: A2D_RELAY_CALL $19, $0006 LB722: rts LB723: sta L0006 @@ -14104,10 +13453,7 @@ LB723: sta L0006 inc L0006 bne LB732 inc $07 -LB732: ldy #$18 - lda #$06 - ldx #$00 - jsr A2D_RELAY +LB732: A2D_RELAY_CALL $18, $0006 lsr $0A ror $09 lda #$01 @@ -14121,23 +13467,14 @@ LB732: ldy #$18 lda LB76B sbc $0A sta $D6B8 - ldy #$0E - lda #$B7 - ldx #$D6 - jsr A2D_RELAY - ldy #$19 - lda #$06 - ldx #$00 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $D6B7 + A2D_RELAY_CALL $19, $0006 rts LB76B: brk sta L0006 stx $07 - ldy #$0E - lda #$BB - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $D6BB lda L0006 ldx $07 jsr LB708 @@ -14179,10 +13516,7 @@ LB7B5: dey jmp LB78D LB7B9: sta $D212 - ldy #$3C - lda #$12 - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $3C, $D212 ldy #$04 lda #$15 .byte $A2 @@ -14235,64 +13569,34 @@ LB80B: clv clv ror $B8,x - ldy #$13 - lda #$20 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $13, $AE20 rts - ldy #$13 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $13, $AE10 rts - ldy #$13 - lda #$28 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $13, $AE28 rts - ldy #$13 - lda #$30 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $13, $AE30 rts - ldy #$13 - lda #$38 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $13, $AE38 rts - ldy #$11 - lda #$20 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE20 rts - ldy #$11 - lda #$10 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE10 rts - ldy #$11 - lda #$28 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE28 rts - ldy #$11 - lda #$30 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE30 rts - ldy #$11 - lda #$38 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE38 rts LB880: jmp (LB886) @@ -14306,23 +13610,14 @@ LB889: brk LB88A: sta LB8F3 lda #$00 sta LB8F2 -LB892: ldy #$2A - lda #$08 - ldx #$D2 - jsr A2D_RELAY +LB892: A2D_RELAY_CALL $2A, $D208 lda $D208 cmp #$02 beq LB8E3 lda $D57D sta $D208 - ldy #$46 - lda #$08 - ldx #$D2 - jsr A2D_RELAY - ldy #$0E - lda #$0D - ldx #$D2 - jsr A2D_RELAY + A2D_RELAY_CALL $46, $D208 + A2D_RELAY_CALL $0E, $D20D jsr LB880 cmp #$80 beq LB8C9 @@ -14362,27 +13657,15 @@ LB8F5: jsr LBD3B sta $08 lda $D6B6 sta $09 - ldy #$0E - lda #$06 - ldx #$00 - jsr A2D_RELAY - ldy #$06 - lda #$C7 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $0006 + A2D_RELAY_CALL $06, $D6C7 bit $D8EB bpl LB92D - ldy #$0C - lda #$6C - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $0C, $AE6C lda #$00 sta $D8EB beq LB93B -LB92D: ldy #$0C - lda #$6D - ldx #$AE - jsr A2D_RELAY +LB92D: A2D_RELAY_CALL $0C, $AE6D lda #$FF sta $D8EB LB93B: lda #$EF @@ -14391,14 +13674,8 @@ LB93B: lda #$EF sta $07 lda $D8EE sta $08 - ldy #$19 - lda #$06 - ldx #$00 - jsr A2D_RELAY - ldy #$0C - lda #$6D - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $19, $0006 + A2D_RELAY_CALL $0C, $AE6D lda $D57D jsr LB7B9 rts @@ -14408,26 +13685,11 @@ LB961: lda $D443 lda $D57D jsr LB7B9 jsr LBEA7 - ldy #$11 - lda #$AB - ldx #$D6 - jsr A2D_RELAY - ldy #$07 - lda #$02 - ldx #$D2 - jsr A2D_RELAY - ldy #$12 - lda #$AB - ldx #$D6 - jsr A2D_RELAY - ldy #$0E - lda #$B3 - ldx #$D6 - jsr A2D_RELAY - ldy #$06 - lda #$C7 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $11, $D6AB + A2D_RELAY_CALL $07, $D202 + A2D_RELAY_CALL $12, $D6AB + A2D_RELAY_CALL $0E, $D6B3 + A2D_RELAY_CALL $06, $D6C7 lda #$43 ldx #$D4 jsr LB708 @@ -14441,18 +13703,9 @@ LB961: lda $D443 jsr LB7B9 LB9B7: rts -LB9B8: ldy #$46 - lda #$08 - ldx #$D2 - jsr A2D_RELAY - ldy #$0E - lda #$0D - ldx #$D2 - jsr A2D_RELAY - ldy #$13 - lda #$AB - ldx #$D6 - jsr A2D_RELAY +LB9B8: A2D_RELAY_CALL $46, $D208 + A2D_RELAY_CALL $0E, $D20D + A2D_RELAY_CALL $13, $D6AB cmp #$80 beq LB9D8 rts @@ -14481,10 +13734,7 @@ LB9EE: jsr LBD3B sta $07 lda $D484 sta $08 -LBA10: ldy #$18 - lda #$06 - ldx #$00 - jsr A2D_RELAY +LBA10: A2D_RELAY_CALL $18, $0006 lda $09 clc adc LBB09 @@ -14543,10 +13793,7 @@ LBA83: lda #$43 sta $07 lda $D443 sta $08 -LBA90: ldy #$18 - lda #$06 - ldx #$00 - jsr A2D_RELAY +LBA90: A2D_RELAY_CALL $18, $0006 lda $09 clc adc $D6B3 @@ -14624,14 +13871,8 @@ LBB1A: lda LBB62 sta $08 lda $D6B6 sta $09 - ldy #$0E - lda #$06 - ldx #$00 - jsr A2D_RELAY - ldy #$06 - lda #$C7 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $0006 + A2D_RELAY_CALL $06, $D6C7 lda #$F6 ldx #$D8 jsr LB708 @@ -14655,14 +13896,8 @@ LBB69: dec $D443 sta $08 lda $D6B6 sta $09 - ldy #$0E - lda #$06 - ldx #$00 - jsr A2D_RELAY - ldy #$06 - lda #$C7 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $0006 + A2D_RELAY_CALL $06, $D6C7 lda #$84 ldx #$D4 jsr LB708 @@ -14697,14 +13932,8 @@ LBBBC: ldx $D443 sta $08 lda $D6B6 sta $09 - ldy #$0E - lda #$06 - ldx #$00 - jsr A2D_RELAY - ldy #$06 - lda #$C7 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $0006 + A2D_RELAY_CALL $06, $D6C7 lda #$84 ldx #$D4 jsr LB708 @@ -14735,14 +13964,8 @@ LBC21: lda $D485,x cpx $D484 bne LBC21 LBC2D: dec $D484 - ldy #$0E - lda #$B3 - ldx #$D6 - jsr A2D_RELAY - ldy #$06 - lda #$C7 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $D6B3 + A2D_RELAY_CALL $06, $D6C7 lda #$43 ldx #$D4 jsr LB708 @@ -14798,10 +14021,7 @@ LBCB3: pla sta $D484 lda #$00 sta $D443 - ldy #$0E - lda #$B3 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $D6B3 jsr LB961 rts @@ -14828,10 +14048,7 @@ LBCDF: lda $D484,x sta $D443 lda #$01 sta $D484 - ldy #$0E - lda #$B3 - ldx #$D6 - jsr A2D_RELAY + A2D_RELAY_CALL $0E, $D6B3 jsr LB961 rts @@ -14878,10 +14095,7 @@ LBD3B: lda #$44 ldx $D6B4 rts -LBD51: ldy #$18 - lda #$06 - ldx #$00 - jsr A2D_RELAY +LBD51: A2D_RELAY_CALL $18, $0006 lda $09 clc adc $D6B3 @@ -15053,40 +14267,18 @@ LBE7D: lda (L0006),y rts LBE8D: jsr LBEA7 - ldy #$11 - lda #$86 - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE86 rts LBE9A: jsr LBEA7 - ldy #$11 - lda #$8E - ldx #$AE - jsr A2D_RELAY + A2D_RELAY_CALL $11, $AE8E rts -LBEA7: ldy #$07 - lda #$00 - ldx #$D2 - jsr A2D_RELAY +LBEA7: A2D_RELAY_CALL $07, $D200 rts -LBEB1: ldy #$03 - lda #$39 - ldx #$D2 - jsr A2D_RELAY - ldy #$04 - lda #$39 - ldx #$D2 - jsr A2D_RELAY +LBEB1: A2D_RELAY_CALL $03, $D239 + A2D_RELAY_CALL $04, $D239 rts - .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 + .res 60, 0