Re: [cc65] Think I found a cc65 bug

Date view Thread view Subject view

From: MagerValp (MagerValp_at_cling.gu.se)
Date: 2002-12-04 12:21:57


>>>>> "UvB" == Ullrich von Bassewitz <uz_at_musoftware.de> writes:

UvB> BTW, here is a cc65 specific suggestion for your code: Pointers
UvB> like "item" are ideal candidates for the "register" keyword. It
UvB> does no harm when used with older compiler versions, so the code
UvB> will still compile with 2.8.0. However, using "register" in the
UvB> code and -Or (or better) on the command line will decrease code
UvB> size and increase speed.

I just compiled the source with the latest snapshot, and now it looks
like this:

  http://www.cling.gu.se/~cl3polof/simple285.png

No code changes yet, just a straight recompile. It redraws the menu
correctly when I move around with the cursor,

        DrawItem(item, menu->xpos + 1, menu->ypos + menu->current + 3, 0);
        item = item->next;
        ++(menu->current);
        DrawItem(item, menu->xpos + 1, menu->ypos + menu->current + 3, 1);

but not when it's initially drawn:

        item = menu->firstitem;
        while (item) {
          DrawItem(item, menu->xpos + 1, menu->ypos + l + 3, menu->current == l ? 1 : 0);
          item = item->next;
          ++l;
        }

Adding

        gotoxy(0,l);
        cprintf("x: %d, y: %d\r\n", menu->xpos, menu->ypos);

before DrawItem changes the position (x correct, y off by 2).

Any ideas?

-- 
    ___          .     .  .         .       . +  .         .      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-04 12:22:45 CET