Predefined cc65-macros

lynx.h

  1. uchar and uint In most case unsigned variables are ok, for these case, I found uchar or uint more convinient.

  2. POKE(char *,char) and POKEW(int *,int)
    Use these macros only to store data in unusual places. Don't use them for hardware-addresse. Use the defined names instead.

  3. PEEK(addr)
    Read a byte from addr. Don't use this for hardware-addresses !

  4. SCB-macros
    SCB * is a pointer to a SpriteCcontrolBlock. Example
       SCBX(my_sprite) = 10;
       SCBNEXT(cls) = my_sprite;
    
    Note:Do not define a scb as struct, it is a horrible waste of space due to the way cc65 treats structs.

  5. CLI and SEI
    Clear or set the interrupt-disable bit in the 65SC02-P register.

  6. EnableIRQ(num) and DisableIRQ(num)
    Enable/Disable the timer-interrupt of timer num. (Set/clear bit 7 in timctl0).

  7. BRK(num)
    Insert a 65SC02-brk #num command.

  8. _SetRGB(pal)
    Inline version of SetRGB.

  9. WAITSUZY
    Waits until Suzy is finished.

  10. _POKE(addr,val) and POKEW(addr,val)
    Special versions of POKE and POKEW.
    addr and val must be either a constant value or a global static variable.

lynxlib.h

  1. _62500Bd,_31250Bd and _9600Bd
    Reload-values for the serial-timer.

  2. IRQ_ENTRY and IRQ_EXIT
    These macros are needed if and irq-routine uses C.
    IRQ routines must not use register variables.
    IRQ_ENTRY must be before any declaration of auto-variables !
    Example
    void MyTimer() interrupt // don't forget this key-word !!
    {
      static hello; // this is ok
      IRQ_ENTRY;    // set up for C
      {             // start a new compound, so that we might use auto-variables
      int a,b,c;    // now we can do what ever we want
    
      //...
      }
      IRQ_EXIT;     // no C beyond this point !!!
    }
    

HOME
(c) Bastian Schick
last modified 1998/01/24