amiga_imgv
changeset 5:0d3d7b020e6a
progress...
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 27 Oct 2017 12:32:24 +0300 |
parents | 0fd37effde29 |
children | ae0ada629b03 |
files | src/amiga/gfx.c src/image.c src/sdl/gfx.c |
diffstat | 3 files changed, 6 insertions(+), 7 deletions(-) [+] |
line diff
1.1 --- a/src/amiga/gfx.c Fri Oct 27 11:36:18 2017 +0300 1.2 +++ b/src/amiga/gfx.c Fri Oct 27 12:32:24 2017 +0300 1.3 @@ -167,7 +167,7 @@ 1.4 for(i=0; i<num_bitplanes; i++) { 1.5 add_copper(COPPER_MOVE(bplptr[i], bpladdr >> 16)); 1.6 add_copper(COPPER_MOVE(bplptr[i] + 2, bpladdr)); 1.7 - bpladdr += fb_width / 8 * num_bitplanes; 1.8 + bpladdr += fb_width / 8; 1.9 } 1.10 } 1.11
2.1 --- a/src/image.c Fri Oct 27 11:36:18 2017 +0300 2.2 +++ b/src/image.c Fri Oct 27 12:32:24 2017 +0300 2.3 @@ -153,15 +153,15 @@ 2.4 pixval = 0; 2.5 for(x=0; x<w; x++) { 2.6 if(i < 4) { 2.7 - unsigned char val = (y & 1) ? 0 : 0xff; 2.8 - pixval = (pixval >> 1) | (((val >> i) & 1) ? 0x80 : 0); 2.9 + unsigned char val = ((y >> 3) & 1) == ((x >> 3) & 1) ? 0 : 0xff; 2.10 + pixval = (pixval >> 1) | (val & 0x80); 2.11 } 2.12 if((x & 7) == 7) { 2.13 *pptr++ = pixval; 2.14 pixval = 0; 2.15 } 2.16 } 2.17 - pptr += w / 8 * (img->nbitplanes - 1); 2.18 + pptr += w / 8 * (nbpl - 1); 2.19 } 2.20 } 2.21
3.1 --- a/src/sdl/gfx.c Fri Oct 27 11:36:18 2017 +0300 3.2 +++ b/src/sdl/gfx.c Fri Oct 27 12:32:24 2017 +0300 3.3 @@ -153,12 +153,12 @@ 3.4 int bit = 7 - (j & 7); 3.5 3.6 for(k=0; k<img->nbitplanes; k++) { 3.7 - idx = (idx << 1) | ((*(src + k * img->width / 8) >> bit) & 1); 3.8 + idx |= (((*(src + k * img->width / 8) >> bit) & 1) << k); 3.9 } 3.10 3.11 printf("%d ", idx); 3.12 color = palette[idx]; 3.13 - /*ham = (idx >> 4) & 3; 3.14 + ham = (idx >> 4) & 3; 3.15 color = (i & j) ? dest[-1] : 0; 3.16 3.17 switch(ham) { 3.18 @@ -174,7 +174,6 @@ 3.19 case 3: 3.20 color = (color & ~GMASK) | (((uint32_t)idx & 0xf) << GSHIFT); 3.21 } 3.22 - */ 3.23 3.24 *dest++ = color; 3.25 if(!bit) {