| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: VP question |
-=> Quoting George Roberts to All <=-
GR> mem[vidseg:(160*(x-1)+2*(x2))+1]:=8;
GR> type of thing... however, VP uses 32-bit flat memory... any idea how
GR> I'm supposed to change this so that I can access specific parts of the
GR> video memory in console apps? Any help would be appreciated... thanks!
Ooooh look a question for which i actually have an answer . Use or modify
at your leisure...
Code was commented and slightly modified at this posting and could contain
errors or omissions. These procedure work in tandem and screencap
"must" be
done prior to screenrestore (ie one could not use this "as is" to post an
array into the screenrestore procure without affecting the srcount which would
need correcting if a screen restore were done without screencap. Likewise each
screencap "eventually" have a screenrestore call).
I think you'll get the idea.
USES OS2BASE,CRT;
TYPE
tscreen = array[1..4007] of char; {defines the "screen"}
CONST
srcount : byte = 0; {start at "0" in our array
(invalid but will be increase prior to any capture)}
VAR
sarray:array[1..5] of tscreen; {array of "screens" so I can recursively
capture and restore up to 5 screens. Can
be increased or decreased as needed}
procedure screencap;
var k:word;
begin
inc(scrcount);
{increase our position in the array}
if scrcount<6 then begin
{if within the confines of our array then capture}
sarray[scrcount][4001]:=chr(lo(windmin));
sarray[scrcount][4002]:=chr(hi(windmin));
sarray[scrcount][4003]:=chr(lo(windmax));
sarray[scrcount][4004]:=chr(hi(windmax)); {record previous window size}
sarray[scrcount][4005]:=chr(textattr); {record previous attribute}
sarray[scrcount][4006]:=chr(wherex);
sarray[scrcount][4007]:=chr(wherey); {record previous cursor position}
window(1,1,80,25); {set full window}
k:=1920;
VioReadCellStr(sarray[scrcount],k,0,0,0);
k:=2180;
VioReadCellStr(sarray[scrcount][1921],k,12,0,0);
{window is captured in two sections due to a problem I experienced
trying to do it in one shot. This was a quick work-around}
end;
end;
procedure screenrestore;
begin
if scrcount<6 then begin
{check for a valid limit within our array}
VioWrtCellStr({at}sarray[scrcount],4000,0,0,0);
{write our screen}
windmin:=ord(sarray[scrcount][4001])+256*ord(sarray[scrcount][4002]);
windmax:=ord(sarray[scrcount][4003])+256*ord(sarray[scrcount][4004]);
{restore window via windmin and windmax}
textattr:=ord(sarray[scrcount][4005]);
{reset our textattr as before the capture}
gotoxy(ord(sarray[scrcount][4006]),ord(sarray[scrcount][4007]));
{put the cursor back as before the capture}
end;
dec(scrcount);
{decrease the position in the array}
end;
Dave...
... THD ProScan support on the web, http://www.naples.net/~nfn03274
~~~ TGWave v1.12+
--- GEcho 1.11+
* Origin: fks Online! * Ontario, Canada * (905)820-7273 * (1:259/423)SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955 SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809 @PATH: 259/423 400 99 250/99 3615/50 396/1 270/101 712/515 711/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™.