diff --git a/CHANGES b/CHANGES index e3ccd43e4..e5b232c92 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,7 @@ Bugfixes: - DS GX: Hack around writing to a full FIFO that has a swap pending (fixes mgba.io/i/608) - DS Video: Enable overflow bit on extended affine modes - DS Video: Fix extended mode 0 without extended palettes + - DS Video: Fix caputre stride Misc: - DS: Set boot complete bit in RAM on boot (fixes mgba.io/i/576, mgba.io/i/580, mgba.io/i/586) - DS Memory: Ensure DS9 I/O is 8-byte aligned diff --git a/src/ds/video.c b/src/ds/video.c index a0001705d..03f288336 100644 --- a/src/ds/video.c +++ b/src/ds/video.c @@ -291,13 +291,13 @@ static void _performCapture(struct DSVideo* video, int y) { pixel |= (colorA >> 3) & 0x001F; #endif pixel |= 0x8000; - STORE_16(pixel, ((x + y * DS_VIDEO_HORIZONTAL_PIXELS) * 2 + base) & 0x1FFFE, vram); + STORE_16(pixel, ((x + y * width) * 2 + base) & 0x1FFFE, vram); } break; case 1: for (x = 0; x < width; ++x) { LOAD_16(pixel, ((x + y * DS_VIDEO_HORIZONTAL_PIXELS) * 2 + readBase) & 0x1FFFE, srcB); - STORE_16(pixel, ((x + y * DS_VIDEO_HORIZONTAL_PIXELS) * 2 + base) & 0x1FFFE, vram); + STORE_16(pixel, ((x + y * width) * 2 + base) & 0x1FFFE, vram); } break; case 2: @@ -336,7 +336,7 @@ static void _performCapture(struct DSVideo* video, int y) { pixel = (pixel & 0x7C1F) | ((pixel >> 16) & 0x03E0); pixel |= 0x8000; - STORE_16(pixel, ((x + y * DS_VIDEO_HORIZONTAL_PIXELS) * 2 + base) & 0x1FFFE, vram); + STORE_16(pixel, ((x + y * width) * 2 + base) & 0x1FFFE, vram); } break; }