2017-02-04 00:44:06 +00:00
|
|
|
#ifndef GUARD_MAIN_H
|
|
|
|
#define GUARD_MAIN_H
|
|
|
|
|
|
|
|
typedef void (*MainCallback)(void);
|
|
|
|
typedef void (*IntrCallback)(void);
|
|
|
|
typedef void (*IntrFunc)(void);
|
|
|
|
|
|
|
|
struct Main
|
|
|
|
{
|
|
|
|
/*0x000*/ MainCallback callback1;
|
|
|
|
/*0x004*/ MainCallback callback2;
|
|
|
|
|
|
|
|
/*0x008*/ MainCallback savedCallback;
|
|
|
|
|
|
|
|
/*0x00C*/ IntrCallback vblankCallback;
|
|
|
|
/*0x010*/ IntrCallback hblankCallback;
|
|
|
|
/*0x014*/ IntrCallback vcountCallback;
|
|
|
|
/*0x018*/ IntrCallback serialCallback;
|
|
|
|
|
|
|
|
/*0x01C*/ vu16 intrCheck;
|
|
|
|
|
|
|
|
/*0x020*/ u32 vblankCounter1;
|
|
|
|
/*0x024*/ u32 vblankCounter2;
|
|
|
|
|
|
|
|
/*0x028*/ u16 heldKeysRaw; // held keys without L=A remapping
|
|
|
|
/*0x02A*/ u16 newKeysRaw; // newly pressed keys without L=A remapping
|
|
|
|
/*0x02C*/ u16 heldKeys; // held keys with L=A remapping
|
|
|
|
/*0x02E*/ u16 newKeys; // newly pressed keys with L=A remapping
|
|
|
|
/*0x030*/ u16 newAndRepeatedKeys; // newly pressed keys plus key repeat
|
|
|
|
/*0x032*/ u16 keyRepeatCounter; // counts down to 0, triggering key repeat
|
|
|
|
/*0x034*/ bool16 watchedKeysPressed; // whether one of the watched keys was pressed
|
|
|
|
/*0x036*/ u16 watchedKeysMask; // bit mask for watched keys
|
|
|
|
|
|
|
|
/*0x038*/ struct OamData oamBuffer[128];
|
|
|
|
|
|
|
|
/*0x438*/ u8 state;
|
|
|
|
|
|
|
|
/*0x439*/ u8 oamLoadDisabled:1;
|
|
|
|
/*0x439*/ u8 inBattle:1;
|
2021-03-12 21:55:58 +00:00
|
|
|
/*0x439*/ u8 isFrontierBattle:1;
|
2017-02-04 00:44:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern const u8 gGameVersion;
|
|
|
|
extern const u8 gGameLanguage;
|
2019-03-24 22:20:35 +00:00
|
|
|
extern const u8 RomHeaderGameCode[4];
|
|
|
|
extern const u8 RomHeaderSoftwareVersion;
|
2017-02-04 00:44:06 +00:00
|
|
|
|
2017-11-08 04:53:30 +00:00
|
|
|
extern u16 gKeyRepeatStartDelay;
|
2017-11-11 05:05:44 +00:00
|
|
|
extern bool8 gLinkTransferringData;
|
2017-11-09 00:29:37 +00:00
|
|
|
extern struct Main gMain;
|
2017-11-08 04:53:30 +00:00
|
|
|
extern u16 gKeyRepeatContinueDelay;
|
2017-11-09 00:29:37 +00:00
|
|
|
extern bool8 gSoftResetDisabled;
|
2017-11-08 04:53:30 +00:00
|
|
|
extern IntrFunc gIntrTable[];
|
2017-11-11 05:05:44 +00:00
|
|
|
extern u8 gLinkVSyncDisabled;
|
2017-11-08 04:53:30 +00:00
|
|
|
extern u32 IntrMain_Buffer[];
|
2018-11-28 16:14:32 +00:00
|
|
|
extern s8 gPcmDmaCounter;
|
2017-11-08 03:52:10 +00:00
|
|
|
|
2017-02-04 00:44:06 +00:00
|
|
|
void AgbMain(void);
|
|
|
|
void SetMainCallback2(MainCallback callback);
|
|
|
|
void InitKeys(void);
|
|
|
|
void SetVBlankCallback(IntrCallback callback);
|
|
|
|
void SetHBlankCallback(IntrCallback callback);
|
|
|
|
void SetVCountCallback(IntrCallback callback);
|
|
|
|
void SetSerialCallback(IntrCallback callback);
|
|
|
|
void InitFlashTimer(void);
|
2019-03-01 06:49:11 +00:00
|
|
|
void SetTrainerHillVBlankCounter(u32 *var);
|
|
|
|
void ClearTrainerHillVBlankCounter(void);
|
2017-02-04 00:44:06 +00:00
|
|
|
void DoSoftReset(void);
|
|
|
|
void ClearPokemonCrySongs(void);
|
2017-11-08 01:25:24 +00:00
|
|
|
void RestoreSerialTimer3IntrHandlers(void);
|
2018-01-24 03:30:13 +00:00
|
|
|
void StartTimer1(void);
|
|
|
|
void SeedRngAndSetTrainerId(void);
|
2019-03-02 03:32:50 +00:00
|
|
|
u16 GetGeneratedTrainerIdLower(void);
|
2019-04-02 02:30:30 +00:00
|
|
|
void sub_819789C(void);
|
2017-02-04 00:44:06 +00:00
|
|
|
|
|
|
|
#endif // GUARD_MAIN_H
|