

GameBoy Emulation in JavaScript: The CPU (2010) - hias
http://imrannazar.com/GameBoy-Emulation-in-JavaScript

======
nielskrijger
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?

