mirror of
https://github.com/UzixLS/zx-multisound.git
synced 2025-07-18 23:01:31 +03:00
fix gs glitches with contended timings
This commit is contained in:
@ -75,6 +75,12 @@ always @(negedge clk32 or negedge rst_n) begin
|
||||
rom_m1_access <= a[15:14] == 2'b00;
|
||||
end
|
||||
|
||||
reg n_rd_wr_delayed, n_rd_wr_delayed1;
|
||||
always @(posedge clk32) begin
|
||||
n_rd_wr_delayed <= n_rd_wr_delayed1;
|
||||
n_rd_wr_delayed1 <= n_wr & n_rd;
|
||||
end
|
||||
|
||||
|
||||
/* CONFIGURATION */
|
||||
wire ym_ena = cfg[0];
|
||||
@ -221,20 +227,28 @@ wire gs_dac3_wr = gs_dac3_cs && ~n_grd;
|
||||
reg gs_flag_cmd, gs_flag_data;
|
||||
wire [7:0] gs_status = {gs_flag_data, 6'b111111, gs_flag_cmd};
|
||||
|
||||
always @(posedge clk32) begin
|
||||
if ((~n_giorq && n_gm1 && ga[3:0] == 4'h2) || (ioreq_rd && port_b3))
|
||||
always @(posedge clk32 or negedge rst_n) begin
|
||||
if (!rst_n)
|
||||
gs_flag_data <= 1'b0;
|
||||
else if ((~n_giorq && n_gm1 && ga[3:0] == 4'h3) || (ioreq_wr && port_b3))
|
||||
else if (~n_iorq && ~n_rd && n_rd_wr_delayed && port_b3)
|
||||
gs_flag_data <= 1'b0;
|
||||
else if (~n_iorq && ~n_wr && n_rd_wr_delayed && port_b3)
|
||||
gs_flag_data <= 1'b1;
|
||||
else if (~n_giorq && n_gm1 && ga[3:0] == 4'h2)
|
||||
gs_flag_data <= 1'b0;
|
||||
else if (~n_giorq && n_gm1 && ga[3:0] == 4'h3)
|
||||
gs_flag_data <= 1'b1;
|
||||
else if (~n_giorq && n_gm1 && ga[3:0] == 4'hA)
|
||||
gs_flag_data <= ~gs_reg00[0];
|
||||
end
|
||||
|
||||
always @(posedge clk32) begin
|
||||
if (~n_giorq && n_gm1 && ga[3:0] == 4'h5)
|
||||
always @(posedge clk32 or negedge rst_n) begin
|
||||
if (!rst_n)
|
||||
gs_flag_cmd <= 1'b0;
|
||||
else if (ioreq_wr && port_bb)
|
||||
else if (~n_iorq && ~n_wr && n_rd_wr_delayed && port_bb)
|
||||
gs_flag_cmd <= 1'b1;
|
||||
else if (~n_giorq && n_gm1 && ga[3:0] == 4'h5)
|
||||
gs_flag_cmd <= 1'b0;
|
||||
else if (~n_giorq && n_gm1 && ga[3:0] == 4'hB)
|
||||
gs_flag_cmd <= vol3[5];
|
||||
end
|
||||
|
Reference in New Issue
Block a user