CORE: Some more try on new_dynarec (no effect it seems
[mupen64plus-pandora.git] / source / mupen64plus-core / src / r4300 / r4300.h
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  *   Mupen64plus - r4300.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 R4300_H
23 #define R4300_H
24
25 #include "recomp.h"
26 #include "memory/tlb.h"
27
28 extern precomp_instr *PC;
29
30 extern precomp_block *blocks[0x100000], *actual;
31
32 extern int stop, llbit, rompause;
33 extern long long int reg[32], hi, lo;
34 extern long long int local_rs;
35 extern unsigned int reg_cop0[32];
36 extern double *reg_cop1_double[32];
37 extern float *reg_cop1_simple[32];
38 extern long long int reg_cop1_fgr_64[32];
39 extern int FCR0, FCR31;
40 extern tlb tlb_e[32];
41 extern unsigned int delay_slot, skip_jump, dyna_interp, op;
42 extern unsigned int r4300emu;
43 extern unsigned int next_interupt, CIC_Chip;
44 extern int rounding_mode, trunc_mode, round_mode, ceil_mode, floor_mode;
45 extern unsigned int last_addr;
46 extern char invalid_code[0x100000];
47 extern unsigned int jump_to_address;
48 extern int no_compiled_jump;
49
50 void init_blocks(void);
51 void free_blocks(void);
52 void r4300_reset_hard(void);
53 void r4300_reset_soft(void);
54 void r4300_execute(void);
55 void pure_interpreter(void);
56 void compare_core(void);
57 void jump_to_func(void);
58 void update_count(void);
59 int check_cop1_unusable(void);
60 void shuffle_fpr_data(int oldStatus, int newStatus);
61 void set_fpr_pointers(int newStatus);
62
63 /* Jumps to the given address. This is for the cached interpreter / dynarec. */
64 #define jump_to(a) { jump_to_address = a; jump_to_func(); }
65
66 /* Jump to the given address. This works for all r4300 emulator, but is slower.
67  * Use this for common code which can be executed from any r4300 emulator. */ 
68 void generic_jump_to(unsigned int address);
69
70 // r4300 emulators
71 #define CORE_PURE_INTERPRETER 0
72 #define CORE_INTERPRETER      1
73 #define CORE_DYNAREC          2
74
75 // profiling
76 #define ALL_SECTION 0
77 #define GFX_SECTION 1
78 #define AUDIO_SECTION 2
79 #define COMPILER_SECTION 3
80 #define IDLE_SECTION 4
81
82 #ifdef PROFILE
83   void start_section(int section_type);
84   void end_section(int section_type);
85   void refresh_stat(void);
86 #else
87   #define start_section(a)
88   #define end_section(a)
89   #define refresh_stat()
90 #endif
91
92 #endif /* R4300_H */
93