From f50d41d919577afc1fe7b508209860fd137acda1 Mon Sep 17 00:00:00 2001 From: LuigiBlood Date: Thu, 3 Aug 2023 15:22:05 +0200 Subject: [PATCH] leoC2_Correction match --- src/libleo/leoc2ecc.c | 25 +++++++++++++++++++++++++ tools/symbol_addrs.txt | 1 + 2 files changed, 26 insertions(+) diff --git a/src/libleo/leoc2ecc.c b/src/libleo/leoc2ecc.c index b872658b..db7a1124 100644 --- a/src/libleo/leoc2ecc.c +++ b/src/libleo/leoc2ecc.c @@ -3,11 +3,36 @@ //Tables to add here extern u8 ganlog[512]; extern u8 glog[512]; +//To be determined, should be a struct +extern static u8 LEOc2_param[16]; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunknown-pragmas" +#ifdef NON_MATCHING +s32 leoC2_Correction(void) { + switch (LEOc2_param[12]) { + case 1: + leoC2_single_ecc(); + return 0; + case 2: + leoC2_double_ecc(); + return 0; + case 3: + leoC2_3_ecc(); + return 0; + case 4: + leoC2_4_ecc(); + return 0; + default: + return -1; + case 0: + return 0; + } +} +#else #pragma GLOBAL_ASM("asm/nonmatchings/libleo/leoc2ecc/leoC2_Correction.s") +#endif #pragma GLOBAL_ASM("asm/nonmatchings/libleo/leoc2ecc/leoC2_single_ecc.s") diff --git a/tools/symbol_addrs.txt b/tools/symbol_addrs.txt index e8b19edb..7f2b70b1 100644 --- a/tools/symbol_addrs.txt +++ b/tools/symbol_addrs.txt @@ -142,6 +142,7 @@ leoDiskStack = 0x801020D0; LEOdisk_type = 0x801006D8; LEO_country_code = 0x801006EC; LEOrw_flags = 0x801006D6; +LEOc2_param = 0x80101080; leoC2_Correction = 0x80053710; leoC2_single_ecc = 0x8005379C; leoC2_double_ecc = 0x80053870;