dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS
https://dirkwhoffmann.github.io/vAmiga
Other
305 stars 25 forks source link

Rink A Dink graphics glitch #116

Closed dirkwhoffmann closed 4 years ago

dirkwhoffmann commented 5 years ago

If BFD is zero, Copper waits until Blitter has finished the current operation.

Rink a Dink seems to rely on it. It sets BFD to zero during this scene:

Bildschirmfoto 2019-08-08 um 08 21 13

TODO: Verify if xAE also shows this bug if the fast / immediate Blitter is selected. Because "immediate blits" are performed immediately, the Copper never has to wait and the BFD flag should not have an effect.

mithrendal commented 5 years ago

YouTube Video for reference. https://youtu.be/7cOjC-nhs_o

It does not show the graphic corruption

dirkwhoffmann commented 5 years ago

It's most likely not a BFD flag issue. Since the DMA inspector can display Blitter DMA now (orange), it can be seen that there is no direct Blitter / Copper interaction in that scene:

Bildschirmfoto 2019-08-22 um 15 26 18

Also, SAE shows a similar graphics error in all Blitter modes.

It might be related to #98. I bet it runs in UAE only with "compatibility = highest". This needs to be verified...

dirkwhoffmann commented 5 years ago

Does anybody know how the DMA debugger works in UAE? It would be super cool to have a comparison pic for that scene.

mithrendal commented 5 years ago

I just tried it. It works like this:

start WinUAE. start a ADF-disk. Pressing SHIFT+F12 opens a debugger console window (on a mac book FN+SHIFT+F12). type h, lists all winuae debugger console commands the commands for enabling DMA debugger are v -1 to v-3

in 2016 toni wrotes the following explanation on EAB.

summary:

v -1 : enable only, no visual mode.
v -2 : enable + visual mode
v -3 : enable + visual mode + doubled horizontal pixels

Note that currently mode can't be changed after it has been enabled.

After it has been enabled (visual or not), v <vpos> <hpos> shows detailed scanline DMA/CPU usage. 

yellow = copper
green = blitter
dark green = blitter line
bright green = blitter fill
blue = bitplane
cpu = gray
audio = red
sprite = white
disk = purple

Vertical line on the left side: CPU interrupt level. 
dirkwhoffmann commented 5 years ago

start WinUAE.

Roger. Engines are running. ๐Ÿ˜Ž

start a ADF-disk.

Roger. Ready to take off. ๐Ÿ˜Ž

Pressing SHIFT+F12 opens a debugger console window (on a mac book FN+SHIFT+F12).

Maybe you're fooling me and it means "Eject" ๐Ÿค”. Anyway, let's do it. No risk no fun...

OMG, it opens up a build-in text adventure called "The Debugger" ๐Ÿ˜ฏ.

type h

There is no "go north", "go south" etc.? Seriously? ๐Ÿค”

v -2

Copied that. I guess this is the magic spell that teleports me right into the heart of the dungeon.

Yes, it does ๐Ÿฅณ...

Bildschirmfoto 2019-08-23 um 08 26 04

With some deeper knowledge of the magic arts, I'm sure the DMA usage could be overlayed at the actual pixel positions where the DMA takes place (like in vAmiga), but the image is good enough for now...

With my restricted knowledge about UAE, I cannot distinguish dark green / bright green / green, but I should check if there are line blits and fill blits going on in that scene. Both have a different timing than standard copy blits. vAmiga cannot emulate line blit timing yet and it treats fill blits like standard copy blits. If we had a DMA usage table for fill blits, exact timing could be easily implemented with the micro-programmable Blitter in vAmiga.

dirkwhoffmann commented 4 years ago

The good: No more polygon errors in Blitter level 2 ๐Ÿ˜Ž

Bildschirmfoto 2019-11-01 um 14 12 47

The bad: New graphics glitches appear in scenes that worked before ๐Ÿ˜ฌ.

TODO: Check if the glitches also appear with the FastBlitter

mithrendal commented 4 years ago

The new sexy activity monitor complete steals "rink a dink" the show.๐Ÿ˜Ž๐Ÿ‘๐Ÿป From what we can see here is that the audio of the demo is surely unbalanced (right channels have to much power). Audio balancing graph looks like small plants with big roots under the earth.๐ŸŒฑ But nevertheless I like the sound of the demo a lot !

dirkwhoffmann commented 4 years ago

