better check for EOF status

This commit is contained in:
Irmen de Jong 2021-01-13 22:11:51 +01:00
parent b9ddde0f12
commit 79e6d4b8dd
3 changed files with 71 additions and 3 deletions

View File

@ -206,7 +206,7 @@ close_end:
f_close()
c64.SETNAM(string.length(filenameptr), filenameptr)
c64.SETLFS(11, drivenumber, 3)
c64.SETLFS(11, drivenumber, 0)
void c64.OPEN() ; open 11,8,0,"filename"
if_cc {
iteration_in_progress = true

View File

@ -0,0 +1,68 @@
; program to test the loading speed
.cpu "65c02"
*=$0801
; 10 sys 2061
.byte $0b, $08, $0a, $00, $9e, $32, $30, $36
.byte $31, $00, $00, $00
start
phx
ldx #<_filename
ldy #>_filename
lda #10
jsr $FFBD ; SETNAM
jmp _go
_filename
.text "romdis.asm"
_go
lda #0
tax
tay
jsr $FFDB ; SETTIM 0,0,0
lda #1
ldx #8
ldy #0
jsr $FFBA ; SETLFS 1,8,0
jsr $FFC0 ; OPEN
ldx #1
jsr $FFC6 ; CHKIN, use #1 as output channel
;lda #'.'
;jsr $FFD2 ; CHROUT
; load the file ....
_loop
jsr $ffb7 ;READST
bne _eof
jsr $FFCF ;CHRIN
sta $02 ; store...
jmp _loop
_eof
; close stuff
jsr $FFCC ;CLRCHN
lda #1
jsr $FFC3 ;CLOSE
; print the time taken
jsr $FFDE ; RDTIM -> A,X,Y
tay
txa
jsr $fe03 ; GIVAYF
jsr $fe81 ; FOUT
sta 2
sty 3
ldy #0
_printlp
lda (2),y
beq _endstr
jsr $FFD2 ; CHROUT
iny
bne _printlp
_endstr
plx
rts

View File

@ -80,7 +80,7 @@ bitmap {
offsetx = (gfx2.width - width) / 2
if height < gfx2.height
offsety = (gfx2.height - height) / 2
status = (not c64.READST()) or c64.READST()==64 ; TODO only check bit 6 rather than value
status = (not c64.READST()) or (c64.READST()&64==64)
}
sub next_scanline() {
@ -88,7 +88,7 @@ bitmap {
py++
y_ok = py < gfx2.height
gfx2.position(offsetx, offsety+py)
status = (not c64.READST()) or c64.READST()==64 ; TODO only check bit 6 rather than value
status = (not c64.READST()) or (c64.READST()&64==64)
}
sub do1bpp(uword width, uword height) -> ubyte {