Skip to content

Commit 4d4f337

Browse files
committed
Fix speed settings initialization and add config file documentation
- Fix speed toggle not reading saved turboMode setting from QSettings - Speed toggle now properly reflects saved state instead of defaulting to false - Ensures correct defaults: 1x speed with turbo mode unchecked - Improve Windows/Linux audio stability with larger buffers - Add Configuration Files section to README documenting storage locations for all platforms (macOS, Windows, Linux)
1 parent 0030a32 commit 4d4f337

File tree

3 files changed

+56
-9
lines changed

3 files changed

+56
-9
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,50 @@ fujisan.exe
394394
### Known Limitations
395395
- **Printer Support**: P: device (printer) functionality is currently disabled due to Error 138 (Device Timeout) issues in the atari800 core. Commands like `LPRINT` and `LIST "P:"` will not work. This limitation also affects the official atari800 emulator and is not specific to Fujisan.
396396

397+
## Configuration Files
398+
399+
Fujisan stores its configuration in platform-specific locations following standard OS conventions.
400+
401+
### Main Settings
402+
403+
Application settings (speed, audio, video, etc.) are stored using Qt's native settings format:
404+
405+
**macOS:**
406+
```
407+
~/Library/Preferences/com.8bitrelics.Fujisan.plist
408+
```
409+
410+
**Windows:**
411+
```
412+
Registry: HKEY_CURRENT_USER\Software\8bitrelics\Fujisan
413+
```
414+
415+
**Linux:**
416+
```
417+
~/.config/8bitrelics/Fujisan.conf
418+
```
419+
420+
### Configuration Profiles
421+
422+
Machine configuration profiles (complete emulator setups) are stored as JSON files:
423+
424+
**macOS:**
425+
```
426+
~/Library/Application Support/Fujisan/profiles/*.profile
427+
```
428+
429+
**Windows:**
430+
```
431+
C:\Users\<username>\AppData\Roaming\Fujisan\profiles\*.profile
432+
```
433+
434+
**Linux:**
435+
```
436+
~/.local/share/Fujisan/profiles/*.profile
437+
```
438+
439+
Profiles contain complete machine configurations including hardware settings, memory configuration, peripherals, and media paths. They can be managed through the Settings dialog's profile system.
440+
397441
## TCP Server API
398442

399443
Fujisan includes a powerful TCP server for remote control and automation. This enables IDE integration, automated testing, and programmatic control of all emulator features.

src/atariemulator.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,9 @@ void AtariEmulator::processFrame()
953953
gap += m_dspBufferBytes;
954954
}
955955

956-
// Conditional speed adjustment - disabled for Windows due to Qt audio issues
957-
#ifndef _WIN32
956+
// Conditional speed adjustment - disabled for Windows/Linux due to Qt audio issues
957+
// Speed micro-adjustments can cause timing variations during typing/UI operations
958+
#if 0 // Disabled for all platforms - provides more stable audio
958959
updateEmulationSpeed();
959960
#endif
960961

@@ -1760,7 +1761,7 @@ void AtariEmulator::setupAudio()
17601761
#if defined(_WIN32) || defined(__linux__)
17611762
// Windows/Linux: Use larger fragments for stability with dynamic frame timing
17621763
m_fragmentSize = 1024; // Larger fragments for better Qt audio stability (~23ms at 44100Hz)
1763-
int targetDelayMs = 30; // Slight headroom for UI operations (drag/resize/typing)
1764+
int targetDelayMs = 50; // Extra headroom for UI operations and typing resilience
17641765
#else
17651766
// macOS: Smaller buffers work fine here
17661767
m_fragmentSize = 512; // Smaller fragments for more responsive audio
@@ -1775,7 +1776,7 @@ void AtariEmulator::setupAudio()
17751776
m_targetDelay = (m_sampleRate * targetDelayMs) / 1000; // Convert to samples
17761777
// Use a larger buffer to handle the accumulation
17771778
#if defined(_WIN32) || defined(__linux__)
1778-
int dspBufferSamples = m_fragmentSize * 20; // Large buffer for Windows/Linux to handle frame timing variations
1779+
int dspBufferSamples = m_fragmentSize * 25; // Extra-large buffer for maximum stability during typing/UI ops
17791780
#else
17801781
int dspBufferSamples = m_fragmentSize * 10; // Standard buffer for macOS
17811782
#endif
@@ -1818,11 +1819,11 @@ void AtariEmulator::setupAudio()
18181819
m_audioOutput->setNotifyInterval(notifyMs);
18191820

18201821
// Set category for optimal performance
1821-
#ifdef _WIN32
1822-
// Windows: Use music category for higher latency/buffering
1822+
#if defined(_WIN32) || defined(__linux__)
1823+
// Windows/Linux: Use music category for higher latency/buffering and stability
18231824
m_audioOutput->setCategory("music");
18241825
#else
1825-
// macOS/Linux: Use game category for lower latency
1826+
// macOS: Use game category for lower latency (works fine with smaller buffers)
18261827
m_audioOutput->setCategory("game");
18271828
#endif
18281829

src/mainwindow.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,9 +1089,11 @@ void MainWindow::updateToolbarFromSettings()
10891089
m_videoToggle->blockSignals(false);
10901090

10911091

1092-
// Update speed toggle (default to normal speed)
1092+
// Update speed toggle from settings
1093+
QSettings speedSettings("8bitrelics", "Fujisan");
1094+
bool turboMode = speedSettings.value("machine/turboMode", false).toBool();
10931095
m_speedToggle->blockSignals(true);
1094-
m_speedToggle->setChecked(false); // Default to normal speed (100%)
1096+
m_speedToggle->setChecked(turboMode);
10951097
m_speedToggle->blockSignals(false);
10961098

10971099
// Update menu actions

0 commit comments

Comments
 (0)