14 October 2021, 22:27 | #1 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
copper wait glitch
Hi.
Working on vertical scroller code. Single playfield (4 bitplanes) scrolling down (starting at y=0) and then back up again. Copper vertical split is calculated based on Y-position such that vertical beam position $2c corresponds to y=0, etc. Emulated Amiga 500 (ECS)... using WinUAE. Display set to PAL. Bitplane pointers are updated at the top of the split and leave the bitplane pointers in the second half of the split pointing to the top of the bitmap so that it gets "dragged" upward as the vertical split moves "up" and the screen appears to scroll down. All of that works fine, except that when scrolling down and the copperlist reaches actual location $2D, something odd happens. The copperlist waits go from Code:
dc.w $ffdf,$fffe dc.w $0001,$fffe Code:
dc.w $00df,$fffe dc.w $ff01,$fffe At the next frame (location y=$2E) the bottom split reappears with the waits Code:
dc.w $00df,$fffe dc.w $fe01,$fffe I know it's a bug in the split, not the bitplane pointers... because I change the background color in the bottom split to yellow (for debug purposes) Y=2C...all is well Y=2D... wtf? Y=2E... separated I can compensate for the problem by checking to see if the scroll is going downward, and then skip past the $00df/$ff01 waits directly to $00df/$fe01... and then the reverse when scrolling up... but I don't like handling those special cases. Is it possible I'm doing something fundamentally wrong? (I'm going to guess "yes" ) Thanks for any help. |
14 October 2021, 22:49 | #2 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
Maybe horizontal DIWSTART/STOP or DDFSTART/STOP is too wide?
Code:
move.w #DMA_fetch_start,DDFSTRT(a6) ;$28 for 22 columns; $38 for 20 columns (etc) move.w #$d0,DDFSTOP(a6) |
15 October 2021, 10:28 | #3 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
|
Quote:
In this case, changing it to $00df,$fffe will make it fire instantly after whatever instruction happens just prior in the Copperlist as you're now waiting for line 0 and the Copper triggers waits when the raster position is equal to or greater than the requested wait position. |
|
15 October 2021, 12:16 | #4 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
|
you could update the wait position as $ffdf,$fffe or as $01fc,$XXXX (copper "nop") depending on whether you need the PAL wait or not for the line at which the screen scroll split happens
|
15 October 2021, 13:06 | #5 | |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
Quote:
The first wait ($FFDF) waits for y=255 and the second wait ($2c01) adds $2c such that if y=0, the bottom "split" will not show. When y=1, the second wait is decremented... so that it is now $2b01. The bottom split shows one line at the very bottom of the visible area. When we get to y=$2C, the waits are $FFDF and $0001. At y=$2D, the first wait is modified to $00DF and the second is now $FF01. Maybe by the time the copper finishes the $00DF wait, and the next frame starts, the beam is already past $ff01--so now it would be like waiting for y=$1ff? That sound like what is needed... a "nop" so that the first wait is ignored after the y position is > $2C. I'll try that. Thank you, Dan. |
|
15 October 2021, 14:04 | #6 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
|
sorry.. should be $01fe NOT $01fc for a copper NOP
|
15 October 2021, 15:18 | #7 |
Registered User
Join Date: Jul 2021
Location: Sandy, UT
Age: 55
Posts: 230
|
Thank you for the help roondar and Dan.
Changing the wait from $FFDF to $01FE didn't change the behavior. I'm now compensating for the separation glitch by subtracting 1 from the wait value when the vertical position goes past Y=$2C. That way when the bottom split actually shows up in the viewable area, it is aligned properly. It seems to stay aligned when doing this, though the bottom split still "flickers" off for one frame when VIDEOY > $2C. In a practical sense (because the screen size for the game is 256x224), I won't be showing > 255 vertical scrollable pixels on screen at any one time anyway, and the "separation" and blanking issues only happen when VIDEOY > $2C (only visible below y=255). So the one frame where the bottom split flickers won't be on screen. ETA: That being the case, maybe I should just re-size the screen buffer to 288x256 instead of 352x288 (as is currently). That way there's no issue. Last edited by chadderack; 15 October 2021 at 15:40. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copper WAIT, copper SKIP and $80/$100 vpos problem | defor | Coders. Asm / Hardware | 2 | 23 July 2021 08:32 |
Copper SKIP/WAIT timing | roondar | Coders. Asm / Hardware | 5 | 05 February 2021 17:46 |
Copper wait | geldo79 | Coders. Asm / Hardware | 9 | 12 November 2019 09:18 |
Copper Wait Problem | sandruzzo | support.WinUAE | 13 | 18 May 2016 21:54 |
Copper Wait Problem | sandruzzo | Coders. Asm / Hardware | 2 | 17 May 2016 10:30 |
|
|