Skip to content

Commit 169e6a3

Browse files
Fix audio init
1 parent c1a2491 commit 169e6a3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ All the differences from the animated GIF (that we're aware of):
2929
## Thanks
3030

3131
[calc84maniac](https://github.com/calc84maniac/) for some mad optimisations
32+
[ISSOtm](https://github.com/ISSOtm) for saner optimisations
3233

3334
## Licenses
3435

inc/judge.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,3 @@ IF !DEF (JUDGE_MUSIC)
230230
ENDC
231231

232232
DEF MUSIC_DELAY EQU $40
233-
DEF MUSIC_STEREO EQU 0

src/judge/judge_main.asm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ JudgeMain:
3131

3232
IF JUDGE_MUSIC
3333

34+
; Optimized by ISSOtm
35+
ld hl, rNR52 ; Load the audio master register's address into HL
36+
ld [hl], a ; Turn the APU off
3437
dec a ; A is zero from previous operations
35-
ldh [rNR52], a ; Enable all channels
36-
IF !MUSIC_STEREO
37-
ldh [rNR51], a ; Play all channels on both speakers
38-
ENDC
39-
ldh [rNR50], a ; Set the volume to max
38+
ld [hld], a ; Turn the APU on
39+
ld [hld], a ; Enable all channels
40+
ld [hl], $77 ; Set max volume but not VIN
4041

4142
ld hl, song_hideout
4243
call hUGE_init

0 commit comments

Comments
 (0)