… | |
… | |
736 | |
736 | |
737 | #define GET_STYLE(x) (((x) & RS_styleMask) >> RS_styleShift) |
737 | #define GET_STYLE(x) (((x) & RS_styleMask) >> RS_styleShift) |
738 | #define SET_STYLE(x,style) (((x) & ~RS_styleMask) | ((style) << RS_styleShift)) |
738 | #define SET_STYLE(x,style) (((x) & ~RS_styleMask) | ((style) << RS_styleShift)) |
739 | |
739 | |
740 | #define GET_ATTR(x) (((x) & RS_attrMask)) |
740 | #define GET_ATTR(x) (((x) & RS_attrMask)) |
741 | // return attributes defining the background, encoding doesn't matter |
|
|
742 | // depends on RS_fgShift > RS_bgShift |
|
|
743 | #define GET_BGATTR(x) \ |
|
|
744 | (ecb_unlikely ((x) & RS_RVid) \ |
|
|
745 | ? (((x) & (RS_attrMask & ~RS_RVid)) \ |
|
|
746 | | (((x) & RS_fgMask) >> (RS_fgShift - RS_bgShift))) \ |
|
|
747 | : ((x) & (RS_attrMask | RS_bgMask))) |
|
|
748 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift)) |
741 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift)) |
749 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift)) |
742 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift)) |
750 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask) | (a)) |
743 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask) | (a)) |
751 | |
744 | |
752 | #define RS_SAME(a,b) (!(((a) ^ (b)) & ~RS_Careful)) |
745 | #define RS_SAME(a,b) (!(((a) ^ (b)) & ~RS_Careful)) |