Skip to content
This repository
Browse code

puae 2.3.0

  • Loading branch information...
commit 4bb0da50ce6ec8a74b3ca86d45a9e842a7b716e2 1 parent b670697
Mustafa TUFAN authored
5 README
@@ -10,11 +10,6 @@ with fixes from:
10 10 Steven 'xaind' Saunders (MacOSX)
11 11 'wuffe' (FreeBSD)
12 12
13   -Thanks for the morale support:
14   - Dom 'Hungry Horace' Cresswell
15   - Christopher 'FOL' Follett
16   - Andrew 'Truck' Holland
17   -
18 13
19 14 Richard Drummond's E-UAE 0.8.29
20 15 ============
75 install_deps.sh
... ... @@ -0,0 +1,75 @@
  1 +# package managers
  2 +package_managers=("aptitude" "emerge" "yum" "urpmi" "pacman" "zypper");
  3 +
  4 +# linux
  5 +apt_32 = "apt-get install build-essential automake zlib1g libsdl1.2-dev libgtk2.0-dev xorg-core";
  6 +
  7 +# macosx
  8 +
  9 +# platform
  10 +echo "* Checking platform...";
  11 +platform=""
  12 +if [ `uname` == "Darwin" ]; then
  13 + platform="osx"
  14 + echo " Darwin";
  15 +elif [ `uname` == "Linux" ]; then
  16 + platform="linux"
  17 + echo " Linux";
  18 +fi
  19 +
  20 +# bits
  21 +echo "* Checking architecture...";
  22 +is_64_bit=0
  23 +if [ `uname -m` == "x86_64" ]; then
  24 + is_64_bit=1
  25 + echo " 64 bit";
  26 +else
  27 + echo " 32 bit";
  28 +fi
  29 +
  30 +# package manager
  31 +echo "* Checking package manager...";
  32 +package_manager=""
  33 +for pm in ${package_managers[@]}; do
  34 + if [ ! -f "`which $pm`" ]; then
  35 + continue;
  36 + fi
  37 + package_manager=$pm;
  38 + echo " $pm";
  39 + break;
  40 +done
  41 +
  42 +# who am i?
  43 +need_sudo=1
  44 +if [ `whoami` = "root" ]; then
  45 + need_sudo=0
  46 + echo "* Logged in as root user...";
  47 +else
  48 + echo "!! You need to login as root (or sudo) !!";
  49 +fi
  50 +
  51 +if [ need_sudo ]
  52 + apt_32 = "sudo " + apt_32
  53 +if
  54 +
  55 +#
  56 +# Install Deps
  57 +#
  58 +if [ platform == "linux" ]
  59 + if [ is_64_bit == 0]
  60 +# LINUX 32b start
  61 + echo ">> Installing Linux 32 bit deps";
  62 + if [ package_manager==aptitude ]
  63 + fi
  64 +# LINUX 32b end
  65 +else
  66 +# LINUX 64b start
  67 + echo ">> Installing Linux 64 bit deps";
  68 +# LINUX 64b end
  69 +fi
  70 +elif [ platform == "osx" ]
  71 +# MACOSX start
  72 + echo ">> Installing MACOSX deps";
  73 +
  74 +# MACOSX end
  75 +fi
154 src/cfgfile.c
@@ -92,7 +92,7 @@ static const struct cfg_lines opttable[] =
92 92 {"gfx_gl_left_crop", "crop image in gl mode (+ integer)" }, //koko
93 93 {"gfx_gl_right_crop", "crop image in gl mode (+ integer)" },*/ //koko
94 94 {"gfx_gl_smoothing", "Linear smoothing in gl mode (true/false)" }, //koko
95   -
  95 +
