Skip to content

Commit 98178cf

Browse files
committed
Merge branch 'master' of https://github.com/pret/pokered
2 parents 3ab31fa + d5ee4fd commit 98178cf

File tree

276 files changed

+2376
-2411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+2376
-2411
lines changed

.github/webhook.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@master
1717
with:
1818
path: rgbds
19-
ref: v0.7.0
19+
ref: v0.8.0
2020
repository: gbdev/rgbds
2121

2222
- name: Install rgbds
@@ -48,13 +48,6 @@ jobs:
4848
return 1
4949
fi
5050
51-
- name: Discord webhook
52-
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
53-
env:
54-
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
55-
run: |
56-
.github/webhook.sh
57-
5851
- name: Checkout symbols
5952
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
6053
uses: actions/checkout@master

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ pokeblue_vc_opt = -Cjv -n 0 -k 01 -l 0x33 -m 0x13 -r 03 -t "POKEMON BLUE"
157157
gfx/battle/move_anim_0.2bpp: tools/gfx += --trim-whitespace
158158
gfx/battle/move_anim_1.2bpp: tools/gfx += --trim-whitespace
159159

160-
gfx/intro/blue_jigglypuff_1.2bpp: rgbgfx += -Z
161-
gfx/intro/blue_jigglypuff_2.2bpp: rgbgfx += -Z
162-
gfx/intro/blue_jigglypuff_3.2bpp: rgbgfx += -Z
163-
gfx/intro/red_nidorino_1.2bpp: rgbgfx += -Z
164-
gfx/intro/red_nidorino_2.2bpp: rgbgfx += -Z
165-
gfx/intro/red_nidorino_3.2bpp: rgbgfx += -Z
166-
gfx/intro/gengar.2bpp: rgbgfx += -Z
160+
gfx/intro/blue_jigglypuff_1.2bpp: rgbgfx += --columns
161+
gfx/intro/blue_jigglypuff_2.2bpp: rgbgfx += --columns
162+
gfx/intro/blue_jigglypuff_3.2bpp: rgbgfx += --columns
163+
gfx/intro/red_nidorino_1.2bpp: rgbgfx += --columns
164+
gfx/intro/red_nidorino_2.2bpp: rgbgfx += --columns
165+
gfx/intro/red_nidorino_3.2bpp: rgbgfx += --columns
166+
gfx/intro/gengar.2bpp: rgbgfx += --columns
167167
gfx/intro/gengar.2bpp: tools/gfx += --remove-duplicates --preserve=0x19,0x76
168168

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

189189
%.1bpp: %.png
190-
$(RGBGFX) $(rgbgfx) -d1 -o $@ $<
190+
$(RGBGFX) $(rgbgfx) --depth 1 -o $@ $<
191191
$(if $(tools/gfx),\
192-
tools/gfx $(tools/gfx) -d1 -o $@ $@)
192+
tools/gfx $(tools/gfx) --depth 1 -o $@ $@)
193193

194194
%.pic: %.2bpp
195195
tools/pkmncompress $< $@

audio/engine_1.asm

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Audio1_UpdateMusic::
1515
ld a, [wMuteAudioAndPauseMusic]
1616
and a
1717
jr z, .applyAffects
18-
bit 7, a
18+
bit BIT_MUTE_AUDIO, a
1919
jr nz, .nextChannel
20-
set 7, a
20+
set BIT_MUTE_AUDIO, a
2121
ld [wMuteAudioAndPauseMusic], a
2222
xor a ; disable all channels' output
2323
ldh [rNR51], a
@@ -197,7 +197,7 @@ Audio1_sound_ret:
197197
.dontDisable
198198
jr .afterDisable
199199
.returnFromCall
200-
res 1, [hl]
200+
res BIT_SOUND_CALL, [hl]
201201
ld d, $0
202202
ld a, c
203203
add a
@@ -377,8 +377,8 @@ Audio1_toggle_perfect_pitch:
377377
ld hl, wChannelFlags1
378378
add hl, bc
379379
ld a, [hl]
380-
xor $1
381-
ld [hl], a ; flip bit 0 of wChannelFlags1
380+
xor 1 << BIT_PERFECT_PITCH
381+
ld [hl], a
382382
jp Audio1_sound_ret
383383

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

13421343
.playMusic
13431344
xor a
1344-
ld [wUnusedC000], a
1345+
ld [wUnusedMusicByte], a
13451346
ld [wDisableChannelOutputWhenSfxEnds], a
13461347
ld [wMusicTempo + 1], a
13471348
ld [wMusicWaveInstrument], a
@@ -1582,7 +1583,7 @@ Audio1_PlaySound::
15821583
ld a, $77
15831584
ldh [rNR50], a ; full volume
15841585
xor a
1585-
ld [wUnusedC000], a
1586+
ld [wUnusedMusicByte], a
15861587
ld [wDisableChannelOutputWhenSfxEnds], a
15871588
ld [wMuteAudioAndPauseMusic], a
15881589
ld [wMusicTempo + 1], a

