Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 03-21-2013, 10:40 AM   #256
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021146
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by hawhill View Post
Nice! Need to invest some time into this... Reliable key repeat is kind of an issue. Though - is it really needed? The K3 version doesn't implement some kind of repeat either. Maybe the handling of multitouch needs a bit of love?
I will dig out my x build then ?
twobob is offline   Reply With Quote
Old 03-22-2013, 10:55 PM   #257
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021146
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Had another dig round in my x build.

sys/x11/xlib.c apprears to be where the dithering action is.

I shoved a bunch of code in and played around but am a bit tired now.


Commented a bunch of stuff out - this is a mess really but you can see what I was trying to achieve at least. probably.
Spoiler:

PHP Code:
/*
 * xlib.c
 *
 *  Created on: 29 Nov 2012
 *      Author: twobobble mangling stuff
 */
/*
 * xlib.c
 *
 * Xlib interface.
 * dist under gnu gpl
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#if defined(HAVE_LIBXEXT) && defined(HAVE_X11_EXTENSIONS_XSHM_H) && defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SHM_H)
#define USE_XSHM
#endif
#else
#define USE_XSHM  /* assume we have shm if no config.h - is this ok? */
#endif

#ifdef USE_XSHM
/* make sure ipc.h and shm.h will work! */
#define _SVID_SOURCE
#define _XOPEN_SOURCE
#endif

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>

#ifdef USE_XSHM
#include <X11/extensions/XShm.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#endif

#include <linux/fb.h>

// just to make the compiler happy
#include <asm/types.h>
typedef __u8 u8;

#include <einkfb.h>

#include "fb.h"
#include "input.h"
#include "rc.h"


int fd = -1;
int xoffs =0;
int yoffs =0;
uint8_t *fbdata NULL;
uint8_t *fbtemp NULL;
struct fb_fix_screeninfo finfo;
struct fb_var_screeninfo vinfo
uint32_t c;

uint8_t odither_e[] = { 0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F0x0F,
0x0F0x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x00 };
uint8_t odither_o[] = { 0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF0xFF,
0xFF0xFF0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF00xF0,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x000x00,
0x000x000x000x000x000x000x000x000x000x000x000x00 };




struct fb fb;

static 
int vmode[3] = { 00};
static 
int x_shmsync 1;

rcvar_t vid_exports[] =
{
    
RCV_VECTOR("vmode", &vmode3),
    
RCV_BOOL("x_shmsync", &x_shmsync),
    
RCV_END
};


static 
int initok;

/* Loads of bogus Xlib crap...bleh */

static char *x_displayname;

static 
Display *x_display;
static 
int x_screen;

