🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #157

Re: Copper Programming

#157
From: Jim Mackraz
Date: Sat, 24 Jun 1989 17:41
56 lines
2837 bytes
In article <5050@umd5.umd.edu> brett@umd5.umd.edu (Brett Bourbin) writes:
)
)	What I have been trying to do is write a short User Copper list that
)calls my private hardware copper list.  The User Copper list simply waits for
)the first line of the screen, where the changes need to be made, then loads
)COP2LC with the address of the private list, finally accesses COPJMP2.  When
)I use the following code, the screen gets all jarbled:

)	if ( !( vp->UCopIns = (struct UCopList *)
)		AllocMem( (long) sizeof (struct UCopList),
)			MEMF_CHIP|MEMF_CLEAR ))) goto FAIL;
)
)	ucl = vp->UCopIns;
)	CINIT( ucl, 10L );
)	CWAIT( ucl, (long) STARTLINE-1, (long) width-1 );
********* key point: what values for STARTLINE?

)	CMOVE( ucl, custom.cop2lc, (long) (privatecop >> 16) & 0xffff );
)	CMOVE( ucl, (*((UWORD *) &custom.cop2lc+1)), (long)privatecop &0xffff );
********* difficult syntax: would be nice if CMOVE were not indirect.

)	CMOVE( ucl, custom.copjmp2, 0L );
)	CEND( ucl );
)

This is what I do (recently, so I stil remember the pitfalls ;^).
First, if you are using Lattice, and in any case, you might toss the
macros and use CMove() and CBump() directly: it simplifies the
register address syntax of CMOVE(), esp for low/high register pairs.

I assume you have your basic UCL stuff at hand: you can change color 0
wherever you want.

I had some problems depending on STARTLINE.  I think the UCL can get
merged in before the real viewport instructions.  Try a 1, or for
that matter, 20.  Without knowing your value for STARTLINE, I'm reluctant
to wager that this is your problem, but it confused me.  I use
CWait( ucl, 1L, 0L ).

The next question is whether your hardware copper list is sound.
Again, jam color 0 (then do the Big Wait).  You can copy these right
out of DCop or another copper list disassembler, for absolute certainty.

Oh, yes: don't pull this stunt in interlaced mode. 

If you're going to hit all the problems I stumbled on, I can also help
by saying yes, you're going to have to poke that copper list of yours
at interrupt time, and when you do so, don't forget to turn off compiler
stack checking, like I did.

	jimm
-- 
Jim Mackraz, I and I Computing	   	"He's hidden now, but you can see
{cbmvax,well,oliveb}!amiga!jimm          The bubbles where he breathes."
							- Shriekback
Opinions are my own.  Comments are not to be taken as Commodore official policy.
Technical Details
Message-ID: <3998@amiga.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!csd4.milw.wisc.edu!bionet!apple!oliveb!amiga!jimm
References: <5050@umd5.umd.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!csd4.milw.wisc.edu!bionet!apple!oliveb!amiga!jimm
From: jimm@amiga.UUCP (Jim Mackraz)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Copper Programming
Message-ID: <3998@amiga.UUCP>
Date: 24 Jun 89 17:41:00 GMT
References: <5050@umd5.umd.edu>
Reply-To: jimm@cloyd.UUCP (Jim Mackraz)
Organization: Commodore-Amiga Inc, Los Gatos CA
Lines: 56