[comp.sys.amiga.tech] Questions about CMOVE, etc. Copper programming.

f86_linus@tekn01.chalmers.se (Sunil 'Linus' Shah) (10/25/88)

Hi netland!

   This is my first posting, hope it won't be my last!


   I've been having some trouble with getting my own defined copper
programmes to work. The real problem (I think) is lack of documentation; 
everything works ok in straight assembler, but the C macros haven't given
me any luck...

   This is the approximate environment:

   struct UCopList *my_ucoplist = NULL;
   struct View     *my_view;
   struct ViewPort *my_viewport;

   /* Some code deleted here */

   my_view->ViewPort = my_viewport;
   LoadRGB4(my_viewport, &ColTable, count);
   MakeVPort(my_view, my_viewport);
   MrgCop(my_view);
   LoadView(my_view);

   /* So far, so good - apart from any 'spelling' mistakes, this
      actually shows an ordinary view.

      But now I want to add a copper program. Could it be something
      like this? :
   */

   CINIT(my_ucoplist, count);
   CWAIT(my_ucoplist, 150, 0);     /* wait line 150, col 0   */
   CMOVE(my_ucoplist, dest, VAL);  /* say, move $0FFF (white) -> 0xDFF184  */
                                   /*  which is harware reg COLOR02 */
   CEND(my_ucoplist);

   my_viewport->UCopList = my_ucoplist;
   MrgCop(my_view);

   /* Is that all that's needed? Or should I:
       LoadView(oldview);
       MakeVPort
       MrgCop
       LoadView(my_view);
      
      Either way, no response...


Now some questions about CMOVE.

Does 'VAL' have to be a constant, isn't variable enough?
    
For parameter 2, dest, I have noticed that expressions are not
allowed, since the macro definition puts an adress '&' in front of it.

   But how on earth is param2 supposed to tell which hardware register
is in mind? For example COLOR02 = $DFF184, is it:

   int dest = $DFF184, or
   int dest = $184, or
   int *dest = (int*) $DFF184, or
   int *dest = (int*) $184.

   ???

According to the Amiga Programmer's Handbook the hardware register _number_
is asked for, but what's that ? maybe ($184 >> 1) ?


Anyway, I've tried all the above mentioned alternatives (however idiotic
they may seem) but the result has always been the same... none at all!

Can anyone help?

Please?

Grateful for any response,

                        Linus, SM7NSX


PS. Is there anything about the macros in the later editions of the Manuals?
I have all of the 1.1's. Not a word there (I think!). DS.