diff --git a/src/f_finale.c b/src/f_finale.c
index 9741962289d3891273d5a49567971de6e57c3032..21a1590827aac27da9c5344e3c69a07930c0529d 100644
--- a/src/f_finale.c
+++ b/src/f_finale.c
@@ -1281,6 +1281,9 @@ void F_CreditDrawer(void)
 	UINT8 colornum;
 	const UINT8 *colormap;
 
+	// compensation for y on non-green resolutions, used to prevent text from disappearing before reaching the top
+	UINT16 compy = (vid.height - (BASEVIDHEIGHT * vid.dup)) / 2;
+
 	if (players[consoleplayer].skincolor)
 		colornum = players[consoleplayer].skincolor;
 	else
@@ -1303,9 +1306,6 @@ void F_CreditDrawer(void)
 	// Dim the background
 	V_DrawFadeScreen(0xFF00, 16);
 
-	// compensation for y on non-green resolutions, used to prevent text from disappearing before reaching the top
-	int compy = vid.height - BASEVIDHEIGHT;
-
 	// Draw credits text on top
 	for (i = 0; credits[i]; i++)
 	{