midi out is now handled on both ay chips

This commit is contained in:
Eugene Lozovoy
2025-02-19 16:01:34 +03:00
parent 7ce8af832f
commit a199682f67
2 changed files with 44 additions and 17 deletions

View File

@ -34,12 +34,20 @@ module turbosound
output [11:0] CHANNEL_L, // Output channel L
output [11:0] CHANNEL_R, // Output channel R
input [7:0] IOA_in,
input [7:0] IOB_in,
output [7:0] IOA_out,
output [7:0] IOB_out,
output IOA_oe,
output IOB_oe
input [7:0] IOA_0_in,
input [7:0] IOB_0_in,
output [7:0] IOA_0_out,
output [7:0] IOB_0_out,
output IOA_0_oe,
output IOB_0_oe,
input [7:0] IOA_1_in,
input [7:0] IOB_1_in,
output [7:0] IOA_1_out,
output [7:0] IOB_1_out,
output IOA_1_oe,
output IOB_1_oe
);
@ -128,7 +136,14 @@ jt03 ym2203_0
.psg_B(psg_ch_b_0),
.psg_C(psg_ch_c_0),
.fm_snd(opn_0)
.fm_snd(opn_0),
.IOA_in(IOA_0_in),
.IOB_in(IOB_0_in),
.IOA_out(IOA_0_out),
.IOB_out(IOB_0_out),
.IOA_oe(IOA_0_oe),
.IOB_oe(IOB_0_oe)
);
wire [7:0] psg_ch_a_1;
@ -154,12 +169,12 @@ jt03 ym2203_1
.fm_snd(opn_1),
.IOA_in(IOA_in),
.IOB_in(IOB_in),
.IOA_out(IOA_out),
.IOB_out(IOB_out),
.IOA_oe(IOA_oe),
.IOB_oe(IOB_oe)
.IOA_in(IOA_1_in),
.IOB_in(IOB_1_in),
.IOA_out(IOA_1_out),
.IOB_out(IOB_1_out),
.IOA_oe(IOA_1_oe),
.IOB_oe(IOB_1_oe)
);
assign DO = ay_select ? DO_1 : DO_0;

View File

@ -46,7 +46,7 @@ module tsconf
input [64:0] RTC,
input TAPE_IN,
output TAPE_OUT,
output MIDI_OUT,
output reg MIDI_OUT = 1'b0,
input UART_RX,
output UART_TX,
@ -1049,8 +1049,19 @@ module tsconf
wire [11:0] ts_l, ts_r;
wire [7:0] ts_do;
wire [7:0] ioa_out;
assign MIDI_OUT = ioa_out[2];
wire [7:0] ioa_0_out;
wire [7:0] ioa_1_out;
reg ioa_0_out_2_r = 1'b0, ioa_1_out_2_r = 1'b0;
always @(posedge fclk) begin
if (ioa_0_out_2_r != ioa_0_out[2]) begin
ioa_0_out_2_r <= ioa_0_out[2];
MIDI_OUT <= ioa_0_out[2];
end
if (ioa_1_out_2_r != ioa_1_out[2]) begin
ioa_1_out_2_r <= ioa_1_out[2];
MIDI_OUT <= ioa_1_out[2];
end
end
turbosound turbosound
(
@ -1063,7 +1074,8 @@ module tsconf
.DO(ts_do),
.CHANNEL_L(ts_l),
.CHANNEL_R(ts_r),
.IOA_out(ioa_out)
.IOA_0_out(ioa_0_out),
.IOA_1_out(ioa_1_out)
);