Hi,
int a = 0x10 => OK
int a = 10 = > OK
int a = 0b10 => KO!
GCC authorizes binary numbers through the 0bXXXXXXXX convention - is there something similar for z88DK's C compiler ?
Thank you
How to specify a binary number in source code ?
Honestly, I don't find this solution very elegant (even if it works).
Unfortunately, this does not work in the context I want to use it :
Unfortunately, this does not work in the context I want to use it :
Code: Select all
enum ESpriteMode
{
MODE_160_160 = 15, // 0b00001111
MODE_160_320 = 14, // 0b00001110
MODE_160_640 = 13, // 0b00001101
MODE_320_160 = 11, // 0b00001011
MODE_320_320 = 10, // 0b00001010
MODE_320_640 = 9, // 0b00001001
MODE_640_160 = 7, // 0b00000111
MODE_640_320 = 6, // 0b00000110
MODE_640_640 = 5 // 0b00000101
};