From dfc40723c5917024849dc9ee83efcd0972826adc Mon Sep 17 00:00:00 2001 From: LuigiBlood Date: Sat, 5 Aug 2023 00:11:20 +0200 Subject: [PATCH] leoC2_single_ecc match --- src/libleo/leoc2ecc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/libleo/leoc2ecc.c b/src/libleo/leoc2ecc.c index 6939249e..73d89bec 100644 --- a/src/libleo/leoc2ecc.c +++ b/src/libleo/leoc2ecc.c @@ -36,7 +36,25 @@ s32 leoC2_Correction(void) { #pragma GLOBAL_ASM("asm/nonmatchings/libleo/leoc2ecc/leoC2_Correction.s") #endif +#ifdef NON_MATCHING +void leoC2_single_ecc(void) { + u8* pointer; + u32 byte; + u8* p_s; + + if (LEOc2_param.err_pos[0] < 0x55) { + byte = LEOc2_param.bytes; + pointer = &LEOc2_param.pntr[(LEOc2_param.err_pos[0] + 1) * byte]; + p_s = LEOc2_param.c2buff_e; + + do { + *(--pointer) ^= *(p_s -= 4); + } while(--byte != 0); + } +} +#else #pragma GLOBAL_ASM("asm/nonmatchings/libleo/leoc2ecc/leoC2_single_ecc.s") +#endif #pragma GLOBAL_ASM("asm/nonmatchings/libleo/leoc2ecc/leoC2_double_ecc.s")