diskio now properly closes files after a load or save

This commit is contained in:
Irmen de Jong 2020-12-03 16:01:58 +01:00
parent 261c0fc9b6
commit 3e63a29c59

View File

@ -97,10 +97,14 @@ io_error:
plp plp
}} }}
ubyte result=0
if_cc if_cc
return c64.READST()==0 result = c64.READST()==0
return false c64.CLRCHN()
c64.CLOSE(1)
return result
} }
sub load(ubyte drivenumber, uword filenameptr, uword address_override) -> uword { sub load(ubyte drivenumber, uword filenameptr, uword address_override) -> uword {
@ -122,6 +126,9 @@ io_error:
+ ldx P8ZP_SCRATCH_REG + ldx P8ZP_SCRATCH_REG
}} }}
c64.CLRCHN()
c64.CLOSE(1)
if end_of_load if end_of_load
return end_of_load - address_override return end_of_load - address_override