Skip to content

Commit

Permalink
Use const_skip and const_next macros for brevity
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jul 9, 2020
1 parent 676a35f commit 3e572b6
Show file tree
Hide file tree
Showing 20 changed files with 540 additions and 2,280 deletions.
22 changes: 12 additions & 10 deletions constants/audio_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,20 @@ HW_CH2_DISABLE_MASK EQU (~HW_CH2_ENABLE_MASK & $ff)
HW_CH3_DISABLE_MASK EQU (~HW_CH3_ENABLE_MASK & $ff)
HW_CH4_DISABLE_MASK EQU (~HW_CH4_ENABLE_MASK & $ff)

REG_DUTY_SOUND_LEN EQU 1
REG_VOLUME_ENVELOPE EQU 2
REG_FREQUENCY_LO EQU 3
const_def 1
const REG_DUTY_SOUND_LEN ; 1
const REG_VOLUME_ENVELOPE ; 2
const REG_FREQUENCY_LO ; 3

; wChannelFlags1 constants
BIT_PERFECT_PITCH EQU 0 ; controlled by toggle_perfect_pitch command
BIT_SOUND_CALL EQU 1 ; if in sound call
BIT_NOISE_OR_SFX EQU 2 ; if channel is the music noise channel or an SFX channel
BIT_VIBRATO_DIRECTION EQU 3 ; if the pitch is above or below normal (cycles)
BIT_PITCH_SLIDE_ON EQU 4 ; if pitch slide is active
BIT_PITCH_SLIDE_DECREASING EQU 5 ; if the pitch slide frequency is decreasing (instead of increasing)
BIT_ROTATE_DUTY_CYCLE EQU 6 ; if rotating duty cycle
const_def
const BIT_PERFECT_PITCH ; 0 ; controlled by toggle_perfect_pitch command
const BIT_SOUND_CALL ; 1 ; if in sound call
const BIT_NOISE_OR_SFX ; 2 ; if channel is the music noise channel or an SFX channel
const BIT_VIBRATO_DIRECTION ; 3 ; if the pitch is above or below normal (cycles)
const BIT_PITCH_SLIDE_ON ; 4 ; if pitch slide is active
const BIT_PITCH_SLIDE_DECREASING ; 5 ; if the pitch slide frequency is decreasing (instead of increasing)
const BIT_ROTATE_DUTY_CYCLE ; 6 ; if rotating duty cycle

; wChannelFlags2 constant (only has one flag)
BIT_EXECUTE_MUSIC EQU 0 ; if in execute music
59 changes: 32 additions & 27 deletions constants/battle_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ NUM_DVS EQU 2
BIT_TEST_BATTLE EQU 0

; battle type constants
BATTLE_TYPE_NORMAL EQU 0
BATTLE_TYPE_OLD_MAN EQU 1
BATTLE_TYPE_SAFARI EQU 2
const_def
const BATTLE_TYPE_NORMAL ; 0
const BATTLE_TYPE_OLD_MAN ; 1
const BATTLE_TYPE_SAFARI ; 2

; damage limits before type effectiveness
MIN_NEUTRAL_DAMAGE EQU 2
Expand All @@ -30,35 +31,39 @@ NO_EFFECT EQU 00

; non-volatile statuses
SLP EQU %111 ; sleep counter
PSN EQU 3
BRN EQU 4
FRZ EQU 5
PAR EQU 6
const_def 3
const PSN ; 3
const BRN ; 4
const FRZ ; 5
const PAR ; 6

MAX_STAT_VALUE EQU 999

; volatile statuses 1
STORING_ENERGY EQU 0 ; Bide
THRASHING_ABOUT EQU 1 ; e.g. Thrash
ATTACKING_MULTIPLE_TIMES EQU 2 ; e.g. Double Kick, Fury Attack
FLINCHED EQU 3
CHARGING_UP EQU 4 ; e.g. Solar Beam, Fly
USING_TRAPPING_MOVE EQU 5 ; e.g. Wrap
INVULNERABLE EQU 6 ; charging up Fly/Dig
CONFUSED EQU 7
const_def
const STORING_ENERGY ; 0 ; Bide
const THRASHING_ABOUT ; 1 ; e.g. Thrash
const ATTACKING_MULTIPLE_TIMES ; 2 ; e.g. Double Kick, Fury Attack
const FLINCHED ; 3
const CHARGING_UP ; 4 ; e.g. Solar Beam, Fly
const USING_TRAPPING_MOVE ; 5 ; e.g. Wrap
const INVULNERABLE ; 6 ; charging up Fly/Dig
const CONFUSED ; 7

; volatile statuses 2
USING_X_ACCURACY EQU 0
PROTECTED_BY_MIST EQU 1
GETTING_PUMPED EQU 2 ; Focus Energy
; EQU 3 ; unused
HAS_SUBSTITUTE_UP EQU 4
NEEDS_TO_RECHARGE EQU 5 ; Hyper Beam
USING_RAGE EQU 6
SEEDED EQU 7
const_def
const USING_X_ACCURACY ; 0
const PROTECTED_BY_MIST ; 1
const GETTING_PUMPED ; 2 ; Focus Energy
const_skip ; 3 ; unused
const HAS_SUBSTITUTE_UP ; 4
const NEEDS_TO_RECHARGE ; 5 ; Hyper Beam
const USING_RAGE ; 6
const SEEDED ; 7

; volatile statuses 3
BADLY_POISONED EQU 0
HAS_LIGHT_SCREEN_UP EQU 1
HAS_REFLECT_UP EQU 2
TRANSFORMED EQU 3
const_def
const BADLY_POISONED ; 0
const HAS_LIGHT_SCREEN_UP ; 1
const HAS_REFLECT_UP ; 2
const TRANSFORMED ; 3
12 changes: 6 additions & 6 deletions constants/credits_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
const CRED_CLUB ; $3E
const CRED_PAAD ; $3F

const_value = $FA
const CRED_THE_END ; $FA
const CRED_COPYRIGHT ; $FB
const CRED_TEXT ; $FC
const CRED_TEXT_FADE ; $FD
const CRED_TEXT_MON ; $FE
const_def -1, -1
const CRED_TEXT_FADE_MON ; $FF
const CRED_TEXT_MON ; $FE
const CRED_TEXT_FADE ; $FD
const CRED_TEXT ; $FC
const CRED_COPYRIGHT ; $FB
const CRED_THE_END ; $FA
Loading

0 comments on commit 3e572b6

Please sign in to comment.