usk/config.h
DefenderOfHyrule c0f8d7c186
More proper implementation of my BCT resync fix and add CLK detection (#9)
* add CLK detection, apparently was never checked :P

* 2.82, more proper implementation of the BCT resync fix.

* 2.82 also contains a fingerprint (first few characters of BCT pubkey) that can be used with modchip toolbox 1.0.2.
2026-04-15 20:33:56 +02:00

24 lines
671 B
C

#include "hardware/flash.h"
#define OFFSET_DIV 8
#define OFFSET_MIN 6200
#define OFFSET_MAX 6900
#define VER_HI 2
#define VER_LO 82
bool is_configured();
void init_config();
bool is_inited();
void erase_config();
void add_boot_record(int offset);
int find_best_record(int * max_weight);
bool fast_check();
int get_weigth(int offset);
#define CONFIG_START 0x8000 // change to 0x100000 when compiling in "default mode"
#define CONFIG_IDX(offset) (((offset - OFFSET_MIN) / OFFSET_DIV) + 1)
#define CONFIG_CNT CONFIG_IDX(OFFSET_MAX)
#define OFFSET_CNT (CONFIG_CNT-1)
#define CONFIG_SIZE (CONFIG_CNT * 256)
#define flash_cfg ((const uint8_t *) (XIP_BASE + CONFIG_START))