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.
This commit is contained in:
aaaaaa123456789
2020-09-13 04:22:50 -03:00
parent 58a2b62bae
commit 7dc95a0103
149 changed files with 6786 additions and 3108 deletions
+2 -2
View File
@@ -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;
+11 -11
View File
@@ -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
};
+2 -1
View File
@@ -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];
+1 -1
View File
@@ -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; \
}
-13
View File
@@ -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);
+1 -1
View File
@@ -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)
+10
View File
@@ -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
-4
View File
@@ -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))
+47 -45
View File
@@ -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 *);
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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);
+6 -6
View File
@@ -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;
+1 -1
View File
@@ -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);