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 | |
2f3ca016 |
12 | #define array_size(x) (sizeof(x) / sizeof(x[0])) |
13 | |
e31266dd |
14 | extern void *g_screen_ptr; |
15 | |
16 | #if SCREEN_SIZE_FIXED |
17 | #define g_screen_width SCREEN_WIDTH |
18 | #define g_screen_height SCREEN_HEIGHT |
19 | #else |
20 | extern int g_screen_width; |
21 | extern int g_screen_height; |
22 | #endif |
23 | |
24 | |
ee0f881e |
25 | #define EOPT_EN_SRAM (1<<0) |
36f6fd5a |
26 | #define EOPT_SHOW_FPS (1<<1) |
27 | #define EOPT_EN_SOUND (1<<2) |
28 | #define EOPT_GZIP_SAVES (1<<3) |
fa5e045b |
29 | #define EOPT_MMUHACK (1<<4) |
7f3b59cf |
30 | #define EOPT_NO_AUTOSVCFG (1<<5) |
388947f3 |
31 | #define EOPT_16BPP (1<<7) |
fa5e045b |
32 | #define EOPT_RAM_TIMINGS (1<<8) |
388947f3 |
33 | #define EOPT_CONFIRM_SAVE (1<<9) |
34 | #define EOPT_EN_CD_LEDS (1<<10) |
35 | #define EOPT_CONFIRM_LOAD (1<<11) |
fa8d1331 |
36 | #define EOPT_A_SN_GAMMA (1<<12) |
f71361b5 |
37 | #define EOPT_VSYNC (1<<13) |
b7911801 |
38 | #define EOPT_GIZ_SCANLN (1<<14) |
39 | #define EOPT_GIZ_DBLBUF (1<<15) |
40 | #define EOPT_VSYNC_MODE (1<<16) |
41 | #define EOPT_SHOW_RTC (1<<17) |
42 | #define EOPT_NO_FRMLIMIT (1<<18) |
43 | #define EOPT_WIZ_TEAR_FIX (1<<19) |
36f6fd5a |
44 | |
fa8d1331 |
45 | enum { |
46 | EOPT_SCALE_NONE = 0, |
47 | EOPT_SCALE_SW_H, |
48 | EOPT_SCALE_HW_H, |
49 | EOPT_SCALE_HW_HV, |
50 | }; |
51 | |
36f6fd5a |
52 | typedef struct _currentConfig_t { |
b7911801 |
53 | int EmuOpt; |
54 | int s_PicoOpt; |
0ae25549 |
55 | int s_PsndRate; |
56 | int s_PicoRegion; |
36f6fd5a |
57 | int s_PicoAutoRgnOrder; |
58 | int s_PicoCDBuffers; |
f013066e |
59 | int Frameskip; |
60 | int CPUclock; |
f013066e |
61 | int volume; |
62 | int gamma; |
36f6fd5a |
63 | int scaling; // gp2x: 0=center, 1=hscale, 2=hvscale, 3=hsoftscale; psp: bilinear filtering |
64 | int rotation; // for UIQ |
6f748c47 |
65 | float scale; // psp: screen scale |
66 | float hscale32, hscale40; // psp: horizontal scale |
960a8e27 |
67 | int gamma2; // psp: black level |
6589c840 |
68 | int turbo_rate; |
f013066e |
69 | } currentConfig_t; |
70 | |
0ae25549 |
71 | extern currentConfig_t currentConfig, defaultConfig; |
f013066e |
72 | extern char *PicoConfigFile; |
144a28a0 |
73 | extern int rom_loaded; |
f013066e |
74 | extern int state_slot; |
75 | extern int config_slot, config_slot_current; |
76 | extern unsigned char *movie_data; |
93c18cb4 |
77 | extern int reset_timing; |
78 | |
79 | #define PICO_PEN_ADJUST_X 4 |
80 | #define PICO_PEN_ADJUST_Y 2 |
81 | extern int pico_pen_x, pico_pen_y; |
8a091e48 |
82 | extern int pico_inp_mode; |
f013066e |
83 | |
049a6b3e |
84 | extern char rom_fname_reload[512]; // ROM to try loading on next PGS_ReloadRom |
85 | extern char rom_fname_loaded[512]; // currently loaded ROM filename |
86 | |
24b24674 |
87 | // engine states |
049a6b3e |
88 | extern int engineState; |
24b24674 |
89 | enum TPicoGameState { |
90 | PGS_Paused = 1, |
91 | PGS_Running, |
92 | PGS_Quit, |
93 | PGS_KeyConfig, |
94 | PGS_ReloadRom, |
95 | PGS_Menu, |
0f4090a9 |
96 | PGS_TrayMenu, |
24b24674 |
97 | PGS_RestartRun, |
98 | PGS_Suspending, /* PSP */ |
99 | PGS_SuspendWake, /* PSP */ |
100 | }; |
101 | |
2f3ca016 |
102 | // media types |
103 | enum { |
104 | PM_BAD = 0, |
105 | PM_MD_CART, /* also 32x */ |
106 | PM_MARK3, |
107 | PM_CD, |
108 | }; |
f013066e |
109 | |
93c18cb4 |
110 | void emu_init(void); |
111 | void emu_finish(void); |
b5bfb864 |
112 | void emu_loop(void); |
93c18cb4 |
113 | |
ee0f881e |
114 | int emu_reload_rom(char *rom_fname); |
6b8796e2 |
115 | int emu_swap_cd(const char *fname); |
ee0f881e |
116 | int emu_save_load_game(int load, int sram); |
93c18cb4 |
117 | void emu_reset_game(void); |
388947f3 |
118 | |
9ecdd73a |
119 | void emu_set_defconfig(void); |
ee0f881e |
120 | int emu_read_config(int game, int no_defaults); |
121 | int emu_write_config(int game); |
388947f3 |
122 | |
ee0f881e |
123 | char *emu_get_save_fname(int load, int is_sram, int slot); |
124 | int emu_check_save_file(int slot); |
388947f3 |
125 | |
b7911801 |
126 | void emu_text_out8 (int x, int y, const char *text); |
127 | void emu_text_out16(int x, int y, const char *text); |
128 | void emu_text_out8_rot (int x, int y, const char *text); |
129 | void emu_text_out16_rot(int x, int y, const char *text); |
130 | |
45deb409 |
131 | void emu_make_path(char *buff, const char *end, int size); |
388947f3 |
132 | void emu_update_input(void); |
ee0f881e |
133 | void emu_get_game_name(char *str150); |
134 | void emu_set_fastforward(int set_on); |
b5bfb864 |
135 | void emu_status_msg(const char *format, ...); |
f013066e |
136 | |
36f6fd5a |
137 | #ifdef __cplusplus |
138 | } // extern "C" |
139 | #endif |
140 | |