add support for doublesized menu fonts
[picodrive.git] / platform / gp2x / plat.c
CommitLineData
1fb0dd88 1#include <string.h>
2
3#include "gp2x.h"
4#include "../common/plat.h"
5#include "../common/readpng.h"
6#include "../common/menu.h"
e2de9939 7#include "../common/emu.h"
1fb0dd88 8
9
10void plat_video_menu_enter(int is_rom_loaded)
11{
12 if (is_rom_loaded)
13 {
14 // darken the active framebuffer
e2de9939 15 memset(g_screen_ptr, 0, 320*8*2);
16 menu_darken_bg((char *)g_screen_ptr + 320*8*2, 320*224, 1);
17 memset((char *)g_screen_ptr + 320*232*2, 0, 320*8*2);
1fb0dd88 18 }
19 else
20 {
21 // should really only happen once, on startup..
e2de9939 22 readpng(g_screen_ptr, "skin/background.png", READPNG_BG);
1fb0dd88 23 }
24
25 // copy to buffer2
e2de9939 26 gp2x_memcpy_buffers((1<<2), g_screen_ptr, 0, 320*240*2);
1fb0dd88 27
28 // switch to 16bpp
29 gp2x_video_changemode2(16);
30 gp2x_video_RGB_setscaling(0, 320, 240);
31 gp2x_video_flip2();
32}
33
34void plat_video_menu_begin(void)
35{
36 gp2x_pd_clone_buffer2();
37}
38
39void plat_video_menu_end(void)
40{
41 gp2x_video_flush_cache();
42 gp2x_video_flip2();
43}
44