1 #ifndef __PLUGIN_LIB_H__
2 #define __PLUGIN_LIB_H__
4 #define THREAD_RENDERING_OFF 0
5 #define THREAD_RENDERING_SYNC 1
6 #define THREAD_RENDERING_ASYNC 2
26 extern int in_state_gun;
27 extern int in_type[8];
30 extern int in_analog_left[8][2];
31 extern int in_analog_right[8][2];
32 extern unsigned short in_keystate[8];
33 extern int in_mouse[8][2];
35 extern int in_adev[2], in_adev_axis[2][2];
36 extern int in_adev_is_nublike[2];
37 extern int in_enable_vibration;
39 extern void *pl_vout_buf;
41 extern int g_layer_x, g_layer_y;
42 extern int g_layer_w, g_layer_h;
44 void pl_start_watchdog(void);
45 void *pl_prepare_screenshot(int *w, int *h, int *bpp);
47 void pl_switch_dispmode(void);
49 void pl_timing_prepare(int is_pal);
50 void pl_frame_limit(void);
53 void (*pl_get_layer_pos)(int *x, int *y, int *w, int *h);
54 int (*pl_vout_open)(void);
55 void (*pl_vout_set_mode)(int w, int h, int raw_w, int raw_h, int bpp);
56 void (*pl_vout_flip)(const void *vram, int stride, int bgr24,
58 void (*pl_vout_close)(void);
59 void *(*mmap)(unsigned int size);
60 void (*munmap)(void *ptr, unsigned int size);
61 // only used by some frontends
62 void (*pl_vout_set_raw_vram)(void *vram);
63 void (*pl_set_gpu_caps)(int caps);
64 // some stats, for display by some plugins
65 int flips_per_sec, cpu_usage;
66 float vsps_cur; // currect vsync/s
67 // these are for gles plugin
68 unsigned int screen_w, screen_h;
69 void *gles_display, *gles_surface;
73 unsigned int *gpu_frame_count;
74 unsigned int *gpu_hcnt;
75 unsigned int flip_cnt; // increment manually if not using pl_vout_flip
76 unsigned int only_16bpp; // platform is 16bpp-only
77 unsigned int thread_rendering;
79 int allow_interlace; // 0 off, 1 on, 2 guess
80 int enhancement_enable;
81 int enhancement_no_main;
97 // old gpu_unai config for compatibility
99 int no_light, no_blend;
105 int bDrawDither, iFilterType, iFrameTexType;
106 int iUseMask, bOpaquePass, bAdvancedBlend, bUseFastMdec;
107 int iVRamSize, iTexGarbageCollection;
113 extern struct rearmed_cbs pl_rearmed_cbs;
115 enum gpu_plugin_caps {
116 GPU_CAP_OWNS_DISPLAY = (1 << 0),
117 GPU_CAP_SUPPORTS_2X = (1 << 1),
121 extern void (*pl_plat_clear)(void);
122 extern void (*pl_plat_blit)(int doffs, const void *src,
123 int w, int h, int sstride, int bgr24);
124 extern void (*pl_plat_hud_print)(int x, int y, const char *str, int bpp);
127 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
130 #endif /* __PLUGIN_LIB_H__ */