dynamite_reed [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=13352 pset implementation <p>Just out of curiosity, how close does my attempt to implement pset() come to the built-in version? Mine appears to be slower.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> 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 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=3521 https://www.lexaloffle.com/bbs/?tid=3521 Wed, 01 Jun 2016 00:13:26 UTC