http://bugs.winehq.org/show_bug.cgi?id=28301
--- Comment #7 from Stefan Dösinger stefandoesinger@gmx.at 2011-09-12 16:42:06 CDT --- I've no clue yet what is going on.
What seems to happen in the p8_primary_test() is that the palette is broken. Color 0 should be red(0x00ff0000), color 1 green(0x0000ff00) and color 2 blue(0x000000ff). What happens is that color 0 is black, color 1 is a dark red(0x00800000) and color 2 is a dark green(0x00008000).
The problem is not related to the other tests. I disabled the others and started the p8_primary_test function directly and the problem still shows up.
Sometimes the first test(clear using p8_surface_fill_rect) succeeds, and the 2nd one fails. The fill_rect call is not needed to reproduce the issue, the colorfill blit alone can fail too.
Filling the surface again doesn't produce the proper color, so the problem is not that the blit is silently ignored.
The surface isn't lost and GetPalette returns the correct palette. However, reapplying the ddraw palette twice fixes the issue.
The wrong color shows up on the screen as well, so it is not a problem of the readback code.
Again, this is on Windows. I'd suspect some brokeness in native ddraw, but apparently the same test is failing on Wine(Although with different, more sane colors).