PS1/Saturn: Double FPS (12 to 30 FPS in DuckStation, 10 to 20 FPS in mednafen)

This commit is contained in:
UnknownShadow200 2024-07-21 12:28:00 +10:00
parent 97c3dd8374
commit 427c4f213a
2 changed files with 10 additions and 3 deletions

View File

@ -550,13 +550,15 @@ static void Gamepad_Update(int port, float delta) {
void Gamepad_SetButton(int port, int btn, int pressed) {
struct GamepadDevice* pad = &Gamepad_Devices[port];
pressed = pressed != 0;
btn -= GAMEPAD_BEG_BTN;
/* Repeat down is handled in Gamepad_Update instead */
if (pressed && pad->pressed[btn]) return;
if (pressed == pad->pressed[btn]) return;
/* Reset hold tracking time */
if (pressed && !pad->pressed[btn]) pad->holdtime[btn] = 0;
pad->pressed[btn] = pressed != 0;
pad->pressed[btn] = pressed;
Gamepad_Apply(port, btn, false, pressed);
}

View File

@ -148,6 +148,10 @@ static void HUDScreen_BuildPosition(struct HUDScreen* s, struct VertexTextured*
TextAtlas_AddInt(atlas, pos.z, &cur);
TextAtlas_Add(atlas, 14, &cur);
s->lastX = pos.x;
s->lastY = pos.y;
s->lastZ = pos.z;
s->posCount = (int)(cur - data);
}
@ -342,8 +346,9 @@ static void HUDScreen_Update(void* screen, float delta) {
}
IVec3_Floor(&pos, &Entities.CurPlayer->Base.Position);
if (pos.x != s->lastX || pos.y != s->lastY || pos.z != s->lastZ)
if (pos.x != s->lastX || pos.y != s->lastY || pos.z != s->lastZ) {
s->dirty = true;
}
}
#define CH_EXTENT 16