Vita: Add SGB cropping

This commit is contained in:
Vicki Pfau 2019-06-06 19:26:54 -07:00
parent ff8f03ab74
commit e9aff885a2
1 changed files with 26 additions and 2 deletions

View File

@ -56,6 +56,7 @@ static vita2d_texture* oldTex;
static vita2d_texture* screenshot; static vita2d_texture* screenshot;
static Thread audioThread; static Thread audioThread;
static bool interframeBlending = false; static bool interframeBlending = false;
static bool sgbCrop = false;
static struct mSceRotationSource { static struct mSceRotationSource {
struct mRotationSource d; struct mRotationSource d;
@ -365,6 +366,10 @@ void mPSP2Setup(struct mGUIRunner* runner) {
if (mCoreConfigGetUIntValue(&runner->config, "camera", &mode)) { if (mCoreConfigGetUIntValue(&runner->config, "camera", &mode)) {
camera.cam = mode; camera.cam = mode;
} }
int fakeBool;
if (mCoreConfigGetIntValue(&runner->config, "sgb.borderCrop", &fakeBool)) {
sgbCrop = fakeBool;
}
} }
void mPSP2LoadROM(struct mGUIRunner* runner) { void mPSP2LoadROM(struct mGUIRunner* runner) {
@ -473,10 +478,15 @@ void mPSP2Unpaused(struct mGUIRunner* runner) {
} }
int fakeBool; int fakeBool;
mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool); if (mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool)) {
interframeBlending = fakeBool; interframeBlending = fakeBool;
} }
if (mCoreConfigGetIntValue(&runner->config, "sgb.borderCrop", &fakeBool)) {
sgbCrop = fakeBool;
}
}
void mPSP2Teardown(struct mGUIRunner* runner) { void mPSP2Teardown(struct mGUIRunner* runner) {
UNUSED(runner); UNUSED(runner);
CircleBufferDeinit(&rumble.history); CircleBufferDeinit(&rumble.history);
@ -519,6 +529,13 @@ void _drawTex(vita2d_texture* t, unsigned width, unsigned height, bool faded, bo
vita2d_draw_texture_tint(backdrop, 0, 0, tint); vita2d_draw_texture_tint(backdrop, 0, 0, tint);
// Fall through // Fall through
case SM_PLAIN: case SM_PLAIN:
if (sgbCrop && width == 256 && height == 224) {
w = 768;
h = 672;
scalex = 3;
scaley = 3;
break;
}
w = 960 / width; w = 960 / width;
h = 544 / height; h = 544 / height;
if (w * height > 544) { if (w * height > 544) {
@ -533,6 +550,13 @@ void _drawTex(vita2d_texture* t, unsigned width, unsigned height, bool faded, bo
scaley = scalex; scaley = scalex;
break; break;
case SM_ASPECT: case SM_ASPECT:
if (sgbCrop && width == 256 && height == 224) {
w = 967;
h = 846;
scalex = 34.0f / 9.0f;
scaley = scalex;
break;
}
w = 960 / aspectw; w = 960 / aspectw;
h = 544 / aspecth; h = 544 / aspecth;
if (w * aspecth > 544) { if (w * aspecth > 544) {