DeskTop Seg 1: Param blocks, direct calls to desktop entry point

This commit is contained in:
Joshua Bell 2017-10-05 08:19:44 -07:00
parent bebc0d1e76
commit 09183e88cc

View File

@ -16,6 +16,8 @@ LD05E := $D05E
LD2D0 := $D2D0 LD2D0 := $D2D0
;; A2D ;; A2D
.assert * = $4000, error, "A2D entry point must be at $4000"
lda $C054 lda $C054
sta $C001 sta $C001
bit L5F1B bit L5F1B
@ -4977,24 +4979,24 @@ L6E33: jmp L68EA
L6E36: ldx $A9 L6E36: ldx $A9
lda L6847,x lda L6847,x
sta L6E8C sta fill_rect_params3_top
inc L6E8C inc fill_rect_params3_top
lda L6848,x lda L6848,x
sta L6E90 sta fill_rect_params3_bottom
clc clc
lda $BB lda $BB
adc #$05 adc #$05
sta L6E8A sta fill_rect_params3_left
lda $BC lda $BC
adc #$00 adc #$00
sta L6E8B sta fill_rect_params3_left+1
sec sec
lda $BD lda $BD
sbc #$05 sbc #$05
sta L6E8E sta fill_rect_params3_right
lda $BE lda $BE
sbc #$00 sbc #$00
sta L6E8F sta fill_rect_params3_right+1
A2D_CALL A2D_SET_PATTERN, light_speckle_pattern A2D_CALL A2D_SET_PATTERN, light_speckle_pattern
lda #$01 lda #$01
jsr L68F5 jsr L68F5
@ -5014,15 +5016,17 @@ light_speckle_pattern:
.byte %10001000 .byte %10001000
.byte %01010101 .byte %01010101
fill_rect_params3: .proc fill_rect_params3
L6E8A: .byte 0 left: .word 0
L6E8B: .byte 0 top: .word 0
L6E8C: .byte 0 right: .word 0
.byte 0 bottom: .word 0
L6E8E: .byte 0 .endproc
L6E8F: .byte 0 fill_rect_params3_left := fill_rect_params3::left
L6E90: .byte 0 fill_rect_params3_top := fill_rect_params3::top
.byte 0 fill_rect_params3_right := fill_rect_params3::right
fill_rect_params3_bottom := fill_rect_params3::bottom
L6E92: sta L0082 L6E92: sta L0082
lda $BD lda $BD
ldx $BE ldx $BE
@ -8082,7 +8086,7 @@ L869E: sta ($06),y
sta ($06),y sta ($06),y
ldx #$00 ldx #$00
ldy #$0B ldy #$0B
L86B6: lda L877A,x L86B6: lda online_params_buffer+1,x
cmp #$41 cmp #$41
bcc L86C4 bcc L86C4
cmp #$5F cmp #$5F
@ -8169,14 +8173,15 @@ L8739: .byte $00,$00,$00,$00
.proc online_params .proc online_params
count: .byte 2 count: .byte 2
unit: .byte $60 unit: .byte $60 ; Slot 6 Drive 1
buffer: .addr online_params_buffer buffer: .addr online_params_buffer
.endproc .endproc
online_params_unit := online_params::unit online_params_unit := online_params::unit
;; Per ProDOS TRM this should be 256 bytes!
online_params_buffer: online_params_buffer:
.byte $0B .byte $0B
L877A: .byte "GRAPHICS.TK",$00,$00,$00,$00,$00 .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
@ -8404,7 +8409,8 @@ glyph_bitmaps:
.byte $00,$00,$00,$00,$00,$00 .byte $00,$00,$00,$00,$00,$00
;; Entry point for "DESKTOP" ;; Entry point for "DESKTOP"
jmp L93BC .assert * = $8E00, error, "DESKTOP entry point must be at $8E00"
jmp DESKTOP_DIRECT
L8E03: .byte $08,$00 L8E03: .byte $08,$00
L8E05: .byte $00 L8E05: .byte $00
@ -8464,12 +8470,12 @@ voff: .word 0
.byte $00,$00 .byte $00,$00
L8E43: .byte $00,$00 L8E43: .byte $00,$00
fill_rect_params6: .byte $00 .proc fill_rect_params6
L8E46: .byte $00,$00,$00 left: .word 0
L8E49: .byte $00 top: .word 0
L8E4A: .byte $00 right: .word 0
L8E4B: .byte $00 bottom: .word 0
L8E4C: .byte $00 .endproc
.proc measure_text_params .proc measure_text_params
addr: .addr text_buffer addr: .addr text_buffer
@ -8630,6 +8636,8 @@ font: .addr 0
.byte $00,$00,$00 .byte $00,$00,$00
.byte $00,$FF,$80 .byte $00,$FF,$80
;; Is this more of a generic "addr of a 0" "...of a 1" etc?
set_fill_mode_params: set_fill_mode_params:
.byte $00 .byte $00
set_fill_mode_params2: set_fill_mode_params2:
@ -8651,8 +8659,15 @@ L939F: .byte $00,$19,$94,$54,$94,$C0,$94,$08
.byte $8F .byte $8F
.byte $95 .byte $95
.macro DESKTOP_DIRECT_CALL op, addr, label
jsr DESKTOP_DIRECT
.byte op
.addr addr
.endmacro
;; DESKTOP entry point (after jump) ;; DESKTOP entry point (after jump)
L93BC: pla DESKTOP_DIRECT:
pla
sta L9413 sta L9413
clc clc
adc #$03 adc #$03
@ -8691,9 +8706,9 @@ L93CF: lda $06,x
lda ($06),y lda ($06),y
sta $07 sta $07
stx $06 stx $06
.byte $20 L9404 := * + 1
L9404: .byte 0 L9405 := * + 2
L9405: .byte 0 jsr $0000
tay tay
ldx #$03 ldx #$03
L9409: pla L9409: pla
@ -8925,9 +8940,7 @@ L9625: lda L9454
beq L9639 beq L9639
lda L9017 lda L9017
sta L95A5 sta L95A5
jsr L93BC DESKTOP_DIRECT_CALL $B, $95A5
.byte $0B
lda $95
jmp L9625 jmp L9625
L9639: ldx #$7E L9639: ldx #$7E
@ -8967,9 +8980,7 @@ L967A: lda L95A6,x
rts rts
L9681: sta L95A5 L9681: sta L95A5
jsr L93BC DESKTOP_DIRECT_CALL $2, $95A5
.byte $02
lda $95
pla pla
tax tax
inx inx
@ -9002,11 +9013,8 @@ L969D: ldx L9696
ldy #$00 ldy #$00
cmp ($06),y cmp ($06),y
bne L969D bne L969D
jsr L93BC DESKTOP_DIRECT_CALL $4, $9695
tsb $95 jmp L969D
stx $4C,y
.byte $9D
.byte $96
L96CF: lda #$00 L96CF: lda #$00
rts rts
@ -9197,6 +9205,7 @@ L9832: .byte $00
L9833: .byte $00 L9833: .byte $00
L9834: .byte $00 L9834: .byte $00
L9835: .byte $00,$00,$00,$00,$00,$00,$00,$00 L9835: .byte $00,$00,$00,$00,$00,$00,$00,$00
L983D: lda #$00 L983D: lda #$00
sta L9830 sta L9830
sta L9833 sta L9833
@ -9284,8 +9293,7 @@ L98F2: lda L9016,x
ldx #$80 ldx #$80
stx L9833 stx L9833
L9909: sta L9834 L9909: sta L9834
jsr L93BC DESKTOP_DIRECT_CALL $D, $9834
ora L9834
beq L9954 beq L9954
jsr LA18A jsr LA18A
lda L9C74 lda L9C74
@ -9430,18 +9438,14 @@ L9A33: lda query_target_params2,x
beq L9A84 beq L9A84
lda L9831 lda L9831
sta query_target_params2::id sta query_target_params2::id
jsr L93BC DESKTOP_DIRECT_CALL $9, $933F
ora #$3F
.byte $93
lda query_target_params2::element lda query_target_params2::element
cmp L9830 cmp L9830
beq L9A84 beq L9A84
A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2
A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3 A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3
A2D_CALL $16, L9096 A2D_CALL $16, L9096
jsr L93BC DESKTOP_DIRECT_CALL $B, $9830
.byte $0B
bmi $9A05 ; ???
A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2
A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3 A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3
A2D_CALL $16, L9096 A2D_CALL $16, L9096
@ -9575,9 +9579,7 @@ L9B9C: A2D_CALL $16, L9096
L9BA5: A2D_CALL $16, L9096 L9BA5: A2D_CALL $16, L9096
lda L9830 lda L9830
beq L9BB9 beq L9BB9
jsr L93BC DESKTOP_DIRECT_CALL $B, $9830
.byte $0B
bmi L9B4E
jmp L9C63 jmp L9C63
L9BB9: A2D_CALL A2D_QUERY_TARGET, query_target_params2 L9BB9: A2D_CALL A2D_QUERY_TARGET, query_target_params2
@ -9877,9 +9879,7 @@ L9E1D: A2D_CALL A2D_QUERY_TARGET, query_target_params2
lda query_target_params2::element lda query_target_params2::element
bne L9E2B bne L9E2B
sta query_target_params2::id sta query_target_params2::id
L9E2B: jsr L93BC L9E2B: DESKTOP_DIRECT_CALL $9, $933F
ora #$3F
.byte $93
lda query_target_params2::element lda query_target_params2::element
bne L9E39 bne L9E39
jmp L9E97 jmp L9E97
@ -9911,9 +9911,7 @@ L9E6A: sta L9830
A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2
A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3 A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3
A2D_CALL $16, L9096 A2D_CALL $16, L9096
jsr L93BC DESKTOP_DIRECT_CALL $2, $9830
.byte $02
bmi L9E1D
A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2 A2D_CALL A2D_SET_PATTERN, checkerboard_pattern2
A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3 A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params3
A2D_CALL $16, L9096 A2D_CALL $16, L9096
@ -9956,10 +9954,8 @@ L9ECB: ldx L9016
L9EEA: ldy #$00 L9EEA: ldy #$00
lda ($06),y lda ($06),y
sta L9EC2 sta L9EC2
jsr L93BC DESKTOP_DIRECT_CALL $3, $9EC2
.byte $03 lda #0
.byte $C2
stz a:$A9,x
rts rts
rts rts
@ -10072,7 +10068,7 @@ L9FCF: lda ($08),y
L9FDF: jsr LA382 L9FDF: jsr LA382
ldy #$09 ldy #$09
L9FE4: lda ($06),y L9FE4: lda ($06),y
sta L8E4B,y sta fill_rect_params6::bottom,y
iny iny
cpy #$1D cpy #$1D
bne L9FE4 bne L9FE4
@ -10141,7 +10137,7 @@ LA085: jsr LA6A3
A2D_CALL A2D_SET_BOX, query_screen_params A2D_CALL A2D_SET_BOX, query_screen_params
rts rts
LA097: A2D_CALL A2D_HIDE_CURSOR, $93BC ; These params should be ignored - bogus? LA097: A2D_CALL A2D_HIDE_CURSOR, DESKTOP_DIRECT ; These params should be ignored - bogus?
A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params5 A2D_CALL A2D_SET_FILL_MODE, set_fill_mode_params5
bit L9F92 bit L9F92
bpl LA0C2 bpl LA0C2
@ -10208,24 +10204,24 @@ LA14F: lda draw_bitmap_params2::left,x
sta fill_rect_params6,x sta fill_rect_params6,x
lda draw_bitmap_params2::left+1,x lda draw_bitmap_params2::left+1,x
adc draw_bitmap_params2::hoff+1,x adc draw_bitmap_params2::hoff+1,x
sta L8E46,x sta fill_rect_params6::left+1,x
lda draw_bitmap_params2::left,x lda draw_bitmap_params2::left,x
clc clc
adc draw_bitmap_params2::width,x adc draw_bitmap_params2::width,x
sta L8E49,x sta fill_rect_params6::right,x
lda draw_bitmap_params2::left+1,x lda draw_bitmap_params2::left+1,x
adc draw_bitmap_params2::width+1,x adc draw_bitmap_params2::width+1,x
sta L8E4A,x sta fill_rect_params6::right+1,x
inx inx
inx inx
cpx #$04 cpx #$04
bne LA14F bne LA14F
lda L8E4B lda fill_rect_params6::bottom
sec sec
sbc #$01 sbc #$01
sta L8E4B sta fill_rect_params6::bottom
bcs LA189 bcs LA189
dec L8E4C dec fill_rect_params6::bottom+1
LA189: rts LA189: rts
LA18A: jsr LA365 LA18A: jsr LA365
@ -10372,9 +10368,7 @@ LA2B5: bmi LA2AA
ldy #$00 ldy #$00
lda ($06),y lda ($06),y
sta LA2A9 sta LA2A9
jsr L93BC DESKTOP_DIRECT_CALL $3, $A2A9
.byte $03
lda #$A2
LA2DD: pla LA2DD: pla
tax tax
dex dex
@ -10587,13 +10581,10 @@ LA49D: ldy #$00
bit LA3B7 bit LA3B7
bpl LA4AC bpl LA4AC
jsr LA4D3 jsr LA4D3
LA4AC: jsr L93BC LA4AC: DESKTOP_DIRECT_CALL $D, $A3AE
ora LA3AE
beq LA4BA beq LA4BA
jsr L93BC DESKTOP_DIRECT_CALL $3, $A3AE
.byte $03
.addr $A3AE
LA4BA: bit LA3B7 LA4BA: bit LA3B7
bpl LA4C5 bpl LA4C5