llvm-mos-sdk
Classes | Macros | Enumerations | Functions
rp6502.h File Reference

Go to the source code of this file.

Classes

struct  vga_mode1_config_t
 
struct  vga_mode2_config_t
 
struct  vga_mode3_config_t
 
struct  vga_mode4_sprite_t
 
struct  vga_mode4_asprite_t
 

Macros

#define RIA   (*(volatile struct __RP6502 *)0xFFE0)
 
#define RIA_READY_TX_BIT   0x80
 
#define RIA_READY_RX_BIT   0x40
 
#define RIA_BUSY_BIT   0x80
 
#define RIA_OP_EXIT   0xFF
 
#define RIA_OP_ZXSTACK   0x00
 
#define RIA_OP_XREG   0x01
 
#define RIA_OP_PHI2   0x02
 
#define RIA_OP_CODEPAGE   0x03
 
#define RIA_OP_LRAND   0x04
 
#define RIA_OP_STDIN_OPT   0x05
 
#define RIA_OP_CLOCK   0x0F
 
#define RIA_OP_CLOCK_GETRES   0x10
 
#define RIA_OP_CLOCK_GETTIME   0x11
 
#define RIA_OP_CLOCK_SETTIME   0x12
 
#define RIA_OP_CLOCK_GETTIMEZONE   0x13
 
#define RIA_OP_OPEN   0x14
 
#define RIA_OP_CLOSE   0x15
 
#define RIA_OP_READ_XSTACK   0x16
 
#define RIA_OP_READ_XRAM   0x17
 
#define RIA_OP_WRITE_XSTACK   0x18
 
#define RIA_OP_WRITE_XRAM   0x19
 
#define RIA_OP_LSEEK   0x1A
 
#define RIA_OP_UNLINK   0x1B
 
#define RIA_OP_RENAME   0x1C
 
#define STDIN_FILENO   0
 
#define STDOUT_FILENO   1
 
#define STDERR_FILENO   2
 
#define O_RDONLY   0x01
 
#define O_WRONLY   0x02
 
#define O_RDWR   0x03
 
#define O_CREAT   0x10
 
#define O_TRUNC   0x20
 
#define O_APPEND   0x40
 
#define O_EXCL   0x80
 
#define SEEK_CUR   0
 
#define SEEK_END   1
 
#define SEEK_SET   2
 
#define xram0_struct_set(addr, type, member, val)
 
#define xram1_struct_set(addr, type, member, val)
 

Enumerations

enum  FRESULT {
  FR_OK = 32, FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY,
  FR_NO_FILE, FR_NO_PATH, FR_INVALID_NAME, FR_DENIED,
  FR_EXIST, FR_INVALID_OBJECT, FR_WRITE_PROTECTED, FR_INVALID_DRIVE,
  FR_NOT_ENABLED, FR_NO_FILESYSTEM, FR_MKFS_ABORTED, FR_TIMEOUT,
  FR_LOCKED, FR_NOT_ENOUGH_CORE, FR_TOO_MANY_OPEN_FILES, FR_INVALID_PARAMETER
}
 

Functions

int xregn (char device, char channel, unsigned char address, unsigned count,...)
 
int phi2 (void)
 
int codepage (void)
 
long lrand (void)
 
int stdin_opt (unsigned long ctrl_bits, unsigned char str_length)
 
int read_xstack (void *buf, unsigned count, int fildes)
 
int read_xram (unsigned buf, unsigned count, int fildes)
 
int write_xstack (const void *buf, unsigned count, int fildes)
 
int write_xram (unsigned buf, unsigned count, int fildes)
 
int open (const char *name, int flags,...)
 
int read (int fildes, void *buf, unsigned count)
 
int write (int fildes, const void *buf, unsigned count)
 
int close (int fd)
 
long lseek (int fd, long offset, int whence)
 
unsigned char _sysremove (const char *name)
 
unsigned char _sysrename (const char *oldpath, const char *newpath)
 

Macro Definition Documentation

◆ O_APPEND

#define O_APPEND   0x40

◆ O_CREAT

#define O_CREAT   0x10

◆ O_EXCL

#define O_EXCL   0x80

◆ O_RDONLY

#define O_RDONLY   0x01

◆ O_RDWR

#define O_RDWR   0x03

◆ O_TRUNC

#define O_TRUNC   0x20

◆ O_WRONLY

#define O_WRONLY   0x02

◆ RIA

#define RIA   (*(volatile struct __RP6502 *)0xFFE0)

◆ RIA_BUSY_BIT

#define RIA_BUSY_BIT   0x80

◆ RIA_OP_CLOCK

#define RIA_OP_CLOCK   0x0F

◆ RIA_OP_CLOCK_GETRES

#define RIA_OP_CLOCK_GETRES   0x10

◆ RIA_OP_CLOCK_GETTIME

#define RIA_OP_CLOCK_GETTIME   0x11

◆ RIA_OP_CLOCK_GETTIMEZONE

#define RIA_OP_CLOCK_GETTIMEZONE   0x13

◆ RIA_OP_CLOCK_SETTIME

#define RIA_OP_CLOCK_SETTIME   0x12

◆ RIA_OP_CLOSE

#define RIA_OP_CLOSE   0x15

◆ RIA_OP_CODEPAGE

#define RIA_OP_CODEPAGE   0x03

◆ RIA_OP_EXIT

#define RIA_OP_EXIT   0xFF

◆ RIA_OP_LRAND

#define RIA_OP_LRAND   0x04

◆ RIA_OP_LSEEK

