summaryrefslogtreecommitdiff
path: root/arm9/lib/include/MATH_crc.h
diff options
context:
space:
mode:
authorRevo <projectrevotpp@hotmail.com>2020-08-20 01:39:17 -0400
committerGitHub <noreply@github.com>2020-08-20 01:39:17 -0400
commit4ed13afd18de6f0b94d35e83023094efcfec73f5 (patch)
tree1347c2688a313c4a70f3a205ab1cc79c496ed2fa /arm9/lib/include/MATH_crc.h
parent512d22cff9098f9c3636ca018355a851d011effc (diff)
parent3d2b7e5e5e3c43a8c5dc8c8ce255b0c53413048d (diff)
Merge pull request #265 from PikalaxALT/pikalax_work
save.c, pokemon_storage_system.c
Diffstat (limited to 'arm9/lib/include/MATH_crc.h')
-rw-r--r--arm9/lib/include/MATH_crc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arm9/lib/include/MATH_crc.h b/arm9/lib/include/MATH_crc.h
index f15a2e32..4f06fa75 100644
--- a/arm9/lib/include/MATH_crc.h
+++ b/arm9/lib/include/MATH_crc.h
@@ -7,6 +7,8 @@ typedef u8 MATHCRC8Context;
typedef u16 MATHCRC16Context;
typedef u32 MATHCRC32Context;
+#define MATH_CRC16_CCITT_POLY 0x1021
+
struct MATHCRC8Table {
u8 table[256];
};
@@ -35,4 +37,9 @@ void MATHi_CRC16InitTable(struct MATHCRC16Table *table, u16 poly);
void MATHi_CRC8Update(const struct MATHCRC8Table *table, MATHCRC8Context *context, const void *input, u32 length);
void MATHi_CRC8InitTable(struct MATHCRC8Table *table, u8 poly);
+static inline void MATH_CRC16InitTable(struct MATHCRC16Table * table)
+{
+ MATHi_CRC16InitTable(table, MATH_CRC16_CCITT_POLY);
+}
+
#endif