1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus - main.h *
3 * Mupen64Plus homepage: https://mupen64plus.org/ *
4 * Copyright (C) 2012 CasualJames *
5 * Copyright (C) 2002 Blight *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
21 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22
23#ifndef __MAIN_H__
24#define __MAIN_H__
25
26#include <stdint.h>
27
28#include "api/m64p_types.h"
29#include "main/cheat.h"
30#include "device/device.h"
31#include "osal/preproc.h"
32
33#if defined(__GNUC__)
34#define ATTR_FMT(fmtpos, attrpos) __attribute__ ((format (printf, fmtpos, attrpos)))
35#else
36#define ATTR_FMT(fmtpos, attrpos)
37#endif
38
39/* globals */
40extern m64p_handle g_CoreConfig;
41
42extern int g_RomWordsLittleEndian;
43extern int g_EmulatorRunning;
44extern int g_rom_pause;
45
46extern struct cheat_ctx g_cheat_ctx;
47
48extern void* g_mem_base;
49
50extern struct device g_dev;
51
52extern m64p_media_loader g_media_loader;
53
54extern m64p_frame_callback g_FrameCallback;
55
56extern int g_gs_vi_counter;
57
58const char* get_savestatepath(void);
59const char* get_savesrampath(void);
60
61void new_frame(void);
62void new_vi(void);
63
64void main_switch_next_pak(int control_id);
65void main_switch_plugin_pak(int control_id);
66void main_change_gb_cart(int control_id);
67
68int main_set_core_defaults(void);
69void main_message(m64p_msg_level level, unsigned int osd_corner, const char *format, ...) ATTR_FMT(3, 4);
70
71m64p_error main_run(void);
72void main_stop(void);
73void main_toggle_pause(void);
74void main_advance_one(void);
75
76void main_speedup(int percent);
77void main_speeddown(int percent);
78void main_set_fastforward(int enable);
79
80void main_take_next_screenshot(void);
81
82void main_state_set_slot(int slot);
83void main_state_inc_slot(void);
84void main_state_load(const char *filename);
85void main_state_save(int format, const char *filename);
86
87m64p_error main_core_state_query(m64p_core_param param, int *rval);
88m64p_error main_core_state_set(m64p_core_param param, int val);
89
90m64p_error main_get_screen_size(int *width, int *height);
91m64p_error main_read_screen(void *pixels, int bFront);
92
93m64p_error main_volume_up(void);
94m64p_error main_volume_down(void);
95m64p_error main_volume_get_level(int *level);
96m64p_error main_volume_set_level(int level);
97m64p_error main_volume_mute(void);
98int main_volume_get_muted(void);
99
100m64p_error main_reset(int do_hard_reset);
101
102#endif /* __MAIN_H__ */
103
104