Patching using xdelta

Discussion in 'NDS - ROM Hacking and Translations' started by Rob3rr, Feb 15, 2012.

  1. Rob3rr
    OP

    Rob3rr Member

    Newcomer
    23
    1
    Feb 15, 2012
    Hello, I am having some trouble with the 'New Super Mario Bros 3' patch. It comes with a program called xdelta which is used to patch the rom.

    After selecting the patch and source file then naming the new file, I press patch but nothing happens. I've tried renaming the rom and patch, but this changes nothing.

    It may be useful to know that I'm using Ubuntu 11.10 with Wine because .exe files cannot be natively run. However, I'm not sure that would be the cause of the problem; others seem to have similar issues, regardless of OS. In other cases from the threads I've read, the OP is recommended to try out a different patching program. This is difficult in my case because the patch is an .xdelta file, and I don't know if it'll work in other patching programs.

    I'm sorry if there's already an answer on the forum, but I did spend a reasonable amount of time looking before making this thread and couldn't find anything of use.

    Thanks.
     


  2. Rydian

    Rydian Resident Furvert™

    Member
    27,883
    8,102
    Feb 4, 2010
    United States
    Cave Entrance, Watching Cyan Write Letters
    When I was on linux I just did it CLI with the linux version, from the package manager I think.

    From my notes...

    Apply patch:
    xdelta -d -s old_file delta_patch patched_file

    I think that's the right one.
     
  3. Rob3rr
    OP

    Rob3rr Member

    Newcomer
    23
    1
    Feb 15, 2012
    Downloaded the linux CLI version. Your command didn't seem to work. xdelta help gives me:

    xdelta: usage: xdelta COMMAND [OPTIONS] [ARG1 ...]
    xdelta: COMMAND is one of:
    xdelta: delta Produce a delta from ARG1 to ARG2 producing ARG3
    xdelta: info List details about delta ARG1
    xdelta: patch Apply patch ARG1 using file ARG2 producing ARG3
    xdelta: OPTIONS are:
    xdelta: -v, --version Print version information
    xdelta: -V, --verbose Print verbose error messages
    xdelta: -h, --help Print this summary
    xdelta: -n, --noverify Disable automatic MD5 verification
    xdelta: -p, --pristine Disable automatic GZIP decompression
    xdelta: -m, --maxmem=SIZE Set the buffer size limit, e.g. 640K, 16M
    xdelta: -[0-9] ZLIB compress level: 0=none, 1=fast, 6=default, 9=best
    xdelta: -s=BLOCK_SIZE Sets block size (power of 2), minimum match length
    xdelta: In-core memory requirement is (FROM_LEN * 8) / BLOCK_SIZE

    So I tried this:
    cd Desktop
    xdelta patch New Super Mario Bros. 3.xdelta [psy-nsmb.nds [nsmbpatched.nds]]

    I get this response: xdelta: usage: xdelta patch patchfile [fromfile [tofile]]

    So I tried putting .nds on the end of the file I'm creating but I got the same message. Tried renaming the patch to patch.xdelta

    that gave me this:
    xdelta: patch.xdelta: bad magic number: not a valid delta

    EDIT: Tried patch --help, gave me this:

    Usage: patch [OPTION]... [ORIGFILE [PATCHFILE]]

    Input options:

    -p NUM --strip=NUM Strip NUM leading components from file names.
    -F LINES --fuzz LINES Set the fuzz factor to LINES for inexact matching.
    -l --ignore-whitespace Ignore white space changes between patch and input.

    -c --context Interpret the patch as a context difference.
    -e --ed Interpret the patch as an ed script.
    -n --normal Interpret the patch as a normal difference.
    -u --unified Interpret the patch as a unified difference.

    -N --forward Ignore patches that appear to be reversed or already applied.
    -R --reverse Assume patches were created with old and new files swapped.

    -i PATCHFILE --input=PATCHFILE Read patch from PATCHFILE instead of stdin.

    Output options:

    -o FILE --output=FILE Output patched files to FILE.
    -r FILE --reject-file=FILE Output rejects to FILE.

    -D NAME --ifdef=NAME Make merged if-then-else output using NAME.
    -m --merge Merge using conflict markers instead of creating reject files.
    -E --remove-empty-files Remove output files that are empty after patching.

    -Z --set-utc Set times of patched files, assuming diff uses UTC (GMT).
    -T --set-time Likewise, assuming local time.

    --quoting-style=WORD output file names using quoting style WORD.
    Valid WORDs are: literal, shell, shell-always, c, escape.
    Default is taken from QUOTING_STYLE env variable, or 'shell' if unset.

    Backup and version control options:

    -b --backup Back up the original contents of each file.
    --backup-if-mismatch Back up if the patch does not match exactly.
    --no-backup-if-mismatch Back up mismatches only if otherwise requested.

    -V STYLE --version-control=STYLE Use STYLE version control.
    STYLE is either 'simple', 'numbered', or 'existing'.
    -B PREFIX --prefix=PREFIX Prepend PREFIX to backup file names.
    -Y PREFIX --basename-prefix=PREFIX Prepend PREFIX to backup file basenames.
    -z SUFFIX --suffix=SUFFIX Append SUFFIX to backup file names.

    -g NUM --get=NUM Get files from RCS etc. if positive; ask if negative.

    Miscellaneous options:

    -t --batch Ask no questions; skip bad-Prereq patches; assume reversed.
    -f --force Like -t, but ignore bad-Prereq patches, and assume unreversed.
    -s --quiet --silent Work silently unless an error occurs.
    --verbose Output extra information about the work being done.
    --dry-run Do not actually change any files; just print what would happen.
    --posix Conform to the POSIX standard.

    -d DIR --directory=DIR Change the working directory to DIR first.
    --reject-format=FORMAT Create 'context' or 'unified' rejects.
    --binary Read and write data in binary mode.

    -v --version Output version info.
    --help Output this help.
     
  4. Rydian

    Rydian Resident Furvert™

    Member
    27,883
    8,102
    Feb 4, 2010
    United States
    Cave Entrance, Watching Cyan Write Letters
    xdelta -v
    To see what version was installed.
     
  5. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,294
    7,875
    Oct 27, 2002
    France
    Engine room, learning
    .xdelta are different than .patch files

    the .patch require the user to explicitly tell the file input and output names.
    The .xdelta file include different verrifications in the file, such as input and output filenames.
    If you placed all the files in the same folder, it will check for the correct filename (defined internally in the patch, so you may need to rename your original filename), and produce the patched file automatically.
     
  6. Rob3rr
    OP

    Rob3rr Member

    Newcomer
    23
    1
    Feb 15, 2012
    Slightly confused here.

    Have the xdeltaUI.exe program which came with the patch
    The CLI version for Linux (Which is version 1.1.3 Rydian)
    And Cyan, you want me to use xdelta3.0z.x86-32.exe which is the most recent Windows version?
     
  7. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,294
    7,875
    Oct 27, 2002
    France
    Engine room, learning
    You said you are using Wine so the most recent Windows version should be fine.

    As for Xdelta GUI, I tried two different GUI, only one worked with a patch for Loveplus NDS. Maybe try the other GUI, or try the command line.

    XDelta UI didnt work for me.
    I used this one : http://www.mediafire.com/file/ylwrdm4gmjz/psycoblaster_xDelta_GUI.zip

     
  8. Rob3rr
    OP

    Rob3rr Member

    Newcomer
    23
    1
    Feb 15, 2012
    Hi, I tried the gui you provided, but it didn't respond after clicking apply.

    However, I was able to get this one to work: http://thejbnet.com/progs/xgui/

    It's created the file, I've added the .nds extention and I will try it out and get back to you.

    EDIT: Success! So far it's worked perfectly. Thanks for all the help!
     
  9. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,294
    7,875
    Oct 27, 2002
    France
    Engine room, learning
    I'm glad you found a working one.

    Thanks for that other GUI :)
    It's always useful to have different tools.

    It's very bad that simple program need a lot of versions and tries from users to be able to patch a little file.
    It should be easy and straightforward.
     
  10. Rob3rr
    OP

    Rob3rr Member

    Newcomer
    23
    1
    Feb 15, 2012
    Maybe someone from here could create a more stable version that's compatible with multiple OSes? I've seen some of the amazing stuff people have created, so this shouldn't be too much of a challenge.
     
  11. Hyunckel

    Hyunckel GBAtemp Regular

    Member
    112
    10
    Mar 23, 2011
    Belgium
    Tried this one myself, which is the one provided in the folder of the NeoSoulSilver hack.


    Tried this one as well, and as soon as I click apply, I get an error similar to this one:

    [​IMG]
    Except instead of "index and count blabla" I get:

    "Could not find file 'C/Users/Myself/Desktop/xdeltagui/pokemonsoulsilver_patched.nds' "

    I have .NET Framework 4.0 installed. Tried installing 2.0, said it's already included in my Win7 install (which is 64 bits btw), tried to get the 3.5 but it's only 2MB and don't do jack when I double click it.

    I remember having to struggle against this stupid error some time ago, but don't remember exactly how I resolved it.

    Any idea ?
     
  12. Hyunckel

    Hyunckel GBAtemp Regular

    Member
    112
    10
    Mar 23, 2011
    Belgium
    I suppose nobody knows as even the mighty google gives me no clues.
     
  13. Rob3rr
    OP

    Rob3rr Member

    Newcomer
    23
    1
    Feb 15, 2012
    The best option would be to search around and find an alternative that works on your system.

    But maybe try to move the .nds file to a different location first? Or rename it to ROM.nds or something simple. It's worth a try.
     
  14. Hyunckel

    Hyunckel GBAtemp Regular

    Member
    112
    10
    Mar 23, 2011
    Belgium
    Well strangely enough, it seems at one time in my several attempts (maybe one of those that say nothing and seems to do nothing when I hit "patch")

    I have one patched backup on my desktop... Too bad after some blabla (neosoulsilver 3) I get a black screen. I suppose there is an AP from rudolphe to use beforehand sigh :/

    Think I'm just gonna replay Devil Survivor before the 2 is available in english (at last) instead, too much of a hassle tbh
     
  15. Alaude

    Alaude GBAtemp Regular

    Member
    197
    74
    Aug 2, 2010
    India
    Utopia
    i have found a way to patch to patch it in Ubuntu 11.10:

    Assuming you have .patch file to patch:
    xdelta patch (directory of patch) (directory of .nds file) (directory for the patched file to be stored)

    Assuming you have .delta file to patch:
    xdelta delta (directory of patch) (directory of .nds file) (directory for the patched file to be stored)
     
  16. servant

    servant GBAtemp Regular

    Member
    172
    29
    Jan 30, 2012
    United States
    This is a total necrobump but is there a way to patch gba rom. I'm attempting to play touhoumon and I'm using an .xdelta patch but the patcher I have only works with DS roms apparently. I typically don't see .xdelta patches for gba roms so I haven't had this problem and just relied on the stuff I already have.

    edit: I'd really just rather have a .ips patch of 1.53 or newer if any were available.
     
  17. Rydian

    Rydian Resident Furvert™

    Member
    27,883
    8,102
    Feb 4, 2010
    United States
    Cave Entrance, Watching Cyan Write Letters
    IPS can only patch stuff up to 16 megabytes, which is why xdelta and such got popular.

    Try using xdelta itself.
    http://xdelta.org/
     
  18. Sora de Eclaune

    Sora de Eclaune Baby squirrel, you's a sexy motherfucker.

    Member
    2,800
    624
    Feb 15, 2011
    United States
    123 Fake Street
    You actually found a Touhoumon patch? I could only find a prepatched ROM!
     
  19. Rydian

    Rydian Resident Furvert™

    Member
    27,883
    8,102
    Feb 4, 2010
    United States
    Cave Entrance, Watching Cyan Write Letters
    If you could get an unpatched ROM as well, you should be able to remake the patch from them (since a patch is a description of differences)..
     
  20. servant

    servant GBAtemp Regular

    Member
    172
    29
    Jan 30, 2012
    United States
    @ Rydian:
    Any file I should be looking for specifically? I've got the psycho one but it only works w/ .nds sized files and when I dwnlded the newest ver. from the site it won't seem to run on my computer.

    Yeah surprisingly the only thing I could find online was a patch but I'd willingly trade it for a prepatched rom if I could find one.