Hacker News new | past | comments | ask | show | jobs | submit | ollien's favorites login

Hey,

  SBC:
    result = byte1 - byte2 - carry
    carry = result < 0
    return result & 0xff

  ADC:
    result = byte1 + byte2 + carry
    carry = result > 0xff
    return result & 0xff
Source - my implementation, passes tests. Look for SBC & ADC in https://github.com/trekawek/coffee-gb/blob/master/src/main/j...

Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: