Improve I_ErrorI for 32-bit output
This commit is contained in:
parent
58e22d75d4
commit
670e3a4b50
|
@ -125,6 +125,19 @@ void CGDAppendNum0_999(const char *pszText,int iNum,int iMinDigits,char *pszBuf)
|
|||
pszBuf[i+1] = 0;
|
||||
}
|
||||
|
||||
void CGDAppendHex32(const char *pszText,int iNum,int iDigits,char *pszBuf)
|
||||
{
|
||||
CGDstrcpy(pszBuf, pszText);
|
||||
pszBuf += CGDstrlen(pszText);
|
||||
for(int i = 0; i < iDigits; i++)
|
||||
{
|
||||
int c = (iNum >> (i * 4)) & 0xf;
|
||||
c = c + '0' + 7 * (c > 9);
|
||||
pszBuf[iDigits-i-1] = c;
|
||||
}
|
||||
pszBuf[iDigits] = 0;
|
||||
}
|
||||
|
||||
|
||||
int CGDstrlen(const char *pszText)
|
||||
{
|
||||
|
|
|
@ -127,10 +127,10 @@ void I_ErrorI (char *error, int i1,int i2,int i3,int i4)
|
|||
PrintLine( "ERROR:", 21 );
|
||||
locate_OS( 1, 2 );
|
||||
PrintLine( (unsigned char *)error, 21 );
|
||||
locate_OS( 1, 3 );CGDAppendNum0_999("i1",i1,0,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
locate_OS( 1, 4 );CGDAppendNum0_999("i2",i2,0,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
locate_OS( 1, 5 );CGDAppendNum0_999("i3",i3,0,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
locate_OS( 1, 6 );CGDAppendNum0_999("i4",i4,0,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
locate_OS( 1, 3 );CGDAppendHex32("i1:",i1,8,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
locate_OS( 1, 4 );CGDAppendHex32("i2:",i2,8,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
locate_OS( 1, 5 );CGDAppendHex32("i3:",i3,8,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
locate_OS( 1, 6 );CGDAppendHex32("i4:",i4,8,buf);PrintLine( (unsigned char *)buf, 21 );
|
||||
{
|
||||
if(key == 31)GetKey( &key );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue