Two command-line and GUI defects fixed: ROMs named on the command line are no longer dropped after --no-console, and the file dialog can no longer freeze the emulator after a close/open round trip.
A ROM named on the command line after --no-console was silently ignored. The flag is consumed by the driver itself, so the configuration parser saw an unknown argument, gave up, and returned "no ROM" — anything after the flag never loaded. The parser now keeps a registry of driver-owned flags and skips them without consuming a value or shifting an argument index; with or without the flag, and with Chinese-named ROMs, behavior is otherwise unchanged.
Closing a ROM and immediately reopening one could freeze the emulator for good. On Windows 11 the native file dialog can end up running on an internal host thread, and its close-time EnableWindow on the main window then blocks as a cross-thread message that the GUI thread — parked inside the dialog's own COM wait — never pumps; both sides wait forever, and autosave never runs. The load now runs only after the dialog has fully unwound, and every native dialog open holds one extra STA reference on the GUI thread (a deliberate, unbalanced CoInitializeEx — bookkeeping only). Without that reference, five independent trials hung within one or two cycles; with it, eighteen consecutive dialog opens never hung. Error popups also no longer stack or drop queued messages. The non-native dialog remains available as a fallback via SDL.UseNativeFileDialog=0.
修复两项命令行及图形界面缺陷:在 --no-console 参数后附带指定的 ROM 文件不再被丢弃;文件对话框经一次关闭、重新打开的操作流程后,也不会再造成模拟器卡死。
原先,在 --no-console 之后通过命令行传入的 ROM 路径会被静默忽略。该参数由驱动层直接处理,配置解析器会将其识别为未知参数,随即终止解析,判定 “未指定 ROM”,导致该参数之后的所有 ROM 路径都无法加载。现已修改实现:解析器维护一份驱动专属参数清单,识别到这类参数时直接跳过,不占用参数值、不偏移参数索引;无论是否携带该参数,中文命名 ROM 等原有逻辑行为保持不变。
先关闭 ROM、紧接着重新打开 ROM,曾会造成模拟器永久卡死。在 Windows 11 环境下,原生文件对话框有可能在一条内部宿主线程中执行;对话框关闭时会对主窗口调用 EnableWindow,这是一条跨线程消息,但此时图形界面线程正阻塞在对话框自身的 COM 等待流程中,无法调度消息,最终形成双向死锁,自动存档功能也无法执行。现调整逻辑:等待对话框资源完全释放后,再执行 ROM 加载;同时每次唤起原生文件对话框时,都会为图形界面线程额外持有一条 STA 引用(主动不做配对释放的 CoInitializeEx,仅用于线程状态记账)。缺少该引用时,五次独立测试都在一两次开闭循环内复现卡死;加入该机制后,连续十八次打开对话框均未出现卡死。错误弹窗也修复了消息堆积、消息丢失问题。用户仍可通过配置 SDL.UseNativeFileDialog=0,降级使用非原生对话框作为备选方案。