diff --git a/libsrc/common/fmisc.s b/libsrc/common/fmisc.s index 185a4ec9c..a8c913b5e 100644 --- a/libsrc/common/fmisc.s +++ b/libsrc/common/fmisc.s @@ -1,4 +1,4 @@ -; +; ; Ullrich von Bassewitz, 31.05.1998 ; ; Several small file stream functions @@ -9,17 +9,19 @@ .import __errno .importzp ptr1 + .include "_file.inc" + ; ; Get the FILE* parameter, check if the file is open ; getf: sta ptr1 stx ptr1+1 - ldy #1 - lda (ptr1),y ; get f->f_flags - and #$01 ; file open? - beq @L1 ; jump if no - clc ; ok + ldy #_FILE_f_flags + lda (ptr1),y ; get f->f_flags + and #_FOPEN ; file open? + beq @L1 ; jump if no + clc ; ok rts @L1: sec rts @@ -32,7 +34,7 @@ _clearerr: jsr getf bcs err lda (ptr1),y - and #$F9 + and #<~(_FEOF | _FERROR) sta (ptr1),y err: rts @@ -44,7 +46,7 @@ _feof: jsr getf ; bcs err lda (ptr1),y - and #$02 + and #_FEOF ldx #0 rts @@ -56,7 +58,7 @@ _ferror: jsr getf ; bcs err lda (ptr1),y - and #$04 + and #_FERROR ldx #0 rts