English Amiga Board


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

 
 
Thread Tools
Old 13 March 2020, 13:44   #1
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Re-using AGA sprites on the same scanline?

Hi,

In this post here Toni references that AGA sprites can be re-used on the same scan line.

"Sprite can appear twice in same horizontal scanline without using copper tricks. (Side-effect of a bit hacky scan doubling implementation, very limited but can be used for some background sprite effects)"

Does anyone (including Toni) have any further info on how to exploit this as I'm keen on using some sprites for a background effect.

Geezer
mcgeezer is offline  
Old 13 March 2020, 13:58   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
Hi Graeme, you need to set SSCAN2 (bit 15) on FMODE.
Then when you set SH10 (bit7) in SPRxPOS, horizontal coincidence detection is for both x positions (SH10 = 0 or 1).
ross is offline  
Old 13 March 2020, 14:00   #3
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by ross View Post
Hi Graeme, you need to set SSCAN2 (bit 15) on FMODE.
Then when you set SH10 (bit7) in SPRxPOS, horizontal coincidence detection is for both x positions (SH10 = 0 or 1).
Thanks Ross, I'll give it a shot tonight.
mcgeezer is offline  
Old 14 March 2020, 11:59   #4
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Interesting... am I reading this correctly in that SH10 would effectively be both on and off at the same time? If so I guess the sprites are always going to be a set distance apart?
timg is offline  
Old 14 March 2020, 12:35   #5
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,797
Yeah, keep us updated...
Tigerskunk is offline  
Old 14 March 2020, 13:04   #6
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
I give an example, I probably answered hastily.

Suppose you set a sprite with SPRxPOS=$2c40 in a default DIW value low-res screen.
A sprite at top/left corner appear.
If you also set FMODE=$800x then sprite is doubled, on the same lines, at $40+$80 (so spaced away by 256 pixels).

And if you set SPRxPOS>=$2c80?
Well, test for yourself, but the effect is interesting
ross is offline  
Old 14 March 2020, 13:33   #7
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
If it's 256 pixels apart that could work for me... going to have a play with that!
timg is offline  
Old 14 March 2020, 18:44   #8
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
It works!

Not the most exciting example, but the white lines here are 64px wide sprites, which are then duplicated in the purple border off to the right.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	184
Size:	10.3 KB
ID:	66463  
timg is offline  
Old 14 March 2020, 19:37   #9
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Same here...

Although I'm getting some strange results when I play with the upper sprites....

Sprites 1+2 are attached and repeated 64px wide sprites
Sprites 3+4 are attached and repeated 64px wide sprites.

Sprites above that seem to scan double... very weird.

mcgeezer is offline  
Old 14 March 2020, 20:12   #10
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Are the lower (green masked) characters being duplicated with SSCAN2? I was thinking it had to be on the same line?
timg is offline  
Old 14 March 2020, 20:22   #11
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by timg View Post
Are the lower (green masked) characters being duplicated with SSCAN2? I was thinking it had to be on the same line?
No, those are just bobs.

(sorry should have mentioned that).
mcgeezer is offline  
Old 14 March 2020, 20:31   #12
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Ah OK, that makes more sense!

Unless I'm missing something the downside of this is that it seems it's an all or nothing thing... I don't think you can repeat 4*64px sprites across the screen, but have other sprites not repeating within the same horizontal band of the screen. (not sure if I've explained that clearly!)
timg is offline  
Old 14 March 2020, 20:46   #13
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by timg View Post
Ah OK, that makes more sense!

Unless I'm missing something the downside of this is that it seems it's an all or nothing thing... I don't think you can repeat 4*64px sprites across the screen, but have other sprites not repeating within the same horizontal band of the screen. (not sure if I've explained that clearly!)
No, I know what you mean (I think).

The thought occurs though that you can have a very nice full screen repeating background (256px wide).

You would be limited on colours if using scrolling because in my example I'm having to lose 3 sprites due to DDFSTRT.

