-
Notifications
You must be signed in to change notification settings - Fork 6
R4 i.L.S., Ace3DS
lifehackerhansol edited this page Nov 15, 2023
·
1 revision
There are many known derivatives of this cart, herein "Ace3DS+". This wiki page attempts to document existing card commands.
This list is incomplete.
Nearly all useful commands are similiar to the original R4.
-
B000000000000000
- Quoting ntrteam:
- Gets the cart version (in the high halfword) and status (in the low byte).
- EX4DS flashcart's DLDI driver seems to check for
returnValue & 7 == 4
in theisInserted
function. Ace3DS+ and R4iLS doesn't check it at all.
- Quoting ntrteam:
-
B4XXXXXXXX000000
- Sets the address (
0xXXXXXXXX
) of the FAT entry for ROM (lsb of address is 0). - This is a 2-byte aligned SD address. Returns
0x00000001
while the card is busy initializing the cluster map and0x00000000
once ready. This command is polled as long as the return value is 1. - Unlike other commands, this is not left-shifted 9. Thus, this command as well as ROM read commands only function on non-SDHC cards.
- Sets the address (
-
B6XXXXXXXX000000
- Start ROM read at address
0xXXXXXXXX
. - Address should be 512 byte aligned. Returns
0x00000001
while the card is busy performing the read and0x00000000
once the data is available. This command is polled as long as the return value is 1. The data can then be read with the standardB7
command. - See SDHC limitation as written in 0xB4 command.
- Start ROM read at address
-
B9XXXXXXXX000000
- Start SD read at address
0xXXXXXXXX
.
- Address is in sectors. Returns
0x00000001
while the card is busy performing the read and0x00000000
once the data is available. This command is polled as long as the return value is 1.
- Start SD read at address
-
BA00000000000000
- Get SD data that was previously requested by command
B9
.
- Returns the 512 byte block of SD data.
- Get SD data that was previously requested by command
-
BBXXXXXXXX000000
- Start SD write to address
0xXXXXXXXX
.
- Address is in sectors. The command expects 512 bytes of data that will be written to the SD card.
- Start SD write to address
-
BCXXXXXXXX0000YY
- Get SD write status for address
0xXXXXXXXX
previously requested by commandBC
. -
YY
is an XOR of all preceding bytes in this command. Thus,BC eor XX eor XX eor XX eor XX eor 00 eor 00
- Returns
0x00000001
while the card is busy performing the write and0x00000000
once done. This command is polled as long as the return value is 1.
- Without sending the address, the SD card corrupts.
- Without sending the XOR byte, write freezes.
- Get SD write status for address
-
BF00000000000000
- Read R4-obfuscated data. Same as ROM read data, and thus needs 0xB4 and 0xB6 respectively.
- A writeup of the obfuscation mechanism was done by asiekierka
- Note that the Ace3DS+ uses key 0x4002.
- This is used by the stage 1 loader to decrypt _DS_MENU.DAT on Ace3DS+, _DSMENU.dat on R4iLS.
- For some reason, this command also checks header->gameTitle of said ROM. If it doesn't match the expected header value, command doesn't seem to work (needs further verification)
- Ace3DS+ derivatives: ARM
b #0xC0
(Passthrough header),ACEP
- R4iLS derivatives:
R4XX
- Gateway Blue, R4infinity 2:
R4IT
- Ace3DS+ derivatives: ARM
- For some reason, this command also checks header->gameTitle of said ROM. If it doesn't match the expected header value, command doesn't seem to work (needs further verification)
-
C0XXYYYYYYYYZZ00
- Send raw SDIO command with
XX
= SDIO command,YYYYYYYY
= parameter,ZZ
= unknown - After sending this, poll
0xB0
command to read status. - Apparently with read commands,
0xBA
command works to return data.
- Send raw SDIO command with
-
C20000XX00000000
- Quoting ntrteam:
- Sets some SD-related register on the card (?)
- What the values in
XX
mean is currently unknown.
- Quoting ntrteam:
-
C3FF3CA5AA555AC7
- Send a calculated checksum via CARD_DATA_RD. Needed to fully init the flash.
- The buffer to calculate is retrieved from the
0xC6
command. - After this, flash can be read/written to via AUXSPI.
-
C600000000000000
- Initialize flash. Returns 512 bytes of... something.
- Not even ntrteam knows what this means.
Work-in-progress. Consult ntrteam's flashcart_core repository.