Skip to content

Fix Mii Maker image export feature#1984

Open
ariankordi wants to merge 5 commits into
cemu-project:mainfrom
ariankordi:fix/mii-maker-sd-card
Open

Fix Mii Maker image export feature#1984
ariankordi wants to merge 5 commits into
cemu-project:mainfrom
ariankordi:fix/mii-maker-sd-card

Conversation

@ariankordi

@ariankordi ariankordi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR gets rid of the "please insert an SD card" error that previously showed up if you tried to use this feature, so that it now works and is fully preserved (like it is in Citra).

Saved image of

Mii QR codes can also export now, albehit the data is all zeroes because Mii encryption is unimplemented:
Pasted Graphic 2

Changes made

  • 345ba08: Invoke SD card callback/notification when FSAddClientEx is called.
    • If Mii Maker never receives this, it doesn't even try to mount the SD card despite it being present.
    • The workaround I applied is to invoke the callback immediately with the string "sdcard".
      • It’s possible this affects other games that use the SD card, if… there are any.
    • That FSAttachCallback is slightly documented in Decaf.
  • 1e1b2c1: Fix image texture readback in Mii Maker
    • As you can see, I had to remove an assertion that got hit while doing this. Context is needed on why it was originally added.
    • Also had to enable TM_LINEAR_GENERAL to be mirrored to CPU RAM as well as TM_LINEAR_ALIGNED.
    • Even with these changes, JPEGs for QR codes are still completely black under the Metal renderer while Vulkan is fine.
  • 244aeb0: Extra change I snuck in to export FSRewindDir.
    • Already implemented, called by "FFLUtility". (Search in RGD Discord for more info)
    • This patch and a mount at /fflutility will make the tool work (--cos-mounts /path/to/hostio:/fflutility)
      • Weirdly not required on a real console.
    • DM me if you'd like to test this.

Fixing QR codes

Proper QR code exports involve implementing ACPMiiWrap/Unwrap, which I could do, but is out of scope and well documented anyway.

  • Used for Mii QR code encryption yes, but also for some obscure Mii network features.
    • sonic2013.rpx: WrapStoreData__31__N_15_FFLiNetwork_cpp_5a76681bFP20FFLiWrappedStoreDataPC16FFLiStoreDataCFLb
  • The concern here is with the AES key it needs, which Citra uses from the txt.
    • Not my call if it should be included in the code, but does Cemu even require keys anywhere else?
    • Citra actually uses 0 as the key if unspecified. Those null-key QR codes, while mostly useless, CAN actually be read/created by a tool I made.
  • Or we can defer this to until camera support works. Then the entire feature can be tested end-to-end.

@Exzap

Exzap commented Jul 9, 2026

Copy link
Copy Markdown
Member

Appreciate the contribution, but our LLM policy requires all code to be written by a human. You can find the full policy and reasons in README.md

@ariankordi

Copy link
Copy Markdown
Contributor Author

Sorry about that, the SD change was from Claude with rewritten comments. I reverted and redid that one by hand.

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.

2 participants