3 ms·
This is incredible. It doesn't make any sense. How can you do that kind of display with 2½KiB of RAM? 320×240×8 bits for the framebuffer alone would be 75KiB.
by kragen 15y ago
This is incredible. It doesn't make any sense. How can you do that kind of display with 2½KiB of RAM? 320×240×8 bits for the framebuffer alone would be 75KiB. Is he re-decoding the images from the SD card with every screen redraw? At 12MIPS with an 8-bit ALU? Is there a couple hundred K of RAM hiding somewhere? I can't find the BOM.
- kragen 15y agoThere are a lot of details on his blog. http://rossum.posterous.com/zork-for-the-microtouch http://rossum.posterous.com/zork-for-the-microtouch explains that for the Zork Z-machine, he pages to the MicroSD card: > Because the microtouch only has 2.5k of memory, all Z-machine memory is virtual, including its stack. 3 layers of caching of different granularities were required to get reasonable performance. A page file on the microSD card ("p.pge") acts as its backing store. By default the app loads "game.z5" game but will play most non v6 games: just change their name and copy to the microSD. Doesn't explain how the hell he gets a high-resolution proportional font to draw on the display, though. Upon further digging, it looks like the LCD controller must contain a framebuffer, with 16-bit TrueColor, so 150KiB of RAM. Take a look at https://github.com/rossumur/microtouch/blob/master/src/hardware/LCD_Microtouch.cpp#L207 https://github.com/rossumur/microtouch/blob/master/src/hardw.... From http://www.adafruit.com/datasheets/ILI9325.pdf http://www.adafruit.com/datasheets/ILI9325.pdf, "ILI9325 is a 262,144-color one-chip SoC driver for a-TFT liquid crystal display with resolution of 240RGBx320 dots, comprising a 720-channel source driver, a 320-channel gate driver, 172,800 bytes RAM for graphic data of 240RGBx320 dots, and power supply circuit." I wonder why he didn't page onto the framebuffer instead of the MicroSD card. It seems like kind of a waste to have 168¾KiB of RAM in a computer and only 2½KiB of it used by the CPU. The LCD driver actually uses 18-bit TrueColor; if you just used the low-order bit in the blue channel, you'd have an extra 9600 bytes. ☺ With that mystery resolved, the font is straightforward: it's a bunch of bitmaps in the program Flash which get blitted into graphics RAM to draw characters.