major menu unification, minor reorganization
[libpicofe.git] / common / emu.h
... / ...
CommitLineData
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
9extern "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
18typedef 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
46extern currentConfig_t currentConfig, defaultConfig;
47extern char *PicoConfigFile;
48extern int rom_loaded;
49extern char noticeMsg[64];
50extern int state_slot;
51extern int config_slot, config_slot_current;
52extern unsigned char *movie_data;
53extern int kb_combo_keys, kb_combo_acts; // keys and actions which need button combos
54extern int pico_inp_mode;
55
56extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom
57extern char rom_fname_loaded[512]; // currently loaded ROM filename
58
59// engine states
60extern int engineState;
61enum TPicoGameState {
62 PGS_Paused = 1,
63 PGS_Running,
64 PGS_Quit,
65 PGS_KeyConfig,
66 PGS_ReloadRom,
67 PGS_Menu,
68 PGS_RestartRun,
69 PGS_Suspending, /* PSP */
70 PGS_SuspendWake, /* PSP */
71};
72
73
74int emu_ReloadRom(char *rom_fname);
75int emu_SaveLoadGame(int load, int sram);
76int emu_ReadConfig(int game, int no_defaults);
77int emu_WriteConfig(int game);
78void emu_writelrom(void);
79char *emu_GetSaveFName(int load, int is_sram, int slot);
80int emu_checkSaveFile(int slot);
81void emu_setSaveStateCbs(int gz);
82void emu_updateMovie(void);
83int emu_cdCheck(int *pregion, char *fname_in);
84int emu_findBios(int region, char **bios_file);
85void emu_textOut8 (int x, int y, const char *text);
86void emu_textOut16(int x, int y, const char *text);
87char *emu_makeRomId(void);
88void emu_getGameName(char *str150);
89void emu_findKeyBindCombos(void);
90void emu_changeFastForward(int set_on);
91void emu_RunEventsPico(unsigned int events);
92void emu_DoTurbo(int *pad, int acts);
93void emu_packConfig(void);
94void emu_unpackConfig(void);
95void emu_shutdownMCD(void);
96
97#ifdef __cplusplus
98} // extern "C"
99#endif
100