From 57351f30edb58f09bba1cab85280e014a5d2e834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Calixte?= Date: Sat, 14 Aug 2021 13:16:36 +0200 Subject: fix fakematch --- arm9/src/unk_02008DEC.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arm9/src/unk_02008DEC.c b/arm9/src/unk_02008DEC.c index 183a9c81..3050110b 100644 --- a/arm9/src/unk_02008DEC.c +++ b/arm9/src/unk_02008DEC.c @@ -559,22 +559,18 @@ THUMB_FUNC void FUN_02009668(u32 *param0, struct UnkStruct_02008DEC_2 *param1, u param1->unk04 = FUN_020099E8((struct UnkStruct_02008DEC_4 *)(param0 + 1)); - void *ptr; if (param1->unk04 > 0) { - ptr = AllocFromHeap(param2, param1->unk04 * sizeof(struct UnkStruct_02008DEC_4)); + param1->unk00 = AllocFromHeap(param2, param1->unk04 * sizeof(struct UnkStruct_02008DEC_4)); } else { - ptr = NULL; + param1->unk00 = NULL; } - param1->unk00 = ptr; - // use volatile to force a reload here - void *r0 = *((void *volatile *)param1); - if (r0 != NULL) + if (param1->unk00 != NULL) { - memcpy(r0, param0 + 1, param1->unk04 * sizeof(struct UnkStruct_02008DEC_4)); + memcpy(param1->unk00, param0 + 1, param1->unk04 * sizeof(struct UnkStruct_02008DEC_4)); } } -- cgit v1.2.3