5 * This work is licensed under the terms of MAME license.
6 * See COPYING file in the top-level directory.
13 #define array_size(x) (sizeof(x) / sizeof(x[0]))
15 extern void *g_screen_ptr;
17 extern int g_screen_width;
18 extern int g_screen_height;
19 extern int g_screen_ppitch; // pitch in pixels
21 #define EOPT_EN_SRAM (1<<0)
22 #define EOPT_SHOW_FPS (1<<1)
23 #define EOPT_EN_SOUND (1<<2)
24 #define EOPT_GZIP_SAVES (1<<3)
25 #define EOPT_NO_AUTOSVCFG (1<<5)
26 #define EOPT_16BPP (1<<7) // depreceted for .renderer
27 #define EOPT_EN_CD_LEDS (1<<10)
28 #define EOPT_A_SN_GAMMA (1<<12)
29 #define EOPT_VSYNC (1<<13)
30 #define EOPT_GIZ_SCANLN (1<<14)
31 #define EOPT_GIZ_DBLBUF (1<<15)
32 #define EOPT_VSYNC_MODE (1<<16)
33 #define EOPT_SHOW_RTC (1<<17)
34 #define EOPT_NO_FRMLIMIT (1<<18)
35 #define EOPT_WIZ_TEAR_FIX (1<<19)
36 #define EOPT_EXT_FRMLIMIT (1<<20) // no internal frame limiter (limited by snd, etc)
37 #define EOPT_PICO_PEN (1<<21)
45 EOPT_SCALE_43 = 1, // 4:3 screen
46 EOPT_SCALE_STRETCH, // stretched to between _43 and _WIDE
47 EOPT_SCALE_WIDE, // stretched to match display width
49 EOPT_VSCALE_FULL = 1, // TV height scaled to screen height
50 EOPT_VSCALE_NOBORDER, // VDP area scaled to screen height
55 // PSP texture filtering
56 EOPT_FILTER_BILINEAR = 1,
58 EOPT_FILTER_SMOOTHER = 1,
59 EOPT_FILTER_BILINEAR1,
60 EOPT_FILTER_BILINEAR2,
64 EOPT_CONFIRM_NONE = 0,
65 EOPT_CONFIRM_SAVE = 1,
66 EOPT_CONFIRM_LOAD = 2,
67 EOPT_CONFIRM_BOTH = 3,
70 typedef struct _currentConfig_t {
75 int s_PicoAutoRgnOrder;
78 int s_PicoSndFilterAlpha;
86 int scaling; // EOPT_SCALE_*
88 int rotation; // for UIQ
89 int gamma2; // psp: black level
93 int filter; // EOPT_FILTER_* video filter
103 extern currentConfig_t currentConfig, defaultConfig;
104 extern const char *PicoConfigFile;
105 extern int state_slot;
106 extern int config_slot, config_slot_current;
107 extern unsigned char *movie_data;
108 extern int reset_timing;
109 extern int flip_after_sync;
111 extern struct vkbd *vkbd;
113 #define PICO_PEN_ADJUST_X 1
114 #define PICO_PEN_ADJUST_Y 1
115 extern int pico_pen_x, pico_pen_y;
116 extern int pico_inp_mode;
118 extern const char *rom_fname_reload; // ROM to try loading on next PGS_ReloadRom
119 extern char rom_fname_loaded[512]; // currently loaded ROM filename
122 extern int engineState;
123 enum TPicoGameState {
132 PGS_Suspending, /* PSP */
133 PGS_SuspendWake, /* PSP */
137 void emu_finish(void);
140 int emu_reload_rom(const char *rom_fname_in);
141 int emu_swap_cd(const char *fname);
142 int emu_play_tape(const char *fname);
143 int emu_record_tape(const char *ext);
144 int emu_save_load_game(int load, int sram);
145 void emu_reset_game(void);
147 void emu_prep_defconfig(void);
148 void emu_set_defconfig(void);
149 int emu_read_config(const char *rom_fname, int no_defaults);
150 int emu_write_config(int game);
152 char *emu_get_save_fname(int load, int is_sram, int slot, int *time);
153 int emu_check_save_file(int slot, int *time);
155 void emu_text_out8 (int x, int y, const char *text);
156 void emu_text_out16(int x, int y, const char *text);
157 void emu_text_out8_rot (int x, int y, const char *text);
158 void emu_text_out16_rot(int x, int y, const char *text);
160 void emu_osd_text16(int x, int y, const char *text);
162 void emu_make_path(char *buff, const char *end, int size);
163 void emu_update_input(void);
164 void emu_get_game_name(char *str150);
165 void emu_set_fastforward(int set_on);
166 void emu_status_msg(const char *format, ...);
168 void emu_pico_overlay(unsigned short *pd, int w, int h, int pitch);
170 /* default sound code */
171 void emu_sound_start(void);
172 void emu_sound_stop(void);
173 void emu_sound_wait(void);
175 /* used by some (but not all) platforms */
176 void emu_cmn_forced_frame(int no_scale, int do_emu, void *buf);
178 /* stuff to be implemented by platform code */
179 extern const char *renderer_names[];
180 extern const char *renderer_names32x[];
182 void pemu_prep_defconfig(void);
183 void pemu_validate_config(void);
184 void pemu_loop_prep(void);
185 void pemu_loop_end(void);
186 void pemu_forced_frame(int no_scale, int do_emu); // ..to g_menubg_src_ptr
187 void pemu_finalize_frame(const char *fps, const char *notice_msg);
189 void pemu_sound_start(void);
191 int plat_parse_arg(int argc, char *argv[], int *x);
192 void plat_early_init(void);
193 void plat_init(void);
194 void plat_finish(void);
196 void plat_show_cursor(int on);
197 int plat_grab_cursor(int on);
198 int plat_has_wm(void);
200 /* used before things blocking for a while (these funcs redraw on return) */
201 void plat_status_msg_busy_first(const char *msg);
202 void plat_status_msg_busy_next(const char *msg);
203 void plat_status_msg_busy_done(void);
204 void plat_status_msg_clear(void);
206 void plat_video_toggle_renderer(int change, int menu_call);
207 void plat_video_loop_prepare(void);
208 void plat_video_set_buffer(void *);
210 void plat_update_volume(int has_changed, int is_up);
212 /* should be in libpicofe/plat.h */
213 void plat_video_clear_status(void);
214 void plat_video_clear_buffers(void);
215 void plat_video_set_size(int w, int h);
216 void plat_video_set_shadow(int w, int h);