Commit graph

4302 commits

Author SHA1 Message Date
SachinVin
41f13456c0
Chore: Enable warnings as errors on MSVC (#6456)
* tests: add Sanity test for SplitFilename83

fix test

fix test

* disable `C4715:not all control paths return a value` for nihstro includes

nihstro: no warn

* Chore: Enable warnings as errors on msvc + fix warnings

fixes

some more warnings

clang-format

* more fixes

* Externals: Add target_compile_options `/W0` nihstro-headers and ...

Revert "disable `C4715:not all control paths return a value` for nihstro includes"
This reverts commit 606d79b55d.

* src\citra\config.cpp: ReadSetting: simplify type casting

* settings.cpp: Get*Name: remove superflous logs
2023-05-01 22:38:58 +03:00
Steveice10
055a58f01e
audio_core: Implement OpenAL backend (#6450) 2023-05-01 21:17:45 +02:00
SachinVin
ce553ab995
renderer_opengl: DrawSingleScreen*: remove duplicate code (#6426)
Co-authored-by: Tobias <thm.frey@gmail.com>
2023-05-01 16:27:42 +02:00
luc-git
7327c334ca
Add cheats in per game configuration (#6379) 2023-04-30 16:36:02 +02:00
Steveice10
ea649263b7
build: Improvements to bundled libraries support. (#6435) 2023-04-28 13:02:53 -07:00
PabloMK7
63bc0b59bb
Use IPC:MakeHeader instead of hardcoded raw values for IPC command tables. (#6453)
* Use IPC:MakeHeader instead of hardcoded values for IPC command tables.

* Use u32 instead of unsigned int in MakeHeader function

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>

* Fix clang format

---------

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
2023-04-27 22:31:03 -07:00
GPUCode
06f3c90cfb
Custom textures rewrite (#6452)
* common: Add thread pool from yuzu

* Is really useful for asynchronous operations like shader compilation and custom textures, will be used in following PRs

* core: Improve ImageInterface

* Provide a default implementation so frontends don't have to duplicate code registering the lodepng version

* Add a dds version too which we will use in the next commit

* rasterizer_cache: Rewrite custom textures

* There's just too much to talk about here, look at the PR description for more details

* rasterizer_cache: Implement basic pack configuration file

* custom_tex_manager: Flip dumped textures

* custom_tex_manager: Optimize custom texture hashing

* If no convertions are needed then we can hash the decoded data directly removing the needed for duplicate decode

* custom_tex_manager: Implement asynchronous texture loading

* The file loading and decoding is offloaded into worker threads, while the upload itself still occurs in the main thread to avoid having to manage shared contexts

* Address review comments

* custom_tex_manager: Introduce custom material support

* video_core: Move custom textures to separate directory

* Also split the files to make the code cleaner

* gl_texture_runtime: Generate mipmaps for material

* custom_tex_manager: Prevent memory overflow when preloading

* externals: Add dds-ktx as submodule

* string_util: Return vector from SplitString

* No code benefits from passing it as an argument

* custom_textures: Use json config file

* gl_rasterizer: Only bind material for unit 0

* Address review comments
2023-04-27 07:38:28 +03:00
SachinVin
000a616bd9
core\loader\ncch.cpp: skip parsing Region info, if user has already... (#6463) 2023-04-26 00:13:21 +02:00
SachinVin
5f81940e63
Merge pull request #6419 from vitor-k/states
Update zstd and improve savestates logging
2023-04-15 10:11:40 +05:30
SachinVin
2a2ee8bc96
Merge pull request #6395 from ian-h-chamberlain/feature/gdbstub-hio
Initial port of luma3ds' gdb_hio to Citra
2023-04-11 20:32:48 +05:30
Ian Chamberlain
025913a734
Fix string_view constructor for macOS clang
Some versions of clang 14 (macOS+android) don't implement
`string_view(It first, It last)`, so let's use
`string_view(const CharT*, size_type)` instead.

Also remove unused header leftover from old code that uses std::string.
2023-04-11 10:06:08 -04:00
Vitor Kiguchi
dccd89b796 savestates: various changes
The header doesn't need to be serialized.
GetSaveStatePath may be static.
Remove unused includes.
Name the CryptoPP stringsource.
2023-04-10 00:51:02 -03:00
Vitor Kiguchi
c79acdd88d savestates: validate states before load 2023-04-10 00:51:02 -03:00
Vitor Kiguchi
8e8c8fa37a savestates: log slot on load and save 2023-04-10 00:51:02 -03:00
Steveice10
b6e73f0d49
Add consolidated GodMode9 key dumping script. (#6396) 2023-04-09 21:16:31 +02:00
SachinVin
8d19483b7e
externals: bump dynarmic to 6.4.6 (#6423) 2023-04-09 21:03:48 +02:00
SachinVin
a94acde519
core\frontend\framebuffer_layout: GetCardboardSettings: clean up floa… (#6399)
* core\frontend\framebuffer_layout: GetCardboardSettings: clean up float to u32 conversion warnings + style fixes

* clang format

* fix signedness
2023-04-09 10:59:25 +05:30
SachinVin
e4e9fb4aed
Merge pull request #6412 from GPUCode/wayland-oops
Port yuzu-emu/yuzu#7410: "Wayland fixes"
2023-04-08 16:51:56 +05:30
Steveice10
287ce1e56f
kernel: Skip address range checks for privileged memory (un)map. (#6407) 2023-04-06 14:30:13 +02:00
Ian Chamberlain
4cc181e5b8
Address review comments
Use more modern C++ style casts + std::array, clean up some log
messages, and rename some functions.
2023-04-05 12:41:17 -04:00
Ian Chamberlain
696c0904f8
Update some c-style casts -> reinterpret_cast 2023-04-04 13:21:25 -04:00
Ian Chamberlain
6e45de760e
Cleanup new code, add docs and error handling 2023-04-04 13:13:24 -04:00
SeleDreams
62d58f669a
kernel: Adjusted resource limits for more accuracy to the running 3DS model (#6393)
Co-authored-by: Tobias <thm.frey@gmail.com>
2023-04-04 19:03:08 +02:00
Steveice10
5f90c9816d
apt: Add stub for ns:c service. (#6409) 2023-04-04 19:01:37 +02:00
Ian Chamberlain
0d4c93d1c2
Undo some changes exposing unused functions 2023-04-04 12:20:41 -04:00
GPUCode
71d4a85957 video_core: Disable async shader loading with strict contexts 2023-04-03 14:32:13 +03:00
Steveice10
041252ba36
file_sys: Attempt to open New 3DS variant NCCH if available. (#6383) 2023-04-02 08:57:56 +05:30
Steveice10
a74d7a0e6b
qt: Hide system titles with invisible or invalid SMDH data. (#6381) 2023-04-02 08:57:22 +05:30
Ian Chamberlain
351730d585
Fix infinite hang if GDB client kills gdbstub 2023-03-31 14:06:43 -04:00
Ian Chamberlain
83138e0c63
Fix some build + impl errors with HIO
After rebase there were some API changes, also fix continuation logic in
the main gdbstub.
2023-03-31 14:05:57 -04:00
GPUCode
ffc95eb59b
Frontend PR fixes (#6378)
* citra_qt: Check if renderer is null

* core: Fix dynarmic use-after-free error

* bootmanager: Add current context check in DoneCurrent

* Loading a save state would destroy the frame dumper class, which contains a shared context. That context would call DoneCurrent without checking if it was actually bound or not, resulting in crashes when calling opengl functions

* externals: Correct glad readme

* common: Log renderer debug setting

* citra: Make lambda lower case

* Consistency with review comments on the PR

* video_core: Kill more global state

* GetResolutionScaleFactor would be called somewhere in the renderer constructor chain but it relies on the yet unitialized g_renderer, resulting in crashes when the resolution scale is set to auto. Rather than adding a workaround, let's kill this global state to fix this for good
2023-03-30 14:24:49 +03:00
Ian Chamberlain
f92f494cab
Stop execution when performing HIO request
Since the HIO request is basically treated like a syscall, we need to
stop emulation while waiting for the GDB client to reply with the
result. This ensures any memory queries etc. that GDB makes to fulfill
the HIO request are accessing memory as it was at the time of the
request, instead of afterwards.
2023-03-29 09:09:32 -04:00
Ian Chamberlain
b9c11e71d7
Fix ABI mismatch in packed HIO request
Using size_t etc. is incorrect, since these definitions are based on the
build machine which most likely has a different arch than the 3DS.
2023-03-29 09:09:32 -04:00
Ian Chamberlain
874bfebaf9
Add some notes + use stringstream to build packet 2023-03-29 09:09:32 -04:00
Ian Chamberlain
7de1bf3746
Properly parse incoming hio packet
This also does kind of a hacky way of sending HIO requests, since we
don't have a direct way of signaling a request should be sent like the
Rosalina implementation.

To improve this, it could probably do some kind of signal sending which
the main run loop handles instead of GDBStub::HandlePacket();
2023-03-29 09:09:32 -04:00
Ian Chamberlain
6f23ee43ae
Initial port of luma3ds' gdb_hio to Citra 2023-03-29 09:09:32 -04:00
Steveice10
5346ca27b5
Rework system title handling with up-to-date title list and region detection support. (#6356) 2023-03-29 13:55:29 +02:00
GPUCode
b5d6f645bd
Prepare frontend for multiple graphics APIs (#6347)
* externals: Update dynarmic

* settings: Introduce GraphicsAPI enum

* For now it's OpenGL only but will be expanded upon later

* citra_qt: Introduce backend agnostic context management

* Mostly a direct port from yuzu

* core: Simplify context acquire

* settings: Add option to create debug contexts

* renderer_opengl: Abstract initialization to Driver

* This commit also updates glad and adds some useful extensions which we will use in part 2

* Rasterizer construction is moved to the specific renderer instead of RendererBase.
  Software rendering has been disable to achieve this but will be brought back in the next commit.

* video_core: Remove Init/Shutdown methods from renderer

* The constructor and destructor can do the same job

* In addition move opengl function loading to Qt since SDL already does this. Also remove ErrorVideoCore which is never reached

* citra_qt: Decouple software renderer from opengl part 1

* citra: Decouple software renderer from opengl part 2

* android: Decouple software renderer from opengl part 3

* swrasterizer: Decouple software renderer from opengl part 4

* This commit simply enforces the renderer naming conventions in the software renderer

* video_core: Move RendererBase to VideoCore

* video_core: De-globalize screenshot state

* video_core: Pass system to the renderers

* video_core: Commonize shader uniform data

* video_core: Abstract backend agnostic rasterizer operations

* bootmanager: Remove references to OpenGL for macOS

OpenGL macOS headers definitions clash heavily with each other

* citra_qt: Proper title for api settings

* video_core: Reduce boost usage

* bootmanager: Fix hide mouse option

Remove event handlers from RenderWidget for events that are
already handled by the parent GRenderWindow.
Also enable mouse tracking on the RenderWidget.

* android: Remove software from graphics api list

* code: Address review comments

* citra: Port per-game settings read

* Having to update the default value for all backends is a pain so lets centralize it

* android: Rename to OpenGLES

---------

Co-authored-by: MerryMage <MerryMage@users.noreply.github.com>
Co-authored-by: Vitor Kiguchi <vitor-kiguchi@hotmail.com>
2023-03-27 14:29:17 +03:00
Steveice10
d9d0fc63ec
applet: Fix HLE applet pre-start lifecycle. (#6362) 2023-03-25 22:36:14 +01:00
bunnei
fdb7ab47ff
Merge pull request #6364 from Steveice10/break_error
kernel: Set system error status on svcBreak.
2023-03-25 01:18:26 -07:00
hank121314
8d563d37b4
citra_android: Storage Access Framework implementation (#6313) 2023-03-23 14:30:52 +01:00
Steveice10
f1c282775d kernel: Set system error status on svcBreak. 2023-03-21 14:19:42 -07:00
Steveice10
fbf53686c3
apt: Fix exiting to game list on application close. (#6353) 2023-03-21 17:07:49 +01:00
PabloMK7
3fb48716c5
CreateThread invalid processor ID return error instead of assert. (#6354) 2023-03-21 17:06:07 +01:00
Steveice10
c96f54f022
Implement app management support (suspend, resume, close, etc) (#6322) 2023-03-10 00:44:26 +01:00
Steveice10
976995ba08
cfg: Set system setup complete flag when formatting save. (#6331) 2023-03-09 00:05:00 +01:00
Steveice10
3c15398f9e
apt: Implement additional applet state management. (#6303)
* apt: Implement additional library applet state management.

* kernel: Clear process handle table on exit.

* apt: Implement system applet commands.

* apt: Pop MediaType from command buffers with correct size.

* apt: Improve accuracy of parameters and HLE applet lifecycle.

* apt: General cleanup.

* file_sys: Make system save data open error code more correct.

Not sure if this is the exact right error code, but it's at least
more correct than before as Game Notes will now create its system
save data instead of throwing a fatal error.

* apt: Fix launching New 3DS Internet Browser.

* frd: Correct fix to GetMyScreenName response.
2023-02-28 14:09:54 +02:00
Steveice10
cda358443f
nim: Fully stub nim:u service. (#6290) 2023-02-17 19:30:47 +01:00
Steveice10
bf73cb57ca
am: Return installed titles in GetNumTickets and GetTicketList stubs. (#6292) 2023-02-17 16:20:56 +02:00
komasanzura
9eb1cd2875
Added an option to set the proportion of the screens when using layout "Large Screen Small Screen", to allow the user to define how much bigger the large screen should be with respect to the smaller screen. Currently the value must be between 1 and 16, but I could set a different maximum value if that would be desired. Thank you very much! (#6252) 2023-02-17 16:19:52 +02:00