1 /*
2  *  Prefs.h - Global preferences
3  *
4  *  Frodo (C) 1994-1997,2002 Christian Bauer
5  */
6 
7 #ifndef _PREFS_H
8 #define _PREFS_H
9 
10 
11 // Drive types
12 enum {
13 	DRVTYPE_DIR,	// 1541 emulation in host file system
14 	DRVTYPE_D64,	// 1541 emulation in .d64 file
15 	DRVTYPE_T64		// 1541 emulation in .t64 file
16 };
17 
18 
19 // SID types
20 enum {
21 	SIDTYPE_NONE,		// SID emulation off
22 	SIDTYPE_DIGITAL,	// Digital SID emulation
23 	SIDTYPE_SIDCARD		// SID card
24 };
25 
26 
27 // REU sizes
28 enum {
29 	REU_NONE,		// No REU
30 	REU_128K,		// 128K
31 	REU_256K,		// 256K
32 	REU_512K		// 512K
33 };
34 
35 
36 // Display types (BeOS)
37 enum {
38 	DISPTYPE_WINDOW,	// BWindow
39 	DISPTYPE_SCREEN		// BWindowScreen
40 };
41 
42 
43 // Preferences data
44 class Prefs {
45 public:
46 	Prefs();
47 	bool ShowEditor(bool startup, char *prefs_name);
48 	void Check(void);
49 	void Load(char *filename);
50 	bool Save(char *filename);
51 
52 	bool operator==(const Prefs &rhs) const;
53 	bool operator!=(const Prefs &rhs) const;
54 
55 	int NormalCycles;		// Available CPU cycles in normal raster lines
56 	int BadLineCycles;		// Available CPU cycles in Bad Lines
57 	int CIACycles;			// CIA timer ticks per raster line
58 	int FloppyCycles;		// Available 1541 CPU cycles per line
59 	int SkipFrames;			// Draw every n-th frame
60 
61 	int DriveType[4];		// Type of drive 8..11
62 
63 	char DrivePath[4][256];	// Path for drive 8..11
64 
65 	char ViewPort[256];		// Size of the C64 screen to display (Win32)
66 	char DisplayMode[256];	// Video mode to use for full screen (Win32)
67 
68 	int SIDType;			// SID emulation type
69 	int REUSize;			// Size of REU
70 	int DisplayType;		// Display type (BeOS)
71 	int LatencyMin;			// Min msecs ahead of sound buffer (Win32)
72 	int LatencyMax;			// Max msecs ahead of sound buffer (Win32)
73 	int LatencyAvg;			// Averaging interval in msecs (Win32)
74 	int ScalingNumerator;	// Window scaling numerator (Win32)
75 	int ScalingDenominator;	// Window scaling denominator (Win32)
76 
77 	bool SpritesOn;			// Sprite display is on
78 	bool SpriteCollisions;	// Sprite collision detection is on
79 	bool Joystick1On;		// Joystick connected to port 1 of host
80 	bool Joystick2On;		// Joystick connected to port 2 of host
81 	bool JoystickSwap;		// Swap joysticks 1<->2
82 	bool LimitSpeed;		// Limit speed to 100%
83 	bool FastReset;			// Skip RAM test on reset
84 	bool CIAIRQHack;		// Write to CIA ICR clears IRQ
85 	bool MapSlash;			// Map '/' in C64 filenames
86 	bool Emul1541Proc;		// Enable processor-level 1541 emulation
87 	bool SIDFilters;		// Emulate SID filters
88 	bool DoubleScan;		// Double scan lines (BeOS, if DisplayType == DISPTYPE_SCREEN)
89 	bool HideCursor;		// Hide mouse cursor when visible (Win32)
90 	bool DirectSound;		// Use direct sound (instead of wav) (Win32)
91 	bool ExclusiveSound;	// Use exclusive mode with direct sound (Win32)
92 	bool AutoPause;			// Auto pause when not foreground app (Win32)
93 	bool PrefsAtStartup;	// Show prefs dialog at startup (Win32)
94 	bool SystemMemory;		// Put view work surface in system mem (Win32)
95 	bool AlwaysCopy;		// Always use a work surface (Win32)
96 	bool SystemKeys;		// Enable system keys and menu keys (Win32)
97 	bool ShowLEDs;			// Show LEDs (Win32)
98 
99 #ifdef __mac__
100 	void ChangeDisks(void);
101 #endif
102 
103 #ifdef WIN32
104 private:
105 	static BOOL CALLBACK StandardDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
106 	static BOOL CALLBACK WIN32DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
107 	BOOL DialogProc(int page, HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
108 	void SetupControls(int page);
109 	void SetValues(int page);
110 	void GetValues(int page);
111 	void BrowseForDevice(int id);
112 
113 	static Prefs *edit_prefs;
114 	static char *edit_prefs_name;
115 	static HWND hDlg;
116 #endif
117 };
118 
119 
120 // These are the active preferences
121 extern Prefs ThePrefs;
122 
123 // Theses are the preferences on disk
124 extern Prefs ThePrefsOnDisk;
125 
126 #endif
127