So I decided to write my own and well this is no better, this is the code I am using now, all the variables with m_ are defined as members of the Console class:
Code: Select all
int Console::Write( char *str )
{
unsigned int i = ((m_ScreenX * 2) + (m_ScreenY * 160));
unsigned int j = 0;
while (str[j] != 0)
{
m_Video[i] = str[j];
m_Video[i + 1] = m_Attribute;
j++; // j will not increment, not even with j += 1 or j = j + 1
i += 2;
m_ScreenX++;
if (m_ScreenX >= 80) // should only start a new line after 80 chars
{
m_ScreenX = 0;
m_ScreenY++;
if (m_ScreenY > 20)
{
m_ScreenY = 0;
}
i = (m_ScreenY * 160);
}
}
return 0;
}
Do you know what the problem is?
thanks.