1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  *   Mupen64plus - interrupt.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 #ifndef M64P_R4300_INTERUPT_H
23 #define M64P_R4300_INTERUPT_H
24 
25 #include <stdint.h>
26 
27 void init_interrupt(void);
28 
29 // set to avoid savestates/reset if state may be inconsistent
30 // (e.g. in the middle of an instruction)
31 extern int interrupt_unsafe_state;
32 
33 void raise_maskable_interrupt(uint32_t cause);
34 
35 void gen_interrupt(void);
36 void check_interrupt(void);
37 
38 void translate_event_queue(unsigned int base);
39 void remove_event(int type);
40 void add_interrupt_event_count(int type, unsigned int count);
41 void add_interrupt_event(int type, unsigned int delay);
42 unsigned int get_event(int type);
43 int get_next_event_type(void);
44 
45 int save_eventqueue_infos(char *buf);
46 void load_eventqueue_infos(char *buf);
47 
48 #define VI_INT      0x001
49 #define COMPARE_INT 0x002
50 #define CHECK_INT   0x004
51 #define SI_INT      0x008
52 #define PI_INT      0x010
53 #define SPECIAL_INT 0x020
54 #define AI_INT      0x040
55 #define SP_INT      0x080
56 #define DP_INT      0x100
57 #define HW2_INT     0x200
58 #define NMI_INT     0x400
59 #define CART_INT    0x800
60 
61 #endif /* M64P_R4300_INTERUPT_H */
62