Skip to content

Commit 5de3371

Browse files
committed
Including debug messages for ROM loading procedure
1 parent 624ced1 commit 5de3371

File tree

2 files changed

+69
-14
lines changed

2 files changed

+69
-14
lines changed

src/atariemulator.cpp

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,14 @@ bool AtariEmulator::initializeWithDisplayConfig(bool basicEnabled, const QString
245245
argList << "-nosound";
246246
}
247247

248-
qDebug() << "Altirra OS enabled:" << m_altirraOSEnabled;
249-
qDebug() << "Altirra BASIC enabled:" << m_altirraBASICEnabled;
248+
qDebug() << "[ROM CONFIG] Altirra OS enabled:" << m_altirraOSEnabled;
249+
qDebug() << "[ROM CONFIG] Altirra BASIC enabled:" << m_altirraBASICEnabled;
250+
qDebug() << "[ROM CONFIG] OS ROM path:" << (m_osRomPath.isEmpty() ? "(not set)" : m_osRomPath);
251+
qDebug() << "[ROM CONFIG] BASIC ROM path:" << (m_basicRomPath.isEmpty() ? "(not set)" : m_basicRomPath);
250252

251253
// Configure OS ROM (Altirra or External)
252254
if (m_altirraOSEnabled) {
253-
qDebug() << "Using built-in Altirra OS ROM";
255+
qDebug() << "[ROM LOAD] Using built-in Altirra OS ROM";
254256
if (machineType == "-5200") {
255257
argList << "-5200-rev" << "altirra";
256258
} else if (machineType == "-atari") {
@@ -259,33 +261,47 @@ bool AtariEmulator::initializeWithDisplayConfig(bool basicEnabled, const QString
259261
argList << "-xl-rev" << "altirra";
260262
}
261263
} else {
262-
qDebug() << "Using external OS ROM from user settings";
264+
qDebug() << "[ROM LOAD] Attempting to use external OS ROM from user settings";
263265
// Only add ROM paths if they are specified in settings
264266
if (!m_osRomPath.isEmpty()) {
265267
if (machineType == "-5200") {
268+
qDebug() << "[ROM LOAD] Loading 5200 OS ROM from:" << m_osRomPath;
266269
argList << "-5200_rom" << m_osRomPath;
267270
} else if (machineType == "-atari") {
271+
qDebug() << "[ROM LOAD] Loading 800 OS-B ROM from:" << m_osRomPath;
268272
argList << "-osb_rom" << m_osRomPath; // 800 OS-B ROM
269273
} else {
270274
// For XL/XE machines
275+
qDebug() << "[ROM LOAD] Loading XL/XE OS ROM from:" << m_osRomPath;
271276
argList << "-xlxe_rom" << m_osRomPath;
272277
}
273278
} else {
274-
qDebug() << "Warning: No OS ROM path specified, emulator may not start properly";
279+
qDebug() << "[ROM LOAD WARNING] No OS ROM path specified, falling back to Altirra OS";
280+
// Fallback to Altirra OS if no external ROM is specified
281+
qDebug() << "[ROM LOAD] Falling back to built-in Altirra OS ROM";
282+
if (machineType == "-5200") {
283+
argList << "-5200-rev" << "altirra";
284+
} else if (machineType == "-atari") {
285+
argList << "-800-rev" << "altirra";
286+
} else {
287+
argList << "-xl-rev" << "altirra";
288+
}
275289
}
276290
}
277291

278292
// Configure BASIC ROM (Altirra, External, or None)
279293
if (basicEnabled) {
280294
if (m_altirraBASICEnabled) {
281-
qDebug() << "Using built-in Altirra BASIC ROM";
295+
qDebug() << "[ROM LOAD] Using built-in Altirra BASIC ROM";
282296
argList << "-basic-rev" << "altirra";
283297
} else {
284-
qDebug() << "Using external BASIC ROM";
298+
qDebug() << "[ROM LOAD] Attempting to use external BASIC ROM";
285299
if (!m_basicRomPath.isEmpty()) {
300+
qDebug() << "[ROM LOAD] Loading BASIC ROM from:" << m_basicRomPath;
286301
argList << "-basic_rom" << m_basicRomPath;
287302
} else {
288-
qDebug() << "Warning: No BASIC ROM path specified";
303+
qDebug() << "[ROM LOAD WARNING] No BASIC ROM path specified, falling back to Altirra BASIC";
304+
argList << "-basic-rev" << "altirra";
289305
}
290306
}
291307
argList << "-basic"; // Actually enable BASIC mode
@@ -416,11 +432,11 @@ bool AtariEmulator::initializeWithInputConfig(bool basicEnabled, const QString&
416432

417433
// Configure OS ROM (Altirra or External)
418434
if (m_altirraOSEnabled) {
419-
qDebug() << "Using built-in Altirra OS ROM";
435+
qDebug() << "[ROM LOAD] Using built-in Altirra OS ROM";
420436
// Use built-in Altirra OS for all machine types
421437
argList << "-xl-rev" << "altirra";
422438
} else {
423-
qDebug() << "Using external OS ROM from user settings";
439+
qDebug() << "[ROM LOAD] Attempting to use external OS ROM from user settings";
424440
if (!m_osRomPath.isEmpty()) {
425441
// Use the correct parameter based on machine type
426442
if (machineType == "-5200") {
@@ -433,21 +449,32 @@ bool AtariEmulator::initializeWithInputConfig(bool basicEnabled, const QString&
433449
}
434450
qDebug() << "Adding OS ROM path:" << m_osRomPath;
435451
} else {
436-
qDebug() << "Warning: No OS ROM path specified, emulator may not start properly";
452+
qDebug() << "[ROM LOAD WARNING] No OS ROM path specified, falling back to Altirra OS";
453+
// Fallback to Altirra OS if no external ROM is specified
454+
qDebug() << "[ROM LOAD] Falling back to built-in Altirra OS ROM";
455+
if (machineType == "-5200") {
456+
argList << "-5200-rev" << "altirra";
457+
} else if (machineType == "-atari") {
458+
argList << "-800-rev" << "altirra";
459+
} else {
460+
argList << "-xl-rev" << "altirra";
461+
}
437462
}
438463
}
439464

440465
// Configure BASIC ROM (Altirra, External, or None)
441466
if (basicEnabled) {
442467
if (m_altirraBASICEnabled) {
443-
qDebug() << "Using built-in Altirra BASIC ROM";
468+
qDebug() << "[ROM LOAD] Using built-in Altirra BASIC ROM";
444469
argList << "-basic-rev" << "altirra";
445470
} else {
446-
qDebug() << "Using external BASIC ROM";
471+
qDebug() << "[ROM LOAD] Attempting to use external BASIC ROM";
447472
if (!m_basicRomPath.isEmpty()) {
473+
qDebug() << "[ROM LOAD] Loading BASIC ROM from:" << m_basicRomPath;
448474
argList << "-basic_rom" << m_basicRomPath;
449475
} else {
450-
qDebug() << "Warning: No BASIC ROM path specified";
476+
qDebug() << "[ROM LOAD WARNING] No BASIC ROM path specified, falling back to Altirra BASIC";
477+
argList << "-basic-rev" << "altirra";
451478
}
452479
}
453480
argList << "-basic"; // Actually enable BASIC mode

src/settingsdialog.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2638,6 +2638,14 @@ void SettingsDialog::saveSettings()
26382638
m_originalSettings.printerEnabled = currentPrinterState;
26392639
} else {
26402640
// No NetSIO change - apply settings normally
2641+
qDebug() << "[SETTINGS] Applying settings without restart:";
2642+
qDebug() << "[SETTINGS] Machine type:" << machineType;
2643+
qDebug() << "[SETTINGS] Video system:" << videoSystem;
2644+
qDebug() << "[SETTINGS] Basic enabled:" << basicEnabled;
2645+
qDebug() << "[SETTINGS] Altirra OS:" << altirraOSEnabled;
2646+
qDebug() << "[SETTINGS] Altirra BASIC:" << altirraBASICEnabled;
2647+
qDebug() << "[SETTINGS] NOTE: Only setting flags - emulator NOT reinitialized!";
2648+
26412649
m_emulator->setMachineType(machineType);
26422650
m_emulator->setVideoSystem(videoSystem);
26432651
m_emulator->setBasicEnabled(basicEnabled);
@@ -2735,13 +2743,33 @@ void SettingsDialog::applySettings()
27352743
// Check which settings require emulator restart vs live updates
27362744
bool needsRestart = false;
27372745

2746+
qDebug() << "[SETTINGS CHECK] Checking for changes that require restart:";
2747+
qDebug() << "[SETTINGS CHECK] Machine: current=" << m_emulator->getMachineType()
2748+
<< " new=" << m_machineTypeCombo->currentData().toString()
2749+
<< " changed=" << (m_machineTypeCombo->currentData().toString() != m_emulator->getMachineType());
2750+
qDebug() << "[SETTINGS CHECK] Video: current=" << m_emulator->getVideoSystem()
2751+
<< " new=" << m_videoSystemCombo->currentData().toString()
2752+
<< " changed=" << (m_videoSystemCombo->currentData().toString() != m_emulator->getVideoSystem());
2753+
qDebug() << "[SETTINGS CHECK] BASIC: current=" << m_emulator->isBasicEnabled()
2754+
<< " new=" << m_basicEnabledCheck->isChecked()
2755+
<< " changed=" << (m_basicEnabledCheck->isChecked() != m_emulator->isBasicEnabled());
2756+
qDebug() << "[SETTINGS CHECK] Altirra OS: current=" << m_emulator->isAltirraOSEnabled()
2757+
<< " new=" << m_altirraOSCheck->isChecked()
2758+
<< " changed=" << (m_altirraOSCheck->isChecked() != m_emulator->isAltirraOSEnabled());
2759+
qDebug() << "[SETTINGS CHECK] Altirra BASIC: current=" << m_emulator->isAltirraBASICEnabled()
2760+
<< " new=" << m_altirraBASICCheck->isChecked()
2761+
<< " changed=" << (m_altirraBASICCheck->isChecked() != m_emulator->isAltirraBASICEnabled());
2762+
27382763
// Check for changes that require emulator restart
27392764
if (m_machineTypeCombo->currentData().toString() != m_emulator->getMachineType() ||
27402765
m_videoSystemCombo->currentData().toString() != m_emulator->getVideoSystem() ||
27412766
m_basicEnabledCheck->isChecked() != m_emulator->isBasicEnabled() ||
27422767
m_altirraOSCheck->isChecked() != m_emulator->isAltirraOSEnabled() ||
27432768
m_altirraBASICCheck->isChecked() != m_emulator->isAltirraBASICEnabled()) {
27442769
needsRestart = true;
2770+
qDebug() << "[SETTINGS CHECK] RESTART REQUIRED";
2771+
} else {
2772+
qDebug() << "[SETTINGS CHECK] No restart needed";
27452773
}
27462774

27472775
// Apply joystick settings immediately (no restart needed)

0 commit comments

Comments
 (0)