sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
aaout.c
1#include "aalib.h"
2void aa_puts(aa_context * c, int x, int y, int attr, char *s)
3{
4 char s1[10000];
5 int pos, pos1;
6 int x1, y1;
7 if (x < 0 || y < 0 || x >= aa_scrwidth(c) || y >= aa_scrheight(c))
8 return;
9 x1 = x;
10 y1 = y;
11 for (pos = 0; s[pos] != 0 && pos < 10000; pos++) {
12 s1[pos] = s[pos];
13 pos1 = x1 + y1 * aa_scrwidth(c);
14 c->textbuffer[pos1] = s[pos];
15 c->attrbuffer[pos1] = attr;
16 x1++;
17 if (x1 >= aa_scrwidth(c)) {
18 x1 = 0;
19 y1++;
20 if (y1 >= aa_scrheight(c))
21 break;
22 }
23 }
24}
25void aa_resizehandler(aa_context * c, void (*handler) (aa_context *))
26{
27 c->resizehandler = handler;
28}
29
30void aa_hidecursor(aa_context * c)
31{
32 c->cursorstate--;
33 if (c->cursorstate == -1 && c->driver->cursormode != NULL)
34 c->driver->cursormode(c, 0);
35}
36void aa_showcursor(aa_context * c)
37{
38 c->cursorstate++;
39 if (c->cursorstate == 0 && c->driver->cursormode != NULL)
40 c->driver->cursormode(c, 1);
41 aa_gotoxy(c, c->cursorx, c->cursory);
42}
43void aa_gotoxy(aa_context * c, int x, int y)
44{
45 if (c->cursorstate >= 0) {
46 if (x < 0)
47 x = 0;
48 if (y < 0)
49 y = 0;
50 if (x >= aa_scrwidth(c))
51 x = aa_scrwidth(c) - 1;
52 if (y >= aa_scrheight(c))
53 y = aa_scrheight(c) - 1;
54 c->driver->gotoxy(c, x, y);
55 c->cursorx = x;
56 c->cursory = y;
57 }
58}