MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / viewToString

Method viewToString

gui/qt/visualizerwidget.cpp:292–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void VisualizerWidget::viewToString() {
293 QString bpp;
294 float bppstep = 1.0f;
295
296 switch ((m_control >> 1) & 7) {
297 case 0: bpp = QStringLiteral("1"); bppstep = 1.0f/0.125f; break;
298 case 1: bpp = QStringLiteral("2"); bppstep = 1.0f/0.25f; break;
299 case 2: bpp = QStringLiteral("4"); bppstep = 1.0f/0.5f; break;
300 case 3: bpp = QStringLiteral("8"); bppstep = 1.0f/1.0f; break;
301 case 4: bpp = QStringLiteral("1555"); bppstep = 1.0f/2.0f; break;
302 case 5: bpp = QStringLiteral("888"); bppstep = 1.0f/3.0f; break;
303 case 6: bpp = QStringLiteral("565"); bppstep = 1.0f/2.0f; break;
304 case 7: bpp = QStringLiteral("444"); bppstep = 1.0f/1.5f; break;
305 default: break;
306 }
307
308 m_setup.clear();
309 m_setup.append(int2hex(m_base, 6).toUpper());
310 m_setup.append(QString::number(m_width) + QStringLiteral("x") + QString::number(m_height));
311 m_setup.append(bpp + QStringLiteral("bpp"));
312 if (m_control & 0x400) { m_setup.append(QStringLiteral("bepo")); }
313 if (m_control & 0x200) { m_setup.append(QStringLiteral("bebo")); }
314 if (m_control & 0x100) { m_setup.append(QStringLiteral("bgr")); }
315 if (m_scale != 100) { m_setup.append(QString::number(m_scale) + QStringLiteral("%")); }
316 if (m_fps != 30) { m_setup.append(QString::number(m_fps) + QStringLiteral("fps")); }
317 if (m_grid == true) { m_setup.append(QStringLiteral("grid")); }
318
319 m_config->setText(m_setup.join(","));
320
321 float s = m_scale / 100.0f;
322 float w = m_width * s;
323 float h = m_height * s;
324
325 uint32_t *data;
326 uint32_t *data_end;
327
328 emu_set_lcd_ptrs(&data, &data_end, m_width, m_height, m_base, m_control, false);
329
330 m_view->setFixedSize(static_cast<int>(w), static_cast<int>(h));
331 m_view->setRefreshRate(m_fps);
332 m_view->setConfig(bppstep, m_width, m_height, m_base, m_control, m_grid, data, data_end);
333 adjustSize();
334
335 emit configChanged();
336}
337
338QString VisualizerWidget::getConfig() {
339 return m_config->text();

Callers

nothing calls this directly

Calls 5

int2hexFunction · 0.85
emu_set_lcd_ptrsFunction · 0.85
setRefreshRateMethod · 0.80
setConfigMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected