-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathrecomp.h
executable file
·110 lines (102 loc) · 2.45 KB
/
recomp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* Mupen64 - recomp.h
* Copyright (C) 2002 Hacktarux
*
* Mupen64 homepage: http://mupen64.emulation64.com
* email address: [email protected]
*
* If you want to contribute to the project please contact
* me first (maybe someone is already making what you are
* planning to do).
*
*
* This program is free software; you can redistribute it and/
* or modify it under the terms of the GNU General Public Li-
* cence as published by the Free Software Foundation; either
* version 2 of the Licence, or any later version.
*
* This program is distributed in the hope that it will be use-
* ful, but WITHOUT ANY WARRANTY; without even the implied war-
* ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public Licence for more details.
*
* You should have received a copy of the GNU General Public
* Licence along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
* USA.
*
**/
#ifndef RECOMP_H
#define RECOMP_H
#include "x86/assemble.h"
#include "../lua/LuaDefine.h"
typedef struct _precomp_instr
{
void (*ops)();
union
{
struct
{
long long int *rs;
long long int *rt;
short immediate;
} i;
struct
{
unsigned long inst_index;
} j;
struct
{
long long int *rs;
long long int *rt;
long long int *rd;
unsigned char sa;
unsigned char nrd;
} r;
struct
{
unsigned char base;
unsigned char ft;
short offset;
} lf;
struct
{
unsigned char ft;
unsigned char fs;
unsigned char fd;
} cf;
#ifdef LUA_BREAKPOINTSYNC_INTERP
unsigned char stype;
#endif
} f;
unsigned long addr;
unsigned long local_addr;
reg_cache_struct reg_cache_infos;
#ifdef LUA_TRACEINTERP
void (*s_ops)();
unsigned long src;
#endif
} precomp_instr;
typedef struct _precomp_block
{
precomp_instr *block;
unsigned int start;
unsigned int end;
unsigned char *code;
unsigned int code_length;
unsigned int max_code_length;
void *jumps_table;
int jumps_number;
//unsigned char md5[16];
unsigned long adler32;
} precomp_block;
void recompile_block(long *source, precomp_block *block, unsigned long func);
void init_block(long *source, precomp_block *block);
void recompile_opcode();
void prefetch_opcode(unsigned long op);
void dyna_jump();
void dyna_start(void (*code)());
void dyna_stop();
extern precomp_instr *dst;
#include "x86/regcache.h"
#endif