Hacking Rom trimmer

Killermech

Cookie Monster
Member
Joined
Mar 5, 2004
Messages
1,809
Trophies
0
Website
Visit site
XP
274
Country
is it possible to use a save file generated by a trimmed rom in an untrimmed rom?
in case you find unexpected limitations with trimmed roms


Yes.

How do you do it?
Have the same name on the sav file as the rom
tongue.gif
 

manomanx2

Well-Known Member
Newcomer
Joined
Dec 31, 2006
Messages
69
Trophies
0
XP
71
Country
United States
Awesome, I just trimmed my roms in prep for my coming R4 and it took off 80 MB, from 704 MB to 621 MB. That's like two more games!


*used DS-X's trimmer, very nice.


edit: Gasp, I just added Castlevania POR and it came out to 666 MB.
 

magikalfly

Active Member
Newcomer
Joined
Dec 7, 2006
Messages
42
Trophies
0
XP
40
Country
What's up with these trimmers? I tried the R4 trimmer and got a certain size. Tried the DS-X trimmer, not the manager and got a different size. If trimming just takes off excess, how can there be such difference? About a 3 megabyte different. Which one is legit?
 

Killermech

Cookie Monster
Member
Joined
Mar 5, 2004
Messages
1,809
Trophies
0
Website
Visit site
XP
274
Country
What's up with these trimmers? I tried the R4 trimmer and got a certain size. Tried the DS-X trimmer, not the manager and got a different size. If trimming just takes off excess, how can there be such difference? About a 3 megabyte different. Which one is legit?

As much as it pains me to say this (GO TEAM R4! WOOHOOO!).. go with the DS-X trimmer. As the R4 provided one seems to be overtrimming some roms. It's all in the code, and in should only remove those empty bytes. But the program can get confused at times depending on how the code is written and by a rare chance.. delete something that is more than an empty byte.

The DS-X trimmer seems to have been tested properly and takes the 'safe' road rather than the 'unsafe'. Which means it only trims to a certain safe point.
 

magikalfly

Active Member
Newcomer
Joined
Dec 7, 2006
Messages
42
Trophies
0
XP
40
Country
As much as it pains me to say this (GO TEAM R4! WOOHOOO!).. go with the DS-X trimmer. As the R4 provided one seems to be overtrimming some roms. It's all in the code, and in should only remove those empty bytes. But the program can get confused at times depending on how the code is written and by a rare chance.. delete something that is more than an empty byte.

The DS-X trimmer seems to have been tested properly and takes the 'safe' road rather than the 'unsafe'. Which means it only trims to a certain safe point.

Funny thing, I just tried trimming POR, The DS-X gave me 41 megs. The R4 trimmer gave me 44.9 and the bodom-child's trimmer gave me 44.9 as well. Can anyone try trimming POR? See what they get? I have the correct rom and all.

BTW, nice trimmer bodom-child. It's nice and freakin easy to use.
 

manomanx2

Well-Known Member
Newcomer
Joined
Dec 31, 2006
Messages
69
Trophies
0
XP
71
Country
United States
As much as it pains me to say this (GO TEAM R4! WOOHOOO!).. go with the DS-X trimmer. As the R4 provided one seems to be overtrimming some roms. It's all in the code, and in should only remove those empty bytes. But the program can get confused at times depending on how the code is written and by a rare chance.. delete something that is more than an empty byte.

The DS-X trimmer seems to have been tested properly and takes the 'safe' road rather than the 'unsafe'. Which means it only trims to a certain safe point.


Funny thing, I just tried trimming POR, The DS-X gave me 41 megs. The R4 trimmer gave me 44.9 and the bodom-child's trimmer gave me 44.9 as well. Can anyone try trimming POR? See what they get? I have the correct rom and all.

BTW, nice trimmer bodom-child. It's nice and freakin easy to use.

I got 44.9 MB, you might have overtrimmed. Check to see using the DS-X trimmer if the rom is highlighted in red, that means it's overtrimmed. If it is red, just retrim it. I used the DS-X trimmer and all my roms came out great, all green.
 

ShortFuse

Well-Known Member
Member
Joined
Nov 17, 2006
Messages
132
Trophies
1
XP
243
Country
United States
Hey guys.

I wrote the DS-X Manager. It should work with all carts. I just called it DS-X Manager because I bought a DS-X and posted it on the DS-X Forums. It's fully compatible with all those other carts. In fact, the new version v0.3 will be released as NDS Manager but it's mostly just a name change.

This is why DS-X Manager's trimming is different. Every rom has a set point for where the data ends. It's in the header. The trimmer I wrote writes up to that point. After that, there's 4 bytes of blank space, followed by 184 bytes the WiFi data. If you trim roms by just using the ROM Size and don't take into account the wifi you'd break download play (and maybe something else) on the carts that support it.

DSLazy and R4 Trimmer do it differently (and much slower too). It reads the ROM from the end, and keeps trimming until it finds something that isn't FF or 00. This is bad way of trimming. I explained this on the DS-X thread so I'll just repost what I wrote.

