Removed support for 40 column display from the apple2enh build. The startup code now switches to 80 column display itself. This allows to:

- configure the web browser to a 76 column wide display.
- get rid of some ugly special background handling code.

Note: The Applesoft wrapper program is now simply used to switch between the result of the apple2 build and the apple2enh build.
diff --git a/contiki-apple2/conf/www-conf.h b/contiki-apple2/conf/www-conf.h
index 93bbea6..cebdb10 100644
--- a/contiki-apple2/conf/www-conf.h
+++ b/contiki-apple2/conf/www-conf.h
@@ -32,7 +32,7 @@
  *
  * This file is part of the Contiki desktop environment
  *
- * $Id: www-conf.h,v 1.3 2004/06/09 22:06:32 oliverschmidt Exp $
+ * $Id: www-conf.h,v 1.4 2004/07/12 21:35:40 oliverschmidt Exp $
  *
  */
 #ifndef __WWW_CONF_H__
@@ -41,7 +41,11 @@
 #define WWW_CONF_HOMEPAGE "http://www.apple2.org/"
 
 /* The size of the HTML viewing area. */
+#ifdef __APPLE2__
 #define WWW_CONF_WEBPAGE_WIDTH 36
+#else /* __APPLE2__ */
+#define WWW_CONF_WEBPAGE_WIDTH 76
+#endif /* __APPLE2__ */
 #define WWW_CONF_WEBPAGE_HEIGHT 16
 
 /* The size of the "Back" history. */
diff --git a/contiki-apple2/contiki.txt b/contiki-apple2/contiki.txt
index 743bf5f..24743b1 100644
--- a/contiki-apple2/contiki.txt
+++ b/contiki-apple2/contiki.txt
@@ -1,7 +1,7 @@
 
    10 REM LOADER FOR CONTIKI ON THE APPLE ][ (OLIVER SCHMIDT)   
    20 HOME :VTAB 2:HTAB 12
-   30 PRINT "Welcome to Contiki"
+   30 PRINT "WELCOME TO CONTIKI"
    40 VTAB 3:HTAB 12
    50 PRINT "=================="
    60 FOR I=0 TO 6
@@ -9,38 +9,35 @@
    80 NEXT I
    90 IF C$<>"CONTIKI" GOTO 150
   100 VTAB 19:HTAB 10
-  110 PRINT "Saving Contiki Conf..."
+  110 PRINT "SAVING CONTIKI CONF..."
   120 PRINT CHR$(4)"BSAVE CONTIKI.CONF,A$280,L$80"
   130 VTAB 19:HTAB 10
   140 PRINT "                      "
   150 IF PEEK(116)>=184 GOTO 190
   160 HOME :PRINT 
-  170 PRINT "Error: Contiki requires DOS to be in LC"
+  170 PRINT "ERROR: CONTIKI REQUIRES DOS TO BE IN LC"
   180 END 
-  190 VTAB 8:HTAB 11
-  200 PRINT "1: 40 Column Display"
-  210 VTAB 10:HTAB 11
-  220 PRINT "2: 80 Column Display"
-  230 VTAB 13:HTAB 11
-  240 PRINT "0: Quit"
-  250 VTAB 16:HTAB 11
+  190 VTAB 8:HTAB 5
+  200 PRINT "1: 40 COL. (64K APPLE ][ OR ][+)"
+  210 VTAB 10:HTAB 5
+  220 PRINT "2: 80 COL. (ENHANCED //E OR //C)"
+  230 VTAB 13:HTAB 5
+  240 PRINT "0: QUIT"
+  250 VTAB 16:HTAB 5
   260 GET K$
   270 IF K$<"0" OR K$>"2" GOTO 260
-  280 IF K$="0" GOTO 440
-  290 IF K$="2" GOTO 320
-  300 H=10
-  310 GOTO 340
-  320 PRINT :PRINT CHR$(4)"PR#3":PRINT 
-  330 H=28
-  340 IF C$="CONTIKI" GOTO 380
-  350 VTAB 19:HTAB H
-  360 PRINT "Loading Contiki Conf..."
-  370 PRINT CHR$(4)"BLOAD CONTIKI.CONF"
-  380 VTAB 19:HTAB H
-  390 PRINT "Loading Contiki Data..."
-  400 PRINT CHR$(4)"BRUN CONTIKI.DATA"
-  410 VTAB 19:HTAB H
-  420 PRINT "Loading Contiki Code..."
-  430 PRINT CHR$(4)"BRUN CONTIKI.CODE"
-  440 HOME 
+  280 IF K$="0" GOTO 410
+  290 IF K$="1" GOTO 310
+  300 E$=".ENH"
+  310 IF C$="CONTIKI" GOTO 350
+  320 VTAB 19:HTAB 10
+  330 PRINT "LOADING CONTIKI CONF..."
+  340 PRINT CHR$(4)"BLOAD CONTIKI.CONF"
+  350 VTAB 19:HTAB 10
+  360 PRINT "LOADING CONTIKI DATA..."
+  370 PRINT CHR$(4)"BRUN CONTIKI.DATA"E$
+  380 VTAB 19:HTAB 10
+  390 PRINT "LOADING CONTIKI CODE..."
+  400 PRINT CHR$(4)"BRUN CONTIKI.CODE"E$
+  410 HOME 
 
diff --git a/contiki-apple2/ctk/ctk-mousetext.c b/contiki-apple2/ctk/ctk-mousetext.c
index 0d3b7b5..c3d08df 100644
--- a/contiki-apple2/ctk/ctk-mousetext.c
+++ b/contiki-apple2/ctk/ctk-mousetext.c
@@ -29,7 +29,7 @@
  *
  * This file is part of the "ctk" console GUI toolkit for cc65
  *
- * $Id: ctk-mousetext.c,v 1.6 2004/07/11 12:24:53 oliverschmidt Exp $
+ * $Id: ctk-mousetext.c,v 1.7 2004/07/12 21:36:00 oliverschmidt Exp $
  *
  */
 
@@ -47,8 +47,6 @@
 #define NULL (void *)0
 #endif /* NULL */
 
-static unsigned char sizex, sizey;
-
 unsigned char ctk_draw_windowborder_height = 1;
 unsigned char ctk_draw_windowborder_width = 1;
 unsigned char ctk_draw_windowtitle_height = 1;
@@ -74,15 +72,7 @@
 void
 ctk_draw_init(void)
 {
-  unsigned char i = 0;
-
-  while(i < 40) {
-    ((char *)0x0200)[i++] = 'V';
-    ((char *)0x0200)[i++] = 'W';
-  }
-
-  screensize(&sizex, &sizey);
-  ctk_draw_clear(0, sizey);
+  ctk_draw_clear(0, 24);
 }
 /*-----------------------------------------------------------------------------------*/
 static void
@@ -228,8 +218,8 @@
 #endif /* CTK_CONF_ICON_TEXTMAPS */
   
       len = strlen(w->widget.icon.title);
-      if(xpos + len >= sizex) {
-	xpos = sizex - len;
+      if(xpos + len >= 80) {
+	xpos = 80 - len;
       }
 
       gotoxy(xpos, ypos);
@@ -365,7 +355,7 @@
     cclearxy(x1, i, dialog->w);
   }
 
-  draw_window_contents(dialog, CTK_FOCUS_DIALOG, 0, sizey,
+  draw_window_contents(dialog, CTK_FOCUS_DIALOG, 0, 24,
 		       x1, x2, y1, y2);
 }
 /*-----------------------------------------------------------------------------------*/
@@ -385,18 +375,10 @@
 
   for(i = y1; i < y2; ++i) {
     gotoxy(0, i);
-    if(sizex == 80) {
-      *(char *)0xC055 = 0;
-      memset(*(char **)0x28, c1, 40);
-      *(char *)0xC054 = 0;
-      memset(*(char **)0x28, c2, 40);
-    } else {
-      if(c1 == 'V') {
-	memcpy(*(char **)0x28, (char *)0x0200, 40);
-      } else {
-	memset(*(char **)0x28, ' ' | 0x80, 40);
-      }
-    }
+    *(char *)0xC055 = 0;
+    memset(*(char **)0x28, c1, 40);
+    *(char *)0xC054 = 0;
+    memset(*(char **)0x28, c2, 40);
   }
 
 }
