Need help with file I/O for Gamecube homebrew

Mode8fx

Active Member
OP
Newcomer
Joined
Nov 14, 2019
Messages
33
Trophies
0
XP
331
Country
United States
I have a Wii homebrew game that I also ported to Gamecube. It runs fine in Dolphin, except external files (in this case, sound effects and music) are not loading. On Wii, these files would be loaded through, say, sd:/apps/my_game/my_sound.wav, but I don't know the equivalent path for Gamecube, and there's surprisingly little information I could find about Gamecube homebrew. Specifically, I want to load these assets from a Gamecube SD to memory card adapter in slot B. According to some repos of old homebrew apps, the root might be sd:/ or cardb:/, but I don't have any way of testing this. I don't have a Gamecube, I haven't been able to successfully run Gamecube homebrew on my Wii, and I have no Gamecube SD access in Dolphin, so the game runs without the loaded audio.

Basically, what is the best way to save/load external assets in a Gamecube homebrew app; what path should I use? Here's the game in question, which currently attempts to load assets from sd:/Trogdor-RB:
https://github.com/Mode8fx/Trogdor-Reburninated/releases/tag/v2.1
 

Extrems

GameCube Wizard
Member
Joined
Jan 17, 2013
Messages
465
Trophies
1
Location
Quebec, Canada
Website
www.extremscorner.org
XP
3,416
Country
Canada
Dolphin doesn't emulate SD cards in SPI mode, so it's impossible to test with it.

The following paths can exist with libogc:
  • carda:/ - for an SD Card Adapter in Memory Slot A
  • cardb:/ - for an SD Card Adapter in Memory Slot B
  • sd:/ - for an SD Card Adapter in Serial Port 2 (SD2SP2)
Additionally with libogc2:
  • dvd:/ - for the GC Loader
Since you're using fatInitDefault(), I suggest using just plain /.
That function will chdir to the first device available (order varies between libogc and libogc2), or the path given in argv[0] if available (it is with the current version of Swiss).
 
Last edited by Extrems,

Mode8fx

Active Member
OP
Newcomer
Joined
Nov 14, 2019
Messages
33
Trophies
0
XP
331
Country
United States
Dolphin doesn't emulate SD cards in SPI mode, so it's impossible to test with it.

The following paths can exist with libogc:
  • carda:/ - for an SD Card Adapter in Memory Slot A
  • cardb:/ - for an SD Card Adapter in Memory Slot B
  • sd:/ - for an SD Card Adapter in Serial Port 2 (SD2SP2)
Additionally with libogc2:
  • dvd:/ - for the GC Loader
Since you're using fatInitDefault(), I suggest using just plain /.
That function will chdir to the first device available (order varies between libogc and libogc2), or the path given in argv[0] if available (it is with the current version of Swiss).
So just using / would be ideal, and the user's method of running homebrew will take care of pulling from the correct device?

In that case, I recompiled it to set /Trogdor-RB/ as root; do you have a few minutes to run this version with the audio from the release version and see if there's audio? I'd really appreciate it. There should be a "Trogador" voice clip after the instructions menu appears, and music in the Options menu.
 

Attachments

  • boot.zip
    2.5 MB · Views: 37

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    CCD's back then where sloooowwwww
  • Tofu_mommy @ Tofu_mommy:
    @SylverReZ I haven't seen them around here, to the point where I'm considering ordering some microSD cards in bulk in case they stop being available at all without pricy imports.
  • Psionic Roshambo @ Psionic Roshambo:
    I have tins full of them, split between old old old (works on old old old crap) and new and new new lol
  • SylverReZ @ SylverReZ:
    Found one of them, when microSD used to be called TransFlash.
  • Psionic Roshambo @ Psionic Roshambo:
    Pre 2GB stuff, 4GB to 64GB then 128 and up lol
  • Psionic Roshambo @ Psionic Roshambo:
    @SylverReZ, TF's a little different
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    TF. SD, MicroSD, Memory stick, Memory Stick Duo, CF, XD, and one or two more I can't remember
  • Psionic Roshambo @ Psionic Roshambo:
    I have readers for them all too lol
  • Psionic Roshambo @ Psionic Roshambo:
    Some of the new readers will not read the old pre 2GB ones
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, Same here. I have one that does *almost* every flash memory (except CF).
  • SylverReZ @ SylverReZ:
    I need some CompactFlash cards. :P
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah it's a pain, I wonder if there would be a market for a slightly higher end reader that works with EVERY format. For the hobbyist who has too much old rtandom junk lol
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, It wouldve saved me shit tons of time bringing out an old computer with a reader in the form of a drive bay lol.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    @SylverReZ, I have like 2 CF cards, I think I got them from old old camera's that people where asking me to recover the photo's off of them.... Funny thing about CF and MicroSD and all the "flash" based storage cards. If you don't power them up every so often the data gets corrupted faster than most people would think.
  • Psionic Roshambo @ Psionic Roshambo:
    In the one case I was able to recover like maybe 50% of the photo's and another 25%ish where somewhat recovered like they where all glitched.... Sad
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, I have several old microSD cards going down to the 1GB. Half of them haven't been powered in years, they all seem to work fine except for some no-name brands which immediately corrupted data as soon as I plug it in.
  • Psionic Roshambo @ Psionic Roshambo:
    The other one was totally fine but the kids had used it to take pictures of turtles and lake and a birthday party, so the photo's the person wanted recovered where way gone.
  • Psionic Roshambo @ Psionic Roshambo:
    @SylverReZ, I wonder if part of the data loss here in Florida is the humidity and maybe it causes the cells to lose power faster?
  • Tofu_mommy @ Tofu_mommy:
    Flash memory being stored unplugged and unused will eventually start corrupting data. I've had a memory stick do that to me within less than 10 years or so of storage.
    +2
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, You can use a free recovery tool like "DMDE" which works on Windows and Linux. At the time when I bought these cards, I tried recovering them with it, managed to recognize every format.
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, Could be with how you stored them. Humid conditions can be a cause for the memory to fail.
  • SylverReZ @ SylverReZ:
    @Tofu_mommy, Damn that sucks.
  • Psionic Roshambo @ Psionic Roshambo:
    Yeah most of the time here in Florida AC is fine and keeps things nice, once in a blue moon though when it has rained like 10 days straight even AC has trouble keeping the inside of a house dry lol
    +1
  • BigOnYa @ BigOnYa:
    Must also be tough when you keep gators indoors as pets/ play things. They prefer the humidity.
    +1
    BigOnYa @ BigOnYa: Must also be tough when you keep gators indoors as pets/ play things. They prefer the humidity. +1