#define RIA_OP_LSEEK   0x1A

◆ RIA_OP_OPEN

#define RIA_OP_OPEN   0x14

◆ RIA_OP_PHI2

#define RIA_OP_PHI2   0x02

◆ RIA_OP_READ_XRAM

#define RIA_OP_READ_XRAM   0x17

◆ RIA_OP_READ_XSTACK

#define RIA_OP_READ_XSTACK   0x16

◆ RIA_OP_RENAME

#define RIA_OP_RENAME   0x1C

◆ RIA_OP_STDIN_OPT

#define RIA_OP_STDIN_OPT   0x05

◆ RIA_OP_UNLINK

#define RIA_OP_UNLINK   0x1B

◆ RIA_OP_WRITE_XRAM

#define RIA_OP_WRITE_XRAM   0x19

◆ RIA_OP_WRITE_XSTACK

#define RIA_OP_WRITE_XSTACK   0x18

◆ RIA_OP_XREG

#define RIA_OP_XREG   0x01

◆ RIA_OP_ZXSTACK

#define RIA_OP_ZXSTACK   0x00

◆ RIA_READY_RX_BIT

#define RIA_READY_RX_BIT   0x40

◆ RIA_READY_TX_BIT

#define RIA_READY_TX_BIT   0x80

◆ SEEK_CUR

#define SEEK_CUR   0

◆ SEEK_END

#define SEEK_END   1

◆ SEEK_SET

#define SEEK_SET   2

◆ STDERR_FILENO

#define STDERR_FILENO   2

◆ STDIN_FILENO

#define STDIN_FILENO   0

◆ STDOUT_FILENO

#define STDOUT_FILENO   1

◆ xram0_struct_set

#define xram0_struct_set (   addr,
  type,
  member,
  val 
)
Value:
RIA.addr0 = (unsigned)(&((type *)0)->member) + (unsigned)addr; \
switch (sizeof(((type *)0)->member)) { \
case 1: \
RIA.rw0 = val; \
break; \
case 2: \
RIA.step0 = 1; \
RIA.rw0 = val & 0xff; \
RIA.rw0 = (val >> 8) & 0xff; \
break; \
case 4: \
RIA.step0 = 1; \
RIA.rw0 = (unsigned long)val & 0xff; \
RIA.rw0 = ((unsigned long)val >> 8) & 0xff; \
RIA.rw0 = ((unsigned long)val >> 16) & 0xff; \
RIA.rw0 = ((unsigned long)val >> 24) & 0xff; \
break; \
}

◆ xram1_struct_set

#define xram1_struct_set (   addr,
  type,
  member,
  val 
)
Value:
RIA.addr1 = (unsigned)(&((type *)0)->member) + (unsigned)addr; \
switch (sizeof(((type *)0)->member)) { \
case 1: \
RIA.rw1 = val; \
break; \
case 2: \
RIA.step1 = 1; \
RIA.rw1 = val & 0xff; \
RIA.rw1 = (val >> 8) & 0xff; \
break; \
case 4: \
RIA.step1 = 1; \
RIA.rw1 = (unsigned long)val & 0xff; \
RIA.rw1 = ((unsigned long)val >> 8) & 0xff; \
RIA.rw1 = ((unsigned long)val >> 16) & 0xff; \
RIA.rw1 = ((unsigned long)val >> 24) & 0xff; \
break; \
}

Enumeration Type Documentation

◆ FRESULT

enum FRESULT
Enumerator
FR_OK 
FR_DISK_ERR 
FR_INT_ERR 
FR_NOT_READY 
FR_NO_FILE 
FR_NO_PATH 
FR_INVALID_NAME 
FR_DENIED 
FR_EXIST 
FR_INVALID_OBJECT 
FR_WRITE_PROTECTED 
FR_INVALID_DRIVE 
FR_NOT_ENABLED 
FR_NO_FILESYSTEM 
FR_MKFS_ABORTED 
FR_TIMEOUT 
FR_LOCKED 
FR_NOT_ENOUGH_CORE 
FR_TOO_MANY_OPEN_FILES 
FR_INVALID_PARAMETER 

Function Documentation

◆ _sysremove()

unsigned char _sysremove ( const char *  name)

◆ _sysrename()

unsigned char _sysrename ( const char *  oldpath,
const char *  newpath 
)

◆ close()

int close ( int  fd)

◆ codepage()

int codepage ( void  )

◆ lrand()

long lrand ( void  )

◆ lseek()

long lseek ( int  fd,
long  offset,
int  whence 
)

◆ open()

int open ( const char *  name,
int  flags,
  ... 
)

◆ phi2()

int phi2 ( void  )

◆ read()

int read ( int  fildes,
void *  buf,
unsigned  count 
)

◆ read_xram()

int read_xram ( unsigned  buf,
unsigned  count,
int  fildes 
)

◆ read_xstack()

int read_xstack ( void *  buf,
unsigned  count,
int  fildes 
)

◆ stdin_opt()

int stdin_opt ( unsigned long  ctrl_bits,
unsigned char  str_length 
)

◆ write()

int write ( int  fildes,
const void *  buf,
unsigned  count 
)

◆ write_xram()

int write_xram ( unsigned  buf,
unsigned  count,
int  fildes 
)

◆ write_xstack()

int write_xstack ( const void *  buf,
unsigned  count,
int  fildes 
)

◆ xregn()

int xregn ( char  device,
char  channel,
unsigned char  address,
unsigned  count,
  ... 
)
RIA
#define RIA
Definition: rp6502.h:33