libws libws
WSwan hardware library for the Wonderful toolchain
|
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. | |
#define ws_hwint_pop ws_hwint_push |
#define ws_mode_get ws_system_mode_get |
#define ws_mode_set ws_system_mode_set |
#define ws_mode_t ws_system_mode_t |
enum ws_system_mode_t |
WonderSwan system mode.
enum ws_system_model_t |
typedef __attribute__ | ( | (interrupt) | ) |
void ws_cpuint_set_handler | ( | uint8_t | idx, |
ws_int_handler_t | handler ) |
Register a CPU interrupt handler.
idx | The INDEX of an interrupt (CPUINT_IDX_*). |
handler | The interrupt handler function. |
|
inlinestatic |
void ws_hwint_disable | ( | uint8_t | mask | ) |
Disable selected hardware interrupts.
mask | The MASK of an interrupt (HWINT_*). |
|
inlinestatic |
void ws_hwint_enable | ( | uint8_t | mask | ) |
Enable selected hardware interrupts.
mask | The MASK of an interrupt (HWINT_*). |
|
inlinestatic |
void ws_hwint_set_default_handler_hblank_timer | ( | void | ) |
Register a default, acknowledge-only interrupt handler.
void ws_hwint_set_default_handler_key | ( | void | ) |
Register a default, acknowledge-only interrupt handler.
void ws_hwint_set_default_handler_line | ( | 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_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_vblank | ( | 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_handler | ( | uint8_t | idx, |
ws_int_handler_t | handler ) |
Register a hardware interrupt handler.
Note that hardware interrupts are level-triggered and thus must be acknowledged. See ws_hwint_ack for more information.
idx | The INDEX of an interrupt (HWINT_IDX_*). |
handler | The interrupt handler function. |
|
inlinestatic |
ws_system_model_t ws_system_get_model | ( | void | ) |
Get the device's model.
|
inlinestatic |
Check if this device is capable of supporting Color mode (= is a WonderSwan Color or above).
This is useful for gating functionality specific to Color mode - see ws_system_mode_t for more information.
|
inlinestatic |
bool ws_system_mode_set | ( | ws_system_mode_t | mode | ) |
Set the new system mode.
Note that any non-Mono modes require a WonderSwan Color or above - see system_is_color
mode | The new system mode. |