llvm-mos-sdk
Classes | Macros | Enumerations | Functions
cx16.h File Reference
#include <stdbool.h>
#include <_6522.h>
Include dependency graph for cx16.h:

Go to the source code of this file.

Classes

struct  JoyState
 Status of SNES joystick populated by cx16_k_joystick_get();. More...
 
struct  cx16_date_time_t
 
struct  cx16_fb_info_t
 
struct  graph_fb_functions_t
 
struct  graph_pos_t
 
struct  mouse_pos_t
 
struct  screen_mode_info_t
 

Macros

#define CH_COLOR_SWAP   0x01
 
#define CH_UNDERLINE   0x04
 
#define CH_WHITE   0x05
 
#define CH_BOLD   0x06
 
#define CH_BACKSPACE   0x08
 
#define CH_ITALIC   0x0B
 
#define CH_OUTLINE   0x0C
 
#define CH_FONT_ISO   0x0F
 
#define CH_RED   0x1C
 
#define CH_GREEN   0x1E
 
#define CH_BLUE   0x1F
 
#define CH_ORANGE   0x81
 
#define CH_FONT_PET   0x8F
 
#define CH_BLACK   0x90
 
#define CH_ATTR_CLEAR   0x92
 
#define CH_BROWN   0x95
 
#define CH_PINK   0x96
 
#define CH_LIGHTRED   CH_PINK
 
#define CH_GRAY1   0x97
 
#define CH_GRAY2   0x98
 
#define CH_LIGHTGREEN   0x99
 
#define CH_LIGHTBLUE   0x9A
 
#define CH_GRAY3   0x9B
 
#define CH_PURPLE   0x9C
 
#define CH_YELLOW   0x9E
 
#define CH_CYAN   0x9F
 
#define CH_SHIFT_SPACE   0xA0
 
#define CH_SHIFT_TAB   0x18
 
#define CH_HELP   0x84
 
#define CH_F1   0x85
 
#define CH_F2   0x89
 
#define CH_F3   0x86
 
#define CH_F4   0x8A
 
#define CH_F5   0x87
 
#define CH_F6   0x8B
 
#define CH_F7   0x88
 
#define CH_F8   0x8C
 
#define CH_F9   0x10
 
#define CH_F10   0x15
 
#define CH_F11   0x16
 
#define CH_F12   0x17
 
#define COLOR_BLACK   0x00
 
#define COLOR_WHITE   0x01
 
#define COLOR_RED   0x02
 
#define COLOR_CYAN   0x03
 
#define COLOR_PURPLE   0x04
 
#define COLOR_GREEN   0x05
 
#define COLOR_BLUE   0x06
 
#define COLOR_YELLOW   0x07
 
#define COLOR_ORANGE   0x08
 
#define COLOR_BROWN   0x09
 
#define COLOR_PINK   0x0A
 
#define COLOR_LIGHTRED   COLOR_PINK
 
#define COLOR_GRAY1   0x0B
 
#define COLOR_GRAY2   0x0C
 
#define COLOR_LIGHTGREEN   0x0D
 
#define COLOR_LIGHTBLUE   0x0E
 
#define COLOR_GRAY3   0x0F
 
#define JOY_KEYBOARD   0
 Joystick selection. More...
 
#define JOY_SNES_PORT1   1
 
#define JOY_SNES_PORT2   2
 
#define JOY_SNES_PORT3   3
 
#define JOY_SNES_PORT4   4
 
#define MOUSE_BTN_MIDDLE   0x02
 
#define VIDEOMODE_80x60   0x00
 
#define VIDEOMODE_80x30   0x01
 
#define VIDEOMODE_40x60   0x02
 
#define VIDEOMODE_40x30   0x03
 
#define VIDEOMODE_40x15   0x04
 
#define VIDEOMODE_20x30   0x05
 
#define VIDEOMODE_20x15   0x06
 
#define VIDEOMODE_80COL   VIDEOMODE_80x60
 
#define VIDEOMODE_40COL   VIDEOMODE_40x30
 
#define VIDEOMODE_320x240   0x80
 
#define VIDEOMODE_SWAP   (-1)
 
#define VERA_IRQ_VSYNC   0b00000001
 
#define VERA_IRQ_RASTER   0b00000010
 
#define VERA_IRQ_SPR_COLL   0b00000100
 
#define VERA_IRQ_AUDIO_LOW   0b00001000
 
#define RAM_BANK   (*(volatile unsigned char *)0x00)
 
