mirror of https://github.com/PCSX2/pcsx2.git
GameDB: Add PCRTC and blending HW fixes
This commit is contained in:
parent
c35092504c
commit
7df189ced4
|
@ -614,6 +614,7 @@ struct Pcsx2Config
|
||||||
{
|
{
|
||||||
static const char* AspectRatioNames[];
|
static const char* AspectRatioNames[];
|
||||||
static const char* FMVAspectRatioSwitchNames[];
|
static const char* FMVAspectRatioSwitchNames[];
|
||||||
|
static const char* BlendingLevelNames[];
|
||||||
static const char* CaptureContainers[];
|
static const char* CaptureContainers[];
|
||||||
|
|
||||||
static const char* GetRendererName(GSRendererType type);
|
static const char* GetRendererName(GSRendererType type);
|
||||||
|
|
|
@ -181,6 +181,16 @@
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"maximum": 1
|
"maximum": 1
|
||||||
},
|
},
|
||||||
|
"PCRTCOffsets": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 1
|
||||||
|
},
|
||||||
|
"PCRTCOverscan": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 1
|
||||||
|
},
|
||||||
"mipmap": {
|
"mipmap": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
|
@ -246,6 +256,21 @@
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"maximum": 2
|
"maximum": 2
|
||||||
},
|
},
|
||||||
|
"minimumBlendingLevel": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 5
|
||||||
|
},
|
||||||
|
"maximumBlendingLevel": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 5
|
||||||
|
},
|
||||||
|
"recommendedBlendingLevel": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 5
|
||||||
|
},
|
||||||
"getSkipCount": {
|
"getSkipCount": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "GameDatabase.h"
|
#include "GameDatabase.h"
|
||||||
#include "GS/GS.h"
|
#include "GS/GS.h"
|
||||||
#include "Host.h"
|
#include "Host.h"
|
||||||
|
#include "IconsFontAwesome5.h"
|
||||||
#include "vtlb.h"
|
#include "vtlb.h"
|
||||||
|
|
||||||
#include "common/FileSystem.h"
|
#include "common/FileSystem.h"
|
||||||
|
@ -353,6 +354,8 @@ static const char* s_gs_hw_fix_names[] = {
|
||||||
"mergeSprite",
|
"mergeSprite",
|
||||||
"wildArmsHack",
|
"wildArmsHack",
|
||||||
"estimateTextureRegion",
|
"estimateTextureRegion",
|
||||||
|
"PCRTCOffsets",
|
||||||
|
"PCRTCOverscan",
|
||||||
"mipmap",
|
"mipmap",
|
||||||
"trilinearFiltering",
|
"trilinearFiltering",
|
||||||
"skipDrawStart",
|
"skipDrawStart",
|
||||||
|
@ -366,8 +369,11 @@ static const char* s_gs_hw_fix_names[] = {
|
||||||
"cpuCLUTRender",
|
"cpuCLUTRender",
|
||||||
"gpuTargetCLUT",
|
"gpuTargetCLUT",
|
||||||
"gpuPaletteConversion",
|
"gpuPaletteConversion",
|
||||||
|
"minimumBlendingLevel",
|
||||||
|
"maximumBlendingLevel",
|
||||||
|
"recommendedBlendingLevel",
|
||||||
"getSkipCount",
|
"getSkipCount",
|
||||||
"beforeDraw",
|
"beforeDraw"
|
||||||
};
|
};
|
||||||
static_assert(std::size(s_gs_hw_fix_names) == static_cast<u32>(GameDatabaseSchema::GSHWFixId::Count), "HW fix name lookup is correct size");
|
static_assert(std::size(s_gs_hw_fix_names) == static_cast<u32>(GameDatabaseSchema::GSHWFixId::Count), "HW fix name lookup is correct size");
|
||||||
|
|
||||||
|
@ -395,6 +401,11 @@ bool GameDatabaseSchema::isUserHackHWFix(GSHWFixId id)
|
||||||
case GSHWFixId::Mipmap:
|
case GSHWFixId::Mipmap:
|
||||||
case GSHWFixId::TexturePreloading:
|
case GSHWFixId::TexturePreloading:
|
||||||
case GSHWFixId::TrilinearFiltering:
|
case GSHWFixId::TrilinearFiltering:
|
||||||
|
case GSHWFixId::MinimumBlendingLevel:
|
||||||
|
case GSHWFixId::MaximumBlendingLevel:
|
||||||
|
case GSHWFixId::RecommendedBlendingLevel:
|
||||||
|
case GSHWFixId::PCRTCOffsets:
|
||||||
|
case GSHWFixId::PCRTCOverscan:
|
||||||
case GSHWFixId::GetSkipCount:
|
case GSHWFixId::GetSkipCount:
|
||||||
case GSHWFixId::BeforeDraw:
|
case GSHWFixId::BeforeDraw:
|
||||||
return false;
|
return false;
|
||||||
|
@ -584,6 +595,12 @@ bool GameDatabaseSchema::GameEntry::configMatchesHWFix(const Pcsx2Config::GSOpti
|
||||||
case GSHWFixId::EstimateTextureRegion:
|
case GSHWFixId::EstimateTextureRegion:
|
||||||
return (static_cast<int>(config.UserHacks_EstimateTextureRegion) == value);
|
return (static_cast<int>(config.UserHacks_EstimateTextureRegion) == value);
|
||||||
|
|
||||||
|
case GSHWFixId::PCRTCOffsets:
|
||||||
|
return (static_cast<int>(config.PCRTCOffsets) == value);
|
||||||
|
|
||||||
|
case GSHWFixId::PCRTCOverscan:
|
||||||
|
return (static_cast<int>(config.PCRTCOverscan) == value);
|
||||||
|
|
||||||
case GSHWFixId::Mipmap:
|
case GSHWFixId::Mipmap:
|
||||||
return (config.HWMipmap == HWMipmapLevel::Automatic || static_cast<int>(config.HWMipmap) == value);
|
return (config.HWMipmap == HWMipmapLevel::Automatic || static_cast<int>(config.HWMipmap) == value);
|
||||||
|
|
||||||
|
@ -623,6 +640,15 @@ bool GameDatabaseSchema::GameEntry::configMatchesHWFix(const Pcsx2Config::GSOpti
|
||||||
case GSHWFixId::GPUPaletteConversion:
|
case GSHWFixId::GPUPaletteConversion:
|
||||||
return (config.GPUPaletteConversion == ((value > 1) ? (config.TexturePreloading == TexturePreloadingLevel::Full) : (value != 0)));
|
return (config.GPUPaletteConversion == ((value > 1) ? (config.TexturePreloading == TexturePreloadingLevel::Full) : (value != 0)));
|
||||||
|
|
||||||
|
case GSHWFixId::MinimumBlendingLevel:
|
||||||
|
return (static_cast<int>(config.AccurateBlendingUnit) >= value);
|
||||||
|
|
||||||
|
case GSHWFixId::MaximumBlendingLevel:
|
||||||
|
return (static_cast<int>(config.AccurateBlendingUnit) <= value);
|
||||||
|
|
||||||
|
case GSHWFixId::RecommendedBlendingLevel:
|
||||||
|
return true;
|
||||||
|
|
||||||
case GSHWFixId::GetSkipCount:
|
case GSHWFixId::GetSkipCount:
|
||||||
return (static_cast<int>(config.GetSkipCountFunctionId) == value);
|
return (static_cast<int>(config.GetSkipCountFunctionId) == value);
|
||||||
|
|
||||||
|
@ -713,6 +739,14 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
|
||||||
config.UserHacks_EstimateTextureRegion = (value > 0);
|
config.UserHacks_EstimateTextureRegion = (value > 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GSHWFixId::PCRTCOffsets:
|
||||||
|
config.PCRTCOffsets = (value > 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GSHWFixId::PCRTCOverscan:
|
||||||
|
config.PCRTCOverscan = (value > 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case GSHWFixId::Mipmap:
|
case GSHWFixId::Mipmap:
|
||||||
{
|
{
|
||||||
if (value >= 0 && value <= static_cast<int>(HWMipmapLevel::Full))
|
if (value >= 0 && value <= static_cast<int>(HWMipmapLevel::Full))
|
||||||
|
@ -801,6 +835,40 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GSHWFixId::MinimumBlendingLevel:
|
||||||
|
{
|
||||||
|
if (value >= 0 && value <= static_cast<int>(AccBlendLevel::Maximum))
|
||||||
|
config.AccurateBlendingUnit = std::max(config.AccurateBlendingUnit, static_cast<AccBlendLevel>(value));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GSHWFixId::MaximumBlendingLevel:
|
||||||
|
{
|
||||||
|
if (value >= 0 && value <= static_cast<int>(AccBlendLevel::Maximum))
|
||||||
|
config.AccurateBlendingUnit = std::min(config.AccurateBlendingUnit, static_cast<AccBlendLevel>(value));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GSHWFixId::RecommendedBlendingLevel:
|
||||||
|
{
|
||||||
|
if (value >= 0 && value <= static_cast<int>(AccBlendLevel::Maximum) && static_cast<int>(GSConfig.AccurateBlendingUnit) < value)
|
||||||
|
{
|
||||||
|
Host::AddKeyedOSDMessage("HWBlendingWarning",
|
||||||
|
fmt::format(ICON_FA_PAINT_BRUSH " Current Blending Accuracy is {}.\n"
|
||||||
|
"Recommended Blending Accuracy for this game is {}.\n"
|
||||||
|
"You can adjust the blending level in Game Properties to improve\n"
|
||||||
|
"graphical quality, but this will increase system requirements.",
|
||||||
|
Pcsx2Config::GSOptions::BlendingLevelNames[static_cast<int>(GSConfig.AccurateBlendingUnit)],
|
||||||
|
Pcsx2Config::GSOptions::BlendingLevelNames[value]),
|
||||||
|
Host::OSD_WARNING_DURATION);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Host::RemoveKeyedOSDMessage("HWBlendingWarning");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case GSHWFixId::GetSkipCount:
|
case GSHWFixId::GetSkipCount:
|
||||||
config.GetSkipCountFunctionId = static_cast<s16>(value);
|
config.GetSkipCountFunctionId = static_cast<s16>(value);
|
||||||
break;
|
break;
|
||||||
|
@ -823,7 +891,7 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions&
|
||||||
if (!disabled_fixes.empty())
|
if (!disabled_fixes.empty())
|
||||||
{
|
{
|
||||||
Host::AddKeyedOSDMessage("HWFixesWarning",
|
Host::AddKeyedOSDMessage("HWFixesWarning",
|
||||||
fmt::format("Manual GS hardware renderer fixes are enabled, automatic fixes were not applied:\n{}",
|
fmt::format(ICON_FA_MAGIC " Manual GS hardware renderer fixes are enabled, automatic fixes were not applied:\n{}",
|
||||||
disabled_fixes),
|
disabled_fixes),
|
||||||
Host::OSD_ERROR_DURATION);
|
Host::OSD_ERROR_DURATION);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,8 @@ namespace GameDatabaseSchema
|
||||||
MergeSprite,
|
MergeSprite,
|
||||||
WildArmsHack,
|
WildArmsHack,
|
||||||
EstimateTextureRegion,
|
EstimateTextureRegion,
|
||||||
|
PCRTCOffsets,
|
||||||
|
PCRTCOverscan,
|
||||||
|
|
||||||
// integer settings
|
// integer settings
|
||||||
Mipmap,
|
Mipmap,
|
||||||
|
@ -88,6 +90,9 @@ namespace GameDatabaseSchema
|
||||||
CPUCLUTRender,
|
CPUCLUTRender,
|
||||||
GPUTargetCLUT,
|
GPUTargetCLUT,
|
||||||
GPUPaletteConversion,
|
GPUPaletteConversion,
|
||||||
|
MinimumBlendingLevel,
|
||||||
|
MaximumBlendingLevel,
|
||||||
|
RecommendedBlendingLevel,
|
||||||
GetSkipCount,
|
GetSkipCount,
|
||||||
BeforeDraw,
|
BeforeDraw,
|
||||||
|
|
||||||
|
|
|
@ -362,6 +362,15 @@ const char* Pcsx2Config::GSOptions::FMVAspectRatioSwitchNames[] = {
|
||||||
"16:9",
|
"16:9",
|
||||||
nullptr};
|
nullptr};
|
||||||
|
|
||||||
|
const char* Pcsx2Config::GSOptions::BlendingLevelNames[] = {
|
||||||
|
"Minimum",
|
||||||
|
"Basic",
|
||||||
|
"Medium",
|
||||||
|
"High",
|
||||||
|
"Full",
|
||||||
|
"Maximum",
|
||||||
|
nullptr};
|
||||||
|
|
||||||
const char* Pcsx2Config::GSOptions::CaptureContainers[] = {
|
const char* Pcsx2Config::GSOptions::CaptureContainers[] = {
|
||||||
"mp4",
|
"mp4",
|
||||||
"mkv",
|
"mkv",
|
||||||
|
|
Loading…
Reference in New Issue