Updated the M68K exception catch
[clinton/Virtual-Jaguar-Rx.git] / src / gui / alpinetab.cpp
CommitLineData
cf76e892
JPM
1//
2// alpinetab.cpp: "Alpine" tab on the settings dialog
3//
4// Part of the Virtual Jaguar Project
5// (C) 2011 Underground Software
6// See the README and GPLv3 files for licensing and warranty information
7//
8// JLH = James Hammons <jlhamm@acm.org>
87d08e09 9// JPM = Jean-Paul Mari <djipi.mari@gmail.com>
cf76e892
JPM
10//
11// WHO WHEN WHAT
12// --- ---------- ------------------------------------------------------------
13// JLH 07/15/2011 Created this file
87d08e09 14// JPM 09/03/2018 Depend the platform transform slashes or backslashes
28c2bdc6 15// JPM Feb./2021 Added a M68K exception catch check
87d08e09 16//
cf76e892
JPM
17
18#include "alpinetab.h"
024bfc46 19#include "settings.h"
cf76e892
JPM
20
21
22AlpineTab::AlpineTab(QWidget * parent/*= 0*/): QWidget(parent)
23{
24 QLabel * label1 = new QLabel("ROM to load:");
25 QLabel * label2 = new QLabel("ABS to load:");
26 QLabel * label3 = new QLabel("Windows refresh:");
27// QLabel * label3 = new QLabel("EEPROMs:");
28// QLabel * label4 = new QLabel("Software:");
29
30 edit1 = new QLineEdit("");
31 edit2 = new QLineEdit("");
32 edit3 = new QLineEdit("");
33// edit3 = new QLineEdit("");
34// edit4 = new QLineEdit("");
35 edit1->setPlaceholderText("ROM to load when Virtual Jaguar loads");
36 edit2->setPlaceholderText("ABS to load when Virtual Jaguar loads");
37 edit3->setPlaceholderText("Windows refresh rate");
38// edit3->setPlaceholderText("EEPROM path");
39// edit4->setPlaceholderText("Software path");
40
41 QVBoxLayout * layout1 = new QVBoxLayout;
42 layout1->addWidget(label1);
43 layout1->addWidget(label2);
44 layout1->addWidget(label3);
45// layout1->addWidget(label3);
46// layout1->addWidget(label4);
47
48 QVBoxLayout * layout2 = new QVBoxLayout;
49 layout2->addWidget(edit1);
50 layout2->addWidget(edit2);
51 layout2->addWidget(edit3);
52// layout2->addWidget(edit3);
53// layout2->addWidget(edit4);
54
55 QHBoxLayout * layout3 = new QHBoxLayout;
56 layout3->addLayout(layout1);
57 layout3->addLayout(layout2);
58
59 QVBoxLayout * layout4 = new QVBoxLayout;
60 layout4->addLayout(layout3);
61
62 // Checkboxes...
28c2bdc6
JPM
63 writeROM = new QCheckBox(tr("Allow writes to cartridge ROM"));
64 M68KExceptionCatch = new QCheckBox(tr("Allow M68000 exception catch"));
cf76e892
JPM
65// useDSP = new QCheckBox(tr("Enable DSP"));
66// useHostAudio = new QCheckBox(tr("Enable audio playback"));
67// useUnknownSoftware = new QCheckBox(tr("Allow unknown software in file chooser"));
68// Currently, this is unused, so let's signal this to the user:
eb20f274 69 //writeROM->setDisabled(true);
cf76e892
JPM
70
71 layout4->addWidget(writeROM);
28c2bdc6 72 layout4->addWidget(M68KExceptionCatch);
cf76e892
JPM
73// layout4->addWidget(useDSP);
74// layout4->addWidget(useHostAudio);
75// layout4->addWidget(useUnknownSoftware);
76
77 setLayout(layout4);
78}
79
024bfc46
JPM
80
81//
cf76e892
JPM
82AlpineTab::~AlpineTab()
83{
84}
024bfc46
JPM
85
86
87// Load / Update the tabs dialog from the settings
88void AlpineTab::GetSettings(void)
89{
90 QVariant v(vjs.refresh);
91 edit1->setText(vjs.alpineROMPath);
92 edit2->setText(vjs.absROMPath);
93 edit3->setText(v.toString());
94 writeROM->setChecked(vjs.allowWritesToROM);
28c2bdc6 95 M68KExceptionCatch->setChecked(vjs.allowM68KExceptionCatch);
024bfc46
JPM
96}
97
98
99// Save / Update the settings from the tabs dialog
100void AlpineTab::SetSettings(void)
101{
102 bool ok;
103
87d08e09
JPM
104 strcpy(vjs.alpineROMPath, CheckForSlashes(edit1->text()).toUtf8().data());
105 strcpy(vjs.absROMPath, CheckForSlashes(edit2->text()).toUtf8().data());
024bfc46
JPM
106 vjs.refresh = edit3->text().toUInt(&ok, 10);
107 vjs.allowWritesToROM = writeROM->isChecked();
28c2bdc6 108 vjs.allowM68KExceptionCatch = M68KExceptionCatch->isChecked();
024bfc46
JPM
109}
110
87d08e09
JPM
111
112// Depend the platform transform slashes or backslashes
113QString AlpineTab::CheckForSlashes(QString s)
114{
115#ifdef _WIN32
116 s.replace(QString("/"), QString("\\"));
117#else
118 s.replace(QString("\\"), QString("/"));
119#endif
120 return s;
121}