linux compile fix, I'm not sure it was right of me to remove the mmsystem include (was it used?) but if it's

for the timer function please put it in Timer.h and not in each seperate file.
(And yes, I have a script that does that).


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3448 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2009-06-15 06:39:26 +00:00
parent 5c04af50a4
commit 75045807a7
5 changed files with 58 additions and 83 deletions

View File

@ -16,9 +16,6 @@
// http://code.google.com/p/dolphin-emu/
//////////////////////////////////////////////////////////////////////////////////////////
// Include
//
#ifdef _WIN32
#include <windows.h>
#else
@ -68,9 +65,9 @@
namespace Core
{
//////////////////////////////////////////////////////////////////////////////////////////
// Declarations and definitions
// ------------
// Function forwarding
//void Callback_VideoRequestWindowSize(int _iWidth, int _iHeight, BOOL _bFullscreen);
@ -104,9 +101,9 @@ SCoreStartupParameter g_CoreStartupParameter;
Common::Event emuThreadGoing;
Common::Event cpuRunloopQuit;
// -----------------------------------------
#ifdef SETUP_TIMER_WAITING
// -----------------
bool VideoThreadRunning = false;
bool StopUpToVideoDone = false;
bool EmuThreadReachedEnd = false;
@ -115,11 +112,11 @@ Common::Event cpuRunloopQuit;
static Common::Event VideoThreadEvent2;
void EmuThreadEnd();
#endif
// ---------------------------
//////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Display messages and return values
//
bool PanicAlertToVideo(const char* text, bool yes_no)
@ -174,9 +171,9 @@ void ReconnectWiimote()
INFO_LOG(CONSOLE, "ReconnectWiimote()\n");
}
// -----------------------------------------
#ifdef SETUP_TIMER_WAITING
// -----------------
void VideoThreadEnd()
{
VideoThreadRunning = false;
@ -185,13 +182,13 @@ void ReconnectWiimote()
//INFO_LOG(CONSOLE, "VideoThreadEnd\n");
}
#endif
// ---------------------------
/////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// This is called from the GUI thread. See the booting call schedule in BootManager.cpp
// -----------------
bool Init()
{
if (g_EmuThread != NULL)
@ -241,7 +238,6 @@ void Stop()
#ifdef SETUP_TIMER_WAITING
if (!StopUpToVideoDone)
{
INFO_LOG(CONSOLE, "--------------------------------------------------------------\n");
INFO_LOG(CONSOLE, "Stop [Main Thread]: Shutting down...\n");
// Reset variables
StopReachedEnd = false;
@ -306,15 +302,13 @@ void Stop()
Host_UpdateGUI();
StopUpToVideoDone = false;
StopReachedEnd = true;
//INFO_LOG(CONSOLE, "Stop() reached the end\n");
if (EmuThreadReachedEnd) INFO_LOG(CONSOLE, "--------------------------------------------------------------\n");
#endif
}
//////////////////////////////////////////////////////////////////////////////////////////
// Create the CPU thread. For use with Single Core mode only.
// ---------------
THREAD_RETURN CpuThread(void *pArg)
{
Common::SetCurrentThreadName("CPU thread");
@ -346,12 +340,12 @@ THREAD_RETURN CpuThread(void *pArg)
cpuRunloopQuit.Set();
return 0;
}
//////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Initalize plugins and create emulation thread
// -------------
// Call browser: Init():g_EmuThread(). See the BootManager.cpp file description for a complete call schedule.
THREAD_RETURN EmuThread(void *pArg)
{
@ -581,10 +575,8 @@ void EmuThreadEnd()
Host_UpdateMainFrame();
#ifdef SETUP_TIMER_WAITING
EmuThreadReachedEnd = true;
//INFO_LOG(CONSOLE, "EmuThread() reached the end\n");
Host_UpdateGUI();
INFO_LOG(CONSOLE, "Stop [Video Thread]: Done\n");
if (StopReachedEnd) INFO_LOG(CONSOLE, "--------------------------------------------------------------\n");
delete g_EmuThread; // Wait for emuthread to close.
g_EmuThread = 0;
#endif
@ -594,9 +586,9 @@ void EmuThreadEnd()
}
//////////////////////////////////////////////////////////////////////////////////////////
// Set or get the running state
// --------------
void SetState(EState _State)
{
switch (_State)
@ -640,7 +632,7 @@ void LoadState() {
// --- Callbacks for plugins / engine ---
// __________________________________________________________________________________________________
// Callback_VideoLog
// WARNING - THIS IS EXECUTED FROM VIDEO THREAD
void Callback_VideoLog(const TCHAR *_szMessage, int _bDoBreak)
@ -648,7 +640,7 @@ void Callback_VideoLog(const TCHAR *_szMessage, int _bDoBreak)
INFO_LOG(VIDEO, _szMessage);
}
// __________________________________________________________________________________________________
// Callback_VideoCopiedToXFB
// WARNING - THIS IS EXECUTED FROM VIDEO THREAD
// We do not write to anything outside this function here
@ -673,7 +665,7 @@ void Callback_VideoCopiedToXFB()
frames++;
// -----------------------------------------------------------------------
// Custom frame limiter
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (targetfps > 0)
@ -686,9 +678,9 @@ void Callback_VideoCopiedToXFB()
if (wait_frametime > 0)
Common::SleepCurrentThread(wait_frametime*2);
}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// Is it possible to calculate the CPU-GPU synced ticks for the dual core mode too?
// And possible the idle skipping mode too?
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@ -699,7 +691,7 @@ void Callback_VideoCopiedToXFB()
// please fix it if possible.
if (Diff > 0) VideoInterface::SyncTicksProgress -= Diff * 700;
DistOld = CommandProcessor::fifo.CPReadWriteDistance;
// -----------------------------------------------------------------------
if (Timer.GetTimeDifference() >= 1000)
{
@ -724,10 +716,10 @@ void Callback_VideoCopiedToXFB()
float FPS = (float)frames / t;
float FPS_To_VPS_Rate = ((float)FPS / VideoInterface::ActualRefreshRate);
// ---------------------------------------------------------------------
// For the sake of the dual core mode calculate an average to somewhat reduce the variations
// in the FPS/VPS rate
// ______________________________
/**/
if (_CoreParameter.bUseDualCore)
{
@ -739,7 +731,7 @@ void Callback_VideoCopiedToXFB()
FPS_To_VPS_Rate = MathFloatVectorSum(FPSVPSList) / AverageOver;
}
// ---------------------------------------------------------------------
// Correct the FPS/VPS rate for temporary CPU-GPU timing variations. This rate can only be 1/Integer
// so we set it to either 0.33, 0.5 or 1.0 depending on which it's closest to.
/*
@ -751,7 +743,7 @@ void Callback_VideoCopiedToXFB()
3. PAL 50Hz games: Are 'patched' so that they still run at the correct speed. So if the NTSC 60Hz
version has a FPS/VPS of 0.5 the 50Hz game will run at 0.6.
*/
// ______________________________
/**/
if (FPS_To_VPS_Rate > 0 && FPS_To_VPS_Rate < ((1.0/3.0 + 1.0/2.0)/2)) FPS_To_VPS_Rate = 1.0/3.0;
else if (FPS_To_VPS_Rate > ((1.0/3.0 + 1.0/2.0)/2) && FPS_To_VPS_Rate < ((1.0/2.0 + 1.0/1.0)/2)) FPS_To_VPS_Rate = 1.0/2.0;
@ -759,7 +751,7 @@ void Callback_VideoCopiedToXFB()
// PAL patch adjustment
if (VideoInterface::TargetRefreshRate == 50) FPS_To_VPS_Rate = FPS_To_VPS_Rate * 1.2;
// ---------------------------------------------------------------------
float TargetFPS = FPS_To_VPS_Rate * (float)VideoInterface::TargetRefreshRate;
float FPSPercentage = (FPS / TargetFPS) * 100.0;
float VPSPercentage = (VideoInterface::ActualRefreshRate / (float)VideoInterface::TargetRefreshRate) * 100.0;
@ -815,7 +807,7 @@ void Callback_VideoCopiedToXFB()
}
}
// __________________________________________________________________________________________________
// Callback_DSPLog
// WARNING - THIS MAY EXECUTED FROM DSP THREAD
void Callback_DSPLog(const TCHAR* _szMessage, int _v)
@ -823,7 +815,7 @@ void Callback_VideoCopiedToXFB()
GENERIC_LOG(LogTypes::AUDIO, (LogTypes::LOG_LEVELS)_v, _szMessage);
}
// __________________________________________________________________________________________________
// Callback_DSPInterrupt
// WARNING - THIS MAY EXECUTED FROM DSP THREAD
void Callback_DSPInterrupt()
@ -831,7 +823,7 @@ void Callback_DSPInterrupt()
DSP::GenerateDSPInterruptFromPlugin(DSP::INT_DSP);
}
// __________________________________________________________________________________________________
// Callback_PADLog
//
void Callback_PADLog(const TCHAR* _szMessage)
@ -840,7 +832,7 @@ void Callback_PADLog(const TCHAR* _szMessage)
INFO_LOG(SERIALINTERFACE, _szMessage);
}
// __________________________________________________________________________________________________
// Callback_ISOName: Let the DSP plugin get the game name
//
const char *Callback_ISOName()
@ -852,7 +844,7 @@ const char *Callback_ISOName()
return "";
}
// __________________________________________________________________________________________________
// Called from ANY thread!
void Callback_KeyPress(int key, bool shift, bool control)
{
@ -868,7 +860,6 @@ void Callback_KeyPress(int key, bool shift, bool control)
}
}
// __________________________________________________________________________________________________
// Callback_WiimoteLog
//
void Callback_WiimoteLog(const TCHAR* _szMessage, int _v)

