menu: display file sizes

This commit is contained in:
ikari 2010-11-23 23:54:38 +01:00
parent c5ff79a9d2
commit b1a04c5f05
4 changed files with 41 additions and 12 deletions

View File

@ -121,3 +121,4 @@ space64 .byt $20, $20, $20, $20, $20, $20, $20, $20
.byt $20, $20, $20, $20, $20, $20, $20, $20 .byt $20, $20, $20, $20, $20, $20, $20, $20
.byt $20, $20, $20, $20, $20, $20, $20, $20 .byt $20, $20, $20, $20, $20, $20, $20, $20
.byt $00 .byt $00
text_dirmark .byt " <dir>", 0

View File

@ -41,7 +41,7 @@ print_pal .word 0 ;palette number for text output
print_temp .word 0 ;work variable print_temp .word 0 ;work variable
print_count .byt 0 ;how many characters may be printed? print_count .byt 0 ;how many characters may be printed?
print_count_tmp .byt 0 ;work variable print_count_tmp .byt 0 ;work variable
print_done .byt 0 ;how many characters were printed? print_done .word 0 ;how many characters were printed?
;----------parameters for dma---------- ;----------parameters for dma----------
dma_a_bank .byt 0 dma_a_bank .byt 0
dma_a_addr .word 0 dma_a_addr .word 0

View File

@ -12,7 +12,7 @@ menu_init:
stx dirstart_addr stx dirstart_addr
stz menu_state stz menu_state
stz dirend_onscreen stz dirend_onscreen
lda #$04 lda #$02
sta cursor_x sta cursor_x
lda #$09 lda #$09
sta cursor_y sta cursor_y
@ -58,7 +58,9 @@ menu_cleanup_loop
pha pha
clc clc
adc #$09 adc #$09
inc
sta print_y sta print_y
stz print_x
lda #^space64 lda #^space64
ldx #!space64 ldx #!space64
sta print_bank sta print_bank
@ -215,6 +217,11 @@ redraw_filelist_out
brl menu_redraw_out brl menu_redraw_out
print_direntry: print_direntry:
lda cursor_y
sta print_y
inc
sta cursor_y
lda dirent_bank lda dirent_bank
ldx dirent_addr ldx dirent_addr
@ -233,37 +240,34 @@ dirent_is_dir
sta @print_pal sta @print_pal
bra dirent_type_cont bra dirent_type_cont
dirent_is_file dirent_is_file
lda #$00 lda #$09
sta @fd_fnoff ;no offset sta @fd_fnoff ;no offset
lda #$00 lda #$00
sta @print_pal ;palette 0 (white) sta @print_pal ;palette 0 (white)
dirent_type_cont dirent_type_cont
rep #$20 : .al
txa txa
clc clc
adc @fd_fnoff adc @fd_fnoff
tax tax
sep #$20 : .as sep #$20 : .as
lda !0, x ;load offset of leaf (file) name lda !0, x ;load offset of leaf (file) name
clc inc
adc #1
rep #$20 : .al rep #$20 : .al
and #$00ff ;kill hi byte and #$00ff ;kill hi byte
sta @fd_fnoff sta @fd_fnoff
txa txa
clc
adc @fd_fnoff adc @fd_fnoff
sta @fd_fnoff sta @fd_fnoff
plb plb
lda cursor_y
sta print_y
inc
sta cursor_y
lda cursor_x lda cursor_x
sta print_x sta print_x
sep #$20 : .as sep #$20 : .as
ldx fd_fnoff ldx fd_fnoff
lda #58 lda #52
sta print_count sta print_count
stx print_src stx print_src
lda dirent_bank lda dirent_bank
@ -274,7 +278,8 @@ dirent_type_cont
clc clc
adc print_done adc print_done
sta print_x sta print_x
lda #58
lda #52
sec sec
sbc print_done sbc print_done
sta print_count sta print_count
@ -284,6 +289,29 @@ dirent_type_cont
stx print_src stx print_src
jsr hiprint jsr hiprint
sep #$20 : .as
lda dirent_type
cmp #$80
bne dirent_is_file_2
lda #^text_dirmark
ldx #!text_dirmark
inx
sta print_bank
stx print_src
bra dirent_type_cont_2
dirent_is_file_2
lda dirent_bank
ldx dirent_addr
inx
sta print_bank
stx print_src
dirent_type_cont_2
lda #54
sta print_x
lda #8
sta print_count
jsr hiprint
rts rts
menu_key_down: menu_key_down:

View File

@ -4,8 +4,8 @@ hiprint:
sep #$20 : .as sep #$20 : .as
lda print_count lda print_count
sta print_count_tmp sta print_count_tmp
stz print_done
rep #$30 : .xl : .al rep #$30 : .xl : .al
stz print_done
lda print_x lda print_x
and #$00ff and #$00ff
lsr lsr