Skip to content

Commit

Permalink
GS/HW: Adjust Barnyard fix for Jurassic Park and Nicktoons Unite
Browse files Browse the repository at this point in the history
Draws its mipmaps at runtime in a very similar way, except with 24-bit
textures as well as 16/32-bit.
  • Loading branch information
stenzek authored and refractionpcsx2 committed Jan 11, 2023
1 parent fa75006 commit 4cf7a10
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 25 deletions.
50 changes: 33 additions & 17 deletions bin/resources/GameIndex.yaml
Expand Up @@ -5308,7 +5308,7 @@ SCKA-20096:
halfPixelOffset: 2 # Fix text and post blur.
mipmap: 2 # Base mip level isn't always used.
autoFlush: 1 # Needed for recursive mipmap rendering.
getSkipCount: "GSC_Barnyard" # Render mipmaps on the CPU.
getSkipCount: "GSC_BlueTongueGames" # Render mipmaps on the CPU.
SCKA-20098:
name: "Nickelodeon SpongeBob SquarePants - Creature from the Krusty Krab"
region: "NTSC-K"
Expand Down Expand Up @@ -12484,9 +12484,11 @@ SLES-51354:
region: "PAL-M5"
compat: 5
gsHWFixes:
autoFlush: 1 # Fixes glows.
mipmap: 1 # Better characters and environment but has a texture cache issue that makes it worse.
autoFlush: 1 # Fixes glows. Also needed for recursive mipmap rendering.
mipmap: 2 # Better characters and environment but has a texture cache issue that makes it worse.
trilinearFiltering: 1 # Using mipmaps, so may as well.
textureInsideRT: 1 # Fixes rainbow lighting for some areas.
getSkipCount: "GSC_BlueTongueGames" # Mipmap rendering on CPU.
SLES-51355:
name: "Big Mutha Truckers"
region: "PAL-M5"
Expand Down Expand Up @@ -17729,9 +17731,11 @@ SLES-53634:
name: "Nicktoons Unite!"
region: "PAL-A"
gsHWFixes:
autoFlush: 1 # Fixes glows.
mipmap: 1 # Better characters and environment but has a texture cache issue that makes it worse.
textureInsideRT: 1 # Fixes rainbow lighting for lamps, computer and other areas.
autoFlush: 1 # Fixes glows. Also needed for recursive mipmap rendering.
mipmap: 2 # Better characters and environment but has a texture cache issue that makes it worse.
trilinearFiltering: 1 # Using mipmaps, so may as well.
textureInsideRT: 1 # Fixes rainbow lighting for some areas.
getSkipCount: "GSC_BlueTongueGames" # Mipmap rendering on CPU.
SLES-53635:
name: "NASCAR '06 - Total Team Control"
region: "PAL-E"
Expand Down Expand Up @@ -19600,23 +19604,23 @@ SLES-54376:
halfPixelOffset: 2 # Fix text and post blur.
mipmap: 2 # Base mip level isn't always used.
autoFlush: 1 # Needed for recursive mipmap rendering.
getSkipCount: "GSC_Barnyard" # Render mipmaps on the CPU.
getSkipCount: "GSC_BlueTongueGames" # Render mipmaps on the CPU.
SLES-54377:
name: "Barnyard"
region: "PAL-G"
gsHWFixes:
halfPixelOffset: 2 # Fix text and post blur.
mipmap: 2 # Base mip level isn't always used.
autoFlush: 1 # Needed for recursive mipmap rendering.
getSkipCount: "GSC_Barnyard" # Render mipmaps on the CPU.
getSkipCount: "GSC_BlueTongueGames" # Render mipmaps on the CPU.
SLES-54378:
name: "Barnyard"
region: "PAL-M4"
gsHWFixes:
halfPixelOffset: 2 # Fix text and post blur.
mipmap: 2 # Base mip level isn't always used.
autoFlush: 1 # Needed for recursive mipmap rendering.
getSkipCount: "GSC_Barnyard" # Render mipmaps on the CPU.
getSkipCount: "GSC_BlueTongueGames" # Render mipmaps on the CPU.
SLES-54379:
name: "NFL Street 3"
region: "PAL-E"
Expand Down Expand Up @@ -25967,6 +25971,12 @@ SLPM-62345:
SLPM-62346:
name: "Keiei Simulation - Jurassic Park [Konami the Best]"
region: "NTSC-J"
gsHWFixes:
autoFlush: 1 # Fixes glows. Also needed for recursive mipmap rendering.
mipmap: 2 # Better characters and environment but has a texture cache issue that makes it worse.
trilinearFiltering: 1 # Using mipmaps, so may as well.
textureInsideRT: 1 # Fixes rainbow lighting for some areas.
getSkipCount: "GSC_BlueTongueGames" # Mipmap rendering on CPU.
SLPM-62348:
name: "Mechsmith, The - Rum"
region: "NTSC-J"
Expand Down Expand Up @@ -26443,9 +26453,11 @@ SLPM-62512:
name: "Keiei Simulation - Jurassic Park [Konami The Best]"
region: "NTSC-J"
gsHWFixes:
autoFlush: 1 # Fixes glows.
mipmap: 1 # Better characters and environment but has a texture cache issue that makes it worse.
autoFlush: 1 # Fixes glows. Also needed for recursive mipmap rendering.
mipmap: 2 # Better characters and environment but has a texture cache issue that makes it worse.
trilinearFiltering: 1 # Using mipmaps, so may as well.
textureInsideRT: 1 # Fixes rainbow lighting for some areas.
getSkipCount: "GSC_BlueTongueGames" # Mipmap rendering on CPU.
SLPM-62513:
name: "Harry Potter and the Chamber of Secrets [EA Best Hits]"
region: "NTSC-J"
Expand Down Expand Up @@ -41933,9 +41945,11 @@ SLUS-20380:
name: "Jurassic Park - Operation Genesis"
region: "NTSC-U"
gsHWFixes:
autoFlush: 1 # Fixes glows.
mipmap: 1 # Better characters and environment but has a texture cache issue that makes it worse.
autoFlush: 1 # Fixes glows. Also needed for recursive mipmap rendering.
mipmap: 2 # Better characters and environment but has a texture cache issue that makes it worse.
trilinearFiltering: 1 # Using mipmaps, so may as well.
textureInsideRT: 1 # Fixes rainbow lighting for some areas.
getSkipCount: "GSC_BlueTongueGames" # Mipmap rendering on CPU.
SLUS-20381:
name: "MX SuperFly"
region: "NTSC-U"
Expand Down Expand Up @@ -46462,7 +46476,7 @@ SLUS-21277:
halfPixelOffset: 2 # Fix text and post blur.
mipmap: 2 # Base mip level isn't always used.
autoFlush: 1 # Needed for recursive mipmap rendering.
getSkipCount: "GSC_Barnyard" # Render mipmaps on the CPU.
getSkipCount: "GSC_BlueTongueGames" # Render mipmaps on the CPU.
SLUS-21278:
name: "SSX on Tour"
region: "NTSC-U"
Expand Down Expand Up @@ -46493,9 +46507,11 @@ SLUS-21284:
name: "Nicktoons Unite!"
region: "NTSC-U"
gsHWFixes:
autoFlush: 1 # Fixes glows.
mipmap: 1 # Better characters and environment but has a texture cache issue that makes it worse.
textureInsideRT: 1 # Fixes rainbow lighting for lamps, computer and other areas.
autoFlush: 1 # Fixes glows. Also needed for recursive mipmap rendering.
mipmap: 2 # Better characters and environment but has a texture cache issue that makes it worse.
trilinearFiltering: 1 # Using mipmaps, so may as well.
textureInsideRT: 1 # Fixes rainbow lighting for some areas.
getSkipCount: "GSC_BlueTongueGames" # Mipmap rendering on CPU.
SLUS-21285:
name: "Ultimate Spider-Man [Limited Edition]"
region: "NTSC-U"
Expand Down
15 changes: 8 additions & 7 deletions pcsx2/GS/Renderers/HW/GSHwHack.cpp
Expand Up @@ -802,23 +802,24 @@ bool GSHwHack::GSC_XenosagaE3(GSRendererHW& r, const GSFrameInfo& fi, int& skip)
return true;
}

