| |
Bacchus
Registered: Jan 2002 Posts: 154 |
Replacing games loader ...
OK, this on cracking but still highly related to coding.
Most games I fiddled with over the year call the loader using a parameter that was the index of the file. Using the same parameter as index for my IFFL or converting it to a two byte string starting the file name has worked well for me in most cases.
I am now facing two games that are not distributed yet (old, but no scene version is out) where there is a lot of data stored directly on the disk and the game then loads it using direct track and sector. Think of it like action adventures. The game loads strings or other really small things by loading T/S and then exctacting the needed part. It's hence not really "files" most of it and there are so many that a file per string is plainly not within reach.
I can think of a few approaches;
1) Keep it as data on disk. Allocate the sectors used and then store the files on the unallocated sectors. You can't compress it - it does take a full disk side any way you look at it. It does work, looks rather neat but cannot be counted as a firstie.
2) Make a big chunk of the data to a file and push it to a REU the first thing you do. The game become ever so much more playable and fast. And the file can be compressed efficiently. You do need a REU (or simply enable it in your emulator or Ultimate Cart) but it's also still not counted as a firstie.
3) Make a big file which you then need to scan as the original 256 byte sectors are now 254, so a sector that was a full page is by necessity spread over two sectors in a file based option. I guess you can also compress the sectors individually and think of the sectors as files in an IFFL. One IFFL file equals a sector. This is an ugly bitch but could be counted as a firstie.
Any other thought on this technical challenge? I must admit I am growing fond of the REU option, and the firstie restriction is the only thing that holds me back. The Tink games we just released had been perfect in REU version. Would have saved SO much work, loading would have been near instant and it would have been a release of two neat files.
Am I missing any options or can someone provide some lateral thinking, that opens up new options by finding approaches I have missed? |
|
... 36 posts hidden. Click here to view all posts.... |
| |
Perplex
Registered: Feb 2009 Posts: 254 |
When the files are stored on disk, tracks and sectors are determined by some kind of logic, not chosen randomly. If you implement this same logic in native code, all you need is table with sizes for each file, and you can calculate t/s and offset from that, right? |
| |
Count Zero
Registered: Jan 2003 Posts: 1820 |
No.
That "logic" is too easily influenced by file copiers, modified drive ROMs (speeders), etc. |
| |
Perplex
Registered: Feb 2009 Posts: 254 |
Won't those break your tables whether they are precalculated or not? |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
Quote: Won't those break your tables whether they are precalculated or not?
Not if you build them by scanning the file when the game first loads, as Bacchus mentioned above.
Interesting challenge, actually - read all the track & sector links in a file in as little time as possible and store a compact representation in drive ram that can be used for fast random seeking… Probably safe to assume there's usually only a new track every ~20 blocks. |
| |
Bacchus
Registered: Jan 2002 Posts: 154 |
So, scanning is needed.
Storing tables is needed.
And preserving memory is also needed. |
| |
Martin Piper
Registered: Nov 2007 Posts: 631 |
It's these little puzzles that keep programming fun. :) |
| |
Maxlide
Registered: Apr 2003 Posts: 29 |
Quote: It's these little puzzles that keep programming fun. :)
...or let you bite into your table :) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11100 |
Quote:Strictly speaking you need less than 10 bits to store the track and sector, if you can spare a few bytes for a small div routine. Even so, that's 900 bytes for the tables, which is a lot.
when you are dealing with 400 chunks of 256 bytes you dont need to put the offset into the table (you can calculate it easily and fast) |
| |
Oswald
Registered: Apr 2002 Posts: 5017 |
Quote: ...or let you bite into your table :)
you will not enjoy it finally working, not having had eatan half of the table :) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
Oh! The piece of furniture your computer sits on!
I was trying to parse Maxlide's comment as being something about code overwriting the offset table or something, and utterly failing to make sense of it. Thanks Oswald.
*stops eating table* |
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next |