llvm-mos-sdk
Macros | Functions
system.h File Reference
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for system.h:
This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

Functionality related to the system.

Macro Definition Documentation

◆ NTSC_COLORBURST_FREQ

#define NTSC_COLORBURST_FREQ   (315 * 1000000 / 88)

◆ PCE_CPU_FREQ

#define PCE_CPU_FREQ   (NTSC_COLORBURST_FREQ * 2)

◆ PCE_FREQ_TO_TIMER

#define PCE_FREQ_TO_TIMER (   freq)    ((PCE_TIMER_FREQ / (freq)) - 1)

Calculate the reload value for a given timer frequency (in Hz).

◆ PCE_SYSTEM_FREQ

#define PCE_SYSTEM_FREQ   (NTSC_COLORBURST_FREQ * 6)

◆ PCE_TIMER_FREQ

#define PCE_TIMER_FREQ   (PCE_CPU_FREQ / 1024)

Function Documentation

◆ pce_irq_disable()

void pce_irq_disable ( uint8_t  mask)

Disable the specified IRQs.

Parameters
maskThe IRQ mask to disable.

◆ pce_irq_enable()

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 .

Parameters
maskThe IRQ mask to enable.

◆ pce_timer_disable()

void pce_timer_disable ( void  )

Disable the timer.

◆ pce_timer_enable()

void pce_timer_enable ( void  )

Enable the timer.

◆ pce_timer_set()

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.

Parameters
countThe reload value.