mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-02 11:02:28 +02:00
what is this even...
This commit is contained in:
parent
0903e20817
commit
97f5b1665f
@ -1,41 +0,0 @@
|
||||
// Copyright (C) 2003 Dolphin 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.
|
||||
|
||||
// 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 SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _SETUP_H_
|
||||
#define _SETUP_H_
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// File description:
|
||||
// Compilation settings. I avoid placing this in Common.h or some place where lots of files needs
|
||||
// to be rebuilt if any of these settings are changed. I'd rather have it in as few files as possible.
|
||||
// This file can be kept on the ignore list in your SVN program. It allows local optional settings
|
||||
// depending on what works on your computer.
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// Settings:
|
||||
|
||||
// This may remove sound artifacts in Wario Land Shake It and perhaps other games
|
||||
//#define SETUP_AVOID_SOUND_ARTIFACTS
|
||||
|
||||
// Build with playback rerecording options
|
||||
//#define RERECORDING
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
#endif // _SETUP_H_
|
||||
|
@ -15,7 +15,6 @@
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Setup.h"
|
||||
#include "Thread.h"
|
||||
#include "Common.h"
|
||||
|
||||
|
@ -5,7 +5,6 @@ set(SRCS Src/ActionReplay.cpp
|
||||
Src/Console.cpp
|
||||
Src/Core.cpp
|
||||
Src/CoreParameter.cpp
|
||||
Src/CoreRerecording.cpp
|
||||
Src/CoreTiming.cpp
|
||||
Src/DSPEmulator.cpp
|
||||
Src/GeckoCodeConfig.cpp
|
||||
|
@ -207,7 +207,6 @@
|
||||
<ClCompile Include="Src\Console.cpp" />
|
||||
<ClCompile Include="Src\Core.cpp" />
|
||||
<ClCompile Include="Src\CoreParameter.cpp" />
|
||||
<ClCompile Include="Src\CoreRerecording.cpp" />
|
||||
<ClCompile Include="Src\CoreTiming.cpp" />
|
||||
<ClCompile Include="Src\Debugger\Debugger_SymbolMap.cpp" />
|
||||
<ClCompile Include="Src\Debugger\Dump.cpp" />
|
||||
|
@ -18,9 +18,9 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include "EmuWindow.h"
|
||||
#endif
|
||||
|
||||
#include "Setup.h" // Common
|
||||
#include "Atomic.h"
|
||||
#include "Thread.h"
|
||||
#include "Timer.h"
|
||||
@ -61,9 +61,6 @@
|
||||
#include "VideoBackendBase.h"
|
||||
#include "AudioCommon.h"
|
||||
#include "OnScreenDisplay.h"
|
||||
#ifdef _WIN32
|
||||
#include "EmuWindow.h"
|
||||
#endif
|
||||
|
||||
#include "VolumeHandler.h"
|
||||
#include "FileMonitor.h"
|
||||
|
@ -95,21 +95,6 @@ void RequestRefreshInfo();
|
||||
// the return value of the first call should be passed in as the second argument of the second call.
|
||||
bool PauseAndLock(bool doLock, bool unpauseOnUnlock=true);
|
||||
|
||||
#ifdef RERECORDING
|
||||
|
||||
void FrameUpdate();
|
||||
void FrameAdvance();
|
||||
void FrameStepOnOff();
|
||||
void WriteStatus();
|
||||
void RerecordingStart();
|
||||
void RerecordingStop();
|
||||
void WindBack(int Counter);
|
||||
|
||||
extern int g_FrameCounter,g_InputCounter;
|
||||
extern bool g_FrameStep;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
|
@ -1,248 +0,0 @@
|
||||
// Copyright (C) 2003 Dolphin 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.
|
||||
|
||||
// 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 SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#include "Setup.h"
|
||||
#ifndef RERECORDING
|
||||
bool rerecording = false;
|
||||
#else
|
||||
|
||||
// Include
|
||||
// --------------
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "Thread.h" // Common
|
||||
|
||||
#include "Timer.h"
|
||||
#include "Common.h"
|
||||
|
||||
#include "Console.h"
|
||||
#include "Core.h"
|
||||
#include "CPUDetect.h"
|
||||
#include "CoreTiming.h"
|
||||
#include "Boot/Boot.h"
|
||||
#include "PatchEngine.h"
|
||||
|
||||
#include "HW/Memmap.h"
|
||||
#include "HW/ProcessorInterface.h"
|
||||
#include "HW/GPFifo.h"
|
||||
#include "HW/CPU.h"
|
||||
#include "HW/HW.h"
|
||||
#include "HW/DSP.h"
|
||||
#include "HW/GPFifo.h"
|
||||
#include "HW/AudioInterface.h"
|
||||
#include "HW/VideoInterface.h"
|
||||
#include "HW/CommandProcessor.h"
|
||||
#include "HW/PixelEngine.h"
|
||||
#include "HW/SystemTimers.h"
|
||||
|
||||
#include "PowerPC/PowerPC.h"
|
||||
|
||||
#include "ConfigManager.h"
|
||||
|
||||
#include "MemTools.h"
|
||||
#include "Host.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// File description: Rerecording Functions
|
||||
/* ---------------
|
||||
|
||||
How the timer works: We measure the time between drawn frames, not when the game is paused. So time
|
||||
should be a fairly comparable measure of the time it took to play the game. However the time it takes
|
||||
to draw a frame will be lower on a fast computer. Therefore we could perhaps measure time as an
|
||||
internal game time that is adjusted by the average time it takes to draw a frame. Also if it only takes
|
||||
ten or twenty milliseconds to draw a frame I'm not certain about how accurate the mmsystem timers are for
|
||||
such short periods.
|
||||
|
||||
//////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
namespace Core
|
||||
{
|
||||
|
||||
|
||||
|
||||
// Declarations and definitions
|
||||
// ---------------
|
||||
int g_FrameCounter = 0;
|
||||
bool g_FrameStep = false;
|
||||
Common::Timer ReRecTimer;
|
||||
|
||||
|
||||
|
||||
|
||||
// Control Run, Pause, Stop and the Timer.
|
||||
// ---------------
|
||||
|
||||
// Subtract the paused time when we run again
|
||||
void Run()
|
||||
{
|
||||
ReRecTimer.AddTimeDifference();
|
||||
}
|
||||
// Update the time
|
||||
void Pause()
|
||||
{
|
||||
ReRecTimer.Update();
|
||||
}
|
||||
|
||||
// Start the timer when a game is booted
|
||||
void RerecordingStart()
|
||||
{
|
||||
g_FrameCounter = 0;
|
||||
ReRecTimer.Start();
|
||||
|
||||
// Logging
|
||||
//DEBUG_LOG(CONSOLE, "RerecordingStart: %i\n", g_FrameCounter);
|
||||
}
|
||||
|
||||
// Reset the frame counter
|
||||
void RerecordingStop()
|
||||
{
|
||||
// Write the final time and Stop the timer
|
||||
ReRecTimer.Stop();
|
||||
|
||||
// Update status bar
|
||||
WriteStatus();
|
||||
}
|
||||
|
||||
/* Wind back the frame counter when a save state is loaded. Currently we don't know what that means in
|
||||
time so we just guess that the time is proportional the the number of frames
|
||||
|
||||
Todo: There are many assumptions here: We probably want to replace the time here by the actual time
|
||||
that we save together with the save state or the input recording for example. And have it adjusted
|
||||
for full speed playback (whether it's 30 fps or 60 fps or some other speed that the game is natively
|
||||
capped at). Also the input interrupts do not occur as often as the frame renderings, they occur more
|
||||
often. So we may want to move the input recording to fram updates, or perhaps sync the input interrupts
|
||||
to frame updates.
|
||||
*/
|
||||
void WindBack(int Counter)
|
||||
{
|
||||
/* Counter should be smaller than g_FrameCounter, however it currently updates faster than the
|
||||
frames so currently it may not be the same. Therefore I use the abs() function. */
|
||||
int AbsoluteFrameDifference = abs(g_FrameCounter - Counter);
|
||||
float FractionalFrameDifference = (float) AbsoluteFrameDifference / (float) g_FrameCounter;
|
||||
|
||||
// Update the frame counter
|
||||
g_FrameCounter = Counter;
|
||||
|
||||
// Approximate a time to wind back the clock to
|
||||
// Get the current time
|
||||
u64 CurrentTimeMs = ReRecTimer.GetTimeElapsed();
|
||||
// Save the current time in seconds in a new double
|
||||
double CurrentTimeSeconds = (double) (CurrentTimeMs / 1000);
|
||||
// Reduce it by the same proportion as the counter was wound back
|
||||
CurrentTimeSeconds = CurrentTimeSeconds * FractionalFrameDifference;
|
||||
// Update the clock
|
||||
ReRecTimer.WindBackStartingTime((u64)CurrentTimeSeconds * 1000);
|
||||
|
||||
// Logging
|
||||
DEBUG_LOG(CONSOLE, "WindBack: %i %u\n", Counter, (u64)CurrentTimeSeconds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Frame advance
|
||||
// ---------------
|
||||
void FrameAdvance()
|
||||
{
|
||||
// Update status bar
|
||||
WriteStatus();
|
||||
|
||||
// If a game is not started, return
|
||||
if (Core::GetState() == Core::CORE_UNINITIALIZED) return;
|
||||
|
||||
// Play to the next frame
|
||||
if (g_FrameStep)
|
||||
{
|
||||
Run();
|
||||
Core::SetState(Core::CORE_RUN);
|
||||
}
|
||||
}
|
||||
|
||||
// Turn on frame stepping
|
||||
void FrameStepOnOff()
|
||||
{
|
||||
/* Turn frame step on or off. If a game is running and we turn this on it means that the game
|
||||
will pause after the next frame update */
|
||||
g_FrameStep = !g_FrameStep;
|
||||
|
||||
// Update status bar
|
||||
WriteStatus();
|
||||
|
||||
// If a game is not started, return
|
||||
if(Core::GetState() == Core::CORE_UNINITIALIZED) return;
|
||||
|
||||
// Run the emulation if we turned off framestepping
|
||||
if (!g_FrameStep)
|
||||
{
|
||||
Run();
|
||||
Core::SetState(Core::CORE_RUN);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// General functions
|
||||
// ---------------
|
||||
|
||||
// Write to the status bar
|
||||
void WriteStatus()
|
||||
{
|
||||
std::string TmpStr = "Time: " + ReRecTimer.GetTimeElapsedFormatted();
|
||||
TmpStr += StringFromFormat(" Frame: %s", ThousandSeparate(g_FrameCounter).c_str());
|
||||
// The FPS is the total average since the game was booted
|
||||
TmpStr += StringFromFormat(" FPS: %i", (g_FrameCounter * 1000) / ReRecTimer.GetTimeElapsed());
|
||||
TmpStr += StringFromFormat(" FrameStep: %s", g_FrameStep ? "On" : "Off");
|
||||
Host_UpdateStatusBar(TmpStr.c_str(), 1);
|
||||
}
|
||||
|
||||
|
||||
// When a new frame is drawn
|
||||
void FrameUpdate()
|
||||
{
|
||||
// Write to the status bar
|
||||
WriteStatus();
|
||||
/* I don't think the frequent update has any material speed inpact at all, but should it
|
||||
have you can controls the update speed by changing the "% 10" in this line */
|
||||
//if (g_FrameCounter % 10 == 0) WriteStatus();
|
||||
|
||||
// Pause if frame stepping is on
|
||||
if(g_FrameStep)
|
||||
{
|
||||
Pause();
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
}
|
||||
|
||||
// Count one frame
|
||||
g_FrameCounter++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // Core
|
||||
|
||||
|
||||
#endif // RERECORDING
|
@ -20,7 +20,6 @@
|
||||
#include "ChunkFile.h"
|
||||
#include "IniFile.h"
|
||||
#include "HLEMixer.h"
|
||||
#include "Setup.h"
|
||||
#include "StringUtil.h"
|
||||
#include "LogManager.h"
|
||||
#include "IniFile.h"
|
||||
|
@ -189,4 +189,4 @@ void SetInputManip(ManipFunction);
|
||||
void CallInputManip(SPADStatus *PadStatus, int controllerID);
|
||||
};
|
||||
|
||||
#endif // __FRAME_H
|
||||
#endif // __MOVIE_H
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "Common.h" // Common
|
||||
#include "FileUtil.h"
|
||||
#include "Timer.h"
|
||||
#include "Setup.h"
|
||||
|
||||
#include "Globals.h" // Local
|
||||
#include "Frame.h"
|
||||
@ -458,13 +457,6 @@ CFrame::CFrame(wxFrame* parent,
|
||||
|
||||
// Update controls
|
||||
UpdateGUI();
|
||||
|
||||
// If we are rerecording create the status bar now instead of later when a game starts
|
||||
#ifdef RERECORDING
|
||||
ModifyStatusBar();
|
||||
// It's to early for the OnHostMessage(), we will update the status when Ctrl or Space is pressed
|
||||
//Core::WriteStatus();
|
||||
#endif
|
||||
}
|
||||
// Destructor
|
||||
CFrame::~CFrame()
|
||||
|
@ -27,9 +27,6 @@ window handle that is returned by CreateWindow() can be accessed from
|
||||
Core::GetWindowHandle().
|
||||
*/
|
||||
|
||||
|
||||
#include "Setup.h" // Common
|
||||
|
||||
#include "NetWindow.h"
|
||||
#include "Common.h" // Common
|
||||
#include "FileUtil.h"
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "CPUDetect.h"
|
||||
#include "IniFile.h"
|
||||
#include "FileUtil.h"
|
||||
#include "Setup.h"
|
||||
|
||||
#include "Host.h" // Core
|
||||
#include "HW/Wiimote.h"
|
||||
|
@ -16,7 +16,6 @@
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "VideoConfig.h"
|
||||
#include "Setup.h"
|
||||
#include "MemoryUtil.h"
|
||||
#include "Thread.h"
|
||||
#include "Atomic.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "Globals.h"
|
||||
#include "VideoConfig.h"
|
||||
#include "IniFile.h"
|
||||
#include "Setup.h"
|
||||
#include "Core.h"
|
||||
#include "Host.h"
|
||||
#include "VideoBackend.h"
|
||||
|
@ -88,7 +88,6 @@ Make AA apply instantly during gameplay if possible
|
||||
#include "TextureConverter.h"
|
||||
#include "PostProcessing.h"
|
||||
#include "OnScreenDisplay.h"
|
||||
#include "Setup.h"
|
||||
#include "DLCache.h"
|
||||
#include "FramebufferManager.h"
|
||||
#include "Core.h"
|
||||
|
Loading…
Reference in New Issue
Block a user