Post one:
QUOTE said:
i'm realizing dslazy's included NDS Rom Trimmer trims more than it should. it might cause problems for some games. the header says where the rom ends on the card, but dslazy's trimmer deletes trailing FF's and 00's from the last file. I'm assuming it's working backwards, from the end of the cart to the last file, but it keeps going until it finds something that's not 00 or FF... I think it shouldn't be done. I haven't had a problem yet... but... I'll trim up to where the developers said where the empty data starts (which is, as i said, specified in the header)

Post two:
QUOTE0x080 to 0x083 holds the ROM Size

DSLazy/Trimmer starts cutting backwards from the end. The problem is that in the file table, it says where in the rom a file begins and a file ends. it's luck it works. let's say the last file on the table was a sprite file and it's between 101 and 150. Let's say the header says the rom ends in 150, being that it's the last file. let's say from 141 to 150, it's all FF (in hex). And finally, let's say the card size is 200.

According to the header, the unused space is from 151 to 200. Now this is true. What DSLazy/Trimmer does, it counts back from 200 until it finds a value not equal to 00 or FF. It should erase up to 151, but since the end of the last file has FF, it keeps going until 141. In some games, this might not cause a problem.

Now supposed the last file on the ROM is a sprite, and the developer sends a command to copy it the memory or whatever, maybe send it via wifi, anything. When it looks to send the file, it checks the FAT (file allocation table) and expects to read from 101 to 150, but in fact, the file has been truncated from 101 to 140. This might cause problems when it tries to read sector 141 as in, a crash. So I'm not going to truncate from the last file and any rom that has truncated files is flagged red in my program.

And then I later learned that the wifi data comes after the rom size and DSLazy / R4 Trimmer could be trimming that data.
FF and 00's are values (0x00 = Null, 0xFF = 255) and the other method could be erasing data which, as I said could crash/break your game.

i'ma post this in a new thread
 

kernelPANIC

Well-Known Member
Member
Joined
Nov 20, 2005
Messages
451
Trophies
1
Age
41
Location
Tokyo
Website
www.kanjiswipe.com
XP
1,830
Country
Japan
Many thanks for the program ShortFuse. With this I managed to add 2-3 games to my DS-X using just the trimming function.
A thankful end user bows down to you kind Sir (or Ma'am. Hopefully Sir)
 

ron555

Well-Known Member
Member
Joined
May 23, 2006
Messages
394
Trophies
0
XP
114
Country
Hey guys,

Here's another DS ROM Trimmer. Looks very promising

DS_Rom Tool v1.0

http://www.saveriorusso.com/public/ds/DS_RomTool.rar

DS-X Manager 0.24 works, but 0.26 is horrendously buggy and it doesn't even work properly (can't select folders; options are greyed out).

I recommend sticking with DS-X Manager0 .24 or using DS_Rom Tool. Looks very nice.


Anyone used DS_Rom Tool?
 

Louse76

Well-Known Member
Member
Joined
Jan 7, 2007
Messages
640
Trophies
0
Age
42
Location
Deltona, FL USA
Website
myspace.com
XP
253
Country
United States
What's up with these trimmers? I tried the R4 trimmer and got a certain size. Tried the DS-X trimmer, not the manager and got a different size. If trimming just takes off excess, how can there be such difference? About a 3 megabyte different. Which one is legit?


As much as it pains me to say this (GO TEAM R4! WOOHOOO!).. go with the DS-X trimmer. As the R4 provided one seems to be overtrimming some roms. It's all in the code, and in should only remove those empty bytes. But the program can get confused at times depending on how the code is written and by a rare chance.. delete something that is more than an empty byte.

The DS-X trimmer seems to have been tested properly and takes the 'safe' road rather than the 'unsafe'. Which means it only trims to a certain safe point.

Anyone actually trim with the R4 trimmer and have a problem, then trim with the DS-X manager instead and have it fix that problem?

Until I hear this, I'm going to stick with my R4 trimmed roms, as every single one has worked perfectly so far.
 

Louse76

Well-Known Member
Member
Joined
Jan 7, 2007
Messages
640
Trophies
0
Age
42
Location
Deltona, FL USA
Website
myspace.com
XP
253
Country
United States
Actually, I decided to give the DSX program a try.

I'm looking forward to a new version, as with this, the only option to output to a hard drive is to put it into a folder that it creates called "apps" on the root.

There's gotta be an option to put them in whatever output directory that you want in the future.
 

Louse76

Well-Known Member
Member
Joined
Jan 7, 2007
Messages
640
Trophies
0
Age
42
Location
Deltona, FL USA
Website
myspace.com
XP
253
Country
United States
Ok, I was using the newer 0.2.6.1 and it stopped working halfway through. It was pulling processor cycles and just stopped doing anything, no new roms were coming through.

I tried 0.2.4 and it gave me an error when I started, but I chose continue and it appears to be working fine right now. Also, I notice on this version that the bar at the bottom actually shows progress, where on the newer version it did not.

Thanks for the app though.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • BigOnYa
  • Xdqwerty
    what are you looking at?
    BakerMan @ BakerMan: i'm gonna start saying uninvoluntary to piss my dad off lmfao