#define ROM_BANK   (*(volatile unsigned char *)0x01)
 
#define VIA1   (*(volatile struct __6522 *)0x9F00)
 
#define VIA2   (*(volatile struct __6522 *)0x9F10)
 
#define VERA   (*(volatile struct __vera *)0x9F20)
 
#define YM2151   (*(volatile struct __ym2151 *)0x9F40)
 
#define EMULATOR   (*(volatile struct __emul *)0x9FB0)
 
#define BANK_RAM   ((volatile unsigned char *)0xA000)
 

Enumerations

enum  : unsigned char {
  JOY_BTN_B_MASK = 1 << 7, JOY_BTN_Y_MASK = 1 << 6, JOY_SELECT_MASK = 1 << 5, JOY_START_MASK = 1 << 4,
  JOY_UP_MASK = 1 << 3, JOY_DOWN_MASK = 1 << 2, JOY_LEFT_MASK = 1 << 1, JOY_RIGHT_MASK = 1 << 0,
  JOY_BTN_A_MASK = 1 << 7, JOY_BTN_X_MASK = 1 << 6, JOY_FIRE_LEFT_MASK = 1 << 5, JOY_FIRE_RIGHT_MASK = 1 << 4
}
 NES controller masks for JoyState. More...
 
enum  : unsigned char {
  TV_NONE = 0x00, TV_VGA, TV_NTSC_COLOR, TV_RGB,
  TV_NONE2, TV_VGA2, TV_NTSC_MONO, TV_RGB2,
  TV_NONE_240P, TV_VGA_240P, TV_NTSC_COLOR_240P, TV_RGB_240P,
  TV_NONE2_240P, TV_VGA2_240P, TV_NTSC_MONO_240P, TV_RGB2_240P
}
 
enum  : unsigned char {
  VERA_DEC_0 = ((0 << 1) | 1) << 3, VERA_DEC_1 = ((1 << 1) | 1) << 3, VERA_DEC_2 = ((2 << 1) | 1) << 3, VERA_DEC_4 = ((3 << 1) | 1) << 3,
  VERA_DEC_8 = ((4 << 1) | 1) << 3, VERA_DEC_16 = ((5 << 1) | 1) << 3, VERA_DEC_32 = ((6 << 1) | 1) << 3, VERA_DEC_64 = ((7 << 1) | 1) << 3,
  VERA_DEC_128 = ((8 << 1) | 1) << 3, VERA_DEC_256 = ((9 << 1) | 1) << 3, VERA_DEC_512 = ((10 << 1) | 1) << 3, VERA_DEC_40 = ((11 << 1) | 1) << 3,
  VERA_DEC_80 = ((12 << 1) | 1) << 3, VERA_DEC_160 = ((13 << 1) | 1) << 3, VERA_DEC_320 = ((14 << 1) | 1) << 3, VERA_DEC_640 = ((15 << 1) | 1) << 3,
  VERA_INC_0 = ((0 << 1) | 0) << 3, VERA_INC_1 = ((1 << 1) | 0) << 3, VERA_INC_2 = ((2 << 1) | 0) << 3, VERA_INC_4 = ((3 << 1) | 0) << 3,
  VERA_INC_8 = ((4 << 1) | 0) << 3, VERA_INC_16 = ((5 << 1) | 0) << 3, VERA_INC_32 = ((6 << 1) | 0) << 3, VERA_INC_64 = ((7 << 1) | 0) << 3,
  VERA_INC_128 = ((8 << 1) | 0) << 3, VERA_INC_256 = ((9 << 1) | 0) << 3, VERA_INC_512 = ((10 << 1) | 0) << 3, VERA_INC_40 = ((11 << 1) | 0) << 3,
  VERA_INC_80 = ((12 << 1) | 0) << 3, VERA_INC_160 = ((13 << 1) | 0) << 3, VERA_INC_320 = ((14 << 1) | 0) << 3, VERA_INC_640 = ((15 << 1) | 0) << 3
}
 
enum  : unsigned char {
  ROM_KERNAL = 0, ROM_KEYBD = 1, ROM_CMDRDOS = 2, ROM_FAT32 = 3,
  ROM_BASIC = 4, ROM_MONITOR = 5, ROM_CHARSET = 6, ROM_DIAG = 7,
  ROM_GRAPH = 8, ROM_DEMO = 9, ROM_AUDIO = 10, ROM_UTIL = 11,
  ROM_BANNEX = 12, ROM_X16EDIT1 = 13, ROM_X16EDIT2 = 14, ROM_BASLOAD = 15
}
 

