Commit [bc8a7a] default Release-0_9 Maximize Restore History

See CHANGES File for Release 0.9

John L. Chmielewski John L. Chmielewski 2006-08-29

added libosd/jamie.patch
changed config.h
changed out2osd.c
changed CHANGES
changed ReleaseNotes
changed Makefile
changed out2osd.h
changed out2osd.conf
changed README
changed out2osd.1
changed INSTALL-TiVo
copied libosd/libosd-0.4.1.patch -> libosd/libosd-0.4.2.patch
libosd/jamie.patch Diff Switch to side-by-side view
Loading...
config.h Diff Switch to side-by-side view
Loading...
out2osd.c Diff Switch to side-by-side view
Loading...
CHANGES Diff Switch to side-by-side view
Loading...
ReleaseNotes Diff Switch to side-by-side view
Loading...
Makefile Diff Switch to side-by-side view
Loading...
out2osd.h Diff Switch to side-by-side view
Loading...
out2osd.conf Diff Switch to side-by-side view
Loading...
README Diff Switch to side-by-side view
Loading...
out2osd.1 Diff Switch to side-by-side view
Loading...
INSTALL-TiVo Diff Switch to side-by-side view
Loading...
libosd/libosd-0.4.1.patch to libosd/libosd-0.4.2.patch
--- a/libosd/libosd-0.4.1.patch
+++ b/libosd/libosd-0.4.2.patch
@@ -1,34 +1,290 @@
-*** libosd-0.4.1/Makefile.orig	2004-08-23 13:11:42.000000000 -0400
---- libosd-0.4.1/Makefile	2004-09-22 00:22:16.022744661 -0400
-***************
-*** 6,15 ****
-  # compilation variables
-  CC = gcc
-  OBJS = font.o osd.o drawstring_direct.o # cs22.o
-  ROOTINCDIR = ./include
-  INCDIR = $(ROOTINCDIR)/tivo/osd
-  FTINCDIR = /usr/local/$(ARCH)/include/freetype2
-! CFLAGS = -g -O -Wall -std=gnu99 -I$(ROOTINCDIR) -I$(FTINCDIR)
-  
-  SERIES=s1
-  ifeq ($(SERIES),s1)
---- 6,17 ----
-  # compilation variables
-  CC = gcc
+*** libosd-0.4.2/drawstring_direct.c.orig	2004-08-14 13:36:37.000000000 -0400
+--- libosd-0.4.2/drawstring_direct.c	2006-08-19 13:15:45.000000000 -0400
+***************
+*** 122,127 ****
+--- 122,128 ----
+  int compute_string_bbox(struct ft_info *info, FT_BBox  *abbox)
+  {
+    FT_BBox  bbox;
++   int n;
+  
+    /* initialize string bbox to "empty" values */    
+    bbox.xMin = bbox.yMin =  32000;
+***************
+*** 129,135 ****
+  
+    /* for each glyph image, compute its bounding box, */    
+    /* translate it, and grow the string bbox          */    
+!   for ( int n = 0; n < info->num_glyphs; n++ )
+      {
+        FT_BBox  glyph_bbox;
+  
+--- 130,136 ----
+  
+    /* for each glyph image, compute its bounding box, */    
+    /* translate it, and grow the string bbox          */    
+!   for ( n = 0; n < info->num_glyphs; n++ )
+      {
+        FT_BBox  glyph_bbox;
+  
+***************
+*** 179,185 ****
+    FT_Raster_Params raster_params;
+    struct raster_params_user_data raster_params_user_data;
+  
+!   int error;
+  
+    if ((bg != info->bg) || (fg != info->fg)) {
+      set_ft_bg_and_fg_colours(osd, info, bg, fg);
+--- 180,187 ----
+    FT_Raster_Params raster_params;
+    struct raster_params_user_data raster_params_user_data;
+  
+!   int error, i, n, row;
+!   int orig_dont_pad_bottom, orig_dont_pad_top;
+  
+    if ((bg != info->bg) || (fg != info->fg)) {
+      set_ft_bg_and_fg_colours(osd, info, bg, fg);
+***************
+*** 196,210 ****
+    start_y = y - string_height;
+    if (info->debug_show_lines) {
+  #ifdef __TIVO_S2__
+!     for (int i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
+        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y)                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x80ff0000;
+        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x8000ff00;
+        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x800000ff;
+      }
+!     for(int i=0; i<480; ++i)
+        osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+start_x] = 0xc0000000 | ((i/3)%2) * 0xff00;
+  #else  // not __TIVO_S2__
+!     for (int i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
+        osd->tivbuffer[(YSIZE-start_y                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 6;
+        osd->tivbuffer[(YSIZE-start_y + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 7;
+        osd->tivbuffer[(YSIZE-start_y - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 16;
+--- 198,212 ----
+    start_y = y - string_height;
+    if (info->debug_show_lines) {
+  #ifdef __TIVO_S2__
+!     for (i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
+        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y)                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x80ff0000;
+        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x8000ff00;
+        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x800000ff;
+      }
+!     for(i=0; i<480; ++i)
+        osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+start_x] = 0xc0000000 | ((i/3)%2) * 0xff00;
+  #else  // not __TIVO_S2__
+!     for (i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
+        osd->tivbuffer[(YSIZE-start_y                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 6;
+        osd->tivbuffer[(YSIZE-start_y + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 7;
+        osd->tivbuffer[(YSIZE-start_y - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 16;
+***************
+*** 212,231 ****
+  #endif
+    }
+  
+!   int orig_dont_pad_bottom = osd->pad.legibility_dont_pad_bottom;
+!   int orig_dont_pad_top    = osd->pad.legibility_dont_pad_top   ;
+!   for (int i = 0; i < osd->width; ++i)
+      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMax + 1)] != get_colour(0)) {
+        osd->pad.legibility_dont_pad_top = 1; break;
+      }
+!   for (int i = 0; i < osd->width; ++i)
+      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMin - 1)] != get_colour(0)) {
+        osd->pad.legibility_dont_pad_bottom = 1; break;
+      }
+  
+    // draw rectangular background
+  //  for (int row = string_bbox.yMin + start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
+!   for (int row = start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
+  //       row < string_bbox.yMax + start_y + osd->pad.top;
+         row < string_height + start_y + (osd->pad.legibility_dont_pad_top ? 0 : osd->pad.legibility_pad_top);
+         ++row)
+--- 214,233 ----
+  #endif
+    }
+  
+!   orig_dont_pad_bottom = osd->pad.legibility_dont_pad_bottom;
+!   orig_dont_pad_top    = osd->pad.legibility_dont_pad_top   ;
+!   for (i = 0; i < osd->width; ++i)
+      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMax + 1)] != get_colour(0)) {
+        osd->pad.legibility_dont_pad_top = 1; break;
+      }
+!   for (i = 0; i < osd->width; ++i)
+      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMin - 1)] != get_colour(0)) {
+        osd->pad.legibility_dont_pad_bottom = 1; break;
+      }
+  
+    // draw rectangular background
+  //  for (int row = string_bbox.yMin + start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
+!   for (row = start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
+  //       row < string_bbox.yMax + start_y + osd->pad.top;
+         row < string_height + start_y + (osd->pad.legibility_dont_pad_top ? 0 : osd->pad.legibility_pad_top);
+         ++row)
+***************
+*** 240,246 ****
+    osd->pad.legibility_dont_pad_top = orig_dont_pad_top;
+    osd->pad.legibility_dont_pad_bottom = orig_dont_pad_bottom;
+  
+!   for (int n = 0; n < info->num_glyphs; ++n) {
+      FT_Glyph   image;
+      FT_Vector  pen;
+  
+--- 242,248 ----
+    osd->pad.legibility_dont_pad_top = orig_dont_pad_top;
+    osd->pad.legibility_dont_pad_bottom = orig_dont_pad_bottom;
+  
+!   for (n = 0; n < info->num_glyphs; ++n) {
+      FT_Glyph   image;
+      FT_Vector  pen;
+  
+***************
+*** 250,258 ****
+      pen.x = start_x + info->pos[n].x;
+      pen.y = start_y + info->pos[n].y;
+  #ifdef __TIVO_S2__
+!     if (info->debug_show_lines) for(int i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 0xc0ff00ff;
+  #else  // not __TIVO_S2__
+!     if (info->debug_show_lines) for(int i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 18;
+  #endif  // __TIVO_S2__
+  
+      if (image->format == FT_GLYPH_FORMAT_OUTLINE) {
+--- 252,260 ----
+      pen.x = start_x + info->pos[n].x;
+      pen.y = start_y + info->pos[n].y;
+  #ifdef __TIVO_S2__
+!     if (info->debug_show_lines) for(i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 0xc0ff00ff;
+  #else  // not __TIVO_S2__
+!     if (info->debug_show_lines) for(i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 18;
+  #endif  // __TIVO_S2__
+  
+      if (image->format == FT_GLYPH_FORMAT_OUTLINE) {
+***************
+*** 306,315 ****
+  #ifdef __TIVO_S2__
+    int alpha;
+  #else  /* not __TIVO_S2__ */
+!   int ptr;
+  #endif
+  
+!   for (int row = 0; row < bitmap.rows; ++row) {
+      if (bitmap.pitch > 0) {
+  #ifdef __TIVO_S2__
+        for (int col = 0; col < bitmap.width; ++col) {
+--- 308,318 ----
+  #ifdef __TIVO_S2__
+    int alpha;
+  #else  /* not __TIVO_S2__ */
+!   int ptr, set_of_8cols;
+  #endif
++ int row;
+  
+!   for (row = 0; row < bitmap.rows; ++row) {
+      if (bitmap.pitch > 0) {
+  #ifdef __TIVO_S2__
+        for (int col = 0; col < bitmap.width; ++col) {
+***************
+*** 317,323 ****
+  	osd->tivbuffer[(top+row)*osd->row_modulo + left+col] = info->alpha_lookup[alpha];
+        }  // for each column
+  #else  /* not __TIVO_S2__ */
+!       for (int set_of_8cols = 0; set_of_8cols < (bitmap.width + 7)/8; ++set_of_8cols) {
+  	ptr = (top+row)*osd->row_modulo + left+8*set_of_8cols;
+  	togglebits(osd, bitmap.buffer[row*abs(bitmap.pitch) + set_of_8cols],
+  		   &ptr,
+--- 320,326 ----
+  	osd->tivbuffer[(top+row)*osd->row_modulo + left+col] = info->alpha_lookup[alpha];
+        }  // for each column
+  #else  /* not __TIVO_S2__ */
+!       for (set_of_8cols = 0; set_of_8cols < (bitmap.width + 7)/8; ++set_of_8cols) {
+  	ptr = (top+row)*osd->row_modulo + left+8*set_of_8cols;
+  	togglebits(osd, bitmap.buffer[row*abs(bitmap.pitch) + set_of_8cols],
+  		   &ptr,
+***************
+*** 334,340 ****
+  
+  // x and y are bottom-left-based Cartesian coordinates in integer pixels
+  void DrawLine(struct osd_info *osd, int x, int y, int len, colour_t colour) {
+!   for (int col = 0; col < len; ++col) {
+      // convert bottom-left-based Cartesian coordinates
+      // to top-left-based device coordinates
+      osd->tivbuffer[((YSIZE-y) * osd->row_modulo) + x + col] = colour;
+--- 337,345 ----
+  
+  // x and y are bottom-left-based Cartesian coordinates in integer pixels
+  void DrawLine(struct osd_info *osd, int x, int y, int len, colour_t colour) {
+!   int col;
+! 
+!   for (col = 0; col < len; ++col) {
+      // convert bottom-left-based Cartesian coordinates
+      // to top-left-based device coordinates
+      osd->tivbuffer[((YSIZE-y) * osd->row_modulo) + x + col] = colour;
+***************
+*** 342,351 ****
+  }
+  
+  void my_spanfunc(int y, int count, FT_Span *spans, void *user) {
+    colour_t colour_out;
+    struct raster_params_user_data *user_data = (struct raster_params_user_data *)user;
+  
+!   for (int i = 0; i < count; ++i) {
+      // process a span
+  #ifdef __TIVO_S2__
+      colour_out = user_data->info->alpha_lookup[spans[i].coverage & 0xff];
+--- 347,357 ----
+  }
+  
+  void my_spanfunc(int y, int count, FT_Span *spans, void *user) {
++   int i;
+    colour_t colour_out;
+    struct raster_params_user_data *user_data = (struct raster_params_user_data *)user;
+  
+!   for (i = 0; i < count; ++i) {
+      // process a span
+  #ifdef __TIVO_S2__
+      colour_out = user_data->info->alpha_lookup[spans[i].coverage & 0xff];
+***************
+*** 524,530 ****
+      break;
+    }
+  
+! //for(int i=0; i<osd->width; ++i) osd->tivbuffer[CART_TO_DEVICE_Y(osd,y)*osd->row_modulo + i] = 0xffff0000;
+    error = do_render_string(osd, info, bbox, x, y, bg, fg);
+    if (error != 0) return error;
+  
+--- 530,536 ----
+      break;
+    }
+  
+! //for(i=0; i<osd->width; ++i) osd->tivbuffer[CART_TO_DEVICE_Y(osd,y)*osd->row_modulo + i] = 0xffff0000;
+    error = do_render_string(osd, info, bbox, x, y, bg, fg);
+    if (error != 0) return error;
+  
+*** libosd-0.4.2/Makefile.orig	2006-08-19 13:13:08.000000000 -0400
+--- libosd-0.4.2/Makefile	2006-08-19 13:15:45.000000000 -0400
+***************
+*** 3,9 ****
+--- 3,18 ----
+  
+  version = 0.4.2
+  
++ # compilation variables
++ CC = /usr/local/$(ARCH)/bin/gcc
   OBJS = font.o osd.o drawstring_direct.o # cs22.o
 + OBJ2 = brcm.o setupBrcmDisplay.o
-  ROOTINCDIR = ./include
-  INCDIR = $(ROOTINCDIR)/tivo/osd
-  FTINCDIR = /usr/local/$(ARCH)/include/freetype2
-! CSTANDARD = -std=gnu99
-! CFLAGS = -g -O -Wall $(CSTANDARD) -I$(ROOTINCDIR) -I$(FTINCDIR)
-  
-  SERIES=s1
++ ROOTINCDIR = ./include
++ INCDIR = $(ROOTINCDIR)/tivo/osd
++ OTHINCDIR = /usr/local/$(ARCH)/include
++ FTINCDIR = $(OTHINCDIR)/freetype2
++ CSTANDARD = -std=gnu99
++ CFLAGS += -g -O -Wall $(CSTANDARD) -I$(ROOTINCDIR) -I$(OTHINCDIR) -I$(FTINCDIR)
+  
+  SERIES=s2
   ifeq ($(SERIES),s1)
 ***************
-*** 18,26 ****
+*** 12,31 ****
   	ifeq ($(SERIES),s2)
-  		ARCH=mips-tivo-3.2/mips-unknown-linux-gnu
+  		ARCH=mips-tivo72
   		CFLAGS += -D__TIVO_S2__
 ! 		OBJS += brcm.o setupBrcmDisplay.o
   	else
@@ -36,9 +292,20 @@
   	endif
   endif
   
---- 20,44 ----
+- # compilation variables
+- CC = /usr/local/$(ARCH)/bin/gcc
+- ROOTINCDIR = ./include
+- INCDIR = $(ROOTINCDIR)/tivo/osd
+- OTHINCDIR = /usr/local/$(ARCH)/include
+- FTINCDIR = $(OTHINCDIR)/freetype2
+- CFLAGS += -g -O -Wall -std=gnu99 -I$(ROOTINCDIR) -I$(OTHINCDIR) -I$(FTINCDIR)
+- 
+  # installation variables
+  prefix = /usr/local/$(ARCH)
+  exec_prefix = $(prefix)
+--- 21,48 ----
   	ifeq ($(SERIES),s2)
-  		ARCH=mips-tivo-3.2/mips-unknown-linux-gnu
+  		ARCH=mips-tivo72
   		CFLAGS += -D__TIVO_S2__
 ! 		OBJS += $(OBJ2)
   	else
@@ -56,60 +323,17 @@
 ! 				CFLAGS += -D__TIVO_S2__
 ! 				OBJS += $(OBJ2)
 ! 			else
-! 				ERROR = $(SERIES)
+! 				echo 1>2 "TiVo series '$(SERIES)' not supported"; false
 ! 			endif
 ! 		endif
   	endif
   endif
   
-***************
-*** 36,45 ****
-  INSTALL_PROGRAM = $(INSTALL)
-  INSTALL_DATA = $(INSTALL) -m 644
-  
-! all: libosd.a
-  
-  libosd.a: $(OBJS)
-! 	ar -rc libosd.a $(OBJS)
-  
-  brcm.o: $(INCDIR)/brcm.h $(INCDIR)/osd_types.h
-  
---- 54,69 ----
-  INSTALL_PROGRAM = $(INSTALL)
-  INSTALL_DATA = $(INSTALL) -m 644
-  
-! all: errmsg libosd.a
-! 
-! errmsg:
-! ifeq ($(ERROR),$(SERIES))
-! 	@echo "TiVo series '$(SERIES)' not supported"
-! 	@false
-! endif
-  
-  libosd.a: $(OBJS)
-! 	$(AR) -rc libosd.a $(OBJS)
-  
-  brcm.o: $(INCDIR)/brcm.h $(INCDIR)/osd_types.h
-  
-***************
-*** 55,61 ****
-  
-  .PHONY: clean install install_libosd install_headers dist
-  clean:
-! 	-rm -rf libosd.a $(OBJS) $(distdir)
-  
-  install: install_libosd install_headers
-  	$(INSTALL_DATA) libosd.a $(libdir)/libosd.a
---- 79,85 ----
-  
-  .PHONY: clean install install_libosd install_headers dist
-  clean:
-! 	-rm -rf libosd.a $(OBJS) $(OBJ2) $(distdir)
-  
-  install: install_libosd install_headers
-  	$(INSTALL_DATA) libosd.a $(libdir)/libosd.a
-*** libosd-0.4.1/osd.c.orig	2004-08-21 19:50:45.000000000 -0400
---- libosd-0.4.1/osd.c	2004-09-20 14:28:12.000000000 -0400
+  # installation variables
+  prefix = /usr/local/$(ARCH)
+  exec_prefix = $(prefix)
+*** libosd-0.4.2/osd.c.orig	2006-08-19 13:13:42.000000000 -0400
+--- libosd-0.4.2/osd.c	2006-08-19 13:15:45.000000000 -0400
 ***************
 *** 23,28 ****
 --- 23,29 ----
@@ -138,7 +362,7 @@
     int old_dont_pad_x = osd->pad.dont_pad_x;
     if (!osd->tivbuffer) return;
 ***************
-*** 461,467 ****
+*** 467,473 ****
       osd->pad.dont_pad_x = old_dont_pad_x;
   
       if (!osd->pad.dont_pad_y && !osd->pad.legibility_dont_pad_top && !osd->pad.legibility_dont_pad_bottom) {
@@ -146,7 +370,7 @@
   //fprintf(stderr, "osd->width is %d; osd->height is %d\n", osd->width, osd->height);
   //fprintf(stderr, "orig_x is %d; offset_y is %d; POS(osd, orig_x, orig_y) - osd->offset_y*OSD_ROW_MODULO is %d\n", orig_x, osd->offset_y, POS(osd, orig_x, orig_y) - (osd->offset_y*OSD_ROW_MODULO));
   //fprintf(stderr, "orig_y-osd->offset_y is %d\n", orig_y-osd->offset_y);
---- 462,468 ----
+--- 468,474 ----
       osd->pad.dont_pad_x = old_dont_pad_x;
   
       if (!osd->pad.dont_pad_y && !osd->pad.legibility_dont_pad_top && !osd->pad.legibility_dont_pad_bottom) {
@@ -155,7 +379,7 @@
   //fprintf(stderr, "orig_x is %d; offset_y is %d; POS(osd, orig_x, orig_y) - osd->offset_y*OSD_ROW_MODULO is %d\n", orig_x, osd->offset_y, POS(osd, orig_x, orig_y) - (osd->offset_y*OSD_ROW_MODULO));
   //fprintf(stderr, "orig_y-osd->offset_y is %d\n", orig_y-osd->offset_y);
 ***************
-*** 489,495 ****
+*** 495,501 ****
   		 //		   + osd->pad.legibility_pad_left + osd->pad.legibility_pad_right,
   		 osd->pad.legibility_pad_bottom_colour);
   }
@@ -163,7 +387,7 @@
   	DrawLine(osd, POS(osd, orig_x, 0) - (osd->offset_y*osd->row_modulo) - osd->pad.legibility_pad_left,
   		 DEVICE_TO_CART_Y(osd, LINE_NO(osd, orig_y) - row),
   		 POS(osd, cur_x, 0) - POS(osd, orig_x, 0) + osd->pad.legibility_pad_left + osd->pad.legibility_pad_right,
---- 490,496 ----
+--- 496,502 ----
   		 //		   + osd->pad.legibility_pad_left + osd->pad.legibility_pad_right,
   		 osd->pad.legibility_pad_bottom_colour);
   }
@@ -172,8 +396,8 @@
   		 DEVICE_TO_CART_Y(osd, LINE_NO(osd, orig_y) - row),
   		 POS(osd, cur_x, 0) - POS(osd, orig_x, 0) + osd->pad.legibility_pad_left + osd->pad.legibility_pad_right,
 ***************
-*** 657,662 ****
---- 658,664 ----
+*** 663,668 ****
+--- 664,670 ----
       { .name = ""                  , .has_arg = 0, .var = NULL                },
     };
   
@@ -182,7 +406,7 @@
     FILE *fp = fopen(config_file_name, "r");
     if (fp == NULL) return -1;
 ***************
-*** 665,671 ****
+*** 671,677 ****
       if ((temp[0] == '\n') || (temp[0] == '#')) continue;
       nl = strchr(temp, '\n');
       if (nl != NULL) *nl = '\0';
@@ -190,7 +414,7 @@
         if (strncasecmp(temp, config_options[i].name, strlen(config_options[i].name)) == 0) {
    	if (config_options[i].has_arg)
    	  *config_options[i].var = atoi(&temp[strlen(config_options[i].name)]);
---- 667,673 ----
+--- 673,679 ----
       if ((temp[0] == '\n') || (temp[0] == '#')) continue;
       nl = strchr(temp, '\n');
       if (nl != NULL) *nl = '\0';
@@ -198,265 +422,3 @@
         if (strncasecmp(temp, config_options[i].name, strlen(config_options[i].name)) == 0) {
    	if (config_options[i].has_arg)
    	  *config_options[i].var = atoi(&temp[strlen(config_options[i].name)]);
-*** libosd-0.4.1/drawstring_direct.c.orig	2004-08-14 13:36:37.000000000 -0400
---- libosd-0.4.1/drawstring_direct.c	2004-09-20 14:29:13.000000000 -0400
-***************
-*** 122,127 ****
---- 122,128 ----
-  int compute_string_bbox(struct ft_info *info, FT_BBox  *abbox)
-  {
-    FT_BBox  bbox;
-+   int n;
-  
-    /* initialize string bbox to "empty" values */    
-    bbox.xMin = bbox.yMin =  32000;
-***************
-*** 129,135 ****
-  
-    /* for each glyph image, compute its bounding box, */    
-    /* translate it, and grow the string bbox          */    
-!   for ( int n = 0; n < info->num_glyphs; n++ )
-      {
-        FT_BBox  glyph_bbox;
-  
---- 130,136 ----
-  
-    /* for each glyph image, compute its bounding box, */    
-    /* translate it, and grow the string bbox          */    
-!   for ( n = 0; n < info->num_glyphs; n++ )
-      {
-        FT_BBox  glyph_bbox;
-  
-***************
-*** 179,185 ****
-    FT_Raster_Params raster_params;
-    struct raster_params_user_data raster_params_user_data;
-  
-!   int error;
-  
-    if ((bg != info->bg) || (fg != info->fg)) {
-      set_ft_bg_and_fg_colours(osd, info, bg, fg);
---- 180,187 ----
-    FT_Raster_Params raster_params;
-    struct raster_params_user_data raster_params_user_data;
-  
-!   int error, i, n, row;
-!   int orig_dont_pad_bottom, orig_dont_pad_top;
-  
-    if ((bg != info->bg) || (fg != info->fg)) {
-      set_ft_bg_and_fg_colours(osd, info, bg, fg);
-***************
-*** 196,210 ****
-    start_y = y - string_height;
-    if (info->debug_show_lines) {
-  #ifdef __TIVO_S2__
-!     for (int i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
-        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y)                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x80ff0000;
-        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x8000ff00;
-        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x800000ff;
-      }
-!     for(int i=0; i<480; ++i)
-        osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+start_x] = 0xc0000000 | ((i/3)%2) * 0xff00;
-  #else  // not __TIVO_S2__
-!     for (int i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
-        osd->tivbuffer[(YSIZE-start_y                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 6;
-        osd->tivbuffer[(YSIZE-start_y + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 7;
-        osd->tivbuffer[(YSIZE-start_y - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 16;
---- 198,212 ----
-    start_y = y - string_height;
-    if (info->debug_show_lines) {
-  #ifdef __TIVO_S2__
-!     for (i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
-        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y)                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x80ff0000;
-        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x8000ff00;
-        osd->tivbuffer[(CART_TO_DEVICE_Y(osd,start_y) - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 0x800000ff;
-      }
-!     for(i=0; i<480; ++i)
-        osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+start_x] = 0xc0000000 | ((i/3)%2) * 0xff00;
-  #else  // not __TIVO_S2__
-!     for (i = 0; i < 720/*OSD_ROW_MODULO(osd)*/; ++i) {  // bottom row, baseline, top row
-        osd->tivbuffer[(YSIZE-start_y                   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 6;
-        osd->tivbuffer[(YSIZE-start_y + string_bbox.yMin)*720/*OSD_ROW_MODULO(osd)*/ + i] = 7;
-        osd->tivbuffer[(YSIZE-start_y - string_height   )*720/*OSD_ROW_MODULO(osd)*/ + i] = 16;
-***************
-*** 212,231 ****
-  #endif
-    }
-  
-!   int orig_dont_pad_bottom = osd->pad.legibility_dont_pad_bottom;
-!   int orig_dont_pad_top    = osd->pad.legibility_dont_pad_top   ;
-!   for (int i = 0; i < osd->width; ++i)
-      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMax + 1)] != get_colour(0)) {
-        osd->pad.legibility_dont_pad_top = 1; break;
-      }
-!   for (int i = 0; i < osd->width; ++i)
-      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMin - 1)] != get_colour(0)) {
-        osd->pad.legibility_dont_pad_bottom = 1; break;
-      }
-  
-    // draw rectangular background
-  //  for (int row = string_bbox.yMin + start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
-!   for (int row = start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
-  //       row < string_bbox.yMax + start_y + osd->pad.top;
-         row < string_height + start_y + (osd->pad.legibility_dont_pad_top ? 0 : osd->pad.legibility_pad_top);
-         ++row)
---- 214,233 ----
-  #endif
-    }
-  
-!   orig_dont_pad_bottom = osd->pad.legibility_dont_pad_bottom;
-!   orig_dont_pad_top    = osd->pad.legibility_dont_pad_top   ;
-!   for (i = 0; i < osd->width; ++i)
-      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMax + 1)] != get_colour(0)) {
-        osd->pad.legibility_dont_pad_top = 1; break;
-      }
-!   for (i = 0; i < osd->width; ++i)
-      if (osd->tivbuffer[CART_TO_DEVICE_Y(osd, string_bbox.yMin - 1)] != get_colour(0)) {
-        osd->pad.legibility_dont_pad_bottom = 1; break;
-      }
-  
-    // draw rectangular background
-  //  for (int row = string_bbox.yMin + start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
-!   for (row = start_y - (osd->pad.legibility_dont_pad_bottom ? 0 : osd->pad.legibility_pad_bottom);
-  //       row < string_bbox.yMax + start_y + osd->pad.top;
-         row < string_height + start_y + (osd->pad.legibility_dont_pad_top ? 0 : osd->pad.legibility_pad_top);
-         ++row)
-***************
-*** 240,246 ****
-    osd->pad.legibility_dont_pad_top = orig_dont_pad_top;
-    osd->pad.legibility_dont_pad_bottom = orig_dont_pad_bottom;
-  
-!   for (int n = 0; n < info->num_glyphs; ++n) {
-      FT_Glyph   image;
-      FT_Vector  pen;
-  
---- 242,248 ----
-    osd->pad.legibility_dont_pad_top = orig_dont_pad_top;
-    osd->pad.legibility_dont_pad_bottom = orig_dont_pad_bottom;
-  
-!   for (n = 0; n < info->num_glyphs; ++n) {
-      FT_Glyph   image;
-      FT_Vector  pen;
-  
-***************
-*** 250,258 ****
-      pen.x = start_x + info->pos[n].x;
-      pen.y = start_y + info->pos[n].y;
-  #ifdef __TIVO_S2__
-!     if (info->debug_show_lines) for(int i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 0xc0ff00ff;
-  #else  // not __TIVO_S2__
-!     if (info->debug_show_lines) for(int i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 18;
-  #endif  // __TIVO_S2__
-  
-      if (image->format == FT_GLYPH_FORMAT_OUTLINE) {
---- 252,260 ----
-      pen.x = start_x + info->pos[n].x;
-      pen.y = start_y + info->pos[n].y;
-  #ifdef __TIVO_S2__
-!     if (info->debug_show_lines) for(i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 0xc0ff00ff;
-  #else  // not __TIVO_S2__
-!     if (info->debug_show_lines) for(i=0; i<480; ++i) osd->tivbuffer[i*720/*OSD_ROW_MODULO(osd)*/+pen.x] = 18;
-  #endif  // __TIVO_S2__
-  
-      if (image->format == FT_GLYPH_FORMAT_OUTLINE) {
-***************
-*** 306,315 ****
-  #ifdef __TIVO_S2__
-    int alpha;
-  #else  /* not __TIVO_S2__ */
-!   int ptr;
-  #endif
-  
-!   for (int row = 0; row < bitmap.rows; ++row) {
-      if (bitmap.pitch > 0) {
-  #ifdef __TIVO_S2__
-        for (int col = 0; col < bitmap.width; ++col) {
---- 308,318 ----
-  #ifdef __TIVO_S2__
-    int alpha;
-  #else  /* not __TIVO_S2__ */
-!   int ptr, set_of_8cols;
-  #endif
-+ int row;
-  
-!   for (row = 0; row < bitmap.rows; ++row) {
-      if (bitmap.pitch > 0) {
-  #ifdef __TIVO_S2__
-        for (int col = 0; col < bitmap.width; ++col) {
-***************
-*** 317,323 ****
-  	osd->tivbuffer[(top+row)*osd->row_modulo + left+col] = info->alpha_lookup[alpha];
-        }  // for each column
-  #else  /* not __TIVO_S2__ */
-!       for (int set_of_8cols = 0; set_of_8cols < (bitmap.width + 7)/8; ++set_of_8cols) {
-  	ptr = (top+row)*osd->row_modulo + left+8*set_of_8cols;
-  	togglebits(osd, bitmap.buffer[row*abs(bitmap.pitch) + set_of_8cols],
-  		   &ptr,
---- 320,326 ----
-  	osd->tivbuffer[(top+row)*osd->row_modulo + left+col] = info->alpha_lookup[alpha];
-        }  // for each column
-  #else  /* not __TIVO_S2__ */
-!       for (set_of_8cols = 0; set_of_8cols < (bitmap.width + 7)/8; ++set_of_8cols) {
-  	ptr = (top+row)*osd->row_modulo + left+8*set_of_8cols;
-  	togglebits(osd, bitmap.buffer[row*abs(bitmap.pitch) + set_of_8cols],
-  		   &ptr,
-***************
-*** 334,340 ****
-  
-  // x and y are bottom-left-based Cartesian coordinates in integer pixels
-  void DrawLine(struct osd_info *osd, int x, int y, int len, colour_t colour) {
-!   for (int col = 0; col < len; ++col) {
-      // convert bottom-left-based Cartesian coordinates
-      // to top-left-based device coordinates
-      osd->tivbuffer[((YSIZE-y) * osd->row_modulo) + x + col] = colour;
---- 337,345 ----
-  
-  // x and y are bottom-left-based Cartesian coordinates in integer pixels
-  void DrawLine(struct osd_info *osd, int x, int y, int len, colour_t colour) {
-!   int col;
-! 
-!   for (col = 0; col < len; ++col) {
-      // convert bottom-left-based Cartesian coordinates
-      // to top-left-based device coordinates
-      osd->tivbuffer[((YSIZE-y) * osd->row_modulo) + x + col] = colour;
-***************
-*** 342,351 ****
-  }
-  
-  void my_spanfunc(int y, int count, FT_Span *spans, void *user) {
-    colour_t colour_out;
-    struct raster_params_user_data *user_data = (struct raster_params_user_data *)user;
-  
-!   for (int i = 0; i < count; ++i) {
-      // process a span
-  #ifdef __TIVO_S2__
-      colour_out = user_data->info->alpha_lookup[spans[i].coverage & 0xff];
---- 347,357 ----
-  }
-  
-  void my_spanfunc(int y, int count, FT_Span *spans, void *user) {
-+   int i;
-    colour_t colour_out;
-    struct raster_params_user_data *user_data = (struct raster_params_user_data *)user;
-  
-!   for (i = 0; i < count; ++i) {
-      // process a span
-  #ifdef __TIVO_S2__
-      colour_out = user_data->info->alpha_lookup[spans[i].coverage & 0xff];
-***************
-*** 524,530 ****
-      break;
-    }
-  
-! //for(int i=0; i<osd->width; ++i) osd->tivbuffer[CART_TO_DEVICE_Y(osd,y)*osd->row_modulo + i] = 0xffff0000;
-    error = do_render_string(osd, info, bbox, x, y, bg, fg);
-    if (error != 0) return error;
-  
---- 530,536 ----
-      break;
-    }
-  
-! //for(i=0; i<osd->width; ++i) osd->tivbuffer[CART_TO_DEVICE_Y(osd,y)*osd->row_modulo + i] = 0xffff0000;
-    error = do_render_string(osd, info, bbox, x, y, bg, fg);
-    if (error != 0) return error;
-