Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryOderNichts committed Feb 17, 2024
1 parent f0d6a53 commit 89fa33d
Showing 1 changed file with 36 additions and 35 deletions.
71 changes: 36 additions & 35 deletions ios_mcp/source/options/ShowExtCsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ void option_ShowExtCsd(void)
return;
}

// Lock blkdrv so it won't interfere with our custom commands
MDBlkDrv_Lock(fsaHandle, blkDrvIndex);

uint8_t* ext_csd = (uint8_t*) IOS_HeapAllocAligned(CROSS_PROCESS_HEAP_ID, 0x200, 0x20);
if (!ext_csd) {
gfx_set_font_color(COLOR_ERROR);
gfx_printf(16, index, 0, "Failed to allocate ext_csd");
waitButtonInput();
return;
}

// Lock blkdrv so it won't interfere with our custom commands
MDBlkDrv_Lock(fsaHandle, blkDrvIndex);

gfx_print(16, index, 0, "Submitting command...");
index += CHAR_SIZE_DRC_Y + 4;

Expand All @@ -70,50 +71,50 @@ void option_ShowExtCsd(void)

uint8_t ext_csd_rev = ext_csd[192];
const char* str;
switch (ext_csd_rev) {
case 8:
str = "5.1";
break;
case 7:
str = "5.0";
break;
case 6:
str = "4.5";
break;
case 5:
str = "4.41";
break;
case 3:
str = "4.3";
break;
case 2:
str = "4.2";
break;
case 1:
str = "4.1";
break;
case 0:
str = "4.0";
break;
default:
str = "Invalid revision";
switch (ext_csd_rev) {
case 8:
str = "5.1";
break;
case 7:
str = "5.0";
break;
}
case 6:
str = "4.5";
break;
case 5:
str = "4.41";
break;
case 3:
str = "4.3";
break;
case 2:
str = "4.2";
break;
case 1:
str = "4.1";
break;
case 0:
str = "4.0";
break;
default:
str = "Invalid revision";
break;
}

gfx_printf(16, index, 0, "Extended CSD rev 1.%d (MMC %s)", ext_csd_rev, str);
index += CHAR_SIZE_DRC_Y + 4;

gfx_printf(16, index, 0, "S_CMD_SET: 0x%02x", ext_csd[504]);
index += CHAR_SIZE_DRC_Y + 4;

gfx_printf(16, index, 0, "BKOPS_SUPPORT: 0x%02x", ext_csd[502]);
gfx_printf(16, index, 0, "BKOPS_SUPPORT: 0x%02x", ext_csd[502]);
index += CHAR_SIZE_DRC_Y + 4;

if (ext_csd_rev >= 5) {
gfx_printf(16, index, 0, "BKOPS_EN: 0x%02x", ext_csd[163]);
if (ext_csd_rev >= 5) {
gfx_printf(16, index, 0, "BKOPS_EN: 0x%02x", ext_csd[163]);
index += CHAR_SIZE_DRC_Y + 4;

gfx_printf(16, index, 0, "BKOPS_STATUS: 0x%02x", ext_csd[246]);
gfx_printf(16, index, 0, "BKOPS_STATUS: 0x%02x", ext_csd[246]);
index += CHAR_SIZE_DRC_Y + 4;
}

Expand Down

0 comments on commit 89fa33d

Please sign in to comment.