From d507c7df9d4caea409031114ca8416dc82ad5f69 Mon Sep 17 00:00:00 2001 From: Jean-Philip Desjardins Date: Wed, 2 Jan 2019 21:32:11 -0500 Subject: [PATCH] Add some timer related constants. --- Source/ee/Timer.cpp | 10 +++++----- Source/ee/Timer.h | 12 ++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Source/ee/Timer.cpp b/Source/ee/Timer.cpp index 725dbd26..7d91c5a1 100644 --- a/Source/ee/Timer.cpp +++ b/Source/ee/Timer.cpp @@ -30,18 +30,18 @@ void CTimer::Count(unsigned int ticks) uint32 nextCount = timer.nCOUNT; uint32 divider = 1; - switch(timer.nMODE & 0x03) + switch(timer.nMODE & MODE_CLOCK_SELECT) { - case 0x00: + case MODE_CLOCK_SELECT_BUSCLOCK: divider = 1; break; - case 0x01: + case MODE_CLOCK_SELECT_BUSCLOCK16: divider = 16; break; - case 0x02: + case MODE_CLOCK_SELECT_BUSCLOCK256: divider = 256; break; - case 0x03: + case MODE_CLOCK_SELECT_EXTERNAL: divider = 9437; // PAL break; } diff --git a/Source/ee/Timer.h b/Source/ee/Timer.h index 26d9f5fd..382cd73b 100644 --- a/Source/ee/Timer.h +++ b/Source/ee/Timer.h @@ -10,6 +10,13 @@ class CTimer public: enum { + MODE_CLOCK_SELECT = 0x003, + + MODE_CLOCK_SELECT_BUSCLOCK = 0x000, + MODE_CLOCK_SELECT_BUSCLOCK16 = 0x001, + MODE_CLOCK_SELECT_BUSCLOCK256 = 0x002, + MODE_CLOCK_SELECT_EXTERNAL = 0x003, + MODE_GATE_ENABLE = 0x004, MODE_GATE_SELECT = 0x008, @@ -28,6 +35,11 @@ public: MODE_OVERFLOW_FLAG = 0x800, }; + enum REGISTER + { + T3_MODE = 0x10001810, + }; + CTimer(CINTC&); virtual ~CTimer() = default;