08 July 2023, 19:54 | #1 |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
|
Question about overscan and sprites
I have a question for the Amiga hardware gurus, if you'd be so kind, please:
I'm currently looking at the MiST/TC64 Minimig core, trying to fix a few glitches and issues, and currently investigating the demo Ray of Hope 2 by Majic12.I have some random sprite garbage in the interference circles effect, which is coming from sprite 7. Looking at the copperlist, two things stand out immediately: Code:
00053348: 0092 0018 ; DDFSTRT := 0x0018 0005334c: 0094 00e0 ; DDFSTOP := 0x00e0 00053350: 008e 1011 ; DIWSTRT := 0x1011 00053354: 0090 38ff ; DIWSTOP := 0x38ff ... bitplane stuff ... 0005337c: 0120 0005 ; SPR0PTH := 0x0005 00053380: 0122 5000 ; SPR0PTL := 0x5000 00053384: 0124 0005 ; SPR1PTH := 0x0005 00053388: 0126 5000 ; SPR1PTL := 0x5000 0005338c: 0128 0005 ; SPR2PTH := 0x0005 00053390: 012a 5000 ; SPR2PTL := 0x5000 00053394: 012c 0005 ; SPR3PTH := 0x0005 00053398: 012e 5000 ; SPR3PTL := 0x5000 0005339c: 0130 0005 ; SPR4PTH := 0x0005 000533a0: 0132 5000 ; SPR4PTL := 0x5000 000533a4: 0134 0005 ; SPR5PTH := 0x0005 000533a8: 0136 5000 ; SPR5PTL := 0x5000 000533ac: 0138 0005 ; SPR6PTH := 0x0005 000533b0: 013a 5000 ; SPR6PTL := 0x5000 2. Sprite 7's pointers aren't being initialised. I *think* what's happening is that during the last line of VBLANK the control words are being fetched for all eight sprites and then it's trying to display sprite 7 even though the overscan should prevent it from being used. My main questions are: 1. During the last line of vblank, should all eight sprites be able to fetch their control words, even though DDFSTART has already been set to 0x18? (bearing in mind bitplane DMA doesn't start until the following row.) 2. The core seems to be using a cycle-by-cycle priority-based allocation for the DMA slots - so the sprite's cycle is only stolen if bitplane DMA actually wants the cycle. But there are two requests in each sprite slot, and when only two bitplanes are active, only one of the two requests is blocked. Should it perhaps instead be blocking all sprite DMA requests after DDFSTART? 3. What happens on real hardware when the display is overscanned to the point where you lose sprites, but those sprites are still enabled? Do they disappear, or just get corrupted? Any insights would be gratefully received! |
08 July 2023, 20:20 | #2 | |||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
Quote:
Quote:
Quote:
Also note that there is OCS/A1000 Agnus extra condition (bug): Sprite slot is also "stolen" (inbihited is probably better word) by bitplane DMA if bitplane DMA starts in following cycle. ECS fixed this off by one bug. Other DMA channels are not affecteded and can use unused bitplane DMA slots normally. EDIT: and nasty bug: https://eab.abime.net/showpost.php?p...&postcount=277 (haven't found any programs that triggers this but if it happens, it can be quite mysterious to debug) Last edited by Toni Wilen; 08 July 2023 at 20:33. |
|||
08 July 2023, 20:43 | #3 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Quote:
But this is not the case with the demo in question because looking at the copper list something else happens: DIWSTRT := 0x1011 Bitplane DMA fetches start long before the first sprite fetches (at PAL line $19). So there is no longer any position control for any of the sprites and many video glitches could theoretically happen if the values present in the registers are previously 'wrong'. |
|
09 July 2023, 00:28 | #4 | |||
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
|
Quote:
Quote:
Quote:
Once again, thanks for the input - much appreciated. |
|||
09 July 2023, 20:21 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
|
|
09 July 2023, 20:48 | #6 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
First game that came to my mind:
https://eab.abime.net/showpost.php?p...3&postcount=35 (but there are others, mostly demos) Quote:
So for 10 lines what happens is simply lost DMA fetches.. The same effect would be achieved, thus saving precious bus cycles, by simply setting the DIW to $1axx and the bitplane pointers 10 lines later. |
|
10 July 2023, 12:19 | #7 |
German Translator
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 185
|
1. I like the terminology "aggresive" overscan, but the maximum is:
dc.w $8e,$1a5c,$90,$38d4,$92,$20,$94,$d8 ; Overscan (DiwStrt, DiwStop, DdfStart, DdfStop) and a datafetch $92,$18 is only necessary for scrolling? 3. vertical blank goes from line $0 to $19 ? $1a is first visible displayline and also first possible Y-spriteposition. earlier bitplane dma fetch is possible but useless, because loosing dma slots and sprite dma fetch starts always in line $19 if sprite dma is enabled ? 3. topic: loosing sprites if DDFSTRT < $38 if OCS/ECS/AGA (two old posts) https://eab.abime.net/showthread.php...hlight=DDFSTRT https://eab.abime.net/showthread.php?t=89276 |
10 July 2023, 13:25 | #8 | ||
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Quote:
Pixel at $5c is a bit 'ephemeral' in videocomposite PAL (no problem for H&V or CSYNC in RGB). The colorburst signal can "spill over" at that location and make 'noise' (this at least from field tests, which may or may not be correct and dependent on the devices). Probably for convenience and simplicity the hardwired values remained the same between NTSC (where the problem doesn't exist, given the slightly higher frequencies) and PAL, and as a solution the workbench drivers start the visible part from $5d (at least, this is the explanation I gave myself, corroborated by a NewTek document where this 'value' is indicated in a document concerning genlock in PAL). It is however a non-problem given that few use videocomposite and above all with a similar overscan, and very few devices are set to display it (by default none). From that point there are 376 low resolution pixels visible (377 in ECS and AGA), in standard PAL mode. EDIT: if I remember correctly in ICS the horizontal blank lasts even longer (STRT=$61 or something?), so even '376' pixels are not always guaranteed.. The end position is only virtually $d4, because the Denise counter do not reach this value (it count from 2 to $(1)c7). So if you set a value >=$1c8 any pixel to the right is rendered, up to the start of the hblank. About datafetch from $18: yes, indeed the demo in #1 uses scrolling Quote:
EDIT: line at '-1' is not blanked but unusable (excluding COLOR00), line0 is also start for Copper and VBI. This in not true on ICS where line -1 is usable and VBI trigger at line1. Last edited by ross; 10 July 2023 at 14:23. |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A question about AGA sprites | ImmortalA1000 | Coders. General | 3 | 05 August 2022 16:10 |
Overscan | CubeTheory | support.Hardware | 6 | 27 March 2020 13:51 |
Newbie question about sprites... or copperlist perhaps? | pushead | Coders. Asm / Hardware | 2 | 01 June 2019 11:26 |
sprite overscan | jamiejamie | Coders. General | 11 | 02 February 2011 16:59 |
Overscan | john4p | support.Hardware | 17 | 15 April 2010 12:05 |
|
|