Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dannye committed May 10, 2024
2 parents ac60aa2 + 546d43f commit 3868f7e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 65 deletions.
126 changes: 63 additions & 63 deletions crysaudio/audio_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -21,64 +21,64 @@
const CHAN2 ; 1
const CHAN3 ; 2
const CHAN4 ; 3
NUM_MUSIC_CHANS EQU const_value
DEF NUM_MUSIC_CHANS EQU const_value
const CHAN5 ; 4
const CHAN6 ; 5
const CHAN7 ; 6
const CHAN8 ; 7
NUM_NOISE_CHANS EQU const_value - NUM_MUSIC_CHANS
NUM_CHANNELS EQU const_value
DEF NUM_NOISE_CHANS EQU const_value - NUM_MUSIC_CHANS
DEF NUM_CHANNELS EQU const_value

Ch1 EQU CHAN1
Ch2 EQU CHAN2
Ch3 EQU CHAN3
Ch4 EQU CHAN4
Ch5 EQU CHAN5
Ch6 EQU CHAN6
Ch7 EQU CHAN7
Ch8 EQU CHAN8
DEF Ch1 EQU CHAN1
DEF Ch2 EQU CHAN2
DEF Ch3 EQU CHAN3
DEF Ch4 EQU CHAN4
DEF Ch5 EQU CHAN5
DEF Ch6 EQU CHAN6
DEF Ch7 EQU CHAN7
DEF Ch8 EQU CHAN8

