Initial Commit

This commit is contained in:
2024-07-12 19:48:34 +02:00
parent 9fd5826e0e
commit ac9e58cce2
89 changed files with 50981 additions and 23 deletions

31
source/Timer.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include <pd/Timer.hpp>
// Ticks per MSEC
#define TPMS 268111.856
namespace Palladium {
Timer::Timer(bool autostart) {
if (autostart) is_running = true;
last = svcGetSystemTick();
current = last;
}
void Timer::Reset() {
last = svcGetSystemTick();
current = last;
}
void Timer::Tick() {
if (is_running) current = svcGetSystemTick();
}
void Timer::Pause() { is_running = false; }
void Timer::Resume() { is_running = true; }
bool Timer::Running() { return is_running; }
float Timer::Get() { return (float)((current - last) / TPMS); }
float Timer::GetLive() { return (float)((svcGetSystemTick() - last) / TPMS); }
} // namespace Palladium