mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-30 15:53:44 -04:00
Gamestate table (#1354)
* gamestate_table.h * move macros * bss * format
This commit is contained in:
@@ -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 : \
|
||||
|
||||
Reference in New Issue
Block a user