aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-09-09 12:46:48 +0200
committerBad Diode <bd@badd10de.dev>2023-09-09 12:46:48 +0200
commit45ad578200d91a1e21ea2b5661efa0e11f99ebca (patch)
tree7ca489cf74415bbc04e008bf5e5bca01cd82c7a2
parent7f42a1877cdfc4af394942b6ca8131e4ee8fa898 (diff)
downloadstepper-45ad578200d91a1e21ea2b5661efa0e11f99ebca.tar.gz
stepper-45ad578200d91a1e21ea2b5661efa0e11f99ebca.zip
Fix some minor bugs and try to improve consistency.
-rw-r--r--Makefile2
-rw-r--r--src/drawing.c19
-rw-r--r--src/main.c6
-rw-r--r--src/sequencer.c4
-rw-r--r--src/settings.c2
5 files changed, 25 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 0bc4bb5..6bf8ba7 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.7-rc1 30TARGET := STEPPER-v1.7-rc3
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/drawing.c b/src/drawing.c
index 274fe66..97435ad 100644
--- a/src/drawing.c
+++ b/src/drawing.c
@@ -1251,11 +1251,20 @@ draw_parameters(void) {
1251 input_handler == handle_param_selection_sq2 || 1251 input_handler == handle_param_selection_sq2 ||
1252 input_handler == handle_param_selection_wave || 1252 input_handler == handle_param_selection_wave ||
1253 input_handler == handle_param_selection_noise) { 1253 input_handler == handle_param_selection_noise) {
1254 switch (channel_selection_loc) { 1254 if (!pat->empty) {
1255 case 0: { draw_parameters_square(&pat->ch1.params[trig_selection_loc], true, false); } break; 1255 switch (channel_selection_loc) {
1256 case 1: { draw_parameters_square(&pat->ch2.params[trig_selection_loc], false, false); } break; 1256 case 0: { draw_parameters_square(&pat->ch1.params[trig_selection_loc], true, false); } break;
1257 case 2: { draw_parameters_wave(&pat->ch3.params[trig_selection_loc], false); } break; 1257 case 1: { draw_parameters_square(&pat->ch2.params[trig_selection_loc], false, false); } break;
1258 case 3: { draw_parameters_noise(&pat->ch4.params[trig_selection_loc], false); } break; 1258 case 2: { draw_parameters_wave(&pat->ch3.params[trig_selection_loc], false); } break;
1259 case 3: { draw_parameters_noise(&pat->ch4.params[trig_selection_loc], false); } break;
1260 }
1261 } else {
1262 switch (channel_selection_loc) {
1263 case 0: { draw_parameters_square(&default_ch1.params, true, false); } break;
1264 case 1: { draw_parameters_square(&default_ch2.params, false, false); } break;
1265 case 2: { draw_parameters_wave(&default_ch3.params, true); } break;
1266 case 3: { draw_parameters_noise(&default_ch4.params, true); } break;
1267 }
1259 } 1268 }
1260 return; 1269 return;
1261 } 1270 }
diff --git a/src/main.c b/src/main.c
index e9d1baf..1970e8e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -81,6 +81,10 @@ WITH REGARD TO THIS SOFTWARE.
81// + Cursor on bank can wrap around (up/down) but the same can't be done on 81// + Cursor on bank can wrap around (up/down) but the same can't be done on
82// patterns. 82// patterns.
83// + Add help for pattern chain 83// + Add help for pattern chain
84// + Make sure when switching to global bpm, the currently selected tempo is
85// used.
86// + Make sure parameters show the default ones on empty/cleared patterns and
87// you can't modify non active trig params or params on empty patterns.
84// - Add CREDITS to the documentation for now, should probably be a menu item 88// - Add CREDITS to the documentation for now, should probably be a menu item
85// later. 89// later.
86// - Make sure sync works with the same cable for in/out. 90// - Make sure sync works with the same cable for in/out.
@@ -89,6 +93,8 @@ WITH REGARD TO THIS SOFTWARE.
89 93
90#include "renderer_m0.c" 94#include "renderer_m0.c"
91#include "globals.c" 95#include "globals.c"
96#include "assets.c"
97#include "patterns.c"
92#include "settings.c" 98#include "settings.c"
93#include "dsound.c" 99#include "dsound.c"
94#include "scale.c" 100#include "scale.c"
diff --git a/src/sequencer.c b/src/sequencer.c
index 3bd214f..27874f5 100644
--- a/src/sequencer.c
+++ b/src/sequencer.c
@@ -1,7 +1,5 @@
1#include "rng.c" 1#include "rng.c"
2#include "text.h" 2#include "text.h"
3#include "assets.c"
4#include "patterns.c"
5#include "save.c" 3#include "save.c"
6#include "drawing.c" 4#include "drawing.c"
7#include "clipboard.c" 5#include "clipboard.c"
@@ -1459,6 +1457,7 @@ handle_trigger_selection(void) {
1459 redraw_channels = true; 1457 redraw_channels = true;
1460 redraw_pattern_buttons = true; 1458 redraw_pattern_buttons = true;
1461 } else { 1459 } else {
1460 if (trig->active && !patterns[pattern_selection_loc].empty) {
1462 // Switch to parameter selection. 1461 // Switch to parameter selection.
1463 switch (channel_selection_loc) { 1462 switch (channel_selection_loc) {
1464 case 0: { input_handler = handle_param_selection_sq1; } break; 1463 case 0: { input_handler = handle_param_selection_sq1; } break;
@@ -1466,6 +1465,7 @@ handle_trigger_selection(void) {
1466 case 2: { input_handler = handle_param_selection_wave; } break; 1465 case 2: { input_handler = handle_param_selection_wave; } break;
1467 case 3: { input_handler = handle_param_selection_noise; } break; 1466 case 3: { input_handler = handle_param_selection_noise; } break;
1468 } 1467 }
1468 }
1469 redraw_params = true; 1469 redraw_params = true;
1470 } 1470 }
1471 } 1471 }
diff --git a/src/settings.c b/src/settings.c
index 31b3dd3..374618c 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -104,6 +104,7 @@ handle_settings_input(void) {
104 settings.global_bpm++; 104 settings.global_bpm++;
105 } 105 }
106 redraw_bpm = true; 106 redraw_bpm = true;
107 settings.bpm = patterns[pattern_selection_loc].bpm;
107 if (play_status) { 108 if (play_status) {
108 update_bpm = true; 109 update_bpm = true;
109 } 110 }
@@ -158,6 +159,7 @@ handle_settings_input(void) {
158 settings.global_bpm--; 159 settings.global_bpm--;
159 } 160 }
160 redraw_bpm = true; 161 redraw_bpm = true;
162 settings.bpm = patterns[pattern_selection_loc].bpm;
161 if (play_status) { 163 if (play_status) {
162 update_bpm = true; 164 update_bpm = true;
163 } 165 }