diff --git a/src/renderer/app.tsx b/src/renderer/app.tsx index 95bd110..5ff6b14 100644 --- a/src/renderer/app.tsx +++ b/src/renderer/app.tsx @@ -1,3 +1,12 @@ +export interface Win95Window extends Window { + emulator: any; + win95: { + app: App; + }; +} + +declare let window: Win95Window; + /** * The top-level class controlling the whole app. This is *not* a React component, * but it does eventually render all components. @@ -27,8 +36,8 @@ export class App { } } -window["win95"] = window["win95"] || { +window.win95 = window.win95 || { app: new App(), }; -window["win95"].app.setup(); +window.win95.app.setup(); diff --git a/src/renderer/card-drive.tsx b/src/renderer/card-drive.tsx deleted file mode 100644 index 8c927a7..0000000 --- a/src/renderer/card-drive.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import * as React from "react"; - -interface CardDriveProps { - showDiskImage: () => void; -} - -interface CardDriveState {} - -export class CardDrive extends React.Component { - constructor(props: CardDriveProps) { - super(props); - - this.state = {}; - } - - public render() { - let advice: JSX.Element | null = null; - - if (process.platform === "win32") { - advice = this.renderAdviceWindows(); - } else if (process.platform === "darwin") { - advice = this.renderAdviceMac(); - } else { - advice = this.renderAdviceLinux(); - } - - return ( -
-
-
-

- - Modify C: Drive -

-
-
-

- windows95 (this app) uses a raw disk image. Windows 95 (the - operating system) is fragile, so adding or removing files is - risky. -

- {advice} -
-
-
- ); - } - - public renderAdviceWindows(): JSX.Element { - return ( -
- Changing the disk on Windows -

- Windows 10 cannot mount raw disk images (ironically, macOS and Linux - can). However, tools exist that let you mount this drive, like the - freeware tool{" "} - - OSFMount - - . I am not affiliated with it, so please use it at your own risk. -

- {this.renderMountButton("Windows Explorer")} -
- ); - } - - public renderAdviceMac(): JSX.Element { - return ( -
- Changing the disk on macOS -

- macOS can mount the disk image directly. Click the button below to see - the disk image in Finder. Then, double-click the image to mount it. -

- {this.renderMountButton("Finder")} -
- ); - } - - public renderAdviceLinux(): JSX.Element { - return ( -
- Changing the disk on Linux -

- There are plenty of tools that enable Linux users to mount and modify - disk images. The disk image used by windows95 is a raw "img" disk - image and can probably be mounted using the mount tool, - which is likely installed on your machine. -

- {this.renderMountButton("file viewer")} -
- ); - } - - public renderMountButton(explorer: string) { - return ( - - ); - } -} diff --git a/src/renderer/emulator.tsx b/src/renderer/emulator.tsx index 4102618..2d821fd 100644 --- a/src/renderer/emulator.tsx +++ b/src/renderer/emulator.tsx @@ -9,11 +9,13 @@ import { CardStart } from "./card-start"; import { StartMenu } from "./start-menu"; import { CardSettings } from "./card-settings"; import { EmulatorInfo } from "./emulator-info"; -import { CardDrive } from "./card-drive"; import { getStatePath } from "./utils/get-state-path"; +import { Win95Window } from "./app"; + +declare let window: Win95Window; export interface EmulatorState { - currentUiCard: string; + currentUiCard: "start" | "settings"; emulator?: any; scale: number; floppyFile?: File; @@ -200,8 +202,6 @@ export class Emulator extends React.Component<{}, EmulatorState> { cdrom={cdromFile} /> ); - } else if (currentUiCard === "drive") { - card = ; } else { card = ; } @@ -210,7 +210,7 @@ export class Emulator extends React.Component<{}, EmulatorState> { <> {card} this.setState({ currentUiCard: target })} + navigate={(target) => this.setState({ currentUiCard: target as "start" | "settings" })} /> ); @@ -308,8 +308,6 @@ export class Emulator extends React.Component<{}, EmulatorState> { } : undefined, boot_order: 0x132, - // One day, maybe! - // network_relay_url: "ws://localhost:8080/" }; console.log(`🚜 Starting emulator with options`, options); diff --git a/src/renderer/start-menu.tsx b/src/renderer/start-menu.tsx index b9b599e..b9b691c 100644 --- a/src/renderer/start-menu.tsx +++ b/src/renderer/start-menu.tsx @@ -28,10 +28,6 @@ export class StartMenu extends React.Component { Settings - - - Modify C: Drive - ); diff --git a/static/drive.png b/static/drive.png deleted file mode 100644 index 9150a0b..0000000 Binary files a/static/drive.png and /dev/null differ