English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 24 March 2024, 19:11   #1
REAKTOR BEAR
Registered User
 
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
Multiple sprite copies

At the moment we are using copperlist to initiate sprites during vblank, but that only gives us 8 sprites on the same display-line spr0, spr1, spr2, spr3, spr4, spr5... and so on.

Is it possible to have multiple copies of a sprite on the same display line?

REAKTOR BEAR is offline  
Old 24 March 2024, 19:31   #2
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Yes, but you have to usual manual mode for the repeated sprites. On Codetappers site there are a number of examples that might inspire you: https://codetapper.com/amiga/sprite-tricks/

But since that technique is limit you may want to rethink (or describe) what you're trying to do.
paraj is offline  
Old 24 March 2024, 19:52   #3
REAKTOR BEAR
Registered User
 
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
We are trying to display a 96px wide attached sprite with 16colors on A500 OCS. So that will require using some sprites multiple times on the same display line. 12 sprites are needed for 96px, 16colors.

Seems like this guy is using that kind of method, recycling 2x sprites to fill the entire background.
https://codetapper.com/amiga/sprite-tricks/jim-power/

Last edited by REAKTOR BEAR; 24 March 2024 at 20:00.
REAKTOR BEAR is offline  
Old 24 March 2024, 22:09   #4
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,197
I'm pretty sure that you cannot change the sprite data itself, just repeat the same sprite pattern with this technique.

does this trick work with attached sprites? another interrogation.

I've successfully implemented sprite multiplexing (with ross' help), but defining a "high" and "low" zone.

Typically, it is possible to use 8 sprites per playfield for an horizontally split screen 2 player game (like Lotus)
jotd is offline  
Old 24 March 2024, 23:31   #5
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 863
There was this? [ Show youtube player ]
Coagulus is online now  
Old 24 March 2024, 23:35   #6
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by jotd View Post
I'm pretty sure that you cannot change the sprite data itself, just repeat the same sprite pattern with this technique.

does this trick work with attached sprites? another interrogation.

I've successfully implemented sprite multiplexing (with ross' help), but defining a "high" and "low" zone.

Typically, it is possible to use 8 sprites per playfield for an horizontally split screen 2 player game (like Lotus)
Data can be changed, too. In fact a write to sprxdata is necessary to rearm the sprite if the sprite was disarmed at some point with a write to sprxctl.
mc6809e is offline  
Old 25 March 2024, 08:57   #7
REAKTOR BEAR
Registered User
 
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
Thanks for all the great info, we ended up using copperlist and flipping the bitplanes settings on different vertical positions of the screen. And thanks to paraj for that awesome link to Sprite tricks.
REAKTOR BEAR is offline  
Old 25 March 2024, 11:22   #8
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
Quote:
Originally Posted by jotd View Post
does this trick work with attached sprites?
It works, but the problem increases because two sprites must have the timed setting for the repositioning of the x position (and possibly a change in shape data).
You have to find some compromises regarding the number of bitplanes or copper effects you want to be able to do on the same video line.
This type of multiplex is really heavy, so even the use of blitter is limited because there are few free DMA slots left in the frame
ross is offline  
Old 25 March 2024, 15:41   #9
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by ross View Post
It works, but the problem increases because two sprites must have the timed setting for the repositioning of the x position (and possibly a change in shape data).
You have to find some compromises regarding the number of bitplanes or copper effects you want to be able to do on the same video line.
This type of multiplex is really heavy, so even the use of blitter is limited because there are few free DMA slots left in the frame
The recent thread by !ZAJC! https://eab.abime.net/showthread.php?t=117203 suggests that in theory MOVEM.L to sprite registers with race-the-beam style/cycle exact programming is possible and would maximize unique sprites per line. Blitter would have to be off/paused of course. Lots of limits.

Not sure anyone has ever tried it on the Amiga though I think Jay Minor who also designed the atari 2600 would have certainly approved.
mc6809e is offline  
Old 25 March 2024, 15:54   #10
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
Quote:
Originally Posted by mc6809e View Post
The recent thread by !ZAJC! https://eab.abime.net/showthread.php?t=117203 suggests that in theory MOVEM.L to sprite registers with race-the-beam style/cycle exact programming is possible and would maximize unique sprites per line. Blitter would have to be off/paused of course. Lots of limits.

