Compare commits
4 Commits
0015c7e8ac
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 72a2083d76 | |||
| 3f6bbc0752 | |||
| d1fc24dae8 | |||
| ef104bce41 |
199
Makefile
199
Makefile
@@ -1,90 +1,109 @@
|
||||
rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2))
|
||||
|
||||
ifeq ($(strip $(DEVKITARM)),)
|
||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
||||
endif
|
||||
|
||||
include $(DEVKITARM)/base_rules
|
||||
|
||||
################################################################################
|
||||
|
||||
IPL_LOAD_ADDR := 0x40008000
|
||||
VERSION := $(shell cat VERSION)
|
||||
|
||||
################################################################################
|
||||
|
||||
TARGET := omninx-installer
|
||||
OUTPUT_NAME := OmniNX-Installer.bin
|
||||
BUILDDIR := build
|
||||
OUTPUTDIR := output
|
||||
SOURCEDIR := source
|
||||
BDKDIR := bdk
|
||||
BDKINC := -I./$(BDKDIR)
|
||||
VPATH = $(dir ./$(SOURCEDIR)/) $(dir $(wildcard ./$(SOURCEDIR)/*/)) $(dir $(wildcard ./$(SOURCEDIR)/*/*/))
|
||||
VPATH += $(dir $(wildcard ./$(BDKDIR)/)) $(dir $(wildcard ./$(BDKDIR)/*/)) $(dir $(wildcard ./$(BDKDIR)/*/*/))
|
||||
|
||||
# All source files
|
||||
OBJS = $(patsubst $(SOURCEDIR)/%.S, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(patsubst $(SOURCEDIR)/%.c, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(call rwildcard, $(SOURCEDIR), *.S *.c)))
|
||||
OBJS += $(patsubst $(BDKDIR)/%.S, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(patsubst $(BDKDIR)/%.c, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(call rwildcard, $(BDKDIR), *.S *.c)))
|
||||
|
||||
GFX_INC := '"../$(SOURCEDIR)/gfx.h"'
|
||||
FFCFG_INC := '"../$(SOURCEDIR)/libs/fatfs/ffconf.h"'
|
||||
|
||||
################################################################################
|
||||
|
||||
CUSTOMDEFINES := -DIPL_LOAD_ADDR=$(IPL_LOAD_ADDR)
|
||||
CUSTOMDEFINES += -DGFX_INC=$(GFX_INC) -DFFCFG_INC=$(FFCFG_INC)
|
||||
CUSTOMDEFINES += -DVERSION='"$(VERSION)"'
|
||||
|
||||
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
|
||||
CFLAGS = $(ARCH) -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -std=gnu11 -Wall -Wno-missing-braces $(CUSTOMDEFINES)
|
||||
LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections -Xlinker --defsym=IPL_LOAD_ADDR=$(IPL_LOAD_ADDR)
|
||||
|
||||
################################################################################
|
||||
|
||||
.PHONY: all clean release
|
||||
|
||||
all: $(OUTPUTDIR)/$(OUTPUT_NAME)
|
||||
$(eval BIN_SIZE = $(shell wc -c < $(OUTPUTDIR)/$(OUTPUT_NAME)))
|
||||
@echo "Payload size is $(BIN_SIZE) bytes"
|
||||
@echo "Max size is 126296 bytes."
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILDDIR)
|
||||
@rm -rf $(OUTPUTDIR)
|
||||
@rm -rf release
|
||||
@rm -f $(TARGET)-*.zip
|
||||
|
||||
$(OUTPUTDIR)/$(OUTPUT_NAME): $(BUILDDIR)/$(TARGET)/$(TARGET).elf
|
||||
@mkdir -p "$(@D)"
|
||||
$(OBJCOPY) -S -O binary $< $(OUTPUTDIR)/$(TARGET).bin
|
||||
@mv $(OUTPUTDIR)/$(TARGET).bin $(OUTPUTDIR)/$(OUTPUT_NAME)
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/$(TARGET).elf: $(OBJS)
|
||||
$(CC) $(LDFLAGS) -T $(SOURCEDIR)/link.ld $^ -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(SOURCEDIR)/%.c
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) $(BDKINC) -I$(SOURCEDIR) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(SOURCEDIR)/%.S
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(BDKDIR)/%.c
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) $(BDKINC) -I$(SOURCEDIR) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(BDKDIR)/%.S
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
release: $(OUTPUTDIR)/$(OUTPUT_NAME)
|
||||
@mkdir -p release/bootloader/payloads
|
||||
@cp $(OUTPUTDIR)/$(OUTPUT_NAME) release/bootloader/payloads/$(OUTPUT_NAME)
|
||||
@cd release && zip -r ../$(TARGET)-$(VERSION).zip bootloader
|
||||
@echo "Release package created: $(TARGET)-$(VERSION).zip"
|
||||
rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2))
|
||||
|
||||
ifeq ($(strip $(DEVKITARM)),)
|
||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
||||
endif
|
||||
|
||||
include $(DEVKITARM)/base_rules
|
||||
|
||||
################################################################################
|
||||
|
||||
IPL_LOAD_ADDR := 0x40008000
|
||||
VERSION := $(shell cat VERSION)
|
||||
|
||||
################################################################################
|
||||
|
||||
TARGET := omninx-installer
|
||||
OUTPUT_NAME := OmniNX-Installer.bin
|
||||
BUILDDIR := build
|
||||
OUTPUTDIR := output
|
||||
SOURCEDIR := source
|
||||
BDKDIR := bdk
|
||||
BDKINC := -I./$(BDKDIR)
|
||||
VPATH = $(dir ./$(SOURCEDIR)/) $(dir $(wildcard ./$(SOURCEDIR)/*/)) $(dir $(wildcard ./$(SOURCEDIR)/*/*/))
|
||||
VPATH += $(dir $(wildcard ./$(BDKDIR)/)) $(dir $(wildcard ./$(BDKDIR)/*/)) $(dir $(wildcard ./$(BDKDIR)/*/*/))
|
||||
|
||||
# All source files
|
||||
OBJS = $(patsubst $(SOURCEDIR)/%.S, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(patsubst $(SOURCEDIR)/%.c, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(call rwildcard, $(SOURCEDIR), *.S *.c)))
|
||||
OBJS += $(patsubst $(BDKDIR)/%.S, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(patsubst $(BDKDIR)/%.c, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(call rwildcard, $(BDKDIR), *.S *.c)))
|
||||
|
||||
GFX_INC := '"../$(SOURCEDIR)/gfx.h"'
|
||||
FFCFG_INC := '"../$(SOURCEDIR)/libs/fatfs/ffconf.h"'
|
||||
|
||||
################################################################################
|
||||
|
||||
CUSTOMDEFINES := -DIPL_LOAD_ADDR=$(IPL_LOAD_ADDR)
|
||||
CUSTOMDEFINES += -DGFX_INC=$(GFX_INC) -DFFCFG_INC=$(FFCFG_INC)
|
||||
CUSTOMDEFINES += -DVERSION='"$(VERSION)"'
|
||||
|
||||
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
|
||||
CFLAGS = $(ARCH) -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -std=gnu11 -Wall -Wno-missing-braces $(CUSTOMDEFINES)
|
||||
LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections -Xlinker --defsym=IPL_LOAD_ADDR=$(IPL_LOAD_ADDR)
|
||||
|
||||
################################################################################
|
||||
|
||||
RAMTEST_BIN := $(OUTPUTDIR)/RAM-Test.bin
|
||||
OBJS_RAMTEST := $(filter-out $(BUILDDIR)/$(TARGET)/main.o,$(OBJS)) \
|
||||
$(BUILDDIR)/$(TARGET)/ram_test_main.o
|
||||
|
||||
.PHONY: all clean release ram-test
|
||||
|
||||
all: $(OUTPUTDIR)/$(OUTPUT_NAME)
|
||||
$(eval BIN_SIZE = $(shell wc -c < $(OUTPUTDIR)/$(OUTPUT_NAME)))
|
||||
@echo "Payload size is $(BIN_SIZE) bytes"
|
||||
@echo "Max size is 126296 bytes."
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILDDIR)
|
||||
@rm -rf $(OUTPUTDIR)
|
||||
@rm -f $(RAMTEST_BIN)
|
||||
@rm -rf release
|
||||
@rm -f $(TARGET)-*.zip
|
||||
|
||||
$(OUTPUTDIR)/$(OUTPUT_NAME): $(BUILDDIR)/$(TARGET)/$(TARGET).elf
|
||||
@mkdir -p "$(@D)"
|
||||
$(OBJCOPY) -S -O binary $< $(OUTPUTDIR)/$(TARGET).bin
|
||||
@mv $(OUTPUTDIR)/$(TARGET).bin $(OUTPUTDIR)/$(OUTPUT_NAME)
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/$(TARGET).elf: $(OBJS)
|
||||
$(CC) $(LDFLAGS) -T $(SOURCEDIR)/link.ld $^ -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/ram_test_main.o: tools/ram_test_main.c
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) $(BDKINC) -I$(SOURCEDIR) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/ram_test.elf: $(OBJS_RAMTEST)
|
||||
$(CC) $(LDFLAGS) -T $(SOURCEDIR)/link.ld $^ -o $@
|
||||
|
||||
$(RAMTEST_BIN): $(BUILDDIR)/$(TARGET)/ram_test.elf
|
||||
@mkdir -p "$(@D)"
|
||||
$(OBJCOPY) -S -O binary $< $@
|
||||
@echo "RAM-Test payload: $(RAMTEST_BIN) ($$(wc -c < $@) bytes)"
|
||||
|
||||
ram-test: $(RAMTEST_BIN)
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(SOURCEDIR)/%.c
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) $(BDKINC) -I$(SOURCEDIR) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(SOURCEDIR)/%.S
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(BDKDIR)/%.c
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) $(BDKINC) -I$(SOURCEDIR) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/$(TARGET)/%.o: $(BDKDIR)/%.S
|
||||
@mkdir -p "$(@D)"
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
release: $(OUTPUTDIR)/$(OUTPUT_NAME)
|
||||
@mkdir -p release/bootloader/payloads
|
||||
@cp $(OUTPUTDIR)/$(OUTPUT_NAME) release/bootloader/payloads/$(OUTPUT_NAME)
|
||||
@cd release && zip -r ../$(TARGET)-$(VERSION).zip bootloader
|
||||
@echo "Release package created: $(TARGET)-$(VERSION).zip"
|
||||
|
||||
@@ -1,295 +1,298 @@
|
||||
/*
|
||||
* OmniNX Installer - Deletion Lists for Clean Install Mode
|
||||
* Selective deletion when no OmniNX install was found.
|
||||
* Only listed paths are removed; does not wipe whole card or user configs.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Atmosphere subdirectories to delete
|
||||
static const char* clean_atmosphere_dirs_to_delete[] = {
|
||||
"sd:/atmosphere/config",
|
||||
"sd:/atmosphere/crash_reports",
|
||||
"sd:/atmosphere/erpt_reports",
|
||||
"sd:/atmosphere/exefs_patches/CrunchPatch",
|
||||
"sd:/atmosphere/exefs_patches/Crunchyroll Patch 1.10.0",
|
||||
"sd:/atmosphere/exefs_patches/bluetooth_patches",
|
||||
"sd:/atmosphere/exefs_patches/bootlogo",
|
||||
"sd:/atmosphere/exefs_patches/btm_patches",
|
||||
"sd:/atmosphere/exefs_patches/es_patches",
|
||||
"sd:/atmosphere/exefs_patches/hid_patches",
|
||||
"sd:/atmosphere/exefs_patches/logo1",
|
||||
"sd:/atmosphere/exefs_patches/nfim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nvnflinger_cmu",
|
||||
"sd:/atmosphere/extrazz",
|
||||
"sd:/atmosphere/fatal_errors",
|
||||
"sd:/atmosphere/fatal_reports",
|
||||
"sd:/atmosphere/flags",
|
||||
"sd:/atmosphere/hbl_html",
|
||||
"sd:/atmosphere/hosts",
|
||||
"sd:/atmosphere/kips",
|
||||
"sd:/atmosphere/kip1",
|
||||
"sd:/atmosphere/kip_patches",
|
||||
"sd:/atmosphere/logs",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Atmosphere contents directories (title IDs; only under atmosphere/contents/)
|
||||
static const char* clean_atmosphere_contents_dirs_to_delete[] = {
|
||||
"sd:/atmosphere/contents/0000000000534C56",
|
||||
"sd:/atmosphere/contents/00FF0000B378D640",
|
||||
"sd:/atmosphere/contents/00FF0000636C6BFF",
|
||||
"sd:/atmosphere/contents/00FF0000A53BB665",
|
||||
"sd:/atmosphere/contents/0100000000000008",
|
||||
"sd:/atmosphere/contents/010000000000000D",
|
||||
"sd:/atmosphere/contents/010000000000002B",
|
||||
"sd:/atmosphere/contents/0100000000000032",
|
||||
"sd:/atmosphere/contents/0100000000000034",
|
||||
"sd:/atmosphere/contents/0100000000000036",
|
||||
"sd:/atmosphere/contents/0100000000000037",
|
||||
"sd:/atmosphere/contents/010000000000003C",
|
||||
"sd:/atmosphere/contents/0100000000000042",
|
||||
"sd:/atmosphere/contents/0100000000000895",
|
||||
"sd:/atmosphere/contents/0100000000000F12",
|
||||
"sd:/atmosphere/contents/0100000000001000",
|
||||
"sd:/atmosphere/contents/0100000000001007",
|
||||
"sd:/atmosphere/contents/0100000000001013",
|
||||
"sd:/atmosphere/contents/010000000000DA7A",
|
||||
"sd:/atmosphere/contents/010000000000bd00",
|
||||
"sd:/atmosphere/contents/01006a800016e000",
|
||||
"sd:/atmosphere/contents/01009D901BC56000",
|
||||
"sd:/atmosphere/contents/0100A3900C3E2000",
|
||||
"sd:/atmosphere/contents/0100F43008C44000",
|
||||
"sd:/atmosphere/contents/050000BADDAD0000",
|
||||
"sd:/atmosphere/contents/4200000000000000",
|
||||
"sd:/atmosphere/contents/420000000000000B",
|
||||
"sd:/atmosphere/contents/420000000000000E",
|
||||
"sd:/atmosphere/contents/4200000000000010",
|
||||
"sd:/atmosphere/contents/4200000000000FFF",
|
||||
"sd:/atmosphere/contents/420000000007E51A",
|
||||
"sd:/atmosphere/contents/420000000007E51B",
|
||||
"sd:/atmosphere/contents/690000000000000D",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Atmosphere files to delete
|
||||
static const char* clean_atmosphere_files_to_delete[] = {
|
||||
"sd:/atmosphere/config/exosphere.ini",
|
||||
"sd:/atmosphere/config/stratosphere.ini",
|
||||
"sd:/atmosphere/hbl.nsp",
|
||||
"sd:/atmosphere/package3",
|
||||
"sd:/atmosphere/reboot_payload.bin",
|
||||
"sd:/atmosphere/stratosphere.romfs",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Bootloader directories to delete
|
||||
static const char* clean_bootloader_dirs_to_delete[] = {
|
||||
"sd:/bootloader/boot",
|
||||
"sd:/bootloader/bootlogo",
|
||||
"sd:/bootloader/ini2",
|
||||
"sd:/bootloader/payloads",
|
||||
"sd:/bootloader/reboot",
|
||||
"sd:/bootloader/res",
|
||||
"sd:/bootloader/sys",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Bootloader files to delete
|
||||
static const char* clean_bootloader_files_to_delete[] = {
|
||||
"sd:/bootloader/ArgonNX.bin",
|
||||
"sd:/bootloader/bootlogo.bmp",
|
||||
"sd:/bootloader/hekate_ipl.ini",
|
||||
"sd:/bootloader/nyx.ini",
|
||||
"sd:/bootloader/patches.ini",
|
||||
"sd:/bootloader/update.bin",
|
||||
"sd:/bootloader/ini/EmuMMC ohne Mods.ini",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Config directories to delete
|
||||
static const char* clean_config_dirs_to_delete[] = {
|
||||
"sd:/config/aio-switch-updater",
|
||||
"sd:/config/blue_pack_updater",
|
||||
"sd:/config/kefir-updater",
|
||||
"sd:/config/nx-hbmenu",
|
||||
"sd:/config/quickntp",
|
||||
"sd:/config/sys-con",
|
||||
"sd:/config/sys-patch",
|
||||
"sd:/config/uberhand",
|
||||
"sd:/config/ultrahand",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Switch directories to delete
|
||||
static const char* clean_switch_dirs_to_delete[] = {
|
||||
"sd:/switch/.overlays",
|
||||
"sd:/switch/.packages",
|
||||
"sd:/switch/90DNS_tester",
|
||||
"sd:/switch/aio-switch-updater",
|
||||
"sd:/switch/amsPLUS-downloader",
|
||||
"sd:/switch/appstore",
|
||||
"sd:/switch/AtmoXL-Titel-Installer",
|
||||
"sd:/switch/breeze",
|
||||
"sd:/switch/checkpoint",
|
||||
"sd:/switch/cheats-updater",
|
||||
"sd:/switch/chiaki",
|
||||
"sd:/switch/ChoiDujourNX",
|
||||
"sd:/switch/crash_ams",
|
||||
"sd:/switch/Daybreak",
|
||||
"sd:/switch/DNS_mitm Tester",
|
||||
"sd:/switch/EdiZon",
|
||||
"sd:/switch/Fizeau",
|
||||
"sd:/switch/FTPD",
|
||||
"sd:/switch/fw-downloader",
|
||||
"sd:/switch/gamecard_installer",
|
||||
"sd:/switch/Goldleaf",
|
||||
"sd:/switch/haze",
|
||||
"sd:/switch/JKSV",
|
||||
"sd:/switch/kefir-updater",
|
||||
"sd:/switch/ldnmitm_config",
|
||||
"sd:/switch/Linkalho",
|
||||
"sd:/switch/Moonlight-Switch",
|
||||
"sd:/switch/Neumann",
|
||||
"sd:/switch/NX-Activity-Log",
|
||||
"sd:/switch/NX-Save-Sync",
|
||||
"sd:/switch/NX-Shell",
|
||||
"sd:/switch/NX-Update-Checker ",
|
||||
"sd:/switch/NXGallery",
|
||||
"sd:/switch/NXRemoteLauncher",
|
||||
"sd:/switch/NXThemesInstaller",
|
||||
"sd:/switch/nxdumptool",
|
||||
"sd:/switch/nxmtp",
|
||||
"sd:/switch/Payload_launcher",
|
||||
"sd:/switch/Reboot",
|
||||
"sd:/switch/reboot_to_argonNX",
|
||||
"sd:/switch/reboot_to_hekate",
|
||||
"sd:/switch/Shutdown_System",
|
||||
"sd:/switch/SimpleModDownloader",
|
||||
"sd:/switch/SimpleModManager",
|
||||
"sd:/switch/sphaira",
|
||||
"sd:/switch/studious-pancake",
|
||||
"sd:/switch/Switch-Time",
|
||||
"sd:/switch/SwitchIdent",
|
||||
"sd:/switch/Switch_themes_Installer",
|
||||
"sd:/switch/Switchfin",
|
||||
"sd:/switch/Sys-Clk Manager",
|
||||
"sd:/switch/Sys-Con",
|
||||
"sd:/switch/sys-clk-manager",
|
||||
"sd:/switch/themezer-nx",
|
||||
"sd:/switch/themezernx",
|
||||
"sd:/switch/tinwoo",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Switch files (NRO) to delete
|
||||
static const char* clean_switch_files_to_delete[] = {
|
||||
"sd:/switch/90DNS_tester/90DNS_tester.nro",
|
||||
"sd:/switch/breeze.nro",
|
||||
"sd:/switch/cheats-updater.nro",
|
||||
"sd:/switch/chiaki.nro",
|
||||
"sd:/switch/ChoiDujourNX.nro",
|
||||
"sd:/switch/daybreak.nro",
|
||||
"sd:/switch/DBI.nro",
|
||||
"sd:/switch/DBI/DBI.nro",
|
||||
"sd:/switch/DBI/DBI_810_DE.nro",
|
||||
"sd:/switch/DBI/DBI_810_EN.nro",
|
||||
"sd:/switch/DBI/DBI_845_DE.nro",
|
||||
"sd:/switch/DBI/DBI_845_EN.nro",
|
||||
"sd:/switch/DBI/DBI_849_DE.nro",
|
||||
"sd:/switch/DBI/DBI_849_EN.nro",
|
||||
"sd:/switch/DBI_810_DE/DBI_810.nro",
|
||||
"sd:/switch/DBI_810_DE/DBI_810_DE.nro",
|
||||
"sd:/switch/DBI_810_EN/DBI_810_EN.nro",
|
||||
"sd:/switch/DBI_RU/DBI_RU.nro",
|
||||
"sd:/switch/DBI/DBI_EN.nro",
|
||||
"sd:/switch/DBI_DE/DBI_DE.nro",
|
||||
"sd:/switch/DNS_mitm Tester.nro",
|
||||
"sd:/switch/EdiZon.nro",
|
||||
"sd:/switch/Fizeau.nro",
|
||||
"sd:/switch/Goldleaf.nro",
|
||||
"sd:/switch/haze.nro",
|
||||
"sd:/switch/JKSV.nro",
|
||||
"sd:/switch/ldnmitm_config.nro",
|
||||
"sd:/switch/linkalho.nro",
|
||||
"sd:/switch/Moonlight-Switch.nro",
|
||||
"sd:/switch/Neumann.nro",
|
||||
"sd:/switch/NX-Shell.nro",
|
||||
"sd:/switch/NXGallery.nro",
|
||||
"sd:/switch/NXThemesInstaller.nro",
|
||||
"sd:/switch/nxdumptool.nro",
|
||||
"sd:/switch/nxtc.bin",
|
||||
"sd:/switch/reboot_to_payload.nro",
|
||||
"sd:/switch/SimpleModDownloader.nro",
|
||||
"sd:/switch/SimpleModManager.nro",
|
||||
"sd:/switch/sphaira.nro",
|
||||
"sd:/switch/SwitchIdent.nro",
|
||||
"sd:/switch/Switch_themes_Installer/NXThemesInstaller.nro",
|
||||
"sd:/switch/Switchfin.nro",
|
||||
"sd:/switch/Sys-Clk Manager/sys-clk-manager.nro",
|
||||
"sd:/switch/Sys-Con.nro",
|
||||
"sd:/switch/sys-clk-manager.nro",
|
||||
"sd:/switch/tinfoil.nro",
|
||||
"sd:/switch/tinfoil/tinfoil.nro",
|
||||
"sd:/switch/tinwoo.nro",
|
||||
"sd:/switch/tinwoo/tinwoo.nro",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Root CFW files to delete
|
||||
static const char* clean_root_files_to_delete[] = {
|
||||
"sd:/boot.dat",
|
||||
"sd:/boot.ini",
|
||||
"sd:/exosphere.bin",
|
||||
"sd:/exosphere.ini",
|
||||
"sd:/hbmenu.nro",
|
||||
"sd:/install.bat",
|
||||
"sd:/license",
|
||||
"sd:/loader.bin",
|
||||
"sd:/mc-mitm.log",
|
||||
"sd:/payload.bin",
|
||||
"sd:/update.bin",
|
||||
"sd:/version",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Miscellaneous directories to delete
|
||||
static const char* clean_misc_dirs_to_delete[] = {
|
||||
"sd:/argon",
|
||||
"sd:/games",
|
||||
"sd:/NSPs (Tools)",
|
||||
"sd:/Patched Apps",
|
||||
"sd:/SaltySD/flags",
|
||||
"sd:/scripts",
|
||||
"sd:/switch/tinfoil/db",
|
||||
"sd:/tools",
|
||||
"sd:/warmboot_mariko",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Miscellaneous files to delete
|
||||
static const char* clean_misc_files_to_delete[] = {
|
||||
"sd:/fusee-primary.bin",
|
||||
"sd:/fusee.bin",
|
||||
"sd:/SaltySD/exceptions.txt",
|
||||
"sd:/SaltySD/saltysd_bootstrap.elf",
|
||||
"sd:/SaltySD/saltysd_bootstrap32_3k.elf",
|
||||
"sd:/SaltySD/saltysd_bootstrap32_5k.elf",
|
||||
"sd:/SaltySD/saltysd_core.elf",
|
||||
"sd:/SaltySD/saltysd_core32.elf",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Old version marker files to delete (clean install only)
|
||||
static const char* old_version_files_to_delete[] = {
|
||||
"sd:/1.0.0l",
|
||||
"sd:/1.0.0s",
|
||||
"sd:/1.0.0oc",
|
||||
"sd:/1.4.0-pre",
|
||||
"sd:/1.4.0-pre-c",
|
||||
"sd:/1.4.0-pre-d",
|
||||
"sd:/1.4.1",
|
||||
"sd:/1.5.0",
|
||||
NULL
|
||||
};
|
||||
/*
|
||||
* OmniNX Installer - Deletion Lists for Clean Install Mode
|
||||
* Selective deletion when no OmniNX install was found.
|
||||
* Only listed paths are removed; does not wipe whole card or user configs.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Atmosphere subdirectories to delete
|
||||
static const char* clean_atmosphere_dirs_to_delete[] = {
|
||||
"sd:/atmosphere/config",
|
||||
"sd:/atmosphere/crash_reports",
|
||||
"sd:/atmosphere/erpt_reports",
|
||||
"sd:/atmosphere/exefs_patches/CrunchPatch",
|
||||
"sd:/atmosphere/exefs_patches/Crunchyroll Patch 1.10.0",
|
||||
"sd:/atmosphere/exefs_patches/bluetooth_patches",
|
||||
"sd:/atmosphere/exefs_patches/bootlogo",
|
||||
"sd:/atmosphere/exefs_patches/btm_patches",
|
||||
"sd:/atmosphere/exefs_patches/es_patches",
|
||||
"sd:/atmosphere/exefs_patches/hid_patches",
|
||||
"sd:/atmosphere/exefs_patches/logo1",
|
||||
"sd:/atmosphere/exefs_patches/nfim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nvnflinger_cmu",
|
||||
"sd:/atmosphere/extrazz",
|
||||
"sd:/atmosphere/fatal_errors",
|
||||
"sd:/atmosphere/fatal_reports",
|
||||
"sd:/atmosphere/flags",
|
||||
"sd:/atmosphere/hbl_html",
|
||||
"sd:/atmosphere/hosts",
|
||||
"sd:/atmosphere/kips",
|
||||
"sd:/atmosphere/kip1",
|
||||
"sd:/atmosphere/kip_patches",
|
||||
"sd:/atmosphere/logs",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Atmosphere contents directories (title IDs; only under atmosphere/contents/)
|
||||
static const char* clean_atmosphere_contents_dirs_to_delete[] = {
|
||||
"sd:/atmosphere/contents/0000000000534C56",
|
||||
"sd:/atmosphere/contents/00FF0000B378D640",
|
||||
"sd:/atmosphere/contents/00FF0000636C6BFF",
|
||||
"sd:/atmosphere/contents/00FF0000A53BB665",
|
||||
"sd:/atmosphere/contents/0100000000000008",
|
||||
"sd:/atmosphere/contents/010000000000000D",
|
||||
"sd:/atmosphere/contents/010000000000002B",
|
||||
"sd:/atmosphere/contents/0100000000000032",
|
||||
"sd:/atmosphere/contents/0100000000000034",
|
||||
"sd:/atmosphere/contents/0100000000000036",
|
||||
"sd:/atmosphere/contents/0100000000000037",
|
||||
"sd:/atmosphere/contents/010000000000003C",
|
||||
"sd:/atmosphere/contents/0100000000000042",
|
||||
"sd:/atmosphere/contents/0100000000000895",
|
||||
"sd:/atmosphere/contents/0100000000000F12",
|
||||
"sd:/atmosphere/contents/0100000000001000",
|
||||
"sd:/atmosphere/contents/0100000000001007",
|
||||
"sd:/atmosphere/contents/0100000000001013",
|
||||
"sd:/atmosphere/contents/010000000000DA7A",
|
||||
"sd:/atmosphere/contents/010000000000bd00",
|
||||
"sd:/atmosphere/contents/01006a800016e000",
|
||||
"sd:/atmosphere/contents/01009D901BC56000",
|
||||
"sd:/atmosphere/contents/0100A3900C3E2000",
|
||||
"sd:/atmosphere/contents/0100F43008C44000",
|
||||
"sd:/atmosphere/contents/050000BADDAD0000",
|
||||
"sd:/atmosphere/contents/4200000000000000",
|
||||
"sd:/atmosphere/contents/420000000000000B",
|
||||
"sd:/atmosphere/contents/420000000000000E",
|
||||
"sd:/atmosphere/contents/4200000000000010",
|
||||
"sd:/atmosphere/contents/4200000000000FFF",
|
||||
"sd:/atmosphere/contents/420000000007E51A",
|
||||
"sd:/atmosphere/contents/420000000007E51B",
|
||||
"sd:/atmosphere/contents/690000000000000D",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Atmosphere files to delete
|
||||
static const char* clean_atmosphere_files_to_delete[] = {
|
||||
"sd:/atmosphere/config/exosphere.ini",
|
||||
"sd:/atmosphere/config/stratosphere.ini",
|
||||
"sd:/atmosphere/hbl.nsp",
|
||||
"sd:/atmosphere/package3",
|
||||
"sd:/atmosphere/reboot_payload.bin",
|
||||
"sd:/atmosphere/stratosphere.romfs",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Bootloader directories to delete
|
||||
static const char* clean_bootloader_dirs_to_delete[] = {
|
||||
"sd:/bootloader/boot",
|
||||
"sd:/bootloader/bootlogo",
|
||||
"sd:/bootloader/ini2",
|
||||
"sd:/bootloader/payloads",
|
||||
"sd:/bootloader/reboot",
|
||||
"sd:/bootloader/res",
|
||||
"sd:/bootloader/sys",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Bootloader files to delete
|
||||
static const char* clean_bootloader_files_to_delete[] = {
|
||||
"sd:/bootloader/ArgonNX.bin",
|
||||
"sd:/bootloader/bootlogo.bmp",
|
||||
"sd:/bootloader/hekate_ipl.ini",
|
||||
"sd:/bootloader/nyx.ini",
|
||||
"sd:/bootloader/patches.ini",
|
||||
"sd:/bootloader/update.bin",
|
||||
"sd:/bootloader/ini/EmuMMC ohne Mods.ini",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Config directories to delete
|
||||
static const char* clean_config_dirs_to_delete[] = {
|
||||
"sd:/config/aio-switch-updater",
|
||||
"sd:/config/blue_pack_updater",
|
||||
"sd:/config/kefir-updater",
|
||||
"sd:/config/nx-hbmenu",
|
||||
"sd:/config/quickntp",
|
||||
"sd:/config/sys-con",
|
||||
"sd:/config/sys-patch",
|
||||
"sd:/config/uberhand",
|
||||
"sd:/config/ultrahand",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Switch directories to delete
|
||||
static const char* clean_switch_dirs_to_delete[] = {
|
||||
"sd:/switch/.overlays",
|
||||
"sd:/switch/.packages",
|
||||
"sd:/switch/90DNS_tester",
|
||||
"sd:/switch/aio-switch-updater",
|
||||
"sd:/switch/amsPLUS-downloader",
|
||||
"sd:/switch/appstore",
|
||||
"sd:/switch/AtmoXL-Titel-Installer",
|
||||
"sd:/switch/breeze",
|
||||
"sd:/switch/checkpoint",
|
||||
"sd:/switch/cheats-updater",
|
||||
"sd:/switch/chiaki",
|
||||
"sd:/switch/ChoiDujourNX",
|
||||
"sd:/switch/crash_ams",
|
||||
"sd:/switch/Daybreak",
|
||||
"sd:/switch/DNS_mitm Tester",
|
||||
"sd:/switch/EdiZon",
|
||||
"sd:/switch/Fizeau",
|
||||
"sd:/switch/FTPD",
|
||||
"sd:/switch/fw-downloader",
|
||||
"sd:/switch/gamecard_installer",
|
||||
"sd:/switch/Goldleaf",
|
||||
"sd:/switch/haze",
|
||||
"sd:/switch/JKSV",
|
||||
"sd:/switch/kefir-updater",
|
||||
"sd:/switch/ldnmitm_config",
|
||||
"sd:/switch/Linkalho",
|
||||
"sd:/switch/Moonlight-Switch",
|
||||
"sd:/switch/Neumann",
|
||||
"sd:/switch/NX-Activity-Log",
|
||||
"sd:/switch/NX-Save-Sync",
|
||||
"sd:/switch/NX-Shell",
|
||||
"sd:/switch/NX-Update-Checker ",
|
||||
"sd:/switch/NXGallery",
|
||||
"sd:/switch/NXRemoteLauncher",
|
||||
"sd:/switch/NXThemesInstaller",
|
||||
"sd:/switch/nxdumptool",
|
||||
"sd:/switch/nxmtp",
|
||||
"sd:/switch/Payload_launcher",
|
||||
"sd:/switch/Reboot",
|
||||
"sd:/switch/reboot_to_argonNX",
|
||||
"sd:/switch/reboot_to_hekate",
|
||||
"sd:/switch/Shutdown_System",
|
||||
"sd:/switch/SimpleModDownloader",
|
||||
"sd:/switch/SimpleModManager",
|
||||
"sd:/switch/sphaira",
|
||||
"sd:/switch/studious-pancake",
|
||||
"sd:/switch/Switch-Time",
|
||||
"sd:/switch/SwitchIdent",
|
||||
"sd:/switch/Switch_themes_Installer",
|
||||
"sd:/switch/Switchfin",
|
||||
"sd:/switch/Sys-Clk Manager",
|
||||
"sd:/switch/Sys-Con",
|
||||
"sd:/switch/sys-clk-manager",
|
||||
"sd:/switch/themezer-nx",
|
||||
"sd:/switch/themezernx",
|
||||
"sd:/switch/tinwoo",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Switch files (NRO) to delete
|
||||
static const char* clean_switch_files_to_delete[] = {
|
||||
"sd:/switch/90DNS_tester/90DNS_tester.nro",
|
||||
"sd:/switch/breeze.nro",
|
||||
"sd:/switch/cheats-updater.nro",
|
||||
"sd:/switch/chiaki.nro",
|
||||
"sd:/switch/ChoiDujourNX.nro",
|
||||
"sd:/switch/daybreak.nro",
|
||||
"sd:/switch/DBI.nro",
|
||||
"sd:/switch/DBI/DBI.nro",
|
||||
"sd:/switch/DBI/DBI_810_DE.nro",
|
||||
"sd:/switch/DBI/DBI_810_EN.nro",
|
||||
"sd:/switch/DBI/DBI_845_DE.nro",
|
||||
"sd:/switch/DBI/DBI_845_EN.nro",
|
||||
"sd:/switch/DBI/DBI_849_DE.nro",
|
||||
"sd:/switch/DBI/DBI_849_EN.nro",
|
||||
"sd:/switch/DBI/DBI_874_DE.nro",
|
||||
"sd:/switch/DBI/DBI_874_EN.nro",
|
||||
"sd:/switch/DBI_810_DE/DBI_810.nro",
|
||||
"sd:/switch/DBI_810_DE/DBI_810_DE.nro",
|
||||
"sd:/switch/DBI_810_EN/DBI_810_EN.nro",
|
||||
"sd:/switch/DBI_RU/DBI_RU.nro",
|
||||
"sd:/switch/DBI/DBI_EN.nro",
|
||||
"sd:/switch/DBI_DE/DBI_DE.nro",
|
||||
"sd:/switch/DNS_mitm Tester.nro",
|
||||
"sd:/switch/EdiZon.nro",
|
||||
"sd:/switch/Fizeau.nro",
|
||||
"sd:/switch/Goldleaf.nro",
|
||||
"sd:/switch/haze.nro",
|
||||
"sd:/switch/JKSV.nro",
|
||||
"sd:/switch/ldnmitm_config.nro",
|
||||
"sd:/switch/linkalho.nro",
|
||||
"sd:/switch/Moonlight-Switch.nro",
|
||||
"sd:/switch/Neumann.nro",
|
||||
"sd:/switch/NX-Shell.nro",
|
||||
"sd:/switch/NXGallery.nro",
|
||||
"sd:/switch/NXThemesInstaller.nro",
|
||||
"sd:/switch/nxdumptool.nro",
|
||||
"sd:/switch/nxtc.bin",
|
||||
"sd:/switch/reboot_to_payload.nro",
|
||||
"sd:/switch/SimpleModDownloader.nro",
|
||||
"sd:/switch/SimpleModManager.nro",
|
||||
"sd:/switch/sphaira.nro",
|
||||
"sd:/switch/SwitchIdent.nro",
|
||||
"sd:/switch/Switch_themes_Installer/NXThemesInstaller.nro",
|
||||
"sd:/switch/Switchfin.nro",
|
||||
"sd:/switch/Sys-Clk Manager/sys-clk-manager.nro",
|
||||
"sd:/switch/Sys-Con.nro",
|
||||
"sd:/switch/sys-clk-manager.nro",
|
||||
"sd:/switch/tinfoil.nro",
|
||||
"sd:/switch/tinfoil/tinfoil.nro",
|
||||
"sd:/switch/tinwoo.nro",
|
||||
"sd:/switch/tinwoo/tinwoo.nro",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Root CFW files to delete
|
||||
static const char* clean_root_files_to_delete[] = {
|
||||
"sd:/boot.dat",
|
||||
"sd:/boot.ini",
|
||||
"sd:/exosphere.bin",
|
||||
"sd:/exosphere.ini",
|
||||
"sd:/hbmenu.nro",
|
||||
"sd:/install.bat",
|
||||
"sd:/license",
|
||||
"sd:/loader.bin",
|
||||
"sd:/mc-mitm.log",
|
||||
"sd:/payload.bin",
|
||||
"sd:/update.bin",
|
||||
"sd:/version",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Miscellaneous directories to delete
|
||||
static const char* clean_misc_dirs_to_delete[] = {
|
||||
"sd:/argon",
|
||||
"sd:/games",
|
||||
"sd:/NSPs (Tools)",
|
||||
"sd:/Patched Apps",
|
||||
"sd:/SaltySD/flags",
|
||||
"sd:/scripts",
|
||||
"sd:/switch/tinfoil/db",
|
||||
"sd:/tools",
|
||||
"sd:/warmboot_mariko",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Miscellaneous files to delete
|
||||
static const char* clean_misc_files_to_delete[] = {
|
||||
"sd:/fusee-primary.bin",
|
||||
"sd:/fusee.bin",
|
||||
"sd:/SaltySD/exceptions.txt",
|
||||
"sd:/SaltySD/saltysd_bootstrap.elf",
|
||||
"sd:/SaltySD/saltysd_bootstrap32_3k.elf",
|
||||
"sd:/SaltySD/saltysd_bootstrap32_5k.elf",
|
||||
"sd:/SaltySD/saltysd_core.elf",
|
||||
"sd:/SaltySD/saltysd_core32.elf",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Old version marker files to delete (clean install only)
|
||||
static const char* old_version_files_to_delete[] = {
|
||||
"sd:/1.0.0l",
|
||||
"sd:/1.0.0s",
|
||||
"sd:/1.0.0oc",
|
||||
"sd:/1.4.0-pre",
|
||||
"sd:/1.4.0-pre-c",
|
||||
"sd:/1.4.0-pre-d",
|
||||
"sd:/1.4.1",
|
||||
"sd:/1.5.0",
|
||||
"sd:/1.6.0",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -172,7 +172,6 @@ static const char* switch_dirs_to_delete[] = {
|
||||
"sd:/switch/Switch-Time",
|
||||
"sd:/switch/SwitchIdent",
|
||||
"sd:/switch/Switch_themes_Installer",
|
||||
"sd:/switch/Switchfin",
|
||||
"sd:/switch/Sys-Clk Manager",
|
||||
"sd:/switch/Sys-Con",
|
||||
"sd:/switch/sys-clk-manager",
|
||||
@@ -223,9 +222,9 @@ static const char* switch_files_to_delete[] = {
|
||||
"sd:/switch/SimpleModDownloader.nro",
|
||||
"sd:/switch/SimpleModManager.nro",
|
||||
"sd:/switch/sphaira.nro",
|
||||
"sd:/switch/swr-ini-tool/swr-ini-tool.nro",
|
||||
"sd:/switch/SwitchIdent.nro",
|
||||
"sd:/switch/Switch_themes_Installer/NXThemesInstaller.nro",
|
||||
"sd:/switch/Switchfin.nro",
|
||||
"sd:/switch/Sys-Clk Manager/sys-clk-manager.nro",
|
||||
"sd:/switch/Sys-Con.nro",
|
||||
"sd:/switch/sys-clk-manager.nro",
|
||||
|
||||
46
source/dram_fuse.c
Normal file
46
source/dram_fuse.c
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* DRAM capacity from fuse (SKU), not physical probe.
|
||||
*/
|
||||
|
||||
#include "dram_fuse.h"
|
||||
#include <soc/fuse.h>
|
||||
#include <soc/hw_init.h>
|
||||
#include <soc/t210.h>
|
||||
|
||||
static int mariko_dram_mib(u32 dram_id)
|
||||
{
|
||||
switch (dram_id) {
|
||||
case 9:
|
||||
case 13:
|
||||
case 18:
|
||||
case 21:
|
||||
case 23:
|
||||
case 28:
|
||||
return 8192;
|
||||
default:
|
||||
if (dram_id >= 3 && dram_id <= 28)
|
||||
return 4096;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int erista_dram_mib(u32 dram_id)
|
||||
{
|
||||
if (dram_id == 4)
|
||||
return 6144;
|
||||
if (dram_id <= 6)
|
||||
return 4096;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dram_capacity_mib_from_fuse(void)
|
||||
{
|
||||
u32 nid = fuse_read_dramid(false);
|
||||
u32 chip = hw_get_chip_id();
|
||||
|
||||
if (chip == GP_HIDREV_MAJOR_T210)
|
||||
return erista_dram_mib(nid);
|
||||
if (chip == GP_HIDREV_MAJOR_T210B01)
|
||||
return mariko_dram_mib(nid);
|
||||
return -1;
|
||||
}
|
||||
6
source/dram_fuse.h
Normal file
6
source/dram_fuse.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <utils/types.h>
|
||||
|
||||
/* DRAM capacity in MiB from fuse DRAM ID + SoC (same table as RAM test payload). */
|
||||
int dram_capacity_mib_from_fuse(void);
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
#include "install.h"
|
||||
#include "dram_fuse.h"
|
||||
#include "fs.h"
|
||||
#include "version.h"
|
||||
#include "gfx.h"
|
||||
@@ -618,6 +619,50 @@ int delete_path_list(const char* paths[], const char* description) {
|
||||
return (failed == 0) ? FR_OK : FR_DISK_ERR;
|
||||
}
|
||||
|
||||
#define HEKATE_8GB_SRC "sd:/bootloader/hekate_8gb.bin"
|
||||
#define PAYLOAD_BIN_DST "sd:/payload.bin"
|
||||
#define UPDATE_BIN_DST "sd:/bootloader/update.bin"
|
||||
|
||||
static void unlink_ignore_err(const char *path)
|
||||
{
|
||||
FILINFO fno;
|
||||
if (f_stat(path, &fno) != FR_OK)
|
||||
return;
|
||||
if (fno.fattrib & AM_RDO)
|
||||
f_chmod(path, fno.fattrib & ~AM_RDO, AM_RDO);
|
||||
f_unlink(path);
|
||||
}
|
||||
|
||||
/* After pack copy: if >4 GiB fuse RAM, install 8GB Hekate to payload.bin + bootloader/update.bin; always remove hekate_8gb.bin when done or if not used. */
|
||||
static void install_hekate_8gb_post_copy(void)
|
||||
{
|
||||
if (!install_path_exists(HEKATE_8GB_SRC))
|
||||
return;
|
||||
|
||||
int mib = dram_capacity_mib_from_fuse();
|
||||
if (mib > 4096) {
|
||||
install_set_color(COLOR_CYAN);
|
||||
gfx_printf("\nMehr als 4 GB RAM erkannt (Fuse). Die 8-GB-Hekate-Variante wird verwendet.\n");
|
||||
gfx_printf("Kopiere nach payload.bin und bootloader/update.bin...\n");
|
||||
install_set_color(COLOR_WHITE);
|
||||
|
||||
int r1 = file_copy(HEKATE_8GB_SRC, PAYLOAD_BIN_DST);
|
||||
int r2 = file_copy(HEKATE_8GB_SRC, UPDATE_BIN_DST);
|
||||
if (r1 == FR_OK && r2 == FR_OK) {
|
||||
install_set_color(COLOR_GREEN);
|
||||
gfx_printf(" [OK] Hekate 8 GB installiert.\n");
|
||||
install_set_color(COLOR_WHITE);
|
||||
unlink_ignore_err(HEKATE_8GB_SRC);
|
||||
} else {
|
||||
install_set_color(COLOR_ORANGE);
|
||||
gfx_printf(" [WARN] Kopie fehlgeschlagen (payload: %d, update: %d). hekate_8gb.bin bleibt.\n", r1, r2);
|
||||
install_set_color(COLOR_WHITE);
|
||||
}
|
||||
} else {
|
||||
unlink_ignore_err(HEKATE_8GB_SRC);
|
||||
}
|
||||
}
|
||||
|
||||
// Main installation function
|
||||
int perform_installation(omninx_variant_t pack_variant, install_mode_t mode) {
|
||||
int res;
|
||||
@@ -637,7 +682,9 @@ int perform_installation(omninx_variant_t pack_variant, install_mode_t mode) {
|
||||
install_set_color(COLOR_WHITE);
|
||||
res = update_mode_install(pack_variant);
|
||||
if (res != FR_OK) return res;
|
||||
|
||||
|
||||
install_hekate_8gb_post_copy();
|
||||
|
||||
install_check_and_clear_screen_if_needed();
|
||||
// Remove staging directory (installed pack)
|
||||
res = cleanup_staging_directory(pack_variant);
|
||||
@@ -676,7 +723,9 @@ int perform_installation(omninx_variant_t pack_variant, install_mode_t mode) {
|
||||
install_set_color(COLOR_WHITE);
|
||||
res = clean_mode_install(pack_variant);
|
||||
if (res != FR_OK) return res;
|
||||
|
||||
|
||||
install_hekate_8gb_post_copy();
|
||||
|
||||
install_check_and_clear_screen_if_needed();
|
||||
// Remove staging directory (installed pack)
|
||||
res = cleanup_staging_directory(pack_variant);
|
||||
|
||||
@@ -116,6 +116,12 @@ static void print_header(void) {
|
||||
set_color(COLOR_WHITE);
|
||||
}
|
||||
|
||||
/* Console Vol+ and Vol- together (exit / cancel where documented) */
|
||||
static inline bool cancel_combo_pressed(u8 btn)
|
||||
{
|
||||
return (btn & (BTN_VOL_UP | BTN_VOL_DOWN)) == (BTN_VOL_UP | BTN_VOL_DOWN);
|
||||
}
|
||||
|
||||
|
||||
void reloc_patcher(u32 payload_dst, u32 payload_src, u32 payload_size) {
|
||||
memcpy((u8 *)payload_src, (u8 *)IPL_LOAD_ADDR, PATCHED_RELOC_SZ);
|
||||
@@ -244,11 +250,13 @@ void ipl_main(void) {
|
||||
set_color(COLOR_GREEN);
|
||||
gfx_printf("Druecke A-Taste (rechter Joy-Con) oder Power-Taste,\n");
|
||||
gfx_printf("um Hekate zu starten...\n");
|
||||
gfx_printf("Oder Vol+ und Vol- (Konsole) gleichzeitig.\n");
|
||||
set_color(COLOR_WHITE);
|
||||
} else {
|
||||
set_color(COLOR_GREEN);
|
||||
gfx_printf("Druecke A-Taste (rechter Joy-Con) oder Power-Taste,\n");
|
||||
gfx_printf("um den Neustart zu starten...\n");
|
||||
gfx_printf("Oder Vol+ und Vol- (Konsole) gleichzeitig.\n");
|
||||
set_color(COLOR_WHITE);
|
||||
}
|
||||
|
||||
@@ -275,7 +283,11 @@ void ipl_main(void) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cancel_combo_pressed(btn_state)) {
|
||||
button_pressed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
msleep(50); // Small delay to avoid busy-waiting
|
||||
}
|
||||
|
||||
@@ -329,12 +341,14 @@ void ipl_main(void) {
|
||||
gfx_printf("\n");
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf("D-Pad / Vol+/-: Auswahl | A oder Power: Bestaetigen\n");
|
||||
gfx_printf("Vol+ und Vol- gleichzeitig: Abbrechen (Hekate)\n");
|
||||
set_color(COLOR_WHITE);
|
||||
|
||||
// Edge detection: only move on press (not while held)
|
||||
bool prev_up = false, prev_down = false;
|
||||
bool menu_aborted = false;
|
||||
|
||||
while (!confirmed) {
|
||||
while (!confirmed && !menu_aborted) {
|
||||
// On selection change: redraw only the two affected lines (no full clear)
|
||||
if (selected != prev_selected) {
|
||||
gfx_con_setpos(menu_x, menu_variant_start_y + (u32)prev_selected * 16);
|
||||
@@ -352,6 +366,11 @@ void ipl_main(void) {
|
||||
|
||||
if (jc && jc->cap)
|
||||
take_screenshot();
|
||||
|
||||
if (cancel_combo_pressed(btn)) {
|
||||
menu_aborted = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// D-pad or Vol+ / Vol- for selection (Vol+ = up, Vol- = down)
|
||||
bool cur_up = false, cur_down = false;
|
||||
@@ -377,6 +396,20 @@ void ipl_main(void) {
|
||||
|
||||
msleep(50);
|
||||
}
|
||||
|
||||
if (menu_aborted) {
|
||||
gfx_printf("\n");
|
||||
set_color(COLOR_YELLOW);
|
||||
gfx_printf("Abgebrochen. Starte Hekate...\n");
|
||||
set_color(COLOR_WHITE);
|
||||
msleep(500);
|
||||
if (file_exists(PAYLOAD_PATH)) {
|
||||
launch_payload(PAYLOAD_PATH);
|
||||
} else {
|
||||
power_set_state(POWER_OFF_REBOOT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
pack_variant = variants_present[selected];
|
||||
gfx_clear_grey(0x1B);
|
||||
@@ -403,20 +436,21 @@ void ipl_main(void) {
|
||||
gfx_printf("mit angeschlossenem Ladegeraet durchgefuehrt werden.\n\n");
|
||||
set_color(COLOR_YELLOW);
|
||||
gfx_printf("Stecke das Ladegeraet an und warte...\n");
|
||||
gfx_printf("Oder druecke + und - zum Abbrechen.\n");
|
||||
gfx_printf("Oder Vol+ und Vol- (Konsole) zum Abbrechen.\n");
|
||||
set_color(COLOR_WHITE);
|
||||
jc_init_hw();
|
||||
while (btn_read() & BTN_POWER) { msleep(50); }
|
||||
bool user_cancelled = false;
|
||||
while (batt_pct < BATT_LOW_THRESHOLD && !bq24193_charger_connected() && !user_cancelled) {
|
||||
u8 pbtn = btn_read();
|
||||
jc_gamepad_rpt_t *jc = joycon_poll();
|
||||
if (jc) {
|
||||
if (jc->cap)
|
||||
take_screenshot();
|
||||
if (jc->plus && jc->minus) {
|
||||
user_cancelled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (cancel_combo_pressed(pbtn)) {
|
||||
user_cancelled = true;
|
||||
break;
|
||||
}
|
||||
if (max17050_get_property(MAX17050_RepSOC, &batt_raw) == 0) {
|
||||
batt_pct = batt_raw >> 8;
|
||||
@@ -473,10 +507,13 @@ void ipl_main(void) {
|
||||
gfx_printf("Empfohlene Karten: Samsung EVO Plus, EVO Select und PRO Plus.\n\n");
|
||||
set_color(COLOR_GREEN);
|
||||
gfx_printf("Druecke A (oder Power), um trotzdem fortzufahren.\n");
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf("Vol+ und Vol- (Konsole) gleichzeitig: Abbrechen -> Hekate.\n");
|
||||
set_color(COLOR_WHITE);
|
||||
while (btn_read() & BTN_POWER) { msleep(50); }
|
||||
bool acknowledged = false;
|
||||
while (!acknowledged) {
|
||||
bool uhs_aborted = false;
|
||||
while (!acknowledged && !uhs_aborted) {
|
||||
u8 btn_state = btn_read();
|
||||
if (btn_state & BTN_POWER) acknowledged = true;
|
||||
jc_gamepad_rpt_t *jc = joycon_poll();
|
||||
@@ -485,8 +522,22 @@ void ipl_main(void) {
|
||||
take_screenshot();
|
||||
if (jc->a) acknowledged = true;
|
||||
}
|
||||
if (cancel_combo_pressed(btn_state)) {
|
||||
uhs_aborted = true;
|
||||
break;
|
||||
}
|
||||
msleep(50);
|
||||
}
|
||||
if (uhs_aborted) {
|
||||
gfx_printf("\nAbgebrochen. Starte Hekate...\n");
|
||||
msleep(500);
|
||||
if (file_exists(PAYLOAD_PATH)) {
|
||||
launch_payload(PAYLOAD_PATH);
|
||||
} else {
|
||||
power_set_state(POWER_OFF_REBOOT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Wait for A and Power to be released so the same press doesn't start the install
|
||||
while (btn_read() & BTN_POWER) { msleep(50); }
|
||||
bool released = false;
|
||||
@@ -526,7 +577,7 @@ void ipl_main(void) {
|
||||
gfx_printf("um die Installation zu starten...\n");
|
||||
set_color(COLOR_WHITE);
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf("Druecke + und - gleichzeitig zum Abbrechen (zurueck zu Hekate).\n");
|
||||
gfx_printf("Vol+ und Vol- (Konsole) gleichzeitig: Abbrechen -> Hekate.\n");
|
||||
set_color(COLOR_WHITE);
|
||||
|
||||
// Wait for A/Power to start, or +/- to cancel
|
||||
@@ -555,11 +606,10 @@ void ipl_main(void) {
|
||||
button_pressed = true;
|
||||
break;
|
||||
}
|
||||
// + and - simultaneously = cancel, return to hekate
|
||||
if (jc->plus && jc->minus) {
|
||||
cancelled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (cancel_combo_pressed(btn_state)) {
|
||||
cancelled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
msleep(50); // Small delay to avoid busy-waiting
|
||||
|
||||
70
tools/ram_test_main.c
Normal file
70
tools/ram_test_main.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Minimal RAM info test payload (fuse DRAM ID + SK table -> MiB).
|
||||
* Build: make ram-test -> output/RAM-Test.bin
|
||||
*/
|
||||
|
||||
#include <display/di.h>
|
||||
#include <mem/heap.h>
|
||||
#include <mem/minerva.h>
|
||||
#include <memory_map.h>
|
||||
#include <soc/bpmp.h>
|
||||
#include <soc/fuse.h>
|
||||
#include <soc/hw_init.h>
|
||||
#include <soc/t210.h>
|
||||
#include <utils/util.h>
|
||||
|
||||
#include "dram_fuse.h"
|
||||
#include "gfx.h"
|
||||
|
||||
#undef COLOR_CYAN
|
||||
#undef COLOR_WHITE
|
||||
#define COLOR_CYAN 0xFF00FFFF
|
||||
#define COLOR_WHITE 0xFFFFFFFF
|
||||
|
||||
/* Required by BDK */
|
||||
boot_cfg_t __attribute__((section("._boot_cfg"))) b_cfg;
|
||||
volatile nyx_storage_t *nyx_str = (nyx_storage_t *)NYX_STORAGE_ADDR;
|
||||
|
||||
extern void pivot_stack(u32 stack_top);
|
||||
|
||||
void ipl_main(void)
|
||||
{
|
||||
hw_init();
|
||||
pivot_stack(IPL_STACK_TOP);
|
||||
heap_init(IPL_HEAP_START);
|
||||
|
||||
minerva_init();
|
||||
minerva_change_freq(FREQ_800);
|
||||
|
||||
display_init();
|
||||
u32 *fb = display_init_framebuffer_pitch();
|
||||
gfx_init_ctxt(fb, 720, 1280, 720);
|
||||
gfx_con_init();
|
||||
display_backlight_pwm_init();
|
||||
display_backlight_brightness(100, 1000);
|
||||
|
||||
bpmp_clk_rate_set(BPMP_CLK_DEFAULT_BOOST);
|
||||
|
||||
gfx_clear_grey(0x1B);
|
||||
gfx_con_setpos(0, 0);
|
||||
gfx_con_setcol(COLOR_CYAN, gfx_con.fillbg, gfx_con.bgcol);
|
||||
gfx_printf("RAM test payload\n\n");
|
||||
gfx_con_setcol(COLOR_WHITE, gfx_con.fillbg, gfx_con.bgcol);
|
||||
|
||||
u32 raw = fuse_read_dramid(true);
|
||||
u32 nid = fuse_read_dramid(false);
|
||||
u32 chip = hw_get_chip_id();
|
||||
int mib = dram_capacity_mib_from_fuse();
|
||||
|
||||
gfx_printf("SoC: %s\n", chip == GP_HIDREV_MAJOR_T210B01 ? "Mariko (T210B01)" : "Erista (T210)");
|
||||
gfx_printf("DRAM fuse: raw %d norm %d\n", raw, nid);
|
||||
if (mib > 0)
|
||||
gfx_printf("Table MiB: %d (fuse SKU, not probe)\n", mib);
|
||||
else
|
||||
gfx_printf("Table MiB: (unknown id for this SoC)\n");
|
||||
|
||||
gfx_printf("\nHang — power off or inject payload.\n");
|
||||
|
||||
while (1)
|
||||
msleep(500);
|
||||
}
|
||||
Reference in New Issue
Block a user