Skip to content

v0.13.0

Latest

Choose a tag to compare

@github-actions github-actions released this 04 Dec 21:49
· 6 commits to main since this release

Summary

This release fixes many kernel, XAM, GPU and macOS issues and adds new settings, input, and filesystem features.

Caution

This release has breaking changes. Migration steps are at the bottom.

Settings

  • A syntax error or invalid value in a setting file now logs a warning and keeps the previously set or default value instead of halting startup
    • This covers a config file that does not parse, a refused value, and an unknown name or command line option
    • Startup stops only for an error in the program, such as an invalid or duplicate action name from GetActions
  • SettingsRegistry::Save merges the choices of the user into the config file instead of writing every setting that differs from its default
  • Reset() returns a setting to its default at any layer below the lock layer, and the next Save removes its entry
  • Add Setting<T>::Set(layer, value) for a typed write at a named layer, and SettingBase::GetEntry for the value with the layer it came from
  • Retire the flat setting names of earlier SDKs, such as headless, user_language and video_driver. A value set under one of them is ignored and logs a warning. The full list is under Removed Names in the settings reference
  • Check Allowed for every setting type, and list the allowed values of every type in the settings overlay
  • Resolve aliases one way. A registered setting name is never an alias, and AddAlias with one gives a notice and changes nothing
  • Load the config file as one batch
  • Return the settings of an owner that is not registered to their defaults when a session ends

Runtime / App

  • Add App::GetCommandLine for the named command line values
  • Allow a title app to override TitleApp::OnStop
  • The config file and the REX_ environment variables can set app.single_instance
  • App::ReportUnknownSettings returns void
  • app.cache_root defaults to {app.user_root}/cache. An empty value keeps no cache
  • Add TitleRuntime::AllocateThunk to give a host function a guest address that guest code can call
  • Add GetTitleExitReasonName for the lowercase name of each exit reason
  • A module must list every interface it serves. An unlisted interface is never found

Input

  • Add conflict_mask to BindingConfig. Two bindings conflict when their masks share a bit, and the group decides only when either mask is zero
  • Add shares_with to BindingConfig, the names of other bindings in the set that may use the same input
  • Replace IBindingSet::FindConflict with FindConflicts to return every conflicting binding
  • Add rex::EnumSet in rex/bit.h for sets of index enum values, and use it for pad button masks
    • KeyCaptureConfig::pad_cancel_mask and IKeyCapture::SetPadButtons take EnumSet<PadInput> in place of a u32 mask
    • PadInput::kCount replaces kPadButtonCount
  • Add hid.sdl.background_events to keep pads working while the window does not have focus

UI

  • Add IDialog::WantsExclusiveInput. A dialog that returns true holds the input block while it is added. DialogBase returns false
  • Add IUISystem::IsExclusiveInputActive
  • IUISystem::ShowMessage uses the message box of the platform when there is no window (a native box on Windows, a line on stderr elsewhere), unless ui.driver is none
  • Add the kOpenFolders file dialog mode for picking one or more folders
  • Load achievement icons from the XDBF of the title when the icon file does not exist
  • Move HostLocale from rex::ui in rex/ui/window.h to rex::platform in rex/platform/locale.h
  • Add platform::GetPreferredLocales to read the host locales without the UI driver, and xam::GetLanguageForLocales to pick from the languages a title accepts

Filesystem

  • Accept a GDFX disc image (ISO) as title.game_root. A disc image is always read only
  • Keep non ASCII paths as UTF-8 on Windows
  • Write host files under a unique temporary name
  • Expose IsDeviceName in rex/platform/file.h

Kernel

  • Rename GuestVector to GuestStdVector, and add GuestStdVectorLayout::kWithAllocator for title vectors that store an allocator word first
  • Accept a type in parentheses in REX_GUEST_GLOBAL, for a type that holds a comma
  • KernelThread::SelfSuspend returns X_STATUS and writes the previous count to an out parameter
  • platform::Event::Set, Reset and Pulse return the previous signal state
  • X_FILE_BASIC_INFORMATION::attributes is a be_u32 followed by padding
  • Add BaseHeap::QueryProtect
  • Replace the workspace range allocator with a free list inside WorkspaceHeap

Graphics / GPU

  • Let a backend act during a WAIT_REG_MEM memory wait

Logging and Profiling

  • Add REXLOG_CAT_FIRST and the *_WARN_FIRST macros to log only the first hits of a site
  • Add REX_PROFILE_PLOT_CONFIG to set the format of a plot
  • Report a log call made while the thread holds a leaf lock, in builds with lock rank checks
  • rexglue shows SDK log lines at warn and above by default. --log-level or --verbose shows the rest
  • Log the critical section spin bound at trace level

Build / CMake

  • Bump the SDK version to 0.13.0
  • Include the Vulkan loader in the macOS package, and install MoltenVK from its target file
  • Disable the Tracy crash handler on platforms other than Windows
  • Add REXTEST_BENCHMARK_WARMUP_MS and REXTEST_BENCHMARK_HIGH_PRIORITY to the benchmark target
  • Take the notes of a release build from the release pull request

Interface Version Changes

Interface 0.12.0 0.13.0
IAudioSystem 3 4
IGraphicsSystem 3 4
IInputSystem 4 8
IUISystem 3 5
ISettingsRegistry 2 3
IObjectTable 4 5

Performance

  • Cache REX_INTERFACE lookups per interface
  • Write type 0 packets as a register range
  • Yield on a zero delay at normal guest priority instead of sleeping on POSIX hosts
  • Keep the priority of the caller when it yields on macOS

