TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Haavard Mork
from: Phil Crown
date: 1997-02-14 18:36:54
subject: Cell

-=> Quoting Haavard Mork to All <=-



 HM> I urgently need some information about these 'Cells' used in Vio.

 HM> Where on the inet can I find this kind of information? Or might

 HM> anybody post it here?



prcp.inf in prcp.zip or inf16bit.zip at hobbes and probably on any OS/2

BBS.



The Cell is a byte for the character and attribute.



 HM> If noone knows, it would be great to know what light cyan on blue

 HM> corresponds to.. :)



This will print colors from 0x00-0xff.



// icc /Q /O /Ss /Wall /W2 color.c /B"/align:4 /exepack:2 /f /non"

// gcc -Zomf -Zcrtdll -Zc++-comments -lwrap -ocolor.exe color.c

// --------------------------------------------------------------------

// color.c

// Syntax:  color [h | d]  h = hex, d = decimal display

// --------------------------------------------------------------------

#define INCL_NOPMAPI

#define INCL_VIO

#include 

#include 

#include 



void color(PCHAR *argv, ULONG Hexmode);



int main(int argc, char **argv)

{

  if( argc > 1 )

    color( argv, *argv[1] );

  else

    color( argv, 'h' );

  return 0;

}

// --------------------------------------------------------------------

void color( PCHAR *argv, ULONG Hexmode )

{

  CHAR          buf[10];

  USHORT        row     =   0,

                col     =   0,

                ocol    =   0,

                count   =   0;

  BYTE          color   =   0;

  VIOMODEINFO   vi;



  vi.cb = sizeof(vi);

  VioGetMode( &vi, 0 );

  VioScrollUp(0, 0, -1, -1, -1, (PBYTE)"\x20\x07", 0L ); // cls

  VioSetCurPos( 4, 0, 0 );

  VioGetCurPos( &row, &col, 0 );

  ocol = col;



  do {

    switch( Hexmode ) {

      case 'd':

      case 'D':

        sprintf(buf,"%3d",color);

        break;

      case 'h':

      case 'H':

        sprintf(buf,"%3x",color);

        break;

    }

    if( !(color % 16) ) {

      col = 15;

      row++;

    }

    VioWrtCharStrAtt(buf, (USHORT)strlen(buf), row, col, &color, 0L);

    col += (USHORT)3;

    color++;

  } while( ++count <= 0x00ff );



  VioSetCurPos(0, 0, 0);

  printf( "%s D[ecimal] or H[ex] display", argv[0] );

  VioSetCurPos( 22, ocol, 0 );

}



Phil Crown  pcrown{at}airmail.net  http://web2.airmail.net/pcrown/



--- Blue Wave/OS2 v2.30

* Origin: * MacSavvy OS/2 BBS * Dallas, Texas * 972-250-4479 * (1:124/1208)
SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 124/1208 1 396/1 270/101 712/624 711/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™.