From 914aaaa0e460362f7a14e2e09969df7b97f08fcb Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 15 Oct 2022 10:04:09 +1000 Subject: [PATCH] Align g_RdpDramStack and g_RdpYieldData --- src/include/constants.h | 6 ++++++ src/lib/rdp.c | 5 ++--- src/lib/ultra/io/controller.c | 7 ++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/include/constants.h b/src/include/constants.h index 04c9b08ac..37b0c1232 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -86,6 +86,12 @@ #define PORTAL_IS_CLOSED(portalnum) ((g_BgPortals[portalnum].flags & PORTALFLAG_CLOSED) && (g_BgPortals[portalnum].flags & PORTALFLAG_FORCEOPEN) == 0) +#ifdef __sgi +#define ALIGNED16 +#else +#define ALIGNED16 __attribute__ ((aligned (16))) +#endif + #if VERSION >= VERSION_NTSC_1_0 #define ROM_COMPANYCODE 0x3459 #else diff --git a/src/lib/rdp.c b/src/lib/rdp.c index a46241e49..7dec33db0 100644 --- a/src/lib/rdp.c +++ b/src/lib/rdp.c @@ -6,9 +6,8 @@ #include "lib/memp.h" #include "lib/sched.h" -u8 g_RdpDramStack[SP_DRAM_STACK_SIZE8]; - -u8 g_RdpYieldData[0xb00]; +ALIGNED16 u8 g_RdpDramStack[SP_DRAM_STACK_SIZE8]; +ALIGNED16 u8 g_RdpYieldData[0xb00]; u16 *g_RdpOutBufferEnd = NULL; u16 *g_RdpOutBufferStart = NULL; diff --git a/src/lib/ultra/io/controller.c b/src/lib/ultra/io/controller.c index 32c9fcd40..73b36b25d 100644 --- a/src/lib/ultra/io/controller.c +++ b/src/lib/ultra/io/controller.c @@ -1,13 +1,10 @@ #include #include #include "controller.h" +#include "constants.h" #include "siint.h" -#ifdef __sgi -OSPifRam __osContPifRam; -#else -__attribute__ ((aligned (0x10))) OSPifRam __osContPifRam; -#endif +ALIGNED16 OSPifRam __osContPifRam; u8 __osContLastCmd; u8 __osMaxControllers;