mirror of
https://github.com/elliotnunn/supermario.git
synced 2024-09-27 14:57:38 +00:00
Reduce console spam
This commit is contained in:
parent
1f6879c5d5
commit
7627be1e6d
23
bin/build
23
bin/build
@ -56,8 +56,6 @@ else:
|
|||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
print('Copying source', flush=True)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(config.tmpdir)
|
shutil.rmtree(config.tmpdir)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
@ -104,8 +102,6 @@ for mkfile in all_makefiles:
|
|||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
print('Splicing amphibian DNA', flush=True) # Ugly, but keeps src tree clean
|
|
||||||
|
|
||||||
splice(config.tmpdir)
|
splice(config.tmpdir)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
@ -117,8 +113,6 @@ vol['Src'].read_folder(config.tmpdir, date=0x90000000, mpw_dates=True)
|
|||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
print('Making bootable', flush=True)
|
|
||||||
|
|
||||||
def folder(name):
|
def folder(name):
|
||||||
return path.join(path.dirname(path.abspath(__file__)), name)
|
return path.join(path.dirname(path.abspath(__file__)), name)
|
||||||
|
|
||||||
@ -154,8 +148,8 @@ vol['MPW']['MPW Shell'].rsrc = macresources.make_file(mpw)
|
|||||||
# which it normally does when the startup app isn't a 'FNDR'.
|
# which it normally does when the startup app isn't a 'FNDR'.
|
||||||
# At that point, replace ShutDwnUserChoice() with ShutDwnPower().
|
# At that point, replace ShutDwnUserChoice() with ShutDwnPower().
|
||||||
# Also, follow a special path to the startup app, instead of Finder name global.
|
# Also, follow a special path to the startup app, instead of Finder name global.
|
||||||
sys = list(macresources.parse_file(vol['System Folder']['System'].rsrc))
|
system = list(macresources.parse_file(vol['System Folder']['System'].rsrc))
|
||||||
for resource in sys:
|
for resource in system:
|
||||||
if resource.type != b'scod': continue # "System CODE" resources = Process Mgr
|
if resource.type != b'scod': continue # "System CODE" resources = Process Mgr
|
||||||
|
|
||||||
resource.data = resource.data.replace(b'FNDR', b'LUSR')
|
resource.data = resource.data.replace(b'FNDR', b'LUSR')
|
||||||
@ -175,7 +169,7 @@ for resource in sys:
|
|||||||
data[offset:offset+2] = b'\x48\x7A' # ...replace with PC-relative 'PEA startapp'
|
data[offset:offset+2] = b'\x48\x7A' # ...replace with PC-relative 'PEA startapp'
|
||||||
data[offset+2:offset+4] = (str_offset - (offset+2)).to_bytes(2, byteorder='big')
|
data[offset+2:offset+4] = (str_offset - (offset+2)).to_bytes(2, byteorder='big')
|
||||||
resource.data = bytes(data)
|
resource.data = bytes(data)
|
||||||
vol['System Folder']['System'].rsrc = macresources.make_file(sys)
|
vol['System Folder']['System'].rsrc = macresources.make_file(system)
|
||||||
|
|
||||||
# Patch the Finder to give it a Quit menu item
|
# Patch the Finder to give it a Quit menu item
|
||||||
finder = list(macresources.parse_file(vol['System Folder']['Finder'].rsrc))
|
finder = list(macresources.parse_file(vol['System Folder']['Finder'].rsrc))
|
||||||
@ -190,18 +184,19 @@ vol['System Folder']['Finder'].rsrc = macresources.make_file(finder)
|
|||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
print('Creating HFS disk image')
|
|
||||||
with open(config.hfsimg, 'wb') as f:
|
with open(config.hfsimg, 'wb') as f:
|
||||||
f.write(vol.write(256*1024*1024, align=4096, desktopdb=False))
|
f.write(vol.write(256*1024*1024, align=4096, desktopdb=False))
|
||||||
|
|
||||||
print('Starting Mini vMac...', flush=True)
|
ran = subprocess.run(config.vmac + ' ' + shlex.quote(config.hfsimg), shell=True, capture_output=True)
|
||||||
|
|
||||||
subprocess.run(config.vmac + ' ' + shlex.quote(config.hfsimg), shell=True, check=True)
|
# Some emulators print nonsense
|
||||||
|
if ran.returncode != 0:
|
||||||
|
sys.stdout.buffer.write(ran.stdout)
|
||||||
|
sys.stderr.buffer.write(ran.stderr)
|
||||||
|
sys.exit(ran.returncode)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
print('Saving changes and cleaning up', flush=True)
|
|
||||||
|
|
||||||
vol = machfs.Volume()
|
vol = machfs.Volume()
|
||||||
with open(config.hfsimg, 'rb') as f:
|
with open(config.hfsimg, 'rb') as f:
|
||||||
vol.read(f.read())
|
vol.read(f.read())
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import argparse
|
|
||||||
import glob
|
import glob
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
@ -90,6 +89,5 @@ def splice(directory):
|
|||||||
fd.write(' ƒ {Sources}%s:%s\n' % (OVERDIR, orig_name))
|
fd.write(' ƒ {Sources}%s:%s\n' % (OVERDIR, orig_name))
|
||||||
fd.write('\tDuplicate -y {Deps} {Targ}\n')
|
fd.write('\tDuplicate -y {Deps} {Targ}\n')
|
||||||
|
|
||||||
diag = 'Successfully spliced: %d/%d' % (len(overs)-len(remaining), len(overs))
|
if remaining:
|
||||||
if remaining: diag += '; Failed: ' + ' '.join(remaining)
|
print('Failed to splice:', *remaining)
|
||||||
print(diag)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user