experimental: add improved dvb table (+ conversion script)

This commit is contained in:
Lightos1
2026-05-11 19:35:48 +02:00
parent 9122768953
commit 2f21f23266
5 changed files with 217 additions and 224 deletions

View File

@@ -820,16 +820,16 @@ namespace ams::ldr::hoc::pcv::mariko {
static_cast<u32>((v)[1]), \
static_cast<u32>((v)[2])
DvbEntry emcDvbTableNew[] = {
{ 204000, { 637, 637, 637, } },
{ 1331200, { 650, 637, 637, } },
{ 1600000, { 675, 650, 637, } },
{ 1866000, { DVB(DvbVolt(700, 675, 650)) } },
{ 2133000, { DVB(DvbVolt(725, 700, 675)) } },
{ 2400000, { DVB(DvbVolt(750, 725, 700)) } },
{ 2666000, { DVB(DvbVolt(775, 750, 725)) } },
{ 2933000, { DVB(DvbVolt(800, 775, 750)) } },
{ 3200000, { DVB(DvbVolt(800, 800, 775)) } },
{ 0xFFFFFFFF, { } },
{ 204000, { 637, 637, 637, }, },
{ 1331200, { 650, 637, 637, }, },
{ 1600000, { 675, 650, 637, }, },
{ 1866000, { DVB(DvbVolt( 700, 675, 650)) }, },
{ 2133000, { DVB(DvbVolt( 725, 700, 675)) }, },
{ 2400000, { DVB(DvbVolt( 750, 725, 700)) }, },
{ 2666000, { DVB(DvbVolt( 850, 825, 800)) }, },
{ 2933000, { DVB(DvbVolt( 950, 925, 900)) }, },
{ 3200000, { DVB(DvbVolt(1050, 1025, 1000)) }, },
{ 0xFFFFFFFF, { }, },
};
#undef DVB

View File

@@ -0,0 +1,95 @@
#include <cstdio>
#include <cstdint>
#include <iterator>
typedef uint32_t u32;
typedef int32_t s32;
struct DvbEntry {
u32 freq;
u32 volts[3];
};
DvbEntry oldDvbTable[] = {
{ 204000, { 637, 637, 637, }, },
{ 1331200, { 650, 637, 637, }, },
{ 1600000, { 675, 650, 637, }, },
{ 1866000, { 700, 675, 650, }, },
{ 2133000, { 725, 700, 675, }, },
{ 2400000, { 750, 725, 700, }, },
{ 2666000, { 775, 750, 725, }, },
{ 2933000, { 800, 775, 750, }, },
{ 3200000, { 800, 800, 775, }, },
};
DvbEntry newDvbTable[] = {
{ 204000, { 637, 637, 637, }, },
{ 1331200, { 650, 637, 637, }, },
{ 1600000, { 675, 650, 637, }, },
{ 1866000, { 700, 675, 650, }, },
{ 2133000, { 725, 700, 675, }, },
{ 2400000, { 750, 725, 700, }, },
{ 2666000, { 850, 825, 800, }, },
{ 2933000, { 950, 925, 900, }, },
{ 3200000, { 1050, 1025, 1000, }, },
};
constexpr u32 DvbTableSize = std::size(oldDvbTable);
u32 PrintAndScan(const char *message) {
u32 scanV;
printf("%s: ", message);
scanf("%i", &scanV);
return scanV;
}
u32 GetProcessId(u32 speedo) {
if (speedo <= 1597) {
return 0;
}
if (speedo <= 1708) {
return 1;
}
/* >= 1709. */
return 2;
}
u32 GetVoltageAndIndex(u32 dvbShift, u32 emc, u32 processId, DvbEntry *dvbTable, u32 &index) {
for (u32 i = 0; i < DvbTableSize - 1; ++i) {
if (emc < dvbTable[i].freq || emc >= dvbTable[i + 1].freq) {
continue;
}
index = i;
return dvbTable[i].volts[processId] + (25 * dvbShift);
}
return 0;
}
s32 GetShift(u32 oldVoltage, u32 processId, DvbEntry *dvbTable, u32 index) {
return (oldVoltage - dvbTable[index].volts[processId]) / 25;
}
int main() {
u32 oldDvb = PrintAndScan("Enter old dvb shift");
u32 emcMaxMhz = PrintAndScan("Enter max ram freq (MHz)");
u32 speedo = PrintAndScan("Enter soc speedo");
u32 emcMaxKhz = emcMaxMhz * 1000;
u32 processId = GetProcessId(speedo);
u32 tableIndex = 0;
u32 oldVoltage = GetVoltageAndIndex(oldDvb, emcMaxKhz, processId, oldDvbTable, tableIndex);
if (oldVoltage == 0 || tableIndex == 0) {
printf("Invalid values!\n");
return -1;
}
s32 newShift = GetShift(oldVoltage, processId, newDvbTable, tableIndex);
printf("New dvb table shift: %d", newShift);
}

View File

@@ -0,0 +1,112 @@
from dataclasses import dataclass
from typing import List
u32 = int
s32 = int
@dataclass
class DvbEntry:
freq: u32
volts: List[u32]
old_dvb_table = [
DvbEntry(204000, [637, 637, 637]),
DvbEntry(1331200, [650, 637, 637]),
DvbEntry(1600000, [675, 650, 637]),
DvbEntry(1866000, [700, 675, 650]),
DvbEntry(2133000, [725, 700, 675]),
DvbEntry(2400000, [750, 725, 700]),
DvbEntry(2666000, [775, 750, 725]),
DvbEntry(2933000, [800, 775, 750]),
DvbEntry(3200000, [800, 800, 775]),
]
new_dvb_table = [
DvbEntry(204000, [637, 637, 637]),
DvbEntry(1331200, [650, 637, 637]),
DvbEntry(1600000, [675, 650, 637]),
DvbEntry(1866000, [700, 675, 650]),
DvbEntry(2133000, [725, 700, 675]),
DvbEntry(2400000, [750, 725, 700]),
DvbEntry(2666000, [850, 825, 800]),
DvbEntry(2933000, [950, 925, 900]),
DvbEntry(3200000, [1050, 1025, 1000]),
]
DVB_TABLE_SIZE = len(old_dvb_table)
def print_and_scan(message: str) -> u32:
return int(input(f"{message}: "))
def get_process_id(speedo: u32) -> u32:
if speedo <= 1597:
return 0
if speedo <= 1708:
return 1
# >= 1709
return 2
def get_voltage_and_index(
dvb_shift: u32,
emc: u32,
process_id: u32,
dvb_table: List[DvbEntry],
):
for i in range(DVB_TABLE_SIZE - 1):
if emc < dvb_table[i].freq or emc >= dvb_table[i + 1].freq:
continue
voltage = dvb_table[i].volts[process_id] + (25 * dvb_shift)
return voltage, i
return 0, 0
def get_shift(
old_voltage: u32,
process_id: u32,
dvb_table: List[DvbEntry],
index: u32,
) -> s32:
return (old_voltage - dvb_table[index].volts[process_id]) // 25
def main():
old_dvb = print_and_scan("Enter old dvb shift")
emc_max_mhz = print_and_scan("Enter max ram freq (MHz)")
speedo = print_and_scan("Enter soc speedo")
emc_max_khz = emc_max_mhz * 1000
process_id = get_process_id(speedo)
old_voltage, table_index = get_voltage_and_index(
old_dvb,
emc_max_khz,
process_id,
old_dvb_table,
)
if old_voltage == 0 or table_index == 0:
print("Invalid values!")
return
new_shift = get_shift(
old_voltage,
process_id,
new_dvb_table,
table_index,
)
print(f"New dvb table shift: {new_shift}")
if __name__ == "__main__":
main()

214
dist/README.md vendored
View File

@@ -1,214 +0,0 @@
<div align="center">
<img src="assets/logo.png" alt="logo" width="768"/>
---
![License: GPL-2.0](https://img.shields.io/badge/GPL--2.0-red?style=for-the-badge)
![Nintendo Switch](https://img.shields.io/badge/Nintendo_Switch-E60012?style=for-the-badge\&logo=nintendo-switch\&logoColor=white)
[![Discord](https://img.shields.io/badge/Discord-5865F2?style=for-the-badge\&logo=discord\&logoColor=white)](https://dsc.gg/horizonoc)
![VSCode](https://img.shields.io/badge/VSCode-0078D4?style=for-the-badge\&logo=visual%20studio%20code\&logoColor=white)
![Made with Notepad++](assets/np++.png?raw=true)
![C++](https://img.shields.io/badge/C%2B%2B-00599C?style=for-the-badge\&logo=c%2B%2B\&logoColor=white)
![Downloads](https://img.shields.io/github/downloads/Horizon-OC/Horizon-OC/total.svg?style=for-the-badge)
---
</div>
## ⚠️ Disclaimer
> **THIS TOOL CAN BE DANGEROUS IF MISUSED. PROCEED WITH CAUTION.**
> Due to the design of Horizon OS, **overclocking RAM can cause NAND OR SD CORRUPTION.**
> Ensure you have a **full NAND, PROINFO, EMUMMC and SD backup** before proceeding.
---
## About
**Horizon OC** is an open-source overclocking tool for Nintendo Switch consoles running **Atmosphere custom firmware**.
It enables advanced CPU, GPU, and RAM tuning with user-friendly configuration tools.
---
## Default clocks
* **CPU:** Up to 1963MHz (Mariko) / 1785MHz (Erista)
* **GPU:** Up to 1075MHz (Mariko) / 921MHz (Erista)
* **RAM:** Up to 1866/2133MHz (Mariko) / 1600MHz (Erista)
* Over/undervolting support
* Built-in configurator
* Compatible with most homebrew
> It is recommended to read the [guide](https://rentry.co/howtoget60fps) before proceeding, as this can help you get a *significant* performance boost over the default settings, often times with less power draw and heat output
---
## Installation
1. Ensure you have the latest versions of
* [Atmosphere](https://github.com/Atmosphere-NX/Atmosphere)
* [Ultrahand Overlay](https://github.com/ppkantorski/Ultrahand-Overlay)
2. Download and extract the **Horizon OC Package** to the root of your SD card.
3. If using **Hekate**, edit `hekate_ipl.ini` to include:
```
kip1=atmosphere/kips/hoc.kip
```
*(No changes needed if using fusee.)*
---
## Configuration
1. Open the Horizon OC Overlay
2. Open the settings menu
3. Adjust your overclocking settings as desired. A helpful guide can be found [here.](https://rentry.co/mariko#oc-settings-for-horizon-oc)
4. Click **Save KIP Settings** to apply your configuration.
---
## Building from Source
Refer to COMPILATION.md
---
## Clock table
### MEM clocks (mhz)
* 3200 → max on mariko, JEDEC.
* 3166
* 3133
* 3100
* 3066
* 3033
* 3000
* 2966
* 2933 → JEDEC.
* 2900
* 2866
* 2833
* 2800
* 2766
* 2733
* 2700
* 2666 → JEDEC.
* 2633
* 2600
* 2566
* 2533
* 2500
* 2466
* 2433
* 2400 → max on erista, JEDEC.
* 2366
* 2333
* 2300
* 2266
* 2233
* 2200
* 2166
* 2133 → Mariko JEDEC standard max (4266 Modules)
* 2100
* 2066
* 2033
* 2000
* 1996 → JEDEC standard
* 1966
* 1933
* 1900
* 1866 → Mariko JEDEC standard max (3733 Modules)
* 1833
* 1800
* 1766
* 1733
* 1700
* 1666
* 1633
* 1600 → official docked, boost mode, Erista JEDEC standard max (3200 Modules), JEDEC.
* 1331 → official handheld, JEDEC.
* 1065
* 800
* 665
### CPU clocks (mhz)
* 2703 → mariko absolute max, dangerous
* 2601 → unsafe
* 2499
* 2397 → mariko safe max with UV (low speedo)
* 2295
* 2193
* 2091
* 1963 → mariko no UV max clock
* 1887
* 1785 → erista no UV max clock, boost mode
* 1683
* 1581
* 1428
* 1326
* 1224 → sdev oc
* 1122
* 1020 → official docked & handheld
* 918
* 816
* 714
* 612 → sleep mode
### GPU clocks (mhz)
* 1536 → absolute max clock on mariko. very dangerous
* 1459
* 1382
* 1305
* 1267 → NVIDIA T214(mariko) rating
* 1228 → mariko High UV safe clock
* 1152 → mariko hiOpt-15mV max clock
* 1075 → mariko hiOpt max clock. absolute max clock on erista. very dangerous
* 998 → NVIDIA T210 (erista) rating
* 960 (erista only) → erista high uv/hiOpt-15mV safe max clock
* 921 → erista no UV max clock
* 844
* 768 → official docked
* 691
* 614
* 537
* 460 → max handheld
* 384 → official handheld
* 307 → official handheld
* 230
* 153
* 76 → boost mode
**Notes:**
1. On Erista, CPU in handheld is capped to 1581MHz
2. GPU overclock is capped at 460MHz on erista in handheld
3. On Mariko, cap with hiOpt is 614MHz, with hiOpt-15mV it is 691MHz and with High UV it's 768MHz
4. Clocks higher than 768MHz on erista need the official charger is plugged in.
---
## Credits
* **Lightos's Cat** - Cat
* **Souldbminer** - hoc-clk and loader development
* **Lightos** - Loader patches development, hoc-clk development, guides
* **TDRR** - HOC Logo Design
* **tetetete-ctrl** - Website design
* **SciresM** - Atmosphere CFW
* **CTCaer** - L4T, Hekate, proper RAM timings
* **KazushiMe** - Switch OC Suite
* **Hanai3bi (Meha)** - Switch OC Suite, EOS, sys-clk-eos
* **NaGaa95** - L4T-OC kernel, Status Monitor fork
* **B3711 (halop)** - EOS, contributions
* **sys-clk team (m4xw, p-sam, natinusala)** - sys-clk
* **Dominatorul** - Soctherm driver, guides, general help
* **ppkantorski** - Ultrahand sys-clk & Status Monitor fork
* **MasaGratoR and ZachyCatGames** - General help
* **MasaGratoR** - Status Monitor & Display Refresh Rate driver
* **Dominatorul, Samybigio, Arcdelta, Miki, Happy, Winnerboi77, Blaise, Alvise, agjeococh, frost, letum00, and Xenshen** - Testing
* **Samybigio2011, Miki** - Italian translations
* **angelblaster** - Korean translations
* **q1332348216-glitch** - Chinese translations
* **Nvidia** - [Tegra X1 Technical Reference Manual](https://developer.nvidia.com/embedded/dlc/tegra-x1-technical-reference-manual), soctherm driver, L4T

Binary file not shown.