15 November 2021, 21:06 | #1 |
Registered User
Join Date: Oct 2013
Location: Hamburg
Posts: 69
|
Behavior with BPLCON1 shifts and mid-scanline BPLCON0 change
I've run into a bitplane rendering mismatch when using BPLCON1 shifts and changing the number of bitplanes mid-scanline.
Display setup:
The copper instructions look like this for each line (with different values for BPLCON1): Code:
0100 1200 [06c 0d0] ; BPLCON0 := 0x1200 6d01 fffe [06c 0d6] ; Wait for vpos >= 0x6d and hpos >= 0x00 VP 6d, VE 7f; HP 00, HE fe; BFD 1 0102 0000 [06d 008] ; BPLCON1 := 0x0000 00e4 0001 [06d 00c] ; BPL2PTH := 0x0001 00e6 5c14 [06d 010] ; BPL2PTL := 0x5c14 00e8 0001 [06d 014] ; BPL3PTH := 0x0001 00ea 5c14 [06d 018] ; BPL3PTL := 0x5c14 00ec 0001 [06d 01c] ; BPL4PTH := 0x0001 00ee 5c34 [06d 020] ; BPL4PTL := 0x5c34 00f0 0001 [06d 024] ; BPL5PTH := 0x0001 00f2 5c34 [06d 028] ; BPL5PTL := 0x5c34 6d43 fffe [06d 02c] ; Wait for vpos >= 0x6d and hpos >= 0x42 VP 6d, VE 7f; HP 42, HE fe; BFD 1 0100 5200 [06d 048] ; BPLCON0 := 0x5200 6d51 fffe [06d 04c] ; Wait for vpos >= 0x6d and hpos >= 0x50 VP 6d, VE 7f; HP 50, HE fe; BFD 1 01a2 0eee [06d 058] ; COLOR17 := 0x0eee 6dc5 fffe [06d 05e] ; Wait for vpos >= 0x6d and hpos >= 0xc4 VP 6d, VE 7f; HP c4, HE fe; BFD 1 01a2 0aaa [06d 0cc] ; COLOR17 := 0x0aaa 0100 1200 [06d 0d0] ; BPLCON0 := 0x1200 ... Tested with WinUAE 4.4.0 and latest Beta, showing slightly different behaviors. (EDIT: test executable updated) Last edited by losso; 16 November 2021 at 09:52. |
16 November 2021, 17:49 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
Great, new undocumented feature
It is more correct in subpixel mode (missing left part becomes visible). I haven't yet debugged why it even happens.. There is probably some internal Denise delays that cause this effect. |
16 November 2021, 19:38 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
Could you do following tests:
- I assume it does not happen if PF1 == PF2? - does it happen if you swap PF1 and PF2? - does it happen if PF1 BPLCON1 bit is F (instead of zero. Or some other non-zero static value)? (or when swapped, PF2 is F) - does it happen only if PF1 > PF2 and/or PF2 > PF1? PF1 != PF2 requires subpixel mode which explains the difference. |
17 November 2021, 00:56 | #4 |
Registered User
Join Date: Oct 2013
Location: Hamburg
Posts: 69
|
Test executable updated (adjust PF1 portion of BPLCON1 with RMB + mouse up/down). Screenshots with PF1 values of $0 to $f attached, that should cover all combinations.
I hope the literal screenshots are still helpful, don't have any capturing equipment... |
17 November 2021, 01:00 | #5 |
Registered User
Join Date: Oct 2013
Location: Hamburg
Posts: 69
|
For completeness: This is how the center image looks like
|
18 November 2021, 18:21 | #6 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
Interesting tiny difference when ECS Denise or AGA. (Check black/red in right edge) OCS Denise or A1000: identical to image in first post.
Old test executable. Image is from real A500 connected OSSC + custom configured "extreme" overscan mode. |
19 November 2021, 18:12 | #7 |
Dirk Hoffmann
Join Date: Jun 2019
Location: Karlsruhe
Posts: 33
|
I've probably made it work in vAmiga. Some details can be found in this GitHub issue:
https://github.com/dirkwhoffmann/vAmiga/issues/609 However, I am not sure if this can help troubleshooting UAE since the code base of vAmiga is completely different. Furthermore, I’ve only tested the program with the start configuration and I haven’t compared my emulator output with the real machine for other BPLCON combinations yet (in other words: I didn’t push any mouse button when running the test). |
19 November 2021, 18:14 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
Should now work correctly in WinUAE (winuae.7z updated). ECS Denise/AGA extra feature is not yet emulated.
Denise logic was not correct. Normal sequence is: - Agnus does BPLxDAT DMA. Denise stores the data. - When BPL1DAT DMA happens, Denise copies all BPLxDAT contents to internal storage registers. All planes. - When BPLCON1 shift matches horizontal counter, only currently active planes are copied to shift register. (UAE used plane count value when BPL1DAT was written but it needs to be current value) - All planes' shift registers are active, including disabled planes. (UAE only shifted active planes, even if plane count decreased mid scanline) (Possibly more detailed description will appear in undocumented features thread later) EDIT: just noticed earlier post. interesting timing.. |
20 November 2021, 18:57 | #9 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
ECS Denise/AGA side-effect: if bitplane gets disabled mid-scanline and if bit 0 of disabled bitplane's last word copied to shifter is one, it appears twice on screen. This logic results in 100% identical output when compared to real ECS Denise A500 and A1200.
Quite weird behavior. Emulation added, supported only in subpixel mode. |
21 November 2021, 13:21 | #10 |
Dirk Hoffmann
Join Date: Jun 2019
Location: Karlsruhe
Posts: 33
|
- When BPLCON1 shift matches horizontal counter, only currently active planes are copied to shift register.
Quick question: This means that if BPLCON1 contains the same shift values for even and odd planes and assuming that all bitplanes are enabled, all shift registers get updated simultaneously. But if the shift values for even and odd planes differ, we have two copy events. When the shift value for odd planes matches, shift registers 1,3, and 5 are filled. When the shift value for even planes matches, shift registers 2,4, and 6 are filled. is this correct? (My emulator is doing this wrong at the moment). |
21 November 2021, 13:24 | #11 |
Dirk Hoffmann
Join Date: Jun 2019
Location: Karlsruhe
Posts: 33
|
@losso: Do you mind if I add your program to my regression test suite for vAmiga? It's a public repo on GitHub: https://github.com/dirkwhoffmann/vAmigaTS
|
21 November 2021, 13:46 | #12 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
btw, I did some quick tests how hires<>lores changes work and it looks like OCS Denise, ECS Denise and AGA all have slightly different behavior (few pixels during change have "undocumented" behavior). Going to examine this more after 4.9 is out.
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
BPLCON1 Scroll Left & Right | DanielAllsopp | Coders. Asm / Hardware | 6 | 13 February 2020 15:01 |
Change in behavior in recent VASM upgrade | Hannibal | Coders. Asm / Hardware | 0 | 20 October 2019 23:28 |
Filter mask on the fly change weird behavior | mcbpete | support.WinUAE | 2 | 04 September 2018 20:47 |
Mid-line bitplane pointer change? | NorthWay | Coders. Asm / Hardware | 10 | 26 September 2015 13:45 |
a painting program that let you change the palette per scanline | Michael Parent | request.Apps | 1 | 26 October 2009 22:09 |
|
|