mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-21 02:09:05 +02:00
The game's requested CPU frequency wasn't stored anywhere, only the effective CoreTiming clock. So a state saved with a locked clock kept that speed when loaded with the lock off, and turning the lock off in-game left the CPU at the locked speed until the game set its clock again (most only do at boot). Changing the lock in-game didn't take effect either, until a reboot or a state load. Now RealcpuFreq is tracked and saved next to the PLL and bus, the setters record the game's request even under a lock, and one function applies either the lock or the game's clocks. It runs at init, on state load, and at vblank whenever the setting has changed. Older states guess the game's clock from the saved effective one, capped at the game's PLL. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
// Official git repository and contact information can be found at
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
#pragma once
|
|
|
|
class PointerWrap;
|
|
|
|
void __PowerInit();
|
|
void __PowerDoState(PointerWrap &p);
|
|
// Applies a change to the locked CPU speed setting. Called every vblank.
|
|
void __PowerCheckLockedClock();
|
|
|
|
void Register_scePower();
|
|
void Register_scePower_driver();
|
|
void Register_sceMePower_driver();
|
|
void Register_sceSuspendForUser();
|
|
|
|
int KernelVolatileMemLock(int type, u32 paddr, u32 psize);
|
|
int KernelVolatileMemUnlock(int type);
|
|
|
|
// Returns 0 for default.
|
|
int GetLockedCPUSpeedMhz();
|
|
|
|
// Scales a duration measured at the default 222MHz to the current clock. The whole system runs
|
|
// from the one PLL - CPU, bus, the Media Engine and the GE - so hardware work speeds up with it.
|
|
int PowerScaleFromDefaultClock(int us);
|