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 "commonclasses.h"
16 #include "menuclasses.h"
19 #include "sound_dialog.h"
23 extern config_t config;
25 Object_Menu_Control_88::Object_Menu_Control_88(QObject *parent, USING_FLAGS *p) : Object_Menu_Control(parent, p)
29 Object_Menu_Control_88::~Object_Menu_Control_88()
34 void Object_Menu_Control_88::do_set_memory_wait(bool flag)
36 emit sig_set_dipsw(0, flag);
40 Action_Control_88::Action_Control_88(QObject *parent, USING_FLAGS *p) : Action_Control(parent, p)
42 pc88_binds = new Object_Menu_Control_88(parent, p);
43 pc88_binds->setValue1(0);
46 Action_Control_88::~Action_Control_88()
51 void META_MainWindow::retranslateVolumeLabels(Ui_SoundDialog *p)
54 p->setDeviceLabel(1, QApplication::translate("MenuPC88", "CMT", 0));
55 switch(config_sound_device_type) {
57 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA", 0));
58 p->setSliderVisible(2, true);
59 p->setSliderVisible(3, false);
62 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN", 0));
63 p->setSliderVisible(2, true);
64 p->setSliderVisible(3, false);
66 #ifdef SUPPORT_PC88_SB2
68 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN", 0));
69 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPNA", 0));
70 p->setSliderVisible(2, true);
71 p->setSliderVisible(3, true);
74 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPN-1", 0));
75 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPN-2", 0));
76 p->setSliderVisible(2, true);
77 p->setSliderVisible(3, true);
80 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA-1", 0));
81 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPNA-2", 0));
82 p->setSliderVisible(2, true);
83 p->setSliderVisible(3, true);
86 p->setDeviceLabel(2, QApplication::translate("MenuPC88", "OPNA", 0));
87 p->setDeviceLabel(3, QApplication::translate("MenuPC88", "OPN", 0));
88 p->setSliderVisible(2, true);
89 p->setSliderVisible(3, true);
97 void META_MainWindow::retranslateUi(void)
100 Ui_MainWindowBase::retranslateUi();
101 retranslateControlMenu(title, false);
102 config_sound_device_type = config.sound_type;
104 this->setWindowTitle(QApplication::translate("MenuPC88", "MainWindow", 0));
107 menuCpuType->setTitle(QApplication::translate("MenuPC88", "CPU Frequency", 0));
108 #if defined(_PC8801MA)
109 actionCpuType[0]->setText(QString::fromUtf8("8MHz"));
110 actionCpuType[1]->setText(QString::fromUtf8("4MHz"));
111 actionCpuType[2]->setText(QString::fromUtf8("8MHz (FE2/MC)"));
113 actionCpuType[0]->setText(QString::fromUtf8("4MHz"));
114 //menuCpuType->setVisible(false);
115 //actionCpuType[0]->setVisible(false);
118 #if defined(_PC8801MA)
119 menuBootMode->setTitle(QApplication::translate("MenuPC88", "Machine Mode", 0));
120 menuBootMode->setToolTipsVisible(true);
121 actionBootMode[0]->setText(QString::fromUtf8("N88-V1(S) Mode"));
122 actionBootMode[1]->setText(QString::fromUtf8("N88-V1(H) Mode"));
123 actionBootMode[2]->setText(QString::fromUtf8("N88-V2 Mode"));
124 actionBootMode[3]->setText(QString::fromUtf8("N Mode (N80 compatible)"));
125 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "V1(Standard) Mode.\nYou can run softwares of PC-8801/mk2.", 0));
126 actionBootMode[1]->setToolTip(QApplication::translate("MenuPC88", "V1(High Speed) Mode.\nYou can run softwares of PC-8801/mk2 faster.", 0));
127 actionBootMode[2]->setToolTip(QApplication::translate("MenuPC88", "V2 Mode.\nYou can run only softwares for PC-8801SR or later.", 0));
128 actionBootMode[3]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run softwares of PC-8001/mk2.", 0));
129 #elif defined(_PC8001SR)
130 menuBootMode->setTitle("Machine Mode");
131 menuBootMode->setToolTipsVisible(true);
132 actionBootMode[0]->setText(QString::fromUtf8("N80-V1 Mode"));
133 actionBootMode[1]->setText(QString::fromUtf8("N80-V2(SR) Mode"));
134 actionBootMode[2]->setText(QString::fromUtf8("N Mode"));
135 actionBootMode[0]->setToolTip(QApplication::translate("MenuPC88", "V1 Mode.\nYou can run softwares of PC-8001/mk2.", 0));
136 actionBootMode[1]->setToolTip(QApplication::translate("MenuPC88", "V2 Mode.\nYou can run only softwares for PC-8001mk2SR or later.", 0));
137 actionBootMode[2]->setToolTip(QApplication::translate("MenuPC88", "N Mode.\nYou can run only softwares for PC-8001.", 0));
140 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Boards", 0));
141 #if defined(SUPPORT_PC88_SB2)
142 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Board", 0));
143 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
144 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
145 actionSoundDevice[2]->setText(QString::fromUtf8("Sound Board 2 (OPN + OPNA)"));
146 actionSoundDevice[3]->setText(QString::fromUtf8("Sound Board 2(OPN + OPN)"));
147 actionSoundDevice[4]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPNA)"));
148 actionSoundDevice[5]->setText(QString::fromUtf8("Sound Board 2 (OPNA + OPN)"));
149 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-23 (OPNA).", 0));
150 actionSoundDevice[1]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-11 (OPN).", 0));
151 actionSoundDevice[2]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPN + OPNA).", 0));
152 actionSoundDevice[3]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPN + OPN).", 0));
153 actionSoundDevice[4]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPNA + OPNA).", 0));
154 actionSoundDevice[5]->setToolTip(QApplication::translate("MenuPC88", "Sound Board 2 (OPNA + OPN).", 0));
155 #elif defined(SUPPORT_PC88_OPNA)
156 menuSoundDevice->setTitle(QApplication::translate("MenuPC88", "Sound Board", 0));
157 actionSoundDevice[0]->setText(QString::fromUtf8("PC-8801-23 (OPNA)"));
158 actionSoundDevice[1]->setText(QString::fromUtf8("PC-8801-11 (OPN)"));
159 actionSoundDevice[0]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-23 (OPNA).", 0));
160 actionSoundDevice[1]->setToolTip(QApplication::translate("MenuPC88", "PC-8801-11 (OPN).", 0));
163 actionDebugger[0]->setText(QApplication::translate("MenuPC88", "Main CPU", 0));
164 #if defined(_PC8001SR)
165 actionDebugger[1]->setText(QApplication::translate("MenuPC88", "PC-80S31K CPU", 0));
167 actionDebugger[1]->setText(QApplication::translate("MenuPC88", "Sub CPU", 0));
169 actionDebugger[0]->setVisible(true);
170 actionDebugger[1]->setVisible(true);
172 actionDebugger[2]->setVisible(false);
173 actionDebugger[3]->setVisible(false);
175 #if defined(USE_JOYSTICK_TYPE)
176 actionJoystickType[0]->setText(QApplication::translate("MenuPC88", "Joystick", 0));
177 actionJoystickType[1]->setText(QApplication::translate("MenuPC88", "Bus Mouse", 0));
178 actionJoystickType[0]->setToolTip(QApplication::translate("MenuPC88", "Connect joystick to JOY PORT.", 0));
179 actionJoystickType[1]->setToolTip(QApplication::translate("MenuPC88", "Connect bus-mouse to JOY PORT.", 0));
180 menuJoystickType->setTitle(QApplication::translate("MenuPC88", "Joy Port", 0));
182 #if defined(USE_PRINTER)
183 actionPrintDevice[1]->setText(QString::fromUtf8("PC-PR201"));
184 actionPrintDevice[1]->setToolTip(QApplication::translate("MenuPC88", "NEC PC-PR201 kanji serial printer.", 0));
185 actionPrintDevice[1]->setEnabled(false);
188 actionMemoryWait->setText(QApplication::translate("MenuPC88", "Wait Memory", 0));
189 actionMemoryWait->setToolTip(QApplication::translate("MenuPC88", "Simulate waiting memory.", 0));
190 #if defined(USE_MONITOR_TYPE)
191 actionMonitorType[0]->setText(QApplication::translate("MenuPC88", "High Resolution", 0));
192 actionMonitorType[1]->setText(QApplication::translate("MenuPC88", "Standard", 0));
200 void META_MainWindow::setupUI_Emu(void)
202 #if defined(USE_CPU_TYPE)
203 ConfigCPUTypes(USE_CPU_TYPE);
206 #if defined(_PC8801MA)
207 ConfigCPUBootMode(4);
208 #elif defined(_PC8001SR)
209 ConfigCPUBootMode(3);
211 actionMemoryWait = new Action_Control_88(this, using_flags);
212 actionMemoryWait->setCheckable(true);
213 actionMemoryWait->setVisible(true);
214 actionMemoryWait->setChecked(false);
216 menuMachine->addAction(actionMemoryWait);
217 if((config.dipswitch & 0x0001) != 0) actionMemoryWait->setChecked(true);
218 connect(actionMemoryWait, SIGNAL(toggled(bool)),
219 actionMemoryWait->pc88_binds, SLOT(do_set_memory_wait(bool)));
220 connect(actionMemoryWait->pc88_binds, SIGNAL(sig_set_dipsw(int, bool)),
221 this, SLOT(set_dipsw(int, bool)));
226 META_MainWindow::META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent) : Ui_MainWindow(p, logger, parent)
228 config_sound_device_type = 0;
234 META_MainWindow::~META_MainWindow()