Hacking Batch rom trimmer for all

fitzbean

Well-Known Member
OP
Newcomer
Joined
Jun 30, 2005
Messages
60
Trophies
0
XP
106
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
 

TLSpartan

Kills threads
Member
Joined
Oct 20, 2006
Messages
2,050
Trophies
0
XP
521
Country
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
 

4saken

Retired Ace Attorney
Member
Joined
Nov 28, 2006
Messages
3,357
Trophies
0
Website
Visit site
XP
145
Country
If it makes it the same size as the M3 trimmer (from what I've heard - it overtrims occasionally), will this particular trimmer overtrim?
 

hankchill

I Pwn n00bs.
Member
Joined
Nov 5, 2005
Messages
2,338
Trophies
0
Age
37
Location
Outer Space
Website
www.hankchill.com
XP
411
Country
Canada
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
 

fitzbean

Well-Known Member
OP
Newcomer
Joined
Jun 30, 2005
Messages
60
Trophies
0
XP
106
Country
United States
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.
 

4saken

Retired Ace Attorney
Member
Joined
Nov 28, 2006
Messages
3,357
Trophies
0
Website
Visit site
XP
145
Country
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.
 

fitzbean

Well-Known Member
OP
Newcomer
Joined
Jun 30, 2005
Messages
60
Trophies
0
XP
106
Country
United States
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.
 

hankchill

I Pwn n00bs.
Member
Joined
Nov 5, 2005
Messages
2,338
Trophies
0
Age
37
Location
Outer Space
Website
www.hankchill.com
XP
411
Country
Canada
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.
 

fitzbean

Well-Known Member
OP
Newcomer
Joined
Jun 30, 2005
Messages
60
Trophies
0
XP
106
Country
United States
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?
 

hankchill

I Pwn n00bs.
Member
Joined
Nov 5, 2005
Messages
2,338
Trophies
0
Age
37
Location
Outer Space
Website
www.hankchill.com
XP
411
Country
Canada
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
 

fitzbean

Well-Known Member
OP
Newcomer
Joined
Jun 30, 2005
Messages
60
Trophies
0
XP
106
Country
United States
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.
 

fitzbean

Well-Known Member
OP
Newcomer
Joined
Jun 30, 2005
Messages
60
Trophies
0
XP
106
Country
United States
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
 
General chit-chat
Help Users
  • Vetusomaru @ Vetusomaru:
    btw do u have discord?
  • Vetusomaru @ Vetusomaru:
    last tv anime i remember with nipples i personally watched was Senran Kagura
  • Skelletonike @ Skelletonike:
    yeah I do
  • Skelletonike @ Skelletonike:
    I mostly read, haven't watched much, but I do keep my cunchyroll sub.
  • Skelletonike @ Skelletonike:
    Found out one of my fave animes got an adaptation this season

    the other day lol
  • Skelletonike @ Skelletonike:
    Yuusha ga Shi
    nda
  • Vetusomaru @ Vetusomaru:
    crynchyrolls is cancer, especially with the censorship they do like they did with Oshimai
  • Vetusomaru @ Vetusomaru:
    can u post your discord here or at dm?
  • Skelletonike @ Skelletonike:
    No idea
  • Skelletonike @ Skelletonike:
    it's my username
  • Vetusomaru @ Vetusomaru:
    and number?
  • Skelletonike @ Skelletonike:
    it needs the number?
  • Vetusomaru @ Vetusomaru:
    okey dokey. i ve sent u friend request.
  • Vetusomaru @ Vetusomaru:
    i have same username with here
  • Skelletonike @ Skelletonike:
    alright, accepted
    +1
  • K3N1 @ K3N1:
    You got a friend in you
  • Skelletonike @ Skelletonike:
    that's gay
  • K3N1 @ K3N1:
    Maybe I like being gay
  • Vetusomaru @ Vetusomaru:
    The Greek dub of Toy Story's You've got a friend in me is still a classic even among boomers who've never watched the movie, mostly because it was sung by a famous beloved Greek singer
  • Vetusomaru @ Vetusomaru:
    Also his choice was quite interesting since his songs are anything but family-friendly
  • Vetusomaru @ Vetusomaru:
    If anything, some of his songs were so controversial that he got troubles with the law regarding "blasphemy laws" in Greece.
    Vetusomaru @ Vetusomaru: If anything, some of his songs were so controversial that he got troubles with the law regarding...