Hacking Batch rom trimmer for all

  • Thread starter Thread starter fitzbean
  • Start date Start date
  • Views Views 2,033
  • Replies Replies 16

fitzbean

Well-Known Member
Newcomer
Joined
Jun 30, 2005
Messages
60
Reaction score
0
Trophies
1
XP
116
Country
United States
Finally got around to making a simply/r4 batch rom trimmer.

It trims them to the exact same size as the M3 trimmer (tested 10 or 15), and it's faster than M3's to boot; best of all of course, load up as many as you want. It drops them in the same folder that the roms were dragged from, and appends the familiar "_trim" to the filename.

get it here.

skinnyrom.jpg
 
His one looks more for windows though. It freezes on DSClippers(which is a great program by the way) when you do heaps of ROMS. It finishes them though but you have no idea where it is
 
If it makes it the same size as the M3 trimmer (from what I've heard - it overtrims occasionally), will this particular trimmer overtrim?
 
His one looks more for windows though. It freezes on DSClippers(which is a great program by the way) when you do heaps of ROMS. It finishes them though but you have no idea where it is

it could possibly be just your computer, because I tried to trim 300 games onto an external drive with the Windows version and it didn't "freeze" up. I saw the progress for each game
smile.gif
 
I didn't "steal any code" lol. Why would I bother if I didn't think I could make it a little better?

What's a "safe trim"? If I had to guess, it probably just leaves a number of bytes after it determines where the game ends to make sure nothing is erased. As for "over trimming", it shouldn't. Although let know if you find a game that doesn't work.

As for DSTrimmer - I don't like how you have to specify an output directory starting at "my computer" every time you run it; also, it doesn't show the amount & percentage trimmed for each game - and lastly, it's a tubby 3,451k and takes 15mb or so memory while SkinnyRom is a lean 145k using around 5mb.
 
How does this trimmer trim roms? IIRC, it may either cut out a certain combination of code, or reads the header and trims to the amount specified.
 
This starts at the back of the file and checks bytes until it finds the end of the game. It then streams the file into memory, resizes it, and saves it.
 
I didn't "steal any code" lol. Why would I bother if I didn't think I could make it a little better?

What's a "safe trim"? If I had to guess, it probably just leaves a number of bytes after it determines where the game ends to make sure nothing is erased. As for "over trimming", it shouldn't. Although let know if you find a game that doesn't work.

As for DSTrimmer - I don't like how you have to specify an output directory starting at "my computer" every time you run it; also, it doesn't show the amount & percentage trimmed for each game - and lastly, it's a tubby 3,451k and takes 15mb or so memory while SkinnyRom is a lean 145k using around 5mb.


Safe trim is infact leaving a certain number of bytes at the end -- and no, it's not for over trimming prevention purposes, it's for preserving wifi connectivity (some games break if they're totally trimmed).

It's DSClippers by the way. Why not start at My Computer? Is it too difficult to navigate your computer
tongue.gif
kidding. And it does show how much is trimmed for each game -- if you look in the SIZE column, it tells you how big it will be.

Plus, you need to remember that your program was designed only for Windows -- Mine is multiplatform, hence the size.

QUOTEThis starts at the back of the file and checks bytes until it finds the end of the game. It then streams the file into memory, resizes it, and saves it.

so you're checking individual bytes? I did that before, and it was slow. Much faster to trim based on header info -- takes a couple seconds to trim each game. There's only a select few games that have incorrect header info (they say 0 bytes), but that's a developer issue.
 
QUOTE said:
Safe trim is infact leaving a certain number of bytes at the end -- and no, it's not for over trimming prevention purposes, it's for preserving wifi connectivity (some games break if they're totally trimmed).

Ah - I didn't even know that - how many bytes do you typically leave at the end of a safe trim?

QUOTE said:
It's DSClippers by the way. Why not start at My Computer? Is it too difficult to navigate your computer
tongue.gif
kidding

It's not difficult, just kind of a extra step.

QUOTE said:
so you're checking individual bytes? I did that before, and it was slow. Much faster to trim based on header info -- takes a couple seconds to trim each game. There's only a select few games that have incorrect header info (they say 0 bytes), but that's a developer issue.

So does DSClippers not work for those games with incorrect header info?
I'm not checking every byte - that is very slow. I check every X byte working backwards until I hit the game data, then I go byte for byte from there to find the exact spot.

QUOTE
Plus, you need to remember that your program was designed only for Windows -- Mine is multiplatform, hence the size.

No argument there; what did you develop it in?
 
QUOTE said:
Safe trim is infact leaving a certain number of bytes at the end -- and no, it's not for over trimming prevention purposes, it's for preserving wifi connectivity (some games break if they're totally trimmed).

Ah - I didn't even know that - how many bytes do you typically leave at the end of a safe trim?

QUOTE said:
It's DSClippers by the way. Why not start at My Computer? Is it too difficult to navigate your computer
tongue.gif
kidding

It's not difficult, just kind of a extra step.

QUOTE said:
so you're checking individual bytes? I did that before, and it was slow. Much faster to trim based on header info -- takes a couple seconds to trim each game. There's only a select few games that have incorrect header info (they say 0 bytes), but that's a developer issue.

So does DSClippers not work for those games with incorrect header info?
I'm not checking every byte - that is very slow. I check every X byte working backwards until I hit the game data, then I go byte for byte from there to find the exact spot.

QUOTE
Plus, you need to remember that your program was designed only for Windows -- Mine is multiplatform, hence the size.

No argument there; what did you develop it in?

I was told that the safe trim keeps an extra 188 bytes at the end of the file (184 + 4 blank) to preserve Wifi -- So far I haven't had any wifi issues using this safe trim method.

Yes, DSClippers will not work with the few games that have incorrect header info -- they're not important games anyways
tongue.gif


I see what you're saying. How many bytes do you jump backwards at a time? Do you have a variable number based on the size of the game? I just remember that there was a trimmer that trimmed one rom at a time (no batch trimming) and scanned byte for byte going backwards -- was slow as HELL!
tongue.gif


My programs are developed in RealBasic -- since I paid for it, I figured I might as well develop multi-platform software with it! What it does is includes the necessary runtimes inside of the program, this way it doesn't require you to have something like .NET or VB runtimes -- it'll run regardless
smile.gif
That's basically the reason why the size is somewhat big and takes up more memory than usual, although the size and memory isn't really an issue for many people these days.

--Henry
 
188 - cool, I'll have to add support for that tonight.

QUOTE said:
Yes, DSClippers will not work with the few games that have incorrect header info -- they're not important games anyways

just the same, a good game may come out that has 0 header info.

QUOTE said:
I see what you're saying. How many bytes do you jump backwards at a time? Do you have a variable number based on the size of the game? I just remember that there was a trimmer that trimmed one rom at a time (no batch trimming) and scanned byte for byte going backwards -- was slow as HELL!
tongue.gif


For this release, I did 250 byte jumps; but I've got to experiment a bit more - perhaps bigger jumps would be even faster; it's really about finding the balance between the jumps and the number of bytes it has to read to find the exact end once it runs into the game data. I had it as an option, but removed it at the last moment. At 250, it's reading what 4k bytes per mb (roughly), and at max has to read byte for byte for 249 bytes. So yea, I assume it could be even much faster if say I went to 1000byte jumps, or even 10k byte jumps more. I'll include it as an option for the next version.

QUOTE
although the size and memory isn't really an issue for many people these days.

Bite your tongue boy!
smile.gif
Size maybe not, but memory always.
 
Here's v1.1

SkinnyRom v1.1

-drag and drop
-specify path to output (or have it automatically output to same directory the rom is in)
-safe trim
-specify appending text
-specify byte jump
-settings saved session-to-session via xml
-uses unique method which involves working from the end of the file backwards, and jumping x bytes until it
finds the end of the rom complete with double and triple checks to ensure there's never any over-trimming.
-much fast than M3s trimmer.
-does not use header information so this will work with ALL games.

check out the rollover hints for brief help for most of the functions of the program

skinnyrom.gif


Download it here

If you find any games that don't trim correctly; please let me know! I'll figure out what's going on.

Enjoy,
Fitz
 

Site & Scene News

Popular threads in this forum