From 6e47d402c8942ca4501d7a09d7e241b5f11a7340 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 2 Aug 2016 22:26:08 -0700 Subject: [PATCH] PSP2: Actually load screen mode setting --- CHANGES | 1 + src/platform/psp2/main.c | 2 +- src/platform/psp2/psp2-context.c | 21 ++++++++++++++------- src/platform/psp2/psp2-context.h | 1 + 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 8719f6578..820b71ff9 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ Bugfixes: - ARM7: Fix decoding of Thumb ADD (variants 5 and 6) - GBA Serialize: Savestates now properly store prefetch - PSP2: Fix accelerometer range + - PSP2: Actually load screen mode setting Misc: - 3DS: Use blip_add_delta_fast for a small speed improvement - OpenGL: Log shader compilation failure diff --git a/src/platform/psp2/main.c b/src/platform/psp2/main.c index f6eee91a7..b6f034e66 100644 --- a/src/platform/psp2/main.c +++ b/src/platform/psp2/main.c @@ -155,7 +155,7 @@ int main() { .drawFrame = mPSP2Draw, .drawScreenshot = mPSP2DrawScreenshot, .paused = 0, - .unpaused = 0, + .unpaused = mPSP2Unpaused, .incrementScreenMode = mPSP2IncrementScreenMode, .pollGameInput = mPSP2PollInput }; diff --git a/src/platform/psp2/psp2-context.c b/src/platform/psp2/psp2-context.c index 38216eb74..aa268b67f 100644 --- a/src/platform/psp2/psp2-context.c +++ b/src/platform/psp2/psp2-context.c @@ -174,6 +174,11 @@ void mPSP2Setup(struct mGUIRunner* runner) { runner->core->setRotation(runner->core, &rotation.d); backdrop = vita2d_load_PNG_buffer(_binary_backdrop_png_start); + + unsigned mode; + if (mCoreConfigGetUIntValue(&runner->core->config, "screenMode", &mode) && mode < SM_MAX) { + screenMode = mode; + } } void mPSP2LoadROM(struct mGUIRunner* runner) { @@ -249,6 +254,13 @@ void mPSP2UnloadROM(struct mGUIRunner* runner) { scePowerSetArmClockFrequency(80); } +void mPSP2Unpaused(struct mGUIRunner* runner) { + unsigned mode; + if (mCoreConfigGetUIntValue(&runner->core->config, "screenMode", &mode) && mode != screenMode) { + screenMode = mode; + } +} + void mPSP2Teardown(struct mGUIRunner* runner) { vita2d_free_texture(tex); vita2d_free_texture(screenshot); @@ -293,13 +305,8 @@ void mPSP2DrawScreenshot(struct mGUIRunner* runner, const uint32_t* pixels, bool } void mPSP2IncrementScreenMode(struct mGUIRunner* runner) { - unsigned mode; - if (mCoreConfigGetUIntValue(&runner->core->config, "screenMode", &mode) && mode != screenMode) { - screenMode = mode; - } else { - screenMode = (screenMode + 1) % SM_MAX; - mCoreConfigSetUIntValue(&runner->core->config, "screenMode", screenMode); - } + screenMode = (screenMode + 1) % SM_MAX; + mCoreConfigSetUIntValue(&runner->core->config, "screenMode", screenMode); } __attribute__((noreturn, weak)) void __assert_func(const char* file, int line, const char* func, const char* expr) { diff --git a/src/platform/psp2/psp2-context.h b/src/platform/psp2/psp2-context.h index 3d4d5dd25..11b662bb2 100644 --- a/src/platform/psp2/psp2-context.h +++ b/src/platform/psp2/psp2-context.h @@ -16,6 +16,7 @@ void mPSP2Teardown(struct mGUIRunner* runner); void mPSP2LoadROM(struct mGUIRunner* runner); void mPSP2UnloadROM(struct mGUIRunner* runner); void mPSP2PrepareForFrame(struct mGUIRunner* runner); +void mPSP2Unpaused(struct mGUIRunner* runner); void mPSP2Draw(struct mGUIRunner* runner, bool faded); void mPSP2DrawScreenshot(struct mGUIRunner* runner, const uint32_t* pixels, bool faded); void mPSP2IncrementScreenMode(struct mGUIRunner* runner);