1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-04-16 07:56:43 +00:00

YM2149: choose between IO port handling modes

This commit is contained in:
Gyorgy Szombathelyi
2020-10-24 21:14:04 +02:00
parent 353b7bb607
commit c1210c4fc8

View File

@@ -62,7 +62,8 @@ library ieee;
entity YM2149 is
generic (
MIXER_VOLTABLE : std_logic := '0'
MIXER_VOLTABLE : std_logic := '0';
IO_OUT_READ_IN : std_logic := '1'
);
port (
-- data bus
@@ -246,15 +247,15 @@ begin
when x"B" => O_DA <= reg(11);
when x"C" => O_DA <= reg(12);
when x"D" => O_DA <= "0000" & reg(13)(3 downto 0);
when x"E" => if (reg(7)(6) = '0') then -- input
when x"E" => if reg(7)(6) = '0' or IO_OUT_READ_IN = '1' then -- input
O_DA <= ioa_inreg;
else
O_DA <= reg(14) and ioa_inreg; -- read output reg
O_DA <= reg(14); -- read output reg
end if;
when x"F" => if (Reg(7)(7) = '0') then
when x"F" => if Reg(7)(7) = '0' or IO_OUT_READ_IN = '1' then
O_DA <= iob_inreg;
else
O_DA <= reg(15) and iob_inreg;
O_DA <= reg(15);
end if;
when others => null;
end case;