GDIBuilder - Tool for building GDI data tracks

Discussion in 'Sega Dreamcast Development and Research' started by S4pph4rad, Dec 3, 2014.

  1. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    I've released a new tool, designed to assist with building GDI images. Work on this was previously mentioned in my old thread on the topic. Since I can't rename that thread to reflect the completion of that research, here's a new thread specifically for this tool now that it's finished. This tool was the result of my interest in making some modifications to an existing title, and discovering that nobody had built GD-ROM images from scratch before.

    Here are direct download links for v1.2:
    Windows version
    Mac OS X version
    Command-line version

    Source code is available on GitHub.

    As detailed in the other thread, it seems that all GD-ROM's require the 1ST_READ.BIN to be located at a specific LBA. Rather than forcing you pad and slice images manually to get things where they need to be, this will generate the track03.bin (and final data track if you have CDDA) then provide the line(s) you need to use in your .gdi file for those tracks. The resulting image will boot on an emulator or a Dreamcast with a drive emulation board like GDEMU. The advanced options window allows you to specify the volume information, which games don't seem to look at or care about. (I could be wrong)

    This is probably only useful for mods, as it doesn't make sense to build a 1GB image for homebrew.

    Project page is here:
    http://projects.sappharad.com/tools/gdibuilder.html

    I'm hoping someone else will find this useful. At this time, it meets all of my needs so I'm not sure if I'll update it. Feedback is always appreciated, maybe there are some other situations that this could help with and additional functionality would help someone. If so, I can consider additional changes. Source code is provided in case someone wants to make their own changes or include the functionality in another application. Note that the main executable name is read out of IP.BIN, so this should work for discs where 1ST_READ.BIN is not the main program. That being said, this won't patch your IP.BIN other than the TOC for disc tracks, so make sure you use the one you want.

    Screenshot:
    [​IMG]
    Version 1.2 adds the truncate option to "Advanced Options", if you don't want to build 1GB discs every time. It's not "the right way" to do things, so if you want to use it you'll have to try to see if it's compatible with the hardware or software that you're using to run the resulting image.
     
    Last edited: Mar 28, 2015
    SiZiOUS, Woofmute and nodezero like this.
  2. PrOfUnD Darkness

    PrOfUnD Darkness Familiar Face

    Joined:
    Mar 13, 2004
    Messages:
    1,121
    Likes Received:
    48
    Congrats! Amazing tool!
     
  3. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    Good job sir!

    I believe it's c# code... Any way to compile this on linux? Also, would a cli binary be hard for you to produce? I'm working on a python program to easily extract files from gdi (almost done now, only need to pretty up the code a little) and both our tools together could be of great use to people working on translations or mods.
     
    Last edited: Dec 3, 2014
  4. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    The Windows version should run out of the box on Linux using Mono. Mono supports windows forms apps under Linux and OS X. The Mac version runs fine on mono too, but I built a native UI for that so it's OS X specific. If you really want to compile it on Linux instead of running it directly via Mono, you can download MonoDevelop and open the .sln project in there then hit run. It should just work.

    Yeah, a command line version would definitely be possible. I'll throw something together over the weekend.
     
    Last edited: Dec 3, 2014
  5. RaZiel

    RaZiel Enthusiastic Member

    Joined:
    Oct 30, 2008
    Messages:
    541
    Likes Received:
    85
    Used this to rebuild Magic the Gathering GDI. Seems the English cards are on the disc and ready for localization. Not all the game is translated but enough to understand now. Just swapped the English deck not used with the JP file names, rebuilt, tested and working. Thanks for this awesome tool. Had to build CDI before with CDDA tracks.
     
    Last edited: Dec 4, 2014
  6. GillBert

    GillBert Spirited Member

    Joined:
    Jul 26, 2012
    Messages:
    101
    Likes Received:
    39
    Very interesting! I'll try this out soon.

    I'm wondering if it could be useful for rebuilding some games which don't work on G1-ATA mod?
     
  7. kuze

    kuze Peppy Member

    Joined:
    Sep 28, 2011
    Messages:
    371
    Likes Received:
    6
    This is awesome, thanks for putting it together and releasing it!
     
  8. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    313
    Likes Received:
    78
  9. keropi

    keropi Familiar Face

    Joined:
    Feb 2, 2011
    Messages:
    1,068
    Likes Received:
    64
    could this be used to create a GDI image from a game like GunLord?
     
  10. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    In general, no. I'm not familiar with this specific game, but commercial homebrew has its own copy protection to ensure it's running from the original CD-ROM. That would be the biggest reason.
    Second reason, most homebrew and unlicensed commercial DC games are built with KOS, which intentionally lacks the ability to read GD-ROM discs. (This part may not be an issue since the drive is already reading GD-ROM, but I haven't done anything to find out.)

    It may be possible for someone to hack a CD-ROM title for running from a GD-ROM, but I wouldn't expect one to work out of the box.
     
  11. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    Not without modifying the bootsector (ip.bin) and maybe the binary of the game too. It surely CAN be done, with enough hacking, but it won't be straightforward.

    Also keep in mind that it's wrong to pirate indie games, but it'd be justified to do so if you got the original and wanna use it on gdemu IMO.
     
    Last edited: Dec 5, 2014
  12. keropi

    keropi Familiar Face

    Joined:
    Feb 2, 2011
    Messages:
    1,068
    Likes Received:
    64
    ^ exactly, I have MNEMO's usb board and cannot run the game. I guess I'll have to wait for CDI support so the download versions will run.
    thanks for the info on this S4pph4rad and -=FamilyGuy=-
     
  13. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    I updated the OP with a link to a new command-line version that -=FamilyGuy=- wanted. Just run it without any arguments to get usage information.
    http://projects.sappharad.com/tools/gdibuilder10_cmd.zip

    There are some minor differences compared to the UI version that I felt were necessary if you wanted to call it from a batch script, those all deal with output. In the command line version, you can specify either a directory for output like the GUI, or the filename(s) for the data tracks. So if you have no CDDA, you'd use -output track03.bin to get track03bin, if you had CDDA you might want something like -output track03.bin track99.bin
    There's also an optional -gdi argument in the command-line version. If the argument is not present, it works like the GUI and spits out the lines for your GDI. If the argument is present, and points to an existing GDI file, the GDI file will be updated with the new track information. If the argument is present and the file does NOT exist, I output the lines for track03 and up so you'll need to add track01 and track02 later if you want a valid .gdi file.

    This should hopefully be good enough for anything you want to do with it.

    Random note: I would've used the username Sappharad if the forum allowed me to register that. It's not taken, but the registration page wouldn't allow it to be used. Would be nice if a mod could rename me to the username I actually wanted.
     
  14. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    313
    Likes Received:
    78
    What happens if you start the "Dreamcast DC SD Ripper" and rip the disk as GDI?

    i mean mount the cdi to GDEMU or use a burned cd with the homebrew cdi
     
    Last edited: Dec 6, 2014
  15. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    That won't work.

    A real GD-ROM drive can tell when a disc is a CD-ROM or a GD-ROM, so that the BIOS knows when to boot as MIL-CD and when not to. If the drive emulator you're using is taking a GDI file, it's always going to tell the BIOS it's a GD-ROM and try to boot it that way. If you rip a CD-ROM as a 1:1 GDI image, the game won't boot because it'll try to boot as a GD-ROM.
    1. The IP.BIN is still programmed for MIL-CD, so it'll expect the 1ST_READ.BIN to be scrambled that way. (Or have the code to descramble. An actual GD-ROM won't be scrambled.)
    2. The 1ST_READ.BIN won't be located in the correct LBA for a GD-ROM, so the disc won't boot.
     
  16. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    Just to reword what sapharad said in layman's terms: if you're dumping a CD or CD-image with the sd-adapter, you won't be able to output a GDI. The DC knows the difference.

    BTW thanks for the CLI version sapharad. I'll have my first release of gditools.py ready in a few days (only need to write the usage and make some examples). Could I ask you to make a .exe out of it using py2exe for Windows users that might have trouble installing Python? (I don't have access to Windows on a regular basis.) Both our tools used together could be automated to extract a GDI, apply mods and rebuild it quite easily, perfect for modders or people working on translations.
     
    Last edited: Dec 6, 2014
  17. madsheep

    madsheep Peppy Member

    Joined:
    Jul 19, 2013
    Messages:
    313
    Likes Received:
    78
    i thought that the GDI is a container and can rip any CD-GD-ROM i don't know how emulators work exactly if they hack the loading process

    @-=FamilyGuy=-

    yes i know but i want to load cd rom over gdi format
     
    Last edited: Dec 6, 2014
  18. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    The problem is that a GDI is meant to represent a gdrom. It's not a container as much as a descriptor, so yes you could represent a burnt cd-rom using a GDI, but the emulator then doesn't know to emulate a CD or a GD in this case and the two booting algorithms are really different in both cases.

    tl;dr:
    The GDI format was never though for cd-rom and thus lacks some info to allows a gd-rom emulator to mimic a CD using it.
     
  19. S4pph4rad

    S4pph4rad Site Supporter 2015

    Joined:
    Nov 28, 2014
    Messages:
    140
    Likes Received:
    114
    I'd be willing to do that for you, sure, although I've never used py2exe before. Windows isn't my primary OS either, but I do have a couple of Windows VM's for development purposes.

    Edit: There's a bug in the command-line build I posted. If you output to a specified filename it works fine (since that feature was exclusive the command line, I actually tested it) but if you output to a directory it crashes. That will be fixed in an update soon, and I'll be adding support for raw 2352 image output to all versions as well. (It's optional, since it's not necessary and just makes images bigger.)

    Edit 2: Released version 1.1. New builds for Win, Mac, and Command Line.
    New in all 3 versions is RAW mode, which outputs 2352 byte per sector data tracks instead of 2048. This just makes the output larger and take longer to generate, but maybe it's less work for GDEMU since it won't need to generate the RAW sectors internally? The UI's have a checkbox for it, and for command line add -raw as an argument.
    Also new in the GUI versions, if disc.gdi exists in the output folder, it will automatically be updated with the new track information so you don't need to do it manually. If it does not exist, then you'll still need to put it into your .gdi manually.

    Enjoy!
     
    Last edited: Dec 6, 2014
  20. RaZiel

    RaZiel Enthusiastic Member

    Joined:
    Oct 30, 2008
    Messages:
    541
    Likes Received:
    85
    Just rebuilt Space Channel 5 Part 2, ripped AFS files at part and replaced with English files from PS2 and now I have a working fully translated GDI of this game with proper buttons from the DC version and not using the PS2 symbols (thanks BRaZE) by swapping the files inside of the AFS instead of just replacing the files with the PS2 counterparts.

    I'm going to attempt some GTA2 mods I have finally gotten to work from CDI as well as translations for Super Street Fighter 2X, Super Puzzle Fighter 2x, Frame Gride, Advanced War and a few others. Does anyone know if the DC can playback SFD files with 48k instead of 44.1k from PS2/GC ports of DC games?

    I have the digital audio mod done to one of my G1-ATA decks and wanted to see if they would playback? I seem to recall Tux doing this for one of his rips but I don't have any downloaded CDI files anymore nor can I find the split release. I believe it was in fact Space Channel 5 Part 2. Going to try some of the files I have from my PS3 PSN variant I have on my PS3, I managed to copy all the files to my USB drive using mMOS. Just don't know if the DC can playback files above the 44.1k frequency. But 48k doesn't seem to far off and might not make much of a difference except on a high end audio receiver.

    Edit

    And DC SD Ripper can't dump CDI unless maybe you mean the DS version of which I have never used. But yea Gunlord's 1st_read LBA is 11702 so some manual work would need to be done to convert from a Mode2 Mil-CD to a Mode1 GD-ROM.
     
    Last edited: Dec 9, 2014
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page