@tmustier/pi-nes 0.2.11 → 0.2.12
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/README.md +2 -2
- package/extensions/nes/config.ts +6 -7
- package/extensions/nes/index.ts +3 -3
- package/package.json +1 -1
- package/spec.md +2 -2
package/README.md
CHANGED
|
@@ -83,8 +83,8 @@ Config is stored at `~/.pi/nes/config.json`. Use `/nes config` for quick setup.
|
|
|
83
83
|
| `romDir` | `/roms/nes` | Where to look for ROM files |
|
|
84
84
|
| `saveDir` | `/roms/nes/saves` | Where to store battery saves (defaults to `<romDir>/saves`) |
|
|
85
85
|
| `renderer` | `"image"` | `"image"` (Kitty graphics) or `"text"` (ANSI) |
|
|
86
|
-
| `imageQuality` | `"balanced"` | `"balanced"` (30 fps
|
|
87
|
-
| `pixelScale` | `1.0` | Display scale (0.5–
|
|
86
|
+
| `imageQuality` | `"balanced"` | `"balanced"` (30 fps) or `"high"` (60 fps) |
|
|
87
|
+
| `pixelScale` | `1.0` | Display scale (0.5–4.0) |
|
|
88
88
|
|
|
89
89
|
## Terminal Support
|
|
90
90
|
|
package/extensions/nes/config.ts
CHANGED
|
@@ -59,11 +59,7 @@ export function normalizeConfig(raw: unknown): NesConfig {
|
|
|
59
59
|
? normalizePath(parsed.saveDir, saveDirFallback)
|
|
60
60
|
: saveDirFallback;
|
|
61
61
|
const imageQuality = normalizeImageQuality(parsed.imageQuality);
|
|
62
|
-
const
|
|
63
|
-
const pixelScale =
|
|
64
|
-
typeof parsed.pixelScale === "number" && !Number.isNaN(parsed.pixelScale)
|
|
65
|
-
? normalizePixelScale(parsed.pixelScale, maxPixelScale)
|
|
66
|
-
: maxPixelScale;
|
|
62
|
+
const pixelScale = normalizePixelScale(parsed.pixelScale);
|
|
67
63
|
return {
|
|
68
64
|
romDir,
|
|
69
65
|
saveDir,
|
|
@@ -115,8 +111,11 @@ async function ensureDirectory(dirPath: string): Promise<void> {
|
|
|
115
111
|
}
|
|
116
112
|
}
|
|
117
113
|
|
|
118
|
-
function normalizePixelScale(raw:
|
|
119
|
-
|
|
114
|
+
function normalizePixelScale(raw: unknown): number {
|
|
115
|
+
if (typeof raw !== "number" || Number.isNaN(raw)) {
|
|
116
|
+
return DEFAULT_CONFIG.pixelScale;
|
|
117
|
+
}
|
|
118
|
+
return Math.min(4, Math.max(0.5, raw));
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
function normalizeImageQuality(raw: unknown): ImageQuality {
|
package/extensions/nes/index.ts
CHANGED
|
@@ -176,8 +176,8 @@ async function configureWithWizard(
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
const qualityChoice = await ctx.ui.select("Quality", [
|
|
179
|
-
"Balanced (recommended) — 30 fps
|
|
180
|
-
"High — 60 fps
|
|
179
|
+
"Balanced (recommended) — 30 fps",
|
|
180
|
+
"High — 60 fps",
|
|
181
181
|
]);
|
|
182
182
|
if (!qualityChoice) {
|
|
183
183
|
return false;
|
|
@@ -185,7 +185,7 @@ async function configureWithWizard(
|
|
|
185
185
|
|
|
186
186
|
const isHighQuality = qualityChoice.startsWith("High");
|
|
187
187
|
const imageQuality = isHighQuality ? "high" : "balanced";
|
|
188
|
-
const pixelScale =
|
|
188
|
+
const pixelScale = config.pixelScale;
|
|
189
189
|
|
|
190
190
|
const defaultSaveDir = getDefaultSaveDir(config.romDir);
|
|
191
191
|
const shouldSyncSaveDir = config.saveDir === defaultSaveDir;
|
package/package.json
CHANGED
package/spec.md
CHANGED
|
@@ -70,7 +70,7 @@ pi-nes/
|
|
|
70
70
|
- `saveDir`
|
|
71
71
|
- `enableAudio`
|
|
72
72
|
- `renderer` ("image" or "text")
|
|
73
|
-
- `imageQuality` ("balanced" or "high")
|
|
73
|
+
- `imageQuality` ("balanced" or "high", controls render fps)
|
|
74
74
|
- `pixelScale` (float, e.g. 1.0)
|
|
75
75
|
- `keybindings` (button-to-keys map, e.g. `{ "a": ["z"] }`)
|
|
76
76
|
|
|
@@ -89,6 +89,6 @@ Note: audio output is currently disabled; setting `enableAudio` will show a warn
|
|
|
89
89
|
- Audio: disabled (no safe dependency selected).
|
|
90
90
|
- Default ROM dir: `/roms/nes` (configurable).
|
|
91
91
|
- Default core: `native`.
|
|
92
|
-
- Default image quality: `balanced
|
|
92
|
+
- Default image quality: `balanced` (30 fps).
|
|
93
93
|
- Default pixel scale: `1.0`.
|
|
94
94
|
- Default save dir: `/roms/nes/saves` (configurable).
|