js-dos 8.1.3 → 8.1.5

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 CHANGED
@@ -33,7 +33,7 @@ The key features:
33
33
 
34
34
  ## Development
35
35
 
36
- 1. You need to install node dependencies and put `emulators@beta` into `public/emulators`.
36
+ 1. You need to install node dependencies and put `emulators` into `public/emulators`.
37
37
  ```
38
38
  yarn
39
39
  cp -rv node_modules/emulators/dist/* public/emulators
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-dos",
3
- "version": "8.1.3",
3
+ "version": "8.1.5",
4
4
  "description": "Full-featured DOS player with multiple emulator backends",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -35,7 +35,7 @@
35
35
  "@typescript-eslint/parser": "^6.20.0",
36
36
  "autoprefixer": "^10.4.17",
37
37
  "daisyui": "^3.9.3",
38
- "emulators": "8.1.2",
38
+ "emulators": "8.1.3",
39
39
  "eslint": "^8.56.0",
40
40
  "eslint-config-google": "^0.14.0",
41
41
  "postcss": "^8.4.33",
@@ -50,6 +50,7 @@ export class Drive {
50
50
  preloadQueue: number[] = [];
51
51
 
52
52
  originReadMode: boolean;
53
+ readOnly = false;
53
54
 
54
55
  public constructor(endpoint: string,
55
56
  owner: string,
@@ -140,7 +141,8 @@ export class Drive {
140
141
  }
141
142
  socket.removeEventListener("message", onPreloadMessage);
142
143
  socket.addEventListener("message", onMessage);
143
- this.openFn(true, mode === "write",
144
+ this.readOnly = mode !== "write";
145
+ this.openFn(true, !this.readOnly,
144
146
  (Number.parseInt(sizeStr) ?? 2 * 1024 * 1024) * 1024,
145
147
  this.preloadQueue,
146
148
  aheadRange);
@@ -304,6 +306,8 @@ export class Drive {
304
306
  this.readBuffer[5 + i * 4 + 3] = (origin >> 24) & 0xFF;
305
307
  }
306
308
  socket.send(this.readBuffer.slice(0, sectors.length * 4 + 5).buffer);
309
+ } else if (this.readOnly) {
310
+ request.resolve(0);
307
311
  } else {
308
312
  const { sectors, buffer, resolve } = request;
309
313
  this.stats.write += this.sectorSize;
@@ -596,9 +596,9 @@ callsites@^3.0.0:
596
596
  integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
597
597
 
598
598
  caniuse-lite@^1.0.30001517:
599
- version "1.0.30001527"
600
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001527.tgz#813826554828245ccee776c850566dce12bdeaba"
601
- integrity sha512-YkJi7RwPgWtXVSgK4lG9AHH57nSzvvOp9MesgXmw4Q7n0C3H04L0foHqfxcmSAm5AcWb8dW9AYj2tR7/5GnddQ==
599
+ version "1.0.30001632"
600
+ resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001632.tgz"
601
+ integrity sha512-udx3o7yHJfUxMLkGohMlVHCvFvWmirKh9JAH/d7WOLPetlH+LTL5cocMZ0t7oZx/mdlOWXti97xLZWc8uURRHg==
602
602
 
603
603
  chalk@^4.0.0, chalk@^4.1.0:
604
604
  version "4.1.2"
package/src/vite-env.d.ts CHANGED
@@ -1,2 +1,5 @@
1
1
  // eslint-disable-next-line
2
2
  /// <reference types="vite/client" />
3
+
4
+ // eslint-disable-next-line no-unused-vars
5
+ declare const JSDOS_VERSION: string;
@@ -39,8 +39,10 @@ function useLog(ci: CommandInterface): void {
39
39
  } else if (msgType === "log" && args[0]?.indexOf("sockdrive:") !== -1) {
40
40
  const drive = args[0].substring(args[0].indexOf(" ") + 1, args[0].indexOf(","));
41
41
  dispatch(uiSlice.actions.cloudSaves(false));
42
- if (args[0]?.indexOf("write=false") !== -1) {
42
+ if (args[0]?.indexOf("write=") !== -1) {
43
43
  console.log("drive", drive, "config:", args[0]);
44
+ }
45
+ if (args[0]?.indexOf("write=false") !== -1) {
44
46
  dispatch(uiSlice.actions.readOnlyWarning(true));
45
47
  }
46
48
  if (args[0]?.indexOf("preload=") !== -1) {
@@ -13,7 +13,6 @@ declare const emulators: Emulators;
13
13
  export function PreRunWindow() {
14
14
  const account = useSelector((state: State) => state.auth.account);
15
15
  const emuVersion = useSelector((state: State) => state.dos.emuVersion);
16
- const lang = useSelector((state: State) => state.i18n.lang);
17
16
  const dispatch = useDispatch();
18
17
  const t = useT();
19
18
 
@@ -22,9 +21,7 @@ export function PreRunWindow() {
22
21
  }
23
22
 
24
23
  function openPremiumPage() {
25
- window.open(lang === "ru" ?
26
- "https://dos.zone/ru/blog/premium-subscription/" :
27
- "https://dos.zone/blog/premium-subscription/", "_blank");
24
+ window.open("https://js-dos.com/cloud-overview.html", "_blank");
28
25
  }
29
26
 
30
27
  return <div class="pre-run-window">
@@ -82,7 +79,8 @@ export function PreRunWindow() {
82
79
  <MouseSensitiviySlider class="mt-4 w-full max-w-sm" />
83
80
  <VolumeSlider class="w-full max-w-sm" />
84
81
 
85
- <div class="text-center mt-8">emu-version: <span class="text-ellipsis overflow-hidden">{emuVersion}</span></div>
82
+ <div class="text-center mt-8">jsdos/emu version:&nbsp;
83
+ <span class="text-ellipsis overflow-hidden">{JSDOS_VERSION}/{emuVersion}</span></div>
86
84
  </div>;
87
85
  }
88
86
 
package/vite.config.ts CHANGED
@@ -19,4 +19,7 @@ export default defineConfig({
19
19
  },
20
20
  },
21
21
  },
22
+ define: {
23
+ JSDOS_VERSION: JSON.stringify(process.env.npm_package_version),
24
+ },
22
25
  });