; channel_struct members (see macros/wram.asm)
CHANNEL_MUSIC_ID EQUS "(wChannel1MusicID - wChannel1)"
CHANNEL_MUSIC_BANK EQUS "(wChannel1MusicBank - wChannel1)"
CHANNEL_FLAGS1 EQUS "(wChannel1Flags1 - wChannel1)"
CHANNEL_FLAGS2 EQUS "(wChannel1Flags2 - wChannel1)"
CHANNEL_FLAGS3 EQUS "(wChannel1Flags3 - wChannel1)"
CHANNEL_MUSIC_ADDRESS EQUS "(wChannel1MusicAddress - wChannel1)"
CHANNEL_LAST_MUSIC_ADDRESS EQUS "(wChannel1LastMusicAddress - wChannel1)"
CHANNEL_NOTE_FLAGS EQUS "(wChannel1NoteFlags - wChannel1)"
CHANNEL_CONDITION EQUS "(wChannel1Condition - wChannel1)"
CHANNEL_DUTY_CYCLE EQUS "(wChannel1DutyCycle - wChannel1)"
CHANNEL_VOLUME_ENVELOPE EQUS "(wChannel1VolumeEnvelope - wChannel1)"
CHANNEL_FREQUENCY EQUS "(wChannel1Frequency - wChannel1)"
CHANNEL_PITCH EQUS "(wChannel1Pitch - wChannel1)"
CHANNEL_OCTAVE EQUS "(wChannel1Octave - wChannel1)"
CHANNEL_TRANSPOSITION EQUS "(wChannel1Transposition - wChannel1)"
CHANNEL_NOTE_DURATION EQUS "(wChannel1NoteDuration - wChannel1)"
CHANNEL_FIELD16 EQUS "(wChannel1Field16 - wChannel1)"
CHANNEL_LOOP_COUNT EQUS "(wChannel1LoopCount - wChannel1)"
CHANNEL_TEMPO EQUS "(wChannel1Tempo - wChannel1)"
CHANNEL_TRACKS EQUS "(wChannel1Tracks - wChannel1)"
CHANNEL_DUTY_CYCLE_PATTERN EQUS "(wChannel1DutyCyclePattern - wChannel1)"
CHANNEL_VIBRATO_DELAY_COUNT EQUS "(wChannel1VibratoDelayCount - wChannel1)"
CHANNEL_VIBRATO_DELAY EQUS "(wChannel1VibratoDelay - wChannel1)"
CHANNEL_VIBRATO_EXTENT EQUS "(wChannel1VibratoExtent - wChannel1)"
CHANNEL_VIBRATO_RATE EQUS "(wChannel1VibratoRate - wChannel1)"
CHANNEL_PITCH_SLIDE_TARGET EQUS "(wChannel1PitchSlideTarget - wChannel1)"
CHANNEL_PITCH_SLIDE_AMOUNT EQUS "(wChannel1PitchSlideAmount - wChannel1)"
CHANNEL_PITCH_SLIDE_AMOUNT_FRACTION EQUS "(wChannel1PitchSlideAmountFraction - wChannel1)"
CHANNEL_FIELD25 EQUS "(wChannel1Field25 - wChannel1)"
CHANNEL_PITCH_OFFSET EQUS "(wChannel1PitchOffset - wChannel1)"
CHANNEL_FIELD29 EQUS "(wChannel1Field29 - wChannel1)"
CHANNEL_FIELD2A EQUS "(wChannel1Field2a - wChannel1)"
CHANNEL_FIELD2C EQUS "(wChannel1Field2c - wChannel1)"
CHANNEL_NOTE_LENGTH EQUS "(wChannel1NoteLength - wChannel1)"
CHANNEL_FIELD2E EQUS "(wChannel1Field2e - wChannel1)"
CHANNEL_FIELD2F EQUS "(wChannel1Field2f - wChannel1)"
CHANNEL_FIELD30 EQUS "(wChannel1Field30 - wChannel1)"
CHANNEL_STRUCT_LENGTH EQUS "(wChannel2 - wChannel1)"
DEF CHANNEL_MUSIC_ID EQUS "(wChannel1MusicID - wChannel1)"
DEF CHANNEL_MUSIC_BANK EQUS "(wChannel1MusicBank - wChannel1)"
DEF CHANNEL_FLAGS1 EQUS "(wChannel1Flags1 - wChannel1)"
DEF CHANNEL_FLAGS2 EQUS "(wChannel1Flags2 - wChannel1)"
DEF CHANNEL_FLAGS3 EQUS "(wChannel1Flags3 - wChannel1)"
DEF CHANNEL_MUSIC_ADDRESS EQUS "(wChannel1MusicAddress - wChannel1)"
DEF CHANNEL_LAST_MUSIC_ADDRESS EQUS "(wChannel1LastMusicAddress - wChannel1)"
DEF CHANNEL_NOTE_FLAGS EQUS "(wChannel1NoteFlags - wChannel1)"
DEF CHANNEL_CONDITION EQUS "(wChannel1Condition - wChannel1)"
DEF CHANNEL_DUTY_CYCLE EQUS "(wChannel1DutyCycle - wChannel1)"
DEF CHANNEL_VOLUME_ENVELOPE EQUS "(wChannel1VolumeEnvelope - wChannel1)"
DEF CHANNEL_FREQUENCY EQUS "(wChannel1Frequency - wChannel1)"
DEF CHANNEL_PITCH EQUS "(wChannel1Pitch - wChannel1)"
DEF CHANNEL_OCTAVE EQUS "(wChannel1Octave - wChannel1)"
DEF CHANNEL_TRANSPOSITION EQUS "(wChannel1Transposition - wChannel1)"
DEF CHANNEL_NOTE_DURATION EQUS "(wChannel1NoteDuration - wChannel1)"
DEF CHANNEL_FIELD16 EQUS "(wChannel1Field16 - wChannel1)"
DEF CHANNEL_LOOP_COUNT EQUS "(wChannel1LoopCount - wChannel1)"
DEF CHANNEL_TEMPO EQUS "(wChannel1Tempo - wChannel1)"
DEF CHANNEL_TRACKS EQUS "(wChannel1Tracks - wChannel1)"
DEF CHANNEL_DUTY_CYCLE_PATTERN EQUS "(wChannel1DutyCyclePattern - wChannel1)"
DEF CHANNEL_VIBRATO_DELAY_COUNT EQUS "(wChannel1VibratoDelayCount - wChannel1)"
DEF CHANNEL_VIBRATO_DELAY EQUS "(wChannel1VibratoDelay - wChannel1)"
DEF CHANNEL_VIBRATO_EXTENT EQUS "(wChannel1VibratoExtent - wChannel1)"
DEF CHANNEL_VIBRATO_RATE EQUS "(wChannel1VibratoRate - wChannel1)"
DEF CHANNEL_PITCH_SLIDE_TARGET EQUS "(wChannel1PitchSlideTarget - wChannel1)"
DEF CHANNEL_PITCH_SLIDE_AMOUNT EQUS "(wChannel1PitchSlideAmount - wChannel1)"
DEF CHANNEL_PITCH_SLIDE_AMOUNT_FRACTION EQUS "(wChannel1PitchSlideAmountFraction - wChannel1)"
DEF CHANNEL_FIELD25 EQUS "(wChannel1Field25 - wChannel1)"
DEF CHANNEL_PITCH_OFFSET EQUS "(wChannel1PitchOffset - wChannel1)"
DEF CHANNEL_FIELD29 EQUS "(wChannel1Field29 - wChannel1)"
DEF CHANNEL_FIELD2A EQUS "(wChannel1Field2a - wChannel1)"
DEF CHANNEL_FIELD2C EQUS "(wChannel1Field2c - wChannel1)"
DEF CHANNEL_NOTE_LENGTH EQUS "(wChannel1NoteLength - wChannel1)"
DEF CHANNEL_FIELD2E EQUS "(wChannel1Field2e - wChannel1)"
DEF CHANNEL_FIELD2F EQUS "(wChannel1Field2f - wChannel1)"
DEF CHANNEL_FIELD30 EQUS "(wChannel1Field30 - wChannel1)"
DEF CHANNEL_STRUCT_LENGTH EQUS "(wChannel2 - wChannel1)"

NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7
DEF NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7

; Flags1
const_def
Expand Down Expand Up @@ -116,22 +116,22 @@ NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7
const NOTE_VIBRATO_OVERRIDE ; 6

; wVolume
VOLUME_SO1_F EQU 3
VOLUME_SO2_F EQU 7
VOLUME_SO1_LEVEL EQU %00000111
VOLUME_SO2_LEVEL EQU %01110000
MAX_VOLUME EQU $77
DEF VOLUME_SO1_F EQU 3
DEF VOLUME_SO2_F EQU 7
DEF VOLUME_SO1_LEVEL EQU %00000111
DEF VOLUME_SO2_LEVEL EQU %01110000
DEF MAX_VOLUME EQU $77

; wSoundInput
SOUND_INPUT_CH1_F EQU 0
SOUND_INPUT_CH2_F EQU 1
SOUND_INPUT_CH3_F EQU 2
SOUND_INPUT_CH4_F EQU 3
SOUND_INPUT_GLOBAL_F EQU 7
DEF SOUND_INPUT_CH1_F EQU 0
DEF SOUND_INPUT_CH2_F EQU 1
DEF SOUND_INPUT_CH3_F EQU 2
DEF SOUND_INPUT_CH4_F EQU 3
DEF SOUND_INPUT_GLOBAL_F EQU 7

; wLowHealthAlarm
DANGER_PITCH_F EQU 4
DANGER_ON_F EQU 7
DEF DANGER_PITCH_F EQU 4
DEF DANGER_ON_F EQU 7

; wMusicFade
MUSIC_FADE_IN_F EQU 7
DEF MUSIC_FADE_IN_F EQU 7
4 changes: 2 additions & 2 deletions crysaudio/macros.asm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ ENDM
MACRO toggle_sfx
db toggle_sfx_cmd
ENDM
execute_music EQUS "toggle_sfx"
DEF execute_music EQUS "toggle_sfx"

const pitch_slide_cmd ; $e0
MACRO pitch_slide
Expand Down Expand Up @@ -202,7 +202,7 @@ MACRO pitch_offset
db pitch_offset_cmd
bigdw \1 ; pitch offset
ENDM
toggle_perfect_pitch EQUS "pitch_offset 1"
DEF toggle_perfect_pitch EQUS "pitch_offset 1"

const unknownmusic0xe7_cmd ; $e7
MACRO unknownmusic0xe7
Expand Down
5 changes: 5 additions & 0 deletions engine/menus/pokedex.asm
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,13 @@ DrawDexEntryOnScreen:
call GetMonHeader ; load pokemon picture location
hlcoord 1, 1
call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture

ld a, [wd11e]
push af
ld a, [wcf91]
call PlayCry ; play pokemon cry
pop af
ld [wd11e], a

pop hl
pop de
Expand Down

0 comments on commit 3868f7e

Please sign in to comment.