Re: A92: Re: Cutting off sprites


[Prev][Next][Index][Thread]

Re: A92: Re: Cutting off sprites




According to TurboSoft@aol.com:
> 
> be.  l can put in any decimal number in  place of d2 in the dc.w parts of 
> sprite:, but putting %d2 there gives a "bad expression" error.
> Down below,
>     dc.w    %d2
> is giving the error.
> 

That's normal, you can't do that, the expression that you put after a "dc.w"
has to be known at compilation time, so you can't put a register.
Why don't you try the following :

 sprite(x,y,lines)
 int x;
 int y;
 int lines;
 {
 asm("
     move.w 8(%sp),%d0
     move.w 10(%sp),%d1
     move.w 12(%sp),%d2
     lea sprites(%PC),%a0
     move.w %d2,(a0)      // this line will work
     bra oversprite
 sprites:
     dc.w    0  // this will be replaced by d2 at execution time
     dc.w    3
     dc.b    255,255,255
     dc.b    255,255,255

     .....


-- 

    Jean-Baptiste CANAZZI
    bloozed@multimania.com
    http://www.multimania.com/bloozed


References: