move sprite patterns to other address

صفحة 2/2
1 |

بواسطة Grauw

Ascended (10180)

صورة Grauw

24-12-2019, 00:54

That’s so strange! I think norakomi had a similar issue recently, also to do with page switching during active display showing sprite-like glitches.

It’s especially strange since I’d never heard of any corruption / glitch issue like this, the only one I’m aware of is the r#18 during commands one, and now within the span of a few weeks we get two people mentioning something like this. Also I’ve not encountered any issues with my page/sprite/scroll splits in my project. After I enable sprites it properly stays blank for one line until it was able to fetch it.

So what do you do exactly? If you can provide any more information on the circumstances, or maybe a photo or video or a test, it could help to get to the bottom of this.

بواسطة inchl

Resident (41)

صورة inchl

24-12-2019, 04:08

The game (NOPs MicroMirrorMen2020) is using overscan 512x232 (with the fix mentioned 506x232) and each 4 scanlines two palette colors get an update. Each game step takes about 6 frames and then the screen toggles between vram page 0 and 1 (double buffering). The on screen cursor is a sprite. Because the vdp copy commands are slower when having sprites enabled the most ideal situation is to disable the sprites… but then the cursor wouldn't be visible :-( To solve this, I enable the sprites for only those scanlines that have the cursor being displayed on. So I only have a slower vdp copy commands for 16 out of 246/256/262? scanlines.

The combination of this all causes the sprite artifacts/corruption/glitches. More strangly is that when vram page 0 is displayed, the artifacts do not appear. During the display of vram page 1 they do. However if I do not toggle between vram pages at all (keep displaying vram page 0) the artifacts reappear… aahhh.
Also disabling the overscan solves the problem (not 100% sure about this).

It really seems that all this has something to do with the internal state of the vdp. Maybe writing to a single register messes up some internal buffer causing the problem and does fetching the first 3 bytes (that I made byte 0) have some side effect that clears that buffer.

What I found so far is that the artifacts being displayed are in fact sprites themselves. The pattern used for these sprites (it seems all these sprites are using pattern#0) correspond to the first 3 bytes of the scanline on which the sprites were enabled. So maybe enabling sprites in mid screen might cause the vdp to use an incorrect pattern address (it uses the address of the scanline currenly being displayed for pattern address). You mentioned that you never have seen this in your own projects. Are you sure that in those projects the first 3 bytes of that specific scanline are not holding byte 0 (you might never noticed it because you applied my fix without realizing it)

NOP will be present on the MSX fair on feb 1 2020, so we might meet and investigate this further if you attend too.

For now I am very happy... It took me a couple of long days to solve this.

Stephan

بواسطة wouter_

Champion (469)

صورة wouter_

24-12-2019, 10:49

Just a guess, could be totally wrong.

From the vdp-vram-timing investigation we know that the Y-coordinate for a sprite is fetched twice. Once to determine which (up to 8) of the 32 sprites are visible. And then later again to know which vertical line within the sprite pattern should be shown.

Could it be that the sprite subsystem gets 'confused' when you change some setting in between these two Y-fetches? E.g. the first fetch already determines that a particular sprite should be shown. Then the sprite attribute table changes, which causes the second fetch to read a different Y-coordinate. And that will cause wrong sprite pattern data to be shown.

بواسطة Grauw

Ascended (10180)

صورة Grauw

24-12-2019, 12:51

Thanks for the elaborate description! Very mysterious. I’ll be sure to keep my eyes open for issues like this.

In my case I normally show page 0 and when I show page 3 in a split the sprites are disabled, so if it only applies to certain pages that may be why I haven’t seen it. In general all my pixels are filled with nonzero values…

بواسطة hit9918

Prophet (2911)

صورة hit9918

24-12-2019, 16:24

Quote:

The artifacts only appear when vram page 1 is displayed or when running in openMSX :-(

I cant tell which register is written. the word "page" could mean the bitmap address, but "sprite table" too was mentioned, so one never knows.

"or when running in openMSX", I cant even tell whether we are talking sparcles on an emulator.

بواسطة erpirao

Paragon (1230)

صورة erpirao

24-12-2019, 20:14

New micromirromen ?, This afternoon I played in my demo of Comjoetania. A great game / promo.
video please

بواسطة Manuel

Ascended (18256)

صورة Manuel

24-12-2019, 22:40

Which demo of Compjoetania?

صفحة 2/2
1 |