Tests

  • Print SDK log lines only for a failing test
  • Report a throwing guest body as a test failure
  • Stop settings, the fake UI and stub warnings from leaking between tests
  • Add benchmarks for heap locks, zero delays, read/write locks, page queries, watched page faults and guest events
  • Expect one whole page upload for a 4 KiB range on hosts with 16 KiB pages

Fixes

Kernel

  • Wake a waiting writer when the exclusive owner releases a read/write lock
  • Keep all 64 bits of the NtRemoveIoCompletion timeout
  • Report the page of a queried address, and no protection for reserved pages
  • Report the old protection as page flags, and size regions without a base in pages
  • Return the previous signal state from the event set, reset and pulse exports
  • Return the previous counts from mutants and semaphores, and write the timer state as one byte
  • Return and limit thread suspend counts the way the console does
  • Reject a wait for all that names an object twice
  • Read the arguments of NtOpenFile in order, and ignore the attributes of a basic information set
  • Read the XMA_LOOP_DATA of the title in XMASetLoopData
  • Silence the audio of a title as soon as it starts terminating

XAM and networking

  • Return the console language from XamGetLanguage
  • Fix accept, FIONREAD and privileged port binds for title sockets
  • Return the results of an offline console from XNetLogonGetTitleID and XamUserGetAgeGroup
  • Install content without holding the leaf lock
  • Retry a refused package folder move

Codegen

  • Reset the floating point mode after a mid function hook call
  • Put the title paths back when a tool runtime ends or its open fails

Graphics

  • Wait for Vulkan presents before reusing a present semaphore or retiring a swapchain
  • Back off between polls of a timed wait instead of sleeping its whole timeout
  • Round transcendental shader results to 21 mantissa bits
  • Scale integer num_format texture fetches to the guest range
  • Give back faces their own stencil reference on D3D12
  • Unwatch a destroyed texture under the watch lock
  • Log an invalid texture fetch constant once, not on every draw

Base and platform

  • Check a pointer in the host allocator before freeing it in every build
  • Decode macOS faults from the exception state without reading a pc that cannot be fetched
  • Unlink the shared memory name of a file mapping at creation on macOS
  • Export ThreadStop and catch it at the Windows thread entry to prevent an uncaught stop outside rexbase
  • Use the error code overloads of std::filesystem

Settings

  • Deliver every setting change and compare numbers exactly
  • Resolve old names in SettingsRegistry::Find
  • Flush settings to disk only in Save, not on every host file write

Filesystem and UI

  • Run the whole delta list of a XEX header patch
  • Leave the aspect ratio of the window alone when SetLimits keeps it
  • Show save results in the settings overlay, and reset through Reset

Migration

  • Rebuild any module or driver built against 0.12.0
  • Run rexglue codegen <project.toml> once after updating when the project has mid function hooks. The build does not rerun codegen for an SDK update
  • Rename GuestVector to GuestStdVector
  • Replace FindConflict with FindConflicts. It returns a std::vector<size_t>, empty when nothing conflicts, in place of a std::optional<size_t>
  • Replace kPadButtonCount with PadInput::kCount, and pass an EnumSet<PadInput> in place of a u32 mask to SetPadButtons and pad_cancel_mask
  • Replace ui::HostLocale with platform::HostLocale from rex/platform/locale.h. A UI driver returns that type from GetPreferredLocales
  • A dialog that derives from IDialog and not DialogBase implements WantsExclusiveInput
  • A class that implements platform::Event returns the previous signal state from Set, Reset and Pulse
  • Callers of KernelThread::SelfSuspend pass a pointer for the previous count and check the returned X_STATUS
  • Code that reads X_FILE_BASIC_INFORMATION::attributes reads 32 bits
  • Remove any check of the result of App::ReportUnknownSettings
  • List every interface a module serves
  • Call rex::detail::ForgetAppInterfaces when the QueryInterface of a module returns a different interface while the app runs
  • Replace any retired flat setting name in config files and launch arguments with its current name
  • Set app.cache_root to empty to keep no shader or pipeline cache
  • Check the log for setting warnings after a config change

Thanks

Thank you to everyone who contributed to this release!

  • @Graine25
    • The read/write lock writer wake, NtRemoveIoCompletion timeout, page query and old protection fixes
    • The event, mutant, semaphore and timer state fixes, thread suspend counts and the wait for all check
    • The title socket fixes and the offline console results for XNetLogonGetTitleID and XamUserGetAgeGroup
    • TitleRuntime::AllocateThunk, the kOpenFolders file dialog mode and hid.sdl.background_events
    • The NtOpenFile argument fix, the title audio silence on terminate and the ThreadStop export
    • The macOS fault decode, shared memory unlink and yield priority fixes, and the zero delay yield on POSIX hosts
    • The settings reset for owners that are not registered, the tool runtime title paths and the SetLimits aspect ratio fix
    • The test leak fixes, the kernel and base benchmarks, the benchmark warm up options and the app.cache_root docs
  • @gtguerreiro-max for XamGetLanguage, the XEX header patch delta list, the texture unwatch and D3D12 back face stencil fixes, and the transcendental rounding
  • @scrieve for the WAIT_REG_MEM backend hook, the texture fetch constant log, the timed wait back off and the cache default
  • @Cioscos for disc images as the game root and type 0 packets as a register range
  • @dwreckgg for UTF-8 paths on Windows, XMASetLoopData, the Tracy crash handler and the privileged port test
  • @synthic for achievement icons from the XDBF
  • @LaLemniscata for the integer num_format texture fetches
  • @Tzeentchnet for the Vulkan present semaphore fix