File I/O from the SD card issues

theelkmechanic

New Member
Feb 12, 2020
2
3
3
I'm hitting a weird error where if I read a file from the SD card in the emulator, it never gives me an EOF if the file is an exact multiple of 512 bytes. Both CHRIN and ACPTR give me back a 0 byte and READST returns no errors once I hit the end of the file. Tracing in with the debugger and it looks to be somewhere way down in the SD card or FAT32 code. Anyone else experiencing this issue?
 
May 22, 2019
662
313
63
No, I've basically given up on the emulator until the codebase stabilizes.

But you can report the issue on their GitHub. It's probably a 6502 code issue, so you will probably want to report it on the ROM git.

 

theelkmechanic

New Member
Feb 12, 2020
2
3
3
Yep, it turned out CBDOS's internal read_block function was doing a less than instead of a less than or equals, so if the last block was a full 512 bytes, it wouldn't flag it as being the last block and would keep trying to read new blocks past the end of the file. Submitted a PR with a fix.