@@ -243,7 +243,7 @@ int flushing = FALSE; /* see dbprint.h if set, all debug/trace printing will cal
243243extern DspInterface currentdsp ;
244244#endif /* DOS || XWINDOW */
245245#ifdef SDL
246- extern int init_SDL ( char * , int , int , int );
246+ #include "sdldefs.h" /* for init_SDL */
247247#endif
248248extern const time_t MDate ;
249249extern int nokbdflag ;
@@ -324,6 +324,15 @@ extern char foregroundColorName[64];
324324char backgroundColorName [64 ] = {0 };
325325extern char backgroundColorName [64 ];
326326#endif
327+ char windowTitle [255 ] = "Medley" ;
328+ extern char windowTitle [255 ];
329+ int lispDisplayRequestedWidth = 1024 ;
330+ extern int lispDisplayRequestedWidth ;
331+ int lispDisplayRequestedHeight = 768 ;
332+ extern int lispDisplayRequestedHeight ;
333+ int pixelScale = 1 ;
334+ extern int pixelScale ;
335+
327336/************************************************************************/
328337/* */
329338/* M A I N E N T R Y P O I N T */
@@ -338,9 +347,6 @@ int main(int argc, char *argv[])
338347 extern int TIMER_INTERVAL ;
339348 extern fd_set LispReadFds ;
340349 long tmpint ;
341- int width = 1024 , height = 768 ;
342- int pixelscale = 1 ;
343- char * windowtitle = "Medley" ;
344350
345351#ifdef MAIKO_ENABLE_FOREIGN_FUNCTION_INTERFACE
346352 if (dld_find_executable (argv [0 ]) == 0 ) {
@@ -365,7 +371,6 @@ int main(int argc, char *argv[])
365371 // arg processing changes argc/argv
366372 if (argc > 1 && argv [1 ][0 ] != '-' ) {
367373 strncpy (sysout_name_first_arg , argv [1 ], MAXPATHLEN );
368- i ++ ;
369374 }
370375
371376
@@ -468,7 +473,7 @@ int main(int argc, char *argv[])
468473#ifdef SDL
469474 else if ((strcmp (argv [i ], "- sc ") == 0) || (strcmp(argv[i], " - SC ") == 0)) {
470475 if (argc > ++ i ) {
471- int read = sscanf (argv [i ], "%dx%d" , & width , & height );
476+ int read = sscanf (argv [i ], "%dx%d" , & lispDisplayRequestedWidth , & lispDisplayRequestedHeight );
472477 if (read != 2 ) {
473478 (void )fprintf (stderr , "Could not parse -sc argument %s\n" , argv [i ]);
474479 exit (1 );
@@ -479,7 +484,7 @@ int main(int argc, char *argv[])
479484 }
480485 } else if ((strcmp (argv [i ], "-pixelscale" ) == 0 ) || (strcmp (argv [i ], "-PIXELSCALE" ) == 0 )) {
481486 if (argc > ++ i ) {
482- int read = sscanf (argv [i ], "%d" , & pixelscale );
487+ int read = sscanf (argv [i ], "%d" , & pixelScale );
483488 if (read != 1 ) {
484489 (void )fprintf (stderr , "Could not parse -pixelscale argument %s\n" , argv [i ]);
485490 exit (1 );
@@ -491,7 +496,7 @@ int main(int argc, char *argv[])
491496 } else if ((strcmp (argv [i ], "-t" ) == 0 ) || (strcmp (argv [i ], "-T" ) == 0 )
492497 || (strcmp (argv [i ], "-title" ) == 0 ) || (strcmp (argv [i ], "-TITLE" ) == 0 )) {
493498 if (argc > ++ i ) {
494- windowtitle = argv [i ];
499+ strncpy ( windowTitle , argv [i ], sizeof ( windowTitle ) - 1 ) ;
495500 } else {
496501 (void )fprintf (stderr , "Missing argument after -title\n" );
497502 exit (1 );
@@ -711,13 +716,12 @@ int main(int argc, char *argv[])
711716 make_dsp_instance (currentdsp , 0 , 0 , 0 , 1 ); /* All defaults the first time */
712717#endif /* DOS || XWINDOW */
713718#if defined(SDL )
714- init_SDL (windowtitle , width , height , pixelscale );
719+ init_SDL (windowTitle , lispDisplayRequestedWidth , lispDisplayRequestedHeight , pixelScale );
715720#endif /* SDL */
716721 /* Load sysout to VM space and returns real sysout_size(not 0) */
717722 sysout_size = sysout_loader (sysout_name , sysout_size );
718723
719- build_lisp_map (); /* built up map */
720-
724+ build_lisp_map (); /* build up map */
721725 init_ifpage (sysout_size ); /* init interface page */
722726 init_iopage ();
723727 init_miscstats ();
0 commit comments