diff --git a/include/JSystem/J3DGraphBase/J3DStruct.h b/include/JSystem/J3DGraphBase/J3DStruct.h index 4a604db07..769a5a9d9 100644 --- a/include/JSystem/J3DGraphBase/J3DStruct.h +++ b/include/JSystem/J3DGraphBase/J3DStruct.h @@ -5,6 +5,7 @@ #include "dolphin/mtx/mtx.h" #include "dolphin/mtx/mtx44.h" #include "dolphin/mtx/vec.h" +#include "global.h" class J3DLightInfo { public: @@ -144,7 +145,7 @@ struct J3DIndTexOrderInfo { }; struct J3DTevSwapModeInfo { - /* 0x0 */ u8 field_0x0 __attribute__((aligned(4))); + /* 0x0 */ u8 field_0x0 ALIGN_DECL(4); /* 0x1 */ u8 field_0x1; }; @@ -179,7 +180,7 @@ struct J3DTevStageInfo { }; struct J3DIndTevStageInfo { - /* 0x0 */ u8 mIndStage __attribute__((aligned(4))); + /* 0x0 */ u8 mIndStage ALIGN_DECL(4); /* 0x1 */ u8 mIndFormat; /* 0x2 */ u8 mBiasSel; /* 0x3 */ u8 mMtxSel; @@ -191,7 +192,7 @@ struct J3DIndTevStageInfo { }; struct J3DTexCoordInfo { - /* 0x0 */ u8 mTexGenType __attribute__((aligned(4))); + /* 0x0 */ u8 mTexGenType ALIGN_DECL(4); /* 0x1 */ u8 mTexGenSrc; /* 0x2 */ u8 mTexGenMtx; }; @@ -216,7 +217,7 @@ struct J3DBlendInfo { }; struct J3DTevOrderInfo { - /* 0x0 */ u8 mTexCoord __attribute__((aligned(2))); + /* 0x0 */ u8 mTexCoord ALIGN_DECL(2); /* 0x1 */ u8 mTexMap; /* 0x2 */ u8 mColorChan; }; diff --git a/include/JSystem/JAudio/JASAudioThread.h b/include/JSystem/JAudio/JASAudioThread.h index 1dc995d22..4c2a4b89a 100644 --- a/include/JSystem/JAudio/JASAudioThread.h +++ b/include/JSystem/JAudio/JASAudioThread.h @@ -3,6 +3,7 @@ #include #include +#include "global.h" class JKRSolidHeap; @@ -15,7 +16,7 @@ namespace JASystem { void start(JKRSolidHeap*, u32, u32); extern OSThread sAudioThread; - extern u8 saAudioStack[4096] __attribute__((aligned(32))); + extern u8 saAudioStack[4096] ALIGN_DECL(32); extern OSMessageQueue sAudioprocMQ; extern OSMessage saAudioMsgBuf[16]; extern u32 sAudioprocMQInit; diff --git a/include/JSystem/JAudio/JASDriverTables.h b/include/JSystem/JAudio/JASDriverTables.h index 406606422..6ec055f7c 100644 --- a/include/JSystem/JAudio/JASDriverTables.h +++ b/include/JSystem/JAudio/JASDriverTables.h @@ -2,14 +2,15 @@ #define JASDRIVERTABLES_H #include "dolphin/types.h" +#include "global.h" namespace JASystem { namespace Driver { extern f32 C5BASE_PITCHTABLE[]; } namespace DSPInterface { - extern u16 DSPADPCM_FILTER[] __attribute__((aligned(32))); - extern u16 DSPRES_FILTER[] __attribute__((aligned(32))); + extern u16 DSPADPCM_FILTER[] ALIGN_DECL(32); + extern u16 DSPRES_FILTER[] ALIGN_DECL(32); } } diff --git a/include/JSystem/JUtility/JUTFontData_Ascfont_fix12.h b/include/JSystem/JUtility/JUTFontData_Ascfont_fix12.h index e57c56460..74a25331b 100644 --- a/include/JSystem/JUtility/JUTFontData_Ascfont_fix12.h +++ b/include/JSystem/JUtility/JUTFontData_Ascfont_fix12.h @@ -1,8 +1,8 @@ #ifndef JUTFONTDATA_ASCFONT_FIX12_H #define JUTFONTDATA_ASCFONT_FIX12_H -#include "dolphin/types.h" +#include "global.h" -extern const u8 JUTResFONT_Ascfont_fix12[] __attribute__((aligned(32))); +extern const u8 JUTResFONT_Ascfont_fix12[] ALIGN_DECL(32); #endif /* JUTFONTDATA_ASCFONT_FIX12_H */ diff --git a/include/d/actor/d_a_agb.h b/include/d/actor/d_a_agb.h index 4de613bb0..655671d8c 100644 --- a/include/d/actor/d_a_agb.h +++ b/include/d/actor/d_a_agb.h @@ -5,6 +5,7 @@ #include "d/d_bg_s_acch.h" #include "d/d_particle.h" #include "f_op/f_op_actor_mng.h" +#include "global.h" #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_hostIO.h" @@ -93,7 +94,7 @@ public: struct daAgb_ItemBuy { /* 0x0 */ u8 field_0x0; - } __attribute__((aligned(4))); + } ALIGN_DECL(4); struct daAgb_GbaFlg { /* 0x0 */ u16 field_0x0; @@ -124,11 +125,11 @@ public: struct daAgb_Item { /* 0x0 */ u8 field_0x0; /* 0x1 */ u8 field_0x1; - } __attribute__((aligned(4))); + } ALIGN_DECL(4); struct daAgb_Shop { /* 0x0 */ u8 field_0x0; - } __attribute__((aligned(4))); + } ALIGN_DECL(4); static int mEffect; static daAgb_ItemBuy mItemBuy; diff --git a/include/dolphin/gba/GBAPriv.h b/include/dolphin/gba/GBAPriv.h index b1ba4661f..d2284e0bb 100644 --- a/include/dolphin/gba/GBAPriv.h +++ b/include/dolphin/gba/GBAPriv.h @@ -1,11 +1,10 @@ #ifndef _DOLPHIN_GBAPRIV #define _DOLPHIN_GBAPRIV -#include "dolphin/types.h" - #include "dolphin/dsp.h" #include "dolphin/gba/GBA.h" #include "dolphin/os/OS.h" +#include "global.h" #ifdef __cplusplus extern "C" { @@ -23,7 +22,7 @@ typedef struct GBASecParam { u32 keyA; s32 keyB; u8 _padding1[24]; -} GBASecParam __attribute__((aligned(32))); +} GBASecParam ALIGN_DECL(32); typedef struct GBABootInfo { s32 paletteColor; diff --git a/include/global.h b/include/global.h index 82758bb06..ffdc54280 100644 --- a/include/global.h +++ b/include/global.h @@ -29,8 +29,12 @@ #define GLUE(a, b) a##b #define GLUE2(a, b) GLUE(a, b) #define STATIC_ASSERT(cond) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1] +#define ALIGN_DECL(ALIGNMENT) __attribute__((aligned(ALIGNMENT))) +#define SECTION_DATA __declspec(section ".data") #else #define STATIC_ASSERT(...) +#define ALIGN_DECL(...) +#define SECTION_DATA #endif // hack to make functions that return comparisons as int match diff --git a/include/m_Do/m_Do_dvd_thread.h b/include/m_Do/m_Do_dvd_thread.h index 02410d32b..5f04f703c 100644 --- a/include/m_Do/m_Do_dvd_thread.h +++ b/include/m_Do/m_Do_dvd_thread.h @@ -5,6 +5,7 @@ #include "dolphin/os/OSMessage.h" #include "dolphin/os/OSMutex.h" #include "f_pc/f_pc_node.h" +#include "global.h" class JKRHeap; class JKRMemArchive; @@ -106,7 +107,7 @@ private: struct mDoDvdThdStack { u8 stack[4096]; -} __attribute__((aligned(32))); +} ALIGN_DECL(32); struct mDoDvdThd { static s32 main(void*); diff --git a/src/JSystem/J3DGraphBase/J3DSys.cpp b/src/JSystem/J3DGraphBase/J3DSys.cpp index 83f4b885a..653bc38c7 100644 --- a/src/JSystem/J3DGraphBase/J3DSys.cpp +++ b/src/JSystem/J3DGraphBase/J3DSys.cpp @@ -9,6 +9,7 @@ #include "JSystem/J3DGraphBase/J3DTevs.h" #include "JSystem/J3DGraphBase/J3DShape.h" #include "dolphin/os/OS.h" +#include "global.h" extern void JRNLoadTexCached(GXTexMapID, u32, GXTexCacheSize, u32, GXTexCacheSize); extern void makeTexCoordTable(); @@ -118,7 +119,7 @@ void J3DFifoLoadNrmMtxImm3x3(Mtx33 mtx, unsigned long idx) { GFX_FIFO(u32) = mtx_u32[8]; } -u8 NullTexData[16] __attribute__((aligned(32))) = { +u8 NullTexData[16] ALIGN_DECL(32) = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; diff --git a/src/JSystem/JFramework/JFWDisplay.cpp b/src/JSystem/JFramework/JFWDisplay.cpp index 557c24da8..1c5b0ab18 100644 --- a/src/JSystem/JFramework/JFWDisplay.cpp +++ b/src/JSystem/JFramework/JFWDisplay.cpp @@ -11,7 +11,7 @@ #include "JSystem/JUtility/JUTProcBar.h" #include "dolphin/gx/GX.h" #include "dolphin/os/OS.h" -#include "dolphin/types.h" +#include "global.h" JFWDisplay* JFWDisplay::sManager = 0; @@ -22,7 +22,7 @@ Mtx e_mtx = { {0.0f, 0.0f, 1.0f, 0.0f}, }; static GXTexObj clear_z_tobj; -u8 clear_z_TX[64] __attribute__((aligned(32))) = { +u8 clear_z_TX[64] ALIGN_DECL(32) = { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, diff --git a/src/d/actor/d_a_hookshot.cpp b/src/d/actor/d_a_hookshot.cpp index 4a82736c7..cf9b863d4 100644 --- a/src/d/actor/d_a_hookshot.cpp +++ b/src/d/actor/d_a_hookshot.cpp @@ -10,12 +10,13 @@ #include "SSystem/SComponent/c_counter.h" #include "d/actor/d_a_player_main.h" #include "d/d_procname.h" +#include "global.h" // Needed for the .data section to match. static Vec dummy_2100 = {1.0f, 1.0f, 1.0f}; static Vec dummy_2080 = {1.0f, 1.0f, 1.0f}; -static u8 l_chainS3TCTEX[] __attribute__((aligned(32))) = { +static u8 l_chainS3TCTEX[] ALIGN_DECL(32) = { 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -82,7 +83,7 @@ static cXy l_texCoord[0xC] = { {0.961538, 0.983522}, }; -static u8 l_chainDL[] __attribute__((aligned(32))) = { +static u8 l_chainDL[] ALIGN_DECL(32) = { 0x98, 0x00, 0x06, 0x01, 0x0A, 0x07, 0x0B, 0x09, 0x08, 0x0B, 0x09, 0x02, 0x08, 0x08, 0x09, 0x98, 0x00, 0x06, 0x0B, 0x07, 0x07, 0x06, 0x0A, 0x04, 0x04, 0x05, 0x09, 0x07, 0x01, 0x06, 0x98, 0x00, 0x06, 0x08, 0x03, 0x0B, 0x02, 0x05, 0x00, 0x0A, 0x01, 0x02, 0x03, 0x09, 0x02, @@ -96,7 +97,7 @@ static u8 l_chainDL[] __attribute__((aligned(32))) = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -static u8 l_matDL[] __attribute__((aligned(32))) = { +static u8 l_matDL[] ALIGN_DECL(32) = { 0x61, 0x80, 0x00, 0x01, 0x3A, 0x61, 0x84, 0x00, 0x00, 0x00, 0x61, 0x88, 0xE0, 0x7C, 0x1F, diff --git a/src/d/actor/d_a_ib.cpp b/src/d/actor/d_a_ib.cpp index 0114b17ed..84979358e 100644 --- a/src/d/actor/d_a_ib.cpp +++ b/src/d/actor/d_a_ib.cpp @@ -12,6 +12,7 @@ #include "d/actor/d_a_item.h" #include "d/d_item.h" #include "d/d_item_data.h" +#include "global.h" #include "m_Do/m_Do_mtx.h" // Needed for the .data section to match. @@ -333,10 +334,7 @@ void daIball_c::set_mtx() { } // TODO: This is a hack. I have no idea why this one variable needs to go in .data instead of .sdata. -#ifndef __INTELLISENSE__ -__declspec(section ".data") -#endif -char daIball_c::m_arcname[] = "Always"; +SECTION_DATA char daIball_c::m_arcname[] = "Always"; dCcD_SrcCyl daIball_c::m_cyl_src = { // dCcD_SrcGObjInf diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp index ad4981281..b690adeaa 100644 --- a/src/d/actor/d_a_tag_msg.cpp +++ b/src/d/actor/d_a_tag_msg.cpp @@ -7,25 +7,26 @@ #include "d/actor/d_a_player_main.h" #include "d/d_com_inf_game.h" #include "d/d_procname.h" +#include "global.h" static Vec bss_3569; // Not sure what these are, but they have size 1, and alignment 1 in the debug maps, but alignment 4 in the non-debug maps. -static u8 bss_1036 __attribute__((aligned(4))); -static u8 bss_1034 __attribute__((aligned(4))); -static u8 bss_1032 __attribute__((aligned(4))); -static u8 bss_1031 __attribute__((aligned(4))); -static u8 bss_1026 __attribute__((aligned(4))); -static u8 bss_1024 __attribute__((aligned(4))); -static u8 bss_1022 __attribute__((aligned(4))); -static u8 bss_1021 __attribute__((aligned(4))); -static u8 bss_984 __attribute__((aligned(4)));; -static u8 bss_982 __attribute__((aligned(4)));; -static u8 bss_980 __attribute__((aligned(4)));; -static u8 bss_979 __attribute__((aligned(4)));; -static u8 bss_941 __attribute__((aligned(4)));; -static u8 bss_939 __attribute__((aligned(4)));; -static u8 bss_937 __attribute__((aligned(4)));; -static u8 bss_936 __attribute__((aligned(4)));; +static u8 bss_1036 ALIGN_DECL(4); +static u8 bss_1034 ALIGN_DECL(4); +static u8 bss_1032 ALIGN_DECL(4); +static u8 bss_1031 ALIGN_DECL(4); +static u8 bss_1026 ALIGN_DECL(4); +static u8 bss_1024 ALIGN_DECL(4); +static u8 bss_1022 ALIGN_DECL(4); +static u8 bss_1021 ALIGN_DECL(4); +static u8 bss_984 ALIGN_DECL(4); +static u8 bss_982 ALIGN_DECL(4); +static u8 bss_980 ALIGN_DECL(4); +static u8 bss_979 ALIGN_DECL(4); +static u8 bss_941 ALIGN_DECL(4); +static u8 bss_939 ALIGN_DECL(4); +static u8 bss_937 ALIGN_DECL(4); +static u8 bss_936 ALIGN_DECL(4); static u32 l_msgId; static msg_class* l_msg; static u8 msg_mode; diff --git a/src/d/d_chain.cpp b/src/d/d_chain.cpp index fa3dec3ff..2ae257cf4 100644 --- a/src/d/d_chain.cpp +++ b/src/d/d_chain.cpp @@ -6,6 +6,7 @@ #include "d/d_kankyo.h" #include "d/d_a_obj.h" #include "d/d_s_play.h" +#include "global.h" #include "m_Do/m_Do_mtx.h" #include "JSystem/J3DGraphBase/J3DPacket.h" @@ -25,7 +26,7 @@ public: static Vec dummy0 = { 1.0f, 1.0f, 1.0f }; static Vec dummy1 = { 1.0f, 1.0f, 1.0f }; -static u8 l_chainS3TCTex[] __attribute__((aligned(32))) = { 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00 }; +static u8 l_chainS3TCTex[] ALIGN_DECL(32) = { 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xDE, 0xDB, 0xB5, 0xB6, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0xB5, 0xB6, 0x94, 0x92, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x8C, 0x31, 0x6B, 0x2D, 0x00, 0x55, 0x55, 0x55, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0x94, 0x92, 0x6B, 0x2D, 0x55, 0x55, 0xAA, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00, 0xB5, 0xB6, 0x94, 0x92, 0x55, 0x55, 0x00, 0x00 }; static Vec l_pos[12] = { { -2.0f, 1.522254f, -0.0f }, { -2.0f, 1.522254f, 7.0f }, @@ -59,8 +60,8 @@ static f32 l_texCoord[24] = { #define CONST_U32(v) ((u8)((v) >> 16)), ((u8)((v) >> 8)), ((u8)((v) >> 0)) #define IMAGE_ADDR(addr) CONST_U32((u32)(addr) >> 5) -static u8 l_chainDL[0x7a] __attribute__((aligned(32))) = { 0x98, 0x00, 0x06, 0x01, 0x0A, 0x07, 0x0B, 0x09, 0x08, 0x0B, 0x09, 0x02, 0x08, 0x08, 0x09, 0x98, 0x00, 0x06, 0x0B, 0x07, 0x07, 0x06, 0x0A, 0x04, 0x04, 0x05, 0x09, 0x07, 0x01, 0x06, 0x98, 0x00, 0x06, 0x08, 0x03, 0x0B, 0x02, 0x05, 0x00, 0x0A, 0x01, 0x02, 0x03, 0x09, 0x02, 0x98, 0x00, 0x06, 0x02, 0x0A, 0x08, 0x0B, 0x00, 0x08, 0x06, 0x09, 0x01, 0x08, 0x07, 0x09, 0x98, 0x00, 0x06, 0x06, 0x07, 0x08, 0x06, 0x03, 0x04, 0x05, 0x05, 0x00, 0x07, 0x02, 0x06, 0x98, 0x00, 0x06, 0x07, 0x03, 0x06, 0x02, 0x04, 0x00, 0x03, 0x01, 0x01, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -static u8 l_matDL[0xa8] __attribute__((aligned(32))) = { +static u8 l_chainDL[0x7a] ALIGN_DECL(32) = { 0x98, 0x00, 0x06, 0x01, 0x0A, 0x07, 0x0B, 0x09, 0x08, 0x0B, 0x09, 0x02, 0x08, 0x08, 0x09, 0x98, 0x00, 0x06, 0x0B, 0x07, 0x07, 0x06, 0x0A, 0x04, 0x04, 0x05, 0x09, 0x07, 0x01, 0x06, 0x98, 0x00, 0x06, 0x08, 0x03, 0x0B, 0x02, 0x05, 0x00, 0x0A, 0x01, 0x02, 0x03, 0x09, 0x02, 0x98, 0x00, 0x06, 0x02, 0x0A, 0x08, 0x0B, 0x00, 0x08, 0x06, 0x09, 0x01, 0x08, 0x07, 0x09, 0x98, 0x00, 0x06, 0x06, 0x07, 0x08, 0x06, 0x03, 0x04, 0x05, 0x05, 0x00, 0x07, 0x02, 0x06, 0x98, 0x00, 0x06, 0x07, 0x03, 0x06, 0x02, 0x04, 0x00, 0x03, 0x01, 0x01, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; +static u8 l_matDL[0xa8] ALIGN_DECL(32) = { 0x61, 0x80, 0x00, 0x01, 0x3A, 0x61, 0x84, 0x00, 0x00, 0x00, 0x61, 0x88, 0xE0, 0x7C, 0x1F, 0x61, 0x94, IMAGE_ADDR(&l_chainS3TCTex), 0x61, 0x30, 0x00, 0x00, 0x20, 0x61, 0x31, 0x00, 0x00, 0x20, 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x80, 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00, 0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00, 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x05, 0x43, 0x61, 0x28, 0x3C, 0x00, 0x00, 0x61, 0xC0, 0x08, 0x24, 0xAF, 0x61, 0xC1, 0x08, 0xFF, 0xF0, 0x61, 0x28, 0x3C, 0x00, 0x00, 0x61, 0xC2, 0x08, 0xF0, 0x8F, 0x61, 0xC3, 0x08, 0xFF, 0xC0, 0x61, 0x43, 0x00, 0x00, 0x01, 0x61, 0x40, 0x00, 0x00, 0x17, 0x61, 0x41, 0x00, 0x01, 0x0C, 0x61, 0xF3, 0x64, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x04, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index 9aa788f31..420d42c29 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -14,6 +14,7 @@ #include "JSystem/J2DGraph/J2DOrthoGraph.h" #include "SSystem/SComponent/c_rnd.h" #include "SSystem/SComponent/c_bg_s_shdw_draw.h" +#include "global.h" GXTexObj dDlst_shadowControl_c::mSimpleTexObj; @@ -479,21 +480,21 @@ extern void GFSetVtxAttrFmtv(GXVtxFmt, GXVtxAttrFmtList*); extern void GFSetBlendModeEtc(GXBlendMode, GXBlendFactor, GXBlendFactor, GXLogicOp, u8, u8, u8); extern void GFSetArray(GXAttr, void*, u8); -char l_backRevZMat[0x41] __attribute__((aligned(32))) = {}; -char l_frontZMat[0x3c] __attribute__((aligned(32))) = {}; -char l_frontNoZSubMat[0x2a] __attribute__((aligned(32))) = {}; +char l_backRevZMat[0x41] ALIGN_DECL(32) = {}; +char l_frontZMat[0x3c] ALIGN_DECL(32) = {}; +char l_frontNoZSubMat[0x2a] ALIGN_DECL(32) = {}; Vec l_bonboriPos[0x2a] = {}; -char l_bonboriDL[0xa7] __attribute__((aligned(32))) = {}; +char l_bonboriDL[0xa7] ALIGN_DECL(32) = {}; Vec l_s_beam_checkPos[0x28] = {}; -char l_s_beam_checkDL[0xf8] __attribute__((aligned(32))) = {}; +char l_s_beam_checkDL[0xf8] ALIGN_DECL(32) = {}; Vec l_cubePos[0x08] = {}; -char l_cubeDL[0x4a] __attribute__((aligned(32))) = {}; +char l_cubeDL[0x4a] ALIGN_DECL(32) = {}; Vec l_bonbori2Pos[0x56] = {}; -char l_bonbori2DL[0x2a8] __attribute__((aligned(32))) = {}; +char l_bonbori2DL[0x2a8] ALIGN_DECL(32) = {}; /* 80082838-80082E44 .text draw__22dDlst_alphaModelData_cFPA4_f */ void dDlst_alphaModelData_c::draw(Mtx viewMtx) { @@ -649,7 +650,7 @@ BOOL dDlst_alphaModel_c::draw(Mtx mtx) { if (mNum == 0) return FALSE; - static char l_matDL[0x64] __attribute__((aligned(32))) = {}; + static char l_matDL[0x64] ALIGN_DECL(32) = {}; static GXVtxDescList l_vtxDescList[2] = { }; diff --git a/src/f_pc/f_pc_manager_data.inc b/src/f_pc/f_pc_manager_data.inc index 0168ac5eb..03e1d7795 100644 --- a/src/f_pc/f_pc_manager_data.inc +++ b/src/f_pc/f_pc_manager_data.inc @@ -1,14 +1,14 @@ -#include "dolphin/types.h" +#include "global.h" -const u8 black_tex[] __attribute__((aligned(4))) = { +const u8 black_tex[] ALIGN_DECL(4) = { 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const u8 msg_data[] __attribute__((aligned(32))) = { +const u8 msg_data[] ALIGN_DECL(32) = { #if VERSION == VERSION_JPN 0x4D, 0x45, 0x53, 0x47, 0x62, 0x6D, 0x67, 0x31, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -86,7 +86,7 @@ const u8 msg_data[] __attribute__((aligned(32))) = { #endif }; -const u8 msg_data_ge[] __attribute__((aligned(32))) = { +const u8 msg_data_ge[] ALIGN_DECL(32) = { 0x4D, 0x45, 0x53, 0x47, 0x62, 0x6D, 0x67, 0x31, 0x00, 0x00, 0x02, 0xA0, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x40, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, @@ -131,7 +131,7 @@ const u8 msg_data_ge[] __attribute__((aligned(32))) = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const u8 msg_data_fr[] __attribute__((aligned(32))) = { +const u8 msg_data_fr[] ALIGN_DECL(32)= { 0x4D, 0x45, 0x53, 0x47, 0x62, 0x6D, 0x67, 0x31, 0x00, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x40, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, @@ -172,7 +172,7 @@ const u8 msg_data_fr[] __attribute__((aligned(32))) = { 0x6D, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const u8 msg_data_sp[] __attribute__((aligned(32))) = { +const u8 msg_data_sp[] ALIGN_DECL(32) = { 0x4D, 0x45, 0x53, 0x47, 0x62, 0x6D, 0x67, 0x31, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x40, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, @@ -211,7 +211,7 @@ const u8 msg_data_sp[] __attribute__((aligned(32))) = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const u8 msg_data_it[] __attribute__((aligned(32))) = { +const u8 msg_data_it[] ALIGN_DECL(32) = { 0x4D, 0x45, 0x53, 0x47, 0x62, 0x6D, 0x67, 0x31, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x40, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, @@ -254,7 +254,7 @@ const u8 msg_data_it[] __attribute__((aligned(32))) = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const u8 font_data[] __attribute__((aligned(32))) = { +const u8 font_data[] ALIGN_DECL(32) = { #if VERSION == VERSION_JPN 0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x82, 0x80, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/m_Do/m_Do_DVDError.cpp b/src/m_Do/m_Do_DVDError.cpp index caf7b519d..060e33687 100644 --- a/src/m_Do/m_Do_DVDError.cpp +++ b/src/m_Do/m_Do_DVDError.cpp @@ -6,11 +6,12 @@ #include "m_Do/m_Do_DVDError.h" #include "JSystem/JKernel/JKRThread.h" #include "dolphin/os/OS.h" +#include "global.h" #include "m_Do/m_Do_dvd_thread.h" #include "m_Do/m_Do_ext.h" OSThread DvdErr_thread; -u8 DvdErr_stack[0x1000] __attribute__((aligned(32))); +u8 DvdErr_stack[0x1000] ALIGN_DECL(32); static OSAlarm Alarm; bool mDoDvdErr_initialized; diff --git a/src/m_Do/m_Do_MemCard.cpp b/src/m_Do/m_Do_MemCard.cpp index 505079d15..6fff7689b 100644 --- a/src/m_Do/m_Do_MemCard.cpp +++ b/src/m_Do/m_Do_MemCard.cpp @@ -7,11 +7,12 @@ #include "m_Do/m_Do_Reset.h" #include "JSystem/JKernel/JKRThread.h" #include "dolphin/card.h" +#include "global.h" #include "MSL_C/string.h" -u8 MemCardStack[0x1000] __attribute__((aligned(32))); +u8 MemCardStack[0x1000] ALIGN_DECL(32); OSThread MemCardThread; -u8 MemCardWorkArea0[0xa000] __attribute__((aligned(32))); +u8 MemCardWorkArea0[0xa000] ALIGN_DECL(32); mDoMemCd_Ctrl_c g_mDoMemCd_control; diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index ca4a12459..18b962c4d 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -16,6 +16,7 @@ #include "c/c_dylink.h" #include "d/d_com_inf_game.h" #include "f_ap/f_ap_game.h" +#include "global.h" #include "m_Do/m_Do_MemCard.h" #include "m_Do/m_Do_Reset.h" #include "m_Do/m_Do_audio.h" @@ -351,7 +352,7 @@ bool JKRHeap::dump_sort() { s32 LOAD_COPYDATE(void*) { s32 status; - DVDFileInfo __attribute__((aligned(0x20))) fileInfo; + DVDFileInfo ALIGN_DECL(0x20) fileInfo; u8 buffer[0x20]; status = DVDOpen("/COPYDATE", &fileInfo); @@ -443,7 +444,7 @@ OSThread mainThread; /* 80006464-800065DC .text main */ void main() { OSThread* current_thread = OSGetCurrentThread(); - u8 __attribute__((aligned(0x20))) stack[0xF000]; + u8 ALIGN_DECL(0x20) stack[0xF000]; mDoMain::sPowerOnTime = OSGetTime(); OSReportInit__Fv();