In v0.46.1, Rink a dink is completely broken with Blitter level 2 ๐Ÿคญ:

Bildschirmfoto 2019-11-14 um 12 29 30

Broken in commit ebeae8e

dirkwhoffmann commented 4 years ago

No longer broken in Blitter accuracy level 2.

dirkwhoffmann commented 4 years ago

Among the remaining graphics glitches, this one is the most severe:

Bildschirmfoto 2020-03-13 um 09 04 19

The most likely reason is the dynamic modification of the bitplane shift values at specific horizontal positions. This is done by the second Copper list:

Bildschirmfoto 2020-03-13 um 09 03 50

TODO: Write timing tests for BPLCON1

dirkwhoffmann commented 4 years ago

Related links:

http://eab.abime.net/showthread.php?t=94080 http://www.stashofcode.fr/zoom-hardware-avec-bplxmod-et-bplcon1-sur-amiga/

http://eab.abime.net/showthread.php?t=71437

Toni: "I finally figured out how BPLCON1 (and Denise) internally works, old emulation code was quite wrong even if results were mostly correct.

(Still rewriting emulation code, this is quite big change)

Quick explanation:

When Agnus writes to Denise's BPL1DAT, BPLxDAT registers are copied to internal temp registers and flag is set.

When bitplane delay value matches Denise's internal hpos counter ((hpos & mask) == delay) and flag is set, internal temp register is copied to 16-bit shift register and flag is reset. Comparison checks are continuous, writes to BPLCON1 can at any time cause comparison to match early or delay matching or even keep it missing longer time (Not sure if this can be used for some effect? Not confirmed if this happens but I am quite sure)

Pixels are clocked out of each bitplane shift registers which goes to color palette, merged with sprites and so on.. The usual.

There is no 32-bit shift register, it is 16-bit only (at least UAE incorrectly used 32-bit shift registers).

This explains "blanking" side effect (above test programs). BPLCON1 is increased which causes comparison match to be delayed. If match is delayed long enough, shift register is not loaded with new data, it becomes empty and keeps outputting zeros."

dirkwhoffmann commented 4 years ago

In my eyes, there are no more issues with the demo in v0.64 ๐Ÿ˜Ž.

There are some oddities in the very left and very right screen area in some scenes, but I am not sure if these area are visible on a real Amiga.

mithrendal commented 4 years ago

You could double check on A500 MMSE ๐Ÿ’‚๐Ÿพ

dirkwhoffmann commented 4 years ago

You could double check on A500 MMSE ๐Ÿ’‚๐Ÿพ

Just compared with the YouTube version:

https://www.youtube.com/watch?v=7cOjC-nhs_o

The artifacts I was wondering about (such as the yellow stripe below) are all on the YouTube video, too ๐Ÿฅณ.

Bildschirmfoto 2020-03-15 um 18 24 26

After that worked out so well, I'll try my hand at more complicated things tomorrow: Shopping for groceries. I already tried on Saturday, but the store looked like one in Venezuela ๐Ÿ˜ฌ.

Fruits and vegetables: Sold out Pasta: Sold out Bread: Sold out Toilet paper: Sold out Flour: Sold out Eggs: Sold out

My fridge is full of frozen pizza now. This was the only item available in large quantities ๐Ÿ˜ณ.

mithrendal commented 4 years ago

The pizzas all have the same topping? ๐Ÿ˜ณ

just read that china is sending medical experts, kind of special forces I think, to italy in order to support us and fight against the plague together. Hopefully fully equipped with all kinds of heavy armour and weapons.๐Ÿ˜Ž See @Alessandro1970, help is coming ... hold out ...

After they successfully secured Italy hopefully they don't forget the rest of europe ...

Alessandro1970 commented 4 years ago

My friends, here is a disaster! It seems that neither masks nor gloves are enough, you have to stay at home and make sure you haven't already been infected. We hope that the German company CureVac from Tรผbingen will be able to find the solution. Many people die every day, there is no medicine that can ...

dirkwhoffmann commented 4 years ago

We hope that the German company CureVac from Tรผbingen will be able to find the solution.

I know nothing about this company, but I did my PhD in Tรผbingen. It was a picturesque and peaceful place back then. It is still picturesque, but they have problems with increasing criminality. Now a medical crisis is coming on top of that and nobody really seems to know how to deal with it. Yes, itโ€™s all very sad...