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

Method saveROMImage

gui/qt/romselection.cpp:218–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218void RomSelection::saveROMImage() {
219 FILE* saveRom;
220
221 QFileDialog dialog(this);
222
223 dialog.setFileMode(QFileDialog::AnyFile);
224 QString filename = dialog.getSaveFileName(this, tr("Save ROM"), m_dir.absolutePath(), tr("ROM Image (*.rom)"));
225
226 m_dir = dialog.directory();
227
228 if (filename.isEmpty()) { return; }
229
230 if (!filename.endsWith(QStringLiteral(".rom"), Qt::CaseInsensitive)) {
231 filename += QStringLiteral(".rom");
232 }
233
234 saveRom = fopen_utf8(filename.toStdString().c_str(), "wb");
235
236 if (saveRom) {
237 fwrite(m_array, 1, ROM_SIZE, saveRom);
238 fclose(saveRom);
239 m_rom = filename;
240 close();
241 }
242}
243
244QString RomSelection::getRomPath() {
245 return m_rom;

Callers

nothing calls this directly

Calls 1

fopen_utf8Function · 0.50

Tested by

no test coverage detected