Low latency game emulation on SPI LCD

Want to show off your own project? Want to keep a build log of it? Post it here!
Post Reply
bitbank
Posts: 6
Joined: Tue May 09, 2017 4:49 pm
Been thanked: 10 times

Low latency game emulation on SPI LCD

Post by bitbank » Thu Jun 29, 2017 10:41 am

My SmartGear/RPi project is starting to take shape. In this video, I'm running on a RPi0W with Shea Silverman's PiPlay Portable board to provide the buttons and sound circuit (I'm using a SteelSeries:Free for input since it allowed me to hold my cell phone in one hand to film it):

https://www.youtube.com/watch?v=J5SsFpn1SG8

The display is a 4-wire SPI ili9341 running at 32Mhz. Since I don't rely on fbtft nor fbcp, there is virtually zero lag in the display, input and audio. I also control the pixel scaling, so the results come out better than using fbcp (which uses dispmanx to scale /dev/fb0 down to /dev/fb1).

I haven't released it as open source yet, but I'm getting closer to that day.

Comments/ideas?

codeman0624
Posts: 109
Joined: Wed Nov 23, 2016 10:19 am
Has thanked: 3 times
Been thanked: 74 times

Re: Low latency game emulation on SPI LCD

Post by codeman0624 » Fri Jun 30, 2017 7:06 am

bitbank wrote:
Thu Jun 29, 2017 10:41 am
My SmartGear/RPi project is starting to take shape. In this video, I'm running on a RPi0W with Shea Silverman's PiPlay Portable board to provide the buttons and sound circuit (I'm using a SteelSeries:Free for input since it allowed me to hold my cell phone in one hand to film it):

https://www.youtube.com/watch?v=J5SsFpn1SG8

The display is a 4-wire SPI ili9341 running at 32Mhz. Since I don't rely on fbtft nor fbcp, there is virtually zero lag in the display, input and audio. I also control the pixel scaling, so the results come out better than using fbcp (which uses dispmanx to scale /dev/fb0 down to /dev/fb1).

I haven't released it as open source yet, but I'm getting closer to that day.

Comments/ideas?
I'm not sure I fully understand what this means, but it certainly seems interesting! Are you saying you built a driver to essentially increase the refresh rate and response time of a SPI based display? How would anyone else implement this into their project?

bitbank
Posts: 6
Joined: Tue May 09, 2017 4:49 pm
Been thanked: 10 times

Re: Low latency game emulation on SPI LCD

Post by bitbank » Fri Jun 30, 2017 7:40 am

codeman0624 wrote:
Fri Jun 30, 2017 7:06 am
I'm not sure I fully understand what this means, but it certainly seems interesting! Are you saying you built a driver to essentially increase the refresh rate and response time of a SPI based display? How would anyone else implement this into their project?
Yes, your interpretation is correct. I've open-sourced my SPI LCD code here:

https://github.com/bitbank2/SPI_LCD

It allows you to write code to talk directly to the LCD instead of going through layers of Linux drivers. It includes code to initialize the display, draw text, rectangles, pixels and image tiles. My emulator uses the image tile function to update the display for games.

I've written a function between my game emulator and this code which compares the current frame to the previous (based on dirty-tiles) and only sends the minimum set of changes to the display. This allows a 30fps (or slower) connection to display 50-60fps output (for many games).

I'm happy to share the object code for anyone to try. The source code I need to divide up into parts that I can release publicly and parts that must stay private.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest