Skip to content

Add support for sending GameID information to MemCardPRO GC #51

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

Open
wants to merge 20 commits into
base: enhanced
Choose a base branch
from

Conversation

Arrghus8
Copy link

@Arrghus8 Arrghus8 commented Jul 9, 2025

Added support for sending GameID information to MemCard PRO GC. Based on the implementation in Swiss.

There are three settings:

  • Off: No GameID information is sent to the memory slots.
  • Full ID: The full GameID is sent, including Company and Revision data (e.g. RSBE0100). This matches the Swiss naming convention.
  • Short ID: A shortened ID is sent, omitting the Company and Revision data (e.g. RSBE). This matches the Nintendont Emulated Memory Card naming convention.

Copy link

@eku eku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wonderig why these change are part of this software and not nintendont?
Please explain.

Check your code formatting!

@wiidev
Copy link
Owner

wiidev commented Jul 10, 2025

I'm wonderig why these change are part of this software and not nintendont? Please explain.

I assume they're doing it this way so that it works with Nintendont, Devolution, and MIOS. However, when it's handled like this, if there's a boot failure or you exit a game, I'd expect the game ID and title to remain on the screen until you eventually boot another GameCube game. But maybe that's just the norm for this device.

There's a few issues here, some of which have been pointed out already.

  1. You should keep the Swiss copyright at the top of MemCardPro.cpp
  2. README.md shouldn't be modified at all
  3. You're using spaces instead of tabs in some files

You could also optimise where gameID_early_set is called so that it doesn't update the game ID and title until all checks for Nintendont, Devolution, MIOS, etc. have been completed. That said, it's probably not worth doing if it's normal for the memory card to occasionally display outdated information.

jllottes added 4 commits July 10, 2025 11:12
…Pro.cpp` and `MemCardPro.h`. Restore `README.md`.
…Pro.cpp` and `MemCardPro.h`. Restore `README.md`.
…Pro.cpp` and `MemCardPro.h`. Restore `README.md`.
…Pro.cpp` and `MemCardPro.h`. Restore `README.md`.
@Arrghus8
Copy link
Author

Arrghus8 commented Jul 10, 2025

Check your code formatting!

I've replaced spaces with tabs to hopefully fix the formatting issues.

I assume they're doing it this way so that it works with Nintendont, Devolution, and MIOS.