Functions

unsigned char cx16_k_bsave (void *startaddr, void *endaddr_plusone) __attribute__((leaf))
 
void cx16_k_clock_get_date_time (cx16_date_time_t *datetime_ptr) __attribute__((leaf))
 
void cx16_k_clock_set_date_time (unsigned char year, unsigned char mon, unsigned char day, unsigned char hour, unsigned char min, unsigned char sec, unsigned char jif) __attribute__((leaf))
 
unsigned char cx16_k_console_get_char (void) __attribute__((leaf))
 
void cx16_k_console_init (unsigned int x, unsigned int y, unsigned int width, unsigned int height) __attribute__((leaf))
 
void cx16_k_console_put_char (unsigned char c, unsigned char wrapwordflag) __attribute__((leaf))
 
void cx16_k_console_put_image (void *imageaddr, unsigned int width, unsigned int height) __attribute__((leaf))
 
void cx16_k_console_set_paging_message (void *msgaddr) __attribute__((leaf))
 
void cx16_k_enter_basic (unsigned char coldstart) __attribute__((noreturn))
 
unsigned long cx16_k_entropy_get (void) __attribute__((leaf))
 
void cx16_k_fb_cursor_next_line (unsigned int x) __attribute__((leaf))
 
void cx16_k_fb_cursor_position (unsigned int x, unsigned int y) __attribute__((leaf))
 
void cx16_k_fb_fill_pixels (unsigned int count, unsigned int step, unsigned char color) __attribute__((leaf))
 
void cx16_k_fb_filter_pixels (void *filterfunc, unsigned int count) __attribute__((leaf))
 
void cx16_k_fb_get_info (cx16_fb_info_t *info_ptr) __attribute__((leaf))
 
unsigned char fb_get_pixel (void) __attribute__((leaf))
 
void cx16_k_fb_get_pixels (void *pixeladdr, unsigned int count) __attribute__((leaf))
 
void cx16_k_fb_init (void) __attribute__((leaf))
 
void cx16_k_fb_move_pixels (unsigned int sx, unsigned int sy, unsigned int tx, unsigned int ty, unsigned int count) __attribute__((leaf))
 
void cx16_k_fb_set_8_pixels (unsigned char pattern, unsigned char color) __attribute__((leaf))
 
void cx16_k_fb_set_8_pixels_opaque (unsigned char pattern, unsigned char mask, unsigned char color1, unsigned char color2) __attribute__((leaf))
 
void cx16_k_fb_set_palette (void *paladdr, unsigned char index, unsigned char count) __attribute__((leaf))
 
void cx16_k_graph_clear (void) __attribute__((leaf))
 
void cx16_k_graph_draw_image (unsigned int x, unsigned int y, void *imageaddr, unsigned int width, unsigned int height) __attribute__((leaf))
 
void cx16_k_graph_draw_line (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2) __attribute__((leaf))
 
void cx16_k_graph_draw_oval (unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int corner_radius, unsigned char fillflag) __attribute__((leaf))
 
void cx16_k_graph_draw_rect (unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int corner_radius, unsigned char fillflag) __attribute__((leaf))
 
long cx16_k_graph_get_char_size (unsigned char c, unsigned char style) __attribute__((leaf))
 
void cx16_k_graph_init (graph_fb_functions_t *fb_funcs_ptr) __attribute__((leaf))
 
void cx16_k_graph_move_rect (unsigned int sx, unsigned int sy, unsigned int tx, unsigned int ty, unsigned int width, unsigned int height) __attribute__((leaf))
 
void cx16_k_graph_put_char (graph_pos_t *pos_ptr, unsigned char c) __attribute__((leaf))
 
void cx16_k_graph_set_colors (unsigned char stroke, unsigned char fill, unsigned char background) __attribute__((leaf))
 
void cx16_k_graph_set_font (void *fontaddr) __attribute__((leaf))
 
void cx16_k_graph_set_window (unsigned int x, unsigned int y, unsigned int width, unsigned int height) __attribute__((leaf))
 
int cx16_k_i2c_read_byte (unsigned char device, unsigned char offset) __attribute__((leaf))
 
int cx16_k_i2c_write_byte (unsigned char device, unsigned char offset, unsigned char byte) __attribute__((leaf))
 
JoyState cx16_k_joystick_get (unsigned char joystick_num)
 
void cx16_k_joystick_scan (void) __attribute__((leaf))
 
