mirror of https://github.com/inolen/redream.git
more hacks
This commit is contained in:
parent
c0114cf749
commit
8ce539f85e
|
@ -29,9 +29,15 @@ static void sh4_ccn_reset(struct sh4 *sh4) {
|
|||
jit_invalidate_code(sh4->jit);
|
||||
}
|
||||
|
||||
extern int sh4_ccn_pref_hack;
|
||||
|
||||
void sh4_ccn_pref(struct sh4 *sh4, uint32_t addr) {
|
||||
struct memory *mem = sh4->dc->mem;
|
||||
|
||||
if (sh4_ccn_pref_hack) {
|
||||
LOG_INFO("sh4_ccn_pref addr=0x%08x", addr);
|
||||
}
|
||||
|
||||
/* make sure this is a sq related prefetch */
|
||||
DCHECK(addr >= 0xe0000000 && addr <= 0xe3ffffff);
|
||||
|
||||
|
|
|
@ -625,6 +625,9 @@ static void x64_backend_emit_prolog(struct x64_backend *backend, struct ir *ir,
|
|||
e.add(e.dword[guestctx + guest->offset_instrs], num_instrs);
|
||||
}
|
||||
|
||||
extern int lse_hack_enable;
|
||||
extern int sh4_ccn_pref_hack;
|
||||
|
||||
static void x64_backend_emit(struct x64_backend *backend, struct ir *ir,
|
||||
jit_emit_cb emit_cb, void *emit_data) {
|
||||
auto &e = *backend->codegen;
|
||||
|
@ -633,6 +636,8 @@ static void x64_backend_emit(struct x64_backend *backend, struct ir *ir,
|
|||
|
||||
e.inLocalLabel();
|
||||
|
||||
e.mov(e.dword[&sh4_ccn_pref_hack], lse_hack_enable);
|
||||
|
||||
list_for_each_entry(block, &ir->blocks, struct ir_block, it) {
|
||||
int first = 1;
|
||||
uint8_t *block_addr = e.getCurr<uint8_t *>();
|
||||
|
|
|
@ -321,6 +321,7 @@ static void jit_promote_fastmem(struct jit *jit, struct jit_block *block,
|
|||
|
||||
int lse_hack_enable;
|
||||
int lse_hack_count;
|
||||
int sh4_ccn_pref_hack;
|
||||
|
||||
void jit_compile_code(struct jit *jit, uint32_t guest_addr) {
|
||||
#if 0
|
||||
|
@ -350,10 +351,14 @@ void jit_compile_code(struct jit *jit, uint32_t guest_addr) {
|
|||
jit_free_block(jit, existing);
|
||||
}
|
||||
|
||||
lse_hack_enable = guest_addr == 0x8c083726;
|
||||
lse_hack_count = 0;
|
||||
|
||||
/* translate guest code into ir */
|
||||
struct ir ir = {0};
|
||||
ir.buffer = jit->ir_buffer;
|
||||
ir.capacity = sizeof(jit->ir_buffer);
|
||||
|
||||
jit->frontend->translate_code(jit->frontend, guest_addr, guest_size, &ir);
|
||||
|
||||
/* dump raw ir */
|
||||
|
@ -365,9 +370,6 @@ void jit_compile_code(struct jit *jit, uint32_t guest_addr) {
|
|||
jit_promote_fastmem(jit, block, &ir);
|
||||
cfa_run(jit->cfa, &ir);
|
||||
|
||||
lse_hack_enable = guest_addr == 0x8c0664c6;
|
||||
lse_hack_count = 0;
|
||||
|
||||
static const uint32_t test[] = {
|
||||
0x0,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue