English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 13 July 2007, 12:16   #1
Blip
Registered User
 
Blip's Avatar
 
Join Date: Aug 2006
Location: Aberdare, South Wales
Posts: 37
Sprite movement and Collision Routine

Hi
Does anyone have a basic sprite movement, animation and collision asm sample?
Thanks
Blip is offline  
Old 13 July 2007, 13:43   #2
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
I'm sure the Hardware Manual covers this in detail. Not sure if there are examples but it explains the principles and what registers etc you need to check/modify
BippyM is offline  
Old 13 July 2007, 14:02   #3
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
I have attached 2 sprite routines to this message, one for 64pixel wide (i.e. AGA) sprites (attached/normal) and one very simple routine that sets a normal 4 color 16 pixel sprite. First routine is straight from my demosystem, the other one I pasted from a very old intro I did back in 1992. Hope it helps.
Attached Files
File Type: txt SetSprite.i.txt (1.8 KB, 433 views)
File Type: txt SetSprite_Simple.s.txt (687 Bytes, 385 views)
StingRay is offline  
Old 13 July 2007, 14:12   #4
Blip
Registered User
 
Blip's Avatar
 
Join Date: Aug 2006
Location: Aberdare, South Wales
Posts: 37
Thanks guys! its a start.
Blip is offline  
Old 13 July 2007, 14:29   #5
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Ok, me again, I've quickly adapted an old demopart of mine and removed everything except the spriteanimation routines. Also singlefiled it. I'll attach it to this message. I didn't bother to clean up the copperlist so there are some things that are not needed in it (original demopart features the spriteanim and a lightsourced vectorcube ;D). Oh, and the spriteanim is not ripped from Dynablaster, friend of mine drew it.
Attached Files
File Type: txt spriteanim_eab.s.txt (18.2 KB, 400 views)
StingRay is offline  
Old 15 July 2007, 11:04   #6
Blip
Registered User
 
Blip's Avatar
 
Join Date: Aug 2006
Location: Aberdare, South Wales
Posts: 37
Nice one! Thanks again StingRay.
Blip is offline  
Old 24 September 2007, 01:12   #7
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
I've tried compiling the spriteanim code in Devpac 3.18 but its not having it. I get an error on line 162:

Code:
Error: wrong processor at line 162 in file spriteanim_eab.s
Here is that line:
Code:
.getit movec vbr, d0
Any ideas?
Steve is offline  
Old 24 September 2007, 03:36   #8
Codetapper
2 contact me: email only!
 
Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,182
It's a 68020+ instruction so you will need to tell your assembler that it is OK to use. I hate Devpac so can't tell you what option/flags you need to set - or you could try changing the line to:

Code:
dc.l $4e7a0801
and seeing if that fixes it. From memory that is the opcode for that instruction but someone with an assembler handy can verify if it's not!
Codetapper is offline  
Old 24 September 2007, 09:57   #9
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Ah thanks codetapper!

I changed to 68020 mode in the options and it worked. I'm not sure if thats the right opcode for the instruction.

I did encounter some warnings due to various spaces between comma's and numeric values in about 7 or 8 dc.l definitions. Not sure why the spaces were in there.

I also encountered 4 error messages due to a piece of code defined as AnimTabPtr_Sp and Devpac couldn't find the code as it was looking for AnimTabPtr_SP. Looks like case definitely matters to Devpac.

@StingRay: What is the FX Lib?
Attached Thumbnails
Click image for larger version

Name:	Devpac.png
Views:	540
Size:	3.2 KB
ID:	14829  

Last edited by Steve; 24 September 2007 at 10:05.
Steve is offline  
Old 27 September 2007, 15:29   #10
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
Case sensitivity can be turned on/off in the options.

