[comp.sys.amiga.tech] multiple viewports and color registers

BBOURBIN@UMDD.BITNET (Brett S Bourbin) (04/29/88)

Does anyone know of a "Official" way of setting the screen colors of a
multiple viewport display, on the second viewport?  I have a split display
that has different color palettes and I want to write a VBLANK routine to
control the colors in the bottom port.  I am going to use the VBLANK to
fade in and out the colors.  Now, I thought that I could use the LoadRGB4()
system call during the vblank to change them, but this would not change the
Copper list that MakeVPort() and MrgCop() created to do the split screen.
I don't think I could issue calls to make a new Copper list during the vblank
so I guess my only hope is to go to the hardware directly and create a new
Copper list every time I want to change the colors.

Now, I have tried very hard to use all system routines and have not gone to
the hardware in my game, but I can not see a way to do what I want without
direct hardware access.  Does anyone else see a better way?  Also, does
LoadRGB4() change the custom chip color registers along with updating the
viewports ColorMap structure?

Brett S Bourbin
Instructional Computer Programs, University of Maryland
bbourbin@umdd.BITNET
brett@rover.umd.edu

avery@puff.cs.wisc.edu (Aaron Avery) (05/05/88)

In article <8804281803.AA28189@jade.berkeley.edu> BBOURBIN@UMDD.BITNET (Brett S Bourbin) writes:
>Does anyone know of a "Official" way of setting the screen colors of a
>multiple viewport display, on the second viewport?  I have a split display
>that has different color palettes and I want to write a VBLANK routine to
>control the colors in the bottom port.  I am going to use the VBLANK to
>fade in and out the colors.  Now, I thought that I could use the LoadRGB4()
>system call during the vblank to change them, but this would not change the
>Copper list that MakeVPort() and MrgCop() created to do the split screen.
>I don't think I could issue calls to make a new Copper list during the vblank
>so I guess my only hope is to go to the hardware directly and create a new
>Copper list every time I want to change the colors.

Well, you've got it pretty well in hand. You are mostly correct in the above
statements except the part about _having_ to go to the hardware directly. That
would be the simplest method, as you merely directly access the color register
data in the copperlist. What you probably want to do is to use the accepted
Signal() method from the VBLANK server. You're right that you probably don't
want to call MrgCop() or MakeVPort() directly from the interrupt server
routine, but you can send a Signal() to another task and have it call those
routines. This might be painful to arrange, or seem wasteful if you create
an entire separate task to do only this, but I think it's your best bet for
doing it 'right'. I sincerely hope that you plan to be doing other things
in the same task during this fade, otherwise this interrupt server idea would
be a waste of effort. Good luck, and I hope this helps.

-- 
Aaron Avery (avery@puff.cs.wisc.edu)
	    ({seismo,caip,allegra,harvard,rutgers,ihnp4}!uwvax!puff!avery)