Changed most of the library sources to use .CAP instead of .CPU.

This commit is contained in:
Kugel Fuhr
2025-07-01 07:25:32 +02:00
parent f333b300f1
commit c72126e68f
59 changed files with 122 additions and 232 deletions

View File

@@ -20,7 +20,6 @@
.include "_file.inc"
.macpack generic
.macpack cpu
; ------------------------------------------------------------------------
; Code
@@ -48,7 +47,7 @@
ldy #_FILE::f_flags
lda (file),y
.if (.cpu .bitand ::CPU_ISET_65SC02)
.if .cap(CPU_HAS_BITIMM)
bit #_FOPEN ; Is the file open?
.else
and #_FOPEN ; Is the file open?
@@ -57,7 +56,7 @@
; Check if the stream is in an error state
.if (.cpu .bitand ::CPU_ISET_65SC02)
.if .cap(CPU_HAS_BITIMM)
bit #_FERROR
.else
lda (file),y ; get file->f_flags again
@@ -74,17 +73,15 @@
; Remember if we have a pushed back character and reset the flag.
@L2: .if (.cpu .bitand ::CPU_ISET_65SC02)
@L2: .if .cap(CPU_HAS_BITIMM)
ldx #$00
bit #_FPUSHBACK
beq @L3
.else
tax ; X = 0
lda (file),y
and #_FPUSHBACK
.endif
beq @L3
.if (.not .cpu .bitand ::CPU_ISET_65SC02)
lda (file),y
.endif
and #<~_FPUSHBACK
@@ -135,7 +132,7 @@
; Copy the buffer pointer into ptr1, and increment the pointer value passed
; to read() by one, so read() starts to store data at buf+1.
.if (.cpu .bitand ::CPU_ISET_65SC02)
.if .cap(CPU_HAS_ZPIND)
lda (c_sp)
sta ptr1
add #1
@@ -159,7 +156,7 @@
ldy #_FILE::f_pushback
lda (file),y
.if (.cpu .bitand ::CPU_ISET_65SC02)
.if .cap(CPU_HAS_ZPIND)
sta (ptr1) ; *buf = file->f_pushback;
.else
ldy #0