Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Fix speed hack for cutscenes
Browse files Browse the repository at this point in the history
  • Loading branch information
PiKeyAr committed Sep 12, 2022
1 parent b9b1bca commit f77547e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sadx-debug-mode/mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DataPointer(int, CutsceneID, 0x3B2C570);
DataPointer(char, CurrentCharacterSelection, 0x3B2A2FD);
DataPointer(char, FreezeFrameByte1, 0x78BA50);
DataPointer(char, FreezeFrameByte2, 0x78B880);
DataPointer(char, CutsceneFramerateMode, 0x00431488);

char DebugSetting = 0; // Menu ID
bool FreeCamEnabled = false;
Expand Down Expand Up @@ -630,7 +631,11 @@ extern "C"
SpeedHack = !SpeedHack;
SendDebugMessage(SpeedHack ? "SPEED HACK: ON" : "SPEED HACK: OFF");
if (!SpeedHack && FrameIncrementCurrent != 1)
{
FrameIncrement = FrameIncrementCurrent = 1;
if (current_event != -1 && CutsceneFramerateMode == 2)
dsInitInt(2, 1);
}
}
if (KeyboardKeys[KEY_PAGEUP].pressed)
{
Expand All @@ -651,7 +656,16 @@ extern "C"
ScaleDebugFont(16);
// Apply speed hack
if (SpeedHack)
{
FrameIncrement = FrameIncrementCurrent;
if (current_event != -1 && CutsceneFramerateMode == 2)
{
if (FrameIncrementCurrent == 1)
dsInitInt(2, 1);
else
njSetWaitVsyncCount(2);
}
}
// Display data
if (!MissedFrames)
{
Expand Down

0 comments on commit f77547e

Please sign in to comment.