unsigned char cx16_k_kbdbuf_get_modifiers (void) __attribute__((leaf))
 
int cx16_k_kbdbuf_peek (unsigned char *index_ptr) __attribute__((leaf))
 
void cx16_k_kbdbuf_put (unsigned char c) __attribute__((leaf))
 
const char * cx16_k_keymap_get_id (void) __attribute__((leaf))
 
unsigned char cx16_k_keymap_set (const char *identifier) __attribute__((leaf))
 
long cx16_k_macptr (unsigned char count, unsigned char noadvance, void *destaddr) __attribute__((leaf))
 
void cx16_k_memory_copy (void *source, void *target, unsigned int num_bytes) __attribute__((leaf))
 
unsigned int cx16_k_memory_crc (void *dataaddr, unsigned int num_bytes) __attribute__((leaf))
 
void cx16_k_memory_decompress (void *inaddr, void *outaddr) __attribute__((leaf))
 
void cx16_k_memory_fill (void *addr, unsigned int num_bytes, unsigned char value) __attribute__((leaf))
 
void cx16_k_monitor (void) __attribute__((noreturn))
 
void cx16_k_mouse_config (unsigned char showmouse, unsigned char xsize8, unsigned char ysize8) __attribute__((leaf))
 
unsigned char cx16_k_mouse_get (mouse_pos_t *mouse_pos_ptr) __attribute__((leaf))
 
void cx16_k_mouse_scan (void) __attribute__((leaf))
 
unsigned long cx16_k_rdtim (void) __attribute__((leaf))
 
unsigned char cx16_k_screen_mode_get (screen_mode_info_t *info_ptr) __attribute__((leaf))
 
unsigned char cx16_k_screen_mode_set (unsigned char mode) __attribute__((leaf))
 
void cx16_k_screen_set_charset (unsigned char charset_type, void *charsetaddr) __attribute__((leaf))
 
unsigned char cx16_k_sprite_set_image (unsigned char num, unsigned char w, unsigned char h, unsigned char maskflag, void *imageaddr, void *maskaddr, unsigned char bpp) __attribute__((leaf))
 
unsigned char cx16_k_sprite_set_position (unsigned char sprnum, unsigned int xpos, unsigned int ypos) __attribute__((leaf))
 
unsigned short get_numbanks (void) __attribute__((leaf))
 
signed char get_ostype (void) __attribute__((leaf))
 
unsigned char get_tv (void) __attribute__((leaf))
 
void set_tv (unsigned char type) __attribute__((leaf))
 
unsigned char vera_layer_enable (unsigned char layers) __attribute__((leaf))
 
unsigned char vera_sprites_enable (unsigned char enable) __attribute__((leaf))
 
signed char videomode (signed char mode) __attribute__((leaf))
 
unsigned char vpeek (unsigned long addr) __attribute__((leaf))
 
void vpoke (unsigned char data, unsigned long addr) __attribute__((leaf))
 
void waitvsync (void)
 

Macro Definition Documentation

◆ BANK_RAM

#define BANK_RAM   ((volatile unsigned char *)0xA000)

◆ CH_ATTR_CLEAR

#define CH_ATTR_CLEAR   0x92

◆ CH_BACKSPACE

#define CH_BACKSPACE   0x08

◆ CH_BLACK

#define CH_BLACK   0x90

◆ CH_BLUE

#define CH_BLUE   0x1F

◆ CH_BOLD

#define CH_BOLD   0x06

◆ CH_BROWN

#define CH_BROWN   0x95

◆ CH_COLOR_SWAP

#define CH_COLOR_SWAP   0x01

◆ CH_CYAN

#define CH_CYAN   0x9F

◆ CH_F1

#define CH_F1   0x85

◆ CH_F10

#define CH_F10   0x15

◆ CH_F11

#define CH_F11   0x16

◆ CH_F12

#define CH_F12   0x17

◆ CH_F2

#define CH_F2   0x89

◆ CH_F3

#define CH_F3   0x86

◆ CH_F4

#define CH_F4   0x8A

◆ CH_F5

#define CH_F5   0x87

◆ CH_F6

#define CH_F6   0x8B

◆ CH_F7

#define CH_F7   0x88

◆ CH_F8

#define CH_F8   0x8C

◆ CH_F9

#define CH_F9   0x10

◆ CH_FONT_ISO

#define CH_FONT_ISO   0x0F

◆ CH_FONT_PET

#define CH_FONT_PET   0x8F

◆ CH_GRAY1

#define CH_GRAY1   0x97

