From: cuz Date: Mon, 25 Nov 2002 13:06:08 +0000 (+0000) Subject: Use register variables X-Git-Tag: V2.12.0~2010 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b4b1a829688957c3ee0d410a39eac01ea7f81d70;p=cc65 Use register variables git-svn-id: svn://svn.cc65.org/cc65/trunk@1630 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/samples/plasma.c b/samples/plasma.c index fd8b0f97b..9bc100d50 100644 --- a/samples/plasma.c +++ b/samples/plasma.c @@ -38,7 +38,7 @@ /* Use static local variables for speed */ -#pragma staticlocals (1); +#pragma staticlocals (1); @@ -79,19 +79,15 @@ static const unsigned char sinustable[0x100] = { -static unsigned char *scrn; - - - -static void doplasma (void) +static void doplasma (register unsigned char* scrn) { unsigned char xbuf[40]; unsigned char ybuf[25]; - unsigned char i,ii; unsigned char c1a,c1b; unsigned char c2a,c2b; unsigned char c1A,c1B; unsigned char c2A,c2B; + register unsigned char i, ii; c1a = c1A; c1b = c1B; @@ -165,6 +161,7 @@ int main (void) unsigned long fps; unsigned fps10; + #if defined(__C64__) unsigned char block; #endif @@ -206,13 +203,11 @@ int main (void) t = clock (); while (!kbhit()) { /* Build page 1, then make it visible */ - scrn = (unsigned char*)SCREEN1; - doplasma (); + doplasma ((unsigned char*)SCREEN1); outb (&VIC.addr, PAGE1); /* Build page 2, then make it visible */ - scrn = (unsigned char*)SCREEN2; - doplasma (); + doplasma ((unsigned char*)SCREEN2); outb (&VIC.addr, PAGE2); /* Count frames */