TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Rob Basler
date: 1995-01-03 01:34:56
subject: Can`t set VIO palette

I'm having trouble with a VIO call from BCOS/2 V1.0, I am trying to set
the palette in an OS/2 full screen session in mode 13 (320x200x256) and
every time I make the VioSetState call, I get the return
ERROR_VIO_INVALID_LENGTH.  I have tried it with the video buffer
locked and unlocked and it doesn't make any difference.  I'm
running a ET4000W32i video card with OS/2 2.11 if that makes any
difference.  I have checked that viocreg.cb=12 (which it is supposed
to.) Here's the code I'm using which I got off of this echo I believe
...

void VGASetAllPalette(char *palette, int size) {
  VIOCOLORREG viocreg;

  viocreg.cb = sizeof(VIOCOLORREG);
  viocreg.type = 3; /* Apparently no #define for this */
  viocreg.firstcolorreg = 0;
  viocreg.numcolorregs = size;

  /* Note: viocreg.colorregaddr should be of type CHAR *_Seg16
     But it isn't! Hence if I say viocreg.colorregaddr = buf,
     then the correct thunking will not be applied! */
  memcpy(&viocreg.colorregaddr, palette, 4);

  VioSetState(&viocreg, (HVIO) 0);
};

The good news is that my frame rate went up about 50% just by compiling
under OS/2 rather than DOS - Yay!

Rob.
___
 X SLMR 2.1a X I haven't lost my mind...it's backed up on tape somewhere

--- Maximus/2 2.01wb
* Origin: The Idle Task... (604)275-0835 Richmond BC. (1:153/905)
SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430
SEEN-BY: 711/807 808 809 934 942 949 712/353 515 713/888 800/1
@PATH: 153/905 828 7041 752 716 920 270/101 396/1 3615/50 229/2 12/2442
@PATH: 711/409 808 809 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™.