◆ CH_GRAY2

#define CH_GRAY2   0x98

◆ CH_GRAY3

#define CH_GRAY3   0x9B

◆ CH_GREEN

#define CH_GREEN   0x1E

◆ CH_HELP

#define CH_HELP   0x84

◆ CH_ITALIC

#define CH_ITALIC   0x0B

◆ CH_LIGHTBLUE

#define CH_LIGHTBLUE   0x9A

◆ CH_LIGHTGREEN

#define CH_LIGHTGREEN   0x99

◆ CH_LIGHTRED

#define CH_LIGHTRED   CH_PINK

◆ CH_ORANGE

#define CH_ORANGE   0x81

◆ CH_OUTLINE

#define CH_OUTLINE   0x0C

◆ CH_PINK

#define CH_PINK   0x96

◆ CH_PURPLE

#define CH_PURPLE   0x9C

◆ CH_RED

#define CH_RED   0x1C

◆ CH_SHIFT_SPACE

#define CH_SHIFT_SPACE   0xA0

◆ CH_SHIFT_TAB

#define CH_SHIFT_TAB   0x18

◆ CH_UNDERLINE

#define CH_UNDERLINE   0x04

◆ CH_WHITE

#define CH_WHITE   0x05

◆ CH_YELLOW

#define CH_YELLOW   0x9E

◆ COLOR_BLACK

#define COLOR_BLACK   0x00

◆ COLOR_BLUE

#define COLOR_BLUE   0x06

◆ COLOR_BROWN

#define COLOR_BROWN   0x09

◆ COLOR_CYAN

#define COLOR_CYAN   0x03

◆ COLOR_GRAY1

#define COLOR_GRAY1   0x0B

◆ COLOR_GRAY2

#define COLOR_GRAY2   0x0C

◆ COLOR_GRAY3

#define COLOR_GRAY3   0x0F

◆ COLOR_GREEN

#define COLOR_GREEN   0x05

◆ COLOR_LIGHTBLUE

#define COLOR_LIGHTBLUE   0x0E

◆ COLOR_LIGHTGREEN

#define COLOR_LIGHTGREEN   0x0D

◆ COLOR_LIGHTRED

#define COLOR_LIGHTRED   COLOR_PINK

◆ COLOR_ORANGE

#define COLOR_ORANGE   0x08

◆ COLOR_PINK

#define COLOR_PINK   0x0A

◆ COLOR_PURPLE

#define COLOR_PURPLE   0x04

◆ COLOR_RED

#define COLOR_RED   0x02

◆ COLOR_WHITE

#define COLOR_WHITE   0x01

◆ COLOR_YELLOW

#define COLOR_YELLOW   0x07

◆ EMULATOR

#define EMULATOR   (*(volatile struct __emul *)0x9FB0)

◆ JOY_KEYBOARD

#define JOY_KEYBOARD   0

Joystick selection.

◆ JOY_SNES_PORT1

#define JOY_SNES_PORT1   1

◆ JOY_SNES_PORT2

#define JOY_SNES_PORT2   2

◆ JOY_SNES_PORT3

#define JOY_SNES_PORT3   3

◆ JOY_SNES_PORT4

#define JOY_SNES_PORT4   4

◆ MOUSE_BTN_MIDDLE

#define MOUSE_BTN_MIDDLE   0x02

◆ RAM_BANK

#define RAM_BANK   (*(volatile unsigned char *)0x00)

◆ ROM_BANK

#define ROM_BANK   (*(volatile unsigned char *)0x01)

◆ VERA

#define VERA   (*(volatile struct __vera *)0x9F20)

◆ VERA_IRQ_AUDIO_LOW

#define VERA_IRQ_AUDIO_LOW   0b00001000

◆ VERA_IRQ_RASTER

#define VERA_IRQ_RASTER   0b00000010

◆ VERA_IRQ_SPR_COLL

#define VERA_IRQ_SPR_COLL   0b00000100

◆ VERA_IRQ_VSYNC

#define VERA_IRQ_VSYNC   0b00000001

◆ VIA1

#define VIA1   (*(volatile struct __6522 *)0x9F00)

◆ VIA2

#define VIA2   (*(volatile struct __6522 *)0x9F10)

◆ VIDEOMODE_20x15

#define VIDEOMODE_20x15   0x06

◆ VIDEOMODE_20x30

#define VIDEOMODE_20x30   0x05

◆ VIDEOMODE_320x240

#define VIDEOMODE_320x240   0x80

