From: Groepaz (groepaz_at_gmx.net)
Date: 2002-12-09 00:01:43
> 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);
> }
you should have also added that using cputs() instead would greatly increase
the speed of that code :)
--
___ ___ .___________________ .___________ _______.
c=64 / | \| \__ ___/ \ \_ _____/ \ \ [groepaz]
gb / ' \ | | | / \ / \ | __)_ / | \ gp32
cgb \ . / | | |/ ' \| \/ | \ psx
gba \___|_ /|___| |____|\____|__ /_______ /\____|__ / dc
-----\/-----'---------------\/--------\/---------\/
http://www.hitmen-console.org Hitmen WWW Headquarters
http://fly.to/hitmen-groepaz my personal playground
http://rr.c64.org/silversurfer home of the RR debugger
ftp.musoftware.de/pub/groepaz cc65 dump site
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2002-12-09 00:14:41 CET