Fix GCLoader support, broken due to double-init of GCODE
Commit f499333 introduced a call to GCODE_Init() in an effort to accelerate the boot device detection loop. Unfortunately, this function is called a second time inside driver->startup(), which seems to break loading files from GCLoader. In this change, we restructure the boot device detection loop to avoid the double-init of GCODE.
This change also tries to reduce the fragility of the loop by calling sdgecko_setSpeed() based on device type rather than index in the list.
I think this might actually fix a bunch of the open issues around GCLoader not being detected when booting from SD card, or the console not recognizing discs when no SD card is inserted, since gcode.c looks like a straight copy of dvd.c from libogc. Things are probably stomping on each other somehow. I'll try to confirm.
Out of curiosity, were to able to confirm Gcloader support was fixed by your changes?
Right now the main issues for me is that as long as gc loader is the only one in there, the console won't recognize any changes and just uses the default configuration for the intro.
@kemurphy would you mind posting a build with these fixes? I've tried my darnedest to get cubeboot to build but I'm stuck with
...cubeboot/cubeboot/source/pngu/pngu.c:14:10: fatal error: png.h: No such file or directory
14 | #include "png.h"
| ^~~~~~~
compilation terminated.
make[1]: *** [/opt/devkitpro/devkitPPC/base_rules:21: pngu.o] Error 1
make: *** [Makefile:110: build] Error 2
I've tried everything under the sun adding libpng to windows path but it's not having it.
I'm specifically trying to get the .dol so that I can compile it with the most recent picoboot (https://support.webhdx.dev/gc/picoboot/compiling-firmware). I'm hoping this will solve my discs not being recognized without going through swiss but I'd also just like to have it all up to date and stable.