| 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 long long int debug_count; |
| 43 | extern unsigned int r4300emu; |
| 44 | extern unsigned int next_interupt, CIC_Chip; |
| 45 | extern int rounding_mode, trunc_mode, round_mode, ceil_mode, floor_mode; |
| 46 | extern unsigned int last_addr; |
| 47 | extern char invalid_code[0x100000]; |
| 48 | extern unsigned int jump_to_address; |
| 49 | extern int no_compiled_jump; |
| 50 | |
| 51 | void init_blocks(void); |
| 52 | void free_blocks(void); |
| 53 | void r4300_reset_hard(void); |
| 54 | void r4300_reset_soft(void); |
| 55 | void r4300_execute(void); |
| 56 | void pure_interpreter(void); |
| 57 | void compare_core(void); |
| 58 | void jump_to_func(void); |
| 59 | void update_count(void); |
| 60 | int check_cop1_unusable(void); |
| 61 | void shuffle_fpr_data(int oldStatus, int newStatus); |
| 62 | void 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. */ |
| 69 | void 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 | |