[comp.sys.amiga.programmer] Copper list help requested

nygardm@nntp-server.caltech.edu (Michael T. Nygard) (05/07/91)

I've been trying to go through the Copper list examples in the Hardware
Reference Manual, but I can't make them work.  Here's the deal.

I'm looking at page 24-5, and the sample copper list.  I wrote a bit of
wrapper code to just startup, load the copper list, and start it. (It's not
very friendly...takes over the machine... busy waits, but hey! I'm just
starting in assembly!)  I know the wrapper code runs OK, but I run into trouble
with the copper list itself.  

The example needs real bitplanes.  I'd like to use the active view, but I can't
seem to get a bitplane pointer (GfxBase->ActiView->ViewPort->RasInfo->BitMap->
Planes is NULL somewhere along the line.)

Next, I think the list as shown is wrong.  The register offsets should be
shifted left by one bit, shouldn't they?

I'd appreciate it if some wizard out there could point me in the right direction
or, even better, mail me a code sample!

Many profuse thanks, and all that.

-- 
--------
Mike Nygard
nygardm@coil.cco.caltech.edu

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

In article <1991May7.034044.26814@nntp-server.caltech.edu> nygardm@nntp-server.caltech.edu (Michael T. Nygard) writes:
>I've been trying to go through the Copper list examples in the Hardware
>Reference Manual, but I can't make them work.  Here's the deal.
>
>I'm looking at page 24-5, and the sample copper list.  I wrote a bit of
>wrapper code to just startup, load the copper list, and start it. (It's not
>very friendly...takes over the machine... busy waits, but hey! I'm just
>starting in assembly!)  I know the wrapper code runs OK, but I run into trouble
>with the copper list itself.  
>
>The example needs real bitplanes.  I'd like to use the active view, but I can't
>seem to get a bitplane pointer (GfxBase->ActiView->ViewPort->RasInfo->BitMap->
>Planes is NULL somewhere along the line.)
>
Try to go via IntuitionBase->ActiveScreen Then, 192 bytes in, are the
bitplane pointers!

/$DR.HEX$

ken@cbmvax.commodore.com (Ken Farinsky - CATS) (05/08/91)

In article <1991May7.154923.20565@cs.umu.se> dvljrt@cs.umu.se (Joakim Rosqvist) writes:
>In article <1991May7.034044.26814@nntp-server.caltech.edu> nygardm@nntp-server.caltech.edu (Michael T. Nygard) writes:
>>I've been trying to go through the Copper list examples in the Hardware
>>Reference Manual, but I can't make them work.  Here's the deal.
>>
>> [...]
>>
>>The example needs real bitplanes.  I'd like to use the active view, but I can't
>>seem to get a bitplane pointer (GfxBase->ActiView->ViewPort->RasInfo->BitMap->
>>Planes is NULL somewhere along the line.)
>>
>Try to go via IntuitionBase->ActiveScreen Then, 192 bytes in, are the
>bitplane pointers!

Please don't do this in a real application!  Never steal the bitplanes of
a screen you don't own!  If you need bitplanes, allocate your own.
If you need a screen, open your own or go through a supported interface.
If you need the memory from the workbench screen, call CloseWorkBench().
If workbench won't close, that means someone is using it.

I understand this is an example, but examples tend to become applications
once they "work", even if they make bad assumptions.
-- 
--
Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines
uucp: ken@cbmvax.commodore.com   or  ...{uunet,rutgers}!cbmvax!ken
bix:  kfarinsky

jsmoller@jsmami.UUCP (Jesper Steen Moller) (05/09/91)

In article <1991May7.154923.20565@cs.umu.se> dvljrt@cs.umu.se (Joakim Rosqvist) writes:

> Try to go via IntuitionBase->ActiveScreen Then, 192 bytes in, are the
> bitplane pointers!

No reason for not going through the proper channels, huh?
I'd say that IntuitionBase->ActiveScreen->BitMap.Planes[] would be
preferrable.

> /$DR.HEX$
--                     __
Jesper Steen Moller   ///  VOICE: +45 31 62 46 45
Maglemosevej 52  __  ///  USENET: cbmehq!jsmami!jsmoller
DK-2920 Charl    \\\///  FIDONET: 2:231/84.45
Denmark           \XX/

ken@cbmvax.commodore.com (Ken Farinsky - CATS) (05/09/91)

In article <jsmoller.5107@jsmami.UUCP> jsmoller@jsmami.UUCP (Jesper Steen Moller) writes:
>In article <1991May7.154923.20565@cs.umu.se> dvljrt@cs.umu.se (Joakim Rosqvist) writes:
>
>> Try to go via IntuitionBase->ActiveScreen Then, 192 bytes in, are the
>> bitplane pointers!
>
>No reason for not going through the proper channels, huh?
>I'd say that IntuitionBase->ActiveScreen->BitMap.Planes[] would be
>preferrable.

Not really.  You're still stealing resources that you don't own.
Don't do this.
-- 
--
Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines
uucp: ken@cbmvax.commodore.com   or  ...{uunet,rutgers}!cbmvax!ken
bix:  kfarinsky

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

In article <1991May7.154923.20565@cs.umu.se> dvljrt@cs.umu.se (Joakim Rosqvist) writes:
>In article <1991May7.034044.26814@nntp-server.caltech.edu> nygardm@nntp-server.caltech.edu (Michael T. Nygard) writes:
>>I've been trying to go through the Copper list examples in the Hardware
>>Reference Manual, but I can't make them work.  Here's the deal.
>>
>>I'm looking at page 24-5, and the sample copper list.  I wrote a bit of
>>wrapper code to just startup, load the copper list, and start it. (It's not
>>very friendly...takes over the machine... busy waits, but hey! I'm just
>>starting in assembly!)  I know the wrapper code runs OK, but I run into trouble
>>with the copper list itself.  
>>
>>The example needs real bitplanes.  I'd like to use the active view, but I can't
>>seem to get a bitplane pointer (GfxBase->ActiView->ViewPort->RasInfo->BitMap->
>>Planes is NULL somewhere along the line.)
>>
>Try to go via IntuitionBase->ActiveScreen Then, 192 bytes in, are the
>bitplane pointers!
>
>/$DR.HEX$

If you need bitplanes, use _LVOAllocMem, or _LVOAllocRaster to get them.  Or
even better yet:

		SECTION	chipBSS,BSS,CHIP
bitplanes	ds.b	PLANES*PLANESIZE

This lets the LOADER allocate and deallocate the bitplanes for you.

(The SECTION directive might be slightly different depending on the assembler
you use).



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