psxcounters: refresh internal state after savestate load
[pcsx_rearmed.git] / frontend / plugin_lib.h
CommitLineData
b60f2812 1
69af03a2 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};
4c08b9e7 20extern int in_type1, in_type2;
21extern int in_keystate, in_state_gun, in_a1[2], in_a2[2];
1b0c5139 22extern int in_adev[2], in_adev_axis[2][2];
2c5d0a55 23extern int in_adev_is_nublike[2];
b944a30e 24extern int in_enable_vibration;
69af03a2 25
76f7048e 26extern void *pl_vout_buf;
69af03a2 27
6469a8c4 28extern int g_layer_x, g_layer_y;
29extern int g_layer_w, g_layer_h;
30
29a8c4f3 31void pl_text_out16(int x, int y, const char *texto, ...);
32void pl_start_watchdog(void);
33void *pl_prepare_screenshot(int *w, int *h, int *bpp);
4c08b9e7 34void pl_init(void);
fa56d360 35void pl_print_hud(int width, int height, int xborder);
36void pl_switch_dispmode(void);
4c08b9e7 37
76f7048e 38void pl_timing_prepare(int is_pal);
39void pl_frame_limit(void);
40
4c08b9e7 41void pl_update_gun(int *xn, int *xres, int *y, int *in);
201c21e2 42
43struct rearmed_cbs {
ffd0d743 44 void (*pl_get_layer_pos)(int *x, int *y, int *w, int *h);
76f7048e 45 int (*pl_vout_open)(void);
fa56d360 46 void (*pl_vout_set_mode)(int w, int h, int bpp);
47 void (*pl_vout_flip)(const void *vram, int stride, int bgr24,
48 int w, int h);
76f7048e 49 void (*pl_vout_close)(void);
9ee0fd5b 50 void *(*mmap)(unsigned int size);
51 void (*munmap)(void *ptr, unsigned int size);
fa56d360 52 // only used by some frontends
55b0eeea 53 void (*pl_vout_set_raw_vram)(void *vram);
fa56d360 54 void (*pl_set_gpu_caps)(int caps);
a92f6af1 55 // some stats, for display by some plugins
56 int flips_per_sec, cpu_usage;
57 float vsps_cur; // currect vsync/s
e64dc4c5 58 // gpu options
59 int frameskip;
60 int fskip_advice;
3ece2f0c 61 unsigned int *gpu_frame_count;
24de2dd4 62 unsigned int *gpu_hcnt;
a92f6af1 63 unsigned int flip_cnt; // increment manually if not using pl_vout_flip
bb88ec28 64 unsigned int screen_w, screen_h; // gles plugin wants this
4ea7de6a 65 unsigned int only_16bpp; // platform is 16bpp-only
746fee51 66 struct {
67 int allow_interlace; // 0 off, 1 on, 2 guess
0b02eb77 68 int enhancement_enable;
69 int enhancement_no_main;
746fee51 70 } gpu_neon;
e64dc4c5 71 struct {
72 int iUseDither;
73 int dwActFixes;
74 float fFrameRateHz;
75 int dwFrameRateTicks;
76 } gpu_peops;
17a54a4a 77 struct {
78 int abe_hack;
79 int no_light, no_blend;
89c0de42 80 int lineskip;
17a54a4a 81 } gpu_unai;
5440b88e 82 struct {
746fee51 83 int dwActFixes;
84 int bDrawDither, iFilterType, iFrameTexType;
85 int iUseMask, bOpaquePass, bAdvancedBlend, bUseFastMdec;
86 int iVRamSize, iTexGarbageCollection;
87 } gpu_peopsgl;
fa56d360 88 // misc
89 int gpu_caps;
201c21e2 90};
91
e64dc4c5 92extern struct rearmed_cbs pl_rearmed_cbs;
4f3639fa 93
fa56d360 94enum gpu_plugin_caps {
95 GPU_CAP_OWNS_DISPLAY = (1 << 0),
96 GPU_CAP_SUPPORTS_2X = (1 << 1),
97};
98
4f3639fa 99#ifndef ARRAY_SIZE
100#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
101#endif