TheRouletteBoi / RouLetteVshMenu

Playstation 3 VSH Menu, SPRX Loader, Mod Menu Loader, Payload injector, RPC Calls, CEX/DEX/HEN
MIT License
42 stars 10 forks source link

Don't refresh clock speeds when not necessary #28 #31 #33

Closed kostirez1 closed 2 years ago

kostirez1 commented 2 years ago

This patch allows to prevent a crash occuring due to clock speed readouts on specific PS3 models by not calling affected functions when user disables it with "showClockSpeeds: Off" in the config.

Related to issues #28 and #31

aldostools commented 2 years ago

The thread LoadExternalOffsets should not be loaded either if showClockSpeeds is not used.

Overlay::Overlay()
{
    g_Config.Load(); // make sure Config is loaded
    m_ReloadConfigTime = GetTimeNow() + 10000;

    if (g_Config.overlay.showClockSpeeds) // find clock speed offsets only when they are displayed
        sys_ppu_thread_create(&LoadExternalOffsetsThreadId, LoadExternalOffsets, 0, 0xB02, 512, SYS_PPU_THREAD_CREATE_JOINABLE, "Overlay::LoadExternalOffsets()");

    sys_ppu_thread_create(&UpdateInfoThreadId, UpdateInfoThread, 0, 0xB01, 512, SYS_PPU_THREAD_CREATE_JOINABLE, "Overlay::UpdateInfoThread()");
}