Example #1
0
 private void BeginExecution()
 {
     while (true)
     {
         Execute(_memory.ReadByte(PC));
     }
 }
Example #2
0
        //ADC A,d8 2  8 Z 0 H C
        public void AddImmediateWithCarry(R8Bit A, R16Bit PC, MappedMemory memory, R8BitFlag flag)
        {
            byte immediate = memory.ReadByte(PC);
            byte carry     = (byte)(flag.CarryFlag ? 1 : 0);

            flag.HalfCarryFlag = ((A.Value & 0x0F) + (B.Value & 0x0F) + carry) > 0x0F;
            var result = A.Value + B.Value + carry;

            flag.CarryFlag = result > 255;
            A.Value        = (byte)result;
            flag.SubFlag   = false;
            flag.ZeroFlag  = A.Value == 0;
        }