ROM Hack How do I Patch AND trim a NDS rom?

Auryn

Well-Known Member
Member
Joined
Jul 21, 2011
Messages
559
Trophies
1
Age
51
XP
707
Country
Swaziland
3161447_m.jpg



OR
if you have to ask how to patch the rom, you don't have the rights to play it.
 

basher11

Well-Known Member
Member
Joined
Jun 29, 2009
Messages
4,385
Trophies
1
XP
571
Country
United States
usually patches trim the rom for you.
but as ivobhz said, trim after patching if it doesn't trim for you.
 

Hebon

Dabbling in the videogamagical
OP
Member
Joined
Mar 10, 2011
Messages
146
Trophies
0
XP
192
Country
United States
The problem with trimming after I patch is that the trimmer seems to think that the size of the patch itself is how big the rom can be trimmed down to. For example; if I have a 64MB game and it can normally be trimmed down to 52, but I had applied a 1MB patch, the trimmer says it can be trimmed down to 1MB.
 

shadowmanwkp

Your roms are on another rom site
Member
Joined
Apr 17, 2008
Messages
486
Trophies
0
Age
32
Location
Vleuten, The Netherlands
XP
246
Country
Netherlands
If you patch a game, usually the patch maker has used junk bytes in the rom to make the patch. Because trimming removes those junk bytes, applying a patch afterwards will always fail, unless the patch maker has taken this into account. By modifying the rom, the header and other data will also be altered, thus if you trim afterwards, the trimming utility doesn't recognize the rom properly and it will result in a broken rom. Patch makers will usually trim the rom to the right size after making a patch, so you don't need to. If you really want to be certain that the game is trimmed, even though you've patched, you can open the rom up in a hex editor and remove all 00 or FF bytes at the end (do this at own risk though)
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,795
Trophies
3
XP
28,452
Country
United Kingdom
That might be true on the GBA shadowmanwkp and I can not speak for pokemon (of which most of the hacking work is done with premade tools) and some of the tool driven hacks (thinking the likes of the mario level editors) but most full blown hack projects will either inject files back into the rom in place (quite OK to trim), properly repoint the modded files (should still be OK), rebuild the rom (most rebuild tools tend not to add the stuff that is trimmed back in) and generate a patch for it or rebuild the rom as part of the patching process (again will likely not have anything worth trimming).

On the flip side some patching methods will add in any extra space if they need but it can also trouble some patching methods (no real idea why but it does) so theoretically you could come at it the other way and trim then patch. At all times you should be prepared to force the patching method to ignore and initial file difference (xdelta and bsdiff are pretty keen on this).
 

Hebon

Dabbling in the videogamagical
OP
Member
Joined
Mar 10, 2011
Messages
146
Trophies
0
XP
192
Country
United States
If certain patchers also trim, does the xdelta patcher fall into that category?
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,795
Trophies
3
XP
28,452
Country
United Kingdom
Most hackers will find the files they want to edit, edit them accordingly and repack the rom before generating a patch to turn the original rom into the repacked rom (occasionally you get roms that do not like this and hacks that are just a few bytes being changed rather than added so the rebuilding part might change a bit but that does not really concern you as the end user unless you have a bad flash cart). This repacking stage is what does the trimming side of things if any is to be done.

xdelta and bsdiff are the two main methods to build patches for end user distribution with and they come from the general file patching world and as such they know nothing of DS roms (certain hacks like the Jump Ultimate Stars translation can work with the DS file system but again we are drifting back into actual hacking related issues)- they replace bytes that have changed and if you have shifted a part of the file around (as rom rebuilding tools are wont to do) they will try to match it up with the new location as well (one of the reasons we no longer use IPS for rom patching is that it can not do this) as well as remove anything from the file if it is not there any more. Naturally all this requires fairly extensive computing ability (somewhat analogous to compression) which is one of the reasons for having so many formats and why patches can end up quite large (they might fail to see a swap/shift and assume it is just a change and pack in the "change" accordingly) but this is getting off topic once more. The check thing stems from the general patching world so as to prevent people from applying the patch to the wrong backup or version of the file (rather than back everything up all the time most of these sorts of things were built to allow just the changes to be stored).
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Who cares as long as you can see sweat dripping from the nipple
  • Veho @ Veho:
    As long as you can see SWEAT RUN DOWN MA BALLS (MA BALLS) ALL YOU BITCHES CRAWL AWW SKEET SKEET MOTHERFUCKER
    +1
  • K3Nv2 @ K3Nv2:
    All I see is hair shave that damn thing :angry:
  • Veho @ Veho:
    Nah, that's more JuanMena's thing. I go for the bear look.
  • K3Nv2 @ K3Nv2:
    Hairy feet who needs viagra
  • The Real Jdbye @ The Real Jdbye:
    @K3Nv2 we
    don't want to see anything dripping from your nipples
  • K3Nv2 @ K3Nv2:
    Yet here you are thinking about my nipples
  • The Real Jdbye @ The Real Jdbye:
    hard not to when you put that mental image in my head
  • K3Nv2 @ K3Nv2:
    I never said my nipple I said the nipple therefor you think about my nipples on your own free time
  • K3Nv2 @ K3Nv2:
    Too unrealistic missing both ears
  • Veho @ Veho:
    That's after the second attempt.
  • Veho @ Veho:
    ...I said too much.
  • K3Nv2 @ K3Nv2:
    It's best we keep him in ac
  • K3Nv2 @ K3Nv2:
    My electric company is sending out a free Google thermostat our state finally passed some deals where homes can get them free depending on area
  • Veho @ Veho:
    What the fuck is a Google thermostat?
  • Veho @ Veho:
    So it's like a thermostat, but expensive.
    +1
  • K3Nv2 @ K3Nv2:
    You can adjust temps from your phone also so useful if you're out and want to turn it off but hey it's free for me
    +1
  • The Real Jdbye @ The Real Jdbye:
    @Veho never heard of Google Nest?
  • Veho @ Veho:
    No. I'm stuck in the 90s.
  • BigOnYa @ BigOnYa:
    Google devices suck, and they steal all your info, of course Amazon does the same
  • K3Nv2 @ K3Nv2:
    Oh Herr durr mah precious info please do not steal for the 80th time this year
    K3Nv2 @ K3Nv2: Oh Herr durr mah precious info please do not steal for the 80th time this year