| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Reading the directory - raw mode
I might have dreamt it but.. I distinctively remember being able to control ”output mode” from the regular reading $ command. I’d rather not parse quoted strings and what not and I’d rather not read raw sectors.
I remeber being able to change output format.. |
|
... 14 posts hidden. Click here to view all posts.... |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Then you should have perfect control over your naming scheme.
I think parsing the directory in cooked mode is the better option. Works consistently across all drives, and you're using KERNAL calls anyways.
And it can't be so hard or error-prone to do some kind of pattern matching in order to list your savegames, can it? Doesn't even require handling quoted strings and what not. :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Then you should have perfect control over your naming scheme.
I think parsing the directory in cooked mode is the better option. Works consistently across all drives, and you're using KERNAL calls anyways.
And it can't be so hard or error-prone to do some kind of pattern matching in order to list your savegames, can it? Doesn't even require handling quoted strings and what not. :)
Just did. :)
1) Enter kernel hell
2 I read each null-terminated line into a buffer.
3) Scan from the end until normal character, then scans backwards until space. => File type found
4) Then I continue to scan backwards until " found. If not, bail
5) Then I scan from 0 and forward until " found. If not bail
=> Filename found
6) Verify filetype, pattern match filename, add to valid file buffer list.
7) Repeat 2) until EOF
8) Leave kernel hell
9) Present nice file picker UI |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
why dont you just let the drive do the work for you?
a) pick a prefix for your savegames, like "leet.game1" "leet.game2"
b) open "$:leet*" |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: why dont you just let the drive do the work for you?
a) pick a prefix for your savegames, like "leet.game1" "leet.game2"
b) open "$:leet*"
Wasnt aware it could be done. Awesome! I’ll remove my filter stuff but keep the quote parsing. Can you enforce filetype also? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
of course - open "$:bla*,p" |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Actually, "$:bla*=p" - see http://unusedino.de/ec64/technical/aay/c1541/ro41c398.htm (and http://unusedino.de/ec64/technical/aay/c1541/ro41da55.htm). :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: of course - open "$:bla*,p"
\o/ |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
OK :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
School book example of an XY-problem: https://en.m.wikipedia.org/wiki/XY_problem |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
wow, didnt know kernal can do such nifty shit :) |
Previous - 1 | 2 | 3 - Next |