Index: emu/lcd.c
===================================================================
--- emu/lcd.c	(revision cd50b8c77a90c07c307cd4025a98bb8e0921bd65)
+++ emu/lcd.c	(revision c6f1cf543aed5b5d1c5715ea5c92fcb599bea183)
@@ -104,54 +104,22 @@
 	last = now;
 
-	void *buf;
-	int32_t pitch;
-
-	if (SDL_LockTexture(gfx, NULL, &buf, &pitch) < 0) {
-		fail("SDL_LockTexture() failed: %s", SDL_GetError());
-	}
-
-	uint32_t *pix = buf;
-
-	for (int32_t y = 0; y < GFX_H; ++y) {
-		for (int32_t x = 0; x < GFX_W * GFX_PIX; ++x) {
-			*pix++ = GFX_BGR;
-		}
-
-		pix += pitch / 4 - GFX_W * GFX_PIX;
+	if (SDL_FillRect(txt, NULL, TXT_BGR) < 0) {
+		fail("SDL_FillRect() failed: %s", SDL_GetError());
 	}
 
 	if (SDL_AtomicGet(&ena) == 0) {
-		SDL_UnlockTexture(gfx);
-
-		if (SDL_RenderCopy(ren, gfx, NULL, NULL) < 0) {
+		SDL_Texture *tex = SDL_CreateTextureFromSurface(ren, txt);
+
+		if (tex == NULL) {
+			fail("SDL_CreateTextureFromSurface() failed: %s", SDL_GetError());
+		}
+
+		if (SDL_RenderCopy(ren, tex, NULL, NULL) < 0) {
 			fail("SDL_RenderCopy() failed: %s", SDL_GetError());
 		}
 
+		SDL_DestroyTexture(tex);
 		SDL_RenderPresent(ren);
 		return;
-	}
-
-	pix = buf;
-
-	for (int32_t y = 0; y < GFX_H; ++y) {
-		for (int32_t x = 0; x < GFX_W; ++x) {
-			uint8_t b = mem_gfx[y * GFX_W + x];
-
-			for (int32_t p = 0; p < GFX_PIX; ++p) {
-				if ((b & (1 << (7 - p))) != 0) {
-					*pix = GFX_FGR;
-				}
-
-				++pix;
-			}
-		}
-
-		pix += pitch / 4 - GFX_W * GFX_PIX;
-	}
-
-	SDL_UnlockTexture(gfx);
-
-	if (SDL_FillRect(txt, NULL, TXT_BGR) < 0) {
-		fail("SDL_FillRect() failed: %s", SDL_GetError());
 	}
 
@@ -207,4 +175,28 @@
 	SDL_DestroyTexture(tex);
 
+	void *buf;
+	int32_t pitch;
+
+	if (SDL_LockTexture(gfx, NULL, &buf, &pitch) < 0) {
+		fail("SDL_LockTexture() failed: %s", SDL_GetError());
+	}
+
+	uint32_t *pix = buf;
+
+	for (int32_t y = 0; y < GFX_H; ++y) {
+		for (int32_t x = 0; x < GFX_W; ++x) {
+			uint8_t b = mem_gfx[y * GFX_W + x];
+
+			for (int32_t p = 0; p < GFX_PIX; ++p) {
+				bool set = (b & (1 << (7 - p))) != 0;
+				*pix++ = set ? GFX_FGR : GFX_BGR;
+			}
+		}
+
+		pix += pitch / 4 - GFX_W * GFX_PIX;
+	}
+
+	SDL_UnlockTexture(gfx);
+
 	if (SDL_RenderCopy(ren, gfx, NULL, NULL) < 0) {
 		fail("SDL_RenderCopy() failed: %s", SDL_GetError());
