Skip to content

Commit

Permalink
reset new and connection_sel regs (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtaylormb authored Jun 9, 2024
1 parent 7ea1288 commit c869ec9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rtl/soc/sound/opl3/channels.sv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module channels
logic cnt; // operator connection
logic [REG_FB_WIDTH-1:0] fb_dummy;

always_ff @(posedge clk)
always_ff @(posedge clk) begin
if (opl3_reg_wr.valid) begin
if (opl3_reg_wr.bank_num == 1 && opl3_reg_wr.address == 4)
connection_sel <= opl3_reg_wr.data[REG_CONNECTION_SEL_WIDTH-1:0];
Expand All @@ -87,6 +87,13 @@ module channels
ryt <= opl3_reg_wr.data[5];
end

if (reset) begin
// these should be reset as next game after reset may be OPL2 and not clear bank 1
connection_sel <= 0;
is_new <= 0;
end
end

mem_multi_bank #(
.DATA_WIDTH(REG_FILE_DATA_WIDTH),
.DEPTH('h9),
Expand Down

0 comments on commit c869ec9

Please sign in to comment.