From d26ba2ee5451bb53bf15384b1ad7af12ecd665ff Mon Sep 17 00:00:00 2001
From: PrisimaTheFox <prisimathefox@gmail.com>
Date: Sun, 9 Sep 2018 23:16:28 -0500
Subject: [PATCH] Update m_anigif.c

More accurate GIF delay.
---
 src/m_anigif.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/m_anigif.c b/src/m_anigif.c
index 2540665ad5..5c7cfbd687 100644
--- a/src/m_anigif.c
+++ b/src/m_anigif.c
@@ -492,7 +492,9 @@ static void GIF_framewrite(void)
 
 	// screen regions are handled in GIF_lzw
 	{
-		UINT16 delay = 3; // todo
+		int d1 = (int)((100.0/NEWTICRATE)*gif_frames);
+		int d2 = (int)((100.0/NEWTICRATE)*(gif_frames-1));
+		UINT16 delay = d1-d2;
 		INT32 startline;
 
 		WRITEMEM(p, gifframe_gchead, 4);
-- 
GitLab