Compare commits

...

167 Commits

Author SHA1 Message Date
000c1756de version 1.2 in Info.plist 2024-12-06 08:17:04 -06:00
1d0152b961 UI: Move Shader Compilation hint, graphics backend, and GPU manufacturer to the right side of the status bar, next to firmware version.
Removed the "Game:" prefix in front of FPS.
2024-12-04 03:37:21 -06:00
07690e4527 chore: applets: Cleanup redundant ReadStruct implementations & provide a default implementation for IApplet#GetResult. 2024-12-04 02:24:40 -06:00
08b7257be5 Add the Cabinet Applet (#340)
This adds the missing Cabinet Applet, which allows for formatting
Amiibos and changing their names.
2024-12-02 23:40:02 -06:00
17483aad24 ARMeilleure: Allow TPIDR2_EL0 to be set properly (#339) 2024-12-02 14:42:07 -06:00
6b5cb151c3 Implement and stub services required for Mario Kart Live: Home Circuit (#331)
These changes allow Mario Kart Live: Home Circuit (v2.0.0) to boot into
menus. Kart functionality has not been implemented and will not work.

Version 1.0.0 is currently unsupported due to unimplemented ARM
registers. I plan on addressing this issue at a later date.


### Here is a list of the implemented and stubbed services in this PR:
#### Implemented:
Ldn.Lp2p.IServiceCreator: 0 (CreateNetworkService)
Ldn.Lp2p.IServiceCreator: 8 (CreateNetworkServiceMonitor)
Ldn.Lp2p.ISfService: 0 (Initialize)
Ldn.Lp2p.ISfServiceMonitor: 0 (Initialize)
Ldn.Lp2p.ISfServiceMonitor: 256 (AttachNetworkInterfaceStateChangeEvent)
Ldn.Lp2p.ISfServiceMonitor: 328 (AttachJoinEvent)
#### Stubbed:
Ldn.Lp2p.ISfService: 768 (CreateGroup)
Ldn.Lp2p.ISfService: 1536 (SendToOtherGroup)
Ldn.Lp2p.ISfService: 1544 (RecvFromOtherGroup)
Ldn.Lp2p.ISfServiceMonitor: 288 (GetGroupInfo)
Ldn.Lp2p.ISfServiceMonitor: 296 (GetGroupInfo2)
Ldn.Lp2p.ISfServiceMonitor: 312 (GetIpConfig)
2024-11-30 17:20:48 -06:00
3680df6092 Fix for missing text with specific system locale encoding (#330) 2024-11-30 17:17:30 -06:00
facc12a94a JIT Sparse Function Table random crash fix (#319)
A couple of games have random crashing with the JIT Sparse Ftable changes, and it seems to have been caused by an insufficient int size returned by `AddressTableLevel#GetValue(ulong address)`.
It was 32 bits (Int32), but the GiantBlock (which is the current address table impl) uses potentially 36 bits for the first level.
2024-11-29 16:32:55 -06:00
8e55e6d6d7 Korean translation for key install tool (#329) 2024-11-29 15:39:11 -06:00
346dfe9542 Added Tool for installing keys (#233)
#232 

![image](https://github.com/user-attachments/assets/5ae6118d-3857-4005-8392-5398c8fa91d5)
2024-11-28 17:32:07 -06:00
8a2b56cae6 Fix logic surrounding PushDescriptors in Vulkan (#257) 2024-11-28 17:00:12 -06:00
baf179efdb ignore macos attribute files (#302) 2024-11-28 16:55:51 -06:00
2a72fb2088 UI: RPC: Add Diablo III 2024-11-26 17:15:11 -06:00
0caeab2270 Remove 'Enter' hotkey in settings menu (#95)
This allows the Enter key to be bound to a button when using the
Avalonia UI.
2024-11-25 13:46:41 -06:00
f72d2c1b2b UI: Add Mii Edit Applet Locale (#311)
This allows the "Mii Edit Applet" dropdown to be localized ( I already
went ahead and localized French )
2024-11-25 13:43:01 -06:00
a18cecbc30 Korean "Show Changelog" translation (#313) 2024-11-25 13:40:39 -06:00
2e6794e69b Add custom refresh rate mode to VSync option (#238)
Rebased @jcm93's refreshinterval branch:
https://github.com/jcm93/Ryujinx/tree/refreshinterval

The option is placed under System/Hacks. Disabled, it's the default
Ryujinx behavior. Enabled, the behavior is shown in the attached
screenshots. If a framerate is too high or low, you can adjust the value
where you normally toggle VSync on and off. It will also cycle through
the default on/off toggles.

Also, in order to reduce clutter, I made an adjustment to remove the
target FPS and only show the percentage.

---------

Co-authored-by: jcm <6864788+jcm93@users.noreply.github.com>
2024-11-25 13:39:09 -06:00
7e16fccfc1 UI: Fix icons getting cutoff in the About window (#310)
Before:


![image](https://github.com/user-attachments/assets/c8d6b7d5-487b-4ab9-83e3-9489eaa0a076)

After:


![image](https://github.com/user-attachments/assets/18ea6360-f6ee-48e6-9a0a-cd8d88a0cf51)
2024-11-24 11:33:53 -06:00
a81212bbf1 Fix window decorations being too wide (#309) 2024-11-24 09:49:44 -06:00
e8d3ad4d8b UI: RPC: TSUKIHIME -A piece of blue glass moon- asset image 2024-11-23 13:10:53 -06:00
3b6731a351 infra: Undo packing native libraries into executable. 2024-11-22 17:51:44 -06:00
e653848a2c JIT Sparse Function Table (#250)
More up to date build of the JIT Sparse PR for continued development.
JIT Sparse Function Table was originally developed by riperiperi for the
original Ryujinx project, and decreased the amount of layers in the
Function Table structure, to decrease lookup times at the cost of
slightly higher RAM usage.
This PR rebalances the JIT Sparse Function Table to be a bit more RAM
intensive, but faster in workloads where the JIT Function Table is a
bottleneck. Faster RAM will see a bigger impact and slower RAM (DDR3 and
potentially slow DDR4) will see a slight performance decrease.
This PR also implements a base for a PPTC profile system that could
allow for PPTC with ExeFS mods enabled in the future.
This PR also potentially fixes a strange issue where Avalonia would time
out in some rare instances, e.g. when running ExeFS mods with TotK and a
strange controller configuration.

---------

Co-authored-by: Evan Husted <gr33m11@gmail.com>
2024-11-22 15:33:44 -06:00
5534001152 UI: Always save screenshots to the Ryujinx data directory. 2024-11-22 15:08:24 -06:00
e05875a079 UI: It's called "live testing." 2024-11-22 14:52:56 -06:00
49eeb26b6f UI: I may be stupid. Primary button result is Ok, not Yes. 2024-11-22 14:46:10 -06:00
f8d63f9a2f UI: Add a show changelog button in the Updater, for new updates & when you're on the latest version. 2024-11-22 14:38:58 -06:00
e2b7738465 Add all the missing locales from XCI Trimmer and LDN merge (#281)
Hello any fellow developers that may be reading this. Whenever you add
any new locales to `en_US.json`, please make sure to add them to the
rest of the locale files. I will not always be there to add them myself.
2024-11-22 11:07:47 -06:00
1d42c29335 Add more mentions of canary (#258)
This should hopefully make it clearer whether or not you're using
canary.

Changelog:
- Changed github workflows to have "canary" in the zip files
- Added `App.FullAppName` in the about section, so that it's clear in
there too
- Changed log name for canary builds to
`Ryujinx_Canary_{version}_{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.log`
(normal builds should still be
"Ryujinx_{version}_{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.log)
2024-11-21 12:34:53 -06:00
c2de5cc700 Fix really obvious typo, lol 2024-11-21 10:16:13 -06:00
aaaf60b7a4 Change headless to nogui in the release artifacts (#285)
This makes it so that instead of the files you download being
`sdl2-ryujinx-headless` they are now `nogui-ryujinx`in the release (and
canary) artifacts
2024-11-20 12:20:38 -06:00
150e06e0de Add documentation and ldn labels to labeler.yml (#282)
This should make it so that any changes made to ldn and documentation
related files should be auto-labeled
2024-11-20 11:52:16 -06:00
c0a4d95c5d ARMeilleure: Implement TPIDR2_EL0 (#280)
This is an implementation of the TPIDR2_EL0 register. There may be more
potential use-cases for this register not included in this PR, but this
implements the use-case seen in SuperTuxKart.
2024-11-19 13:02:24 -06:00
c3831428e0 Try and fix weird nullref 2024-11-19 10:22:11 -06:00
fda79efed4 Fix Windows builds not being uploaded 2024-11-19 09:31:22 -06:00
8444e4dca0 Fixed mime types button not updating after install/uninstall (#241) 2024-11-19 02:16:15 -06:00
008d908c5a Update Chinese locale missing line (#259) 2024-11-19 01:59:56 -06:00
722953211d Add Zelda Echoes of Wisdom Amiibos informations (#262)
This adds missing informations about Zelda Echoes of Wisdom Amiibos.
2024-11-19 01:59:00 -06:00
df5002bdbf Created bool to store if the "Avilable Update" should be hidden on startup (--hide-updates) (#272)
fixes #263
2024-11-19 01:52:51 -06:00
f4b757c584 Add XCITrimmerTrim and XCITrimmerUntrim Locales (#273) 2024-11-18 15:05:00 -06:00
25d69079cb Fix a couple dead links and spotty wording in docs (#260)
Made it clearer that building is for contributors only in `COMPILING.md`

Fixed 2 dead links in `CONTRIBUTING.md`, that were caused by separating
`COMPILING.md` and file structure changed to `pr-guide.md`
2024-11-17 04:35:37 -06:00
2e1ede5348 Merge remote-tracking branch 'origin/master' 2024-11-17 00:58:10 -06:00
52f42d450f try 1: Fix IndexOutOfBounds in SDL2GamepadDriver.cs 2024-11-17 00:57:56 -06:00
11416e2167 i18n: es_ES: Added missing translations and minor fixes (#242)
Added missing translations and fixed a few spelling mistakes.
2024-11-17 00:17:56 -06:00
e5d076a1b2 Fixed some broken urls (#249) 2024-11-17 00:16:05 -06:00
d394dd769a Updated IT translation file (#243) 2024-11-17 00:15:06 -06:00
6de3afc43d misc: chore: Move build instructions into its own markdown file; remove compatibility section since there's no games list. 2024-11-15 06:02:26 -06:00
9b90e81817 Fix window sizing when "Show Title Bar" is enabled (#247)
Fixes a bug that causes the main window to not size properly when the
TitleBar is enabled (i.e.: when the TitleBar and MenuStrip are separate
entities). Corrects the size for main window startup and when a user
clicks a "View > Window Size > *Resolution Here*" MenuStripItem

Prior to this fix if a user selects 720p/1080p and "Show Title Bar" is
enabled, the window would be sized smaller than intended and display
black bars on the sides of the render area
2024-11-15 01:26:35 -06:00
1e53a17041 misc: Add LEGO Horizon Adventures image asset to Discord RPC 2024-11-15 01:18:00 -06:00
0c23104792 Add mention of canary to README.md (#236) 2024-11-15 00:24:18 -06:00
1ed2aea029 Update ko_KR again 2024-11-14 02:28:00 -06:00
34caa03385 Update ko_KR.json 2024-11-14 02:16:54 -06:00
104701e80d Updtate Korean translation! (#226)
I participated in the Ryujinx Korean localisation through crowdin, but
there were some parts that I couldn't express in my own colours because
of the existing translation, but I started from scratch and coloured it
with my own colours.

There were some duplicates while editing, so I fixed them all.
2024-11-14 02:08:56 -06:00
cef88febb2 Implement IAllSystemAppletProxiesService: 350 (OpenSystemApplicationProxy) (#237)
Implements IAllSystemAppletProxiesService: 350
(OpenSystemApplicationProxy)

This fixes a crash that occurs when launching an NSP forwarder generated
by Nro2Nsp.
2024-11-13 22:29:00 -06:00
5fccfb76b9 Fix divide by zero when recovering from missed draw (Vulkan), authored by EmulationEnjoyer (#235)
Adds the fix for the crash in the opening cutscene of Baldo: The Sacred
Owls when using Vulkan, from ryujinx-mirror. The original discussion
about the fix can be found
[here.](https://github.com/ryujinx-mirror/ryujinx/pull/52)

It's up to you if you want to merge this, it's one of the very few
improvements that ryujinx-mirror got that hasn't made it into your fork
yet. My opinion is that without a graphics expert on board, we can't
know the real cause of this divide-by-zero issue and will have to make
do with this patch to fix it. And I think we will have to do this many
times in the future for other games that suffer crashes at the moment as
well, at least going by current discussions in the #development section
of the discord.

I did not come up with this fix, all credit goes to
[EmulationEnjoyer](https://github.com/EmulationEnjoyer) for putting
Ryujinx through a debugger and discovering the cause of the crash.
2024-11-13 20:36:59 -06:00
4cb5946be4 UI: RPC: Only show hours at maximum for play time 2024-11-11 18:22:19 -06:00
e1dfb48e23 misc: Specify Normal or Canary in Version log line 2024-11-11 18:22:19 -06:00
6d8738c048 TESTERS WANTED: RyuLDN implementation (#65)
These changes allow players to matchmake for local wireless using a LDN
server. The network implementation originates from Berry's public TCP
RyuLDN fork. Logo and unrelated changes have been removed.

Additionally displays LDN game status in the game selection window when
RyuLDN is enabled.

Functionality is only enabled while network mode is set to "RyuLDN" in
the settings.
2024-11-11 16:06:50 -06:00
abfcfcaf0f Fix issue with Logger.Trace (#228) 2024-11-11 14:14:29 -06:00
d404a8b05b i may be stupid 2024-11-10 23:34:30 -06:00
42cbe24bb1 Actually fix Canary showing the wrong repo 2024-11-10 23:32:37 -06:00
79ba9d1258 UI: RPC: Fix asset image hover string version pointing to the Canary repo in Canary 2024-11-10 23:26:15 -06:00
826ffd4a04 misc: Move the LowPowerPtc event handler that changes Optimizations.LowPower into the ConfigurationState ctor 2024-11-10 22:31:26 -06:00
7369079459 misc: chore: cleanup 2 accidental xml namespaces 2024-11-10 22:23:03 -06:00
a506d81989 Split ConfigurationState into 3 parts:
Migration, Model, and everything else.
2024-11-10 22:16:45 -06:00
15c20920b3 I thought this was a typo on my part; it wasn't 2024-11-10 22:04:55 -06:00
285ee276b6 misc: Bake in value change logging into ReactiveObject to reduce logic duplication. 2024-11-10 22:03:12 -06:00
617b81e209 UI: Conditionally enable install/uninstall file types buttons based on whether they're installed already 2024-11-10 20:33:49 -06:00
eb6ce7bcb3 misc: chore: replace some new "" additions & some I missed 2024-11-10 20:09:02 -06:00
69f75f2df1 misc: Fix small code formatting & styling issues 2024-11-10 19:58:02 -06:00
10c8d73b60 UI: Ryujinx Canary title in NCA extractor 2024-11-10 19:10:02 -06:00
e01a30016e RPC: Add Mario & Luigi Brothership image. 2024-11-10 17:01:47 -06:00
e26625dfd5 UI: Disable XCI trimmer button when in-game 2024-11-10 16:17:36 -06:00
9c82d98ec4 headless: Add Ignore Controller Applet as a configurable option 2024-11-10 15:48:07 -06:00
4aae82bad1 misc: Small cleanups 2024-11-10 15:34:24 -06:00
299be822c4 UI: fix: when switching players, it would show old config (#122)
When switching between players' gamepads while saving settings, then
returning to the previous player, the settings show the default settings
instead of the actual settings applied
2024-11-09 23:24:17 -06:00
b17e4f79fb Adds the ability to read a amiibo's nickname from the VirtualAmiiboFile (#217)
This feature adds a way to change the Amiibo's nickname inside Smash and
other places where it's used, so it’s not always "Ryujinx." However, I
did not add a GUI or create the Cabinet applet that would allow users to
change this. So you will have to go to system/amiibo and find your
amiibo id to change it.
2024-11-09 21:18:50 -06:00
a7b58df3fe Appimage Round 2 (#73) 2024-11-09 19:30:19 -06:00
8c2d6192ba Add Dummy Applet to Replace NotImplementedException (#216)
Currently, in Ryujinx, if an app attempts to open an unimplemented
applet, it crashes. This change adds a dummy applet to send a dummy
response instead of crashing and logs the applet.
2024-11-09 19:28:12 -06:00
2a23000fed Add Canary release badge & links 2024-11-08 19:54:36 -06:00
ab7d0a2e6d nuget: bump Microsoft.IdentityModel.JsonWebTokens from 8.0.1 to 8.1.2 (#13) 2024-11-07 10:47:40 -06:00
bd2681b2f9 Add missing and update translations for zh-tw (#158)
Simply add back some missing translations and update outdated
translations for zh-tw.
2024-11-07 10:46:40 -06:00
640d7f9e77 Updater: kinda confused how this didn't work? 2024-11-06 19:55:58 -06:00
02e8278438 Merge remote-tracking branch 'origin/master' 2024-11-06 19:46:30 -06:00
6acd86c890 Fix canary updater & checking if current build is canary. 2024-11-06 19:46:20 -06:00
708256ce96 Add just, a whole bunch of games to RPC assets. (#98) 2024-11-06 19:22:40 -06:00
5bf50836e1 i18n: missing comma in en_US locale 2024-11-06 18:24:30 -06:00
730ba44043 misc: Canary-specific naming & other small changes I had that I need to push. 2024-11-06 18:23:27 -06:00
36c374cc7a fix: remove --deep (#188) 2024-11-06 18:18:59 -06:00
75f714488e Add many missing locales to all languages (#160)
* Added many missing locales
2024-11-06 17:57:12 -06:00
4831965404 Add ability to trim and untrim XCI files from the application context menu AND in Bulk (#105) 2024-11-06 17:37:30 -06:00
47b8145809 Fix fullscreen when using 'Show Title Bar' (#150) 2024-11-06 17:36:30 -06:00
20cc21add6 fix minor grammatical issues in en_US.json (#183) 2024-11-06 17:36:02 -06:00
683baec1af OOPSIE!!!!!!!!! 2024-11-06 17:04:20 -06:00
f4957d2a09 Didn't realize you could compare tags and not just releases although that should have been obvious 2024-11-06 17:00:16 -06:00
3e1182af22 Specify what is a canary tag 2024-11-06 16:55:17 -06:00
6664ed1b11 Merge remote-tracking branch 'origin/master' 2024-11-06 16:48:33 -06:00
0c88b9eff7 Canary & Release separation. 2024-11-06 16:48:20 -06:00
8a064bcd7e Update README.md (#187) 2024-11-05 12:34:38 -06:00
5ff962be37 fix index out of range check in GetCoefficientAtIndex (#164) 2024-11-03 13:58:27 -06:00
d9c8b7d937 feat: add DebugMouse HID (#163) 2024-11-03 13:58:14 -06:00
feeeafe8fe Update MacOS distribution .icns (#139) 2024-11-02 19:37:42 -05:00
04f014c777 hotfix: Locale formatting 2024-11-01 16:17:08 -05:00
4a677deb50 infra: Add build/release workflows to solution items, remove jitsupport dylib from linux & windows, pack native libraries into Ryujinx executable. 2024-11-01 16:04:32 -05:00
1c07bf3dd0 misc: Abstract repeated logic in markup extensions & move Updater into the base of the Avalonia project. 2024-11-01 15:48:25 -05:00
4c83794254 Avalonia: Move LocaleExtension & IconExtension into one namespace to simplify the usage sites in the markup. 2024-11-01 13:00:56 -05:00
6911e288bc misc: Code cleanups. 2024-11-01 12:00:07 -05:00
67ab54e2bb misc: Remove custom themes in config. 2024-11-01 11:58:58 -05:00
139c195eb7 misc: Replace "" with string.Empty. 2024-11-01 11:57:23 -05:00
9305d171e7 Textures : Increase the amount of VRAM Cache available for Textures based on selected DRAM. (#36) 2024-11-01 06:46:29 -05:00
fb4ab5ea08 UI: Set UseFloatingWatermark to false when the watermark is empty (#135) 2024-11-01 06:46:15 -05:00
d7e17abade Fix homebrew loading. Fixes #109, #107 2024-11-01 06:41:02 -05:00
bdb92224f9 update shell image 2024-10-31 14:05:33 -05:00
b21740c931 Much-needed clarification 2024-10-30 13:24:29 -05:00
4f06c343a4 Removed mentions of the old Ryujinx repo in the docs (#114) 2024-10-30 10:52:38 -05:00
6c6f18509b Update README
Latest release badge, mention where you can find releases in the building section, make discord badge more obvious.
2024-10-30 08:52:55 -05:00
70b7c4c1c3 French: Fixed faulty colon formatting and wrong translations (#92)
* Fixed faulty colon formatting and wrong translations

(The wrong translatations were mostly my fault but you don't need to know that)

* Fixed a typo

* Fixed a couple more colons

* Changed DRamTooltip

* Update fr_FR.json
2024-10-30 02:23:18 -05:00
7764a74a6d Update pt_BR.json (#97)
Inserting new translations and updating some.
2024-10-30 02:22:40 -05:00
5de2c4f292 Italian translation (#96) 2024-10-30 02:22:32 -05:00
5845787325 Add option to show the old title bar (#101) 2024-10-30 02:22:22 -05:00
9c94db1130 Update logo (#103)
higher resolution
2024-10-30 02:21:39 -05:00
1c3347c95a Added missing french translations (#87)
and also fixed a couple wrong ones
2024-10-27 17:38:34 -05:00
b70580bc9f Update fr_FR.json (#88) 2024-10-27 17:38:27 -05:00
4926df42a4 Added Thai language description of the Ignore Applet setting (#60) 2024-10-27 06:33:06 -05:00
7038a902c3 Automatically remove invalid dlc and updates as part of auto load (#42)
* Automatically remove invalid dlc and updates as part of auto load
Fixed some minor label spacing issues in options dialog
Removal of unused variable in input view model

* Fixed missing french message for AutoloadDlcAddedMessage
2024-10-27 06:32:32 -05:00
6be8838043 ci moment 2024-10-26 09:00:35 -05:00
033ea86c1b Disable appimage build (for now) 2024-10-26 08:56:27 -05:00
dfb4854d19 misc: Replace references to IntPtr/UIntPtr with nint/nuint + code cleanups. 2024-10-26 08:46:50 -05:00
a09d314817 UI: Updater: Remove Avalonia migration code. 2024-10-26 08:46:50 -05:00
75035b3231 UI: Fix crash when using "delete all" button in mod manager. 2024-10-26 08:46:50 -05:00
9a1bdaae16 UI: Attach dev tools in debug. 2024-10-26 08:46:50 -05:00
c2f6d5d029 Update release.yml
e1dfeac7e8
2024-10-26 07:36:49 -05:00
4f160b35f6 Update build.yml
e1dfeac7e8
2024-10-26 07:36:33 -05:00
5fa74574ba Appimage builds (#28) 2024-10-26 07:31:37 -05:00
a647050ed4 Update nightly_pr_comment.yml 2024-10-25 22:48:35 -05:00
8686bea63f Update checks.yml 2024-10-25 08:49:04 -05:00
d280fbdf37 UI: RPC: Added SONIC X SHADOW GENERATIONS asset image 2024-10-25 08:36:41 -05:00
7d88dfa00d UI: Add program icon to windows other than the main 2024-10-25 08:36:41 -05:00
570c7cfaa2 UI: reference recently added translations 2024-10-25 08:36:41 -05:00
281be7ca62 misc: Code cleanup 2024-10-25 08:36:41 -05:00
c69904afc6 Add descriptions for "ignoring applet" translated into other languages (#59)
* Added description of the "Ignore applet" setting and translated descriptions into all available languages ​​in the emulator
2024-10-25 07:56:21 -05:00
26375766b4 Note to self, CHECK PRs MORE THOROUGHLY. 2024-10-24 14:28:14 -05:00
a01a06cd3f 2 unmerged PRs from original Ryujinx:
Implement shader compile counter (currently not translated, will change, need to pull changes.)
Remove event logic in favor of a single init function.
Thanks @MutantAura
2024-10-24 14:14:17 -05:00
7618ef134d misc: Code cleanups. 2024-10-24 14:14:17 -05:00
a2cd3c2799 Added missing strings, less transliterated word and grammar fixed. (#54)
Co-authored-by: Evan Husted <gr33m11@gmail.com>
2024-10-24 14:05:14 -05:00
eefeb65d9a Mention ryujinx-mirror 2024-10-24 11:25:12 -05:00
e30ee32eee Added option to ignore applet (gamepad connection window will not appear when it is disconnected) (#40)
This option is under the hacks category for a reason; use if you know what you're doing.
2024-10-23 20:10:54 -05:00
59277a9301 Merge remote-tracking branch 'origin/master' 2024-10-23 14:19:47 -05:00
2d0d73b617 Null-coalesce autoload dirs on config load 2024-10-23 14:19:34 -05:00
59277e49c5 Update Simplified Chinese Translation (#51) 2024-10-23 11:20:22 -05:00
8e8ad0f37e go away dependabot 2024-10-23 09:54:39 -05:00
b883de5d67 Update dependabot.yml
STOP OPENING THE DAMN AVALONIA PRS
2024-10-23 09:47:56 -05:00
1040ec4e53 Update dependabot.yml
Stop trying to bother berry
2024-10-23 09:38:41 -05:00
4d1ebaf9ba Ava UI : Set the Default Controller to Pro Controller. (#37)
* Set the Default Controller to Pro Controller.

- Let's be honest nobody is using JoyCon pair on their PC.
- It looks nicer and more accurate to more traditional controllers.
- Fixes issues with UltraCam mods and other such mods with lack of proper Dual Joycon support.

* Change standard configuration too.
2024-10-23 06:56:58 -05:00
dc3267f152 Ensure we unselect the previously selected update when auto selcting a new update (#30) 2024-10-21 23:22:13 -05:00
f76a97c976 Replace 'Expand DRAM' option with dropdown menu (#32)
Allows to use mods that require a larger memory pool to allocate from.
2024-10-21 23:16:41 -05:00
0f3c7f920b Fix for duplicate controller names under Ava when two controllers of the same type are attached (#29) 2024-10-21 10:25:14 -05:00
9ae89d55ca i18n: fr_FR: Added missing strings and general improvements (#27) 2024-10-21 09:51:59 -05:00
dde62f44c7 Sigh 2024-10-21 07:49:18 -05:00
decc93bcdc I18n: Improve french translation 2024-10-21 07:40:42 -05:00
8b75ce1d98 misc: Fix the issues blocking PRs 2024-10-21 02:43:07 -05:00
509f6d738c Revert Maximized = Fullscreen changes, fixes #20 2024-10-21 02:43:07 -05:00
f3efada444 ci: bump actions/github-script from 6 to 7 (#1)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-19 19:42:03 -05:00
b20613661c misc: Code cleanups 2024-10-19 16:41:04 -05:00
2facad4be3 UI: Reset RPC state when AppHost stops 2024-10-19 16:40:28 -05:00
741eba2798 UI: Add keybinds to useful things 2024-10-19 16:39:21 -05:00
59b3ff7802 Ava: Cleanup XML 2024-10-19 16:36:39 -05:00
c0cc3c4188 UI: Reload games list on locale change. 2024-10-19 16:31:15 -05:00
547 changed files with 18653 additions and 7606 deletions

View File

@ -1,40 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
labels:
- "infra"
reviewers:
- TSRBerry
commit-message:
prefix: "ci"
- package-ecosystem: nuget
directory: /
open-pull-requests-limit: 10
schedule:
interval: daily
labels:
- "infra"
reviewers:
- TSRBerry
commit-message:
prefix: nuget
groups:
Avalonia:
patterns:
- "*Avalonia*"
Silk.NET:
patterns:
- "Silk.NET*"
OpenTK:
patterns:
- "OpenTK*"
SixLabors:
patterns:
- "SixLabors*"
NUnit:
patterns:
- "NUnit*"

8
.github/labeler.yml vendored
View File

@ -33,3 +33,11 @@ kernel:
infra:
- changed-files:
- any-glob-to-any-file: ['.github/**', 'distribution/**', 'Directory.Packages.props']
documentation:
- changed-files:
- any-glob-to-any-file: 'docs/**'
ldn:
- changed-files:
- any-glob-to-any-file: 'src/Ryujinx.HLE/HOS/Services/Ldn/**'

View File

@ -7,6 +7,7 @@ env:
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
RYUJINX_BASE_VERSION: "1.2.0"
RELEASE: 0
jobs:
build:
@ -60,11 +61,11 @@ jobs:
if: matrix.platform.name != 'linux-arm64'
- name: Publish Ryujinx
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx --self-contained true
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx --self-contained
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
- name: Publish Ryujinx.Headless.SDL2
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Headless.SDL2 --self-contained true
run: dotnet publish -c "${{ matrix.configuration }}" -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless -p:Version="${{ env.RYUJINX_BASE_VERSION }}" -p:DebugType=embedded -p:SourceRevisionId="${{ steps.git_short_hash.outputs.result }}" -p:ExtraDefineConstants=DISABLE_UPDATER src/Ryujinx.Headless.SDL2 --self-contained
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
- name: Set executable bit
@ -73,6 +74,37 @@ jobs:
chmod +x ./publish_sdl2_headless/Ryujinx.Headless.SDL2 ./publish_sdl2_headless/Ryujinx.sh
if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest'
- name: Build AppImage
if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest'
run: |
PLATFORM_NAME="${{ matrix.platform.name }}"
sudo apt install -y zsync desktop-file-utils appstream
mkdir -p tools
export PATH="$PATH:$(readlink -f tools)"
# Setup appimagetool
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x tools/appimagetool
chmod +x distribution/linux/appimage/build-appimage.sh
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
if [ "$PLATFORM_NAME" = "linux-x64" ]; then
ARCH_NAME=x64
export ARCH=x86_64
elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
ARCH_NAME=arm64
export ARCH=aarch64
else
echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
exit 1
fi
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
shell: bash
- name: Upload Ryujinx artifact
uses: actions/upload-artifact@v4
with:
@ -80,10 +112,17 @@ jobs:
path: publish
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
- name: Upload Ryujinx (AppImage) artifact
uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest'
with:
name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }}-AppImage
path: publish_appimage
- name: Upload Ryujinx.Headless.SDL2 artifact
uses: actions/upload-artifact@v4
with:
name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }}
name: nogui-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }}
path: publish_sdl2_headless
if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13'
@ -146,6 +185,6 @@ jobs:
- name: Upload Ryujinx.Headless.SDL2 artifact
uses: actions/upload-artifact@v4
with:
name: sdl2-ryujinx-headless-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal
name: nogui-ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-macos_universal
path: "publish_headless/*.tar.gz"
if: github.event_name == 'pull_request'

257
.github/workflows/canary.yml vendored Normal file
View File

@ -0,0 +1,257 @@
name: Canary release job
on:
workflow_dispatch:
inputs: {}
push:
branches: [ master ]
paths-ignore:
- '.github/**'
- 'docs/**'
- 'assets/**'
- '*.yml'
- '*.json'
- '*.config'
- '*.md'
concurrency: release
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
RYUJINX_BASE_VERSION: "1.2"
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "canary"
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "GreemDev"
RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO: "Ryujinx"
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Ryujinx-Canary"
RELEASE: 1
jobs:
tag:
name: Create tag
runs-on: ubuntu-20.04
steps:
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
shell: bash
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/Canary-${{ steps.version_info.outputs.build_version }}',
sha: context.sha
})
- name: Create release
uses: ncipollo/release-action@v1
with:
name: "Canary ${{ steps.version_info.outputs.build_version }}"
tag: ${{ steps.version_info.outputs.build_version }}
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }}"
omitBodyDuringUpdate: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
token: ${{ secrets.RELEASE_TOKEN }}
release:
name: Release for ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- { name: win-x64, os: windows-latest, zip_os_name: win_x64 }
- { name: linux-x64, os: ubuntu-latest, zip_os_name: linux_x64 }
- { name: linux-arm64, os: ubuntu-latest, zip_os_name: linux_arm64 }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Overwrite csc problem matcher
run: echo "::add-matcher::.github/csc.json"
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash
- name: Configure for release
run: |
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash
- name: Create output dir
run: "mkdir release_output"
- name: Publish
run: |
dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_ava/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained
dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Headless.SDL2 --self-contained
- name: Packing Windows builds
if: matrix.platform.os == 'windows-latest'
run: |
pushd publish_ava
rm publish/libarmeilleure-jitsupport.dylib
7z a ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
popd
pushd publish_sdl2_headless
rm publish/libarmeilleure-jitsupport.dylib
7z a ../release_output/nogui-ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
popd
shell: bash
- name: Packing Linux builds
if: matrix.platform.os == 'ubuntu-latest'
run: |
pushd publish_ava
rm publish/libarmeilleure-jitsupport.dylib
chmod +x publish/Ryujinx.sh publish/Ryujinx
tar -czvf ../release_output/ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
popd
pushd publish_sdl2_headless
rm publish/libarmeilleure-jitsupport.dylib
chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
tar -czvf ../release_output/nogui-ryujinx-canary-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
popd
shell: bash
#- name: Build AppImage (Linux)
# if: matrix.platform.os == 'ubuntu-latest'
# run: |
# BUILD_VERSION="${{ steps.version_info.outputs.build_version }}"
# PLATFORM_NAME="${{ matrix.platform.name }}"
# sudo apt install -y zsync desktop-file-utils appstream
# mkdir -p tools
# export PATH="$PATH:$(readlink -f tools)"
# Setup appimagetool
# wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
# chmod +x tools/appimagetool
# chmod +x distribution/linux/appimage/build-appimage.sh
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
# if [ "$PLATFORM_NAME" = "linux-x64" ]; then
# ARCH_NAME=x64
# export ARCH=x86_64
# elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
# ARCH_NAME=arm64
# export ARCH=aarch64
# else
# echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
# exit 1
# fi
# export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
# BUILDDIR=publish_ava OUTDIR=publish_ava_appimage distribution/linux/appimage/build-appimage.sh
# Add to release output
# pushd publish_ava_appimage
# mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
# mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
# popd
# shell: bash
- name: Pushing new release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version_info.outputs.build_version }}
artifacts: "release_output/*.tar.gz,release_output/*.zip"
#artifacts: "release_output/*.tar.gz,release_output/*.zip/*AppImage*"
tag: ${{ steps.version_info.outputs.build_version }}
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }}"
omitBodyDuringUpdate: true
allowUpdates: true
replacesArtifacts: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
token: ${{ secrets.RELEASE_TOKEN }}
macos_release:
name: Release MacOS universal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Setup LLVM 15
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
- name: Install rcodesign
run: |
mkdir -p $HOME/.bin
gh release download -R indygreg/apple-platform-rs -O apple-codesign.tar.gz -p 'apple-codesign-*-x86_64-unknown-linux-musl.tar.gz'
tar -xzvf apple-codesign.tar.gz --wildcards '*/rcodesign' --strip-components=1
rm apple-codesign.tar.gz
mv rcodesign $HOME/.bin/
echo "$HOME/.bin" >> $GITHUB_PATH
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get version info
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
- name: Configure for release
run: |
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash
- name: Publish macOS Ryujinx
run: |
./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 1
- name: Publish macOS Ryujinx.Headless.SDL2
run: |
./distribution/macos/create_macos_build_headless.sh . publish_tmp_headless publish_headless ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 1
- name: Pushing new release
uses: ncipollo/release-action@v1
with:
name: "Canary ${{ steps.version_info.outputs.build_version }}"
artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz"
tag: ${{ steps.version_info.outputs.build_version }}
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/Canary-${{ steps.version_info.outputs.prev_build_version }}...Canary-${{ steps.version_info.outputs.build_version }}"
omitBodyDuringUpdate: true
allowUpdates: true
replacesArtifacts: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
token: ${{ secrets.RELEASE_TOKEN }}

View File

@ -1,4 +1,4 @@
name: Perform checks
name: Build PR
on:
pull_request:
@ -20,55 +20,6 @@ concurrency:
cancel-in-progress: true
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Overwrite csc problem matcher
run: echo "::add-matcher::.github/csc.json"
- run: dotnet restore
- name: Print dotnet format version
run: dotnet format --version
- name: Run dotnet format whitespace
run: |
dotnet format whitespace --verify-no-changes --report ./whitespace-report.json -v d
# For some unknown reason this step sometimes fails with exit code 139 (segfault?),
# so in that case we'll try again (3 tries max).
- name: Run dotnet format style
uses: TSRBerry/unstable-commands@v1
with:
commands: dotnet format style --severity info --verify-no-changes --report ./style-report.json -v d
timeout-minutes: 5
retry-codes: 139
# For some unknown reason this step sometimes fails with exit code 139 (segfault?),
# so in that case we'll try again (3 tries max).
- name: Run dotnet format analyzers
uses: TSRBerry/unstable-commands@v1
with:
commands: dotnet format analyzers --severity info --verify-no-changes --report ./analyzers-report.json -v d
timeout-minutes: 5
retry-codes: 139
- name: Upload report
if: failure()
uses: actions/upload-artifact@v4
with:
name: dotnet-format
path: ./*-report.json
pr_build:
uses: ./.github/workflows/build.yml
needs: format
secrets: inherit

View File

@ -2,7 +2,7 @@ name: Comment PR artifacts links
on:
workflow_run:
workflows: ['Perform checks']
workflows: ['Build PR']
types: [completed]
jobs:
@ -38,12 +38,12 @@ jobs:
return core.error(`No artifacts found`);
}
let body = `Download the artifacts for this pull request:\n`;
let hidden_headless_artifacts = `\n\n <details><summary>GUI-less (SDL2)</summary>\n`;
let hidden_headless_artifacts = `\n\n <details><summary>GUI-less</summary>\n`;
let hidden_debug_artifacts = `\n\n <details><summary>Only for Developers</summary>\n`;
for (const art of artifacts) {
if(art.name.includes('Debug')) {
hidden_debug_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
} else if(art.name.includes('sdl2-ryujinx-headless')) {
} else if(art.name.includes('nogui-ryujinx')) {
hidden_headless_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
} else {
body += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
@ -62,4 +62,4 @@ jobs:
} else {
core.info(`Creating a comment`);
await github.rest.issues.createComment({repo, owner, issue_number, body});
}
}

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs: {}
push:
branches: [ master ]
branches: [ release ]
paths-ignore:
- '.github/**'
- 'docs/**'
@ -20,9 +20,10 @@ env:
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
RYUJINX_BASE_VERSION: "1.2"
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "master"
RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "release"
RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "GreemDev"
RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Ryujinx"
RELEASE: 1
jobs:
tag:
@ -33,10 +34,11 @@ jobs:
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
shell: bash
- name: Create tag
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
@ -51,6 +53,7 @@ jobs:
with:
name: ${{ steps.version_info.outputs.build_version }}
tag: ${{ steps.version_info.outputs.build_version }}
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}"
omitBodyDuringUpdate: true
owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}
repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}
@ -79,6 +82,7 @@ jobs:
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash
@ -89,6 +93,7 @@ jobs:
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash
@ -97,32 +102,71 @@ jobs:
- name: Publish
run: |
dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_ava/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained true
dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless/publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Headless.SDL2 --self-contained true
dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx --self-contained
dotnet publish -c Release -r "${{ matrix.platform.name }}" -o ./publish_sdl2_headless -p:Version="${{ steps.version_info.outputs.build_version }}" -p:SourceRevisionId="${{ steps.version_info.outputs.git_short_hash }}" -p:DebugType=embedded src/Ryujinx.Headless.SDL2 --self-contained
- name: Packing Windows builds
if: matrix.platform.os == 'windows-latest'
run: |
pushd publish_ava
7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
pushd publish
rm libarmeilleure-jitsupport.dylib
7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish
popd
pushd publish_sdl2_headless
7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
rm libarmeilleure-jitsupport.dylib
7z a ../release_output/nogui-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip ../publish
popd
shell: bash
- name: Build AppImage (Linux)
if: matrix.platform.os == 'ubuntu-latest'
run: |
BUILD_VERSION="${{ steps.version_info.outputs.build_version }}"
PLATFORM_NAME="${{ matrix.platform.name }}"
sudo apt install -y zsync desktop-file-utils appstream
mkdir -p tools
export PATH="$PATH:$(readlink -f tools)"
# Setup appimagetool
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x tools/appimagetool
chmod +x distribution/linux/appimage/build-appimage.sh
# Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name)
if [ "$PLATFORM_NAME" = "linux-x64" ]; then
ARCH_NAME=x64
export ARCH=x86_64
elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then
ARCH_NAME=arm64
export ARCH=aarch64
else
echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME""
exit 1
fi
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
pushd publish_appimage
mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
popd
shell: bash
- name: Packing Linux builds
if: matrix.platform.os == 'ubuntu-latest'
run: |
pushd publish_ava
chmod +x publish/Ryujinx.sh publish/Ryujinx
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
pushd publish
chmod +x Ryujinx.sh Ryujinx
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish
popd
pushd publish_sdl2_headless
chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
chmod +x Ryujinx.sh Ryujinx.Headless.SDL2
tar -czvf ../release_output/nogui-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz ../publish
popd
shell: bash
@ -130,8 +174,9 @@ jobs:
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version_info.outputs.build_version }}
artifacts: "release_output/*.tar.gz,release_output/*.zip"
artifacts: "release_output/*.tar.gz,release_output/*.zip,release_output/*AppImage*"
tag: ${{ steps.version_info.outputs.build_version }}
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}"
omitBodyDuringUpdate: true
allowUpdates: true
replacesArtifacts: true
@ -170,6 +215,7 @@ jobs:
id: version_info
run: |
echo "build_version=${{ env.RYUJINX_BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "prev_build_version=${{ env.RYUJINX_BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
- name: Configure for release
@ -179,23 +225,25 @@ jobs:
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_SOURCE_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs
sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs
shell: bash
- name: Publish macOS Ryujinx
run: |
./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish_ava ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release
./distribution/macos/create_macos_build_ava.sh . publish_tmp_ava publish ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 0
- name: Publish macOS Ryujinx.Headless.SDL2
run: |
./distribution/macos/create_macos_build_headless.sh . publish_tmp_headless publish_headless ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release
./distribution/macos/create_macos_build_headless.sh . publish_tmp_headless publish_headless ./distribution/macos/entitlements.xml "${{ steps.version_info.outputs.build_version }}" "${{ steps.version_info.outputs.git_short_hash }}" Release 0
- name: Pushing new release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version_info.outputs.build_version }}
artifacts: "publish_ava/*.tar.gz, publish_headless/*.tar.gz"
artifacts: "publish/*.tar.gz, publish_headless/*.tar.gz"
tag: ${{ steps.version_info.outputs.build_version }}
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}"
omitBodyDuringUpdate: true
allowUpdates: true
replacesArtifacts: true

5
.gitignore vendored
View File

@ -16,6 +16,8 @@ x64/
build/
[Bb]in/
[Oo]bj/
AppDir/
publish_appimage/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/
@ -173,3 +175,6 @@ PublishProfiles/
# Glade backup files
*.glade~
# Ignore MacOS Attribute Files
._*

23
COMPILING.md Normal file
View File

@ -0,0 +1,23 @@
## Compilation
Building the project is for users that want to contribute code only.
If you wish to build the emulator yourself, follow these steps:
### Step 1
Install the [.NET 8.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/8.0).
Make sure your SDK version is higher or equal to the required version specified in [global.json](global.json).
### Step 2
Either use `git clone https://github.com/GreemDev/Ryujinx` on the command line to clone the repository or use Code --> Download zip button to get the files.
### Step 3
To build Ryujinx, open a command prompt inside the project directory.
You can quickly access it on Windows by holding shift in File Explorer, then right clicking and selecting `Open command window here`.
Then type the following command: `dotnet build -c Release -o build`
the built files will be found in the newly created build directory.
Ryujinx system files are stored in the `Ryujinx` folder.
This folder is located in the user folder, which can be accessed by clicking `Open Ryujinx Folder` under the File menu in the GUI.

View File

@ -12,24 +12,15 @@ Please read the entire document before continuing as it can potentially save eve
We always welcome bug reports, feature proposals and overall feedback. Here are a few tips on how you can make reporting your issue as effective as possible.
### Identify Where to Report
The Ryujinx codebase is distributed across multiple repositories in the [Ryujinx organization](https://github.com/Ryujinx). Depending on the feedback you might want to file the issue on a different repo. Here are a few common repos:
* [Ryujinx/Ryujinx](https://github.com/Ryujinx/Ryujinx) Ryujinx core project files.
* [Ryujinx/Ryujinx-Games-List](https://github.com/Ryujinx/Ryujinx-Games-List) Ryujinx game compatibility list.
* [Ryujinx/Ryujinx-Website](https://github.com/Ryujinx/Ryujinx-Website) Ryujinx website source code.
* [Ryujinx/Ryujinx-Ldn-Website](https://github.com/Ryujinx/Ryujinx-Ldn-Website) Ryujinx LDN website source code.
### Finding Existing Issues
Before filing a new issue, please search our [open issues](https://github.com/Ryujinx/Ryujinx/issues) to check if it already exists.
Before filing a new issue, please search our [open issues](https://github.com/GreemDev/Ryujinx/issues) to check if it already exists.
If you do find an existing issue, please include your own feedback in the discussion. Do consider upvoting (👍 reaction) the original post, as this helps us prioritize popular issues in our backlog.
### Writing a Good Feature Request
Please review any feature requests already opened to both check it has not already been suggested, and to familiarize yourself with the format. When ready to submit a proposal, please use the [Feature Request issue template](https://github.com/Ryujinx/Ryujinx/issues/new?assignees=&labels=&projects=&template=feature_request.yml&title=%5BFeature+Request%5D).
Please review any feature requests already opened to both check it has not already been suggested, and to familiarize yourself with the format. When ready to submit a proposal, please use the [Feature Request issue template](https://github.com/GreemDev/Ryujinx/issues/new?assignees=&labels=&projects=&template=feature_request.yml&title=%5BFeature+Request%5D).
### Writing a Good Bug Report
@ -43,13 +34,13 @@ Ideally, a bug report should contain the following information:
* A Ryujinx log file of the run instance where the issue occurred. Log files can be found in `[Executable Folder]/Logs` and are named chronologically.
* Additional information, e.g. is it a regression from previous versions? Are there any known workarounds?
When ready to submit a bug report, please use the [Bug Report issue template](https://github.com/Ryujinx/Ryujinx/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=%5BBug%5D).
When ready to submit a bug report, please use the [Bug Report issue template](https://github.com/GreemDev/Ryujinx/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=%5BBug%5D).
## Contributing Changes
Project maintainers will merge changes that both improve the project and meet our standards for code quality.
The [Pull Request Guide](docs/workflow/pr-guide.md) and [License](https://github.com/Ryujinx/Ryujinx/blob/master/LICENSE.txt) docs define additional guidance.
The [Pull Request Guide](docs/workflow/pr-guide.md) and [License](https://github.com/GreemDev/Ryujinx/blob/master/LICENSE.txt) docs define additional guidance.
### DOs and DON'Ts
@ -83,23 +74,23 @@ We use and recommend the following workflow:
3. In your fork, create a branch off of main (`git checkout -b mybranch`).
- Branches are useful since they isolate your changes from incoming changes from upstream. They also enable you to create multiple PRs from the same fork.
4. Make and commit your changes to your branch.
- [Build Instructions](https://github.com/Ryujinx/Ryujinx#building) explains how to build and test.
- [Build Instructions](https://github.com/GreemDev/Ryujinx/blob/master/COMPILING.md) explains how to build and test.
- Commit messages should be clear statements of action and intent.
6. Build the repository with your changes.
- Make sure that the builds are clean.
- Make sure that `dotnet format` has been run and any corrections tested and committed.
7. Create a pull request (PR) against the Ryujinx/Ryujinx repository's **main** branch.
- State in the description what issue or improvement your change is addressing.
- Check if all the Continuous Integration checks are passing. Refer to [Actions](https://github.com/Ryujinx/Ryujinx/actions) to check for outstanding errors.
8. Wait for feedback or approval of your changes from the [core development team](https://github.com/orgs/Ryujinx/teams/developers)
- Details about the pull request [review procedure](docs/workflow/ci/pr-guide.md).
- Check if all the Continuous Integration checks are passing. Refer to [Actions](https://github.com/GreemDev/Ryujinx/actions) to check for outstanding errors.
8. Wait for feedback or approval of your changes from the core development team
- Details about the pull request [review procedure](docs/workflow/pr-guide.md).
9. When the team members have signed off, and all checks are green, your PR will be merged.
- The next official build will automatically include your change.
- You can delete the branch you used for making the change.
### Good First Issues
The team marks the most straightforward issues as [good first issues](https://github.com/Ryujinx/Ryujinx/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). This set of issues is the place to start if you are interested in contributing but new to the codebase.
The team marks the most straightforward issues as [good first issues](https://github.com/GreemDev/Ryujinx/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). This set of issues is the place to start if you are interested in contributing but new to the codebase.
### Commit Messages
@ -122,7 +113,7 @@ Also do your best to factor commits appropriately, not too large with unrelated
### PR - CI Process
The [Ryujinx continuous integration](https://github.com/Ryujinx/Ryujinx/actions) (CI) system will automatically perform the required builds and run tests (including the ones you are expected to run) for PRs. Builds and test runs must be clean or have bugs properly filed against flaky/unexpected failures that are unrelated to your change.
The [Ryujinx continuous integration](https://github.com/GreemDev/Ryujinx/actions) (CI) system will automatically perform the required builds and run tests (including the ones you are expected to run) for PRs. Builds and test runs must be clean or have bugs properly filed against flaky/unexpected failures that are unrelated to your change.
If the CI build fails for any reason, the PR actions tab should be consulted for further information on the failure. There are a few usual suspects for such a failure:
* `dotnet format` has not been run on the PR and has outstanding stylistic issues.
@ -143,5 +134,5 @@ Ryujinx uses some implementations and frameworks from other projects. The follow
- The license of the file is [permissive](https://en.wikipedia.org/wiki/Permissive_free_software_licence).
- The license of the file is left in-tact.
- The contribution is correctly attributed in the [3rd party notices](https://github.com/Ryujinx/Ryujinx/blob/master/distribution/legal/THIRDPARTY.md) file in the repository, as needed.
- The contribution is correctly attributed in the [3rd party notices](https://github.com/GreemDev/Ryujinx/blob/master/distribution/legal/THIRDPARTY.md) file in the repository, as needed.

View File

@ -22,7 +22,7 @@
<PackageVersion Include="LibHac" Version="0.19.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.1.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
@ -33,11 +33,12 @@
<PackageVersion Include="OpenTK.Graphics" Version="4.8.2" />
<PackageVersion Include="OpenTK.Audio.OpenAL" Version="4.8.2" />
<PackageVersion Include="OpenTK.Windowing.GraphicsLibraryFramework" Version="4.8.2" />
<PackageVersion Include="Open.NAT.Core" Version="2.1.0.5" />
<PackageVersion Include="Ryujinx.Audio.OpenAL.Dependencies" Version="1.21.0.1" />
<PackageVersion Include="Ryujinx.Graphics.Nvdec.Dependencies" Version="5.0.3-build14" />
<PackageVersion Include="Ryujinx.Graphics.Vulkan.Dependencies.MoltenVK" Version="1.2.0" />
<PackageVersion Include="Ryujinx.SDL2-CS" Version="2.30.0-build32" />
<PackageVersion Include="Gommon" Version="2.6.5" />
<PackageVersion Include="Gommon" Version="2.6.8" />
<PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
<PackageVersion Include="shaderc.net" Version="0.1.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
@ -51,4 +52,4 @@
<PackageVersion Include="System.Management" Version="8.0.0" />
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
</ItemGroup>
</Project>
</Project>

View File

@ -6,6 +6,23 @@
<br>
<sub><sup><b>(REE-YOU-JINX)</b></sup></sub>
<br>
<a href="https://github.com/GreemDev/Ryujinx/actions/workflows/release.yml">
<img src="https://github.com/GreemDev/Ryujinx/actions/workflows/release.yml/badge.svg"
alt="">
</a>
<a href="https://github.com/GreemDev/Ryujinx/releases/latest">
<img src="https://img.shields.io/github/v/release/GreemDev/Ryujinx"
alt="Latest Release">
</a>
<br>
<a href="https://github.com/GreemDev/Ryujinx/actions/workflows/canary.yml">
<img src="https://github.com/GreemDev/Ryujinx/actions/workflows/canary.yml/badge.svg"
alt="">
</a>
<a href="https://github.com/GreemDev/Ryujinx-Canary/releases/latest">
<img src="https://img.shields.io/github/v/release/GreemDev/Ryujinx-Canary?label=canary"
alt="Latest Canary Release">
</a>
</h1>
<p align="center">
@ -17,37 +34,28 @@
</p>
<p align="center">
On October 1st 2024, Ryujinx was discontinued as the creator was forced to abandon the project.
This fork is intended to be a direct continuation for existing Ryujinx users.
Guides and documentation will not be provided at this time, though you can find the old ones on the Internet Archive.
<br>
This fork is intended to be a QoL uplift for existing Ryujinx users.
<br>
This is not a Ryujinx revival project. This is not a Phoenix project.
<br>
Guides and documentation can be found on the <a href="https://github.com/GreemDev/Ryujinx/wiki">Wiki tab</a>.
</p>
<p align="center">
If you would like a more preservative fork of Ryujinx, check out <a href="https://github.com/ryujinx-mirror/ryujinx">ryujinx-mirror</a>.
</p>
<p align="center">
<a href="https://github.com/GreemDev/Ryujinx/actions/workflows/release.yml">
<img src="https://github.com/GreemDev/Ryujinx/actions/workflows/release.yml/badge.svg"
alt="">
</a>
<a href="https://crwd.in/ryujinx">
<img src="https://badges.crowdin.net/ryujinx/localized.svg"
alt="">
</a>
Click below to join the Discord:
<br>
<a href="https://discord.gg/dHPrkBkkyA">
<img src="https://img.shields.io/discord/1294443224030511104?color=5865F2&label=Ryujinx&logo=discord&logoColor=white"
alt="Discord">
<img src="https://img.shields.io/discord/1294443224030511104?color=5865F2&label=Ryubing&logo=discord&logoColor=white" alt="Discord">
</a>
<br>
<br>
<img src="https://raw.githubusercontent.com/GreemDev/Ryujinx/refs/heads/master/docs/shell.png">
</p>
## Compatibility
As of May 2024, Ryujinx has been tested on approximately 4,300 titles;
over 4,100 boot past menus and into gameplay, with roughly 3,550 of those being considered playable.
Anyone is free to submit a new game test or update an existing game test entry;
simply follow the new issue template and testing guidelines, or post as a reply to the applicable game issue.
Use the search function to see if a game has been tested already!
## Usage
To run this emulator, your PC must be equipped with at least 8GiB of RAM;
@ -55,36 +63,21 @@ failing to meet this requirement may result in a poor gameplay experience or une
## Latest build
These builds are compiled automatically for each commit on the master branch.
While we strive to ensure optimal stability and performance prior to pushing an update, our automated builds **may be unstable or completely broken**.
Stable builds are made every so often onto a separate "release" branch that then gets put into the releases you know and love.
These stable builds exist so that the end user can get a more **enjoyable and stable experience**.
You can find the latest stable release [here](https://github.com/GreemDev/Ryujinx/releases/latest).
Canary builds are compiled automatically for each commit on the master branch.
While we strive to ensure optimal stability and performance prior to pushing an update, these builds **may be unstable or completely broken**.
These canary builds are only recommended for experienced users.
You can find the latest canary release [here](https://github.com/GreemDev/Ryujinx-Canary/releases/latest).
## Documentation
If you are planning to contribute or just want to learn more about this project please read through our [documentation](docs/README.md).
## Building
If you wish to build the emulator yourself, follow these steps:
### Step 1
Install the [.NET 8.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/8.0).
Make sure your SDK version is higher or equal to the required version specified in [global.json](global.json).
### Step 2
Either use `git clone https://github.com/GreemDev/Ryujinx` on the command line to clone the repository or use Code --> Download zip button to get the files.
### Step 3
To build Ryujinx, open a command prompt inside the project directory.
You can quickly access it on Windows by holding shift in File Explorer, then right clicking and selecting `Open command window here`.
Then type the following command: `dotnet build -c Release -o build`
the built files will be found in the newly created build directory.
Ryujinx system files are stored in the `Ryujinx` folder.
This folder is located in the user folder, which can be accessed by clicking `Open Ryujinx Folder` under the File menu in the GUI.
## Features
- **Audio**

View File

@ -29,12 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Graphics.Nvdec", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Audio", "src\Ryujinx.Audio\Ryujinx.Audio.csproj", "{806ACF6D-90B0-45D0-A1AC-5F220F3B3985}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F870C1-3E5F-485F-B426-F0645AF78751}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Memory", "src\Ryujinx.Memory\Ryujinx.Memory.csproj", "{A5E6C691-9E22-4263-8F40-42F002CE66BE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Tests.Memory", "src\Ryujinx.Tests.Memory\Ryujinx.Tests.Memory.csproj", "{D1CC5322-7325-4F6B-9625-194B30BE1296}"
@ -87,6 +81,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Horizon.Kernel.Gene
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.HLE.Generators", "src\Ryujinx.HLE.Generators\Ryujinx.HLE.Generators.csproj", "{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F870C1-3E5F-485F-B426-F0645AF78751}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Packages.props = Directory.Packages.props
.github/workflows/release.yml = .github/workflows/release.yml
.github/workflows/canary.yml = .github/workflows/canary.yml
.github/workflows/build.yml = .github/workflows/build.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View File

@ -3,9 +3,13 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FSimpleTypes/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForOtherTypes/@EntryValue">UseExplicitType</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForSimpleTypes/@EntryValue">UseExplicitType</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="I" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GL/@EntryIndexedValue">GL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SDL/@EntryIndexedValue">SDL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SDL/@EntryIndexedValue">OS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="I" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a0b4bc4d_002Dd13b_002D4a37_002Db37e_002Dc9c6864e4302/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Any" Description="Types and namespaces"&gt;&lt;ElementKinds&gt;&lt;Kind Name="NAMESPACE" /&gt;&lt;Kind Name="CLASS" /&gt;&lt;Kind Name="STRUCT" /&gt;&lt;Kind Name="ENUM" /&gt;&lt;Kind Name="DELEGATE" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="I" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=amiibo/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ASET/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Astc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Luma/@EntryIndexedValue">True</s:Boolean>
@ -20,4 +24,4 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Spirv/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Srgb/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unorm/@EntryIndexedValue">True</s:Boolean>
</wpf:ResourceDictionary>
</wpf:ResourceDictionary>

View File

@ -707,6 +707,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Blue Attire",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01010300",
@ -3526,6 +3542,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01400000",
@ -4160,6 +4192,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -5848,6 +5896,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -6126,6 +6190,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -8341,6 +8421,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -9020,6 +9116,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000100",
@ -9496,6 +9608,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Blue Attire",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01010000",
@ -9833,6 +9961,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -14667,6 +14811,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01030000",
@ -16119,6 +16279,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01050000",
@ -16717,6 +16893,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01070000",
@ -19745,6 +19937,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01080000",
@ -20503,6 +20711,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Blue Attire",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01010000",
@ -21805,6 +22029,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -22340,6 +22580,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01020100",
@ -22990,6 +23246,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -23440,6 +23712,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -24660,6 +24948,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01410000",
@ -24954,6 +25258,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01060000",
@ -25286,6 +25606,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -29114,6 +29450,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Blue Attire",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01010000",
@ -32512,6 +32864,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -32928,6 +33296,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000100",
@ -34800,6 +35184,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Red Tunic",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01000000",
@ -37569,6 +37969,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Blue Attire",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01010100",
@ -41293,6 +41709,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Black Cat Clothes",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01020100",
@ -45153,6 +45585,22 @@
"0100F2C0115B6000"
],
"gameName": "The Legend of Zelda: Tears of the Kingdom"
},
{
"amiiboUsage": [
{
"Usage": "Receive the Blue Attire",
"write": false
},
{
"Usage": "Receive random materials",
"write": false
}
],
"gameID": [
"01008CF01BAAC000"
],
"gameName": "The Legend of Zelda: Echoes of Wisdom"
}
],
"head": "01010000",
@ -47896,5 +48344,5 @@
"type": "Figure"
}
],
"lastUpdated": "2024-10-01T00:00:25.035619"
}
"lastUpdated": "2024-11-17T15:28:47.035619"
}

View File

@ -14,7 +14,7 @@ if [ -z "$RYUJINX_BIN" ]; then
exit 1
fi
COMMAND="env DOTNET_EnableAlternateStackCheck=1"
COMMAND="env LANG=C.UTF-8 DOTNET_EnableAlternateStackCheck=1"
if command -v gamemoderun > /dev/null 2>&1; then
COMMAND="$COMMAND gamemoderun"

View File

@ -0,0 +1,3 @@
#!/bin/sh
CURRENTDIR="$(readlink -f "$(dirname "$0")")"
exec "$CURRENTDIR"/usr/bin/Ryujinx.sh "$@"

View File

@ -0,0 +1,33 @@
#!/bin/sh
set -eu
ROOTDIR="$(readlink -f "$(dirname "$0")")"/../../../
cd "$ROOTDIR"
BUILDDIR=${BUILDDIR:-publish}
OUTDIR=${OUTDIR:-publish_appimage}
UFLAG=${UFLAG:-"gh-releases-zsync|GreemDev|ryujinx|latest|*-x64.AppImage.zsync"}
rm -rf AppDir
mkdir -p AppDir/usr/bin
cp distribution/linux/Ryujinx.desktop AppDir/Ryujinx.desktop
cp distribution/linux/appimage/AppRun AppDir/AppRun
cp src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png AppDir/Ryujinx.svg
cp -r "$BUILDDIR"/* AppDir/usr/bin/
# Ensure necessary bins are set as executable
chmod +x AppDir/AppRun AppDir/usr/bin/Ryujinx*
mkdir -p "$OUTDIR"
appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 21 \
-u "$UFLAG" \
AppDir "$OUTDIR"/Ryujinx.AppImage
# Move zsync file needed for delta updates
if [ "$RELEASE" = "1" ]; then
mv ./*.AppImage.zsync "$OUTDIR"
fi

View File

@ -40,11 +40,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.0</string>
<string>1.2.0</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>CSResourcesFileMapped</key>

Binary file not shown.

View File

@ -46,5 +46,5 @@ then
rcodesign sign --entitlements-xml-path "$ENTITLEMENTS_FILE_PATH" "$APP_BUNDLE_DIRECTORY"
else
echo "Usign codesign for ad-hoc signing"
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f --deep -s - "$APP_BUNDLE_DIRECTORY"
fi
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f -s - "$APP_BUNDLE_DIRECTORY"
fi

View File

@ -2,8 +2,8 @@
set -e
if [ "$#" -lt 7 ]; then
echo "usage <BASE_DIR> <TEMP_DIRECTORY> <OUTPUT_DIRECTORY> <ENTITLEMENTS_FILE_PATH> <VERSION> <SOURCE_REVISION_ID> <CONFIGURATION> <EXTRA_ARGS>"
if [ "$#" -lt 8 ]; then
echo "usage <BASE_DIR> <TEMP_DIRECTORY> <OUTPUT_DIRECTORY> <ENTITLEMENTS_FILE_PATH> <VERSION> <SOURCE_REVISION_ID> <CONFIGURATION> <CANARY>"
exit 1
fi
@ -18,10 +18,11 @@ ENTITLEMENTS_FILE_PATH=$(readlink -f "$4")
VERSION=$5
SOURCE_REVISION_ID=$6
CONFIGURATION=$7
EXTRA_ARGS=$8
CANARY=$8
if [ "$VERSION" == "1.1.0" ];
then
if [ "$CANARY" == "1" ]; then
RELEASE_TAR_FILE_NAME=ryujinx-canary-$VERSION-macos_universal.app.tar
elif [ "$VERSION" == "1.1.0" ]; then
RELEASE_TAR_FILE_NAME=ryujinx-$CONFIGURATION-$VERSION+$SOURCE_REVISION_ID-macos_universal.app.tar
else
RELEASE_TAR_FILE_NAME=ryujinx-$VERSION-macos_universal.app.tar
@ -61,7 +62,7 @@ mkdir -p "$OUTPUT_DIRECTORY"
cp -R "$ARM64_APP_BUNDLE" "$UNIVERSAL_APP_BUNDLE"
rm "$UNIVERSAL_APP_BUNDLE/$EXECUTABLE_SUB_PATH"
# Make it libraries universal
# Make its libraries universal
python3 "$BASE_DIR/distribution/macos/construct_universal_dylib.py" "$ARM64_APP_BUNDLE" "$X64_APP_BUNDLE" "$UNIVERSAL_APP_BUNDLE" "**/*.dylib"
if ! [ -x "$(command -v lipo)" ];
@ -99,7 +100,7 @@ then
rcodesign sign --entitlements-xml-path "$ENTITLEMENTS_FILE_PATH" "$UNIVERSAL_APP_BUNDLE"
else
echo "Using codesign for ad-hoc signing"
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f --deep -s - "$UNIVERSAL_APP_BUNDLE"
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f -s - "$UNIVERSAL_APP_BUNDLE"
fi
echo "Creating archive"
@ -111,4 +112,4 @@ rm "$RELEASE_TAR_FILE_NAME"
popd
echo "Done"
echo "Done"

View File

@ -2,8 +2,8 @@
set -e
if [ "$#" -lt 7 ]; then
echo "usage <BASE_DIR> <TEMP_DIRECTORY> <OUTPUT_DIRECTORY> <ENTITLEMENTS_FILE_PATH> <VERSION> <SOURCE_REVISION_ID> <CONFIGURATION> <EXTRA_ARGS>"
if [ "$#" -lt 8 ]; then
echo "usage <BASE_DIR> <TEMP_DIRECTORY> <OUTPUT_DIRECTORY> <ENTITLEMENTS_FILE_PATH> <VERSION> <SOURCE_REVISION_ID> <CONFIGURATION> <CANARY>"
exit 1
fi
@ -18,13 +18,14 @@ ENTITLEMENTS_FILE_PATH=$(readlink -f "$4")
VERSION=$5
SOURCE_REVISION_ID=$6
CONFIGURATION=$7
EXTRA_ARGS=$8
CANARY=$8
if [ "$VERSION" == "1.1.0" ];
then
RELEASE_TAR_FILE_NAME=sdl2-ryujinx-headless-$CONFIGURATION-$VERSION+$SOURCE_REVISION_ID-macos_universal.tar
if [ "$CANARY" == "1" ]; then
RELEASE_TAR_FILE_NAME=nogui-ryujinx-canary-$VERSION-macos_universal.tar
elif [ "$VERSION" == "1.1.0" ]; then
RELEASE_TAR_FILE_NAME=nogui-ryujinx-$CONFIGURATION-$VERSION+$SOURCE_REVISION_ID-macos_universal.tar
else
RELEASE_TAR_FILE_NAME=sdl2-ryujinx-headless-$VERSION-macos_universal.tar
RELEASE_TAR_FILE_NAME=nogui-ryujinx-$VERSION-macos_universal.tar
fi
ARM64_OUTPUT="$TEMP_DIRECTORY/publish_arm64"
@ -56,7 +57,7 @@ mkdir -p "$OUTPUT_DIRECTORY"
cp -R "$ARM64_OUTPUT/" "$UNIVERSAL_OUTPUT"
rm "$UNIVERSAL_OUTPUT/$EXECUTABLE_SUB_PATH"
# Make it libraries universal
# Make its libraries universal
python3 "$BASE_DIR/distribution/macos/construct_universal_dylib.py" "$ARM64_OUTPUT" "$X64_OUTPUT" "$UNIVERSAL_OUTPUT" "**/*.dylib"
if ! [ -x "$(command -v lipo)" ];
@ -95,7 +96,7 @@ else
echo "Using codesign for ad-hoc signing"
for FILE in "$UNIVERSAL_OUTPUT"/*; do
if [[ $(file "$FILE") == *"Mach-O"* ]]; then
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f --deep -s - "$FILE"
codesign --entitlements "$ENTITLEMENTS_FILE_PATH" -f -s - "$FILE"
fi
done
fi
@ -108,4 +109,4 @@ gzip -9 < "$RELEASE_TAR_FILE_NAME" > "$RELEASE_TAR_FILE_NAME.gz"
rm "$RELEASE_TAR_FILE_NAME"
popd
echo "Done"
echo "Done"

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 255.76 255.76"><defs><style>.cls-1{fill:#02c5e5;}.cls-2{fill:#ff5f55;}.cls-3{fill:none;}</style></defs><g id="Ebene_2" data-name="Ebene 2"><g id="Ebene_1-2" data-name="Ebene 1"><g id="Ebene_2-2" data-name="Ebene 2"><g id="Ebene_1-2-2" data-name="Ebene 1-2"><path class="cls-1" d="M80.63,0V220.39H44.37c-14,0-35.74-20.74-35.74-39.13V40.13C8.63,19.19,31.36,0,49.06,0Z"/><path class="cls-2" d="M175.13,35.37V255.76h36.26c14,0,35.74-20.74,35.74-39.13V75.5c0-20.94-22.73-40.13-40.43-40.13Z"/><polygon class="cls-1" points="124.34 137.96 122.58 145.57 90.64 145.57 92.89 137.96 124.34 137.96"/><polygon class="cls-2" points="160.29 137.96 157.84 145.57 122.58 145.57 124.34 137.96 160.29 137.96"/><polygon class="cls-1" points="130.39 111.86 128.62 119.47 95.14 119.47 97.39 111.86 130.39 111.86"/><polygon class="cls-2" points="164.79 111.86 162.34 119.47 128.62 119.47 130.39 111.86 164.79 111.86"/><polygon class="cls-1" points="104.24 167.99 122.83 87.77 129.78 87.77 111.19 167.99 104.24 167.99"/><polygon class="cls-2" points="128.18 167.99 146.77 87.77 153.89 87.77 135.3 167.99 128.18 167.99"/></g><rect class="cls-3" width="255.76" height="255.76"/></g></g></g></svg>
<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"><path d="M80.63 0V220.39H44.37C30.37 220.39 8.63 199.65 8.63 181.26V40.13C8.63 19.19 31.36 0 49.06 0H80.63Z" fill="url(#g)"/><path d="M175.13 35.37V255.76H211.39C225.39 255.76 247.13 235.02 247.13 216.63V75.5C247.13 54.56 224.4 35.37 206.7 35.37H175.13Z" fill="url(#g)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M109.436 145.57L104.24 167.99H111.19L116.386 145.57H133.376L128.18 167.99H135.3L140.496 145.57H157.84L160.29 137.96H142.259L146.544 119.47H162.34L164.79 111.86H148.307L153.89 87.77H146.77L141.187 111.86H124.197L129.78 87.77H122.83L117.247 111.86H97.39L95.14 119.47H115.484L111.199 137.96H92.89L90.64 145.57H109.436ZM139.424 119.47L135.139 137.96H118.149L122.434 119.47H139.424Z" fill="url(#g)"/><defs><linearGradient id="g" x1="223.76" y1="32" x2="27" y2="228.76" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#686868"/><stop offset="0.14" stop-color="#686868"/><stop offset="0.14" stop-color="#AE9675"/><stop offset="0.28" stop-color="#AE9675"/><stop offset="0.28" stop-color="#FF635E"/><stop offset="0.42" stop-color="#FF635E"/><stop offset="0.42" stop-color="#FE8F63"/><stop offset="0.56" stop-color="#FE8F63"/><stop offset="0.56" stop-color="#FDEF68"/><stop offset="0.7" stop-color="#FDEF68"/><stop offset="0.7" stop-color="#71C56D"/><stop offset="0.84" stop-color="#71C56D"/><stop offset="0.84" stop-color="#32ADDD"/><stop offset="1" stop-color="#32ADDD"/></linearGradient></defs></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 905 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -2,14 +2,14 @@
## Contributing Rules
All contributions to Ryujinx/Ryujinx repository are made via pull requests (PRs) rather than through direct commits. The pull requests are reviewed and merged by the maintainers after a review and at least two approvals from the core development team.
All contributions to GreemDev/Ryujinx repository are made via pull requests (PRs) rather than through direct commits. The pull requests are reviewed and merged by the maintainers after a review and at least two approvals from the core development team.
To merge pull requests, you must have write permissions in the repository.
## Quick Code Review Rules
* Do not mix unrelated changes in one pull request. For example, a code style change should never be mixed with a bug fix.
* All changes should follow the existing code style. You can read more about our code style at [docs/coding-guidelines](../coding-guidelines/coding-style.md).
* All changes should follow the existing code style. You can read more about our code style at [docs/coding-style](../coding-guidelines/coding-style.md).
* Adding external dependencies is to be avoided unless not doing so would introduce _significant_ complexity. Any dependency addition should be justified and discussed before merge.
* Use Draft pull requests for changes you are still working on but want early CI loop feedback. When you think your changes are ready for review, [change the status](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request) of your pull request.
* Rebase your changes when required or directly requested. Changes should always be commited on top of the upstream branch, not the other way around.
@ -24,7 +24,7 @@ If during the code review process a merge conflict occurs, the PR author is resp
## Pull Request Builds
When submitting a PR to the `Ryujinx/Ryujinx` repository, various builds will run validating many areas to ensure we keep developer productivity and product quality high. These various workflows can be tracked in the [Actions](https://github.com/Ryujinx/Ryujinx/actions) tab of the repository. If the job continues to completion, the build artifacts will be uploaded and posted as a comment in the PR discussion.
When submitting a PR to the `GreemDev/Ryujinx` repository, various builds will run validating many areas to ensure we keep developer productivity and product quality high. These various workflows can be tracked in the [Actions](https://github.com/GreemDev/Ryujinx/actions) tab of the repository. If the job continues to completion, the build artifacts will be uploaded and posted as a comment in the PR discussion.
## Review Turnaround Times
@ -42,7 +42,7 @@ Anyone with write access can merge a pull request manually when the following co
* The PR has been approved by two reviewers and any other objections are addressed.
* You can request follow up reviews from the original reviewers if they requested changes.
* The PR successfully builds and passes all tests in the Continuous Integration (CI) system. In case of failures, refer to the [Actions](https://github.com/Ryujinx/Ryujinx/actions) tab of your PR.
* The PR successfully builds and passes all tests in the Continuous Integration (CI) system. In case of failures, refer to the [Actions](https://github.com/GreemDev/Ryujinx/actions) tab of your PR.
Typically, PRs are merged as one commit (squash merges). It creates a simpler history than a Merge Commit. "Special circumstances" are rare, and typically mean that there are a series of cleanly separated changes that will be too hard to understand if squashed together, or for some reason we want to preserve the ability to dissect them.

View File

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>

View File

@ -127,13 +127,13 @@ namespace ARMeilleure.CodeGen.Arm64
#region macOS
[LibraryImport("libSystem.dylib", SetLastError = true)]
private static unsafe partial int sysctlbyname([MarshalAs(UnmanagedType.LPStr)] string name, out int oldValue, ref ulong oldSize, IntPtr newValue, ulong newValueSize);
private static unsafe partial int sysctlbyname([MarshalAs(UnmanagedType.LPStr)] string name, out int oldValue, ref ulong oldSize, nint newValue, ulong newValueSize);
[SupportedOSPlatform("macos")]
private static bool CheckSysctlName(string name)
{
ulong size = sizeof(int);
if (sysctlbyname(name, out int val, ref size, IntPtr.Zero, 0) == 0 && size == sizeof(int))
if (sysctlbyname(name, out int val, ref size, nint.Zero, 0) == 0 && size == sizeof(int))
{
return val != 0;
}

View File

@ -58,7 +58,7 @@ namespace ARMeilleure.CodeGen
/// <typeparam name="T">Type of delegate</typeparam>
/// <param name="codePointer">Pointer to the function code in memory</param>
/// <returns>A delegate of type <typeparamref name="T"/> pointing to the mapped function</returns>
public T MapWithPointer<T>(out IntPtr codePointer)
public T MapWithPointer<T>(out nint codePointer)
{
codePointer = JitCache.Map(this);

View File

@ -387,7 +387,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
public override int GetHashCode()
{
return HashCode.Combine((IntPtr)_data);
return HashCode.Combine((nint)_data);
}
public override string ToString()

View File

@ -63,7 +63,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
public override int GetHashCode()
{
return HashCode.Combine((IntPtr)_data);
return HashCode.Combine((nint)_data);
}
public override string ToString()

View File

@ -1,252 +0,0 @@
using ARMeilleure.Diagnostics;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace ARMeilleure.Common
{
/// <summary>
/// Represents a table of guest address to a value.
/// </summary>
/// <typeparam name="TEntry">Type of the value</typeparam>
public unsafe class AddressTable<TEntry> : IDisposable where TEntry : unmanaged
{
/// <summary>
/// Represents a level in an <see cref="AddressTable{TEntry}"/>.
/// </summary>
public readonly struct Level
{
/// <summary>
/// Gets the index of the <see cref="Level"/> in the guest address.
/// </summary>
public int Index { get; }
/// <summary>
/// Gets the length of the <see cref="Level"/> in the guest address.
/// </summary>
public int Length { get; }
/// <summary>
/// Gets the mask which masks the bits used by the <see cref="Level"/>.
/// </summary>
public ulong Mask => ((1ul << Length) - 1) << Index;
/// <summary>
/// Initializes a new instance of the <see cref="Level"/> structure with the specified
/// <paramref name="index"/> and <paramref name="length"/>.
/// </summary>
/// <param name="index">Index of the <see cref="Level"/></param>
/// <param name="length">Length of the <see cref="Level"/></param>
public Level(int index, int length)
{
(Index, Length) = (index, length);
}
/// <summary>
/// Gets the value of the <see cref="Level"/> from the specified guest <paramref name="address"/>.
/// </summary>
/// <param name="address">Guest address</param>
/// <returns>Value of the <see cref="Level"/> from the specified guest <paramref name="address"/></returns>
public int GetValue(ulong address)
{
return (int)((address & Mask) >> Index);
}
}
private bool _disposed;
private TEntry** _table;
private readonly List<IntPtr> _pages;
/// <summary>
/// Gets the bits used by the <see cref="Levels"/> of the <see cref="AddressTable{TEntry}"/> instance.
/// </summary>
public ulong Mask { get; }
/// <summary>
/// Gets the <see cref="Level"/>s used by the <see cref="AddressTable{TEntry}"/> instance.
/// </summary>
public Level[] Levels { get; }
/// <summary>
/// Gets or sets the default fill value of newly created leaf pages.
/// </summary>
public TEntry Fill { get; set; }
/// <summary>
/// Gets the base address of the <see cref="EntryTable{TEntry}"/>.
/// </summary>
/// <exception cref="ObjectDisposedException"><see cref="EntryTable{TEntry}"/> instance was disposed</exception>
public IntPtr Base
{
get
{
ObjectDisposedException.ThrowIf(_disposed, this);
lock (_pages)
{
return (IntPtr)GetRootPage();
}
}
}
/// <summary>
/// Constructs a new instance of the <see cref="AddressTable{TEntry}"/> class with the specified list of
/// <see cref="Level"/>.
/// </summary>
/// <exception cref="ArgumentNullException"><paramref name="levels"/> is null</exception>
/// <exception cref="ArgumentException">Length of <paramref name="levels"/> is less than 2</exception>
public AddressTable(Level[] levels)
{
ArgumentNullException.ThrowIfNull(levels);
if (levels.Length < 2)
{
throw new ArgumentException("Table must be at least 2 levels deep.", nameof(levels));
}
_pages = new List<IntPtr>(capacity: 16);
Levels = levels;
Mask = 0;
foreach (var level in Levels)
{
Mask |= level.Mask;
}
}
/// <summary>
/// Determines if the specified <paramref name="address"/> is in the range of the
/// <see cref="AddressTable{TEntry}"/>.
/// </summary>
/// <param name="address">Guest address</param>
/// <returns><see langword="true"/> if is valid; otherwise <see langword="false"/></returns>
public bool IsValid(ulong address)
{
return (address & ~Mask) == 0;
}
/// <summary>
/// Gets a reference to the value at the specified guest <paramref name="address"/>.
/// </summary>
/// <param name="address">Guest address</param>
/// <returns>Reference to the value at the specified guest <paramref name="address"/></returns>
/// <exception cref="ObjectDisposedException"><see cref="EntryTable{TEntry}"/> instance was disposed</exception>
/// <exception cref="ArgumentException"><paramref name="address"/> is not mapped</exception>
public ref TEntry GetValue(ulong address)
{
ObjectDisposedException.ThrowIf(_disposed, this);
if (!IsValid(address))
{
throw new ArgumentException($"Address 0x{address:X} is not mapped onto the table.", nameof(address));
}
lock (_pages)
{
return ref GetPage(address)[Levels[^1].GetValue(address)];
}
}
/// <summary>
/// Gets the leaf page for the specified guest <paramref name="address"/>.
/// </summary>
/// <param name="address">Guest address</param>
/// <returns>Leaf page for the specified guest <paramref name="address"/></returns>
private TEntry* GetPage(ulong address)
{
TEntry** page = GetRootPage();
for (int i = 0; i < Levels.Length - 1; i++)
{
ref Level level = ref Levels[i];
ref TEntry* nextPage = ref page[level.GetValue(address)];
if (nextPage == null)
{
ref Level nextLevel = ref Levels[i + 1];
nextPage = i == Levels.Length - 2 ?
(TEntry*)Allocate(1 << nextLevel.Length, Fill, leaf: true) :
(TEntry*)Allocate(1 << nextLevel.Length, IntPtr.Zero, leaf: false);
}
page = (TEntry**)nextPage;
}
return (TEntry*)page;
}
/// <summary>
/// Lazily initialize and get the root page of the <see cref="AddressTable{TEntry}"/>.
/// </summary>
/// <returns>Root page of the <see cref="AddressTable{TEntry}"/></returns>
private TEntry** GetRootPage()
{
if (_table == null)
{
_table = (TEntry**)Allocate(1 << Levels[0].Length, fill: IntPtr.Zero, leaf: false);
}
return _table;
}
/// <summary>
/// Allocates a block of memory of the specified type and length.
/// </summary>
/// <typeparam name="T">Type of elements</typeparam>
/// <param name="length">Number of elements</param>
/// <param name="fill">Fill value</param>
/// <param name="leaf"><see langword="true"/> if leaf; otherwise <see langword="false"/></param>
/// <returns>Allocated block</returns>
private IntPtr Allocate<T>(int length, T fill, bool leaf) where T : unmanaged
{
var size = sizeof(T) * length;
var page = (IntPtr)NativeAllocator.Instance.Allocate((uint)size);
var span = new Span<T>((void*)page, length);
span.Fill(fill);
_pages.Add(page);
TranslatorEventSource.Log.AddressTableAllocated(size, leaf);
return page;
}
/// <summary>
/// Releases all resources used by the <see cref="AddressTable{TEntry}"/> instance.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases all unmanaged and optionally managed resources used by the <see cref="AddressTable{TEntry}"/>
/// instance.
/// </summary>
/// <param name="disposing"><see langword="true"/> to dispose managed resources also; otherwise just unmanaged resouces</param>
protected virtual void Dispose(bool disposing)
{
if (!_disposed)
{
foreach (var page in _pages)
{
Marshal.FreeHGlobal(page);
}
_disposed = true;
}
}
/// <summary>
/// Frees resources used by the <see cref="AddressTable{TEntry}"/> instance.
/// </summary>
~AddressTable()
{
Dispose(false);
}
}
}

View File

@ -0,0 +1,44 @@
namespace ARMeilleure.Common
{
/// <summary>
/// Represents a level in an <see cref="IAddressTable{TEntry}"/>.
/// </summary>
public readonly struct AddressTableLevel
{
/// <summary>
/// Gets the index of the <see cref="Level"/> in the guest address.
/// </summary>
public int Index { get; }
/// <summary>
/// Gets the length of the <see cref="AddressTableLevel"/> in the guest address.
/// </summary>
public int Length { get; }
/// <summary>
/// Gets the mask which masks the bits used by the <see cref="AddressTableLevel"/>.
/// </summary>
public ulong Mask => ((1ul << Length) - 1) << Index;
/// <summary>
/// Initializes a new instance of the <see cref="AddressTableLevel"/> structure with the specified
/// <paramref name="index"/> and <paramref name="length"/>.
/// </summary>
/// <param name="index">Index of the <see cref="AddressTableLevel"/></param>
/// <param name="length">Length of the <see cref="AddressTableLevel"/></param>
public AddressTableLevel(int index, int length)
{
(Index, Length) = (index, length);
}
/// <summary>
/// Gets the value of the <see cref="AddressTableLevel"/> from the specified guest <paramref name="address"/>.
/// </summary>
/// <param name="address">Guest address</param>
/// <returns>Value of the <see cref="AddressTableLevel"/> from the specified guest <paramref name="address"/></returns>
public long GetValue(ulong address)
{
return (long)((address & Mask) >> Index);
}
}
}

View File

@ -0,0 +1,75 @@
namespace ARMeilleure.Common
{
public static class AddressTablePresets
{
private static readonly AddressTableLevel[] _levels64Bit =
new AddressTableLevel[]
{
new(31, 17),
new(23, 8),
new(15, 8),
new( 7, 8),
new( 2, 5),
};
private static readonly AddressTableLevel[] _levels32Bit =
new AddressTableLevel[]
{
new(31, 17),
new(23, 8),
new(15, 8),
new( 7, 8),
new( 1, 6),
};
private static readonly AddressTableLevel[] _levels64BitSparseTiny =
new AddressTableLevel[]
{
new( 11, 28),
new( 2, 9),
};
private static readonly AddressTableLevel[] _levels32BitSparseTiny =
new AddressTableLevel[]
{
new( 10, 22),
new( 1, 9),
};
private static readonly AddressTableLevel[] _levels64BitSparseGiant =
new AddressTableLevel[]
{
new( 38, 1),
new( 2, 36),
};
private static readonly AddressTableLevel[] _levels32BitSparseGiant =
new AddressTableLevel[]
{
new( 31, 1),
new( 1, 30),
};
//high power will run worse on DDR3 systems and some DDR4 systems due to the higher ram utilization
//low power will never run worse than non-sparse, but for most systems it won't be necessary
//high power is always used, but I've left low power in here for future reference
public static AddressTableLevel[] GetArmPreset(bool for64Bits, bool sparse, bool lowPower = false)
{
if (sparse)
{
if (lowPower)
{
return for64Bits ? _levels64BitSparseTiny : _levels32BitSparseTiny;
}
else
{
return for64Bits ? _levels64BitSparseGiant : _levels32BitSparseGiant;
}
}
else
{
return for64Bits ? _levels64Bit : _levels32Bit;
}
}
}
}

View File

@ -2,7 +2,7 @@ using System;
namespace ARMeilleure.Common
{
unsafe abstract class Allocator : IDisposable
public unsafe abstract class Allocator : IDisposable
{
public T* Allocate<T>(ulong count = 1) where T : unmanaged
{

View File

@ -20,7 +20,7 @@ namespace ARMeilleure.Common
private List<PageInfo> _pages;
private readonly ulong _pageSize;
private readonly uint _pageCount;
private readonly List<IntPtr> _extras;
private readonly List<nint> _extras;
public ArenaAllocator(uint pageSize, uint pageCount)
{
@ -31,11 +31,11 @@ namespace ARMeilleure.Common
_pageIndex = -1;
_page = null;
_pages = new List<PageInfo>();
_pages = [];
_pageSize = pageSize;
_pageCount = pageCount;
_extras = new List<IntPtr>();
_extras = [];
}
public Span<T> AllocateSpan<T>(ulong count) where T : unmanaged
@ -64,7 +64,7 @@ namespace ARMeilleure.Common
{
void* extra = NativeAllocator.Instance.Allocate(size);
_extras.Add((IntPtr)extra);
_extras.Add((nint)extra);
return extra;
}
@ -84,7 +84,7 @@ namespace ARMeilleure.Common
{
_page = new PageInfo
{
Pointer = (byte*)NativeAllocator.Instance.Allocate(_pageSize),
Pointer = (byte*)NativeAllocator.Instance.Allocate(_pageSize)
};
_pages.Add(_page);
@ -114,7 +114,7 @@ namespace ARMeilleure.Common
}
// Free extra blocks that are not page-sized
foreach (IntPtr ptr in _extras)
foreach (nint ptr in _extras)
{
NativeAllocator.Instance.Free((void*)ptr);
}
@ -173,7 +173,7 @@ namespace ARMeilleure.Common
NativeAllocator.Instance.Free(info.Pointer);
}
foreach (IntPtr ptr in _extras)
foreach (nint ptr in _extras)
{
NativeAllocator.Instance.Free((void*)ptr);
}

View File

@ -15,7 +15,7 @@ namespace ARMeilleure.Common
private int _freeHint;
private readonly int _pageCapacity; // Number of entries per page.
private readonly int _pageLogCapacity;
private readonly Dictionary<int, IntPtr> _pages;
private readonly Dictionary<int, nint> _pages;
private readonly BitMap _allocated;
/// <summary>
@ -41,7 +41,7 @@ namespace ARMeilleure.Common
}
_allocated = new BitMap(NativeAllocator.Instance);
_pages = new Dictionary<int, IntPtr>();
_pages = new Dictionary<int, nint>();
_pageLogCapacity = BitOperations.Log2((uint)(pageSize / sizeof(TEntry)));
_pageCapacity = 1 << _pageLogCapacity;
}
@ -138,9 +138,9 @@ namespace ARMeilleure.Common
{
var pageIndex = (int)((uint)(index & ~(_pageCapacity - 1)) >> _pageLogCapacity);
if (!_pages.TryGetValue(pageIndex, out IntPtr page))
if (!_pages.TryGetValue(pageIndex, out nint page))
{
page = (IntPtr)NativeAllocator.Instance.Allocate((uint)sizeof(TEntry) * (uint)_pageCapacity);
page = (nint)NativeAllocator.Instance.Allocate((uint)sizeof(TEntry) * (uint)_pageCapacity);
_pages.Add(pageIndex, page);
}

View File

@ -0,0 +1,51 @@
using System;
namespace ARMeilleure.Common
{
public interface IAddressTable<TEntry> : IDisposable where TEntry : unmanaged
{
/// <summary>
/// True if the address table's bottom level is sparsely mapped.
/// This also ensures the second bottom level is filled with a dummy page rather than 0.
/// </summary>
bool Sparse { get; }
/// <summary>
/// Gets the bits used by the <see cref="Levels"/> of the <see cref="IAddressTable{TEntry}"/> instance.
/// </summary>
ulong Mask { get; }
/// <summary>
/// Gets the <see cref="AddressTableLevel"/>s used by the <see cref="IAddressTable{TEntry}"/> instance.
/// </summary>
AddressTableLevel[] Levels { get; }
/// <summary>
/// Gets or sets the default fill value of newly created leaf pages.
/// </summary>
TEntry Fill { get; set; }
/// <summary>
/// Gets the base address of the <see cref="EntryTable{TEntry}"/>.
/// </summary>
/// <exception cref="ObjectDisposedException"><see cref="EntryTable{TEntry}"/> instance was disposed</exception>
nint Base { get; }
/// <summary>
/// Determines if the specified <paramref name="address"/> is in the range of the
/// <see cref="IAddressTable{TEntry}"/>.
/// </summary>
/// <param name="address">Guest address</param>
/// <returns><see langword="true"/> if is valid; otherwise <see langword="false"/></returns>
bool IsValid(ulong address);
/// <summary>
/// Gets a reference to the value at the specified guest <paramref name="address"/>.
/// </summary>
/// <param name="address">Guest address</param>
/// <returns>Reference to the value at the specified guest <paramref name="address"/></returns>
/// <exception cref="ObjectDisposedException"><see cref="EntryTable{TEntry}"/> instance was disposed</exception>
/// <exception cref="ArgumentException"><paramref name="address"/> is not mapped</exception>
ref TEntry GetValue(ulong address);
}
}

View File

@ -3,13 +3,13 @@ using System.Runtime.InteropServices;
namespace ARMeilleure.Common
{
unsafe sealed class NativeAllocator : Allocator
public unsafe sealed class NativeAllocator : Allocator
{
public static NativeAllocator Instance { get; } = new();
public override void* Allocate(ulong size)
{
void* result = (void*)Marshal.AllocHGlobal((IntPtr)size);
void* result = (void*)Marshal.AllocHGlobal((nint)size);
if (result == null)
{
@ -21,7 +21,7 @@ namespace ARMeilleure.Common
public override void Free(void* block)
{
Marshal.FreeHGlobal((IntPtr)block);
Marshal.FreeHGlobal((nint)block);
}
}
}

View File

@ -193,6 +193,8 @@ namespace ARMeilleure.Instructions
Operand hostAddress;
var table = context.FunctionTable;
// If address is mapped onto the function table, we can skip the table walk. Otherwise we fallback
// onto the dispatch stub.
if (guestAddress.Kind == OperandKind.Constant && context.FunctionTable.IsValid(guestAddress.Value))
@ -203,6 +205,30 @@ namespace ARMeilleure.Instructions
hostAddress = context.Load(OperandType.I64, hostAddressAddr);
}
else if (table.Sparse)
{
// Inline table lookup. Only enabled when the sparse function table is enabled with 2 levels.
// Deliberately attempts to avoid branches.
Operand tableBase = !context.HasPtc ?
Const(table.Base) :
Const(table.Base, Ptc.FunctionTableSymbol);
hostAddress = tableBase;
for (int i = 0; i < table.Levels.Length; i++)
{
var level = table.Levels[i];
int clearBits = 64 - (level.Index + level.Length);
Operand index = context.ShiftLeft(
context.ShiftRightUI(context.ShiftLeft(guestAddress, Const(clearBits)), Const(clearBits + level.Index)),
Const(3)
);
hostAddress = context.Load(OperandType.I64, context.Add(hostAddress, index));
}
}
else
{
hostAddress = !context.HasPtc ?

View File

@ -49,6 +49,9 @@ namespace ARMeilleure.Instructions
case 0b11_011_1101_0000_011:
EmitGetTpidrroEl0(context);
return;
case 0b11_011_1101_0000_101:
EmitGetTpidr2El0(context);
return;
case 0b11_011_1110_0000_000:
info = typeof(NativeInterface).GetMethod(nameof(NativeInterface.GetCntfrqEl0));
break;
@ -84,6 +87,9 @@ namespace ARMeilleure.Instructions
case 0b11_011_1101_0000_010:
EmitSetTpidrEl0(context);
return;
case 0b11_011_1101_0000_101:
EmitSetTpidr2El0(context);
return;
default:
throw new NotImplementedException($"Unknown MSR 0x{op.RawOpCode:X8} at 0x{op.Address:X16}.");
@ -213,6 +219,17 @@ namespace ARMeilleure.Instructions
SetIntOrZR(context, op.Rt, result);
}
private static void EmitGetTpidr2El0(ArmEmitterContext context)
{
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
Operand result = context.Load(OperandType.I64, context.Add(nativeContext, Const((ulong)NativeContext.GetTpidr2El0Offset())));
SetIntOrZR(context, op.Rt, result);
}
private static void EmitSetNzcv(ArmEmitterContext context)
{
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
@ -274,5 +291,16 @@ namespace ARMeilleure.Instructions
context.Store(context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrEl0Offset())), value);
}
private static void EmitSetTpidr2El0(ArmEmitterContext context)
{
OpCodeSystem op = (OpCodeSystem)context.CurrOp;
Operand value = GetIntOrZR(context, op.Rt);
Operand nativeContext = context.LoadArgument(OperandType.I64, 0);
context.Store(context.Add(nativeContext, Const((ulong)NativeContext.GetTpidr2El0Offset())), value);
}
}
}

View File

@ -32,7 +32,7 @@ namespace ARMeilleure.IntermediateRepresentation
/// <exception cref="ArgumentException"><typeparamref name="T"/> is not pointer sized.</exception>
public IntrusiveList()
{
if (Unsafe.SizeOf<T>() != IntPtr.Size)
if (Unsafe.SizeOf<T>() != nint.Size)
{
throw new ArgumentException("T must be a reference type or a pointer sized struct.");
}

View File

@ -24,7 +24,7 @@ namespace ARMeilleure.IntermediateRepresentation
{
Debug.Assert(operand.Kind == OperandKind.Memory);
_data = (Data*)Unsafe.As<Operand, IntPtr>(ref operand);
_data = (Data*)Unsafe.As<Operand, nint>(ref operand);
}
public Operand BaseAddress

View File

@ -228,7 +228,7 @@ namespace ARMeilleure.IntermediateRepresentation
public readonly override int GetHashCode()
{
return HashCode.Combine((IntPtr)_data);
return HashCode.Combine((nint)_data);
}
public static bool operator ==(Operation a, Operation b)

View File

@ -4,7 +4,7 @@ namespace ARMeilleure.Memory
{
public interface IJitMemoryBlock : IDisposable
{
IntPtr Pointer { get; }
nint Pointer { get; }
void Commit(ulong offset, ulong size);

View File

@ -6,7 +6,7 @@ namespace ARMeilleure.Memory
{
int AddressSpaceBits { get; }
IntPtr PageTablePointer { get; }
nint PageTablePointer { get; }
MemoryManagerType Type { get; }

View File

@ -8,7 +8,7 @@ namespace ARMeilleure.Memory
public IJitMemoryBlock Block { get; }
public IntPtr Pointer => Block.Pointer;
public nint Pointer => Block.Pointer;
private readonly ulong _maxSize;
private readonly ulong _sizeGranularity;

View File

@ -8,6 +8,6 @@ namespace ARMeilleure.Native
static partial class JitSupportDarwin
{
[LibraryImport("libarmeilleure-jitsupport", EntryPoint = "armeilleure_jit_memcpy")]
public static partial void Copy(IntPtr dst, IntPtr src, ulong n);
public static partial void Copy(nint dst, nint src, ulong n);
}
}

View File

@ -8,7 +8,7 @@ namespace ARMeilleure.Signal
{
public static class NativeSignalHandlerGenerator
{
public const int MaxTrackedRanges = 8;
public const int MaxTrackedRanges = 16;
private const int StructAddressOffset = 0;
private const int StructWriteOffset = 4;
@ -21,7 +21,7 @@ namespace ARMeilleure.Signal
private const uint EXCEPTION_ACCESS_VIOLATION = 0xc0000005;
private static Operand EmitGenericRegionCheck(EmitterContext context, IntPtr signalStructPtr, Operand faultAddress, Operand isWrite, int rangeStructSize)
private static Operand EmitGenericRegionCheck(EmitterContext context, nint signalStructPtr, Operand faultAddress, Operand isWrite, int rangeStructSize)
{
Operand inRegionLocal = context.AllocateLocal(OperandType.I32);
context.Copy(inRegionLocal, Const(0));
@ -155,7 +155,7 @@ namespace ARMeilleure.Signal
throw new PlatformNotSupportedException();
}
public static byte[] GenerateUnixSignalHandler(IntPtr signalStructPtr, int rangeStructSize)
public static byte[] GenerateUnixSignalHandler(nint signalStructPtr, int rangeStructSize)
{
EmitterContext context = new();
@ -203,7 +203,7 @@ namespace ARMeilleure.Signal
return Compiler.Compile(cfg, argTypes, OperandType.None, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Code;
}
public static byte[] GenerateWindowsSignalHandler(IntPtr signalStructPtr, int rangeStructSize)
public static byte[] GenerateWindowsSignalHandler(nint signalStructPtr, int rangeStructSize)
{
EmitterContext context = new();

View File

@ -16,7 +16,7 @@ namespace ARMeilleure.Signal
{
public delegate bool DebugPartialUnmap();
public delegate int DebugThreadLocalMapGetOrReserve(int threadId, int initialState);
public delegate void DebugNativeWriteLoop(IntPtr nativeWriteLoopPtr, IntPtr writePtr);
public delegate void DebugNativeWriteLoop(nint nativeWriteLoopPtr, nint writePtr);
public static DebugPartialUnmap GenerateDebugPartialUnmap()
{
@ -35,7 +35,7 @@ namespace ARMeilleure.Signal
return Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DebugPartialUnmap>();
}
public static DebugThreadLocalMapGetOrReserve GenerateDebugThreadLocalMapGetOrReserve(IntPtr structPtr)
public static DebugThreadLocalMapGetOrReserve GenerateDebugThreadLocalMapGetOrReserve(nint structPtr)
{
EmitterContext context = new();

View File

@ -13,18 +13,18 @@ namespace ARMeilleure.Signal
internal static partial class WindowsPartialUnmapHandler
{
[LibraryImport("kernel32.dll", SetLastError = true, EntryPoint = "LoadLibraryA")]
private static partial IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)] string lpFileName);
private static partial nint LoadLibrary([MarshalAs(UnmanagedType.LPStr)] string lpFileName);
[LibraryImport("kernel32.dll", SetLastError = true)]
private static partial IntPtr GetProcAddress(IntPtr hModule, [MarshalAs(UnmanagedType.LPStr)] string procName);
private static partial nint GetProcAddress(nint hModule, [MarshalAs(UnmanagedType.LPStr)] string procName);
private static IntPtr _getCurrentThreadIdPtr;
private static nint _getCurrentThreadIdPtr;
public static IntPtr GetCurrentThreadIdFunc()
public static nint GetCurrentThreadIdFunc()
{
if (_getCurrentThreadIdPtr == IntPtr.Zero)
if (_getCurrentThreadIdPtr == nint.Zero)
{
IntPtr handle = LoadLibrary("kernel32.dll");
nint handle = LoadLibrary("kernel32.dll");
_getCurrentThreadIdPtr = GetProcAddress(handle, "GetCurrentThreadId");
}
@ -34,13 +34,13 @@ namespace ARMeilleure.Signal
public static Operand EmitRetryFromAccessViolation(EmitterContext context)
{
IntPtr partialRemapStatePtr = PartialUnmapState.GlobalState;
IntPtr localCountsPtr = IntPtr.Add(partialRemapStatePtr, PartialUnmapState.LocalCountsOffset);
nint partialRemapStatePtr = PartialUnmapState.GlobalState;
nint localCountsPtr = nint.Add(partialRemapStatePtr, PartialUnmapState.LocalCountsOffset);
// Get the lock first.
EmitNativeReaderLockAcquire(context, IntPtr.Add(partialRemapStatePtr, PartialUnmapState.PartialUnmapLockOffset));
EmitNativeReaderLockAcquire(context, nint.Add(partialRemapStatePtr, PartialUnmapState.PartialUnmapLockOffset));
IntPtr getCurrentThreadId = GetCurrentThreadIdFunc();
nint getCurrentThreadId = GetCurrentThreadIdFunc();
Operand threadId = context.Call(Const((ulong)getCurrentThreadId), OperandType.I32);
Operand threadIndex = EmitThreadLocalMapIntGetOrReserve(context, localCountsPtr, threadId, Const(0));
@ -58,7 +58,7 @@ namespace ARMeilleure.Signal
Operand threadLocalPartialUnmapsPtr = EmitThreadLocalMapIntGetValuePtr(context, localCountsPtr, threadIndex);
Operand threadLocalPartialUnmaps = context.Load(OperandType.I32, threadLocalPartialUnmapsPtr);
Operand partialUnmapsCount = context.Load(OperandType.I32, Const((ulong)IntPtr.Add(partialRemapStatePtr, PartialUnmapState.PartialUnmapsCountOffset)));
Operand partialUnmapsCount = context.Load(OperandType.I32, Const((ulong)nint.Add(partialRemapStatePtr, PartialUnmapState.PartialUnmapsCountOffset)));
context.Copy(retry, context.ICompareNotEqual(threadLocalPartialUnmaps, partialUnmapsCount));
@ -79,14 +79,14 @@ namespace ARMeilleure.Signal
context.MarkLabel(endLabel);
// Finally, release the lock and return the retry value.
EmitNativeReaderLockRelease(context, IntPtr.Add(partialRemapStatePtr, PartialUnmapState.PartialUnmapLockOffset));
EmitNativeReaderLockRelease(context, nint.Add(partialRemapStatePtr, PartialUnmapState.PartialUnmapLockOffset));
return retry;
}
public static Operand EmitThreadLocalMapIntGetOrReserve(EmitterContext context, IntPtr threadLocalMapPtr, Operand threadId, Operand initialState)
public static Operand EmitThreadLocalMapIntGetOrReserve(EmitterContext context, nint threadLocalMapPtr, Operand threadId, Operand initialState)
{
Operand idsPtr = Const((ulong)IntPtr.Add(threadLocalMapPtr, ThreadLocalMap<int>.ThreadIdsOffset));
Operand idsPtr = Const((ulong)nint.Add(threadLocalMapPtr, ThreadLocalMap<int>.ThreadIdsOffset));
Operand i = context.AllocateLocal(OperandType.I32);
@ -130,7 +130,7 @@ namespace ARMeilleure.Signal
// If it was 0, then we need to initialize the struct entry and return i.
context.BranchIfFalse(idNot0Label, context.ICompareEqual(existingId2, Const(0)));
Operand structsPtr = Const((ulong)IntPtr.Add(threadLocalMapPtr, ThreadLocalMap<int>.StructsOffset));
Operand structsPtr = Const((ulong)nint.Add(threadLocalMapPtr, ThreadLocalMap<int>.StructsOffset));
Operand structPtr = context.Add(structsPtr, context.SignExtend32(OperandType.I64, offset2));
context.Store(structPtr, initialState);
@ -149,10 +149,10 @@ namespace ARMeilleure.Signal
return context.Copy(i);
}
private static Operand EmitThreadLocalMapIntGetValuePtr(EmitterContext context, IntPtr threadLocalMapPtr, Operand index)
private static Operand EmitThreadLocalMapIntGetValuePtr(EmitterContext context, nint threadLocalMapPtr, Operand index)
{
Operand offset = context.Multiply(index, Const(sizeof(int)));
Operand structsPtr = Const((ulong)IntPtr.Add(threadLocalMapPtr, ThreadLocalMap<int>.StructsOffset));
Operand structsPtr = Const((ulong)nint.Add(threadLocalMapPtr, ThreadLocalMap<int>.StructsOffset));
return context.Add(structsPtr, context.SignExtend32(OperandType.I64, offset));
}
@ -170,9 +170,9 @@ namespace ARMeilleure.Signal
context.BranchIfFalse(loop, context.ICompareEqual(initial, replaced));
}
private static void EmitNativeReaderLockAcquire(EmitterContext context, IntPtr nativeReaderLockPtr)
private static void EmitNativeReaderLockAcquire(EmitterContext context, nint nativeReaderLockPtr)
{
Operand writeLockPtr = Const((ulong)IntPtr.Add(nativeReaderLockPtr, NativeReaderWriterLock.WriteLockOffset));
Operand writeLockPtr = Const((ulong)nint.Add(nativeReaderLockPtr, NativeReaderWriterLock.WriteLockOffset));
// Spin until we can acquire the write lock.
Operand spinLabel = Label();
@ -182,16 +182,16 @@ namespace ARMeilleure.Signal
context.BranchIfTrue(spinLabel, context.CompareAndSwap(writeLockPtr, Const(0), Const(1)));
// Increment reader count.
EmitAtomicAddI32(context, Const((ulong)IntPtr.Add(nativeReaderLockPtr, NativeReaderWriterLock.ReaderCountOffset)), Const(1));
EmitAtomicAddI32(context, Const((ulong)nint.Add(nativeReaderLockPtr, NativeReaderWriterLock.ReaderCountOffset)), Const(1));
// Release write lock.
context.CompareAndSwap(writeLockPtr, Const(1), Const(0));
}
private static void EmitNativeReaderLockRelease(EmitterContext context, IntPtr nativeReaderLockPtr)
private static void EmitNativeReaderLockRelease(EmitterContext context, nint nativeReaderLockPtr)
{
// Decrement reader count.
EmitAtomicAddI32(context, Const((ulong)IntPtr.Add(nativeReaderLockPtr, NativeReaderWriterLock.ReaderCountOffset)), Const(-1));
EmitAtomicAddI32(context, Const((ulong)nint.Add(nativeReaderLockPtr, NativeReaderWriterLock.ReaderCountOffset)), Const(-1));
}
}
}

View File

@ -9,7 +9,7 @@ namespace ARMeilleure.State
private readonly NativeContext _nativeContext;
internal IntPtr NativeContextPtr => _nativeContext.BasePtr;
internal nint NativeContextPtr => _nativeContext.BasePtr;
private bool _interrupted;

View File

@ -21,13 +21,14 @@ namespace ARMeilleure.State
public ulong ExclusiveValueLow;
public ulong ExclusiveValueHigh;
public int Running;
public long Tpidr2El0;
}
private static NativeCtxStorage _dummyStorage = new();
private readonly IJitMemoryBlock _block;
public IntPtr BasePtr => _block.Pointer;
public nint BasePtr => _block.Pointer;
public NativeContext(IJitMemoryAllocator allocator)
{
@ -176,6 +177,9 @@ namespace ARMeilleure.State
public long GetTpidrroEl0() => GetStorage().TpidrroEl0;
public void SetTpidrroEl0(long value) => GetStorage().TpidrroEl0 = value;
public long GetTpidr2El0() => GetStorage().Tpidr2El0;
public void SetTpidr2El0(long value) => GetStorage().Tpidr2El0 = value;
public int GetCounter() => GetStorage().Counter;
public void SetCounter(int value) => GetStorage().Counter = value;
@ -232,6 +236,11 @@ namespace ARMeilleure.State
return StorageOffset(ref _dummyStorage, ref _dummyStorage.TpidrroEl0);
}
public static int GetTpidr2El0Offset()
{
return StorageOffset(ref _dummyStorage, ref _dummyStorage.Tpidr2El0);
}
public static int GetCounterOffset()
{
return StorageOffset(ref _dummyStorage, ref _dummyStorage.Counter);

View File

@ -46,7 +46,7 @@ namespace ARMeilleure.Translation
public IMemoryManager Memory { get; }
public EntryTable<uint> CountTable { get; }
public AddressTable<ulong> FunctionTable { get; }
public IAddressTable<ulong> FunctionTable { get; }
public TranslatorStubs Stubs { get; }
public ulong EntryAddress { get; }
@ -62,7 +62,7 @@ namespace ARMeilleure.Translation
public ArmEmitterContext(
IMemoryManager memory,
EntryTable<uint> countTable,
AddressTable<ulong> funcTable,
IAddressTable<ulong> funcTable,
TranslatorStubs stubs,
ulong entryAddress,
bool highCq,
@ -92,7 +92,7 @@ namespace ARMeilleure.Translation
else
{
int index = Delegates.GetDelegateIndex(info);
IntPtr funcPtr = Delegates.GetDelegateFuncPtrByIndex(index);
nint funcPtr = Delegates.GetDelegateFuncPtrByIndex(index);
OperandType returnType = GetOperandType(info.ReturnType);

View File

@ -31,7 +31,7 @@ namespace ARMeilleure.Translation.Cache
[SupportedOSPlatform("windows")]
[LibraryImport("kernel32.dll", SetLastError = true)]
public static partial IntPtr FlushInstructionCache(IntPtr hProcess, IntPtr lpAddress, UIntPtr dwSize);
public static partial nint FlushInstructionCache(nint hProcess, nint lpAddress, nuint dwSize);
public static void Initialize(IJitMemoryAllocator allocator)
{
@ -65,7 +65,7 @@ namespace ARMeilleure.Translation.Cache
}
}
public static IntPtr Map(CompiledFunction func)
public static nint Map(CompiledFunction func)
{
byte[] code = func.Code;
@ -75,7 +75,7 @@ namespace ARMeilleure.Translation.Cache
int funcOffset = Allocate(code.Length);
IntPtr funcPtr = _jitRegion.Pointer + funcOffset;
nint funcPtr = _jitRegion.Pointer + funcOffset;
if (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
{
@ -83,7 +83,7 @@ namespace ARMeilleure.Translation.Cache
{
fixed (byte* codePtr = code)
{
JitSupportDarwin.Copy(funcPtr, (IntPtr)codePtr, (ulong)code.Length);
JitSupportDarwin.Copy(funcPtr, (nint)codePtr, (ulong)code.Length);
}
}
}
@ -95,7 +95,7 @@ namespace ARMeilleure.Translation.Cache
if (OperatingSystem.IsWindows() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
{
FlushInstructionCache(Process.GetCurrentProcess().Handle, funcPtr, (UIntPtr)code.Length);
FlushInstructionCache(Process.GetCurrentProcess().Handle, funcPtr, (nuint)code.Length);
}
else
{
@ -109,7 +109,7 @@ namespace ARMeilleure.Translation.Cache
}
}
public static void Unmap(IntPtr pointer)
public static void Unmap(nint pointer)
{
lock (_lock)
{

View File

@ -68,7 +68,7 @@ namespace ARMeilleure.Translation.Cache
}
}
public void Invalidate(IntPtr basePointer, ulong size)
public void Invalidate(nint basePointer, ulong size)
{
if (_needsInvalidation)
{

View File

@ -40,7 +40,7 @@ namespace ARMeilleure.Translation.Cache
PushMachframe = 10,
}
private unsafe delegate RuntimeFunction* GetRuntimeFunctionCallback(ulong controlPc, IntPtr context);
private unsafe delegate RuntimeFunction* GetRuntimeFunctionCallback(ulong controlPc, nint context);
[LibraryImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
@ -49,7 +49,7 @@ namespace ARMeilleure.Translation.Cache
ulong baseAddress,
uint length,
GetRuntimeFunctionCallback callback,
IntPtr context,
nint context,
[MarshalAs(UnmanagedType.LPWStr)] string outOfProcessCallbackDll);
private static GetRuntimeFunctionCallback _getRuntimeFunctionCallback;
@ -60,7 +60,7 @@ namespace ARMeilleure.Translation.Cache
private unsafe static UnwindInfo* _unwindInfo;
public static void InstallFunctionTableHandler(IntPtr codeCachePointer, uint codeCacheLength, IntPtr workBufferPtr)
public static void InstallFunctionTableHandler(nint codeCachePointer, uint codeCacheLength, nint workBufferPtr)
{
ulong codeCachePtr = (ulong)codeCachePointer.ToInt64();
@ -91,7 +91,7 @@ namespace ARMeilleure.Translation.Cache
}
}
private static unsafe RuntimeFunction* FunctionTableHandler(ulong controlPc, IntPtr context)
private static unsafe RuntimeFunction* FunctionTableHandler(ulong controlPc, nint context)
{
int offset = (int)((long)controlPc - context.ToInt64());

View File

@ -8,9 +8,9 @@ namespace ARMeilleure.Translation
private readonly Delegate _dlg; // Ensure that this delegate will not be garbage collected.
#pragma warning restore IDE0052
public IntPtr FuncPtr { get; }
public nint FuncPtr { get; }
public DelegateInfo(Delegate dlg, IntPtr funcPtr)
public DelegateInfo(Delegate dlg, nint funcPtr)
{
_dlg = dlg;
FuncPtr = funcPtr;

View File

@ -9,7 +9,7 @@ namespace ARMeilleure.Translation
{
static class Delegates
{
public static bool TryGetDelegateFuncPtrByIndex(int index, out IntPtr funcPtr)
public static bool TryGetDelegateFuncPtrByIndex(int index, out nint funcPtr)
{
if (index >= 0 && index < _delegates.Count)
{
@ -25,7 +25,7 @@ namespace ARMeilleure.Translation
}
}
public static IntPtr GetDelegateFuncPtrByIndex(int index)
public static nint GetDelegateFuncPtrByIndex(int index)
{
if (index < 0 || index >= _delegates.Count)
{
@ -35,7 +35,7 @@ namespace ARMeilleure.Translation
return _delegates.Values[index].FuncPtr; // O(1).
}
public static IntPtr GetDelegateFuncPtr(MethodInfo info)
public static nint GetDelegateFuncPtr(MethodInfo info)
{
ArgumentNullException.ThrowIfNull(info);
@ -65,7 +65,7 @@ namespace ARMeilleure.Translation
return index;
}
private static void SetDelegateInfo(Delegate dlg, IntPtr funcPtr)
private static void SetDelegateInfo(Delegate dlg, nint funcPtr)
{
string key = GetKey(dlg.Method);

View File

@ -2,6 +2,6 @@ using System;
namespace ARMeilleure.Translation
{
delegate void DispatcherFunction(IntPtr nativeContext, ulong startAddress);
delegate ulong WrapperFunction(IntPtr nativeContext, ulong startAddress);
delegate void DispatcherFunction(nint nativeContext, ulong startAddress);
delegate ulong WrapperFunction(nint nativeContext, ulong startAddress);
}

View File

@ -77,7 +77,7 @@ namespace ARMeilleure.Translation
{
continue;
}
for (int pBlkIndex = 0; pBlkIndex < block.Predecessors.Count; pBlkIndex++)
{
BasicBlock current = block.Predecessors[pBlkIndex];

View File

@ -97,7 +97,7 @@ namespace ARMeilleure.Translation
public virtual Operand Call(MethodInfo info, params Operand[] callArgs)
{
IntPtr funcPtr = Delegates.GetDelegateFuncPtr(info);
nint funcPtr = Delegates.GetDelegateFuncPtr(info);
OperandType returnType = GetOperandType(info.ReturnType);

View File

@ -2,5 +2,5 @@ using System;
namespace ARMeilleure.Translation
{
delegate ulong GuestFunction(IntPtr nativeContextPtr);
delegate ulong GuestFunction(nint nativeContextPtr);
}

View File

@ -13,6 +13,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@ -29,7 +30,7 @@ namespace ARMeilleure.Translation.PTC
private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0";
private const uint InternalVersion = 6950; //! To be incremented manually for each change to the ARMeilleure project.
private const uint InternalVersion = 6997; //! To be incremented manually for each change to the ARMeilleure project.
private const string ActualDir = "0";
private const string BackupDir = "1";
@ -40,6 +41,7 @@ namespace ARMeilleure.Translation.PTC
public static readonly Symbol PageTableSymbol = new(SymbolType.Special, 1);
public static readonly Symbol CountTableSymbol = new(SymbolType.Special, 2);
public static readonly Symbol DispatchStubSymbol = new(SymbolType.Special, 3);
public static readonly Symbol FunctionTableSymbol = new(SymbolType.Special, 4);
private const byte FillingByte = 0x00;
private const CompressionLevel SaveCompressionLevel = CompressionLevel.Fastest;
@ -100,7 +102,7 @@ namespace ARMeilleure.Translation.PTC
Disable();
}
public void Initialize(string titleIdText, string displayVersion, bool enabled, MemoryManagerType memoryMode)
public void Initialize(string titleIdText, string displayVersion, bool enabled, MemoryManagerType memoryMode, string cacheSelector)
{
Wait();
@ -126,6 +128,8 @@ namespace ARMeilleure.Translation.PTC
DisplayVersion = !string.IsNullOrEmpty(displayVersion) ? displayVersion : DisplayVersionDefault;
_memoryMode = memoryMode;
Logger.Info?.Print(LogClass.Ptc, $"PPTC (v{InternalVersion}) Profile: {DisplayVersion}-{cacheSelector}");
string workPathActual = Path.Combine(AppDataManager.GamesDirPath, TitleIdText, "cache", "cpu", ActualDir);
string workPathBackup = Path.Combine(AppDataManager.GamesDirPath, TitleIdText, "cache", "cpu", BackupDir);
@ -139,8 +143,8 @@ namespace ARMeilleure.Translation.PTC
Directory.CreateDirectory(workPathBackup);
}
CachePathActual = Path.Combine(workPathActual, DisplayVersion);
CachePathBackup = Path.Combine(workPathBackup, DisplayVersion);
CachePathActual = Path.Combine(workPathActual, DisplayVersion) + "-" + cacheSelector;
CachePathBackup = Path.Combine(workPathBackup, DisplayVersion) + "-" + cacheSelector;
PreLoad();
Profiler.PreLoad();
@ -268,11 +272,11 @@ namespace ARMeilleure.Translation.PTC
return false;
}
IntPtr intPtr = IntPtr.Zero;
nint intPtr = nint.Zero;
try
{
intPtr = Marshal.AllocHGlobal(new IntPtr(outerHeader.UncompressedStreamSize));
intPtr = Marshal.AllocHGlobal(new nint(outerHeader.UncompressedStreamSize));
using UnmanagedMemoryStream stream = new((byte*)intPtr.ToPointer(), outerHeader.UncompressedStreamSize, outerHeader.UncompressedStreamSize, FileAccess.ReadWrite);
try
@ -373,7 +377,7 @@ namespace ARMeilleure.Translation.PTC
}
finally
{
if (intPtr != IntPtr.Zero)
if (intPtr != nint.Zero)
{
Marshal.FreeHGlobal(intPtr);
}
@ -455,11 +459,11 @@ namespace ARMeilleure.Translation.PTC
outerHeader.SetHeaderHash();
IntPtr intPtr = IntPtr.Zero;
nint intPtr = nint.Zero;
try
{
intPtr = Marshal.AllocHGlobal(new IntPtr(outerHeader.UncompressedStreamSize));
intPtr = Marshal.AllocHGlobal(new nint(outerHeader.UncompressedStreamSize));
using UnmanagedMemoryStream stream = new((byte*)intPtr.ToPointer(), outerHeader.UncompressedStreamSize, outerHeader.UncompressedStreamSize, FileAccess.ReadWrite);
stream.Seek((long)Unsafe.SizeOf<InnerHeader>(), SeekOrigin.Begin);
@ -513,7 +517,7 @@ namespace ARMeilleure.Translation.PTC
}
finally
{
if (intPtr != IntPtr.Zero)
if (intPtr != nint.Zero)
{
Marshal.FreeHGlobal(intPtr);
}
@ -664,7 +668,7 @@ namespace ARMeilleure.Translation.PTC
foreach (RelocEntry relocEntry in relocEntries)
{
IntPtr? imm = null;
nint? imm = null;
Symbol symbol = relocEntry.Symbol;
if (symbol.Type == SymbolType.FunctionTable)
@ -675,7 +679,7 @@ namespace ARMeilleure.Translation.PTC
{
unsafe
{
imm = (IntPtr)Unsafe.AsPointer(ref translator.FunctionTable.GetValue(guestAddress));
imm = (nint)Unsafe.AsPointer(ref translator.FunctionTable.GetValue(guestAddress));
}
}
}
@ -683,7 +687,7 @@ namespace ARMeilleure.Translation.PTC
{
int index = (int)symbol.Value;
if (Delegates.TryGetDelegateFuncPtrByIndex(index, out IntPtr funcPtr))
if (Delegates.TryGetDelegateFuncPtrByIndex(index, out nint funcPtr))
{
imm = funcPtr;
}
@ -698,13 +702,17 @@ namespace ARMeilleure.Translation.PTC
unsafe
{
imm = (IntPtr)Unsafe.AsPointer(ref callCounter.Value);
imm = (nint)Unsafe.AsPointer(ref callCounter.Value);
}
}
else if (symbol == DispatchStubSymbol)
{
imm = translator.Stubs.DispatchStub;
}
else if (symbol == FunctionTableSymbol)
{
imm = translator.FunctionTable.Base;
}
if (imm == null)
{
@ -744,7 +752,7 @@ namespace ARMeilleure.Translation.PTC
bool highCq)
{
var cFunc = new CompiledFunction(code, unwindInfo, RelocInfo.Empty);
var gFunc = cFunc.MapWithPointer<GuestFunction>(out IntPtr gFuncPointer);
var gFunc = cFunc.MapWithPointer<GuestFunction>(out nint gFuncPointer);
return new TranslatedFunction(gFunc, gFuncPointer, callCounter, guestSize, highCq);
}
@ -848,17 +856,15 @@ namespace ARMeilleure.Translation.PTC
}
}
List<Thread> threads = new();
for (int i = 0; i < degreeOfParallelism; i++)
{
Thread thread = new(TranslateFuncs)
{
IsBackground = true,
};
threads.Add(thread);
}
List<Thread> threads = Enumerable.Range(0, degreeOfParallelism)
.Select(idx =>
new Thread(TranslateFuncs)
{
IsBackground = true,
Name = "Ptc.TranslateThread." + idx
}
).ToList();
Stopwatch sw = Stopwatch.StartNew();
@ -885,6 +891,7 @@ namespace ARMeilleure.Translation.PTC
Thread preSaveThread = new(PreSave)
{
IsBackground = true,
Name = "Ptc.DiskWriter"
};
preSaveThread.Start();
}

View File

@ -7,12 +7,12 @@ namespace ARMeilleure.Translation
{
private readonly GuestFunction _func; // Ensure that this delegate will not be garbage collected.
public IntPtr FuncPointer { get; }
public nint FuncPointer { get; }
public Counter<uint> CallCounter { get; }
public ulong GuestSize { get; }
public bool HighCq { get; }
public TranslatedFunction(GuestFunction func, IntPtr funcPointer, Counter<uint> callCounter, ulong guestSize, bool highCq)
public TranslatedFunction(GuestFunction func, nint funcPointer, Counter<uint> callCounter, ulong guestSize, bool highCq)
{
_func = func;
FuncPointer = funcPointer;

View File

@ -22,33 +22,13 @@ namespace ARMeilleure.Translation
{
public class Translator
{
private static readonly AddressTable<ulong>.Level[] _levels64Bit =
new AddressTable<ulong>.Level[]
{
new(31, 17),
new(23, 8),
new(15, 8),
new( 7, 8),
new( 2, 5),
};
private static readonly AddressTable<ulong>.Level[] _levels32Bit =
new AddressTable<ulong>.Level[]
{
new(31, 17),
new(23, 8),
new(15, 8),
new( 7, 8),
new( 1, 6),
};
private readonly IJitMemoryAllocator _allocator;
private readonly ConcurrentQueue<KeyValuePair<ulong, TranslatedFunction>> _oldFuncs;
private readonly Ptc _ptc;
internal TranslatorCache<TranslatedFunction> Functions { get; }
internal AddressTable<ulong> FunctionTable { get; }
internal IAddressTable<ulong> FunctionTable { get; }
internal EntryTable<uint> CountTable { get; }
internal TranslatorStubs Stubs { get; }
internal TranslatorQueue Queue { get; }
@ -57,7 +37,7 @@ namespace ARMeilleure.Translation
private Thread[] _backgroundTranslationThreads;
private volatile int _threadCount;
public Translator(IJitMemoryAllocator allocator, IMemoryManager memory, bool for64Bits)
public Translator(IJitMemoryAllocator allocator, IMemoryManager memory, IAddressTable<ulong> functionTable)
{
_allocator = allocator;
Memory = memory;
@ -72,15 +52,15 @@ namespace ARMeilleure.Translation
CountTable = new EntryTable<uint>();
Functions = new TranslatorCache<TranslatedFunction>();
FunctionTable = new AddressTable<ulong>(for64Bits ? _levels64Bit : _levels32Bit);
FunctionTable = functionTable;
Stubs = new TranslatorStubs(FunctionTable);
FunctionTable.Fill = (ulong)Stubs.SlowDispatchStub;
}
public IPtcLoadState LoadDiskCache(string titleIdText, string displayVersion, bool enabled)
public IPtcLoadState LoadDiskCache(string titleIdText, string displayVersion, bool enabled, string cacheSelector)
{
_ptc.Initialize(titleIdText, displayVersion, enabled, Memory.Type);
_ptc.Initialize(titleIdText, displayVersion, enabled, Memory.Type, cacheSelector);
return _ptc;
}
@ -298,7 +278,7 @@ namespace ARMeilleure.Translation
_ptc.WriteCompiledFunction(address, funcSize, hash, highCq, compiledFunc);
}
GuestFunction func = compiledFunc.MapWithPointer<GuestFunction>(out IntPtr funcPointer);
GuestFunction func = compiledFunc.MapWithPointer<GuestFunction>(out nint funcPointer);
Allocators.ResetAll();

View File

@ -15,12 +15,12 @@ namespace ARMeilleure.Translation
/// </summary>
class TranslatorStubs : IDisposable
{
private readonly Lazy<IntPtr> _slowDispatchStub;
private readonly Lazy<nint> _slowDispatchStub;
private bool _disposed;
private readonly AddressTable<ulong> _functionTable;
private readonly Lazy<IntPtr> _dispatchStub;
private readonly IAddressTable<ulong> _functionTable;
private readonly Lazy<nint> _dispatchStub;
private readonly Lazy<DispatcherFunction> _dispatchLoop;
private readonly Lazy<WrapperFunction> _contextWrapper;
@ -28,7 +28,7 @@ namespace ARMeilleure.Translation
/// Gets the dispatch stub.
/// </summary>
/// <exception cref="ObjectDisposedException"><see cref="TranslatorStubs"/> instance was disposed</exception>
public IntPtr DispatchStub
public nint DispatchStub
{
get
{
@ -42,7 +42,7 @@ namespace ARMeilleure.Translation
/// Gets the slow dispatch stub.
/// </summary>
/// <exception cref="ObjectDisposedException"><see cref="TranslatorStubs"/> instance was disposed</exception>
public IntPtr SlowDispatchStub
public nint SlowDispatchStub
{
get
{
@ -86,7 +86,7 @@ namespace ARMeilleure.Translation
/// </summary>
/// <param name="functionTable">Function table used to store pointers to the functions that the guest code will call</param>
/// <exception cref="ArgumentNullException"><paramref name="translator"/> is null</exception>
public TranslatorStubs(AddressTable<ulong> functionTable)
public TranslatorStubs(IAddressTable<ulong> functionTable)
{
ArgumentNullException.ThrowIfNull(functionTable);
@ -140,7 +140,7 @@ namespace ARMeilleure.Translation
/// Generates a <see cref="DispatchStub"/>.
/// </summary>
/// <returns>Generated <see cref="DispatchStub"/></returns>
private IntPtr GenerateDispatchStub()
private nint GenerateDispatchStub()
{
var context = new EmitterContext();
@ -198,7 +198,7 @@ namespace ARMeilleure.Translation
/// Generates a <see cref="SlowDispatchStub"/>.
/// </summary>
/// <returns>Generated <see cref="SlowDispatchStub"/></returns>
private IntPtr GenerateSlowDispatchStub()
private nint GenerateSlowDispatchStub()
{
var context = new EmitterContext();

View File

@ -9,7 +9,7 @@ namespace ARMeilleure.Translation
{
public static class TranslatorTestMethods
{
public delegate int FpFlagsPInvokeTest(IntPtr managedMethod);
public delegate int FpFlagsPInvokeTest(nint managedMethod);
private static bool SetPlatformFtz(EmitterContext context, bool ftz)
{

View File

@ -41,7 +41,7 @@ namespace Ryujinx.Audio.Backends.OpenAL
public OpenALHardwareDeviceDriver()
{
_device = ALC.OpenDevice("");
_device = ALC.OpenDevice(string.Empty);
_context = ALC.CreateContext(_device, new ALContextAttributes());
_updateRequiredEvent = new ManualResetEvent(false);
_pauseEvent = new ManualResetEvent(true);

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>

View File

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>

View File

@ -26,7 +26,7 @@ namespace Ryujinx.Audio.Backends.SDL2
// NOTE: We use a DllImport here because of marshaling issue for spec.
#pragma warning disable SYSLIB1054
[DllImport("SDL2")]
private static extern int SDL_GetDefaultAudioInfo(IntPtr name, out SDL_AudioSpec spec, int isCapture);
private static extern int SDL_GetDefaultAudioInfo(nint name, out SDL_AudioSpec spec, int isCapture);
#pragma warning restore SYSLIB1054
public SDL2HardwareDeviceDriver()
@ -37,7 +37,7 @@ namespace Ryujinx.Audio.Backends.SDL2
SDL2Driver.Instance.Initialize();
int res = SDL_GetDefaultAudioInfo(IntPtr.Zero, out var spec, 0);
int res = SDL_GetDefaultAudioInfo(nint.Zero, out var spec, 0);
if (res != 0)
{
@ -136,7 +136,7 @@ namespace Ryujinx.Audio.Backends.SDL2
desired.callback = callback;
uint device = SDL_OpenAudioDevice(IntPtr.Zero, 0, ref desired, out SDL_AudioSpec got, 0);
uint device = SDL_OpenAudioDevice(nint.Zero, 0, ref desired, out SDL_AudioSpec got, 0);
if (device == 0)
{

View File

@ -72,7 +72,7 @@ namespace Ryujinx.Audio.Backends.SDL2
}
}
private unsafe void Update(IntPtr userdata, IntPtr stream, int streamLength)
private unsafe void Update(nint userdata, nint stream, int streamLength)
{
Span<byte> streamSpan = new((void*)stream, streamLength);
@ -97,7 +97,7 @@ namespace Ryujinx.Audio.Backends.SDL2
fixed (byte* p = samples)
{
IntPtr pStreamSrc = (IntPtr)p;
nint pStreamSrc = (nint)p;
// Zero the dest buffer
streamSpan.Clear();

View File

@ -10,41 +10,41 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
private const string LibraryName = "libsoundio";
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void OnDeviceChangeNativeDelegate(IntPtr ctx);
public delegate void OnDeviceChangeNativeDelegate(nint ctx);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void OnBackendDisconnectedDelegate(IntPtr ctx, SoundIoError err);
public delegate void OnBackendDisconnectedDelegate(nint ctx, SoundIoError err);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void OnEventsSignalDelegate(IntPtr ctx);
public delegate void OnEventsSignalDelegate(nint ctx);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void EmitRtPrioWarningDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void JackCallbackDelegate(IntPtr msg);
public delegate void JackCallbackDelegate(nint msg);
[StructLayout(LayoutKind.Sequential)]
public struct SoundIoStruct
{
public IntPtr UserData;
public IntPtr OnDeviceChange;
public IntPtr OnBackendDisconnected;
public IntPtr OnEventsSignal;
public nint UserData;
public nint OnDeviceChange;
public nint OnBackendDisconnected;
public nint OnEventsSignal;
public SoundIoBackend CurrentBackend;
public IntPtr ApplicationName;
public IntPtr EmitRtPrioWarning;
public IntPtr JackInfoCallback;
public IntPtr JackErrorCallback;
public nint ApplicationName;
public nint EmitRtPrioWarning;
public nint JackInfoCallback;
public nint JackErrorCallback;
}
public struct SoundIoChannelLayout
{
public IntPtr Name;
public nint Name;
public int ChannelCount;
public Array24<SoundIoChannelId> Channels;
public static IntPtr GetDefault(int channelCount)
public static nint GetDefault(int channelCount)
{
return soundio_channel_layout_get_default(channelCount);
}
@ -63,17 +63,17 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public struct SoundIoDevice
{
public IntPtr SoundIo;
public IntPtr Id;
public IntPtr Name;
public nint SoundIo;
public nint Id;
public nint Name;
public SoundIoDeviceAim Aim;
public IntPtr Layouts;
public nint Layouts;
public int LayoutCount;
public SoundIoChannelLayout CurrentLayout;
public IntPtr Formats;
public nint Formats;
public int FormatCount;
public SoundIoFormat CurrentFormat;
public IntPtr SampleRates;
public nint SampleRates;
public int SampleRateCount;
public int SampleRateCurrent;
public double SoftwareLatencyMin;
@ -86,17 +86,17 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public struct SoundIoOutStream
{
public IntPtr Device;
public nint Device;
public SoundIoFormat Format;
public int SampleRate;
public SoundIoChannelLayout Layout;
public double SoftwareLatency;
public float Volume;
public IntPtr UserData;
public IntPtr WriteCallback;
public IntPtr UnderflowCallback;
public IntPtr ErrorCallback;
public IntPtr Name;
public nint UserData;
public nint WriteCallback;
public nint UnderflowCallback;
public nint ErrorCallback;
public nint Name;
public bool NonTerminalHint;
public int BytesPerFrame;
public int BytesPerSample;
@ -105,74 +105,74 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public struct SoundIoChannelArea
{
public IntPtr Pointer;
public nint Pointer;
public int Step;
}
[LibraryImport(LibraryName)]
internal static partial IntPtr soundio_create();
internal static partial nint soundio_create();
[LibraryImport(LibraryName)]
internal static partial SoundIoError soundio_connect(IntPtr ctx);
internal static partial SoundIoError soundio_connect(nint ctx);
[LibraryImport(LibraryName)]
internal static partial void soundio_disconnect(IntPtr ctx);
internal static partial void soundio_disconnect(nint ctx);
[LibraryImport(LibraryName)]
internal static partial void soundio_flush_events(IntPtr ctx);
internal static partial void soundio_flush_events(nint ctx);
[LibraryImport(LibraryName)]
internal static partial int soundio_output_device_count(IntPtr ctx);
internal static partial int soundio_output_device_count(nint ctx);
[LibraryImport(LibraryName)]
internal static partial int soundio_default_output_device_index(IntPtr ctx);
internal static partial int soundio_default_output_device_index(nint ctx);
[LibraryImport(LibraryName)]
internal static partial IntPtr soundio_get_output_device(IntPtr ctx, int index);
internal static partial nint soundio_get_output_device(nint ctx, int index);
[LibraryImport(LibraryName)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool soundio_device_supports_format(IntPtr devCtx, SoundIoFormat format);
internal static partial bool soundio_device_supports_format(nint devCtx, SoundIoFormat format);
[LibraryImport(LibraryName)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool soundio_device_supports_layout(IntPtr devCtx, IntPtr layout);
internal static partial bool soundio_device_supports_layout(nint devCtx, nint layout);
[LibraryImport(LibraryName)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool soundio_device_supports_sample_rate(IntPtr devCtx, int sampleRate);
internal static partial bool soundio_device_supports_sample_rate(nint devCtx, int sampleRate);
[LibraryImport(LibraryName)]
internal static partial IntPtr soundio_outstream_create(IntPtr devCtx);
internal static partial nint soundio_outstream_create(nint devCtx);
[LibraryImport(LibraryName)]
internal static partial SoundIoError soundio_outstream_open(IntPtr outStreamCtx);
internal static partial SoundIoError soundio_outstream_open(nint outStreamCtx);
[LibraryImport(LibraryName)]
internal static partial SoundIoError soundio_outstream_start(IntPtr outStreamCtx);
internal static partial SoundIoError soundio_outstream_start(nint outStreamCtx);
[LibraryImport(LibraryName)]
internal static partial SoundIoError soundio_outstream_begin_write(IntPtr outStreamCtx, IntPtr areas, IntPtr frameCount);
internal static partial SoundIoError soundio_outstream_begin_write(nint outStreamCtx, nint areas, nint frameCount);
[LibraryImport(LibraryName)]
internal static partial SoundIoError soundio_outstream_end_write(IntPtr outStreamCtx);
internal static partial SoundIoError soundio_outstream_end_write(nint outStreamCtx);
[LibraryImport(LibraryName)]
internal static partial SoundIoError soundio_outstream_pause(IntPtr devCtx, [MarshalAs(UnmanagedType.Bool)] bool pause);
internal static partial SoundIoError soundio_outstream_pause(nint devCtx, [MarshalAs(UnmanagedType.Bool)] bool pause);
[LibraryImport(LibraryName)]
internal static partial SoundIoError soundio_outstream_set_volume(IntPtr devCtx, double volume);
internal static partial SoundIoError soundio_outstream_set_volume(nint devCtx, double volume);
[LibraryImport(LibraryName)]
internal static partial void soundio_outstream_destroy(IntPtr streamCtx);
internal static partial void soundio_outstream_destroy(nint streamCtx);
[LibraryImport(LibraryName)]
internal static partial void soundio_destroy(IntPtr ctx);
internal static partial void soundio_destroy(nint ctx);
[LibraryImport(LibraryName)]
internal static partial IntPtr soundio_channel_layout_get_default(int channelCount);
internal static partial nint soundio_channel_layout_get_default(int channelCount);
[LibraryImport(LibraryName)]
internal static partial IntPtr soundio_strerror(SoundIoError err);
internal static partial nint soundio_strerror(SoundIoError err);
}
}

View File

@ -8,13 +8,13 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
{
public class SoundIoContext : IDisposable
{
private IntPtr _context;
private nint _context;
private Action<SoundIoError> _onBackendDisconnect;
private OnBackendDisconnectedDelegate _onBackendDisconnectNative;
public IntPtr Context => _context;
public nint Context => _context;
internal SoundIoContext(IntPtr context)
internal SoundIoContext(nint context)
{
_context = context;
_onBackendDisconnect = null;
@ -60,9 +60,9 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public SoundIoDeviceContext GetOutputDevice(int index)
{
IntPtr deviceContext = soundio_get_output_device(_context, index);
nint deviceContext = soundio_get_output_device(_context, index);
if (deviceContext == IntPtr.Zero)
if (deviceContext == nint.Zero)
{
return null;
}
@ -72,9 +72,9 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public static SoundIoContext Create()
{
IntPtr context = soundio_create();
nint context = soundio_create();
if (context == IntPtr.Zero)
if (context == nint.Zero)
{
return null;
}
@ -84,9 +84,9 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
protected virtual void Dispose(bool disposing)
{
IntPtr currentContext = Interlocked.Exchange(ref _context, IntPtr.Zero);
nint currentContext = Interlocked.Exchange(ref _context, nint.Zero);
if (currentContext != IntPtr.Zero)
if (currentContext != nint.Zero)
{
soundio_destroy(currentContext);
}

View File

@ -7,11 +7,11 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
{
public class SoundIoDeviceContext
{
private readonly IntPtr _context;
private readonly nint _context;
public IntPtr Context => _context;
public nint Context => _context;
internal SoundIoDeviceContext(IntPtr context)
internal SoundIoDeviceContext(nint context)
{
_context = context;
}
@ -36,9 +36,9 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public SoundIoOutStreamContext CreateOutStream()
{
IntPtr context = soundio_outstream_create(_context);
nint context = soundio_outstream_create(_context);
if (context == IntPtr.Zero)
if (context == nint.Zero)
{
return null;
}

View File

@ -8,19 +8,19 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public class SoundIoOutStreamContext : IDisposable
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private unsafe delegate void WriteCallbackDelegate(IntPtr ctx, int frameCountMin, int frameCountMax);
private unsafe delegate void WriteCallbackDelegate(nint ctx, int frameCountMin, int frameCountMax);
private IntPtr _context;
private IntPtr _nameStored;
private nint _context;
private nint _nameStored;
private Action<int, int> _writeCallback;
private WriteCallbackDelegate _writeCallbackNative;
public IntPtr Context => _context;
public nint Context => _context;
internal SoundIoOutStreamContext(IntPtr context)
internal SoundIoOutStreamContext(nint context)
{
_context = context;
_nameStored = IntPtr.Zero;
_nameStored = nint.Zero;
_writeCallback = null;
_writeCallbackNative = null;
}
@ -40,7 +40,7 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
{
var context = GetOutContext();
if (_nameStored != IntPtr.Zero && context.Name == _nameStored)
if (_nameStored != nint.Zero && context.Name == _nameStored)
{
Marshal.FreeHGlobal(_nameStored);
}
@ -124,14 +124,14 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
public Span<SoundIoChannelArea> BeginWrite(ref int frameCount)
{
IntPtr arenas = default;
nint arenas = default;
int nativeFrameCount = frameCount;
unsafe
{
var frameCountPtr = &nativeFrameCount;
var arenasPtr = &arenas;
CheckError(soundio_outstream_begin_write(_context, (IntPtr)arenasPtr, (IntPtr)frameCountPtr));
CheckError(soundio_outstream_begin_write(_context, (nint)arenasPtr, (nint)frameCountPtr));
frameCount = *frameCountPtr;
@ -143,10 +143,10 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
protected virtual void Dispose(bool disposing)
{
if (_context != IntPtr.Zero)
if (_context != nint.Zero)
{
soundio_outstream_destroy(_context);
_context = IntPtr.Zero;
_context = nint.Zero;
}
}

View File

@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>

View File

@ -81,7 +81,7 @@ namespace Ryujinx.Audio.Renderer.Dsp
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static short GetCoefficientAtIndex(ReadOnlySpan<short> coefficients, int index)
{
if ((uint)index > (uint)coefficients.Length)
if ((uint)index >= (uint)coefficients.Length)
{
Logger.Error?.Print(LogClass.AudioRenderer, $"Out of bound read for coefficient at index {index}");

View File

@ -64,11 +64,11 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe IntPtr GetBufferPointer(int index)
public unsafe nint GetBufferPointer(int index)
{
if (index >= 0 && index < _buffersEntryCount)
{
return (IntPtr)((float*)_buffersMemoryHandle.Pointer + index * _sampleCount);
return (nint)((float*)_buffersMemoryHandle.Pointer + index * _sampleCount);
}
throw new ArgumentOutOfRangeException(nameof(index), index, null);

View File

@ -82,8 +82,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
statistics.Reset(_parameter.ChannelCount);
}
Span<IntPtr> inputBuffers = stackalloc IntPtr[_parameter.ChannelCount];
Span<IntPtr> outputBuffers = stackalloc IntPtr[_parameter.ChannelCount];
Span<nint> inputBuffers = stackalloc nint[_parameter.ChannelCount];
Span<nint> outputBuffers = stackalloc nint[_parameter.ChannelCount];
Span<float> channelInput = stackalloc float[_parameter.ChannelCount];
ExponentialMovingAverage inputMovingAverage = state.InputMovingAverage;
float unknown4 = state.Unknown4;

View File

@ -77,7 +77,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private unsafe void ProcessDelayStereo(ref DelayState state, Span<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private unsafe void ProcessDelayStereo(ref DelayState state, Span<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
const ushort ChannelCount = 2;
@ -114,7 +114,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private unsafe void ProcessDelayQuadraphonic(ref DelayState state, Span<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private unsafe void ProcessDelayQuadraphonic(ref DelayState state, Span<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
const ushort ChannelCount = 4;
@ -160,7 +160,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private unsafe void ProcessDelaySurround(ref DelayState state, Span<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private unsafe void ProcessDelaySurround(ref DelayState state, Span<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
const ushort ChannelCount = 6;
@ -219,8 +219,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
if (IsEffectEnabled && Parameter.IsChannelCountValid())
{
Span<IntPtr> inputBuffers = stackalloc IntPtr[Parameter.ChannelCount];
Span<IntPtr> outputBuffers = stackalloc IntPtr[Parameter.ChannelCount];
Span<nint> inputBuffers = stackalloc nint[Parameter.ChannelCount];
Span<nint> outputBuffers = stackalloc nint[Parameter.ChannelCount];
for (int i = 0; i < Parameter.ChannelCount; i++)
{

View File

@ -70,8 +70,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
if (IsEffectEnabled && _parameter.IsChannelCountValid())
{
Span<IntPtr> inputBuffers = stackalloc IntPtr[_parameter.ChannelCount];
Span<IntPtr> outputBuffers = stackalloc IntPtr[_parameter.ChannelCount];
Span<nint> inputBuffers = stackalloc nint[_parameter.ChannelCount];
Span<nint> outputBuffers = stackalloc nint[_parameter.ChannelCount];
for (int i = 0; i < _parameter.ChannelCount; i++)
{

View File

@ -88,8 +88,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
statistics.Reset();
}
Span<IntPtr> inputBuffers = stackalloc IntPtr[_parameter.ChannelCount];
Span<IntPtr> outputBuffers = stackalloc IntPtr[_parameter.ChannelCount];
Span<nint> inputBuffers = stackalloc nint[_parameter.ChannelCount];
Span<nint> outputBuffers = stackalloc nint[_parameter.ChannelCount];
for (int i = 0; i < _parameter.ChannelCount; i++)
{

View File

@ -71,30 +71,30 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverb3dMono(ref Reverb3dState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverb3dMono(ref Reverb3dState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverb3dGeneric(ref state, outputBuffers, inputBuffers, sampleCount, _outputEarlyIndicesTableMono, _targetEarlyDelayLineIndicesTableMono, _targetOutputFeedbackIndicesTableMono);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverb3dStereo(ref Reverb3dState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverb3dStereo(ref Reverb3dState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverb3dGeneric(ref state, outputBuffers, inputBuffers, sampleCount, _outputEarlyIndicesTableStereo, _targetEarlyDelayLineIndicesTableStereo, _targetOutputFeedbackIndicesTableStereo);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverb3dQuadraphonic(ref Reverb3dState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverb3dQuadraphonic(ref Reverb3dState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverb3dGeneric(ref state, outputBuffers, inputBuffers, sampleCount, _outputEarlyIndicesTableQuadraphonic, _targetEarlyDelayLineIndicesTableQuadraphonic, _targetOutputFeedbackIndicesTableQuadraphonic);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverb3dSurround(ref Reverb3dState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverb3dSurround(ref Reverb3dState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverb3dGeneric(ref state, outputBuffers, inputBuffers, sampleCount, _outputEarlyIndicesTableSurround, _targetEarlyDelayLineIndicesTableSurround, _targetOutputFeedbackIndicesTableSurround);
}
private unsafe void ProcessReverb3dGeneric(ref Reverb3dState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount, ReadOnlySpan<int> outputEarlyIndicesTable, ReadOnlySpan<int> targetEarlyDelayLineIndicesTable, ReadOnlySpan<int> targetOutputFeedbackIndicesTable)
private unsafe void ProcessReverb3dGeneric(ref Reverb3dState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount, ReadOnlySpan<int> outputEarlyIndicesTable, ReadOnlySpan<int> targetEarlyDelayLineIndicesTable, ReadOnlySpan<int> targetOutputFeedbackIndicesTable)
{
const int DelayLineSampleIndexOffset = 1;
@ -193,8 +193,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
if (IsEffectEnabled && Parameter.IsChannelCountValid())
{
Span<IntPtr> inputBuffers = stackalloc IntPtr[Parameter.ChannelCount];
Span<IntPtr> outputBuffers = stackalloc IntPtr[Parameter.ChannelCount];
Span<nint> inputBuffers = stackalloc nint[Parameter.ChannelCount];
Span<nint> outputBuffers = stackalloc nint[Parameter.ChannelCount];
for (int i = 0; i < Parameter.ChannelCount; i++)
{

View File

@ -77,7 +77,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverbMono(ref ReverbState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverbMono(ref ReverbState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverbGeneric(
ref state,
@ -91,7 +91,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverbStereo(ref ReverbState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverbStereo(ref ReverbState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverbGeneric(
ref state,
@ -105,7 +105,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverbQuadraphonic(ref ReverbState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverbQuadraphonic(ref ReverbState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverbGeneric(
ref state,
@ -119,7 +119,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ProcessReverbSurround(ref ReverbState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount)
private void ProcessReverbSurround(ref ReverbState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount)
{
ProcessReverbGeneric(
ref state,
@ -132,7 +132,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
_outputIndicesTableSurround);
}
private unsafe void ProcessReverbGeneric(ref ReverbState state, ReadOnlySpan<IntPtr> outputBuffers, ReadOnlySpan<IntPtr> inputBuffers, uint sampleCount, ReadOnlySpan<int> outputEarlyIndicesTable, ReadOnlySpan<int> targetEarlyDelayLineIndicesTable, ReadOnlySpan<int> targetOutputFeedbackIndicesTable, ReadOnlySpan<int> outputIndicesTable)
private unsafe void ProcessReverbGeneric(ref ReverbState state, ReadOnlySpan<nint> outputBuffers, ReadOnlySpan<nint> inputBuffers, uint sampleCount, ReadOnlySpan<int> outputEarlyIndicesTable, ReadOnlySpan<int> targetEarlyDelayLineIndicesTable, ReadOnlySpan<int> targetOutputFeedbackIndicesTable, ReadOnlySpan<int> outputIndicesTable)
{
bool isSurround = Parameter.ChannelCount == 6;
@ -223,8 +223,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
if (IsEffectEnabled && Parameter.IsChannelCountValid())
{
Span<IntPtr> inputBuffers = stackalloc IntPtr[Parameter.ChannelCount];
Span<IntPtr> outputBuffers = stackalloc IntPtr[Parameter.ChannelCount];
Span<nint> inputBuffers = stackalloc nint[Parameter.ChannelCount];
Span<nint> outputBuffers = stackalloc nint[Parameter.ChannelCount];
for (int i = 0; i < Parameter.ChannelCount; i++)
{

View File

@ -29,7 +29,7 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
private readonly unsafe ref MemoryPoolState MemoryPoolState => ref *_memoryPools;
public readonly unsafe bool HasMemoryPoolState => (IntPtr)_memoryPools != IntPtr.Zero;
public readonly unsafe bool HasMemoryPoolState => (nint)_memoryPools != nint.Zero;
/// <summary>
/// Create an new empty <see cref="AddressInfo"/>.

View File

@ -55,7 +55,7 @@ namespace Ryujinx.Audio.Renderer.Server.MemoryPool
[MarshalAs(UnmanagedType.I1)]
public bool IsUsed;
public static unsafe MemoryPoolState* Null => (MemoryPoolState*)IntPtr.Zero.ToPointer();
public static unsafe MemoryPoolState* Null => (MemoryPoolState*)nint.Zero.ToPointer();
/// <summary>
/// Create a new <see cref="MemoryPoolState"/> with the given <see cref="LocationType"/>.

View File

@ -65,7 +65,7 @@ namespace Ryujinx.Audio.Renderer.Server.Mix
/// <summary>
/// The effect processing order storage.
/// </summary>
private readonly IntPtr _effectProcessingOrderArrayPointer;
private readonly nint _effectProcessingOrderArrayPointer;
/// <summary>
/// The max element count that can be found in the effect processing order storage.
@ -123,7 +123,7 @@ namespace Ryujinx.Audio.Renderer.Server.Mix
{
get
{
if (_effectProcessingOrderArrayPointer == IntPtr.Zero)
if (_effectProcessingOrderArrayPointer == nint.Zero)
{
return Span<int>.Empty;
}
@ -153,7 +153,7 @@ namespace Ryujinx.Audio.Renderer.Server.Mix
unsafe
{
// SAFETY: safe as effectProcessingOrderArray comes from the work buffer memory that is pinned.
_effectProcessingOrderArrayPointer = (IntPtr)Unsafe.AsPointer(ref MemoryMarshal.GetReference(effectProcessingOrderArray.Span));
_effectProcessingOrderArrayPointer = (nint)Unsafe.AsPointer(ref MemoryMarshal.GetReference(effectProcessingOrderArray.Span));
}
EffectProcessingOrderArrayMaxCount = (uint)effectProcessingOrderArray.Length;

View File

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>

View File

@ -492,7 +492,7 @@ namespace Ryujinx.Common.Collections
Start = start;
End = end;
Max = end;
Values = [ new RangeNode<TKey, TValue>(start, end, value) ];
Values = [new RangeNode<TKey, TValue>(start, end, value)];
Parent = parent;
}
}

View File

@ -98,7 +98,7 @@ namespace Ryujinx.Common.Configuration
if (IsPathSymlink(BaseDirPath))
{
Logger.Warning?.Print(LogClass.Application, $"Application data directory is a symlink. This may be unintended.");
Logger.Warning?.Print(LogClass.Application, "Application data directory is a symlink. This may be unintended.");
}
SetupBasePaths();
@ -119,7 +119,7 @@ namespace Ryujinx.Common.Configuration
private static string SetUpLogsDir()
{
string logDir = "";
string logDir = string.Empty;
if (Mode == LaunchMode.Portable)
{
@ -148,7 +148,7 @@ namespace Ryujinx.Common.Configuration
catch
{
Logger.Warning?.Print(LogClass.Application, $"Logging directory could not be created '{logDir}'");
logDir = "";
logDir = string.Empty;
}
if (string.IsNullOrEmpty(logDir))
@ -179,7 +179,7 @@ namespace Ryujinx.Common.Configuration
catch
{
Logger.Warning?.Print(LogClass.Application, $"Logging directory could not be created '{logDir}'");
logDir = "";
logDir = string.Empty;
}
if (string.IsNullOrEmpty(logDir))

View File

@ -2,7 +2,7 @@ namespace Ryujinx.Common.Configuration.Hid
{
public class KeyboardHotkeys
{
public Key ToggleVsync { get; set; }
public Key ToggleVSyncMode { get; set; }
public Key Screenshot { get; set; }
public Key ShowUI { get; set; }
public Key Pause { get; set; }
@ -11,5 +11,7 @@ namespace Ryujinx.Common.Configuration.Hid
public Key ResScaleDown { get; set; }
public Key VolumeUp { get; set; }
public Key VolumeDown { get; set; }
public Key CustomVSyncIntervalIncrement { get; set; }
public Key CustomVSyncIntervalDecrement { get; set; }
}
}

View File

@ -3,6 +3,7 @@ namespace Ryujinx.Common.Configuration.Multiplayer
public enum MultiplayerMode
{
Disabled,
LdnRyu,
LdnMitm,
}
}

View File

@ -0,0 +1,9 @@
namespace Ryujinx.Common.Configuration
{
public enum VSyncMode
{
Switch,
Unbounded,
Custom
}
}

View File

@ -21,33 +21,33 @@ namespace Ryujinx.Common.GraphicsDriver
private const uint NvAPI_DRS_DestroySession_ID = 0x0DAD9CFF8;
[LibraryImport("nvapi64")]
private static partial IntPtr nvapi_QueryInterface(uint id);
private static partial nint nvapi_QueryInterface(uint id);
private delegate int NvAPI_InitializeDelegate();
private static NvAPI_InitializeDelegate NvAPI_Initialize;
private delegate int NvAPI_DRS_CreateSessionDelegate(out IntPtr handle);
private delegate int NvAPI_DRS_CreateSessionDelegate(out nint handle);
private static NvAPI_DRS_CreateSessionDelegate NvAPI_DRS_CreateSession;
private delegate int NvAPI_DRS_LoadSettingsDelegate(IntPtr handle);
private delegate int NvAPI_DRS_LoadSettingsDelegate(nint handle);
private static NvAPI_DRS_LoadSettingsDelegate NvAPI_DRS_LoadSettings;
private delegate int NvAPI_DRS_FindProfileByNameDelegate(IntPtr handle, NvapiUnicodeString profileName, out IntPtr profileHandle);
private delegate int NvAPI_DRS_FindProfileByNameDelegate(nint handle, NvapiUnicodeString profileName, out nint profileHandle);
private static NvAPI_DRS_FindProfileByNameDelegate NvAPI_DRS_FindProfileByName;
private delegate int NvAPI_DRS_CreateProfileDelegate(IntPtr handle, ref NvdrsProfile profileInfo, out IntPtr profileHandle);
private delegate int NvAPI_DRS_CreateProfileDelegate(nint handle, ref NvdrsProfile profileInfo, out nint profileHandle);
private static NvAPI_DRS_CreateProfileDelegate NvAPI_DRS_CreateProfile;
private delegate int NvAPI_DRS_CreateApplicationDelegate(IntPtr handle, IntPtr profileHandle, ref NvdrsApplicationV4 app);
private delegate int NvAPI_DRS_CreateApplicationDelegate(nint handle, nint profileHandle, ref NvdrsApplicationV4 app);
private static NvAPI_DRS_CreateApplicationDelegate NvAPI_DRS_CreateApplication;
private delegate int NvAPI_DRS_SetSettingDelegate(IntPtr handle, IntPtr profileHandle, ref NvdrsSetting setting);
private delegate int NvAPI_DRS_SetSettingDelegate(nint handle, nint profileHandle, ref NvdrsSetting setting);
private static NvAPI_DRS_SetSettingDelegate NvAPI_DRS_SetSetting;
private delegate int NvAPI_DRS_SaveSettingsDelegate(IntPtr handle);
private delegate int NvAPI_DRS_SaveSettingsDelegate(nint handle);
private static NvAPI_DRS_SaveSettingsDelegate NvAPI_DRS_SaveSettings;
private delegate int NvAPI_DRS_DestroySessionDelegate(IntPtr handle);
private delegate int NvAPI_DRS_DestroySessionDelegate(nint handle);
private static NvAPI_DRS_DestroySessionDelegate NvAPI_DRS_DestroySession;
private static bool _initialized;
@ -94,7 +94,7 @@ namespace Ryujinx.Common.GraphicsDriver
Check(NvAPI_Initialize());
Check(NvAPI_DRS_CreateSession(out IntPtr handle));
Check(NvAPI_DRS_CreateSession(out nint handle));
Check(NvAPI_DRS_LoadSettings(handle));
@ -121,8 +121,8 @@ namespace Ryujinx.Common.GraphicsDriver
};
application.AppName.Set("Ryujinx.exe");
application.UserFriendlyName.Set("Ryujinx");
application.Launcher.Set("");
application.FileInFolder.Set("");
application.Launcher.Set(string.Empty);
application.FileInFolder.Set(string.Empty);
Check(NvAPI_DRS_CreateApplication(handle, profileHandle, ref application));
}
@ -148,9 +148,9 @@ namespace Ryujinx.Common.GraphicsDriver
private static T NvAPI_Delegate<T>(uint id) where T : class
{
IntPtr ptr = nvapi_QueryInterface(id);
nint ptr = nvapi_QueryInterface(id);
if (ptr != IntPtr.Zero)
if (ptr != nint.Zero)
{
return Marshal.GetDelegateForFunctionPointer<T>(ptr);
}

View File

@ -4,8 +4,8 @@ using System.Diagnostics;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
// ReSharper disable InconsistentNaming
namespace Ryujinx.Common
@ -67,18 +67,198 @@ namespace Ryujinx.Common
private static ReadOnlySpan<byte> Xxh3KSecret =>
[
0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c,
0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f,
0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21,
0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c,
0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3,
0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8,
0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d,
0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64,
0xea, 0xc5, 0xac, 0x83, 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb,
0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e,
0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce,
0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e
0xb8,
0xfe,
0x6c,
0x39,
0x23,
0xa4,
0x4b,
0xbe,
0x7c,
0x01,
0x81,
0x2c,
0xf7,
0x21,
0xad,
0x1c,
0xde,
0xd4,
0x6d,
0xe9,
0x83,
0x90,
0x97,
0xdb,
0x72,
0x40,
0xa4,
0xa4,
0xb7,
0xb3,
0x67,
0x1f,
0xcb,
0x79,
0xe6,
0x4e,
0xcc,
0xc0,
0xe5,
0x78,
0x82,
0x5a,
0xd0,
0x7d,
0xcc,
0xff,
0x72,
0x21,
0xb8,
0x08,
0x46,
0x74,
0xf7,
0x43,
0x24,
0x8e,
0xe0,
0x35,
0x90,
0xe6,
0x81,
0x3a,
0x26,
0x4c,
0x3c,
0x28,
0x52,
0xbb,
0x91,
0xc3,
0x00,
0xcb,
0x88,
0xd0,
0x65,
0x8b,
0x1b,
0x53,
0x2e,
0xa3,
0x71,
0x64,
0x48,
0x97,
0xa2,
0x0d,
0xf9,
0x4e,
0x38,
0x19,
0xef,
0x46,
0xa9,
0xde,
0xac,
0xd8,
0xa8,
0xfa,
0x76,
0x3f,
0xe3,
0x9c,
0x34,
0x3f,
0xf9,
0xdc,
0xbb,
0xc7,
0xc7,
0x0b,
0x4f,
0x1d,
0x8a,
0x51,
0xe0,
0x4b,
0xcd,
0xb4,
0x59,
0x31,
0xc8,
0x9f,
0x7e,
0xc9,
0xd9,
0x78,
0x73,
0x64,
0xea,
0xc5,
0xac,
0x83,
0x34,
0xd3,
0xeb,
0xc3,
0xc5,
0x81,
0xa0,
0xff,
0xfa,
0x13,
0x63,
0xeb,
0x17,
0x0d,
0xdd,
0x51,
0xb7,
0xf0,
0xda,
0x49,
0xd3,
0x16,
0x55,
0x26,
0x29,
0xd4,
0x68,
0x9e,
0x2b,
0x16,
0xbe,
0x58,
0x7d,
0x47,
0xa1,
0xfc,
0x8f,
0xf8,
0xb8,
0xd1,
0x7a,
0xd0,
0x31,
0xce,
0x45,
0xcb,
0x3a,
0x8f,
0x95,
0x16,
0x04,
0x28,
0xaf,
0xd7,
0xfb,
0xca,
0xbb,
0x4b,
0x40,
0x7e
];
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -551,6 +731,6 @@ namespace Ryujinx.Common
};
}
#endregion
#endregion
}
}

View File

@ -72,5 +72,6 @@ namespace Ryujinx.Common.Logging
TamperMachine,
UI,
Vic,
XCIFileTrimmer
}
}

View File

@ -38,7 +38,7 @@ namespace Ryujinx.Common.Logging
{
if (_enabledClasses[(int)logClass])
{
Updated?.Invoke(null, new LogEventArgs(Level, _time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, "", message)));
Updated?.Invoke(null, new LogEventArgs(Level, _time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, string.Empty, message)));
}
}
@ -212,9 +212,7 @@ namespace Ryujinx.Common.Logging
foreach (var log in logs)
{
if (log.HasValue)
{
levels.Add(log.Value.Level);
}
}
return levels;
@ -233,6 +231,7 @@ namespace Ryujinx.Common.Logging
case LogLevel.AccessLog : AccessLog = enabled ? new Log(LogLevel.AccessLog) : new Log?(); break;
case LogLevel.Stub : Stub = enabled ? new Log(LogLevel.Stub) : new Log?(); break;
case LogLevel.Trace : Trace = enabled ? new Log(LogLevel.Trace) : new Log?(); break;
case LogLevel.Notice : break;
default: throw new ArgumentException("Unknown Log Level", nameof(logLevel));
#pragma warning restore IDE0055
}

View File

@ -30,10 +30,10 @@ namespace Ryujinx.Common.Logging.Targets
string ILogTarget.Name { get => _target.Name; }
public AsyncLogTargetWrapper(ILogTarget target)
: this(target, -1, AsyncLogTargetOverflowAction.Block)
: this(target, -1)
{ }
public AsyncLogTargetWrapper(ILogTarget target, int queueLimit, AsyncLogTargetOverflowAction overflowAction)
public AsyncLogTargetWrapper(ILogTarget target, int queueLimit = -1, AsyncLogTargetOverflowAction overflowAction = AsyncLogTargetOverflowAction.Block)
{
_target = target;
_messageQueue = new BlockingCollection<LogEventArgs>(queueLimit);

Some files were not shown because too many files have changed in this diff Show More