PSP2: Actually load screen mode setting

This commit is contained in:
Jeffrey Pfau 2016-08-02 22:26:08 -07:00
parent 15477688d7
commit 6e47d402c8
4 changed files with 17 additions and 8 deletions

View File

@ -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

View File

@ -155,7 +155,7 @@ int main() {
.drawFrame = mPSP2Draw,
.drawScreenshot = mPSP2DrawScreenshot,
.paused = 0,
.unpaused = 0,
.unpaused = mPSP2Unpaused,
.incrementScreenMode = mPSP2IncrementScreenMode,
.pollGameInput = mPSP2PollInput
};

View File

@ -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) {

View File

@ -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);