Skip to content

Commit

Permalink
Merge pull request #129 from mikrosk/bcd_fixes2
Browse files Browse the repository at this point in the history
Fix NBCD instruction
  • Loading branch information
tonioni committed Jan 9, 2018
2 parents 83fcc48 + 4fa8009 commit ceff388
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gencpu.cpp
Expand Up @@ -3424,8 +3424,9 @@ static void gen_opcode (unsigned int opcode)
printf ("\tuae_u16 newv_hi = - (src & 0xF0);\n");
printf ("\tuae_u16 newv;\n");
printf ("\tint cflg, tmp_newv;\n");
printf ("\ttmp_newv = newv_hi + newv_lo;\n");
printf ("\tif (newv_lo > 9) { newv_lo -= 6; }\n");
printf ("\ttmp_newv = newv = newv_hi + newv_lo;\n");
printf ("\tnewv = newv_hi + newv_lo;\n");
printf ("\tcflg = (newv & 0x1F0) > 0x90;\n");
printf ("\tif (cflg) newv -= 0x60;\n");
printf ("\tSET_CFLG (cflg);\n");
Expand Down

0 comments on commit ceff388

Please sign in to comment.