- remove single track CD fetching from HPS

- remove some useless debug options
This commit is contained in:
Robert Peip
2022-04-02 16:49:46 +02:00
parent 4f55ef9a38
commit 956a8c4b5d
6 changed files with 45 additions and 154 deletions

14
PSX.sv
View File

@@ -342,7 +342,7 @@ wire reset = RESET | buttons[1] | status[0] | bios_download | cart_download;
// 0 1 2 3 4 5 6
// 01234567890123456789012345678901 23456789012345678901234567890123
// 0123456789ABCDEFGHIJKLMNOPQRSTUV 0123456789ABCDEFGHIJKLMNOPQRSTUV
// XXXXX XXX XXXXXXXXXXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// XXXXX XXX XXXXXXXXXXXXXX XXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXX
`include "build_id.v"
parameter CONF_STR = {
@@ -406,19 +406,16 @@ parameter CONF_STR = {
"P3oP,Sync Video Out,Off,On;",
"P3oO,Sync Video Clock,Off,On;",
"P3OU,Sound,On,Off;",
"P3oA,SPU Reverb,On,Off;",
"P3OV,Fast Memory,Off,On;",
"P3oQ,Data Cache(Cheats Off),Off,On;",
"P3OJ,RepTimingGPU,Off,On;",
"P3OK,RepTimingDMA,Off,On;",
"P3oB,RepTimingSPUDMA,Off,On;",
"P3OQ,DMAinBLOCKs,Off,On;",
"P3oL,CD Singletrack,Off,On;",
"P3OL,CD Instant Seek,Off,On;",
"P3oK,CD Inserted,Yes,No;",
"P3OF,Force 60Hz PAL,Off,On;",
"P3OR,Textures,On,Off;",
"P3oM,Patch TTY,Off,On;",
//"P3oM,Patch TTY,Off,On;",
"P3T1,Advance Pause;",
"- ;",
@@ -771,24 +768,23 @@ psx
.pause(paused),
.loadExe(loadExe),
.fastboot(status[16]),
.FASTMEM(status[31]),
.FASTMEM(0),
.DATACACHEON(status[58]),
.REPRODUCIBLEGPUTIMING(status[19]),
.REPRODUCIBLEDMATIMING(status[20]),
.DMABLOCKATONCE(status[26]),
.multitrack(~status[53]),
.INSTANTSEEK(status[21]),
.ditherOff(status[22]),
.fpscountOn(status[28]),
.cdslowOn(status[59]),
.errorOn(~status[29]),
.PATCHSERIAL(status[54]),
.PATCHSERIAL(0), //.PATCHSERIAL(status[54]),
.noTexture(status[27]),
.syncVideoOut(syncVideoOut),
.syncInterlace(status[60]),
.SPUon(~status[30]),
.SPUSDRAM(status[44] & SDRAM2_EN),
.REVERBOFF(status[42]),
.REVERBOFF(0),
.REPRODUCIBLESPUDMA(status[43]),
.WIDESCREEN(status[61]),
// RAM/BIOS interface

View File

@@ -12,7 +12,6 @@ entity cd_top is
ce : in std_logic;
reset : in std_logic;
multitrack : in std_logic;
INSTANTSEEK : in std_logic;
hasCD : in std_logic;
newCD : in std_logic;
@@ -43,7 +42,7 @@ entity cd_top is
cd_hps_req : out std_logic := '0';
cd_hps_lba : out std_logic_vector(31 downto 0);
cd_hps_lba_sim : out std_logic_vector(31 downto 0);
cd_hps_lba_sim : out std_logic_vector(31 downto 0) := (others => '0');
cd_hps_ack : in std_logic;
cd_hps_write : in std_logic;
cd_hps_data : in std_logic_vector(15 downto 0);
@@ -398,17 +397,7 @@ architecture arch of cd_top is
TRACKSEARCH_CHECK
);
signal trackSearchState : ttrackSearchState := TRACKSEARCH_IDLE;
-- size calculation
signal lbaCount : integer range 0 to 524287;
signal cdSize_work : unsigned(29 downto 0);
signal lbaCount_work : integer range 0 to 524287;
signal cd_SecondsHigh : unsigned(3 downto 0);
signal cd_SecondsLow : unsigned(3 downto 0);
signal cd_MinutesHigh : unsigned(3 downto 0);
signal cd_MinutesLow : unsigned(3 downto 0);
signal writeSingletrack : std_logic := '0';
-- savestates
type t_ssarray is array(0 to 127) of std_logic_vector(31 downto 0);
signal ss_in : t_ssarray := (others => (others => '0'));
@@ -2167,18 +2156,12 @@ begin
when SFETCH_START =>
sectorFetchState <= SFETCH_HPSACK;
cd_hps_req <= '1';
if (positionInIndex >= 0) then
cd_hps_lba <= x"00" & std_logic_vector(to_unsigned(positionInIndex, 24));
cd_hps_lba_sim <= x"00" & std_logic_vector(to_unsigned(positionInIndex, 24));
else
cd_hps_lba <= x"00" & std_logic_vector(to_unsigned(0, 24));
cd_hps_lba_sim <= x"00" & std_logic_vector(to_unsigned(0, 24));
end if;
if (multitrack = '1') then
cd_hps_lba <= std_logic_vector(to_unsigned(lastReadSector, 32));
cd_hps_lba_sim(23 downto 0) <= std_logic_vector(to_unsigned(lastReadSector - startLBA, 24));
cd_hps_lba_sim(30 downto 24) <= trackNumber;
end if;
cd_hps_lba <= std_logic_vector(to_unsigned(lastReadSector, 32));
cd_hps_lba_sim <= (others => '0');
-- synthesis translate_off
cd_hps_lba_sim(23 downto 0) <= std_logic_vector(to_unsigned(lastReadSector - startLBA, 24));
cd_hps_lba_sim(31 downto 24) <= '0' & trackNumber;
-- synthesis translate_on
readSubchannel <= '1';
@@ -2716,22 +2699,6 @@ begin
end if;
end if;
if (writeSingletrack = '1') then
trackNumber <= "0000001";
trackcountBCD <= x"01";
isAudioCD <= '0';
totalSecondsBCD <= std_logic_vector(cd_SecondsHigh & cd_SecondsLow);
totalMinutesBCD <= std_logic_vector(cd_MinutesHigh & cd_MinutesLow);
trackInfo_DataA(18 downto 0) <= (others => '0');
trackInfo_DataA(37 downto 19) <= std_logic_vector(to_unsigned(lbaCount - 1, 19));
trackInfo_DataA(45 downto 38) <= x"02";
trackInfo_DataA(53 downto 46) <= x"00";
trackInfo_DataA(54) <= '0';
trackInfo_addrA <= "0000001";
trackInfo_wrenA <= '1';
end if;
end if;
end process;
@@ -2764,64 +2731,6 @@ begin
q_b => trackInfo_DataOutB
);
-- size calculation
process(clk1x)
begin
if (rising_edge(clk1x)) then
writeSingletrack <= '0';
if (newCD = '1') then
cdSize_work <= cdSize;
lbaCount <= 0;
lbaCount_work <= 0;
cd_SecondsHigh <= (others => '0');
cd_SecondsLow <= (others => '0');
cd_MinutesHigh <= (others => '0');
cd_MinutesLow <= (others => '0');
else
if (lbaCount_work >= FRAMES_PER_SECOND) then
lbaCount_work <= lbaCount_work - FRAMES_PER_SECOND;
if (cd_SecondsLow < 9) then
cd_SecondsLow <= cd_SecondsLow + 1;
else
cd_SecondsLow <= (others => '0');
if (cd_SecondsHigh < 5) then
cd_SecondsHigh <= cd_SecondsHigh + 1;
else
cd_SecondsHigh <= (others => '0');
if (cd_MinutesLow < 9) then
cd_MinutesLow <= cd_MinutesLow + 1;
else
cd_MinutesLow <= (others => '0');
cd_MinutesHigh <= cd_MinutesHigh + 1;
end if;
end if;
end if;
else
lbaCount_work <= 0;
end if;
if (lbaCount_work > 0 and lbaCount_work <= FRAMES_PER_SECOND) then
writeSingletrack <= not multitrack;
end if;
if (cdSize_work > 0) then
lbaCount <= lbaCount + 1;
if (cdSize_work > RAW_SECTOR_SIZE) then
cdSize_work <= cdSize_work - RAW_SECTOR_SIZE;
else
cdSize_work <= (others => '0');
lbaCount_work <= lbaCount + 1;
end if;
end if;
end if;
end if;
end process;
--##############################################################
--############################### savestates
--##############################################################

View File

@@ -208,21 +208,21 @@ architecture arch of gpu is
signal vramFill_requestFifo : std_logic;
signal vramFill_done : std_logic;
signal vramFill_CmdDone : std_logic;
--signal vramFill_CmdDone : std_logic;
signal vramFill_pixelColor : std_logic_vector(15 downto 0);
signal vramFill_pixelAddr : unsigned(19 downto 0);
signal vramFill_pixelWrite : std_logic;
signal cpu2vram_requestFifo : std_logic;
signal cpu2vram_done : std_logic;
signal cpu2vram_CmdDone : std_logic;
--signal cpu2vram_CmdDone : std_logic;
signal cpu2vram_pixelColor : std_logic_vector(15 downto 0);
signal cpu2vram_pixelAddr : unsigned(19 downto 0);
signal cpu2vram_pixelWrite : std_logic;
signal vram2vram_requestFifo : std_logic;
signal vram2vram_done : std_logic;
signal vram2vram_CmdDone : std_logic;
--signal vram2vram_CmdDone : std_logic;
signal vram2vram_pixelColor : std_logic_vector(15 downto 0);
signal vram2vram_pixelAddr : unsigned(19 downto 0);
signal vram2vram_pixelWrite : std_logic;
@@ -235,7 +235,7 @@ architecture arch of gpu is
signal vram2cpu_requestFifo : std_logic;
signal vram2cpu_done : std_logic;
signal vram2cpu_CmdDone : std_logic;
--signal vram2cpu_CmdDone : std_logic;
signal vram2cpu_reqVRAMEnable : std_logic;
signal vram2cpu_reqVRAMXPos : unsigned(9 downto 0);
signal vram2cpu_reqVRAMYPos : unsigned(8 downto 0);
@@ -249,7 +249,7 @@ architecture arch of gpu is
signal line_requestFifo : std_logic;
signal line_done : std_logic;
signal line_CmdDone : std_logic;
--signal line_CmdDone : std_logic;
signal line_div : t_div_array;
signal line_pipeline_new : std_logic;
signal line_pipeline_transparent : std_logic;
@@ -267,7 +267,7 @@ architecture arch of gpu is
signal rect_requestFifo : std_logic;
signal rect_done : std_logic;
signal rect_CmdDone : std_logic;
--signal rect_CmdDone : std_logic;
signal rect_pipeline_new : std_logic;
signal rect_pipeline_texture : std_logic;
signal rect_pipeline_transparent : std_logic;
@@ -291,7 +291,7 @@ architecture arch of gpu is
signal poly_requestFifo : std_logic;
signal poly_done : std_logic;
signal poly_CmdDone : std_logic;
--signal poly_CmdDone : std_logic;
signal poly_div : t_div_array;
signal poly_pipeline_new : std_logic;
signal poly_pipeline_texture : std_logic;
@@ -887,7 +887,7 @@ begin
fifo_data => fifoIn_Dout,
requestFifo => vramFill_requestFifo,
done => vramFill_done,
CmdDone => vramFill_CmdDone,
--CmdDone => vramFill_CmdDone,
pixelStall => pixelStall,
pixelColor => vramFill_pixelColor,
@@ -913,7 +913,7 @@ begin
fifo_data => fifoIn_Dout,
requestFifo => cpu2vram_requestFifo,
done => cpu2vram_done,
CmdDone => cpu2vram_CmdDone,
--CmdDone => cpu2vram_CmdDone,
pixelStall => pixelStall,
pixelColor => cpu2vram_pixelColor,
@@ -939,7 +939,7 @@ begin
fifo_data => fifoIn_Dout,
requestFifo => vram2vram_requestFifo,
done => vram2vram_done,
CmdDone => vram2vram_CmdDone,
--CmdDone => vram2vram_CmdDone,
requestVRAMEnable => vram2vram_reqVRAMEnable,
requestVRAMXPos => vram2vram_reqVRAMXPos,
@@ -983,7 +983,7 @@ begin
fifo_data => fifoIn_Dout,
requestFifo => vram2cpu_requestFifo,
done => vram2cpu_done,
CmdDone => vram2cpu_CmdDone,
--CmdDone => vram2cpu_CmdDone,
requestVRAMEnable => vram2cpu_reqVRAMEnable,
requestVRAMXPos => vram2cpu_reqVRAMXPos,
@@ -1046,7 +1046,7 @@ begin
fifo_data => fifoIn_Dout,
requestFifo => line_requestFifo,
done => line_done,
CmdDone => line_CmdDone,
--CmdDone => line_CmdDone,
requestVRAMEnable => line_reqVRAMEnable,
requestVRAMXPos => line_reqVRAMXPos,
@@ -1100,7 +1100,7 @@ begin
fifo_data => fifoIn_Dout,
requestFifo => rect_requestFifo,
done => rect_done,
CmdDone => rect_CmdDone,
--CmdDone => rect_CmdDone,
requestVRAMEnable => rect_reqVRAMEnable,
requestVRAMXPos => rect_reqVRAMXPos,
@@ -1169,7 +1169,7 @@ begin
fifo_data => fifoIn_Dout,
requestFifo => poly_requestFifo,
done => poly_done,
CmdDone => poly_CmdDone,
--CmdDone => poly_CmdDone,
requestVRAMEnable => poly_reqVRAMEnable,
requestVRAMXPos => poly_reqVRAMXPos,

View File

@@ -23,7 +23,6 @@ entity psx_mister is
REPRODUCIBLEGPUTIMING : in std_logic;
REPRODUCIBLEDMATIMING : in std_logic;
DMABLOCKATONCE : in std_logic;
multitrack : in std_logic;
INSTANTSEEK : in std_logic;
ditherOff : in std_logic;
fpscountOn : in std_logic;
@@ -229,7 +228,6 @@ begin
REPRODUCIBLEGPUTIMING => REPRODUCIBLEGPUTIMING,
REPRODUCIBLEDMATIMING => REPRODUCIBLEDMATIMING,
DMABLOCKATONCE => DMABLOCKATONCE,
multitrack => multitrack,
INSTANTSEEK => INSTANTSEEK,
ditherOff => ditherOff,
fpscountOn => fpscountOn,

View File

@@ -28,7 +28,6 @@ entity psx_top is
REPRODUCIBLEGPUTIMING : in std_logic;
REPRODUCIBLEDMATIMING : in std_logic;
DMABLOCKATONCE : in std_logic;
multitrack : in std_logic;
INSTANTSEEK : in std_logic;
ditherOff : in std_logic;
fpscountOn : in std_logic;
@@ -1201,7 +1200,6 @@ begin
ce => ce,
reset => reset_intern,
multitrack => multitrack,
INSTANTSEEK => INSTANTSEEK,
hasCD => hasCD,
newCD => newCD,

View File

@@ -164,8 +164,6 @@ architecture arch of etb is
signal trackinfo_addr : std_logic_vector(8 downto 0);
signal trackinfo_write : std_logic := '0';
signal multitrack : std_logic := '1';
-- spu
signal spuram_dataWrite : std_logic_vector(31 downto 0);
signal spuram_Adr : std_logic_vector(18 downto 0);
@@ -245,7 +243,6 @@ begin
REPRODUCIBLEGPUTIMING => '0',
REPRODUCIBLEDMATIMING => '0',
DMABLOCKATONCE => '0',
multitrack => multitrack,
INSTANTSEEK => '0',
ditherOff => '0',
fpscountOn => '0',
@@ -480,20 +477,18 @@ begin
variable count : integer;
begin
if (multitrack = '1') then
file_open(f_status, infile, "R:\cdtracks.txt", read_mode);
file_open(f_status, infile, "R:\cdtracks.txt", read_mode);
count := 1;
while (not endfile(infile)) loop
readline(infile,inLine);
tracknames(count) <= (others => ' ');
tracknames(count)(1 to inLine'length) <= inLine(1 to inLine'length);
count := count + 1;
end loop;
trackcount <= count;
file_close(infile);
end if;
count := 1;
while (not endfile(infile)) loop
readline(infile,inLine);
tracknames(count) <= (others => ' ');
tracknames(count)(1 to inLine'length) <= inLine(1 to inLine'length);
count := count + 1;
end loop;
trackcount <= count;
file_close(infile);
wait;
end process;
@@ -540,7 +535,7 @@ begin
end;
begin
if (cdLoaded = '0' and multitrack = '1') then
if (cdLoaded = '0') then
file_open(f_status, infile, "R:\\cuedata.bin", read_mode);
@@ -572,20 +567,15 @@ begin
wait until rising_edge(clk33);
if (cd_hps_req = '1' or (multitrack = '0' and cdLoaded = '0')) then
if (cd_hps_req = '1') then
-- load new track if required
if ((multitrack = '1' and cdTrack /= cd_hps_lba(31 downto 24)) or (multitrack = '0' and cdLoaded = '0')) then
if (cdTrack /= cd_hps_lba(31 downto 24)) then
if (multitrack = '1') then
cdTrack <= cd_hps_lba(31 downto 24);
report "Loading new File";
report tracknames(to_integer(unsigned(cd_hps_lba(31 downto 24))));
file_open(f_status, infile, tracknames(to_integer(unsigned(cd_hps_lba(31 downto 24)))), read_mode);
else
cdLoaded <= '1';
file_open(f_status, infile, "C:\Projekte\psx\WipEout (Europe) (Track 01).bin", read_mode);
end if;
cdTrack <= cd_hps_lba(31 downto 24);
report "Loading new File";
report tracknames(to_integer(unsigned(cd_hps_lba(31 downto 24))));
file_open(f_status, infile, tracknames(to_integer(unsigned(cd_hps_lba(31 downto 24)))), read_mode);
targetpos := 0;