from Hacker News

GameBoy Emulation in JavaScript: The CPU (2010)

by hias on 5/26/15, 6:43 AM with 1 comments

  • by nielskrijger on 5/26/15, 6:18 PM

    Really?

        CPr_b: function() {
            var i = Z80._r.a;                          // Temp copy of A
            i -= Z80._r.b;                             // Subtract B
            Z80._r.f |= 0x40;                          // Set subtraction flag
            if(!(i & 255)) Z80._r.f |= 0x80;           // Check for zero
            if(i < 0) Z80._r.f |= 0x10;                // Check for underflow
            Z80._r.m = 1; Z80._r.t = 4;                // 1 M-time taken
        }
    
    Who anybody other than a machine will be able to make sense of that?