unified menu wip and some reorganization for it
[libpicofe.git] / common / emu.h
1 // (c) Copyright 2006-2007 notaz, All rights reserved.
2 // Free for non-commercial use.
3
4 // For commercial use, separate licencing terms must be obtained.
5
6 #include "port_config.h"
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 #define EOPT_USE_SRAM     (1<<0)
13 #define EOPT_SHOW_FPS     (1<<1)
14 #define EOPT_EN_SOUND     (1<<2)
15 #define EOPT_GZIP_SAVES   (1<<3)
16 #define EOPT_NO_AUTOSVCFG (1<<5)
17
18 typedef struct _currentConfig_t {
19         // char lastRomFile[512];
20         int EmuOpt;             // LSb->MSb: use_sram, show_fps, enable_sound, gzip_saves,
21                                         // squidgehack, no_save_cfg_on_exit, <unused>, 16_bit_mode
22                                         // craigix_ram, confirm_save, show_cd_leds, confirm_load
23                                         // A_SNs_gamma, perfect_vsync, giz_scanlines, giz_dblbuff
24                                         // vsync_mode, show_clock, no_frame_limitter
25         int s_PicoOpt;          // for old cfg files only
26         int s_PsndRate;
27         int s_PicoRegion;
28         int s_PicoAutoRgnOrder;
29         int s_PicoCDBuffers;
30         int Frameskip;
31         int CPUclock;
32         int KeyBinds[PLAT_MAX_KEYS];
33         int volume;
34         int gamma;
35 #if PLAT_HAVE_JOY
36         int JoyBinds[4][32];
37 #endif
38         int scaling;  // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering
39         int rotation; // for UIQ
40         float scale; // psp: screen scale
41         float hscale32, hscale40; // psp: horizontal scale
42         int gamma2;  // psp: black level
43         int turbo_rate;
44 } currentConfig_t;
45
46 extern currentConfig_t currentConfig, defaultConfig;
47 extern char *PicoConfigFile;
48 extern int rom_loaded;
49 extern char noticeMsg[64];
50 extern int state_slot;
51 extern int config_slot, config_slot_current;
52 extern unsigned char *movie_data;
53 extern char loadedRomFName[512];                // last loaded ROM filename
54 extern int kb_combo_keys, kb_combo_acts;        // keys and actions which need button combos
55 extern int pico_inp_mode;
56
57 // engine states
58 enum TPicoGameState {
59         PGS_Paused = 1,
60         PGS_Running,
61         PGS_Quit,
62         PGS_KeyConfig,
63         PGS_ReloadRom,
64         PGS_Menu,
65         PGS_RestartRun,
66         PGS_Suspending,         /* PSP */
67         PGS_SuspendWake,        /* PSP */
68 };
69
70
71 int   emu_ReloadRom(char *rom_fname);
72 int   emu_SaveLoadGame(int load, int sram);
73 int   emu_ReadConfig(int game, int no_defaults);
74 int   emu_WriteConfig(int game);
75 void  emu_writelrom(void);
76 char *emu_GetSaveFName(int load, int is_sram, int slot);
77 int   emu_checkSaveFile(int slot);
78 void  emu_setSaveStateCbs(int gz);
79 void  emu_updateMovie(void);
80 int   emu_cdCheck(int *pregion, char *fname_in);
81 int   emu_findBios(int region, char **bios_file);
82 void  emu_textOut8 (int x, int y, const char *text);
83 void  emu_textOut16(int x, int y, const char *text);
84 char *emu_makeRomId(void);
85 void  emu_getGameName(char *str150);
86 void  emu_findKeyBindCombos(void);
87 void  emu_changeFastForward(int set_on);
88 void  emu_RunEventsPico(unsigned int events);
89 void  emu_DoTurbo(int *pad, int acts);
90 void  emu_packConfig(void);
91 void  emu_unpackConfig(void);
92 void  emu_shutdownMCD(void);
93
94 #ifdef __cplusplus
95 } // extern "C"
96 #endif
97