Skip to content

M3 DS Real

lifehackerhansol edited this page May 8, 2023 · 5 revisions

M3 DS Real

This page documents a subset of extra card commands supported by the M3 DS Real (herein M3). This page was written by lifehackerhansol based on previous documentation by Taiju Yamada (nee Xenon++).

Commands: what are they, what do they do (or at least some of them)

M3's original DLDI uses several different commands for reading and writing. There are single-sector read commands which align with the implemenation from the Original R4, as well as multi-sector reads.

Below are commands documented by Taiju Yamada in u64, as follows:

XXXXXXXX XXXXXXXX

Each two digits, from left to right, is REG_CARD_COMMAND[0] to REG_CARD_COMMAND[7] as defined in libnds.
Lowercase x will imply that this is unused. Any others are explained.

B0xxxxxx xxxxxxxx

  • Initialization / Get jumper pins
  • This is identical to the original R4's implementation.

BDaaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512)
  • preparation to read from SD/TF sector. wait until reading zero.

BAaaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512)
  • read from SD/TF sector

BEaaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512)
  • write to SD/TF sector

BCaaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512)
  • completion to write SD/TF sector. wait until reading zero.

CDxxxxxx xxxxxxxx

  • Get cart region
  • M3 has JP/EU/US regions; the only difference appears to be that the encryption key for the boot file are different.

Below are another set of commands, this time for multi-sector reading:

B1aaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512)
  • preparation to read multiple sectors from SD/TF. wait until reading zero.

B2aaaaaa aaxxxxxx

  • aaaaaaaa: sector address requested in B1 (Don't need to x512)
  • preparation to read next sector from SD/TF. wait until reading zero.

B3aaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512) // might not be needed
  • end multi-sector read or write from SD/TF.

B4aaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512)
  • write first sector of multi-sectors to SD/TF

B6aaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512) // might not be needed
  • completion to write one sector of multi-sectors to SD/TF. wait until reading zero.
  • it appears this is also needed after a B3 cmd to end multi-sector writes

B5aaaaaa aaxxxxxx

  • aaaaaaaa: sector address (Don't need to x512) // might not be needed
  • write next sector of multi-sectors to SD/TF