Commit graph

392 commits

Author SHA1 Message Date
riperiperi
10aa11ce13
Interrupt GPU command processing when a frame's fence is reached. (#1741)
* Interrupt GPU command processing when a frame's fence is reached.

* Accumulate times rather than %s

* Accurate timer for vsync

Spin wait for the last .667ms of a frame. Avoids issues caused by signalling 16ms vsync. (periodic stutters in smo)

* Use event wait for better timing.

* Fix lazy wait

Windows doesn't seem to want to do 1ms consistently, so force a spin if we're less than 2ms.

* A bit more efficiency on frame waits.

Should now wait the remainder 0.6667 instead of 1.6667 sometimes (odd waits above 1ms are reliable, unlike 1ms waits)

* Better swap interval 0 solution

737 fps without breaking a sweat. Downside: Vsync can no longer be disabled on games that use the event heavily (link's awakening - which is ok since it breaks anyways)

* Fix comment.

* Address Comments.
2020-12-17 19:39:52 +01:00
Ac_K
11222516c4
gui/gpu: Implement setting and toggle for Aspect Ratio (#1777)
* gui/gpu: Implement setting and toggle for Aspect Ratio

* address gdkchan feedback and add 16:10

* fix config.json file

* Fix rebase

* Address gdkchan feedback

* Address rip feedback

* Fix aspectWidth
2020-12-15 23:19:07 -03:00
Ac_K
808380690c
am/gui: Implement Wake-up message (#1750)
* am/gui: Implement Wake-up message.

This implement the ability to send a Wake-up (Resume) message to the guest.
Sometime games needs to Sleep and Wake-up the switch to unlock some ingame features.

* Address gdkchan feedback
2020-12-15 21:41:42 -03:00
riperiperi
c9b6be1ef8
NVIDIA Thread create/delete stutter workarounds (#1760)
* Thread create/delete stutter workarounds Pt 1

* As tiered compilation is disabled, disable quick jit too

Should result in tier 1 compilation all the time

* Fix rebase.
2020-12-09 19:36:08 -03:00
gdkchan
48278905d1
Rewrite scheduler context switch code (#1786)
* Rewrite scheduler context switch code

* Fix race in UnmapIpcRestorePermission

* Fix thread exit issue that could leave the scheduler in a invalid state

* Change context switch method to not wait on guest thread, remove spin wait, use SignalAndWait to pass control

* Remove multi-core setting (it is always on now)

* Re-enable assert

* Remove multicore from default config and schema

* Fix race in KTimeManager
2020-12-09 19:20:05 -03:00
Ac_K
668720b088
logger: Add build version to the log file names (#1782) 2020-12-07 20:29:22 +11:00
gdkchan
cf6cd71488
IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel (#1458)
* IPC refactor part 2: Use ReplyAndReceive on HLE services and remove special handling from kernel

* Fix for applet transfer memory + some nits

* Keep handles if possible to avoid server handle table exhaustion

* Fix IPC ZeroFill bug

* am: Correctly implement CreateManagedDisplayLayer and implement CreateManagedDisplaySeparableLayer

CreateManagedDisplaySeparableLayer is requires since 10.x+ when appletResourceUserId != 0

* Make it exit properly

* Make ServiceNotImplementedException show the full message again

* Allow yielding execution to avoid starving other threads

* Only wait if active

* Merge IVirtualMemoryManager and IAddressSpaceManager

* Fix Ro loading data from the wrong process

Co-authored-by: Thog <me@thog.eu>
2020-12-02 00:23:43 +01:00
Xpl0itR
e383c41b6e
Add a "Remove All" button to the DLC and Update windows (#1579) 2020-12-01 23:51:49 +01:00
Xpl0itR
bd8d28c59d
Add option to start games in fullscreen mode (#1580)
* Add option to start games in fullscreen mode

* Add command line option

* Use pascal case on menu item
2020-12-01 23:02:27 +01:00
Ac_K
a04a1b663d
config: Fix MaxAnisotropy value parsing (#1764) 2020-12-01 21:44:04 +01:00
Mary
245f8a7eee
ui: Check last played datetime validity against current culture (#1730)
This is an issue happening when you change your datetime format on your
system and try to sort via last played datetime. DateTime.Parse use the
current thread culture and will not parse date correctly, effectively
causing a crash.

As such, I added a check when loading the game list that ensure that the
datetime is valid in current culture.

Fix #1727.
2020-11-27 19:05:36 +01:00
Ac_K
b1877632cf
Remove some warnings and cleaning code (#1736) 2020-11-27 18:57:20 +01:00
Ac_K
f8f23bf899
gui: Toggle Docked/Handheld mode and VSync by clicking status bar (#1726)
* gui: Toggle between docked/handheld mode by clicking status bar

This PR just add a way to toggle between the docked and the handheld mode by clicking the lable in the status bar.
Nothing more.

* Fix glade file formatting

* Add VSync toggle
2020-11-19 11:34:28 +11:00
Sera
41ab43151b
GLRenderer: Change between docked and handheld mode using a keybinding (#1685)
* GLRenderer: Change between docked and handheld mode using a keybinding

* nit
2020-11-19 00:15:44 +01:00
Mary
863edae328
shader cache: Fix Linux boot issues (#1709)
* shader cache: Fix Linux boot issues

This rollback the init logic back to previous state, and replicate the
way PTC handle initialization.

* shader cache: set default state of ready for translation event to false

* Fix cpu unit tests
2020-11-17 22:40:19 +01:00
Mary
4bc4cacdd0
ui diag: Add missing error message for ApplicationNotFound (#1693)
I missed to add the error messages for this error code on the initial
PR, this fix it.
2020-11-15 21:26:49 +01:00
EmulationFanatic
d3147bab5a
Standardize to camel-case: option to check for updates on launch (#1698)
* Standardize to camel-case: option to check for updates on launch

Updates the "Check for updates on launch" to read instead "Check For Updates On Launch" to be consistent with camel-case options elsewhere in the UI. This time done with manual editing instead of with the Glade app.

* Updated to match general English rules on articles and conjunctions
2020-11-15 21:11:23 +01:00
Xpl0itR
58bc6897a5
Don't warn when debug feature is enabled in debug mode (#1707) 2020-11-15 20:56:44 +01:00
Mary
aa129fdbdf
infra: Migrate to .NET 5 (#1694)
* infra: Migrate to .NET 5

This migrate projects and CI to .NET 5

* Remove language version restrictions (now on 9.0 by default)

* infra: pin .NET 5 to avoid later issues

* infra: Cleanup csproj files

* infra: update dependencies

* infra: Add temporary workaround for a bug in Vector128.Create

see https://github.com/dotnet/runtime/issues/44704 for more informations
2020-11-15 19:27:15 +01:00
Sera
04e048efcf
SettingsWindow: Add an Apply button (#1562)
* SettingsWindow: Add an Apply button

Adds an apply button that doesnt close the settings window when saving
the changes.

* fix the apply button staying turned on after clicking it
2020-11-13 01:50:28 +01:00
Mary
48f6570557
Salieri: shader cache (#1701)
Here come Salieri, my implementation of a disk shader cache!

"I'm sure you know why I named it that."
"It doesn't really mean anything."

This implementation collects shaders at runtime and cache them to be later compiled when starting a game.
2020-11-13 00:15:34 +01:00
Mary
61e67b64ea
updater: Ignore first commandline argument when passing commandline to updated binary (#1674)
Fix a regression caused by #1643.
2020-11-06 19:46:22 +01:00
CeruleanSky
b5a760bde9
Preserve command line arguments when updater restarts Ryujinx (#1643)
Command line arguements are not preserved by the updater, and this causes an issue when the updater restarts Ryujinx in portable mode as it will create/use/modify its default directory instead.

This simple pull addresses the first part of #1594 

As far as the second part of the issue, where the updater perhaps overzealously deletes everything but log files and folders, which causes problems in portable installs with a user subfolder or something else inside the Ryujinx folder. 

Perhaps an UpdateList.txt containing a list of files that the updater deletes is included in the ryujinx.zip/tar.gz/etc and placed in the upacked directory for the updater to use upon the next upgrade.

The build system can run something like `forfiles /s /m *.txt /c "cmd /c echo @relpath"` or the correct command for the OS and include it in the distribution, or it could be generated by the updater itself.
2020-10-29 23:07:10 +01:00
emmauss
9f13f957af
Motion Fixes (#1589)
* fix stalling when server is offline

* add retry timer to fail server connections, fix alt slot number

* fix alt slot key issue

* fix crash when saving controller config with empty fields

* code fixes

* add index check in motion hid update, made HandleResponse async

Co-authored-by: Emmanuel <nhv3@localhost.localdomain>
2020-10-28 20:52:07 +01:00
riperiperi
b4d8d893a4
Memory Read/Write Tracking using Region Handles (#1272)
* WIP Range Tracking

- Texture invalidation seems to have large problems
- Buffer/Pool invalidation may have problems
- Mirror memory tracking puts an additional `add` in compiled code, we likely just want to make HLE access slower if this is the final solution.
- Native project is in the messiest possible location.
- [HACK] JIT memory access always uses native "fast" path
- [HACK] Trying some things with texture invalidation and views.

It works :)

Still a few hacks, messy things, slow things

More work in progress stuff (also move to memory project)

Quite a bit faster now.
- Unmapping GPU VA and CPU VA will now correctly update write tracking regions, and invalidate textures for the former.
- The Virtual range list is now non-overlapping like the physical one.
- Fixed some bugs where regions could leak.
- Introduced a weird bug that I still need to track down (consistent invalid buffer in MK8 ribbon road)

Move some stuff.

I think we'll eventually just put the dll and so for this in a nuget package.

Fix rebase.

[WIP] MultiRegionHandle variable size ranges

- Avoid reprotecting regions that change often (needs some tweaking)
- There's still a bug in buffers, somehow.
- Might want different api for minimum granularity

Fix rebase issue

Commit everything needed for software only tracking.

Remove native components.

Remove more native stuff.

Cleanup

Use a separate window for the background context, update opentk. (fixes linux)

Some experimental changes

Should get things working up to scratch - still need to try some things with flush/modification and res scale.

Include address with the region action.

Initial work to make range tracking work

Still a ton of bugs

Fix some issues with the new stuff.

* Fix texture flush instability

There's still some weird behaviour, but it's much improved without this. (textures with cpu modified data were flushing over it)

* Find the destination texture for Buffer->Texture full copy

Greatly improves performance for nvdec videos (with range tracking)

* Further improve texture tracking

* Disable Memory Tracking for view parents

This is a temporary approach to better match behaviour on master (where invalidations would be soaked up by views, rather than trigger twice)

The assumption is that when views are created to a texture, they will cover all of its data anyways. Of course, this can easily be improved in future.

* Introduce some tracking tests.

WIP

* Complete base tests.

* Add more tests for multiregion, fix existing test.

* Cleanup Part 1

* Remove unnecessary code from memory tracking

* Fix some inconsistencies with 3D texture rule.

* Add dispose tests.

* Use a background thread for the background context.

Rather than setting and unsetting a context as current, doing the work on a dedicated thread with signals seems to be a bit faster.

Also nerf the multithreading test a bit.

* Copy to texture with matching alignment

This extends the copy to work for some videos with unusual size, such as tutorial videos in SMO. It will only occur if the destination texture already exists at XCount size.

* Track reads for buffer copies. Synchronize new buffers before copying overlaps.

* Remove old texture flushing mechanisms.

Range tracking all the way, baby.

* Wake the background thread when disposing.

Avoids a deadlock when games are closed.

* Address Feedback 1

* Separate TextureCopy instance for background thread

Also `BackgroundContextWorker.InBackground` for a more sensible idenfifier for if we're in a background thread.

* Add missing XML docs.

* Address Feedback

* Maybe I should start drinking coffee.

* Some more feedback.

* Remove flush warning, Refocus window after making background context
2020-10-16 17:18:35 -03:00
riperiperi
aec8177850
Replace Host FPS with GPU command queue load ("Fifo %") (#1585)
* Replace Host FPS with FIFO%

* Change measurement order. Improve calculation.

Now at 100% when FIFO is blocking game exectution, rather than "0".

* Address feedback (1)

* Remove Host FPS

* FIFO rather than Fifo

* Address Ac_k feedback

* Rebase
2020-10-14 07:54:42 +11:00
Thog
ace67ed324 Rollback the CreateExitDialog function that was lost with auto updater 2020-10-10 01:22:25 +02:00
Xpl0itR
ce87650d81
Show confirmation dialog when attempting to close while a game is loaded (#1582) 2020-10-10 01:06:48 +02:00
Mary
8506b7a334
Fix exiting emulator with multi programs (#1590)
THis fix a bug introduced in #1560 that would cause "Stop emulation" to
actually restart the game all the time.
2020-10-10 00:52:11 +02:00
emmauss
26319d5ab3
Add Motion controls (#1363)
* Add motion controls

Apply suggestions from code review

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* cleanup

* add reference orientation and derive relative orientation from it

* cleanup

* remove unused variable and strange file

* Review_2.

* change GetInput to TryGetInput

* Review_3.

Co-authored-by: Ac_K <Acoustik666@gmail.com>
Co-authored-by: LDj3SNuD <dvitiello@gmail.com>
2020-09-29 23:32:42 +02:00
Thog
a6f8a0b01e Do not show update being availaible when appveyor is still building 2020-09-29 22:52:41 +02:00
MelonSpeedruns
a15459366e
Appveyor Ryujinx Updater (#1403)
Co-authored-by: Xpl0itR <xpl0itr@outlook.com>
2020-09-29 22:05:25 +02:00
Ac_K
4f65043ad7
Basic impl of Error Applet (#1551) 2020-09-28 00:00:38 +02:00
Mary
33f8284bc0
hle/ui: Basic multi programs support (#1560)
* hos/gui: Add a check of NCA program index in titleid

This add a check to `ApplicationLoader` for the last 2 digits of the game TitleId who seems to be the NCA program index.
We currently return the last index, instead of the lower one.
Same check is added to ApplicationLibrary in the UI.

I've cleaned up both file too.

* hle: implement partial relaunch logic

TODO: make the emulator auto relauch.

* Handle auto relaunch

* hle: Unify update usage system

* hle: Implement support of multi programs in update system

* Add some documentation

* Address rip's comment

Co-authored-by: Ac_K <Acoustik666@gmail.com>
2020-09-21 13:45:30 +10:00
Xpl0itR
d0e36b7b19
Move the open logs folder from setting into the File menu in the main window (#1550) 2020-09-20 14:31:05 +10:00
Mary
2ce59c44bc
Fix debug Config using res scaling 2x by default (#1546)
As the title say, this restore the value to 1.
2020-09-13 11:02:45 +10:00
Alex Barney
1bb7fdaca4
Update to LibHac 0.12.0 (#1485)
* Update to LibHac 0.12.0

* Auto-formatting. Fixed a bug in SetApplicationCopyrightImage
2020-09-01 17:08:59 -03:00
Mary
3ec911a630
ui: Initial better user error reporting (#1503)
This update the "No keys" dialog and block starting NSP/XCI/NCA without firmware.

Also propose to the user if they want to install firmware if they start an untrimmed XCI and remove KEYS.md as it was completely outdated.

PS: Also fix a bug with "&" in URL with OpenUrl on Windows.
2020-09-01 11:09:42 +02:00
Mary
4f3ae6f62c
Remove the Ryujinx.Debugger project (#1506)
This project wasn't really used by anyone and isn't worth mantaining.

This commit remove the profiler entirely from Ryujinx and remove the associated CI tasks.
2020-08-30 19:06:05 +02:00
mageven
b9398f1f3a
Allow launching with custom data directories (#1505)
* Allow launching with custom data directories

Don't load alternate keys when using custom directory

* Address gdkchan's comments

* Misc fixes to log levels

Added more enabled log levels by default

Moved successful config updation to Notice as
1. It's not a warning
2. Warnings could've been disabled by the config load and hence message
   would be lost
2020-08-30 18:51:53 +02:00
mageven
27179d0218
Improve multi-controller support in HID and Controller Applet (#1453)
* Initial commit

Enable proper LED patterns
Toggle Hotkeys only on focus
Ignore Handheld on Docked mode
Remove PrimaryController
Validate NpadIdType
Rewrite NpadDevices to process config in update loop
Cleanup

* Notify in log periodically when no matched controllers

* Remove duplicate StructArrayHelpers in favor of Common.Memory

Fix struct padding CS0169 warns in Touchscreen

* Remove GTK markup from Controller Applet

Use IList instead of List
Explicit list capacity in 1ms loop
Fix formatting

* Restrict ControllerWindow to show valid controller types

Add selected player name to ControllerWindow title

* ControllerWindow: Fix controller type initial value

NpadDevices: Simplify default battery charge

* Address AcK's comments

Use explicit types and fix formatting

* Remove HashSet for SupportedPlayers

Fixes potential exceptions due to race

* Fix ControllerSupportArg struct packing

Also comes with two revisions of struct for 4/8 players max.
2020-08-23 22:54:11 +02:00
Mary
a389dd59bd
Amadeus: Final Act (#1481)
* Amadeus: Final Act

This is my requiem, I present to you Amadeus, a complete reimplementation of the Audio Renderer!

This reimplementation is based on my reversing of every version of the audio system module that I carried for the past 10 months.
This supports every revision (at the time of writing REV1 to REV8 included) and all features proposed by the Audio Renderer on real hardware.

Because this component could be used outside an emulation context, and to avoid possible "inspirations" not crediting the project, I decided to license the Ryujinx.Audio.Renderer project under LGPLv3.

- FE3H voices in videos and chapter intro are not present.
- Games that use two audio renderer **at the same time** are probably going to have issues right now **until we rewrite the audio output interface** (Crash Team Racing is the only known game to use two renderer at the same time).

- Persona 5 Scrambler now goes ingame but audio is garbage. This is caused by the fact that the game engine is syncing audio and video in a really aggressive way. This will disappears the day this game run at full speed.

* Make timing more precise when sleeping on Windows

Improve precision to a 1ms resolution on Windows NT based OS.
This is used to avoid having totally erratic timings and unify all
Windows users to the same resolution.

NOTE: This is only active when emulation is running.
2020-08-17 22:49:37 -03:00
mageven
0de5367369
PPTC GUI: Purge all versioned caches on click (#1454)
* PPTC GUI: Purge all versioned caches on click

* Address AcK's comments

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* nit: Explicit declarations

Co-authored-by: Ac_K <Acoustik666@gmail.com>
2020-08-13 19:31:13 +02:00
Xpl0itR
58f65b6523
Replace the Audio Backend ComboBoxText to a ComboBox with a custom model (#1451)
* Use a combobox with a custom model to be able to disable entries within it

* Address Ack's comments
2020-08-09 22:46:06 +02:00
mageven
e19193e073
Rename DebugLevel Performance to Slowdowns (#1450) 2020-08-07 15:30:06 +02:00
mageven
a33dc2f491
Improved Logger (#1292)
* Logger class changes only

Now compile-time checking is possible with the help of Nullable Value
types.

* Misc formatting

* Manual optimizations

PrintGuestLog
PrintGuestStackTrace
Surfaceflinger DequeueBuffer

* Reduce SendVibrationXX log level to Debug

* Add Notice log level

This level is always enabled and used to print system info, etc...
Also, rewrite LogColor to switch expression as colors are static

* Unify unhandled exception event handlers

* Print enabled LogLevels during init

* Re-add App Exit disposes in proper order

nit: switch case spacing

* Revert PrintGuestStackTrace to Info logs due to #1407

PrintGuestStackTrace is now called in some critical error handlers
so revert to old behavior as KThread isn't part of Guest.

* Batch replace Logger statements
2020-08-04 01:32:53 +02:00
mageven
c11855565e
Implement Software Keyboard GTK frontend (#1434)
* Implement SwKbd GUI

* Relocate UI handler to Emu Context from Config

Also create a common interface for UI handlers in the context and specialize for Gtk

Add basic input length validation in InputDialog

* Add Transfer Memory support to AppletCreator

Read Initial Text for SwKbd using Transfer Memory

* Improve InputDialog widget

Improve length validation
Has extra label to show validition info
Handle potential errors and log them

* Misc improvements

* Improve string validation
* Improve error handling
* Remove tuple in struct
* Address formatting nits

* Add proper Cancel functionality

Also handle GUI errors in UI handler

* Address jD's comments

* Fix _uiHandler init

* Address AcK's comments
2020-08-03 03:30:58 +02:00
mageven
f0c91d9efb
Facilitate OpenGL debug logging via GUI (#1373)
* Allow printing GL Debug logs with GUI options

Improve GL Debugger

Make the new option persistent

Address gdkchan's comments
- Rename enum to GraphicsDebugLevel
- Move Debugger Init to Renderer Init
- Fix formatting

* nit: newlines
2020-08-02 16:41:24 +02:00
emmauss
3c1f220c5e
fix fullscreen toggling (#1364) 2020-07-23 23:12:19 +10:00
mageven
4aa47a66c6
Better TimeZone entry in System Settings (#1254)
* Better timezone labels in System TimeZone

Replace with GtkEntry with auto-complete

Also removed async task as now loading is fast

Address Thog's comments

self-nit: Remove string alias

Address AcK's comments

* Improve parsing
* Optimize and fix string matching

Address jD's comments

* Also, make abbreviations searchable
* Optimize EntryCompletion's MatchFunc

* nit: Result.IsFailure()

* Fix potential crash on opening Settings window w/o FW installed
2020-07-21 06:14:42 +02:00
Xpl0itR
21dfa4974a
A couple fixes for the audio backend GUI option (#1360)
* Detect available audio backends in the gui on a separate thread and

hardcode dummy backend in the dropdown and select it by default

* Use a Task rather than a Thread

* Modify UI on UI thread
2020-07-21 05:33:23 +02:00
gdkchan
4d02a2d2c0
New NVDEC and VIC implementation (#1384)
* Initial NVDEC and VIC implementation

* Update FFmpeg.AutoGen to 4.3.0

* Add nvdec dependencies for Windows

* Unify some VP9 structures

* Rename VP9 structure fields

* Improvements to Video API

* XML docs for Common.Memory

* Remove now unused or redundant overloads from MemoryAccessor

* NVDEC UV surface read/write scalar paths

* Add FIXME comments about hacky things/stuff that will need to be fixed in the future

* Cleaned up VP9 memory allocation

* Remove some debug logs

* Rename some VP9 structs

* Remove unused struct

* No need to compile Ryujinx.Graphics.Host1x with unsafe anymore

* Name AsyncWorkQueue threads to make debugging easier

* Make Vp9PictureInfo a ref struct

* LayoutConverter no longer needs the depth argument (broken by rebase)

* Pooling of VP9 buffers, plus fix a memory leak on VP9

* Really wish VS could rename projects properly...

* Address feedback

* Remove using

* Catch OperationCanceledException

* Add licensing informations

* Add THIRDPARTY.md to release too

Co-authored-by: Thog <me@thog.eu>
2020-07-12 05:07:01 +02:00
mageven
189c0c9c72
Implement modding support (#1249)
* Implement Modding Support

* Executables: Rewrite to use contiguous mem and Spans

* Reorder ExeFs, Npdm, ControlData and SaveData calls

After discussion with gdkchan, it was decided it's best to call
LoadExeFs after all other loads are done as it starts the guest process.

* Build RomFs manually instead of Layering FS

Layered FS approach has considerable latency when building the final
romfs. So, we manually replace files in a single romfs instance.

* Add RomFs modding via storage file

* Fix and cleanup MemPatch

* Add dynamically loaded NRO patching

* Support exefs file replacement

* Rewrite ModLoader to use mods-search architecture

* Disable PPTC when exefs patches are detected

Disable PPTC on exefs replacements too

* Rewrite ModLoader, again

* Increased maintainability and matches Atmosphere closely
* Creates base mods structure if it doesn't exist
* Add Exefs partition replacement
* IPSwitch: Fix nsobid parsing

* Move mod logs to new LogClass

* Allow custom suffixes to title dirs again

* Address nits

* Add a per-App "Open Mods Directory" context menu item

Creates the path if not present.

* Normalize tooltips verbiage

* Use LocalStorage and remove unused namespaces
2020-07-09 14:31:15 +10:00
riperiperi
484eb645ae
Implement Zero-Configuration Resolution Scaling (#1365)
* Initial implementation of Render Target Scaling

Works with most games I have. No GUI option right now, it is hardcoded.

Missing handling for texelFetch operation.

* Realtime Configuration, refactoring.

* texelFetch scaling on fragment shader (WIP)

* Improve Shader-Side changes.

* Fix potential crash when no color/depth bound

* Workaround random uses of textures in compute.

This was blacklisting textures in a few games despite causing no bugs. Will eventually add full support so this doesn't break anything.

* Fix scales oscillating when changing between non-native scales.

* Scaled textures on compute, cleanup, lazier uniform update.

* Cleanup.

* Fix stupidity

* Address Thog Feedback.

* Cover most of GDK's feedback (two comments remain)

* Fix bad rename

* Move IsDepthStencil to FormatExtensions, add docs.

* Fix default config, square texture detection.

* Three final fixes:

- Nearest copy when texture is integer format.
- Texture2D -> Texture3D copy correctly blacklists the texture before trying an unscaled copy (caused driver error)
- Discount small textures.

* Remove scale threshold.

Not needed right now - we'll see if we run into problems.

* All CPU modification blacklists scale.

* Fix comment.
2020-07-07 04:41:07 +02:00
Mary
686eceb9f6
Readd SoundIO as OpenAL fallback (#1356) 2020-07-04 02:38:39 +02:00
Xpl0itR
bf87f02c0c
Changes to game list reloading (#1334)
* Only reload list when game dirs are changed

* do not reload game list when game is loaded
2020-07-04 01:29:36 +02:00
Xpl0itR
7cb6532971
Implement audio backend configuration option (#1325)
* Implement audio backend configuration option

* Use OpenAL by default

* Increment version number in config.json

and add 30px to the height of the settings window

* nits

* capitalise audio backend names
2020-07-04 01:16:49 +02:00
Sera
af72875bee
GameTableContextMenu: Implemented options for PPTC (#1321)
* GameTableContextMenu: Implemented options for PPTC

Added an option for purging the cache and for opening the PPTC directory.

* Fixed formating and used a better naming scheme for some of the variables.

* Fixed some nits

* Fixed more nits

* Rearranged the context menu and fixed some nits

* Addressed LDj's review
2020-07-04 01:04:04 +02:00
Sera
8b8039e8b9
SettingsWindow: Add the ability to add multiple game directories at once (#1314)
* SettingsWindow: Add the ability to choose multiple game directories in one go

* Adressed emmauss's suggestion

* Simplified the check for duplicate game directories

As per Xpl0itr's and emmauss's suggestion, I simplified the loop that checks if the selected game directories are already added.

* Fixed a nit
2020-07-04 00:57:03 +02:00
Xpl0itR
68a6960617
Remember GUI column sort and separate hotkey settings from emulated input settings (#1223)
* Separate hotkey settings from emulated input settings

* Remember gui column sort

* nit

* fix schema

* nit

* Remove unused SaveDataPath to speed up game list loading

* Reset the vertical scrollbar to the top when titles finish loading
2020-06-26 12:30:16 +02:00
Xpl0itR
2ed9db1fcd
Implement dlc management window (#1313)
* Implement dlc management window

* reduce repetition

* Implement per NCA toggling of DLC rather than per container
2020-06-23 10:32:07 +10:00
Xpl0itR
fcd187ce42
Copy the value of InputConfig to a new array before iterating (#1271) 2020-06-22 22:19:30 +02:00
LDj3SNuD
5e724cf24e
Add Profiled Persistent Translation Cache. (#769)
* Delete DelegateTypes.cs

* Delete DelegateCache.cs

* Add files via upload

* Update Horizon.cs

* Update Program.cs

* Update MainWindow.cs

* Update Aot.cs

* Update RelocEntry.cs

* Update Translator.cs

* Update MemoryManager.cs

* Update InstEmitMemoryHelper.cs

* Update Delegates.cs

* Nit.

* Nit.

* Nit.

* 10 fewer MSIL bytes for us

* Add comment. Nits.

* Update Translator.cs

* Update Aot.cs

* Nits.

* Opt..

* Opt..

* Opt..

* Opt..

* Allow to change compression level.

* Update MemoryManager.cs

* Update Translator.cs

* Manage corner cases during the save phase. Nits.

* Update Aot.cs

* Translator response tweak for Aot disabled. Nit.

* Nit.

* Nits.

* Create DelegateHelpers.cs

* Update Delegates.cs

* Nit.

* Nit.

* Nits.

* Fix due to #784.

* Fixes due to #757 & #841.

* Fix due to #846.

* Fix due to #847.

* Use MethodInfo for managed method calls.

Use IR methods instead of managed methods about Max/Min (S/U).
Follow-ups & Nits.

* Add missing exception messages.

Reintroduce slow path for Fmov_Vi.
Implement slow path for Fmov_Si.

* Switch to the new folder structure.

Nits.

* Impl. index-based relocation information. Impl. cache file version field.

* Nit.

* Address gdkchan comments.

Mainly:
- fixed cache file corruption issue on exit; - exposed a way to disable AOT on the GUI.

* Address AcK77 comment.

* Address Thealexbarney, jduncanator & emmauss comments.

Header magic, CpuId (FI) & Aot -> Ptc.

* Adaptation to the new application reloading system.

Improvements to the call system of managed methods.
Follow-ups.
Nits.

* Get the same boot times as on master when PTC is disabled.

* Profiled Aot.

* A32 support (#897).

* #975 support (1 of 2).

* #975 support (2 of 2).

* Rebase fix & nits.

* Some fixes and nits (still one bug left).

* One fix & nits.

* Tests fix (by gdk) & nits.

* Support translations not only in high quality and rejit.

Nits.

* Added possibility to skip translations and continue execution, using `ESC` key.

* Update SettingsWindow.cs

* Update GLRenderer.cs

* Update Ptc.cs

* Disabled Profiled PTC by default as requested in the past by gdk.

* Fix rejit bug. Increased number of parallel translations. Add stack unwinding stuffs support (1 of 2).

Nits.

* Add stack unwinding stuffs support (2 of 2). Tuned number of parallel translations.

* Restored the ability to assemble jumps with 8-bit offset when Profiled PTC is disabled or during profiling.

Modifications due to rebase.
Nits.

* Limited profiling of the functions to be translated to the addresses belonging to the range of static objects only.

* Nits.

* Nits.

* Update Delegates.cs

* Nit.

* Update InstEmitSimdArithmetic.cs

* Address riperiperi comments.

* Fixed the issue of unjustifiably longer boot times at the second boot than at the first boot, measured at the same time or reference point and with the same number of translated functions.

* Implemented a simple redundant load/save mechanism.

Halved the value of Decoder.MaxInstsPerFunction more appropriate for the current performance of the Translator.
Replaced by Logger.PrintError to Logger.PrintDebug in TexturePool.cs about the supposed invalid texture format to avoid the spawn of the log.
Nits.

* Nit.

Improved Logger.PrintError in TexturePool.cs to avoid log spawn.
Added missing code for FZ handling (in output) for fp max/min instructions (slow paths).

* Add configuration migration for PTC

Co-authored-by: Thog <me@thog.eu>
2020-06-16 20:28:02 +02:00
mageven
ba4830293e
Refactor out Application details from Horizon (#1236)
* Initial Application refactor

* Misc typo and access modifier fixes

* Clean unused namespaces

* Address gdkchan's comments

* Move ticket reading to common method

* Change IParentalControlService to use ApplicationLoader.ControlData
2020-05-15 03:16:46 -03:00
Ac_K
0711ffd52b
Fix SystemInfo logging to file (#1217)
We currently logs system informations before we load the configuration file.
Since the logger use the configuration file (to sets if it should store the logs in a file, etc...), if we print something before the configuration init, the log file doesn't contains any system informations.
Now it's fixed.
2020-05-07 23:24:33 +10:00
SeraUX
8be7335176
Logging the current firmware version (#1199)
* Logging the curent firmware version

* fixed an error in cases when firmware is not installed
2020-05-05 21:51:04 +10:00
HorrorTroll
371b9999f2
Add Docked/Handheld text on status bar (#1205)
* Add Dock/Handheld on status bar

* Simplified the code & move next to V-Sync

* Nit.
2020-05-05 08:10:01 +10:00
Mary
651a07c6c2
Refactor SystemInfo and implement macOS system info backend (#1177) 2020-05-04 12:15:27 +10:00
Ac_K
4c54f36c38
Upgrade projects to C#8 (#1193)
Some parts of our code needs C# 8 who isn't set as default in Visual Studio. To fix this we have to set the C# version correctly in the csproj files and then we are be able to build the project using Visual Studio.
2020-05-04 12:14:48 +10:00
Thog
12399b8aea
Update GLWidget to 1.0.2 (#1191)
This should fix OpenGL context creation on OSX (using Cocoa).

NOTE: As macOS doesn't support OpenGL 4.3, the emulator will probably not work but this fix the hardcrash when starting any games.
2020-05-04 08:58:59 +10:00
riperiperi
28e12dad0f
Fix issues causing keyboard profiles to throw errors on load. (#1206)
* Fix issues causing keyboard profiles to throw errors on load.

* Re-add space before the using aliases
2020-05-03 20:42:17 +02:00
Xpl0itR
676fc73885
Revert package include condition (#1204) 2020-05-03 15:36:51 +02:00
Thog
80d0cc7d6f system: Make index 0 of keyboards in configuration 'all keyboards' 2020-05-03 15:00:29 +02:00
Thog
afecb551c5 ui: fix major regression on SaveConfig 2020-05-03 12:08:21 +02:00
Xpl0itR
538fba826b
Improvements to input and input configuration in the GUI. (#849)
* Improvements to input and input configuration in the GUI

* Requested changes

* nits

* more nits
2020-05-03 04:00:53 +02:00
Xpl0itR
5f3558fd51
catch key errors (#1157) 2020-05-03 01:43:22 +02:00
Michael Kuklinski
9be4e4c766
Adding .editorconfig so code style can be consistent and localized (#1131)
* Updated all NuGet packages to latest, and updated the framework from .NET Core 3.0 to 3.1.

* Updating appveyor settings for 3.1

Updating appveyor to use the netcoreapp3.1 path instead of 3.0.

* Removing unneeded NuGet package System.Runtime.CompilerServices.Unsafe.

* Removing unused NuGet package SharpFontCore.

* Removing unused NuGet package TimeZoneConverter.Posix

* Cleaning up by adding newline to a csproj.

* Simplfying a NuGet conditional include, and adding a warning disable for an annoying NuGet package.

* Adding .editorconfig so users have a consistent style setting regardless of their local settings.

* I'm not sure if .travis.yml is still used, but I'm updating its 'dotnet' version to the correct SDK.

* Making the runtime version into its own environment variable so it's a bit easier to change in the future.

* Removing OpenTK.NetStandard reference from Ryujinx.Common

* Fixing indentation in Common.csproj

* Updating the README to specify .NET Core 3.1.

* Reverting the update of the GTKSharp package so it doesn't block the PR.
2020-05-03 00:58:58 +02:00
Thog
886e42fb19
Use the official JSON parser (#1151)
This remove Utf8son and JsonPrettyPrinter dependencies.

NOTE: the standard JSON parser doesn't support configurable
indentation, as a result, all the pretty printed JSON are indented with 2
spaces.
2020-04-30 14:07:41 +02:00
Alex Barney
7ab3fccd4d
Add BCAT delivery cache support (#1154)
* Initial bcat delivery cache support

* Use LibHac 0.11.0

* Add option to open the BCAT savedata directory
2020-04-30 14:58:19 +10:00
Patrick Grabensteiner
ec620e2de0
Create log folder if not exists fixes #1143 (#1146)
* Create log folder if not exists fixes #1143

* Fixed Format

Co-authored-by: Patrick Grabensteiner <patrick.grabensteiner@gmx.at>
2020-04-28 03:50:36 +02:00
Xpl0itR
59145acd7c
Revert package include condition (#1164) 2020-04-27 23:08:13 +10:00
Thog
74f8a9bd79
UI: Implement interactive search on GameTable (#1148)
As I was unable to disable the ctrl + f keybinding, this implement
something to make it works with the default GTK code logic.

Also remove unused _treeView static member.
2020-04-25 23:02:44 +10:00
Xpl0itR
a065dc1626
Log Ryujinx Version, OS Name, CPU Name and RAM size (#1102)
* Log Ryujinx version and OS

* Log total RAM size and CPU name

* Requested changes

* requested change

* jd's requested changes

* jd's requested changes
2020-04-25 23:01:32 +10:00
Thog
fba8651213
ui: Make ExtractSection supports updates (#1150)
This adds update support to the section extractor.
2020-04-23 21:21:32 +02:00
Xpl0itR
72b560d15c
Fix metadata.json JsonParsingException crash (#1062)
* Load defualt metadata if the metadata.json gets corrupt

* Write to disk immediately to decrease the chances of corruption
2020-04-23 14:01:23 +02:00
Michael Kuklinski
c46edfab85
Update .NET Core to 3.1, and update NuGet Packages (#1121)
* Updated all NuGet packages to latest, and updated the framework from .NET Core 3.0 to 3.1.

* Updating appveyor settings for 3.1

Updating appveyor to use the netcoreapp3.1 path instead of 3.0.

* Removing unneeded NuGet package System.Runtime.CompilerServices.Unsafe.

* Removing unused NuGet package SharpFontCore.

* Removing unused NuGet package TimeZoneConverter.Posix

* Cleaning up by adding newline to a csproj.

* Simplfying a NuGet conditional include, and adding a warning disable for an annoying NuGet package.

* I'm not sure if .travis.yml is still used, but I'm updating its 'dotnet' version to the correct SDK.

* Making the runtime version into its own environment variable so it's a bit easier to change in the future.

* Removing OpenTK.NetStandard reference from Ryujinx.Common

* Fixing indentation in Common.csproj

* Updating the README to specify .NET Core 3.1.

* Reverting the update of the GTKSharp package so it doesn't block the PR.
2020-04-22 14:13:41 +10:00
Thog
36749c358d
SurfaceFlinger v2 (#981)
* Rewrite SurfaceFlinger

Reimplement accurately SurfaceFlinger (based on my 8.1.0 reversing of it)

TODO: support swap interval properly and reintroduce disabled "game vsync" support.

* Some fixes for SetBufferCount

* uncomment a test from last commit

* SurfaceFlinger: don't free the graphic buffer in SetBufferCount

* SurfaceFlinger: Implement swap interval correctly

* SurfaceFlinger: Reintegrate Game VSync toggle

* SurfaceFlinger: do not push a fence on buffer release on the consumer side

* Revert "SurfaceFlinger: do not push a fence on buffer release on the consumer side"

This reverts commit 586b52b0bfab2d11f361f4b59ab7b7141020bbad.

* Make the game vsync toggle work dynamically again

* Unregister producer's Binder object when closing layer

* Address ripinperi's comments

* Add a timeout on syncpoint wait operation

Syncpoint aren't supposed to be waited on for more than a second.

This effectively workaround issues caused by not having a channel
scheduling in place yet.

PS: Also introduce Android WaitForever warning about fence being not
signaled for 3s

* Fix a print of previous commit

* Address Ac_K's comments

* Address gdkchan's comments

* Address final comments
2020-04-22 14:10:27 +10:00
Cristallix
4738113f29
Suppress warnings from fields never used or never assigned (CS0169 and CS0649) (#919)
* chore : disable unwanted warnings and minor code cleanup

* chore : remove more warnings

* fix : reorder struct correctly

* fix : restore _isKernel and remove useless comment

* fix : copy/paste error

* fix : restore CallMethod call

* fix : whitespace

* chore : clean using

* feat : remove warnings

* fix : simplify warning removal on struct

* fix : revert fields deletion and code clean up

* fix : re-add RE value

* fix : typo
2020-04-21 07:59:59 +10:00
CJ Bok
0a7c6caedf
System Time Offset Implementation (#1101)
* System Time Offset Implementation

* Addressed @Thog's comments

* Addressed JD's comments

* Addressed @Thog's and @AcK77's comments

* formatting correction
2020-04-17 09:18:54 +10:00
Xpl0itR
ad3d2fb5a9
Implement update loader and log loaded application info (#1023)
* Implement update loader

* Add title version to titlebar and log loaded application info

* nits

* requested changes
2020-04-12 23:02:37 +02:00
Thog
f70cc96464
libhac: use ApplicationControlProperty instead of Nacp (#1073)
* libhac: use ApplicationControlProperty instead of Nacp

Nacp was marked as deprecated in 0.10.0, this PR remove all usage of it
from Ryujinx and use the new struct ApplicationControlProperty.

* Address Moose's comment
2020-04-03 21:01:26 +11:00
mageven
2365ddfc36
HID SharedMem Rework (#1003)
* Delete old HLE.Input

* Add new HLE Input.

git shows Hid.cs as modified because of the same name. It is new.

* Change HID Service

* Change Ryujinx UI to reflect new Input

* Add basic ControllerApplet

* Add DebugPad

Should fix Kirby Star Allies

* Address Ac_K's comments

* Moved all of HLE.Input to Services.Hid
* Separated all structs and enums each to a file
* Removed vars
* Made some naming changes to align with switchbrew
* Added official joycon colors

As an aside, fixed a mistake in touchscreen headers and added checks to
important SharedMem structs at init time.

* Further address Ac_K's comments

* Addressed gdkchan's and some more Ac_K's comments

* Address AcK's review comments

* Address AcK's second review comments

* Replace missed Marshal.SizeOf and address gdkchan's comments
2020-04-03 11:10:02 +11:00
Xpl0itR
45c7424f7c
fix tooltip (#1080) 2020-03-31 20:44:05 +02:00
Xpl0itR
92b17fc228
Set default width and height based on monitor resolution (#1046) 2020-03-31 00:10:13 +02:00
Xpl0itR
6a7b58e256
Add warning with an option to disable for settings that impact performance (#1002)
* Add warning and option to disable when loading game with debug logs

* Add warning and option to disable when shader dumping is enabled

* Edit text and add title
2020-03-31 08:39:46 +11:00
Xpl0itR
12d49c37d2
Make max anisotropy configurable (#1043)
* Make max anisotropy configurable

* Move opengl command to opengl project

* Add GUI option
2020-03-31 08:38:52 +11:00
Elise
5c1757f7c2
Escape key now brings up a dialog to confirm you want to stop emulation (#1044)
* Add a dialog to make sure user wants to stop emulation when esc is pressed

* Remove unneccesary space

* Fix formatting

* Remove unnessecary spaces

* Fix formatting for member of GtkDialog
2020-03-29 23:47:37 +11:00
Xpl0itR
2816b2bf17
Discord Rich Presence update (#1029)
* Fix bug

* Add a few more titles and move the list from dat file into the code

* requested changes
2020-03-29 14:25:54 +11:00
Thog
0dd38028cb
Make Device Location Name configuration (custom TZ) (#1031)
This permit to use arbitrary timezone (instead of UTC).

Useful for games like ACNH.
2020-03-26 09:23:21 +11:00
Thog
5423daea56
ui: Make it possible to open the device save directory (#1040)
* Add an open device folder option

* Simplify logic from previous commit

* Address Xpl0itR's comments

* Address Ac_K comment
2020-03-25 18:09:38 +01:00
Elise
d5670aff77
Fix unhandled UnauthorizedAccessException causing crash while listing… (#1025)
* Fix unhandled UnauthorizedAccessException causing crash while listing directories

* Actually handle not having privileges for a directory

* Fix log message when not having privileges for a directory

* Remove unneccesary empty lines

* Remove unneccecssary space
2020-03-25 17:17:54 +01:00
Alex Barney
21c9c04f9f
Add IMultiCommitManager (#1011)
* Update LibHac

* Add IMultiCommitManager

* Updates

* Delete NuGet.Config

* Add command version
2020-03-25 19:14:35 +11:00
Ac_K
a40d8d4a17
Fix gpu vendor name parsing (#1030)
* Update GLRenderer.cs

* print the vendor name fully
2020-03-25 00:12:01 +01:00
HorrorTroll
17200214df
Add GPU name in status bar (#984)
* Add GPU name in status bar

* Fixed like Ac_K suggest

* Nit.

* Minor fix

* Minor change.

* Nit.

* Fixed for ATI vendor

* Minor fix, again...
2020-03-24 22:54:09 +01:00
Ac_K
32d3f3f690
Implement GetRegionCode and add the RegionCode to settings (#999)
This implement `GetRegionCode` accordingly to RE. I've added a setting in the GUI and a field in the Configuration file with a way to update the Configuration file if needed.
2020-03-20 09:37:55 +11:00
riperiperi
8ce3993afa
Fix GTK window crash by using 24 bit surface on unix, 32 bit on windows. (#976)
* Use 24 bit surface on unix, 32 bit on windows.

* Address jd's comment

Co-authored-by: Thomas Guillemard <me@thog.eu>
2020-03-14 22:36:56 +01:00
Xpl0itR
e2bb5e8091
Move status information from the title bar to the new status bar (#948)
* Move status information from the title bar to the new status bar

* jd's requested changes

* Ack's requested changes

* gdk's requested changes

* Remove frame time statistics
2020-03-07 13:40:06 +11:00
Alex Barney
cecbd256a5
Add support for cache storage (#936)
* Update LibHac

* Run EnsureApplicationCacheStorage when launching a game

* Add new FS commands
2020-03-03 15:07:06 +01:00
emmauss
3045c1a186
update glwidget package (#961) 2020-03-03 13:49:18 +11:00
Thog
5f6949d9b0
Improve rendering on resolution lower than 1080p (#944)
* Improve rendering on resolution lower than 1080p

* Apply scaling factor to the renderer (This fix 4K displays)
2020-02-18 22:34:57 +11:00
Xpl0itR
d736352da2
Add button in settings to open logs folder (#947) 2020-02-17 22:35:03 +01:00
Xpl0itR
d89e90a16e
Catch System.IO.IOException (#932) 2020-02-15 21:20:19 +01:00
Thog
91b37ae36e
Accept gamepad inputs when not focused (#941) 2020-02-15 12:30:53 +01:00
Thog
4789f79254
Fix crash when first starting the emulator (#945)
* Fix crash when first starting the emulator

* Fix a nit
2020-02-14 23:07:22 +01:00
Xpl0itR
a73fd9e9bd
Changes to configuration (#811)
* config loading changes

- load config from either ryufs or ryujinx.exe parent folder with parent folder taking priority
- config file in repo is only copied to parent directory if built in debug mode

* AcK's requested changes

* add "Profile Debug" as a condition to copy the default config to output
2020-02-14 20:19:13 +01:00
Thog
dbe3f938c7
Remove ScopedGlContext (#933)
As MakeCurrent can be slow to execute, this PR changes GLRenderer to not
have to reexecute MakeCurrent when processing frames.
2020-02-14 11:52:34 +01:00
Ac_K
949bb81a9e
Add version in all window titles (#935)
This add the AppVeyor build version (added in #927) in the console window title and in the GUI title (when you are on the games list or when an emulated game is closed).
2020-02-14 11:33:22 +01:00
Thog
416ddd0f6e
Some fixes for the new GLRenderer (#930)
* Some fixes for the new GLRenderer

Changelog:
- Fix transparency of the window on some games on Windows.
- Fix escape key not being able to exit emulation.
- Fix inverted logic in fullscreen event handling.
- Fix a race condition when stoping emulation causing a hang.
- Fix a memory leak of the OpenGL context when stoping emulation (saving ~200MB of RAM when stoping emulation).
- Simplify and document behaviours when exiting the emulator while the
emulation is running.

* Make sure to clear alpha channel when presenting Texture

This fix once and for all the transparency issue on Windows.

* Enforce footer bar size to avoid gl widget to get resized to 1280x724

* Fix full screen inversion in MainWindow and make sure _listStatusBox don't come back when not needed

* Remove previous transparency clear attempt that is useless now

* Remove an extra line return
2020-02-13 14:43:29 -03:00
Thog
8d83878f67
Improve build identification (#927)
* Improve build identification

Add versioning on CI build

Fix #887

* Fix appveyor

* Fix appveyor for real now
2020-02-12 14:35:39 +01:00
emmauss
3aa3c4261a
Add inbuilt Opengl renderer to window (#922)
* add gl rendering widget

* embed renderer into main window

* add input

* fix mouse input

* fix mouse coords

* refresh game list after closing game, remove profiler method

* rebase, hide game list progress bar while game is running

* Some bug fixes

Changelog:

- Reapply some changes that got lost while rebasing from #904
- Make sure to guarantee exclusivity on the GL context (fixing multiple
possible race conditions on Windows)
- Avoid making GLRenderer disposed multiple time

* add fullscreen,  enable input on focus, disable aplha

* addressed comments

* Disable transparency in the window

* fix fullscreen state, fix focus, addressed comments

* nit

* addressed nit

Co-authored-by: Thog <thog@protonmail.com>
2020-02-12 01:56:19 +01:00
Alex Barney
e7a4e0a328
Get program IDs for the game list from NCA headers (#928)
Previously it would try various fields from the NACP and didn't always work
2020-02-11 23:43:24 +01:00
Xpl0itR
2e6080ccbb
Implement NCA section extractors in the GUI (#896)
* Implement NCA section extractors in the GUI

* AcK's requested changes

* Put extractor on a new thread and added dialogs

* bug fix

* make extraction cancelable

* nits

* changes

* gdkchan's requested change
2020-02-08 15:22:45 -03:00
Thog
a906f2071c
Fix a crash when closing the main UI (#904)
* Fix a crash when closing the main Ui

Also make sure to dispose the OpenAL context to not leak memory when
unloading the emulation context.

* Improve keys and 'game already running' dialogs

* Make sure to dispose the page table and ThreadContext

Less memory leaks!

* Fix tests

* Address gdk's comments
2020-02-06 12:38:24 +01:00
emmauss
f2b9a9c2b0
Render Profiler in GUI (#854)
* move profiler output to gui

* addressed commits, rebased

* removed whitespaces
2020-02-06 11:25:47 +00:00
Xpl0itR
7b0576db71
Fix application list (#891)
* Fix application list

* Convert file extensions to lowercase before comparing

* AcK's requested changes

* fixed bug found by gdkchan's requested changes

* Account for mismatch between LibHac.TitleLanguage and ...System.Language
2020-01-31 19:21:46 +01:00
Thog
1d8da18334 Make VirtualFileSystem only instanciable once (#901)
This fix a regression caused by #888 on temporary saves for SNES Online.
(and probably other games)
2020-01-24 17:01:21 +01:00
MelonSpeedruns
4232a15187 Added Program Icon (#900)
* Added Program Icon

Added an icon that displays in the Windows File Explorer and on the console window itself when launched.

* Renamed ryu.ico to Ryujinx.ico
2020-01-24 16:14:51 +01:00
Thog
d6b9babe1d Keep the GUI alive when closing a game (#888)
* Keep the GUI alive when closing a game

Make HLE.Switch init when starting a game and dispose it when closing
the GlScreen.

This also make HLE in charge of disposing the audio and gpu backend.

* Address Ac_k's comments

* Make sure to dispose the Discord module and use GTK quit method

Also update Discord Precense when closing a game.

* Make sure to dispose MainWindow

* Address gdk's comments
2020-01-21 23:23:11 +01:00
Jonathan Goyvaerts
b4b2b8b162 Update DiscordRichPresence package reference to 1.0.147 which is now built for .NET core (#898) 2020-01-20 17:55:15 +01:00
Alex Barney
c5f872c70a Update to LibHac 0.8.2 (#889)
* Update to LibHac 0.8.2

This brings support for temporary savedata, ignores case in key names when loading from a file, and prints the rights ID correctly when missing a title key.

* Auto-format IFileSystemProxy
2020-01-16 19:08:39 -03:00
Ac_K
5facc0c07f Name all threads (#886)
* Name all threads

Close #874

* use ThreadName instead of ThreadId in Logging
2020-01-13 01:21:54 +01:00
Jonathan Goyvaerts
88f78ae6c8 Get rid of unused class AboutInfo (#882) 2020-01-12 14:11:45 -03:00
Alex Barney
e348f95495 Call EnsureApplicationSaveData when launching a game (#871)
* Workaround for the lack of a program registry

* Call EnsureApplicationSaveData when launching a game
2020-01-12 12:15:17 +01:00
Jonathan Goyvaerts
78f6b1d396 Create method to LoadAndSave ApplicationMetaData and get rid of code duplication (#872) 2020-01-12 04:01:04 +01:00
emmauss
e485ee049d System firmware installer (#791)
* firmware installer

* Add directory installation option and fix 9.x support for directory

* Fix missing system font error while installing for the first time

* Address code style comments

* Create and use InvalidFirmwarePackageException

* Fix LDj3SNuD's comments

* addressed alex's comments

* add label to status bar to show current firmware version

Co-authored-by: Thog <thog@protonmail.com>
2020-01-12 03:10:55 +01:00
Ac_K
021ed3f44e InitializeCounters to Initialize 2020-01-10 02:17:34 +01:00
gdkchan
92703af555 Address PR feedback 2020-01-09 02:13:00 +01:00
gdkchan
59fdaa744b GPU resource disposal 2020-01-09 02:13:00 +01:00
gdk
16d88c21fc Improved and simplified window texture presentation 2020-01-09 02:13:00 +01:00
gdk
63345a3098 Support window resizing 2020-01-09 02:13:00 +01:00
gdk
1876b346fe Initial work 2020-01-09 02:13:00 +01:00
Thog
01daefe38d
Make sure to reload keys after Migration
This fix keys not being loaded on the first run right after migration.
2020-01-05 16:39:35 +01:00
Alex Barney
63b24b4af2 Rename "RyuFs" directory to "Ryujinx" and use the same savedata system the Switch uses (#801)
* Use savedata FS commands from LibHac

* Add EnsureSaveData. Use ApplicationControlProperty struct

* Add a function to migrate to the new directory layout

* LibHac update

* Change backup structure

* Don't create UI files in the save path

* Update RyuFs paths

* Add GetProgramIndexForAccessLog

Ryujinx only runs one program at a time, so always return values reflecting that

* Load control NCA when loading from an NSP

* Skip over UI stats when exiting

* Set TitleName and TitleId in more cases. Fix TitleID naming style

* Completely comment out GUI play stats code

* rebase

* Update LibHac

* Update LibHac

* Revert UI changes

* Do migration automatically at startup

* Rename RyuFs directory to Ryujinx

* Update RyuFs text

* Store savedata paths in the GUI

* Make "Open Save Directory" work

* Use a dummy NACP in EnsureSaveData if one is not loaded

* Remove manual migration button

* Respond to feedback

* Don't read the installer config to get a version string

* Delete nuget.config

* Exclude 'sdcard' and 'bis' during migration

Co-authored-by: Thog <thog@protonmail.com>
2020-01-05 12:49:44 +01:00
Xpl0itR
bd010869a5 GUI: Implement context menu for the game table (#840)
* Add context menu to the game table

* Minor bugfix and cleanup

* add ability to create directory if it doesn't exist

* nit

* dont show menu when right-clicking nothing
2019-12-22 03:49:51 +01:00
Thog
01a4c80ed5
Rewrite the configuration system (#831)
The configuration system was quite fragile and too dependent on everything, this fix #812 .

The changes:

    The file configuration is now entirely independent from the internal configuration state.
    The file configuration is versioned (current version is 1).
    Every configuration elements are now reactive properties that the emulator can register on to handle initialization and configuration changes.
    The configuration system is now in Ryujinx.Common to be accessible on every projects.
    Discord integration is now independent from the UI and can be reloaded.
    The primary controller is now configurable at runtime (NOTE: the UI currently doesn't have any options to configure real controller).
    The logger is entirely reloadable.
    You can now hotplug your controller when the emulator is running.
    The logger now takes name for every LogTarget to make them removable at runtime.
    The logger now always add the default "console" target to avoid loosing early init logs.
    The configuration system now generates a default file configuration if it's missing or too new.
    General system stability improvements to enhance the user's experience
2019-12-21 20:52:31 +01:00
Xpl0itR
da4e0856c9 Add features to GUI (#757)
* controller image changes depending on the selected controller type

the new controller image assets are temporary until i get new ones

* Game list scans subdirs for games

* Key file existence check

* Only shows Program NCAs in Application list

* Change shown GUI columns without restarting

* Sort by column if you click on the column header

Columns are sorted as text so there are inaccuracies on some columns

* Fix sort on Time Played, Last Played and File Size columns

* Add ability to designate favourite games #1

TODO:
- Make fav games persistent
- Fix invisible check marks due to theme

* Add ability to designate favourite games #2

Also removed default theme

* Added a Windows specific build condition and a Linux bug fix

* bugfix

* Load metadata from JSONs

* Temp bug fix for MacOS

* lil clean up

* requested changes

* Misc fixes

* edited schema and config

* Show the TitleID of games on the title bar

* gui column config option have names

* Async loading of game list

* bugfix and cleanup

* thog's requested changes

* requested changes and cleanup

still need to fix the gtk seizure

* Fix issue where an ExeFS as a NSP didn't show up in the application list

* Minor fixes

* catch glib unhandled exceptions

* Make sure to do UI manipulation in the main thread

* Print path of invalid files

* Ac_k's requested changes

* Return of the dark theme

* move AboutInfo struct to another file

* sort usings

* changes

- gdkchan's requested changes that have been marked resolved
- made some structs internal as they aren't used outside of the GUI
- renamed Ryujinx.UI to Ryujinx.Ui to fit naming convention and folder structure
- fixed bug where controller type dropdown box is stretched
2019-11-29 15:32:51 +11:00
Wardoc
848cda1837 Update controller config (#793)
* Update Config

Correct a bad Controller Left and Right Joycon config

* Update config to correct A and B

* Update To fix buttons X and Y

Update To fix buttons X and Y

* Removed stick_y
2019-11-01 14:17:37 +11:00
LDj3SNuD
eee639d6ba .NET Core 3.0 is here! (#784)
* .NET Core 3.0 is here!

* Remove IMemoryManager.cs and its references.

* Add T Math/F.FusedMultiplyAdd(T, T, T). Nits.

* Nit.

* Update appveyor.yml

* Revert "Resolve Visual Studio build issues"

This reverts commit 1772128ce0.

* Update SvcTable.cs
2019-10-31 19:09:03 +01:00
Alex Barney
8a8ea4c8c0 Update to LibHac 0.6.0 (#792)
* Update to LibHac 0.6.0

* Create an IFileSystemProxy object from LibHac

* Rename rc -> result

* Alignment and spacing

* Result formatting

* Spacing

* Sort usings
2019-10-17 08:17:44 +02:00
riperiperi
17d3c75df4 Fix behaviour when an analog trigger is assigned to a button. (#790) 2019-10-13 19:45:12 +02:00