console text color in asm?

Started by
0 comments, last by Yohomyth 19 years, 11 months ago
I''m making a text-based game with TASM, but I can''t figure out how to color the text. Is there an interrupt for it or something? Thx in advance. ----------------------------------------------- Here comes the Thnikkaman!
------------------------------------------------------------"Many combilations elizagerth. I hope you see my particles." - Senor Cardgage
Advertisement
When writing directly to memory at 0xB8000, you first put an attribute bit that describes the color of the character before every character. Bit''s 0-3 of that bit specify the foreground color, bits 4-6 specify the background color, and bit 7 specifies if the character is blinking or not. Your options for colors are (in order starting with 000): black, blue, green, cyan, red, magenta, brown/yellow, and gray. Bit 3 is an intensity bit that you can use for a brightness control on foreground colors. You would use this if you wanted to get white.

This is how old Apogee games did those ending screens... they''d have a file full of attribute/character pairs and just dump the whole thing to 0xb8000 when the program ended. In all practicality, you''ll be better off looking up ANSI escape codes since they work on more platforms than just DOS. Do a Google search on them for info.

This topic is closed to new replies.

Advertisement