Patching GDI images

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!
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
Thanks a lot! Going to try this out, one step closer to a fully functional VGA compatible GDI-copy of Skies of Arcadia!
Uploaded the gdibuilder12_cmd.zip & gdibuilder12_win.zip here
http://sheep.host22.com/_Other/
@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.
You should use gditools, it'd spit you an ip.bin

You're sure the dump is clean?
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.....
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.
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
If you just need to VGA, most games should be directly used 1st MSR file to guide production
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
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.
@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.
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!
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)
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 :)
py2exe
compiled to exe: http://sheep.host22.com/_Other/gditools_20150714_exe.rar
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.
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
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.

Original thread: https://assemblergames.com/threads/patching-gdi-images.57271/