Patching GDI images

Discussion in 'Sega Dreamcast Development and Research' started by wombat, Jul 9, 2015.

  1. wombat

    wombat SEGA!

    Joined:
    Mar 14, 2004
    Messages:
    2,671
    Likes Received:
    319
    Dreamcast developer and fellow Assemblergames member @japanese_cake has made some really cool patches, among them are 60Hz/VGA enable-patches for the PAL versions of:
    • Resident Evil Code Veronica
    • Skies of Arcadia
    • Snow Surfers
    • WWF Attitude
    (download archive)

    1. Download the patch
    2. Download and install Phyton
    3. Download and unpack @Rocky5's Extract Re-Build GDI's package
    4. Place the folder of the game you want to patch inside the 'Extract Re-Build GDI'-folder (e.g. Skies of Arcadia Disc 1)
    5. Drag and drop the folder on 'Extract GDI image.bat' and wait till the process is finished
    6. Open the '-extracted' folder and replace the 1ST_READ.BIN with the patch from step 1
    7. Drag and drop the '-extracted' folder on 'Build truncated GDI image.bat' and wait till the process is finished

    ----

    Thanks for all the help @-=FamilyGuy=-, @S4pph4rad, @madsheep & @Rocky5!
     
    Last edited: Jul 10, 2015
  2. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,032
    Likes Received:
    891
    Use Sapharad tool to rebuild the gdi, and shrink it while you're at it!

    You should use gditools, check my signature. GDI2DATA is an old script I made that is normally included in my Selfboot pack. Gditools is (harder) better, faster (stronger) and gives you the sorttxt.txt file too.

    To build back the gdi should be easy for a 3-tracks game, but kinda harder for multitracks ones. It does seem like too much trouble for nothing though.

    Ideally, I'd convert the bin files to ISO (bin2iso included in the gditools project) and simply find the 1st_read.bin in the last track ISO and patch it in place. This is cleaner as it avoids extracting 1GB of unnecessary data.

    EDIT:

    Gdibuilder should be included in rebuild gdi here: http://sheep.host22.com
     
    Last edited: Jul 9, 2015
  3. wombat

    wombat SEGA!

    Joined:
    Mar 14, 2004
    Messages:
    2,671
    Likes Received:
    319
    Thanks a lot! Going to try this out, one step closer to a fully functional VGA compatible GDI-copy of Skies of Arcadia!
     
  4. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    313
    Likes Received:
    78
  5. wombat

    wombat SEGA!

    Joined:
    Mar 14, 2004
    Messages:
    2,671
    Likes Received:
    319
    @madsheep thanks for the upload!

    update: this is definitely harder then I expected. It seems that Skies of Arcadia Disc 1 doesn't have a IP.BIN? Rebuilded both disc 1 & 2, but none of them work, after the license screen it reboots and goes back to the GDMENU (other games do work, so it's definitely something I did wrong). Will continue experimenting with this some other day.
     
  6. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,032
    Likes Received:
    891
  7. LordFenixNC

    LordFenixNC Peppy Member

    Joined:
    Aug 24, 2014
    Messages:
    300
    Likes Received:
    72
    Dreamcast PAL S-U https://mega.co.nz/#F!OtFxGCRB!fwxmzjKOYMMJgpqTYXcjDw
    Skies of arcadia is up there im on work network and they wont let me view site and give you direct link.... but this is GDI from Trurip so hope that might help you in your quest. If it works please let us know and might try to get that from you and add to my collection.....
     
  8. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    Works for me. Is it just you, or does the site not work for anyone else?

    I check my email throughout the day, so I usually notice right away if it goes down. It hasn't been down in quite some time, as far as I've noticed.
     
  9. Rocky5

    Rocky5 Site Supporter 2015

    Joined:
    Jan 17, 2014
    Messages:
    524
    Likes Received:
    95
    I made a batch file that's drag & drop.
    (Can upload later if you want)

    You drag your game folder onto the batch it extracts the game files & the ip.bin to a new folder & then you can overwrite the 1st_read.bin, then you drag the extracted folder onto the build image (truncated) batch & it rebuilds your game, mutli CDDA tracks are handled automatically.

    I made it as I was modding Shenmue II, & got fed up of having to do it manually via the GUI, so drag & drop seemed easier.
    (I was converting the eng dubbed 1gb cdi's to GDI's, texture modding & adding new 0GDTEX.PVR images :D)

    It uses, Familyguy's & S4pph4rad's command line tools, credit is given.

    Download Extract Re-Build GDI's v1.2.zip
     
    Last edited: Dec 7, 2016
    SONIC3D and justice99 like this.
  10. yzb37859365

    yzb37859365 Spirited Member

    Joined:
    Jul 14, 2013
    Messages:
    187
    Likes Received:
    124
    If you just need to VGA, most games should be directly used 1st MSR file to guide production
     
  11. wombat

    wombat SEGA!

    Joined:
    Mar 14, 2004
    Messages:
    2,671
    Likes Received:
    319
    Thanks for all the help guys, I have finally managed to get disc 2 of Skies of Arcadia patched (I think my disc 1 is corrupted, will continue to work on that one later today Got disc 1 up and running as well. Hooray)!

    @Rocky5 your handy bat-files did the trick (fellow users, don't forget to install Phyton first, don't make the same mistake I did LOL), thanks for including the instruction-video as well!
    @-=FamilyGuy=- thanks for the feedback. I have not been able to get gditools up and running (get all sorts of errors), but luckily from within Rocky5's re-build pack it did work like a charm. Will continue some other time by using your vanilla version.
    @S4pph4rad yesterday I could not get the page to load on 2 different systems, today I can reach your website without any problems!
    @yzb37859365 thanks for the feedback, unfortunately for the 4 specific titles mentioned above this doesn't work that way
     
    Last edited: Jul 10, 2015
  12. SONIC3D

    SONIC3D Spirited Member

    Joined:
    Oct 30, 2008
    Messages:
    149
    Likes Received:
    33
    A quick fix to your batch scripts.
    1.I replaced all %~n1 with %~nx1 so that directory name with dot won't be truncated.
    (e.g:"Ikaruga v1.002 (2002)(ESP)(NTSC)(JP)[!]" in Tosec set is parsed as "Ikaruga v1" in original script which makes it failed to locate the ".gdi" file inside it.)
    I have tested the modified script with folder name contains multiple dot and multiple Chinese characters.Seems no more problem exists.

    2.I replaced line character in hyper ascii code with dash which displayed incorrectly in multi-byte language system(Chinese/Japanese/Korean).So that the splash screen won't be mis-formatted.

    UPDATE:Rocky5 has updated his build.Just download his pack at #9 post in this thread.
     

    Attached Files:

    Last edited: Jul 14, 2015
  13. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,032
    Likes Received:
    891
    @Rocky5 and @SONIC3D,

    Hey, just read that (for the first time) and I want to point out that you can extract the files and the ip.bin using a single line. Just add -b ip.bin to the line with --extract-all. Also, --silent would be preferable to >NUL as it'd still spit an error if there's one.

    e.g.
    tools\gditools.exe -i "%~nx1\%GDI%" -b "..\%~nx1 Extracted\IP.BIN" --data-folder "..\%~nx1 Extracted" --extract-all --silent

    Also, I don't know how the repacking is done, but the ip.bin shouldn't normally be with the data files. It shouldn't appear in the filesystem.
     
    Last edited: Jul 13, 2015
  14. SONIC3D

    SONIC3D Spirited Member

    Joined:
    Oct 30, 2008
    Messages:
    149
    Likes Received:
    33
    Yes,-b can be used with --extract-all but I found it will try to extract IP.BIN before other disc content extraction and if the target dir of IP.BIN does not exist,the program will crash(while it would be working ok if you extract disc content data only to an non-exist dir).

    And yes IP.BIN should not be extract to disk root content dir.I think it should be extracted to source gdi dir for better data organization and for future data resemble.And provide a independent bat file for clear it from the source gdi dir.But as I use this tool script for ripping dummy data,for GDEmu.So adding IP.BIN won't cause capacity increase.That's why I ignored it. =D

    Anyway,thank you for your great gditools!Really awesome tool!
     
  15. Rocky5

    Rocky5 Site Supporter 2015

    Joined:
    Jan 17, 2014
    Messages:
    524
    Likes Received:
    95
    Like above, your tool errors out if the target directory doesn't exist before the extraction starts, I could create the target directory prior, but I let your tool do it.

    Code:
    if not exist "%~nx1 Extracted" MD "%~nx1 Extracted" >NUL
    tools\gditools.exe -i "%~nx1\%GDI%" --data-folder "..\%~nx1 Extracted" -b "..\%~nx1 Extracted\IP.BIN" --extract-all
    Also the IP.BIN is placed in the extracted directory as it clean way of storing the file & also has no adverse affect to the creation or running of the .GDI.

    I updated the original link, with changes & a updates.txt
    Code:
    [Updates]
    
    1) Changed ASCII Splash screen, to use - instead of Ä.
    
    2) Made the Extract batch create the extracted folder & then extract the IP.BIN along with the rest of the files.
    (a one liner)
    
    3) Changed the batches to use %~NX1 so folders with "." will be handled correctly.
    (None of my games folder have "." as there all named after each game name)
     
    Last edited: Jul 14, 2015
  16. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,032
    Likes Received:
    891
    Fixed it. Up to date code is on sourceforge: https://sourceforge.net/projects/dcisotools/
    I don't know how it was converted to exe though. It should work with python 2.7 on any platform.
    I suggest pythonxy for windows users.


    One way to do it without adding the ip.bin to the filesystem would be to drag and drop the gdi file even on the script to rebuild the game and store the ip.bin in the gdi dump folder or extract it on the fly. You could also put it in another folder reserved to bootsectors with a filename like "%~nx1_IP.BIN".

    Just a suggestion though!

    You're very welcome. I'm glad people find it useful :)
     
    Last edited: Jul 14, 2015
  17. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    313
    Likes Received:
    78
  18. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,032
    Likes Received:
    891
    Could you please tell me the relative performance of the exe versus the .py? Can you try compiling with Nuitka and look at the performance (on linux it's ~ the same)?

    I made a lot of efforts to optimize the performance (~10x from initial code) and I wonder how much is lost in the exe convertion.
    I think it's nice to have an exe for the casual users though, thank you for that.
     
    Last edited: Jul 14, 2015
  19. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    313
    Likes Received:
    78
    i used this bat file:
    for the .exe
    Code:
    @echo off
    set startTime=%time%
    gditools.exe -i "" -o ""  --extract-all
    echo Start  Time: %startTime%
    echo Finish Time: %time%
    @pause
    for the .py
    Code:
    @echo off
    set startTime=%time%
    gditools.py -i "" -o ""  --extract-all
    echo Start  Time: %startTime%
    echo Finish Time: %time%
    @pause
    game: Capcom vs. SNK 2 - Millionaire Fighting 2001 v1.001 (2001)(Capcom)(NTSC)(JP)(en)[!]
    time of execution ~11.5sec (on my pc)
    time of execution is the same for py and exe maybe 1sec difference

    about Nuitka i think i tasted this solution before creating my RebuildGDI program and i ended using py2exe because it puts all the libs in 1 file and the python27.dll so it is more compact. on linux i dont know
     
  20. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,032
    Likes Received:
    891
    Thanks! Glad to see the performance is not affected! On my computer using a SSD Sonic Adventure extracts in under a second!

    I think nuitka can put everything in a single exe now though.
     
    Last edited: Jul 14, 2015
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page