Gamestate table (#1354)

* gamestate_table.h

* move macros

* bss

* format
This commit is contained in:
Anghelo Carvajal
2023-08-12 11:44:35 -04:00
committed by GitHub
parent 138dd55662
commit 656fd08ee8
8 changed files with 81 additions and 55 deletions
-10
View File
@@ -53,21 +53,11 @@
// To be used with `Magic_Add`, but ensures enough magic is added to fill the magic bar to capacity
#define MAGIC_FILL_TO_CAPACITY (((void)0, gSaveContext.magicFillTarget) + (gSaveContext.save.saveInfo.playerData.isDoubleMagicAcquired + 1) * MAGIC_NORMAL_METER)
#define CONTROLLER1(gameState) (&(gameState)->input[0])
#define CONTROLLER2(gameState) (&(gameState)->input[1])
#define CONTROLLER3(gameState) (&(gameState)->input[2])
#define CONTROLLER4(gameState) (&(gameState)->input[3])
#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0)
#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0)
#define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask))
#define ALIGN8(val) (((val) + 7) & ~7)
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
#define ALIGN64(val) (((val) + 0x3F) & ~0x3F)
#define ALIGN256(val) (((val) + 0xFF) & ~0xFF)
#define BIT_FLAG_TO_SHIFT(flag) \
((flag & 0x80) ? 7 : \
(flag & 0x40) ? 6 : \