bool GSHwHack::GSC_Barnyard(GSRendererHW& r, const GSFrameInfo& fi, int& skip)
bool GSHwHack::GSC_BlueTongueGames(GSRendererHW& r, const GSFrameInfo& fi, int& skip)
{
GSDrawingContext* context = r.m_context;

// Whoever wrote this was kinda nuts. They draw a stipple/dither pattern to a framebuffer, then reuse that as
// the depth buffer. Textures are then drawn repeatedly on top of one another, each with a slight offset.
// Depth testing is enabled, and that determines which pixels make it into the final texture. Kinda like an
// attempt at anti-aliasing or adding more detail to the textures?
// attempt at anti-aliasing or adding more detail to the textures? Or, a way to get more colours..

// The size of these textures varies quite a bit. 16-bit, 24-bit and 32-bit formats are all used.
// The ones we need to take care of here, are the textures which use mipmaps. Those get drawn recursively, mip
// levels are then drawn to the right of the base texture. And we can't handle that in the texture cache. So
// we'll limit to 16/32-bit, going up to 320 wide. Some font textures are 1024x1024, we don't really want to
// be rasterizing that on the CPU.
// we'll limit to 16/24/32-bit, going up to 320 wide. Some font textures are 1024x1024, we don't really want
// to be rasterizing that on the CPU.

// Catch the mipmap draws.
if ((context->FRAME.PSM == PSM_PSMCT16S || context->FRAME.PSM == PSM_PSMCT32) && context->FRAME.FBW <= 5)
// Catch the mipmap draws. Barnyard only uses 16/32-bit, Jurassic Park uses 24-bit.
// Also used for Nicktoons Unite, same engine it appears.
if ((context->FRAME.PSM == PSM_PSMCT16S || context->FRAME.PSM <= PSM_PSMCT24) && context->FRAME.FBW <= 5)
{
r.SwPrimRender(r, true);
skip = 1;
Expand Down Expand Up @@ -1276,7 +1277,7 @@ const GSHwHack::Entry<GSRendererHW::GSC_Ptr> GSHwHack::s_get_skip_count_function
CRC_F(GSC_UrbanReign, CRCHackLevel::Partial),
CRC_F(GSC_ZettaiZetsumeiToshi2, CRCHackLevel::Partial),
CRC_F(GSC_BlackAndBurnoutSky, CRCHackLevel::Partial),
CRC_F(GSC_Barnyard, CRCHackLevel::Partial),
CRC_F(GSC_BlueTongueGames, CRCHackLevel::Partial),
CRC_F(GSC_Battlefield2, CRCHackLevel::Partial),

// Channel Effect
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/GS/Renderers/HW/GSHwHack.h
Expand Up @@ -55,7 +55,7 @@ class GSHwHack
static bool GSC_RedDeadRevolver(GSRendererHW& r, const GSFrameInfo& fi, int& skip);
static bool GSC_ShinOnimusha(GSRendererHW& r, const GSFrameInfo& fi, int& skip);
static bool GSC_XenosagaE3(GSRendererHW& r, const GSFrameInfo& fi, int& skip);
static bool GSC_Barnyard(GSRendererHW& r, const GSFrameInfo& fi, int& skip);
static bool GSC_BlueTongueGames(GSRendererHW& r, const GSFrameInfo& fi, int& skip);
static bool GSC_Battlefield2(GSRendererHW& r, const GSFrameInfo& fi, int& skip);

static bool OI_PointListPalette(GSRendererHW& r, GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t);
Expand Down

0 comments on commit 4cf7a10

Please sign in to comment.