Skip to content

Commit

Permalink
Identify CHANNEL_FIELD16 as part of the note duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Oct 17, 2024
1 parent a18a8bf commit 01f5f82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
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

0 comments on commit 01f5f82

Please sign in to comment.