13 July 2007, 12:16 | #1 |
Registered User
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 |
13 July 2007, 13:43 | #2 |
Global Moderator
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
|
13 July 2007, 14:02 | #3 |
move.l #$c0ff33,throat
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.
|
13 July 2007, 14:12 | #4 |
Registered User
Join Date: Aug 2006
Location: Aberdare, South Wales
Posts: 37
|
Thanks guys! its a start.
|
13 July 2007, 14:29 | #5 |
move.l #$c0ff33,throat
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.
|
15 July 2007, 11:04 | #6 |
Registered User
Join Date: Aug 2006
Location: Aberdare, South Wales
Posts: 37
|
Nice one! Thanks again StingRay.
|
24 September 2007, 01:12 | #7 |
I Identify as an Ewok
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 Code:
.getit movec vbr, d0 |
24 September 2007, 03:36 | #8 |
2 contact me: email only!
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 |
24 September 2007, 09:57 | #9 |
I Identify as an Ewok
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? Last edited by Steve; 24 September 2007 at 10:05. |
27 September 2007, 15:29 | #10 |
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. |
09 March 2010, 09:38 | #11 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Quote:
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 |
|
09 March 2010, 09:48 | #12 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Why would you need a source for that? Sprite routines are here in the thread, that's all you need. |
|
09 March 2010, 10:42 | #13 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Quote:
Good point. When I answer for that question I just realized that you're right. Thanks |
|
18 March 2010, 00:55 | #14 |
Moderator
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. |
18 March 2010, 01:17 | #15 |
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. |
18 March 2010, 01:49 | #16 |
Moderator
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... |
18 March 2010, 02:07 | #17 |
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. |
18 March 2010, 18:35 | #18 |
Moderator
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. |
18 November 2010, 17:21 | #19 |
AMOS Extensions Developer
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 |
18 November 2010, 18:46 | #20 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Hey Lonewolf10
can you post a code and sprite data snippet...? |
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 |
|
|