Skip to content

Commit 2859681

Browse files
DRXInfoScreen: Add chip version and umi version
1 parent a10521a commit 2859681

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

source/screens/DRXInfoScreen.cpp

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "DRXInfoScreen.hpp"
22
#include "Utils.hpp"
33
#include <span>
4+
#include <map>
45

56
#include <nsysccr/cdc.h>
67
#include <nsysccr/cfg.h>
@@ -58,6 +59,15 @@ const char* kBoardSubVersions[] = {
5859
"DKTVMP"
5960
};
6061

62+
// from gamepad firmware @0x00020bc0
63+
const std::map<uint8_t, const char*> kChipVersions = {
64+
{ 0x10, "TS" },
65+
{ 0x20, "ES1" },
66+
{ 0x30, "ES2" },
67+
{ 0x40, "ES3" },
68+
{ 0x41, "MS01" },
69+
};
70+
6171
// from gamepad firmare @0x000b29fc
6272
const char* kRegionStrings[] = {
6373
"JAPAN",
@@ -105,6 +115,15 @@ DRXInfoScreen::DRXInfoScreen()
105115
mDRCList.push_back({"GetRegion failed", ""});
106116
}
107117

118+
CCRCDCSysInfo sysInfo;
119+
if (CCRCDCSysGetInfo(CCR_CDC_DESTINATION_DRC0, &sysInfo) == 0) {
120+
mDRCList.push_back({"Chip Version:", Utils::sprintf("%s (0x%02x)",
121+
kChipVersions.contains(sysInfo.chipVersion) ? kChipVersions.at(sysInfo.chipVersion) : "UNKNOWN", sysInfo.chipVersion)});
122+
mDRCList.push_back({"UMI Version:", {Utils::sprintf("0x%08x", sysInfo.umiVersion), true}});
123+
} else {
124+
mDRCList.push_back({"SysGetInfo failed", ""});
125+
}
126+
108127
if (CCRCDCSoftwareGetVersion(CCR_CDC_DESTINATION_DRH, &softwareVersion) == 0) {
109128
uint32_t v = softwareVersion.runningVersion;
110129
mDRHList.push_back({"Running Version:", Utils::sprintf("%d.%d.%d", v >> 24 & 0xff, v >> 16 & 0xff, v & 0xffff)});
@@ -150,12 +169,12 @@ void DRXInfoScreen::Draw()
150169
int yOff = 128;
151170
yOff = DrawHeader(32, yOff, 896, 0xf11b, "DRC Info");
152171
yOff = DrawList(32, yOff, 896, mDRCList);
153-
yOff = DrawHeader(32, yOff, 896, 0xf0cb, "DRC Ext IDs");
154-
yOff = DrawList(32, yOff, 896, mExtIdList);
172+
yOff = DrawHeader(32, yOff, 896, 0xf2db, "DRH Info");
173+
yOff = DrawList(32, yOff, 896, mDRHList);
155174

156175
yOff = 128;
157-
yOff = DrawHeader(992, yOff, 896, 0xf2db, "DRH Info");
158-
yOff = DrawList(992, yOff, 896, mDRHList);
176+
yOff = DrawHeader(992, yOff, 896, 0xf0cb, "DRC Ext IDs");
177+
yOff = DrawList(992, yOff, 896, mExtIdList);
159178

160179
DrawBottomBar(nullptr, "\ue044 Exit", "\ue001 Back");
161180
}

0 commit comments

Comments
 (0)