Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Reading the directory - raw mode
2018-10-08 19:20
JackAsser

Registered: Jun 2002
Posts: 2038
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..
2018-10-08 19:36
soci

Registered: Sep 2003
Posts: 486
Use a secondary address of 2-14 to do that. Format varies by device.
2018-10-08 19:44
JackAsser

Registered: Jun 2002
Posts: 2038
Quote: Use a secondary address of 2-14 to do that. Format varies by device.

Thanks!!! Formats specified anywhere?
2018-10-08 19:51
Krill

Registered: Apr 2002
Posts: 3097
It's just a step above raw sectors. I guess you know the directory format, being the original author of CC1541. :)

So parsing the BASIC-style cooked directory might actually be the better idea.

But why do you need to read and parse the directory?
2018-10-08 19:58
JackAsser

Registered: Jun 2002
Posts: 2038
Quote: It's just a step above raw sectors. I guess you know the directory format, being the original author of CC1541. :)

So parsing the BASIC-style cooked directory might actually be the better idea.

But why do you need to read and parse the directory?


To locate savegames
2018-10-08 23:07
Krill

Registered: Apr 2002
Posts: 3097
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. :)
2018-10-08 23:35
JackAsser

Registered: Jun 2002
Posts: 2038
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
2018-10-08 23:39
chatGPZ

Registered: Dec 2001
Posts: 11523
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*"
2018-10-09 00:03
JackAsser

Registered: Jun 2002
Posts: 2038
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?
2018-10-09 00:09
chatGPZ

Registered: Dec 2001
Posts: 11523
of course - open "$:bla*,p"
2018-10-09 00:14
Krill

Registered: Apr 2002
Posts: 3097
Actually, "$:bla*=p" - see http://unusedino.de/ec64/technical/aay/c1541/ro41c398.htm (and http://unusedino.de/ec64/technical/aay/c1541/ro41da55.htm). :)
 
... 14 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
BYB/Hokuto Force
wil/VCC^CTG
MWR/Visdom
Guests online: 182
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Diskmag Editors
1 Magic  (10)
2 Jazzcat  (9.5)
3 hedning  (9.2)
4 Elwix  (9.1)
5 Peter  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.056 sec.