As probably some of you heard already, there is a new device called
Ben Nanonote.
It uses the same hardware as the Dingoo and is binary compatibile with it.
I confirmed that the dingux game ports work on it almost out-of-the-box.
It uses the same resolution (320x240). The only problem I encountered was the color depth. Dingoo's LCD uses 16bpp, and Nanonote 32bpp.
A Nanonote developer
larsc from #
[email protected] found an easy way to make the dingux games fully compatibile with that device.
Here's the colordepth autodetection code he proposed (and we confirmed it works):
#include <unistd.h>
#include <fcntl.h>
unsigned int get_screen_depth(unsigned int def)
{
int fd;
ssize_t ret;
char buffer[3];
fd = open("/sys/class/graphics/fb0/bits_per_pixel", 0);
if (fd < 0)
return def;
ret = read(fd, buffer, 2);
close(fd);
if (ret != 2)
return def;
buffer[2] = 0;
return atoi(buffer);
}
Using it is as simple as calling that function later in the code:
hw_screen = SDL_SetVideoMode (width, height, get_screen_depth(16), sdl_flags);