]> skyeroc.xyz Git - dgamelaunch/commitdiff
TTY playback fixes from blackpenguin.
authorPasi Kallinen <paxed@alt.org>
Mon, 13 Sep 2010 16:18:22 +0000 (16:18 +0000)
committerPasi Kallinen <paxed@alt.org>
Mon, 13 Sep 2010 16:18:22 +0000 (16:18 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@576 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

ttyplay.c

index 010b8519269de74626cbf7658fac00a4c116312f..fbdfdfc936360c18d29b83322f5bf7c38b156460 100644 (file)
--- a/ttyplay.c
+++ b/ttyplay.c
@@ -449,9 +449,12 @@ static off_t
 find_seek_offset_clrscr (FILE * fp)
 {
   off_t raw_seek_offset = 0;
+  off_t raw_seek_offset2 = 0;
   off_t seek_offset_clrscr;
 
   raw_seek_offset = find_last_string_in_file(fp, "\033[2J");
+  raw_seek_offset2 = find_last_string_in_file(fp, "\033[H\033[J");
+  if (raw_seek_offset2>raw_seek_offset) raw_seek_offset=raw_seek_offset2;
 
   seek_offset_clrscr = 0;
   /* now find last filepos that is less than seek offset */
@@ -534,7 +537,7 @@ ttyplay_main (char *ttyfile, int mode, int resizex, int resizey)
   new.c_cc[VMIN] = 1;
   new.c_cc[VTIME] = 0;
   tcsetattr (0, TCSANOW, &new); /* Make it current */
-
+  raw();
 
   if (resizex > 0 && resizey > 0) {
       term_resizex = resizex;