-void gp2x_make_fb_bufferable(int yes)
-{
- int ret = 0;
-
- yes = yes ? 1 : 0;
- ret |= warm_change_cb_range(WCB_B_BIT, yes, gp2x_screens[0], 320*240*2);
- ret |= warm_change_cb_range(WCB_B_BIT, yes, gp2x_screens[1], 320*240*2);
- ret |= warm_change_cb_range(WCB_B_BIT, yes, gp2x_screens[2], 320*240*2);
- ret |= warm_change_cb_range(WCB_B_BIT, yes, gp2x_screens[3], 320*240*2);
-
- if (ret)
- fprintf(stderr, "could not make fb buferable.\n");
- else
- printf("made fb buferable.\n");
-}
-
-/* common */
-void plat_video_menu_enter(int is_rom_loaded)
-{
- if (gp2x_current_bpp != 16 || gp2x_dev_id == GP2X_DEV_WIZ) {
- /* try to switch nicely avoiding glitches */
- gp2x_video_wait_vsync();
- memset(gp2x_screens[0], 0, 320*240*2);
- memset(gp2x_screens[1], 0, 320*240*2);
- gp2x_video_flip2(); // might flip to fb2/3
- gp2x_video_flip2(); // ..so we do it again
- // gp2x_video_wait_vsync();
- }
-
- // switch to 16bpp
- gp2x_video_changemode_ll(16);
- gp2x_video_RGB_setscaling(0, 320, 240);
-}
-
-void plat_video_menu_begin(void)
-{
- memcpy(g_screen_ptr, gp2x_screens[2], 320*240*2);
- g_menuscreen_ptr = g_screen_ptr;
-}
-
-void plat_video_menu_end(void)
-{
- // FIXME
- // gp2x_video_flush_cache();
- gp2x_video_flip2();
-}
-
-void plat_early_init(void)
+static const char * const caanoo_keys[KEY_MAX + 1] = {
+ [0 ... KEY_MAX] = NULL,
+ [KEY_UP] = "Up",
+ [KEY_LEFT] = "Left",
+ [KEY_RIGHT] = "Right",
+ [KEY_DOWN] = "Down",
+ [BTN_TRIGGER] = "A",
+ [BTN_THUMB] = "X",
+ [BTN_THUMB2] = "B",
+ [BTN_TOP] = "Y",
+ [BTN_TOP2] = "L",
+ [BTN_PINKIE] = "R",
+ [BTN_BASE] = "Home",
+ [BTN_BASE2] = "Lock",
+ [BTN_BASE3] = "I",
+ [BTN_BASE4] = "II",
+ [BTN_BASE5] = "Push",
+};
+
+/* to be filled by mmsp2/pollux _init */
+struct plat_target plat_target;
+
+int plat_target_init(void)