Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pret/pokered
Browse files Browse the repository at this point in the history
  • Loading branch information
dannye committed Sep 26, 2024
2 parents 3ab31fa + d5ee4fd commit 98178cf
Show file tree
Hide file tree
Showing 276 changed files with 2,376 additions and 2,411 deletions.
13 changes: 0 additions & 13 deletions .github/webhook.sh

This file was deleted.

9 changes: 1 addition & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@master
with:
path: rgbds
ref: v0.7.0
ref: v0.8.0
repository: gbdev/rgbds

- name: Install rgbds
Expand Down Expand Up @@ -48,13 +48,6 @@ jobs:
return 1
fi
- name: Discord webhook
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
.github/webhook.sh
- name: Checkout symbols
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
uses: actions/checkout@master
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ pokeblue_vc_opt = -Cjv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE"
gfx/battle/move_anim_0.2bpp: tools/gfx += --trim-whitespace
gfx/battle/move_anim_1.2bpp: tools/gfx += --trim-whitespace

gfx/intro/blue_jigglypuff_1.2bpp: rgbgfx += -Z
gfx/intro/blue_jigglypuff_2.2bpp: rgbgfx += -Z
gfx/intro/blue_jigglypuff_3.2bpp: rgbgfx += -Z
gfx/intro/red_nidorino_1.2bpp: rgbgfx += -Z
gfx/intro/red_nidorino_2.2bpp: rgbgfx += -Z
gfx/intro/red_nidorino_3.2bpp: rgbgfx += -Z
gfx/intro/gengar.2bpp: rgbgfx += -Z
gfx/intro/blue_jigglypuff_1.2bpp: rgbgfx += --columns
gfx/intro/blue_jigglypuff_2.2bpp: rgbgfx += --columns
gfx/intro/blue_jigglypuff_3.2bpp: rgbgfx += --columns
gfx/intro/red_nidorino_1.2bpp: rgbgfx += --columns
gfx/intro/red_nidorino_2.2bpp: rgbgfx += --columns
gfx/intro/red_nidorino_3.2bpp: rgbgfx += --columns
gfx/intro/gengar.2bpp: rgbgfx += --columns
gfx/intro/gengar.2bpp: tools/gfx += --remove-duplicates --preserve=0x19,0x76

gfx/credits/the_end.2bpp: tools/gfx += --interleave --png=$<
Expand All @@ -187,9 +187,9 @@ gfx/trade/game_boy.2bpp: tools/gfx += --remove-duplicates
tools/gfx $(tools/gfx) -o $@ $@)

%.1bpp: %.png
$(RGBGFX) $(rgbgfx) -d1 -o $@ $<
$(RGBGFX) $(rgbgfx) --depth 1 -o $@ $<
$(if $(tools/gfx),\
tools/gfx $(tools/gfx) -d1 -o $@ $@)
tools/gfx $(tools/gfx) --depth 1 -o $@ $@)

%.pic: %.2bpp
tools/pkmncompress $< $@
17 changes: 9 additions & 8 deletions audio/engine_1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Audio1_UpdateMusic::
ld a, [wMuteAudioAndPauseMusic]
and a
jr z, .applyAffects
bit 7, a
bit BIT_MUTE_AUDIO, a
jr nz, .nextChannel
set 7, a
set BIT_MUTE_AUDIO, a
ld [wMuteAudioAndPauseMusic], a
xor a ; disable all channels' output
ldh [rNR51], a
Expand Down Expand Up @@ -197,7 +197,7 @@ Audio1_sound_ret:
.dontDisable
jr .afterDisable
.returnFromCall
res 1, [hl]
res BIT_SOUND_CALL, [hl]
ld d, $0
ld a, c
add a
Expand Down Expand Up @@ -377,8 +377,8 @@ Audio1_toggle_perfect_pitch:
ld hl, wChannelFlags1
add hl, bc
ld a, [hl]
xor $1
ld [hl], a ; flip bit 0 of wChannelFlags1
xor 1 << BIT_PERFECT_PITCH
ld [hl], a
jp Audio1_sound_ret

Audio1_vibrato:
Expand Down Expand Up @@ -831,7 +831,8 @@ Audio1_note_pitch:
bit BIT_PERFECT_PITCH, [hl] ; has toggle_perfect_pitch been used?
jr z, .skipFrequencyInc
inc e ; if yes, increment the frequency by 1
jr nc, .skipFrequencyInc
jr nc, .skipFrequencyInc ; Likely a mistake, because `inc` does not set flag C.
; Fortunately this does not seem to affect any notes that actually occur.
inc d
.skipFrequencyInc
ld hl, wChannelFrequencyLowBytes
Expand Down Expand Up @@ -1341,7 +1342,7 @@ Audio1_PlaySound::

