The display capture EVA/EVB factors are now clamped to 16. This avoids corrupted colors when the game sets these factors to values over 16.

This commit is contained in:
luigi__ 2009-04-11 22:07:32 +00:00
parent a2c33d0d35
commit 9fa2003bc5
1 changed files with 2 additions and 2 deletions

View File

@ -2518,8 +2518,8 @@ void GPU_set_DISPCAPCNT(u32 val)
struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits;
gpu->dispCapCnt.val = val;
gpu->dispCapCnt.EVA = val & 0x1F;
gpu->dispCapCnt.EVB = (val >> 8) & 0x1F;
gpu->dispCapCnt.EVA = std::min((u32)16, (val & 0x1F));
gpu->dispCapCnt.EVB = std::min((u32)16, ((val >> 8) & 0x1F));
gpu->dispCapCnt.writeBlock = (val >> 16) & 0x03;
gpu->dispCapCnt.writeOffset = (val >> 18) & 0x03;
gpu->dispCapCnt.readBlock = dispCnt->VRAM_Block;