13 March 2016, 16:47 | #21 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
|
well, disabling sprite DMA while a sprite is being displayed, gives the horrid vertically repeating sprites, but if you are moving the horizontal position into a non-displayable area, i guess it should work
|
14 March 2016, 09:08 | #22 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
ok, let's hope the best. Another thing: Will it speed up the CPU when I disable sprite-DMA? I know that 5 or 6 plane bitmap DMA will slow down the CPU, but sprites?
|
14 March 2016, 11:15 | #23 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
Usually you have a similar situation when you take over the system and disable all DMA. Sloppy coders forget to disarm the mouse pointer sprite, which sometimes shows as a long vertical bar over the screen. In this case you either have to write zeros to SPRxDATA/SPRxDATB or disarm the sprite with writing 0 to SPRxCTL. No, I don't think so. Sprite, Disk and Audio DMA slots are fixed. Nobody else can use them (ok, except the last sprite DMA slots may be overridden by bitplane DMA). |
|
14 March 2016, 12:06 | #24 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
They have fixed positions but if DMA channel is not needed for current line (even if DMA channel is enabled), it's slot(s) can be used by other lower priority channels, including CPU.
|
14 March 2016, 17:03 | #25 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Wow! I wasn't sure about that. Nice!
|
17 March 2016, 10:29 | #26 | |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
|
Quote:
|
|
09 December 2017, 22:03 | #27 |
tulou
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 88
|
Is it possible to update the pos/ctl/pth/ptl registers using the copper or cpu, and then have sprite dma immideately fetch pixel data at pth/ptl? Or will dma always start by fetching the two control words at pth/ptl (effectively discarding what the copper or cpu wrote)?
|
09 December 2017, 22:56 | #28 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
For example Superfrog and Project-X uses this method. |
|
25 January 2018, 17:03 | #29 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Turning off sprite DMA when it or bitplane DMA is on is the common reason for rolling sprites. The recommended method is to change sprite DMA only during vertical blank (as in: before the magic scanline, see Toni's comment).
It's untested whether setting 0 bitplanes with dc.w $0100,$0200 is a suitable replacement. Any write to BPLCON0 enables bitplane DMA and so should enable sprite DMA IIRC and not work. Maybe Toni could verify. Hmm, I hesitate moving this and the other sprite thread in General to Asm/Hardware, because there's already one there... Maybe I should, anyway? |
20 November 2020, 22:22 | #30 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Apologies for resurrecting an old thread but it may be useful for others.
I'm trying to multi-plex two sprites on the Y Axis and wondering what is the easiest best way to achieve what I want. Here is a video of the task/problem at hand: [ Show youtube player ] The cars are all 64 width hardware sprites, when they explode I simply change the sprite pointers to the sprite data that I have in memory. What should happen in the game is that when the helicopter sprite passes over it should place the car at the Y position where the player respawns to. In the video the helicopter flies to the bottom of the screen and then it is able to place the car because the hw sprite is no longer used. The HRM says that I can link two hardware sprites together by placing their data structures straight after one another, the problem with this is that I would have to blit the two sprites together which would give a performance hit. As the video shows I'm loading the sprite data with the copper, if I wait for a specific line in the display I could do it that way, but then if multiple cars crash it would screw up. Is it even possible for example to set the sprite structure pointers at line $25 for Sprites 0 & 1 (the car) which in their control words have a line position of 70, then after that sprite has been displayed re-arm the sprites with a different data structure showing the helicopter? Am I over thinking this or will I have to copy the two sprites together? In Rygar I had set screen positions in the copper to reload the sprite data, this isn't the same because the cars can crash at any y position. Got me scrahting my head this one - and I think i'm making hard work of it. Cheers, Graeme Last edited by mcgeezer; 20 November 2020 at 22:25. Reason: typos |
21 November 2020, 04:51 | #31 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
How many colors are your sprites using individually? By setting the even and odd sprite banks to different palette offsets you can give each AGA sprite a separate 3 colors independent of one another. That way you can keep your sprites on 2 bitplanes.
|
21 November 2020, 10:05 | #32 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
Re-reading the thread i’m thinking about using a copper interrupt every 8 lines down the screen, if the chopper is beyond the respawn point for the car then it will set the new sprite addresses and rearm with update to sprpos. I’ll try it today. |
|
21 November 2020, 11:53 | #33 | |
Registered User
Join Date: May 2017
Location: AmigaLand
Posts: 459
|
Quote:
If I'm off track please forgive me Edit : So you don't need to copy datas with blitter or cpu Edit bis : Of course, $142 needs to point directly to sprite date and not sprite ctrl. |
|
22 November 2020, 13:35 | #34 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Another related problem I have is hardware sprite clipping, is there an easy way to do it on the Y Axis?
My spites are 116 pixels tall for the car explosion, if the car explodes at the top of the screen I can't clip just the lower part of the hardware sprite. I do have a solution but it isn't elegant, is there another easier way to do it? |
22 November 2020, 15:20 | #35 | |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
|
Quote:
I would write the control word into the sprite data at the correct place (having saved that off somewhere)... then next frame, restore the sprite data that the control word overwrote, and write the next frames control word in wherever needed. |
|
22 November 2020, 16:44 | #36 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
The original explosion sprites were in an IFF with a resolution of 320x580 taking up 93kb, this gave me 25 64x116 sized sprites - most of which were empty. So due to the clipping problem I ran into, I halved the sprite sheet size into 64x58 and got rid of the blank sprites as a result. The only problem was I had to duplicate some sprites, but it still resulted in a chip memory saving of around 10kb. I might revisit it and see if I can manipulate the control words, but my original multiplexing problem still stands which I need to figure out. See attachments for the explosion graphics and what I did with them. |
|
27 August 2021, 15:30 | #37 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
about sprite clipping, is there a way to clip sprites horizontally ?
left of screen: can the amiga use a control word with negative X so the right part of the sprite is drawn? right of screen: my game area doesn't end exactly at the end of display (status bar on the right). ATM the way that works is to put a sprite of higher priority on the side with a black forground but then I have palette issues and I need a super complex copperlist to dynamically change palette. There's also dual playfield, but using DPF just for that brings other problems. I think I'm going to create another sprite area and shift it manually. Any genius ideas? |
27 August 2021, 15:56 | #38 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Ok, main idea is 'abuse' ATT bit for 16 bit sprites, see next message. I did not understand the problem on the left, which in fact does not exist, just put an x lower than the one that makes the sprite appear at full Last edited by ross; 27 August 2021 at 17:19. |
|
27 August 2021, 17:01 | #39 | ||
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
Quote:
Quote:
|
||
27 August 2021, 17:12 | #40 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
Quote:
both are very good points. The sprite xy table I have doesn't take "negative" coords into account. I have to fix that. And the playfield priority trick pleases me because I don't have to change palette dynamically, which is a nightmare for me. But then I don't have enough colors to use another black color. Game uses 16 colors, and I don't want to go full 5 bitplanes just for this. But it would be very quick as it would not change a lot of stuff. In that case I could reuse one of the black colors of the sprite palette. Damn, that problem is not that easy. but thanks. On the other hand, not sure shifting the sprite data at each frame would be costly either on a 16x16 sprite, only for 1 or 2 sprites max. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Settlers sprite | zdechlak | project.Sprites | 1 | 02 March 2019 10:55 |
Best sprite scaling/Doom style engines on Amiga? | ImmortalA1000 | Amiga scene | 95 | 23 July 2018 00:17 |
Amiga Sprite/Tile Cross-Platform Software? | diablothe2nd | Amiga scene | 16 | 12 July 2013 17:29 |
sprite overscan | jamiejamie | Coders. General | 11 | 02 February 2011 16:59 |
DIWSTART and sprite | Camionsauro | Coders. Tutorials | 3 | 22 April 2009 13:24 |
|
|