Skip to content

Commit

Permalink
v8.3.4: updated emulators to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Oct 22, 2024
1 parent e007386 commit 4b3e390
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/frame/stats-frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export function StatsFrame() {
<td>HDD Cache Hit/Miss</td>
<td>{stats.driveCacheHit} / {stats.driveCacheMiss}</td>
</tr>
<tr>
<td>HDD Buffered</td>
<td>{stats.driveBufferedAmount}</td>
</tr>
<tr>
<td>HDD RX</td>
<td>{stats.driveIo.map((io) => {
Expand Down
10 changes: 10 additions & 0 deletions src/sidebar/sidebar-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/sockdrive
2 changes: 2 additions & 0 deletions src/store/dos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface EmulatorStats {
driveCacheHit: number,
driveCacheMiss: number,
driveCacheUsed: number,
driveBufferedAmount: number,
driveIo: { read: number, write: number }[];
};

Expand Down Expand Up @@ -121,6 +122,7 @@ const initialState: {
driveCacheHit: 0,
driveCacheMiss: 0,
driveCacheUsed: 0,
driveBufferedAmount: 0,
driveIo: [],
},
network: {
Expand Down
1 change: 1 addition & 0 deletions src/window/dos/dos-runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/ws/ws-transport-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4b3e390

Please sign in to comment.