atari_py/ale_interface/src/emucore/m6502/src/M6502Hi.ins [1849:1887]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
{
  operand = operand + 1;
  poke(operandAddress, operand);

  uInt8 oldA = A;

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

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

    if(difference < 0)
      difference += 100;

    A = ourBCDTable[1][difference];
    notZ = A;
    N = A & 0x80;

    C = (oldA >= (operand + (C ? 0 : 1)));
    V = ((oldA ^ A) & 0x80) && ((A ^ operand) & 0x80);
  }
}
break;

case 0xf7:
{
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



atari_py/ale_interface/src/emucore/m6502/src/M6502Low.ins [1859:1897]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}
{
  operand = operand + 1;
  poke(operandAddress, operand);

  uInt8 oldA = A;

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

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

    if(difference < 0)
      difference += 100;

    A = ourBCDTable[1][difference];
    notZ = A;
    N = A & 0x80;

    C = (oldA >= (operand + (C ? 0 : 1)));
    V = ((oldA ^ A) & 0x80) && ((A ^ operand) & 0x80);
  }
}
break;

case 0xf7:
{
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



