fixes ADC bug introduced in last commit

This commit is contained in:
Ed McCardell 2012-03-21 10:17:40 -04:00
parent e932b9b7ac
commit ea1e8f192e
1 changed files with 2 additions and 1 deletions

View File

@ -358,7 +358,8 @@ class Cpu : CpuBase
al = ((al + 0x06) & 0x0F) + 0x10;
a = (a & 0xF0) + (val & 0xF0) + al;
flag.negative_ = flag.zero_ = cast(ubyte)a;
flag.negative_ = cast(ubyte)a;
flag.zero_ = cast(ubyte)(accumulator + val + flag.carry);
flag.overflow =
(!((accumulator ^ val) & 0x80)) && ((val ^ a) & 0x80);