Page 1 of 1
NES Space Checker
Posted: Fri Dec 30, 2011 12:37 am
by Shiru
My
quest for a tool that checks free ROM space resulted in this small project. It does the job for me, maybe it could be useful for someone else.
That's how it looks:
Download the tool
Posted: Fri Dec 30, 2011 6:13 am
by Denine
That's really nice tool, may come handy.
I'm really curious HOW the tool know which byte is empty byte?
How tool detects it?
Posted: Fri Dec 30, 2011 6:32 am
by tepples
Denine wrote:That's really nice tool, may come handy.
I'm really curious HOW the tool know which byte is empty byte?
How tool detects it?
I'm guessing it looks for $FF or $00 bytes (most common choices for ld65 fillval), or it looks for the longest existing runs and uses their byte values.
Posted: Fri Dec 30, 2011 2:45 pm
by Shiru
The algorithm is explained in the readme, and there is source code as well - yes, it looks for the longest existing runs.
Posted: Sun Jun 24, 2012 8:35 am
by thefox
FYI, I tried running the app but it complained about two DLLs: borlndmm.dll and cc3270mt.dll. I found those online but it would be nice if they were included in the package for convenience.
Posted: Sun Jun 24, 2012 8:54 am
by Shiru
Thanks for report, I forgot to disable Dynamic RTL. The file is updated.
Posted: Sun Jun 24, 2012 9:14 am
by thefox
Shiru wrote:The file is updated.
Doesn't seem to be updated, the modification time of NESsc.exe is still 2011-12-30.
Posted: Mon Jun 25, 2012 8:08 am
by Shiru
It is because there was wrong link in the first post (fixed) - I moved files to another place since then, with copy of old files at old place.
Posted: Mon Jun 25, 2012 9:18 am
by thefox
Thanks, works now.
Posted: Thu Jul 05, 2012 3:04 am
by Bisqwit
Related to that, here's my PHP library for inserting stuff into a ROM according to a list of free space. It is the little brother of the system I have in
Chronotools.
It does automatic tail-head merging of partially/wholly identical pieces of data, linking of inter-object references, and attempts to organize the potentially thousands of pieces into the given stripes of free space in a manner that results in most optimal filling.
It is aware of restrictions like "this object must be stored in a pre-defined location" or "these 200 objects must be placed in the same memory bank, whatever that may be".
Source code / download:
http://bisqwit.iki.fi/src/romlinker_php.zip
The field of use for this library is in ROM hacking. I used it in the creation of my
Finnish translation patch of Simon's Quest.
See inc/linker.php , which contains phpDocumentor compatible documentation.
Re: NES Space Checker
Posted: Fri Sep 07, 2012 7:03 am
by thefox
There's a bug in the way this tool finds the fill byte, so it doesn't always use the byte with the longest run in the file. I took a look at the code, and as far as I could understand, the bug seems to be here:
Should be:
Code: Select all
if(len>=8 && len > lens[prev]) lens[prev]=len;
Re: NES Space Checker
Posted: Fri Sep 07, 2012 3:05 pm
by Shiru
Guess you are right, updated the file.
Re: NES Space Checker
Posted: Fri Sep 07, 2012 4:31 pm
by thefox
Shiru wrote:Guess you are right, updated the file.
Thanks!