[comp.sys.amiga.tech] Problem with double-buffering and some 1-second interrupt annoyance

koster@cory.Berkeley.EDU.UUCP (07/02/88)

   I am doing a double-buffered display just like it says in ROM KERNAL
VOLUME 1. I have created two sets of copper lists and one view structure
and am putting the list I want into the v_LOFcprlist then doing a loadview
when I want the display to switch.
   It may take more than 1/60th of a second to draw the hidden picture, so
I have set up a vertical blank interrupt server that maintains a counter
of fields. When it gets up to 3, it clears the counter and sends the main
program a signal. One mystery is this interrupt. I must AddIntServer a
structure that has priority 127. If I put it at 0 or -60 (Like one of the
examples in RKM1) I get nothing out of it, as if the system servers do not
let the chain continue.
  The main program does as follows: switch the v_LOFcprlist in the view
structure, switch so that I will write to the other bitmap, do a LoadView,
then wait for the above signal sent from the interrupt server. Then I
actually do the writing into the hidden planes, and when that is done
I continue the loop.
  Everything works fine, everything is smooth, except at about one second
intervals I get a little flicker, as if it is displaying the bitmap I am
working on just for a single frame.
  My theory is that at one second intervals the Amiga does some incredibly
lengthy maintainance of say the disk drives, internal clock, whatever, that
takes a long time. What I want to know is how can I fix this problem?
What are these housekeeping functions, and is it ok if I make my server
the end of the chain, such that no one else gets vertical blank timings?
Why do I have to set the VB server's priority at 127?
  Thanks very much in advance, of course.

koster@cory.berkeley.edu

berry@hor-res.UUCP (No comment) (07/04/88)

In article <4213@pasteur.Berkeley.Edu>, koster@cory.Berkeley.EDU (Kevin Oster) writes:


> 
>   Everything works fine, everything is smooth, except at about one second
> intervals I get a little flicker, as if it is displaying the bitmap I am
> working on just for a single frame.
>   My theory is that at one second intervals the Amiga does some incredibly
> lengthy maintainance of say the disk drives, internal clock, whatever, that
> takes a long time. What I want to know is how can I fix this problem?

I have seen this before when I was fooling with double buffering. I am not
sure of the cause but I suspect you are on the right track. I was able to fix
it though ... 
 Here is a rough flow of what I did:

 To display a particular View,

 Forbid();
 WaitBOVP(&vp);
 MakeVPort(view,&vp);
 MrgCop(view);
 LoadView(view);
 Permit();

 This may not be the perfect solution, but it works great.
 It also rids you of that unsightly glitch every once in a while.

> 
> koster@cory.berkeley.edu


-- 
-Steve Berry- ...!bunny!hor-res!berry
"Dare to be gorgeous and unique. But don't ever be cryptic or otherwise
Unfathomable. Make it unforgettably great."
Intuition Reference Manual, pg 231.

carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) (07/12/88)

In article <3183@crash.cts.com> haitex@pnet01.cts.com (Wade Bickel) writes:
>
>  Hi Carolyn,
>
>                What is this "_custom" your speaking of and where is it
>      documented? 
It's the address of the custom chips.

It's defined in amiga.lib and is the address of the custom chips as
C programmers reference it:

1. from C

#include "hardware/custom.h"
extern struct Custom custom;


2. Asm equivalent


XREF   _custom

lea    _custom, a0


3. Other way (hardcoding it in your source)

The asm examples in the hardware manual use an EQU instead...

CUSTOM EQU $DFF000



Remember though - the last thing you must do in your server is to
load d0 with 0.  You must exit server with Z flag set (as documented
in the AW RKM Exec).

-- 
==========================================================================
  Carolyn Scheppner -- CATS  Commodore Amiga Technical Support
  PHONE 215-431-9180   UUCP  ...{uunet,allegra,rutgers}!cbmvax!carolyn 

 Pad with zeros for a light, airy program.
==========================================================================

bobb@tekfdi.TEK.COM (Robert Bales) (07/21/88)

In article <4229@cbmvax.UUCP> carolyn@cbmvax.UUCP (Carolyn Scheppner CATS)
writes:

>> Wade Bickel

>>                What is this "_custom" your speaking of and where is it
>>      documented? 

>It's the address of the custom chips.

>It's defined in amiga.lib and is the address of the custom chips as
>C programmers reference it:

>1. from C

>#include "hardware/custom.h"
>extern struct Custom custom;

Not quite, at least for Manx V 3.6. In hardware/custom.h, "Custom" is a
#define, so after the preprocessor, there is no "Custom" left around. The
normal references Custom.xxxx work fine but the extern declaration isn't needed
and causes an error.

   Bob Bales
   Tektronix, Inc.

I help Tektronix make their instruments. They don't help me make my opinions.