Not sure anyone has ever tried it on the Amiga though I think Jay Minor who also designed the atari 2600 would have certainly approved.
I see major limitations in using movem.l for sprites.
In any case, one is forced to use writing blocks that include from SPRxCTL to SPRxDATA (in reverse mode), so it would only be useful for complete updates of both the position and the shape (all 'repetitions' or partial positionings or partial data would be excluded).
Furthermore, synchronization with the CPU would take away many precious cycles, however you intend to do it (a problem that you wouldn't have with Copper).
It is probably a technique that has never been used because it does not have great advantages
Obviously it could work and as a proof of concept it would be feasible (a massive sprite background!).
But there are other more interesting things to try

EDIT: And I forgot another fundamental point!
Copper is memoryless.
Instead, even after having filled all the possible registers of the sprites with the CPU, you need to re-fill the CPU registers for the new re-writing, which you must necessarily fetch from memory, and you must do it 'racing the beam'.
At that point you lose all the advantages you had gained using the technique...

Last edited by ross; 25 March 2024 at 16:08.
ross is offline  
Old 25 March 2024, 18:53   #11
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by ross View Post
I see major limitations in using movem.l for sprites. <snip>
At that point you lose all the advantages you had gained using the technique...
You make good points.

One thing, though. As long as movem.l uses some addressing mode other than predecrement mode memory is written to in-oder. This works for updating a sprite completely since a write to sprxclt disarms a sprite while a write to sprxdata realms it and they are they're mapped to memory in that order.

But, yeah, trying to cram all that data into registers between scalines would be tough.

Maybe a hybrid approach could work. Let DMA take care of four/six sprites and cpu the other two/four. Memory accesses would interleave.

Meh. Probably still too many issues.
mc6809e is offline  
Old 25 March 2024, 19:35   #12
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
Quote:
Originally Posted by mc6809e View Post
One thing, though. As long as movem.l uses some addressing mode other than predecrement mode memory is written to in-oder. This works for updating a sprite completely since a write to sprxclt disarms a sprite while a write to sprxdata realms it and they are they're mapped to memory in that order.
Right
Also it is better since there is no variation of the base register in the case of rx-ry,(ax)
I misremembered the order of the registers..
ross is offline  
Old 27 March 2024, 19:22   #13
REAKTOR BEAR
Registered User
 
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
On A500 OCS, lowres, 1bitplane, single playfield, Auto-loaded sprites... Sprite6 is somewhat defective, and Sprite7 is missing in action. Is there some setting in BPLCON to fix this issue?



Code:
sprcopper:
	dc	spr0pth,$0000
	dc	spr0ptl,$0000
	dc	spr1pth,$0000
	dc	spr1ptl,$0000
	dc	spr2pth,$0000
	dc	spr2ptl,$0000
	dc	spr3pth,$0000
	dc	spr3ptl,$0000
	dc	spr4pth,$0000
	dc	spr4ptl,$0000
	dc	spr5pth,$0000
	dc	spr5ptl,$0000
	dc	spr6pth,$0000
	dc	spr6ptl,$0000
	dc	spr7pth,$0000
	dc	spr7ptl,$0000
Code:
spr0pth = $120
spr0ptl = $122
spr1pth = $124
spr1ptl = $126
spr2pth = $128
spr2ptl = $12a
spr3pth = $12c
spr3ptl = $12e
spr4pth = $130
spr4ptl = $132
spr5pth = $134
spr5ptl = $136
spr6pth = $138
spr6ptl = $13a
spr7pth = $13c
spr7ptl = $13e

Last edited by REAKTOR BEAR; 27 March 2024 at 20:38.
REAKTOR BEAR is offline  
Old 27 March 2024, 20:43   #14
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Do you use overscan, how your dma fetch window looks like ($dff092/94)?
http://amigadev.elowar.com/read/ADCD.../node02D4.html
a/b is offline  
Old 27 March 2024, 21:46   #15
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
With DDFSTART set for scrolling (ie 16 pixels to left of regular display window), you lose the last sprite and half of the previous sprite, as bitplane DMA steals those slots
DanScott 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
running two copies of winuae Phantasm support.WinUAE 23 14 September 2019 01:46
Blatantly selling copies slk486 MarketPlace 29 19 June 2011 13:18
Looking for Release copies of A64 EmulationGuy request.Apps 23 14 October 2010 15:04
Replacement copies on Ebay... th4t1guy MarketPlace 6 19 July 2003 11:00
Can someone confirm OK copies of these? dirkies request.Old Rare Games 7 07 August 2002 10:24

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

Top

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