96 96 {"gfx_colour_mode", "" },
97 97 {"32bit_blits", "Enable 32 bit blitter emulation" },
98 98 {"immediate_blits", "Perform blits immediately" },
@@ -221,83 +221,6 @@ static const TCHAR *obsolete[] = {
221 221
222 222 #define UNEXPANDED "$(FILE_PATH)"
223 223
224   -
225   -/*
226   - * The beginnings of a less brittle, more easily maintainable way of handling
227   - * prefs options.
228   - *
229   - * We maintain a key/value table of options.
230   - *
231   - * TODO:
232   - * Make this a hash table.
233   - * Add change notification.
234   - * Support other value data types.
235   - * Migrate more options.
236   - */
237   -
238   -typedef struct {
239   - const char *key;
240   - int target_specific;
241   - const char *value;
242   - const char *help;
243   -} prefs_attr_t;
244   -
245   -static prefs_attr_t prefs_attr_table[] = {
246   - {"floppy_path", 1, 0, "Default directory for floppy disk images"},
247   - {"rom_path", 1, 0, "Default directory for ROM images"},
248   - {"hardfile_path", 1, 0, "Default directory for hardfiles and filesystems"},
249   - {"savestate_path", 1, 0, "Default directory for saved-state images"},
250   - {0, 0, 0, 0}
251   -};
252   -
253   -static prefs_attr_t *lookup_attr (const char *key)
254   -{
255   - prefs_attr_t *attr = &prefs_attr_table[0];
256   -
257   - while (attr->key) {
258   - if (0 == strcmp (key, attr->key))
259   - return attr;
260   - attr++;
261   - }
262   - return 0;
263   -}
264   -
265   -static void prefs_dump_help (void)
266   -{
267   - prefs_attr_t *attr = &prefs_attr_table[0];
268   -
269   - while (attr->key) {
270   - int width = -MAX_OPTION_KEY_LEN;
271   - if (attr->target_specific) {
272   - width += strlen (TARGET_NAME) + 1;
273   - write_log ("%s.", TARGET_NAME);
274   - }
275   - write_log ("%*s: %s.\n", width, attr->key, attr->help ? attr->help : "");
276   - attr++;
277   - }
278   -}
279   -
280   -void prefs_set_attr (const char *key, const char *value)
281   -{
282   - prefs_attr_t *attr = lookup_attr (key);
283   -
284   - if (attr) {
285   - if (attr->value)
286   - free ((void *)attr->value);
287   - attr->value = value;
288   - }
289   -}
290   -
291   -const char *prefs_get_attr (const char *key)
292   -{
293   - prefs_attr_t *attr = lookup_attr (key);
294   -
295   - if (attr)
296   - return attr->value;
297   - else
298   - return 0;
299   -}
300   -
301 224 static void trimwsa (char *s)
302 225 {
303 226 /* Delete trailing whitespace. */
@@ -428,7 +351,7 @@ void cfgfile_write (struct zfile *f, const TCHAR *option, const TCHAR *format,..
428 351 TCHAR tmp[CONFIG_BLEN];
429 352
430 353 va_start (parms, format);
431   - vsnprintf (tmp, CONFIG_BLEN, format, parms);
  354 + _vsntprintf (tmp, CONFIG_BLEN, format, parms);
432 355 cfg_dowrite (f, option, tmp, 0, 0);
433 356 va_end (parms);
434 357 }
@@ -438,7 +361,7 @@ void cfgfile_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *format,.
438 361 TCHAR tmp[CONFIG_BLEN];
439 362
440 363 va_start (parms, format);
441   - vsnprintf (tmp, CONFIG_BLEN, format, parms);
  364 + _vsntprintf (tmp, CONFIG_BLEN, format, parms);
442 365 cfg_dowrite (f, option, tmp, 1, 0);
443 366 va_end (parms);
444 367 }
@@ -448,7 +371,7 @@ void cfgfile_target_write (struct zfile *f, const TCHAR *option, const TCHAR *fo
448 371 TCHAR tmp[CONFIG_BLEN];
449 372
450 373 va_start (parms, format);
451   - vsnprintf (tmp, CONFIG_BLEN, format, parms);
  374 + _vsntprintf (tmp, CONFIG_BLEN, format, parms);
452 375 cfg_dowrite (f, option, tmp, 0, 1);
453 376 va_end (parms);
454 377 }
@@ -458,7 +381,7 @@ void cfgfile_target_dwrite (struct zfile *f, const TCHAR *option, const TCHAR *f
458 381 TCHAR tmp[CONFIG_BLEN];
459 382
460 383 va_start (parms, format);
461   - vsnprintf (tmp, CONFIG_BLEN, format, parms);
  384 + _vsntprintf (tmp, CONFIG_BLEN, format, parms);
462 385 cfg_dowrite (f, option, tmp, 1, 1);
463 386 va_end (parms);
464 387 }
@@ -483,6 +406,45 @@ static void cfgfile_write_rom (struct zfile *f, const TCHAR *path, const TCHAR *
483 406
484 407 }
485 408
  409 +
  410 +static void write_filesys_config (struct uae_prefs *p, const TCHAR *unexpanded,
  411 + const TCHAR *default_path, struct zfile *f)
  412 +{
  413 + int i;
  414 + TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
  415 + TCHAR *hdcontrollers[] = { "uae",
  416 + "ide0", "ide1", "ide2", "ide3",
  417 + "scsi0", "scsi1", "scsi2", "scsi3", "scsi4", "scsi5", "scsi6",
  418 + "scsram", "scside" }; /* scsram = smart card sram = pcmcia sram card */
  419 +
  420 + for (i = 0; i < p->mountitems; i++) {
  421 + struct uaedev_config_info *uci = &p->mountconfig[i];
  422 + TCHAR *str;
  423 + int bp = uci->bootpri;
  424 +
  425 + if (!uci->autoboot)
  426 + bp = -128;
  427 + if (uci->donotmount)
  428 + bp = -129;
  429 + str = cfgfile_subst_path (default_path, unexpanded, uci->rootdir);
  430 + if (!uci->ishdf) {
  431 + _stprintf (tmp, "%s,%s:%s:%s,%d", uci->readonly ? "ro" : "rw",
  432 + uci->devname ? uci->devname : "", uci->volname, str, bp);
  433 + cfgfile_write_str (f, "filesystem2", tmp);
  434 + } else {
  435 + _stprintf (tmp, "%s,%s:%s,%d,%d,%d,%d,%d,%s,%s",
  436 + uci->readonly ? "ro" : "rw",
  437 + uci->devname ? uci->devname : "", str,
  438 + uci->sectors, uci->surfaces, uci->reserved, uci->blocksize,
  439 + bp, uci->filesys ? uci->filesys : "", hdcontrollers[uci->controller]);
  440 + cfgfile_write_str (f, "hardfile2", tmp);
  441 + }
  442 + _stprintf (tmp2, "uaehf%d", i);
  443 + cfgfile_write (f, tmp2, "%s,%s", uci->ishdf ? "hdf" : "dir", tmp);
  444 + xfree (str);
  445 + }
  446 +}
  447 +
486 448 static void subst_home (char *f, int n)
487 449 {
488 450 const char *home = getenv ("HOME");
@@ -514,13 +476,13 @@ void do_cfgfile_write (FILE *f, const char *format,...)
514 476 static void cfgfile_write_path_option (FILE *f, const char *key)
515 477 {
516 478 const char *home = getenv ("HOME");
517   - const char *path = prefs_get_attr (key);
  479 + const char *path = "./";
518 480 char *out_path = 0;
519 481
520 482 if (path)
521   - out_path = cfgfile_subst_path (home, "~", path);
  483 + out_path = cfgfile_subst_path (home, "~", path);
522 484
523   - cfgfile_write (f, "%s.%s=%s\n", TARGET_NAME, key, out_path ? out_path : "");
  485 + cfgfile_write (f, "%s.%s=%s\n", TARGET_NAME, key, out_path ? out_path : "");
524 486
525 487 if (out_path)
526 488 free (out_path);
@@ -965,7 +927,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
965 927 cfgfile_dwrite_bool (f, "warp", p->turbo_emulation);
966 928
967 929 #ifdef FILESYS
968   - //write_filesys_config (currprefs.mountinfo, UNEXPANDED, prefs_get_attr ("hardfile_path"), f);
  930 + write_filesys_config (p, UNEXPANDED, p->path_hardfile, f);
969 931 if (p->filesys_no_uaefsdb)
970 932 cfgfile_write_bool (f, "filesys_no_fsdb", p->filesys_no_uaefsdb);
971 933 #endif
@@ -2664,13 +2626,8 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
2664 2626 cfgfile_parse_line (p, line, 0);
2665 2627 }
2666 2628
2667   - for (i = 0; i < 4; i++) {
2668   - subst (prefs_get_attr("floppy_path"), p->floppyslots[i].df, sizeof p->floppyslots[i].df);
  2629 + for (i = 0; i < 4; i++)
2669 2630 subst (p->path_floppy, p->floppyslots[i].df, sizeof p->floppyslots[i].df / sizeof (TCHAR));
2670   - }
2671   - subst (prefs_get_attr("rom_path"), p->romfile, sizeof p->romfile);
2672   - subst (prefs_get_attr("rom_path"), p->romextfile, sizeof p->romextfile);
2673   - subst (prefs_get_attr("rom_path"), p->keyfile, sizeof p->keyfile);
2674 2631 subst (p->path_rom, p->romfile, sizeof p->romfile / sizeof (TCHAR));
2675 2632 subst (p->path_rom, p->romextfile, sizeof p->romextfile / sizeof (TCHAR));
2676 2633
@@ -3773,17 +3730,6 @@ void default_prefs (struct uae_prefs *p, int type)
3773 3730 strcpy (p->cartfile, "");
3774 3731 #endif
3775 3732
3776   - prefs_set_attr ("rom_path", strdup_path_expand (TARGET_ROM_PATH));
3777   - prefs_set_attr ("floppy_path", strdup_path_expand (TARGET_FLOPPY_PATH));
3778   - prefs_set_attr ("hardfile_path", strdup_path_expand (TARGET_HARDFILE_PATH));
3779   -#ifdef SAVESTATE
3780   - prefs_set_attr ("savestate_path", strdup_path_expand (TARGET_SAVESTATE_PATH));
3781   -#endif
3782   -
3783   - _tcscpy (p->romextfile, "");
3784   - _tcscpy (p->flashfile, "");
3785   - _tcscpy (p->cartfile, "");
3786   -
3787 3733 _tcscpy (p->path_rom, "./");
3788 3734 _tcscpy (p->path_floppy, "./");
3789 3735 _tcscpy (p->path_hardfile, "./");
@@ -3851,7 +3797,9 @@ void default_prefs (struct uae_prefs *p, int type)
3851 3797
3852 3798 inputdevice_default_prefs (p);
3853 3799
  3800 +#ifdef SCSIEMU
3854 3801 blkdev_default_prefs (p);
  3802 +#endif
3855 3803
3856 3804 zfile_fclose (default_file);
3857 3805 default_file = NULL;
2  src/custom.c
@@ -5123,7 +5123,9 @@ static void vsync_handler (void)
5123 5123 picasso_handle_vsync ();
5124 5124 #endif
5125 5125 audio_vsync ();
  5126 +#ifdef SCSIEMU
5126 5127 blkdev_vsync ();
  5128 +#endif
5127 5129
5128 5130 if (quit_program > 0) {
5129 5131 /* prevent possible infinite loop at wait_cycles().. */
4 src/disk.c
@@ -788,8 +788,8 @@ TCHAR *DISK_get_saveimagepath (const TCHAR *name)
788 788 }
789 789 i--;
790 790 }
791   -
792   - sprintf (name1, "%s%s_save.adf", prefs_get_attr ("floppy_path"), name2 + i);
  791 + fetch_saveimagepath (path, sizeof path / sizeof (TCHAR), 1);
  792 + _stprintf (name1, "%s%s_save.adf", path, name2 + i);
793 793 return name1;
794 794 }
795 795
2  src/ersatz.c
@@ -134,7 +134,7 @@ static void ersatz_init (void)
134 134 already_failed = 1;
135 135 gui_message ("You need to have a diskfile in DF0 to use the Kickstart replacement!\n");
136 136 uae_quit ();
137   - uae_restart (-1, NULL);
  137 + //uae_restart (-1, NULL);
