diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp index a5f5baaf..8458b469 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.cpp @@ -89,6 +89,7 @@ volatile CustomizeTable C = { .marikoGpuUV = 0, + .eristaCpuUV = 0, .eristaGpuUV = 0, @@ -115,6 +116,7 @@ volatile CustomizeTable C = { .mem_burst_latency = 2, // NOTE: These tables should NOT BE USED and are only here as placeholders. Always try and find your own optimal tables. +// Ensure the voltages actually increase or stay the sameot .marikoGpuVoltArray = { 610 /* 76 */, @@ -132,7 +134,7 @@ volatile CustomizeTable C = { 675 /* 998 */, 710 /* 1075 */, 735 /* 1152 */, - 785 /* 1228 */, + 785 /* 1228 (Only safe if GPU Scheduling is on)*/, 0 /* 1267 (Disabled by default) */, 0 /* 1305 (Disabled by default) */, 0 /* 1344 (Disabled by default) */, @@ -156,7 +158,7 @@ volatile CustomizeTable C = { 875 /* 691 */, 900 /* 768 */, 950 /* 844 */, - 900 /* 921 */, + 975 /* 921 */, 0 /* 998 (Disabled by default) */, 0 /* 1075 (Disabled by default) */, }, @@ -164,6 +166,12 @@ volatile CustomizeTable C = { .marikoCpuVmin = 600, +.eristaGpuVmin = 810, + +.marikoGpuVmin = 610, + +.marikoGpuVmax = 800, + /* Advanced Settings: * - Erista CPU DVFS Table: */ diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp index e87bee3b..703ea2b0 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/customize.hpp @@ -86,7 +86,10 @@ u32 marikoCpuVmin; - + u32 eristaGpuVmin; + u32 marikoGpuVmin; + u32 marikoGpuVmax; + CustomizeCpuDvfsTable eristaCpuDvfsTable; CustomizeCpuDvfsTable marikoCpuDvfsTable; CustomizeCpuDvfsTable marikoCpuDvfsTableSLT; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp index c6201f1b..9579be2d 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv.hpp @@ -48,12 +48,17 @@ namespace ams::ldr::oc::pcv {1963500, {1675751, -38635, 27}, {1120000}}, {}, }; + + constexpr int gpuVmax = 750; + + constexpr int gpuVmin = 610; constexpr u16 CpuMinVolts[] = {800, 637, 620, 610}; constexpr u32 CpuClkOfficial = 1963'500; constexpr u32 CpuVoltOfficial = 1120; + constexpr cvb_entry_t GpuCvbTableDefault[] = { // GPUB01_NA_CVB_TABLE {76800, {}, { @@ -184,6 +189,10 @@ namespace ams::ldr::oc::pcv {}, }; + constexpr int gpuVmin = 810; + + constexpr u32 CpuVoltOfficial = 1235; + constexpr u32 CpuVoltL4T = 1235'000; constexpr u16 CpuMinVolts[] = {950, 850, 825, 810}; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp index ec9a180c..e16864b3 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_erista.cpp @@ -21,7 +21,33 @@ namespace ams::ldr::oc::pcv::erista { - + Result CpuFreqVdd(u32* ptr) { + dvfs_rail* entry = reinterpret_cast(reinterpret_cast(ptr) - offsetof(dvfs_rail, freq)); + + R_UNLESS(entry->id == 1, ldr::ResultInvalidCpuFreqVddEntry()); + R_UNLESS(entry->min_mv == 250'000, ldr::ResultInvalidCpuFreqVddEntry()); + R_UNLESS(entry->step_mv == 5000, ldr::ResultInvalidCpuFreqVddEntry()); + R_UNLESS(entry->max_mv == 1525'000, ldr::ResultInvalidCpuFreqVddEntry()); + + if (C.eristaCpuUV) { + if(!C.enableEristaCpuUnsafeFreqs) { + PATCH_OFFSET(ptr, GetDvfsTableLastEntry(C.eristaCpuDvfsTable)->freq); + } else { + PATCH_OFFSET(ptr, GetDvfsTableLastEntry(C.eristaCpuDvfsTableUnsafeFreqs)->freq); + } + } else { + PATCH_OFFSET(ptr, GetDvfsTableLastEntry(C.eristaCpuDvfsTable)->freq); + } + + R_SUCCEED(); + } + Result GpuVmin(u32 *ptr) + { + if (!C.eristaGpuVmin) + R_SKIP(); + PATCH_OFFSET(ptr, (int)C.eristaGpuVmin); + R_SUCCEED(); + } Result CpuVoltRange(u32 *ptr) { u32 min_volt_got = *(ptr - 1); @@ -41,42 +67,37 @@ Result CpuVoltDfll(u32* ptr) { cvb_cpu_dfll_data *entry = reinterpret_cast(ptr); - R_UNLESS(entry->tune0_low == 0x0000FFCF, ldr::ResultInvalidCpuVoltDfllEntry()); - R_UNLESS(entry->tune0_high == 0x00000000, ldr::ResultInvalidCpuVoltDfllEntry()); - R_UNLESS(entry->tune1_low == 0x012207FF, ldr::ResultInvalidCpuVoltDfllEntry()); - R_UNLESS(entry->tune1_high == 0x03FFF7FF, ldr::ResultInvalidCpuVoltDfllEntry()); +// R_UNLESS(entry->tune0_low == 0x0000FFCF, ldr::ResultInvalidCpuVoltDfllEntry()); +// R_UNLESS(entry->tune0_high == 0x00000000, ldr::ResultInvalidCpuVoltDfllEntry()); +// R_UNLESS(entry->tune1_low == 0x012207FF, ldr::ResultInvalidCpuVoltDfllEntry()); +// R_UNLESS(entry->tune1_high == 0x03FFF7FF, ldr::ResultInvalidCpuVoltDfllEntry()); + if(!C.eristaCpuUV) { + R_SKIP(); + } + PATCH_OFFSET(&(entry->dvco_calibration_max), 0x1C); + PATCH_OFFSET(&(entry->tune1_high), 0x10); + PATCH_OFFSET(&(entry->tune_high_margin_millivolts), 0xc); + switch(C.eristaCpuUV) { - case 0: - break; case 1: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FF88); //process_id 0 // EOS UV2 - PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); - PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); - PATCH_OFFSET(&(entry->tune1_high), 0x00000000); + PATCH_OFFSET(&(entry->tune0_low), 0x0000FFFF); //process_id 0 // EOS UV1 + PATCH_OFFSET(&(entry->tune1_low), 0x027007FF); break; case 2: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FF90); //process_id 1 // EOS Uv2 - PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); - PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); - PATCH_OFFSET(&(entry->tune1_high), 0x00000000); + PATCH_OFFSET(&(entry->tune0_low), 0x0000EFFF); //process_id 1 // EOS Uv2 + PATCH_OFFSET(&(entry->tune1_low), 0x027407FF); break; case 3: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FF98); //process_id 0 // EOS UV3 - PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); - PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); - PATCH_OFFSET(&(entry->tune1_high), 0x00000000); + PATCH_OFFSET(&(entry->tune0_low), 0x0000DFFF); //process_id 0 // EOS UV3 + PATCH_OFFSET(&(entry->tune1_low), 0x027807FF); break; case 4: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FFA0); //process_id 1 // EOS Uv4 - PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); - PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); - PATCH_OFFSET(&(entry->tune1_high), 0x00000000); + PATCH_OFFSET(&(entry->tune0_low), 0x0000DFDF); //process_id 1 // EOS Uv4 + PATCH_OFFSET(&(entry->tune1_low), 0x027A07FF); break; case 5: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FFFF); // EOS UV6 - PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); - PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); - PATCH_OFFSET(&(entry->tune1_high), 0x022217FF); + PATCH_OFFSET(&(entry->tune0_low), 0x0000CFDF); // EOS UV5 + PATCH_OFFSET(&(entry->tune1_low), 0x037007FF); break; default: break; @@ -337,9 +358,10 @@ u32 GpuCvbDefaultMaxFreq = static_cast(GetDvfsTableLastEntry(GpuCvbTableDefault)->freq); PatcherEntry patches[] = { + { "CPU Freq Vdd", &CpuFreqVdd, 1, nullptr, CpuClkOSLimit }, {"CPU Freq Table", CpuFreqCvbTable, 1, nullptr, CpuCvbDefaultMaxFreq}, - {"CPU Volt Limit", &CpuVoltRange, 0, &CpuMaxVoltPatternFn}, - { "CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0x0000FFCF }, + { "CPU Volt Limit", &CpuVoltRange, 13, nullptr, CpuVoltOfficial }, + { "CPU Volt Dfll", &CpuVoltDfll, 1, nullptr, 0xFFEAD0FF }, {"GPU Freq Table", GpuFreqCvbTable, 1, nullptr, GpuCvbDefaultMaxFreq}, {"GPU Freq Asm", &GpuFreqMaxAsm, 2, &GpuMaxClockPatternFn}, {"GPU Freq PLL", &GpuFreqPllLimit, 1, nullptr, GpuClkPllLimit}, @@ -347,6 +369,7 @@ {"MEM Freq Max", &MemFreqMax, 0, nullptr, EmcClkOSLimit}, {"MEM Freq PLLM", &MemFreqPllmLimit, 2, nullptr, EmcClkPllmLimit}, {"MEM Volt", &MemVoltHandler, 2, nullptr, MemVoltHOS}, + {"GPU Vmin", &GpuVmin, 0, nullptr, gpuVmin}, }; for (uintptr_t ptr = mapped_nso; diff --git a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp index c10b52cb..1fa71784 100644 --- a/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/oc/pcv/pcv_mariko.cpp @@ -21,6 +21,22 @@ namespace ams::ldr::oc::pcv::mariko { +Result GpuVmin(u32 *ptr) +{ + if (!C.marikoGpuVmin) + R_SKIP(); + PATCH_OFFSET(ptr, (int)C.marikoGpuVmin); + R_SUCCEED(); +} + +Result GpuVmax(u32 *ptr) +{ + if (!C.marikoGpuVmax) + R_SKIP(); + PATCH_OFFSET(ptr, (int)C.marikoGpuVmax); + R_SUCCEED(); +} + Result CpuFreqVdd(u32* ptr) { dvfs_rail* entry = reinterpret_cast(reinterpret_cast(ptr) - offsetof(dvfs_rail, freq)); @@ -78,31 +94,31 @@ case 0: break; case 1: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FF88); //process_id 0 // EOS UV2 + PATCH_OFFSET(&(entry->tune0_low), 0x0000FF88); //process_id 0 // EOS UV1 PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); PATCH_OFFSET(&(entry->tune1_high), 0x00000000); break; case 2: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FF90); //process_id 1 // EOS Uv2 + PATCH_OFFSET(&(entry->tune0_low), 0x0000FF90); /// EOS Uv2 PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); PATCH_OFFSET(&(entry->tune1_high), 0x00000000); break; case 3: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FF98); //process_id 0 // EOS UV3 + PATCH_OFFSET(&(entry->tune0_low), 0x0000FF98); // EOS UV3 PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); PATCH_OFFSET(&(entry->tune1_high), 0x00000000); break; case 4: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FFA0); //process_id 1 // EOS Uv4 + PATCH_OFFSET(&(entry->tune0_low), 0x0000FFA0); // EOS Uv4 PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); PATCH_OFFSET(&(entry->tune1_high), 0x00000000); break; case 5: - PATCH_OFFSET(&(entry->tune0_low), 0x0000FFFF); // EOS UV6 + PATCH_OFFSET(&(entry->tune0_low), 0x0000FFFF); // EOS UV5 PATCH_OFFSET(&(entry->tune0_high), 0x0000FFFF); PATCH_OFFSET(&(entry->tune1_low), 0x021107FF); PATCH_OFFSET(&(entry->tune1_high), 0x022217FF); @@ -647,7 +663,9 @@ { "MEM Freq Max", &MemFreqMax, 0, nullptr, EmcClkOSLimit }, { "MEM Freq PLLM", &MemFreqPllmLimit, 2, nullptr, EmcClkPllmLimit }, { "MEM Vddq", &EmcVddqVolt, 2, nullptr, EmcVddqDefault }, - { "MEM Vdd2", &MemVoltHandler, 2, nullptr, MemVdd2Default } + { "MEM Vdd2", &MemVoltHandler, 2, nullptr, MemVdd2Default }, + { "GPU Vmin", &GpuVmin, 0, nullptr, gpuVmin}, + { "GPU Vmax", &GpuVmax, 0, nullptr, gpuVmax}, }; for (uintptr_t ptr = mapped_nso; diff --git a/Source/Configurator/src/__pycache__/gpu.cpython-313.pyc b/Source/Configurator/src/__pycache__/gpu.cpython-313.pyc index 22cddcaf..23bf7c31 100644 Binary files a/Source/Configurator/src/__pycache__/gpu.cpython-313.pyc and b/Source/Configurator/src/__pycache__/gpu.cpython-313.pyc differ diff --git a/Source/Configurator/src/__pycache__/kip.cpython-313.pyc b/Source/Configurator/src/__pycache__/kip.cpython-313.pyc index 4ff6b878..0e1124c5 100644 Binary files a/Source/Configurator/src/__pycache__/kip.cpython-313.pyc and b/Source/Configurator/src/__pycache__/kip.cpython-313.pyc differ diff --git a/Source/Configurator/src/__pycache__/misc.cpython-313.pyc b/Source/Configurator/src/__pycache__/misc.cpython-313.pyc index 8a97d87e..23b64b11 100644 Binary files a/Source/Configurator/src/__pycache__/misc.cpython-313.pyc and b/Source/Configurator/src/__pycache__/misc.cpython-313.pyc differ diff --git a/Source/Configurator/src/__pycache__/ram.cpython-313.pyc b/Source/Configurator/src/__pycache__/ram.cpython-313.pyc index d5f20d78..c3ffbf2d 100644 Binary files a/Source/Configurator/src/__pycache__/ram.cpython-313.pyc and b/Source/Configurator/src/__pycache__/ram.cpython-313.pyc differ diff --git a/Source/Configurator/src/gpu.py b/Source/Configurator/src/gpu.py index 60e83681..3f84b679 100644 --- a/Source/Configurator/src/gpu.py +++ b/Source/Configurator/src/gpu.py @@ -65,6 +65,11 @@ def populate(): voltages_e = [0] + list(range(700, 1100 + 1, 5)) # 0 first for Disabled processed_voltages_e = ["Disabled" if v == 0 else f"{v} mV" for v in voltages_e] processed_voltages_default = ["Default" if v == 0 else f"{v} mV" for v in voltages] + voltages_vmin = [0] + list(range(480, 650 + 1, 5)) # 0 first for Disabled + processed_voltages_vmin = ["Disabled" if v == 0 else f"{v} mV" for v in voltages_vmin] + voltages_vmin_e = [0] + list(range(700, 850 + 1, 5)) # 0 first for Disabled + processed_voltages_vmin_e = ["Disabled" if v == 0 else f"{v} mV" for v in voltages_vmin_e] + freqs_khz = [ 76800, 153600, 230400, 307200, 384000, 460800, 537600, 614400, 691200, 768000, 844800, 921600, 998400, 1075200, 1152000, 1228800, 1267200, 1305600, 1344000, 1382400, 1420800, @@ -72,7 +77,7 @@ def populate(): ] freqs_khz_e = [ 76800, 153600, 230400, 307200, 384000, 460800, 537600, 614400, 691200, 768000, - 844800, 921600, 998400, 1075200, 1152000 + 844800, 921600, 998400, 1075200 #, 1152000, 1228800 # Disabled by default as these freqs can cause board damage ] freqs_mhz = [ 76.8, 153.6, 230.4, 307.2, 384.0, 460.8, 537.6, 614.4, 691.2, 768.0, @@ -119,20 +124,28 @@ def populate(): small=True, tag="volt_info" ) - # dpg.add_combo( - # items=processed_voltages, - # default_value="Disabled", - # label="Gpu vMin", - # callback=k.grab_kip_storage_values_no_mult, - # tag="g_vmin" - # ) - # dpg.add_combo( - # items=processed_voltages, - # default_value="Disabled", - # label="Gpu vMax", - # callback=k.grab_kip_storage_values_no_mult, - # tag="g_vmax" - # ) + dpg.add_combo( + items=processed_voltages_vmin_e, + default_value="Disabled", + label="Erista GPU vMin", + callback=k.grab_kip_storage_values_no_mult, + tag="eristaGpuVmin" + ) + dpg.add_combo( + items=processed_voltages_vmin, + default_value="Disabled", + label="Mariko GPU vMin", + callback=k.grab_kip_storage_values_no_mult, + tag="marikoGpuVmin" + ) + + dpg.add_combo( + items=processed_voltages, + default_value="Disabled", + label="Mariko GPU vMax", + callback=k.grab_kip_storage_values_no_mult, + tag="marikoGpuVmax" + ) dpg.add_separator(label="Undervolt") diff --git a/Source/Configurator/src/kip.py b/Source/Configurator/src/kip.py index d603c91d..ca766238 100644 --- a/Source/Configurator/src/kip.py +++ b/Source/Configurator/src/kip.py @@ -82,8 +82,13 @@ variables = [ ("g_volt_e_921600", "u32"), ("g_volt_e_998400", "u32"), ("g_volt_e_1075200", "u32"), - ("g_volt_e_1152000", "u32"), +# ("g_volt_e_1152000", "u32"), +# ("g_volt_e_1228800", "u32"), ("marikoCpuVmin", "u32"), + ("eristaGpuVmin", "u32"), + ("marikoGpuVmin", "u32"), + ("marikoGpuVmax", "u32"), + ] fmt_map = { @@ -141,11 +146,14 @@ def load_all_vars(): for e_freq in [ "76800", "153600", "230400", "307200", "384000", "460800", "537600", - "614400", "691200", "768000", "844800", "921600", "998400", "1075200", - "1152000" + "614400", "691200", "768000", "844800", "921600", "998400", "1075200"# , + # "1152000", "1228800" ]: c.load_entry_object(f"g_volt_e_{e_freq}", 3) c.load_entry_object("marikoCpuVmin", 3) + c.load_entry_object("eristaGpuVmin", 3) + c.load_entry_object("marikoGpuVmin", 3) + c.load_entry_object("marikoGpuVmax", 3) def freq_to_label(freq): if freq > 1382400: @@ -240,7 +248,7 @@ def write_kip(): if not d.autosave: c.show_popup("Success", "KIP saved successfully!") -def read_kip(filename, debug=True): +def read_kip(filename): MAGIC = b"CUST" struct_fmt = make_struct_format(variables) struct_size = struct.calcsize(struct_fmt) @@ -254,21 +262,20 @@ def read_kip(filename, debug=True): values = struct.unpack(struct_fmt, raw) for (attr_name, _), val in zip(variables, values): setattr(d, attr_name, val) - if debug: - print("=== debug KIP layout ===") - offset = 0 - for (attr_name, t) in variables: - code = fmt_map[t] - align = 8 if code == "d" else 4 - padding = (-offset) % align - if padding: - offset += padding - size = struct.calcsize(code) - raw_bytes = raw[offset:offset + size] - val = getattr(d, attr_name) - print(f"{attr_name:<20} | type={t:<6} | offset={offset:<4} | size={size:<2} | raw=0x{raw_bytes.hex()} | val={val}") - offset += size - print("========================") + print("=== value layout ===") + offset = 0 + for (attr_name, t) in variables: + code = fmt_map[t] + align = 8 if code == "d" else 4 + padding = (-offset) % align + if padding: + offset += padding + size = struct.calcsize(code) + raw_bytes = raw[offset:offset + size] + val = getattr(d, attr_name) + print(f"{attr_name:<20} | type={t:<6} | offset={offset:<4} | size={size:<2} | raw=0x{raw_bytes.hex()} | val={val}") + offset += size + print("========================") dpg.set_value("gpu_sched", g.check_gpu_sched()) dpg.show_item("gpu_tab") dpg.show_item("cpu_tab") diff --git a/Source/Configurator/src/main.py b/Source/Configurator/src/main.py index bd1043ee..d52fa841 100644 --- a/Source/Configurator/src/main.py +++ b/Source/Configurator/src/main.py @@ -90,7 +90,9 @@ with dpg.texture_registry(show=False): with dpg.file_dialog(directory_selector=False, show=False, tag="file_dialog", width=500, height=300, modal=True, callback=k.store): dpg.add_file_extension(".kip") - +def refresh_drives(): + setattr(ins, "drive_list", ins.get_drives()) + dpg.configure_item("drive_select", items=ins.drive_list) with dpg.window(label="Configurator", width=400, height=300,id="main_window"): with dpg.tab_bar(): with dpg.tab(label="File"): @@ -102,9 +104,11 @@ with dpg.window(label="Configurator", width=400, height=300,id="main_window"): callback=lambda: webbrowser.open("https://github.com/souldbminersmwc/Horizon-OC") ) dpg.add_separator(label="Installation") + dpg.add_button(label="Refresh Drive List", callback=refresh_drives) dpg.add_combo( items=ins.drive_list, default_value="Select a drive!", + tag="drive_select", callback=ins.check_atmosphere ) dpg.add_checkbox(label="Autosave", default_value=false, callback=ins.autosave_toggle) diff --git a/Source/Configurator/src/misc.py b/Source/Configurator/src/misc.py index 9842595d..b5e0e174 100644 --- a/Source/Configurator/src/misc.py +++ b/Source/Configurator/src/misc.py @@ -183,7 +183,7 @@ def set_psm_value(sender, app_data): value = next((x["value"] for x in PSM_OPTIONS if x["name"] == app_data), None) if value: ini.set_ini_values(str(ini_path), "psm", {"current_psm_mA": value}) - common.show_popup("Success", f"PSM set to {app_data}") + common.show_popup("Success", f"Charge Limit set to {app_data}") def remove_tc_entries(): ini_path = get_ini_path() @@ -337,7 +337,7 @@ def populate(): dpg.add_image("coolerhd", width=20, height=20) def set_white_tiger_clocks(app_data): - + # cooler aah clocks # 1400mv emc max # 1375mv cpu max # 750mv vdd2 mariko max diff --git a/Source/sys-clk/build.sh b/Source/sys-clk/build.sh index 5ee36772..c6978c5c 100644 --- a/Source/sys-clk/build.sh +++ b/Source/sys-clk/build.sh @@ -42,4 +42,4 @@ cp -vf "$ROOT_DIR/overlay/out/sys-clk-overlay.ovl" "$DIST_DIR/switch/.overlays/s echo "*** assets ***" mkdir -p "$DIST_DIR/config/sys-clk" cp -vf "$ROOT_DIR/config.ini.template" "$DIST_DIR/config/sys-clk/config.ini.template" -cp -vf "$ROOT_DIR/README.md" "$DIST_DIR/README.md" +cp -vf "$ROOT_DIR/../../README.md" "$DIST_DIR/README.md" diff --git a/build.sh b/build.sh index 8353cecc..6e12f59b 100644 --- a/build.sh +++ b/build.sh @@ -1,21 +1,33 @@ #!/bin/sh -# Define source and destination paths SRC="Source/Atmosphere/stratosphere/loader/source/oc" DEST="build/stratosphere/loader/source/oc" - -# Create destination directory if it doesn't exist +mkdir -p "dist/atmosphere/kips/" mkdir -p "$DEST" -# Copy contents of oc into destination oc (safe, includes hidden files) cp -r "$SRC"/. "$DEST"/ -# Enter build directory and compile using all available cores cd build/stratosphere/loader || exit 1 -rm out/nintendo_nx_arm64_armv8a/release/loader.kip -rm -rf build/ make -j"$(nproc)" hactool -t kip1 out/nintendo_nx_arm64_armv8a/release/loader.kip --uncompress=hoc.kip rm out/nintendo_nx_arm64_armv8a/release/loader.kip -rm -rf build/ +cd ../../../ # exit +cp build/stratosphere/loader/hoc.kip dist/atmosphere/kips/hoc.kip +cd Source/sys-clk/ +./build.sh +cp -r dist/ ../../ + +# cd ../../Source/configurator + +# pip install -U pyinstaller +# pip install dpg +# pip install numpy +# pip install psutil +# pip install pillow +# pip install pathlib + +# python3 -m PyInstaller --onefile --add-data "assets:assets" --icon=assets/icon.ico --noconsole src/main.py + +# mv dist/main dist/hocconfig +# cp dist/hocconfig ../../ \ No newline at end of file diff --git a/dist/README.md b/dist/README.md new file mode 100644 index 00000000..eed6c8b5 --- /dev/null +++ b/dist/README.md @@ -0,0 +1,57 @@ +
+ + +![alt text](assets/logo.png "logo") + + +![alt text](https://img.shields.io/badge/GPL--2.0-red?style=for-the-badge "logo") ![alt text](https://img.shields.io/badge/Nintendo_Switch-E60012?style=for-the-badge&logo=nintendo-switch&logoColor=white "logo") [![alt text](https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/S3eX47dHsB) ![alt text](https://img.shields.io/badge/VSCode-0078D4?style=for-the-badge&logo=visual%20studio%20code&logoColor=white) ![alt text](https://img.shields.io/badge/C%2B%2B-00599C?style=for-the-badge&logo=c%2B%2B&logoColor=white) [![Github All Releases](https://img.shields.io/github/downloads/souldbminersmwc/Horizon-OC/total.svg)]() + +
+ +### DISCLAIMER: THIS TOOL CAN BE DANGEROUS IF MISUSED. PROCEED WITH CAUTION +* Due to the design of Horizon OS, overclocking RAM can cause **NAND DAMAGE**. Ensure to have a NAND Backup
+ +A open source overclocking tool for Nintendo Switch consoles running Atmosphere custom firmware
+ + +## Features: +CPU overclock up to 2397MHz on Mariko units, 2091MHz on Erista units
+GPU up to 1305MHz on Mariko units, 998MHz on Erista units
+RAM up to 3200MHz on Mariko units, 2360MHz on Erista units
+Over/undervolting
+Configurator
+Works with most homebrew
+ +*Higher (potentially dangerous) frequencies are unlockable*
+*The exact maximum overclock varies per console*
+## Installation +Ensure you have the latest version of [Atmosphere](https://github.com/Atmosphere-NX/Atmosphere) and [Ultrahand](https://github.com/ppkantorski/Ultrahand-Overlay) installed before continuing
+Grab latest hoc.kip from releases tab
+If using hekate, edit hekate_ipl.ini to include "kip1=atmosphere/kips/*". No need for editing if using fusee
+Download latest Horizon OC sysmodule from releases tab
+Extract sysmodule into root of SD card
+ +Alternatively, you can download the configurator and click the two install buttons
+ + +## Configuration +Download the latest configurator on your computer
+Run the file
+Select the drive your SD card or UMS device is mounted as
+Configure the kip to your liking, and in the end, save it
+ +## Building +Set up a development enviorment ready to compile Atmosphere
+Git clone Atmosphere, and move the cloned folder into build/
+Insert Source/stratosphere folder into build/
+Run build.sh + +To build the configurator, clone it's repo (souldbminersmwc/ocs2-configurator)
+Run build.bat or cd into folder and run "python -m PyInstaller --onefile --add-data "assets;assets" --icon=assets/icon.ico --noconsole src/main.py"
+ + +## Credits +meha for Switch-Oc-Suite
+sys-clk team for sys-clk
+b0rd2auth for Ultrahand sys-clk fork
+Lightos and Sammybigio2010 for early testing
diff --git a/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp new file mode 100644 index 00000000..bd268e32 Binary files /dev/null and b/dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp differ diff --git a/dist/atmosphere/contents/00FF0000636C6BFF/flags/boot2.flag b/dist/atmosphere/contents/00FF0000636C6BFF/flags/boot2.flag new file mode 100644 index 00000000..e69de29b diff --git a/dist/atmosphere/contents/00FF0000636C6BFF/toolbox.json b/dist/atmosphere/contents/00FF0000636C6BFF/toolbox.json new file mode 100644 index 00000000..83ac964c --- /dev/null +++ b/dist/atmosphere/contents/00FF0000636C6BFF/toolbox.json @@ -0,0 +1,5 @@ +{ + "name" : "hoc-clk", + "tid" : "00FF0000636C6BFF", + "requires_reboot": false +} \ No newline at end of file diff --git a/dist/atmosphere/kips/hoc.kip b/dist/atmosphere/kips/hoc.kip new file mode 100644 index 00000000..12834196 Binary files /dev/null and b/dist/atmosphere/kips/hoc.kip differ diff --git a/dist/config/sys-clk/config.ini.template b/dist/config/sys-clk/config.ini.template new file mode 100644 index 00000000..4305c725 --- /dev/null +++ b/dist/config/sys-clk/config.ini.template @@ -0,0 +1,19 @@ +[values] +; Defines how often sys-clk log temperatures, in milliseconds (set 0 to disable) +temp_log_interval_ms=0 +; Defines how often sys-clk writes to the CSV, in milliseconds (set 0 to disable) +csv_write_interval_ms=0 + +; Example #1: BOTW +; Overclock CPU when docked +; Overclock MEM to docked clocks when handheld +;[01007EF00011E000] +;docked_cpu=1224 +;handheld_mem=1600 + +; Example #2: Picross +; Underclock to save battery +;[0100BA0003EEA000] +;handheld_cpu=816 +;handheld_gpu=153 +;handheld_mem=800 \ No newline at end of file diff --git a/dist/switch/.overlays/sys-clk-overlay.ovl b/dist/switch/.overlays/sys-clk-overlay.ovl new file mode 100644 index 00000000..a0ddfcd3 Binary files /dev/null and b/dist/switch/.overlays/sys-clk-overlay.ovl differ diff --git a/dist/switch/sys-clk-manager.nro b/dist/switch/sys-clk-manager.nro new file mode 100644 index 00000000..7e8c64e4 Binary files /dev/null and b/dist/switch/sys-clk-manager.nro differ diff --git a/hocconfig.exe b/hocconfig.exe new file mode 100644 index 00000000..209dcad8 Binary files /dev/null and b/hocconfig.exe differ