Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around sound not working in Mac OS 8 and Mac OS 9
Appears to be due to corruption introduced by modifying the images with machfs, which in turn results in the sound driver resource not being loaded. I do not have a fix for that yet (tracked in #84), but as a workaround we remove the need to read-modify-write the disk image with machfs. The main reason why we were doing that was to insert a dynamically- generated stickies file (see 5be16f6 and 6b04758). However, we can do that with direct manipulation of the disk image, instead of doing HFS operations. We do this by generating a placeholder "Stickies file" file that we copy to the disk image by hand, and then replace it with the actual file when building images (the images are defragmented with Speed Disk from Norton Utilities to ensure the placeholder data is continuous). The load-placeholder-stickies-file script helps with this. Mac OS 9 still does not have sound by default, because the "Built-in" source is not selected. It will likely require some tweaks to the PRAM to fix that. Updates #67
- Loading branch information
Showing
14 changed files
with
291 additions
and
177 deletions.
There are no files selected for viewing
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import disks | ||
import os.path | ||
import paths | ||
import subprocess | ||
import typing | ||
|
||
|
||
def run(disk_paths: typing.List[str], modelid: int = 14) -> None: | ||
rom_path = os.path.join(paths.DATA_DIR, "Quadra-650.rom") | ||
basilisk_ii_args = [ | ||
("--config", "none"), | ||
] + [("--disk", p) for p in disk_paths] + [ | ||
("--extfs", "none"), | ||
("--rom", rom_path), | ||
("--screen", "win/800/600"), | ||
("--ramsize", "134217728"), | ||
("--frameskip", "0"), | ||
("--modelid", str(modelid)), | ||
("--cpu", "4"), | ||
("--fpu", "true"), | ||
("--nocdrom", "true"), | ||
("--nosound", "true"), | ||
("--noclipconversion", "true"), | ||
("--idlewait", "true"), | ||
] | ||
subprocess.check_call([ | ||
"open", | ||
"-a", | ||
"BasiliskII", | ||
"-W", | ||
"--args", | ||
] + [a for arg in basilisk_ii_args for a in arg]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import dataclasses | ||
import os.path | ||
import paths | ||
import stickies | ||
import typing | ||
|
||
|
||
@dataclasses.dataclass | ||
class Disk: | ||
name: str | ||
domain: str | ||
stickies_path: typing.List[str] = dataclasses.field( | ||
default_factory=lambda: | ||
["System Folder", "Preferences", "Stickies file"]) | ||
stickies_encoding: str = "mac_roman" | ||
welcome_sticky_override: stickies.Sticky = None | ||
|
||
def path(self) -> str: | ||
return os.path.join(paths.IMAGES_DIR, self.name) | ||
|
||
|
||
SYSTEM_753 = Disk( | ||
name="System 7.5.3 HD.dsk", | ||
domain="system7.app", | ||
) | ||
|
||
SYSTEM_753_PPC = Disk( | ||
name="System 7.5.3 (PPC) HD.dsk", | ||
domain="system7.app", | ||
) | ||
|
||
MAC_OS_81 = Disk( | ||
name="Mac OS 8.1 HD.dsk", | ||
domain="macos8.app", | ||
) | ||
|
||
JAPANESE_WELCOME_STICKY = stickies.Sticky( | ||
top=125, | ||
left=468, | ||
bottom=180, | ||
right=660, | ||
font=stickies.Font.OSAKA, | ||
size=18, | ||
style={stickies.Style.BOLD}, | ||
text="Infinite Macintosh へようこそ!", | ||
) | ||
|
||
KANJITALK_753 = Disk( | ||
name="KanjiTalk 7.5.3 HD.dsk", | ||
domain="kanjitalk7.app", | ||
# Generate Mojibake of Shift-JIS interpreted as MacRoman, the machfs | ||
# library always assumes the latter. | ||
stickies_path=[ | ||
p.encode("shift_jis").decode("mac_roman") for p in [ | ||
"システムフォルダ", | ||
"初期設定", | ||
'スティッキーズファイル', | ||
] | ||
], | ||
stickies_encoding="shift_jis", | ||
welcome_sticky_override=JAPANESE_WELCOME_STICKY) | ||
|
||
MAC_OS_904 = Disk( | ||
name="Mac OS 9.0.4 HD.dsk", | ||
domain="macos9.app", | ||
) | ||
|
||
ALL_DISKS = [ | ||
SYSTEM_753, | ||
SYSTEM_753_PPC, | ||
MAC_OS_81, | ||
KANJITALK_753, | ||
MAC_OS_904, | ||
] |
Oops, something went wrong.