/* Creates an image and palette based off of an image from http://www.effectgames.com/demos/canvascycle/ You just need to open devtools and find the `CanvasCycle.processImage` call, then create a file for it. eg. http://www.effectgames.com/demos/canvascycle/image.php?file=V29&callback=CanvasCycle.processImage Finally cycles just needs adding */ var CanvasCycle = { processImage : function(info) { const IMG1_HEIGHT = 55; const IMG2_HEIGHT = 240-(24+55); var img1 = Buffer.alloc(240*IMG1_HEIGHT); var img2 = Buffer.alloc(240*IMG2_HEIGHT); var n=0; /* img.writeUInt8(240, n++); img.writeUInt8(240, n++); img.writeUInt8(8, n++);*/ var pal = Buffer.alloc(256*2); for (var i=0;i>3); pal.writeUInt16LE(p, i*2); } function getPixel(x,y) { return info.pixels[(x+640-240)+((y+480-240)*640)]; } n = 0; for (var y=0;y