[cc65] Possible bug in cc65

From: Joseph Rose <rose.joseph121yahoo.com>
Date: 2012-03-26 18:20:45
I've been working on a cartridge libary for cc65's C64 platform and have been encountering problems with one of the demos.  I converted a part of the demo to run outside the demo (i.e. in the normal configuration) and found the same two bugs; 1. cputsxy() displays garbage text and; 2. the output for rand() is too regular.  I have the code here:
 
----------------------
blot.c
----------------------
static const unsigned char blotc [4]={0,1,2,5};
void blot ()
{
 static unsigned i;
 _randomize ();
 bordercolor (3); bgcolor(1); textcolor (0);
 clrscr ();
 for (i=0; i<20*40; ++i) {revers (rand()&1); cputc(' ');}
 revers(0);
 cputcxy (0,24,"Press any key to continue...");
 //gotoxy (0,24); cputs ("Press any key to continue...");
 while (!kbhit());
 cgetc();
}
void colorblot ()
{
 static unsigned i;
 _randomize ();
 bordercolor (3); bgcolor(1); textcolor (0);
 clrscr (); revers(1);
 for (i=0; i<20*40; ++i) {textcolor (blotc[rand()&3]); cputc(' ');}
 revers(0);
 textcolor (0);
 gotoxy (0,23);
 puts ("Press any key to continue...");
 while (!kbhit());
 cgetc();
}
----------------------
main.c
----------------------
void blot ();
void colorblot ();
void main()
{
 bgcolor (1); bordercolor (2); textcolor (5);
 clrscr();
 blot(); colorblot();
}
----------------------
I used cc65 v. 2.13.3, SVN 5495 to compile the code.
----------------------
Joseph Rose, a.k.a. Harry Potter
Working magic in the computer community
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Mar 26 18:20:54 2012

This archive was generated by hypermail 2.1.8 : 2012-03-26 18:20:57 CEST