diff --git a/src/synth.c b/src/synth.c index c6e7b775..6031d997 100644 --- a/src/synth.c +++ b/src/synth.c @@ -102,33 +102,6 @@ void synth_pitch(u8 channel, u8 octave, u16 freqNumber) updateOctaveAndFrequency(channel); } -void synth_totalLevel(u8 channel, u8 totalLevel) -{ - const u8 REG_TOTAL_LEVEL = 0x40; - Channel* chan = getChannel(channel); - switch (chan->algorithm) { - case 7: - writeOperatorReg(channel, 0, REG_TOTAL_LEVEL, totalLevel); - writeOperatorReg(channel, 1, REG_TOTAL_LEVEL, totalLevel); - writeOperatorReg(channel, 2, REG_TOTAL_LEVEL, totalLevel); - writeOperatorReg(channel, 3, REG_TOTAL_LEVEL, totalLevel); - break; - case 6: - case 5: - writeOperatorReg(channel, 1, REG_TOTAL_LEVEL, totalLevel); - writeOperatorReg(channel, 2, REG_TOTAL_LEVEL, totalLevel); - writeOperatorReg(channel, 3, REG_TOTAL_LEVEL, totalLevel); - break; - case 4: - writeOperatorReg(channel, 2, REG_TOTAL_LEVEL, totalLevel); - writeOperatorReg(channel, 3, REG_TOTAL_LEVEL, totalLevel); - break; - default: - writeOperatorReg(channel, 3, REG_TOTAL_LEVEL, totalLevel); - break; - } -} - void synth_volume(u8 channel, u8 volume) { volumes[channel] = volume; diff --git a/src/synth.h b/src/synth.h index 9ba45d8e..7ac53e4c 100644 --- a/src/synth.h +++ b/src/synth.h @@ -41,7 +41,6 @@ void synth_init(void); void synth_noteOn(u8 channel); void synth_noteOff(u8 channel); void synth_pitch(u8 channel, u8 octave, u16 freqNumber); -void synth_totalLevel(u8 channel, u8 totalLevel); void synth_volume(u8 channel, u8 volume); void synth_stereo(u8 channel, u8 mode); void synth_algorithm(u8 channel, u8 algorithm); diff --git a/tests/Makefile b/tests/Makefile index 06870066..09e23c06 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -27,7 +27,6 @@ MOCKS=midi_process \ synth_noteOn \ synth_noteOff \ synth_pitch \ - synth_totalLevel \ synth_stereo \ synth_algorithm \ synth_feedback \ diff --git a/tests/unit/main.c b/tests/unit/main.c index 6531456e..30437f29 100644 --- a/tests/unit/main.c +++ b/tests/unit/main.c @@ -94,10 +94,6 @@ int main(void) synth_test(test_synth_sets_note_off_fm_reg_chan_0_to_2), synth_test(test_synth_sets_note_off_fm_reg_chan_3_to_5), synth_test(test_synth_sets_octave_and_freq_reg_chan), - synth_test(test_synth_sets_total_level_reg_chan_for_algorithms_0_to_3), - synth_test(test_synth_sets_total_level_reg_chan_for_algorithm_4), - synth_test(test_synth_sets_total_level_reg_chan_for_algorithms_5_and_6), - synth_test(test_synth_sets_total_level_reg_chan_for_algorithm_7), synth_test(test_synth_sets_stereo_ams_and_freq), synth_test(test_synth_sets_algorithm), synth_test(test_synth_sets_feedback), diff --git a/tests/unit/test_synth.c b/tests/unit/test_synth.c index 269ab28d..5ddf6627 100644 --- a/tests/unit/test_synth.c +++ b/tests/unit/test_synth.c @@ -14,7 +14,6 @@ extern void __real_synth_noteOff(u8 channel); extern void __real_synth_enableLfo(u8 enable); extern void __real_synth_globalLfoFrequency(u8 freq); extern void __real_synth_pitch(u8 channel, u8 octave, u16 freqNumber); -extern void __real_synth_totalLevel(u8 channel, u8 totalLevel); extern void __real_synth_stereo(u8 channel, u8 stereo); extern void __real_synth_ams(u8 channel, u8 ams); extern void __real_synth_fms(u8 channel, u8 fms); @@ -101,60 +100,6 @@ static void test_synth_sets_octave_and_freq_reg_chan(UNUSED void** state) } } -static void test_synth_sets_total_level_reg_chan_for_algorithms_0_to_3( - UNUSED void** state) -{ - for (u8 algorithm = 0; algorithm < 4; algorithm++) - for (u8 chan = 0; chan < MAX_FM_CHANS; chan++) { - expect_ym2612_write_channel_any_data(chan, 0xB0); - expect_ym2612_write_operator(chan, 3, 0x40, 0); - __real_synth_algorithm(chan, algorithm); - __real_synth_totalLevel(chan, 0); - } -} - -static void test_synth_sets_total_level_reg_chan_for_algorithm_4( - UNUSED void** state) -{ - const u8 algorithm = 4; - for (u8 chan = 0; chan < MAX_FM_CHANS; chan++) { - expect_ym2612_write_channel_any_data(chan, 0xB0); - expect_ym2612_write_operator(chan, 2, 0x40, 0); - expect_ym2612_write_operator(chan, 3, 0x40, 0); - __real_synth_algorithm(chan, algorithm); - __real_synth_totalLevel(chan, 0); - } -} - -static void test_synth_sets_total_level_reg_chan_for_algorithms_5_and_6( - UNUSED void** state) -{ - for (u8 algorithm = 5; algorithm < 6; algorithm++) - for (u8 chan = 0; chan < MAX_FM_CHANS; chan++) { - expect_ym2612_write_channel_any_data(chan, 0xB0); - expect_ym2612_write_operator(chan, 1, 0x40, 0); - expect_ym2612_write_operator(chan, 2, 0x40, 0); - expect_ym2612_write_operator(chan, 3, 0x40, 0); - __real_synth_algorithm(chan, algorithm); - __real_synth_totalLevel(chan, 0); - } -} - -static void test_synth_sets_total_level_reg_chan_for_algorithm_7( - UNUSED void** state) -{ - const u8 algorithm = 7; - for (u8 chan = 0; chan < MAX_FM_CHANS; chan++) { - expect_ym2612_write_channel_any_data(chan, 0xB0); - expect_ym2612_write_operator(chan, 0, 0x40, 0); - expect_ym2612_write_operator(chan, 1, 0x40, 0); - expect_ym2612_write_operator(chan, 2, 0x40, 0); - expect_ym2612_write_operator(chan, 3, 0x40, 0); - __real_synth_algorithm(chan, algorithm); - __real_synth_totalLevel(chan, 0); - } -} - static void test_synth_sets_stereo_ams_and_freq(UNUSED void** state) { const u8 ams = 1;