That is one reason. The second reason, at least in the case of Nintendont (I haven't looked into the other loaders), is that USBloaderGX does not send the full GameID information within the NIN_CFG structure. Specifically, the Revision information is not part of this structure. Rather than modifying both projects to include and accept this additional information, I thought it more straightforward to let USBloaderGX handle the MemCardPro directly.

However, when it's handled like this, if there's a boot failure or you exit a game, I'd expect the game ID and title to remain on the screen until you eventually boot another GameCube game. But maybe that's just the norm for this device.

This is the same behavior as Swiss, and does not cause any issues. There is some discussion with the developers of the MemCardPro to add a command to reset to the default memory card. If/when that happens, this command could be sent when loading USBloaderGX to reset the game ID.

You could also optimise where gameID_early_set is called so that it doesn't update the game ID and title until all checks for Nintendont, Devolution, MIOS, etc. have been completed. That said, it's probably not worth doing if it's normal for the memory card to occasionally display outdated information.

If I understand, you're suggesting calling gameID_early_set within BootDevolution, BootNintendont, and BootDIOSMIOS rather than directly within BootGCMode?

@wiidev
Copy link
Owner

wiidev commented Jul 10, 2025

I've replaced spaces with tabs to hopefully fix the formatting issues.

Thanks. And thanks for addressing the copyright info, although, that second copy for gameID_early_set is probably superfluous, since everything is within the one file.

You need to remove your usbloader_gx_MCP.zip file. And I should probably configure Git to ignore *.zip rather than /usbloader_gx.zip.

This is the same behavior as Swiss, and does not cause any issues. There is some discussion with the developers of the MemCardPro to add a command to reset to the default memory card. If/when that happens, this command could be sent when loading USBloaderGX to reset the game ID.

Okay, cool. Hopefully they'll add that in a future firmware update.

If I understand, you're suggesting calling gameID_early_set within BootDevolution, BootNintendont, and BootDIOSMIOS rather than directly within BootGCMode?

Yes. Just before everything gets shutdown and handed off to Nintendont, Devolution, MIOS, etc. That way, the memory card won't display the new ID and title if the boot process was aborted for some reason (e.g., GC games on an unsupported file system).

I know that this suggestion isn't critical, but it'd keeps the information a little more accurate. Especially if the MemCardPro devs do eventually add a command to reset things.

@Arrghus8
Copy link
Author

You need to remove your usbloader_gx_MCP.zip file.

Done.

Yes. Just before everything gets shutdown and handed off to Nintendont, Devolution, MIOS, etc.

I think I've put things in the appropriate places, but am a bit over my head, so please let me know if there are issues. I've tested with Nintendont and everything worked correctly, but I don't currently have DIOSMIOS or Devolution setup.

Copy link
Owner

@wiidev wiidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few changes needed.

@Arrghus8
Copy link
Author

Addressed the highlighted issues. Please let me know if any further changes are required.

@wiidev
Copy link
Owner

wiidev commented Jul 10, 2025

It's looking good now, thank you.

I promise I'll merge this when I'm a little closer to a new release.

@Arrghus8
Copy link
Author

Great, glad to hear it!

Copy link
Owner

@wiidev wiidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I said it looked good earlier, but I cherry-picked it into my local copy of the loader to see how it looked, and I noticed a few things that could be improved. Thanks again.

@Arrghus8
Copy link
Author

Made the recommended adjustments.

@wiidev
Copy link
Owner

wiidev commented Jul 10, 2025

This might seem a little nitpicky, but in LoaderSettings.cpp the setting's position didn't really need to change, since the menu is mostly static there. Plus, there's already a Progressive Patch setting under GameCube Mode that applies to all of the GC modes, much like the MemCard PRO setting does.

I'm open to other suggestions. For example, we could move the Progressive Patch setting before GameCube Mode as well, to make the structure of global vs. per-game settings more consistent. That said, I'm used to seeing GameCube Source and GameCube Mode grouped together.

@Arrghus8
Copy link
Author

No worries, you're more than welcome to nitpick. For now, I've just moved the MemCard PRO setting back below GameCube Mode in LoaderSettings.cpp. It seems like it would be a bit of a headache to align the global and per-game settings, and it doesn't seem that critical.

One other thing that I had in mind was possibly tying the MemCard PRO setting to the memory card emulation setting. Basically, I am thinking of not sending the GameID information if the user has memory care emulation enabled since it would serve no purpose. On the other hand, it wouldn't negatively affect anything. It's a little messy since DIOSMIOS and (c)MIOS don't offer this feature. What are your thoughts?

@wiidev
Copy link
Owner

wiidev commented Jul 18, 2025

One other thing that I had in mind was possibly tying the MemCard PRO setting to the memory card emulation setting. Basically, I am thinking of not sending the GameID information if the user has memory care emulation enabled since it would serve no purpose. On the other hand, it wouldn't negatively affect anything. It's a little messy since DIOSMIOS and (c)MIOS don't offer this feature. What are your thoughts?

Sorry for the late reply! It's been a hectic week, and I'm only now getting caught up.

Let's say your suggestion was applied and you had your MemCard PRO inserted. If you played a game with memory card emulation disabled, and then played another game with memory card emulation enabled, the MemCard PRO would continue to display the game that you played while memory card emulation was disabled, right? Also, does it show the last played game as soon as the console powers on? Because if either of those things happen, I'd probably continue updating the game ID anyway.

Have you tried doing something like this to see if it clears the game info?

struct discHdr *header = new struct discHdr;
memset(header, 0, sizeof(struct discHdr));
gameID_early_set(header, false);
delete header;
header = NULL;

@Arrghus8
Copy link
Author

Sorry for the late reply! It's been a hectic week, and I'm only now getting caught up.

No problem at all!

Let's say your suggestion was applied and you had your MemCard PRO inserted. If you played a game with memory card emulation disabled, and then played another game with memory card emulation enabled, the MemCard PRO would continue to display the game that you played while memory card emulation was disabled, right?

That's correct. It wouldn't hurt anything, but it would be displaying out-of-date information.

Also, does it show the last played game as soon as the console powers on?

There are currently two settings. The default option has the MemCard PRO boot with a card called MemoryCard1. Alternatively, it can be set to load the last used card on boot.

Have you tried doing something like this to see if it clears the game info?

This does clear the game info, but I'm hesitant to do so in this way. This causes the MemCardPro to create a new card "-1.raw" rather than loading the intended startup card. I am hoping that the 8BitMods team will modify the behavior of the MemCard PRO so that it will load the intended startup card when receiving this type of command. If that does happen, I'll be happy to make the adjustments to make use of it.

From all of this, I would agree that it's probably best to just update the GameID info regardless of memory card emulation.

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.

4 participants