add kip version detection + version mismatch warning

This commit is contained in:
Lightos1
2026-05-08 20:44:28 +02:00
parent d443e069fd
commit 848a788c5f
4 changed files with 47 additions and 22 deletions

View File

@@ -78,9 +78,11 @@ typedef struct {
// FPS / Resolution // FPS / Resolution
u8 fps; u8 fps;
u16 resolutionHeight; u16 resolutionHeight;
u8 custRev;
u16 kipVersion;
// Reserved for future use // Reserved for future use
u8 reserved[0x368]; u8 reserved[0x363];
} HocClkContext; } HocClkContext;
typedef struct typedef struct

View File

@@ -22,6 +22,8 @@
#include "cat.h" #include "cat.h"
#include "ult_ext.h" #include "ult_ext.h"
// tsl::elm::ListItem* custRevItem = NULL;
tsl::elm::ListItem* kipVersionItem = NULL;
tsl::elm::ListItem* SpeedoItem = NULL; tsl::elm::ListItem* SpeedoItem = NULL;
tsl::elm::ListItem* IddqItem = NULL; tsl::elm::ListItem* IddqItem = NULL;
tsl::elm::ListItem* DramModule = NULL; tsl::elm::ListItem* DramModule = NULL;
@@ -133,6 +135,12 @@ void AboutGui::listUI()
new tsl::elm::CategoryHeader("Software Info") new tsl::elm::CategoryHeader("Software Info")
); );
// custRevItem = new tsl::elm::ListItem("CUST revision:");
// this->listElement->addItem(custRevItem);
kipVersionItem = new tsl::elm::ListItem("Kip version:");
this->listElement->addItem(kipVersionItem);
if(!IsHoag()) { if(!IsHoag()) {
sysdockStatusItem = sysdockStatusItem =
new tsl::elm::ListItem("sys-dock status:"); new tsl::elm::ListItem("sys-dock status:");
@@ -210,7 +218,7 @@ void AboutGui::listUI()
); );
this->listElement->addItem( this->listElement->addItem(
new tsl::elm::ListItem("Delta") new tsl::elm::ListItem("arcdelta")
); );
this->listElement->addItem( this->listElement->addItem(
@@ -255,7 +263,7 @@ void AboutGui::listUI()
); );
this->listElement->addItem( this->listElement->addItem(
new tsl::elm::ListItem("ScriesM - Atmosphere CFW") new tsl::elm::ListItem("SciresM - Atmosphere CFW")
); );
this->listElement->addItem( this->listElement->addItem(
@@ -263,7 +271,7 @@ void AboutGui::listUI()
); );
this->listElement->addItem( this->listElement->addItem(
new tsl::elm::ListItem("hanai3bi - Switch OC Suite & EOS") new tsl::elm::ListItem("hanai3Bi - Switch OC Suite & EOS")
); );
this->listElement->addItem( this->listElement->addItem(
@@ -357,6 +365,10 @@ void AboutGui::refresh()
SpeedoItem->setValue(strings[0]); SpeedoItem->setValue(strings[0]);
IddqItem->setValue(strings[1]); IddqItem->setValue(strings[1]);
DramModule->setValue(formatRamModule()); DramModule->setValue(formatRamModule());
// custRevItem->setValue(std::to_string(this->context->custRev));
kipVersionItem->setValue(std::to_string((this->context->kipVersion / 100) % 10) + "." + std::to_string((this->context->kipVersion / 10) % 10) + "." + std::to_string( this->context->kipVersion % 10));
if(!IsHoag()) if(!IsHoag())
sysdockStatusItem->setValue(this->context->isSysDockInstalled ? "Installed" : "Not Installed"); sysdockStatusItem->setValue(this->context->isSysDockInstalled ? "Installed" : "Not Installed");

View File

@@ -18,8 +18,11 @@
#include "kip.hpp" #include "kip.hpp"
#include "board/board.hpp" #include "board/board.hpp"
#include "file_utils.hpp" #include "file_utils.hpp"
#include "clock_manager.hpp"
#define CUST_REV 2 #define CUST_REV 2
#define KIP_VERSION 220
namespace kip { namespace kip {
bool kipAvailable = false; bool kipAvailable = false;
@@ -58,7 +61,6 @@ namespace kip {
// return; // return;
// } // }
CUST_WRITE_FIELD_BATCH(&table, custRev, config::GetConfigValue(KipConfigValue_custRev));
// CUST_WRITE_FIELD_BATCH(&table, mtcConf, config::GetConfigValue(KipConfigValue_mtcConf)); // CUST_WRITE_FIELD_BATCH(&table, mtcConf, config::GetConfigValue(KipConfigValue_mtcConf));
CUST_WRITE_FIELD_BATCH(&table, hpMode, config::GetConfigValue(KipConfigValue_hpMode)); CUST_WRITE_FIELD_BATCH(&table, hpMode, config::GetConfigValue(KipConfigValue_hpMode));
@@ -200,6 +202,14 @@ namespace kip {
configValues.values[KipCrc32] = (u64)crc32::checksum_file("sdmc:/atmosphere/kips/hoc.kip"); // write checksum configValues.values[KipCrc32] = (u64)crc32::checksum_file("sdmc:/atmosphere/kips/hoc.kip"); // write checksum
// configValues.values[KipConfigValue_mtcConf] = cust_get_mtc_conf(&table); // configValues.values[KipConfigValue_mtcConf] = cust_get_mtc_conf(&table);
clockManager::gContext.custRev = cust_get_cust_rev(&table);
u16 kipVersion = cust_get_kip_version(&table);
if (kipVersion != KIP_VERSION) {
notification::writeNotification("Horizon OC\nKip version mismatch detected!");
}
clockManager::gContext.kipVersion = kipVersion;
configValues.values[KipConfigValue_hpMode] = cust_get_hp_mode(&table); configValues.values[KipConfigValue_hpMode] = cust_get_hp_mode(&table);
configValues.values[KipConfigValue_commonEmcMemVolt] = cust_get_common_emc_volt(&table); configValues.values[KipConfigValue_commonEmcMemVolt] = cust_get_common_emc_volt(&table);

View File

@@ -34,7 +34,7 @@ namespace kip {
typedef struct { typedef struct {
u8 cust[4]; u8 cust[4];
u32 custRev; u32 custRev;
u32 hocVersion; u32 kipVersion;
u32 hpMode; u32 hpMode;
u32 commonEmcMemVolt; u32 commonEmcMemVolt;
u32 eristaEmcMaxClock; u32 eristaEmcMaxClock;
@@ -206,7 +206,7 @@ namespace kip {
return cust_write_table(path, &t); \ return cust_write_table(path, &t); \
} while (0) } while (0)
static inline bool cust_set_cust_rev(const char* p, u32 v) { CUST_WRITE_FIELD(p, custRev, v); } // static inline bool cust_set_cust_rev(const char* p, u32 v) { CUST_WRITE_FIELD(p, custRev, v); }
// static inline bool cust_set_mtc_conf(const char* p, u32 v) { CUST_WRITE_FIELD(p, mtcConf, v); } // static inline bool cust_set_mtc_conf(const char* p, u32 v) { CUST_WRITE_FIELD(p, mtcConf, v); }
static inline bool cust_set_hp_mode(const char* p, u32 v) { CUST_WRITE_FIELD(p, hpMode, v); } static inline bool cust_set_hp_mode(const char* p, u32 v) { CUST_WRITE_FIELD(p, hpMode, v); }
@@ -295,6 +295,7 @@ namespace kip {
#define CUST_GET_FIELD(table, field) ((table) ? (table)->field : 0) #define CUST_GET_FIELD(table, field) ((table) ? (table)->field : 0)
static inline u32 cust_get_cust_rev(const CustomizeTable* t) { return CUST_GET_FIELD(t, custRev); } static inline u32 cust_get_cust_rev(const CustomizeTable* t) { return CUST_GET_FIELD(t, custRev); }
static inline u32 cust_get_kip_version(const CustomizeTable* t) { return CUST_GET_FIELD(t, kipVersion); }
// static inline u32 cust_get_mtc_conf(const CustomizeTable* t) { return CUST_GET_FIELD(t, mtcConf); } // static inline u32 cust_get_mtc_conf(const CustomizeTable* t) { return CUST_GET_FIELD(t, mtcConf); }
static inline u32 cust_get_hp_mode(const CustomizeTable* t) { return CUST_GET_FIELD(t, hpMode); } static inline u32 cust_get_hp_mode(const CustomizeTable* t) { return CUST_GET_FIELD(t, hpMode); }