frontend: initial sdl overlay implementation
[pcsx_rearmed.git] / frontend / plugin_lib.h
... / ...
CommitLineData
1
2enum {
3 DKEY_SELECT = 0,
4 DKEY_L3,
5 DKEY_R3,
6 DKEY_START,
7 DKEY_UP,
8 DKEY_RIGHT,
9 DKEY_DOWN,
10 DKEY_LEFT,
11 DKEY_L2,
12 DKEY_R2,
13 DKEY_L1,
14 DKEY_R1,
15 DKEY_TRIANGLE,
16 DKEY_CIRCLE,
17 DKEY_CROSS,
18 DKEY_SQUARE,
19};
20extern int in_type1, in_type2;
21extern int in_keystate, in_state_gun, in_a1[2], in_a2[2];
22extern int in_adev[2], in_adev_axis[2][2];
23extern int in_adev_is_nublike[2];
24extern int in_enable_vibration;
25
26extern void *pl_vout_buf;
27
28extern int g_layer_x, g_layer_y;
29extern int g_layer_w, g_layer_h;
30
31void pl_start_watchdog(void);
32void *pl_prepare_screenshot(int *w, int *h, int *bpp);
33void pl_init(void);
34void pl_print_hud(int width, int height, int xborder);
35void pl_switch_dispmode(void);
36
37void pl_timing_prepare(int is_pal);
38void pl_frame_limit(void);
39
40struct rearmed_cbs {
41 void (*pl_get_layer_pos)(int *x, int *y, int *w, int *h);
42 int (*pl_vout_open)(void);
43 void (*pl_vout_set_mode)(int w, int h, int raw_w, int raw_h, int bpp);
44 void (*pl_vout_flip)(const void *vram, int stride, int bgr24,
45 int w, int h);
46 void (*pl_vout_close)(void);
47 void *(*mmap)(unsigned int size);
48 void (*munmap)(void *ptr, unsigned int size);
49 // only used by some frontends
50 void (*pl_vout_set_raw_vram)(void *vram);
51 void (*pl_set_gpu_caps)(int caps);
52 // some stats, for display by some plugins
53 int flips_per_sec, cpu_usage;
54 float vsps_cur; // currect vsync/s
55 // gpu options
56 int frameskip;
57 int fskip_advice;
58 unsigned int *gpu_frame_count;
59 unsigned int *gpu_hcnt;
60 unsigned int flip_cnt; // increment manually if not using pl_vout_flip
61 unsigned int screen_w, screen_h; // gles plugin wants this
62 unsigned int only_16bpp; // platform is 16bpp-only
63 struct {
64 int allow_interlace; // 0 off, 1 on, 2 guess
65 int enhancement_enable;
66 int enhancement_no_main;
67 } gpu_neon;
68 struct {
69 int iUseDither;
70 int dwActFixes;
71 float fFrameRateHz;
72 int dwFrameRateTicks;
73 } gpu_peops;
74 struct {
75 int abe_hack;
76 int no_light, no_blend;
77 int lineskip;
78 } gpu_unai;
79 struct {
80 int dwActFixes;
81 int bDrawDither, iFilterType, iFrameTexType;
82 int iUseMask, bOpaquePass, bAdvancedBlend, bUseFastMdec;
83 int iVRamSize, iTexGarbageCollection;
84 } gpu_peopsgl;
85 // misc
86 int gpu_caps;
87};
88
89extern struct rearmed_cbs pl_rearmed_cbs;
90
91enum gpu_plugin_caps {
92 GPU_CAP_OWNS_DISPLAY = (1 << 0),
93 GPU_CAP_SUPPORTS_2X = (1 << 1),
94};
95
96#ifndef ARRAY_SIZE
97#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
98#endif