817818ef72676c2423fc75e8cd0442e1903e73ab
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 09/03/2018 Added a Models & Bios tab
15 // JPM 09/03/2018 Depend the platform transform slashes or backslashes
18 #include "configdialog.h"
19 #include "generaltab.h"
24 GeneralTab::GeneralTab(QWidget
* parent
/*= 0*/): QWidget(parent
)
26 // I'm thinking we should scan the bios folder for the 5 known BIOSes, and
27 // just present a radio button to choose between them...
28 // (BIOS is built-in now...)
29 // QLabel * label1 = new QLabel("Boot ROM:");
30 // QLabel * label2 = new QLabel("CD Boot ROM:");
31 QLabel
* label3
= new QLabel("EEPROMs:");
32 QLabel
* label4
= new QLabel("Software:");
34 // edit1 = new QLineEdit("");
35 // edit2 = new QLineEdit("");
36 edit3
= new QLineEdit("");
37 edit4
= new QLineEdit("");
38 // edit1->setPlaceholderText("Boot ROM location");
39 // edit2->setPlaceholderText("CD Boot ROM location");
40 edit3
->setPlaceholderText("EEPROM path");
41 edit4
->setPlaceholderText("Software path");
43 QVBoxLayout
* layout1
= new QVBoxLayout
;
44 // layout1->addWidget(label1);
45 // layout1->addWidget(label2);
46 layout1
->addWidget(label3
);
47 layout1
->addWidget(label4
);
49 QVBoxLayout
* layout2
= new QVBoxLayout
;
50 // layout2->addWidget(edit1);
51 // layout2->addWidget(edit2);
52 layout2
->addWidget(edit3
);
53 layout2
->addWidget(edit4
);
55 QHBoxLayout
* layout3
= new QHBoxLayout
;
56 layout3
->addLayout(layout1
);
57 layout3
->addLayout(layout2
);
59 QVBoxLayout
* layout4
= new QVBoxLayout
;
60 layout4
->addLayout(layout3
);
63 #ifndef NEWMODELSBIOSHANDLER
64 useBIOS
= new QCheckBox(tr("Enable Jaguar BIOS"));
66 useGPU
= new QCheckBox(tr("Enable GPU"));
67 useDSP
= new QCheckBox(tr("Enable DSP"));
68 useFullScreen
= new QCheckBox(tr("Start Virtual Jaguar in full screen"));
69 // useHostAudio = new QCheckBox(tr("Enable audio playback (requires DSP)"));
70 useUnknownSoftware
= new QCheckBox(tr("Show all files in file chooser"));
71 useFastBlitter
= new QCheckBox(tr("Use fast blitter"));
73 #ifndef NEWMODELSBIOSHANDLER
74 layout4
->addWidget(useBIOS
);
76 layout4
->addWidget(useGPU
);
77 layout4
->addWidget(useDSP
);
78 layout4
->addWidget(useFullScreen
);
79 // layout4->addWidget(useHostAudio);
80 layout4
->addWidget(useUnknownSoftware
);
81 layout4
->addWidget(useFastBlitter
);
88 GeneralTab::~GeneralTab()
93 // Load / Update the tabs dialog from the settings
94 void GeneralTab::GetSettings(void)
96 // generalTab->edit1->setText(vjs.jagBootPath);
97 // generalTab->edit2->setText(vjs.CDBootPath);
98 edit3
->setText(vjs
.EEPROMPath
);
99 edit4
->setText(vjs
.ROMPath
);
100 #ifndef NEWMODELSBIOSHANDLER
101 useBIOS
->setChecked(vjs
.useJaguarBIOS
);
103 useGPU
->setChecked(vjs
.GPUEnabled
);
104 useDSP
->setChecked(vjs
.DSPEnabled
);
105 useFullScreen
->setChecked(vjs
.fullscreen
);
106 // generalTab->useHostAudio->setChecked(vjs.audioEnabled);
107 useFastBlitter
->setChecked(vjs
.useFastBlitter
);
111 // Save & Update the settings from the tabs dialog
112 void GeneralTab::SetSettings(void)
114 // strcpy(vjs.jagBootPath, generalTab->edit1->text().toAscii().data());
115 // strcpy(vjs.CDBootPath, generalTab->edit2->text().toAscii().data());
116 strcpy(vjs
.EEPROMPath
, CheckForTrailingSlash(edit3
->text()).toUtf8().data());
117 strcpy(vjs
.ROMPath
, CheckForTrailingSlash(edit4
->text()).toUtf8().data());
119 #ifndef NEWMODELSBIOSHANDLER
120 vjs
.useJaguarBIOS
= useBIOS
->isChecked();
122 vjs
.GPUEnabled
= useGPU
->isChecked();
123 vjs
.DSPEnabled
= useDSP
->isChecked();
124 vjs
.fullscreen
= useFullScreen
->isChecked();
125 // vjs.audioEnabled = generalTab->useHostAudio->isChecked();
126 vjs
.useFastBlitter
= useFastBlitter
->isChecked();
130 // Append a slash or a backslash at the end of the string
131 // Depend the platform transform slashes or backslashes
132 QString
GeneralTab::CheckForTrailingSlash(QString s
)
134 if (!s
.endsWith('/') && !s
.endsWith('\\'))
139 s
.replace(QString("/"), QString("\\"));
141 s
.replace(QString("\\"), QString("/"));
148 vjs
.useJoystick
= settings
.value("useJoystick", false).toBool();
149 vjs
.joyport
= settings
.value("joyport", 0).toInt();
150 vjs
.frameSkip
= settings
.value("frameSkip", 0).toInt();
151 vjs
.useJaguarBIOS
= settings
.value("useJaguarBIOS", false).toBool();
152 vjs
.DSPEnabled
= settings
.value("DSPEnabled", false).toBool();
153 vjs
.usePipelinedDSP
= settings
.value("usePipelinedDSP", false).toBool();
154 vjs
.fullscreen
= settings
.value("fullscreen", false).toBool();
155 vjs
.renderType
= settings
.value("renderType", 0).toInt();
156 strcpy(vjs
.jagBootPath
, settings
.value("JagBootROM", "./bios/[BIOS] Atari Jaguar (USA, Europe).zip").toString().toAscii().data());
157 strcpy(vjs
.CDBootPath
, settings
.value("CDBootROM", "./bios/jagcd.rom").toString().toAscii().data());
158 strcpy(vjs
.EEPROMPath
, settings
.value("EEPROMs", "./eeproms").toString().toAscii().data());
159 strcpy(vjs
.ROMPath
, settings
.value("ROMs", "./software").toString().toAscii().data());