llvm-mos-sdk
|
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | NTSC_COLORBURST_FREQ (315 * 1000000 / 88) |
#define | PCE_SYSTEM_FREQ (NTSC_COLORBURST_FREQ * 6) |
#define | PCE_CPU_FREQ (NTSC_COLORBURST_FREQ * 2) |
#define | PCE_TIMER_FREQ (PCE_CPU_FREQ / 1024) |
#define | PCE_FREQ_TO_TIMER(freq) ((PCE_TIMER_FREQ / (freq)) - 1) |
Calculate the reload value for a given timer frequency (in Hz). More... | |
Functions | |
void | pce_irq_enable (uint8_t mask) |
Enable the specified IRQs. More... | |
void | pce_irq_disable (uint8_t mask) |
Disable the specified IRQs. More... | |
void | pce_timer_set (uint8_t count) |
Initialize the timer with a given reload value. More... | |
void | pce_timer_enable (void) |
Enable the timer. More... | |
void | pce_timer_disable (void) |
Disable the timer. More... | |
Functionality related to the system.
#define NTSC_COLORBURST_FREQ (315 * 1000000 / 88) |
#define PCE_CPU_FREQ (NTSC_COLORBURST_FREQ * 2) |
#define PCE_FREQ_TO_TIMER | ( | freq | ) | ((PCE_TIMER_FREQ / (freq)) - 1) |
Calculate the reload value for a given timer frequency (in Hz).
#define PCE_SYSTEM_FREQ (NTSC_COLORBURST_FREQ * 6) |
#define PCE_TIMER_FREQ (PCE_CPU_FREQ / 1024) |
void pce_irq_disable | ( | uint8_t | mask | ) |
Disable the specified IRQs.
mask | The IRQ mask to disable. |
void pce_irq_enable | ( | uint8_t | mask | ) |
Enable the specified IRQs.
Note that one must enable IRQs on the CPU for this to be effective; the console is initialized with IRQs disabled - see pce_cpu_irq_enable .
mask | The IRQ mask to enable. |
void pce_timer_disable | ( | void | ) |
Disable the timer.
void pce_timer_enable | ( | void | ) |
Enable the timer.
void pce_timer_set | ( | uint8_t | count | ) |
Initialize the timer with a given reload value.
To calculate the reload value from a given frequency (in Hz), use the PCE_FREQ_TO_TIMER macro.
This function does not enable the timer automatically.
count | The reload value. |