PVcollib  1.5.0
A devkit for ColecoVision
Functions | Variables
console.h File Reference

coleco generic console support. More...

#include <coleco/coltypes.h>

Go to the source code of this file.

Functions

u8 sys_choice (u8 minval, u8 maxval)
 Wait until a key between two values if pressed. More...
 
void sys_memcpyb (void *dest, void *src, unsigned num)
 Copy memory. More...
 
void sys_pause (void)
 Wait until a fire button is pressed (do a pause)
 
u8 sys_randbyte (u8 A, u8 B)
 Generate and return a randomized a 8 bit number between two numbers named A and B. More...
 
u16 sys_random (void)
 Generate and return a randomized 16 bit number. More...
 
char * sys_str (unsigned value)
 return a converted value in string More...
 
u16 sys_strlen (char *text)
 return the length of a string More...
 
void sys_utoa (unsigned value, char *buffer)
 Convert an unsigned value to ascii text. More...
 

Variables

u8 buffer32 [32]
 buffer32 used for some functions. More...
 
volatile u8 vid_freq
 vid_freq is set with video frequency (50 or 60) hz.
 

Detailed Description

coleco generic console support.

This unit provides generic features related to the console.

Here is the list of features:

Function Documentation

◆ sys_choice()

u8 sys_choice ( u8  minval,
u8  maxval 
)

Wait until a key between two values if pressed.

Parameters
minvalminimum value of key pressed
maxvalmaximum value of key pressed
Returns
value of key pressed

◆ sys_memcpyb()

void sys_memcpyb ( void *  dest,
void *  src,
unsigned  num 
)

Copy memory.

Parameters
destdestination memory
srcsource memory
numnumber of bytes to copy

◆ sys_randbyte()

u8 sys_randbyte ( u8  A,
u8  B 
)

Generate and return a randomized a 8 bit number between two numbers named A and B.

Parameters
Aminimum value of random number
Bmaximum value of random number
Returns
unsigned char of a randomized number

◆ sys_random()

u16 sys_random ( void  )

Generate and return a randomized 16 bit number.

Returns
unsigned short of a randomized number
Examples:
random/randvalue.c.

◆ sys_str()

char * sys_str ( unsigned  value)

return a converted value in string

Parameters
valuenumber to convert
Returns
pointer to converted string
Examples:
scoring/scoring.c.

◆ sys_strlen()

u16 sys_strlen ( char *  text)

return the length of a string

Parameters
texttext to analyze
Returns
unsigned short of string length

◆ sys_utoa()

void sys_utoa ( unsigned  value,
char *  buffer 
)

Convert an unsigned value to ascii text.

Leading zeros are put in buffer

Parameters
valuevalue to convert to text
buffertext that will receive vvalue converted
Examples:
random/randvalue.c.

Variable Documentation

◆ buffer32

u8 buffer32[32]

buffer32 used for some functions.


can be used by program too.

Examples:
random/randvalue.c.