Duckstation/src/core/timers.h

37 lines
725 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
2019-09-20 13:40:19 +00:00
#pragma once
#include "types.h"
class StateWrapper;
2023-01-11 08:58:25 +00:00
namespace Timers {
2019-09-20 13:40:19 +00:00
2023-01-11 08:58:25 +00:00
void Initialize();
void Shutdown();
void Reset();
bool DoState(StateWrapper& sw);
2019-09-20 13:40:19 +00:00
2023-01-11 08:58:25 +00:00
void SetGate(u32 timer, bool state);
2019-09-20 13:40:19 +00:00
2023-01-11 08:58:25 +00:00
void DrawDebugStateWindow();
2019-09-20 13:40:19 +00:00
2023-01-11 08:58:25 +00:00
void CPUClocksChanged();
2019-10-12 12:15:38 +00:00
2023-01-11 08:58:25 +00:00
// dot clock/hblank/sysclk div 8
bool IsUsingExternalClock(u32 timer);
bool IsSyncEnabled(u32 timer);
2023-01-11 08:58:25 +00:00
// queries for GPU
bool IsExternalIRQEnabled(u32 timer);
2023-01-11 08:58:25 +00:00
TickCount GetTicksUntilIRQ(u32 timer);
2023-01-11 08:58:25 +00:00
void AddTicks(u32 timer, TickCount ticks);
2023-01-11 08:58:25 +00:00
u32 ReadRegister(u32 offset);
void WriteRegister(u32 offset, u32 value);
2019-09-20 13:40:19 +00:00
2023-01-11 08:58:25 +00:00
} // namespace Timers