/* Copyright 2010 Lawrence Sebald12This file is part of Yabause.34Yabause is free software; you can redistribute it and/or modify5it under the terms of the GNU General Public License as published by6the Free Software Foundation; either version 2 of the License, or7(at your option) any later version.89Yabause is distributed in the hope that it will be useful,10but WITHOUT ANY WARRANTY; without even the implied warranty of11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12GNU General Public License for more details.1314You should have received a copy of the GNU General Public License15along with Yabause; if not, write to the Free Software16Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA17*/1819#ifndef SH2REC_H20#define SH2REC_H2122#define SH2CORE_DYNAREC 102324#define INSTRUCTION_A(x) ((x & 0xF000) >> 12)25#define INSTRUCTION_B(x) ((x & 0x0F00) >> 8)26#define INSTRUCTION_C(x) ((x & 0x00F0) >> 4)27#define INSTRUCTION_D(x) (x & 0x000F)28#define INSTRUCTION_CD(x) (x & 0x00FF)29#define INSTRUCTION_BCD(x) (x & 0x0FFF)3031typedef struct sh2rec_block {32u16 *block;33u32 start_pc;34int cycles;35int length;3637u16 *ptr;38u32 pc;39} sh2rec_block_t;4041/* Recompile a single instruction */42int sh2rec_rec_inst(sh2rec_block_t *b, int isdelay);4344/* Recompile a block at the PC specified in the block */45int sh2rec_rec_block(sh2rec_block_t *b);4647extern SH2Interface_struct SH2Dynarec;4849#endif /* !SH2REC_H */505152