Commit graph

2121 commits

Author SHA1 Message Date
flodavid 40644d43f7 yuzu: create linux group in general settings
- Create files dedicated to starting and stopping gamemode functions
  - Use them in yuzu and yuzu_cmd modules
2023-11-25 19:30:37 +01:00
xcfrg dfa56765d6 yuzu: integrate gamemode support on linux 2023-11-25 19:30:29 +01:00
GPUCode 5a9ffa81a6 host_memory: Simplify randomness generation 2023-11-25 00:47:43 -05:00
GPUCode c37b5f431f common: Enforce fastmem for nce usage 2023-11-25 00:47:36 -05:00
GPUCode 6de2edcca1 Address some review comments 2023-11-25 00:47:35 -05:00
GPUCode 8fab363237 android: Add cpu bakend gui toggle 2023-11-25 00:47:28 -05:00
Liam 9f91ba1f73 arm: Implement native code execution backend 2023-11-25 00:46:47 -05:00
GPUCode 4838837620 device_memory: Enable direct mapped addresses for nce 2023-11-25 00:46:47 -05:00
GPUCode 15331c2a60 settings: Add cpu backend setting 2023-11-25 00:46:15 -05:00
GPUCode 5938a9582a core: Respect memory permissions in Map 2023-11-25 00:46:15 -05:00
Liam 4766baddf3 host_memory: Switch to FreeRegionManager 2023-11-25 00:46:15 -05:00
Liam 448d4815de host_memory: ensure map base is between 36 and 39 bits 2023-11-25 00:46:15 -05:00
--author=Liam 29e7d79a86 common: Add free region manager
* Abstraction for placeholder region tracking in host_memory
2023-11-25 00:46:15 -05:00
GPUCode 20011dfeb8 common: Add libc sigaction hook 2023-11-25 00:46:15 -05:00
t895 ac522db857 common: settings: Add ifdefs to define android's default settings 2023-11-21 01:58:13 -05:00
t895 da14c7b8e4 config: Unify config handling under frontend_common
Replaces every way of handling config for each frontend with SimpleIni. frontend_common's Config class is at the center where it saves and loads all of the cross-platform settings and provides a set of pure virtual functions for platform specific settings.

