ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/prefs.cpp
(Generate patch)

Comparing BasiliskII/src/prefs.cpp (file contents):
Revision 1.2 by cebix, 1999-10-19T17:41:18Z vs.
Revision 1.8 by cebix, 2000-07-25T15:19:40Z

# Line 1 | Line 1
1   /*
2   *  prefs.cpp - Preferences handling
3   *
4 < *  Basilisk II (C) 1997-1999 Christian Bauer
4 > *  Basilisk II (C) 1997-2000 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 28 | Line 28
28   #include "prefs.h"
29  
30  
31 < // Common preferences items (those which exist on all platforms)
32 < // Except for "disk", "floppy", "cdrom", "scsiX", "screen", "rom" and "ether",
33 < // these are guaranteed to be in the prefs; "disk", "floppy" and "cdrom" can
34 < // occur multiple times
35 < prefs_desc common_prefs_items[] = {
36 <        {"disk", TYPE_STRING, true},            // Device/file names of Mac volumes (disk.cpp)
37 <        {"floppy", TYPE_STRING, true},          // Device/file names of Mac floppy drives (sony.cpp)
38 <        {"cdrom", TYPE_STRING, true},           // Device/file names of Mac CD-ROM drives (cdrom.cpp)
39 <        {"extfs", TYPE_STRING, false},          // Root path of ExtFS (extfs.cpp)
40 <        {"scsi0", TYPE_STRING, false},          // SCSI targets for Mac SCSI ID 0..6 (scsi_*.cpp)
41 <        {"scsi1", TYPE_STRING, false},
42 <        {"scsi2", TYPE_STRING, false},
43 <        {"scsi3", TYPE_STRING, false},
44 <        {"scsi4", TYPE_STRING, false},
45 <        {"scsi5", TYPE_STRING, false},
46 <        {"scsi6", TYPE_STRING, false},
47 <        {"screen", TYPE_STRING, false},         // Video mode (video.cpp)
48 <        {"seriala", TYPE_STRING, false},        // Device name of Mac serial port A (serial_*.cpp)
49 <        {"serialb", TYPE_STRING, false},        // Device name of Mac serial port B (serial_*.cpp)
50 <        {"ether", TYPE_STRING, false},          // Device name of Mac ethernet adapter (ether_*.cpp)
51 <        {"rom", TYPE_STRING, false},            // Path of ROM file (main_*.cpp)
52 <        {"bootdrive", TYPE_INT16, false},       // Boot drive number (main_*.cpp)
53 <        {"bootdriver", TYPE_INT16, false},      // Boot driver number (main_*.cpp)
54 <        {"ramsize", TYPE_INT32, false},         // Size of Mac RAM in bytes (main_*.cpp)
55 <        {"frameskip", TYPE_INT32, false},       // Number of frames to skip in refreshed video modes (video_*.cpp)
56 <        {"modelid", TYPE_INT32, false},         // Mac Model ID (Gestalt Model ID minus 6) (rom_patches.cpp)
57 <        {"fpu", TYPE_BOOLEAN, false},           // Enable FPU emulation (main_*.cpp)
58 <        {"nocdrom", TYPE_BOOLEAN, false},       // Don't install CD-ROM driver (cdrom.cpp/rom_patches.cpp)
59 <        {"nosound", TYPE_BOOLEAN, false},       // Don't enable sound output (audio_*.cpp)
60 <        {"nogui", TYPE_BOOLEAN, false},         // Disable GUI (main_*.cpp)
61 <        {NULL, TYPE_END, false} // End of list
62 < };
63 <
64 <
65 < // Prefs item are stored in a linked list of these nodes
31 > // Prefs items are stored in a linked list of these nodes
32   struct prefs_node {
33          prefs_node *next;
34          const char *name;
# Line 84 | Line 50 | void PrefsInit(void)
50          the_prefs = NULL;
51  
52          // Set defaults
53 <        SysAddSerialPrefs();
88 <        PrefsAddInt16("bootdriver", 0);
89 <        PrefsAddInt16("bootdrive", 0);
90 <        PrefsAddInt32("ramsize", 8 * 1024 * 1024);
91 <        PrefsAddInt32("frameskip", 6);
92 <        PrefsAddInt32("modelid", 5);    // Mac IIci
93 <        PrefsAddBool("fpu", false);
94 <        PrefsAddBool("nocdrom", false);
95 <        PrefsAddBool("nosound", false);
96 <        PrefsAddBool("nogui", false);
53 >        AddPrefsDefaults();
54          AddPlatformPrefsDefaults();
55  
56          // Load preferences from settings file
# Line 331 | Line 288 | void LoadPrefsFromStream(FILE *f)
288  
289                  // Skip whitespace until value
290                  while (isspace(*p)) p++;
334                if (*p == 0)
335                        continue;
291                  char *keyword = line;
292                  char *value = p;
293                  int32 i = atol(value);
# Line 392 | Line 347 | static void write_prefs(FILE *f, const p
347                                  fprintf(f, "%s %d\n", list->name, PrefsFindInt16(list->name));
348                                  break;
349                          case TYPE_INT32:
350 <                                fprintf(f, "%s %ld\n", list->name, PrefsFindInt32(list->name));
350 >                                fprintf(f, "%s %d\n", list->name, PrefsFindInt32(list->name));
351                                  break;
352                          default:
353                                  break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines