Re: [cc65] Weird problems with LoadKoala

Date view Thread view Subject view

From: MagerValp (MagerValp_at_cling.gu.se)
Date: 2002-12-08 20:54:11


>>>>> "V" ==   <visy_at_tukka.org> writes:

V> void centertext(char text[40], int coordy) {
V> gotoxy(40 - strlen(text), coordy)ö
V> cprintf("%s",text);
V> }

As the 1st argument is just a pointer to a string, defining it as
unsigned char * makes a bit more sense. In any case, specifying a size
for the array doesn't work. And to center the text, you should use
half the screen width minus half the text length:

void centertext(unsigned char *text, unsigned char line) {
  gotoxy((40 - strlen(text))/2, line);
  cprintf("%s", text);
}

V> btw. Seems that if I add *ANY* function it fucks up.

Well, then the rest of your code is buggy :) Reduce the program to its
bare minimum and try to isolate the problem. Post here if you can't
find it.

-- 
    ___          .     .  .         .       . +  .         .      o   
  _|___|_   +   .  +     .     +         .  Per Olofsson, arkadspelare
    o-o    .      .     .   o         +          MagerValp_at_cling.gu.se
     -       +            +    .     http://www.cling.gu.se/~cl3polof/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-12-08 20:55:15 CET