From 4f263d8e36bb46d6be5dbf3106037914fcf3bfbd Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 22 Jun 2007 20:43:08 +0000
Subject: [PATCH] Real for partial scroll detection... ansivmem uses shorts of
 all the stupid things. This will need to be fixed for ANSI output on BE
 platforms.

---
 src/conio/ansi_cio.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/conio/ansi_cio.c b/src/conio/ansi_cio.c
index 6f17a4f0af..f9708e6ebf 100644
--- a/src/conio/ansi_cio.c
+++ b/src/conio/ansi_cio.c
@@ -238,6 +238,11 @@ int ansi_puttext(int sx, int sy, int ex, int ey, void* buf)
 			|| fill==NULL)
 		return(0);
 
+	/* Check if this actually does anything */
+	if(sx==1 && sy==1 && ex==ti.screenwidth && ey==ti.screenheight
+			&& memcmp(buf,ansivmem,ti.screenwidth*ti.screenheight*2)==0)
+		return;
+
 	out=fill;
 	attrib=ti.attribute;
 
@@ -291,7 +296,7 @@ int ansi_puttext(int sx, int sy, int ex, int ey, void* buf)
 #if 1
 	/* Check if this *includes* a scroll */
 	if(sx==1 && sy==1 && ex==ti.screenwidth && ey==ti.screenheight
-			&& memcmp(buf,ansivmem+ti.screenwidth*2,ti.screenwidth*(ti.screenheight-1)*2)==0) {
+			&& memcmp(buf,ansivmem+ti.screenwidth,ti.screenwidth*(ti.screenheight-1)*2)==0) {
 		/* We need to get to the bottom line... */
 		if(ansi_row < ti.screenheight-1) {
 			if(ansi_row > ti.screenheight-5) {
-- 
GitLab