Skip to content

Commit

Permalink
fix shutoff intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Nov 26, 2023
1 parent 8467c9f commit 1d6fa56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/common/vb_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ void sound_update(int reg) {
snd_ram_changed[mem_rbyte(S1RAM)] = 0;
// Output according to interval data
}
shutoff_intervals[0] = reg1 & 0x1f;
voice_set_position(voice[CH1], 0);
reg2 = mem_rbyte(S1EV0);
envelope_intervals[0] = reg2 & 7;
Expand Down Expand Up @@ -293,6 +294,7 @@ void sound_update(int reg) {
memcpy(channel[CH2]->data, waveram, 32);
snd_ram_changed[mem_rbyte(S2RAM)] = 0;
}
shutoff_intervals[1] = reg1 & 0x1f;
voice_set_position(voice[CH2], 0);
reg2 = mem_rbyte(S2EV0);
envelope_intervals[1] = reg2 & 7;
Expand Down Expand Up @@ -335,6 +337,7 @@ void sound_update(int reg) {
memcpy(channel[CH3]->data, waveram, 32);
snd_ram_changed[mem_rbyte(S3RAM)] = 0;
}
shutoff_intervals[2] = reg1 & 0x1f;
voice_set_position(voice[CH3], 0);
reg2 = mem_rbyte(S3EV0);
envelope_intervals[2] = reg2 & 7;
Expand Down Expand Up @@ -377,6 +380,7 @@ void sound_update(int reg) {
memcpy(channel[CH4]->data, waveram, 32);
snd_ram_changed[mem_rbyte(S4RAM)] = 0;
}
shutoff_intervals[3] = reg1 & 0x1f;
voice_set_position(voice[CH4], 0);
reg2 = mem_rbyte(S4EV0);
envelope_intervals[3] = reg2 & 7;
Expand Down Expand Up @@ -419,6 +423,7 @@ void sound_update(int reg) {
memcpy(channel[CH5]->data, waveram, 32);
snd_ram_changed[mem_rbyte(S5RAM)] = 0;
}
shutoff_intervals[4] = reg1 & 0x1f;
voice_set_position(voice[CH5], 0);
reg2 = mem_rbyte(S5EV0);
envelope_intervals[4] = reg2 & 7;
Expand Down Expand Up @@ -469,6 +474,7 @@ void sound_update(int reg) {
case S6INT:
reg1 = mem_rbyte(reg);
if (reg1 & 0x80) {
shutoff_intervals[5] = reg1 & 0x1f;
voice_set_position(Curr_C6V, 0);
reg2 = mem_rbyte(S6EV0);
envelope_intervals[5] = reg2 & 7;
Expand Down

0 comments on commit 1d6fa56

Please sign in to comment.