[comp.sys.atari.st] double buffering using vdi ops

bds@mtgzz.UUCP (01/28/87)

How does one use the Setscreen() xbios routine to do double buffering
with vdi operations. Is there a trick to this? When I set the
logical base to an array and do vdi operations followed by setting the
physical base to the array, the result is garbage. Any suggestions?
Thanks.

jafischer@watrose.UUCP (01/29/87)

In article <2430@mtgzz.UUCP> bds@mtgzz.UUCP writes:
>How does one use the Setscreen() xbios routine to do double buffering

	Setscreen() won't work for double-buffering; it clears the screen.  At
least, that's what my experience suggests (and I'm sure I read it in either
the Hitchhiker's Guide to the BIOS or in ST Internals).  I have a feeling that
you will have to directly manipulate the screen address register (listed in ST
Internals, and probably elsewhere).

-- 
				- Jonathan Fischer 	(jafischer@watrose)
		or:   	watmath!watrose!jafischer
		or:   	jafischer%watrose@waterloo.csnet
		or:  	jafischer%watrose@waterloo.csnet@csnet-relay.arpa

bammi@cwruecmp.UUCP (01/29/87)

In article <8411@watrose.UUCP> jafischer@watrose.UUCP (Jonathan Fischer) writes:

#In article <2430@mtgzz.UUCP> bds@mtgzz.UUCP writes:
##How does one use the Setscreen() xbios routine to do double buffering
#
#	Setscreen() won't work for double-buffering; it clears the screen.  At
#least, that's what my experience suggests (and I'm sure I read it in either

	No Setscreen() does not clear the screen. See Xmdm (posted here)
	where it uses two screen buffers and switches between a local
	and remote screens using Setscreen(), while comm. with a host.
-- 
usenet: .....!decvax!cwruecmp!bammi		jwahar r. bammi
csnet:       bammi@case
arpa:        bammi%case@csnet-relay
compuServe:  71515,155

sansom@trwrb.UUCP (01/30/87)

In article <2430@mtgzz.UUCP> bds@mtgzz.UUCP writes:
>How does one use the Setscreen() xbios routine to do double buffering
>with vdi operations. Is there a trick to this? When I set the
>logical base to an array and do vdi operations followed by setting the
>physical base to the array, the result is garbage. Any suggestions?

You must make sure that your buffer starts on a 0x100 byte byte boundry
or the display _will_ be garbage.  Try this:

char screenbuf[32256];		/* (160 x 200) + 256	    */
long screenptr;			/* address of new screen    */
.
.
.
/* get the new screen's address & make sure it's on a 0x100 boundry */
screenptr = (long)(0x100L + ((long)&screenbuf[0] & 0xffff00L));

/* make the new screen both the physical & logical screen */
Setscreen(screenptr, screenptr, -1);


That should do the trick (warning - this code is untested in that I've
generated it here at my terminal; still, if I've made no typos, it
should work).

-Rich






-- 
 __________ ______ ____ _____ ___
/_________//___   ||__|/____|/__/   Richard E. Sansom
   ___    ____/  / ____________     TRW Electronics & Defense Sector
  /  /   /  /\  <  |    /|    /     One Space Park Drive, R3/1028
 /  /   /  /  \  \ |   / |   /      Redondo Beach, CA 90278
/__/   /__/    \__\|__/  |__/       ...{decvax,ucbvax,ihnp4}!trwrb!sansom