Bug in the 5th sprite emulation

Page 2/6
1 | | 3 | 4 | 5 | 6

By ARTRAG

Enlighted (6845)

ARTRAG's picture

05-11-2006, 18:07

this is a picture of both emulators

http://ragozini.googlepages.com/Immagine.JPG

By Manuel

Ascended (18855)

Manuel's picture

05-11-2006, 20:35

OK, I tested this and confirmed the problem. I'll open a bug for it in our bug tracker. Thanks for providing the test program!

By flyguille

Prophet (3028)

flyguille's picture

05-11-2006, 20:38

so, seems that openmsx's gurues has work to do.!

By Manuel

Ascended (18855)

Manuel's picture

05-11-2006, 20:41

flyguille: we always have Tongue

By Manuel

Ascended (18855)

Manuel's picture

05-11-2006, 21:09

Feel free to add comments or other useful info to the bug report.

By dvik

Prophet (2200)

dvik's picture

06-11-2006, 01:38


BTW what is the behaviour of S0 in openMSX when there are multiple lines with 5 sprites?
Or at least, what was it supposed to return?
The very same question holds for bluemsx.

If the 5th sprite bit is cleared, one of these two sprite plane indexes are put in the 5 low bits in S0:
1. If 5 sprites are detected on the current line, the index of the 5th sprite is placed in S0 and 5th sprite bit is set
2. If 4 or less sprites are detected on current line, the index of the sprite plane that has Y-coordinate = 208 is placed in S0.

Note that after the 5th sprite bit is set in S0, the lower 5 bits are not modified anymore until status register S0 is read.

So this is how its implemented in blueMSX, not 100% sure its exactly the same as real HW.

By ARTRAG

Enlighted (6845)

ARTRAG's picture

06-11-2006, 01:42

I think that you should emulate also this very special behaviour of the HW:

you know very well that Y=209 is a terminator that says "the SAT end here",
you surely know that the 5th sprite is returned even if the sprites are outside the
screen on under the borders...

Actually THERE IS an undocumented exception:

If Y=208 that sprite plane is skipped in the 5th sprite management,
this means that even if you place 5 or more sprites under the border,
S0 will never return the planes with Y=208 and the vdp will never rise
the 5th sprite flag if the 5th sprite has Y=208.

This Is A Very Particular And Undocumented Fact !!!
(Bruno, thanks again for discovering it)

By flyguille

Prophet (3028)

flyguille's picture

06-11-2006, 03:07

yes, I know.

By dvik

Prophet (2200)

dvik's picture

06-11-2006, 06:56


If Y=208 that sprite plane is skipped in the 5th sprite management,
this means that even if you place 5 or more sprites under the border,
S0 will never return the planes with Y=208 and the vdp will never rise
the 5th sprite flag if the 5th sprite has Y=208.

I'm not sure I understand what you're saying here. In blueMSX the plane with Y=208 is treated the same regardless of what scanline is rendered. A plane with Y=208 always terminates the SAT and will never cause the 5th sprite flag to be set. I'm not sure what the strange thing with this is or am I missing something?

By ARTRAG

Enlighted (6845)

ARTRAG's picture

06-11-2006, 09:13

I do apologize, maybe I am wrong on which of them is a delimiter and on which says "skip" but both Y=208 and Y=209 have special meanings.

In particular, the delimiter says “SAT ends here, do not process any further”, the “skip” says “this plane does not count”. The mining of the latter is that if you place on sprites on plane

0 1 2 3 4
Y=207; Y=207; Y=207; Y=207 ; Y= « skip »;

(Where « skip » was 208 in my previous text) the 5th sprite flag says « no 5th sprite » and the plane in S0 is 31. So plane 4 does not exit does not count for the 5th sprite.

Page 2/6
1 | | 3 | 4 | 5 | 6