Skip to content

Commit

Permalink
Add Mac 128K machine and System 1.0 disk image.
Browse files Browse the repository at this point in the history
Updates #100
  • Loading branch information
mihaip committed Feb 25, 2023
1 parent a6d9a9d commit 1ccca29
Show file tree
Hide file tree
Showing 11 changed files with 5,307 additions and 13 deletions.
3 changes: 3 additions & 0 deletions Images/System 1.0.dsk
Git LFS file not shown
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ Once it has built, use `npm run import-sheepshaver` from the host to update the

```sh
cd /minivmac
# Configure for building for WASM (builds the Mac Plus model -- add `-m II` to
# build the Mac II model instead).
# Configure for building for WASM (builds the Mac Plus model by default --
# add `-m 128K` or `-m II` to build the Mac 128K or II models instead).
./emscripten_setup.sh
# Actually compile Mini vMac targetting WASM
make -j8
Expand Down
7 changes: 7 additions & 0 deletions scripts/disks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ class Disk:
def path(self) -> str:
return os.path.join(paths.IMAGES_DIR, self.name)


SYSTEM_10 = Disk(
name="System 1.0.dsk",
domain="system1.app",
)

SYSTEM_608 = Disk(
name="System 6.0.8 HD.dsk",
domain="system6.app",
Expand Down Expand Up @@ -70,6 +76,7 @@ def path(self) -> str:
)

ALL_DISKS = [
SYSTEM_10,
SYSTEM_608,
SYSTEM_753,
SYSTEM_753_PPC,
Expand Down
Binary file added src/Data/Mac-128K.rom
Binary file not shown.
19 changes: 11 additions & 8 deletions src/Mac.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import React, {useEffect, useState, useRef, useCallback} from "react";
import "./Mac.css";
import infiniteHdManifest from "./Data/Infinite HD.dsk.json";
import type {
EmulatorEthernetProvider,
EmulatorEthernetPeer,
EmulatorSettings,
} from "./emulator/emulator-ui";
import {Emulator} from "./emulator/emulator-ui";
import type {EmulatorSpeed, EmulatorType} from "./emulator/emulator-common";
import type {
EmulatorChunkedFileSpec,
EmulatorSpeed,
EmulatorType,
} from "./emulator/emulator-common";
import {
emulatorSupportsSpeedSetting,
emulatorHandlesDiskImages,
Expand All @@ -20,6 +23,7 @@ import type {ScreenControl, ScreenFrameProps} from "./ScreenFrame";
import {ScreenFrame} from "./ScreenFrame";
import {Dialog} from "./Dialog";
import type {DiskDef} from "./disks";
import {INFINITE_HD} from "./disks";
import type {MachineDef} from "./machines";
import type {ButtonProps} from "./Button";

Expand Down Expand Up @@ -82,19 +86,18 @@ export function Mac({
"webkitfullscreenchange",
handleFullScreenChange
);
const libraryDisk = {
baseUrl: "/Disk",
prefetchChunks: [0, 3346, 3350, 3351, 3352],
...infiniteHdManifest,
};
const disks: EmulatorChunkedFileSpec[] = [disk];
if (!disk.mfsOnly) {
disks.push(INFINITE_HD);
}
const emulator = new Emulator(
{
machine,
useSharedMemory,
screenWidth: initialScreenWidth,
screenHeight: initialScreenHeight,
screenCanvas: screenRef.current!,
disks: [disk, libraryDisk],
disks,
ethernetProvider,
debugAudio,
},
Expand Down
27 changes: 25 additions & 2 deletions src/disks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import infiniteHdManifest from "./Data/Infinite HD.dsk.json";
import system10Manifest from "./Data/System 1.0.dsk.json";
import system608HdManifest from "./Data/System 6.0.8 HD.dsk.json";
import system753HdManifest from "./Data/System 7.5.3 HD.dsk.json";
import system753PpcHdManifest from "./Data/System 7.5.3 (PPC) HD.dsk.json";
Expand All @@ -7,24 +9,37 @@ import macos904HdManifest from "./Data/Mac OS 9.0.4 HD.dsk.json";
import type {EmulatorChunkedFileSpec} from "./emulator/emulator-common";
import type {MachineDef} from "./machines";
import {
MAC_128K,
MAC_II,
MAC_PLUS,
NEW_WORLD_POWERMAC,
OLD_WORLD_POWERMAC,
QUADRA,
} from "./machines";

// prefetchChunks are semi-automatically generated -- we will get a
// warning via validateSpecPrefetchChunks() if these are incorrect.
export type DiskDef = EmulatorChunkedFileSpec & {
displayName: string;
displaySubtitle?: string;
description: string;
machines: MachineDef[];
appleTalkSupported?: boolean;
mfsOnly?: boolean;
bezelStyle: "Beige" | "Platinum" | "Pinstripes";
};

// prefetchChunks are semi-automatically generated -- we will get a
// warning via validateSpecPrefetchChunks() if these are incorrect.
const SYSTEM_1_0: DiskDef = {
displayName: "System 1.0",
description: "Initial system software release, shipped with the Mac 128K.",
baseUrl: "/Disk",
prefetchChunks: [0, 1],
machines: [MAC_128K],
bezelStyle: "Beige",
mfsOnly: true,
...system10Manifest,
};

const SYSTEM_6_0_8: DiskDef = {
displayName: "System 6.0.8",
description:
Expand Down Expand Up @@ -154,13 +169,15 @@ export const DISKS_BY_DOMAIN: {
export const DISKS_BY_YEAR: {
[year: number]: DiskDef[];
} = {
1984: [SYSTEM_1_0],
1991: [SYSTEM_6_0_8],
1996: [SYSTEM_7_5_3, SYSTEM_7_5_3_PPC, KANJITALK_7_5_3],
1998: [MAC_OS_8_1],
2000: [MAC_OS_9_0_4],
};

export const ALL_DISKS = [
SYSTEM_1_0,
SYSTEM_6_0_8,
SYSTEM_7_5_3,
SYSTEM_7_5_3_PPC,
Expand All @@ -172,3 +189,9 @@ export const ALL_DISKS = [
export const DISKS_BY_NAME = Object.fromEntries(
ALL_DISKS.map(disk => [disk.name, disk])
);

export const INFINITE_HD = {
baseUrl: "/Disk",
prefetchChunks: [0, 3346, 3350, 3351, 3352],
...infiniteHdManifest,
};
2 changes: 1 addition & 1 deletion src/emulator/emulator-common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type EmulatorType = "BasiliskII" | "SheepShaver" | "Mini vMac";

export type EmulatorSubtype = "Plus" | "II";
export type EmulatorSubtype = "128K" | "Plus" | "II";

export function emulatorHandlesDiskImages(type: EmulatorType): boolean {
return type === "Mini vMac";
Expand Down
8 changes: 8 additions & 0 deletions src/emulator/emulator-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import {
handleDirectoryExtraction,
uploadsFromDirectoryExtractionFile,
} from "./emulator-ui-extractor";
import MinivMac128KPath from "./minivmac-128K.jsz";
import MinivMac128KWasmPath from "./minivmac-128K.wasmz";
import MinivMacIIPath from "./minivmac-II.jsz";
import MinivMacIIWasmPath from "./minivmac-II.wasmz";
import MinivMacPlusPath from "./minivmac-Plus.jsz";
Expand Down Expand Up @@ -267,6 +269,12 @@ export class Emulator {
break;
case "Mini vMac":
switch (this.#config.machine.emulatorSubtype) {
case "128K":
emulatorPaths = [
MinivMac128KPath,
MinivMac128KWasmPath,
];
break;
case "Plus":
emulatorPaths = [
MinivMacPlusPath,
Expand Down
Loading

0 comments on commit 1ccca29

Please sign in to comment.