Skip to content

Commit

Permalink
Update flashcart_core
Browse files Browse the repository at this point in the history
- support variant of r4i gold 3ds; A5, A6
  • Loading branch information
d3m3vilurr committed Aug 25, 2017
1 parent 6d371e3 commit 6bac998
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 26 deletions.
2 changes: 1 addition & 1 deletion external/flashcart_core
33 changes: 8 additions & 25 deletions source/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,31 @@ void Flashcart::platformInit() {
// TODO
}

void Flashcart::sendCommand(const uint8_t *cmdbuf, uint16_t response_len, uint8_t *resp) {
void Flashcart::sendCommand(const uint8_t *cmdbuf, uint16_t response_len, uint8_t *resp, uint32_t flags) {
u8 reversed[8];
for (int i = 0; i < 8; i++) {
reversed[7 - i] = cmdbuf[i];
}

u32 defaultFlags;
u32 defaultFlags = flags;
switch (response_len & 0xfffffffc) {
case 0:
defaultFlags = 0;
defaultFlags |= 0;
break;
case 4:
defaultFlags = CARD_BLK_SIZE(7);
defaultFlags |= CARD_BLK_SIZE(7);
break;
case 512:
defaultFlags = CARD_BLK_SIZE(1);
defaultFlags |= CARD_BLK_SIZE(1);
break;
case 8192:
defaultFlags = CARD_BLK_SIZE(5);
defaultFlags |= CARD_BLK_SIZE(5);
break;
case 16384:
defaultFlags = CARD_BLK_SIZE(6);
defaultFlags |= CARD_BLK_SIZE(6);
break;
default:
defaultFlags = CARD_BLK_SIZE(4);
break;
}

switch (cmdbuf[0]) {
case 0xA5:
defaultFlags |= CARD_DELAY1(20);
break;
case 0xB7:
defaultFlags |= CARD_DELAY1(2);
break;
case 0xC0:
defaultFlags |= CARD_DELAY1(4);
break;
case 0xC8:
case 0xD4:
case 0xD8:
defaultFlags |= CARD_DELAY1(20);
defaultFlags |= CARD_BLK_SIZE(4);
break;
}

Expand Down

0 comments on commit 6bac998

Please sign in to comment.