abaire / nxdk_pgraph_tests

Tests to verify xemu handling of various pushbuffer commands
Other
12 stars 8 forks source link

Add tests / reverse engineer pgraph command `0x0AE0` #110

Closed abaire closed 11 months ago

abaire commented 12 months ago

https://github.com/xemu-project/xemu/issues/713

abaire commented 11 months ago

Copying relevant bits of my comment from https://github.com/xemu-project/xemu/issues/713:

This one is a bit tricky, there are a couple components involved and the behavior isn't entirely obvious.

These do set key colors, one per texture stage (i.e. 0xAE0 sets the key for Tex0, 0xAEC sets Tex3). To get these to do anything, the corresponding NV097_SET_TEXTURE_CONTROL0 for the stage needs to be modified, it looks like the two low bits have an effect:

Bit 0 just kills the alpha channel Bit 1 kills the whole color If neither bit is set, the color key is ignored entirely. If both bits are set, it appears that the pixel is killed even if alpha is not being sampled, as seen here where some pixels are missing even though the combiner forces alpha to 0xFF. The kill behavior (for any combination of the two bits) takes effect regardless of whether a given texture channel is being sampled by the color combiner. This means you can enable a channel that isn't being sampled and kill pixels in the channel that is being sampled.