PVcollib  1.5.0
A devkit for ColecoVision
Data Structures | Functions
score.h File Reference

coleco generic score support. More...

#include <coleco/coltypes.h>

Go to the source code of this file.

Data Structures

struct  score_t
 score value Can manage score with more than 65536 values (max of an unsigned) More...
 

Functions

void sys_scoadd (score_t *sco, unsigned value)
 Add a unsigned value to a score variable. More...
 
void sys_scoclear (score_t *sco)
 Init a score variable with value 0. More...
 
u16 sys_scocmp (score_t *sco1, score_t *sco2)
 Compare two scores and return 1 if 1st one is lower than 2nd one. More...
 
void sys_scocpy (score_t *sco1, score_t *sco2)
 Copy a score sco1 into another score sco2. More...
 
char * sys_scostr (score_t *sco, unsigned length)
 Convert a score variable to a string of specific length. More...
 

Detailed Description

coleco generic score support.

This unit provides methods to manage scores.

Here is the list of supported features:

Function Documentation

◆ sys_scoadd()

void sys_scoadd ( score_t sco,
unsigned  value 
)

Add a unsigned value to a score variable.

Parameters
scoscore variable
valuevalue to add to score
Examples:
scoring/scoring.c.

◆ sys_scoclear()

void sys_scoclear ( score_t sco)

Init a score variable with value 0.

Parameters
scoscore variable to reset
Examples:
scoring/scoring.c.

◆ sys_scocmp()

u16 sys_scocmp ( score_t sco1,
score_t sco2 
)

Compare two scores and return 1 if 1st one is lower than 2nd one.

Parameters
sco1score variable
sco2score variable
Returns
1 if sco1 is lower than sco2, 0 if not, 0xFF if equals
Examples:
scoring/scoring.c.

◆ sys_scocpy()

void sys_scocpy ( score_t sco1,
score_t sco2 
)

Copy a score sco1 into another score sco2.

Parameters
sco1score variable
sco2score variable

◆ sys_scostr()

char * sys_scostr ( score_t sco,
unsigned  length 
)

Convert a score variable to a string of specific length.

Parameters
scoscore variable
lengthnumber of digits for displkay (max 9)
Returns
char * string value of score
Examples:
scoring/scoring.c.