Skip to content

Commit

Permalink
Fix v30mz regression (again) (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdgleaver committed Nov 25, 2021
1 parent 3fcb582 commit ea00c1d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mednafen/wswan/v30mz.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,13 @@ static void DoOP(uint8 opcode)
}
} OP_EPILOGUE;

OP( 0xd4, i_aam ) { I.regs.b[AH] = I.regs.b[AL] / 10; I.regs.b[AL] %= 10; SetSZPF_Word(I.regs.w[AW]); CLK(17); } OP_EPILOGUE;
OP( 0xd5, i_aad ) { I.regs.b[AL] = I.regs.b[AH] * 10 + I.regs.b[AL]; I.regs.b[AH] = 0; SetSZPF_Byte(I.regs.b[AL]); CLK(6); } OP_EPILOGUE;
/* Warning: Do not modify this code, or everything
* will break
* (ignore any "variable 'mult' set but not used"
* compiler warnings; 'FETCH' is a non-trivial
* macro, and is absolutely required) */
OP( 0xd4, i_aam ) { uint32 mult=FETCH; mult=0; I.regs.b[AH] = I.regs.b[AL] / 10; I.regs.b[AL] %= 10; SetSZPF_Word(I.regs.w[AW]); CLK(17); } OP_EPILOGUE;
OP( 0xd5, i_aad ) { uint32 mult=FETCH; mult=0; I.regs.b[AL] = I.regs.b[AH] * 10 + I.regs.b[AL]; I.regs.b[AH] = 0; SetSZPF_Byte(I.regs.b[AL]); CLK(6); } OP_EPILOGUE;
OP( 0xd6, i_setalc ) { I.regs.b[AL] = (CF)?0xff:0x00; CLK(3); } OP_EPILOGUE;
OP( 0xd7, i_trans ) { uint32 dest = (I.regs.w[BW]+I.regs.b[AL])&0xffff; I.regs.b[AL] = GetMemB(DS0, dest); CLK(5); } OP_EPILOGUE;

Expand Down

0 comments on commit ea00c1d

Please sign in to comment.