Jump to content
IGNORED

cc65 for Windows


karri

Recommended Posts

Hint: Use pre instead of post increment/decrement. It gives better code.
 

signed int Sin(char ang,char sgn)
{ 
	int tval;
	tval = (0x100 * SinTabhi[ang]) + SinTablo[ang];
	if (!sgn) { 
	tval = 0xffff ^ tval;
	tval++ ;
}
	return tval;
} 

=>

signed int Sin(char ang,char sgn)
{ 
	int tval;
	tval = (0x100 * SinTabhi[ang]) + SinTablo[ang];
	if (!sgn) { 
	tval = 0xffff ^ tval;
	++tval ;
   }
	return tval;
} 

But: Why not simply: tval = -tval; ????

 

And (ouch): tval = (SinTabhi[ang] << 8 ) | SinTablo[ang]);

Edited by 42bs
Link to comment
Share on other sites

  • 1 month later...

I made the changes, thanx @42bs. a See http:// https://ANDREW-PROGS@bitbucket.org/ANDREW-PROGS/contacts.git

for source. If anyone has noticed a distortion in the shape of the cube, it is because the transformed cooordinates of the cube corners

are re -used for the next spacial calculation. Also the sine/cosine table is at a resolution of 8 bits and this contributes to the effect of lossy maths.

Cheers.

Edited by Positron5
Link to comment
Share on other sites

2 hours ago, 42bs said:

Not by heart, but placed my latest version on my GitHub page.

Almost it seems :)

 

 printf("\n  -d        Debugging on\n"
         "  -s        Print storage info\n"
         "  -h        Print hashtab stats\n"
         "  -C        Include source as comment\n"
//         "	-O   	  Optimize code\n"
         "  -Dsymbol  define Symbol\n" 
         "  -v        Verbose mode\n"
         "  -I <fn>   Specify include directory\n"
         "  -?        This help message\n"
         "  -N        print copyright notice\n");

edit: ok it seems all code optimization have been handled to xopt, which I already use.

Edited by LordKraken
Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...