Compare commits

..
12 Commits
Author SHA1 Message Date
Connor McLaughlin fac171fa95 CDVD: Check file actually opened before proceeding
If you loaded an invalid file, particularly with compression, the file
open may fail, leading to a division by zero (on block size), or trying
to read from nothing.
2021-12-18 13:41:56 +00:00
refractionpcsx2 fa1b6493da CDVD GZip: Correct type causing index creation to fail 2021-12-17 11:46:31 +00:00
refractionpcsx2 e58766745c Log: Restore BIOS Found message 2021-12-16 11:45:12 +00:00
Mrlinkwii d8a9c5b479 Gamedb add gamefixes to 'Titeuf Mega-compet' and patch 'Yamiyo ni Sasayaku - Tantei Sagara Kyouichirou' series 2021-12-15 17:17:18 +00:00
Mrlinkwii 9a4d8ba934 Gamedb: add more 2k games patches 2021-12-15 10:52:22 +00:00
refractionpcsx2 ab816543c8 CDVD: Fixed typo opening gzip files
Fixes #5162
2021-12-15 09:38:04 +00:00
refractionpcsx2 37ccd81985 GS: Avoid some unnecessary flushes
CLUT only updates if valid index type used in PSM
2021-12-14 18:28:21 +00:00
refractionpcsx2 42dad4ade8 GS: Check CLUT dirty write on vertex kick 2021-12-14 18:28:21 +00:00
refractionpcsx2 b2ac035862 VS: Fix location of shaders in project 2021-12-14 17:47:53 +00:00
refractionpcsx2 f42d7eec74 CDVD: Don't set as Reading when buffering. 2021-12-14 10:35:12 +00:00
refractionpcsx2 e4ef41f86a CDVD: Fix some read timing logic 2021-12-14 10:35:12 +00:00
Mrlinkwii 103dd3954a missing UI and game elements. 2021-12-14 09:22:31 +00:00
11 changed files with 123 additions and 80 deletions
+61
View File
@@ -9502,6 +9502,8 @@ SLES-51145:
SLES-51150:
name: "Scrabble Interactive - 2003 Edition"
region: "PAL-M3"
clampModes:
vuClampMode: 0 # Fixes missing UI and game elements.
SLES-51151:
name: "NHL 2003"
region: "PAL-M6"
@@ -12448,6 +12450,8 @@ SLES-52710:
SLES-52711:
name: "Titeuf Mega Compet"
region: "PAL-F"
gameFixes:
- GIFFIFOHack # Fixes corrupted textures.
patches:
958e5086:
content: |-
@@ -13131,6 +13135,14 @@ SLES-53021:
SLES-53022:
name: "ESPN NBA 2K5"
region: "PAL-E"
gameFixes:
- SkipMPEGHack # Fixes videos.
patches:
CA37B42E:
content: |-
author=Prafull
comment=fixes hang at start
patch=1,EE,0034DA98,word,00000000
SLES-53023:
name: "RTL Ski Jump 2005"
region: "PAL-E-G"
@@ -14549,6 +14561,12 @@ SLES-53686:
SLES-53687:
name: "NBA 2K6"
region: "PAL-M5"
patches:
04808D11:
content: |-
author=Prafull
comment=fixes hang at start
patch=1,EE,00441ff8,word,00000000
SLES-53689:
name: "World Poker Tour 2K6"
region: "PAL-M3"
@@ -15650,6 +15668,12 @@ SLES-54209:
SLES-54210:
name: "NBA 2K7"
region: "PAL-M5"
patches:
04808D11:
content: |-
author=Prafull
comment=fixes hang at start
patch=1,EE,0044f0f8,word,00000000
SLES-54211:
name: "NHL 2K7"
region: "PAL-M5"
@@ -25756,6 +25780,13 @@ SLPM-66294:
SLPM-66295:
name: "Yamiyo ni Sasayaku - Tantei Sagara Kyouichirou [Limited Edition]"
region: "NTSC-J"
patches:
23A9A026:
content: |-
author=PSI, Jelta
// Game does weird stack manipulation, causing data sent to the IOP to be corrupted unless EE data cache is enabled.
// This patch skips over the stack code, allowing the game to boot.
patch=1,EE,00156888,word,10000003
SLPM-66296:
name: "Yamiyo ni Sasayaku - Tantei Sagara Kyouichirou"
region: "NTSC-J"
@@ -26242,6 +26273,12 @@ SLPM-66450:
SLPM-66451:
name: "Major League Baseball 2K6"
region: "NTSC-J"
patches:
F0393708:
content: |-
author=Prafull
comment=fixes hang at start
patch=1,EE,0035d8b8,word,00000000
SLPM-66452:
name: "Kamaitachi no Yoru 3"
region: "NTSC-J"
@@ -39434,6 +39471,12 @@ SLUS-21560:
SLUS-21561:
name: "Major League Baseball 2K7"
region: "NTSC-U"
patches:
73D6D171:
content: |-
author=Prafull
comment=fixes hang at start
patch=1,EE,003CDE10,word,00000000
SLUS-21563:
name: "Horsez"
region: "NTSC-U"
@@ -40732,6 +40775,12 @@ SLUS-21870:
SLUS-21871:
name: "Major League Baseball 2K9"
region: "NTSC-U"
patches:
72905002:
content: |-
author=Prafull
comment=fixes hang at start
patch=1,EE,003CC5D8,word,00000000
SLUS-21872:
name: "MTV Pimp my Ride - Street Racing"
region: "NTSC-U"
@@ -41010,6 +41059,12 @@ SLUS-21944:
SLUS-21945:
name: "Major League Baseball 2K11"
region: "NTSC-U"
patches:
3D621C56:
content: |-
author=By Prafull
comment=fixes hang at start
patch=1,EE,003CFE58,word,00000000
SLUS-21946:
name: "Madden NFL 12"
region: "NTSC-U"
@@ -41032,6 +41087,12 @@ SLUS-21950:
SLUS-21951:
name: "Major League Baseball 2K12"
region: "NTSC-U"
patches:
C26C70A9:
content: |-
author=By Prafull
comment=fixes hang at start
patch=1,EE,003D4098,word,00000000
SLUS-21954:
name: "FIFA 13"
region: "NTSC-U" # Latin America with En,Fr,Es
+19 -42
View File
@@ -1038,7 +1038,7 @@ __fi void cdvdActionInterrupt()
cdvd.Spinning = true;
cdvd.Ready |= CDVD_DRIVE_READY; //check (rama)
cdvd.Sector = cdvd.SeekToSector;
cdvd.Status = CDVD_STATUS_READ;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.nextSectorsBuffered = 0;
cdvd.triggerDataReady = true;
CDVDSECTORREADY_INT(cdvd.ReadTime);
@@ -1049,7 +1049,7 @@ __fi void cdvdActionInterrupt()
cdvd.Spinning = true; //check (rama)
cdvd.Ready |= CDVD_DRIVE_READY; //check (rama)
cdvd.Sector = cdvd.SeekToSector;
cdvd.Status = CDVD_STATUS_READ;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.nextSectorsBuffered = 0;
cdvd.triggerDataReady = true;
CDVDSECTORREADY_INT(cdvd.ReadTime);
@@ -1103,18 +1103,8 @@ __fi void cdvdSectorReady()
}
}
if (cdvd.nextSectorsBuffered == 16 && (cdvd.Ready & CDVD_DRIVE_READY))
{
cdvd.Status = CDVD_STATUS_PAUSE; // Needed here but could be smth else than Pause (rama)
}
else
{
if (cdvd.nextSectorsBuffered < 16)
{
CDVDSECTORREADY_INT(cdvd.ReadTime);
cdvd.Status = CDVD_STATUS_READ;
}
}
if (cdvd.nextSectorsBuffered < 16)
CDVDSECTORREADY_INT(cdvd.ReadTime);
}
// inlined due to being referenced in only one place.
@@ -1139,14 +1129,10 @@ __fi void cdvdReadInterrupt()
cdvd.Reading = 1;
cdvd.Readed = 1;
cdvd.Sector = cdvd.SeekToSector;
CDVD_LOG("Cdvd Seek Complete > Scheduling block read interrupt at iopcycle=%8.8x.",
psxRegs.cycle + cdvd.ReadTime);
CDVDREAD_INT(cdvd.ReadTime);
cdvd.Status = CDVD_STATUS_READ;
return;
CDVD_LOG("Cdvd Seek Complete at iopcycle=%8.8x.", psxRegs.cycle);
}
else if (cdvd.Reading)
if (cdvd.Reading)
{
if (cdvd.RErr == 0)
{
@@ -1217,10 +1203,7 @@ __fi void cdvdReadInterrupt()
iopIntcIrq(2);
cdvd.Ready |= CDVD_DRIVE_READY;
if (cdvd.nextSectorsBuffered < 16)
cdvd.Status = CDVD_STATUS_READ;
else
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.nCommand = 0;
//DevCon.Warning("Scheduling interrupt in %d cycles", cdvd.ReadTime - ((cdvd.BlockSize / 4) * 12));
@@ -1300,6 +1283,7 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode)
// if delta > 0 it will read a new sector so the readInterrupt will account for this.
seektime = 0;
isSeeking = false;
if (delta == 0)
{
@@ -1324,24 +1308,16 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode)
}
else
{
CDVDSECTORREADY_INT(cdvd.ReadTime);
seektime = cdvd.ReadTime + ((cdvd.BlockSize / 4) * 12);
delta = 1; // Forces it to use the rotational delay since we have no sectors buffered and it isn't buffering any.
}
}
else
seektime = (cdvd.BlockSize / 4) * 12;
return (cdvd.BlockSize / 4) * 12;
}
else
{
if (delta < cdvd.nextSectorsBuffered)
{
isSeeking = false;
}
else
{
psxRegs.interrupt &= ~(1 << IopEvt_CdvdSectorReady);
cdvd.nextSectorsBuffered = 0;
}
psxRegs.interrupt &= ~(1 << IopEvt_CdvdSectorReady);
cdvd.nextSectorsBuffered = 0;
}
}
@@ -1354,8 +1330,9 @@ static uint cdvdStartSeek(uint newsector, CDVD_MODE_TYPE mode)
CDVDSECTORREADY_INT(seektime);
seektime += (cdvd.BlockSize / 4) * 12;
}
else if(cdvd.nCommand != N_CD_SEEK)
CDVDSECTORREADY_INT(seektime + ((cdvd.BlockSize / 4) * 12));
else
CDVDSECTORREADY_INT(seektime);
return seektime;
}
@@ -1633,7 +1610,7 @@ static void cdvdWrite04(u8 rt)
cdvdSetIrq();
cdvd.nCommand = 0;
//After Pausing needs to buffer the next sector
cdvd.Status = CDVD_STATUS_READ;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.nextSectorsBuffered = 0;
cdvd.triggerDataReady = true;
CDVDSECTORREADY_INT(cdvd.ReadTime);
@@ -1865,7 +1842,7 @@ static void cdvdWrite04(u8 rt)
HW_DMA3_CHCR &= ~0x01000000;
psxDmaInterrupt(3);
//After reading the TOC it needs to go back to buffer the next sector
cdvd.Status = CDVD_STATUS_READ;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.nextSectorsBuffered = 0;
cdvd.triggerDataReady = true;
CDVDSECTORREADY_INT(cdvd.ReadTime);
@@ -1882,7 +1859,7 @@ static void cdvdWrite04(u8 rt)
cdvdSetIrq();
cdvd.nCommand = 0;
//After reading the key it needs to go back to buffer the next sector
cdvd.Status = CDVD_STATUS_READ;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.nextSectorsBuffered = 0;
cdvd.triggerDataReady = true;
CDVDSECTORREADY_INT(cdvd.ReadTime);
+2 -2
View File
@@ -80,7 +80,7 @@ static void WriteIndexToFile(Access* index, const char* filename)
return;
}
auto fp = FileSystem::OpenManagedCFile(filename, "rb");
auto fp = FileSystem::OpenManagedCFile(filename, "wb");
if (!fp)
return;
@@ -300,7 +300,7 @@ bool GzippedFileReader::OkIndex()
// Try to read index from disk
const std::string indexfile(iso2indexname(m_filename));
if (indexfile.empty() == 0)
if (indexfile.empty())
return false; // iso2indexname(...) will print errors if it can't apply the template
if (FileSystem::FileExists(indexfile.c_str()) && (m_pIndex = ReadIndexFromFile(indexfile.c_str())))
+2 -1
View File
@@ -221,7 +221,8 @@ bool InputIsoFile::Open(std::string srcfile, bool testOnly)
m_reader = new FlatFileReader(EmuConfig.CdvdShareWrite);
}
m_reader->Open(m_filename);
if (!m_reader->Open(m_filename))
return false;
// It might actually be a blockdump file.
// Check that before continuing with the FlatFileReader.
+4 -3
View File
@@ -148,16 +148,17 @@ bool GSClut::WriteTest(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT)
__assume(0);
}
return m_write.IsDirty(TEX0, TEXCLUT);
// CLUT only reloads if PSM is a valid index type, avoid unnecessary flushes
return ((TEX0.PSM & 0x7) >= 3) && m_write.IsDirty(TEX0, TEXCLUT);
}
void GSClut::Write(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT)
{
m_write.TEX0 = TEX0;
m_write.TEXCLUT = TEXCLUT;
m_write.dirty = false;
m_read.dirty = true;
m_write.dirty = false;
(this->*m_wc[TEX0.CSM][TEX0.CPSM][TEX0.PSM])(TEX0, TEXCLUT);
}
+7 -2
View File
@@ -2546,8 +2546,13 @@ __forceinline void GSState::VertexKick(u32 skip)
__assume(0);
}
if (auto_flush && PRIM->TME && (m_context->FRAME.Block() == m_context->TEX0.TBP0))
FlushPrim();
if (m_context->FRAME.FBMSK != 0xFFFFFFFF)
{
m_mem.m_clut.Invalidate(m_context->FRAME.Block());
if (auto_flush && PRIM->TME && (m_context->FRAME.Block() == m_context->TEX0.TBP0))
FlushPrim();
}
}
void GSState::GetTextureMinMax(GSVector4i& r, const GIFRegTEX0& TEX0, const GIFRegCLAMP& CLAMP, bool linear)
-2
View File
@@ -1009,7 +1009,6 @@ void GSRendererHW::SwSpriteRender()
}
m_tc->InvalidateVideoMem(dpo, m_r);
m_mem.m_clut.Invalidate();
}
bool GSRendererHW::CanUseSwSpriteRender()
@@ -2279,7 +2278,6 @@ bool GSRendererHW::OI_PointListPalette(GSTexture* rt, GSTexture* ds, GSTextureCa
m_mem.WritePixel32(x, y, c, FBP, FBW);
}
m_tc->InvalidateVideoMem(m_context->offset.fb, m_r);
m_mem.m_clut.Invalidate();
return false;
}
return true;
-2
View File
@@ -578,8 +578,6 @@ void GSRendererSW::Queue(GSRingHeap::SharedPtr<GSRasterizerData>& item)
if (sd->global.sel.fwrite)
{
m_tc->InvalidatePages(sd->m_fb_pages, sd->m_fpsm);
m_mem.m_clut.Invalidate(m_context->FRAME.Block());
}
if (sd->global.sel.zwrite)
+13 -13
View File
@@ -71,19 +71,19 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="GS\res\glsl\common_header.glsl" />
<None Include="GS\res\glsl\convert.glsl" />
<None Include="GS\res\glsl\interlace.glsl" />
<None Include="GS\res\glsl\merge.glsl" />
<None Include="GS\res\glsl\shadeboost.glsl" />
<None Include="GS\res\glsl\tfx_fs.glsl" />
<None Include="GS\res\glsl\tfx_vgs.glsl" />
<None Include="GS\res\convert.fx" />
<None Include="GS\res\fxaa.fx" />
<None Include="GS\res\interlace.fx" />
<None Include="GS\res\merge.fx" />
<None Include="GS\res\shadeboost.fx" />
<None Include="GS\res\tfx.fx" />
<None Include="..\bin\resources\shaders\opengl\common_header.glsl" />
<None Include="..\bin\resources\shaders\opengl\convert.glsl" />
<None Include="..\bin\resources\shaders\opengl\interlace.glsl" />
<None Include="..\bin\resources\shaders\opengl\merge.glsl" />
<None Include="..\bin\resources\shaders\opengl\shadeboost.glsl" />
<None Include="..\bin\resources\shaders\opengl\tfx_fs.glsl" />
<None Include="..\bin\resources\shaders\opengl\tfx_vgs.glsl" />
<None Include="..\bin\resources\shaders\dx11\convert.fx" />
<None Include="..\bin\resources\shaders\common\fxaa.fx" />
<None Include="..\bin\resources\shaders\dx11\interlace.fx" />
<None Include="..\bin\resources\shaders\dx11\merge.fx" />
<None Include="..\bin\resources\shaders\dx11\shadeboost.fx" />
<None Include="..\bin\resources\shaders\dx11\tfx.fx" />
<None Include="PAD\Windows\Default.ini" />
<None Include="Utilities\folderdesc.txt" />
<None Include="Docs\License.txt" />
+13 -13
View File
@@ -330,43 +330,43 @@
<None Include="PAD\Windows\Default.ini">
<Filter>System\Ps2\PAD</Filter>
</None>
<None Include="GS\res\glsl\common_header.glsl">
<None Include="..\bin\resources\shaders\opengl\common_header.glsl">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\glsl\convert.glsl">
<None Include="..\bin\resources\shaders\opengl\convert.glsl">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\glsl\interlace.glsl">
<None Include="..\bin\resources\shaders\opengl\interlace.glsl">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\glsl\merge.glsl">
<None Include="..\bin\resources\shaders\opengl\merge.glsl">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\glsl\shadeboost.glsl">
<None Include="..\bin\resources\shaders\opengl\shadeboost.glsl">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\glsl\tfx_fs.glsl">
<None Include="..\bin\resources\shaders\opengl\tfx_fs.glsl">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\glsl\tfx_vgs.glsl">
<None Include="..\bin\resources\shaders\opengl\tfx_vgs.glsl">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\convert.fx">
<None Include="..\bin\resources\shaders\dx11\convert.fx">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\fxaa.fx">
<None Include="..\bin\resources\shaders\common\fxaa.fx">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\interlace.fx">
<None Include="..\bin\resources\shaders\dx11\interlace.fx">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\merge.fx">
<None Include="..\bin\resources\shaders\dx11\merge.fx">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\shadeboost.fx">
<None Include="..\bin\resources\shaders\dx11\shadeboost.fx">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
<None Include="GS\res\tfx.fx">
<None Include="..\bin\resources\shaders\dx11\tfx.fx">
<Filter>System\Ps2\GS\Shaders</Filter>
</None>
</ItemGroup>
+2
View File
@@ -119,6 +119,8 @@ static bool LoadBiosVersion(std::FILE* fp, u32& version, std::string& descriptio
version = strtol(vermaj, (char**)NULL, 0) << 8;
version |= strtol(vermin, (char**)NULL, 0);
foundRomVer = true;
Console.WriteLn("Bios Found: %s", description.c_str());
}
if ((rd.fileSize % 0x10) == 0)