Skip to content

Commit 15187f5

Browse files
authored
Identify CHANNEL_FIELD16 as CHANNEL_NOTE_DURATION_MODIFIER (#1162)
1 parent 85ddf0e commit 15187f5

File tree

3 files changed

+47
-48
lines changed

3 files changed

+47
-48
lines changed

audio/engine.asm

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,20 +2205,19 @@ SetNoteDuration:
22052205
ld e, [hl]
22062206
inc hl
22072207
ld d, [hl]
2208-
; add ??? to the next result
2209-
ld hl, CHANNEL_FIELD16
2208+
; add duration modifier to the next result
2209+
ld hl, CHANNEL_NOTE_DURATION_MODIFIER
22102210
add hl, bc
22112211
ld l, [hl]
22122212
; multiply Tempo by last result (NoteLength * LOW(delay))
22132213
call .Multiply
22142214
; copy result to de
22152215
ld e, l
22162216
ld d, h
2217-
; store result in ???
2218-
ld hl, CHANNEL_FIELD16
2217+
; store result in NoteDuration and NoteDurationModifier
2218+
ld hl, CHANNEL_NOTE_DURATION_MODIFIER
22192219
add hl, bc
22202220
ld [hl], e
2221-
; store result in NoteDuration
22222221
ld hl, CHANNEL_NOTE_DURATION
22232222
add hl, bc
22242223
ld [hl], d
@@ -2283,9 +2282,9 @@ Tempo:
22832282
ld [hl], e
22842283
inc hl
22852284
ld [hl], d
2286-
; clear ???
2285+
; clear duration modifier
22872286
xor a
2288-
ld hl, CHANNEL_FIELD16
2287+
ld hl, CHANNEL_NOTE_DURATION_MODIFIER
22892288
add hl, bc
22902289
ld [hl], a
22912290
ret

constants/audio_constants.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ DEF CHANNEL_PITCH rb
4949
DEF CHANNEL_OCTAVE rb
5050
DEF CHANNEL_TRANSPOSITION rb
5151
DEF CHANNEL_NOTE_DURATION rb
52-
DEF CHANNEL_FIELD16 rb
52+
DEF CHANNEL_NOTE_DURATION_MODIFIER rb
5353
rb_skip
5454
DEF CHANNEL_LOOP_COUNT rb
5555
DEF CHANNEL_TEMPO rw

macros/ram.asm

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -135,47 +135,47 @@ MACRO map_connection_struct
135135
ENDM
136136

137137
MACRO channel_struct
138-
\1MusicID:: dw
139-
\1MusicBank:: db
140-
\1Flags1:: db ; 0:on/off 1:subroutine 2:looping 3:sfx 4:noise 5:rest
141-
\1Flags2:: db ; 0:vibrato on/off 1:pitch slide 2:duty cycle pattern 4:pitch offset
142-
\1Flags3:: db ; 0:vibrato up/down 1:pitch slide direction
143-
\1MusicAddress:: dw
144-
\1LastMusicAddress:: dw
145-
dw
146-
\1NoteFlags:: db ; 5:rest
147-
\1Condition:: db ; conditional jumps
148-
\1DutyCycle:: db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
149-
\1VolumeEnvelope:: db ; hi:volume lo:fade
150-
\1Frequency:: dw ; 11 bits
151-
\1Pitch:: db ; 0:rest 1-c:note
152-
\1Octave:: db ; 7-0 (0 is highest)
153-
\1Transposition:: db ; raises existing octaves (to repeat phrases)
154-
\1NoteDuration:: db ; frames remaining for the current note
155-
\1Field16:: ds 1
156-
ds 1
157-
\1LoopCount:: db
158-
\1Tempo:: dw
159-
\1Tracks:: db ; hi:left lo:right
160-
\1DutyCyclePattern:: db
161-
\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
162-
\1VibratoDelay:: db ; number of frames a note plays until vibrato starts
163-
\1VibratoExtent:: db
164-
\1VibratoRate:: db ; hi:frames for each alt lo:frames to the next alt
165-
\1PitchSlideTarget:: dw ; frequency endpoint for pitch slide
166-
\1PitchSlideAmount:: db
138+
\1MusicID:: dw
139+
\1MusicBank:: db
140+
\1Flags1:: db ; 0:on/off 1:subroutine 2:looping 3:sfx 4:noise 5:rest
141+
\1Flags2:: db ; 0:vibrato on/off 1:pitch slide 2:duty cycle pattern 4:pitch offset
142+
\1Flags3:: db ; 0:vibrato up/down 1:pitch slide direction
143+
\1MusicAddress:: dw
144+
\1LastMusicAddress:: dw
145+
ds 2
146+
\1NoteFlags:: db ; 5:rest
147+
\1Condition:: db ; conditional jumps
148+
\1DutyCycle:: db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
149+
\1VolumeEnvelope:: db ; hi:volume lo:fade
150+
\1Frequency:: dw ; 11 bits
151+
\1Pitch:: db ; 0:rest 1-c:note
152+
\1Octave:: db ; 7-0 (0 is highest)
153+
\1Transposition:: db ; raises existing octaves (to repeat phrases)
154+
\1NoteDuration:: db ; frames remaining for the current note
155+
\1NoteDurationModifier:: db
156+
ds 1
157+
\1LoopCount:: db
158+
\1Tempo:: dw
159+
\1Tracks:: db ; hi:left lo:right
160+
\1DutyCyclePattern:: db
161+
\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
162+
\1VibratoDelay:: db ; number of frames a note plays until vibrato starts
163+
\1VibratoExtent:: db
164+
\1VibratoRate:: db ; hi:frames for each alt lo:frames to the next alt
165+
\1PitchSlideTarget:: dw ; frequency endpoint for pitch slide
166+
\1PitchSlideAmount:: db
167167
\1PitchSlideAmountFraction:: db
168-
\1Field25:: db
169-
ds 1
170-
\1PitchOffset:: dw
171-
\1Field29:: ds 1
172-
\1Field2a:: ds 2
173-
\1Field2c:: ds 1
174-
\1NoteLength:: db ; frames per 16th note
175-
\1Field2e:: ds 1
176-
\1Field2f:: ds 1
177-
\1Field30:: ds 1
178-
ds 1
168+
\1Field25:: db
169+
ds 1
170+
\1PitchOffset:: dw
171+
\1Field29:: ds 1
172+
\1Field2a:: ds 2
173+
\1Field2c:: ds 1
174+
\1NoteLength:: db ; frames per 16th note
175+
\1Field2e:: ds 1
176+
\1Field2f:: ds 1
177+
\1Field30:: ds 1
178+
ds 1
179179
ENDM
180180

181181
MACRO battle_tower_struct

0 commit comments

Comments
 (0)