Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GC Loader support #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

coolbho3k
Copy link

@coolbho3k coolbho3k commented Sep 11, 2022

This PR adds support for loading from GC Loader, currently prioritized last, as trying to read from GC Loader hangs for 10 seconds if no disc drive is present. It's tested and working on my setup when compiled against the latest libogc2.

A slight modification was made to the FATFS struct to align the disk access window buffer to 32 bits, as libogc2 doesn't allow reading from GC Loader when it's not aligned. This shouldn't affect anything else. Let me know if there's a known better way to do this.

Why load from GC Loader when you've got an IPL replacement chip (or, why even install an IPL replacement when you already have a GC Loader)?
Why not? :) It's always best to give the user more options. One practical reason is so we can use the shortcut buttons which aren't supported with GC Loader right now. Plus, projects like PicoBoot may add deeper features that GC Loader users may want to take advantage of, so it could be even more advantageous in the future to have both installed.

@Extrems
Copy link
Collaborator

Extrems commented Sep 11, 2022

FIL needs to be aligned as well.

One problem with this is, if there isn't any kind of disc drive present, iplboot will hang for 10 seconds when trying the GC Loader.

@coolbho3k
Copy link
Author

I'll find and align, though it worked without that but probably by chance.

Hm, should we make it load last, after sd2sp2? If no disk drive present, then that should still be okay, as in that case nothing should be able to boot.

@Extrems
Copy link
Collaborator

Extrems commented Sep 11, 2022

No disc drive present is a configuration supported by Swiss.

@coolbho3k
Copy link
Author

I moved GC Loader to the end. Can Swiss still possibly load if there's no disc drive and you get to the end?

At that point, it boots into the original IPL which tries to boot from disc. So if there's no drive, I'd think there's no remaining way to load Swiss. If that's the case, I think it should be ok if it hangs for 10 seconds here.

@coolbho3k
Copy link
Author

coolbho3k commented Sep 11, 2022

It may make sense to wait for #31 to merge and then add GC Loader support as a configuration option, instead, perhaps avoiding trying to boot from it by default and the possibility of the 10 second hang.

@coolbho3k
Copy link
Author

Ah that wouldn't work because presumably you would need a device to read the config from too. I think leaving GC Loader last may be the best option

@9ary
Copy link
Member

9ary commented Sep 11, 2022

This increases code size significantly, which is a problem for some modchips. This is going to be on hold until we can build multiple variants. In the meantime if you want to use this you can download the build from CI.
For what it's worth I'm not at all convinced there is any point in having both an IPL replacement and a drive emulator in the same console. If you want iplboot on gcloader we can build an iso image like Swiss provides.

@coolbho3k
Copy link
Author

coolbho3k commented Sep 11, 2022

Ah, I didn't consider impact on code size was that significant.

I will have an attempt at building an ISO image too. But, it still won't be able to actually read from the GC Loader after booting without this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants