Commit graph

230 commits

Author SHA1 Message Date
Lib
2fdb5240d4 settings: devirtualize SettingsInterface
SettingsInterface was a base class with five pure-virtual config-getter
methods, defined in core/settings.h. There has only ever been one
concrete subclass: LibretroSettingsInterface (in libretro/), which
backs every GetXxxValue call with a single retro_environment_callback
to RETRO_ENVIRONMENT_GET_VARIABLE.

The single-impl shape means every si.GetBoolValue / si.GetIntValue /
si.GetStringValue call in Settings::Load and elsewhere goes through a
vtable indirection that resolves to exactly one place. Settings::Load
issues 61 such calls, and runs at boot plus on every libretro
core-options change. The cost per call is small (~2 ns per virtual
dispatch on modern CPUs), so the wall-clock saving is modest, but
the abstraction itself buys nothing - there is no second
implementation, no plan to add one (the core target is libretro-only),
and no use case where the indirection would help.

Drop the base class:

  - Remove 'class SettingsInterface' from core/settings.h, along with
    its virtual destructor and five pure virtuals.
  - Remove the SettingsInterface destructor definition from
    core/settings.cpp.
  - Make LibretroSettingsInterface a plain class with non-virtual
    methods (drop the 'override' keyword and the public-inheritance
    base).
  - Change Settings::Load's signature from (SettingsInterface&) to
    (LibretroSettingsInterface&). The one caller already passes a
    LibretroSettingsInterface, so no call site needs to change.
  - Forward-declare LibretroSettingsInterface in core/settings.h
    (the type only appears as a reference in Load's signature) and
    include the libretro header from settings.cpp where the
    member function calls actually have to see the definition.

The forward-declaration plus include-from-cpp pattern keeps
core/settings.h free of libretro headers - a header-level layering
nicety. The cpp-level dependency is an existing pattern (multiple
core/ TUs already include libretro/ headers - gpu_hw_d3d11.cpp,
gpu_hw_opengl.cpp, gpu_hw_vulkan.cpp, texture_replacements.cpp).

Linux x64 build still warning-clean. .so size drops from 8048432
to 8047800 bytes (-632) from removing the SettingsInterface vtable,
its typeinfo, the virtual destructor, and the indirect-call sites
in Settings::Load. 25 retro_* exports unchanged. Behaviour is
identical (same calls, same arguments, just direct now).
2026-05-08 14:22:28 +02:00
DarthMew
83776ae7d3 Implement NeGcon with rumble 2024-07-04 17:29:03 +02:00
DarthMew
834a6f1241 Provide more details regarding MDEC routines 2024-07-03 03:53:32 +02:00
DarthMew
afb6bc73c7 Add 'Use Alternative Audio Hook' option, enable by default 2023-10-01 00:22:22 +02:00
DarthMew
39c86ae8e5 Add option to disable GunCon crosshair & LibretroAudioStream: move UploadToFrontend code to FramesAvailable 2023-08-13 01:48:54 +02:00
DarthMew
44f5d8b257 Update libretro.h & libretro_d3d.h, include d3d12 main files for later 2023-07-27 18:08:19 +02:00
Patrick Northon
d57c2113b2 Bugs:
- Fix missing break in DoCDROMAccess.
- Fix missing include for va_list and change to std::va_list.
- Fix missing initializer for VkClearDepthStencilValue.

Improvements:
- Replace all enum constants with constexpr constants.
- Replace LOGLEVEL enum with an enum class.
- Remove some unused variables.
- Remove redundant const in some methods.
- Prefer using std::numeric_limits.
- Fix some missing initializers.
2023-05-08 02:24:13 -04:00
DarthMew
d799fb2c90
Remove redundant line 2023-03-17 04:18:26 +01:00
DarthMew
132d9fd240 Simplify code related to settings 2023-03-17 01:11:54 +01:00
DarthMew
d27eb69e9e Change memcard 2 option description & remove some unused options 2023-03-02 00:20:51 +01:00
DarthMew
7edb35058e Remove unused internal display linear filtering and stretch options, frontend handles these instead 2023-02-22 21:14:03 +01:00
DarthMew
e6c53a15cd Revert 27c76b0a48 and fix underlying issue 2023-02-09 14:04:28 +01:00
DarthMew
27c76b0a48 Revert 28d4d33b2c 3bfe5959da 0d47de2dd7 & 826d58355c 2023-02-09 01:51:40 +01:00
DarthMew
28d4d33b2c Backport MDEC: 8ab46d0713 1bb321c41f 3e0be0a577 & af5d49649c 2023-02-08 17:17:39 +01:00
DarthMew
826d58355c Backport PGXP perspective-correct color interpolation toggle & cleanup libretro_game_settings 2023-01-31 01:52:51 +01:00
DarthMew
e4689b5ae0 Add option to toggle rumble 2023-01-22 04:17:01 +01:00
DarthMew
d347f38931 Remove 'Load Memory Cards From Save States', conflicts with 'Don't overwrite SaveRAM on loading savestate' 2023-01-20 19:32:52 +01:00
DarthMew
50b8761b50
Readd .mcd memcards for slot 1 2022-12-23 20:09:39 +01:00
DarthMew
cd0a682c44 Reorder core option categories & reword the first memcard to be exclusively LibRetro to prevent potential save corruption 2022-11-12 18:53:37 +01:00
DarthMew
7d8ce92847 Rework Analog Mode toggle to have multiple combo options 2022-10-09 22:27:47 +02:00
DarthMew
b6a18318bd Re-add 'Game Native' aspect ratio 2022-09-23 18:02:28 +02:00
LibretroAdmin
e806ab933c Remove static_asserts and if 0s 2022-09-11 08:29:07 +02:00
LibretroAdmin
68bb06bed8 Remove integer scaling mode - is handled on the frontend side -
and was not hooked up anyway
2022-09-08 05:59:43 +02:00
LibretroAdmin
45ae1e5c95 (gpu/host_display) - Some parts never used, hardcode them 2022-09-08 04:10:13 +02:00
LibretroAdmin
1f7d694cc3 Remove unused array 2022-09-08 03:21:44 +02:00
LibretroAdmin
7eb87f5bbc Remove unused settings 2022-09-08 03:16:12 +02:00
LibretroAdmin
6399c5dc60 - Pause functionality never used, removing
- buffer_wait_for_fill always false for audiostream
2022-09-08 02:00:50 +02:00
libretroadmin
bf334fc233 Remove file_system.h include from core/settings.cpp and common/crash_handler.cpp 2022-06-24 20:15:57 +02:00
libretroadmin
bac2a3a7b1 Remove unneeded code for libretro 2022-06-24 07:05:59 +02:00
libretroadmin
7a52940165 Get rid of debugging settings 2022-06-24 06:27:28 +02:00
libretroadmin
24669e024c Slim down settings - libretro does not need loading and reading
of settings files
2022-06-24 05:54:33 +02:00
libretroadmin
263df1ea17 Remove settings display_show_fps - frontend can do this 2022-06-24 03:36:25 +02:00
DarthMew
76fea7b267
Set this to false 2022-04-26 15:58:30 +02:00
DarthMew
c706125769 Fix controller specific settings not updating without a re-init, and re-add 'NeGcon Steering Axis Deadzone' option 2022-04-16 18:09:16 +02:00
DarthMew
cb7cae4305 Remove unused gdb protocol & files 2022-03-02 23:22:48 +01:00
DarthMew
7b15d79eb4 Exclude D3D12 renderer files for Libretro 2022-02-22 23:05:46 +01:00
DarthMew
4335a2ad7e Reduce the amount of files in the repo & rename 'duckstation-libretro' to 'libretro' 2022-02-21 23:16:22 +01:00
DarthMew
b2afbb79db Fix small inconsistency when switching renderers during runtime & small cleanup 2022-02-08 23:52:03 +01:00
Nikos Chantziaras
0cca23ff30
Add CHD precache support
This uses the chd_precache() function of libchdr which just loads the
CHD image to memory without decompressing it. So this is "weaker" than
the full preload to RAM option, which fully decompresses the CHD image,
but it still solves the problem of having the CHD images stored on
unreliable network storage. It's also much faster, since CHDs are quite
slow to decompress in whole.

The main point of this is to be able to use M3U files to run multi-disc
games and still be able to work around unreliable storage. The full
preload to RAM option does not work with M3U files. This option does.

CHD precache is ignored (and the option disabled in the UI) if the full
preload to RAM option is enabled.
2022-02-04 21:40:28 +02:00
DarthMew
d7ce813885 Reduce controller log spamming 2022-01-17 00:15:55 +01:00
DarthMew
a7b185edc5 Separate fastmem rewrite feature into its own option & have CPU Execution Mode OSD message only appear when switching CPU Execution Mode 2021-12-26 00:05:20 +01:00
DarthMew
fb5064b3a9
Comment this out so updating settings doesn't change the controller to digital. 2021-11-17 22:02:56 +01:00
DarthMew
f79179a9ef Separate software renderer upscaling into a separate option, and disable software upscale values for Android to prevent crashing 2021-11-11 20:00:49 +01:00
DarthMew
be4783514a reapply swanstation commits to latest upstream 2021-10-14 23:30:13 +02:00
Connor McLaughlin
521d20bcd2 CommonHostInterface: Add display enhancement settings option 2021-08-15 14:23:20 +10:00
Connor McLaughlin
3f3607548f CommonHostInterface: Make status indicators toggleable 2021-08-12 21:31:40 +10:00
Jean-André Santoni
b1c10b52bb Fix memcards 2021-07-27 23:30:11 +07:00
Connor McLaughlin
21938e14c6 CPU/Recompiler: Implement block linking 2021-07-24 13:07:11 +10:00
Connor McLaughlin
a32ef4a963 CDROMAsyncReader: Support reading ahead more sectors 2021-07-12 21:14:06 +10:00
Connor McLaughlin
14e7f8fd13 GPU: Add D3D12 renderer 2021-07-10 21:45:10 +10:00