http://ftp.ksu.edu.tw/FTP/FreeBSD/distfiles/xscreensaver-4.20.tar.gz
[xscreensaver] / hacks / apple2-main.c
index 95078befdcfb9681c135bdc328f3a7f11808e023..883e42b02be876c4f75f0106a7c01d77559961b9 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1998-2004 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2005 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
 #include <X11/keysymdef.h>
 
 #ifdef HAVE_FORKPTY
-# include <pty.h>
+# ifdef HAVE_PTY_H
+#  include <pty.h>
+# endif
+# ifdef HAVE_UTIL_H
+#  include <util.h>
+# endif
 #endif /* HAVE_FORKPTY */
 
 #undef countof
@@ -534,7 +539,7 @@ load_image (Display *dpy, Window window, char **image_filename_r)
 
   XGetWindowAttributes (dpy, window, &xgwa);
   p = XCreatePixmap (dpy, window, xgwa.width, xgwa.height, xgwa.depth);
-  load_random_image (xgwa.screen, window, p, image_filename_r);
+  load_random_image (xgwa.screen, window, p, image_filename_r, NULL);
   image = XGetImage (dpy, p, 0, 0, xgwa.width, xgwa.height, ~0, ZPixmap);
   XFreePixmap (dpy, p);
   p = 0;
@@ -673,7 +678,10 @@ void slideshow_controller(apple2_sim_t *sim, int *stepno,
         if (dot) *dot=0;
       }
       if (strlen(basename)>20) basename[20]=0;
-      for (s=basename; *s; s++) *s = toupper (*s);
+      for (s=basename; *s; s++) {
+        *s = toupper (*s);
+        if (*s <= ' ') *s = '_';
+      }
       sprintf(sim->typing_buf, "BLOAD %s\n", basename);
       sim->typing = sim->typing_buf;