pandora: tripplebuffer fbdev out, refactoring
[picodrive.git] / platform / pandora / pandora.c
CommitLineData
3a3947cd 1#include <stdio.h>\r
2#include <stdlib.h>\r
3#include <stdarg.h>\r
3a3947cd 4\r
e5ab6faf 5#include "../linux/sndout_oss.h"\r
d08e7326 6#include "../linux/fbdev.h"\r
74f5e726 7#include "../common/emu.h"\r
3a3947cd 8\r
697746df 9void plat_early_init(void)\r
10{\r
11}\r
12\r
13void plat_init(void)\r
3a3947cd 14{\r
d08e7326 15 int ret, w, h;\r
3a3947cd 16\r
d08e7326 17 ret = vout_fbdev_init(&w, &h);\r
18 if (ret != 0) {\r
19 fprintf(stderr, "couldn't init framebuffer\n");\r
e163b67f 20 exit(1);\r
21 }\r
22\r
d08e7326 23 if (w != g_screen_width || h != g_screen_height) {\r
24 fprintf(stderr, "%dx%d not supported\n", w, h);\r
25 vout_fbdev_finish();\r
e55f0cbb 26 exit(1);\r
27 }\r
3a3947cd 28\r
3a3947cd 29 // snd\r
e5ab6faf 30 sndout_oss_init();\r
3a3947cd 31}\r
32\r
697746df 33void plat_finish(void)\r
3a3947cd 34{\r
e5ab6faf 35 sndout_oss_exit();\r
d08e7326 36 vout_fbdev_finish();\r
3a3947cd 37\r
e55f0cbb 38 printf("all done");\r
3a3947cd 39}\r
40\r
41/* lprintf */\r
42void lprintf(const char *fmt, ...)\r
43{\r
44 va_list vl;\r
45\r
46 va_start(vl, fmt);\r
47 vprintf(fmt, vl);\r
48 va_end(vl);\r
49}\r
50\r