Textcolor and Textbackground
-
jrfritz
Re:Textcolor and Textbackground
Ok then...modify the doprintf to have 1 more arguments. It would be check if you want it to print or not...if int printyesno = 1 then print it...if yesnoprintf = 0 then just return the number...and make the doprintf return the hex/number instead of count.
Re:Textcolor and Textbackground
the variable in memory is ALREADY IN HEXGuest wrote: this is the only way i no how to convert decimal to hex, dont no ne other way.
if u no of a way plz tell me?
thnx
if you pass 5 to the function it returns 5, if you pass 255 it returns 0xFF which is 255! your compiler turns 255 into 0xFF ! its only your source code that you have the number in a 'hex' notation.
-- Stu --
-
Guest
Re:Textcolor and Textbackground
so if i was to get rid of the den2hex function, my code will still work?
-
Tim
Re:Textcolor and Textbackground
Yes.
The computer doesn't care what base the numbers are; as far as it's concerned, numbers are just signals inside the CPU or in memory (so in fact everything gets converted to binary internally). There is no difference between the number 255 and the number 0xFF -- they're both integers.
The computer doesn't care what base the numbers are; as far as it's concerned, numbers are just signals inside the CPU or in memory (so in fact everything gets converted to binary internally). There is no difference between the number 255 and the number 0xFF -- they're both integers.
-
jrfritz
Re:Textcolor and Textbackground
Like...if you:
int test1 = 10;
and printed
printf("0x%x", 10);
i'd come out 0xA.
int test1 = 10;
and printed
printf("0x%x", 10);
i'd come out 0xA.
-
Guest
Re:Textcolor and Textbackground
i no got rid of the lookup table and found out that the code works, so it doesnt matter what the numbers are written in.
neways i still cant get the function to blink the text on the screen.
so does bochs even support blinking text?
neways i still cant get the function to blink the text on the screen.
so does bochs even support blinking text?
-
Tim
Re:Textcolor and Textbackground
Bochs doesn't support blinking text. As long as the high bit of the attribute is set (i.e. the attribute is greater than or equal to 128 = 0x80), it will blink on a real PC.
