mirror of
https://github.com/irmen/prog8.git
synced 2024-07-26 05:29:15 +00:00
cx16diskio.f_read() now correctly deals with banked ram boundary
This commit is contained in:
parent
a6ffa5738b
commit
0fcd57192b
@ -102,6 +102,8 @@ cx16diskio {
|
|||||||
goto byte_read_loop ; macptr block read not supported, do fallback loop
|
goto byte_read_loop ; macptr block read not supported, do fallback loop
|
||||||
diskio.list_blocks += size
|
diskio.list_blocks += size
|
||||||
bufferpointer += size
|
bufferpointer += size
|
||||||
|
if msb(bufferpointer) == $c0
|
||||||
|
bufferpointer = mkword($a0, lsb(bufferpointer)) ; wrap over bank boundary
|
||||||
num_bytes -= size
|
num_bytes -= size
|
||||||
if c64.READST() & $40 {
|
if c64.READST() & $40 {
|
||||||
diskio.f_close() ; end of file, close it
|
diskio.f_close() ; end of file, close it
|
||||||
|
@ -226,6 +226,8 @@ close_end:
|
|||||||
sub f_read(uword bufferpointer, uword num_bytes) -> uword {
|
sub f_read(uword bufferpointer, uword num_bytes) -> uword {
|
||||||
; -- read from the currently open file, up to the given number of bytes.
|
; -- read from the currently open file, up to the given number of bytes.
|
||||||
; returns the actual number of bytes read. (checks for End-of-file and error conditions)
|
; returns the actual number of bytes read. (checks for End-of-file and error conditions)
|
||||||
|
; NOTE: on systems with banked ram (such as Commander X16) this routine DOES NOT
|
||||||
|
; automatically load into subsequent banks if it reaches a bank boundary!
|
||||||
if not iteration_in_progress or not num_bytes
|
if not iteration_in_progress or not num_bytes
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ TODO
|
|||||||
|
|
||||||
For next release
|
For next release
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
- bug: f_read() can't deal with running out of banked ram? maybe only cx16diskio.f_read()?
|
|
||||||
- add McCarthy evaluation to shortcircuit and/or expressions. Both conditional expressions and assignments!
|
- add McCarthy evaluation to shortcircuit and/or expressions. Both conditional expressions and assignments!
|
||||||
- add some more optimizations in vmPeepholeOptimizer
|
- add some more optimizations in vmPeepholeOptimizer
|
||||||
- vm Instruction needs to know what the read-registers/memory are, and what the write-register/memory is.
|
- vm Instruction needs to know what the read-registers/memory are, and what the write-register/memory is.
|
||||||
|
@ -36,13 +36,9 @@ zsound_lib:
|
|||||||
|
|
||||||
ubyte load_ok = false
|
ubyte load_ok = false
|
||||||
|
|
||||||
sub prebuffer() {
|
sub prebuffer() {
|
||||||
txt.print("prebuffering...")
|
txt.print("prebuffering...")
|
||||||
repeat 4 {
|
void cx16diskio.f_read(digi_address, ram_bank_size*4)
|
||||||
void cx16diskio.f_read(digi_address, ram_bank_size)
|
|
||||||
txt.print_ub(cx16.getrambank())
|
|
||||||
txt.spc()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
|
Loading…
Reference in New Issue
Block a user