Some versions of GenAm (Devpac's assembler) are sensitive to extraneous spaces in operand lists, some are not. I think GenAm from Devpac 3.14 handled the spaces.
Kalms is offline  
Old 09 March 2010, 09:38   #11
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Quote:
Originally Posted by StingRay View Post
I have attached 2 sprite routines to this message, one for 64pixel wide (i.e. AGA) sprites (attached/normal) and one very simple routine that sets a normal 4 color 16 pixel sprite. First routine is straight from my demosystem, the other one I pasted from a very old intro I did back in 1992. Hope it helps.
Hi StingRay,

Very nice routines. I found a tiny mistake in SetSprite.i.txt comment. Should be "Also, Bit 2+3 in $dff1fc have to be set!"

I found very interesting doc about sprites. http://www.winnicki.net/amiga/achtun..._one_line.html and If I understand correctly that is possible to make 320-pixel wide ( five 64pixel sprites ) background with 16 colors. Can someone post some source about this nice effect ?

Regards
asman
Asman is offline  
Old 09 March 2010, 09:48   #12
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by Asman View Post
Hi StingRay,

Very nice routines. I found a tiny mistake in SetSprite.i.txt comment. Should be "Also, Bit 2+3 in $dff1fc have to be set!"
Not a mistake (not for me at least as I perfectly understand the comment I made there) as I just counted the bits from 1 instead of 0.

Quote:
Originally Posted by Asman View Post
and If I understand correctly that is possible to make 320-pixel wide ( five 64pixel sprites ) background with 16 colors. Can someone post some source about this nice effect ?
Why would you need a source for that? Sprite routines are here in the thread, that's all you need.
StingRay is offline  
Old 09 March 2010, 10:42   #13
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Quote:
Originally Posted by StingRay View Post
Not a mistake (not for me at least as I perfectly understand the comment I made there) as I just counted the bits from 1 instead of 0.
Thats change everything. Sorry for my math perversion

Quote:
Originally Posted by StingRay View Post
Why would you need a source for that? Sprite routines are here in the thread, that's all you need.
Good point. When I answer for that question I just realized that you're right. Thanks
Asman is offline  
Old 18 March 2010, 00:55   #14
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Is there like a 'HRM for AGA' somewhere? Sorry for my ignorance, but since Stingray did a fine job helping out with the sprite extravaganza, and I've only seen some shady .txt files on AGA differences back in the day, I'd really like to know if there is, or if we should start an 'AGA differences wiki' before the information dies with the coders

Haven't really looked before, a link will suffice if there is already documentation online.
Photon is offline  
Old 18 March 2010, 01:17   #15
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
The most complete source of info is the AA specification document. You can find it in the ASM-One 1.48 archive here http://www.theflamearrows.info/ftp/asmonev148.lha.

AGA is a pretty small upgrade really, it's not like learning a new hardware or anything. People coming from OCS/ECS should pay attention to the new FMODE register, it's the usual culprit when you can't get your stuff to display properly on AGA.
Leffmann is offline  
Old 18 March 2010, 01:49   #16
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Yeah, well I just think there ought to be a proper (Commodore should have released a HRM) version for AGA and not some ascii in an .lha file somewhere which only coders can find

I know, I know, I've come in 12+ years after the fact, but still. Seems a little like learning AGA tricks is like searching for some obscure playing tips for an old adventure game... if you know what I mean...
Photon is offline  
Old 18 March 2010, 02:07   #17
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I think the explanation was that Commodore were trying to get developers to start doing things through the Kickstart APIs instead of hitting the hardware directly, in order to prevent more software from being locked to specific machines.

The AA spec is a bit brief but it works great as a complement to the HRM, and I don't think there are any mysteries left in the AGA anymore unless you take weird intricate timing details into consideration.
Leffmann is offline  
Old 18 March 2010, 18:35   #18
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
OK, I'll have a look when it's time to aga.

Surely they must have documented the hardware changes? I'm hanging on to this question like a terrier just in case someone apart from our usual visitors here DOES know of some obscure but proper book.
Photon is offline  
Old 18 November 2010, 17:21   #19
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Hi,

I have a small problem in that the HSTART,VSTART and HSTOP data is getting displayed along with the sprite! Can anyone please tell me why and how do I correct this, please?


Regards,
Lonewolf10
Attached Thumbnails
Click image for larger version

Name:	SpriteProblem.png
Views:	398
Size:	6.0 KB
ID:	27034  
Lonewolf10 is offline  
Old 18 November 2010, 18:46   #20
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Hey Lonewolf10

can you post a code and sprite data snippet...?
pmc 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
Is there a Pacmania with sprite-collision disabled? Predseda request.Other 3 30 January 2012 17:10
CJ's Elephant Antics - weird collision glitch MethodGit project.WHDLoad 0 21 August 2011 01:57
what games need 'full' collision level ? kirk support.WinUAE 25 07 February 2010 02:01
Hires and fast movement Galahad/FLT support.WinUAE 4 22 November 2009 08:47
Slamtilt and RTC collision Predseda support.Games 5 22 August 2009 22:28

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 17:08.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13464 seconds with 16 queries