Skip to content

Commit

Permalink
Merge pull request #355 from red031000/master
Browse files Browse the repository at this point in the history
remove assignment and bitfield alignment
  • Loading branch information
adrienntindall authored Nov 12, 2024
2 parents f22f237 + 30cb64d commit edbd0f8
Show file tree
Hide file tree
Showing 283 changed files with 26,036 additions and 26,037 deletions.
7 changes: 3 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ LineEnding: LF
ColumnLimit: 0

AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments:
Enabled: true
AlignConsecutiveBitFields:
Enabled: true
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: LeftWithLastLine
AlignTrailingComments: true
AlignArrayOfStructures: Left

Expand Down
6 changes: 3 additions & 3 deletions include/bag_types_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ typedef enum RegisterItemResult {

// Enum for argument "code" to GetItemUseErrorMessage
typedef enum ItemUseError {
ITEMUSEERROR_OKAY = 0, // no error
ITEMUSEERROR_OKAY = 0, // no error
ITEMUSEERROR_NODISMOUNT = 1, // can't get off bike
ITEMUSEERROR_NOFOLLOWER = 2, // have a companion
ITEMUSEERROR_NOTNOW = 3, // you're a member of team rocket
ITEMUSEERROR_NOTNOW = 3, // you're a member of team rocket

ITEMUSEERROR_OAKSWORDS = -1u,
} ItemUseError;
Expand Down Expand Up @@ -58,7 +58,7 @@ typedef struct BagViewPocket {
typedef struct ItemCheckUseData {
u32 mapId;
int playerState;
u16 haveFollower : 1;
u16 haveFollower : 1;
u16 haveRocketCostume : 1;
u16 facingTile;
u16 standingTile;
Expand Down
196 changes: 98 additions & 98 deletions include/battle/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,34 @@ typedef struct FieldConditionData {
} FieldConditionData;

typedef struct SideConditionData {
u32 reflectBattler : 2;
u32 reflectTurns : 3;
u32 lightScreenBattler : 2;
u32 lightScreenTurns : 3;
u32 mistBattler : 2;
u32 mistTurns : 3;
u32 safeguardBattler : 2;
u32 safeguardTurns : 3;
u32 followMeFlag : 1;
u32 battlerIdFollowMe : 2;
u32 reflectBattler : 2;
u32 reflectTurns : 3;
u32 lightScreenBattler : 2;
u32 lightScreenTurns : 3;
u32 mistBattler : 2;
u32 mistTurns : 3;
u32 safeguardBattler : 2;
u32 safeguardTurns : 3;
u32 followMeFlag : 1;
u32 battlerIdFollowMe : 2;
u32 battlerBitKnockedOffItem : 6;
u32 unk0_1D : 3;
u32 spikesLayers : 2;
u32 toxicSpikesLayers : 2;
u32 unk4_4 : 28;
u32 unk0_1D : 3;
u32 spikesLayers : 2;
u32 toxicSpikesLayers : 2;
u32 unk4_4 : 28;
} SideConditionData;

typedef struct TurnData {
u32 struggleFlag : 1;
u32 unk0_1 : 1;
u32 protectFlag : 1;
u32 struggleFlag : 1;
u32 unk0_1 : 1;
u32 protectFlag : 1;
u32 helpingHandFlag : 1;
u32 magicCoatFlag : 1;
u32 snatchFlag : 1;
u32 roostFlag : 1;
u32 runFlag : 2; // 1 - Fled using item, 2 - Fled using ability
u32 endureFlag : 1;
u32 unk0_A : 22;
u32 magicCoatFlag : 1;
u32 snatchFlag : 1;
u32 roostFlag : 1;
u32 runFlag : 2; // 1 - Fled using item, 2 - Fled using ability
u32 endureFlag : 1;
u32 unk0_A : 22;
int physicalDamage[4];
int battlerIdPhysicalDamage;
int battlerBitPhysicalDamage;
Expand All @@ -96,14 +96,14 @@ typedef struct TurnData {
} TurnData;

typedef struct SelfTurnData {
u32 ignorePressure : 1;
u32 ignorePressure : 1;
u32 lightningRodFlag : 1;
u32 stormDrainFlag : 1;
u32 moldBreakerFlag : 1;
u32 trickRoomFlag : 1;
u32 endureItemFlag : 1;
u32 rolloutCount : 3;
u32 unk0_9 : 23;
u32 stormDrainFlag : 1;
u32 moldBreakerFlag : 1;
u32 trickRoomFlag : 1;
u32 endureItemFlag : 1;
u32 rolloutCount : 3;
u32 unk0_9 : 23;
int physicalDamage;
int battlerIdPhysicalAttacker;
int specialDamage;
Expand Down Expand Up @@ -145,49 +145,49 @@ typedef struct TrainerAIData {
} TrainerAIData;

typedef struct MoveFailFlags {
u32 paralysis : 1;
u32 noEffect : 1;
u32 imprison : 1;
u32 paralysis : 1;
u32 noEffect : 1;
u32 imprison : 1;
u32 infatuation : 1;
u32 disabled : 1;
u32 unk0_5 : 1;
u32 flinch : 1;
u32 confusion : 1;
u32 gravity : 1;
u32 healBlock : 1;
u32 unused : 21;
u32 disabled : 1;
u32 unk0_5 : 1;
u32 flinch : 1;
u32 confusion : 1;
u32 gravity : 1;
u32 healBlock : 1;
u32 unused : 21;
} MoveFailFlags;

typedef struct UnkBattlemonSub {
u32 disabledTurns : 3;
u32 encoredTurns : 3;
u32 isCharged : 2;
u32 tauntTurns : 3;
u32 disabledTurns : 3;
u32 encoredTurns : 3;
u32 isCharged : 2;
u32 tauntTurns : 3;
u32 protectSuccessTurns : 2;
u32 perishSongTurns : 2;
u32 rolloutCount : 3;
u32 furyCutterCount : 3;
u32 stockpileCount : 3;
u32 stockpileDefCount : 3;
u32 perishSongTurns : 2;
u32 rolloutCount : 3;
u32 furyCutterCount : 3;
u32 stockpileCount : 3;
u32 stockpileDefCount : 3;
u32 stockpileSpDefCount : 3;
u32 truantFlag : 1;
u32 flashFire : 1;
u32 battlerIdLockOn : 2;
u32 mimicedMoveIndex : 4;
u32 battlerIdBinding : 2;
u32 battlerIdMeanLook : 2;
u32 lastResortCount : 3;
u32 magnetRiseTurns : 3;
u32 healBlockTurns : 3;
u32 embargoFlag : 3;
u32 knockOffFlag : 1; // unclear whether true mean knocked off or not knocked
// off based on current information on its usage
u32 metronomeTurns : 4; // refers to the item, not the move
u32 micleBerryFlag : 1;
u32 truantFlag : 1;
u32 flashFire : 1;
u32 battlerIdLockOn : 2;
u32 mimicedMoveIndex : 4;
u32 battlerIdBinding : 2;
u32 battlerIdMeanLook : 2;
u32 lastResortCount : 3;
u32 magnetRiseTurns : 3;
u32 healBlockTurns : 3;
u32 embargoFlag : 3;
u32 knockOffFlag : 1; // unclear whether true mean knocked off or not knocked
// off based on current information on its usage
u32 metronomeTurns : 4; // refers to the item, not the move
u32 micleBerryFlag : 1;
u32 custapBerryFlag : 1;
u32 quickClawFlag : 1;
u32 meFirstFlag : 1;
u32 unk4_2F : 1; // unused
u32 quickClawFlag : 1;
u32 meFirstFlag : 1;
u32 unk4_2F : 1; // unused
int rechargeCount;
int fakeOutCount;
int slowStartTurns;
Expand All @@ -212,34 +212,34 @@ typedef struct BattleMon {
u16 spAtk;
u16 spDef;
u16 moves[MAX_MON_MOVES];
u32 hpIV : 5;
u32 atkIV : 5;
u32 defIV : 5;
u32 speedIV : 5;
u32 spAtkIV : 5;
u32 spDefIV : 5;
u32 isEgg : 1;
u32 hpIV : 5;
u32 atkIV : 5;
u32 defIV : 5;
u32 speedIV : 5;
u32 spAtkIV : 5;
u32 spDefIV : 5;
u32 isEgg : 1;
u32 hasNickname : 1;
s8 statChanges[NUM_BATTLE_STATS];
int weight;
u8 type1;
u8 type2;
u8 form : 5;
u8 shiny : 1;
u8 form : 5;
u8 shiny : 1;
u8 unk26_6 : 2;
u8 ability;
u32 sendOutFlag : 1;
u32 intimidateFlag : 1;
u32 traceFlag : 1;
u32 downloadFlag : 1;
u32 sendOutFlag : 1;
u32 intimidateFlag : 1;
u32 traceFlag : 1;
u32 downloadFlag : 1;
u32 anticipationFlag : 1;
u32 forewarnFlag : 1;
u32 slowStartFlag : 1;
u32 slowStartEnded : 1;
u32 friskFlag : 1;
u32 moldBreakerFlag : 1;
u32 pressureFlag : 1;
u32 unk28_B : 21;
u32 forewarnFlag : 1;
u32 slowStartFlag : 1;
u32 slowStartEnded : 1;
u32 friskFlag : 1;
u32 moldBreakerFlag : 1;
u32 pressureFlag : 1;
u32 unk28_B : 21;
u8 movePPCur[MAX_MON_MOVES];
u8 movePP[MAX_MON_MOVES];
u8 level;
Expand All @@ -257,7 +257,7 @@ typedef struct BattleMon {
u16 unk76;
u8 unk78;
u8 msgFlag;
u8 gender : 4;
u8 gender : 4;
u8 metGender : 4;
u8 ball;
u32 moveEffectFlags;
Expand Down Expand Up @@ -433,7 +433,7 @@ typedef struct BattleContext {
u8 unk_314C[4];
int battlersOnField;
u32 battleContinueFlag : 1;
u32 unused : 31;
u32 unused : 31;
} BattleContext;

typedef struct BattleSystem BattleSystem;
Expand Down Expand Up @@ -583,10 +583,10 @@ struct BattleSystem {
u8 unk23FC;
u8 unk23FD;
u8 unk23FE;
u8 unk240F_0 : 1;
u8 unk240F_1 : 1;
u8 unk240E_F : 1;
u8 criticalHpMusic : 2;
u8 unk240F_0 : 1;
u8 unk240F_1 : 1;
u8 unk240E_F : 1;
u8 criticalHpMusic : 2;
u8 criticalHpMusicDelay : 3;
Terrain terrain;
int unk2404;
Expand Down Expand Up @@ -617,10 +617,10 @@ struct BattleSystem {
u16 unk245C[4];
int unk2464[4];
u32 isRecordingPaused : 1;
u32 unk2474_1 : 1;
u32 unk2474_2 : 1;
u32 unk2474_3 : 1;
u32 unk2474_4 : 28;
u32 unk2474_1 : 1;
u32 unk2474_2 : 1;
u32 unk2474_3 : 1;
u32 unk2474_4 : 28;
u32 unk2478;
SysTask *unk247C;
u8 chatotVoiceParam[4];
Expand Down Expand Up @@ -657,8 +657,8 @@ typedef struct {
// double battle
typedef struct TargetPokemon {
u8 selectedMon;
u8 gender : 2;
u8 hide : 1;
u8 gender : 2;
u8 hide : 1;
u8 unused1_3 : 5;
u8 status;
u8 unused3;
Expand Down
44 changes: 22 additions & 22 deletions include/bg_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ typedef struct Window {
u8 width;
u8 height;
u8 paletteNum;
u16 baseTile : 15;
u16 baseTile : 15;
u16 colorMode : 1;
void *pixelBuffer;
} Window;

enum GFScreen {
SCREEN_MAIN = 0,
SCREEN_SUB = 1,
SCREEN_SUB = 1,
};

enum GFBppMode {
Expand All @@ -100,16 +100,16 @@ enum GFPalLoadLocation {
};

enum GFPalSlotOffset {
GF_PAL_SLOT_0_OFFSET = 0x00,
GF_PAL_SLOT_1_OFFSET = 0x20,
GF_PAL_SLOT_2_OFFSET = 0x40,
GF_PAL_SLOT_3_OFFSET = 0x60,
GF_PAL_SLOT_4_OFFSET = 0x80,
GF_PAL_SLOT_5_OFFSET = 0xA0,
GF_PAL_SLOT_6_OFFSET = 0xC0,
GF_PAL_SLOT_7_OFFSET = 0xE0,
GF_PAL_SLOT_8_OFFSET = 0x100,
GF_PAL_SLOT_9_OFFSET = 0x120,
GF_PAL_SLOT_0_OFFSET = 0x00,
GF_PAL_SLOT_1_OFFSET = 0x20,
GF_PAL_SLOT_2_OFFSET = 0x40,
GF_PAL_SLOT_3_OFFSET = 0x60,
GF_PAL_SLOT_4_OFFSET = 0x80,
GF_PAL_SLOT_5_OFFSET = 0xA0,
GF_PAL_SLOT_6_OFFSET = 0xC0,
GF_PAL_SLOT_7_OFFSET = 0xE0,
GF_PAL_SLOT_8_OFFSET = 0x100,
GF_PAL_SLOT_9_OFFSET = 0x120,
GF_PAL_SLOT_10_OFFSET = 0x140,
GF_PAL_SLOT_11_OFFSET = 0x160,
GF_PAL_SLOT_12_OFFSET = 0x180,
Expand Down Expand Up @@ -142,17 +142,17 @@ enum GFBgScreenSize {
};

enum GFBgBufferSize {
GF_BG_BUF_SIZE_128x128_4BPP = 128 * 128 / 32,
GF_BG_BUF_SIZE_256x256_4BPP = 256 * 256 / 32,
GF_BG_BUF_SIZE_256x512_4BPP = 256 * 512 / 32,
GF_BG_BUF_SIZE_512x256_4BPP = 512 * 256 / 32,
GF_BG_BUF_SIZE_512x512_4BPP = 512 * 512 / 32,
GF_BG_BUF_SIZE_128x128_4BPP = 128 * 128 / 32,
GF_BG_BUF_SIZE_256x256_4BPP = 256 * 256 / 32,
GF_BG_BUF_SIZE_256x512_4BPP = 256 * 512 / 32,
GF_BG_BUF_SIZE_512x256_4BPP = 512 * 256 / 32,
GF_BG_BUF_SIZE_512x512_4BPP = 512 * 512 / 32,
GF_BG_BUF_SIZE_1024x1024_4BPP = 1024 * 1024 / 32,
GF_BG_BUF_SIZE_128x128_8BPP = 128 * 128 / 64,
GF_BG_BUF_SIZE_256x256_8BPP = 256 * 256 / 64,
GF_BG_BUF_SIZE_256x512_8BPP = 256 * 512 / 64,
GF_BG_BUF_SIZE_512x256_8BPP = 512 * 256 / 64,
GF_BG_BUF_SIZE_512x512_8BPP = 512 * 512 / 64,
GF_BG_BUF_SIZE_128x128_8BPP = 128 * 128 / 64,
GF_BG_BUF_SIZE_256x256_8BPP = 256 * 256 / 64,
GF_BG_BUF_SIZE_256x512_8BPP = 256 * 512 / 64,
GF_BG_BUF_SIZE_512x256_8BPP = 512 * 256 / 64,
GF_BG_BUF_SIZE_512x512_8BPP = 512 * 512 / 64,
GF_BG_BUF_SIZE_1024x1024_8BPP = 1024 * 1024 / 64,
};

Expand Down
Loading

0 comments on commit edbd0f8

Please sign in to comment.