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