Завершить разделение SDK и внешних проектов
This commit is contained in:
@@ -7,6 +7,7 @@ from contextlib import redirect_stdout
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import signal
|
||||
import subprocess
|
||||
@@ -157,6 +158,10 @@ def main():
|
||||
parser.add_argument('--build',required=True)
|
||||
parser.add_argument('--socket',required=True)
|
||||
parser.add_argument('--data',action='append',default=[])
|
||||
parser.add_argument('--app-hdd',default=None,
|
||||
help='локальный CHD приложения для -hard2')
|
||||
parser.add_argument('--launch-path',default=None,
|
||||
help='путь к EXE в DSS, например d:\\games\\sprpop\\sprpop.exe')
|
||||
parser.add_argument('--launch-at',type=float,default=0,
|
||||
help='не начинать ввод раньше этой секунды эмуляции')
|
||||
parser.add_argument('--dss-timeout',type=float,default=30,
|
||||
@@ -181,8 +186,6 @@ def main():
|
||||
if args.mame and not args.mame_bin:
|
||||
args.mame_bin=args.mame
|
||||
profile=from_arguments(args)
|
||||
if profile.binary is None and (ROOT/'mame/v306/mame.arm').is_file():
|
||||
profile=MameProfile.resolve({'MAME_HOME':str(ROOT/'mame/v306')})
|
||||
profile.validate(dss=True)
|
||||
mame=profile.binary
|
||||
stopping=False
|
||||
@@ -203,7 +206,15 @@ def main():
|
||||
with redirect_stdout(sys.stderr):
|
||||
if not create_floppy_image(str(disk_path),files):
|
||||
raise RuntimeError('Не удалось создать debug-дискету')
|
||||
command_text='a:\\'+basename_83(exe.name).replace(' ','')+'\n'
|
||||
if args.launch_path:
|
||||
launch_path=args.launch_path.replace('/', '\\')
|
||||
if not re.fullmatch(r'[A-Za-z]:\\[A-Za-z0-9_.\\-]+',launch_path):
|
||||
raise ValueError('launch-path: ожидается путь DOS вида d:\\dir\\app.exe')
|
||||
if Path(launch_path.split('\\')[-1]).name.upper() != exe.name.upper():
|
||||
raise ValueError('launch-path должен заканчиваться именем debug EXE: '+exe.name)
|
||||
command_text=launch_path+'\n'
|
||||
else:
|
||||
command_text='a:\\'+basename_83(exe.name).replace(' ','')+'\n'
|
||||
events=build_events([(0,command_text)])
|
||||
ready=state/'main.json'
|
||||
lua=state/'launch.lua'
|
||||
@@ -215,9 +226,6 @@ def main():
|
||||
installed_plugins=profile.home.parent/'plugins' if profile.home else None
|
||||
if installed_plugins and installed_plugins.is_dir():
|
||||
plugin_paths.append(str(installed_plugins))
|
||||
legacy_plugins=ROOT/'mame/sources/MAME/plugins'
|
||||
if legacy_plugins.is_dir():
|
||||
plugin_paths.append(str(legacy_plugins))
|
||||
command=[str(mame),'sprinter','-noreadconfig','-rompath',str(profile.rompath),
|
||||
'-bios',profile.bios,'-kbd','ms_naturl,bios=sp2k','-video','soft','-window',
|
||||
'-sound','none','-skip_gameinfo','-beta:wd179x:0','35hd',
|
||||
@@ -226,6 +234,13 @@ def main():
|
||||
'-debug','-debugger',args.debugger,
|
||||
'-plugin','sdbgbridge','-pluginspath',';'.join(plugin_paths),
|
||||
'-autoboot_delay','0','-autoboot_script',str(lua)]
|
||||
if args.app_hdd:
|
||||
app_hdd=Path(args.app_hdd).resolve()
|
||||
if not app_hdd.is_file():
|
||||
raise ValueError('Не найден CHD приложения: '+str(app_hdd))
|
||||
mounted_app_hdd=state/'application.chd'
|
||||
shutil.copyfile(app_hdd,mounted_app_hdd)
|
||||
command.extend(['-hard2',str(mounted_app_hdd)])
|
||||
for name in ('nvram','cfg','diff','snapshot'):
|
||||
command.extend(['-'+name+'_directory',str(state/name)])
|
||||
log=(state/'mame.log').open('w')
|
||||
|
||||
Reference in New Issue
Block a user