/* print an unsigned integer to a stream without using printf/sprintf */ void PrintUnsigned(unsigned long Num, unsigned int Base, int FieldWidth, int ZeroPad, int LeftJustify, struct OutputStream *Stream) { char Result[33]; int ResPos = sizeof(Result); Result[--ResPos] = '\0'; if (Num == 0) Result[--ResPos] = '0'; while (Num > 0) { unsigned long NextNum = Num / Base; unsigned long Digit = Num - NextNum * Base; if (Digit < 10) Result[--ResPos] = '0' + Digit; else Result[--ResPos] = 'a' + Digit - 10; Num = NextNum; } if (FieldWidth > 0 && !LeftJustify) PrintRepeatedChar(ZeroPad ? '0' : ' ', FieldWidth - (sizeof(Result) - 1 - ResPos), Stream); PrintStr(&Result[ResPos], Stream); if (FieldWidth > 0 && LeftJustify) PrintRepeatedChar(' ', FieldWidth - (sizeof(Result) - 1 - ResPos), Stream); }
static void InitScreen () { ClearScreen(); const char *title = #ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE " YourProduct Boot Loader " #else " YourProduct Rescue Disk " #endif VERSION_STRING "\r\n"; Print (title); PrintRepeatedChar ('\xDC', TC_BIOS_MAX_CHARS_PER_LINE); #ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE if (CustomUserMessage[0]) { PrintEndl(); Print (CustomUserMessage); } #endif PrintEndl (2); }