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

[WIP] SD card adapter support #12680

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft

Conversation

Pokechu22
Copy link
Contributor

This is a very old change which I'm just putting up here to make it easier to find. I haven't tested it in a long time.

The games that support this are Doubutsu no Mori e+ (a Japan-specific version of Animal Crossing), the Japanese release of Pokémon Channel, the Homebrew Channel, and Datel's SD Media Launcher/later Action Replay releases. At one point I did test all of these and I'm pretty sure they worked, but it's been a while.

Not for this PR, but useful for testing
This works, for getting it to detect an SD card, though it then needs to init it and that fails.  But it's a start, even if it'll need to be thrown out when things get further along.
(actually like 15 minutes ago)
The CRC part still unnerves me
Both of these are used by Pok�émon Channel.  However, Pokémon Channel actually DOES care about CRCs, so... yay.
Libogc has a bit of a footgun, where __io_gcsda.isInserted() will initialize the card, but not the CRC tables; __io_gcsda.startup() needs to be called first.
No idea if this actually works
2 different CRC bugs, and also an OOB bug.
Libogc needs this now; I'm not sure what I changed from before that made it necessary.
Enough for libogc, but not enough for Channel...
This is enough for Pokémon Channel to save.  Loading should also work, but I'm unable to test since memory cards are still broken...
Note that the default was AD16 before, and I've now changed it to None.
This doesn't work (changes aren't saved to disk), and I don't fully understand why...
Dropped in b0f9bb9 - I should look at that for how to fix my own changes
The xor technique doesn't work well when 0 is a legal device, since CS not changing will return device 0, and then reset CS for that device.  This broke memcards; they now work.
This is NOT needed to fix anything, but still seems like a good idea to me.  Though getting a device based on CS still seems less than perfect (e.g. what does the hardware do if multiple chips are selected at the same time?  Probably it doesn't handle it well, but it might still be worth emulating...)
There still probably needs to be another state for CMD0 or such, but that can be handled separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant