Skip to content

Commit

Permalink
Fixed audio issues caused by accessing APU in turbo mode. Fixes Super…
Browse files Browse the repository at this point in the history
… R-Type
  • Loading branch information
originalgrego committed May 25, 2019
1 parent 3652c5b commit 811642c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/CPU.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 811642c

Please sign in to comment.