add dumb pragma to prevent the 19 32-bit integer ureg from being padded out to the wrong size. Reference: /n/patches.lsub.org/patch/auxvgavesa Date: Thu Sep 13 21:03:22 CES 2012 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/aux/vga/vesa.c Thu Apr 12 12:25:25 2012 +++ /sys/src/cmd/aux/vga/vesa.c Sun Sep 9 23:31:34 2012 @@ -1,8 +1,10 @@ #include #include #include +#pragma pack on #include typedef struct Ureg Ureg; +#pragma pack off #include "pci.h" #include "vga.h" @@ -155,6 +157,9 @@ continue; if(strcmp(vm.name, mode) == 0) goto havemode; + /* accept mode numbers so we can select bit pattern */ + if(vm.id == strtoul(mode, 0, 0)) + goto havemode; } } werrstr("no such vesa mode"); @@ -510,20 +515,20 @@ } m->xo = m->x = 0; - d = 1 << (m->depth - 1); - d |= d - 1; - c = ((1<r)-1) << m->ro; + d = 1<depth-1; + d |= d-1; + c = ((1<r)-1) << m->ro; c |= ((1<g)-1) << m->go; c |= ((1<b)-1) << m->bo; - x = d ^ c; - if(x != 0){ + if(x = d ^ c){ for(; (x & 1) == 0; x >>= 1) m->xo++; - for(; x & 1; x >>= 1) + for(; (x & 1) == 1; x >>= 1) m->x++; } - m->chan[0] = o = 0; + o = 0; + m->chan[0] = 0; while(o < m->depth){ if(m->r && m->ro == o){ snprint(tmp, sizeof tmp, "r%d%s", m->r, m->chan);