@@ -410,8 +392,8 @@
   cputs(m->title);
   cputc(' ');
   x2 = wherex();
-  if(x + CTK_CONF_MENUWIDTH > sizex) {
-    x = sizex - CTK_CONF_MENUWIDTH;
+  if(x + CTK_CONF_MENUWIDTH > 80) {
+    x = 80 - CTK_CONF_MENUWIDTH;
   }
     
   for(y = 0; y < m->nitems; ++y) {
@@ -450,10 +432,10 @@
     }
   }
 
-  if(wherex() + strlen(menus->desktopmenu->title) + 1>= sizex) {
-    gotoxy(sizex - strlen(menus->desktopmenu->title) - 1, 0);
+  if(wherex() + strlen(menus->desktopmenu->title) + 1>= 80) {
+    gotoxy(80 - strlen(menus->desktopmenu->title) - 1, 0);
   } else {
-    cclear(sizex - wherex() -
+    cclear(80 - wherex() -
 	   strlen(menus->desktopmenu->title) - 1);
   }
   
@@ -471,13 +453,13 @@
 unsigned char
 ctk_draw_height(void)
 {
-  return sizey;
+  return 24;
 }
 /*-----------------------------------------------------------------------------------*/
 unsigned char
 ctk_draw_width(void)
 {
-  return sizex;
+  return 80;
 }
 /*-----------------------------------------------------------------------------------*/
 int
diff --git a/contiki-apple2/readme.txt b/contiki-apple2/readme.txt
index 26fa713..447f8b2 100644
--- a/contiki-apple2/readme.txt
+++ b/contiki-apple2/readme.txt
@@ -21,6 +21,12 @@
 a2tools in -r b contiki.dsk CONTIKI.CODE contiki.cod
 a2tools in -r b contiki.dsk CONTIKI.DATA contiki.dat
 
+If you built the 'apple2enh' target replace the last two commands with the
+following ones to allow the Contiki wrapper program to work as expected:
+
+a2tools in -r b contiki.dsk CONTIKI.CODE.ENH contiki.cod
+a2tools in -r b contiki.dsk CONTIKI.DATA.ENH contiki.dat
+
 On the Apple ][ enter the following commands on the Applesoft prompt (']') to
 create the Contiki wrapper program.
 
@@ -38,6 +44,6 @@
 As there is no DOS available while Contiki is running the configuration data
 is saved by running the Contiki wrapper program again immediately after exiting
 Contiki via Ctrl-Reset and rebooting. The wrapper program checks if the data is
-still available and prints "Saving Contiki Conf..." if it is.
+still available and prints "SAVING CONTIKI CONF..." if it is.
 
 eof
\ No newline at end of file