Skip to content

Commit c52f432

Browse files
gmarullclaude
andcommitted
wscript: add --qemu-decoration option
Introduce a per-board table of QEMU SDL decorations (emery, flint, gabbro) with the first entry as the default, and expose a --qemu-decoration CLI option to override it. "none" disables the decoration entirely. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
1 parent 85bd9cd commit c52f432

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

wscript

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ RUNNERS = {
4343
'getafix_dvt2': ['sftool'],
4444
}
4545

46+
# QEMU SDL decorations per board. The first entry is used as the default.
47+
QEMU_DECORATIONS = {
48+
'qemu_emery': ['pt2-br', 'pt2-sb'],
49+
'qemu_flint': ['p2d-bk', 'p2d-wh'],
50+
'qemu_gabbro': ['pr2-bk20', 'pr2-gd14'],
51+
}
52+
53+
QEMU_DECORATION_CHOICES = sorted({d for ds in QEMU_DECORATIONS.values() for d in ds}) + ['none']
54+
4655
def truncate(msg):
4756
if msg is None:
4857
return msg
@@ -147,6 +156,11 @@ def options(opt):
147156
opt.add_option('--onlysdk', action='store_true', help="only build the sdk")
148157
opt.add_option('--qemu_host', default='localhost:12345',
149158
help='host:port for the emulator console connection')
159+
opt.add_option('--qemu-decoration', action='store', default=None,
160+
choices=QEMU_DECORATION_CHOICES,
161+
help='SDL decoration to use for QEMU. Defaults to the per-board '
162+
'default (emery: pt2-br, flint: p2d-bk, gabbro: pr2-bk20). '
163+
'Pass "none" to disable decorations.')
150164
opt.add_option('--screenshot-output', default=None,
151165
help='Output path for `./waf screenshot` (must end in .png). '
152166
'Defaults to build/screenshot.png')
@@ -970,7 +984,15 @@ def qemu_launch(ctx):
970984

971985
# Always keep the host cursor visible over the emulator window.
972986
import platform
973-
display_type = 'cocoa' if platform.system() == 'Darwin' else 'sdl'
987+
decoration = ctx.options.qemu_decoration
988+
if decoration is None:
989+
decoration = QEMU_DECORATIONS.get(ctx.env.BOARD, [None])[0]
990+
if platform.system() == 'Darwin':
991+
display_type = 'cocoa'
992+
elif decoration and decoration != 'none':
993+
display_type = 'sdl,decoration=%s' % decoration
994+
else:
995+
display_type = 'sdl'
974996
machine_dep_args.extend(['-display', '%s,show-cursor=on' % display_type])
975997

976998
mon_sock = ctx.path.get_bld().make_node('qemu-mon.sock').abspath()

0 commit comments

Comments
 (0)