138 138 return;
139 139 }
140 140
2  src/gui-cocoa/cocoaui.m
@@ -435,7 +435,7 @@ - (void)displayOpenPanelForInsertIntoDriveNumber:(int)driveNumber
435 435 if (!run_once) {
436 436 run_once++;
437 437
438   - const char *floppy_path = prefs_get_attr("floppy_path");
  438 + const char *floppy_path = currprefs.path_floppy;
439 439
440 440 if (floppy_path != NULL) {
441 441 char homedir[MAX_PATH];
2,636 src/gui-glade/puae.glade
2,636 additions, 0 deletions not shown
15 src/gui-gtk/gtkui.c
@@ -608,10 +608,10 @@ static int my_idle (void)
608 608 }
609 609 if (cmd == GUICMD_SHOW) {
610 610 gtk_widget_show (gui_window);
611   -# if GTK_MAJOR_VERSION >= 2
  611 +#if GTK_MAJOR_VERSION >= 2
612 612 gtk_window_present (GTK_WINDOW (gui_window));
613 613 gui_active = 1;
614   -# endif
  614 +#endif
615 615 } else {
616 616 n = read_comm_pipe_int_blocking (&to_gui_pipe);
617 617 floppyfileentry_do_dialog (FLOPPYFILEENTRY (floppy_widget[n]));
@@ -943,9 +943,8 @@ static void did_romchange (GtkWidget *w, gpointer data)
943 943 {
944 944 gtk_widget_set_sensitive (rom_change_widget, 0);
945 945
946   - rom_selector = make_file_selector ("Select a ROM file",
947   - did_rom_select, did_close_rom);
948   - filesel_set_path (rom_selector, prefs_get_attr ("rom_path"));
  946 + rom_selector = make_file_selector ("Select a ROM file", did_rom_select, did_close_rom);
  947 + filesel_set_path (rom_selector, currprefs.path_rom);
949 948 }
950 949
951 950 static GtkWidget *key_selector;
@@ -977,7 +976,7 @@ static void did_keychange (GtkWidget *w, gpointer data)
977 976 gtk_widget_set_sensitive (key_change_widget, 0);
978 977
979 978 key_selector = make_file_selector ("Select a Kickstart key file", did_key_select, did_close_key);
980   - filesel_set_path (key_selector, prefs_get_attr ("rom_path"));
  979 + filesel_set_path (key_selector, currprefs.path_rom);
981 980 }
982 981
983 982 static void add_empty_vbox (GtkWidget *tobox)
@@ -1138,7 +1137,7 @@ static void make_floppy_disks (GtkWidget *vbox)
1138 1137 gtk_widget_set_sensitive(floppy_widget[i], 0);
1139 1138 floppyfileentry_set_drivename (FLOPPYFILEENTRY (floppy_widget[i]), buf);
1140 1139 floppyfileentry_set_label (FLOPPYFILEENTRY (floppy_widget[i]), buf);
1141   - floppyfileentry_set_currentdir (FLOPPYFILEENTRY (floppy_widget[i]), prefs_get_attr ("floppy_path"));
  1140 + floppyfileentry_set_currentdir (FLOPPYFILEENTRY (floppy_widget[i]), currprefs.path_floppy);
1142 1141 gtk_box_pack_start (GTK_BOX (vbox), floppy_widget[i], FALSE, TRUE, 0);
1143 1142 gtk_widget_show (floppy_widget[i]);
1144 1143 gtk_signal_connect (GTK_OBJECT (floppy_widget[i]), "disc-changed", (GtkSignalFunc) disc_changed, GINT_TO_POINTER (i));
@@ -1175,7 +1174,7 @@ static void did_sstate_change (GtkWidget *w, gpointer data)
1175 1174 gtk_widget_set_sensitive (sstate_change_widget, 0);
1176 1175
1177 1176 sstate_selector = make_file_selector ("Select a Savestate file", did_sstate_select, did_close_sstate);
1178   - filesel_set_path (sstate_selector, prefs_get_attr ("savestate_path"));
  1177 + filesel_set_path (sstate_selector, currprefs.path_savestate);
1179 1178 }
1180 1179
1181 1180 static void did_sstate_load (GtkWidget *w, gpointer data)
4 src/gui-muirexx/ami-gui.c
@@ -79,7 +79,7 @@ static const char *get_last_floppy_dir (void)
79 79 atexit (free_last_floppy_dir);
80 80 }
81 81
82   - last_floppy_dir = my_strdup (prefs_get_attr ("floppy_path"));
  82 + last_floppy_dir = my_strdup (currprefs.path_floppy);
