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