diff options
author | aaaaaa123456789 <aaaaaa123456789@acidch.at> | 2020-09-13 04:22:50 -0300 |
---|---|---|
committer | aaaaaa123456789 <aaaaaa123456789@acidch.at> | 2020-09-13 06:30:55 -0300 |
commit | 7dc95a0103af08c95c9093b6efa6c77af77a2538 (patch) | |
tree | 663537916626ab264bbdef4ea3606415457c36a3 /include | |
parent | 58a2b62bae1406d2c768698ed13efcd6a5ffbeec (diff) |
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
Diffstat (limited to 'include')
-rw-r--r-- | include/AgbRfu_LinkManager.h | 4 | ||||
-rw-r--r-- | include/battle.h | 22 | ||||
-rw-r--r-- | include/battle_main.h | 3 | ||||
-rw-r--r-- | include/battle_message.h | 2 | ||||
-rw-r--r-- | include/battle_util.h | 13 | ||||
-rw-r--r-- | include/constants/battle.h | 2 | ||||
-rw-r--r-- | include/constants/battle_pyramid.h | 10 | ||||
-rw-r--r-- | include/constants/rgb.h | 4 | ||||
-rw-r--r-- | include/gba/m4a_internal.h | 92 | ||||
-rw-r--r-- | include/global.h | 2 | ||||
-rw-r--r-- | include/list_menu.h | 4 | ||||
-rw-r--r-- | include/pokemon.h | 12 | ||||
-rw-r--r-- | include/pokenav.h | 2 |
13 files changed, 84 insertions, 88 deletions
diff --git a/include/AgbRfu_LinkManager.h b/include/AgbRfu_LinkManager.h index 4e1a879c2..d4ef13183 100644 --- a/include/AgbRfu_LinkManager.h +++ b/include/AgbRfu_LinkManager.h @@ -176,8 +176,8 @@ typedef struct linkManagerTag /* 0x024 */ VBL_TIMER nameAcceptTimer; /* 0x030 */ VBL_TIMER linkRecoveryTimer; /* 0x03c */ INIT_PARAM *init_param; - /* 0x040 */ void (*LMAN_callback)(u8 msg, u8 paramCount); - /* 0x044 */ void (*MSC_callback)(u16 REQ_commandID); + /* 0x040 */ void (*LMAN_callback)(u8, u8); + /* 0x044 */ void (*MSC_callback)(u16); } LINK_MANAGER; extern struct linkManagerTag lman; diff --git a/include/battle.h b/include/battle.h index 5a04c1eec..6dddfd197 100644 --- a/include/battle.h +++ b/include/battle.h @@ -124,22 +124,22 @@ struct ProtectStruct u32 flinchImmobility:1; u32 notFirstStrike:1; u32 palaceUnableToUseMove:1; - s32 physicalDmg; - s32 specialDmg; + u32 physicalDmg; + u32 specialDmg; u8 physicalBattlerId; u8 specialBattlerId; }; struct SpecialStatus { - u32 statLowered:1; - u32 lightningRodRedirected:1; - u32 restoredBattlerSprite: 1; - u32 intimidatedMon:1; - u32 traced:1; - u32 ppNotAffectedByPressure:1; - u32 flag40:1; - u32 focusBanded:1; + u8 statLowered:1; + u8 lightningRodRedirected:1; + u8 restoredBattlerSprite: 1; + u8 intimidatedMon:1; + u8 traced:1; + u8 ppNotAffectedByPressure:1; + u8 flag40:1; + u8 focusBanded:1; s32 dmg; s32 physicalDmg; s32 specialDmg; @@ -254,7 +254,7 @@ struct BattleResults u16 playerMon2Species; // 0x26 u16 caughtMonSpecies; // 0x28 u8 caughtMonNick[POKEMON_NAME_LENGTH + 1]; // 0x2A - u8 filler35; // 0x35 + u8 filler35[1]; // 0x35 u8 catchAttempts[11]; // 0x36 }; diff --git a/include/battle_main.h b/include/battle_main.h index 0176f7f24..890e47f39 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -73,6 +73,8 @@ void nullsub_20(void); void BeginBattleIntro(void); void SwitchInClearSetData(void); void FaintClearSetData(void); +void sub_803B3AC(void); // unused +void sub_803B598(void); // unused void BattleTurnPassed(void); u8 IsRunningFromBattleImpossible(void); void SwitchPartyOrder(u8 battlerId); @@ -81,7 +83,6 @@ u8 GetWhoStrikesFirst(u8 battlerId1, u8 battlerId2, bool8 ignoreChosenMoves); void RunBattleScriptCommands_PopCallbacksStack(void); void RunBattleScriptCommands(void); bool8 TryRunFromBattle(u8 battlerId); -void SpecialStatusesClear(void); extern struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE]; diff --git a/include/battle_message.h b/include/battle_message.h index af090a06c..011a1cb0c 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -145,7 +145,7 @@ { \ textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \ textVar[1] = B_BUFF_STRING; \ - textVar[2] = (stringId & 0xFF); \ + textVar[2] = stringId; \ textVar[3] = (stringId & 0xFF00) >> 8; \ textVar[4] = B_BUFF_EOS; \ } diff --git a/include/battle_util.h b/include/battle_util.h index 81443f463..157ba8eb6 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -41,19 +41,6 @@ #define WEATHER_HAS_EFFECT ((!ABILITY_ON_FIELD(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD(ABILITY_AIR_LOCK))) #define WEATHER_HAS_EFFECT2 ((!ABILITY_ON_FIELD2(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD2(ABILITY_AIR_LOCK))) -void HandleAction_UseMove(void); -void HandleAction_Switch(void); -void HandleAction_UseItem(void); -void HandleAction_Run(void); -void HandleAction_WatchesCarefully(void); -void HandleAction_SafariZoneBallThrow(void); -void HandleAction_ThrowPokeblock(void); -void HandleAction_GoNear(void); -void HandleAction_SafariZoneRun(void); -void HandleAction_WallyBallThrow(void); -void HandleAction_TryFinish(void); -void HandleAction_NothingIsFainted(void); -void HandleAction_ActionFinished(void); u8 GetBattlerForBattleScript(u8 caseId); void PressurePPLose(u8 target, u8 attacker, u16 move); void PressurePPLoseOnUsingPerishSong(u8 attacker); diff --git a/include/constants/battle.h b/include/constants/battle.h index fa8f422c4..8b860e384 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -186,7 +186,7 @@ #define HITMARKER_x4000000 (1 << 26) #define HITMARKER_CHARGING (1 << 27) #define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28) -#define HITMARKER_FAINTED2(battler) ((1 << 28) << battler) +#define HITMARKER_FAINTED2(battler) (1 << (28 + battler)) // Per-side statuses that affect an entire party #define SIDE_STATUS_REFLECT (1 << 0) diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h index 378197a4d..004df7155 100644 --- a/include/constants/battle_pyramid.h +++ b/include/constants/battle_pyramid.h @@ -7,6 +7,16 @@ #define FLOOR_WALKABLE_METATILE 0x28D #define FLOOR_EXIT_METATILE 0x28E +#define HINT_EXIT_DIRECTION 0 +#define HINT_REMAINING_ITEMS 1 +#define HINT_REMAINING_TRAINERS 2 +#define HINT_EXIT_SHORT_REMAINING_TRAINERS 3 +#define HINT_EXIT_SHORT_REMAINING_ITEMS 4 +#define HINT_EXIT_MEDIUM_REMAINING_TRAINERS 5 +#define HINT_EXIT_MEDIUM_REMAINING_ITEMS 6 +#define HINT_EXIT_FAR_REMAINING_TRAINERS 7 +#define HINT_EXIT_FAR_REMAINING_ITEMS 8 + #define OBJ_TRAINERS 0 #define OBJ_ITEMS 1 diff --git a/include/constants/rgb.h b/include/constants/rgb.h index 1896250d2..80d951f4b 100644 --- a/include/constants/rgb.h +++ b/include/constants/rgb.h @@ -1,10 +1,6 @@ #ifndef GUARD_RGB_H #define GUARD_RGB_H -#define GET_R(color) ((color) & 0x1F) -#define GET_G(color) (((color) >> 5) & 0x1F) -#define GET_B(color) (((color) >> 10) & 0x1F) - #define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) #define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) #define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F)) diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h index bdff1b865..e2836c6f6 100644 --- a/include/gba/m4a_internal.h +++ b/include/gba/m4a_internal.h @@ -140,13 +140,55 @@ struct SoundChannel struct WaveData *wav; u32 cp; struct MusicPlayerTrack *track; - void *pp; - void *np; - void *d4; + u32 pp; + u32 np; + u32 d4; u16 xpi; u16 xpc; }; +#define MAX_DIRECTSOUND_CHANNELS 12 + +#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer + +struct SoundInfo +{ + // This field is normally equal to ID_NUMBER but it is set to other + // values during sensitive operations for locking purposes. + // This field should be volatile but isn't. This could potentially cause + // race conditions. + u32 ident; + + vu8 pcmDmaCounter; + + // Direct Sound + u8 reverb; + u8 maxChans; + u8 masterVolume; + u8 freq; + + u8 mode; + u8 c15; + u8 pcmDmaPeriod; // number of V-blanks per PCM DMA + u8 maxLines; + u8 gap[3]; + s32 pcmSamplesPerVBlank; + s32 pcmFreq; + s32 divFreq; + struct CgbChannel *cgbChans; + u32 func; + u32 intp; + void (*CgbSound)(void); + void (*CgbOscOff)(u8); + u32 (*MidiKeyToCgbFreq)(u8, u8, u8); + u32 MPlayJumpTable; + u32 plynote; + u32 ExtVolPit; + u8 gap2[16]; + struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS]; + s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2]; +}; + struct SongHeader { u8 trackCount; @@ -270,7 +312,7 @@ struct MusicPlayerInfo struct MusicPlayerTrack *tracks; struct ToneData *tone; u32 ident; - void (*func)(); + u32 func; u32 intp; }; @@ -292,47 +334,7 @@ struct Song extern const struct MusicPlayer gMPlayTable[]; extern const struct Song gSongTable[]; -#define MAX_DIRECTSOUND_CHANNELS 12 - -#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer - -struct SoundInfo -{ - // This field is normally equal to ID_NUMBER but it is set to other - // values during sensitive operations for locking purposes. - // This field should be volatile but isn't. This could potentially cause - // race conditions. - u32 ident; - - vu8 pcmDmaCounter; - - // Direct Sound - u8 reverb; - u8 maxChans; - u8 masterVolume; - u8 freq; - u8 mode; - u8 c15; - u8 pcmDmaPeriod; // number of V-blanks per PCM DMA - u8 maxLines; - u8 gap[3]; - s32 pcmSamplesPerVBlank; - s32 pcmFreq; - s32 divFreq; - struct CgbChannel *cgbChans; - void (*func)(); - u32 intp; - void (*CgbSound)(); - void (*CgbOscOff)(u8); - u32 (*MidiKeyToCgbFreq)(u8, u8, u8); - void (**MPlayJumpTable)(); - void (*plynote)(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *); - void (*ExtVolPit)(struct MusicPlayerInfo *, struct MusicPlayerTrack *); - u32 gap2[4]; - struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS]; - s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2]; -}; extern u8 gMPlayMemAccArea[]; @@ -446,7 +448,7 @@ void ply_tune(struct MusicPlayerInfo *, struct MusicPlayerTrack *); void ply_port(struct MusicPlayerInfo *, struct MusicPlayerTrack *); void ply_xcmd(struct MusicPlayerInfo *, struct MusicPlayerTrack *); void ply_endtie(struct MusicPlayerInfo *, struct MusicPlayerTrack *); -void ply_note(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_note(struct MusicPlayerInfo *, struct MusicPlayerTrack *); // extended sound command handler functions void ply_xxx(struct MusicPlayerInfo *, struct MusicPlayerTrack *); diff --git a/include/global.h b/include/global.h index 8c5167041..08988eac7 100644 --- a/include/global.h +++ b/include/global.h @@ -99,7 +99,7 @@ #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) // Macros for checking the joypad -#define TEST_BUTTON(field, button) ((field) & (button)) +#define TEST_BUTTON(field, button) ({(field) & (button);}) #define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button) #define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button) #define JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button) diff --git a/include/list_menu.h b/include/list_menu.h index 4697ba5aa..0a54a069a 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -24,7 +24,7 @@ struct ListMenu; struct ListMenuItem { const u8 *name; - u32 id; + s32 id; }; struct ListMenuTemplate @@ -98,7 +98,7 @@ struct CursorStruct extern struct ScrollArrowsTemplate gTempScrollArrowTemplate; extern struct ListMenuTemplate gMultiuseListMenuTemplate; -u32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); +s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow); u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow); s32 ListMenu_ProcessInput(u8 listTaskId); diff --git a/include/pokemon.h b/include/pokemon.h index 81c17f545..d75ec94f3 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -123,12 +123,12 @@ struct Pokemon struct Unknown_806F160_Struct { - u32 field_0_0:4; - u32 field_0_1:4; - u32 field_1:8; - u16 magic:8; - u32 size:4; - u16 field_3_1:4; + u8 field_0_0:4; + u8 field_0_1:4; + u8 field_1; + u8 magic; + u8 field_3_0:4; + u8 field_3_1:4; void *bytes; u8 **byteArrays; struct SpriteTemplate *templates; diff --git a/include/pokenav.h b/include/pokenav.h index ed4e5a906..ac916f3ba 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -313,7 +313,7 @@ bool32 WaitForHelpBar(void); void sub_81C78A0(void); bool32 MainMenuLoopedTaskIsBusy(void); void sub_81C7FDC(void); -void sub_81C79BC(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *palette); +void sub_81C79BC(const u16 *a0, const u16 *a1, u32 a2, u32 a3, u32 a4, u16 *a5); void sub_81C7B40(void); struct Sprite *PauseSpinningPokenavSprite(void); void ResumeSpinningPokenavSprite(void); |