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

Commits on Mar 31, 2024

  1. Create EXI_DeviceSD

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    c6c8126 View commit details
    Browse the repository at this point in the history
  2. Dummy EXI_DeviceSD

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    a68f4f2 View commit details
    Browse the repository at this point in the history
  3. HLE kprintf

    Not for this PR, but useful for testing
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    1afc1de View commit details
    Browse the repository at this point in the history
  4. Add SetCS - amend dummy

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    452740e View commit details
    Browse the repository at this point in the history
  5. Advance reading

    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.
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    32b10ac View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f0798d1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0d677e6 View commit details
    Browse the repository at this point in the history
  8. Adjust SD getid thing

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    0b05085 View commit details
    Browse the repository at this point in the history
  9. Basic command detection

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    b88811d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e641198 View commit details
    Browse the repository at this point in the history
  11. Implement CMD8

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    5300bde View commit details
    Browse the repository at this point in the history
  12. CMD9 and CMD10 - early version

    (actually like 15 minutes ago)
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    ce85b22 View commit details
    Browse the repository at this point in the history
  13. Hardcode data for CMD9 and CMD10

    The CRC part still unnerves me
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    b66b241 View commit details
    Browse the repository at this point in the history
  14. Implement last few commands, enough to get it detected by libogc (tho…

    …ugh not enough to be useful)
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    4a13f84 View commit details
    Browse the repository at this point in the history
  15. Implement STOP_TRANSMISSION and APP_CMD SD_SEND_OP_COND

    Both of these are used by Pok�émon Channel.  However, Pokémon Channel actually DOES care about CRCs, so... yay.
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    582dd35 View commit details
    Browse the repository at this point in the history
  16. Use correct CRC16s

    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.
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    8474bdc View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    fe91623 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    f057491 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    1faab59 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    fe3227d View commit details
    Browse the repository at this point in the history
  21. Initial implementation of reads and writes

    No idea if this actually works
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    749da1e View commit details
    Browse the repository at this point in the history
  22. Fix CRC handling

    2 different CRC bugs, and also an OOB bug.
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    9646fd3 View commit details
    Browse the repository at this point in the history
  23. Implement SendStatus

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    0b89a5f View commit details
    Browse the repository at this point in the history
  24. Fix multi-block reads

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    d30d3cc View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    89f77a1 View commit details
    Browse the repository at this point in the history
  26. Undo some test stuff

    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    0c0ad48 View commit details
    Browse the repository at this point in the history
  27. Implement ReadOCR

    Libogc needs this now; I'm not sure what I changed from before that made it necessary.
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    f41d68f View commit details
    Browse the repository at this point in the history
  28. WIP fix block reads

    Enough for libogc, but not enough for Channel...
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    98c1826 View commit details
    Browse the repository at this point in the history
  29. Actually functional block read

    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...
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    302b64d View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    3d32c6b View commit details
    Browse the repository at this point in the history
  31. Allow configuring SP2

    Note that the default was AD16 before, and I've now changed it to None.
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    e372ebf View commit details
    Browse the repository at this point in the history
  32. Partially implement configuring the SD card path

    This doesn't work (changes aren't saved to disk), and I don't fully understand why...
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    fb0b86d View commit details
    Browse the repository at this point in the history
  33. Fix SD Media Launcher

    Datel...
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    dae01cc View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    0766f1c View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    6b7444c View commit details
    Browse the repository at this point in the history
  36. Re-add ConfigManager.h include

    Dropped in b0f9bb9 - I should look at that for how to fix my own changes
    Pokechu22 committed Mar 31, 2024
    Configuration menu
    Copy the full SHA
    0a08247 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    cbe5811 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2024

  1. Call SetCS for all devices

    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.
    Pokechu22 committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    b5a6fc1 View commit details
    Browse the repository at this point in the history
  2. Only return SD device when CS is 0

    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...)
    Pokechu22 committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    d22f42a View commit details
    Browse the repository at this point in the history
  3. Eliminate hacky setup states

    There still probably needs to be another state for CMD0 or such, but that can be handled separately.
    Pokechu22 committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    d1bf525 View commit details
    Browse the repository at this point in the history