[comp.sys.amiga.programmer] Copper & HiRes Interlace

clp@gumby.Altos.COM (Chuck L. Peterson) (05/23/91)

When my software is in complete control of my Amiga 2000, I support my
High Resolution Interlaced display by catching the Vertical blanking
interrupt.  Essentially, my interrupt service routine looks like this:

#define LOF 0x8000	/* Interlace Long Frame Bit */
display_intr()
{
	if (custom.vposr & LOF)
		custom.bplpt[0] = bitplane;
	else
		custom.bplpt[0] = bitplane + 80;
	custom.intreq = INTF_VERB;	/* clear interrupt */
}

What I want to know is how this stuff can be done entirely within
a COPER list.  It would be really nice if my display didn't
completely flip out every time I disabled interrupts.  The HRM states:

  To get the Copper to execute the correct list, you set an interrupt to
  the 68k just after the first line in the display.  When the interrupt
  is executed, you change the contents of the COP1LC location register to
  point to the second list.  Then, during the vertical blanking interval,
  COP1LC will be automatically reset to point to the original list.

This seems similar to what I do above except it seems a little less
direct.  The text above suggests that the Copper interrupt routine
switch to a second Copper list (which, I assume, would contain a
different bitplane address assignment).  Is there any way to just have
a single Copper list which drives a High Resolution Interlaced screen
without requiring the Vertical Blank or Copper interrupts?

Chuck L. Peterson
clp@altos.com

kskelm@happy.colorado.edu (05/24/91)

In article <4892@gumby.Altos.COM>, clp@gumby.Altos.COM (Chuck L. Peterson) writes:
> What I want to know is how this stuff can be done entirely within
> a COPER list.  It would be really nice if my display didn't
> completely flip out every time I disabled interrupts.  The HRM states:

   Well, you could try using two copper lists.  The first one, for the
long frame, would load BPLxPTR = data, and then at the bottom of the
frame (or whenever you're done changing stuff) would automatically set
COP1LC to the address of the SHORT frame copper list.  THAT list would
loadd BPLxPTR = data + 80, and when done would reset COP1LC to the FIRST list's
address.


      Should work.

+------------------------------------------------------------+
|      ///  Kevin "Visionary will be done RSN" Kelm          |
|     ///  kskelm@happy.colorado.edu                         |
| \\\/// "Reality is subjective-- if you can make your own,  |
|  \XX/ then who's crazy? That's entertainment software!"-me |
| C code run.  Run, code, run--PLEASE!                       |
+------------------------------------------------------------+

dale@boing.UUCP (Dale Luck) (05/24/91)

In article <4892@gumby.Altos.COM> clp@gumby.Altos.COM (Chuck L. Peterson) writes:
>When my software is in complete control of my Amiga 2000
>What I want to know is how this stuff can be done entirely within
>a COPER list.

Use two copper lists, at the end of each copper list set the
Copper location pointer to point to the other copper list.
It will then ping pong  between the two, all by itself. This is
what we did in the system software to take care of ASquared
disabling interrupts while frame grabbing.

-- 
Dale Luck     GfxBase/Boing, Inc.
{uunet!cbmvax|pyramid}!amiga!boing!dale

dvljrt@cs.umu.se (Joakim Rosqvist) (05/25/91)

>When my software is in complete control of my Amiga 2000, I support my
>High Resolution Interlaced display by catching the Vertical blanking
>interrupt.  Essentially, my interrupt service routine looks like this:
>
>#define LOF 0x8000	/* Interlace Long Frame Bit */
>display_intr()
>{
>	if (custom.vposr & LOF)
>		custom.bplpt[0] = bitplane;
>	else
>		custom.bplpt[0] = bitplane + 80;
>	custom.intreq = INTF_VERB;	/* clear interrupt */
>}
>
>completely flip out every time I disabled interrupts.  The HRM states:
>
>  To get the Copper to execute the correct list, you set an interrupt to
>  the 68k just after the first line in the display.  When the interrupt
>  is executed, you change the contents of the COP1LC location register to
>  point to the second list.  Then, during the vertical blanking interval,
>  COP1LC will be automatically reset to point to the original list.
>

You will have use 2 copperlists, but you don't need any interrupt handling
to install it, the LongFrame bit can be written to as well.


/$DR.HEX$

--------------------------------------------
Email to:  dvljrt@cs.umu.se
2 Windows on the screen?  Oh no, not me.  I just Logout & Go.

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) (05/27/91)

In article <1991May25.165221.2209@cs.umu.se> dvljrt@cs.umu.se (Joakim Rosqvist) writes:
>>When my software is in complete control of my Amiga 2000, I support my
>>High Resolution Interlaced display by catching the Vertical blanking
>>interrupt.  Essentially, my interrupt service routine looks like this:
>>
>>#define LOF 0x8000	/* Interlace Long Frame Bit */
>>display_intr()
>>{
>>	if (custom.vposr & LOF)
>>		custom.bplpt[0] = bitplane;
>>	else
>>		custom.bplpt[0] = bitplane + 80;
>>	custom.intreq = INTF_VERB;	/* clear interrupt */
>>}
>>
>>completely flip out every time I disabled interrupts.  The HRM states:
>>
>>  To get the Copper to execute the correct list, you set an interrupt to
>>  the 68k just after the first line in the display.  When the interrupt
>>  is executed, you change the contents of the COP1LC location register to
>>  point to the second list.  Then, during the vertical blanking interval,
>>  COP1LC will be automatically reset to point to the original list.
>>
>
>You will have use 2 copperlists, but you don't need any interrupt handling
>to install it, the LongFrame bit can be written to as well.
>
>
>/$DR.HEX$
>
>--------------------------------------------
>Email to:  dvljrt@cs.umu.se
>2 Windows on the screen?  Oh no, not me.  I just Logout & Go.

What I do is the following...  

		lea	CUSTOM,a6		; $dff000
		move.w	#$4000,INTENAW(a6)	; disable ints
10$		cmpi.b	#$fc,VHPOSR(a6)
		bne.s	10$			; wait for BOVP
		move.l	a0,COP1LC(a6)		; a0 = ptr to copper list
		clr.w	COPJMP1(a6)		; Strobe Copper
		move.w	#$c000,INTENAW(a6)
		...

I use two copper lists, one for even and one for odd frame.  The even frame
list ends by storing the address of the odd frame list to COPJMP1, and the
odd frame list stores the address of the even frame list to COPJMP1.  There
is no need for interrupts of any kind.

Note:  The above code is merely for illustration purposes... CAVEAT USER

--
****************************************************
* I want games that look like Shadow of the Beast  *
* but play like Leisure Suit Larry.                *
****************************************************