Due to my interest in retrogaming, I decided to write some code to talk directly to those inexpensive little 240x320 SPI LCD displays which use the ILI9341 controller. For my purposes, my game emulator code draws directly on the LCD, bypassing the framebuffer and its inherent latencies and limitations. My current game project (soon to be released) uses smart buffer management (dirty tiles) and hardware scrolling to achieve a steady 60fps output from many games. I've written emulators for NES, Genesis, TG16, GameBoy, GameGear/SMS and many coin-op titles. Today I'm releasing my ili9341 code which has the following features:
- Works in both landscape and portrait orientation
- Two sizes of text drawing with custom fg/bg color
- Fast 16x16 tile drawing for gaming
- Hardware scrolling (vertical/portrait direction only)
- Single pixel drawing
- Portable C code with wrapper functions for I/O; easy to compile on any system
- Uses either wiringPi, bcm2835, or PIGPIO to access SPI/GPIO
I will be releasing my game emulators (soon) which support this type of display and traditional framebuffer/SDL2/GTK output.
The git repo can be found here:
Here's an early video of my Pac-Man and Dig Dug (coin-op) emulators running with wiringPi (effectively 7fps of throughput), but getting 60fps through smart buffer management:
I welcome any and all feedback.