04489f65da572eccf8e9f2d18e53c1277df844f9
[pcsx_rearmed.git] / frontend / main.h
1 /*  Pcsx - Pc Psx Emulator
2  *  Copyright (C) 1999-2002  Pcsx Team
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA
17  */
18
19 #ifndef __LINUX_H__
20 #define __LINUX_H__
21
22 #include "config.h"
23
24 #define DEFAULT_MEM_CARD_1 "/.pcsx/memcards/card1.mcd"
25 #define DEFAULT_MEM_CARD_2 "/.pcsx/memcards/card2.mcd"
26 #define MEMCARD_DIR "/.pcsx/memcards/"
27 #define PLUGINS_DIR "/.pcsx/plugins/"
28 #define PLUGINS_CFG_DIR "/.pcsx/plugins/cfg/"
29 #define PCSX_DOT_DIR "/.pcsx/"
30 #define STATES_DIR "/.pcsx/sstates/"
31 #define CHEATS_DIR "/.pcsx/cheats/"
32 #define PATCHES_DIR "/.pcsx/patches/"
33 #define BIOS_DIR "/bios/"
34
35 extern char cfgfile_basename[MAXPATHLEN];
36
37 extern int state_slot;
38
39 /* emu_core_preinit - must be the very first call
40  * emu_core_init - to be called after platform-specific setup */
41 int emu_core_preinit(void);
42 int emu_core_init(void);
43
44 void emu_set_default_config(void);
45 void emu_on_new_cd(int show_hud_msg);
46
47 int get_state_filename(char *buf, int size, int i);
48 int emu_check_state(int slot);
49 int emu_save_state(int slot);
50 int emu_load_state(int slot);
51
52 void set_cd_image(const char *fname);
53
54 extern unsigned long gpuDisp;
55 extern int ready_to_go;
56
57 extern char hud_msg[64];
58 extern int hud_new_msg;
59
60 enum sched_action {
61         SACTION_NONE,
62         SACTION_ENTER_MENU,
63         SACTION_LOAD_STATE,
64         SACTION_SAVE_STATE,
65         SACTION_NEXT_SSLOT,
66         SACTION_PREV_SSLOT,
67         SACTION_TOGGLE_FSKIP,
68         SACTION_SWITCH_DISPMODE,
69         SACTION_FAST_FORWARD,
70         SACTION_SCREENSHOT,
71         SACTION_VOLUME_UP,
72         SACTION_VOLUME_DOWN,
73         SACTION_MINIMIZE,
74         SACTION_TOGGLE_FPS,
75         SACTION_GUN_TRIGGER = 16,
76         SACTION_GUN_A,
77         SACTION_GUN_B,
78         SACTION_GUN_TRIGGER2,
79 };
80
81 #define SACTION_GUN_MASK (0x0f << SACTION_GUN_TRIGGER)
82
83 static inline void emu_set_action(enum sched_action action_)
84 {
85         extern enum sched_action emu_action, emu_action_old;
86         extern int stop;
87
88         if (action_ == SACTION_NONE)
89                 emu_action_old = 0;
90         else if (action_ != emu_action_old)
91                 stop = 1;
92         emu_action = action_;
93 }
94
95 #endif /* __LINUX_H__ */