14 July 2018, 07:55 | #1 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
Half pixel copper delay on A1200 hardware
I have some code that uses the copper to set color00 every line, synchronized with the DIWSTRT/STOP (to get an extra color out of OCS amigas).
It works perfectly in WinUAE with OCS and AGA chipsets and also a real A500 (everything lines up perfectly), but on a real A1200 the color change is delayed by half a lores pixel. I thought for the longest time there was something wrong with my code and (accidentally setting some AGA specific bits related to sub-pixel control, perhaps on my sprites or bitplanes) but I checked all of it and it seems correct. I finally thought to test another game that I know uses this per-line color00 change (Shadow of the Beast first level) and it also has this half pixel offset on my real A1200, but not in WinUAE (OCS or AGA) and not on my real A500. Does anyone know: - Is it possible this is still a code bug, that just happens to be the same in my code and Beast? - Is there a known HW quirk that perhaps WinUAE does not emulate? (PS - checked in WinUAE 3.5.0 and 4.0.0) Last edited by FSizzle; 14 July 2018 at 07:58. Reason: Typo |
14 July 2018, 09:40 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
Attach simple example binary (that run when booted without startup-sequence), thanks.
|
14 July 2018, 12:09 | #3 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Finally a reference!
From old memories I seemed that I too had similar problems that drove me mad. But they are old memories from 25 years ago, I just thought I was wrong. I looked for a reference for a while but finding nothing so I had left off. Also Lionheart use this technique and there's a code snippet that search for A1200 Lisa and change DIWSTOP.. http://eab.abime.net/showpost.php?p=...5&postcount=29 (leave out the other glitches that are in fact bugs) I'm curious to know if this is real |
14 July 2018, 12:57 | #4 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Quote:
(if it exists, as usual I can not confirm as I do not have a real machine). |
|
14 July 2018, 13:10 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
Simple test case is much better, games have too much happening at the same time.
|
14 July 2018, 16:37 | #6 | |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
Quote:
|
|
14 July 2018, 18:14 | #7 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Quote:
Copper stripes is COLOR00, synced with DIWSTRT/STOP. Red circle to better view if there is an half pixel mismatch. |
|
14 July 2018, 20:44 | #8 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
I've uploaded a sample that reproduces the issue:
- a bootblock.s - a bootable ADF image with that bootblock I've also attached some images: - Screenshot of WinUAE A1200 where everything lines up - Screenshots of real A1200 running the test showing misalignment - Screenshots of real A1200 running Shadow of the Beast showing misalignment I hope we can get to the bottom of this! (PS Sorry for the poor photos - I had a lot of trouble getting it to focus!) Code:
;# BootBlock ;#------------------------------------------------------------------------------- dc.b 'D','O','S',0 dc.l 0 dc.l 880 ;# Chipset ;#------------------------------------------------------------------------------- REG_BASE equ $dff000 COP1LCH equ $080 DIWSTRT equ $08e DIWSTOP equ $090 DDFSTRT equ $092 DDFSTOP equ $094 DMACON equ $096 INTENA equ $09a INTREQ equ $09c BPL1PTH equ $0e0 BPL1PTL equ $0e2 BPLCON0 equ $100 BPLCON1 equ $102 BPL1MOD equ $108 COLOR00 equ $180 COLOR01 equ $182 FRAMEBUFFER equ 256*1024 ;# MAIN ;#------------------------------------------------------------------------------- MAIN: lea REG_BASE,a6 ;# a6 always used as chipset base ;# Clear FRAMEBUFFER lea FRAMEBUFFER,a0 move.l #(((320+16)*200)/32)-1,d0 ;# Fill enough for a single 320+16 x 200 bitplane .fillLoop: move.l #$0,(a0)+ dbra d0,.fillLoop ;# Write one pixel on left and right of display lea FRAMEBUFFER,a0 move.l #$80000000,(a0) ;# Set pixel 0 move.l #$00000010,$24(a0) ;# Set pixel 315 ;# Activate CopperList lea COPPERLIST(pc),a0 move.l a0,COP1LCH(a6) ;# Set address of CopperList ;# Enable DMA move.w #$8380,DMACON(a6) ;# Master DMA, Bitplanes & Copper ;# Loop forever LOOP: jmp LOOP COPPERLIST: ;# Activate frame buffer dc.w DIWSTRT,$2C80 dc.w DIWSTOP,$F4BC ;# 316 pixels wide dc.w DDFSTRT,$0030 ;# Early fetch to support scrolling dc.w DDFSTOP,$00D0 dc.w BPL1PTH,(FRAMEBUFFER>>16) ;# Bitplane 0 high dc.w BPL1PTL,(FRAMEBUFFER&$FFFF) ;# Bitplane 0 low dc.w BPLCON0,(1<<12) ;# Enable 1 bitplane dc.w BPLCON1,$F ;# Scroll delay so we show first pixel dc.w COLOR01,$A00 ;# Color01 red ;# Set COLOR00 in sync with DIWSTRT/DIWSTOP ;# First row dc.w $2C<<8|$3F|$1,$FFFE dc.w COLOR00,$AAA ;# Color00 gray dc.w $2C<<8|$DC|$1,$FFFE dc.w COLOR00,$000 ;# Color00 black ;# Second row dc.w ($2D)<<8|$3F|$1,$FFFE dc.w COLOR00,$AAA ;# Color00 gray dc.w ($2D)<<8|$DC|$1,$FFFE dc.w COLOR00,$000 ;# Color00 black dc.w $FFFF,$FFFE ;# End ;#------------------------------------------------------------------------------- Last edited by FSizzle; 14 July 2018 at 20:48. Reason: Inserted code inline as well for easier viewing |
14 July 2018, 20:58 | #9 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Quote:
I've uploaded an updated executable that shift plane2 with right mouse button press. Can you test to see if the effect is visible? EDIT: you need a PAL video mode Last edited by ross; 14 July 2018 at 21:07. |
|
14 July 2018, 21:19 | #10 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
Quote:
EDIT: include all AGA bplcon1 shift bits (shres resolution) in right mouse button press. Bootblock is too annoying to use, executable please. (Yes, I am really lazy..) |
|
14 July 2018, 21:25 | #11 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
|
14 July 2018, 21:34 | #12 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Ok, attached a very stripped version
(works also on NTSC) EDIT: ops, lost the EDIT from message #10 regarding shres shift, please wait an update... Last edited by ross; 15 July 2018 at 01:09. |
14 July 2018, 21:35 | #13 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
|
14 July 2018, 21:39 | #14 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
Uploaded HalfPixelTest.exe.
|
14 July 2018, 21:43 | #15 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
Uploaded source for HalfPixelTest.exe I uploaded (it's the same as the bootblock.s, but with 2 changes):
- Set the FMODE to 0 in the copper list - Remove the DOS header required for boot blocks |
14 July 2018, 22:39 | #16 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
For some reason that I do not understand now (too much wine?), quarter pixels scroll isn't working on WinUAE,
even if "superhires" on Host/Display/Resolution selected and AGA bits used (so we need four right click for a visible shift..) pf1 priority below pf2 and a fixed pattern for bitmap used. EDIT: changed name because stoopid Windows10 Defender antivirus and cleaned some code Last edited by ross; 15 July 2018 at 01:04. |
15 July 2018, 00:06 | #17 |
Registered User
Join Date: Nov 2017
Location: Los Angeles
Posts: 49
|
I've uploaded a new HalfPixelTest.exe. This simplifies the repro (exe is now 252 bytes ) and also eliminates some on-screen garbage when running from the WB or CLI.
@Toni. Let me know if this is helpful, or if changes would make it more useful. Last edited by FSizzle; 15 July 2018 at 01:50. Reason: Typo |
15 July 2018, 07:29 | #18 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
AGA hires/shres bits only work if both playfields have same scroll value. This is very old limit and supporting it is really complex (it can be also done easily but easy solution would also slow down everything..)
|
15 July 2018, 09:22 | #19 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Quote:
[this pf1!=pf2 AGA shift bits support could be a new feature for a later version of WinUAE, with option] With my LUT approach was super simple to duplicate shift bits, so attached a version that work also on WinUAE. Could other changes to the code be useful? Last edited by ross; 15 July 2018 at 09:36. Reason: * censored to protect the innocent ;) |
|
15 July 2018, 10:25 | #20 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
Does hires resolution also have exact same extra delay? (EDIT: I'll try to do some real hardware tests later today)
-- I probably explained it in some other thread but here is quick explanation: This requires large rewrite, currently single Amiga lores/hires/shres pixel is single bit in whole display emulation path. Until finally output pixel color is decided (background, sprite or bitplane pixel) where single pixel becomes 1, 2 or 4 native horizontal pixels using optimized generated code. (every doubling mode has separate routine) Everything is optimized for this behavior. Sprites already support it because they are relatively simple and can't have weird side-effects. (like writing to BPLCON1 mid-scanline does) Last edited by Toni Wilen; 15 July 2018 at 10:49. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Alien Breed II title pixel by pixel logo removal | dex | project.Sprites | 17 | 06 May 2020 15:23 |
Needed: A1200 Delay Line & Bandpass Filter | PARALAX | support.Hardware | 0 | 04 December 2016 18:44 |
A1200 reset delay | Cobe | support.Hardware | 18 | 09 May 2016 18:31 |
Problem running copper master demo on A1200 | whitebird | support.Demos | 26 | 17 August 2014 17:41 |
Wanted - A1200 Tin Shield Bottom Half - NEW | Peter | MarketPlace | 0 | 15 September 2010 17:06 |
|
|