JIT (ARM): Fix bugs that caused "Alice in Wonderland" and "Sonic Chronicles: The Dark Brotherhood" to fail to start.

- Also fixes ultra slow text timing in "7th Dragon".
- Special thanks to @byte4byte for this fix. His notes: "Fixed issue with sbc&adc reg and mvns".
This commit is contained in:
rogerman 2022-04-25 11:18:23 -07:00
parent 0b0bee78cc
commit 2ab69da5e2
2 changed files with 5 additions and 4 deletions

View File

@ -710,8 +710,8 @@ static void emit_negs(t_bytes *out, int rs, int rt)
static void emit_mvns(t_bytes *out, int rs,int rt)
{
output_w32(out, 0x2a200000|rs<<16|WZR<<5|rt);
emit_cmp(out, rt, rt);
output_w32(out, 0x2A2003E0|rs<<16|WZR<<5|rt);
emit_cmpimm(out, rt, 0);
}
static void emit_zeroreg(t_bytes *out, int rt)

View File

@ -3253,8 +3253,9 @@ static int OP_SUB_REG(const u32 i)
//-----------------------------------------------------------------------------
static int OP_ADC_REG(const u32 i)
{
reg_pos_thumb(3, tmp, VALUE);
GET_CARRY(0);
reg_pos_thumb(3, tmp, VALUE);
reg_pos_thumb(0, tmp2, VALUE);
emit_adcs(g_out, tmp2, tmp, tmp2);
emit_write_ptr32_regptrTO_regFROM(g_out, CACHED_PTR(reg_pos_thumb(0, R1, ADDRESS)), tmp2);
@ -3268,8 +3269,8 @@ static int OP_ADC_REG(const u32 i)
//-----------------------------------------------------------------------------
static int OP_SBC_REG(const u32 i)
{
reg_pos_thumb(3, tmp, VALUE);
GET_CARRY(1);
reg_pos_thumb(3, tmp, VALUE);
reg_pos_thumb(0, tmp2, VALUE);
emit_sbcs(g_out, tmp2, tmp, tmp2);
emit_write_ptr32_regptrTO_regFROM(g_out, CACHED_PTR(reg_pos_thumb(0, R1, ADDRESS)), tmp2);