Patch Finder to be quittable

This lets you escape from the emulator with a cmd-q, which is cool.
This commit is contained in:
Elliot Nunn 2019-01-14 16:36:57 +08:00
parent f2451b3ecf
commit 5f69373155
1 changed files with 11 additions and 0 deletions

11
Build
View File

@ -288,6 +288,17 @@ for resource in sys:
resource.data = bytes(data)
vol['System Folder']['System'].rsrc = make_file(sys)
# Patch the Finder to give it a Quit menu item
finder = list(parse_file(vol['System Folder']['Finder'].rsrc))
for resource in finder:
if resource.type == b'fmnu' and b'Put Away' in resource.data:
data = bytearray(resource.data)
data[3] += 2
data.extend(b'xxx0\0\0\0\0\x01\x2D')
data.extend(b'quit\x81\x00\x51\x00\x04Quit\0')
resource.data = bytes(data)
vol['System Folder']['Finder'].rsrc = make_file(finder)
########################################################################
log('Writing out disk image')