How to make a NDS rom patch ?

Discussion in 'NDS - ROM Hacking and Translations' started by SpyMaster, Feb 7, 2008.

Feb 7, 2008
  1. SpyMaster
    OP

    Newcomer SpyMaster Member

    Joined:
    Jan 29, 2008
    Messages:
    29
    Location:
    France
    Country:
    France
    I ask you how to make a patch !

    I'm a member of a translation team and I modified some files in the rom with DSlazy. We want to make a patch to change the files in the rom without the software because we don't want to up the modified rom.
    Can you help me ?
    I would like to make a patch like deufeufeu's JUS rom patcher.

    I'm french ! You could speak french ? So speak french !

    Thanks !
     
  2. arctic_flame

    Member arctic_flame GBAtemp ATMEGA8 Fan

    Joined:
    Nov 4, 2006
    Messages:
    2,840
    Location:
    England land
    Country:
    United Kingdom
    Use bsdiff.
     
  3. SpyMaster
    OP

    Newcomer SpyMaster Member

    Joined:
    Jan 29, 2008
    Messages:
    29
    Location:
    France
    Country:
    France
    Can you explain me how to use it please ? [​IMG]
     
  4. acidrain

    Newcomer acidrain Advanced Member

    Joined:
    Nov 17, 2006
    Messages:
    97
    Location:
    Montreal, Qc
    Country:
    Canada
    It's a command line program.
    To create a patch, type in a command prompt:
    bsdiff.exe base_rom modified_rom patchfile
    and it will create the patch.

    To patch a file, it's the same thing, except you use bspatch.exe

    You can download the windows version here
    If you use linux, it should come with your distribution.

    Ou si tu préfères en français
    Dans une invite de commande, tapes
    bsdiff.exe rom_de_base rom_modifie nom_du_patch
    pour créer le fichier patch

    Pour appliquer le patch, c'est la même commande, mais utilise bspatch.exe

    Tu peux downloader ces programmes en version windows ici
    Si tu utilises linux, ces programmes devraient être inclus avec ta distribution.
     
  5. SpyMaster
    OP

    Newcomer SpyMaster Member

    Joined:
    Jan 29, 2008
    Messages:
    29
    Location:
    France
    Country:
    France
    I launched the application with my CMD.

    How many time does it work (files sizes are about 42-43 Mo) ?


    In French :
    J'ai lancé l'application avec l'invité de commande !
    Combien de temps ça va me prendre pour des fichiers de 42-43 Mo ?


    EDIT : The program works ^^ I've got the patch [​IMG]

    Thanks acidrain ^^


    Is it not a easier program ? I know some people who can't use the CMD ! Help me please ! Thanks !

    In French :
    N'existe-t-il pas un programme plus simple ? Je connais certaines personnes qui ne savent pas utiliser l'invité de commande ! Aidez-moi SVP ! Merci !
     
  6. acidrain

    Newcomer acidrain Advanced Member

    Joined:
    Nov 17, 2006
    Messages:
    97
    Location:
    Montreal, Qc
    Country:
    Canada
    An ips patcher like Lunar IPS would be much easier to use. There's a GUI and can both create and apply patch files.

    Un patcher ips comme Lunar IPS serait effectivement beaucoup plus facile à utiliser. Il a une interface graphique et peut créer et appliquer des patches.
     
  7. arctic_flame

    Member arctic_flame GBAtemp ATMEGA8 Fan

    Joined:
    Nov 4, 2006
    Messages:
    2,840
    Location:
    England land
    Country:
    United Kingdom
    If you make many changes to the file, IPS patches may be massive, as they don't use a very intelligent method of patching.
     
  8. setya5785

    Member setya5785 GBAtemp Regular

    Joined:
    Jan 11, 2008
    Messages:
    154
    Country:
    Indonesia
    IPS cannot address changes above the 16MB mark.
    use newer patcher program such as xDelta or Ninja.
    basicly, a patcher compare 2 file and search for data differences.
    both delta and Ninja don' have issue with large files. i personally recommend Ninja, since it use XOR so a pacther file can either be use to patch or restore a patched file its former condition.

    you can get info and download on Ninja here
     
  9. deufeufeu

    Member deufeufeu GBAtemp Advanced Fan

    Joined:
    Nov 21, 2005
    Messages:
    880
    Country:
    Cote d'Ivoire
    traditional patch system works under the assumption that only some data as at given location was changed and the rest was kept. This does not work for nds roms because as soon as you've changed the filesystem everything is moved in the rom. This is why you get big patch files, because you are including almost all the filesystem in the patchfile.
    To resolve this I've develloped a quick and dirty solution : dps patches. A dps patch tells how to rebuild the new rom from the original one by just relocating some data and inserting data included in the patch. To make a dps patch you could write a bruteforce program, but the better method is to have it generated by the program you've written to modify the rom.
    It's not that hard, but if you have problems with command prompt I guess it would be too hard for you. By the way, it answers the pm you sent me.
     
  10. SpyMaster
    OP

    Newcomer SpyMaster Member

    Joined:
    Jan 29, 2008
    Messages:
    29
    Location:
    France
    Country:
    France
    I don't have problem with the command ^^.

    But I want to diffuse the patch ! And some users don't know how to use the CMD ! If they don't know how to patch the rom file, they won't be able to play with the modified game [​IMG] .

    Help me please [​IMG]
     
  11. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,737
    Country:
    United Kingdom
    Batch file perhaps? if a user can not double click something then they probably do not need to play it.
     
  12. SpyMaster
    OP

    Newcomer SpyMaster Member

    Joined:
    Jan 29, 2008
    Messages:
    29
    Location:
    France
    Country:
    France
    YEEEEEAH ! I forgot the batch files !

    I'll do it, thanks !
     
  13. deufeufeu

    Member deufeufeu GBAtemp Advanced Fan

    Joined:
    Nov 21, 2005
    Messages:
    880
    Country:
    Cote d'Ivoire
    Batch file is not so noob proof, the only thing really noob proof is a small gui window with a choose file dialog...
     
  14. acidrain

    Newcomer acidrain Advanced Member

    Joined:
    Nov 17, 2006
    Messages:
    97
    Location:
    Montreal, Qc
    Country:
    Canada
    It's funny you're talking about that, I made one in java yesterday for bsdiff.
    Everything is included, just double-click bsdiff-gui.jar
    bsdiff-gui.zip

    EDIT: I could make a version for dpspatcher too if someone is interested, would take me 5mins.
     
  15. deufeufeu

    Member deufeufeu GBAtemp Advanced Fan

    Joined:
    Nov 21, 2005
    Messages:
    880
    Country:
    Cote d'Ivoire
    but assuming java is installed is not really noob proof [​IMG]
     
  16. acidrain

    Newcomer acidrain Advanced Member

    Joined:
    Nov 17, 2006
    Messages:
    97
    Location:
    Montreal, Qc
    Country:
    Canada
    Yeah, I know it's not the perfect solution, but it was the easiest way for me to make a cross platform gui (I'm using linux).
    I guess I could make something in C/C++ but I don't know any way to code a cross platform gui without having to install libraries (like gtk or qt). If you know a way, I'd be very interested [​IMG]
    edit: I guess I could zip my program with the required dlls...

    And maybe I'm wrong, but I think that most people already have java installed.
     
  17. deufeufeu

    Member deufeufeu GBAtemp Advanced Fan

    Joined:
    Nov 21, 2005
    Messages:
    880
    Country:
    Cote d'Ivoire
    Yes here comes my main problem. I'm not using windows, and to make lightweight programs you have to directly make a win32api program...
    Java is no more preinstalled on windows since the argument between sun and microsoft. So java is not all around the place.
    But if you compare installing java with installing the latest version of the runtime for .Net, that people like to use to make dead simple programs... I think it's on par.
     
  18. acidrain

    Newcomer acidrain Advanced Member

    Joined:
    Nov 17, 2006
    Messages:
    97
    Location:
    Montreal, Qc
    Country:
    Canada
    I'm also not using windows, and I want something that can run on both Linux and Windows (and OSX if possible) so I can't use either win32api on .NET.
    I'm giving a try in C++ with Qt4. Linux users will need to install Qt4 (if it isn't already), which shouldn't be a big problem. And I can simply give the Qt dlls for the windows release.
    This seems to be the best solution for multi platform.
     
  19. SpyMaster
    OP

    Newcomer SpyMaster Member

    Joined:
    Jan 29, 2008
    Messages:
    29
    Location:
    France
    Country:
    France
    Finally, I tried two solutions :

    - I make a batch file who use bsdiff.

    - I make a *.rup patch file with Ninja [​IMG]

    These solutions work and they are simple to use !

    Thanks all ^^
     

Share This Page