libwwcl libwwcl
WWitch compatibility layer for the Wonderful toolchain
Loading...
Searching...
No Matches
system.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Adrian "asie" Siekierka
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 *
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 *
20 * 3. This notice may not be removed or altered from any source distribution.
21 */
22
27#ifndef __WF_LIBWW_SYSTEM_H__
28#define __WF_LIBWW_SYSTEM_H__
29
30#include "types.h"
31
37#define SYS_INT_SENDREADY 0x00
38#define SYS_INT_KEY 0x01
39#define SYS_INT_CASETTE 0x02
40#define SYS_INT_RECEIVEREADY 0x03
41#define SYS_INT_DISPLINE 0x04
42#define SYS_INT_TIMER_COUNTUP 0x05
43#define SYS_INT_VBLANK 0x06
44#define SYS_INT_HBLANK_COUNTUP 0x07
45
46void sys_interrupt_set_hook(uint8_t id, intvector_t *new_vector, intvector_t *old_vector);
47void sys_interrupt_reset_hook(uint8_t id, intvector_t *old_vector);
48
49void sys_wait(uint16_t v);
50
58uint32_t sys_get_tick_count(void);
59
60void sys_sleep(void);
61void sys_set_sleep_time(uint16_t time);
62uint16_t sys_get_sleep_time(void);
63void sys_set_awake_key(uint16_t key);
64uint16_t sys_get_awake_key(void);
65void sys_set_keepalive_int(uint16_t value);
66uint16_t sys_get_version(void);
67
70#endif /* __WF_LIBWW_SYSTEM_H__ */
void sys_set_keepalive_int(uint16_t value)
uint16_t sys_get_awake_key(void)
uint16_t sys_get_version(void)
void sys_interrupt_set_hook(uint8_t id, intvector_t *new_vector, intvector_t *old_vector)
uint16_t sys_get_sleep_time(void)
void sys_interrupt_reset_hook(uint8_t id, intvector_t *old_vector)
uint32_t sys_get_tick_count(void)
Read the current tick count.
void sys_wait(uint16_t v)
void sys_set_awake_key(uint16_t key)
void sys_sleep(void)
void sys_set_sleep_time(uint16_t time)