Skip to content

Commit

Permalink
md board: move MCLK_e
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeykt committed Aug 10, 2023
1 parent eb15ce9 commit 2223e54
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions fc1004.v
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
module fc1004
(
input MCLK,
input MCLK_e,
input [7:0] SD,
output SE1,
output SE0,
Expand Down Expand Up @@ -281,6 +282,7 @@ module fc1004

ym7101 vdp(
.MCLK(MCLK),
.MCLK_e(MCLK_e),
.SD(SD),
.SE1(SE1),
.SE0(SE0),
Expand Down Expand Up @@ -395,6 +397,7 @@ module fc1004
ym6045 arb
(
.MCLK(MCLK),
.MCLK_e(MCLK_e),
.VCLK(CLK_i),
.ZCLK(ZCLK_i),
.VD8_i(VD_i[8]),
Expand Down
10 changes: 9 additions & 1 deletion md_board.v
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module md_board
output vdp_rs1, // h32/h40
output vdp_m2, // v28/v30
output vdp_lcb,
output vdp_psg_hclk1,
output vdp_psg_clk1,
output fm_clk1

);
Expand Down Expand Up @@ -216,9 +216,17 @@ module md_board
wire [7:0] ym_ZD_o;
wire [7:0] ym_ZD_d;

reg MCLK_e;

always @(posedge MCLK2)
begin
MCLK_e <= ~MCLK_e;
end

fc1004 ym
(
.MCLK(MCLK2),
.MCLK_e(MCLK_e),
.SD(SD),
.SE1(SE1),
.SE0(SE0),
Expand Down
4 changes: 1 addition & 3 deletions ym6045.v
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
module ym6045
(
input MCLK,
input MCLK_e,
input VCLK,
input ZCLK,
input VD8_i,
Expand Down Expand Up @@ -414,16 +415,13 @@ module ym6045
edclk_buf <= w2;
end*/

reg MCLK_e;

ym_scnt_bit dff1(.MCLK(MCLK), .clk(MCLK_e), .load(w1), .val(1'h1), .cin(w3), .rst(sres), .nq(dff1_nq));
ym_scnt_bit dff2(.MCLK(MCLK), .clk(MCLK_e), .load(w1), .val(~dff9_q), .cin(1'h1), .rst(sres), .q(dff2_q), .nq(dff2_nq));
ym_scnt_bit dff3(.MCLK(MCLK), .clk(MCLK_e), .load(w1), .val(1'h0), .cin(dff2_q), .rst(sres), .q(dff3_q), .nq(dff3_nq));

always @(posedge MCLK)
begin
edclk_buf <= w2;
MCLK_e <= ~MCLK_e;
end

//assign w1 = ~(~dff1 & ~dff2 & ~dff3);
Expand Down
6 changes: 2 additions & 4 deletions ym7101.v
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

module ym7101
(
input MCLK,
input [7:0] SD,
output SE1,
output SE0,
Expand Down Expand Up @@ -64,7 +65,7 @@ module ym7101
//output CLK1_d,
output SBCR,
output CLK0,
input MCLK,
input MCLK_e,
input EDCLK_i,
output EDCLK_o,
output EDCLK_d,
Expand Down Expand Up @@ -2274,12 +2275,9 @@ module ym7101

assign mclk_cpu_clk1 = ~(mclk_clk3 | mclk_clk3_l);

reg MCLK_e;

always @(posedge MCLK)
begin
mclk_clk3_l <= mclk_clk3;
MCLK_e <= ~MCLK_e;
end

ym7101_dff prescaler_dff1(.MCLK(MCLK), .clk(MCLK_e), .inp(reset_comb), .rst(1'h0), .outp(prescaler_dff1_l2));
Expand Down

0 comments on commit 2223e54

Please sign in to comment.