WIT (Wiimms ISO Tools) GameCube disc support

Discussion in 'Wii - Hacking' started by Wiimm, Sep 1, 2010.

Sep 1, 2010
  1. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    WIT (Wiimms ISO Tools) GameCube disc support

    In the thread WIA = Wii ISO Archive WiiPower ask me to support GameCube disc and we have a little discussion. Today I have released the first WIT with GameCube support. And because GameCube support is offtopic in the WIA thread, I startet a new one (this).

    The important posts:

    State of the art:
    • The internal ISO interface is now able to work with GameCube discs. GameCube discs are supported as a decrypted Wii image with exact one DATA partition. Because of this simulation all commands support GameCube discs without special code.
      .
    • GameCube discs can be stored as PLAIN ISO and within all supported containers (WDF, WIA, CISO, WBFS).
      .
    • Scrubbing support is also available but must be tested.
      .
    • Extracting files from a GameCube disc works, but not composing a GameCube disc.
      .
    • Please consider: The GameCube support is experimental!
      .
     
    tmv_josue likes this.


  2. W hat

    Member W hat Rhythm Heaven Fan

    Joined:
    Feb 28, 2007
    Messages:
    606
    Country:
    United States
    Multiboot, scrubbed, and multiboot discs of scrubbed ISOs don't always work on Wii softmods, to my knowledge. Can anyone confirm?

    Of course, some GC games don't work at all on softmodded Wiis.
     
  3. WiiPower

    Member WiiPower GBAtemp Guru

    Joined:
    Oct 17, 2008
    Messages:
    8,165
    Country:
    Germany
    To NeoGamma's GC loader it doesn't matter if the game is a single game disc or if it's on a multi game disc(worst thing is slower reads on a multi game disc, but that would require the games to be not aligned at least at 2KB). What matters is if the .iso was shrunken. If that's not done properly(i guess most tools don't do it properly), then audio streams are not correctly aligned and the game gets an error when it's supposed to play that stream. But this only affects games that acutally have audio streams, about 90% have the audio streaming bit set, but only 10-30% really have audio streams.
     
  4. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    so if i have a GC iso that is shrunken using the older tools that didnt align all the stuff properly, what command would i use in wit that would cause it to copy the iso and fix the offsets?
     
  5. WiiPower

    Member WiiPower GBAtemp Guru

    Joined:
    Oct 17, 2008
    Messages:
    8,165
    Country:
    Germany
    I think that's exactly the function that's not implemented yet. If you would use the old fstfix with the option t on the .iso it should be fine. I wonder why there are still tools around that do crap when there are working tools for years now. Anyways, when Wiimm finishes his stuff, it will hopefully be superior to everything and you won't need any other tool again.
     
  6. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    I'm still working on that ... options and data structures already defined
     
  7. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    What's about multiboot?
    How the partitions are linked together?
    Is there a special header?


    And here are my trimming plans:

    First I plan the option "--trim keylist" with three trimming types for both Wii and GC discs:[*] Move partitions within discs. Fake signing is not neccessary (Wii).
    GC igore it (or not if I know how multiboot is working).
    .
    [*] Move sector groups (Wii) or sectors (GC) within partitions.
    The aligning of files keeps stable.
    Wii: Only hashes H3 and H4 are modified but neither sector hash values nor encryption.
    .
    [*] Move files within sectors+partitions. The option --align defines aligning values.
    Wii: Decryption and encryption will slow down the trimming.
    .All three trimming method can be combined. The additional keyword ALL selects all methods and the additional keyword FAST selects only the fast methods (all but files).

    And now I have a question to the english native speakers: How should I call the keywords for the three methods?[*] Built the name from the containers: --trim disc,partition,sector[*] Built the name from objects to move: --trim partition,sector,fileIf all of this is implemented I will add the 2 new options --add-files and --repl-files. The options --rm-files and --zero-files are already implemented.
     
  8. WiiPower

    Member WiiPower GBAtemp Guru

    Joined:
    Oct 17, 2008
    Messages:
    8,165
    Country:
    Germany
    If a disc has the gamecube magic word in its disc ID and one of the following disc IDs:
    COBRAM, GGCOSD, GCOPDV or RGCOSD, then NeoGamma reads the offsettable at offset 64 on the disc. Well then comes the part which i don't believe is like that:
    If at offset 4 of the disc, the string "DVD9" is found then the offsets in the table are already >> 2, if not not. And the number of games is defined indirectly with the offsets, if an offset is 0, the entry before that is the last one. Oh and the offsettable has max 64 entries.

    Before you write somehting in that direction, i should ask emu_kidid if i left something out or whatever, he knows a lot about gamecube modding. And i think if it's possible to make this modchip and NeoGamma compatible, then you want to do that.

    I don't understand your different file move operations. Does this mean you will allow to fast expand GC discs to 4.37 GB by moving all data about 3GB(something with 32KB alignment) without changing its structure? That sounds very good to me.
     
  9. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    Option 1 (move whole partitions)
    This option allows to move whole partitions to the beginning or end of the disc. Partition data is not changed, fake signing not necessary. Option --disc-size overwrites the default disc size (4.7GB, needed for "--trim disc,end").

    Option 2 (move whole sectors/sector groups within partitions)
    GC: It moves only whole sectors (32KiB) to close holes. The advantage is that the original aligning will not changed.
    Wii: It moves only whole sector groups (Wii, 2MiB) to close holes. The advantage is that the there is no need do de+encrypt the data.
    GC+Wii: copying is fast because reading+writing continuous block from the hard drive.

    Option 3 (complete reorganization of files)
    The file are sorted and placed at new offsets. File aligning is controlled by --align.
    This is slow because reading and writing is done on file level.
    Wii: de+encryption and calculating of hash values is needed. This is much slower.


    EDIT: MULTIBOOT:
    I have loaded neogamma sources and found the multiboot source. I think thats enough info for me. If not I will bother you.
     
  10. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    im doing "wit COPY gamecubegame.iso newfile.wbfs" and it looks like it is working like it should, it outputs a new file that is the correct size. but it spits out an error
    the filename is "BMX XXX_2.iso" it contains a space. even if i wrap my filename in single quotes, i still get this error after it has done its thing

    Code:
    ./wit CP '/media/1TB_3GbS_2/GC games/BMX XXX_2.iso' /home/jenna/c/gcmtest.wbfs --id=GB3E51 '--name=BMX XXX' --modify=DISC -v -v -v -v -L -L --overwrite --progress
    
    wit: Wiimms ISO Tool v1.16a r1645 x86_64 - Dirk Clemens - 2010-09-01
    
    PROGRAM_NAMEÂÂ = wit
    SEARCH_PATH[0] = /home/jenna/c/wiimms_tools/1645/bin/
    SEARCH_PATH[1] = /usr/local/share/wit/
    SEARCH_PATH[2] = ./
    
    ! wit: Title file not found: titles.txt
    ! wit: Title file not found: titles.local.txt
    * wit SCRUB 1/1 ISO:/media/1TB_3GbS_2/GC games/BMX XXX_2.iso -> WBFS:/home/jenna/c/gcmtest.wbfs
    !! wit: ERROR #27 [READ FILE FAILED] in ReadISO() @ src/lib-sf.c#1239
    !!ÂÂÂÂÂÂRead failed [F=3,4d050000+8000]: /media/1TB_3GbS_2/GC games/BMX XXX_2.iso
    !!ÂÂÂÂÂÂ-> No such file or directory
    ÂÂÂÂ 1232 MiB copied in 0:02.410, 511.3 MiB/sec

    DUMP and ILIST are working fine for this game. i only see the error using COPY.
     
  11. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    I can't reproduce this:

    Code:
    # wit cp 'pool/te st/w ch.wdf' pool/a.wbfs --id=GB3E51 '--name=BMX XXX' --modify=DISC -v -v -v -v -L -L --overwrite --progress
    
    wit: Wiimms ISO Tool v1.16a r1656M i386 - Dirk Clemens - 2010-09-03
    
    PROGRAM_NAMEÂÂ = wit
    SEARCH_PATH[0] = /usr/local/bin/
    SEARCH_PATH[1] = /usr/local/share/wit/
    SEARCH_PATH[2] = ./
    
    
    Patching table of the disc:
    
    ÂÂÂÂÂÂÂÂoffset .. offset endÂÂÂÂ sizeÂÂcomment
    ÂÂ --------------------------------------------------------------
    ÂÂÂÂÂÂÂÂÂÂÂÂ 0 ..ÂÂÂÂÂÂÂÂ 6ÂÂÂÂÂÂÂÂ 6ÂÂdisc id: RTYP01 -> GB3E51
    ÂÂÂÂÂÂÂÂÂÂÂÂ20 ..ÂÂÂÂÂÂÂÂ60ÂÂÂÂÂÂÂÂ40ÂÂdisc name: BMX XXX
    ÂÂÂÂÂÂÂÂ 4e000 ..ÂÂÂÂ 4e020ÂÂÂÂÂÂÂÂ20ÂÂregion: 1
    
    Patching table of the disc:
    
    ÂÂÂÂÂÂÂÂoffset .. offset endÂÂÂÂ sizeÂÂcomment
    ÂÂ --------------------------------------------------------------
    ÂÂÂÂÂÂÂÂÂÂÂÂ 0 ..ÂÂÂÂÂÂÂÂ 6ÂÂÂÂÂÂÂÂ 6ÂÂdisc id: RTYP01 -> GB3E51
    ÂÂÂÂÂÂÂÂÂÂÂÂ20 ..ÂÂÂÂÂÂÂÂ60ÂÂÂÂÂÂÂÂ40ÂÂdisc name: BMX XXX
    ÂÂÂÂÂÂÂÂ 4e000 ..ÂÂÂÂ 4e020ÂÂÂÂÂÂÂÂ20ÂÂregion: 1
    SCAN TITLE FILE /usr/local/share/wit/titles.txt
    SCAN TITLE FILE /usr/local/share/wit/titles.local.txt
    * wit SCRUB 1/1 WDF:pool/te st/w ch.wdf -> WBFS:pool/a.wbfs
    ÂÂÂÂÂÂ 24 MiB copied in 0:00.788, 30.7 MiB/sec
    BTW: You can write "-v -v -v -v -L -L" as -vvvvLL


    EDIT:
    If you "make debug all" each program call creates a file named "_trace-wit.tmp". Please mail it to me if the error happens again.
     
  12. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    Multiboot GC discs are recognized:

    Warning: Spoilers inside!


    @WiiPower
    In the GCOS readme I have found:
    Does this mean: 32 KiB align is not enough for large files?

    The GCOS tool stores a little start partition in a multiboot image. Is this necessary for loaders like NeoGamma?
    Is there a free one available?
     
  13. WiiPower

    Member WiiPower GBAtemp Guru

    Joined:
    Oct 17, 2008
    Messages:
    8,165
    Country:
    Germany
    Well GCOS adds his loader to the 1st partition, and that is supposed to show you a menu where you select which game to run. Since that's completely incompatible with NeoGamma, NeoGamma skips that. You could create a multi game image with just the partition offsets on the beginning, and at 32K the 1st game. It would still work in NeoGamma, but i can't say what good it does to other loading methods.

    Maybe you want to ask emukidid about this:
    http://www.gc-forever.com/forums/viewforum.php?f=4

    He knows all this stuff. Also your tools should be at least compatible to NeoGamma + the loader he is working on, his yet unnamed loader with sd gecko, and disc(on an actual gamecube) support.
     
  14. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    i have checked out r1661 and built make debug all. it still gives a similar error so what i posted before.
    Code:
    jenna@pc:~/c/wiimms_tools/1661$ '/home/jenna/c/wiimms_tools/1661/bin/debug/wit' CP '/media/1TB_3GbS_2/GC games/GC_NTSC/BMX XXX_2.iso' /home/jenna/c/gui_fork/gcmtest.wbfs --id=GB3E51 '--name=BMX XXX' --modify=DISC -vvvvLL --overwrite --progress
    
    wit: Wiimms ISO Tool v1.16a r1661 x86_64 - Dirk Clemens - 2010-09-03
    
    PROGRAM_NAMEÂÂ = wit
    SEARCH_PATH[0] = /home/jenna/c/wiimms_tools/1661/bin/debug/
    SEARCH_PATH[1] = /usr/local/share/wit/
    SEARCH_PATH[2] = ./
    
    ! wit: Title file not found: titles.txt
    ! wit: Title file not found: titles.local.txt
    * wit SCRUB 1/1 ISO:/media/1TB_3GbS_2/GC games/GC_NTSC/BMX XXX_2.iso -> WBFS:/home/jenna/c/gui_fork/gcmtest.wbfs
    WBFS size = 230800000 = 9403629568
    WBFS WRITE HEADER: 0 + 100
    !! wit: ERROR #27 [READ FILE FAILED] in ReadISO() @ src/lib-sf.c#1239
    !!ÂÂÂÂÂÂRead failed [F=4,4d050000+8000]: /media/1TB_3GbS_2/GC games/GC_NTSC/BMX XXX_2.iso
    !!ÂÂÂÂÂÂ-> No such file or directory
    !! wit: ERROR #39 [FATAL ERROR] in ReadISO() @ src/lib-sf.c#1242
    !!ÂÂÂÂÂÂffffffffffffffff : 4d058000
    here is the trace file http://www.multiupload.com/LR0O524R7Q
     
  15. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    @gaintpune:
    1) I don't understand you error, perhaps it is the wrong errno message.
    Is your source file .../BMX XXX_2.iso smaller than 1 292 206 080 bytes?

    2.) The repos contained the 1.16a release. In this minute I have committed the current state to the beta repos (untested on 64 bit, hope that all printf formats are correct)
     
  16. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    my game is 1 292 199 600 bytes, it was shrunken with some other tool. im not sure which one i used.
     
  17. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    I always read whole sectors (multiple of 0x8000). Your disc size 39434.802 sectors and the program miss 0.198 sectors = 6480 bytes. hmmmm....

    EDIT:
    For future interpretation:

    "[F=4,4d050000+8000]" means:

    - "F": File based on open(), S: Stream based on fopen()
    - "=4": file descriptor 4
    - "4d050000" : read offset in hex
    - "+8000" : read size in hex
     
  18. giantpune

    Member giantpune GBAtemp Addict

    Joined:
    Apr 10, 2009
    Messages:
    2,860
    Country:
    United States
    so if i have a whole shitload of games that are like this, i should just write a program that will go through all my games and pad them out with 0s and they will be fine in wit?
     
  19. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    Or I add an option with ignore such errors.

    Or calculate the end of a gc partition on file level instead on sector level.

    Ignoring such errors completely is perhaps possible for gamecube discs, but never for Wii discs because decryption+hash
     
  20. Wiimm
    OP

    Member Wiimm Developer

    Joined:
    Aug 11, 2009
    Messages:
    2,051
    Location:
    Germany
    Country:
    Germany
    @giantpune:
    I have committed a special release for your special prob in the beta repos.

    It reads only until the end of image file if the data behind that point is not needed.
    Say me, if it help.
     

Share This Page