83 83 }
84 84 return last_floppy_dir;
85 85 }
@@ -95,7 +95,7 @@ static const char *get_last_savestate_dir (void)
95 95 atexit (free_last_savestate_dir);
96 96 }
97 97
98   - last_savestate_dir = my_strdup (prefs_get_attr ("savestate_path"));
  98 + last_savestate_dir = my_strdup (currprefs.path_savestate);
99 99 }
100 100 return last_savestate_dir;
101 101 }
1  src/include/options.h
@@ -327,6 +327,7 @@ struct uae_prefs {
327 327 TCHAR path_floppy[256];
328 328 TCHAR path_hardfile[256];
329 329 TCHAR path_rom[256];
  330 + TCHAR path_savestate[256];
330 331
331 332 int m68k_speed;
332 333 int cpu_model;
2  src/main.c
@@ -439,7 +439,9 @@ void fixup_prefs (struct uae_prefs *p)
439 439 p->maprom = 0x0f000000;
440 440 if (p->tod_hack && p->cs_ciaatod == 0)
441 441 p->cs_ciaatod = p->ntscmode ? 2 : 1;
  442 +#ifdef SCSIEMU
442 443 blkdev_fix_prefs (p);
  444 +#endif
443 445 target_fixup_options (p);
444 446 }
445 447

0 comments on commit 4bb0da5

Please sign in to comment.
Something went wrong with that request. Please try again.