screen ptr/size unification, major cleanups
[libpicofe.git] / gp2x / plat.c
CommitLineData
24b24674 1#include <string.h>
2
3#include "gp2x.h"
4#include "../common/plat.h"
5#include "../common/readpng.h"
6#include "../common/menu.h"
e31266dd 7#include "../common/emu.h"
24b24674 8
9
10void plat_video_menu_enter(int is_rom_loaded)
11{
12 if (is_rom_loaded)
13 {
14 // darken the active framebuffer
e31266dd 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);
24b24674 18 }
19 else
20 {
21 // should really only happen once, on startup..
e31266dd 22 readpng(g_screen_ptr, "skin/background.png", READPNG_BG);
24b24674 23 }
24
25 // copy to buffer2
e31266dd 26 gp2x_memcpy_buffers((1<<2), g_screen_ptr, 0, 320*240*2);
24b24674 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