From cac7f92c8c736f75853de5f3f4806826b15a8718 Mon Sep 17 00:00:00 2001 From: nukeykt Date: Mon, 14 Aug 2023 20:32:15 +0900 Subject: [PATCH] ym3438: fix ch index output, add sync signal (fm_sel23) --- md_board.v | 3 +++ ym3438_regs.v | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/md_board.v b/md_board.v index 957e85e..06ef39a 100644 --- a/md_board.v +++ b/md_board.v @@ -56,6 +56,7 @@ module md_board output [9:0] MOL_2612, MOR_2612, // ym2612 dac emulation, signed output [15:0] PSG, output [2:0] DAC_ch_index, + output fm_sel23, // input input [6:0] PA_i, @@ -425,6 +426,8 @@ module md_board .DAC_ch_index(DAC_ch_index) ); + assign fm_sel23 = TEST0_o; + wire [2:0] IPL; reg BR; wire BERR; diff --git a/ym3438_regs.v b/ym3438_regs.v index 17b92ad..03d0918 100644 --- a/ym3438_regs.v +++ b/ym3438_regs.v @@ -510,7 +510,7 @@ module ym3438_reg_ctrl // EXTRA start - wire [2:0] dac_index_i = fsm_dac_out_sel ? reg_cnt[2:0] : (reg_cnt[2:0] + 3'h1); + wire [2:0] dac_index_i = reg_cnt[1:0] + (reg_cnt[2] ? 3'h3 : 3'h0) + { 2'h0, ~fsm_dac_out_sel }; ym_slatch #(.DATA_WIDTH(3)) dac_index_lock (