key combos for new input code
[picodrive.git] / platform / common / emu.h
CommitLineData
ea8c405f 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
ca482e5d 6#include "port_config.h"
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
e2de9939 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
ca482e5d 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)
d7dd4d66 27#define EOPT_NO_AUTOSVCFG (1<<5)
ca482e5d 28
29typedef struct _currentConfig_t {
1ca2ea4f 30 // char lastRomFile[512];
ea8c405f 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
c77ca79e 34 // A_SNs_gamma, perfect_vsync, giz_scanlines, giz_dblbuff
c6196c0f 35 // vsync_mode, show_clock, no_frame_limitter
58c86d00 36 int s_PicoOpt; // for old cfg files only
37 int s_PsndRate;
38 int s_PicoRegion;
ca482e5d 39 int s_PicoAutoRgnOrder;
40 int s_PicoCDBuffers;
ea8c405f 41 int Frameskip;
42 int CPUclock;
ca482e5d 43 int KeyBinds[PLAT_MAX_KEYS];
ea8c405f 44 int volume;
45 int gamma;
ca482e5d 46#if PLAT_HAVE_JOY
ea8c405f 47 int JoyBinds[4][32];
ca482e5d 48#endif
49 int scaling; // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering
50 int rotation; // for UIQ
8ab3e3c1 51 float scale; // psp: screen scale
52 float hscale32, hscale40; // psp: horizontal scale
6fc57144 53 int gamma2; // psp: black level
f0f0d2df 54 int turbo_rate;
ea8c405f 55} currentConfig_t;
56
58c86d00 57extern currentConfig_t currentConfig, defaultConfig;
ea8c405f 58extern char *PicoConfigFile;
eacee137 59extern int rom_loaded;
ea8c405f 60extern char noticeMsg[64];
61extern int state_slot;
62extern int config_slot, config_slot_current;
63extern unsigned char *movie_data;
c060a9ab 64extern int pico_inp_mode;
ea8c405f 65
713c9224 66extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom
67extern char rom_fname_loaded[512]; // currently loaded ROM filename
68
1fb0dd88 69// engine states
713c9224 70extern int engineState;
1fb0dd88 71enum TPicoGameState {
72 PGS_Paused = 1,
73 PGS_Running,
74 PGS_Quit,
75 PGS_KeyConfig,
76 PGS_ReloadRom,
77 PGS_Menu,
78 PGS_RestartRun,
79 PGS_Suspending, /* PSP */
80 PGS_SuspendWake, /* PSP */
81};
82
ea8c405f 83
ca482e5d 84int emu_ReloadRom(char *rom_fname);
ea8c405f 85int emu_SaveLoadGame(int load, int sram);
86int emu_ReadConfig(int game, int no_defaults);
87int emu_WriteConfig(int game);
d7dd4d66 88void emu_writelrom(void);
ea8c405f 89char *emu_GetSaveFName(int load, int is_sram, int slot);
90int emu_checkSaveFile(int slot);
91void emu_setSaveStateCbs(int gz);
92void emu_updateMovie(void);
ca482e5d 93int emu_cdCheck(int *pregion, char *fname_in);
ea8c405f 94int emu_findBios(int region, char **bios_file);
95void emu_textOut8 (int x, int y, const char *text);
96void emu_textOut16(int x, int y, const char *text);
58c86d00 97char *emu_makeRomId(void);
ca482e5d 98void emu_getGameName(char *str150);
c060a9ab 99void emu_changeFastForward(int set_on);
100void emu_RunEventsPico(unsigned int events);
f0f0d2df 101void emu_DoTurbo(int *pad, int acts);
ca482e5d 102void emu_packConfig(void);
103void emu_unpackConfig(void);
104void emu_shutdownMCD(void);
ea8c405f 105
ca482e5d 106#ifdef __cplusplus
107} // extern "C"
108#endif
109