You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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).

    If you don't want to touch C, you can do some stuff in JavaScript by accessing the buffer - the only gotcha is that the pixels are stored in 8 pixel vertical strips.

    The VT100 terminal module already does some simple scrolling with 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.


Avatar for Gordon @Gordon started