|
1 | 1 | #include "DRXInfoScreen.hpp"
|
2 | 2 | #include "Utils.hpp"
|
3 | 3 | #include <span>
|
| 4 | +#include <map> |
4 | 5 |
|
5 | 6 | #include <nsysccr/cdc.h>
|
6 | 7 | #include <nsysccr/cfg.h>
|
@@ -58,6 +59,15 @@ const char* kBoardSubVersions[] = {
|
58 | 59 | "DKTVMP"
|
59 | 60 | };
|
60 | 61 |
|
| 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 | + |
61 | 71 | // from gamepad firmare @0x000b29fc
|
62 | 72 | const char* kRegionStrings[] = {
|
63 | 73 | "JAPAN",
|
@@ -105,6 +115,15 @@ DRXInfoScreen::DRXInfoScreen()
|
105 | 115 | mDRCList.push_back({"GetRegion failed", ""});
|
106 | 116 | }
|
107 | 117 |
|
| 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 | + |
108 | 127 | if (CCRCDCSoftwareGetVersion(CCR_CDC_DESTINATION_DRH, &softwareVersion) == 0) {
|
109 | 128 | uint32_t v = softwareVersion.runningVersion;
|
110 | 129 | 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()
|
150 | 169 | int yOff = 128;
|
151 | 170 | yOff = DrawHeader(32, yOff, 896, 0xf11b, "DRC Info");
|
152 | 171 | 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); |
155 | 174 |
|
156 | 175 | 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); |
159 | 178 |
|
160 | 179 | DrawBottomBar(nullptr, "\ue044 Exit", "\ue001 Back");
|
161 | 180 | }
|
|
0 commit comments