.playMusic
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMusicTempo + 1], a
ld [wMusicWaveInstrument], a
Expand Down Expand Up @@ -1582,7 +1583,7 @@ Audio1_PlaySound::
ld a, $77
ldh [rNR50], a ; full volume
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMuteAudioAndPauseMusic], a
ld [wMusicTempo + 1], a
Expand Down
23 changes: 12 additions & 11 deletions audio/engine_2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Audio2_UpdateMusic::
ld a, [wMuteAudioAndPauseMusic]
and a
jr z, .applyAffects
bit 7, a
bit BIT_MUTE_AUDIO, a
jr nz, .nextChannel
set 7, a
set BIT_MUTE_AUDIO, a
ld [wMuteAudioAndPauseMusic], a
xor a ; disable all channels' output
ldh [rNR51], a
Expand Down Expand Up @@ -163,8 +163,8 @@ Audio2_PlayNextNote:
ld a, c
cp CHAN5
jr nz, .beginChecks
ld a, [wLowHealthAlarm] ; low health alarm enabled?
bit 7, a
ld a, [wLowHealthAlarm]
bit BIT_LOW_HEALTH_ALARM, a
ret nz
.beginChecks
; ---
Expand Down Expand Up @@ -208,7 +208,7 @@ Audio2_sound_ret:
.dontDisable
jr .afterDisable
.returnFromCall
res 1, [hl]
res BIT_SOUND_CALL, [hl]
ld d, $0
ld a, c
add a
Expand Down Expand Up @@ -388,8 +388,8 @@ Audio2_toggle_perfect_pitch:
ld hl, wChannelFlags1
add hl, bc
ld a, [hl]
xor $1
ld [hl], a ; flip bit 0 of wChannelFlags1
xor 1 << BIT_PERFECT_PITCH
ld [hl], a
jp Audio2_sound_ret

Audio2_vibrato:
Expand Down Expand Up @@ -842,7 +842,8 @@ Audio2_note_pitch:
bit BIT_PERFECT_PITCH, [hl] ; has toggle_perfect_pitch been used?
jr z, .skipFrequencyInc
inc e ; if yes, increment the frequency by 1
jr nc, .skipFrequencyInc
jr nc, .skipFrequencyInc ; Likely a mistake, because `inc` does not set flag C.
; Fortunately this does not seem to affect any notes that actually occur.
inc d
.skipFrequencyInc
ld hl, wChannelFrequencyLowBytes
Expand Down Expand Up @@ -977,7 +978,7 @@ Audio2_ResetCryModifiers:
cp CHAN5
jr nz, .skip
ld a, [wLowHealthAlarm]
bit 7, a
bit BIT_LOW_HEALTH_ALARM, a
jr z, .skip
xor a
ld [wFrequencyModifier], a
Expand Down Expand Up @@ -1404,7 +1405,7 @@ Audio2_PlaySound::

.playMusic
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMusicTempo + 1], a
ld [wMusicWaveInstrument], a
Expand Down Expand Up @@ -1645,7 +1646,7 @@ Audio2_PlaySound::
ld a, $77
ldh [rNR50], a ; full volume
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMuteAudioAndPauseMusic], a
ld [wMusicTempo + 1], a
Expand Down
17 changes: 9 additions & 8 deletions audio/engine_3.asm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Audio3_UpdateMusic::
ld a, [wMuteAudioAndPauseMusic]
and a
jr z, .applyAffects
bit 7, a
bit BIT_MUTE_AUDIO, a
jr nz, .nextChannel
set 7, a
set BIT_MUTE_AUDIO, a
ld [wMuteAudioAndPauseMusic], a
xor a ; disable all channels' output
ldh [rNR51], a
Expand Down Expand Up @@ -197,7 +197,7 @@ Audio3_sound_ret:
.dontDisable
jr .afterDisable
.returnFromCall
res 1, [hl]
res BIT_SOUND_CALL, [hl]
ld d, $0
ld a, c
add a
Expand Down Expand Up @@ -377,8 +377,8 @@ Audio3_toggle_perfect_pitch:
ld hl, wChannelFlags1
add hl, bc
ld a, [hl]
xor $1
ld [hl], a ; flip bit 0 of wChannelFlags1
xor 1 << BIT_PERFECT_PITCH
ld [hl], a
jp Audio3_sound_ret

Audio3_vibrato:
Expand Down Expand Up @@ -831,7 +831,8 @@ Audio3_note_pitch:
bit BIT_PERFECT_PITCH, [hl] ; has toggle_perfect_pitch been used?
jr z, .skipFrequencyInc
inc e ; if yes, increment the frequency by 1
jr nc, .skipFrequencyInc
jr nc, .skipFrequencyInc ; Likely a mistake, because `inc` does not set flag C.
; Fortunately this does not seem to affect any notes that actually occur.
inc d
.skipFrequencyInc
ld hl, wChannelFrequencyLowBytes
Expand Down Expand Up @@ -1341,7 +1342,7 @@ Audio3_PlaySound::

