Import Cardgame 0.1.15 upstream source snapshot
Original author: Pierre Sarrazin. Public-domain library and demo. Source: http://sarrazip.com/dev/cardgame-0.1.15.tar.gz Archive SHA-256: ca706dddd96fec63b829f8958c2e47485b0e1166129d45fda0b6369404c1bb54
This commit is contained in:
commit
d3a54e24ee
39 files changed
+2603
No files matched your search
@@ -0,0 +1,18 @@
|
||||
#include "cardgame.h"
|
||||
|
||||
|
||||
byte
|
||||
printCentered(byte row, const char *str)
|
||||
{
|
||||
word len = strlen(str);
|
||||
if (len > textScreenWidth)
|
||||
len = textScreenWidth;
|
||||
byte col = (byte) (textScreenWidth - len) >> 1;
|
||||
moveCursor(0, row);
|
||||
for (byte x = 0; x < col; ++x)
|
||||
putchar(' ');
|
||||
putstr(str, len);
|
||||
for (byte x = col; x < BYTES_PER_SCREEN_ROW; ++x)
|
||||
putchar(' ');
|
||||
return col;
|
||||
}
|
||||
Reference in new issue
Block a user