Hi Unichrome users,

I've a Epia-10000M with Debian using the debs from 
http://www.physik.fu-berlin.de/~glaweh/debian/
but wanted to try out the vt1622-noscale-2 patch from 
http://www.kingcot.eclipse.co.uk/unichrome/unichromeTvOut.html
To skip rebuilding the XFree server I wrote this binary patch.  Simply
compile it with "gcc vt1622-noscale-2.c -o vt" and run as root "./vt".
It should print "Found   wrote ok".
To reverse the patch use "./vt reverse_this_patch_now_please".
Its a good idea to backup "/usr/X11R6/lib/modules/drivers/via_drv.o"
before you start.

I've also had some success with this 50Hz mode line 
Modeline "720x576" 26.80 720 752 848 880 576 588 593 605 
I generated from
http://xtiming.sourceforge.net/cgi-bin/xtiming.pl

Paul

P.S. Can't see much of a difference with this patch.  
But 'Option "TVDeflicker" "0"' (the default) helps a lot.

// gcc vt1622-noscale-2.c -o vt

#include <stdio.h>

#define END 0xfe
#define BYTE unsigned char

BYTE borginal[] = {
    0x04, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x10, 0x10, 0x7D, 0x32, 0x60, 0x00, 0x57, 0x46, 0x0F, 0x00, 0x00, 0x00, 0xEC, 0x15, 0xDC, 0x28, 0x2D, 0x77, 0x66, 0x2D, 0xEE, 0x03, 0x0A, 0x80, 0x00, 0x84, 0x13, 0x0C, 0x04, 0x7B, 0x48, 0x64, 0x30, 0x93, 0x49, 0x5F, 0x15, 0xA5, 0x23, 0x77, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE7, 0x45, 0x04, 0x00, 0x00, 0x45, 0xE7, 0xCF, 0x23, 0x57, 0x02, 0x1F, 0x80, 0x75, 0x23, 0x89, 0xC7, 0xF1, 0xFF, 0x05, 0xD7, 0x80, 0x03, 0x00, 0x00, 0xBF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x78, 0x59, 0x59, 0x9C, 0x5B, 0x8C, 0x56, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x20, 0x40, 0x00, 0x00, 0x87, 0x1C, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x87, 0x1C, 0x00, 0x00, 0x00,
    0xE7, 0xCF, 0xCF, 0xE7, 0x9A, 0x23, 0xD7, 0x0C, 0x57, 0x3F, 0x3F, 0x57, 0x52, 0x12, 0x40, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x5A, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
    0xE7, 0xCF, 0xCF, 0xE7, 0x9A, 0x23, 0xD7, 0x0C, 0x57, 0x3F, 0x3F, 0x57, 0x52, 0x12, 0x40, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0xB4, 0x40, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
    0xE7, 0xCF, 0xCF, 0xE7, 0x9A, 0x23, 0xD7, 0x0C, 0x57, 0x3F, 0x3F, 0x57, 0x52, 0x12, 0x40, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x68, 0x81, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
    0x07, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x06, 0x00, 0x02, 0x2A, 0x65, 0xBA, 0x66, 0xB8, 0x67, 0xB8, 0x27, 0x90, 0x2B, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x04, 0x00, 0x02, 0x03, 0x65, 0x58, 0x66, 0x48, 0x67, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    END
};

BYTE bnew[] = {
    /* These TV mode lines set's the VT1622 to display 720x568 PAL with no scaling */
    /* This only works if the TV is the only and primary display */
    0x04, 0x00, 0x00, 0xa4, 0x40, 0x00, 0x10, 0x75, 0xa5, 0x3a, 0x5a, 0x00, 0x49, 0x46, 0x00, 0x89, 0x00, 0x00, 0xe9, 0x19, 0xdc, 0x24, 0xe3, 0x33, 0x89, 0x28, 0xee, 0x03, 0x0a, 0x80, 0x00, 0x04, 0x13, 0x0c, 0x04, 0x7b, 0x48, 0x64, 0x30, 0x93, 0x49, 0x5f, 0x15, 0xa5, 0x23, 0x77, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x45, 0x04, 0x00, 0x00, 0x45, 0x7f, 0xd0, 0x23, 0x70, 0x02, 0x7f, 0xd0, 0x93, 0x23, 0x89, 0xc7, 0xf1, 0xbd, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x03, 0x00, 0x00, 0x00, 0xe3, 0x33, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x6b, 0x59, 0x59, 0x88, 0x5b, 0x8c, 0x6f, 0xf0, 0x00, 0x60, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x33, 0x3f, 0x68, 0x00, 0x3f, 0x57, 0xe3, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x20, 0x40, 0x00, 0x00, 0x87, 0x1C, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x87, 0x1C, 0x00, 0x00, 0x00,
    0xE7, 0xCF, 0xCF, 0xE7, 0x9A, 0x23, 0xD7, 0x0C, 0x57, 0x3F, 0x3F, 0x57, 0x52, 0x12, 0x40, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x5A, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
    0xE7, 0xCF, 0xCF, 0xE7, 0x9A, 0x23, 0xD7, 0x0C, 0x57, 0x3F, 0x3F, 0x57, 0x52, 0x12, 0x40, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0xB4, 0x40, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
    0xE7, 0xCF, 0xCF, 0xE7, 0x9A, 0x23, 0xD7, 0x0C, 0x57, 0x3F, 0x3F, 0x57, 0x52, 0x12, 0x40, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x68, 0x81, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
    0x07, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x06, 0x00, 0x02, 0x2A, 0x65, 0xBA, 0x66, 0xB8, 0x67, 0xB8, 0x27, 0x90, 0x2B, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x04, 0x00, 0x02, 0x03, 0x65, 0x58, 0x66, 0x48, 0x67, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    END
};

char filename[]="/usr/X11R6/lib/modules/drivers/via_drv.o";

int main(int argc, char *argv[])
{
    BYTE *bsearch, *breplace;
    FILE *fo;
    BYTE byte;
    int pos=0;

    if (argc == 1)
    {
        bsearch = borginal;
        breplace = bnew;
    }
    else
    {
        bsearch = bnew;
        breplace = borginal;
    }

    if ((fo=fopen(filename,"r+b"))==NULL)
    {
        printf("can't open %s\n",filename);
        exit(1);
    }
    
    while (fread(&byte, 1, 1, fo) == 1)
    {
        if (byte==bsearch[pos])
        {
            pos++;
            if (bsearch[pos]==END)
            {
                printf("Found\n");

                int back=-pos;
                fseek(fo, back, SEEK_CUR);
                if (fwrite(breplace, 1, pos, fo)==pos)
                {
                    printf("wrote ok\n");
                }
                else
                {
                    printf("wrote short\n");
                }
                
                pos=0;                
                break;
            }
        }
        else
        {
            if (pos>4)
                printf("sorry %d == %d\n",byte,bsearch[pos]);
            pos=0;
        }
    }
    
    fclose(fo);
    
    return 0;
}
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Reply via email to