timers.h (726B)
1 // SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com> 2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) 3 4 #pragma once 5 6 #include "types.h" 7 8 class StateWrapper; 9 10 namespace Timers { 11 12 void Initialize(); 13 void Shutdown(); 14 void Reset(); 15 bool DoState(StateWrapper& sw); 16 17 void SetGate(u32 timer, bool state); 18 19 void DrawDebugStateWindow(); 20 21 void CPUClocksChanged(); 22 23 // dot clock/hblank/sysclk div 8 24 bool IsUsingExternalClock(u32 timer); 25 bool IsSyncEnabled(u32 timer); 26 27 // queries for GPU 28 bool IsExternalIRQEnabled(u32 timer); 29 30 TickCount GetTicksUntilIRQ(u32 timer); 31 32 void AddTicks(u32 timer, TickCount ticks); 33 34 u32 ReadRegister(u32 offset); 35 void WriteRegister(u32 offset, u32 value); 36 37 } // namespace Timers