Author Topic: Compatibility with the Ben Nanonote  (Read 2347 times)

zear (OP)

  • * Moderator
  • Posts: 2381
Compatibility with the Ben Nanonote
« on: November 22, 2009, 08:28:21 pm »
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):
Code: [Select]
#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:
Code: [Select]
hw_screen = SDL_SetVideoMode (width, height, get_screen_depth(16), sdl_flags);

eule

  • * Former Staff
  • Posts: 889
Re: Compatibility with the Ben Nanonote
« Reply #1 on: November 22, 2009, 09:28:07 pm »
Wow, that is awesome! Very nice to see more devices with an ingenics cpu AND Linux. Hope to see more of these, maybe even more powerful ones.

vimrc

  • Posts: 66
Re: Compatibility with the Ben Nanonote
« Reply #2 on: November 22, 2009, 09:39:42 pm »
Nice, I am quite interested if they have fixed the 8bpp problem in fb driver of linux. Using SDL function is
not efficient indeed.

Meneer Jansen

  • Posts: 511
Re: Compatibility with the Ben Nanonote
« Reply #3 on: November 23, 2009, 01:59:31 pm »
What a cool little thingy! For ~100 USD. I want one!
Finally got me a new Dingoo after I Kentucky ~~::fried::~~ the other one. Yippee! [edit] And lost it!

eule

  • * Former Staff
  • Posts: 889
Re: Compatibility with the Ben Nanonote
« Reply #4 on: November 23, 2009, 02:23:42 pm »
Some more facts about the Nanonote, Dingoo-compatibility and Ingenics CPUs:
http://lists.qi-hardware.com/pipermail/developer/2009-August/000236.html
and here: http://www.qi-hardware.com/blog/  :D
« Last Edit: November 23, 2009, 02:27:41 pm by eule »