Log In  

@dynamite_reed

Follow
Follow

Just out of curiosity, how close does my attempt to implement pset() come to the built-in version? Mine appears to be slower.

function my_pset(x, y, c)
  addr = 0x6000 + shr(x, 1) + shl(y, 6)
  old_val = peek(addr)

  if (band(1, x) == 0) then
    new_val = c + band(0xf0, old_val)
  else
    new_val = shl(c, 4) + band(0x0f, old_val)
  end

  poke(addr, new_val)
end
P#22009 2016-06-01 00:13 ( Edited 2016-06-02 23:40)

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-10-23 04:45 | 0.059s | 2097k | Q:10