• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revisión4fee6d8db9e9880a893b3c2f48af66e10026ce61 (tree)
Tiempo2019-10-12 04:24:02
AutorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[Qt][PC9801] Update UI.

Cambiar Resumen

Diferencia incremental

--- a/source/src/qt/machines/pc9801/MainWindow.cpp
+++ b/source/src/qt/machines/pc9801/MainWindow.cpp
@@ -36,7 +36,7 @@ void Object_Menu_Control_98::do_set_memory_wait(bool flag)
3636
3737 void Object_Menu_Control_98::do_set_enable_v30(bool flag)
3838 {
39- emit sig_set_dipsw(DIPSWITCH_POSITION_CPU_MODE, flag);
39+ emit sig_set_dipsw(DIPSWITCH_POSITION_USE_V30, flag);
4040 }
4141
4242
@@ -75,6 +75,16 @@ Action_Control_98::~Action_Control_98()
7575 delete pc98_binds;
7676 }
7777
78+// DIPSW 3-8
79+void META_MainWindow::do_use_ix86()
80+{
81+ set_dipsw(DIPSWITCH_POSITION_CPU_MODE, false);
82+}
83+
84+void META_MainWindow::do_use_v30()
85+{
86+ set_dipsw(DIPSWITCH_POSITION_CPU_MODE, true);
87+}
7888
7989 void META_MainWindow::retranslateUi(void)
8090 {
@@ -123,7 +133,7 @@ void META_MainWindow::retranslateUi(void)
123133 actionSoundDevice[2]->setVisible(false);
124134 actionSoundDevice[3]->setVisible(false);
125135 #endif
126-#if defined(HAS_I286) || defined(UPPER_I386)
136+#if defined(HAS_V30_SUB_CPU)
127137 actionSUB_V30->setText(QApplication::translate("MainWindow", "Enable V30 SUB CPU(need RESTART).", 0));
128138 actionSUB_V30->setToolTip(QApplication::translate("MainWindow", "Enable emulation of V30 SUB CPU.\nThis may make emulation speed slower.\nYou must restart emulator after reboot.", 0));
129139 #endif
@@ -145,28 +155,27 @@ void META_MainWindow::retranslateUi(void)
145155 # elif defined(_PC9801VX) || defined(_PC98XL)
146156 actionCpuType[0]->setText(QString::fromUtf8("80286 10MHz"));
147157 actionCpuType[1]->setText(QString::fromUtf8("80286 8MHz"));
148- actionCpuType[2]->setText(QString::fromUtf8("V30 8MHz"));
149- if((config.dipswitch & ((0x1) << DIPSWITCH_POSITION_CPU_MODE)) == 0) {
150- actionCpuType[2]->setEnabled(false);
151- }
152158 # elif defined(_PC9801RA) || defined(_PC98RL)
153159 // ToDo: PC98RL's display rotate.
154160 actionCpuType[0]->setText(QString::fromUtf8("80386 20MHz"));
155161 actionCpuType[1]->setText(QString::fromUtf8("80386 16MHz"));
156- actionCpuType[2]->setText(QString::fromUtf8("V30 8MHz"));
157- if((config.dipswitch & ((0x1) << DIPSWITCH_POSITION_CPU_MODE)) == 0) {
158- actionCpuType[2]->setEnabled(false);
159- }
160162 # elif defined(_PC98XA)
161163 actionCpuType[0]->setText(QString::fromUtf8("80286 8MHz"));
162164 actionCpuType[1]->setVisible(false);
163- actionCpuType[2]->setText(QString::fromUtf8("V30 8MHz"));
164- if((config.dipswitch & ((0x1) << DIPSWITCH_POSITION_CPU_MODE)) == 0) {
165- actionCpuType[2]->setEnabled(false);
165+# endif
166+#endif
167+#if defined(HAS_V30_SUB_CPU)
168+ if((config.dipswitch & ((0x1) << DIPSWITCH_POSITION_USE_V30)) == 0) {
169+ actionRunSubCPU->setEnabled(false);
166170 }
171+# if defined(UPPER_I386)
172+ actionRunMainCPU->setText(QString::fromUtf8("i386"));
173+# else
174+ actionRunMainCPU->setText(QString::fromUtf8("i80286"));
167175 # endif
176+ actionRunSubCPU->setText(QString::fromUtf8("V30 8MHz"));
177+ menuRunCpu->setTitle(QApplication::translate("MainWindow", "Running CPU (DIPSW 3-8)", 0));
168178 #endif
169-
170179 actionRAM_512K->setText(QApplication::translate("MainWindow", "512KB RAM", 0));
171180 actionRAM_512K->setToolTip(QApplication::translate("MainWindow", "Set lower RAM size to 512KB(not 640KB).\nMaybe for backward compatibility.", 0));
172181 actionINIT_MEMSW->setText(QApplication::translate("MainWindow", "INIT MEMSW(need RESET)", 0));
@@ -222,21 +231,18 @@ void META_MainWindow::retranslateUi(void)
222231 actionDebugger[2]->setVisible(true);
223232 #elif defined(HAS_I286)
224233 actionDebugger[0]->setText(QApplication::translate("MainWindow", "i80286 Main CPU", 0));
225- actionDebugger[1]->setText(QApplication::translate("MainWindow", "V30 Sub CPU", 0));
226- actionDebugger[1]->setVisible(true);
227234 #elif defined(HAS_I386)
228235 actionDebugger[0]->setText(QApplication::translate("MainWindow", "i80386 Main CPU", 0));
229- actionDebugger[1]->setText(QApplication::translate("MainWindow", "V30 Sub CPU", 0));
230- actionDebugger[1]->setVisible(true);
231236 #elif defined(HAS_I486)
232237 actionDebugger[0]->setText(QApplication::translate("MainWindow", "i80486 Main CPU", 0));
233- actionDebugger[1]->setText(QApplication::translate("MainWindow", "V30 Sub CPU", 0));
234- actionDebugger[1]->setVisible(true);
235238 #elif defined(UPPER_I386)
236239 actionDebugger[0]->setText(QApplication::translate("MainWindow", "i80x86 Main CPU", 0));
240+#endif
241+#if defined(HAS_V30_SUB_CPU)
237242 actionDebugger[1]->setText(QApplication::translate("MainWindow", "V30 Sub CPU", 0));
238243 actionDebugger[1]->setVisible(true);
239-#endif
244+#endif
245+
240246 #endif
241247 #ifdef USE_MONITOR_TYPE
242248 actionMonitorType[0]->setText(QApplication::translate("MainWindow", "High Resolution", 0));
@@ -247,24 +253,46 @@ void META_MainWindow::retranslateUi(void)
247253 void META_MainWindow::setupUI_Emu(void)
248254 {
249255 #ifdef USE_CPU_TYPE
250- #if defined(HAS_I286) || defined(UPPER_I386)
251- ConfigCPUTypes(3);
252- #else
253256 ConfigCPUTypes(2);
254- #endif
255257 #endif
256-#if defined(HAS_I286) || defined(UPPER_I386)
258+#if defined(HAS_V30_SUB_CPU)
257259 actionSUB_V30 = new Action_Control_98(this, using_flags);
258260 actionSUB_V30->setCheckable(true);
259261 actionSUB_V30->setVisible(true);
260262 menuMachine->addAction(actionSUB_V30);
261- if((config.dipswitch & ((0x1) << DIPSWITCH_POSITION_CPU_MODE)) != 0) actionSUB_V30->setChecked(true); // Emulation with V30
263+ if((config.dipswitch & ((0x1) << DIPSWITCH_POSITION_USE_V30)) != 0) actionSUB_V30->setChecked(true); // Emulation with V30
262264 connect(actionSUB_V30, SIGNAL(toggled(bool)),
263265 actionSUB_V30->pc98_binds, SLOT(do_set_enable_v30(bool)));
264266 connect(actionSUB_V30->pc98_binds, SIGNAL(sig_set_dipsw(int, bool)),
265267 this, SLOT(set_dipsw(int, bool)));
266268 connect(actionSUB_V30->pc98_binds, SIGNAL(sig_emu_update_config()),
267269 this, SLOT(do_emu_update_config()));
270+
271+ actionGroup_RunningCpu = new QActionGroup(this);
272+ actionGroup_RunningCpu->setExclusive(true);
273+
274+ actionRunMainCPU = new Action_Control_98(this, using_flags);
275+ actionRunMainCPU->setCheckable(true);
276+ actionRunMainCPU->setVisible(true);
277+ actionGroup_RunningCpu->addAction(actionRunMainCPU);
278+ connect(actionRunMainCPU, SIGNAL(triggered()), this, SLOT(do_use_ix86()));
279+
280+ actionRunSubCPU = new Action_Control_98(this, using_flags);
281+ actionRunSubCPU->setCheckable(true);
282+ actionRunSubCPU->setVisible(true);
283+ actionGroup_RunningCpu->addAction(actionRunSubCPU);
284+ connect(actionRunSubCPU, SIGNAL(triggered()), this, SLOT(do_use_v30()));
285+
286+ if((config.dipswitch & (1 << DIPSWITCH_POSITION_CPU_MODE)) != 0) {
287+ actionRunSubCPU->setChecked(true);
288+ } else {
289+ actionRunMainCPU->setChecked(true);
290+ }
291+ menuRunCpu = new QMenu(menuMachine);
292+ menuRunCpu->addAction(actionRunMainCPU);
293+ menuRunCpu->addAction(actionRunSubCPU);
294+ menuMachine->addAction(menuRunCpu->menuAction());
295+
268296 #endif
269297
270298 actionRAM_512K = new Action_Control_98(this, using_flags);
--- a/source/src/qt/machines/pc9801/menuclasses.h
+++ b/source/src/qt/machines/pc9801/menuclasses.h
@@ -51,20 +51,28 @@ protected:
5151 Action_Control_98 *actionRAM_512K;
5252 Action_Control_98 *actionINIT_MEMSW;
5353 Action_Control_98 *actionGDC_FAST;
54-#if defined(HAS_I286) || defined(HAS_I386) || defined(HAS_I486) || defined(HAS_PENTIUM)
55- Action_Control_98 *actionSUB_V30;
56-#endif
5754 #if defined(SUPPORT_EGC)
5855 Action_Control_98 *actionEGC;
5956 #endif
6057 #if defined(_PC98DO)
6158 Action_Control_98 *actionMemoryWait;
62-#endif
59+#endif
60+#if defined(HAS_V30_SUB_CPU)
61+ Action_Control_98 *actionSUB_V30;
62+ QActionGroup *actionGroup_RunningCpu;
63+ QMenu *menuRunCpu;
64+ Action_Control_98 *actionRunMainCPU;
65+ Action_Control_98 *actionRunSubCPU;
66+#endif
6367 void setupUI_Emu(void);
6468 void retranslateUi(void);
6569 public:
6670 META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent = 0);
6771 ~META_MainWindow();
72+public slots:
73+ void do_use_ix86();
74+ void do_use_v30();
75+
6876 };
6977
7078 QT_END_NAMESPACE
Show on old repository browser