◆ VIDEOMODE_40COL

#define VIDEOMODE_40COL   VIDEOMODE_40x30

◆ VIDEOMODE_40x15

#define VIDEOMODE_40x15   0x04

◆ VIDEOMODE_40x30

#define VIDEOMODE_40x30   0x03

◆ VIDEOMODE_40x60

#define VIDEOMODE_40x60   0x02

◆ VIDEOMODE_80COL

#define VIDEOMODE_80COL   VIDEOMODE_80x60

◆ VIDEOMODE_80x30

#define VIDEOMODE_80x30   0x01

◆ VIDEOMODE_80x60

#define VIDEOMODE_80x60   0x00

◆ VIDEOMODE_SWAP

#define VIDEOMODE_SWAP   (-1)

◆ YM2151

#define YM2151   (*(volatile struct __ym2151 *)0x9F40)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : unsigned char

NES controller masks for JoyState.

Enumerator
JOY_BTN_B_MASK 
JOY_BTN_Y_MASK 
JOY_SELECT_MASK 
JOY_START_MASK 
JOY_UP_MASK 
JOY_DOWN_MASK 
JOY_LEFT_MASK 
JOY_RIGHT_MASK 
JOY_BTN_A_MASK 
JOY_BTN_X_MASK 
JOY_FIRE_LEFT_MASK 
JOY_FIRE_RIGHT_MASK 

◆ anonymous enum

anonymous enum : unsigned char
Enumerator
TV_NONE 
TV_VGA 
TV_NTSC_COLOR 
TV_RGB 
TV_NONE2 
TV_VGA2 
TV_NTSC_MONO 
TV_RGB2 
TV_NONE_240P 
TV_VGA_240P 
TV_NTSC_COLOR_240P 
TV_RGB_240P 
TV_NONE2_240P 
TV_VGA2_240P 
TV_NTSC_MONO_240P 
TV_RGB2_240P 

◆ anonymous enum

anonymous enum : unsigned char
Enumerator
VERA_DEC_0 
VERA_DEC_1 
VERA_DEC_2 
VERA_DEC_4 
VERA_DEC_8 
VERA_DEC_16 
VERA_DEC_32 
VERA_DEC_64 
VERA_DEC_128 
VERA_DEC_256 
VERA_DEC_512 
VERA_DEC_40 
VERA_DEC_80 
VERA_DEC_160 
VERA_DEC_320 
VERA_DEC_640 
VERA_INC_0 
VERA_INC_1 
VERA_INC_2 
VERA_INC_4 
VERA_INC_8 
VERA_INC_16 
VERA_INC_32 
VERA_INC_64 
VERA_INC_128 
VERA_INC_256 
VERA_INC_512 
VERA_INC_40 
VERA_INC_80 
VERA_INC_160 
VERA_INC_320 
VERA_INC_640 

◆ anonymous enum

anonymous enum : unsigned char

ROM bank labels

Enumerator
ROM_KERNAL 

KERNAL operating system and drivers.

ROM_KEYBD 

Keyboard layout tables.

ROM_CMDRDOS 

The computer-based CMDR-DOS for FAT32 SD cards.

ROM_FAT32 

The FAT32 driver itself.

ROM_BASIC 

BASIC interpreter.

ROM_MONITOR 

Machine Language Monitor.

ROM_CHARSET 

PETSCII and ISO character sets (uploaded into VRAM)

ROM_DIAG 

Memory diagnostic.

ROM_GRAPH 

Kernal graph and font routines.

ROM_DEMO 

Demo routines.

ROM_AUDIO 

Audio API routines.

ROM_UTIL 

System Configuration (Date/Time, Display Preferences)

ROM_BANNEX 

BASIC Annex (code for some added BASIC functions)

ROM_X16EDIT1 

The built-in text editor.

ROM_X16EDIT2 

The built-in text editor.

ROM_BASLOAD 

A transpiler that converts BASLOAD dialect to BASIC V2.

Function Documentation

◆ cx16_k_bsave()

unsigned char cx16_k_bsave ( void *  startaddr,
void *  endaddr_plusone 
)

◆ cx16_k_clock_get_date_time()

void cx16_k_clock_get_date_time ( cx16_date_time_t datetime_ptr)

◆ cx16_k_clock_set_date_time()

void cx16_k_clock_set_date_time ( unsigned char  year,
unsigned char  mon,
unsigned char  day,
unsigned char  hour,
unsigned char  min,
unsigned char  sec,
unsigned char  jif 
)

