dborth/snes9xgx

"Error Opening Directory" on GameCube with SDGecko

CrashOveride95 opened this issue ยท 30 comments

Describe the bug
"Error opening directory" message shows up when the emulator starts up, clicking out of this error will show corrupted directory listings.
I am doubtful it is an issue with my filesystem, as other emulators/programs work fine with my SD Card.
I used the latest nightly build which was linked at the readme, as of this writing the commit was a13c3a
To Reproduce
Steps to reproduce the behavior:
Load Swiss with the Exploit Under Fire exploit, then run "snes9xgx-gc.dol"
Expected behavior
I expected the file browser to work properly and show the root of my SD card.
Screenshots
image
image
(Please forgive the pink tint on the top left, the old Trinitron was having a bad day)

Looks like #932.

That issue didn't appear to be fixed; rather the submitter just giving up and using an old version

@CrashOveride95 does version 4.1.7 work for you like in the other post?
If so could you try to test all the build up until 4.4.8 and make a note from which build this specific issue starts?

There should be a change which has caused this, I don't own a Gamecube so I cannot test it myself.

Will do

@bladeoner the problem is it's also possible that changes in libogc or devkitppc itself could also have caused this. Comparing the all of the file handling/browsing code it looks identical between the projects and hasn't really changed in forever.

@dborth that's possible, but just lets see when the issue occurred for the first time.

If the old version works, we could also compile it with latest tools (is a big task as it needs unfortunately some fixes over the years).
But then we can make sure if the problem lies within this emulator or the toolchain.

I'm not sure if it can be related to the Freetype issue, that's the only older lib we use which is not really part of the rest.

I opened up a thread on:
https://devkitpro.org/viewtopic.php?t=9091

Here you can find the stack dump details:
https://devkitpro.org/download/file.php?id=159

These relate to the files here:
https://github.com/devkitPro/libogc

Didn't figure out what went wrong, @dborth @carstene1ns do you have any idea with this information?

The stack dump is only useful with the corresponding .elf/.map unfortunately.
Going to dust off my wii and will check a local build here.

Sorry for the wait, I was busy IRL

I've tested 4.1.7 and it worked, currently testing every few versions from it onwards to see which broke

Good to know there are later versions that work. ๐Ÿ‘

About the freetype problem:
The older non-pacman portlib was version 2.4.2, which dates back around 2010.
It seems they added some multithreading stuff in 2.6 (2015), which might be the culprit from my guess and I tried to workaround this by adding some mutex locks and global library state. no luck though.
I am going to build 2.5.4 with current tools and see if that changes anything.

@CrashOveride95 no worries thanks for testing.

@carstene1ns I also figured out that it was that version from 10 years a go I didn't mention that in the thread I opened, sorry for that.

When I find some time I will also look if I can find something more about the Freetype issue.

I've asked someone else also to test with a Gamecube, results are as following:
4.1.7 works
4.3.2 works
4.3.7 works
4.3.8 doesn't work, this is the moment we switched to the new devkit build tools

The above test results are when Loading Swiss with the Exploit Under Fire exploit, when you Load the Swiss Bootable disc with a Modchip also the higher versions work like 4.3.8 and the latest 4.4.8.

Conclusion: it doesn't work when the emulator is compiled with newer tools and used on a GameCube using the Agent Under Fire exploit.

I attached the latest working version 4.3.7 so people can use it, I didn't see it under the version history.
Snes9x_4.3.7_GC

It may be a bug in the filesystem driver, either libfat or DVD interface.

This is interesting, sounds like something about that exploit causes some sort of memory corruption? Not really sure, I'm out of my depth on this one, I'd ask FIX94 or Extrems about this. Perhaps on www.gc-forever.com

We could try and build with an older libfat but I'm not sure which hurdles we will get. I didn't find the time yet to look into that.

When building with an older libfat I'm getting an error:

c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld.exe: C:/devkitPro/libogc/lib/cube\libfat.a(directory.o): in function _FAT_directory_entryGetAlias': /Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:227: undefined reference to ctype_ptr'
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld.exe: /Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:227: undefined reference to __ctype_ptr__' c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld.exe: /Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:235: undefined reference to ctype_ptr'
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/10.2.0/../../../../powerpc-eabi/bin/ld.exe: /Users/davem/projects/devkitpro/libnds-master/libfat/libogc/../source/directory.c:235: undefined reference to `ctype_ptr'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [/opt/devkitpro/devkitPPC/gamecube_rules:30: /opt/devkitpro/examples/snes9xgx-master/executables/snes9xgx-gc.elf] Error 1

For me this it is really difficult to troubleshoot or test something since I don't own a GameCube.

This issue is common to the three emulators, it has nothing to do with the way the console is forced to run homebrew (Exploit Under Fire is my main boot method for SWISS), it is due to the program unable to create its own configuration file and folder, and it doesn't come in the archive too.

You can copy from one you have that works, as I did from Snes9x to FCEUGX, or you can download them from this link as long as there has been an upload for less than 30 days.

http://dl.free.fr/i3KMJGRBa

I tried for VBAGX later just to check as Emulators can't fulfill my needs so I have plenty of GB/GBA compatible hardware anyways, and it works by copying another's conf file too!

@CrashOveride95 @Papy-G are you using the latest version of Swiss?
If not could you try using the latest version of Swiss?

@CrashOveride95 @Papy-G are you using the latest version of Swiss?
If not could you try using the latest version of Swiss?

I checked and I was using latest Swiss

@CrashOveride95 could you try this Snes9x build see if it changes anything?
Snes9xGX-GameCube.zip

Latest SWISS here too.

Build confirmed working, good job!

Now go on and do the same with FCeUGX and VBAGX, then ask dborth to merge that to the master.

snes9xgx-gc.zip
Can you confirm this build is OK before I release it?

Oh my, I tested both bladeoner's and yours, and I realise I didn't try with SlotB so:
Both work well with SD2SP2, create folders and conf file, but they don't work anymore on SlotB, even when conf file and folders already exists, unlike the 4.9.9. :L

Thanks so much for testing.

I have one last idea. Can you try both of these and let me know?

snes9xgx-gc-try1.zip
snes9xgx-gc-try2.zip

I'ts getting better, both can load game from Slot B now, but still can't create/modify the conf file when on Slot B, so if it is not set with 4.4.9 before, it doesn't load anything, also, both don't load the save file.
Getting back to SWISS from SD2SP2 doesn't work (maybe related to not beeing able to edit conf. file, so not first class concern).

Not sure. Going to release it as-is and we'll see how it goes.

Maybe you can let this issue open as long as it is not fully adressed, so anyone could know of it and maybe solve this.