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

Fix DSi Mode related setup #2506

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Conversation

Lorenzooone
Copy link
Contributor

What's changed?

Fixes various setup issues preventing slot1launch from launching DSi games in DSi mode.

In particular:

  • Made sure the 0x10 bytes at 0x0380FFC0 are cleared if not launching is DSi mode. These bytes are used by the ARM7 binaries to determine whether the game is launched on a DSi or not. (In particular, it's bit 2 of 0x0380FFC8, I think... Though it may be bit 7, I'd have to check). So having them mismatch ARM9's mode would cause crashes.
  • Set __dsimode, the internal libnds register. This is needed to make sure isDSiMode works properly. In particular, that method is used by disableSlot1 and enableSlot1, so not having it set would cause problems (i.e. cartridge reads not working).
  • REG_IF is cleared before booting, as turning off and on the slot 1 triggers an interrupt. If not cleared, that interrupt flag would make the games think the cartridge was removed.

This PR just fixes the setup, but it's not going to enable DSi mode by default. This is mainly because:

  • The size of the binary becomes too big with DSi mode stuff enabled. As such, it's disabled by default. To test it, I personally disabled the cardengine (not included in the PR). As such, all DSi related stuff is covered by ifdefs et simila (in the Makefile the needed source/include definitions are commented). I leave to the team the decision on how to handle this problem. Personally, though, I'd suggest moving the spot in which cardengine is copied to RAM so it's not done by bootloader.
  • There should be options to choose how to launch your DSi game. So if you want to use DS mode or DSi mode, etc. There currently aren't.

Where have you tested it?

3DS via TwilightMenu++ application and DSi via unlaunch + TwilightMenu++.


Pull Request status

  • This PR has been tested using the latest version of devkitARM and libnds.

@RocketRobz RocketRobz merged commit 79e69a6 into DS-Homebrew:master Jan 13, 2025
1 check passed
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