2 // generaltab.cpp: "General" tab on the settings dialog
4 // Part of the Virtual Jaguar Project
5 // (C) 2011 Underground Software
6 // See the README and GPLv3 files for licensing and warranty information
8 // JLH = James Hammons <jlhamm@acm.org>
9 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>
12 // --- ---------- ------------------------------------------------------------
13 // JLH 06/23/2011 Created this file
14 // JPM Sept./2018 Added a Models & Bios tab, slashes / backslashes formatting, and screenshot path
18 // To scan the bios folder for the 5 known BIOSes, and just present a radio button to choose between them...
22 #include "configdialog.h"
23 #include "generaltab.h"
28 GeneralTab::GeneralTab(QWidget
* parent
/*= 0*/): QWidget(parent
)
30 // QLabel * label1 = new QLabel("Boot ROM:");
31 // QLabel * label2 = new QLabel("CD Boot ROM:");
32 QLabel
* label3
= new QLabel("EEPROMs:");
33 QLabel
* label4
= new QLabel("Software:");
34 QLabel
* label5
= new QLabel("Screenshots:");
36 // edit1 = new QLineEdit("");
37 // edit2 = new QLineEdit("");
38 edit3
= new QLineEdit("");
39 edit4
= new QLineEdit("");
40 edit5
= new QLineEdit("");
41 // edit1->setPlaceholderText("Boot ROM location");
42 // edit2->setPlaceholderText("CD Boot ROM location");
43 edit3
->setPlaceholderText("EEPROM path");
44 edit4
->setPlaceholderText("Software path");
45 edit5
->setPlaceholderText("Screenshot path");
47 QVBoxLayout
* layout1
= new QVBoxLayout
;
48 // layout1->addWidget(label1);
49 // layout1->addWidget(label2);
50 layout1
->addWidget(label3
);
51 layout1
->addWidget(label4
);
52 layout1
->addWidget(label5
);
54 QVBoxLayout
* layout2
= new QVBoxLayout
;
55 // layout2->addWidget(edit1);
56 // layout2->addWidget(edit2);
57 layout2
->addWidget(edit3
);
58 layout2
->addWidget(edit4
);
59 layout2
->addWidget(edit5
);
61 QHBoxLayout
* layout3
= new QHBoxLayout
;
62 layout3
->addLayout(layout1
);
63 layout3
->addLayout(layout2
);
65 QVBoxLayout
* layout4
= new QVBoxLayout
;
66 layout4
->addLayout(layout3
);
69 #ifndef NEWMODELSBIOSHANDLER
70 useBIOS
= new QCheckBox(tr("Enable Jaguar BIOS"));
72 useGPU
= new QCheckBox(tr("Enable GPU"));
73 useDSP
= new QCheckBox(tr("Enable DSP"));
74 useFullScreen
= new QCheckBox(tr("Start Virtual Jaguar in full screen"));
75 // useHostAudio = new QCheckBox(tr("Enable audio playback (requires DSP)"));
76 useUnknownSoftware
= new QCheckBox(tr("Show all files in file chooser"));
77 useFastBlitter
= new QCheckBox(tr("Use fast blitter"));
79 #ifndef NEWMODELSBIOSHANDLER
80 layout4
->addWidget(useBIOS
);
82 layout4
->addWidget(useGPU
);
83 layout4
->addWidget(useDSP
);
84 layout4
->addWidget(useFullScreen
);
85 // layout4->addWidget(useHostAudio);
86 layout4
->addWidget(useUnknownSoftware
);
87 layout4
->addWidget(useFastBlitter
);
94 GeneralTab::~GeneralTab()
99 // Load / Update the tabs dialog from the settings
100 void GeneralTab::GetSettings(void)
102 // generalTab->edit1->setText(vjs.jagBootPath);
103 // generalTab->edit2->setText(vjs.CDBootPath);
104 edit3
->setText(vjs
.EEPROMPath
);
105 edit4
->setText(vjs
.ROMPath
);
106 edit5
->setText(vjs
.screenshotPath
);
107 #ifndef NEWMODELSBIOSHANDLER
108 useBIOS
->setChecked(vjs
.useJaguarBIOS
);
110 useGPU
->setChecked(vjs
.GPUEnabled
);
111 useDSP
->setChecked(vjs
.DSPEnabled
);
112 useFullScreen
->setChecked(vjs
.fullscreen
);
113 // generalTab->useHostAudio->setChecked(vjs.audioEnabled);
114 useFastBlitter
->setChecked(vjs
.useFastBlitter
);
118 // Save & Update the settings from the tabs dialog
119 void GeneralTab::SetSettings(void)
121 // strcpy(vjs.jagBootPath, generalTab->edit1->text().toAscii().data());
122 // strcpy(vjs.CDBootPath, generalTab->edit2->text().toAscii().data());
123 strcpy(vjs
.EEPROMPath
, CheckForTrailingSlash(edit3
->text()).toUtf8().data());
124 strcpy(vjs
.ROMPath
, CheckForTrailingSlash(edit4
->text()).toUtf8().data());
125 strcpy(vjs
.screenshotPath
, CheckForTrailingSlash(edit5
->text()).toUtf8().data());
127 #ifndef NEWMODELSBIOSHANDLER
128 vjs
.useJaguarBIOS
= useBIOS
->isChecked();
130 vjs
.GPUEnabled
= useGPU
->isChecked();
131 vjs
.DSPEnabled
= useDSP
->isChecked();
132 vjs
.fullscreen
= useFullScreen
->isChecked();
133 // vjs.audioEnabled = generalTab->useHostAudio->isChecked();
134 vjs
.useFastBlitter
= useFastBlitter
->isChecked();
138 // Append a slash or a backslash at the end of the string
139 // Depend the platform transform slashes or backslashes
140 QString
GeneralTab::CheckForTrailingSlash(QString s
)
142 if (!s
.endsWith('/') && !s
.endsWith('\\'))
147 s
.replace(QString("/"), QString("\\"));
149 s
.replace(QString("\\"), QString("/"));
156 vjs
.useJoystick
= settings
.value("useJoystick", false).toBool();
157 vjs
.joyport
= settings
.value("joyport", 0).toInt();
158 vjs
.frameSkip
= settings
.value("frameSkip", 0).toInt();
159 vjs
.useJaguarBIOS
= settings
.value("useJaguarBIOS", false).toBool();
160 vjs
.DSPEnabled
= settings
.value("DSPEnabled", false).toBool();
161 vjs
.usePipelinedDSP
= settings
.value("usePipelinedDSP", false).toBool();
162 vjs
.fullscreen
= settings
.value("fullscreen", false).toBool();
163 vjs
.renderType
= settings
.value("renderType", 0).toInt();
164 strcpy(vjs
.jagBootPath
, settings
.value("JagBootROM", "./bios/[BIOS] Atari Jaguar (USA, Europe).zip").toString().toAscii().data());
165 strcpy(vjs
.CDBootPath
, settings
.value("CDBootROM", "./bios/jagcd.rom").toString().toAscii().data());
166 strcpy(vjs
.EEPROMPath
, settings
.value("EEPROMs", "./eeproms").toString().toAscii().data());
167 strcpy(vjs
.ROMPath
, settings
.value("ROMs", "./software").toString().toAscii().data());