Skip to content
Permalink
Browse files

Hack around most of the problems with the save/load dialog. Software …

…stretch gets enabled in non-wide mode, so wallpapers work at a cost of speed.
  • Loading branch information...
hrydgard committed Oct 25, 2019
1 parent 102a70b commit 86c781e434f0ef75b5eef9e298208baa94a92208
Showing with 26 additions and 21 deletions.
  1. +1 −1 Core/HLE/sceUtility.cpp
  2. +25 −19 GPU/Software/Clipper.cpp
  3. +0 −1 GPU/Software/SoftGpu.cpp
@@ -130,7 +130,7 @@ enum UtilityDialogType {

// Only a single dialog is allowed at a time.
static UtilityDialogType currentDialogType;
static bool currentDialogActive;
bool currentDialogActive;
static PSPSaveDialog saveDialog;
static PSPMsgDialog msgDialog;
static PSPOskDialog oskDialog;
@@ -28,6 +28,8 @@


extern bool g_DarkStalkerStretch;
// For Darkstalkers hack. Ugh.
extern bool currentDialogActive;

namespace Clipper {

@@ -139,8 +141,11 @@ static void RotateUVThrough(const VertexData &tl, const VertexData &br, VertexDa
}
}

bool needsClear = false;

void ProcessRect(const VertexData& v0, const VertexData& v1)
{
g_DarkStalkerStretch = false;
if (!gstate.isModeThrough()) {
VertexData buf[4];
buf[0].clippos = ClipCoords(v0.clippos.x, v0.clippos.y, v1.clippos.z, v1.clippos.w);
@@ -191,32 +196,33 @@ void ProcessRect(const VertexData& v0, const VertexData& v1)
bool coord_check =
(xdiff == udiff || xdiff == -udiff) &&
(ydiff == vdiff || ydiff == -vdiff);
// TODO: The U/V mirror support is off by one somehow. Predecrement?

/*
bool state_check =
!gstate.isModeClear() &&
!gstate.isFogEnabled() &&
gstate.isTextureMapEnabled() &&
!gstate.isDepthTestEnabled() &&
!gstate.isStencilTestEnabled();
bool alpha_check =
gstate.getAlphaTestFunction() == GEComparison::GE_COMP_GREATER &&
gstate.getAlphaTestMask() == 0xFF &&
gstate.getAlphaTestRef() == 0;
*/
bool state_check = !gstate.isModeClear();
bool alpha_check = true;
if ((coord_check || !gstate.isTextureMapEnabled()) && state_check && alpha_check) {
bool state_check = !gstate.isModeClear(); // TODO: Add support for clear modes in Rasterizer::DrawSprite.
if ((coord_check || !gstate.isTextureMapEnabled()) && state_check) {
Rasterizer::DrawSprite(v0, v1);
return;
}

// Eliminate the stretch blit in DarkStalkers.
// We compensate for that when blitting the framebuffer in SoftGpu.cpp.
if (PSP_CoreParameter().compat.flags().DarkStalkersPresentHack && v0.texturecoords.x == 64.0f && v0.texturecoords.y == 16.0f && v1.texturecoords.x == 448.0f && v1.texturecoords.y == 240.0f) {
g_DarkStalkerStretch = true;
return;
if (v0.screenpos.x == 0x7100 && v0.screenpos.y == 0x7780 && v1.screenpos.x == 0x8f00 && v1.screenpos.y == 0x8880) {
// Also check for save/load dialog.
if (!currentDialogActive) {
g_DarkStalkerStretch = true;
if (needsClear) {
needsClear = false;
// Afterwards, we also need to clear the actual destination. Can do a fast rectfill.
gstate.textureMapEnable &= ~1;
VertexData newV0 = v0;
newV0.color0 = Vec4<int>(0, 0, 0, 255);
Rasterizer::DrawSprite(newV0, v1);
gstate.textureMapEnable |= 1;
}
return;
} else {
needsClear = true;
}
} // else, handle the Capcom screen stretch, or the non-wide stretch? Or let's just not bother.
}

VertexData buf[4];
@@ -208,7 +208,6 @@ void SoftGPU::CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight) {
u1 = 447.5f / 512.0f;
v1 = 16.0f / 272.0f;
v0 = 240.0f / 272.0f;
g_DarkStalkerStretch = false;
} else if (!Memory::IsValidAddress(displayFramebuf_) || srcwidth == 0 || srcheight == 0) {
hasImage = false;
u1 = 1.0f;

0 comments on commit 86c781e

Please sign in to comment.
You can’t perform that action at this time.