Skip to content

Commit

Permalink
ym3438: fix busy flag read
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeykt committed Aug 3, 2023
1 parent be77739 commit 17fd7e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions fc1004.v
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ module fc1004
wire fm_clk;
wire [7:0] fm_data_o;
wire fm_data_d;
wire fm_data_d2;
wire fm_test_d; // reg_2c[7]
wire fm_cs;
wire fm_irq;
Expand Down Expand Up @@ -554,12 +555,14 @@ module fc1004

wire colorbus = ~(tmss_test_1 & tmss_test_2 & tmss_test_3);

assign fm_data_d2 = fm_data_d | tmss_test_3;

assign ZD_o =
(ioc_bc4 ? 8'h0 : ioc_zdata) |
(colorbus ? 8'h0 : vdp_ra) |
(fm_data_d ? 8'h0 : fm_data_o);
(fm_data_d2 ? 8'h0 : fm_data_o);

assign ZD_d = (ioc_bc4 & colorbus & fm_data_d) ? 8'hff : 8'h0;
assign ZD_d = (ioc_bc4 & colorbus & fm_data_d2) ? 8'hff : 8'h0;

wire [15:0] ioc_vdata_word = { ioc_vdata[7:1], M3 ? ioc_vdata[0] : ioc_reg_3e_q, ioc_vdata[7:0] };

Expand Down
2 changes: 1 addition & 1 deletion ym3438_io.v
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module ym3438_io
);

assign data_o =
(read_status ? { ~busy_state_o, 6'h0, timer_b_status_sl_out, timer_a_status_sl_out } : 8'h0) |
(read_status ? { ~busy_state_o, 5'h0, timer_b_status_sl_out, timer_a_status_sl_out } : 8'h0) |
(read_debug ? debug_data : 8'h0);

assign irq = ~(timer_a_status_sl_out | timer_b_status_sl_out);
Expand Down

0 comments on commit 17fd7e9

Please sign in to comment.