atari_py/ale_interface/src/emucore/m6502/src/M6502Hi.ins [3157:3193]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
{
  uInt8 oldA = A;
  bool oldC = C;

  // Set carry flag according to the right-most bit
  C = operand & 0x01;

  operand = ((operand >> 1) & 0x7f) | (oldC ? 0x80 : 0x00);
  poke(operandAddress, operand);

  if(!D)
  {
    Int16 sum = (Int16)((Int8)A) + (Int16)((Int8)operand) + (C ? 1 : 0);
    V = ((sum > 127) || (sum < -128));

    sum = (Int16)A + (Int16)operand + (C ? 1 : 0);
    A = sum;
    C = (sum > 0xff);
    notZ = A;
    N = A & 0x80;
  }
  else
  {
    Int16 sum = ourBCDTable[0][A] + ourBCDTable[0][operand] + (C ? 1 : 0);

    C = (sum > 99);
    A = ourBCDTable[1][sum & 0xff];
    notZ = A;
    N = A & 0x80;
    V = ((oldA ^ A) & 0x80) && ((A ^ operand) & 0x80);
  }
}
break;

case 0x7b:
{
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



atari_py/ale_interface/src/emucore/m6502/src/M6502Low.ins [3165:3201]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
{
  uInt8 oldA = A;
  bool oldC = C;

  // Set carry flag according to the right-most bit
  C = operand & 0x01;

  operand = ((operand >> 1) & 0x7f) | (oldC ? 0x80 : 0x00);
  poke(operandAddress, operand);

  if(!D)
  {
    Int16 sum = (Int16)((Int8)A) + (Int16)((Int8)operand) + (C ? 1 : 0);
    V = ((sum > 127) || (sum < -128));

    sum = (Int16)A + (Int16)operand + (C ? 1 : 0);
    A = sum;
    C = (sum > 0xff);
    notZ = A;
    N = A & 0x80;
  }
  else
  {
    Int16 sum = ourBCDTable[0][A] + ourBCDTable[0][operand] + (C ? 1 : 0);

    C = (sum > 99);
    A = ourBCDTable[1][sum & 0xff];
    notZ = A;
    N = A & 0x80;
    V = ((oldA ^ A) & 0x80) && ((A ^ operand) & 0x80);
  }
}
break;

case 0x7b:
{
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



