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()

View File

@@ -3,6 +3,9 @@ TODO
romable: fix as many of the "TODO: Romable" issues as possible to improve romability of library code
document romable option and that strings+initialized arrays become read-only
...
@@ -76,7 +79,7 @@ STRUCTS?
--------
- declare struct *type*, or directly declare the variable itself? Problem with the latter is: you cannot easily define multiple variables of the same struct type.
- can contain only numeric types (byte,word,float) - no nested structs, no reference types (strings, arrays) inside structs
- can contain only numeric types (byte,word,float) - no nested structs, no reference types (strings, arrays) inside structs, max 1 page of memory total size to allow regular indexing?
- only as a reference type (uword pointer). This removes a lot of the problems related to introducing a variable length value type.
- arrays of struct is just an array of uword pointers. Can even be @split?
- need to introduce typed pointer datatype in prog8