From 1910d8b718472ab5334f6fcb33697c2a9caac418 Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Sat, 22 Mar 2025 01:51:18 -0400 Subject: [PATCH] anon fixed matching for me --- include/gba/defines.h | 1 + include/structs/axdata.h | 8 ++++---- src/debug.c | 28 ++++++++++++++-------------- src/text_2.c | 14 +++++++------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/include/gba/defines.h b/include/gba/defines.h index 5e1560240..111652019 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -16,6 +16,7 @@ #define NORETURN __attribute__((noreturn)) #define PACKED __attribute__((packed)) #define ALIGNED(n) __attribute__((aligned(n))) +#define ALIGNED_PACKED(n) __attribute__((packed, aligned(n))) #define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) #define INTR_CHECK (*(u16 *)0x3007FF8) diff --git a/include/structs/axdata.h b/include/structs/axdata.h index 03a142f99..cdd8b44d6 100644 --- a/include/structs/axdata.h +++ b/include/structs/axdata.h @@ -29,21 +29,21 @@ typedef struct axdata1 } axdata1; // Size: 0x2 -typedef struct ax_pose_unk2 +typedef struct ALIGNED_PACKED(2) ax_pose_unk2 { u8 unk0; s8 unk1; -} ax_pose_unk2 __attribute__((packed, aligned(2))); +} ax_pose_unk2; // size: 0xA -typedef struct ax_pose +typedef struct ALIGNED_PACKED(2) ax_pose { /* 0x0 */ s16 sprite; /* 0x2 */ ax_pose_unk2 unk2; // Always {0, 0} in red (except for end markers {0xFF, 0xFF} and Latios Pose189...) /* 0x4 */ u16 flags1; /* 0x6 */ u16 flags2; /* 0x8 */ u16 flags3; -} ax_pose __attribute__((packed, aligned(2))); +} ax_pose; // size: 0xC typedef struct ax_anim diff --git a/src/debug.c b/src/debug.c index 3f1b75d13..0377a973d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,10 +1,21 @@ #include "global.h" #include "debug.h" -static EWRAM_INIT bool32 gNDS_DebugEnabled = {0}; // NDS=020EACE4 -static EWRAM_INIT u8 gUnknown_203B150 = {0}; +EWRAM_INIT static bool32 gNDS_DebugEnabled = {0}; // NDS=020EACE4 +EWRAM_INIT static u8 gUnknown_203B150 = {0}; -UNUSED static EWRAM_INIT const char *sUnusedEwramDebugStrings[] = +ALIGNED(4) static const char gFuncFileLineString[] = "func = '%s'\nfile = '%s' line = %5d"; + +ALIGNED(4) static const char gNotEntryText[] = "--- not entry ---"; +ALIGNED(4) static const char gFuncFileLineStringWPrefix[] = "%sfunc = '%s'\nfile = '%s' line = %5d\n"; + +ALIGNED(4) static const char gFuncFileLineString2[] = "func = '%s'\nfile = '%s' line = %5d\n"; + +ALIGNED(4) static const char debug_fill14[] = "pksdir0"; +ALIGNED(4) static const char gDebugPrintPrefix[] = " Print "; +ALIGNED(4) static const char debug_fill13[] = "pksdir0"; + +EWRAM_INIT UNUSED static const char *sUnusedEwramDebugStrings[] = { "Ground", "GroundScript", @@ -18,17 +29,6 @@ UNUSED static EWRAM_INIT const char *sUnusedEwramDebugStrings[] = "Performance", }; -ALIGNED(4) static const char gFuncFileLineString[] = "func = '%s'\nfile = '%s' line = %5d"; - -ALIGNED(4) static const char gNotEntryText[] = "--- not entry ---"; -ALIGNED(4) static const char gFuncFileLineStringWPrefix[] = "%sfunc = '%s'\nfile = '%s' line = %5d\n"; - -ALIGNED(4) static const char gFuncFileLineString2[] = "func = '%s'\nfile = '%s' line = %5d\n"; - -ALIGNED(4) static const char debug_fill14[] = "pksdir0"; -ALIGNED(4) static const char gDebugPrintPrefix[] = " Print "; -ALIGNED(4) static const char debug_fill13[] = "pksdir0"; - ALIGNED(4) static const char gNotMountText[] = "not mount log system"; ALIGNED(4) static const char debug_fill9[] = "pksdir0"; ALIGNED(4) static const char debug_fill10[] = "pksdir0"; diff --git a/src/text_2.c b/src/text_2.c index 66ec61754..cb4d1b051 100644 --- a/src/text_2.c +++ b/src/text_2.c @@ -5,13 +5,6 @@ #include "text_1.h" #include "text_2.h" -static const u32 sUnknown_80B8868[] = -{ - 0, 0xF, 0xFF, 0xFFF, 0xFFFF, 0xFFFFF, 0xFFFFFF, 0xFFFFFFF, - 0xFFFFFFFF, 0xFFFFFFF0, 0xFFFFFF00, 0xFFFFF000, 0xFFFF0000, - 0xFFF00000, 0xFF000000, 0xF0000000 -}; - static void AddUnderScoreHighlightInternal(Window *windows, u32 windowId, s32 x, s32 y, s32 width, u32 color); static void DisplayMonPortrait(Window *a0, u16 a1[32][32], s32 a2, const u8 *compressedData, u32 a4); static void DisplayMonPortraitFlipped(Window *windows, s32 windowId, const u8 *compressedData, s32 a3); @@ -904,6 +897,13 @@ UNUSED static void nullsub_168(void) { } +static const u32 sUnknown_80B8868[] = +{ + 0, 0xF, 0xFF, 0xFFF, 0xFFFF, 0xFFFFF, 0xFFFFFF, 0xFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFF0, 0xFFFFFF00, 0xFFFFF000, 0xFFFF0000, + 0xFFF00000, 0xFF000000, 0xF0000000 +}; + UNUSED static void sub_80086C8(Window *windows, s32 windowId, s32 a2, s32 a3, s32 a4, s32 a5) { u32 *r5;