make diskio.f_read() ROM-compatible

This commit is contained in:
Irmen de Jong
2025-04-15 00:23:23 +02:00
parent 6b9cdbd482
commit fb44c87597
3 changed files with 15 additions and 13 deletions

View File

@@ -411,18 +411,17 @@ close_end:
byte_read_loop: ; fallback if MACPTR isn't supported on the device
%asm {{
lda bufferpointer
sta m_in_buffer+1
sta P8ZP_SCRATCH_W1
lda bufferpointer+1
sta m_in_buffer+2
sta P8ZP_SCRATCH_W1+1
}}
while num_bytes!=0 {
; TODO: Romable
%asm {{
jsr cbm.CHRIN
m_in_buffer sta $ffff ; modified
inc m_in_buffer+1
sta (P8ZP_SCRATCH_W1)
inc P8ZP_SCRATCH_W1
bne +
inc m_in_buffer+2
inc P8ZP_SCRATCH_W1+1
+
}}
cx16.r0L = cbm.READST()

View File

@@ -364,18 +364,18 @@ close_end:
list_blocks = 0 ; we reuse this variable for the total number of bytes read
%asm {{
lda bufferpointer
sta m_in_buffer+1
sta P8ZP_SCRATCH_W1
lda bufferpointer+1
sta m_in_buffer+2
sta P8ZP_SCRATCH_W1+1
}}
while num_bytes!=0 {
; TODO: Romable
%asm {{
jsr cbm.CHRIN
m_in_buffer sta $ffff ; modified
inc m_in_buffer+1
ldy #0
sta (P8ZP_SCRATCH_W1),y
inc P8ZP_SCRATCH_W1
bne +
inc m_in_buffer+2
inc P8ZP_SCRATCH_W1+1
+
}}
cx16.r0L = cbm.READST()