diff options
author | Bad Diode <bd@badd10de.dev> | 2023-04-09 13:07:25 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2023-04-09 13:07:25 +0200 |
commit | 94a112cbb3d7afd398ec32c5b1149352144f71b7 (patch) | |
tree | a0b7286f2ec036623d0bca4d605445bd1f633327 | |
parent | 4198973c29b4c91c2a40c5c637d00881ceb4511e (diff) | |
download | stepper-94a112cbb3d7afd398ec32c5b1149352144f71b7.tar.gz stepper-94a112cbb3d7afd398ec32c5b1149352144f71b7.zip |
Fix a bug with noise channel envelope
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/sequencer.c | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -27,7 +27,7 @@ INC_FLAGS := $(addprefix -I,$(INC_DIRS)) | |||
27 | INC_FLAGS += -I$(LIBGBA_SRC) | 27 | INC_FLAGS += -I$(LIBGBA_SRC) |
28 | 28 | ||
29 | # Output library names and executables. | 29 | # Output library names and executables. |
30 | TARGET := STEPPER-v1.0 | 30 | TARGET := STEPPER-v1.1 |
31 | ELF := $(BUILD_DIR)/$(TARGET).elf | 31 | ELF := $(BUILD_DIR)/$(TARGET).elf |
32 | BIN := $(BUILD_DIR)/$(TARGET).gba | 32 | BIN := $(BUILD_DIR)/$(TARGET).gba |
33 | 33 | ||
diff --git a/src/sequencer.c b/src/sequencer.c index ff5847d..6baa565 100644 --- a/src/sequencer.c +++ b/src/sequencer.c | |||
@@ -1832,9 +1832,6 @@ irq_timer(void) { | |||
1832 | if (pat->ch4.active) { | 1832 | if (pat->ch4.active) { |
1833 | TriggerNote *trig = &pat->ch4.notes[step_counter]; | 1833 | TriggerNote *trig = &pat->ch4.notes[step_counter]; |
1834 | ChannelNoiseParams *params = &pat->ch4.params[step_counter]; | 1834 | ChannelNoiseParams *params = &pat->ch4.params[step_counter]; |
1835 | SOUND_NOISE_CTRL = SOUND_NOISE_ENV_VOL(params->env_volume) | ||
1836 | | SOUND_NOISE_ENV_TIME(params->env_time) | ||
1837 | | SOUND_NOISE_ENV_DIR(params->env_direction); | ||
1838 | if (trig->active) { | 1835 | if (trig->active) { |
1839 | static const u8 div_freq[] = { | 1836 | static const u8 div_freq[] = { |
1840 | 7, 6, 5, 4, 7, 6, 5, 4, 7, 6, 5, 4, | 1837 | 7, 6, 5, 4, 7, 6, 5, 4, 7, 6, 5, 4, |
@@ -1852,6 +1849,9 @@ irq_timer(void) { | |||
1852 | 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, | 1849 | 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, |
1853 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 1850 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
1854 | }; | 1851 | }; |
1852 | SOUND_NOISE_CTRL = SOUND_NOISE_ENV_VOL(params->env_volume) | ||
1853 | | SOUND_NOISE_ENV_TIME(params->env_time) | ||
1854 | | SOUND_NOISE_ENV_DIR(params->env_direction); | ||
1855 | SOUND_NOISE_FREQ = SOUND_FREQ_RESET | 1855 | SOUND_NOISE_FREQ = SOUND_FREQ_RESET |
1856 | | SOUND_NOISE_PRESTEP_FREQ(pre_freq[trig->note]) | 1856 | | SOUND_NOISE_PRESTEP_FREQ(pre_freq[trig->note]) |
1857 | | SOUND_NOISE_DIV_FREQ(div_freq[trig->note]) | 1857 | | SOUND_NOISE_DIV_FREQ(div_freq[trig->note]) |