MAX_PALETTE
#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE)
SP_PARM->_color_table[n] = tp[n % MAX_PALETTE];