+extern int reset_timing;
+
+#define PICO_PEN_ADJUST_X 4
+#define PICO_PEN_ADJUST_Y 2
+extern int pico_pen_x, pico_pen_y;
+extern int pico_inp_mode;
+
+extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom
+extern char rom_fname_loaded[512]; // currently loaded ROM filename
+
+// engine states
+extern int engineState;
+enum TPicoGameState {
+ PGS_Paused = 1,
+ PGS_Running,
+ PGS_Quit,
+ PGS_KeyConfig,
+ PGS_ReloadRom,
+ PGS_Menu,
+ PGS_TrayMenu,
+ PGS_RestartRun,
+ PGS_Suspending, /* PSP */
+ PGS_SuspendWake, /* PSP */
+};
+
+// media types
+enum {
+ PM_BAD = 0,
+ PM_MD_CART, /* also 32x */
+ PM_MARK3,
+ PM_CD,
+};
+
+void emu_init(void);
+void emu_finish(void);
+void emu_loop(void);
+
+int emu_reload_rom(char *rom_fname);
+int emu_swap_cd(const char *fname);
+int emu_save_load_game(int load, int sram);
+void emu_reset_game(void);
+
+void emu_set_defconfig(void);
+int emu_read_config(int game, int no_defaults);
+int emu_write_config(int game);
+
+char *emu_get_save_fname(int load, int is_sram, int slot);
+int emu_check_save_file(int slot);
+
+void emu_text_out8 (int x, int y, const char *text);
+void emu_text_out16(int x, int y, const char *text);
+void emu_text_out8_rot (int x, int y, const char *text);
+void emu_text_out16_rot(int x, int y, const char *text);