spectrum_cmbrot

changeset 1:c2815c765fea

done
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 17 Feb 2014 11:00:23 +0200
parents e56d8b0eee4b
children 34f2fca9690b
files Makefile test.c
diffstat 2 files changed, 24 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/Makefile	Mon Feb 17 10:17:17 2014 +0200
     1.2 +++ b/Makefile	Mon Feb 17 11:00:23 2014 +0200
     1.3 @@ -4,7 +4,7 @@
     1.4  bin = test.tap
     1.5  
     1.6  CC = zcc
     1.7 -CFLAGS = +zx -pragma-define=myzorg=28000
     1.8 +CFLAGS = +zx -pragma-define=myzorg=28000 -O2
     1.9  LDFLAGS = -create-app
    1.10  
    1.11  $(bin): $(obj)
     2.1 --- a/test.c	Mon Feb 17 10:17:17 2014 +0200
     2.2 +++ b/test.c	Mon Feb 17 11:00:23 2014 +0200
     2.3 @@ -13,9 +13,9 @@
     2.4  
     2.5  		for(i=0; i<192; i++) {
     2.6  			unsigned int banky = i & 0x3f;
     2.7 -			unsigned int cell = banky / 8;
     2.8 -			unsigned int cline = banky % 8;
     2.9 -			unsigned int memline = cell + cline * 8;
    2.10 +			unsigned int cell = banky >> 3;
    2.11 +			unsigned int cline = banky & 0x7;
    2.12 +			unsigned int memline = cell + (cline << 3);
    2.13  			unsigned char *ptr = FB_ADDR + (start + memline) * LINESKIP;
    2.14  
    2.15  			for(j=0; j<32; j++) {	/* 256 pixels, 8 pixels per byte */
    2.16 @@ -44,6 +44,8 @@
    2.17  {
    2.18  	unsigned char i;
    2.19  	int cx, cy, zx, zy, x, y, len;
    2.20 +	int xop1, xop2, yop1, yop2;
    2.21 +	int zxop1, zxop2, zyop1, zyop2;
    2.22  
    2.23  	cx = int2fix8_8(px - 192) >> 6;
    2.24  	cy = int2fix8_8(py - 96) >> 6;
    2.25 @@ -55,11 +57,25 @@
    2.26  	zy = cy;
    2.27  
    2.28  	for(i=0; i<32; i++) {
    2.29 -		x = fix_mul5_11(zx, zx) - fix_mul5_11(zy, zy) + cx;
    2.30 -		y = fix_mul5_11(zy, zx) + fix_mul5_11(zx, zy) + cy;
    2.31 -		len = fix_mul5_11(x, x) + fix_mul5_11(y, y);
    2.32 +		/*x = fix_mul5_11(zx, zx) - fix_mul5_11(zy, zy) + cx;
    2.33 +		y = fix_mul5_11(zy, zx) + fix_mul5_11(zx, zy) + cy;*/
    2.34 +		zxop1 = zx >> 5;
    2.35 +		zxop2 = zxop1 >> 1;
    2.36 +		zyop1 = zy >> 5;
    2.37 +		zyop2 = zyop1 >> 1;
    2.38  
    2.39 -		if(len > int2fix5_11(4)) return 0;
    2.40 +		x = zxop1 * zxop2 - zyop1 * zyop2 + cx;
    2.41 +		y = zyop1 * zxop2 + zxop1 * zyop2 + cy;
    2.42 +
    2.43 +		/*len = fix_mul5_11(x, x) + fix_mul5_11(y, y);*/
    2.44 +		xop1 = x >> 5;
    2.45 +		xop2 = xop1 >> 1;
    2.46 +		yop1 = y >> 5;
    2.47 +		yop2 = yop1 >> 1;
    2.48 +		len = xop1 * xop2 + yop1 * yop2;
    2.49 +
    2.50 +		/*if(len > int2fix5_11(4)) return 0;*/
    2.51 +		if(len > 8192) return 0;
    2.52  
    2.53  		zx = x;
    2.54  		zy = y;