Repository navigation
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::Savemerges the choices of the user into the config file instead of writing every setting that differs from its defaultReset()returns a setting to its default at any layer below the lock layer, and the nextSaveremoves its entry- Add
Setting<T>::Set(layer, value)for a typed write at a named layer, andSettingBase::GetEntryfor the value with the layer it came from - Retire the flat setting names of earlier SDKs, such as
headless,user_languageandvideo_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
Allowedfor 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
AddAliaswith 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::GetCommandLinefor the named command line values - Allow a title app to override
TitleApp::OnStop - The config file and the
REX_environment variables can setapp.single_instance App::ReportUnknownSettingsreturnsvoidapp.cache_rootdefaults to{app.user_root}/cache. An empty value keeps no cache- Add
TitleRuntime::AllocateThunkto give a host function a guest address that guest code can call - Add
GetTitleExitReasonNamefor the lowercase name of each exit reason - A module must list every interface it serves. An unlisted interface is never found
Input
- Add
conflict_masktoBindingConfig. Two bindings conflict when their masks share a bit, and the group decides only when either mask is zero - Add
shares_withtoBindingConfig, the names of other bindings in the set that may use the same input - Replace
IBindingSet::FindConflictwithFindConflictsto return every conflicting binding - Add
rex::EnumSetinrex/bit.hfor sets of index enum values, and use it for pad button masksKeyCaptureConfig::pad_cancel_maskandIKeyCapture::SetPadButtonstakeEnumSet<PadInput>in place of au32maskPadInput::kCountreplaceskPadButtonCount
- Add
hid.sdl.background_eventsto 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.DialogBasereturns false - Add
IUISystem::IsExclusiveInputActive IUISystem::ShowMessageuses the message box of the platform when there is no window (a native box on Windows, a line on stderr elsewhere), unlessui.driverisnone- Add the
kOpenFoldersfile 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
HostLocalefromrex::uiinrex/ui/window.htorex::platforminrex/platform/locale.h - Add
platform::GetPreferredLocalesto read the host locales without the UI driver, andxam::GetLanguageForLocalesto 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
IsDeviceNameinrex/platform/file.h
Kernel
- Rename
GuestVectortoGuestStdVector, and addGuestStdVectorLayout::kWithAllocatorfor 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::SelfSuspendreturnsX_STATUSand writes the previous count to an out parameterplatform::Event::Set,ResetandPulsereturn the previous signal stateX_FILE_BASIC_INFORMATION::attributesis abe_u32followed 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_MEMmemory wait
Logging and Profiling
- Add
REXLOG_CAT_FIRSTand the*_WARN_FIRSTmacros to log only the first hits of a site - Add
REX_PROFILE_PLOT_CONFIGto set the format of a plot - Report a log call made while the thread holds a leaf lock, in builds with lock rank checks
rexglueshows SDK log lines atwarnand above by default.--log-levelor--verboseshows 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_MSandREXTEST_BENCHMARK_HIGH_PRIORITYto 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_INTERFACElookups 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
NtRemoveIoCompletiontimeout - 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
NtOpenFilein order, and ignore the attributes of a basic information set - Read the
XMA_LOOP_DATAof the title inXMASetLoopData - Silence the audio of a title as soon as it starts terminating
XAM and networking
- Return the console language from
XamGetLanguage - Fix accept,
FIONREADand privileged port binds for title sockets - Return the results of an offline console from
XNetLogonGetTitleIDandXamUserGetAgeGroup - 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_formattexture 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
ThreadStopand catch it at the Windows thread entry to prevent an uncaught stop outsiderexbase - 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
SetLimitskeeps 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
GuestVectortoGuestStdVector - Replace
FindConflictwithFindConflicts. It returns astd::vector<size_t>, empty when nothing conflicts, in place of astd::optional<size_t> - Replace
kPadButtonCountwithPadInput::kCount, and pass anEnumSet<PadInput>in place of au32mask toSetPadButtonsandpad_cancel_mask - Replace
ui::HostLocalewithplatform::HostLocalefromrex/platform/locale.h. A UI driver returns that type fromGetPreferredLocales - A dialog that derives from
IDialogand notDialogBaseimplementsWantsExclusiveInput - A class that implements
platform::Eventreturns the previous signal state fromSet,ResetandPulse - Callers of
KernelThread::SelfSuspendpass a pointer for the previous count and check the returnedX_STATUS - Code that reads
X_FILE_BASIC_INFORMATION::attributesreads 32 bits - Remove any check of the result of
App::ReportUnknownSettings - List every interface a module serves
- Call
rex::detail::ForgetAppInterfaceswhen theQueryInterfaceof 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_rootto 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,
NtRemoveIoCompletiontimeout, 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
XNetLogonGetTitleIDandXamUserGetAgeGroup TitleRuntime::AllocateThunk, thekOpenFoldersfile dialog mode andhid.sdl.background_events- The
NtOpenFileargument fix, the title audio silence on terminate and theThreadStopexport - 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
SetLimitsaspect ratio fix - The test leak fixes, the kernel and base benchmarks, the benchmark warm up options and the
app.cache_rootdocs
- The read/write lock writer wake,
- @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_MEMbackend 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_formattexture fetches - @Tzeentchnet for the Vulkan present semaphore fix