diff --git a/src/GPU.cpp b/src/GPU.cpp index dcd79b48..071d5f65 100644 --- a/src/GPU.cpp +++ b/src/GPU.cpp @@ -284,6 +284,7 @@ void SetDisplaySettings(bool accel) if (Framebuffer[1][0]) delete[] Framebuffer[1][0]; if (Framebuffer[0][1]) delete[] Framebuffer[0][1]; if (Framebuffer[1][1]) delete[] Framebuffer[1][1]; + Framebuffer[0][0] = new u32[fbsize]; Framebuffer[1][0] = new u32[fbsize]; Framebuffer[0][1] = new u32[fbsize]; diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp index 3375d452..8998453f 100644 --- a/src/GPU2D.cpp +++ b/src/GPU2D.cpp @@ -753,8 +753,10 @@ void GPU2D::DrawScanline(u32 line) case 1: // regular display { - for (int i = 0; i < stride; i+=2) + int i = 0; + for (; i < (stride & ~1); i+=2) *(u64*)&dst[i] = *(u64*)&BGOBJLine[i]; + if (stride & 1) dst[i] = BGOBJLine[i]; } break;