diff --git a/src/libleo/leoc2ecc.c b/src/libleo/leoc2ecc.c index b872658..5aee5bb 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 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 e8b19ed..7f2b70b 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;