English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 February 2021, 13:57   #1
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
AGA hardware sprite question

I'm trying to program hw sprites where data is coming from dynamic locations, meaning I don't have a static sprite structure, but want to feed the sprites data from either a dynmaic location in memory, or by manually setting the data/datb fields, on every line.

Manually setting the data/datb and pos registers on each display line works fine on OCS, but how can I do the same for AGA 4x sprites, when there are 4 words, and regs are 16 bits?

Alternatively is there a way to change the sprite pointer every line to read sprite data (4x) from a new location?
I have tried to setup sprites before display, and then change the pth/ptl and pos regs every line but no luck.
agermose is offline  
Old 26 February 2021, 14:31   #2
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 2,756
Sadly, you can't feed 4x sprites manually
Reloading pointers should work though, so it's weird that is doesn't.
roondar is offline  
Old 26 February 2021, 14:47   #3
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Quote:
Originally Posted by roondar View Post
Sadly, you can't feed 4x sprites manually
Reloading pointers should work though, so it's weird that is doesn't.
Thanks, that's what I was afraid of. I'll make some more expirements with DMA sprites, and rewriting the pointers.
agermose is offline  
Old 26 February 2021, 18:12   #4
Photon
Moderator

Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 4,948
If putting lots of sprite data into a Copper list is OK, then generating the sprites will actually be the same processing time. And it will be less DMA time (if you don't need a WAIT on each scanline for other things and can omit it).
Photon is offline  
Old 26 February 2021, 22:17   #5
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Quote:
Originally Posted by Photon View Post
If putting lots of sprite data into a Copper list is OK, then generating the sprites will actually be the same processing time. And it will be less DMA time (if you don't need a WAIT on each scanline for other things and can omit it).
Yes, correct, but also higher memory usage.
There is a bit more to it, than what I wrote initially, because I also want to reposition the sprites on every scanline, besides changing the data ptr.
agermose is offline  
Old 26 February 2021, 22:30   #6
Photon
Moderator

Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 4,948
Quote:
Originally Posted by agermose View Post
Yes, correct, but also higher memory usage.
There is a bit more to it, than what I wrote initially, because I also want to reposition the sprites on every scanline, besides changing the data ptr.
All that you could do has been considered. <3

As I wrote it's likely you will save memory writing sprite data with the CPU instead of the Copper.

You can still set sprite position with the Copper per scanline. Try it!
Photon is offline  
Old 26 February 2021, 22:32   #7
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Can someone enlighten me, how to change the data pointer and position of a DMA sprite on any scanline?
I have set up a copperlist which initially sets the sprite ptr to a sprite structure, where the control words are: dc.w $2c60,$0c02
VSTART=$2c, HSTART=$60, VSTOP=$10c
The rest of the sprite structure is some dummy data.

This works fine, but when I try and change the HPOS or PTR in a scanline, then weird stuff happens.
If I change to a bigger xpos, then the sprite is moved, and uses the new data ptr, but the old data is still shown in the old hpos ($60).
I have a feeling there is some timing issue, when the changes are done.

Each scanline I wait for position $xx05, where xx is the vertical pos, and then set the sprite ptr/pos.

Last edited by agermose; 26 February 2021 at 22:39.
agermose is offline  
Old 26 February 2021, 22:53   #8
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Quote:
Originally Posted by Photon View Post
All that you could do has been considered. <3

As I wrote it's likely you will save memory writing sprite data with the CPU instead of the Copper.

You can still set sprite position with the Copper per scanline. Try it!
Thanks for your help.
Yes I know I can move the sprites with the copper. I have done this before with "manual" sprites, including multiplexing on every line (score panel in 1942 is an example).
But somehow rewriting "DMA sprites" is not working for me. Will try out some more things.

Last edited by agermose; 27 February 2021 at 18:23.
agermose is offline  
Old 26 February 2021, 22:58   #9
Adrian Browne
Jackie Chan
 
Join Date: Mar 2012
Location: Ireland
Age: 43
Posts: 812
Quote:
Originally Posted by agermose View Post
Thanks for your help.
Yes I know I can move the sprites with the copper. I have done this before with "manual" sprites, including multiplexing on every line (score panel in 1942 is an example).
But somehow rewriting "DMA sprites" are not working for me. Will try out some more things.
Are you making a game?
Adrian Browne is offline  
Old 26 February 2021, 23:03   #10
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Putting the sprite outside the display window hides the "original" drawing. I'll go with this solution for now.
agermose is offline  
Old 26 February 2021, 23:04   #11
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Quote:
Originally Posted by Adrian Browne View Post
Are you making a game?
Yes it's for another game, on AGA hw.
agermose is offline  
Old 26 February 2021, 23:12   #12
Adrian Browne
Jackie Chan
 
Join Date: Mar 2012
Location: Ireland
Age: 43
Posts: 812
Quote:
Originally Posted by agermose View Post
Yes it's for another game, on AGA hw.
Cool. What type of game is it may i ask?
Adrian Browne is offline  
Old 26 February 2021, 23:31   #13
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Quote:
Originally Posted by Adrian Browne View Post
Cool. What type of game is it may i ask?
It's an arcade conversion, but it's a secret, until I have verified the project is doable. Hope to have something to announce soon.
agermose is offline  
Old 26 February 2021, 23:38   #14
Adrian Browne
Jackie Chan
 
Join Date: Mar 2012
Location: Ireland
Age: 43
Posts: 812
Quote:
Originally Posted by agermose View Post
It's an arcade conversion, but it's a secret, until I have verified the project is doable. Hope to have something to announce soon.
Fair enough- cool.
Adrian Browne is offline  
Old 01 March 2021, 12:14   #15
agermose
Registered User

 
Join Date: Nov 2019
Location: Odense / Denmark
Posts: 126
Got everything sorted out now, thanks for all the help.

Oh yes, and a tip for everyone. If you have separate copperlists for each screen in a doublebuffer system, and dynamically build the content, make sure there is enough room for all the copper commands :-(
agermose is offline  
Old 03 March 2021, 23:37   #16
Photon
Moderator

Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 4,948
Yes, Copperlists can swell but... on AGA you'll have room??

If you really have tons of other chipmem assets, maybe require fastmem and generate them from there?

Why oh why didn't A1200 come with just a smidge of fastmem... would have lifted even the humble EC020 to the sky!
Photon 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
Console sprite hardware/animation vs Amiga/other home computers Solo Kazuki Retrogaming General Discussion 31 20 July 2020 23:27
Sprite hardware vs blitting sprites Nightfox Coders. Asm / Hardware 55 21 May 2020 18:15
Pointer to blank (null) hardware sprite DanScott Coders. Asm / Hardware 10 08 March 2020 15:48
Hardware Sprite Glitch Old_Bob support.WinUAE 4 05 April 2018 23:53
Using hardware sprite images more than once per lin jimmy2x2x Coders. General 5 20 November 2014 11:30

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 02:36.


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