Identify CHANNEL_FIELD16 as CHANNEL_NOTE_DURATION_MODIFIER (#1162)

This commit is contained in:
Rangi
2024-12-27 12:54:25 -05:00
committed by GitHub
parent 85ddf0e90a
commit 15187f5d63
3 changed files with 47 additions and 48 deletions

View File

@@ -2205,8 +2205,8 @@ SetNoteDuration:
ld e, [hl]
inc hl
ld d, [hl]
; add ??? to the next result
ld hl, CHANNEL_FIELD16
; add duration modifier to the next result
ld hl, CHANNEL_NOTE_DURATION_MODIFIER
add hl, bc
ld l, [hl]
; multiply Tempo by last result (NoteLength * LOW(delay))
@@ -2214,11 +2214,10 @@ SetNoteDuration:
; copy result to de
ld e, l
ld d, h
; store result in ???
ld hl, CHANNEL_FIELD16
; store result in NoteDuration and NoteDurationModifier
ld hl, CHANNEL_NOTE_DURATION_MODIFIER
add hl, bc
ld [hl], e
; store result in NoteDuration
ld hl, CHANNEL_NOTE_DURATION
add hl, bc
ld [hl], d
@@ -2283,9 +2282,9 @@ Tempo:
ld [hl], e
inc hl
ld [hl], d
; clear ???
; clear duration modifier
xor a
ld hl, CHANNEL_FIELD16
ld hl, CHANNEL_NOTE_DURATION_MODIFIER
add hl, bc
ld [hl], a
ret

View File

@@ -49,7 +49,7 @@ 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_MODIFIER rb
rb_skip
DEF CHANNEL_LOOP_COUNT rb
DEF CHANNEL_TEMPO rw

View File

@@ -142,7 +142,7 @@ MACRO channel_struct
\1Flags3:: db ; 0:vibrato up/down 1:pitch slide direction
\1MusicAddress:: dw
\1LastMusicAddress:: dw
dw
ds 2
\1NoteFlags:: db ; 5:rest
\1Condition:: db ; conditional jumps
\1DutyCycle:: db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
@@ -152,7 +152,7 @@ MACRO channel_struct
\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
\1NoteDurationModifier:: db
ds 1
\1LoopCount:: db
\1Tempo:: dw