Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/yabause/src/dreamcast/sh2rec/sh2rec.h
2 views
1
/* Copyright 2010 Lawrence Sebald
2
3
This file is part of Yabause.
4
5
Yabause is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
10
Yabause is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with Yabause; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
20
#ifndef SH2REC_H
21
#define SH2REC_H
22
23
#define SH2CORE_DYNAREC 10
24
25
#define INSTRUCTION_A(x) ((x & 0xF000) >> 12)
26
#define INSTRUCTION_B(x) ((x & 0x0F00) >> 8)
27
#define INSTRUCTION_C(x) ((x & 0x00F0) >> 4)
28
#define INSTRUCTION_D(x) (x & 0x000F)
29
#define INSTRUCTION_CD(x) (x & 0x00FF)
30
#define INSTRUCTION_BCD(x) (x & 0x0FFF)
31
32
typedef struct sh2rec_block {
33
u16 *block;
34
u32 start_pc;
35
int cycles;
36
int length;
37
38
u16 *ptr;
39
u32 pc;
40
} sh2rec_block_t;
41
42
/* Recompile a single instruction */
43
int sh2rec_rec_inst(sh2rec_block_t *b, int isdelay);
44
45
/* Recompile a block at the PC specified in the block */
46
int sh2rec_rec_block(sh2rec_block_t *b);
47
48
extern SH2Interface_struct SH2Dynarec;
49
50
#endif /* !SH2REC_H */
51
52