◆ cx16_k_console_get_char()

unsigned char cx16_k_console_get_char ( void  )

◆ cx16_k_console_init()

void cx16_k_console_init ( unsigned int  x,
unsigned int  y,
unsigned int  width,
unsigned int  height 
)

◆ cx16_k_console_put_char()

void cx16_k_console_put_char ( unsigned char  c,
unsigned char  wrapwordflag 
)

◆ cx16_k_console_put_image()

void cx16_k_console_put_image ( void *  imageaddr,
unsigned int  width,
unsigned int  height 
)

◆ cx16_k_console_set_paging_message()

void cx16_k_console_set_paging_message ( void *  msgaddr)

◆ cx16_k_enter_basic()

void cx16_k_enter_basic ( unsigned char  coldstart)

◆ cx16_k_entropy_get()

unsigned long cx16_k_entropy_get ( void  )

◆ cx16_k_fb_cursor_next_line()

void cx16_k_fb_cursor_next_line ( unsigned int  x)

◆ cx16_k_fb_cursor_position()

void cx16_k_fb_cursor_position ( unsigned int  x,
unsigned int  y 
)

◆ cx16_k_fb_fill_pixels()

void cx16_k_fb_fill_pixels ( unsigned int  count,
unsigned int  step,
unsigned char  color 
)

◆ cx16_k_fb_filter_pixels()

void cx16_k_fb_filter_pixels ( void *  filterfunc,
unsigned int  count 
)

◆ cx16_k_fb_get_info()

void cx16_k_fb_get_info ( cx16_fb_info_t info_ptr)

◆ cx16_k_fb_get_pixels()

void cx16_k_fb_get_pixels ( void *  pixeladdr,
unsigned int  count 
)

◆ cx16_k_fb_init()

void cx16_k_fb_init ( void  )

◆ cx16_k_fb_move_pixels()

void cx16_k_fb_move_pixels ( unsigned int  sx,
unsigned int  sy,
unsigned int  tx,
unsigned int  ty,
unsigned int  count 
)

◆ cx16_k_fb_set_8_pixels()

void cx16_k_fb_set_8_pixels ( unsigned char  pattern,
unsigned char  color 
)

◆ cx16_k_fb_set_8_pixels_opaque()

void cx16_k_fb_set_8_pixels_opaque ( unsigned char  pattern,
unsigned char  mask,
unsigned char  color1,
unsigned char  color2 
)

◆ cx16_k_fb_set_palette()

void cx16_k_fb_set_palette ( void *  paladdr,
unsigned char  index,
unsigned char  count 
)

◆ cx16_k_graph_clear()

void cx16_k_graph_clear ( void  )

◆ cx16_k_graph_draw_image()

void cx16_k_graph_draw_image ( unsigned int  x,
unsigned int  y,
void *  imageaddr,
unsigned int  width,
unsigned int  height 
)

◆ cx16_k_graph_draw_line()

void cx16_k_graph_draw_line ( unsigned int  x1,
unsigned int  y1,
unsigned int  x2,
unsigned int  y2 
)

◆ cx16_k_graph_draw_oval()

void cx16_k_graph_draw_oval ( unsigned int  x,
unsigned int  y,
unsigned int  width,
unsigned int  height,
unsigned int  corner_radius,
unsigned char  fillflag 
)

◆ cx16_k_graph_draw_rect()

void cx16_k_graph_draw_rect ( unsigned int  x,
unsigned int  y,
unsigned int  width,
unsigned int  height,
unsigned int  corner_radius,
unsigned char  fillflag 
)

◆ cx16_k_graph_get_char_size()

long cx16_k_graph_get_char_size ( unsigned char  c,
unsigned char  style 
)

◆ cx16_k_graph_init()

void cx16_k_graph_init ( graph_fb_functions_t fb_funcs_ptr)

◆ cx16_k_graph_move_rect()

void cx16_k_graph_move_rect ( unsigned int  sx,
unsigned int  sy,
unsigned int  tx,
unsigned int  ty,
unsigned int  width,
unsigned int  height 
)

◆ cx16_k_graph_put_char()

void cx16_k_graph_put_char ( graph_pos_t pos_ptr,
unsigned char  c 
)

◆ cx16_k_graph_set_colors()

void cx16_k_graph_set_colors ( unsigned char  stroke,
unsigned char  fill,
unsigned char  background 
)

◆ cx16_k_graph_set_font()

void cx16_k_graph_set_font ( void *  fontaddr)

