Skip to content

Commit

Permalink
Add comment about audio engine perfect pitch bug (#451)
Browse files Browse the repository at this point in the history
Co-authored-by: preeyan <preeyan>
  • Loading branch information
preeyan authored May 23, 2024
1 parent 5f7b444 commit d38cf52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion audio/engine_1.asm
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion audio/engine_2.asm
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion audio/engine_3.asm
Original file line number Diff line number Diff line change
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

0 comments on commit d38cf52

Please sign in to comment.