OBJS += frontend/plat_dummy.o
endif
ifeq "$(PLATFORM)" "pandora"
-frontend/%.o: CFLAGS += -DVOUT_FBDEV
OBJS += frontend/linux/fbdev.o
OBJS += frontend/plat_omap.o
OBJS += frontend/plat_pandora.o
#include "config.h"
#include "plugin.h"
#include "plugin_lib.h"
-#include "omap.h"
#include "plat.h"
#include "pcnt.h"
#include "common/plat.h"
scaling = SCALE_CUSTOM;
- omap_enable_layer(1);
+ plat_gvideo_open();
for (;;)
{
g_layer_w = 800 - g_layer_x;
if (g_layer_y + g_layer_h > 480)
g_layer_h = 480 - g_layer_y;
- omap_enable_layer(1);
+ // resize the layer
+ plat_gvideo_open();
}
}
- omap_enable_layer(0);
+ plat_gvideo_close();
return 0;
}
#endif
}
+// XXX: should really menu code cotrol the layer size?
void menu_notify_mode_change(int w, int h, int bpp)
{
float mult;
+++ /dev/null
-
-extern struct vout_fbdev *layer_fb;
-extern int g_layer_x, g_layer_y;
-extern int g_layer_w, g_layer_h;
-
-int omap_enable_layer(int enabled);
int plat_cpu_clock_apply(int cpu_clock);
int plat_get_bat_capacity(void);
+// indirectly called from GPU plugin
+void plat_gvideo_open(void);
+void *plat_gvideo_set_mode(int *w, int *h, int *bpp);
+void *plat_gvideo_flip(void);
+void plat_gvideo_close(void);
+
// XXX
int plat_pandora_init(void);
*/
#include "common/input.h"
-#include "linux/fbdev.h"
#include "plat.h"
-struct vout_fbdev *layer_fb;
-int g_layer_x, g_layer_y, g_layer_w, g_layer_h;
struct in_default_bind in_evdev_defbinds[] = {
{ 0, 0, 0 },
};
-int omap_enable_layer(int enabled)
-{
- return 0;
-}
-
void plat_video_menu_enter(int is_rom_loaded)
{
}
{
}
+void plat_gvideo_open(void)
+{
+}
+
+void *plat_gvideo_set_mode(int *w, int *h, int *bpp)
+{
+ return 0;
+}
+
+void *plat_gvideo_flip(void)
+{
+ return 0;
+}
+
+void plat_gvideo_close(void)
+{
+}
+
void plat_init(void)
{
}
/*
- * (C) notaz, 2010
+ * (C) GraÅžvydas "notaz" Ignotas, 2010-2012
*
* This work is licensed under the terms of the GNU GPLv2 or later.
* See the COPYING file in the top-level directory.
#include "linux/xenv.h"
#include "plugin_lib.h"
#include "pl_gun_ts.h"
-#include "omap.h"
#include "plat.h"
+#include "menu.h"
-
-static struct vout_fbdev *main_fb;
-int g_layer_x = 80, g_layer_y = 0;
-int g_layer_w = 640, g_layer_h = 480;
-
-struct vout_fbdev *layer_fb;
+static struct vout_fbdev *main_fb, *layer_fb;
static int omap_setup_layer_(int fd, int enabled, int x, int y, int w, int h)
{
return 0;
}
-int omap_enable_layer(int enabled)
+static int omap_enable_layer(int enabled)
{
if (enabled)
pl_set_gun_rect(g_layer_x, g_layer_y, g_layer_w, g_layer_h);
g_layer_x, g_layer_y, g_layer_w, g_layer_h);
}
+void plat_gvideo_open(void)
+{
+ omap_enable_layer(1);
+
+ // try to align redraws to vsync
+ vout_fbdev_wait_vsync(layer_fb);
+}
+
+void *plat_gvideo_set_mode(int *w, int *h, int *bpp)
+{
+ void *buf;
+
+ vout_fbdev_clear(layer_fb);
+ buf = vout_fbdev_resize(layer_fb, *w, *h, *bpp, 0, 0, 0, 0, 3);
+
+ omap_enable_layer(1);
+
+ return buf;
+}
+
+void *plat_gvideo_flip(void)
+{
+ return vout_fbdev_flip(layer_fb);
+}
+
+void plat_gvideo_close(void)
+{
+ omap_enable_layer(0);
+}
+
void plat_video_menu_enter(int is_rom_loaded)
{
g_menuscreen_ptr = vout_fbdev_resize(main_fb,
{
}
+void *plat_prepare_screenshot(int *w, int *h, int *bpp)
+{
+ return NULL;
+}
+
void plat_init(void)
{
const char *main_fb_name, *layer_fb_name;
exit(1);
}
+ g_layer_x = 80, g_layer_y = 0;
+ g_layer_w = 640, g_layer_h = 480;
+
ret = omap_setup_layer_(fd, 0, g_layer_x, g_layer_y, g_layer_w, g_layer_h);
close(fd);
if (ret != 0) {
static int psx_offset_x, psx_offset_y, psx_src_width, psx_src_height;
static int fb_offset_x, fb_offset_y;
-// TODO: get rid of this
-struct vout_fbdev;
-struct vout_fbdev *layer_fb;
-int g_layer_x, g_layer_y, g_layer_w, g_layer_h;
-
-int omap_enable_layer(int enabled)
-{
- return 0;
-}
-
static void caanoo_init(void);
-static void *pl_vout_set_mode(int w, int h, int bpp);
static void *fb_flip(void)
memset(g_menuscreen_ptr, 0, 320*240 * psx_bpp/8);
g_menuscreen_ptr = fb_flip();
- pl_vout_set_mode(psx_width, psx_height, psx_bpp);
}
void *plat_prepare_screenshot(int *w, int *h, int *bpp)
if (psx_bpp == 16) {
pl_vout_buf = g_menuscreen_ptr;
- pl_print_hud(320, fb_offset_y + psx_src_height, fb_offset_x);
+ pl_print_hud(fb_offset_x);
}
g_menuscreen_ptr = fb_flip();
\
if (psx_bpp == 16) { \
pl_vout_buf = g_menuscreen_ptr; \
- pl_print_hud(320, fb_offset_y + psx_src_height, fb_offset_x); \
+ pl_print_hud(fb_offset_x); \
} \
\
g_menuscreen_ptr = fb_flip(); \
make_flip_func(raw_flip_soft_512, blit320_512)
make_flip_func(raw_flip_soft_640, blit320_640)
-static void *pl_vout_set_mode(int w, int h, int bpp)
+void *plat_gvideo_set_mode(int *w_, int *h_, int *bpp_)
{
int poff_w, poff_h, w_max;
+ int w = *w_, h = *h_, bpp = *bpp_;
if (!w || !h || !bpp)
return NULL;
pl_set_gun_rect(fb_offset_x, fb_offset_y, w > 320 ? 320 : w, h);
+ // adjust for hud
+ *w_ = 320;
+ *h_ = fb_offset_y + psx_src_height;
+
return NULL;
}
-static void *pl_vout_flip(void)
+/* not really used, we do raw_flip */
+void plat_gvideo_open(void)
+{
+}
+
+void *plat_gvideo_flip(void)
{
return NULL;
}
+void plat_gvideo_close(void)
+{
+}
+
static void save_multiple_regs(unsigned int *dest, int base, int count)
{
const volatile unsigned int *regs = memregl + base / 4;
if (mixerdev == -1)
perror("open(/dev/mixer)");
- pl_rearmed_cbs.pl_vout_flip = pl_vout_flip;
pl_rearmed_cbs.pl_vout_raw_flip = have_warm ? raw_flip_dma : raw_flip_soft;
- pl_rearmed_cbs.pl_vout_set_mode = pl_vout_set_mode;
pl_rearmed_cbs.pl_vout_set_raw_vram = pl_vout_set_raw_vram;
psx_src_width = 320;
f = fopen(fname, "r");
if (f == NULL) {
- fprintf("fopen(%s)", fname);
+ fprintf(stderr, "fopen(%s)", fname);
perror("");
return -1;
}
#include "linux/fbdev.h"
#include "common/fonts.h"
#include "common/input.h"
-#include "omap.h"
#include "menu.h"
#include "main.h"
#include "plat.h"
int in_enable_vibration;
void *tsdev;
void *pl_vout_buf;
+int g_layer_x, g_layer_y, g_layer_w, g_layer_h;
static int pl_vout_w, pl_vout_h, pl_vout_bpp;
static int vsync_cnt;
static int frame_interval, frame_interval1024, vsync_usec_time;
}
}
-void pl_print_hud(int w, int h, int xborder)
+void pl_print_hud(int xborder)
{
- pl_vout_w = w; // used by pollux
- pl_vout_h = h;
+ int w = pl_vout_w, h = pl_vout_h;
if (g_opts & OPT_SHOWSPU)
draw_active_chans(w, h);
pl_vout_h = h;
pl_vout_bpp = bpp;
-#if defined(VOUT_FBDEV)
- vout_fbdev_clear(layer_fb);
- pl_vout_buf = vout_fbdev_resize(layer_fb, w, h, bpp, 0, 0, 0, 0, 3);
-#elif defined(MAEMO)
- extern void *hildon_set_mode(int w, int h);
- pl_vout_buf = hildon_set_mode(w, h);
-#endif
-
+ pl_vout_buf = plat_gvideo_set_mode(&pl_vout_w, &pl_vout_h, &pl_vout_bpp);
if (pl_vout_buf == NULL)
fprintf(stderr, "failed to set mode\n");
- // menu decides on layer size, we commit it
menu_notify_mode_change(w, h, bpp);
- omap_enable_layer(1);
return pl_vout_buf;
}
+// only used if raw flip is not defined
static void *pl_vout_flip(void)
{
pl_rearmed_cbs.flip_cnt++;
if (pl_vout_buf != NULL)
- pl_print_hud(pl_vout_w, pl_vout_h, 0);
+ pl_print_hud(0);
// let's flip now
-#if defined(VOUT_FBDEV)
- pl_vout_buf = vout_fbdev_flip(layer_fb);
-#elif defined(MAEMO)
- extern void *hildon_flip(void);
- pl_vout_buf = hildon_flip();
-#endif
+ pl_vout_buf = plat_gvideo_flip();
return pl_vout_buf;
}
static int pl_vout_open(void)
{
struct timeval now;
+ int h;
- omap_enable_layer(1);
-#if defined(VOUT_FBDEV)
// force mode update
- int h = pl_vout_h;
+ h = pl_vout_h;
pl_vout_h--;
pl_vout_buf = pl_vout_set_mode(pl_vout_w, h, pl_vout_bpp);
- // try to align redraws to vsync
- vout_fbdev_wait_vsync(layer_fb);
-#elif defined(MAEMO)
- extern void *hildon_flip(void);
- pl_vout_buf = hildon_flip();
-#endif
+ plat_gvideo_open();
gettimeofday(&now, 0);
vsync_usec_time = now.tv_usec;
static void pl_vout_close(void)
{
- omap_enable_layer(0);
+ plat_gvideo_close();
}
void *pl_prepare_screenshot(int *w, int *h, int *bpp)
{
-#if defined(VOUT_FBDEV)
+ void *ret = plat_prepare_screenshot(w, h, bpp);
+ if (ret != NULL)
+ return ret;
+
*w = pl_vout_w;
*h = pl_vout_h;
*bpp = pl_vout_bpp;
return pl_vout_buf;
-#else
- return plat_prepare_screenshot(w, h, bpp);
-#endif
}
#ifndef MAEMO
extern void *pl_vout_buf;
+extern int g_layer_x, g_layer_y;
+extern int g_layer_w, g_layer_h;
+
void pl_text_out16(int x, int y, const char *texto, ...);
void pl_start_watchdog(void);
void *pl_prepare_screenshot(int *w, int *h, int *bpp);
void pl_init(void);
-void pl_print_hud(int w, int h, int xborder);
+void pl_print_hud(int xborder);
void pl_timing_prepare(int is_pal);
void pl_frame_limit(void);
#include "plugin_lib.h"
#include "main.h"
+#include "plat.h"
#include "../libpcsxcore/psemu_plugin_defs.h"
#include "common/readpng.h"
#include "maemo_common.h"
#define D_WIDTH 640
#define D_HEIGHT 480
-int g_layer_x = (X_RES - D_WIDTH) / 2;
-int g_layer_y = (Y_RES - D_HEIGHT) / 2;
-int g_layer_w = D_WIDTH, g_layer_h = D_HEIGHT;
-
static GdkImage *image;
static HildonAnimationActor *actor;
static GtkWidget *window, *drawing;
gtk_widget_show_all (GTK_WIDGET (actor));
gtk_widget_show_all (GTK_WIDGET (window));
+
+ g_layer_x = (X_RES - D_WIDTH) / 2;
+ g_layer_y = (Y_RES - D_HEIGHT) / 2;
+ g_layer_w = D_WIDTH, g_layer_h = D_HEIGHT;
}
void menu_loop(void)
{
}
-void *hildon_set_mode(int w, int h)
+void *plat_gvideo_set_mode(int *w_, int *h_, int *bpp_)
{
+ int w = *w_, h = *h_;
+
if (w <= 0 || h <= 0)
return pl_vout_buf;
return pl_vout_buf;
}
-void *hildon_flip(void)
+void *plat_gvideo_flip(void)
{
gtk_widget_queue_draw (drawing);
return pl_vout_buf;
}
-int omap_enable_layer(int enabled)
+void plat_gvideo_open(void)
{
- return 0;
}
-void menu_notify_mode_change(int w, int h, int bpp)
+void plat_gvideo_close(void)
{
}