Skip to content

Commit

Permalink
cd: new command will stop working commands(fixes wipeout xl cd info r…
Browse files Browse the repository at this point in the history
…eadout -> track 9)

cd: new command will always overwrite old command
  • Loading branch information
RobertPeip committed May 8, 2022
1 parent 65d4c2c commit 5bcbc71
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions rtl/cd_top.vhd
Expand Up @@ -788,7 +788,6 @@ begin
-- command processing
process(clk1x)
variable paramCountNew : integer range 0 to 6;
variable skipCmd : std_logic;
begin
if (rising_edge(clk1x)) then

Expand Down Expand Up @@ -854,7 +853,6 @@ begin
-- receive new command request or decrease wait timer on pending command
if (beginCommand = '1') then

skipCmd := '0';
case (newCmd) is
when x"02" => paramCountNew := 3; --Setloc
when x"0D" => paramCountNew := 2; --SetFilter
Expand All @@ -869,33 +867,32 @@ begin

if (cmdPending = '1' and paramCount > paramCountNew) then
FifoParam_reset <= '1';
skipCmd := '1';
end if;

working <= '0'; -- second response from reset will interfere with command (e.g. wipeout xl)

if (skipCmd = '0') then
cmdPending <= '1';
cmd_busy <= '1';
if (driveState = DRIVE_OPENING) then
cmd_delay <= 15000 - 2;
else
cmd_delay <= 25000 - 2;
end if;
if (newCmd = x"1C") then -- init
cmd_delay <= 120000 - 2;
end if;
cmdPending <= '1';
cmd_busy <= '1';
if (driveState = DRIVE_OPENING) then
cmd_delay <= 15000 - 2;
else
cmd_delay <= 25000 - 2;
end if;
if (newCmd = x"1C") then -- init
cmd_delay <= 120000 - 2;
end if;

nextCmd <= newCmd;
paramCount <= paramCountNew;

if (driveState = DRIVE_IDLE and internalStatus(1) = '1' and newCmd = x"11") then
updatePhysicalPosition <= '1';
end if;

if (CDROM_IRQFLAG /= "00000") then
cmd_busy <= '0';
end if;
nextCmd <= newCmd;
paramCount <= paramCountNew;

if (driveState = DRIVE_IDLE and internalStatus(1) = '1' and newCmd = x"11") then
updatePhysicalPosition <= '1';
end if;

if (CDROM_IRQFLAG /= "00000") then
cmd_busy <= '0';
end if;

elsif (pause_cmd = '1') then
cmd_busy <= '0';
if (cmd_busy = '1') then
Expand Down

0 comments on commit 5bcbc71

Please sign in to comment.