Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed more emulator things to devctl api #16441

Merged
merged 1 commit into from
Nov 26, 2022
Merged

Exposed more emulator things to devctl api #16441

merged 1 commit into from
Nov 26, 2022

Conversation

ThirteenAG
Copy link
Contributor

@ThirteenAG ThirteenAG commented Nov 26, 2022

Related to #15626

Decided to kickstart some things, to have more flexibility in plugins.

E.g., GTA VCS, now possible to fastforward automatically during loadscreens and mission/cutscene/interior loading.
Also possible to automatically detect actual screen aspect ratio and use that in game, without manually editing ini settings.

devenv_2022_11_26_17_23_03.mp4

Download test version of compatible with new options plugin here:

GTAVCS.PPSSPP.WidescreenFix.zip

Some code examples:

// not implemented yet
short CPad::GetAccelerate(short* pad) {
    if (pad[77] == 0)
    {
        unsigned char rt = 0;
        sceIoDevctl("kemulator:", EMULATOR_DEVCTL__GET_RTRIGGER, NULL, 0, &rt, sizeof(rt));
        if (rt > 30) //deadzone
            return rt;
    }
    return 0;
}
void UnthrottleEmuEnable()
{
    sceIoDevctl("kemulator:", EMULATOR_DEVCTL__TOGGLE_FASTFORWARD, (void*)1, 0, NULL, 0);
}

void UnthrottleEmuDisable()
{
    sceIoDevctl("kemulator:", EMULATOR_DEVCTL__TOGGLE_FASTFORWARD, (void*)0, 0, NULL, 0);
}

...
int UnthrottleEmuDuringLoading = 0;
void GameLoopStuff()
{
    if (UnthrottleEmuDuringLoading)
    {
        uint32_t gMenuActivated = sub_2A9B4(sub_471400()); //inlined on psp
        float gBlackScreenTime = *(float*)(injector.GetGP() + ptr_1334C4);
        if (gBlackScreenTime && !gMenuActivated)
            UnthrottleEmuEnable();
        else
            UnthrottleEmuDisable();
    }
}
        float ar = 0.0f;
        sceIoDevctl("kemulator:", EMULATOR_DEVCTL__GET_ASPECT_RATIO, NULL, 0, &ar, sizeof(ar));
        if (ar)
            fAspectRatio = ar;

added
EMULATOR_DEVCTL__TOGGLE_FASTFORWARD
EMULATOR_DEVCTL__GET_ASPECT_RATIO
EMULATOR_DEVCTL__GET_SCALE
@hrydgard hrydgard added the Plugins Issues with running PSP plugins label Nov 26, 2022
@hrydgard hrydgard added this to the v1.14.0 milestone Nov 26, 2022
Copy link
Owner

@hrydgard hrydgard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just leaving a note that how aspect works (and also the scale) will change when I change how the screen setup works, likely soon (will be fixed to actually match the configured display, and not assume stretch mode).

@hrydgard hrydgard merged commit 767a877 into hrydgard:master Nov 26, 2022
@ThirteenAG
Copy link
Contributor Author

Lcs most likely, when I have time, ctw is more tricky, so not sure.

@ThirteenAG
Copy link
Contributor Author

@Bizz91 Found a way to speed up PDA loading in CTW:

ctw.mp4

Original for comparison:

PPSSPPWindows64_2022_12_01_02_06_22.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugins Issues with running PSP plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants