2014-07-24 20:14:46 -04:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2009-01-07 02:59:19 +00:00
|
|
|
|
2009-10-21 04:24:36 +00:00
|
|
|
// This file controls all system timers
|
|
|
|
|
|
|
|
/* (shuffle2) I don't know who wrote this, but take it with salt. For starters, "time" is contextual...
|
|
|
|
"Time" is measured in frames, not time: These update frequencies are determined by the passage
|
|
|
|
of frames. So if a game runs slow, on a slow computer for example, these updates will occur
|
|
|
|
less frequently. This makes sense because almost all console games are controlled by frames
|
|
|
|
rather than time, so if a game can't keep up with the normal framerate all animations and
|
2013-04-19 09:21:45 -04:00
|
|
|
actions slows down and the game runs to slow. This is different from PC games that are
|
2009-10-21 04:24:36 +00:00
|
|
|
often controlled by time instead and may not have maximum framerates.
|
|
|
|
|
|
|
|
However, I'm not sure if the Bluetooth communication for the Wiimote is entirely frame
|
|
|
|
dependent, the timing problems with the ack command in Zelda - TP may be related to
|
|
|
|
time rather than frames? For now the IPC_HLE_PERIOD is frame dependent, but because of
|
|
|
|
different conditions on the way to PluginWiimote::Wiimote_Update() the updates may actually
|
|
|
|
be time related after all, or not?
|
|
|
|
|
|
|
|
I'm not sure about this but the text below seems to assume that 60 fps means that the game
|
|
|
|
runs in the normal intended speed. In that case an update time of [GetTicksPerSecond() / 60]
|
|
|
|
would mean one update per frame and [GetTicksPerSecond() / 250] would mean four updates per
|
|
|
|
frame.
|
|
|
|
|
|
|
|
|
|
|
|
IPC_HLE_PERIOD: For the Wiimote this is the call schedule:
|
|
|
|
IPC_HLE_UpdateCallback() // In this file
|
|
|
|
|
|
|
|
// This function seems to call all devices' Update() function four times per frame
|
|
|
|
WII_IPC_HLE_Interface::Update()
|
|
|
|
|
|
|
|
// If the AclFrameQue is empty this will call Wiimote_Update() and make it send
|
|
|
|
the current input status to the game. I'm not sure if this occurs approximately
|
|
|
|
once every frame or if the frequency is not exactly tied to rendered frames
|
|
|
|
CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
|
|
|
|
PluginWiimote::Wiimote_Update()
|
|
|
|
|
|
|
|
// This is also a device updated by WII_IPC_HLE_Interface::Update() but it doesn't
|
|
|
|
seem to ultimately call PluginWiimote::Wiimote_Update(). However it can be called
|
|
|
|
by the /dev/usb/oh1 device if the AclFrameQue is empty.
|
|
|
|
CWII_IPC_HLE_WiiMote::Update()
|
|
|
|
*/
|
|
|
|
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "Common/Atomic.h"
|
|
|
|
#include "Common/Common.h"
|
|
|
|
#include "Common/Thread.h"
|
|
|
|
#include "Common/Timer.h"
|
|
|
|
|
|
|
|
#include "Core/ConfigManager.h"
|
2014-02-16 23:13:01 +01:00
|
|
|
#include "Core/Core.h"
|
2014-02-19 13:09:14 -05:00
|
|
|
#include "Core/CoreTiming.h"
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "Core/DSPEmulator.h"
|
|
|
|
#include "Core/PatchEngine.h"
|
|
|
|
#include "Core/HW/AudioInterface.h"
|
|
|
|
#include "Core/HW/DSP.h"
|
|
|
|
#include "Core/HW/EXI_DeviceIPL.h"
|
|
|
|
#include "Core/HW/SI.h"
|
|
|
|
#include "Core/HW/SystemTimers.h"
|
|
|
|
#include "Core/HW/VideoInterface.h"
|
|
|
|
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
2014-02-19 13:09:14 -05:00
|
|
|
#include "Core/PowerPC/PowerPC.h"
|
2014-02-17 05:18:15 -05:00
|
|
|
|
|
|
|
#include "VideoCommon/CommandProcessor.h"
|
|
|
|
#include "VideoCommon/VideoBackendBase.h"
|
2009-09-02 21:00:45 +00:00
|
|
|
|
2008-12-08 05:30:24 +00:00
|
|
|
|
|
|
|
namespace SystemTimers
|
|
|
|
{
|
|
|
|
|
2014-07-08 15:58:25 +02:00
|
|
|
static u32 CPU_CORE_CLOCK = 486000000u; // 486 mhz (its not 485, stop bugging me!)
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2009-10-21 04:24:36 +00:00
|
|
|
/*
|
2014-06-07 11:30:39 +09:00
|
|
|
GameCube MHz
|
2014-02-16 15:30:18 -05:00
|
|
|
flipper <-> ARAM bus: 81 (DSP)
|
|
|
|
gekko <-> flipper bus: 162
|
|
|
|
flipper <-> 1T-SRAM bus: 324
|
|
|
|
gekko: 486
|
2009-10-21 04:24:36 +00:00
|
|
|
|
|
|
|
These contain some guesses:
|
2014-02-16 15:30:18 -05:00
|
|
|
Wii MHz
|
|
|
|
hollywood <-> GDDR3 RAM bus: ??? no idea really
|
|
|
|
broadway <-> hollywood bus: 243
|
|
|
|
hollywood <-> 1T-SRAM bus: 486
|
|
|
|
broadway: 729
|
2009-10-21 04:24:36 +00:00
|
|
|
*/
|
2009-04-08 18:36:53 +00:00
|
|
|
// Ratio of TB and Decrementer to clock cycles.
|
|
|
|
// TB clk is 1/4 of BUS clk. And it seems BUS clk is really 1/3 of CPU clk.
|
|
|
|
// So, ratio is 1 / (1/4 * 1/3 = 1/12) = 12.
|
2008-12-08 05:30:24 +00:00
|
|
|
// note: ZWW is ok and faster with TIMER_RATIO=8 though.
|
|
|
|
// !!! POSSIBLE STABLE PERF BOOST HACK THERE !!!
|
2009-11-24 05:03:47 +00:00
|
|
|
|
2009-04-08 18:36:53 +00:00
|
|
|
enum
|
|
|
|
{
|
2008-12-08 05:30:24 +00:00
|
|
|
TIMER_RATIO = 12
|
|
|
|
};
|
|
|
|
|
2014-07-08 15:58:25 +02:00
|
|
|
static int et_Dec;
|
|
|
|
static int et_VI;
|
|
|
|
static int et_SI;
|
|
|
|
static int et_CP;
|
|
|
|
static int et_AudioDMA;
|
|
|
|
static int et_DSP;
|
|
|
|
static int et_IPC_HLE;
|
|
|
|
static int et_PatchEngine; // PatchEngine updates every 1/60th of a second by default
|
|
|
|
static int et_Throttle;
|
2008-12-08 05:30:24 +00:00
|
|
|
|
|
|
|
// These are badly educated guesses
|
2009-04-08 18:36:53 +00:00
|
|
|
// Feel free to experiment. Set these in Init below.
|
2014-07-08 15:58:25 +02:00
|
|
|
static int
|
2013-10-29 01:23:17 -04:00
|
|
|
// This is a fixed value, don't change it
|
2009-12-25 11:59:04 +00:00
|
|
|
AUDIO_DMA_PERIOD,
|
|
|
|
|
2013-02-16 12:51:09 +11:00
|
|
|
// Regulates the speed of the Command Processor
|
|
|
|
CP_PERIOD,
|
|
|
|
|
2008-12-08 05:30:24 +00:00
|
|
|
// This is completely arbitrary. If we find that we need lower latency, we can just
|
|
|
|
// increase this number.
|
2010-01-14 10:52:14 +00:00
|
|
|
IPC_HLE_PERIOD;
|
2009-09-02 21:00:45 +00:00
|
|
|
|
2009-01-07 02:59:19 +00:00
|
|
|
|
2008-12-08 05:30:24 +00:00
|
|
|
|
|
|
|
u32 GetTicksPerSecond()
|
|
|
|
{
|
|
|
|
return CPU_CORE_CLOCK;
|
|
|
|
}
|
|
|
|
|
2009-04-08 18:36:53 +00:00
|
|
|
// DSP/CPU timeslicing.
|
2014-07-08 14:29:26 +02:00
|
|
|
static void DSPCallback(u64 userdata, int cyclesLate)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2011-01-02 00:16:13 +00:00
|
|
|
//splits up the cycle budget in case lle is used
|
|
|
|
//for hle, just gives all of the slice to hle
|
2013-04-12 12:08:05 +10:00
|
|
|
DSP::UpdateDSPSlice(DSP::GetDSPEmulator()->DSP_UpdateRate() - cyclesLate);
|
|
|
|
CoreTiming::ScheduleEvent(DSP::GetDSPEmulator()->DSP_UpdateRate() - cyclesLate, et_DSP);
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void AudioDMACallback(u64 userdata, int cyclesLate)
|
2009-01-15 06:48:15 +00:00
|
|
|
{
|
2013-04-15 20:23:25 +10:00
|
|
|
int fields = VideoInterface::GetNumFields();
|
2011-01-23 03:28:05 +00:00
|
|
|
int period = CPU_CORE_CLOCK / (AudioInterface::GetAIDSampleRate() * 4 / 32 * fields);
|
2008-12-08 05:30:24 +00:00
|
|
|
DSP::UpdateAudioDMA(); // Push audio to speakers.
|
2010-11-01 23:41:20 +00:00
|
|
|
CoreTiming::ScheduleEvent(period - cyclesLate, et_AudioDMA);
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate)
|
2009-01-15 06:48:15 +00:00
|
|
|
{
|
2010-02-06 05:22:53 +00:00
|
|
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
2010-09-14 12:32:02 +00:00
|
|
|
{
|
2014-05-27 20:12:12 -07:00
|
|
|
WII_IPC_HLE_Interface::UpdateDevices();
|
2010-09-14 12:32:02 +00:00
|
|
|
CoreTiming::ScheduleEvent(IPC_HLE_PERIOD - cyclesLate, et_IPC_HLE);
|
|
|
|
}
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void VICallback(u64 userdata, int cyclesLate)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
|
|
|
VideoInterface::Update();
|
2010-10-21 14:50:42 +00:00
|
|
|
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerLine() - cyclesLate, et_VI);
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void SICallback(u64 userdata, int cyclesLate)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2009-02-20 23:42:21 +00:00
|
|
|
SerialInterface::UpdateDevices();
|
2009-10-21 05:24:45 +00:00
|
|
|
CoreTiming::ScheduleEvent(SerialInterface::GetTicksToNextSIPoll() - cyclesLate, et_SI);
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void CPCallback(u64 userdata, int cyclesLate)
|
2013-02-16 12:51:09 +11:00
|
|
|
{
|
|
|
|
CommandProcessor::Update();
|
|
|
|
CoreTiming::ScheduleEvent(CP_PERIOD - cyclesLate, et_CP);
|
|
|
|
}
|
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void DecrementerCallback(u64 userdata, int cyclesLate)
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
|
|
|
PowerPC::ppcState.spr[SPR_DEC] = 0xFFFFFFFF;
|
2010-09-01 22:03:51 +00:00
|
|
|
Common::AtomicOr(PowerPC::ppcState.Exceptions, EXCEPTION_DECREMENTER);
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DecrementerSet()
|
|
|
|
{
|
|
|
|
u32 decValue = PowerPC::ppcState.spr[SPR_DEC];
|
2010-09-01 23:44:03 +00:00
|
|
|
|
2008-12-08 05:30:24 +00:00
|
|
|
CoreTiming::RemoveEvent(et_Dec);
|
2010-09-01 23:44:03 +00:00
|
|
|
if ((decValue & 0x80000000) == 0)
|
|
|
|
{
|
2011-01-19 08:13:15 +00:00
|
|
|
CoreTiming::SetFakeDecStartTicks(CoreTiming::GetTicks());
|
|
|
|
CoreTiming::SetFakeDecStartValue(decValue);
|
2013-10-29 01:23:17 -04:00
|
|
|
|
2010-09-01 23:44:03 +00:00
|
|
|
CoreTiming::ScheduleEvent(decValue * TIMER_RATIO, et_Dec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 GetFakeDecrementer()
|
|
|
|
{
|
2011-01-19 08:13:15 +00:00
|
|
|
return (CoreTiming::GetFakeDecStartValue() - (u32)((CoreTiming::GetTicks() - CoreTiming::GetFakeDecStartTicks()) / TIMER_RATIO));
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2010-09-01 23:44:03 +00:00
|
|
|
void TimeBaseSet()
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2011-01-19 08:13:15 +00:00
|
|
|
CoreTiming::SetFakeTBStartTicks(CoreTiming::GetTicks());
|
|
|
|
CoreTiming::SetFakeTBStartValue(*((u64 *)&TL));
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
2010-09-01 23:44:03 +00:00
|
|
|
u64 GetFakeTimeBase()
|
|
|
|
{
|
2011-01-19 08:13:15 +00:00
|
|
|
return CoreTiming::GetFakeTBStartValue() + ((CoreTiming::GetTicks() - CoreTiming::GetFakeTBStartTicks()) / TIMER_RATIO);
|
2010-09-01 23:44:03 +00:00
|
|
|
}
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void PatchEngineCallback(u64 userdata, int cyclesLate)
|
2009-10-21 04:24:36 +00:00
|
|
|
{
|
|
|
|
// Patch mem and run the Action Replay
|
|
|
|
PatchEngine::ApplyFramePatches();
|
|
|
|
PatchEngine::ApplyARPatches();
|
2010-01-14 10:52:14 +00:00
|
|
|
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame() - cyclesLate, et_PatchEngine);
|
2009-10-21 04:24:36 +00:00
|
|
|
}
|
|
|
|
|
2014-07-08 14:29:26 +02:00
|
|
|
static void ThrottleCallback(u64 last_time, int cyclesLate)
|
2014-02-06 18:17:03 +01:00
|
|
|
{
|
|
|
|
u32 time = Common::Timer::GetTimeMs();
|
|
|
|
|
|
|
|
int diff = (u32)last_time - time;
|
2014-02-16 23:13:01 +01:00
|
|
|
const SConfig& config = SConfig::GetInstance();
|
2014-07-24 08:16:17 -04:00
|
|
|
bool frame_limiter = config.m_Framelimit && !Core::GetIsFramelimiterTempDisabled();
|
2014-02-06 18:17:03 +01:00
|
|
|
u32 next_event = GetTicksPerSecond()/1000;
|
2014-07-24 08:16:17 -04:00
|
|
|
if (SConfig::GetInstance().m_Framelimit > 1)
|
2014-02-06 18:17:03 +01:00
|
|
|
{
|
|
|
|
next_event = next_event * (SConfig::GetInstance().m_Framelimit - 1) * 5 / VideoInterface::TargetRefreshRate;
|
|
|
|
}
|
|
|
|
|
|
|
|
const int max_fallback = 40; // 40 ms for one frame on 25 fps games
|
|
|
|
if (frame_limiter && abs(diff) > max_fallback)
|
|
|
|
{
|
2014-02-16 12:57:17 +01:00
|
|
|
DEBUG_LOG(COMMON, "system too %s, %d ms skipped", diff<0 ? "slow" : "fast", abs(diff) - max_fallback);
|
2014-02-06 18:17:03 +01:00
|
|
|
last_time = time - max_fallback;
|
|
|
|
}
|
|
|
|
else if (frame_limiter && diff > 0)
|
|
|
|
Common::SleepCurrentThread(diff);
|
|
|
|
CoreTiming::ScheduleEvent(next_event - cyclesLate, et_Throttle, last_time + 1);
|
|
|
|
}
|
|
|
|
|
2012-01-02 02:20:22 -08:00
|
|
|
// split from Init to break a circular dependency between VideoInterface::Init and SystemTimers::Init
|
|
|
|
void PreInit()
|
2008-12-08 05:30:24 +00:00
|
|
|
{
|
2010-02-06 05:22:53 +00:00
|
|
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
2009-02-09 00:39:51 +00:00
|
|
|
CPU_CORE_CLOCK = 729000000u;
|
2012-01-02 02:20:22 -08:00
|
|
|
else
|
|
|
|
CPU_CORE_CLOCK = 486000000u;
|
|
|
|
}
|
2009-04-08 20:26:33 +00:00
|
|
|
|
2012-01-02 02:20:22 -08:00
|
|
|
void Init()
|
|
|
|
{
|
|
|
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
|
|
|
{
|
2009-11-24 05:03:47 +00:00
|
|
|
// AyuanX: TO BE TWEAKED
|
2013-02-04 16:00:11 -06:00
|
|
|
// Now the 1500 is a pure assumption
|
2009-12-07 12:48:39 +00:00
|
|
|
// We need to figure out the real frequency though
|
Apply (a variation of) the first patch attached to issue 4608. This should limit the amount of ACL packet loss due to the 200Hz timing (which is now 150Hz if you disable Wiimote Speaker) and the handling of the ACL pool when it's occasionally full (which this improves by dropping one packet instead of letting the "pointers" overlap which would make packets unreachable).
See comment #6 for more details on the changes to WII_IPC_HLE_Device_usb.
In addition to that, rework some comments a bit (such as those from the
original patch; plus Ayuanx's one about maintaining Wiimote timing, which lost
relevance since r7272 which made Wiimote::Update timing independent from IPC
timing), and remove an unused global variable (event for watchdog hack)...
In short, this should address *some* of the Wiimote disconnection and/or "forgotten extension" problems that appeared with r7272 and/or r7394. To prevent the "ACL queue is full" warnings from appearing (View->Show Log), pay attention to the amount of enabled Wiimotes (use as few as possible, connect the extra Wiimotes only when needed), and make sure to disable the "Disable Wiimote Speaker" option (if unneeded or causing problems) in the game properties. If possible, make sure to use real Wiimotes instead of emulated ones, as well.
If Wiimotes disconnect forever (and cannot be reconnected using the Alt+Fx hotkeys), open the Wiimote config window, set the faulty Wiimote's type to "None", close/reopen the window, and set the previous Wiimote type back.
Note that it's not a *complete* fix for issue 4608! This only fixes about half (or maybe third) of the possible causes of this issue... But at least this should make the accurate Wiimote emulation (I mean, with the limitation of the ACL queue included) more usable in some cases (such as multi-player).
Nope, I didn't (and can't yet) perform in-depth tests on the real hardware myself (unlike some developers), I just rely on the given "accurate" code and numbers (such as the 10-packet limit implemented by godisgovernment)...
Maybe I'll get to fixing other problem "causes" (if I feel like doing it), maybe not in a while... After all, I have other hobbies, and it's the summer holidays for me...
Anyway, feel free to test and comment.
Update issue 4667
Update issue 4608
Update issue 4604
Update issue 4583
Update issue 4436
Update issue 4353
Update issue 4013
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7675 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-07-12 15:49:08 +00:00
|
|
|
|
2013-02-04 16:00:11 -06:00
|
|
|
// FYI, WII_IPC_HLE_Interface::Update is also called in WII_IPCInterface::Write32
|
|
|
|
const int freq = 1500;
|
2013-04-16 21:18:53 +10:00
|
|
|
IPC_HLE_PERIOD = GetTicksPerSecond() / (freq * VideoInterface::GetNumFields());
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
2009-10-21 04:24:36 +00:00
|
|
|
|
2010-10-21 14:50:42 +00:00
|
|
|
// System internal sample rate is fixed at 32KHz * 4 (16bit Stereo) / 32 bytes DMA
|
2010-11-16 20:36:57 +00:00
|
|
|
AUDIO_DMA_PERIOD = CPU_CORE_CLOCK / (AudioInterface::GetAIDSampleRate() * 4 / 32);
|
2009-12-25 11:59:04 +00:00
|
|
|
|
2013-02-16 12:51:09 +11:00
|
|
|
// Emulated gekko <-> flipper bus speed ratio (cpu clock / flipper clock)
|
|
|
|
CP_PERIOD = GetTicksPerSecond() / 10000;
|
|
|
|
|
2008-12-08 05:30:24 +00:00
|
|
|
Common::Timer::IncreaseResolution();
|
2008-12-13 11:57:01 +00:00
|
|
|
// store and convert localtime at boot to timebase ticks
|
2011-01-19 08:13:15 +00:00
|
|
|
CoreTiming::SetFakeTBStartValue((u64)(CPU_CORE_CLOCK / TIMER_RATIO) * (u64)CEXIIPL::GetGCTime());
|
|
|
|
CoreTiming::SetFakeTBStartTicks(CoreTiming::GetTicks());
|
2010-09-01 23:44:03 +00:00
|
|
|
|
2011-01-19 08:13:15 +00:00
|
|
|
CoreTiming::SetFakeDecStartValue(0xFFFFFFFF);
|
|
|
|
CoreTiming::SetFakeDecStartTicks(CoreTiming::GetTicks());
|
2008-12-08 05:30:24 +00:00
|
|
|
|
|
|
|
et_Dec = CoreTiming::RegisterEvent("DecCallback", DecrementerCallback);
|
|
|
|
et_VI = CoreTiming::RegisterEvent("VICallback", VICallback);
|
|
|
|
et_SI = CoreTiming::RegisterEvent("SICallback", SICallback);
|
2013-02-16 12:51:09 +11:00
|
|
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPU)
|
|
|
|
et_CP = CoreTiming::RegisterEvent("CPCallback", CPCallback);
|
2008-12-08 05:30:24 +00:00
|
|
|
et_DSP = CoreTiming::RegisterEvent("DSPCallback", DSPCallback);
|
2009-12-25 11:59:04 +00:00
|
|
|
et_AudioDMA = CoreTiming::RegisterEvent("AudioDMACallback", AudioDMACallback);
|
2008-12-08 05:30:24 +00:00
|
|
|
et_IPC_HLE = CoreTiming::RegisterEvent("IPC_HLE_UpdateCallback", IPC_HLE_UpdateCallback);
|
2009-10-21 04:24:36 +00:00
|
|
|
et_PatchEngine = CoreTiming::RegisterEvent("PatchEngine", PatchEngineCallback);
|
2014-02-06 18:17:03 +01:00
|
|
|
et_Throttle = CoreTiming::RegisterEvent("Throttle", ThrottleCallback);
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2010-10-21 14:50:42 +00:00
|
|
|
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerLine(), et_VI);
|
2013-04-12 12:08:05 +10:00
|
|
|
CoreTiming::ScheduleEvent(0, et_DSP);
|
2010-01-14 10:52:14 +00:00
|
|
|
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame(), et_SI);
|
2009-12-25 11:59:04 +00:00
|
|
|
CoreTiming::ScheduleEvent(AUDIO_DMA_PERIOD, et_AudioDMA);
|
2014-02-06 18:17:03 +01:00
|
|
|
CoreTiming::ScheduleEvent(0, et_Throttle, Common::Timer::GetTimeMs());
|
2013-02-16 12:51:09 +11:00
|
|
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bSyncGPU)
|
|
|
|
CoreTiming::ScheduleEvent(CP_PERIOD, et_CP);
|
2008-12-08 05:30:24 +00:00
|
|
|
|
2010-01-14 10:52:14 +00:00
|
|
|
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerFrame(), et_PatchEngine);
|
2009-10-21 04:24:36 +00:00
|
|
|
|
2010-02-06 05:22:53 +00:00
|
|
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
2009-10-21 04:24:36 +00:00
|
|
|
CoreTiming::ScheduleEvent(IPC_HLE_PERIOD, et_IPC_HLE);
|
2008-12-08 05:30:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Shutdown()
|
|
|
|
{
|
|
|
|
Common::Timer::RestoreResolution();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|