Skip to content
Permalink
Browse files

gpu: fixed off-by-one in drawingOffset sign extending

  • Loading branch information
JaCzekanski committed Aug 12, 2019
1 parent 9948991 commit bb94c810e0fc0f7b14b707cc6df94e6db770de4a
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/device/gpu/gpu.cpp
@@ -490,8 +490,8 @@ void GPU::writeGP0(uint32_t data) {
drawingArea.bottom = (arguments[0] & 0xffc00) >> 10;
} else if (command == 0xe5) {
// Drawing offset
drawingOffsetX = extend_sign<11>(arguments[0] & 0x7ff);
drawingOffsetY = extend_sign<11>((arguments[0] >> 11) & 0x7ff);
drawingOffsetX = extend_sign<10>(arguments[0] & 0x7ff);
drawingOffsetY = extend_sign<10>((arguments[0] >> 11) & 0x7ff);
} else if (command == 0xe6) {
// Mask bit setting
gp0_e6._reg = arguments[0];

0 comments on commit bb94c81

Please sign in to comment.
You can’t perform that action at this time.