17 October 2018, 16:32 | #1 |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
How to terminate a sprite in automatic mode?
Hi!
Is it possible to manually turn off automatic data fetching for a sprite channel before it reaches the vertical stop position? I'm missing a control bit for this, does there happen to be one? |
17 October 2018, 17:11 | #2 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Writing to SPRxCTL disables the corresponding sprite.
So wait for the desired line, then write. |
17 October 2018, 22:26 | #3 |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
Really? That seem to work for me only when the sprite is already in manual mode.
|
18 October 2018, 00:42 | #4 |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
If I write to SPRxCTL somewhere between the sprite's DMA slots and its horizontal screen position, that line of the sprite is omitted. The next lines of the sprite are still being displayed however. This behaviour lead me to believe that SPRxCTL does not turn off the automatic data fetch.
|
18 October 2018, 09:24 | #5 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Well, logically it depends on what you write
With proper EVx bits vertical position the fetch stop. Otherwise a write to SPRxDATA, fetched by DMA on next line, rearm the sprite. EDIT: this is the reason for a 0,0 when you want to end a sprite list. These values are loaded by DMA into xPOS and xCTL, after the last defined EVx position, and the fetch end. Practically the values in SVx and EVx are defining the 'window' where the fetch is active and going to xDAT. Last edited by ross; 18 October 2018 at 10:07. |
18 October 2018, 12:00 | #6 |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
I take it you suggest that xDAT is loaded if and only if
SV <= beam y < EV, and that xPOS/xCTL is loaded if and only if beam y = EV. I get a different picture: xDAT is loaded if and only if data fetch is enabled and beam y != EV xPOS/xCTL is loaded if and only if data fetch is enabled and beam y = EV and data fetch is enabled at some point when y beam = SV data fetch is disabled at some point when y beam = EV |
18 October 2018, 12:53 | #7 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
No, what I wrote is that (only for y position, not counting the x behaviour):
Code:
if (SPREN==1) { //leave out in this context the interaction it has with BPLEN
on line 25 (PAL, 20 NTSC) DMA always load SPRxPOS and SPRxCTL
while (SVx<EVx) {
if (line==EVx) { fetch new SPRxPOS and SPRxCTL }
if (line>=SVx)* { fetch SPRxDATA and SPRxDATB }
}
}
* see Toni comment some messages later The condition is even more simple (the DMA simply start at SVx line) EDIT: sorry if respond a bit at a time but I'm a little busy But you are right, if you really want to stop the fetch you need also to clear SPREN and re-enable at copper list start Not that is really a problem, you can position sprites outside of the view or clear xDAT, but maybe your goal is save some DMA cycles I'll make some test and report Last edited by ross; 18 October 2018 at 15:04. |
18 October 2018, 13:27 | #8 |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
So there should be no more DMA fetches if I set EVx = 0, because the while condition wouldn't be satisfied? I tried doing that just now by writing 0 to SPRxCTL, but no, it didn't work... :/
|
18 October 2018, 13:33 | #9 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
18 October 2018, 13:39 | #10 |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
|
18 October 2018, 13:49 | #11 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Quote:
Conditions are really simple: line == SVx: Agnus starts doing sprite SPRxDATx fetches for this sprite. line == EVx: Agnus does SPRxPOS/SPRxCTL fetches for this sprite, then sprite's DMA channel becomes idle. Note that Denise does not care or know nothing about sprite vertical position. |
|
18 October 2018, 13:51 | #12 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Ok, i've got the point.
SPRxCTL need to be ==line in value. And the fetch really stop. EDIT: ops Toni faster, thanks |
18 October 2018, 14:33 | #13 |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
All right, so now we have established that sprite DMA fetches may be disabled by having the sprite reach the vertical stop position. But can it be done before somehow, i.e. without having to go through the "load new xPOS/xCTL"-step?
|
18 October 2018, 14:57 | #14 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
A xCTL write is due before the EV==line position (or this very same line if early on position). |
|
18 October 2018, 15:27 | #15 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
18 October 2018, 15:35 | #16 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
All Y-coordinate values are located in registers inside Agnus. They don't matter when sprite is in non-DMA mode. (and vice versa, X-coordinates are only located inside Denise, Agnus does not care)
|
18 October 2018, 15:45 | #17 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
18 October 2018, 15:47 | #18 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
Quote:
Interesting to know the reason this worked! |
|
26 October 2018, 01:32 | #19 | |
Registered User
Join Date: Feb 2017
Location: Oslo
Posts: 90
|
Hello again!
First, thank you all for the replies. It's been a week since I started this thread now, and the time is probably overripe for this, but I hereby confess that still I don't see how the the answers given so far answers my question. The most conclusive reply I got was this: Quote:
This solution isn't exactly what I would like, because it still relies on the sprite channel to stop the automatic fetches. I'm aiming at a solution that stops the fetches directly, without having to go through the standard mechanism. The other main thing that's been brought up is that HPOS- and VPOS-related parameters are stored in separate chips. I must say I currently don't know what difference it makes which chip a piece of data is stored in. Maybe this is where I fail? More interesting for this problem, the way I see it, is where the automatic fetch status for each sprite channel is stored. I haven't found anything on this in the HWRM yet. :S |
|
26 October 2018, 10:28 | #20 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
The point about y being in agnus means that agnus controls sprite dma fetch (which is only related to y pos), and I'm afraid you can't turn that off manually - since the vertical stop pos is in the second control word, it has to be cached by agnus internally somehow, otherwise it wouldn't know when the next control/end of sprite words are encountered.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mani Pulite sprite problems (A500 mode) | andreas | support.WinUAE | 17 | 22 January 2015 14:41 |
Start automatic.. | Nightmare4k | support.FS-UAE | 8 | 08 November 2014 16:53 |
Automatic Savestates | Another World | request.UAE Wishlist | 12 | 17 January 2009 19:55 |
'Warp Mode' broken in 'windowed mode' | NoX1911 | support.WinUAE | 3 | 26 May 2007 01:05 |
REQ: Automatic resolution change ; automatic resolution detection | Borg_Number_One | request.UAE Wishlist | 3 | 21 August 2004 14:16 |
|
|