drc: rework jump_out lists
[pcsx_rearmed.git] / frontend / plugin_lib.h
CommitLineData
908e426c 1#ifndef __PLUGIN_LIB_H__
2#define __PLUGIN_LIB_H__
b60f2812 3
c765eb86
JW
4#define THREAD_RENDERING_OFF 0
5#define THREAD_RENDERING_SYNC 1
6#define THREAD_RENDERING_ASYNC 2
7
69af03a2 8enum {
9 DKEY_SELECT = 0,
10 DKEY_L3,
11 DKEY_R3,
12 DKEY_START,
13 DKEY_UP,
14 DKEY_RIGHT,
15 DKEY_DOWN,
16 DKEY_LEFT,
17 DKEY_L2,
18 DKEY_R2,
19 DKEY_L1,
20 DKEY_R1,
21 DKEY_TRIANGLE,
22 DKEY_CIRCLE,
23 DKEY_CROSS,
24 DKEY_SQUARE,
25};
29f3675b 26extern int in_state_gun;
61c4962a 27extern int in_type[8];
29f3675b 28extern int multitap1;
29extern int multitap2;
61c4962a 30extern int in_analog_left[8][2];
31extern int in_analog_right[8][2];
f40e9993 32extern unsigned short in_keystate[8];
7dea987c 33extern int in_mouse[8][2];
61c4962a 34
1b0c5139 35extern int in_adev[2], in_adev_axis[2][2];
2c5d0a55 36extern int in_adev_is_nublike[2];
b944a30e 37extern int in_enable_vibration;
69af03a2 38
76f7048e 39extern void *pl_vout_buf;
69af03a2 40
6469a8c4 41extern int g_layer_x, g_layer_y;
42extern int g_layer_w, g_layer_h;
43
29a8c4f3 44void pl_start_watchdog(void);
45void *pl_prepare_screenshot(int *w, int *h, int *bpp);
4c08b9e7 46void pl_init(void);
fa56d360 47void pl_switch_dispmode(void);
4c08b9e7 48
76f7048e 49void pl_timing_prepare(int is_pal);
50void pl_frame_limit(void);
51
201c21e2 52struct rearmed_cbs {
ffd0d743 53 void (*pl_get_layer_pos)(int *x, int *y, int *w, int *h);
76f7048e 54 int (*pl_vout_open)(void);
e4c83ca6 55 void (*pl_vout_set_mode)(int w, int h, int raw_w, int raw_h, int bpp);
fa56d360 56 void (*pl_vout_flip)(const void *vram, int stride, int bgr24,
57 int w, int h);
76f7048e 58 void (*pl_vout_close)(void);
9ee0fd5b 59 void *(*mmap)(unsigned int size);
60 void (*munmap)(void *ptr, unsigned int size);
fa56d360 61 // only used by some frontends
55b0eeea 62 void (*pl_vout_set_raw_vram)(void *vram);
fa56d360 63 void (*pl_set_gpu_caps)(int caps);
a92f6af1 64 // some stats, for display by some plugins
65 int flips_per_sec, cpu_usage;
66 float vsps_cur; // currect vsync/s
418caf43 67 // these are for gles plugin
68 unsigned int screen_w, screen_h;
69 void *gles_display, *gles_surface;
e64dc4c5 70 // gpu options
71 int frameskip;
72 int fskip_advice;
3ece2f0c 73 unsigned int *gpu_frame_count;
24de2dd4 74 unsigned int *gpu_hcnt;
a92f6af1 75 unsigned int flip_cnt; // increment manually if not using pl_vout_flip
4ea7de6a 76 unsigned int only_16bpp; // platform is 16bpp-only
c765eb86 77 unsigned int thread_rendering;
746fee51 78 struct {
79 int allow_interlace; // 0 off, 1 on, 2 guess
0b02eb77 80 int enhancement_enable;
81 int enhancement_no_main;
5c1cbedc 82 int allow_dithering;
746fee51 83 } gpu_neon;
e64dc4c5 84 struct {
85 int iUseDither;
86 int dwActFixes;
87 float fFrameRateHz;
88 int dwFrameRateTicks;
89 } gpu_peops;
17a54a4a 90 struct {
030d1121 91 int ilace_force;
92 int pixel_skip;
93 int lighting;
94 int fast_lighting;
95 int blending;
96 int dithering;
97 // old gpu_unai config for compatibility
17a54a4a 98 int abe_hack;
99 int no_light, no_blend;
89c0de42 100 int lineskip;
43047988 101 int scale_hires;
17a54a4a 102 } gpu_unai;
5440b88e 103 struct {
746fee51 104 int dwActFixes;
105 int bDrawDither, iFilterType, iFrameTexType;
106 int iUseMask, bOpaquePass, bAdvancedBlend, bUseFastMdec;
107 int iVRamSize, iTexGarbageCollection;
108 } gpu_peopsgl;
fa56d360 109 // misc
110 int gpu_caps;
201c21e2 111};
112
e64dc4c5 113extern struct rearmed_cbs pl_rearmed_cbs;
4f3639fa 114
fa56d360 115enum gpu_plugin_caps {
116 GPU_CAP_OWNS_DISPLAY = (1 << 0),
117 GPU_CAP_SUPPORTS_2X = (1 << 1),
118};
119
c9099d02 120// platform hooks
121extern void (*pl_plat_clear)(void);
122extern void (*pl_plat_blit)(int doffs, const void *src,
123 int w, int h, int sstride, int bgr24);
124extern void (*pl_plat_hud_print)(int x, int y, const char *str, int bpp);
125
4f3639fa 126#ifndef ARRAY_SIZE
127#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
128#endif
908e426c 129
130#endif /* __PLUGIN_LIB_H__ */