Common Source Code Project for Qt (a.k.a for FM-7).
Revisión | 4fee6d8db9e9880a893b3c2f48af66e10026ce61 (tree) |
---|---|
Tiempo | 2019-10-12 04:24:02 |
Autor | K.Ohta <whatisthis.sowhat@gmai...> |
Commiter | K.Ohta |
[Qt][PC9801] Update UI.
@@ -36,7 +36,7 @@ void Object_Menu_Control_98::do_set_memory_wait(bool flag) | ||
36 | 36 | |
37 | 37 | void Object_Menu_Control_98::do_set_enable_v30(bool flag) |
38 | 38 | { |
39 | - emit sig_set_dipsw(DIPSWITCH_POSITION_CPU_MODE, flag); | |
39 | + emit sig_set_dipsw(DIPSWITCH_POSITION_USE_V30, flag); | |
40 | 40 | } |
41 | 41 | |
42 | 42 |
@@ -75,6 +75,16 @@ Action_Control_98::~Action_Control_98() | ||
75 | 75 | delete pc98_binds; |
76 | 76 | } |
77 | 77 | |
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 | +} | |
78 | 88 | |
79 | 89 | void META_MainWindow::retranslateUi(void) |
80 | 90 | { |
@@ -123,7 +133,7 @@ void META_MainWindow::retranslateUi(void) | ||
123 | 133 | actionSoundDevice[2]->setVisible(false); |
124 | 134 | actionSoundDevice[3]->setVisible(false); |
125 | 135 | #endif |
126 | -#if defined(HAS_I286) || defined(UPPER_I386) | |
136 | +#if defined(HAS_V30_SUB_CPU) | |
127 | 137 | actionSUB_V30->setText(QApplication::translate("MainWindow", "Enable V30 SUB CPU(need RESTART).", 0)); |
128 | 138 | 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)); |
129 | 139 | #endif |
@@ -145,28 +155,27 @@ void META_MainWindow::retranslateUi(void) | ||
145 | 155 | # elif defined(_PC9801VX) || defined(_PC98XL) |
146 | 156 | actionCpuType[0]->setText(QString::fromUtf8("80286 10MHz")); |
147 | 157 | 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 | - } | |
152 | 158 | # elif defined(_PC9801RA) || defined(_PC98RL) |
153 | 159 | // ToDo: PC98RL's display rotate. |
154 | 160 | actionCpuType[0]->setText(QString::fromUtf8("80386 20MHz")); |
155 | 161 | 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 | - } | |
160 | 162 | # elif defined(_PC98XA) |
161 | 163 | actionCpuType[0]->setText(QString::fromUtf8("80286 8MHz")); |
162 | 164 | 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); | |
166 | 170 | } |
171 | +# if defined(UPPER_I386) | |
172 | + actionRunMainCPU->setText(QString::fromUtf8("i386")); | |
173 | +# else | |
174 | + actionRunMainCPU->setText(QString::fromUtf8("i80286")); | |
167 | 175 | # endif |
176 | + actionRunSubCPU->setText(QString::fromUtf8("V30 8MHz")); | |
177 | + menuRunCpu->setTitle(QApplication::translate("MainWindow", "Running CPU (DIPSW 3-8)", 0)); | |
168 | 178 | #endif |
169 | - | |
170 | 179 | actionRAM_512K->setText(QApplication::translate("MainWindow", "512KB RAM", 0)); |
171 | 180 | actionRAM_512K->setToolTip(QApplication::translate("MainWindow", "Set lower RAM size to 512KB(not 640KB).\nMaybe for backward compatibility.", 0)); |
172 | 181 | actionINIT_MEMSW->setText(QApplication::translate("MainWindow", "INIT MEMSW(need RESET)", 0)); |
@@ -222,21 +231,18 @@ void META_MainWindow::retranslateUi(void) | ||
222 | 231 | actionDebugger[2]->setVisible(true); |
223 | 232 | #elif defined(HAS_I286) |
224 | 233 | 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); | |
227 | 234 | #elif defined(HAS_I386) |
228 | 235 | 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); | |
231 | 236 | #elif defined(HAS_I486) |
232 | 237 | 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); | |
235 | 238 | #elif defined(UPPER_I386) |
236 | 239 | actionDebugger[0]->setText(QApplication::translate("MainWindow", "i80x86 Main CPU", 0)); |
240 | +#endif | |
241 | +#if defined(HAS_V30_SUB_CPU) | |
237 | 242 | actionDebugger[1]->setText(QApplication::translate("MainWindow", "V30 Sub CPU", 0)); |
238 | 243 | actionDebugger[1]->setVisible(true); |
239 | -#endif | |
244 | +#endif | |
245 | + | |
240 | 246 | #endif |
241 | 247 | #ifdef USE_MONITOR_TYPE |
242 | 248 | actionMonitorType[0]->setText(QApplication::translate("MainWindow", "High Resolution", 0)); |
@@ -247,24 +253,46 @@ void META_MainWindow::retranslateUi(void) | ||
247 | 253 | void META_MainWindow::setupUI_Emu(void) |
248 | 254 | { |
249 | 255 | #ifdef USE_CPU_TYPE |
250 | - #if defined(HAS_I286) || defined(UPPER_I386) | |
251 | - ConfigCPUTypes(3); | |
252 | - #else | |
253 | 256 | ConfigCPUTypes(2); |
254 | - #endif | |
255 | 257 | #endif |
256 | -#if defined(HAS_I286) || defined(UPPER_I386) | |
258 | +#if defined(HAS_V30_SUB_CPU) | |
257 | 259 | actionSUB_V30 = new Action_Control_98(this, using_flags); |
258 | 260 | actionSUB_V30->setCheckable(true); |
259 | 261 | actionSUB_V30->setVisible(true); |
260 | 262 | 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 | |
262 | 264 | connect(actionSUB_V30, SIGNAL(toggled(bool)), |
263 | 265 | actionSUB_V30->pc98_binds, SLOT(do_set_enable_v30(bool))); |
264 | 266 | connect(actionSUB_V30->pc98_binds, SIGNAL(sig_set_dipsw(int, bool)), |
265 | 267 | this, SLOT(set_dipsw(int, bool))); |
266 | 268 | connect(actionSUB_V30->pc98_binds, SIGNAL(sig_emu_update_config()), |
267 | 269 | 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 | + | |
268 | 296 | #endif |
269 | 297 | |
270 | 298 | actionRAM_512K = new Action_Control_98(this, using_flags); |
@@ -51,20 +51,28 @@ protected: | ||
51 | 51 | Action_Control_98 *actionRAM_512K; |
52 | 52 | Action_Control_98 *actionINIT_MEMSW; |
53 | 53 | 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 | |
57 | 54 | #if defined(SUPPORT_EGC) |
58 | 55 | Action_Control_98 *actionEGC; |
59 | 56 | #endif |
60 | 57 | #if defined(_PC98DO) |
61 | 58 | 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 | |
63 | 67 | void setupUI_Emu(void); |
64 | 68 | void retranslateUi(void); |
65 | 69 | public: |
66 | 70 | META_MainWindow(USING_FLAGS *p, CSP_Logger *logger, QWidget *parent = 0); |
67 | 71 | ~META_MainWindow(); |
72 | +public slots: | |
73 | + void do_use_ix86(); | |
74 | + void do_use_v30(); | |
75 | + | |
68 | 76 | }; |
69 | 77 | |
70 | 78 | QT_END_NAMESPACE |