/* * misc.h -- misc macros * * Copyright (C) 1997 by Sony Computer Entertainment * All rights Reserved */ #define OK 0 #define NG -1 #define CHRBUFMAX 256 #define nibble_table char *nib_tbl[] = {\ "0000", "0001", "0010", "0011",\ "0100", "0101", "0110", "0111",\ "1000", "1001", "1010", "1011",\ "1100", "1101", "1110", "1111",\ } #define nibble_str(d) (nib_tbl[((d)&0xf)]) #define byte_str(d) (nib_tbl[((d>>4)&0xf)]),(nib_tbl[((d)&0xf)]) #define short_str(d) (nib_tbl[((d>>12)&0xf)]),(nib_tbl[((d>>8)&0xf)]),\ (nib_tbl[((d>>4)&0xf)]),(nib_tbl[((d)&0xf)]) #define long_str(d) (nib_tbl[((d>>28)&0xf)]),(nib_tbl[((d>>24)&0xf)]),\ (nib_tbl[((d>>20)&0xf)]),(nib_tbl[((d>>16)&0xf)]),\ (nib_tbl[((d>>12)&0xf)]),(nib_tbl[((d>>8)&0xf)]),\ (nib_tbl[((d>>4)&0xf)]),(nib_tbl[((d)&0xf)])