audio/engine_2.asm

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Audio2_UpdateMusic::
1717
ld a, [wMuteAudioAndPauseMusic]
1818
and a
1919
jr z, .applyAffects
20-
bit 7, a
20+
bit BIT_MUTE_AUDIO, a
2121
jr nz, .nextChannel
22-
set 7, a
22+
set BIT_MUTE_AUDIO, a
2323
ld [wMuteAudioAndPauseMusic], a
2424
xor a ; disable all channels' output
2525
ldh [rNR51], a
@@ -163,8 +163,8 @@ Audio2_PlayNextNote:
163163
ld a, c
164164
cp CHAN5
165165
jr nz, .beginChecks
166-
ld a, [wLowHealthAlarm] ; low health alarm enabled?
167-
bit 7, a
166+
ld a, [wLowHealthAlarm]
167+
bit BIT_LOW_HEALTH_ALARM, a
168168
ret nz
169169
.beginChecks
170170
; ---
@@ -208,7 +208,7 @@ Audio2_sound_ret:
208208
.dontDisable
209209
jr .afterDisable
210210
.returnFromCall
211-
res 1, [hl]
211+
res BIT_SOUND_CALL, [hl]
212212
ld d, $0
213213
ld a, c
214214
add a
@@ -388,8 +388,8 @@ Audio2_toggle_perfect_pitch:
388388
ld hl, wChannelFlags1
389389
add hl, bc
390390
ld a, [hl]
391-
xor $1
392-
ld [hl], a ; flip bit 0 of wChannelFlags1
391+
xor 1 << BIT_PERFECT_PITCH
392+
ld [hl], a
393393
jp Audio2_sound_ret
394394

395395
Audio2_vibrato:
@@ -842,7 +842,8 @@ Audio2_note_pitch:
842842
bit BIT_PERFECT_PITCH, [hl] ; has toggle_perfect_pitch been used?
843843
jr z, .skipFrequencyInc
844844
inc e ; if yes, increment the frequency by 1
845-
jr nc, .skipFrequencyInc
845+
jr nc, .skipFrequencyInc ; Likely a mistake, because `inc` does not set flag C.
846+
; Fortunately this does not seem to affect any notes that actually occur.
846847
inc d
847848
.skipFrequencyInc
848849
ld hl, wChannelFrequencyLowBytes
@@ -977,7 +978,7 @@ Audio2_ResetCryModifiers:
977978
cp CHAN5
978979
jr nz, .skip
979980
ld a, [wLowHealthAlarm]
980-
bit 7, a
981+
bit BIT_LOW_HEALTH_ALARM, a
981982
jr z, .skip
982983
xor a
983984
ld [wFrequencyModifier], a
@@ -1404,7 +1405,7 @@ Audio2_PlaySound::
14041405

14051406
.playMusic
14061407
xor a
1407-
ld [wUnusedC000], a
1408+
ld [wUnusedMusicByte], a
14081409
ld [wDisableChannelOutputWhenSfxEnds], a
14091410
ld [wMusicTempo + 1], a
14101411
ld [wMusicWaveInstrument], a
@@ -1645,7 +1646,7 @@ Audio2_PlaySound::
16451646
ld a, $77
16461647
ldh [rNR50], a ; full volume
16471648
xor a
1648-
ld [wUnusedC000], a
1649+
ld [wUnusedMusicByte], a
16491650
ld [wDisableChannelOutputWhenSfxEnds], a
16501651
ld [wMuteAudioAndPauseMusic], a
16511652
ld [wMusicTempo + 1], a

audio/engine_3.asm

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Audio3_UpdateMusic::
1515
ld a, [wMuteAudioAndPauseMusic]
1616
and a
1717
jr z, .applyAffects
18-
bit 7, a
18+
bit BIT_MUTE_AUDIO, a
1919
jr nz, .nextChannel
20-
set 7, a
20+
set BIT_MUTE_AUDIO, a
2121
ld [wMuteAudioAndPauseMusic], a
2222
xor a ; disable all channels' output
2323
ldh [rNR51], a
@@ -197,7 +197,7 @@ Audio3_sound_ret:
197197
.dontDisable
198198
jr .afterDisable
199199
.returnFromCall
200-
res 1, [hl]
200+
res BIT_SOUND_CALL, [hl]
201201
ld d, $0
202202
ld a, c
203203
add a
@@ -377,8 +377,8 @@ Audio3_toggle_perfect_pitch:
377377
ld hl, wChannelFlags1
378378
add hl, bc
379379
ld a, [hl]
380-
xor $1
381-
ld [hl], a ; flip bit 0 of wChannelFlags1
380+
xor 1 << BIT_PERFECT_PITCH
381+
ld [hl], a
382382
jp Audio3_sound_ret
383383

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

