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
5
int
disp_xpos
=
XPOS_INIT
;
6
int
disp_ypos
=
YPOS_INIT
;
7
8
void
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
}
26
void
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
{
39
disp_xpos
=
XPOS_INIT
;
40
disp_ypos
++;
41
}
42
}
43
}
44
bfont_draw
size_t bfont_draw(void *buffer, uint32_t bufwidth, bool opaque, uint32_t c)
Draw a single character to a buffer.
vram_s
uint16_t * vram_s
16-bit size pointer to the current drawing area.
print_d
void print_d(char *str)
Definition
display.c:26
YPOS_INIT
#define YPOS_INIT
Definition
display.c:2
printpos_d
void printpos_d(int xpos, int ypos, char *str)
Definition
display.c:8
XPOS_INIT
#define XPOS_INIT
Definition
display.c:1
SCREENWIDTH
#define SCREENWIDTH
Definition
display.c:3
disp_xpos
int disp_xpos
Definition
display.c:5
disp_ypos
int disp_ypos
Definition
display.c:6
examples
dreamcast
sound
hello-mp3
display.c
Generated by
1.12.0