if (mod == 2)
known_regs.r[r] = (known_regs.r[r] & ~modulo) | ((known_regs.r[r] - count) & modulo);
else known_regs.r[r] = (known_regs.r[r] & ~modulo) | ((known_regs.r[r] + count) & modulo);
+ dirty_regb |= (1 << (r + 8));
}
else
{
return;
}
+ tr_flush_dirty_pmcrs();
known_regb &= ~KRREG_PMC;
dirty_regb &= ~KRREG_PMC;
known_regb &= ~(1 << (20+reg));
// call the C code to handle this
tr_flush_dirty_ST();
- //tr_flush_dirty_pmcrs();
tr_mov16(0, reg);
emith_call_c_func(ssp_pm_read);
hostreg_clear();
hostreg_sspreg_changed(SSP_AL);
if (const_val != -1) {
known_regs.gr[SSP_A].l = const_val;
- known_regb |= 1 << SSP_AL;
+ known_regb |= KRREG_AL;
} else
- known_regb &= ~(1 << SSP_AL);
+ known_regb &= ~KRREG_AL;
}
static void tr_r0_to_PMX(int reg)
return;
}
+ tr_flush_dirty_pmcrs();
known_regb &= ~KRREG_PMC;
dirty_regb &= ~KRREG_PMC;
known_regb &= ~(1 << (25+reg));
// call the C code to handle this
tr_flush_dirty_ST();
- //tr_flush_dirty_pmcrs();
tr_mov16(1, reg);
emith_call_c_func(ssp_pm_write);
hostreg_clear();
known_regs.emu_status |= SSP_PMC_HAVE_ADDR;
known_regs.pmc.l = const_val;
}
+ dirty_regb |= KRREG_PMC;
}
else
{
tr_flush_dirty_ST();
- if (known_regb & KRREG_PMC) {
+ if (dirty_regb & KRREG_PMC) {
emith_move_r_imm(1, known_regs.pmc.v);
EOP_STR_IMM(1,7,0x400+SSP_PMC*4);
- known_regb &= ~KRREG_PMC;
dirty_regb &= ~KRREG_PMC;
}
+ known_regb &= ~KRREG_PMC;
EOP_LDR_IMM(1,7,0x484); // ldr r1, [r7, #0x484] // emu_status
EOP_ADD_IMM(2,7,24/2,4); // add r2, r7, #0x400
EOP_TST_IMM(1, 0, SSP_PMC_HAVE_ADDR);
EOP_ORR_IMM(6, 6, 24/2, 6); // orr r6, r6, 0x600
hostreg_sspreg_changed(SSP_ST);
known_regs.gr[SSP_ST].h = 0x60;
- known_regb |= 1 << SSP_ST;
+ known_regb |= KRREG_ST;
dirty_regb &= ~KRREG_ST;
(*pc) += 3*2;
n_in_ops += 3;
tr_make_dirty_ST();
EOP_C_DOP_REG_XIMM(A_COND_AL,A_OP_SUB,1,5,5,0,A_AM1_LSL,10); // subs r5, r5, r10
hostreg_sspreg_changed(SSP_A);
- known_regb &= ~(KRREG_A|KRREG_AL);
dirty_regb |= KRREG_ST;
+ known_regb &= ~(KRREG_A|KRREG_AL|KRREG_ST);
ret++; break;
// mpya (rj), (ri), b
tr_make_dirty_ST();
EOP_C_DOP_REG_XIMM(A_COND_AL,A_OP_ADD,1,5,5,0,A_AM1_LSL,10); // adds r5, r5, r10
hostreg_sspreg_changed(SSP_A);
- known_regb &= ~(KRREG_A|KRREG_AL);
dirty_regb |= KRREG_ST;
+ known_regb &= ~(KRREG_A|KRREG_AL|KRREG_ST);
ret++; break;
// mld (rj), (ri), b
EOP_C_DOP_IMM(A_COND_AL,A_OP_MOV,1,0,5,0,0); // movs r5, #0
hostreg_sspreg_changed(SSP_A);
known_regs.gr[SSP_A].v = 0;
- known_regb |= (KRREG_A|KRREG_AL);
dirty_regb |= KRREG_ST;
+ known_regb &= ~KRREG_ST;
+ known_regb |= (KRREG_A|KRREG_AL);
tr_mac_load_XY(op);
ret++; break;