KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
display.c
Go to the documentation of this file.
1#define XPOS_INIT 1
2#define YPOS_INIT 1
3#define SCREENWIDTH 640
4
7
8void printpos_d(int xpos, int ypos, char *str) {
9 int offset;
10 char current;
11
12 while(*str) {
13 offset = (xpos * 12) + ((ypos * (24 + 4)) * SCREENWIDTH);
14 current = *str++;
15
16 if(current != '\n') {
17 bfont_draw(vram_s + offset, SCREENWIDTH, 0, current);
18 xpos++;
19 }
20 else {
21 xpos = XPOS_INIT;
22 ypos ++;
23 }
24 }
25}
26void print_d(char *str) {
27 int offset;
28 char current;
29
30 while(*str) {
31 offset = (disp_xpos * 12) + ((disp_ypos * (24 + 4)) * SCREENWIDTH);
32 current = *str++;
33
34 if(current != '\n') {
35 bfont_draw(vram_s + offset, SCREENWIDTH, 0, current);
36 disp_xpos++;
37 }
38 else {
40 disp_ypos ++;
41 }
42 }
43}
44
size_t bfont_draw(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
Draw a single character to a buffer.
uint16_t * vram_s
16-bit size pointer to the current drawing area.
void print_d(char *str)
Definition display.c:26
#define YPOS_INIT
Definition display.c:2
void printpos_d(int xpos, int ypos, char *str)
Definition display.c:8
#define XPOS_INIT
Definition display.c:1
#define SCREENWIDTH
Definition display.c:3
int disp_xpos
Definition display.c:5
int disp_ypos
Definition display.c:6