13421343
.playMusic
13431344
xor a
1344-
ld [wUnusedC000], a
1345+
ld [wUnusedMusicByte], a
13451346
ld [wDisableChannelOutputWhenSfxEnds], a
13461347
ld [wMusicTempo + 1], a
13471348
ld [wMusicWaveInstrument], a
@@ -1582,7 +1583,7 @@ Audio3_PlaySound::
15821583
ld a, $77
15831584
ldh [rNR50], a ; full volume
15841585
xor a
1585-
ld [wUnusedC000], a
1586+
ld [wUnusedMusicByte], a
15861587
ld [wDisableChannelOutputWhenSfxEnds], a
15871588
ld [wMuteAudioAndPauseMusic], a
15881589
ld [wMusicTempo + 1], a

audio/fade_audio.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FadeOutAudio::
22
ld a, [wAudioFadeOutControl]
33
and a ; currently fading out audio?
44
jr nz, .fadingOut
5-
ld a, [wd72c]
6-
bit 1, a
5+
ld a, [wStatusFlags2]
6+
bit BIT_NO_AUDIO_FADE_OUT, a
77
ret nz
88
ld a, $77
99
ldh [rNR50], a

audio/low_health_alarm.asm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Music_DoLowHealthAlarm::
22
ld a, [wLowHealthAlarm]
3-
cp $ff
3+
cp DISABLE_LOW_HEALTH_ALARM
44
jr z, .disableAlarm
55

6-
bit 7, a ;alarm enabled?
7-
ret z ;nope
6+
bit BIT_LOW_HEALTH_ALARM, a
7+
ret z
88

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

1212
call .playToneHi
@@ -19,15 +19,15 @@ Music_DoLowHealthAlarm::
1919
call .playToneLo ;actually set the sound registers.
2020

2121
.noTone
22-
ld a, $86
22+
ld a, CRY_SFX_END
2323
ld [wChannelSoundIDs + CHAN5], a ;disable sound channel?
2424
ld a, [wLowHealthAlarm]
25-
and $7f ;decrement alarm timer.
25+
and LOW_HEALTH_TIMER_MASK
2626
dec a
2727

2828
.resetTimer
2929
; reset the timer and enable flag.
30-
set 7, a
30+
set BIT_LOW_HEALTH_ALARM, a
3131
ld [wLowHealthAlarm], a
3232
ret
3333

color/color.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ SetPal_BattleAfterBlack:
3838
; Wait 3 frames (if LCD is on) to allow tilemap updates to apply. Prevents garbage
3939
; from appearing on player/enemy silhouettes.
4040
ldh a, [rLCDC]
41-
and rLCDC_ENABLE_MASK
41+
and 1 << rLCDC_ENABLE
4242
jr z, .doneDelay
4343
ld c, 3
4444
call DelayFrames
@@ -70,7 +70,7 @@ SetPal_Battle:
7070
; Wait 3 frames (if LCD is on) to allow tilemap updates to apply. Prevents garbage
7171
; from appearing after closing pokemon menu.
7272
ldh a, [rLCDC]
73-
and rLCDC_ENABLE_MASK
73+
and 1 << rLCDC_ENABLE
7474
jr z, .doneDelay
7575
ld c, 3
7676
call DelayFrames
@@ -268,7 +268,7 @@ SetPal_TownMap:
268268

269269
; Status screen
270270
SetPal_StatusScreen:
271-
ld a, [wcf91]
271+
ld a, [wCurPartySpecies]
272272
cp NUM_POKEMON_INDEXES + 1
273273
jr c, .pokemon
274274
ld a, $1 ; not pokemon
@@ -351,7 +351,7 @@ ENDC
351351

352352
; Show pokedex data
353353
SetPal_Pokedex:
354-
ld a, [wcf91]
354+
ld a, [wCurPartySpecies]
355355
call DeterminePaletteID
356356
ld d, a
357357
ld e, 0
@@ -636,7 +636,7 @@ SetPal_Overworld:
636636

637637
; Wait 2 frames before updating palettes (if LCD is on)
638638
ldh a, [rLCDC]
639-
and rLCDC_ENABLE_MASK
639+
and 1 << rLCDC_ENABLE
640640
jr z, .doneDelay
641641
ld c, 2
642642
call DelayFrames

color/draw_hud_pokeball_gfx.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ EnemyHUDHAX:
4141
jr nz, .notWildBattle
4242
push hl
4343
ld a, [wEnemyMonSpecies2]
44-
ld [wd11e], a
44+
ld [wPokedexNum], a
4545
callfar IndexToPokedex
46-
ld a, [wd11e]
46+
ld a, [wPokedexNum]
4747
dec a
4848
ld c, a
4949
ld b, $2

0 commit comments

Comments
 (0)