View File

@ -22,8 +22,6 @@
#include "CoreTiming.h"
#include "StringUtil.h"
#include <mmsystem.h>
namespace CoreTiming
{

View File

@ -29,8 +29,7 @@
#include "../CoreTiming.h"
#include "../HW/SystemTimers.h"
#include "StringUtil.h"
#include <mmsystem.h>
#include "Timer.h"
namespace VideoInterface
{
@ -1006,9 +1005,8 @@ u8* GetXFBPointerBottom()
}
//////////////////////////////////////////////////////////////////////////////////////////
// Screenshot and screen message
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void UpdateTiming()
{
switch (m_DisplayControlRegister.FMT)
@ -1035,19 +1033,16 @@ void UpdateTiming()
break;
}
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Purpose 1: Send VI interrupt for every screen refresh
// Purpose 2: Execute XFB copy in homebrew games
// Run when: This is run 7200 times per second on full speed
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Update()
{
// -----------------------------------------------------------------------
// Calculate actual refresh rate
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// Update the target refresh rate
TargetRefreshRate = (m_DisplayControlRegister.FMT == 0 || m_DisplayControlRegister.FMT == 2)
? 60 : 50;
@ -1068,7 +1063,7 @@ void Update()
LastTick = CoreTiming::GetTicks();
SyncTicksProgress = 0;
}
// -----------------------------------------------------------------------
// Go through all lines
while ((CoreTiming::GetTicks() - LastTime) > (TicksPerFrame / LineCount))
@ -1142,6 +1137,5 @@ void Update()
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////
} // namespace

View File

@ -104,10 +104,8 @@ void Fifo_ExitLoopNonBlocking() {
fifoStateRun = false;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Fifo_EnterLoop() sends data through this function.
// TODO: Possibly inline it? This one is exported so it will likely not be inlined at all.
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Video_SendFifoData(u8* _uData, u32 len)
{
if (size + len >= FIFO_SIZE)
@ -126,13 +124,9 @@ void Video_SendFifoData(u8* _uData, u32 len)
size += len;
OpcodeDecoder_Run();
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Main FIFO update loop
// Purpose: Keep the Core HW updated about the CPU-GPU distance
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
{
fifoStateRun = true;
@ -226,4 +220,4 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
fifo_exit_event.SetTimer();
#endif
}
//////////////////////////////////////////////////////////////////////////////////////////