Consistent code formatting: no redundant as and spaces after commas

This commit is contained in:
Remy Oukaour 2017-12-10 00:06:20 -05:00
parent 32ea595c47
commit ab7025a144
14 changed files with 61 additions and 61 deletions

View File

@ -744,7 +744,7 @@ LoadNote: ; e83d1
sub [hl] sub [hl]
ld e, a ld e, a
ld a, d ld a, d
sbc a, 0 sbc 0
ld d, a ld d, a
ld hl, Channel1PitchWheelTarget + 1 - Channel1 ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc add hl, bc
@ -766,7 +766,7 @@ LoadNote: ; e83d1
sub e sub e
ld e, a ld e, a
ld a, d ld a, d
sbc a, 0 sbc 0
ld d, a ld d, a
; ???? ; ????
ld hl, Channel1PitchWheelTarget + 1 - Channel1 ld hl, Channel1PitchWheelTarget + 1 - Channel1
@ -793,7 +793,7 @@ LoadNote: ; e83d1
sub [hl] sub [hl]
ld e, a ld e, a
ld a, d ld a, d
sbc a, 0 sbc 0
ld d, a ld d, a
ld hl, Channel1PitchWheelTarget + 1 - Channel1 ld hl, Channel1PitchWheelTarget + 1 - Channel1
add hl, bc add hl, bc
@ -1021,7 +1021,7 @@ ApplyPitchWheel: ; e84f9
sub e sub e
ld e, a ld e, a
ld a, d ld a, d
sbc a, 0 sbc 0
ld d, a ld d, a
; [Channel*Field0x25] *= 2 ; [Channel*Field0x25] *= 2
; if rollover: Frequency -= 1 ; if rollover: Frequency -= 1
@ -1031,10 +1031,10 @@ ApplyPitchWheel: ; e84f9
add a add a
ld [hl], a ld [hl], a
ld a, e ld a, e
sbc a, 0 sbc 0
ld e, a ld e, a
ld a, d ld a, d
sbc a, 0 sbc 0
ld d, a ld d, a
; Compare the dw at [Channel*PitchWheelTarget] to de. ; Compare the dw at [Channel*PitchWheelTarget] to de.
; If frequency is lower, we're finished. ; If frequency is lower, we're finished.
@ -1378,7 +1378,7 @@ ParseMusicCommand: ; e870f
; reload command ; reload command
ld a, [CurMusicByte] ld a, [CurMusicByte]
; get command # ; get command #
sub a, $d0 ; first command sub $d0 ; first command
ld e, a ld e, a
ld d, 0 ld d, 0
; seek command pointer ; seek command pointer

View File

