DeskTop: Fourth part of loader appears to be screen dump to printer

This commit is contained in:
Joshua Bell
2018-01-07 13:23:21 -08:00
parent 13e997568b
commit aaa258e0f9

View File

@@ -48,8 +48,6 @@ params: .byte 4
.proc quit_routine .proc quit_routine
.org $1000 .org $1000
self: self:
jmp start jmp start
reinstall_flag: ; set once prefix saved and reinstalled reinstall_flag: ; set once prefix saved and reinstalled
@@ -239,10 +237,6 @@ crash: sta $6 ; Crash?
prefix_buffer: prefix_buffer:
.res 64, 0 .res 64, 0
;; ???
L11D0:
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00
.endproc ; quit_routine .endproc ; quit_routine
;;; ================================================== ;;; ==================================================
@@ -252,6 +246,9 @@ L11D0:
;;; memory, then invokes the DeskTop initialization routine. ;;; memory, then invokes the DeskTop initialization routine.
.proc install_segments .proc install_segments
;; Pad to be at $200 into the file
.res $200 - (.sizeof(install_as_quit) + .sizeof(quit_routine)), 0
.org $2000 .org $2000
jmp start jmp start
@@ -324,7 +321,7 @@ start:
sei sei
MLI_CALL OPEN, open_params MLI_CALL OPEN, open_params
plp plp
and #$FF and #$FF ; ???
beq :+ beq :+
brk ; crash brk ; crash
: lda open_params::ref_num : lda open_params::ref_num
@@ -334,7 +331,7 @@ start:
sei sei
MLI_CALL SET_MARK, set_mark_params MLI_CALL SET_MARK, set_mark_params
plp plp
and #$FF and #$FF ; ???
beq :+ beq :+
brk ; crash brk ; crash
: lda #0 : lda #0
@@ -344,12 +341,12 @@ loop: lda segment_num
cmp num_segments cmp num_segments
bne continue bne continue
;; Close and invoke... $800 ??? ;; Close and invoke DeskTop init routine
php php
sei sei
MLI_CALL CLOSE, close_params MLI_CALL CLOSE, close_params
plp plp
and #$FF and #$FF ; ???
beq :+ beq :+
brk ; crash brk ; crash
: jmp DESKTOP_INIT : jmp DESKTOP_INIT
@@ -481,32 +478,27 @@ max_page:
;;; Not sure where this could be invoked from ;;; Not sure where this could be invoked from
.proc rest .proc rest
.org $280
L02B4 := $02B4 SLOT1 := $C100
L02B6 := $02B6 TAB := $09
L02C3 := $02C3 LF := $0A
L02C5 := $02C5 CR := $0D
L02E6 := $02E6 ESC := $1B
L035F := $035F
L0393 := $0393
L03B3 := $03B3
L03C1 := $03C1
L03E5 := $03E5
;; Test for OpenApple+ClosedApple+P ;; Test for OpenApple+ClosedApple+P
pha pha
lda BUTN0 lda BUTN0
and BUTN1 and BUTN1
bpl L2210 bpl :+
lda KBD lda KBD
cmp #('P' | $80) cmp #('P' | $80)
beq L2214 beq L0294
L2210: pla : pla
jmp L7ECA jmp L7ECA ; ???
;; Invoked if OA+CA+P is held ;; Invoked if OA+CA+P is held
L2214: sta KBDSTRB L0294: sta KBDSTRB
sta SET80COL sta SET80COL
sta SET80VID sta SET80VID
sta DHIRESON sta DHIRESON
@@ -514,110 +506,114 @@ L2214: sta KBDSTRB
lda HIRES lda HIRES
sta ALTZPOFF sta ALTZPOFF
sta ROMIN2 sta ROMIN2
lda #$00 lda #0
sta $03C5 sta L03C5
jmp L035F jmp L035F
ldy #$00 .proc send_spacing_sequence
lda $03CF,y ldy #0
beq L2242 : lda spacing_sequence,y
jsr L03C1 beq done
jsr cout
iny iny
jmp L02B6 jmp :-
done: rts
L2242: rts .endproc
.proc send_restore_state
ldy #$00 ldy #$00
lda $03DE,y : lda restore_state,y
beq L2251 beq done
jsr L03C1 jsr cout
iny iny
jmp L02C5 jmp :-
done: rts
.endproc
L2251: rts .proc send_init_graphics
ldx #0
ldx #$00 : lda init_graphics,x
L2254: lda $02E0,x jsr cout
jsr L03C1
inx inx
cpx #$06 cpx #6
bne L2254 bne :-
rts rts
init_graphics:
.byte ESC,"G0560" ; Graphics, 560 data bytes
.endproc
.byte $1B,$47,$30,$35,$36,$30 ; ??? L02E6: jsr send_init_graphics
jsr $02D2
ldy #$00 ldy #$00
sty $03CC sty L03CC
lda #$01 lda #$01
sta $03C9 sta L03C9
lda #$00 lda #$00
sta $03C6 sta L03C6
sta $03C7 sta L03C7
L227B: lda #$08 L02FB: lda #$08
sta $03CB sta L03CB
lda $03C5 lda L03C5
sta $03C8 sta L03C8
L2286: lda $03C8 L0306: lda L03C8
jsr L0393 jsr L0393
lda $03CC lda L03CC
lsr a lsr a
tay tay
sta LOWSCR sta LOWSCR
bcs L2299 bcs L0319
sta HISCR sta HISCR
L2299: lda ($06),y L0319: lda ($06),y
and $03C9 and L03C9
cmp #$01 cmp #1
ror $03CA ror L03CA
inc $03C8 inc L03C8
dec $03CB dec L03CB
bne L2286 bne L0306
lda $03CA lda L03CA
eor #$FF eor #$FF
sta LOWSCR sta LOWSCR
jsr L03C1 jsr cout
lda $03C6 lda L03C6
cmp #$2F cmp #$2F
bne L22C4 bne L0344
lda $03C7 lda L03C7
cmp #$02 cmp #2
beq L22DB beq L035B
L22C4: asl $03C9 L0344: asl L03C9
bpl L22D1 bpl L0351
lda #$01 lda #1
sta $03C9 sta L03C9
inc $03CC inc L03CC
L22D1: inc $03C6 L0351: inc L03C6
bne L227B bne L02FB
inc $03C7 inc L03C7
bne L227B bne L02FB
L22DB: sta LOWSCR L035B: sta LOWSCR
rts rts
jsr L03B3 L035F: jsr pr_num_1
jsr L02B4 jsr send_spacing_sequence
L22E5: jsr L02E6 L0365: jsr L02E6
lda #$0D lda #CR
jsr L03C1 jsr cout
lda #$0A lda #LF
jsr L03C1 jsr cout
lda $03C8 lda L03C8
sta $03C5 sta L03C5
cmp #$C0 cmp #192 ; screen height in pixels
bcc L22E5 bcc L0365
lda #$0D lda #CR
jsr L03C1 jsr cout
lda #$0D lda #CR
jsr L03C1 jsr cout
jsr L02C3 jsr send_restore_state
sta ALTZPON sta ALTZPON
lda LCBANK1 lda LCBANK1
lda LCBANK1 lda LCBANK1
rts rts
pha L0393: pha
and #$C7 and #$C7
eor #$08 eor #$08
sta $07 sta $07
@@ -639,24 +635,45 @@ L22E5: jsr L02E6
sta $06 sta $06
rts rts
lda #>$C100 pr_num_1:
lda #>SLOT1
sta COUT_HOOK+1 sta COUT_HOOK+1
lda #<$C100 lda #<SLOT1
sta COUT_HOOK sta COUT_HOOK
lda #(CR | $80)
lda #$8D jsr invoke_slot1
jsr L03E5
rts rts
jsr COUT cout: jsr COUT
rts rts
L2345: .byte $00,$00,$00,$00,$00,$00,$00,$00 L03C5: .byte 0
.byte $00,$00,$1B,$65,$1B,$54,$31,$36 L03C6: .byte 0
.byte $09,$4C,$20,$44,$8D,$09,$5A,$8D L03C7: .byte 0
.byte $00,$1B,$4E,$1B,$54,$32,$34,$00 L03C8: .byte 0
.byte $4C,$00,$C1,$00,$00,$00,$00,$00 L03C9: .byte 0
.byte $00,$00,$00,$00,$00,$00,$00,$00 L03CA: .byte 0
.byte $00,$00,$00,$00,$00,$00,$00,$00 L03CB: .byte 0
.byte $00,$00,$00 L03CC: .byte 0
.byte $00,$00
spacing_sequence:
.byte ESC,'e' ; 107 DPI (horizontal)
.byte ESC,"T16" ; distance between lines (16/144")
.byte TAB,$4C,$20,$44,$8D ; ???
.byte TAB,$5A,$8D ; ???
.byte 0
restore_state:
.byte ESC,'N' ; 80 DPI (horizontal)
.byte ESC,"T24" ; distance between lines (24/144")
.byte 0
invoke_slot1:
jmp SLOT1
;; Padding
.res $400 - *, 0
.endproc ; rest .endproc ; rest
.assert .sizeof(install_as_quit) + .sizeof(quit_routine) + .sizeof(install_segments) + .sizeof(rest) = $580, error, "Size mismatch"