PVcollib  1.5.0
A devkit for ColecoVision
score.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------------
2 
3  Generic score 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_SCORE_H
40 #define COL_SCORE_H
41 
42 #include <coleco/coltypes.h>
43 
49 typedef struct {
50  unsigned lo;
51  unsigned hi;
52 } score_t;
53 
60 void sys_scoclear(score_t *sco);
61 
69 void sys_scoadd(score_t *sco, unsigned value);
70 
79 u16 sys_scocmp(score_t *sco1,score_t *sco2);
80 
88 void sys_scocpy(score_t *sco1,score_t *sco2);
89 
98 char *sys_scostr(score_t *sco, unsigned length);
99 
100 #endif
u16 sys_scocmp(score_t *sco1, score_t *sco2)
Compare two scores and return 1 if 1st one is lower than 2nd one.
void sys_scoadd(score_t *sco, unsigned value)
Add a unsigned value to a score variable.
void sys_scocpy(score_t *sco1, score_t *sco2)
Copy a score sco1 into another score sco2.
Custom types used by pvcollib.
unsigned lo
Definition: score.h:50
void sys_scoclear(score_t *sco)
Init a score variable with value 0.
score value Can manage score with more than 65536 values (max of an unsigned)
Definition: score.h:49
char * sys_scostr(score_t *sco, unsigned length)
Convert a score variable to a string of specific length.
unsigned hi
Definition: score.h:51