Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify CHANNEL_FIELD16 as part of the note duration #117

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions audio/engine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2205,20 +2205,19 @@ SetNoteDuration:
ld e, [hl]
inc hl
ld d, [hl]
; add ??? to the next result
ld hl, CHANNEL_FIELD16
; add hi duration to the next result
ld hl, CHANNEL_NOTE_DURATION + 1
add hl, bc
ld l, [hl]
; multiply Tempo by last result (NoteLength * LOW(delay))
call .Multiply
; copy result to de
ld e, l
ld d, h
; store result in ???
ld hl, CHANNEL_FIELD16
; store result in NoteDuration
ld hl, CHANNEL_NOTE_DURATION + 1
add hl, bc
ld [hl], e
; store result in NoteDuration
ld hl, CHANNEL_NOTE_DURATION
add hl, bc
ld [hl], d
Expand Down Expand Up @@ -2283,9 +2282,9 @@ Tempo:
ld [hl], e
inc hl
ld [hl], d
; clear ???
; clear hi duration
xor a
ld hl, CHANNEL_FIELD16
ld hl, CHANNEL_NOTE_DURATION + 1
add hl, bc
ld [hl], a
ret
Expand Down
3 changes: 1 addition & 2 deletions constants/audio_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ DEF CHANNEL_FREQUENCY rw
DEF CHANNEL_PITCH rb
DEF CHANNEL_OCTAVE rb
DEF CHANNEL_TRANSPOSITION rb
DEF CHANNEL_NOTE_DURATION rb
DEF CHANNEL_FIELD16 rb
DEF CHANNEL_NOTE_DURATION rw
rb_skip
DEF CHANNEL_LOOP_COUNT rb
DEF CHANNEL_TEMPO rw
Expand Down
3 changes: 1 addition & 2 deletions macros/ram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ MACRO channel_struct
\1Pitch:: db ; 0:rest 1-c:note
\1Octave:: db ; 7-0 (0 is highest)
\1Transposition:: db ; raises existing octaves (to repeat phrases)
\1NoteDuration:: db ; frames remaining for the current note
\1Field16:: ds 1
\1NoteDuration:: dw ; frames remaining for the current note
ds 1
\1LoopCount:: db
\1Tempo:: dw
Expand Down