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 |
9 | extern "C" { |
10 | #endif |
11 | |
e31266dd |
12 | extern 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 |
18 | extern int g_screen_width; |
19 | extern 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) |
388947f3 |
29 | #define EOPT_16BPP (1<<7) |
fa5e045b |
30 | #define EOPT_RAM_TIMINGS (1<<8) |
388947f3 |
31 | #define EOPT_CONFIRM_SAVE (1<<9) |
32 | #define EOPT_EN_CD_LEDS (1<<10) |
33 | #define EOPT_CONFIRM_LOAD (1<<11) |
fa8d1331 |
34 | #define EOPT_A_SN_GAMMA (1<<12) |
fa5e045b |
35 | #define EOPT_PSYNC (1<<13) |
36f6fd5a |
36 | |
fa8d1331 |
37 | enum { |
38 | EOPT_SCALE_NONE = 0, |
39 | EOPT_SCALE_SW_H, |
40 | EOPT_SCALE_HW_H, |
41 | EOPT_SCALE_HW_HV, |
42 | }; |
43 | |
36f6fd5a |
44 | typedef struct _currentConfig_t { |
367b6f1f |
45 | // char lastRomFile[512]; |
f013066e |
46 | int EmuOpt; // LSb->MSb: use_sram, show_fps, enable_sound, gzip_saves, |
fa5e045b |
47 | // mmuhack, no_save_cfg_on_exit, <unused>, 16_bit_mode |
f013066e |
48 | // craigix_ram, confirm_save, show_cd_leds, confirm_load |
f3dc5a3a |
49 | // A_SNs_gamma, perfect_vsync, giz_scanlines, giz_dblbuff |
c6334564 |
50 | // vsync_mode, show_clock, no_frame_limitter |
0ae25549 |
51 | int s_PicoOpt; // for old cfg files only |
52 | int s_PsndRate; |
53 | int s_PicoRegion; |
36f6fd5a |
54 | int s_PicoAutoRgnOrder; |
55 | int s_PicoCDBuffers; |
f013066e |
56 | int Frameskip; |
57 | int CPUclock; |
f013066e |
58 | int volume; |
59 | int gamma; |
36f6fd5a |
60 | int scaling; // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering |
61 | int rotation; // for UIQ |
6f748c47 |
62 | float scale; // psp: screen scale |
63 | float hscale32, hscale40; // psp: horizontal scale |
960a8e27 |
64 | int gamma2; // psp: black level |
6589c840 |
65 | int turbo_rate; |
f013066e |
66 | } currentConfig_t; |
67 | |
0ae25549 |
68 | extern currentConfig_t currentConfig, defaultConfig; |
f013066e |
69 | extern char *PicoConfigFile; |
144a28a0 |
70 | extern int rom_loaded; |
f013066e |
71 | extern int state_slot; |
72 | extern int config_slot, config_slot_current; |
73 | extern unsigned char *movie_data; |
8a091e48 |
74 | extern int pico_inp_mode; |
f013066e |
75 | |
049a6b3e |
76 | extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom |
77 | extern char rom_fname_loaded[512]; // currently loaded ROM filename |
78 | |
24b24674 |
79 | // engine states |
049a6b3e |
80 | extern int engineState; |
24b24674 |
81 | enum 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 | |
f013066e |
93 | |
36f6fd5a |
94 | int emu_ReloadRom(char *rom_fname); |
f013066e |
95 | int emu_SaveLoadGame(int load, int sram); |
388947f3 |
96 | |
f013066e |
97 | int emu_ReadConfig(int game, int no_defaults); |
98 | int emu_WriteConfig(int game); |
388947f3 |
99 | void emu_packConfig(void); |
100 | void emu_unpackConfig(void); |
7f3b59cf |
101 | void emu_writelrom(void); |
388947f3 |
102 | |
f013066e |
103 | char *emu_GetSaveFName(int load, int is_sram, int slot); |
104 | int emu_checkSaveFile(int slot); |
105 | void emu_setSaveStateCbs(int gz); |
388947f3 |
106 | |
107 | void emu_update_input(void); |
f013066e |
108 | int emu_findBios(int region, char **bios_file); |
109 | void emu_textOut8 (int x, int y, const char *text); |
110 | void emu_textOut16(int x, int y, const char *text); |
0ae25549 |
111 | char *emu_makeRomId(void); |
36f6fd5a |
112 | void emu_getGameName(char *str150); |
8a091e48 |
113 | void emu_changeFastForward(int set_on); |
114 | void emu_RunEventsPico(unsigned int events); |
36f6fd5a |
115 | void emu_shutdownMCD(void); |
388947f3 |
116 | int emu_cdCheck(int *pregion, char *fname_in); |
f013066e |
117 | |
36f6fd5a |
118 | #ifdef __cplusplus |
119 | } // extern "C" |
120 | #endif |
121 | |