Core commit. Compile and run on the OpenPandora
[mupen64plus-pandora.git] / source / mupen64plus-core / src / r4300 / interupt.h
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  *   Mupen64plus - interupt.h                                              *
3  *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
4  *   Copyright (C) 2002 Hacktarux                                          *
5  *                                                                         *
6  *   This program is free software; you can redistribute it and/or modify  *
7  *   it under the terms of the GNU General Public License as published by  *
8  *   the Free Software Foundation; either version 2 of the License, or     *
9  *   (at your option) any later version.                                   *
10  *                                                                         *
11  *   This program is distributed in the hope that it will be useful,       *
12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14  *   GNU General Public License for more details.                          *
15  *                                                                         *
16  *   You should have received a copy of the GNU General Public License     *
17  *   along with this program; if not, write to the                         *
18  *   Free Software Foundation, Inc.,                                       *
19  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
20  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
21
22 void compare_interupt(void);
23 void gen_dp(void);
24 void init_interupt(void);
25
26 extern int vi_field;
27 extern unsigned int next_vi;
28
29 // set to avoid savestates/reset if state may be inconsistent
30 // (e.g. in the middle of an instruction)
31 extern int interupt_unsafe_state;
32
33 void gen_interupt(void);
34 void check_interupt(void);
35
36 void translate_event_queue(unsigned int base);
37 void remove_event(int type);
38 void add_interupt_event_count(int type, unsigned int count);
39 void add_interupt_event(int type, unsigned int delay);
40 unsigned int get_event(int type);
41 int get_next_event_type(void);
42
43 int save_eventqueue_infos(char *buf);
44 void load_eventqueue_infos(char *buf);
45
46 #define VI_INT      0x001
47 #define COMPARE_INT 0x002
48 #define CHECK_INT   0x004
49 #define SI_INT      0x008
50 #define PI_INT      0x010
51 #define SPECIAL_INT 0x020
52 #define AI_INT      0x040
53 #define SP_INT      0x080
54 #define DP_INT      0x100
55 #define HW2_INT     0x200
56 #define NMI_INT     0x400
57