static 
struct
{
    
int bits;
    
int vc;
    
int bytes;
x_vissup[] =
{
    { 
8PseudoColor},
    { 
15TrueColor},
    { 
16TrueColor},
    { 
32TrueColor},
    { 
24TrueColor},
    { 
00}
};

static 
int x_bitsx_bytes;
static 
Visual *x_vis;
static 
XVisualInfo x_visinfo;
static 
int x_pseudo;
static 
Colormap x_cmap;
static 
XColor x_ctable[256];

static 
int x_wattrmask;
static 
XSetWindowAttributes x_wattr;
static 
int x_gcvalmask;
static 
XGCValues x_gcval;

static 
Window x_win;
static 
int x_win_xx_win_y;
static 
int x_widthx_height;
static 
GC x_gc;

static 
XSizeHints x_size;
static 
XWMHints x_wmhints;
/*static XClassHint x_class;*/

#ifdef USE_XSHM
static XShmSegmentInfo x_shm;
#endif

static int x_useshm;
static 
int x_shmevent;
static 
int x_shmdone;
static 
XImage *x_image;
static 
int x_byteswap;

static 
XEvent x_ev;




static 
void freescreen()
{
    if (!
initok || !x_image) return;
    if ((
char *)fb.ptr != (char *)x_image->data)
        
free(fb.ptr);
#ifdef USE_XSHM
    
if (x_useshm)
    {
        
/* FIXME - is this the right way to free shared mem? */
        
XSync(x_displayFalse);
        if (!
XShmDetach(x_display, &x_shm))
            die (
"XShmDetach failed\n");
        
XSync(x_displayFalse);
        
shmdt(x_shm.shmaddr);
        
shmctl(x_shm.shmidIPC_RMID0);
        
x_image->data NULL;
    }
#endif
    
free(x_image);
    
x_image NULL;
    
fb.ptr NULL;
}

static 
void allocscreen()
{
    if (
initokfreescreen();
#ifdef USE_XSHM
    
if (x_useshm)
    {
        
x_image XShmCreateImage(
            
x_displayx_visx_bitsZPixmap0,
            &
x_shmx_widthx_height);
        if (
x_image)
        {
            
x_shm.shmid shmget(
                
IPC_PRIVATE,
                
x_image->bytes_per_line x_image->height,
                
IPC_CREAT 0777);
            if (
x_shm.shmid 0)
                die(
"shmget failed\n");
            
x_image->data x_shm.shmaddr =
                
shmat(x_shm.shmid00);
            if (!
x_image->data)
                die(
"shmat failed\n");
            if (!
XShmAttach(x_display, &x_shm))
                die(
"XShmAttach failed\n");
            
XSync(x_displayFalse);
            
x_shmdone 1;
            
fb.pitch x_image->bytes_per_line;
        }
        else
        {
            
x_useshm 0;
        }
    }
#endif
    
if (!x_useshm)
    {
        
x_image XCreateImage(
            
x_displayx_visx_bitsZPixmap0,
            
malloc(x_width*x_height*x_bytes),
            
x_widthx_heightx_bitsx_width*x_bytes);
        if (!
x_image)
            die(
"XCreateImage failed\n");
    }
    
x_byteswap x_image->byte_order ==
#ifdef IS_LITTLE_ENDIAN
        
MSBFirst
#else
        
LSBFirst
#endif
        
;
    if (
x_byteswap && x_bytes 1)
        
fb.ptr malloc(x_image->bytes_per_line x_image->height);
    else
        
fb.ptr = (byte *)x_image->data;
}



void vid_resize()
{
    
freescreen();
    
x_width fb.w;
    
x_height fb.h;
    
XResizeWindow(x_displayx_winx_widthx_height);
    
x_size.flags PSize PMinSize PMaxSize;
    
x_size.min_width x_size.max_width x_size.base_width x_width;
    
x_size.min_height x_size.max_height x_size.base_height x_height;
    
XSetWMNormalHints(x_displayx_win, &x_size);
    
XSync(x_displayFalse);
    
allocscreen();
}


static 
void colorshifts()
{
    
int i;
    
int mask[3];
    
int lc;

    
mask[0] = x_vis->red_mask;
    
mask[1] = x_vis->green_mask;
    
mask[2] = x_vis->blue_mask;

    for (
03i++)
    {
        for (
032 && !((1<<l) & mask[i]); l++);
        for (
0l+32 && ((1<<(l+c)) & mask[i]); c++);
        
fb.cc[i].l;
        
fb.cc[i].8-c;
    }
}


void vid_preinit()
{
    
/* do nothing; only needed on systems where we must drop perms */
}

void vid_init()
{
    
int i;


/* me */
fbtemp = (uint8_t*) malloc(144*160);
    if (!
fbtemp) {
        
fprintf(stderr"Error: can't claim shadow fb mem\n");
        exit(
1);
    }

/* open framebuffer */
    
fd open("/dev/fb0"O_RDWR);
    if (
fd == -1) {
        
perror("framebuffer");
        exit(
1);
    }

    
/* initialize data structures */
    
memset(&finfo0sizeof(finfo));
    
memset(&vinfo0sizeof(vinfo));

    
/* Get fixed screen information */
    
if (ioctl(fdFBIOGET_FSCREENINFO, &finfo)) {
        
perror("Error: get screen info");
        exit(
1);
    }

    if (
finfo.type != FB_TYPE_PACKED_PIXELS) {
        
fprintf(stderr"Error: video type not supported\n");
        exit(
1);
    }

    if (
ioctl(fdFBIOGET_VSCREENINFO, &vinfo)) {
        
perror("Error: get variable screen info");
        exit(
1);
    }

    if (!
vinfo.grayscale) {
        
fprintf(stderr"Error: only grayscale is supported\n");
        exit(
1);
    }

    if (
vinfo.bits_per_pixel != && vinfo.bits_per_pixel != 8) {
        
fprintf(stderr"Error: only 4/8BPP is supported for now\n");
        exit(
1);
    }

    
fprintf(stderr"%d bpp\n"vinfo.bits_per_pixel);
    
    if (
vinfo.xres <= || vinfo.yres <= 0) {
        
fprintf(stderr"Error: checking resolution, cannot use %dx%d.\n"vinfo.xresvinfo.yres);
        exit(
1);
    }

    
fprintf(stderr"resolution, is %dx%d.\n"vinfo.xresvinfo.yres);

    
/* mmap the framebuffer */
    
fbdata mmap(0finfo.smem_lenPROT_READ PROT_WRITEMAP_SHAREDfd0);
    if(
fbdata == MAP_FAILED) {
        
perror("mmap framebuffer");
    }
    
memset(fbdata0x00finfo.line_length*vinfo.yres);



/* end me */

    
if (initok) return;

    
x_displayname getenv("DISPLAY");
    if (!
x_displayname)
        die(
"DISPLAY environment variable not set\n");
    
x_display XOpenDisplay(NULL);
    if (!
x_display)
        die(
"failed to connect to X display\n");
    
x_screen DefaultScreen(x_display);

    for (
0x_vissup[i].bitsi++)
    {
        if (
XMatchVisualInfo(
            
x_displayx_screen,
            
x_vissup[i].bitsx_vissup[i].vc, &x_visinfo))
        {
            if (
x_vissup[i].vc == PseudoColor)
                
x_pseudo 1;
            else
                
x_pseudo 0;
            
x_bits x_vissup[i].bits;
            
x_bytes x_vissup[i].bytes;
            break;
        }
    }
    if (!
x_bits) die("no suitable X visuals\n");
    
x_vis x_visinfo.visual;
    if (!
x_vis) die("X visual is NULL");

    if (
x_pseudo)
    {
        
x_cmap XCreateColormap(
            
x_displayRootWindow(x_displayx_screen),
            
x_visAllocAll);
        for (
0256i++)
        {
            
x_ctable[i].pixel i;
            
x_ctable[i].flags DoRed|DoGreen|DoBlue;
        }
    }

    
x_wattrmask CWEventMask CWBorderPixel CWColormap;
    
x_wattr.event_mask KeyPressMask KeyReleaseMask ExposureMask
        
FocusChangeMask;
    
x_wattr.border_pixel 0;
    
x_wattr.colormap x_cmap;

    
x_gcvalmask GCGraphicsExposures;
    
x_gcval.graphics_exposures False;

    if (!
vmode[0] || !vmode[1])
    {
        
int scale rc_getint("scale");
        if (
scale 1scale 1;
        
vmode[0] = 160 scale;
        
vmode[1] = 144 scale;
    }

    
fb.vmode[0];
    
fb.vmode[1];
    
fb.pelsize x_bytes == x_bytes;
    
fb.pitch fb.fb.pelsize;
    
fb.indexed x_pseudo;
    
fb.enabled 1;
    
fb.dirty 0;

    
x_win_x x_win_y 0;
    
x_width fb.w;
    
x_height fb.h;
    
x_win XCreateWindow(
        
x_displayRootWindow(x_displayx_screen),
        
x_win_xx_win_yx_widthx_height0x_bits,
        
InputOutputx_visx_wattrmask, &x_wattr);
    if (!
x_win) die("could not create X window\n");

    
x_gc XCreateGC(x_displayx_winx_gcvalmask, &x_gcval);

    
x_size.flags PSize PMinSize PMaxSize;
    
x_size.min_width x_size.max_width x_size.base_width x_width;
    
x_size.min_height x_size.max_height x_size.base_height x_height;
    
XSetWMNormalHints(x_displayx_win, &x_size);

    
x_wmhints.initial_state NormalState;
    
x_wmhints.input True;
    
x_wmhints.flags StateHint InputHint;
    
XSetWMHints(x_displayx_win, &x_wmhints);

    
/* FIXME - set X class info stuff (with XSetClassHint)... */

    
XMapWindow(x_displayx_win);

    for(;;)
    {
        
XNextEvent(x_display, &x_ev);
        if (
x_ev.type == Expose && !x_ev.xexpose.count)
            break;
    }

    
XSetInputFocus(x_displayx_winRevertToPointerRootCurrentTime);

#ifdef USE_XSHM
    
if (XShmQueryExtension(x_display) && x_displayname[0] == ':')
    {
        
x_useshm 1;
        
x_shmevent XShmGetEventBase(x_display) + ShmCompletion;
    }
#endif

    
colorshifts();
    
allocscreen();

    
joy_init();

    
initok 1;


    
xoffs = (vinfo.xres vmode[0]) / 2;
    
yoffs = (vinfo.yres vmode[1]) / 2;
    
fprintf(stderr"x_image->bytes_per_line %d \n",x_image->bytes_per_line);
    
fprintf(stderr"x_image->height %d \n",x_image->height);
    
fprintf(stderr"finfo.line_length %d \n",finfo.line_length);
    
fprintf(stderr"vmode[0] %d \n",vmode[0]);
    
fprintf(stderr"vmode[1] %d \n",vmode[1]);
    
fprintf(stderr"vinfo.xres  %d \n",vinfo.xres );
    
fprintf(stderr"vinfo.yres  %d \n",vinfo.yres );
    
fprintf(stderr"xoffs  %d \n",xoffs );
    
fprintf(stderr"yoffs  %d \n",yoffs );
    
fprintf(stderr"x_byteswap && x_bytes >1  %d \n",x_byteswap && x_bytes );
    
fprintf(stderr"x_bytes %d \n",x_bytes );



}

void vid_close()
{
    
joy_close();
    if (!
initok) return;
    
freescreen();
    
XFreeGC(x_displayx_gc);
    
XDestroyWindow(x_displayx_win);
    
XCloseDisplay(x_display);
    
initok 0;
}



/* keymap - mappings of the form { keysym, localcode } - from x11/keymap.c */
extern int keymap[][2];

static 
int mapxkeycode(int xkeycode)
{
    
int i;
    
int sym;
    
int code;

    
sym XKeycodeToKeysym(x_displayxkeycode0);
    for (
0keymap[i][0]; i++)
        if (
keymap[i][0] == sym)
            return 
keymap[i][1];
    if (
sym XK_space || sym XK_asciitilde)
        return 
0;
    
code sym XK_space ' ';
    if (
code >= 'A' && code <= 'Z')
        
code tolower(code);;
    return 
code;
}


void vid_end();

static 
int nextevent(int sync)
{
    
event_t ev;

    if (!
sync && !XPending(x_display))
        return 
0;

    
XNextEvent(x_display, &x_ev);
    switch(
x_ev.type)
    {
    case 
KeyPress:
        
ev.type EV_PRESS;
        
ev.code mapxkeycode(x_ev.xkey.keycode);
        break;
    case 
KeyRelease:
        
ev.type EV_RELEASE;
        
ev.code mapxkeycode(x_ev.xkey.keycode);
        break;
    case 
Expose:
        
vid_end();
        return 
1;
        break;
    default:
        if (
x_ev.type == x_shmeventx_shmdone 1;
        return 
1;
        break;
    }
    return 
ev_postevent(&ev);  /* returns 0 if queue is full */
}



void ev_poll()
{
    while (
nextevent(0));
    
joy_poll();
}



void vid_settitle(char *title)
{
    
//XStoreName(x_display, x_win, title);
    
XStoreName(x_displayx_win"L:A_N:application_ID:xgnuboy_PC:N");
    
XSetIconName(x_displayx_wintitle);
}


void vid_setpal(int iint rint gint b)
{
    if (!
initok) return;

    if (
x_pseudo == 1)
    {
        
x_ctable[i].red << 8;
        
x_ctable[i].green << 8;
        
x_ctable[i].blue << 8;
        
XStoreColors(x_displayx_cmapx_ctable256);
    }
}

void vid_begin()
{
    if (!
x_useshm) return;

    
/* XSync(x_display, False); */
    
while (!x_shmdone && x_shmsync)
        
nextevent(1);
}

static 
void endianswap()
{

return;
    
int cnt;
    
un16 t16;
    
un32 t32;
    
un16 *src16 = (void *)fb.ptr;
    
un16 *dst16 = (void *)x_image->data;
    
un32 *src32 = (void *)fb.ptr;
    
un32 *dst32 = (void *)x_image->data;

    switch (
x_bytes)
    {
    case 
2:
        
cnt = (x_image->bytes_per_line x_image->height)>>1;
        while (
cnt--)
        {
            
t16 = *(src16++);
            *(
dst16++) = (t16 << 8) | (t16 >> 8);
        }
        break;
    case 
4:
        
cnt = (x_image->bytes_per_line x_image->height)>>2;
        while (
cnt--)
        {
            
t32 = *(src32++);
            *(
dst32++) = (t32 << 24) | ((t32 << 8) & 0x00FF0000) |
                ((
t32 >> 8) & 0x0000FF00) | (t32 >> 24);
        }
        break;
    }
}


void vid_end()
{

    
int xy;

    
uint8_t *dst_o;

int skip x_image->bytes_per_line//*2 - x_image->width * (vinfo.bits_per_pixel >> 2); // 480 * 2 - 480 * 1

    
if (!initok) return;

    if (
x_byteswapendianswap();

    
int cnt;
 
    
uint8_t  t8;

    
fb.ptr = (uint8_t*)x_image->data;
    
uint8_t *src = (void *)fb.ptr;

    
uint8_t *dst_e = (void *)x_image->data// + 0 + 0 * x_image->bytes_per_line;
    //dst_o = dst_e + finfo.line_length;

    
dst_o dst_e x_image->bytes_per_line 2;

    
//if(0 == c++ % 100) { /*frameskip*/
if(== 1) { /*frameskip*/

for(0<  x_image->heighty++) {
                for(
0<  x_image->widthx++) {
                    *
dst_e odither_e[*src] & 0xF0;
    
        
//    fprintf(stderr, "*src  %u \n",*src );
                    
*dst_e = *dst_e | (*dst_e >> 4);

        
//    fprintf(stderr, "dst_e  %u \n",dst_e );    
                    
dst_e++;
                    *
dst_e odither_e[*src] & 0x0F;

        
//    fprintf(stderr, "*src  %u \n",*src );
                    
*dst_e = *dst_e | (*dst_e << 4);

        
//    fprintf(stderr, "dst_e  %u \n",dst_e );    
                    
dst_e++;
                    *
dst_o odither_o[*src] & 0xF0;

        
//    fprintf(stderr, "*src  %u \n",*src );
                    
*dst_o = *dst_o | (*dst_o >> 4);

        
//    fprintf(stderr, "dst_o  %u \n",dst_o );    
                    
dst_o++;
                    *
dst_e odither_o[*src] & 0x0F;

        
//    fprintf(stderr, "*src  %u \n",*src );
                    
*dst_e = *dst_o | (*dst_o << 4);
    
    
//    fprintf(stderr, "dst_o  %u \n",dst_o );    
                    
dst_o++;
                    
src++;
//fprintf(stderr, "*src  %d \n",*src );
                
}
                
dst_e += skip;
                
dst_o += skip;


//        fprintf(stderr, "skip  %i \n",skip );

        
}

}
/*
    
        cnt = ((x_image->bytes_per_line*2) * x_image->height)>>2;
        while (cnt--)
        {
            t8 = *(src8++);
            *dst8 = odither_e[*src8] & 0xF0;
            *(dst8++) = (t8 << 4) | (t8 >> 4);

        }

*/


    
if (x_useshm)
    {
        if (!
x_shmdone) return;
#ifdef USE_XSHM
        
if (!XShmPutImage(
            
x_displayx_winx_gcx_image,
            
0000x_widthx_heightTrue))
            die(
"XShmPutImage failed\n");
#endif
        
x_shmdone 0;
fprintf(stderr"SHM Loop: x_height %i x_height %i \n",x_width,x_height);
    }
    else
    {
        
XPutImage(x_displayx_winx_gcx_image,
              
0000x_widthx_height); 
//fprintf(stderr, "Loop: count %i x_height %i x_height %i \n",c,x_width,x_height);
    
}

//    int skip = finfo.line_length*2 - 160 * (vinfo.bits_per_pixel >> 2);


//    if(0 == c++ % 2) { /*frameskip*/
    /*    src = fbtemp;
         // 8bpp
            dst_e = fbdata + xoffs + yoffs * finfo.line_length;
            dst_o = dst_e + finfo.line_length;

            for(y = 0; y <  x_image->height; y++) {
                for(x = 0; x <  x_image->width; x++) {
                    *dst_e = odither_e[*src] & 0xF0;
                    *dst_e = *dst_e | (*dst_e >> 4);
                    dst_e++;
                    *dst_e = odither_e[*src] & 0x0F;
                    *dst_e = *dst_e | (*dst_e << 4);
                    dst_e++;
                    *dst_o = odither_o[*src] & 0xF0;
                    *dst_o = *dst_o | (*dst_o >> 4);
                    dst_o++;
                    *dst_e = odither_o[*src] & 0x0F;
                    *dst_e = *dst_o | (*dst_o << 4);
                    dst_o++;
                    src++;
                }
                dst_e += skip;
                dst_o += skip;
            
        }
    
*/
    //    update_area_t myarea;
    //    myarea.x1 = xoffs;
    //    myarea.x2 = 320 + xoffs;
    //    myarea.y1 = yoffs;
    //    myarea.y2 = 288 + yoffs;
    //    myarea.buffer = NULL;
    //    myarea.which_fx = fx_update_partial;
    /*    ioctl(fd, FBIO_EINK_UPDATE_DISPLAY_AREA, &myarea);  */





Maybe I will just focus on trying to patch Xepyhr via builroot tomorrow instead.
twobob is offline   Reply With Quote
 
Advertisement
Old 08-19-2013, 11:06 PM   #258
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021146
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
*cough*

https://github.com/twobob/fbgnuboy/

*cough*

Just so I can reference the code more easily for external peeps.

Cheers.
twobob is offline   Reply With Quote
Old 01-04-2014, 07:28 PM   #259
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
44 GB (compressed) MAME ROMs brought to you by Archive.org:
https://archive.org/details/MAME_0.149_ROMs

Single mass download, or individual zip files. The mass download zip file contains a README file and 28,739 zip files (each containing a game ROM). Surely some of them should work in the emulator featured in this thread.

These downloads are part of the larger "MESS and MAME collection":
https://archive.org/details/messmame

Last edited by geekmaster; 01-04-2014 at 08:08 PM.
geekmaster is offline   Reply With Quote
Old 01-05-2014, 06:47 AM   #260
brianinmaine
Addict
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 388
Karma: 1287365
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
I see it, I just can't believe it? How did the legal status change? Aren't these still copyrighted or "abandonware"?
brianinmaine is offline   Reply With Quote
Old 01-05-2014, 11:03 AM   #261
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,070
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by brianinmaine View Post
I see it, I just can't believe it? How did the legal status change? Aren't these still copyrighted or "abandonware"?
I had a similar thought when I stumbled across this "mother load" of ebooks:

http://www.it-ebooks.info/

geekmaster is offline   Reply With Quote
Old 01-30-2014, 10:12 AM   #262
PieMan597
Half-eaten
PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.
 
PieMan597's Avatar
 
Posts: 2,190
Karma: 2048148
Join Date: Jan 2014
Location: PieTown USA
Device: Kindle Touch, Nexus 7
Can someone please give me a download link for xgnugoy or fbgnuboy for the Kindle Touch with touch controls. Even if it was vory buggy, it would still be very good to have, and I am no good at coding.
PieMan597 is offline   Reply With Quote
Old 01-30-2014, 10:48 AM   #263
brianinmaine
Addict
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 388
Karma: 1287365
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
Quote:
Originally Posted by PieMan597 View Post
Can someone please give me a download link for xgnugoy or fbgnuboy for the Kindle Touch with touch controls. Even if it was vory buggy, it would still be very good to have, and I am no good at coding.
As far as I know, neither has been ported to the touch version. On-screen controls would be quite difficult to navigate with, have you seen a version with them? Also, multiple key-presses would be awkward as the touch is pretty slow with input?
brianinmaine is offline   Reply With Quote
Old 01-30-2014, 11:17 AM   #264
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 64,832
Karma: 42808855
Join Date: Nov 2006
Location: UK
Device: Kindle Voyage, iPad Mini, iPhone 4, MS Surface Pro, N7
Quote:
Originally Posted by brianinmaine View Post
I see it, I just can't believe it? How did the legal status change? Aren't these still copyrighted or "abandonware"?
I seriously doubt that the copyright status did change. Unfortunately there's an awful lot of illegal content on "archive.org", although obviously the overwhelming majority is perfectly OK. Do check the legality of files there before downloading.
HarryT is offline   Reply With Quote
Old 01-30-2014, 01:00 PM   #265
PieMan597
Half-eaten
PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.
 
PieMan597's Avatar
 
Posts: 2,190
Karma: 2048148
Join Date: Jan 2014
Location: PieTown USA
Device: Kindle Touch, Nexus 7
Oh. I guess for now I'm limited to playing Gameboy games on my Gameboy or my calculator. When I learn to code, I will work on touch for this for sure.
PieMan597 is offline   Reply With Quote
Old 01-30-2014, 04:54 PM   #266
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,180
Karma: 2116649
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
I never bothered - it didn't look like it would be either ever in a usable state (due to touchscreen technology), or interesting enough (after all, this is just a pet project :-))
hawhill is offline   Reply With Quote
Old 01-31-2014, 05:46 AM   #267
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021146
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
hmm... IIRC it was easy to build this for touch.

just fiddle with the targets to make it target X.

but you would have to fix the dithering problem yourself...



EDIT:

https://github.com/twobob/fbgnuboy/blob/master/Makefile maybe?

Last edited by twobob; 01-31-2014 at 06:30 AM.
twobob is offline   Reply With Quote
Old 01-31-2014, 09:23 AM   #268
PieMan597
Half-eaten
PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.
 
PieMan597's Avatar
 
Posts: 2,190
Karma: 2048148
Join Date: Jan 2014
Location: PieTown USA
Device: Kindle Touch, Nexus 7
Thank for the sources twobob!
PieMan597 is offline   Reply With Quote
Old 02-25-2014, 05:49 PM   #269
PieMan597
Half-eaten
PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.PieMan597 ought to be getting tired of karma fortunes by now.
 
PieMan597's Avatar
 
Posts: 2,190
Karma: 2048148
Join Date: Jan 2014
Location: PieTown USA
Device: Kindle Touch, Nexus 7
How exactly do I compile this for my Kindle? Being a newcomer to the coding world, I don't know much. It would be nice if you guys could help me out.
PieMan597 is offline   Reply With Quote
Old 03-13-2014, 05:22 PM   #270
discocreeper101
Member
discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.discocreeper101 can even cheer up an android equipped with a defective Genuine Personality Prototype.
 
discocreeper101's Avatar
 
Posts: 14
Karma: 30226
Join Date: Mar 2014
Device: Kindle Paperwhite 2
Thanks For The Great Work You Have Done!
Where Do You Put The Extracted Files & How Do You Run It on the kindle? Do you hve to compile the project?

Last edited by discocreeper101; 03-21-2014 at 07:54 AM.
discocreeper101 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle VNC viewer (native app, GPLv2) hawhill Kindle Developer's Corner 496 Today 02:37 PM
Gameboy emulator on PE bunodosoma enTourage eDGe 2 11-16-2011 09:19 PM
Gameboy screen bookmeal General Discussions 7 10-03-2011 03:40 PM
software suggestion: virtualboy(gameboy emulator) arfarf624 Kindle Developer's Corner 3 07-27-2011 06:06 AM
Free (GPLv2) Translation Dictionaries Elleo Amazon Kindle 3 01-11-2011 11:57 PM


All times are GMT -4. The time now is 08:25 PM.


MobileRead.com is a privately owned, operated and funded community.