🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #157

VioSavRedrawWait and EMX problems...

#157
From: the Dodger
Date: Wed, 04 Nov 1992 06:08
42 lines
2654 bytes
I'm having lots of luck using the Vio functions with the emx package. I have
no docs on the functions and have run into a problem. I need to set up a
save and redraw thread for when the user switches from and to my program. I
downloaded the full screen graphics example from hobbes (graf.zoo or something)
and have been trying to implement the function in the same manner that it does.

As soon as I try to switch away from my program, I get an access violation
in emxio.dll. Now, I have to admit that I am tweaking the video mode just a
bit to do what I want. However, without the saveredraw thread running, OS/2
handles the mode switching just fine! This totally amazed me at first. The
only thing OS/2 doesn't restore is the actual video data.

Currently I'm avoiding using the -Zmt option because any time I link with it
and run my program, I get an access violation in emxlibc.dll. This is an error
I haven't been able to track down. Therefore there are no C library calls in
any of my threads (as far as I can tell ;).

My saveredraw thread first allocates 4 64k chuncks of memory with DosAllocMem.
Then it waits in an infinite loop with the VioSavRedrawWait command waiting
for a command. When it is told to save the screen, it calls _outp16 to set
the correct video plane to read and proceeds to copy the 64k from screen
memory (allocated via VioGetPhysBuf) to the save buffer. It does this 4 times,
once for each plane.

The only problem I can think of is that OS/2 is switching away from my process
before emx does the _outp16. (What other calls are in emxio.dll?) However,
this should work because that is just how the sample program works, with
outports and everything. There is one other thread in the sample program that
runs continuously and I don't know what it is for. It calls
VioModeWait(0,&cmd,0) in an infinite loop. What is this for?

I really need some docs...

Thanks

Keith

-- 
                              ____          _____  ____
Keith Murray                 /     /___/ /\ \    \ \____    P.O. Box 1889
murrayk@prism.cs.orst.edu   /___  /   / /__\ \____\ ____\   Corvallis OR 97339
   the Dodger                  s  o  f  t  w\ a  r  e
Technical Details
Message-ID: <1d7pd9INNoo6@flop.ENGR.ORST.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!flop.ENGR.ORST.EDU!flop.ENGR.ORST.EDU!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!flop.ENGR.ORST.EDU!flop.ENGR.ORST.EDU!usenet
From: murrayk@prism.CS.ORST.EDU (the Dodger)
Newsgroups: comp.os.os2.programmer
Subject: VioSavRedrawWait and EMX problems...
Message-ID: <1d7pd9INNoo6@flop.ENGR.ORST.EDU>
Date: 4 Nov 92 06:08:41 GMT
Article-I.D.: flop.1d7pd9INNoo6
Distribution: world
Organization: Oregon State University, Computer Science Dept.
Lines: 42
NNTP-Posting-Host: prism.cs.orst.edu