Spiffy Hacks
Homebrew creation for innotab - Printable Version

+- Spiffy Hacks (https://spiffyhacks.com)
+-- Forum: Vtech InnoTab (https://spiffyhacks.com/forum-1.html)
+--- Forum: General Info, FAQ and Downloads (https://spiffyhacks.com/forum-15.html)
+--- Thread: Homebrew creation for innotab (/thread-421.html)



Homebrew creation for innotab - rioray - 12-26-2014

Hi ,

Just new on the hardware and i try to figure out how to make homebrew for innotab2.
and i have some questions to the dev here.

for now i know a little about the hardware, firmware, sqlite part ...
and i have found on github the Source Code Release for the VTech InnoTab
(don't know if it apply to innotab 2 as well)

Is there any other sdk to start to build homebrew on the device ?
which library must i use ? how access fb (i mean other than use lcdterm) .
I've already the arm-2010q1-188 toolchain , must i update to another one ?

i have saw the video of scummvm port , is there any source code to look at ?

if someone here can point me in the good direction it will be nice .

thanks in advance.


RE: Homebrew creation for innotab - mifille - 12-27-2014

to ask questions to dev i think you should try to contact them on irc channel. contact isomick or deak phreak....


RE: Homebrew creation for innotab - rioray - 12-28-2014

(12-27-2014, 03:39 AM)mifille Wrote: to ask questions to dev i think you should try to contact them on irc channel. contact isomick or deak phreak....

thks for replying , i went on irc but hard to find isomick or deak.

i was able to build and execute some hombrew ( sdl sample ) , fprintf show me fct works but nothing appear on screen. (blink/ black screen/loading screen then retrun ) so i hope find isomick to ask him how i did for scummvm .


RE: Homebrew creation for innotab - mifille - 12-28-2014

have you seen there's a yahoogroup for inotab?

it's old but iso was talking about scummvm on it.


RE: Homebrew creation for innotab - rioray - 12-28-2014

(12-28-2014, 11:25 AM)mifille Wrote: have you seen there's a yahoogroup for inotab?

it's old but iso was talking about scummvm on it.

yeah i found it when doing search for innotab ,
my main pb now at that my app show up less than 1 sec and then screen become black , then loading screen...
but in that second , i can see my sdlscreen , so sdl code work and touch (tslib) log are done ,
now i will wait (here and irc) that some other dev show me how they did to have screen fully working
(i mean maybe tweak _Run to kill other process that can cause my main pb)
BTW thanks for help and reply .


RE: Homebrew creation for innotab - mifille - 12-28-2014

ok, hope you 'll find isomick on irc.


RE: Homebrew creation for innotab - Deak Phreak - 12-28-2014

Sorry I am not as technical as mick so I am not familiar with creating things from scratch. I'd try to catch him on IRC. He does not use the forums.


RE: Homebrew creation for innotab - rioray - 12-29-2014

thanks ,

I  finaly got him on IRC and he point me (by giving me his SDL moded source code) how to build an SDL sample working .
i point me also he use /dev/disp0 and chunkMem in his fbconv SDL video driver .  So big thank Mick .

finaly i respond to myself and post the basic to setup an basic framebuffer using /dev/disp0 , maybe usefull for someone else.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>

#include <sys/types.h>
#include <sys/ioctl.h>

#include "mach/gp_display.h"
#include "mach/gp_chunkmem.h"

#include <tslib.h>

#define XRATIO 1.0f //1.5f
#define YRATIO 1.0f //1.134f

#define SCREEN_WIDTH  480
#define SCREEN_HEIGHT 272
#define SCREEN_DEPTH 16

#define BMP_WIDTH  SCREEN_WIDTH
#define BMP_HEIGHT SCREEN_HEIGHT
#define BMP_DEPTH  SCREEN_DEPTH

#define RGB565(r, g, b)  (((r) << (5+6)) | ((g) << 6) | (b))

#include "graph.h"

#define CLEAR(x) memset (&(x), 0, sizeof (x))

int main( int argc, char* args[] )
{
int done = 0;

/* dips variable */
int dispDev;
int chunkMem;
chunk_block_t priBlk;
gp_disp_res_t panelRes;
gp_bitmap_t priBitmap;
UINT16 *data;

/* tslib init */
char *tsdevice=NULL;
struct tsdev *ts;
if( (tsdevice = getenv("TSLIB_TSDEVICE")) != NULL ) {
ts = ts_open(tsdevice,0);
} else {
ts = ts_open("/dev/input/event0", 0);
}
if (!ts) {
perror("ts_open");
exit(1);
}
if (ts_config(ts)) {
perror("ts_config");
exit(1);
}

/* Opening the device dispDev */
dispDev = open("/dev/disp0",O_RDWR);
fprintf(stderr,"dispDev = %d\n", dispDev);

ioctl(dispDev, DISPIO_SET_INITIAL, 0);
ioctl(dispDev, DISPIO_GET_PANEL_RESOLUTION, &panelRes);

/* Opening /dev/chunkmem */
chunkMem = open("/dev/chunkmem", O_RDWR);

/* Allocate primary frame buffer */
priBlk.size = (BMP_WIDTH) * (BMP_HEIGHT) *2;
ioctl(chunkMem, CHUNK_MEM_ALLOC, (unsigned long)&priBlk);

/* Set primary layer bitmap */
priBitmap.width = panelRes.width;
priBitmap.height = panelRes.height;
priBitmap.bpl = panelRes.width*2;
priBitmap.type = SP_BITMAP_RGB565;
priBitmap.pData = priBlk.addr;

ioctl(dispDev, DISPIO_SET_PRI_BITMAP, &priBitmap);

/* Enable primary layer */
ioctl(dispDev, DISPIO_SET_PRI_ENABLE, 1);
ioctl(dispDev, DISPIO_SET_UPDATE, 0);


while(done==0){

/* fill primary bitmap */
Draw_string((char*)priBitmap.pData, 50, 50,"Hello World innotab!", 20, 1, 2,0xffff,0x8080);
DrawBoxBmp((char*)priBitmap.pData,40,40, 200,40, RGB565(31, 11, 7));
DrawCircle((char*)priBitmap.pData,200, 100, 25,RGB565(31, 31, 31),1);
DrawFBoxBmp((char*)priBitmap.pData,50,100,100,50,RGB565(31, 0, 0));
DrawlineBmp((char*)priBitmap.pData,20,256,460,258,RGB565(0, 31, 0));

/* update and wait frame end */
ioctl(dispDev, DISPIO_SET_PRI_BITMAP, &priBitmap);
ioctl(dispDev, DISPIO_SET_PRI_ENABLE, 1);
ioctl(dispDev, DISPIO_SET_UPDATE, 0);
ioctl(dispDev, DISPIO_WAIT_FRAME_END, 0);


/* update tslib and exit if touch*/
struct ts_sample samp;
int ret;
ret = ts_read(ts, &samp, 1);
if (ret < 0) {
perror("ts_read");
goto fin;
}
if (ret != 1)
continue;

if (samp.pressure > 0)
fprintf(stderr,"%ld.%06ld: %6d %6d %6d\n", samp.tv.tv_sec, samp.tv.tv_usec,samp.x, samp.y, samp.pressure);

int SX=(int)(samp.x/XRATIO);
int SY=(int)(samp.y/YRATIO);
if(SX>50 && SX<150 && SY>100 && SY<200)done=1;

}

fin:

close(dispDev);

ioctl(chunkMem, CHUNK_MEM_FREE, (unsigned long)&priBlk);
close(chunkMem);

return 0;
}



RE: Homebrew creation for innotab - Deak Phreak - 12-29-2014

Thanks. If you get in to it further and want to write up a tutorial for others, I will be glad to pin it or put a link to it in the FAQ.


RE: Homebrew creation for innotab - emilie56 - 01-05-2018

bonjour
merci pour l acceptation
je viens d acquérir une storio 2 et j'ai qqs questions pour récupérer des jeux