.playMusic
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMusicTempo + 1], a
ld [wMusicWaveInstrument], a
Expand Down Expand Up @@ -1582,7 +1583,7 @@ Audio3_PlaySound::
ld a, $77
ldh [rNR50], a ; full volume
xor a
ld [wUnusedC000], a
ld [wUnusedMusicByte], a
ld [wDisableChannelOutputWhenSfxEnds], a
ld [wMuteAudioAndPauseMusic], a
ld [wMusicTempo + 1], a
Expand Down
4 changes: 2 additions & 2 deletions audio/fade_audio.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FadeOutAudio::
ld a, [wAudioFadeOutControl]
and a ; currently fading out audio?
jr nz, .fadingOut
ld a, [wd72c]
bit 1, a
ld a, [wStatusFlags2]
bit BIT_NO_AUDIO_FADE_OUT, a
ret nz
ld a, $77
ldh [rNR50], a
Expand Down
14 changes: 7 additions & 7 deletions audio/low_health_alarm.asm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Music_DoLowHealthAlarm::
ld a, [wLowHealthAlarm]
cp $ff
cp DISABLE_LOW_HEALTH_ALARM
jr z, .disableAlarm

bit 7, a ;alarm enabled?
ret z ;nope
bit BIT_LOW_HEALTH_ALARM, a
ret z

and $7f ;low 7 bits are the timer.
and LOW_HEALTH_TIMER_MASK
jr nz, .notToneHi ;if timer > 0, play low tone.

call .playToneHi
Expand All @@ -19,15 +19,15 @@ Music_DoLowHealthAlarm::
call .playToneLo ;actually set the sound registers.

.noTone
ld a, $86
ld a, CRY_SFX_END
ld [wChannelSoundIDs + CHAN5], a ;disable sound channel?
ld a, [wLowHealthAlarm]
and $7f ;decrement alarm timer.
and LOW_HEALTH_TIMER_MASK
dec a

.resetTimer
; reset the timer and enable flag.
set 7, a
set BIT_LOW_HEALTH_ALARM, a
ld [wLowHealthAlarm], a
ret

Expand Down
10 changes: 5 additions & 5 deletions color/color.asm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SetPal_BattleAfterBlack:
; Wait 3 frames (if LCD is on) to allow tilemap updates to apply. Prevents garbage
; from appearing on player/enemy silhouettes.
ldh a, [rLCDC]
and rLCDC_ENABLE_MASK
and 1 << rLCDC_ENABLE
jr z, .doneDelay
ld c, 3
call DelayFrames
Expand Down Expand Up @@ -70,7 +70,7 @@ SetPal_Battle:
; Wait 3 frames (if LCD is on) to allow tilemap updates to apply. Prevents garbage
; from appearing after closing pokemon menu.
ldh a, [rLCDC]
and rLCDC_ENABLE_MASK
and 1 << rLCDC_ENABLE
jr z, .doneDelay
ld c, 3
call DelayFrames
Expand Down Expand Up @@ -268,7 +268,7 @@ SetPal_TownMap:

; Status screen
SetPal_StatusScreen:
ld a, [wcf91]
ld a, [wCurPartySpecies]
cp NUM_POKEMON_INDEXES + 1
jr c, .pokemon
ld a, $1 ; not pokemon
Expand Down Expand Up @@ -351,7 +351,7 @@ ENDC

; Show pokedex data
SetPal_Pokedex:
ld a, [wcf91]
ld a, [wCurPartySpecies]
call DeterminePaletteID
ld d, a
ld e, 0
Expand Down Expand Up @@ -636,7 +636,7 @@ SetPal_Overworld:

; Wait 2 frames before updating palettes (if LCD is on)
ldh a, [rLCDC]
and rLCDC_ENABLE_MASK
and 1 << rLCDC_ENABLE
jr z, .doneDelay
ld c, 2
call DelayFrames
Expand Down
4 changes: 2 additions & 2 deletions color/draw_hud_pokeball_gfx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ EnemyHUDHAX:
jr nz, .notWildBattle
push hl
ld a, [wEnemyMonSpecies2]
ld [wd11e], a
ld [wPokedexNum], a
callfar IndexToPokedex
ld a, [wd11e]
ld a, [wPokedexNum]
dec a
ld c, a
ld b, $2
Expand Down
2 changes: 1 addition & 1 deletion color/exp_bar.asm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ KeepEXPBarFull:
ld a, [wEXPBarKeepFullFlag]
set 0, a
ld [wEXPBarKeepFullFlag], a
ld a, [wCurEnemyLVL]
ld a, [wCurEnemyLevel]
ret

IsCurrentMonBattleMon:
Expand Down
8 changes: 8 additions & 0 deletions constants/audio_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@ DEF HW_CH4_DISABLE_MASK EQU (~HW_CH4_ENABLE_MASK & $ff)

; wChannelFlags2 constant (only has one flag)
DEF BIT_EXECUTE_MUSIC EQU 0 ; if in execute music

; wMuteAudioAndPauseMusic
DEF BIT_MUTE_AUDIO EQU 7

; wLowHealthAlarm
DEF BIT_LOW_HEALTH_ALARM EQU 7
DEF LOW_HEALTH_TIMER_MASK EQU %01111111
DEF DISABLE_LOW_HEALTH_ALARM EQU $ff
Loading

0 comments on commit 98178cf

Please sign in to comment.