aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-04-09 13:07:25 +0200
committerBad Diode <bd@badd10de.dev>2023-04-09 13:07:25 +0200
commit94a112cbb3d7afd398ec32c5b1149352144f71b7 (patch)
treea0b7286f2ec036623d0bca4d605445bd1f633327
parent4198973c29b4c91c2a40c5c637d00881ceb4511e (diff)
downloadstepper-94a112cbb3d7afd398ec32c5b1149352144f71b7.tar.gz
stepper-94a112cbb3d7afd398ec32c5b1149352144f71b7.zip
Fix a bug with noise channel envelope
-rw-r--r--Makefile2
-rw-r--r--src/sequencer.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index b6e0ada..61361e2 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ INC_FLAGS := $(addprefix -I,$(INC_DIRS))
27INC_FLAGS += -I$(LIBGBA_SRC) 27INC_FLAGS += -I$(LIBGBA_SRC)
28 28
29# Output library names and executables. 29# Output library names and executables.
30TARGET := STEPPER-v1.0 30TARGET := STEPPER-v1.1
31ELF := $(BUILD_DIR)/$(TARGET).elf 31ELF := $(BUILD_DIR)/$(TARGET).elf
32BIN := $(BUILD_DIR)/$(TARGET).gba 32BIN := $(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])