We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e03583 commit b1f7bdcCopy full SHA for b1f7bdc
src/device/gpu/gpu.cpp
@@ -523,8 +523,15 @@ void GPU::cmdVramToVram() {
523
int w = MaskCopy::w(arguments[3] & 0xffff);
524
int h = MaskCopy::h((arguments[3] & 0xffff0000) >> 16);
525
526
+ // Note: VramToVram copy is always Top-to-Bottom
527
+ // but it might be Left-to-Right or Right-to-Left depending whether srcX < dstX
528
+ // See gpu/vram-to-vram-overlap test
529
+ bool dir = srcX < dstX;
530
+
531
for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++) {
532
+ for (int _x = 0; _x < w; _x++) {
533
+ int x = (!dir) ? _x : w - 1 - _x;
534
535
uint16_t src = VRAM[(srcY + y) % VRAM_HEIGHT][(srcX + x) % VRAM_WIDTH];
536
maskedWrite(dstX + x, dstY + y, src);
537
}
0 commit comments