Qt: Include cheats in bug report

This commit is contained in:
Vicki Pfau 2022-09-28 04:27:33 -07:00
parent 31f798748b
commit 0c33863e66
2 changed files with 13 additions and 0 deletions

View File

@ -110,6 +110,7 @@ Misc:
- Qt: Change lossless setting to use WavPack audio - Qt: Change lossless setting to use WavPack audio
- Qt: Use FFmpeg to convert additional camera formats, if available - Qt: Use FFmpeg to convert additional camera formats, if available
- Qt: Resume crashed game when loading a save state - Qt: Resume crashed game when loading a save state
- Qt: Include cheats in bug report
- SDL: Support exposing an axis directly as the gyro value (closes mgba.io/i/2531) - SDL: Support exposing an axis directly as the gyro value (closes mgba.io/i/2531)
- Windows: Attach to console if present - Windows: Attach to console if present
- VFS: Early return NULL if attempting to map 0 bytes from a file - VFS: Early return NULL if attempting to map 0 bytes from a file

View File

@ -12,6 +12,7 @@
#include <QSysInfo> #include <QSysInfo>
#include <QWindow> #include <QWindow>
#include <mgba/core/cheats.h>
#include <mgba/core/serialize.h> #include <mgba/core/serialize.h>
#include <mgba/core/version.h> #include <mgba/core/version.h>
#include <mgba-util/png-io.h> #include <mgba-util/png-io.h>
@ -266,6 +267,17 @@ void ReportView::generateReport() {
} }
addROMInfo(windowReport, controller.get()); addROMInfo(windowReport, controller.get());
mCheatDevice* device = controller->cheatDevice();
if (device) {
VFileDevice vf(VFileDevice::openMemory());
mCheatSaveFile(device, vf);
vf.seek(0);
QByteArray cheats(vf.readAll());
if (cheats.size()) {
addReport(QString("Cheats %1").arg(winId), QString::fromUtf8(cheats));
}
}
if (m_ui.includeSave->isChecked() && !m_ui.includeState->isChecked()) { if (m_ui.includeSave->isChecked() && !m_ui.includeState->isChecked()) {
// Only do the save separately if savestates aren't enabled, to guarantee consistency // Only do the save separately if savestates aren't enabled, to guarantee consistency
mCore* core = controller->thread()->core; mCore* core = controller->thread()->core;