all repos — mgba @ 2315e528556221ecd9cf5d240a0a6f57a323b8ec

mGBA Game Boy Advance Emulator

GB IO: Fix reading from palette data
Jeffrey Pfau jeffrey@endrift.com
Sun, 21 Feb 2016 15:40:51 -0800
commit

2315e528556221ecd9cf5d240a0a6f57a323b8ec

parent

123dc183987e1fac9654b0d877b46cbc43bfe535

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/gb/io.csrc/gb/io.c

@@ -338,7 +338,7 @@ break;

case REG_BCPS: gb->video.bcpIndex = value & 0x3F; gb->video.bcpIncrement = value & 0x80; - gb->memory.io[REG_BCPD] = gb->video.palette[gb->video.bcpIndex >> 1]; + gb->memory.io[REG_BCPD] = gb->video.palette[gb->video.bcpIndex >> 1] >> (8 * (gb->video.bcpIndex & 1)); break; case REG_BCPD: GBVideoProcessDots(&gb->video);

@@ -347,7 +347,7 @@ break;

case REG_OCPS: gb->video.ocpIndex = value & 0x3F; gb->video.ocpIncrement = value & 0x80; - gb->memory.io[REG_OCPD] = gb->video.palette[8 * 4 + (gb->video.ocpIndex >> 1)]; + gb->memory.io[REG_OCPD] = gb->video.palette[8 * 4 + (gb->video.ocpIndex >> 1)] >> (8 * (gb->video.ocpIndex & 1)); break; case REG_OCPD: GBVideoProcessDots(&gb->video);