emoemu 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +77 -0
- package/.node-version +1 -0
- package/CLAUDE.md +435 -0
- package/README.md +404 -0
- package/TODO.md +655 -0
- package/dist/index.cjs +25108 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25085 -0
- package/docs/building-libretro-cores-arm-mac.md +237 -0
- package/docs/config-file-format.md +488 -0
- package/docs/cores-trd.md +425 -0
- package/docs/headless-hardware-rendering-trd.md +676 -0
- package/docs/libretro-cores-trd.md +997 -0
- package/docs/mupen64-software-rendering-trd.md +751 -0
- package/docs/n64-support-trd.md +306 -0
- package/docs/native-rendering-trd.md +540 -0
- package/docs/native-ui-rendering-trd.md +1195 -0
- package/docs/netplay-trd.md +665 -0
- package/docs/retroarch-netplay-docs.md +277 -0
- package/docs/save-state-format.md +666 -0
- package/eslint.config.js +111 -0
- package/icon/icon.png +0 -0
- package/icon/icon.pxd +0 -0
- package/package.json +63 -0
- package/pnpm-workspace.yaml +10 -0
- package/src/Emulator/consts.ts +14 -0
- package/src/Emulator/index.ts +2496 -0
- package/src/Emulator/saveState/index.ts +155 -0
- package/src/Emulator/screenshot/index.ts +160 -0
- package/src/Emulator/terminalDimensions/index.ts +79 -0
- package/src/Emulator/types.ts +83 -0
- package/src/cli/commands/consts.ts +10 -0
- package/src/cli/commands/index.ts +462 -0
- package/src/cli/parseArgs/consts.ts +17 -0
- package/src/cli/parseArgs/index.ts +457 -0
- package/src/cli/parseArgs/types.ts +61 -0
- package/src/cli/runEmulator/index.ts +406 -0
- package/src/cli/runEmulator/types.ts +7 -0
- package/src/consts.ts +19 -0
- package/src/core/button/consts.ts +35 -0
- package/src/core/button/index.ts +123 -0
- package/src/core/core.ts +300 -0
- package/src/core/index.ts +19 -0
- package/src/cores/libretro/api/index.ts +334 -0
- package/src/cores/libretro/api/types.ts +148 -0
- package/src/cores/libretro/callbacks/consts.ts +41 -0
- package/src/cores/libretro/callbacks/index.ts +456 -0
- package/src/cores/libretro/consts.ts +45 -0
- package/src/cores/libretro/coreOptions/consts.ts +36 -0
- package/src/cores/libretro/coreOptions/index.ts +222 -0
- package/src/cores/libretro/environment/consts.ts +118 -0
- package/src/cores/libretro/environment/index.ts +1095 -0
- package/src/cores/libretro/index.ts +937 -0
- package/src/cores/libretro/loader/index.ts +496 -0
- package/src/cores/libretro/pixelFormat/consts.ts +43 -0
- package/src/cores/libretro/pixelFormat/index.ts +397 -0
- package/src/cores/libretro/types.ts +339 -0
- package/src/frontend/AudioManager/index.ts +420 -0
- package/src/frontend/SettingsManager/index.ts +250 -0
- package/src/frontend/config/index.ts +608 -0
- package/src/frontend/config/tests.ts +354 -0
- package/src/frontend/config/types.ts +36 -0
- package/src/frontend/consts.ts +114 -0
- package/src/frontend/coreBuilder/index.ts +644 -0
- package/src/frontend/coreBuilder/types.ts +15 -0
- package/src/frontend/coreDownloader/index.ts +620 -0
- package/src/frontend/coreDownloader/types.ts +17 -0
- package/src/frontend/corePreferences/index.ts +69 -0
- package/src/frontend/coreRegistry/index.ts +276 -0
- package/src/frontend/directoryCache/index.ts +75 -0
- package/src/frontend/index.ts +79 -0
- package/src/frontend/notifications/consts.ts +14 -0
- package/src/frontend/notifications/index.ts +250 -0
- package/src/frontend/playlist/consts.ts +168 -0
- package/src/frontend/playlist/index.ts +899 -0
- package/src/frontend/playlist/labelFormatter/consts.ts +15 -0
- package/src/frontend/playlist/labelFormatter/index.ts +155 -0
- package/src/frontend/playlist/labelFormatter/tests.ts +153 -0
- package/src/frontend/playlist/reader/index.ts +559 -0
- package/src/frontend/playlist/sync/index.ts +511 -0
- package/src/frontend/playlist/systemLookup/index.ts +233 -0
- package/src/frontend/playlist/utils/index.ts +50 -0
- package/src/frontend/romScanner/consts.ts +348 -0
- package/src/frontend/romScanner/index.ts +1957 -0
- package/src/frontend/saveServices/consts.ts +2 -0
- package/src/frontend/saveServices/index.ts +313 -0
- package/src/frontend/serviceProvider/index.ts +108 -0
- package/src/frontend/serviceProvider/types.ts +13 -0
- package/src/index.ts +428 -0
- package/src/input/Controller/consts.ts +50 -0
- package/src/input/Controller/index.ts +81 -0
- package/src/input/GamepadManager/consts.ts +22 -0
- package/src/input/GamepadManager/index.ts +418 -0
- package/src/input/InputManager/consts.ts +86 -0
- package/src/input/InputManager/index.ts +593 -0
- package/src/input/InputMapper/consts.ts +33 -0
- package/src/input/InputMapper/index.ts +436 -0
- package/src/input/consts.ts +410 -0
- package/src/input/gamepadProfiles/index.ts +1100 -0
- package/src/input/index.ts +38 -0
- package/src/input/inputUtils/index.ts +31 -0
- package/src/netplay/FrameBuffer/consts.ts +2 -0
- package/src/netplay/FrameBuffer/index.ts +364 -0
- package/src/netplay/FrameBuffer/tests.ts +286 -0
- package/src/netplay/InputBuffer/consts.ts +7 -0
- package/src/netplay/InputBuffer/index.ts +347 -0
- package/src/netplay/InputBuffer/tests.ts +166 -0
- package/src/netplay/NetplayClient/index.ts +976 -0
- package/src/netplay/NetplayConnection/index.ts +536 -0
- package/src/netplay/NetplayDiscovery/consts.ts +41 -0
- package/src/netplay/NetplayDiscovery/index.ts +525 -0
- package/src/netplay/NetplayServer/index.ts +1407 -0
- package/src/netplay/SyncManager/index.ts +984 -0
- package/src/netplay/SyncManager/tests.ts +419 -0
- package/src/netplay/consts.ts +371 -0
- package/src/netplay/crc32/consts.ts +14 -0
- package/src/netplay/crc32/index.ts +97 -0
- package/src/netplay/crc32/tests.ts +40 -0
- package/src/netplay/index.ts +41 -0
- package/src/netplay/netplayLogger/consts.ts +30 -0
- package/src/netplay/netplayLogger/index.ts +345 -0
- package/src/netplay/protocol/consts.ts +86 -0
- package/src/netplay/protocol/index.ts +1280 -0
- package/src/netplay/protocol/tests.ts +606 -0
- package/src/netplay/protocol/types.ts +20 -0
- package/src/netplay/types.ts +395 -0
- package/src/rendering/KittyRenderer/index.ts +616 -0
- package/src/rendering/NativeRenderer/index.ts +279 -0
- package/src/rendering/NativeRenderer/tests.ts +133 -0
- package/src/rendering/TerminalRenderer/index.ts +770 -0
- package/src/rendering/consts.ts +401 -0
- package/src/rendering/fonts/CozetteVector.ttf +0 -0
- package/src/rendering/index.ts +26 -0
- package/src/rendering/nativeUi/NativeWindowManager/index.ts +158 -0
- package/src/rendering/nativeUi/NativeWindowManager/tests.ts +81 -0
- package/src/rendering/nativeUi/consts.ts +6 -0
- package/src/rendering/nativeUi/index.ts +20 -0
- package/src/rendering/postProcessing/consts.ts +38 -0
- package/src/rendering/postProcessing/index.ts +923 -0
- package/src/rendering/shared/ansi/consts.ts +12 -0
- package/src/rendering/shared/ansi/index.ts +104 -0
- package/src/rendering/shared/consts.ts +2 -0
- package/src/rendering/shared/fitToTerminal/index.ts +67 -0
- package/src/ui/AddRomsPrompt/consts.ts +13 -0
- package/src/ui/AddRomsPrompt/index.tsx +781 -0
- package/src/ui/App/consts.ts +2 -0
- package/src/ui/App/index.tsx +456 -0
- package/src/ui/AppCapabilities/index.tsx +67 -0
- package/src/ui/ConfigContext/index.tsx +56 -0
- package/src/ui/CoreManager/consts.ts +11 -0
- package/src/ui/CoreManager/index.tsx +779 -0
- package/src/ui/CoreSelector/consts.ts +2 -0
- package/src/ui/CoreSelector/index.tsx +251 -0
- package/src/ui/DialogContainer/index.tsx +42 -0
- package/src/ui/DialogOptionsList/index.tsx +61 -0
- package/src/ui/DuplicateCrcPrompt/consts.ts +5 -0
- package/src/ui/DuplicateCrcPrompt/index.tsx +146 -0
- package/src/ui/GamepadContext/consts.ts +15 -0
- package/src/ui/GamepadContext/index.tsx +295 -0
- package/src/ui/NativeDialog/index.tsx +120 -0
- package/src/ui/NetplayDisconnectedDialog/index.tsx +93 -0
- package/src/ui/NetplayPauseMenu/consts.ts +2 -0
- package/src/ui/NetplayPauseMenu/index.tsx +97 -0
- package/src/ui/RomBrowser/NetplayPanel/consts.ts +24 -0
- package/src/ui/RomBrowser/NetplayPanel/index.tsx +520 -0
- package/src/ui/RomBrowser/SettingsPanel/index.tsx +478 -0
- package/src/ui/RomBrowser/consts.ts +61 -0
- package/src/ui/RomBrowser/index.tsx +1164 -0
- package/src/ui/RomBrowser/settingsConfig/index.ts +320 -0
- package/src/ui/RomBrowser/types.ts +67 -0
- package/src/ui/SaveStateDialog/consts.ts +2 -0
- package/src/ui/SaveStateDialog/index.tsx +225 -0
- package/src/ui/WarningDialog/index.tsx +113 -0
- package/src/ui/consts.ts +27 -0
- package/src/ui/hooks/useClearTerminal/consts.ts +2 -0
- package/src/ui/hooks/useClearTerminal/index.ts +37 -0
- package/src/ui/hooks/useDialogNavigation/index.ts +99 -0
- package/src/ui/hooks/useGamepad/consts.ts +21 -0
- package/src/ui/hooks/useGamepad/index.ts +194 -0
- package/src/ui/index.ts +27 -0
- package/src/utils/buffer/consts.ts +17 -0
- package/src/utils/buffer/index.ts +129 -0
- package/src/utils/color/consts.ts +58 -0
- package/src/utils/color/index.ts +183 -0
- package/src/utils/compression/consts.ts +50 -0
- package/src/utils/compression/index.ts +101 -0
- package/src/utils/consts.ts +2 -0
- package/src/utils/crc32/consts.ts +22 -0
- package/src/utils/crc32/index.ts +83 -0
- package/src/utils/ensureDirectory/index.ts +10 -0
- package/src/utils/format/consts.ts +8 -0
- package/src/utils/format/index.ts +53 -0
- package/src/utils/getErrorMessage/index.ts +10 -0
- package/src/utils/index.ts +113 -0
- package/src/utils/ini/index.ts +200 -0
- package/src/utils/kitty/consts.ts +13 -0
- package/src/utils/kitty/index.ts +181 -0
- package/src/utils/logger/consts.ts +35 -0
- package/src/utils/logger/index.ts +217 -0
- package/src/utils/paths/consts.ts +18 -0
- package/src/utils/paths/index.ts +151 -0
- package/src/utils/png/consts.ts +34 -0
- package/src/utils/png/index.ts +131 -0
- package/src/utils/readJsonFile/index.ts +16 -0
- package/src/utils/rotateLogFile/index.ts +44 -0
- package/src/utils/safeClose/index.ts +10 -0
- package/src/utils/terminal/consts.ts +8 -0
- package/src/utils/terminal/index.ts +102 -0
- package/src/utils/thumbnailRenderer/consts.ts +2 -0
- package/src/utils/thumbnailRenderer/index.ts +147 -0
- package/src/utils/typedError/index.ts +26 -0
- package/tsconfig.json +31 -0
- package/vitest.config.ts +13 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
# Configuration File Format (.cfg)
|
|
2
|
+
|
|
3
|
+
emoemu uses a configuration file to persist user settings across sessions. The format is designed to be compatible with RetroArch's config file format where applicable, making it familiar to users of that ecosystem.
|
|
4
|
+
|
|
5
|
+
## File Location
|
|
6
|
+
|
|
7
|
+
The config file is stored in platform-specific standard locations:
|
|
8
|
+
|
|
9
|
+
| Platform | Path |
|
|
10
|
+
|----------|------|
|
|
11
|
+
| **macOS** | `~/Library/Application Support/emoemu/emoemu.cfg` |
|
|
12
|
+
| **Linux** | `~/.config/emoemu/emoemu.cfg` |
|
|
13
|
+
| **Windows** | `%APPDATA%\emoemu\emoemu.cfg` |
|
|
14
|
+
|
|
15
|
+
The config file is created automatically on first run with default values. If the file does not exist, built-in defaults are used.
|
|
16
|
+
|
|
17
|
+
### Alternative Config Paths
|
|
18
|
+
|
|
19
|
+
emoemu also checks these locations (in order of precedence):
|
|
20
|
+
|
|
21
|
+
1. `--config <path>` CLI flag (highest priority)
|
|
22
|
+
2. `EMOEMU_CONFIG` environment variable
|
|
23
|
+
3. `./emoemu.cfg` (current working directory)
|
|
24
|
+
4. Platform-specific path (listed above)
|
|
25
|
+
|
|
26
|
+
## File Format
|
|
27
|
+
|
|
28
|
+
The config file uses a simple INI-style format compatible with RetroArch:
|
|
29
|
+
|
|
30
|
+
```ini
|
|
31
|
+
# Comment lines start with #
|
|
32
|
+
key = "value"
|
|
33
|
+
key = value
|
|
34
|
+
key = true
|
|
35
|
+
key = 1.5
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Format Rules
|
|
39
|
+
|
|
40
|
+
- **Comments**: Lines starting with `#` are ignored
|
|
41
|
+
- **Empty lines**: Ignored
|
|
42
|
+
- **Keys**: Lowercase with underscores (e.g., `video_scale`)
|
|
43
|
+
- **Values**: Can be quoted (`"value"`) or unquoted (`value`)
|
|
44
|
+
- **Booleans**: `true` or `false` (unquoted)
|
|
45
|
+
- **Numbers**: Integer or floating-point (unquoted)
|
|
46
|
+
- **Strings**: Should be quoted if they contain spaces
|
|
47
|
+
|
|
48
|
+
### Example Config
|
|
49
|
+
|
|
50
|
+
```ini
|
|
51
|
+
# emoemu Configuration
|
|
52
|
+
# Generated by emoemu
|
|
53
|
+
|
|
54
|
+
# Video settings
|
|
55
|
+
video_driver = "kitty"
|
|
56
|
+
video_scale = 2
|
|
57
|
+
video_smooth = false
|
|
58
|
+
|
|
59
|
+
# Post-processing mode: off, crt, or custom
|
|
60
|
+
video_postprocessing_mode = "crt"
|
|
61
|
+
|
|
62
|
+
# CRT preset values (used when mode is "crt")
|
|
63
|
+
crt_gamma = 1.3
|
|
64
|
+
crt_scanlines = 0.1
|
|
65
|
+
crt_vignette = 0.5
|
|
66
|
+
|
|
67
|
+
# Custom effect values (used when mode is "custom")
|
|
68
|
+
video_gamma = 1.2
|
|
69
|
+
video_scanlines = 0.3
|
|
70
|
+
|
|
71
|
+
# Audio settings
|
|
72
|
+
audio_enable = true
|
|
73
|
+
|
|
74
|
+
# Input settings
|
|
75
|
+
input_joypad_enable = true
|
|
76
|
+
|
|
77
|
+
# Save data settings
|
|
78
|
+
savestate_auto_load = true
|
|
79
|
+
savestate_auto_save = true
|
|
80
|
+
savestate_compression = true
|
|
81
|
+
battery_save_enable = true
|
|
82
|
+
|
|
83
|
+
# Emulation settings
|
|
84
|
+
fps_show_enable = false
|
|
85
|
+
fps_limit = 0
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Configuration Keys
|
|
91
|
+
|
|
92
|
+
### Video Settings
|
|
93
|
+
|
|
94
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
95
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
96
|
+
| `video_driver` | string | `"kitty"` | `--kitty`, `--terminal`, `--ascii`, `--emoji` | Yes | Rendering mode |
|
|
97
|
+
| `video_scale` | integer | `2` | `--scale` | Yes | Internal render scale for Kitty mode |
|
|
98
|
+
| `video_smooth` | boolean | `false` | - | Yes | Enable bilinear filtering (reserved) |
|
|
99
|
+
| `video_fullscreen` | boolean | `false` | - | Yes | Full terminal mode (reserved) |
|
|
100
|
+
| `custom_viewport_width` | integer | auto | `--width` | Yes | Display width in characters |
|
|
101
|
+
| `custom_viewport_height` | integer | auto | `--height` | Yes | Display height in characters |
|
|
102
|
+
| `video_color_enable` | boolean | `true` | `--no-color` | No | Enable color output |
|
|
103
|
+
| `video_diff_render` | boolean | `true` | `--no-diff-render` | No | Enable diff-based rendering optimization |
|
|
104
|
+
|
|
105
|
+
#### Video Driver Values
|
|
106
|
+
|
|
107
|
+
| Value | Description |
|
|
108
|
+
|-------|-------------|
|
|
109
|
+
| `"kitty"` | Kitty graphics protocol (best quality) |
|
|
110
|
+
| `"terminal"` | Unicode half-block characters |
|
|
111
|
+
| `"ascii"` | ASCII character rendering |
|
|
112
|
+
| `"emoji"` | Emoji character rendering |
|
|
113
|
+
|
|
114
|
+
### Post-Processing Settings
|
|
115
|
+
|
|
116
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
117
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
118
|
+
| `video_postprocessing_mode` | string | `"off"` | `--crt` | No | Post-processing mode: `"off"`, `"crt"`, or `"custom"` |
|
|
119
|
+
|
|
120
|
+
#### Post-Processing Mode Values
|
|
121
|
+
|
|
122
|
+
| Value | Description |
|
|
123
|
+
|-------|-------------|
|
|
124
|
+
| `"off"` | No post-processing effects applied |
|
|
125
|
+
| `"crt"` | CRT preset (uses crt_* config values) |
|
|
126
|
+
| `"custom"` | Custom effects (uses video_* config values below) |
|
|
127
|
+
|
|
128
|
+
### CRT Preset Values
|
|
129
|
+
|
|
130
|
+
These values are used when `video_postprocessing_mode = "crt"`:
|
|
131
|
+
|
|
132
|
+
| Key | Type | Default | Description |
|
|
133
|
+
|-----|------|---------|-------------|
|
|
134
|
+
| `crt_gamma` | float | `1.3` | CRT gamma correction |
|
|
135
|
+
| `crt_scanlines` | float | `0.1` | CRT scanline intensity |
|
|
136
|
+
| `crt_saturation` | float | `1.0` | CRT color saturation |
|
|
137
|
+
| `crt_vignette` | float | `0.5` | CRT vignette darkening |
|
|
138
|
+
| `crt_ntsc` | float | `1.0` | CRT NTSC color bleeding |
|
|
139
|
+
| `crt_curvature` | float | `0.1` | CRT screen curvature |
|
|
140
|
+
|
|
141
|
+
### Custom Effect Values
|
|
142
|
+
|
|
143
|
+
These values are used when `video_postprocessing_mode = "custom"`:
|
|
144
|
+
|
|
145
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
146
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
147
|
+
| `video_shader_enable` | boolean | `false` | - | Yes | Master enable for post-processing |
|
|
148
|
+
| `video_gamma` | float | `1.0` | `--gamma` | No | Gamma correction (1.1-1.4 for CRT-like) |
|
|
149
|
+
| `video_scanlines` | float | `0` | `--scanlines` | No | Scanline intensity (0.0-1.0) |
|
|
150
|
+
| `video_saturation` | float | `1.0` | `--saturation` | No | Color saturation multiplier |
|
|
151
|
+
| `video_brightness` | float | `1.0` | `--brightness` | No | Brightness multiplier |
|
|
152
|
+
| `video_contrast` | float | `1.0` | `--contrast` | No | Contrast adjustment |
|
|
153
|
+
| `video_vignette` | float | `0` | `--vignette` | No | Vignette edge darkening (0.3-0.5 for CRT) |
|
|
154
|
+
| `video_bloom` | float | `0` | `--bloom` | No | Phosphor bloom/glow (Kitty only) |
|
|
155
|
+
| `video_bloom_threshold` | float | `0.6` | `--bloom-threshold` | No | Brightness threshold for bloom |
|
|
156
|
+
| `video_ntsc` | float | `0` | `--ntsc` | No | NTSC color artifacts (Kitty only) |
|
|
157
|
+
| `video_curvature` | float | `0` | `--curvature` | No | CRT screen curvature (Kitty only) |
|
|
158
|
+
|
|
159
|
+
### Kitty-Specific Settings
|
|
160
|
+
|
|
161
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
162
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
163
|
+
| `kitty_png_level` | integer | `4` | `--png-level` | No | PNG compression level (1-9) |
|
|
164
|
+
|
|
165
|
+
### Audio Settings
|
|
166
|
+
|
|
167
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
168
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
169
|
+
| `audio_enable` | boolean | `true` | `--no-audio` | Yes | Enable audio output |
|
|
170
|
+
| `audio_volume` | float | `1.0` | - | Yes | Master volume (0.0-1.0) |
|
|
171
|
+
| `audio_mute_enable_enable` | boolean | `false` | - | Yes | Mute audio |
|
|
172
|
+
|
|
173
|
+
### Input Settings
|
|
174
|
+
|
|
175
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
176
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
177
|
+
| `input_joypad_enable` | boolean | `true` | `--no-gamepad` | Yes | Enable gamepad support |
|
|
178
|
+
| `input_autodetect_enable` | boolean | `true` | - | Yes | Auto-detect gamepads |
|
|
179
|
+
|
|
180
|
+
### Save Data Settings
|
|
181
|
+
|
|
182
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
183
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
184
|
+
| `savestate_auto_load` | boolean | `true` | `--no-save-state` | Yes | Auto-load save states |
|
|
185
|
+
| `savestate_auto_save` | boolean | `true` | `--no-save-state` | Yes | Auto-save states on exit |
|
|
186
|
+
| `savestate_compression` | boolean | `true` | `--no-gzip-state` | Yes | Gzip compress save states |
|
|
187
|
+
| `savestate_directory` | string | `""` | - | Yes | Directory for save states (empty=default) |
|
|
188
|
+
| `savefile_directory` | string | `""` | - | Yes | Directory for battery saves (empty=default) |
|
|
189
|
+
| `battery_save_enable` | boolean | `true` | `--no-battery-save` | No | Enable battery save (.srm) files |
|
|
190
|
+
|
|
191
|
+
### Directory Settings
|
|
192
|
+
|
|
193
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
194
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
195
|
+
| `system_directory` | string | `""` | - | Yes | Directory for BIOS files (empty=./system) |
|
|
196
|
+
| `screenshot_directory` | string | `""` | - | Yes | Directory for screenshots (empty=default) |
|
|
197
|
+
|
|
198
|
+
### Emulation Settings
|
|
199
|
+
|
|
200
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
201
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
202
|
+
| `fps_show_enable_enable` | boolean | `false` | `--status` | Yes | Show status bar with FPS |
|
|
203
|
+
| `fps_limit` | integer | `0` | `--fps-limit` | No | FPS limit (0=core native) |
|
|
204
|
+
|
|
205
|
+
### Core Settings
|
|
206
|
+
|
|
207
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
208
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
209
|
+
| `core_default` | string | `""` | `--core` | No | Default core ID to use |
|
|
210
|
+
| `libretro_directory` | string | `""` | - | Yes | Path to libretro cores |
|
|
211
|
+
| `retroarch_cores_enable` | boolean | `false` | `--retroarch` | No | Load cores from RetroArch paths |
|
|
212
|
+
|
|
213
|
+
#### Cores Directory
|
|
214
|
+
|
|
215
|
+
emoemu searches for libretro cores in platform-specific directories that follow the same convention as RetroArch:
|
|
216
|
+
|
|
217
|
+
| Platform | Default Cores Directory |
|
|
218
|
+
|----------|------------------------|
|
|
219
|
+
| **macOS** | `~/Library/Application Support/emoemu/cores/` |
|
|
220
|
+
| **Linux** | `~/.config/emoemu/cores/` |
|
|
221
|
+
| **Windows** | `%APPDATA%\emoemu\cores\` |
|
|
222
|
+
|
|
223
|
+
To use a custom cores directory, set `libretro_directory` in your config:
|
|
224
|
+
|
|
225
|
+
```ini
|
|
226
|
+
# Custom cores directory (RetroArch-compatible key)
|
|
227
|
+
libretro_directory = "/path/to/my/cores"
|
|
228
|
+
|
|
229
|
+
# Or use ~ for home directory
|
|
230
|
+
libretro_directory = "~/my-cores"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Search order for cores:
|
|
234
|
+
1. Custom path from `libretro_directory` (if set)
|
|
235
|
+
2. `./cores/` (current directory, for development)
|
|
236
|
+
3. Platform-specific emoemu cores directory (see table above)
|
|
237
|
+
4. System library paths (`/usr/lib/libretro/`, etc.)
|
|
238
|
+
5. RetroArch directories (only if `--retroarch` flag is used)
|
|
239
|
+
|
|
240
|
+
### NES-Specific Settings
|
|
241
|
+
|
|
242
|
+
| Key | Type | Default | CLI Flag | RetroArch Compatible | Description |
|
|
243
|
+
|-----|------|---------|----------|---------------------|-------------|
|
|
244
|
+
| `nes_sprite_limit` | boolean | `false` | `--sprite-limit` | No | Enable 8-sprite-per-scanline limit |
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Post-Processing Modes
|
|
249
|
+
|
|
250
|
+
emoemu supports three post-processing modes, configurable via `video_postprocessing_mode` or the P key during gameplay:
|
|
251
|
+
|
|
252
|
+
### Off Mode
|
|
253
|
+
No effects applied. Clean pixel output.
|
|
254
|
+
|
|
255
|
+
### CRT Mode
|
|
256
|
+
Uses the CRT preset values for an authentic retro look:
|
|
257
|
+
|
|
258
|
+
```ini
|
|
259
|
+
video_postprocessing_mode = "crt"
|
|
260
|
+
|
|
261
|
+
# CRT preset values (customizable)
|
|
262
|
+
crt_gamma = 1.3
|
|
263
|
+
crt_scanlines = 0.1
|
|
264
|
+
crt_saturation = 1.0
|
|
265
|
+
crt_vignette = 0.5
|
|
266
|
+
crt_ntsc = 1.0
|
|
267
|
+
crt_curvature = 0.1
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
The `--crt` CLI flag sets `video_postprocessing_mode = "crt"`.
|
|
271
|
+
|
|
272
|
+
### Custom Mode
|
|
273
|
+
Uses the user-defined `video_*` effect values:
|
|
274
|
+
|
|
275
|
+
```ini
|
|
276
|
+
video_postprocessing_mode = "custom"
|
|
277
|
+
|
|
278
|
+
# Custom effect values
|
|
279
|
+
video_gamma = 1.2
|
|
280
|
+
video_scanlines = 0.3
|
|
281
|
+
video_saturation = 1.1
|
|
282
|
+
video_vignette = 0.4
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Custom effect values persist in config even when switching to Off or CRT mode, so you can return to your custom settings later.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Configuration Precedence
|
|
290
|
+
|
|
291
|
+
Settings are applied in this order (later overrides earlier):
|
|
292
|
+
|
|
293
|
+
1. **Built-in defaults** (lowest priority)
|
|
294
|
+
2. **Config file** (`emoemu.cfg`)
|
|
295
|
+
3. **CLI flags** (highest priority)
|
|
296
|
+
|
|
297
|
+
This means CLI flags always take precedence over config file settings.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## RetroArch Compatibility Notes
|
|
302
|
+
|
|
303
|
+
emoemu uses RetroArch-compatible key names where the functionality overlaps. This provides several benefits:
|
|
304
|
+
|
|
305
|
+
- Familiarity for RetroArch users
|
|
306
|
+
- Potential for shared config snippets
|
|
307
|
+
- Consistent naming conventions
|
|
308
|
+
|
|
309
|
+
### Fully Compatible Keys
|
|
310
|
+
|
|
311
|
+
These keys use the exact same names and value formats as RetroArch:
|
|
312
|
+
|
|
313
|
+
- `video_driver`
|
|
314
|
+
- `video_scale`
|
|
315
|
+
- `video_smooth`
|
|
316
|
+
- `video_fullscreen`
|
|
317
|
+
- `video_shader_enable`
|
|
318
|
+
- `custom_viewport_width`
|
|
319
|
+
- `custom_viewport_height`
|
|
320
|
+
- `audio_enable`
|
|
321
|
+
- `audio_volume`
|
|
322
|
+
- `audio_mute_enable`
|
|
323
|
+
- `input_joypad_enable`
|
|
324
|
+
- `input_autodetect_enable`
|
|
325
|
+
- `savestate_auto_load`
|
|
326
|
+
- `savestate_auto_save`
|
|
327
|
+
- `savestate_compression`
|
|
328
|
+
- `fps_show_enable`
|
|
329
|
+
- `libretro_directory`
|
|
330
|
+
|
|
331
|
+
### emoemu Specific Keys
|
|
332
|
+
|
|
333
|
+
These keys are unique to emoemu and not present in RetroArch:
|
|
334
|
+
|
|
335
|
+
- `video_color_enable`
|
|
336
|
+
- `video_diff_render`
|
|
337
|
+
- `video_gamma`, `video_scanlines`, `video_saturation`, etc. (post-processing)
|
|
338
|
+
- `kitty_*` settings
|
|
339
|
+
- `battery_save_enable`
|
|
340
|
+
- `fps_limit`
|
|
341
|
+
- `core_default`
|
|
342
|
+
- `retroarch_cores_enable`
|
|
343
|
+
- `nes_sprite_limit`
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Programmatic Access
|
|
348
|
+
|
|
349
|
+
### Reading Config
|
|
350
|
+
|
|
351
|
+
```typescript
|
|
352
|
+
import { loadConfig } from './config.js';
|
|
353
|
+
|
|
354
|
+
const config = loadConfig();
|
|
355
|
+
console.log(config.video_driver); // "kitty"
|
|
356
|
+
console.log(config.audio_enable); // true
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Writing Config
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
import { saveConfig, getConfigPath } from './config.js';
|
|
363
|
+
|
|
364
|
+
saveConfig({
|
|
365
|
+
video_driver: "terminal",
|
|
366
|
+
video_scale: 3,
|
|
367
|
+
audio_enable: false
|
|
368
|
+
});
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Config Interface
|
|
372
|
+
|
|
373
|
+
```typescript
|
|
374
|
+
interface Config {
|
|
375
|
+
// Video
|
|
376
|
+
video_driver: 'kitty' | 'terminal' | 'ascii' | 'emoji';
|
|
377
|
+
video_scale: number;
|
|
378
|
+
video_smooth: boolean;
|
|
379
|
+
video_fullscreen: boolean;
|
|
380
|
+
custom_viewport_width: number | null;
|
|
381
|
+
custom_viewport_height: number | null;
|
|
382
|
+
video_color_enable: boolean;
|
|
383
|
+
video_diff_render: boolean;
|
|
384
|
+
|
|
385
|
+
// Post-processing mode
|
|
386
|
+
video_postprocessing_mode: 'off' | 'crt' | 'custom';
|
|
387
|
+
|
|
388
|
+
// CRT preset values (used when mode is 'crt')
|
|
389
|
+
crt_gamma: number;
|
|
390
|
+
crt_scanlines: number;
|
|
391
|
+
crt_saturation: number;
|
|
392
|
+
crt_vignette: number;
|
|
393
|
+
crt_ntsc: number;
|
|
394
|
+
crt_curvature: number;
|
|
395
|
+
|
|
396
|
+
// Custom effect values (used when mode is 'custom')
|
|
397
|
+
video_shader_enable: boolean;
|
|
398
|
+
video_gamma: number;
|
|
399
|
+
video_scanlines: number;
|
|
400
|
+
video_saturation: number;
|
|
401
|
+
video_brightness: number;
|
|
402
|
+
video_contrast: number;
|
|
403
|
+
video_vignette: number;
|
|
404
|
+
video_bloom: number;
|
|
405
|
+
video_bloom_threshold: number;
|
|
406
|
+
video_ntsc: number;
|
|
407
|
+
video_curvature: number;
|
|
408
|
+
|
|
409
|
+
// Kitty
|
|
410
|
+
kitty_png_level: number;
|
|
411
|
+
|
|
412
|
+
// Audio
|
|
413
|
+
audio_enable: boolean;
|
|
414
|
+
audio_volume: number;
|
|
415
|
+
audio_mute_enable: boolean;
|
|
416
|
+
|
|
417
|
+
// Input
|
|
418
|
+
input_joypad_enable: boolean;
|
|
419
|
+
input_autodetect_enable: boolean;
|
|
420
|
+
|
|
421
|
+
// Save data
|
|
422
|
+
savestate_auto_load: boolean;
|
|
423
|
+
savestate_auto_save: boolean;
|
|
424
|
+
savestate_compression: boolean;
|
|
425
|
+
battery_save_enable: boolean;
|
|
426
|
+
|
|
427
|
+
// Emulation
|
|
428
|
+
fps_show_enable: boolean;
|
|
429
|
+
fps_limit: number;
|
|
430
|
+
|
|
431
|
+
// Core
|
|
432
|
+
core_default: string;
|
|
433
|
+
libretro_directory: string;
|
|
434
|
+
retroarch_cores_enable: boolean;
|
|
435
|
+
|
|
436
|
+
// NES
|
|
437
|
+
nes_sprite_limit: boolean;
|
|
438
|
+
}
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Migration from CLI-only Usage
|
|
444
|
+
|
|
445
|
+
If you've been using CLI flags, here's how to migrate to config file:
|
|
446
|
+
|
|
447
|
+
| CLI Flag | Config Key |
|
|
448
|
+
|----------|------------|
|
|
449
|
+
| `--kitty` | `video_driver = "kitty"` |
|
|
450
|
+
| `--terminal` | `video_driver = "terminal"` |
|
|
451
|
+
| `--ascii` | `video_driver = "ascii"` |
|
|
452
|
+
| `--emoji` | `video_driver = "emoji"` |
|
|
453
|
+
| `--scale 2` | `video_scale = 2` |
|
|
454
|
+
| `--no-color` | `video_color_enable = false` |
|
|
455
|
+
| `--no-diff-render` | `video_diff_render = false` |
|
|
456
|
+
| `--crt` | `video_postprocessing_mode = "crt"` |
|
|
457
|
+
| `--gamma 1.3` | `video_gamma = 1.3` |
|
|
458
|
+
| `--scanlines 0.3` | `video_scanlines = 0.3` |
|
|
459
|
+
| `--saturation 1.2` | `video_saturation = 1.2` |
|
|
460
|
+
| `--brightness 1.1` | `video_brightness = 1.1` |
|
|
461
|
+
| `--contrast 1.1` | `video_contrast = 1.1` |
|
|
462
|
+
| `--vignette 0.5` | `video_vignette = 0.5` |
|
|
463
|
+
| `--bloom 0.5` | `video_bloom = 0.5` |
|
|
464
|
+
| `--bloom-threshold 0.6` | `video_bloom_threshold = 0.6` |
|
|
465
|
+
| `--ntsc 1.0` | `video_ntsc = 1.0` |
|
|
466
|
+
| `--curvature 0.1` | `video_curvature = 0.1` |
|
|
467
|
+
| `--png-level 6` | `kitty_png_level = 6` |
|
|
468
|
+
| `--no-audio` | `audio_enable = false` |
|
|
469
|
+
| `--no-gamepad` | `input_joypad_enable = false` |
|
|
470
|
+
| `--no-save-state` | `savestate_auto_load = false` and `savestate_auto_save = false` |
|
|
471
|
+
| `--no-battery-save` | `battery_save_enable = false` |
|
|
472
|
+
| `--no-gzip-state` | `savestate_compression = false` |
|
|
473
|
+
| `--status` | `fps_show_enable = true` |
|
|
474
|
+
| `--fps-limit 30` | `fps_limit = 30` |
|
|
475
|
+
| `--core nes` | `core_default = "nes"` |
|
|
476
|
+
| `--retroarch` | `retroarch_cores_enable = true` |
|
|
477
|
+
| `--sprite-limit` | `nes_sprite_limit = true` |
|
|
478
|
+
| `--width 120` | `custom_viewport_width = 120` |
|
|
479
|
+
| `--height 40` | `custom_viewport_height = 40` |
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## Version History
|
|
484
|
+
|
|
485
|
+
| Version | Changes |
|
|
486
|
+
|---------|---------|
|
|
487
|
+
| 2 | Added `video_postprocessing_mode` (off/crt/custom), CRT preset values (`crt_*`). Replaced `video_crt_mode` boolean. |
|
|
488
|
+
| 1 | Initial config file format |
|