From 958c9291d7daf34c95c3fd7c2f2e336ab7d3b2c3 Mon Sep 17 00:00:00 2001 From: Till Harbaum Date: Wed, 17 Oct 2018 21:10:47 +0200 Subject: [PATCH] Fix bidirectional port handling of YM2149 --- cores/mist/YM2149_volmix.vhd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cores/mist/YM2149_volmix.vhd b/cores/mist/YM2149_volmix.vhd index 2b30498..37441be 100644 --- a/cores/mist/YM2149_volmix.vhd +++ b/cores/mist/YM2149_volmix.vhd @@ -260,12 +260,13 @@ begin when x"E" => if (reg(7)(6) = '0') then -- input O_DA <= ioa_inreg; else - O_DA <= reg(14); -- read output reg + -- outputs have pullups and can still be driven low externally + O_DA <= reg(14) AND ioa_inreg; -- read output reg end if; when x"F" => if (reg(7)(7) = '0') then O_DA <= iob_inreg; else - O_DA <= reg(15); + O_DA <= reg(15) AND iob_inreg; end if; when others => null; end case; @@ -529,7 +530,7 @@ begin vol_table_in_r(11 downto 8) <= reg(10)(3 downto 0); else vol_table_in_l(11 downto 8) <= env_vol(4 downto 1); - vol_table_in_r(11 downto 8) <= env_vol(4 downto 1); + vol_table_in_r(11 downto 8) <= reg(10)(3 downto 0); end if; end if; end if;