English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 06 March 2011, 19:35   #1
jman
Registered User
 
Join Date: Nov 2010
Location: .
Posts: 307
Devpac CWAIT macro

Hello,

I just noticed a weird behaviour of the CWAIT macro provided from Devpac to handle copper WAITs (along with CMOVE,CSKIP,...).

Example:
Code:
main:
    dc.w    $9031,$fffe
    CWAIT    $31,$90
the CWAIT macro is actually this instruction:
Code:
DC.W ((\2)&$FF)<<8|((\1)&$7F)<<1|1,$FFFE
If I have a look in memory I see:
Code:
9031 FFFE
9063 FFFE <- ?
Why the X value for the copper is reworked as such? I cannot fully grasp what it is done with my "(\1)" param, but I see there's a $7f involved (first usable line of the screen). Can you help me dismember what it is done and why?

Thanks!
jman is offline  
Old 06 March 2011, 23:59   #2
Lonewolf10
AMOS Extensions Developer
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 41
Posts: 1,924
I personally don't use Macro's in my code - just subroutines

I was unaware of that Macro and prefer to write out the copperlist in the normal way (e.g. the first line in your example).


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 07 March 2011, 01:21   #3
hitchhikr
Registered User

 
Join Date: Jun 2008
Location: somewhere else
Posts: 431
Input value range is [0..127] (&$7f) and it must be word aligned [0..254] so it's multiplied by 2 (<<1) and it's converted to an odd number ([1..255]) by |1.

Check RKM for infos about Copper inner working.
hitchhikr is offline  
Old 07 March 2011, 18:36   #4
Lonewolf10
AMOS Extensions Developer
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 41
Posts: 1,924
Quote:
Originally Posted by hitchhikr View Post
Input value range is [0..127] (&$7f) and it must be word aligned [0..254] so it's multiplied by 2 (<<1) and it's converted to an odd number ([1..255]) by |1.

Thanks for the info. I always wondered what <<1 and |1 meant.


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 07 March 2011, 21:16   #5
jman
Registered User
 
Join Date: Nov 2010
Location: .
Posts: 307
Quote:
Originally Posted by hitchhikr View Post
Input value range is [0..127] (&$7f) and it must be word aligned [0..254] so it's multiplied by 2 (<<1) and it's converted to an odd number ([1..255]) by |1.
Check RKM for infos about Copper inner working.
ok, thanks for the explaination. I'll load the reference in my laptop and have a sweet bednight reading. If I won't understand, I'll be back here (you won't get rid of me with a simple rtfm :-) )!
jman is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
WAITBLIT macro phx Coders. Asm / Hardware 20 18 February 2014 14:22
Macro shot of powerflyer mk3 needed DoogUK support.Hardware 3 10 May 2009 22:41
Cybervision 64/3d repair (macro pr0n for Z and others) chiark Hardware pics 14 09 May 2009 19:11
Amiga Macro Assembler Canyon Matt request.Apps 0 06 January 2009 18:40
Looking for Macro Paint mr_a500 request.Apps 2 28 January 2006 18:20

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:35.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.06933 seconds with 15 queries