ares-headless#2467
Draft
awsms wants to merge 9 commits into
Draft
Conversation
Add a headless target for running ares without the desktop UI stack. This introduces a separate executable wired directly against ares, mia, and nall, and makes it possible to launch content from the command line without depending on ruby, hiro, or the desktop frontend. To support that, add an ARES_BUILD_DESKTOP_UI option at the top level so GUI dependencies can be disabled for headless-oriented builds. Also make mia-ui conditional on hiro actually being present, so optional-target builds still configure correctly when the desktop UI is turned off. The headless build loads media through mia, derives a default system and profile from the detected medium, connects default media and controller ports, and runs the emulation loop until completion criteria are met. Initial CLI support includes: - --system to override medium detection - --benchmark for.. benchmarks - --run-frames for fixed-length execution - --video-checksum to print the final frame hash
Expand the initial nogui into something much closer to a usable automation and tooling interface. Add save state loading and saving, including optional slot parsing and save-on-exit behavior, and extend nall::Arguments with takeOptional() so flags that accept an optional value can be handled cleanly. Introduce launch/settings parsing in a dedicated settings module. This adds support for --settings-file and --setting name=value overrides, and plumbs selected values into runtime behavior. The settings layer also reads default save paths from settings.bml so the headless target can follow the same general save-location conventions as the desktop UI. Add several runtime CLI features: - --save-state with optional slot selection - --save-on-exit with optional slot selection - --save-last-frame to export the final rendered frame as PNG - --quiet / --verbose / --verbosity for log control - embedded GDB server configuration via launch settings
Refactor the headless target to break up the monolithic main source file into smaller, focused translation units. The previous single-file implementation had grown to include CLI parsing, numeric parsing helpers, runtime/platform callbacks, savestate handling, PNG output etc in one place, which made it harder to read and extend. Introduce dedicated modules for: - cli: command-line parsing and usage text - parse: shared integer parsing helpers - runtime: the ares::Platform implementation and frame/audio/input hooks - states: save-state path resolution and serialization helpers - video-output: frame resizing and PNG encoding helpers
This adds CLI options to dump mixed audio to WAV and to print the run's audio checksum. Also extends the headless runtime to enumerate audio streams, mix pending samples, and canonicalize the captured output as stereo 16-bit PCM. To improve reproducibility, the runtime now stabilizes node ordering for audio/video enumeration, aligns audio draining with the run loop exit boundary and forces a fixed RNG seed for headless runs, so cores that randomize boot-time audio state do not vary between runs.
Reuse the desktop settings.bml firmware mapping in headless mode. That way, systems requiring a BIOS to boot can resolve their configured firmware locations without a separate headless-only configuration. Also fix Mega Drive-family pak routing in the headless runtime so they resolve the correct paks instead of the wrong backing data.
6361a50 to
fc44d45
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
headless target; WIP.