You are reading a single comment by @russdx and its replies. Click here to read the full conversation.
  • Hey

    Wow that's pretty cool to see it running on the web ide :)

    Regards to the json parser I did not actually know there was a native one! I will definitely use it know I know it exists :) (I did come across it in node js and just assumed it was a node js thing did not know it was a standard javascript method hehe)

    I have almost got it working with the removed html canvas :) still working on that canvasCopy method (not quite working right lol) Hopefully finish it off tomorrow in work. But it still all runs fast and is looking good and is using pure byte arrays now :D not relying on html canvas which is nice if I ever wanted to port this to another language.

  • Great to hear... what I though think is that the array/buffer part should be in a separate class. The way the code works now, is preparing everything in a buffer on bit level - actually rendering the characters - and then all that data - bit image buffer - is sent to the display system (Canvas). This may get short handed on memory, because the setup is not taking advantage of the display controller's buffer / memory and processing and function power (the controller implements quite powerful render operations, including scrolling).

    Refactoring the bit to buffer code into its own class enables it to be easily replaced with the display's buffer and code.. If the controller has not the desirable font(s) and no way to upload them, one character is rendered at a time and then shipped as a bit image... I know for sure that with a display with 16 bits of color (actually 24 bits when going through the Espruino Graphics interface) per bit and a much higher dot density than a LED panel, it is becoming a lot of bits... just as @Gordon mentioned (The display I have is a 2.8" diagonal TFT LCD with 320x240 pixels, a pixel density of about 138 dpi, where as with 5mm LEDs on the panel you end up with 5 dpi. Even with the adjustment of the viewing distance, dpi ratio is still between 3..5 to 1 for LCD vs. LED.)

    The display controller's buffer can be seen as the (or canvas / context) which understands most importantly text drawing commands: just sending the ASCII string together with foreground and background color information, font size information, and may be font type id, and position is sufficient. I know already for sure that I cannot have 3 bytes per bit in buffers if I want to run simultaneously also other code and and data in the main processor's memory.

About

Avatar for russdx @russdx started