English Amiga Board


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

 
 
Thread Tools
Old 29 July 2015, 18:13   #1
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Reuse sprite, attached and unattached

Is it possible to create an unattached sprite with the copper at the beginning of a line, followed by the same sprite (and its companion sprite) at the end of a line, but this time attached?

Example (single line):
Sprite 6 (4col) at xpos=16.
Sprite 6 and 7 (16col) at xpos=248.

In my game the DMA for sprite 6 and 7 is not available anyway, so I always write their SPRxPOS and SPRxDAT with the copper. For the example line I hope to use the following sequence:

SPR6POS,SPR6DATA,SPR6DATB,WAIT(after Spr6 is displayed),SPR6CTL,SPR7CTL,SPR6POS,SPR6DATA,SPR6DATB,SPR7POS,SPR7DATA,SPR7DATB

Sprite 6 and 7 don't have an attached bit set before this line. Now I set it with SPR7CTL in the middle of the line. I know that an access to the control register disables the sprite. But writing to SPRxPOS and SPRxDAT arms it again, right?

Could that ever work?
phx is offline  
Old 29 July 2015, 20:46   #2
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Don't know the answer off the top of my head - sorry - but... this would seem like a good candidate for just trying it and seeing what happens. Nothing worse than "nope, that didn't work" could possibly await
pmc is offline  
Old 29 July 2015, 20:54   #3
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
PMC, are you back or am I imagining this?

phx, I agree with PMC. I think it will probably work
Lonewolf10 is offline  
Old 29 July 2015, 21:01   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Not answering the question, not sure but it probably works but what about simply keeping attach bit always enabled and adjust palette to match changed "not actually attached" sprites' palette selection? (If possible, it reduces number of unique sprite colors)
Toni Wilen is offline  
Old 29 July 2015, 23:14   #5
TheDarkCoder
Registered User
 
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 213
I bet it works, but you have to try! ;-)

Quote:
Originally Posted by phx View Post
Is it possible to create an unattached sprite with the copper at the beginning of a line, followed by the same sprite (and its companion sprite) at the end of a line, but this time attached?

Example (single line):
Sprite 6 (4col) at xpos=16.
Sprite 6 and 7 (16col) at xpos=248.

In my game the DMA for sprite 6 and 7 is not available anyway, so I always write their SPRxPOS and SPRxDAT with the copper. For the example line I hope to use the following sequence:

SPR6POS,SPR6DATA,SPR6DATB,WAIT(after Spr6 is displayed),SPR6CTL,SPR7CTL,SPR6POS,SPR6DATA,SPR6DATB,SPR7POS,SPR7DATA,SPR7DATB

Sprite 6 and 7 don't have an attached bit set before this line. Now I set it with SPR7CTL in the middle of the line. I know that an access to the control register disables the sprite. But writing to SPRxPOS and SPRxDAT arms it again, right?

Could that ever work?
TheDarkCoder is offline  
Old 30 July 2015, 11:57   #6
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Ok, so I have to try that. Just wanted to know about my chances before doing so, because it needs some work to prepare all the code and graphics.

Quote:
Originally Posted by Toni Wilen View Post
what about simply keeping attach bit always enabled and adjust palette to match changed "not actually attached" sprites' palette selection?
I already had the same idea, but as far as I understand sprite 7 will no longer use the same colours as sprite 6 in such a case. And I need these two sprites in other locations on the screen with their common colours.
phx is offline  
Old 02 August 2015, 20:29   #7
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
FYI, it works!
phx is offline  
Old 02 August 2015, 23:42   #8
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Yes!
Lonewolf10 is offline  
Old 03 August 2015, 12:58   #9
TheDarkCoder
Registered User
 
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 213
very good!
I win my bet! :-)
Which is my reward? An A3000T ? :-)
TheDarkCoder 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
Amiga Coverdisks - How were they attached? bill-rhit Nostalgia & memories 23 13 February 2013 17:08
Minimising attached picture size mark_k project.EAB 1 03 February 2013 21:12
Identify attached module absence request.Modules 7 12 August 2012 23:45
WinUAE 2.4.1 does not boot with attached HD anymore Jasmin68k support.WinUAE 9 18 June 2012 09:31
Attached sprite coming out 8 pixels wide (UAE) korruptor Coders. General 8 17 January 2008 09:04

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:52.

Top

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