Fix CD audio not playing on some platforms
[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};
29f3675b 20extern int in_state_gun;
61c4962a 21extern int in_type[8];
29f3675b 22extern int multitap1;
23extern int multitap2;
61c4962a 24extern int in_analog_left[8][2];
25extern int in_analog_right[8][2];
f40e9993 26extern unsigned short in_keystate[8];
61c4962a 27
1b0c5139 28extern int in_adev[2], in_adev_axis[2][2];
2c5d0a55 29extern int in_adev_is_nublike[2];
b944a30e 30extern int in_enable_vibration;
69af03a2 31
76f7048e 32extern void *pl_vout_buf;
69af03a2 33
6469a8c4 34extern int g_layer_x, g_layer_y;
35extern int g_layer_w, g_layer_h;
36
29a8c4f3 37void pl_start_watchdog(void);
38void *pl_prepare_screenshot(int *w, int *h, int *bpp);
4c08b9e7 39void pl_init(void);
fa56d360 40void pl_switch_dispmode(void);
4c08b9e7 41
76f7048e 42void pl_timing_prepare(int is_pal);
43void pl_frame_limit(void);
44
201c21e2 45struct rearmed_cbs {
ffd0d743 46 void (*pl_get_layer_pos)(int *x, int *y, int *w, int *h);
76f7048e 47 int (*pl_vout_open)(void);
e4c83ca6 48 void (*pl_vout_set_mode)(int w, int h, int raw_w, int raw_h, int bpp);
fa56d360 49 void (*pl_vout_flip)(const void *vram, int stride, int bgr24,
50 int w, int h);
76f7048e 51 void (*pl_vout_close)(void);
9ee0fd5b 52 void *(*mmap)(unsigned int size);
53 void (*munmap)(void *ptr, unsigned int size);
fa56d360 54 // only used by some frontends
55b0eeea 55 void (*pl_vout_set_raw_vram)(void *vram);
fa56d360 56 void (*pl_set_gpu_caps)(int caps);
a92f6af1 57 // some stats, for display by some plugins
58 int flips_per_sec, cpu_usage;
59 float vsps_cur; // currect vsync/s
418caf43 60 // these are for gles plugin
61 unsigned int screen_w, screen_h;
62 void *gles_display, *gles_surface;
e64dc4c5 63 // gpu options
64 int frameskip;
65 int fskip_advice;
3ece2f0c 66 unsigned int *gpu_frame_count;
24de2dd4 67 unsigned int *gpu_hcnt;
a92f6af1 68 unsigned int flip_cnt; // increment manually if not using pl_vout_flip
4ea7de6a 69 unsigned int only_16bpp; // platform is 16bpp-only
746fee51 70 struct {
71 int allow_interlace; // 0 off, 1 on, 2 guess
0b02eb77 72 int enhancement_enable;
73 int enhancement_no_main;
5c1cbedc 74 int allow_dithering;
746fee51 75 } gpu_neon;
e64dc4c5 76 struct {
77 int iUseDither;
78 int dwActFixes;
79 float fFrameRateHz;
80 int dwFrameRateTicks;
81 } gpu_peops;
17a54a4a 82 struct {
83 int abe_hack;
84 int no_light, no_blend;
89c0de42 85 int lineskip;
17a54a4a 86 } gpu_unai;
5440b88e 87 struct {
746fee51 88 int dwActFixes;
89 int bDrawDither, iFilterType, iFrameTexType;
90 int iUseMask, bOpaquePass, bAdvancedBlend, bUseFastMdec;
91 int iVRamSize, iTexGarbageCollection;
92 } gpu_peopsgl;
fa56d360 93 // misc
94 int gpu_caps;
201c21e2 95};
96
e64dc4c5 97extern struct rearmed_cbs pl_rearmed_cbs;
4f3639fa 98
fa56d360 99enum gpu_plugin_caps {
100 GPU_CAP_OWNS_DISPLAY = (1 << 0),
101 GPU_CAP_SUPPORTS_2X = (1 << 1),
102};
103
c9099d02 104// platform hooks
105extern void (*pl_plat_clear)(void);
106extern void (*pl_plat_blit)(int doffs, const void *src,
107 int w, int h, int sstride, int bgr24);
108extern void (*pl_plat_hud_print)(int x, int y, const char *str, int bpp);
109
4f3639fa 110#ifndef ARRAY_SIZE
111#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
112#endif