From 4b3e3905e16659cdb7d8a702a8398a7cb08c173d Mon Sep 17 00:00:00 2001 From: Alexander Guryanov Date: Tue, 22 Oct 2024 12:26:17 +0300 Subject: [PATCH] v8.3.4: updated emulators to latest --- package.json | 4 ++-- src/frame/stats-frame.tsx | 4 ++++ src/sidebar/sidebar-button.tsx | 10 ++++++++++ src/sockdrive | 2 +- src/store/dos.ts | 2 ++ src/window/dos/dos-runtime.tsx | 1 + src/ws/ws-transport-layer.ts | 1 + yarn.lock | 8 ++++---- 8 files changed, 25 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 0cbf5ca8..3c510eb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-dos", - "version": "8.3.3", + "version": "8.3.4", "description": "Full-featured DOS player with multiple emulator backends", "type": "module", "keywords": [ @@ -37,7 +37,7 @@ "@typescript-eslint/parser": "^6.20.0", "autoprefixer": "^10.4.17", "daisyui": "^3.9.3", - "emulators": "8.3.0", + "emulators": "8.3.1", "eslint": "^8.56.0", "eslint-config-google": "^0.14.0", "postcss": "^8.4.33", diff --git a/src/frame/stats-frame.tsx b/src/frame/stats-frame.tsx index 7b698100..39171489 100644 --- a/src/frame/stats-frame.tsx +++ b/src/frame/stats-frame.tsx @@ -98,6 +98,10 @@ export function StatsFrame() { HDD Cache Hit/Miss {stats.driveCacheHit} / {stats.driveCacheMiss} + + HDD Buffered + {stats.driveBufferedAmount} + HDD RX {stats.driveIo.map((io) => { diff --git a/src/sidebar/sidebar-button.tsx b/src/sidebar/sidebar-button.tsx index 3860d259..853a5d61 100644 --- a/src/sidebar/sidebar-button.tsx +++ b/src/sidebar/sidebar-button.tsx @@ -92,7 +92,9 @@ export function HddLed(props: {}) { const id = setInterval(() => { if (state.delayLedTo <= Date.now()) { const newRecv = getState(store).dos.stats.driveRecv; + const write = getState(store).dos.stats.driveBufferedAmount; const newEnabled = state.recv !== newRecv; + if (newEnabled !== state.enabled) { el.classList.remove("bg-base-300", "bg-green-300", "animate-led"); if (newEnabled) { @@ -103,6 +105,14 @@ export function HddLed(props: {}) { state.enabled = newEnabled; } + if (write) { + if (!el.classList.contains("bg-red-300")) { + el.classList.add("bg-red-300"); + } + } else { + el.classList.remove("bg-red-300"); + } + if (newEnabled) { state.delayLedTo = Date.now() + 300 + Math.random() * 1500; } else { diff --git a/src/sockdrive b/src/sockdrive index 3ba5b58e..e4d1d354 160000 --- a/src/sockdrive +++ b/src/sockdrive @@ -1 +1 @@ -Subproject commit 3ba5b58e08059ca75acc1830a3227be593441b4d +Subproject commit e4d1d354819dd5c59eb83831613c08aee6451744 diff --git a/src/store/dos.ts b/src/store/dos.ts index 5e933227..66e8b1ea 100644 --- a/src/store/dos.ts +++ b/src/store/dos.ts @@ -42,6 +42,7 @@ export interface EmulatorStats { driveCacheHit: number, driveCacheMiss: number, driveCacheUsed: number, + driveBufferedAmount: number, driveIo: { read: number, write: number }[]; }; @@ -121,6 +122,7 @@ const initialState: { driveCacheHit: 0, driveCacheMiss: 0, driveCacheUsed: 0, + driveBufferedAmount: 0, driveIo: [], }, network: { diff --git a/src/window/dos/dos-runtime.tsx b/src/window/dos/dos-runtime.tsx index 6bc326a5..4654ad67 100644 --- a/src/window/dos/dos-runtime.tsx +++ b/src/window/dos/dos-runtime.tsx @@ -195,6 +195,7 @@ function useStats(ci: CommandInterface): void { driveCacheHit: stats.driveCacheHit, driveCacheMiss: stats.driveCacheMiss, driveCacheUsed: stats.driveCacheUsed, + driveBufferedAmount: stats.driveBufferedAmount, driveIo: structuredClone(stats.driveIo), }; dispatch(dosSlice.actions.stats(dStats)); diff --git a/src/ws/ws-transport-layer.ts b/src/ws/ws-transport-layer.ts index 4d1d6686..0898b1a6 100644 --- a/src/ws/ws-transport-layer.ts +++ b/src/ws/ws-transport-layer.ts @@ -213,6 +213,7 @@ export class WsTransportLayer implements TransportLayer { driveCacheMiss: this.sockdrive.stats.cacheMiss, driveRecvTime: this.sockdrive.stats.readTotalTime, driveCacheUsed: this.sockdrive.stats.cacheUsed, + driveBufferedAmount: 0, driveIo: this.sockdrive.stats.io, }; if (payload[0]!.length > 20) { diff --git a/yarn.lock b/yarn.lock index cf304b47..e67e337b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1159,10 +1159,10 @@ electron-to-chromium@^1.4.648: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.653.tgz#832ab25e80ad698ac09c1ca547bd9ee6cce7df10" integrity sha512-wA2A2LQCqnEwQAvwADQq3KpMpNwgAUBnRmrFgRzHnPhbQUFArTR32Ab46f4p0MovDLcg4uqd4nCsN2hTltslpA== -emulators@8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/emulators/-/emulators-8.3.0.tgz#73fef07121ac6b92825653007f59b05ae6a073a6" - integrity sha512-+m7zXnTxR364sSkt6FPYBJLV2f41F8b5DUhD2/J1w4rGfKSzwmVhRmZldAVH+4c6guqOVFMEFqup8qKE/3gFBA== +emulators@8.3.1: + version "8.3.1" + resolved "https://registry.yarnpkg.com/emulators/-/emulators-8.3.1.tgz#25788315876b4176bb9aa0ad929707a59f7f3537" + integrity sha512-rhEVIGKPSINIdCp68Y4Udwofu+nBbfT2eSJNJ/xQiI6wdoV1aIziyROkk6WySM0p5YZ3pu256YuqE3mMNuzMJQ== entities@^4.2.0: version "4.5.0"