The Socrates Gameboy Advance Development Engine
The SGADE is a development library for the Nintendo Gameboy
Advance. It's free for all uses and is distributed without guarantees.
For more information visit
the SGADE page.
#include "SoTimer.h"#include "SoIntManager.h"#include "SoDebug.h"Data Structures | |
| struct | tag_Timer |
| Timer register overlay struct;. More... | |
Functions | |
| void | SoTimerClockHandler (void) |
| Clock interrupt handler. | |
| void | SoTimerClockEnable (u32 a_TimerID) |
| Enables and starts the clock. | |
| void | SoTimerClockReset (void) |
| Resets the clock. | |
| void | SoTimerClockDisable (void) |
| Disables the clock;. | |
| void | SoTimerClockPause (void) |
| Pauses the clock. | |
| void | SoTimerClockResume (void) |
| Resumes the clock. | |
| u32 | SoTimerClockGetTotalSeconds (void) |
| Returns the total number of seconds of the clock. | |
| u32 | SoTimerClockGetTotalMilliseconds (void) |
| Returns the total number of seconds of the clock. | |
| u32 | SoTimerClockGetSeconds (void) |
| Returns the number of seconds of the clock. | |
| u32 | SoTimerClockGetMinutes (void) |
| Returns the number of minutes of the clock. | |
| u32 | SoTimerClockGetHours (void) |
| Returns the number of hours of the clock. | |
| u32 | SoTimerClockGetDays (void) |
| Returns the number of days of the clock. | |
| void | SoTimerClockSet (u32 a_NumDays, u32 a_NumHours, u32 a_NumMinutes, u32 a_NumSeconds) |
| Sets the clock to the given value. | |
| u32 | SoTimerClockGetTimerID (void) |
| Returns the timer that is used by the clock, if one is used at all. | |
| void | SoTimerWait (u32 a_TimerID, u32 a_NumMilliSeconds) |
| Halts the CPU for the given time. Interrupts are still executed. | |
| void | SoTimerEnableForDirectSound (u32 a_TimerID) |
| This enables the given timer for direct sound purposes. | |
Variables | |
| u32 | s_NumTotalSeconds |
| Total number of seconds elapsed since clock start. | |
| u32 | s_NumSeconds |
| seconds portion of time elapsed since clock start. | |
| u32 | s_NumMinutes |
| minutes portion of time elapsed since clock start. | |
| u32 | s_NumHours |
| hours portion of time elapsed since clock start. | |
| u32 | s_NumDays |
| days portion of time elapsed since clock start. | |
| s8 | s_ClockTimerID |
| tag_Timer * | s_Timer |
| Timer register overlay struct;. | |
|
|
Clock interrupt handler.
For internal use only.
This function is called every clock second, to update the clock values. |
|
|
For internal use only. Timer ID the clock is currently using. Valid values are [0..3] for IRQ's and -1 when the clock is not in use. This also means that s_ClockTimerID + SO_INTERRUPT_TYPE_TIMER_0 equals the interrupt for the clock (when calling SoInterruptManager functions). |
|
|
days portion of time elapsed since clock start.
For internal use only.
|
|
|
hours portion of time elapsed since clock start.
For internal use only.
|
|
|
minutes portion of time elapsed since clock start.
For internal use only.
|
|
|
seconds portion of time elapsed since clock start.
For internal use only.
|
|
|
Total number of seconds elapsed since clock start.
For internal use only.
|
|
|
Timer register overlay struct;.
For internal use only.
This struct is put over the timer registers on the GBA, so we can easily acces different timers. |