more unification; replace some magic bits to defines
[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)
0d9bf4fc 27#define EOPT_MMUHACK (1<<4)
d7dd4d66 28#define EOPT_NO_AUTOSVCFG (1<<5)
d34a42f9 29#define EOPT_16BPP (1<<7)
0d9bf4fc 30#define EOPT_RAM_TIMINGS (1<<8)
d34a42f9 31#define EOPT_CONFIRM_SAVE (1<<9)
32#define EOPT_EN_CD_LEDS (1<<10)
33#define EOPT_CONFIRM_LOAD (1<<11)
ee2a3bdf 34#define EOPT_A_SN_GAMMA (1<<12)
0d9bf4fc 35#define EOPT_PSYNC (1<<13)
ca482e5d 36
ee2a3bdf 37enum {
38 EOPT_SCALE_NONE = 0,
39 EOPT_SCALE_SW_H,
40 EOPT_SCALE_HW_H,
41 EOPT_SCALE_HW_HV,
42};
43
ca482e5d 44typedef struct _currentConfig_t {
1ca2ea4f 45 // char lastRomFile[512];
ea8c405f 46 int EmuOpt; // LSb->MSb: use_sram, show_fps, enable_sound, gzip_saves,
0d9bf4fc 47 // mmuhack, no_save_cfg_on_exit, <unused>, 16_bit_mode
ea8c405f 48 // craigix_ram, confirm_save, show_cd_leds, confirm_load
c77ca79e 49 // A_SNs_gamma, perfect_vsync, giz_scanlines, giz_dblbuff
c6196c0f 50 // vsync_mode, show_clock, no_frame_limitter
58c86d00 51 int s_PicoOpt; // for old cfg files only
52 int s_PsndRate;
53 int s_PicoRegion;
ca482e5d 54 int s_PicoAutoRgnOrder;
55 int s_PicoCDBuffers;
ea8c405f 56 int Frameskip;
57 int CPUclock;
ea8c405f 58 int volume;
59 int gamma;
ca482e5d 60 int scaling; // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering
61 int rotation; // for UIQ
8ab3e3c1 62 float scale; // psp: screen scale
63 float hscale32, hscale40; // psp: horizontal scale
6fc57144 64 int gamma2; // psp: black level
f0f0d2df 65 int turbo_rate;
ea8c405f 66} currentConfig_t;
67
58c86d00 68extern currentConfig_t currentConfig, defaultConfig;
ea8c405f 69extern char *PicoConfigFile;
eacee137 70extern int rom_loaded;
ea8c405f 71extern int state_slot;
72extern int config_slot, config_slot_current;
73extern unsigned char *movie_data;
c060a9ab 74extern int pico_inp_mode;
ea8c405f 75
713c9224 76extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom
77extern char rom_fname_loaded[512]; // currently loaded ROM filename
78
1fb0dd88 79// engine states
713c9224 80extern int engineState;
1fb0dd88 81enum TPicoGameState {
82 PGS_Paused = 1,
83 PGS_Running,
84 PGS_Quit,
85 PGS_KeyConfig,
86 PGS_ReloadRom,
87 PGS_Menu,
88 PGS_RestartRun,
89 PGS_Suspending, /* PSP */
90 PGS_SuspendWake, /* PSP */
91};
92
ea8c405f 93
ca482e5d 94int emu_ReloadRom(char *rom_fname);
ea8c405f 95int emu_SaveLoadGame(int load, int sram);
d34a42f9 96
ea8c405f 97int emu_ReadConfig(int game, int no_defaults);
98int emu_WriteConfig(int game);
d34a42f9 99void emu_packConfig(void);
100void emu_unpackConfig(void);
d7dd4d66 101void emu_writelrom(void);
d34a42f9 102
ea8c405f 103char *emu_GetSaveFName(int load, int is_sram, int slot);
104int emu_checkSaveFile(int slot);
105void emu_setSaveStateCbs(int gz);
d34a42f9 106
107void emu_update_input(void);
ea8c405f 108int emu_findBios(int region, char **bios_file);
109void emu_textOut8 (int x, int y, const char *text);
110void emu_textOut16(int x, int y, const char *text);
58c86d00 111char *emu_makeRomId(void);
ca482e5d 112void emu_getGameName(char *str150);
c060a9ab 113void emu_changeFastForward(int set_on);
114void emu_RunEventsPico(unsigned int events);
ca482e5d 115void emu_shutdownMCD(void);
d34a42f9 116int emu_cdCheck(int *pregion, char *fname_in);
ea8c405f 117
ca482e5d 118#ifdef __cplusplus
119} // extern "C"
120#endif
121