NES Space Checker

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

NES Space Checker

Post 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:

Image

Download the tool
Last edited by Shiru on Mon Jun 25, 2012 8:07 am, edited 1 time in total.
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post 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?
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post 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.
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

The algorithm is explained in the readme, and there is source code as well - yes, it looks for the longest existing runs.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post 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.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post by Shiru »

Thanks for report, I forgot to disable Dynamic RTL. The file is updated.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post 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.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Post 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.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox »

Thanks, works now.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Bisqwit
Posts: 248
Joined: Fri Oct 14, 2011 1:09 am

Post 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.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: NES Space Checker

Post 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:

Code: Select all

if(len>=8) lens[prev]=len;
Should be:

Code: Select all

if(len>=8 && len > lens[prev]) lens[prev]=len;
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Shiru
Posts: 1161
Joined: Sat Jan 23, 2010 11:41 pm

Re: NES Space Checker

Post by Shiru »

Guess you are right, updated the file.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: NES Space Checker

Post by thefox »

Shiru wrote:Guess you are right, updated the file.
Thanks!
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Post Reply