gp2x->common menu migration finished, gp2x now only uses input fwk
[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
12extern void *g_screen_ptr;
13
14#if SCREEN_SIZE_FIXED
15#define g_screen_width SCREEN_WIDTH
16#define g_screen_height SCREEN_HEIGHT
17#else
18extern int g_screen_width;
19extern int g_screen_height;
20#endif
21
22
23#define EOPT_USE_SRAM (1<<0)
24#define EOPT_SHOW_FPS (1<<1)
25#define EOPT_EN_SOUND (1<<2)
26#define EOPT_GZIP_SAVES (1<<3)
27#define EOPT_NO_AUTOSVCFG (1<<5)
28
29typedef struct _currentConfig_t {
30 // char lastRomFile[512];
31 int EmuOpt; // LSb->MSb: use_sram, show_fps, enable_sound, gzip_saves,
32 // squidgehack, no_save_cfg_on_exit, <unused>, 16_bit_mode
33 // craigix_ram, confirm_save, show_cd_leds, confirm_load
34 // A_SNs_gamma, perfect_vsync, giz_scanlines, giz_dblbuff
35 // vsync_mode, show_clock, no_frame_limitter
36 int s_PicoOpt; // for old cfg files only
37 int s_PsndRate;
38 int s_PicoRegion;
39 int s_PicoAutoRgnOrder;
40 int s_PicoCDBuffers;
41 int Frameskip;
42 int CPUclock;
43 int volume;
44 int gamma;
45 int scaling; // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering
46 int rotation; // for UIQ
47 float scale; // psp: screen scale
48 float hscale32, hscale40; // psp: horizontal scale
49 int gamma2; // psp: black level
50 int turbo_rate;
51} currentConfig_t;
52
53extern currentConfig_t currentConfig, defaultConfig;
54extern char *PicoConfigFile;
55extern int rom_loaded;
56extern char noticeMsg[64];
57extern int state_slot;
58extern int config_slot, config_slot_current;
59extern unsigned char *movie_data;
60extern int pico_inp_mode;
61
62extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom
63extern char rom_fname_loaded[512]; // currently loaded ROM filename
64
65// engine states
66extern int engineState;
67enum TPicoGameState {
68 PGS_Paused = 1,
69 PGS_Running,
70 PGS_Quit,
71 PGS_KeyConfig,
72 PGS_ReloadRom,
73 PGS_Menu,
74 PGS_RestartRun,
75 PGS_Suspending, /* PSP */
76 PGS_SuspendWake, /* PSP */
77};
78
79
80int emu_ReloadRom(char *rom_fname);
81int emu_SaveLoadGame(int load, int sram);
82int emu_ReadConfig(int game, int no_defaults);
83int emu_WriteConfig(int game);
84void emu_writelrom(void);
85char *emu_GetSaveFName(int load, int is_sram, int slot);
86int emu_checkSaveFile(int slot);
87void emu_setSaveStateCbs(int gz);
88void emu_updateMovie(void);
89int emu_cdCheck(int *pregion, char *fname_in);
90int emu_findBios(int region, char **bios_file);
91void emu_textOut8 (int x, int y, const char *text);
92void emu_textOut16(int x, int y, const char *text);
93char *emu_makeRomId(void);
94void emu_getGameName(char *str150);
95void emu_changeFastForward(int set_on);
96void emu_RunEventsPico(unsigned int events);
97void emu_DoTurbo(int *pad, int acts);
98void emu_packConfig(void);
99void emu_unpackConfig(void);
100void emu_shutdownMCD(void);
101
102#ifdef __cplusplus
103} // extern "C"
104#endif
105