Timer patches

This commit is contained in:
nastys
2019-10-13 02:10:42 +02:00
parent ace2ea03f3
commit 42bee2ffaf
8 changed files with 26 additions and 75 deletions
@@ -4,7 +4,6 @@
#include "Input/InputEmulator.h"
#include "Input/TouchSliderEmulator.h"
#include "Input/TouchPanelEmulator.h"
#include "SysTimer.h"
#include "PlayerDataManager.h"
#include "FrameRateManager.h"
#include "FastLoader.h"
@@ -37,7 +36,6 @@ namespace TLAC::Components
new InputEmulator(),
new TouchSliderEmulator(),
new TouchPanelEmulator(),
new SysTimer(),
new PlayerDataManager(),
new FrameRateManager(),
new FastLoader(),
@@ -1,34 +0,0 @@
#include "SysTimer.h"
#include "../Constants.h"
namespace TLAC::Components
{
SysTimer::SysTimer()
{
}
SysTimer::~SysTimer()
{
}
const char* SysTimer::GetDisplayName()
{
return "sys_timer";
}
void SysTimer::Initialize(ComponentsManager*)
{
selPvTime = GetSysTimePtr((void*)SEL_PV_TIME_ADDRESS);
}
void SysTimer::Update()
{
// account for the decrement that occures during this frame
*selPvTime = SEL_PV_FREEZE_TIME * SYS_TIME_FACTOR + 1;
}
int* SysTimer::GetSysTimePtr(void *address)
{
return (int*)address;
}
}
@@ -1,25 +0,0 @@
#pragma once
#include "EmulatorComponent.h"
namespace TLAC::Components
{
class SysTimer : public EmulatorComponent
{
const int SYS_TIME_FACTOR = 60;
const int SEL_PV_FREEZE_TIME = 39;
public:
SysTimer();
~SysTimer();
virtual const char* GetDisplayName() override;
virtual void Initialize(ComponentsManager*) override;
virtual void Update() override;
private:
int* selPvTime;
int* GetSysTimePtr(void *address);
};
}