I wonder how they did this in Flink, apparently it uses the same technique.
mcgeezer is offline  
Old 14 March 2020, 21:02   #14
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,213
Flinks background layer appears to repeat every 128 pixels by the look of it, so they are probably just re-arming SPRxPOS with the copper to repeat the sprite data

Beautiful looking game is Flink, but don't know why they let the background parallax appear behind the status panel at the top.. it just looks very odd to me
DanScott is offline  
Old 14 March 2020, 21:04   #15
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
Flink does not use SSCAN2.
FMODE fetches = x4 for sprites and x2 for bpls, DDFSTRT=$30, DIW = $91 to $b1, sprites repeated with the usual copper x-multiplexing.
ross is offline  
Old 14 March 2020, 21:06   #16
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by ross View Post
Flink does not use SSCAN2.
FMODE fetches = x4 for sprites and x2 for bpls, DDFSTRT=$30, DIW = $91 to $b1, sprites repeated with the usual copper x-multiplexing.
Then bull shit is what I read somewhere else.
mcgeezer is offline  
Old 14 March 2020, 21:19   #17
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
Quote:
Originally Posted by mcgeezer View Post
Then bull shit is what I read somewhere else.


If you want a game that use SSCAN2 with a 256px sprites repeated background look for Fantastic Dizzy AGA.
FMODE fetches like Flink, but DDFSTRT=$38, DIW = $a1 to $1a1, all 8 sprites used for the background (4x64x16colors).
ross is offline  
Old 14 March 2020, 21:23   #18
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Quote:
Originally Posted by mcgeezer View Post
The thought occurs though that you can have a very nice full screen repeating background (256px wide).

You would be limited on colours if using scrolling because in my example I'm having to lose 3 sprites due to DDFSTRT.
That's exactly what I was thinking too...

Quote:
Originally Posted by mcgeezer View Post
I wonder how they did this in Flink, apparently it uses the same technique.
How have I not heard of Flink before?!?! That's got some seriously nice pixel art.


Quote:
Originally Posted by DanScott View Post
Flinks background layer appears to repeat every 128 pixels by the look of it, so they are probably just re-arming SPRxPOS with the copper to repeat the sprite data
They are still managing to scroll the background vertically, I thought that would be quite time consuming with x-multiplexing... would you have to update every row individually?

Quote:
Originally Posted by DanScott View Post
Beautiful looking game is Flink, but don't know why they let the background parallax appear behind the status panel at the top.. it just looks very odd to me
Very true. Does make the play area look larger when you're outside though.
timg is offline  
Old 14 March 2020, 21:40   #19
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,797
Quote:
Originally Posted by timg View Post


They are still managing to scroll the background vertically, I thought that would be quite time consuming with x-multiplexing... would you have to update every row individually?
They just need to update the pointer to the sprites start.
Compared to the rest that you need to take care of in x-multiplexing for a bg scroll layer this is not complicated.
Tigerskunk is offline  
Old 14 March 2020, 22:28   #20
timg
Registered User
 
Join Date: Jan 2020
Location: Saltash
Posts: 27
Quote:
Originally Posted by Steril707 View Post
They just need to update the pointer to the sprites start.
Compared to the rest that you need to take care of in x-multiplexing for a bg scroll layer this is not complicated.
Ah, is that for a whole screen... I've been thinking of mixing layers of sprites with bitplane parallax layers and scrolling those vertically which does make the copperlist more complex.
timg 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
Sprites mutliplexing AGA mcgeezer Coders. General 24 29 August 2018 19:20
Aga Sprites Attached issue sandruzzo Coders. Asm / Hardware 11 28 April 2016 14:17
AGA: Using 32 pixel sprites twice per scanline buzzybee Coders. Asm / Hardware 18 05 January 2016 20:26
AGA border sprites mark_k support.WinUAE 9 06 January 2014 14:35
EHB sprites with AGA chipset ? FrenchShark Coders. General 4 17 September 2009 06:37

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 03:25.

Top

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