Closed mooinglemur closed 1 year ago
Oops, line 260
should say 40 characters, not 20 :) Doesn't affect the output though.
Tested against R41 and current masters with identical results
x16-emulator: e10bc7b7dfa20fa73a4bace58c956ef7805779d7 x16-rom: 5d8ba9f36b4c4fb4397b94c7ce273e2d4e5e0110
I think the crux of the issue is that opening a file clobbers the single dirent structure in the fat32 driver. It appears that it even occurred to @mist64 a couple years ago that this would be problematic.
Reopened issue https://github.com/X16Community/x16-rom/issues/19
I was writing an assembly language program that programmatically reads a directory list, and before the program reads all of it, opens a file, reads from it, closes it, and then returns to reading the directory listing. This appears to result in some sort of corruption of the directory listing cursor's position.
Moreover, closing and reopening the directory listing at that point results in a corrupt directory read with what should be a clean state. Repeating that one more time seems to come back clean.
I managed to create a BASIC test case for this.
I created this BASIC program
I saved it as
DIRTEST.PRG
, and I created an SD card image via the following.This is the output I see
All of these scenarios' outputs should be identical, but they're not.