Compare commits

..
8 Commits
6 changed files with 133 additions and 72 deletions
+46 -46
View File
@@ -24378,12 +24378,12 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="442"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="443"/>
<source>GunCon 2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="584"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="585"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="78"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="106"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="938"/>
@@ -24397,7 +24397,7 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="585"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="586"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="79"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="107"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="940"/>
@@ -24411,7 +24411,7 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="586"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="587"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="80"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="108"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="941"/>
@@ -24425,7 +24425,7 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="587"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="588"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="81"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="109"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="939"/>
@@ -24439,22 +24439,22 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="589"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="590"/>
<source>Trigger</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="590"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="591"/>
<source>Shoot Offscreen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="592"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="593"/>
<source>Calibration Shot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="594"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="595"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="139"/>
<location filename="../../pcsx2/USB/usb-pad/usb-seamic.cpp" line="363"/>
<location filename="../../pcsx2/USB/usb-pad/usb-train.cpp" line="154"/>
@@ -24462,7 +24462,7 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="595"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="596"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="140"/>
<location filename="../../pcsx2/USB/usb-pad/usb-seamic.cpp" line="364"/>
<location filename="../../pcsx2/USB/usb-pad/usb-train.cpp" line="155"/>
@@ -24470,14 +24470,14 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="596"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="597"/>
<location filename="../../pcsx2/USB/usb-pad/usb-seamic.cpp" line="365"/>
<location filename="../../pcsx2/USB/usb-pad/usb-train.cpp" line="156"/>
<source>C</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="597"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="598"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="90"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="116"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="936"/>
@@ -24491,7 +24491,7 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="598"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="599"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="91"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="117"/>
<location filename="../../pcsx2/USB/usb-pad/usb-pad.cpp" line="937"/>
@@ -24505,141 +24505,141 @@ Rename it to {} to remove this warning.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="599"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="600"/>
<source>Relative Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="600"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="601"/>
<source>Relative Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="601"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="602"/>
<source>Relative Up</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="602"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="603"/>
<source>Relative Down</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="611"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="612"/>
<source>Cursor Path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="612"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="613"/>
<source>Sets the crosshair image that this lightgun will use. Setting a crosshair image will disable the system cursor.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="615"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="616"/>
<source>Cursor Scale</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="616"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="617"/>
<source>Scales the crosshair image set above.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="616"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="617"/>
<source>%.0f%%</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="618"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="619"/>
<source>Cursor Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="619"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="620"/>
<source>Applies a color to the chosen crosshair images, can be used for multiple players. Specify in HTML/CSS format (e.g. #aabbcc)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="622"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="623"/>
<source>Manual Screen Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="623"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="624"/>
<source>Forces the use of the screen parameters below, instead of automatic parameters if available.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="626"/>
<source>X Scale (Sensitivity)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="627"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="630"/>
<source>Scales the position to simulate CRT curvature.</source>
<source>X Scale (Sensitivity)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="628"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="631"/>
<source>%.2f%%</source>
<source>Scales the position to simulate CRT curvature.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="629"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="632"/>
<source>%.2f%%</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="630"/>
<source>Y Scale (Sensitivity)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="632"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="633"/>
<source>Center X</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="633"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="634"/>
<source>Sets the horizontal center position of the simulated screen.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="634"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="637"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="635"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="638"/>
<source>%.0fpx</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="635"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="636"/>
<source>Center Y</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="636"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="637"/>
<source>Sets the vertical center position of the simulated screen.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="638"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="639"/>
<source>Screen Width</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="639"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="640"/>
<source>Sets the width of the simulated screen.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="639"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="642"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="640"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="643"/>
<source>%dpx</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="641"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="642"/>
<source>Screen Height</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="642"/>
<location filename="../../pcsx2/USB/usb-lightgun/guncon2.cpp" line="643"/>
<source>Sets the height of the simulated screen.</source>
<translation type="unfinished"></translation>
</message>
+11 -11
View File
@@ -5,23 +5,23 @@
// clang-format off
#define VM_SIZE 4194304u
#define HALF_VM_SIZE (VM_SIZE / 2u)
#define GS_PAGE_SIZE 8192u
#define GS_BLOCK_SIZE 256u
#define GS_COLUMN_SIZE 64u
#define GS_BLOCKS_PER_PAGE (GS_PAGE_SIZE / GS_BLOCK_SIZE)
#define GS_MAX_PAGES (VM_SIZE / GS_PAGE_SIZE)
#define GS_MAX_BLOCKS (VM_SIZE / GS_BLOCK_SIZE)
#define GS_MAX_COLUMNS (VM_SIZE / GS_COLUMN_SIZE)
//if defined, will send much info in reply to the API title info queri from PCSX2
//default should be undefined
//#define GSTITLEINFO_API_FORCE_VERBOSE
#include "GSVector.h"
constexpr u32 VM_SIZE = 4194304u;
constexpr u32 HALF_VM_SIZE = (VM_SIZE / 2u);
constexpr u32 GS_PAGE_SIZE = 8192u;
constexpr u32 GS_BLOCK_SIZE = 256u;
constexpr u32 GS_COLUMN_SIZE = 64u;
constexpr u32 GS_BLOCKS_PER_PAGE = (GS_PAGE_SIZE / GS_BLOCK_SIZE);
constexpr u32 GS_MAX_PAGES = (VM_SIZE / GS_PAGE_SIZE);
constexpr u32 GS_MAX_BLOCKS = (VM_SIZE / GS_BLOCK_SIZE);
constexpr u32 GS_MAX_COLUMNS = (VM_SIZE / GS_COLUMN_SIZE);
#pragma pack(push, 1)
enum GS_PRIM
+1 -1
View File
@@ -805,7 +805,7 @@ GSTexture* GSDevice::CreateTexture(int w, int h, int mipmap_levels, GSTexture::F
{
pxAssert(mipmap_levels != 0 && (mipmap_levels < 0 || mipmap_levels <= GetMipmapLevelsForSize(w, h)));
const int levels = mipmap_levels < 0 ? GetMipmapLevelsForSize(w, h) : mipmap_levels;
return FetchSurface(GSTexture::Texture, w, h, levels, format, false, m_features.prefer_new_textures && prefer_reuse);
return FetchSurface(GSTexture::Texture, w, h, levels, format, false, !m_features.prefer_new_textures || prefer_reuse);
}
GSTexture* GSDevice::CreateTexture(const GSVector2i& size, int mipmap_levels, GSTexture::Format format, bool prefer_reuse)
+18 -8
View File
@@ -3225,8 +3225,10 @@ void GSRendererHW::Draw()
// Be careful of being 1 pixel from filled.
const bool page_aligned = (m_r.w % pgs.y) == (pgs.y - 1) || (m_r.w % pgs.y) == 0;
const bool is_zero_color_clear = (GetConstantDirectWriteMemClearColor() == 0 && !preserve_rt_color && page_aligned);
const bool is_zero_depth_clear = (GetConstantDirectWriteMemClearDepth() == 0 && !preserve_depth && page_aligned);
const bool is_full_color_cover = !preserve_rt_color && page_aligned;
const bool is_full_depth_cover = !preserve_depth && page_aligned;
const bool is_zero_color_clear = (GetConstantDirectWriteMemClearColor() == 0 && is_full_color_cover);
const bool is_zero_depth_clear = (GetConstantDirectWriteMemClearDepth() == 0 && is_full_depth_cover);
bool gs_mem_cleared = false;
// If it's an invalid-sized draw, do the mem clear on the CPU, we don't want to create huge targets.
// If clearing to zero, don't bother creating the target. Games tend to clear more than they use, wasting VRAM/bandwidth.
@@ -3261,8 +3263,8 @@ void GSRendererHW::Draw()
}
gs_mem_cleared |= overwriting_whole_rt && overwriting_whole_ds && (!no_rt || !no_ds);
if (overwriting_whole_rt && overwriting_whole_ds &&
TryGSMemClear(no_rt, preserve_rt_color, is_zero_color_clear, rt_end_bp,
no_ds, preserve_depth, is_zero_depth_clear, ds_end_bp))
TryGSMemClear(no_rt, preserve_rt_color, is_full_color_cover, rt_end_bp,
no_ds, preserve_depth, is_full_depth_cover, ds_end_bp))
{
GL_INS("HW: Skipping (%d,%d=>%d,%d) draw at FBP %x/ZBP %x due to invalid height or zero clear.", m_r.x, m_r.y,
m_r.z, m_r.w, m_cached_ctx.FRAME.Block(), m_cached_ctx.ZBUF.Block());
@@ -3285,8 +3287,14 @@ void GSRendererHW::Draw()
}
}
CleanupDraw(false);
return;
no_rt |= is_zero_color_clear;
no_ds |= is_zero_depth_clear;
if (no_rt && no_ds)
{
CleanupDraw(false);
return;
}
}
}
@@ -9975,9 +9983,11 @@ bool GSRendererHW::DetectDoubleHalfClear(bool& no_rt, bool& no_ds)
// path write out FRAME and Z separately, with their associated masks. Limit it to black to avoid false positives.
if (write_color == 0)
{
// Don't check the *entire* size for the end, as some games (X-Men) decide it's done with Z and starts overwriting
// the end with other things, which causes a resize, so the end point is no longer in the right place.
// So let's just check there's at least one page over the half way point, at worst it means 2 targets overlap.
const GSTextureCache::Target* base_tgt = g_texture_cache->GetExactTarget(base * GS_BLOCKS_PER_PAGE,
m_cached_ctx.FRAME.FBW, clear_depth ? GSTextureCache::DepthStencil : GSTextureCache::RenderTarget,
GSLocalMemory::GetEndBlockAddress(half * GS_BLOCKS_PER_PAGE, m_cached_ctx.FRAME.FBW, m_cached_ctx.FRAME.PSM, m_r));
m_cached_ctx.FRAME.FBW, clear_depth ? GSTextureCache::DepthStencil : GSTextureCache::RenderTarget, (half + 1) * GS_BLOCKS_PER_PAGE);
if (base_tgt)
{
GL_INS("HW: DetectDoubleHalfClear(): Invalidating targets at 0x%x/0x%x due to different formats, and clear to black.",
+56 -6
View File
@@ -3565,16 +3565,62 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons
// Make sure there's sufficient compatibility/overlap between the old target and the new target
// to warrant loading from the old target.
const u32 old_buffer_width = std::max(1U, old_dst->m_TEX0.TBW);
if (old_dst->m_TEX0.PSM != dst->m_TEX0.PSM ||
!old_dst->Overlaps(dst->m_TEX0.TBP0, dst->m_TEX0.TBW, dst->m_TEX0.PSM, dst_valid))
{
if (old_dst->m_TEX0.TBP0 == dst->m_TEX0.TBP0 && dst_end_block >= old_dst->m_end_block && (!src || !src->m_target || src->m_from_target != old_dst))
{
InvalidateSourcesFromTarget(old_dst);
i = list.erase(j);
delete old_dst;
continue;
}
if (old_dst->Overlaps(dst->m_TEX0.TBP0, dst->m_TEX0.TBW, dst->m_TEX0.PSM, dst_valid))
{
const GSLocalMemory::psm_t& psm_o = GSLocalMemory::m_psm[old_dst->m_TEX0.PSM];
if (dst->m_TEX0.TBP0 > old_dst->m_TEX0.TBP0)
{
const int block_diff = dst->m_TEX0.TBP0 - old_dst->m_TEX0.TBP0;
const u32 old_pages_wide = old_buffer_width * 64 / psm_o.pgs.x;
if ((block_diff % (GS_BLOCKS_PER_PAGE * old_pages_wide)) == 0) // Check for left alignment.
{
const int new_height = block_diff / (GS_BLOCKS_PER_PAGE * old_pages_wide) * psm_o.pgs.y;
old_dst->m_valid = old_dst->m_valid.rintersect(GSVector4i(old_dst->m_valid.x, old_dst->m_valid.y, old_dst->m_valid.z, new_height));
old_dst->ResizeValidity(old_dst->m_valid);
}
}
else // new target is behind the old one, so need to move the start of the old one to the end block of the new.
{
const int block_diff = dst_end_block - old_dst->m_TEX0.TBP0;
const u32 old_pages_wide = old_buffer_width * 64 / psm_o.pgs.x;
if ((block_diff % (GS_BLOCKS_PER_PAGE * old_pages_wide)) == 0) // Check for left alignment.
{
const int change_height = block_diff / (GS_BLOCKS_PER_PAGE * old_pages_wide) * psm_o.pgs.y;
old_dst->m_valid = old_dst->m_valid.rintersect(GSVector4i(old_dst->m_valid.x, old_dst->m_valid.y, old_dst->m_valid.z, old_dst->m_valid.w - change_height));
old_dst->m_TEX0.TBP0 += block_diff;
const GSVector2i new_scaled_size = GSVector2i(old_dst->m_unscaled_size * old_dst->m_scale);
if (GSTexture* tex = g_gs_device->CreateCompatible(dst->m_texture, new_scaled_size, true))
{
const int height_offset = change_height * old_dst->m_scale;
g_gs_device->CopyRect(old_dst->m_texture, tex, GSVector4i(0, height_offset, old_dst->GetUnscaledWidth() * old_dst->m_scale, old_dst->GetUnscaledHeight() * old_dst->m_scale), 0, 0);
g_gs_device->Recycle(old_dst->m_texture);
old_dst->m_texture = tex;
}
}
}
}
i++;
continue;
}
const int page_diff = std::abs(static_cast<int>(old_dst->m_TEX0.TBP0 - dst->m_TEX0.TBP0)) >> 5;
const u32 new_buffer_width = std::max(1U, dst->m_TEX0.TBW);
const u32 old_buffer_width = std::max(1U, old_dst->m_TEX0.TBW);
// Handle cases where the buffer widths don't match.
if (new_buffer_width != old_buffer_width)
@@ -3592,7 +3638,7 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons
const u32 old_pages_wide = old_buffer_width * 64 / psm_s.pgs.x;
if ((block_diff % (32 * old_pages_wide)) == 0) // Check for left alignment.
{
const int new_height = block_diff / (32 * old_pages_wide) * psm_s.pgs.y;
const int new_height = block_diff / (GS_BLOCKS_PER_PAGE * old_pages_wide) * psm_s.pgs.y;
old_dst->m_valid = old_dst->m_valid.rintersect(GSVector4i(0, 0, old_dst->GetUnscaledWidth(), new_height));
if (old_dst->m_valid.rempty())
{
@@ -4543,10 +4589,14 @@ void GSTextureCache::InvalidateContainedTargets(u32 start_bp, u32 end_bp, u32 wr
InvalidateSourcesFromTarget(t);
t->m_valid_alpha_low &= preserve_alpha;
t->m_valid_alpha_high &= preserve_alpha;
t->m_valid_rgb &= (fb_mask & 0x00FFFFFF) != 0;
t->m_was_dst_matched = false;
if (type == DepthStencil || start_bp == t->m_TEX0.TBP0 || (start_bp < t->m_TEX0.TBP0 && t->UnwrappedEndBlock() <= end_bp))
{
const bool compatible_channel_swizzle = GSLocalMemory::m_psm[t->m_TEX0.PSM].bpp == GSLocalMemory::m_psm[write_psm].bpp;
t->m_valid_alpha_low &= preserve_alpha && compatible_channel_swizzle;
t->m_valid_alpha_high &= preserve_alpha && compatible_channel_swizzle;
t->m_valid_rgb &= (fb_mask & 0x00FFFFFF) != 0 && compatible_channel_swizzle;
t->m_was_dst_matched = false;
}
// Don't keep partial depth buffers around.
if ((!t->m_valid_alpha_low && !t->m_valid_alpha_high && !t->m_valid_rgb) || type == DepthStencil)
+1
View File
@@ -92,6 +92,7 @@ namespace usb_lightgun
{"SLPS-25077", 90.0f, 97.5f, 422, 118, 640, 240}, // Vampire Night (J)
{"SLUS-20221", 89.8f, 102.5f, 422, 124, 640, 228}, // Vampire Night (U)
{"SLES-51229", 110.15f, 100.0f, 433, 159, 512, 256}, // Virtua Cop - Elite Edition (E,J) (480i)
{"SLPM-62205", 110.15f, 100.0f, 433, 159, 512, 256}, // Virtua Cop Re-Birth (J) (480i)
// {"SLES-51229", 85.75f, 92.0f, 456, 164, 640, 256}, // Virtua Cop - Elite Edition (E,J) (480p)
};