@ -6267,13 +6267,13 @@ LoadEnemyMon: ; 3e8eb
; 25% chance of getting an item ; 25% chance of getting an item
call BattleRandom call BattleRandom
cp a, 1 + (75 percent) cp 1 + (75 percent)
ld a, NO_ITEM ld a, NO_ITEM
jr c, .UpdateItem jr c, .UpdateItem
; From there, an 8% chance for Item2 ; From there, an 8% chance for Item2
call BattleRandom call BattleRandom
cp a, 8 percent ; 8% of 25% = 2% Item2 cp 8 percent ; 8% of 25% = 2% Item2
ld a, [BaseItems] ld a, [BaseItems]
jr nc, .UpdateItem jr nc, .UpdateItem
ld a, [BaseItems+1] ld a, [BaseItems+1]
@ -6320,7 +6320,7 @@ LoadEnemyMon: ; 3e8eb
; Roaming monsters (Entei, Raikou) work differently ; Roaming monsters (Entei, Raikou) work differently
; They have their own structs, which are shorter than normal ; They have their own structs, which are shorter than normal
ld a, [BattleType] ld a, [BattleType]
cp a, BATTLETYPE_ROAMING cp BATTLETYPE_ROAMING
jr nz, .NotRoaming jr nz, .NotRoaming
; Grab HP ; Grab HP
@ -6361,7 +6361,7 @@ LoadEnemyMon: ; 3e8eb
; Forced shiny battle type ; Forced shiny battle type
; Used by Red Gyarados at Lake of Rage ; Used by Red Gyarados at Lake of Rage
cp a, BATTLETYPE_SHINY cp BATTLETYPE_SHINY
jr nz, .GenerateDVs jr nz, .GenerateDVs
ld b, ATKDEFDV_SHINY ; $ea ld b, ATKDEFDV_SHINY ; $ea
@ -6391,7 +6391,7 @@ LoadEnemyMon: ; 3e8eb
; Unown ; Unown
ld a, [TempEnemyMonSpecies] ld a, [TempEnemyMonSpecies]
cp a, UNOWN cp UNOWN
jr nz, .Magikarp jr nz, .Magikarp
; Get letter based on DVs ; Get letter based on DVs
@ -6406,7 +6406,7 @@ LoadEnemyMon: ; 3e8eb
; Skimming this part recommended ; Skimming this part recommended
ld a, [TempEnemyMonSpecies] ld a, [TempEnemyMonSpecies]
cp a, MAGIKARP cp MAGIKARP
jr nz, .Happiness jr nz, .Happiness
; Get Magikarp's length ; Get Magikarp's length
@ -6416,25 +6416,25 @@ LoadEnemyMon: ; 3e8eb
; We're clear if the length is < 1536 ; We're clear if the length is < 1536
ld a, [wMagikarpLength] ld a, [wMagikarpLength]
cp a, $06 ; $600 = 1536 cp $06 ; $600 = 1536
jr nz, .CheckMagikarpArea jr nz, .CheckMagikarpArea
; 5% chance of skipping size checks ; 5% chance of skipping size checks
call Random call Random
cp a, $0c ; / $100 cp $0c ; / $100
jr c, .CheckMagikarpArea jr c, .CheckMagikarpArea
; Try again if > 1614 ; Try again if > 1614
ld a, [wMagikarpLength + 1] ld a, [wMagikarpLength + 1]
cp a, $50 cp $50
jr nc, .GenerateDVs jr nc, .GenerateDVs
; 20% chance of skipping this check ; 20% chance of skipping this check
call Random call Random
cp a, $32 ; / $100 cp $32 ; / $100
jr c, .CheckMagikarpArea jr c, .CheckMagikarpArea
; Try again if > 1598 ; Try again if > 1598
ld a, [wMagikarpLength + 1] ld a, [wMagikarpLength + 1]
cp a, $40 cp $40
jr nc, .GenerateDVs jr nc, .GenerateDVs
.CheckMagikarpArea: .CheckMagikarpArea:
@ -6448,18 +6448,18 @@ LoadEnemyMon: ; 3e8eb
; Intended behavior enforces a minimum size at Lake of Rage ; Intended behavior enforces a minimum size at Lake of Rage
; The real behavior prevents size flooring in the Lake of Rage area ; The real behavior prevents size flooring in the Lake of Rage area
ld a, [MapGroup] ld a, [MapGroup]
cp a, GROUP_LAKE_OF_RAGE cp GROUP_LAKE_OF_RAGE
jr z, .Happiness jr z, .Happiness
ld a, [MapNumber] ld a, [MapNumber]
cp a, MAP_LAKE_OF_RAGE cp MAP_LAKE_OF_RAGE
jr z, .Happiness jr z, .Happiness
; 40% chance of not flooring ; 40% chance of not flooring
call Random call Random
cp a, $64 ; / $100 cp $64 ; / $100
jr c, .Happiness jr c, .Happiness
; Floor at length 1024 ; Floor at length 1024
ld a, [wMagikarpLength] ld a, [wMagikarpLength]
cp a, 1024 >> 8 cp 1024 >> 8
jr c, .GenerateDVs ; try again jr c, .GenerateDVs ; try again
; Finally done with DVs ; Finally done with DVs
@ -6480,7 +6480,7 @@ LoadEnemyMon: ; 3e8eb
; If we're in a trainer battle, ; If we're in a trainer battle,
; get the rest of the parameters from the party struct ; get the rest of the parameters from the party struct
ld a, [wBattleMode] ld a, [wBattleMode]
cp a, TRAINER_BATTLE cp TRAINER_BATTLE
jr z, .OpponentParty jr z, .OpponentParty
; If we're in a wild battle, check wild-specific stuff ; If we're in a wild battle, check wild-specific stuff
@ -6515,7 +6515,7 @@ LoadEnemyMon: ; 3e8eb
; ..unless it's a RoamMon ; ..unless it's a RoamMon
ld a, [BattleType] ld a, [BattleType]
cp a, BATTLETYPE_ROAMING cp BATTLETYPE_ROAMING
jr nz, .Moves jr nz, .Moves
; Grab HP ; Grab HP
@ -6568,7 +6568,7 @@ LoadEnemyMon: ; 3e8eb
ld de, EnemyMonMoves ld de, EnemyMonMoves
; Are we in a trainer battle? ; Are we in a trainer battle?
ld a, [wBattleMode] ld a, [wBattleMode]
cp a, TRAINER_BATTLE cp TRAINER_BATTLE
jr nz, .WildMoves jr nz, .WildMoves
; Then copy moves from the party struct ; Then copy moves from the party struct
ld hl, OTPartyMon1Moves ld hl, OTPartyMon1Moves
@ -6595,7 +6595,7 @@ LoadEnemyMon: ; 3e8eb
.PP: .PP:
; Trainer battle? ; Trainer battle?
ld a, [wBattleMode] ld a, [wBattleMode]
cp a, TRAINER_BATTLE cp TRAINER_BATTLE
jr z, .TrainerPP jr z, .TrainerPP
; Fill wild PP ; Fill wild PP
@ -6670,13 +6670,13 @@ CheckSleepingTreeMon: ; 3eb38
; Don't do anything if this isn't a tree encounter ; Don't do anything if this isn't a tree encounter
ld a, [BattleType] ld a, [BattleType]
cp a, BATTLETYPE_TREE cp BATTLETYPE_TREE
jr nz, .NotSleeping jr nz, .NotSleeping
; Get list for the time of day ; Get list for the time of day
ld hl, .Morn ld hl, .Morn
ld a, [TimeOfDay] ld a, [TimeOfDay]
cp a, DAY cp DAY
jr c, .Check jr c, .Check
ld hl, .Day ld hl, .Day
jr z, .Check jr z, .Check
@ -6759,7 +6759,7 @@ CheckUnownLetter: ; 3eb75
inc e inc e
inc e inc e
ld a, e ld a, e
cp a, .Set1 - .LetterSets cp .Set1 - .LetterSets
jr c, .loop jr c, .loop
; Hasn't been unlocked, or the letter is invalid ; Hasn't been unlocked, or the letter is invalid

