Textcolor and Textbackground

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
jrfritz

Re:Textcolor and Textbackground

Post by jrfritz »

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.
Guest

Re:Textcolor and Textbackground

Post by Guest »

ok thnx
ill try it den.
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Textcolor and Textbackground

Post by df »

Guest 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
the variable in memory is ALREADY IN HEX

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

Post by Guest »

so if i was to get rid of the den2hex function, my code will still work?
Tim

Re:Textcolor and Textbackground

Post by Tim »

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.
jrfritz

Re:Textcolor and Textbackground

Post by jrfritz »

Like...if you:

int test1 = 10;

and printed

printf("0x%x", 10);

i'd come out 0xA.
Guest

Re:Textcolor and Textbackground

Post by Guest »

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?
Tim

Re:Textcolor and Textbackground

Post by Tim »

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.
Post Reply