Skip to content
Permalink
Browse files

Fixed audio issues caused by accessing APU in turbo mode. Fixes Super…

… R-Type
  • Loading branch information
originalgrego committed May 25, 2019
1 parent 3652c5b commit 811642c5e3fadeb71eaaacabb68fd065e47269bc
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/CPU.vhd
@@ -78,6 +78,7 @@ architecture rtl of SCPU is
signal P65_EN : std_logic;
signal P65_VPA, P65_VDA : std_logic;
signal P65_BRK : std_logic;
signal P65_BANK: std_logic_vector(7 downto 0);

type speed_t is (
XSLOW,
@@ -231,14 +232,16 @@ architecture rtl of SCPU is

begin

DMA_ACTIVE <= DMA_RUN or HDMA_RUN;
DMA_ACTIVE <= DMA_RUN or HDMA_RUN;
P65_BANK <= P65_A(23 downto 16);

process( SPEED, MEMSEL, REFRESHED, CPU_ACTIVEr, TURBO )
begin
CPU_MID_CLOCK <= x"2";
DMA_MID_CLOCK <= "011";
DMA_LAST_CLOCK <= "111";
if TURBO = '1' then
DMA_LAST_CLOCK <= "111";
-- No turbo while accessing APU ports $2140-$2143 in banks $00-$3F and their mirrors at $80-$BF
if TURBO = '1' and not (P65_A(15 downto 4) = x"214" and (P65_BANK < x"40" or (P65_BANK > x"7F" and P65_BANK < x"C0"))) then
CPU_LAST_CLOCK <= x"3";
CPU_MID_CLOCK <= x"1";
DMA_LAST_CLOCK <= "011";

0 comments on commit 811642c

Please sign in to comment.
You can’t perform that action at this time.