libws libws
WSwan hardware library for the Wonderful toolchain
Loading...
Searching...
No Matches
system.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "util.h"
#include "hardware.h"

Go to the source code of this file.

Macros

#define ws_mode_t   ws_system_mode_t
 
#define ws_mode_get   ws_system_mode_get
 
#define ws_mode_set   ws_system_mode_set
 
#define ws_hwint_pop   ws_hwint_push
 

Enumerations

enum  ws_system_model_t { WS_MODEL_MONO = 0x00 , WS_MODEL_PCV2 = 0x01 , WS_MODEL_COLOR = 0x82 , WS_MODEL_CRYSTAL = 0x83 }
 WonderSwan device model. More...
 
enum  ws_system_mode_t { WS_MODE_MONO = 0x00 , WS_MODE_COLOR = 0x80 , WS_MODE_COLOR_4BPP = 0xC0 , WS_MODE_COLOR_4BPP_PACKED = 0xE0 }
 WonderSwan system mode. More...
 

Functions

static bool ws_system_is_color (void)
 Check if this device is capable of supporting Color mode (= is a WonderSwan Color or above).
 
static bool ws_system_color_active (void)
 Check if this device is currently in Color mode.
 
ws_system_model_t ws_system_get_model (void)
 Get the device's model.
 
static ws_system_mode_t ws_system_mode_get (void)
 Get the current system mode.
 
bool ws_system_mode_set (ws_system_mode_t mode)
 Set the new system mode.
 
typedef __attribute__ ((interrupt)) void __far(*ws_int_handler_t)(void)
 
void ws_cpuint_set_handler (uint8_t idx, ws_int_handler_t handler)
 Register a CPU interrupt handler.
 
void ws_hwint_set_handler (uint8_t idx, ws_int_handler_t handler)
 Register a hardware interrupt handler.
 
void ws_hwint_set_default_handler_serial_tx (void)
 Register a default interrupt handler for serial transmission. This handler will automatically disable and acknowledge HWINT_SERIAL_TX .
 
void ws_hwint_set_default_handler_key (void)
 Register a default, acknowledge-only interrupt handler.
 
void ws_hwint_set_default_handler_serial_rx (void)
 Register a default interrupt handler for serial receiving. This handler will automatically disable and acknowledge HWINT_SERIAL_RX .
 
void ws_hwint_set_default_handler_line (void)
 Register a default, acknowledge-only interrupt handler.
 
void ws_hwint_set_default_handler_vblank_timer (void)
 Register a default, acknowledge-only interrupt handler.
 
void ws_hwint_set_default_handler_vblank (void)
 Register a default, acknowledge-only interrupt handler.
 
void ws_hwint_set_default_handler_hblank_timer (void)
 Register a default, acknowledge-only interrupt handler.
 
static void ws_hwint_set (uint8_t mask)
 Set selected hardware interrupts.
 
static uint8_t ws_hwint_push (uint8_t mask)
 
void ws_hwint_enable (uint8_t mask)
 Enable selected hardware interrupts.
 
void ws_hwint_disable (uint8_t mask)
 Disable selected hardware interrupts.
 
static void ws_hwint_disable_all (void)
 Disable all hardware interrupts.
 
static void ws_hwint_ack (uint8_t mask)
 Acknowledge hardware interrupt.
 

Detailed Description

Functionality related to system control.

Definition in file system.h.