I don't believe the module was copied from anywhere else (apart from perhaps the initialisation codes, but they have since been tweaked). I'm not sure the screen itself does much fancy stuff either - it's down to the graphics library in Espruino to do stuff before sending to the screen.
Clear an area is just fillRect(..) with the colour set to 0, but scrolling is something I've wanted to do in the Graphics lib for a while - it'd be good if someone would add it (but it'd need doing in C code).
The VT100 terminal module already does some simple scrolling with new Uint8Array(this.g.buffer).set(new Uint8Array(this.g.buffer, stride), 0);
new Uint8Array(this.g.buffer).set(new Uint8Array(this.g.buffer, stride), 0);
Making stride = g.getWidth() will scroll 8 pixels vertically, and making it 1 will scroll by 1 pixel horizontally. To scroll vertically by less than 8 pixels will require some fun with shifting, which will be pretty slow if done in JS.
stride = g.getWidth()
© Espruino, powered by microcosm.
Report a problem