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;
20 #define EOPT_EN_SRAM (1<<0)
21 #define EOPT_SHOW_FPS (1<<1)
22 #define EOPT_EN_SOUND (1<<2)
23 #define EOPT_GZIP_SAVES (1<<3)
24 #define EOPT_NO_AUTOSVCFG (1<<5)
25 #define EOPT_16BPP (1<<7) // depreceted for .renderer
26 #define EOPT_EN_CD_LEDS (1<<10)
27 #define EOPT_A_SN_GAMMA (1<<12)
28 #define EOPT_VSYNC (1<<13)
29 #define EOPT_GIZ_SCANLN (1<<14)
30 #define EOPT_GIZ_DBLBUF (1<<15)
31 #define EOPT_VSYNC_MODE (1<<16)
32 #define EOPT_SHOW_RTC (1<<17)
33 #define EOPT_NO_FRMLIMIT (1<<18)
34 #define EOPT_WIZ_TEAR_FIX (1<<19)
35 #define EOPT_EXT_FRMLIMIT (1<<20) // no internal frame limiter (limited by snd, etc)
44 EOPT_CONFIRM_NONE = 0,
45 EOPT_CONFIRM_SAVE = 1,
46 EOPT_CONFIRM_LOAD = 2,
47 EOPT_CONFIRM_BOTH = 3,
50 typedef struct _currentConfig_t {
55 int s_PicoAutoRgnOrder;
64 int scaling; // gp2x: EOPT_SCALE_*; psp: bilinear filtering
66 int rotation; // for UIQ
67 float scale; // psp: screen scale
68 float hscale32, hscale40; // psp: horizontal scale
69 int gamma2; // psp: black level
73 int filter; // pandora
79 extern currentConfig_t currentConfig, defaultConfig;
80 extern const char *PicoConfigFile;
81 extern int state_slot;
82 extern int config_slot, config_slot_current;
83 extern unsigned char *movie_data;
84 extern int reset_timing;
85 extern int flip_after_sync;
87 #define PICO_PEN_ADJUST_X 4
88 #define PICO_PEN_ADJUST_Y 2
89 extern int pico_pen_x, pico_pen_y;
90 extern int pico_inp_mode;
92 extern const char *rom_fname_reload; // ROM to try loading on next PGS_ReloadRom
93 extern char rom_fname_loaded[512]; // currently loaded ROM filename
96 extern int engineState;
106 PGS_Suspending, /* PSP */
107 PGS_SuspendWake, /* PSP */
111 void emu_finish(void);
114 int emu_reload_rom(const char *rom_fname_in);
115 int emu_swap_cd(const char *fname);
116 int emu_save_load_game(int load, int sram);
117 void emu_reset_game(void);
119 void emu_prep_defconfig(void);
120 void emu_set_defconfig(void);
121 int emu_read_config(const char *rom_fname, int no_defaults);
122 int emu_write_config(int game);
124 char *emu_get_save_fname(int load, int is_sram, int slot, int *time);
125 int emu_check_save_file(int slot, int *time);
127 void emu_text_out8 (int x, int y, const char *text);
128 void emu_text_out16(int x, int y, const char *text);
129 void emu_text_out8_rot (int x, int y, const char *text);
130 void emu_text_out16_rot(int x, int y, const char *text);
132 void emu_osd_text16(int x, int y, const char *text);
134 void emu_make_path(char *buff, const char *end, int size);
135 void emu_update_input(void);
136 void emu_get_game_name(char *str150);
137 void emu_set_fastforward(int set_on);
138 void emu_status_msg(const char *format, ...);
140 /* default sound code */
141 void emu_sound_start(void);
142 void emu_sound_stop(void);
143 void emu_sound_wait(void);
145 /* used by some (but not all) platforms */
146 void emu_cmn_forced_frame(int no_scale, int do_emu);
148 /* stuff to be implemented by platform code */
149 extern const char *renderer_names[];
150 extern const char *renderer_names32x[];
152 void pemu_prep_defconfig(void);
153 void pemu_validate_config(void);
154 void pemu_loop_prep(void);
155 void pemu_loop_end(void);
156 void pemu_forced_frame(int no_scale, int do_emu); // ..to g_menubg_src_ptr
157 void pemu_finalize_frame(const char *fps, const char *notice_msg);
159 void pemu_sound_start(void);
161 void plat_early_init(void);
162 void plat_init(void);
163 void plat_finish(void);
165 /* used before things blocking for a while (these funcs redraw on return) */
166 void plat_status_msg_busy_first(const char *msg);
167 void plat_status_msg_busy_next(const char *msg);
168 void plat_status_msg_clear(void);
170 void plat_video_toggle_renderer(int change, int menu_call);
171 void plat_video_loop_prepare(void);
173 void plat_update_volume(int has_changed, int is_up);