PVcollib  1.5.0
A devkit for ColecoVision
console.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------------
2 
3  Generic console functions.
4 
5  Copyright (C) 2018-2019
6  Alekmaul
7 
8  This software is provided 'as-is', without any express or implied
9  warranty. In no event will the authors be held liable for any
10  damages arising from the use of this software.
11 
12  Permission is granted to anyone to use this software for any
13  purpose, including commercial applications, and to alter it and
14  redistribute it freely, subject to the following restrictions:
15 
16  1. The origin of this software must not be misrepresented; you
17  must not claim that you wrote the original software. If you use
18  this software in a product, an acknowledgment in the product
19  documentation would be appreciated but is not required.
20  2. Altered source versions must be plainly marked as such, and
21  must not be misrepresented as being the original software.
22  3. This notice may not be removed or altered from any source
23  distribution.
24 
25 
26 ---------------------------------------------------------------------------------*/
39 #ifndef COL_CONSOLE_H
40 #define COL_CONSOLE_H
41 
42 #include <coleco/coltypes.h>
43 
49 extern u8 buffer32[32];
50 
55 extern volatile u8 vid_freq;
56 
63 u16 sys_random(void);
64 
73 u8 sys_randbyte(u8 A, u8 B);
74 
75 
80 void sys_pause(void);
81 
89 u16 sys_strlen(char *text);
90 
98 void sys_utoa(unsigned value,char *buffer);
99 
107 char *sys_str(unsigned value);
108 
117 void sys_memcpyb (void *dest,void *src,unsigned num);
118 
127 u8 sys_choice(u8 minval, u8 maxval);
128 
129 #endif
u8 sys_randbyte(u8 A, u8 B)
Generate and return a randomized a 8 bit number between two numbers named A and B.
u16 sys_strlen(char *text)
return the length of a string
u8 buffer32[32]
buffer32 used for some functions.
void sys_utoa(unsigned value, char *buffer)
Convert an unsigned value to ascii text.
void sys_memcpyb(void *dest, void *src, unsigned num)
Copy memory.
char * sys_str(unsigned value)
return a converted value in string
Custom types used by pvcollib.
volatile u8 vid_freq
vid_freq is set with video frequency (50 or 60) hz.
void sys_pause(void)
Wait until a fire button is pressed (do a pause)
u8 sys_choice(u8 minval, u8 maxval)
Wait until a key between two values if pressed.
u16 sys_random(void)
Generate and return a randomized 16 bit number.