2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2014-07-24 20:14:46 -04:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "Common/CommonTypes.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
namespace SystemTimers
|
|
|
|
{
|
2014-08-19 21:52:09 -07:00
|
|
|
/*
|
|
|
|
GameCube MHz
|
|
|
|
flipper <-> ARAM bus: 81 (DSP)
|
|
|
|
gekko <-> flipper bus: 162
|
|
|
|
flipper <-> 1T-SRAM bus: 324
|
|
|
|
gekko: 486
|
|
|
|
|
|
|
|
These contain some guesses:
|
|
|
|
Wii MHz
|
|
|
|
hollywood <-> GDDR3 RAM bus: ??? no idea really
|
|
|
|
broadway <-> hollywood bus: 243
|
|
|
|
hollywood <-> 1T-SRAM bus: 486
|
|
|
|
broadway: 729
|
|
|
|
*/
|
|
|
|
// 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.
|
|
|
|
// note: ZWW is ok and faster with TIMER_RATIO=8 though.
|
|
|
|
// !!! POSSIBLE STABLE PERF BOOST HACK THERE !!!
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2016-06-24 10:43:46 +02:00
|
|
|
TIMER_RATIO = 12
|
2014-08-19 21:52:09 -07:00
|
|
|
};
|
|
|
|
|
2017-01-28 18:12:05 +01:00
|
|
|
enum class Mode
|
|
|
|
{
|
|
|
|
GC,
|
|
|
|
Wii,
|
|
|
|
};
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
u32 GetTicksPerSecond();
|
2012-01-02 02:20:22 -08:00
|
|
|
void PreInit();
|
2008-12-08 04:46:09 +00:00
|
|
|
void Init();
|
|
|
|
void Shutdown();
|
2017-01-28 18:12:05 +01:00
|
|
|
void ChangePPCClock(Mode mode);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
|
|
|
// Notify timing system that somebody wrote to the decrementer
|
|
|
|
void DecrementerSet();
|
2010-09-01 23:44:03 +00:00
|
|
|
u32 GetFakeDecrementer();
|
|
|
|
|
|
|
|
void TimeBaseSet();
|
|
|
|
u64 GetFakeTimeBase();
|
2016-07-13 16:46:14 -04:00
|
|
|
// Custom RTC
|
2016-07-19 14:21:29 -04:00
|
|
|
s64 GetLocalTimeRTCOffset();
|
2008-12-08 04:46:09 +00:00
|
|
|
}
|