01 November 2017, 02:55 | #1 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
7th sprite corrupt with DDFSTRT of 0x30
I'm having a weird problem with my 7th sprite being corrupt when I start my DDSTRT earlier (0x30 instead of 0x38) in order to have HW scrolling.
I fully expect to lose the 8th sprite, but I'm puzzled why the 7th sprite appears, but doesn't display properly. Here is my full window setup: DIWSTRT = 0x2C80 DIWSTOP = 0xF4BC DDFSTRT = 0x0030 DDFSTOP = 0x00D0 Am I missing something really obvious here? Have i misunderstood the DMA timing diagram? |
01 November 2017, 03:44 | #2 | |
Code Kitten
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Quote:
DDFSTRTis the only one which matters and with 0x30 you should indeed only lose the 8th Sprite (Sprite 7). Are you sure that you are feeding Sprite 6 with proper data? It could be as simple as your Sprite data being corrupted by another bug in your code. Toni has discovered a number of weird behaviors regarding data fetches but I do not recall anything which matches your case. |
|
01 November 2017, 07:39 | #3 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
Thanks for confirming that at least what I'm trying to do should work I do suspect it's something wrong with my code, but I'm a little stumped as to what it might be.
If I change the DDFSTRT to 0x38, the 7th sprite displays correctly. Similarly, if I change the sprite to use any of the first 6 slots it also displays correctly, so if the bug is somehow in the sprite setup, it's very subtle. I've noticed that the way the sprite is corrupted is very specific - it's almost as if the second word fetch for each line is being inhibited, including the sprite data ptr not being advanced. For example, with the sprite data for each row as follows: 1111000000000000 0000000000000000 0000111100000000 0000000000000000 0000000011110000 0000000000000000 0000000000001111 0000000000000000 it actually ends up displaying as alternating lines: 1111000000000000 0000000000000000 0000111100000000 0000000000000000 0000000011110000 0000000000000000 0000000000001111 0000000000000000 It appears the same in Win-UAE and FS-UAE - I guess i can try the real HW next. I'm open to other ideas about what else I should check if you have any |
01 November 2017, 08:52 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
All OCS Agnus variants (fixed in ECS/AGA) have sprite DMA bug/feature: single cycle just before bitplane DMA starts is not available for sprites, it kills dma transfer to sprite's second control word/data word (if bitplane DMA start is early enough) causing sprite to become damaged, for example previously loaded DATB is visible.
In other words, if OCS Agnus, when documentation says only sprite 7 gets killed due to bitplane DMA, sprite 6 second word DMA slot also gets stolen by bitplane DMA and so on. |
02 November 2017, 01:24 | #5 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
|
Correct, basically left side overscan steals sprite channel DMA slots one bitplane per 8px. (See the moon sprite in the DYSP part of Uncle Tom Sonix, and surely any game with horizontal scrolling would use the 7th sprite.)
For DDFSTRTs of $2c and $34 you can still use 1 bitplane sprites! |
02 November 2017, 02:35 | #6 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
Thanks for the great info everyone. Looks like I'll need to shrink the window by 16 pixels on the left if I want that 7th sprite to work reliably on all hw (on the plus side I'll get the 8th one back also).
|
06 November 2017, 13:19 | #7 | |
Registered User
Join Date: Jan 2016
Location: NL
Posts: 32
|
Quote:
Or is this a noob-answer? |
|
10 November 2017, 03:20 | #8 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
It's possible to have the screen finish 16px later, thus keeping the full width, all the sprites and scrolling, as far as I can tell, but it introduces some new potential problems.
Firstly, I think this would be considered to be entering the overscan area, so you are now risking the image being cut off on people's screens. If someone has a monitor like the 1084s they can adjust the position, but someone on a TV is not able to do that usually. Even the defaults of something like WinUAE would at best put this to the very edge of the window and maybe even cut off some pixels. It also think it looks bad to be so off-center like this. Secondly, I am relying on some precise copper timing to align palette switching at the left and right edges of the window. For reasons I don't fully understand, pushing the window further to the right starts to exhibit some odd timing problems that make it not possible to reliably line up the right window edge and copper palette switches (timing seems to not be consistent). |
10 November 2017, 12:28 | #9 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
|
Quote:
BTW, sprites 6 and 7 still work, you only lost their DMA slots. Which means you could also load SPRxDATA/SPRxDATB with the copper, at the beginning of the line and still use those sprites. |
|
11 November 2017, 17:36 | #10 | ||
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
Quote:
Code:
for ( uint16_t i=0; i<32; ++i ) { // Left CopperList_WaitH( cl, 100 + i, 0x40 ); CopperList_Move( cl, 0x180, ( i & 0x1 ) ? 0xF00 : 0x0F0 ); // Red/Green // Right CopperList_WaitH( cl, 100 + i, 0xDC - 16 + i ); CopperList_Move( cl, 0x180, 0x000 ); } Quote:
|
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Reminder LAG meeting 42 will be held on Saturday the 7th of March 2015" | rockape | News | 0 | 28 February 2015 14:16 |
LAG meeting 37 will be held on Saturday the 7th of June 2014. | rockape | News | 1 | 07 June 2014 18:38 |
"REMINDER LAG meeting 34 will be held on Saturday the 7th of September" | rockape | News | 5 | 01 September 2013 17:15 |
Melbourne Amiga User Group (MAUG) - 7th of July | NovaCoder | Amiga scene | 16 | 08 July 2011 08:37 |
"LAG 21 is booked for Saturday 7th of May" | rockape | News | 3 | 07 May 2011 23:31 |
|
|