TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: andrew clarke
date: 1996-08-23 13:41:20
subject: vm_mkcolor()

20 Aug 96 20:37, Frank Adam wrote to Andrew Clarke:

 > #define vm_mkcolor(fore,back)  ((fore) | (back << 4))

OK.

 > #define Set_Attrib(fore,back) (((back << 4) + fore) & 127)

OK, if you want the parameters reversed, this should read:

  #define Set_Attrib(back,fore) (((back << 4) + fore) & 127)

 > printf("\n %d",vm_mkcolor(1,10));

Blinking blue text on a light green background.

 > printf("\n %d",Set_Attrib(1,10));

Light green text on a blue background.

 > Output will be   161 i 
 >                  33  !

161 - 128 = 33.

Regards
Andrew

-- randy{at}zws.com

--- Msged/2 4.00
* Origin: Blizzard of Ozz, Melbourne, Australia (3:635/727.4{at}fidonet)
SEEN-BY: 50/99 620/243 623/630 632/349 635/503 544 727 728 711/401 409 410
SEEN-BY: 711/413 430 808 809 932 934 712/515 713/888 714/906 800/1
@PATH: 635/727 544 50/99 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.