As a result of making config handling platform specific, several parts had to be moved to each platform's own config class or to other parts. Default keys were put in platform specific config classes and translatable strings for Qt were moved to shared_translation. Default hotkeys, default_theme, window geometry, and qt metatypes were moved to uisettings. Additionally, to reduce dependence on Qt, QStrings were converted to std::strings where applicable.
2023-11-21 01:58:13 -05:00
liamwhite ea4c92f734
Merge pull request #12007 from german77/moar_buttons
core: hid: Split SL and SR buttons
2023-11-16 09:13:39 -05:00
liamwhite 247d66a680
Merge pull request #11990 from german77/audio
yuzu: Save mute when in background setting
2023-11-13 09:13:12 -05:00
GPUCode efc50485b8 renderer_vulkan: Introduce separate cmd buffer for uploads 2023-11-12 20:27:39 +01:00
german77 ae57a99d7d core: hid: Split SL and SR buttons 2023-11-11 21:03:15 -06:00
Liam 2a255b2d61 kernel: add KPageTableBase
Co-authored-by: Kelebek1 <eeeedddccc@hotmail.co.uk>
2023-11-10 12:01:35 -05:00
Narr the Reg 9e331f9957 yuzu: Make mute audio persistent 2023-11-10 10:22:04 -06:00
Narr the Reg 9169cbf728 yuzu: Save mute when in background setting 2023-11-10 10:22:02 -06:00
Charles Lombardo 4b321c003c arm: NativeClock: Special handling for bad system counter clock frequency reporting
On some devices, checking the system counter clock frequency will return 0. Substitute in the correct values to prevent issues.
2023-11-03 16:21:54 -04:00
Charles Lombardo 585b6e9d46 android: Fix resolving android URIs in native code 2023-10-30 11:38:10 -04:00
liamwhite eec3d356b6
Merge pull request #11689 from liamwhite/breakpad
qt: implement automatic crash dump support
2023-10-29 23:41:13 -04:00
Ameer J 9e4d606c4c nvidia_flags: Enable GL Threaded optimizations 2023-10-28 21:26:22 -04:00
Alexandre Bouvier 79ba5d9c26 cmake: prefer system stb headers 2023-10-25 21:47:32 +02:00
Liam 59b62c6507 common: use SetThreadDescription API for thread names 2023-10-20 11:41:29 -04:00
liamwhite 18672e6a78
Merge pull request #11159 from flodavid/master_bis
Enable to use controller to close a game
2023-10-14 09:58:03 -04:00
Valeri Ochinski ca75c9125d
common/polyfill_thread: use std::forward where appropriate, qualify std::move calls 2023-10-13 18:51:11 +03:00
liamwhite 519c12da15
Merge pull request #11746 from liamwhite/relr
jit: add support for relr-type relocations
2023-10-12 18:23:31 -04:00
Liam 2212c9653d kernel: mark TLS accessors as noinline for non-MSVC LTO 2023-10-12 09:16:22 -04:00
Florian 6c246f2ac5 yuzu: Use new setting method for stop emulation 2023-10-12 01:51:53 +02:00
Liam 7b5d234558 jit: add support for relr-type relocations 2023-10-11 11:13:19 -04:00
Fernando S b28b05e2aa
Merge pull request #11718 from liamwhite/arm64-native-clock
common: add arm64 native clock
2023-10-10 11:48:06 +02:00
liamwhite c0d152affa
Merge pull request #11705 from FearlessTobi/windows-sc
yuzu: Add desktop shortcut support for Windows (continuation of #11344)
2023-10-08 17:11:52 -04:00
liamwhite 85d99f873f
Merge pull request #10519 from mdmrk/master
yuzu-qt: Track play time
2023-10-08 17:11:34 -04:00
Liam 21bc2c14bc common: add arm64 native clock 2023-10-08 12:54:23 -04:00
Liam d3997bad9b qt: implement automatic crash dump support 2023-10-08 11:35:53 -04:00
FearlessTobi 9ef9ca0927 yuzu: Add desktop shortcut support for Windows
Allows creating desktop shortcuts with icons for yuzu games.

Co-Authored-By: Jeroen van Schijndel <13182141+roenyroeny@users.noreply.github.com>
2023-10-07 21:24:11 -04:00
Liam 38394f36d7 gdbserver: use numeric character references for unicode 2023-10-01 19:22:08 -04:00
liamwhite 7bae22a3ca
Merge pull request #11402 from FernandoS27/depth-bias-control
Vulkan: Implement Depth Bias Control
2023-09-28 09:35:37 -04:00
lat9nq 9335cf8857 settings_setting: Read audio engine
This was mysteriously missing, likely from when I ported Citra fixes
semi-recently.
2023-09-25 22:20:24 -04:00
Fernando Sahmkow f1a2e36711 Query Cachge: Fully rework Vulkan's query cache 2023-09-23 23:05:29 +02:00
Fernando Sahmkow b99f94a7ff Vulkan: add temporary workaround for AMDVLK 2023-09-16 11:59:20 -04:00
Kelebek1 67e2d5c28b Reimplement HardwareOpus 2023-09-16 11:56:25 -04:00
liamwhite 13d551846a
Merge pull request #11499 from Squall-Leonhart/bitlockerfix
add std::error_code for std::filesystem exceptions
2023-09-16 11:40:10 -04:00
liamwhite c05ea35f78
Merge pull request #11492 from lat9nq/c-numeric-conversions
general: Remove uncaught usages of C++ string number conversions
2023-09-16 11:40:03 -04:00
Squall-Leonhart 21ecf01a17 add std::error_code for std::filesystem exceptions
Resolves a case on Windows where an unmounted bitlocker protected volume containing an assigned game directory would crash Yuzu at start.

May also resolve cases where a disconnected SMB volume causes similar crashes (needs testing)
2023-09-15 04:47:15 +10:00
lat9nq fea5b758bc settings_common: Fix typo 2023-09-14 11:30:14 -04:00
GPUCode c656105a6c debug: Add renderdoc capture hotkey 2023-09-14 16:37:41 +03:00
liamwhite 04352a9aef
Merge pull request #11496 from liamwhite/ngc
ngc: implement service
2023-09-14 09:24:46 -04:00
liamwhite b5f99164f1
Merge pull request #11433 from liamwhite/shutdown-oopsie
polyfill_thread: ensure mutex was locked before signaling stop
2023-09-14 09:24:20 -04:00
Liam 9d7eebde7b ngc: implement service 2023-09-14 09:14:08 -04:00
lat9nq fe70c6f481 settings_setting: Don't remove the AudioEngine workaround 2023-09-13 15:59:44 -04:00
lat9nq 0098ecb609 settings: Retro-port Citra Settings work
This has yet to be PR'd on Citra, but regressions on yuzu that have
been fixed in Citra needed to appear here.
2023-09-13 13:36:25 -04:00
liamwhite ce5320c49f
Merge pull request #11447 from xcfrg/portable-compile-out
common: add a compile time option to allow disabling portable mode
2023-09-12 09:17:50 -04:00
xcfrg a02d641042
add a compile time option to allow disabling portable mode 2023-09-06 18:53:39 -04:00
Danila Malyutin 785e480b62 msvc: set warning level to /W4 globally
And fix a bunch of warnings
2023-09-03 18:42:10 +04:00
Liam bdd09d6844 polyfill_thread: ensure mutex was locked before signaling stop 2023-09-02 11:51:40 -04:00
Charles Lombardo 6c8f2b355a android: Expose interface for getting settings from native code
Completely removes code related to parsing the settings file on the java side. Now all settings are accessed via NativeConfig.kt and config.cpp has been modified to be closer to the core counterpart. Since the core currently uses QSettings, we can't remove reliance from Wini yet. This also includes simplifications to each settings interface to get closer to native code and prepare for per-game settings.
2023-08-29 19:40:17 -04:00
Mario 5464423667 yuzu-qt: Track play time 2023-08-26 22:20:19 -04:00
liamwhite 6c4abd23be
Merge pull request #11356 from lat9nq/console-mode-pg
general,config-qt: Present Console Mode as an enum with separate options in game properties
2023-08-26 19:15:00 -04:00
comex 91eb5afd0b Warnings cleanup for GCC 13 and Clang 16
Note: For GCC there are still a huge number of `-Warray-bounds` warnings
coming from `externals/dynarmic`.  I could have added a workaround in
`externals/CMakeLists.txt` similar to what this PR does for other
externals, but given Dynarmic's close affiliation with Yuzu, it would be
better to fix it upstream.

Besides that, on my machine, this makes the build warning-free except
for some warnings from glslangValidator and AutoMoc.

Details:

- Disable some warnings in externals.

- Disable `-Wnullability-completeness`, which is a Clang warning triggered
  by the Vulkan SDK where if any pointers in the header are marked
  _Nullable, it wants all pointers to be marked _Nullable or _Nonnull.
  Most of them are, but some aren't.  Who knows why.

- `src/web_service/verify_user_jwt.cpp`: Disable another warning when
  including `jwt.hpp`.

- `src/input_common/input_poller.cpp`: Add missing `override` specifiers.

- src/common/swap.h: Remove redundant `operator&`.  In general, this
  file declares three overloads of each operator.  Using `+` as an
  example, the overloads are:

  - a member function for `swapped_t + integer`
  - a member function for `swapped_t + swapped_t`
  - a free function for `integer + swapped_t`

  But for `operator&`, there was an additional free function for
  `swapped_t + integer`, which was redundant with the member function.
  This caused a GCC warning saying "ISO C++ says that these are
  ambiguous".
2023-08-25 19:22:31 -04:00
lat9nq ab862207d7 settings: Add docked mode helper function 2023-08-22 21:58:09 -04:00
lat9nq 387ede76d2 general: Convert use_docked_mode to an enumeration
Allows some special interactions with it in the Qt frontend.
2023-08-22 16:07:52 -04:00
liamwhite ef61d129d3
Merge pull request #11303 from lat9nq/screenshots-configurable
yuzu-qt: Add configuration for screenshot resolution
2023-08-22 11:30:25 -04:00
lat9nq 6fe51b48e9 yuzu-qt: Screenshots depend more on the graphics settings 2023-08-16 16:12:42 -04:00
lat9nq 96c98d09cb yuzu-qt: Implement unspecified screenshot ratio 2023-08-16 00:18:47 -04:00
lat9nq 3e28e85468 settings: Add AspectRatio enum, split res scale function 2023-08-15 22:41:50 -04:00
Liam 50eee9b218 fssystem: rework for yuzu style 2023-08-15 17:47:40 -04:00
Liam 86f6b6b7b2 vfs: expand support for NCA reading 2023-08-15 17:47:25 -04:00
Liam 023b9b38cc general: fix apple clang build 2023-08-09 22:38:37 -04:00
liamwhite fca7d975fd
Merge pull request #10839 from lat9nq/pgc-plus
general: Reimplement per-game configurations
2023-08-02 14:25:52 -04:00
Morph bb4e676155 wall_clock: Increase precision requirements
We are providing a conversion to nanoseconds in NativeClock, which is more precise than the GPU tick.
2023-07-27 18:40:56 -04:00
liamwhite d3da1e6517
Merge pull request #10990 from comex/ubsan
Fixes and workarounds to make UBSan happier on macOS
2023-07-26 10:33:28 -04:00
lat9nq 195403c87c (ui)settings: Add more runtime_modifiable settings 2023-07-25 23:14:13 -04:00
lat9nq 1bc0b673aa backend: Remove usage of explicit operator overload
Causes a crash on MSVC from a race condition on application quit.

Intended to address yuzu-emu/yuzu/issues/11137
2023-07-25 22:53:58 -04:00
lat9nq 397333b2d5 settings: Correct Linkage member impl location 2023-07-25 15:57:55 -04:00
lat9nq b1716a9e14 settings: Set GPU as default ASTC decoder 2023-07-24 16:28:13 -04:00
lat9nq f84e7b4656 settings_common: Document specializations 2023-07-23 16:21:08 -04:00
lat9nq 17b9c1e171 common,qt-config: Remove usage of forward_list 2023-07-21 23:09:09 -04:00
liamwhite 8927f016e1
Merge pull request #11069 from lat9nq/mingw-no-tzdb
common: Use arithmetic instead of string ops to get time zone
2023-07-21 15:05:59 -04:00
lat9nq 2911988b85 settings_common: Use a vector in category linkage
Improve storage requirements.
2023-07-21 10:56:55 -04:00
lat9nq ffb384463f settings: Remove sorting from log
Unecessary, and would run every time the settings are logged.
2023-07-21 10:56:55 -04:00
lat9nq 3211623192 common: Move global configuration state modifiers back to settings 2023-07-21 10:56:55 -04:00
lat9nq b02e7eea78 settings_setting: Fix typo 2023-07-21 10:56:55 -04:00
lat9nq 1e093767a8 common,configure_system: Rename method to GetCategory
Fixes essentially a shadowing issue.
2023-07-21 10:56:55 -04:00
lat9nq 267f3c7905 settings: Cleanup
Addresses review feedback

Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
2023-07-21 10:56:55 -04:00
lat9nq 127b3da0f1 core,common: Give memory layout setting an enum
Allows for 6GB and 8GB layouts to be selected.
2023-07-21 10:56:55 -04:00
lat9nq ff6a5031d5 settings: Require time zone setting value for stirng 2023-07-21 10:56:55 -04:00
lat9nq e7f01128f1 settings: Give indices to enums 2023-07-21 10:56:55 -04:00
lat9nq 52cc7b438b settings_common: Remove unncessary enum spec 2023-07-21 10:56:55 -04:00
lat9nq 8497fb0a04 settings_enums: Remove casting
Not sure how I missed this earlier, but these vectors can be constructed
using the type of the enum.
2023-07-21 10:56:55 -04:00
lat9nq 54d58130a0 settings_setting: Silence shadowing warnings 2023-07-21 10:56:55 -04:00
lat9nq 926f3e3d3e settings,configuration: Add a default suffix 2023-07-21 10:56:55 -04:00
lat9nq 7f708e8d77 settings: Define paired settings
settings_common: Remove unused optional
2023-07-21 10:56:55 -04:00
lat9nq b2438f1fb7 settings: Define specializations for settings
Suggests to a frontend how to represent each setting.
2023-07-21 10:56:55 -04:00
lat9nq 8b28aa45b9 settings,translation: Fix time zone enum
Renames enum values to conform to naming convention.
2023-07-21 10:56:55 -04:00
lat9nq 8366736b67 settings,opengl,yuzu-qt: Fix AA, Filter maximums
The new enum macros don't support setting values directly.
For LastAA and LastFilter, this means we need a simpler approach to loop
around the toggle in the frontend...
2023-07-21 10:56:55 -04:00
lat9nq 7ffbffe170 settings_enums: More aggressively use macros
This lets us define an enum and all the textual representations
of its values in one swing. All for the price of some ugly macros.
2023-07-21 10:56:55 -04:00
lat9nq fdbeb84168 settings,uisettings: Remove leading underscore 2023-07-21 10:56:55 -04:00
lat9nq 3a7705e774 settings: Move speed_limit to core 2023-07-21 10:56:55 -04:00
lat9nq 3f0cc544cf common,yuzu-qt: Avoid explicit instantiation on old clang
Clang versions < 15 have compile issues with explicit instantiation.
Disable it for these versions.
2023-07-21 10:56:55 -04:00
lat9nq c97cbd089b settings_setting: Fix MSVC error 2023-07-21 10:56:55 -04:00
lat9nq ee32b17782 common,yuzu-qt: GCC warning silences
Fixes -Wshadow, -Wdeprecated, and catch by copy rather than by ref.
2023-07-21 10:56:55 -04:00
lat9nq a0883526d6 settings: Delete cpu_accuracy_first_time
Almost a 2 year old migration setting now
2023-07-21 10:56:54 -04:00
lat9nq 27e53990ed settings: Document BasicSetting, add Ranged 2023-07-21 10:56:54 -04:00
lat9nq b4f2ad3ff5 settings: Move IsConfiguringGlobal to settings_common 2023-07-21 10:56:54 -04:00
lat9nq 11e7e1b8ce settings: Move some simple data to BasicSetting
Reduces the need for the compiler to duplicate this code, by about
100KB executable size.
2023-07-21 10:56:54 -04:00
lat9nq 4903f40efe settings_setting: Fix errors
ToString didn't have a constexpr if statement where needed.
Canonicalize missed an else, causing unreachable code error on MSVC.
2023-07-21 10:56:54 -04:00
lat9nq 04d4b6ab80 (ui,)settings: Use explicit instantiation
Reduces compile times a tad on clang.
2023-07-21 10:56:54 -04:00
lat9nq 02265f19d9 settings: Remove redundant false literals 2023-07-21 10:56:54 -04:00
lat9nq 0193add060 general: Add typeinfo where needed
Using typeid without including typeinfo first produces an ill-formed program.
2023-07-21 10:56:54 -04:00
lat9nq 2fba913d0b settings_enums: Add const type where needed 2023-07-21 10:56:54 -04:00
lat9nq b86171d2b5 settings: yuzu is not capitalized why is it capitalized stop no bad 2023-07-21 10:56:54 -04:00
lat9nq 163f229d26 settings: Reorder
Groups graphics audio and system settings together in a way that
reflects the frontend. This also just conceptually groups them more
nicely than they were.
2023-07-21 10:56:54 -04:00
lat9nq 78b2709373 settings: Report all contained settings values
Also adds a couple characters that denotes the state of the setting.
M for modified, or not default.
C for custom, in context of per-game settings.
2023-07-21 10:56:54 -04:00
lat9nq 8c17a945f7 settings_enums: Cannonicalize settings names
Gives every option of the enums a string literal via a macro.
2023-07-21 10:56:54 -04:00
lat9nq d146dd9d12 settings,general: Rename non-confirming enums 2023-07-21 10:56:54 -04:00
lat9nq 3281ea935f settings: Make volume runtime-configurable 2023-07-21 10:56:07 -04:00
lat9nq 432f68ad29 configure_audio: Implement ui generation
Needs a considerable amount of management specific to some of
the comoboboxes due to the audio engine configuration.

general: Partial audio config implmentation

configure_audio: Implement ui generation

Needs a considerable amount of management specific to some of
the comoboboxes due to the audio engine configuration.

general: Partial audio config implmentation

settings: Make audio settings as enums
2023-07-21 10:56:07 -04:00
lat9nq 88d3de4e85 settings: Split enums to new file 2023-07-21 10:56:07 -04:00
lat9nq 4c4bc134a9 settings, uisettings: Initialize linkage counter 2023-07-21 10:56:07 -04:00
lat9nq 8e15146026 configure_system: Implement with for loop 2023-07-21 10:56:07 -04:00
lat9nq cdb5dea269 settings: Move runtime and save to parameters
These don't need to be whole new types.
2023-07-21 10:56:07 -04:00
lat9nq 464aad52cd settings: Add UiGeneral class 2023-07-21 10:56:07 -04:00
lat9nq d35577d3ed configuration: Implement slider 2023-07-21 10:56:07 -04:00
lat9nq 3a7a5edcea settings: Define base renderer runtime modifiable settings 2023-07-21 10:56:07 -04:00
lat9nq a4de202cbd settings: Add anisotropy mode enum 2023-07-21 10:56:07 -04:00
lat9nq cfb63c68db shared_translation: Finish using int ids 2023-07-21 10:56:07 -04:00
lat9nq bafd569b47 settings,uisettings: Add IDs to settings 2023-07-21 10:56:07 -04:00
lat9nq f8435d676f configure_graphics: Partial runtime implementation 2023-07-21 10:56:07 -04:00
lat9nq 75d7e40113 settings: Recategorize a bit
Will help with generating config UI later.
2023-07-21 10:56:07 -04:00
lat9nq a007ac6b9c configure_graphics_advance: Generate UI at runtime
We can iterate through the AdvancedGraphics settings and generate the UI
during runtime. This doesn't help runtime efficiency, but it helps a ton
in reducing the amount of work a developer needs in order to add a new
setting.
2023-07-21 10:56:07 -04:00
lat9nq 60773194a0 settings: Add a registry of settings
LoadString: Sanitize input

settings: Handle empty string, remove redundant category

settings: Rename Input to Controls, FS to DataStorage

settings: Fix Controls groups information

settings: Move use_docked_mode to System (again)

settings: Document

settings: Add type identification function

settings: Move registry into values

settings: Move global_reset_registry into values

settings: Separate AdvGraphics from Renderer

settings: More document

squash

settings: Use linkage object

uisettings: Move registry into settings

Probably wont build without

uisettings: Use settings linkage object

config: Load settings with a map

Uses the new all_settings vector to load settings.

qt-config: Rename settings category

qt config: Rename to read category

config: Read/write contols category with for_each

This is extremely limited due to the complexity of the Controls group,
but this handles the the settings that use the interface.

qt-config: Use new settings registry

qt-config: Read/write advgrphics

qt-config: Use settings linkage object

yuzu_cmd: Load setting off of vector

cmd-config: Finish settings rename

config: Read controls settings group with for_each

cmd/config: Move registry into values

cmd: Read adv graphics

cmd-config: Use settings linkage object
2023-07-21 10:56:07 -04:00
lat9nq 4133165607 settings,core,config_sys: Remove optional type from custom_rtc, rng_seed
core: Fix MSVC errors
2023-07-21 10:56:07 -04:00
lat9nq 5ccfaf0517 settings: Pool SetGlobal functions 2023-07-21 10:56:07 -04:00
lat9nq 5cffa34288 settings,video_core: Consolidate ASTC decoding options
Just puts them all neatly into one place.
2023-07-21 10:56:07 -04:00
lat9nq 71b3b2a2f0 general: Silence -Wshadow{,-uncaptured-local} warnings
These occur in the latest commits in LLVM Clang.
2023-07-18 19:31:35 -04:00
Morph e0fb1d3d17 ssl: Reorder inclusions 2023-07-17 15:46:24 -04:00
liamwhite 2461c78e3f
Merge pull request #10912 from comex/ssl
Implement SSL service
2023-07-16 16:56:47 -04:00
comex d7c532d889 Fixes and workarounds to make UBSan happier on macOS
There are still some other issues not addressed here, but it's a start.

Workarounds for false-positive reports:

- `RasterizerAccelerated`: Put a gigantic array behind a `unique_ptr`,
  because UBSan has a [hardcoded limit](https://stackoverflow.com/questions/64531383/c-runtime-error-using-fsanitize-undefined-object-has-a-possibly-invalid-vp)
  of how big it thinks objects can be, specifically when dealing with
  offset-to-top values used with multiple inheritance.  Hopefully this
  doesn't have a performance impact.

- `QueryCacheBase::QueryCacheBase`: Avoid an operation that UBSan thinks
  is UB even though it at least arguably isn't.  See the link in the
  comment for more information.

Fixes for correct reports:

- `PageTable`, `Memory`: Use `uintptr_t` values instead of pointers to
  avoid UB from pointer overflow (when pointer arithmetic wraps around
  the address space).

- `KScheduler::Reload`: `thread->GetOwnerProcess()` can be `nullptr`;
  avoid calling methods on it in this case.  (The existing code returns
  a garbage reference to a field, which is then passed into
  `LoadWatchpointArray`, and apparently it's never used, so it's
  harmless in practice but still triggers UBSan.)

- `KAutoObject::Close`: This function calls `this->Destroy()`, which
  overwrites the beginning of the object with junk (specifically a free
  list pointer).  Then it calls `this->UnregisterWithKernel()`.  UBSan
  complains about a type mismatch because the vtable has been
  overwritten, and I believe this is indeed UB.  `UnregisterWithKernel`
  also loads `m_kernel` from the 'freed' object, which seems to be
  technically safe (the overwriting doesn't extend as far as that
  field), but seems dubious.  Switch to a `static` method and load
  `m_kernel` in advance.
2023-07-15 12:00:28 -07:00
lat9nq 63a0a1f826 time_zone: Clean up includes 2023-07-12 03:03:03 -04:00
lat9nq 9e0d6f7d54 time_zone: Swap subtraction order 2023-07-12 03:02:45 -04:00
lat9nq 13755c0903 time_zone: Account for leap years
Protects against invalid hour offsets during transitions to years
following leap years.
2023-07-12 02:34:02 -04:00
bunnei ce7c418e0c
Merge pull request #10996 from Kelebek1/readblock_optimisation
Use spans over guest memory where possible instead of copying data
2023-07-10 18:54:19 -07:00
lat9nq 833306bf5e settings: Disable C++20 tzdb path on MinGW
This path always results in Etc/UTC on MinGW, which often is not
close to the local time zone.
2023-07-10 17:52:35 -04:00
lat9nq 90d76333da time_zone: Remove string ops for determing zone
MinGW's strftime implementation does not work and cannot be used to
determine the time zone. Besides that, the string operations are
actually unnecessary since we can get the offset from
std::localtime.

Compare localtime to gmtime to find the zone offset on all platforms.
2023-07-10 17:51:34 -04:00