◆ cx16_k_graph_set_window()

void cx16_k_graph_set_window ( unsigned int  x,
unsigned int  y,
unsigned int  width,
unsigned int  height 
)

◆ cx16_k_i2c_read_byte()

int cx16_k_i2c_read_byte ( unsigned char  device,
unsigned char  offset 
)

◆ cx16_k_i2c_write_byte()

int cx16_k_i2c_write_byte ( unsigned char  device,
unsigned char  offset,
unsigned char  byte 
)

◆ cx16_k_joystick_get()

JoyState cx16_k_joystick_get ( unsigned char  joystick_num)

Get joystick state using KERNAL routine JOYSTICK_GET.

More information: https://github.com/X16Community/x16-docs

Parameters
joystick_numKeyboard joystick (0) or SNES controllers (1-4).
Returns
Struct with current status.

◆ cx16_k_joystick_scan()

void cx16_k_joystick_scan ( void  )

◆ cx16_k_kbdbuf_get_modifiers()

unsigned char cx16_k_kbdbuf_get_modifiers ( void  )

◆ cx16_k_kbdbuf_peek()

int cx16_k_kbdbuf_peek ( unsigned char *  index_ptr)

◆ cx16_k_kbdbuf_put()

void cx16_k_kbdbuf_put ( unsigned char  c)

◆ cx16_k_keymap_get_id()

const char* cx16_k_keymap_get_id ( void  )

◆ cx16_k_keymap_set()

unsigned char cx16_k_keymap_set ( const char *  identifier)

◆ cx16_k_macptr()

long cx16_k_macptr ( unsigned char  count,
unsigned char  noadvance,
void *  destaddr 
)

◆ cx16_k_memory_copy()

void cx16_k_memory_copy ( void *  source,
void *  target,
unsigned int  num_bytes 
)

◆ cx16_k_memory_crc()

unsigned int cx16_k_memory_crc ( void *  dataaddr,
unsigned int  num_bytes 
)

◆ cx16_k_memory_decompress()

void cx16_k_memory_decompress ( void *  inaddr,
void *  outaddr 
)

◆ cx16_k_memory_fill()

void cx16_k_memory_fill ( void *  addr,
unsigned int  num_bytes,
unsigned char  value 
)

◆ cx16_k_monitor()

void cx16_k_monitor ( void  )

◆ cx16_k_mouse_config()

void cx16_k_mouse_config ( unsigned char  showmouse,
unsigned char  xsize8,
unsigned char  ysize8 
)

◆ cx16_k_mouse_get()

unsigned char cx16_k_mouse_get ( mouse_pos_t mouse_pos_ptr)

◆ cx16_k_mouse_scan()

void cx16_k_mouse_scan ( void  )

◆ cx16_k_rdtim()

unsigned long cx16_k_rdtim ( void  )

◆ cx16_k_screen_mode_get()

unsigned char cx16_k_screen_mode_get ( screen_mode_info_t info_ptr)

◆ cx16_k_screen_mode_set()

unsigned char cx16_k_screen_mode_set ( unsigned char  mode)

◆ cx16_k_screen_set_charset()

void cx16_k_screen_set_charset ( unsigned char  charset_type,
void *  charsetaddr 
)

◆ cx16_k_sprite_set_image()

unsigned char cx16_k_sprite_set_image ( unsigned char  num,
unsigned char  w,
unsigned char  h,
unsigned char  maskflag,
void *  imageaddr,
void *  maskaddr,
unsigned char  bpp 
)

◆ cx16_k_sprite_set_position()

unsigned char cx16_k_sprite_set_position ( unsigned char  sprnum,
unsigned int  xpos,
unsigned int  ypos 
)

◆ fb_get_pixel()

unsigned char fb_get_pixel ( void  )

◆ get_numbanks()

unsigned short get_numbanks ( void  )

◆ get_ostype()

signed char get_ostype ( void  )

◆ get_tv()

unsigned char get_tv ( void  )

◆ set_tv()

void set_tv ( unsigned char  type)

◆ vera_layer_enable()

unsigned char vera_layer_enable ( unsigned char  layers)

◆ vera_sprites_enable()

unsigned char vera_sprites_enable ( unsigned char  enable)

◆ videomode()

signed char videomode ( signed char  mode)

◆ vpeek()

unsigned char vpeek ( unsigned long  addr)

◆ vpoke()

void vpoke ( unsigned char  data,
unsigned long  addr 
)

◆ waitvsync()

void waitvsync ( void  )