more identifications

This commit is contained in:
Joshua Bell 2017-12-09 09:29:35 -08:00
parent 7042ad9901
commit ba96487609

102
b.s
View File

@ -26,6 +26,9 @@ SETINV := $FE80
SETNORM := $FE84 SETNORM := $FE84
ZP_HPOS := $24 ZP_HPOS := $24
ZP_TMASK := $32
COL80HPOS := $057B
ASCII_TAB := $9 ASCII_TAB := $9
@ -69,8 +72,10 @@ L2000: jmp install_and_quit
current_entry := $67 current_entry := $67
num_entries := $68 num_entries := $68
rows_per_screen := 21 page_start := $73
current_line := $73
top_row := 2
bottom_row := 21
cld cld
lda ROMINNW lda ROMINNW
@ -224,15 +229,15 @@ L1129: MLI_CALL CLOSE, close_params
ldx #0 ldx #0
: lda prefix+1,x : lda prefix+1,x
beq L1153 beq L1153
jsr L12AF jsr ascii_cout
inx inx
bne :- bne :-
L1153: stz current_entry L1153: stz current_entry
stz current_line stz page_start
lda num_entries lda num_entries
beq keyboard_loop beq keyboard_loop
cmp #rows_per_screen cmp #bottom_row
bcc L1161 bcc L1161
lda #$14 lda #$14
L1161: sta $6A L1161: sta $6A
@ -249,19 +254,23 @@ L116F: jsr draw_current_line
stz current_entry stz current_entry
beq draw_current_line_inv beq draw_current_line_inv
;;; ------------------------------------------------------------
.proc on_up .proc on_up
jsr draw_current_line ; show current line jsr draw_current_line ; show current line
ldx current_entry ldx current_entry
beq draw_current_line_inv beq draw_current_line_inv ; first one? just redraw
dec current_entry dec current_entry ; go to previous
lda $25 lda $25
cmp #$02 cmp #top_row
bne draw_current_line_inv bne draw_current_line_inv
dec current_line dec page_start
lda #$16 ; code output ??? lda #$16 ; code output ???
bne draw_current_line_with_char bne draw_current_line_with_char
.endproc .endproc
;;; ------------------------------------------------------------
.proc on_down .proc on_down
jsr draw_current_line jsr draw_current_line
ldx current_entry ldx current_entry
@ -270,13 +279,15 @@ L116F: jsr draw_current_line
bcs draw_current_line_inv bcs draw_current_line_inv
stx current_entry stx current_entry
lda $25 lda $25
cmp #rows_per_screen cmp #bottom_row
bne draw_current_line_inv bne draw_current_line_inv
inc current_line inc page_start
lda #$17 ; code output ??? lda #$17 ; code output ???
;; fall through ;; fall through
.endproc .endproc
;;; ------------------------------------------------------------
draw_current_line_with_char: draw_current_line_with_char:
jsr COUT jsr COUT
@ -287,28 +298,38 @@ draw_current_line_inv:
;;; ------------------------------------------------------------ ;;; ------------------------------------------------------------
.proc keyboard_loop
keyboard_loop:
lda KBD lda KBD
bpl keyboard_loop bpl keyboard_loop
sta KBDSTRB sta KBDSTRB
jsr SETNORM jsr SETNORM
ldx num_entries ldx num_entries
beq L11CB beq :+ ; no up/down/return if empty
cmp #HI(ASCII_RETURN) cmp #HI(ASCII_RETURN)
beq on_return beq on_return
cmp #HI(ASCII_DOWN) cmp #HI(ASCII_DOWN)
beq on_down beq on_down
cmp #HI(ASCII_UP) cmp #HI(ASCII_UP)
beq on_up beq on_up
L11CB: cmp #HI(ASCII_TAB)
: cmp #HI(ASCII_TAB)
beq next_drive beq next_drive
cmp #HI(ASCII_ESCAPE) cmp #HI(ASCII_ESCAPE)
bne keyboard_loop bne keyboard_loop
;; fall through
.endproc
;;; ------------------------------------------------------------
.proc on_escape
jsr L11DA jsr L11DA
dec $6B dec $6B
bra L11F1 bra L11F1
.endproc
;;; ------------------------------------------------------------
L11DA: ldx prefix L11DA: ldx prefix
L11DD: dex L11DD: dex
lda prefix,x lda prefix,x
@ -325,7 +346,9 @@ next_drive:
L11F0: inx L11F0: inx
L11F1: jmp L1059 L11F1: jmp L1059
on_return: ;;; ------------------------------------------------------------
.proc on_return
MLI_CALL SET_PREFIX, set_prefix_params MLI_CALL SET_PREFIX, set_prefix_params
bcs next_drive bcs next_drive
ldx current_entry ldx current_entry
@ -343,6 +366,10 @@ on_return:
ldy current_entry ldy current_entry
lda $74,y lda $74,y
bpl L11F0 ; is directory??? bpl L11F0 ; is directory???
;; nope, system file, so...
;; fall through
.endproc
;;; ------------------------------------------------------------ ;;; ------------------------------------------------------------
@ -372,14 +399,18 @@ on_return:
cout_string_hpos: cout_string_hpos:
sta ZP_HPOS sta ZP_HPOS
cout_string: .proc cout_string
lda help_string,y lda help_string,y
beq L1257 beq done
jsr COUT jsr COUT
iny iny
bne cout_string bne cout_string
L1257: rts done: rts
.endproc
;;; ------------------------------------------------------------
;; Compute offset to name in directory listing ???
L1258: stz $6D L1258: stz $6D
txa txa
asl a asl a
@ -400,37 +431,44 @@ L1258: stz $6D
sta $69 sta $69
rts rts
;;; ------------------------------------------------------------
draw_current_line: draw_current_line:
lda #$02 lda #2 ; hpos = 2
sta $057B sta COL80HPOS
ldx current_entry
ldx current_entry ; vpos = entry - page_start + 2
txa txa
sec sec
sbc current_line sbc page_start
inc a inc a
inc a inc a
jsr MON_TABV jsr MON_TABV
lda $74,x lda $74,x
bmi L1299 bmi L1299
stz $057B stz COL80HPOS
lda $32 lda ZP_TMASK
pha pha
ldy #(folder_string - string_start) ; Draw folder glyphs ldy #(folder_string - string_start) ; Draw folder glyphs
jsr cout_string jsr cout_string
pla pla
sta $32 sta ZP_TMASK
L1299: jsr L12A9 L1299: jsr L12A9
jsr L1258 jsr L1258
L129F: iny L129F: iny
lda ($6C),y lda ($6C),y
jsr L12AF jsr ascii_cout
cpy $69 cpy $69
bcc L129F bcc L129F
L12A9: lda #$A0 L12A9: lda #HI(' ')
bne L12B1 bne cout ; implicit RTS
L12AD: lda #$99 L12AD: lda #$99 ; Ctrl+Y ??
L12AF: ora #$80
L12B1: jmp COUT ;; Sets high bit before calling COUT
ascii_cout:
ora #$80
cout: jmp COUT
;;; ------------------------------------------------------------ ;;; ------------------------------------------------------------