further prep for Wiz port. Cleanups, rm cpuctrl mmuhack; add warm
[libpicofe.git] / common / emu.h
CommitLineData
f013066e 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
36f6fd5a 6#include "port_config.h"
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
e31266dd 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
36f6fd5a 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)
fa5e045b 27#define EOPT_MMUHACK (1<<4)
7f3b59cf 28#define EOPT_NO_AUTOSVCFG (1<<5)
fa5e045b 29#define EOPT_RAM_TIMINGS (1<<8)
30#define EOPT_PSYNC (1<<13)
36f6fd5a 31
32typedef struct _currentConfig_t {
367b6f1f 33 // char lastRomFile[512];
f013066e 34 int EmuOpt; // LSb->MSb: use_sram, show_fps, enable_sound, gzip_saves,
fa5e045b 35 // mmuhack, no_save_cfg_on_exit, <unused>, 16_bit_mode
f013066e 36 // craigix_ram, confirm_save, show_cd_leds, confirm_load
f3dc5a3a 37 // A_SNs_gamma, perfect_vsync, giz_scanlines, giz_dblbuff
c6334564 38 // vsync_mode, show_clock, no_frame_limitter
0ae25549 39 int s_PicoOpt; // for old cfg files only
40 int s_PsndRate;
41 int s_PicoRegion;
36f6fd5a 42 int s_PicoAutoRgnOrder;
43 int s_PicoCDBuffers;
f013066e 44 int Frameskip;
45 int CPUclock;
f013066e 46 int volume;
47 int gamma;
36f6fd5a 48 int scaling; // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering
49 int rotation; // for UIQ
6f748c47 50 float scale; // psp: screen scale
51 float hscale32, hscale40; // psp: horizontal scale
960a8e27 52 int gamma2; // psp: black level
6589c840 53 int turbo_rate;
f013066e 54} currentConfig_t;
55
0ae25549 56extern currentConfig_t currentConfig, defaultConfig;
f013066e 57extern char *PicoConfigFile;
144a28a0 58extern int rom_loaded;
f013066e 59extern char noticeMsg[64];
60extern int state_slot;
61extern int config_slot, config_slot_current;
62extern unsigned char *movie_data;
8a091e48 63extern int pico_inp_mode;
f013066e 64
049a6b3e 65extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom
66extern char rom_fname_loaded[512]; // currently loaded ROM filename
67
24b24674 68// engine states
049a6b3e 69extern int engineState;
24b24674 70enum TPicoGameState {
71 PGS_Paused = 1,
72 PGS_Running,
73 PGS_Quit,
74 PGS_KeyConfig,
75 PGS_ReloadRom,
76 PGS_Menu,
77 PGS_RestartRun,
78 PGS_Suspending, /* PSP */
79 PGS_SuspendWake, /* PSP */
80};
81
f013066e 82
36f6fd5a 83int emu_ReloadRom(char *rom_fname);
f013066e 84int emu_SaveLoadGame(int load, int sram);
85int emu_ReadConfig(int game, int no_defaults);
86int emu_WriteConfig(int game);
7f3b59cf 87void emu_writelrom(void);
f013066e 88char *emu_GetSaveFName(int load, int is_sram, int slot);
89int emu_checkSaveFile(int slot);
90void emu_setSaveStateCbs(int gz);
91void emu_updateMovie(void);
36f6fd5a 92int emu_cdCheck(int *pregion, char *fname_in);
f013066e 93int emu_findBios(int region, char **bios_file);
94void emu_textOut8 (int x, int y, const char *text);
95void emu_textOut16(int x, int y, const char *text);
0ae25549 96char *emu_makeRomId(void);
36f6fd5a 97void emu_getGameName(char *str150);
8a091e48 98void emu_changeFastForward(int set_on);
99void emu_RunEventsPico(unsigned int events);
6589c840 100void emu_DoTurbo(int *pad, int acts);
36f6fd5a 101void emu_packConfig(void);
102void emu_unpackConfig(void);
103void emu_shutdownMCD(void);
f013066e 104
36f6fd5a 105#ifdef __cplusplus
106} // extern "C"
107#endif
108