View File

@ -77,9 +77,9 @@ CheckPartyMove: ; c742
ld a, [hl] ld a, [hl]
and a and a
jr z, .no jr z, .no
cp a, -1 cp -1
jr z, .no jr z, .no
cp a, EGG cp EGG
jr z, .next jr z, .next
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
@ -510,7 +510,7 @@ CheckDirection: ; c9cb
; Get player direction ; Get player direction
ld a, [PlayerDirection] ld a, [PlayerDirection]
and a, %00001100 ; bits 2 and 3 contain direction and %00001100 ; bits 2 and 3 contain direction
rrca rrca
rrca rrca
ld e, a ld e, a

View File

@ -1830,7 +1830,7 @@ PrintBCDNumber:: ; 38bb
; 0x38f2 ; 0x38f2
PrintBCDDigit:: ; 38f2 PrintBCDDigit:: ; 38f2
and a, %00001111 and %00001111
and a and a
jr z, .zeroDigit jr z, .zeroDigit
.nonzeroDigit .nonzeroDigit
@ -1845,7 +1845,7 @@ PrintBCDDigit:: ; 38f2
.skipCurrencySymbol .skipCurrencySymbol
res 7, b ; unset 7 to indicate that a nonzero digit has been reached res 7, b ; unset 7 to indicate that a nonzero digit has been reached
.outputDigit .outputDigit
add a, "0" add "0"
ld [hli], a ld [hli], a
jp PrintLetterDelay jp PrintLetterDelay

View File

@ -130,7 +130,7 @@ GetJoypad:: ; 984
; The player input can be automated using an input stream. ; The player input can be automated using an input stream.
; See more below. ; See more below.
ld a, [InputType] ld a, [InputType]
cp a, AUTO_INPUT cp AUTO_INPUT
jr z, .auto jr z, .auto
; To get deltas, take this and last frame's input. ; To get deltas, take this and last frame's input.
@ -197,14 +197,14 @@ GetJoypad:: ; 984
.updateauto .updateauto
; An input of $ff will end the stream. ; An input of $ff will end the stream.
ld a, [hli] ld a, [hli]
cp a, -1 cp -1
jr z, .stopauto jr z, .stopauto
ld b, a ld b, a
; A duration of $ff will end the stream indefinitely. ; A duration of $ff will end the stream indefinitely.
ld a, [hli] ld a, [hli]
ld [AutoInputLength], a ld [AutoInputLength], a
cp a, -1 cp -1
jr nz, .next jr nz, .next
; The current input is overwritten. ; The current input is overwritten.

View File

@ -183,7 +183,7 @@ CheckNickErrors:: ; 669f
inc hl inc hl
; reached end of commands table? ; reached end of commands table?
ld a, [hl] ld a, [hl]
cp a, -1 cp -1
jr z, .done jr z, .done
; is the current char between this value (inclusive)... ; is the current char between this value (inclusive)...

View File

@ -304,7 +304,7 @@ WaitTileAnimation: ; fc2fe
StandingTileFrame8: ; fc2ff StandingTileFrame8: ; fc2ff
ld a, [TileAnimationTimer] ld a, [TileAnimationTimer]
inc a inc a
and a, 7 and 7
ld [TileAnimationTimer], a ld [TileAnimationTimer], a
ret ret
; fc309 ; fc309