2 * Common Source code Project:
3 * Ui->Qt->MainWindow for X1TurboZ .
4 * (C) 2015 K.Ohta <whatisthis.sowhat _at_ gmail.com>
7 * Jan 14, 2015 : Initial, many of constructors were moved to qt/gui/menu_main.cpp.
12 #include <QApplication>
15 #include "../../../src/vm/vm.h"
16 #include "commonclasses.h"
17 #include "menuclasses.h"
20 #include "sound_dialog.h"
24 extern config_t config;
26 Object_Menu_Control_88::Object_Menu_Control_88(QObject *parent, USING_FLAGS *p) : Object_Menu_Control(parent, p)
30 Object_Menu_Control_88::~Object_Menu_Control_88()
35 void Object_Menu_Control_88::do_set_memory_wait(bool flag)
37 emit sig_set_dipsw(0, flag);
41 Action_Control_88::Action_Control_88(QObject *parent, USING_FLAGS *p) : Action_Control(parent, p)
43 pc88_binds = new Object_Menu_Control_88(parent, p);
44 pc88_binds->setValue1(0);
47 Action_Control_88::~Action_Control_88()
52 void META_MainWindow::retranslateVolumeLabels(Ui_SoundDialog *p)
55 p->setDeviceLabel(1, QApplication::translate("MenuPC88", "CMT", 0));
56 switch(config_sound_device_type) {
58 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA", 0));
59 p->setSliderVisible(2, true);
60 p->setSliderVisible(3, false);
63 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN", 0));
64 p->setSliderVisible(2, true);
65 p->setSliderVisible(3, false);
67 #ifdef SUPPORT_PC88_SB2
69 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN", 0));
70 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPNA", 0));
71 p->setSliderVisible(2, true);
72 p->setSliderVisible(3, true);
75 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN-1", 0));
76 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPN-2", 0));
77 p->setSliderVisible(2, true);
78 p->setSliderVisible(3, true);
81 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA-1", 0));
82 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPNA-2", 0));
83 p->setSliderVisible(2, true);
84 p->setSliderVisible(3, true);
87 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA", 0));
88 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPN", 0));
89 p->setSliderVisible(2, true);
90 p->setSliderVisible(3, true);
98 void META_MainWindow::retranslateUi(void)
100 const char *title="";
101 Ui_MainWindowBase::retranslateUi();
102 retranslateControlMenu(title, false);
103 config_sound_device_type = config.sound_type;
105 this->setWindowTitle(QApplication::translate("MenuPC88", "MainWindow", 0));
108 menuCpuType->setTitle(QApplication::translate("MenuPC88", "CPU Frequency", 0));
109 #ifdef SUPPORT_PC88_HIGH_CLOCK
110 actionCpuType[0]->setText(QString::fromUtf8("8MHz"));
111 actionCpuType[1]->setText(QString::fromUtf8("4MHz"));
112 actionCpuType[2]->setText(QString::fromUtf8("8MHz (FE2/MC)"));
114 actionCpuType[0]->setText(QString::fromUtf8("4MHz"));
115 #if defined(USE_CPU_TYPE)
116 for(int i = 1; i < USE_CPU_TYPE; i++) {
117 actionCpuType[i]->setVisible(false);
120 // menuCpuType->setVisible(false);
121 // actionCpuType[0]->setVisible(false);
124 menuBootMode->setTitle(QApplication::translate("MenuPC88", "Machine Mode", 0));
125 menuBootMode->setToolTipsVisible(true);
127 actionBootMode[0]->setText(QString::fromUtf8("N88 Mode"));
128 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
129 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "N88 Mode.\nYou can run softwares of PC-8801/mk2.", 0));
130 actionBootMode[3]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run softwares of PC-8001/mk2.", 0));
131 actionBootMode[1]->setVisible(false);
132 actionBootMode[2]->setVisible(false);
133 #elif defined(_PC8801MK2)
134 actionBootMode[0]->setText(QString::fromUtf8("N88 Mode"));
135 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
136 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "N88 Mode.\nYou can run softwares of PC-8801/mk2.", 0));
137 actionBootMode[3]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run softwares of PC-8001/mk2.", 0));
138 actionBootMode[1]->setVisible(false);
139 actionBootMode[2]->setVisible(false);
141 #elif defined(_PC8801MA)
142 actionBootMode[0]->setText(QString::fromUtf8("N88-V1(S) Mode"));
143 actionBootMode[1]->setText(QString::fromUtf8("N88-V1(H) Mode"));
144 actionBootMode[2]->setText(QString::fromUtf8("N88-V2 Mode"));
145 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
146 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "V1(Standard) Mode.\nYou can run softwares of PC-8801/mk2.", 0));
147 actionBootMode[1]->setToolTip(QApplication::translate("MenuPC88", "V1(High Speed) Mode.\nYou can run softwares of PC-8801/mk2 faster.", 0));
148 actionBootMode[2]->setToolTip(QApplication::translate("MenuPC88", "V2 Mode.\nYou can run only softwares for PC-8801SR or later.", 0));
149 actionBootMode[3]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run softwares of PC-8001/mk2.", 0));
150 #elif defined(_PC8001)
151 menuBootMode->setVisible(false);
152 menuBootMode->setToolTipsVisible(false);
153 actionBootMode[0]->setVisible(false);
154 actionBootMode[1]->setVisible(false);
155 actionBootMode[2]->setVisible(false);
156 #elif defined(_PC8001MK2)
157 actionBootMode[0]->setText(QString::fromUtf8("N80 Mode"));
158 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
159 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "N80 Mode.\nYou can run softwares of PC-8001/mk2.", 0));
160 actionBootMode[2]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run only softwares for PC-8001.", 0));
161 actionBootMode[1]->setVisible(false);
162 #elif defined(_PC8001SR)
163 actionBootMode[0]->setText(QString::fromUtf8("N80 Mode"));
164 actionBootMode[1]->setText(QString::fromUtf8("N80-V2(SR) Mode"));
165 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
166 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "N80 Mode.\nYou can run softwares of PC-8001/mk2.", 0));
167 actionBootMode[1]->setToolTip(QApplication::translate("MenuPC88", "N80 V2 Mode.\nYou can run only softwares for PC-8001mk2SR or later.", 0));
168 actionBootMode[2]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run only softwares for PC-8001.", 0));
171 #if defined(SUPPORT_PC88_OPN1) && defined(SUPPORT_PC88_OPN2)
172 #if defined(_PC8001SR)
173 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Board", 0));
174 actionSoundDevice[0]->setText(QString::fromUtf8("OPN"));
175 actionSoundDevice[1]->setText(QString::fromUtf8("OPNA"));
176 actionSoundDevice[2]->setText(QString::fromUtf8("OPN + OPNA"));
177 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "Using YM2203(OPN) as FM sounder.", 0));
178 actionSoundDevice[1]->setToolTip(QApplication::translate("MenuPC88", "Using YM2608(OPNA) as FM sounder.", 0));
179 actionSoundDevice[2]->setToolTip(QApplication::translate("MenuPC88", "Using YM2203(OPN) and YM2608(OPNA) as FM sounder.", 0));
181 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Board", 0));
182 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
183 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
184 actionSoundDevice[2]->setText(QString::fromUtf8("Sound Board 2 (OPN + OPNA)"));
185 actionSoundDevice[3]->setText(QString::fromUtf8("Sound Board 2(OPN + OPN)"));
186 actionSoundDevice[4]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPNA)"));
187 actionSoundDevice[5]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPN)"));
188 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-23 (OPNA).", 0));
189 actionSoundDevice[1]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-11 (OPN).", 0));
190 actionSoundDevice[2]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPN + OPNA).", 0));
191 actionSoundDevice[3]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPN + OPN).", 0));
192 actionSoundDevice[4]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPNA + OPNA).", 0));
193 actionSoundDevice[5]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPNA + OPN).", 0));
195 #elif defined(SUPPORT_PC88_OPN1) || defined(SUPPORT_PC88_OPN2)
196 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Board", 0));
197 #if defined(SUPPORT_OPNA)
198 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-11 (OPN).", 0));
199 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
200 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
201 actionSoundDevice[1]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-23 (OPNA).", 0));
203 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-11 (OPN).", 0));
204 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
208 actionDebugger[0]->setText(QApplication::translate("MenuPC88", "Main CPU", 0));
209 #if defined(_PC8001SR)
210 actionDebugger[1]->setText(QApplication::translate("MenuPC88", "PC-80S31K CPU", 0));
212 actionDebugger[1]->setText(QApplication::translate("MenuPC88", "Sub CPU", 0));
214 actionDebugger[0]->setVisible(true);
215 actionDebugger[1]->setVisible(true);
217 actionDebugger[2]->setVisible(false);
218 actionDebugger[3]->setVisible(false);
220 #if defined(USE_JOYSTICK_TYPE)
221 actionJoystickType[0]->setText(QApplication::translate("MenuPC88", "Joystick", 0));
222 actionJoystickType[1]->setText(QApplication::translate("MenuPC88", "Bus Mouse", 0));
223 actionJoystickType[0]->setToolTip(QApplication::translate("MenuPC88", "Connect joystick to JOY PORT.", 0));
224 actionJoystickType[1]->setToolTip(QApplication::translate("MenuPC88", "Connect bus-mouse to JOY PORT.", 0));
225 menuJoystickType->setTitle(QApplication::translate("MenuPC88", "Joy Port", 0));
227 #if defined(USE_PRINTER)
228 actionPrintDevice[1]->setText(QString::fromUtf8("PC-PR201"));
229 actionPrintDevice[1]->setToolTip(QApplication::translate("MenuPC88", "NEC PC-PR201 kanji serial printer.", 0));
230 actionPrintDevice[1]->setEnabled(false);
233 actionMemoryWait->setText(QApplication::translate("MenuPC88", "Wait Memory", 0));
234 actionMemoryWait->setToolTip(QApplication::translate("MenuPC88", "Simulate waiting memory.", 0));
235 #if defined(USE_MONITOR_TYPE)
236 actionMonitorType[0]->setText(QApplication::translate("MenuPC88", "High Resolution", 0));
237 actionMonitorType[1]->setText(QApplication::translate("MenuPC88", "Standard", 0));
245 void META_MainWindow::setupUI_Emu(void)
247 #if defined(USE_CPU_TYPE)
248 ConfigCPUTypes(USE_CPU_TYPE);
251 #if defined(PC8001_VARIANT)
252 ConfigCPUBootMode(3);
254 ConfigCPUBootMode(4);
256 actionMemoryWait = new Action_Control_88(this, using_flags);
257 actionMemoryWait->setCheckable(true);
258 actionMemoryWait->setVisible(true);
259 actionMemoryWait->setChecked(false);
261 menuMachine->addAction(actionMemoryWait);
262 if((config.dipswitch & 0x0001) != 0) actionMemoryWait->setChecked(true);
263 connect(actionMemoryWait, SIGNAL(toggled(bool)),
264 actionMemoryWait->pc88_binds, SLOT(do_set_memory_wait(bool)));
265 connect(actionMemoryWait->pc88_binds, SIGNAL(sig_set_dipsw(int, bool)),
266 this, SLOT(set_dipsw(int, bool)));
271 META_MainWindow::META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent) : Ui_MainWindow(p, logger, parent)
273 config_sound_device_type = 0;
279 META_MainWindow::~META_MainWindow()