English Amiga Board


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

 
 
Thread Tools
Old 29 July 2015, 19:13   #1
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,203
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 online now  
Old 29 July 2015, 21:46   #2
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
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, 21:54   #3
Lonewolf10
AMOS Extensions Developer
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 39
Posts: 1,919
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, 22:01   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,026
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 online now  
Old 30 July 2015, 00:14   #5
TheDarkCoder
Registered User
 
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 211
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, 12:57   #6
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,203
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 online now  
Old 02 August 2015, 21:29   #7
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,203
FYI, it works!
phx is online now  
Old 03 August 2015, 00:42   #8
Lonewolf10
AMOS Extensions Developer
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 39
Posts: 1,919
Yes!
Lonewolf10 is offline  
Old 03 August 2015, 13:58   #9
TheDarkCoder
Registered User
 
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 211
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 18:08
Minimising attached picture size mark_k project.EAB 1 03 February 2013 22:12
Identify attached module absence request.Modules 7 13 August 2012 00:45
WinUAE 2.4.1 does not boot with attached HD anymore Jasmin68k support.WinUAE 9 18 June 2012 10:31
Attached sprite coming out 8 pixels wide (UAE) korruptor Coders. General 8 17 January 2008 10: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 21:58.


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