Commit graph

828 commits

Author SHA1 Message Date
emmauss 8dcfeb64a3
fix wrong contenttype (#553) 2018-12-30 15:36:35 +02:00
WilliamWsyHK 5b029ae7a2 System Language can be configurable. (#535) 2018-12-27 17:08:34 +02:00
Thomas Guillemard d8f2497f15 Fix issues with compressed NSO without a section (#548)
* Fix issues with compressed NSO without a section

Avoid trying to decompress something that doesn't exist

* don't use the lengths of the buffer directly
2018-12-22 15:42:48 -02:00
gdkchan 0039bb6394
Refactor SVC handler (#540)
* Refactor SVC handler

* Get rid of KernelErr

* Split kernel code files into multiple folders
2018-12-18 03:33:36 -02:00
Roderick Sieben 2e143365eb Optimized memory modified check (#538)
* Optimized memory modified check

This was initially in some cases more expensive than plainly sending the data. Now it should have way better performance.

* Small refactoring

* renamed InvalidAccessEventArgs
* Renamed PtPageBits

* Removed ValueRange(set)

They are currently unused and won't be likely to be used in the near future
2018-12-11 23:48:54 -02:00
emmauss f1529b1bc2
Fix homebrew input (#528)
* fix homebrew input
2018-12-07 22:59:38 +02:00
HorrorTroll 5b4382f459 Fix InitializeOld & add FinalizeOld, SetAndWaitOld, GetOld on mm:u (#521)
* Fix mm:u

* Align some missing

* Fix some uncorrect code
2018-12-07 13:19:10 -02:00
Alex Barney fb1d9493a3 Adjust naming conventions and general refactoring in HLE Project (#527)
* Rename enum fields

* Naming conventions

* Remove unneeded ".this"

* Remove unneeded semicolons

* Remove unused Usings

* Don't use var

* Remove unneeded enum underlying types

* Explicitly label class visibility

* Remove unneeded @ prefixes

* Remove unneeded commas

* Remove unneeded if expressions

* Method doesn't use unsafe code

* Remove unneeded casts

* Initialized objects don't need an empty constructor

* Remove settings from DotSettings

* Revert "Explicitly label class visibility"

This reverts commit ad5eb5787c.

* Small changes

* Revert external enum renaming

* Changes from feedback

* Apply previous refactorings to the merged code
2018-12-06 09:16:24 -02:00
gdkchan 3615a70cae
Revert "Adjust naming conventions and general refactoring in HLE Project (#490)" (#526)
This reverts commit 85dbb9559a.
2018-12-04 22:52:39 -02:00
Alex Barney 85dbb9559a Adjust naming conventions and general refactoring in HLE Project (#490)
* Rename enum fields

* Naming conventions

* Remove unneeded ".this"

* Remove unneeded semicolons

* Remove unused Usings

* Don't use var

* Remove unneeded enum underlying types

* Explicitly label class visibility

* Remove unneeded @ prefixes

* Remove unneeded commas

* Remove unneeded if expressions

* Method doesn't use unsafe code

* Remove unneeded casts

* Initialized objects don't need an empty constructor

* Remove settings from DotSettings

* Revert "Explicitly label class visibility"

This reverts commit ad5eb5787c.

* Small changes

* Revert external enum renaming

* Changes from feedback

* Remove unneeded property setters
2018-12-04 18:23:37 -02:00
gdkchan c86aacde76
NVDEC implementation using FFmpeg (#443)
* Initial nvdec implementation using FFmpeg

* Fix swapped channels on the video decoder and the G8R8 texture format

* Fix texture samplers not being set properly (regression)

* Rebased

* Remove unused code introduced on the rebase

* Add support for RGBA8 output format on the video image composer

* Correct spacing

* Some fixes for rebase and other tweaks

* Allow size mismatch on frame copy

* Get rid of GetHostAddress calls on VDec
2018-12-03 00:38:47 -02:00
jduncanator 9b22e8af5e Normalize all the line endings (#518) 2018-11-29 00:01:19 -02:00
gdkchan 00579927e4
Better process implementation (#491)
* Initial implementation of KProcess

* Some improvements to the memory manager, implement back guest stack trace printing

* Better GetInfo implementation, improve checking in some places with information from process capabilities

* Allow the cpu to read/write from the correct memory locations for accesses crossing a page boundary

* Change long -> ulong for address/size on memory related methods to avoid unnecessary casts

* Attempt at implementing ldr:ro with new KProcess

* Allow BSS with size 0 on ldr:ro

* Add checking for memory block slab heap usage, return errors if full, exit gracefully

* Use KMemoryBlockSize const from KMemoryManager

* Allow all methods to read from non-contiguous locations

* Fix for TransactParcelAuto

* Address PR feedback, additionally fix some small issues related to the KIP loader and implement SVCs GetProcessId, GetProcessList, GetSystemInfo, CreatePort and ManageNamedPort

* Fix wrong check for source pages count from page list on MapPhysicalMemory

* Fix some issues with UnloadNro on ldr:ro
2018-11-28 20:18:09 -02:00
Ac_K ea35b3d1b0 Clean LM string (#512)
* Update ILogger.cs

* Update ILogger.cs

remove optionnal args

* Change to interpolated strings
2018-11-21 04:27:18 -02:00
emmauss dc02ac08ca Support other switch controller types (#487)
* Make controllers modular, support changing controller type

* return readable events

* signal hid events

* fix style
2018-11-20 01:01:36 +01:00
emmauss 0c36835f6d fix typo (#509) 2018-11-19 10:04:33 +01:00
jduncanator 26e09474a9 ContentServices: Handle null LocationEntry Path in VerifyContentType (#506)
When `LocationEntry.ContentPath` is `null`, we can always return `false` as it can't possibly be a valid `ContentType`
2018-11-19 01:20:17 +01:00
emmauss fe8fbb6fb9 Implement ContentManager and related services (#438)
* Implement contentmanager and related services

* small changes

* read system firmware version from nand

* add pfs support, write directoryentry info for romfs files

* add file check in fsp-srv:8

* add support for open fs of internal files

* fix filename when accessing pfs

* use switch style paths for contentpath

* close nca after verifying type

* removed publishing profiles, align directory entry

* fix style

* lots of style fixes

* yasf(yet another style fix)

* yasf(yet another style fix) plus symbols

* enforce path check on every fs access

* change enum type to default

* fix typo
2018-11-18 17:37:41 -02:00
gdkchan d2bb458b51 Improved GPU command lists decoding (#499)
* Better implementation of the DMA pusher, misc fixes

* Remove some debug code

* Correct RGBX8 format

* Add support for linked Texture Sampler Control

* Attempt to fix upside down screen issue
2018-11-17 05:01:31 +01:00
gdkchan b833183ef6 HwOpus service implementation (#201)
* Started to implement the hwopus service

* Write outputs on decode method, some basic error handling

* Fix buffer size read from header and check

* Fix order of values
2018-11-17 04:36:49 +01:00
jduncanator 8275bc3c08 Implement libsoundio as an alternative audio backend (#406)
* Audio: Implement libsoundio as an alternative audio backend

libsoundio will be preferred over OpenAL if it is available on the machine. If neither are available, it will fallback to a dummy audio renderer that outputs no sound.

* Audio: Fix SoundIoRingBuffer documentation

* Audio: Unroll and optimize the audio write callback

Copying one sample at a time is slow, this unrolls the most common audio channel layouts and manually copies the bytes between source and destination. This is over 2x faster than calling CopyBlockUnaligned every sample.

* Audio: Optimize the write callback further

This dramatically reduces the audio buffer copy time. When the sample size is one of handled sample sizes the buffer copy operation is almost 10x faster than CopyBlockAligned.

This works by copying full samples at a time, rather than the individual bytes that make up the sample. This allows for 2x or 4x faster copy operations depending on sample size.

* Audio: Fix typo in Stereo write callback

* Audio: Fix Surround (5.1) audio write callback

* Audio: Update Documentation

* Audio: Use built-in Unsafe.SizeOf<T>()

Built-in `SizeOf<T>()` is 10x faster than our `TypeSize<T>` helper. This also helps reduce code surface area.

* Audio: Keep fixed buffer style consistent

* Audio: Address styling nits

* Audio: More style nits

* Audio: Add additional documentation

* Audio: Move libsoundio bindings internal

As per discussion, moving the libsoundio native bindings into Ryujinx.Audio

* Audio: Bump Target Framework back up to .NET Core 2.1

* Audio: Remove voice mixing optimizations.

Leaves Saturation optimizations in place.
2018-11-15 03:22:50 +01:00
Alex Barney 53e6664526 Update libhac. Load tickets from XCI files (#476) 2018-10-30 23:34:27 -03:00
Alex Barney 9cb57fb4bb Adjust naming conventions for Ryujinx and ChocolArm64 projects (#484)
* Change naming convention for Ryujinx project

* Change naming convention for ChocolArm64 project

* Fix NaN

* Remove unneeded this. from Ryujinx project

* Adjust naming from new PRs

* Name changes based on feedback

* How did this get removed?

* Rebasing fix

* Change FP enum case

* Remove prefix from ChocolArm64 classes - Part 1

* Remove prefix from ChocolArm64 classes - Part 2

* Fix alignment from last commit's renaming

* Rename namespaces

* Rename stragglers

* Fix alignment

* Rename OpCode class

* Missed a few

* Adjust alignment
2018-10-30 22:43:02 -03:00
jduncanator c1b7340023 Timing: Optimize Timestamp Aquisition (#479)
* Timing: Optimize Timestamp Aquisition

Currently, we make use of Environment.TickCount in a number of places. This has some downsides, mainly being that the TickCount is a signed 32-bit integer, and has an effective limit of ~25 days before overflowing and wrapping around. Due to the signed-ness of the value, this also caused issues with negative numbers. This resolves these issues by using a 64-bit tick count obtained from Performance Counters (via the Stopwatch class). This has a beneficial side effect of being significantly more accurate than the TickCount.

* Timing: Rename ElapsedTicks to ElapsedMilliseconds and expose TicksPerX

* Timing: Some style changes

* Timing: Align static variable initialization
2018-10-28 19:31:13 -03:00
Thomas Guillemard 19152def95 hid: Implement KEY_RSTICK_* & KEY_LSTICK_* (#466)
* hid: Implement KEY_RSTICK_* & KEY_LSTICK_*

* Fix KEY_RSTICK_UP
2018-10-27 18:36:49 +00:00
gdkchan 2fd23577ce
Move prio/core locals inside the lock on yield (#478) 2018-10-24 09:45:37 -03:00
Ac_K 7920dc1d2f Implement basic psm service (#467)
* Implement basic psm service

- Add `IPsmServer`
- Stub `GetBatteryChargePercentage` & `GetChargerType`

* Fix wrong sorting

* Add IPsmSession

- Add `IPsmSession` by Thog
- Implement `OpenSession`
2018-10-21 03:01:22 -03:00
Thomas Guillemard b5f7d8106b Complete rewrite of bsd IClient (#460)
This should provide accurate behaviours.
This implementation has been tested with ftpd and libtransistor bsd tests.

This implementation lacks OOB support.
2018-10-20 22:08:58 +00:00
gdkchan 2cb8541462 Print stack trace on invalid memory accesses (#461)
* Print stack trace on invalid memory accesses

* Rebased, change code region base address for 39-bits address space, print stack trace on break and undefined instructions too
2018-10-20 22:07:52 +00:00
gdkchan 0e1e094b7a
Improve texture tables (#457)
* Improve texture tables

* More renaming and other tweaks

* Minor tweaks
2018-10-17 18:02:23 -03:00
gdkchan 02a8e7fc93
Remove unnecessary usings (#463)
* Remove unnecessary usings

* Fix CastExpression while I'm at it
2018-10-17 14:55:10 -03:00
ReinUsesLisp b3a4662be1 Move logging to Ryujinx.Common and make it a static class (#413) 2018-10-17 14:15:50 -03:00
Thomas Guillemard 9b19ea3c87 Remove IFileSystem::OpenDirectory extraneous check (#459)
A directory can be open more than one time. This fix issues with
homebrews opening the same directory multiple time.
2018-10-16 23:55:10 +00:00
Thomas Guillemard ac1a379265 Fix some issues with UserId (#455) 2018-10-14 02:07:56 +00:00
Ac_K 3561062bc6 Update IAccountService and IManagerForApplication (#454)
* Update IAccountService and IManagerForApplication

`IAccountService`:
- Add symbols.
- Fix some mistake.
- Add `IsUserRegistrationRequestPermitted` and `TrySelectUserWithoutInteraction`.

`IManagerForApplication`:
- Add symbols.
- Add Uuid args.
- Little improvement of `GetAccountId`
2018-10-14 01:16:02 +02:00
Ac_K 824d4b74d0 Update UInt128.cs (#453)
Fix invalid Write implementation.
2018-10-13 23:29:49 +02:00
Thomas Guillemard b2063be597 Implement IResolver (#442)
* Implement IResolver

- GetAddrInfo & GetNameInfo still need to be implemented.

* Address comments

* Use MakeError
2018-10-10 01:15:07 +02:00
Thomas Guillemard d5c0de8362 Implement IRoInterface (#445)
* Implement IRoInterface

This is required by Super Mario Party.
This commit also adds MapProcessCodeMemory and UnmapProcessCodeMemory functions in KMemoryManager. Those two calls might not reflect what the SVC of the same names do.

* Fix some code style issues

* Use MakeError to clarify error code

* Add NRR and NRO constants

* Fix some codestyle issues

* Fix InvalidMemoryState error code
2018-10-10 01:01:49 +02:00
Thomas Guillemard 65c67bb4a5
Break: don't crash when bit 31 is set (#444) 2018-10-08 20:53:08 +02:00
emmauss 625fc8c0e0 Stubs Again (#439)
* stub/implement audren commands

* stub ISelfController get/set IdleTimeDetectonExtension

* stub irs

* add irs logclass, stub mmu:u irequest 1

* style fixes, addressed comments
2018-10-07 17:12:11 +02:00
emmauss caa181edf2 Save Common implementation (#434)
* save common implementation

* remove zero userid check

* Renamed UserId to UInt128

* fix index in hex conversion
2018-10-07 15:13:46 +02:00
Ac_K 5b8ccb717f Implement ISslContext (#440)
This PR implement an empty `ISslContext` and update `CreateContext` and `SetInterfaceVersion` inside `ISslService`
2018-10-07 00:16:42 +02:00
Alex Barney 5821ff675d Misc content loading improvements (#432)
* Misc content loading improvements
2018-10-06 18:11:47 +03:00
emmaus 0ada047eaf fix out of handles error 2018-09-28 10:47:53 +00:00
Ac_K 40282da93a Implement friend:a IFriendService: 10101 (#429)
* Implement friend:a IFriendService: 10101

* Update Profile Picture

* Update IFriendServiceTypes.cs

* Update IFriendServiceTypes.cs

* Update IFriendService.cs

* Update IFriendServiceTypes.cs

* Update IFriendServiceTypes.cs

* Update IFriendService.cs
2018-09-25 19:59:29 -03:00
ReinUsesLisp 2562ca6c3f Fix multiple rendertargets (#427)
* Simplify render target bindings

* Implement multiple viewports

* Pack glViewportIndexed calls into a single glViewportArray

* Use ARB_viewport_array when available

* Cache framebuffer attachments

* Use get accessors in OGLExtension

* Address feedback
2018-09-26 00:55:30 +02:00
gdkchan 7de7b559ad Improve kernel events implementation (#430)
* Improve kernel events implementation

* Some cleanup

* Address PR feedback
2018-09-23 20:11:46 +02:00
Ac_K a76660eac5
Fix IHidServer code style 2018-09-21 06:30:58 +02:00
Ac_K e77c1560e6 Full 5.X stubbed IHidServer (#428)
* Full 5.X stubbed IHidServer

Since we can't support all those Hid calls in the right way, we can stub them with more information as possible in the logs.
I have added all symbols in it to be more revelant as possible.
It's remove some Hid spam in few games too, because we assign some var as the game want.

* Fix issues

* Fix code according to review
2018-09-21 02:08:35 +02:00
gdkchan 6d65e53664
Remove cold methods from the CPU cache (#224)
* Remove unused tracing functionality from the CPU

* GetNsoExecutable -> GetExecutable

* Unsigned comparison

* Re-add cpu tracing

* Config change

* Remove cold methods from the translation cache on the cpu

* Replace lock with try lock, pass new ATranslatorCache instead of ATranslator

* Rebase fixups
2018-09-19 17:07:56 -03:00
gdkchan 99b2692425
Fix performance regression caused by the new scheduler changes (#422)
* Call interrupt less often, remove some leftovers from the old scheduler code

* Remove unneeded attribute
2018-09-19 12:16:20 -03:00
emmauss fae097408e Show Game Title on Titlebar (#408)
* support reading control data

* show game info on titlebar

* use first language is default is not available

* use seperate language enums for titles

* fix hex display
2018-09-19 14:09:49 +02:00
gdkchan b8133c1997
Thread scheduler rewrite (#393)
* Started to rewrite the thread scheduler

* Add a single core-like scheduling mode, enabled by default

* Clear exclusive monitor on context switch

* Add SetThreadActivity, misc fixes

* Implement WaitForAddress and SignalToAddress svcs, misc fixes

* Misc fixes (on SetActivity and Arbiter), other tweaks

* Rebased

* Add missing null check

* Rename multicore key on config, fix UpdatePriorityInheritance

* Make scheduling data MLQs private

* nit: Ordering
2018-09-18 20:36:43 -03:00
gdkchan d6fba62f8a
Misc fixes on the arena allocator (#364) 2018-09-18 12:28:28 -03:00
gdkchan d4187aaa9d
Allow "reinterpretation" of framebuffer/zeta formats (#418)
* (Re)Implement format reinterpretation, other changes

* Implement writeback to guest memory, some refactoring

* More refactoring, implement reinterpretation the old way again

* Clean up

* Some fixes on M2MF (old Dma engine), added partial support for P2MF, fix conditional ssy, add Z24S8 zeta format, other fixes

* nit: Formatting

* Address PR feedback
2018-09-18 01:30:35 -03:00
Thomas Guillemard 46a11460d4 Rewrite the C++ Demangler (#416)
* Rewrite the C++ Demangler

This new Demangler provides support to almost every possible mangled
symbols and should behaves like GNU c++filt.

It works on 98.9% of the sdk's symbols and 99.5%
of Puyo Puyo Tetris's symbols.

* Fix code style

* Fix noexcept enclosed expression parsing issues

* fix code style issues
2018-09-15 15:29:18 +02:00
Ac_K 476ebf5b03 Update IStorage.cs (#415)
Lock the stream fix a multithreading error when a XCI game try to access to the RomFs.
2018-09-13 13:45:59 +02:00
emmauss db1a759c59 Lock GbpQueueBuffer till Vsync is signalled (#367)
* Initial Framerate limit implementation

* use seperate event for limiter

* check for vsync signal after queue up framebuffer

* removed ingame toggle

* fix nits
2018-09-10 01:38:56 +02:00
emmauss fc77b089a6 Implements proper save path (#386)
* initial save path implementation

* fix savedatatype offset, remove incomplete createsavedata implimentation

* address nits

* fix crash if npdm is not found

* made saveinfo readonly, other stuff

* remove context param from saveinfo contructor

* fix style

* remove whitespace
2018-09-08 19:04:26 -03:00
Alex Barney 3227218114 Add XCI, NSP and NCA loading support (#404)
* Add XCI and NCA loading support

* Code style changes

* Add NSP loading

* Changes from code review

* Read XCIs with patches. Code style

* Add KEYS.md file

* Make file extension matching case-insensitive
2018-09-08 15:33:27 -03:00
ReinUsesLisp ce1d5be212 Move GPU emulation from Ryujinx.HLE to Ryujinx.Graphics and misc changes (#402)
* Move GPU LLE emulation from HLE to Graphics

* Graphics: Move Gal/Texture to Texture

* Remove Engines/ directory and namespace

* Use tables for image formats

* Abstract OpCode decoding

* Simplify image table

* Do not leak Read* symbols in TextureReader

* Fixups

* Rename IGalFrameBuffer -> IGalRenderTarget

* Remove MaxBpp hardcoded value

* Change yet again texture data and add G8R8 flipping

* Rename GalFrameBufferFormat to GalSurfaceFormat

* Unident EnsureSetup in ImageHandler

* Add IsCompressed

* Address some feedback
2018-09-08 14:51:50 -03:00
emmauss 675f3f6f81 Implement loading of profile image (#391)
* implement loading of profile image

* rename icon to profilepicture

* rename icon file
2018-09-01 19:04:20 -03:00
gdkchan b549daed03
Fix exception throw message for unimpl texture formats (#398) 2018-09-01 18:51:51 -03:00
HorrorTroll bf28d8f1aa Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format (#377)
* Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format

* Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format

* Revert "Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format"

This reverts commit aea5c9db3a.

* Conflicts fix

* Wrong fix

* E

* e
2018-09-01 18:25:49 -03:00
gdkchan 35778afef9
Improve handling on QueryGet on the gpu (#397) 2018-09-01 11:54:56 -03:00
HorrorTroll 27023e7afc Add R32_G32 texture format (#383) 2018-08-27 11:18:21 -03:00
ReinUsesLisp a42ab2e40c Implement vertex instancing (#381) 2018-08-25 01:16:58 -03:00
emmauss da7e702751 Update BSD service implementation (#363)
* Update BSD service to handle libnx's 'smart IPC buffers' for address info

* Use existing "GetBufferType0x21" for certain BSD socket methods

* Parse address port as unsigned short

* Fix bounds check on reading the IPC buffer

* Implement Read, Write methods

* rebased and cleaned

* addressed nits

* remove unused swap method

* fixed alignments
2018-08-24 14:20:42 -03:00
ReinUsesLisp 624e813cd3 Implement multiple rendertarget attachments and depth writting (#375)
* Add depth writting

* Implement multiple attachments

* Address feedback
2018-08-23 02:07:23 -03:00
gdkchan 9977acad0f
Fix BinarySearchLt to return less than rather than less than or equal value (#372) 2018-08-23 01:54:59 -03:00
ReinUsesLisp 1cd7aaf504 Avoid querying and setting texture bindings in hot code (#376) 2018-08-23 01:54:32 -03:00
Thomas Guillemard 57dfa09e3a Improve LM implementation (#373)
- Manage end of the log packet correctly.
- Add drop count, time, and program name parsing.
- Use the correct buffer type. (0x21 not 0x9)
- Prefix unknown fields with "Field"
2018-08-22 18:06:29 -03:00
Thomas Guillemard b08d889f95 SvcSetHeapSize: match kernel check for invalid size (#374)
This fix games like DK Country
2018-08-21 13:05:12 -03:00
ReinUsesLisp 726de8c46a Rendertarget attachments, texture and image changes (#358)
* Add multiple color outputs for fragment shaders

* Add registers and gal enums

* Use textures for framebuffers and split color and zeta framebuffers

* Abstract texture and framebuffer targets as an image

* Share images between framebuffers and textures

* Unstub formats

* Add some formats

* Disable multiple attachments

* Cache framebuffer attachments

* Handle format types

* Add some rendertarget formats

* Code cleanup

* Fixup half float types

* Address feedback

* Disable multiple attachments in shaders

* Add A4B4G4R4 image format

* Add reversed section for image enums
2018-08-19 22:25:26 -03:00
gdkchan 056c2840b1
Fix MapPhysicalMemory when block position is less than map position (#359)
* Fix MapPhysicalMemory when block position is less than map position

* Only try to free pages that are actually mapped

* Only unmap after freeing the memory
2018-08-17 10:39:35 -03:00
gdkchan 521751795a
Code style fixes and nits on the HLE project (#355)
* Some style fixes and nits on ITimeZoneService

* Remove some unneeded usings

* Remove the Ryujinx.HLE.OsHle.Handles namespace

* Remove hbmenu automatic load on process exit

* Rename Ns to Device, rename Os to System, rename SystemState to State

* Move Exceptions and Utilities out of OsHle

* Rename OsHle to HOS

* Rename OsHle folder to HOS

* IManagerDisplayService and ISystemDisplayService style fixes

* BsdError shouldn't be public

* Add a empty new line before using static

* Remove unused file

* Some style fixes on NPDM

* Exit gracefully when the application is closed

* Code style fixes on IGeneralService

* Add 0x prefix on values printed as hex

* Small improvements on finalization code

* Move ProcessId and ThreadId out of AThreadState

* Rename VFs to FileSystem

* FsAccessHeader shouldn't be public. Also fix file names casing

* More case changes on NPDM

* Remove unused files

* Move using to the correct place on NPDM

* Use properties on KernelAccessControlMmio

* Address PR feedback
2018-08-16 20:47:36 -03:00
gdkchan 182d716867
Remove artificial call count limit for EndGl (#357) 2018-08-16 20:45:00 -03:00
gdkchan c393cdf8e3
More flexible memory manager (#307)
* Keep track mapped buffers with fixed offsets

* Started rewriting the memory manager

* Initial support for MapPhysicalMemory and UnmapPhysicalMemory, other tweaks

* MapPhysicalMemory/UnmapPhysicalMemory support, other tweaks

* Rebased

* Optimize the map/unmap physical memory svcs

* Integrate shared font support

* Fix address space reserve alignment

* Some fixes related to gpu memory mapping

* Some cleanup

* Only try uploading const buffers that are really used

* Check if memory region is contiguous

* Rebased

* Add missing count increment on IsRegionModified

* Check for reads/writes outside of the address space, optimize translation with a tail call
2018-08-15 15:59:51 -03:00
emmauss 76d95dee05 Implement ITimeZone 201, 202 (#327)
* Implement ITimeZone 201, 202

* fix alignment

* fix array count

* fix mismatching datetime kind and timezone
2018-08-15 15:53:23 -03:00
ReinUsesLisp 0673dc183a Reset cache on command buffer execution instead of sync calls (#341)
Also resets const buffer cache on CbData calls.
Non-const buffer data might also change while a command buffer is
executing but that's very unlikely.
2018-08-14 22:27:05 -03:00
gdkchan 9ac5583513
Better support for user accounts (#349)
* Better support for user accounts

* Nits

* Check for invalid ids
2018-08-14 19:02:42 -03:00
emmauss 17f54b5d78 Implement IProfile Get and GetBase (#266)
* implement IProfile Get(Base)

* use default user

* changed userid
2018-08-13 21:13:01 -03:00
emmauss 6e48312052 Implement AcquireNpadStyleSetUpdate event (#306)
* implement get npad set event

* move npad style set event to hid service

* fix spacing

* change event to field

* dispose event
2018-08-13 18:31:09 -03:00
gdkchan 09593ae6d8
Add partial support to the TEX.B shader instruction (#342)
* Add partial support to the TEX.B shader instruction, fix for mixed indexed and non-indexed drawing

* Better exception
2018-08-13 18:22:09 -03:00
Unknown 1f983d981e fix DockedMode variable
delete unneeded spaces

fix DockedMode variable

fix DockedMode variable

change PerformanceMode cast to int
align ICommonStateGetter Commands
2018-08-11 15:31:34 +02:00
emmauss 8482e16dcc
Merge pull request #304 from emmauss/listdisplays
Implemented IApplicationDisplayService:ListDisplays
2018-08-11 15:32:56 +03:00
emmauss 402a143ae1
fix dock mode style issues 2018-08-11 12:24:55 +00:00
greggameplayer 1fd4311e12 Add the ability to set or not docked mode via config file (#227)
* Add a toggleable DockedMode bool
2018-08-11 15:12:28 +03:00
ReinUsesLisp 25dd5f4238 Low level graphics API prerequisites (#319)
* Add GalPipelineState and IGalPipeline

* Separate UploadVertex call

* Add ConstBuffer cache

* Move Vertex Assembly into GalPipelineState

* Move Uniform binds to GalPipelineState

* Move framebuffer flip into a buffer

* Rebase

* Fix regression

* Move clear values from VertexEndGl to ClearBuffers

* Rename obscure names O->Old S->New
2018-08-10 01:09:40 -03:00
greggameplayer 652238f526 Add SetScreenShotImageOrientation (#310)
* Add SetScreenShotImageOrientation

* add a stubbed print
2018-08-08 03:00:54 -03:00
gdkchan 0cec4cbee5
Fix race condition on IdDictionary (#333) 2018-08-07 23:32:24 -03:00
Thomas Guillemard eeb626947e Implement Shared Fonts (#215)
* Implement Shared Fonts

This fully implements shared fonts.
This commit is provided without fonts.
This commit also add Size to HSharedMem.Positions to be able to add fonts to shared zones when RequestLoad is called.

* Require the user to provide fonts in RyuFS/system

* Use File.Exits instead of relying ona try/catch and change system resource exception format a bit

* Make sure that font sum doesn't exceed 17MB

Also rename font data dictionary for coherence.
2018-08-04 18:38:49 -03:00
AboodMadridista c68bca5396 Use the more specific NotImplementedException type instead of just Exception (#322) 2018-08-02 21:58:48 -03:00
emmaus a9a2c0c2f5 moved metadata to process 2018-08-02 23:33:28 +03:00
emmauss d137405e94
Merge pull request #298 from Cyuubi/npdm
Add Npdm parsing into Ryujinx.HLE
2018-08-02 22:59:14 +03:00
greggameplayer ce96a45685 Implement A2B10G10R10 TextureFormat (#248)
* add A2B10G10R10 TextureFormat

* return correct PixelFormat & PixelType

* return correct texture size

* return correct Bytes Per Pixel
2018-07-29 01:41:02 -03:00
Starlet e07b0265c6 Add 5.0.0 IPCs (#300)
* Implement 5.0.0 IPC

* Align ControlWithContext
2018-07-29 01:40:02 -03:00
ReinUsesLisp 3208173620 Cache changes (#302)
* Skip repeated cache tests between same sync

* Skip some checks for regions where just one resource is resident

* Dehardcode residency page size

* Some cleanup
2018-07-29 01:39:15 -03:00
gdkchan fdda67d476
Some fix to IRequest on NIFM, support sending objects to services (#294) 2018-07-29 01:36:29 -03:00
emmaus 4a3ed0cec7 implemented ListDisplays 2018-07-24 21:38:55 +00:00
ReinUsesLisp 1344a47c77 Blit framebuffer without shaders (#229)
* Blit framebuffer without shaders

* De-hardcode native size values

* Adapt to dehardcoded framebuffers and address feedback

* Remove framebuffer rebinding
2018-07-23 16:21:05 +02:00
greggameplayer ed29982f9b Link BCAT:U & BCAT:A & BCAT:M & BCAT:S (#257)
* Link BCAT:U & BCAT:A & BCAT:M & BCAT:S

* delete unneeded using

* delete unneeded spaces

* delete unneeded using

* Add comment (1/2)

* Add comment (2/2)

* delete unneeded using
2018-07-23 16:20:16 +02:00
Ac_K ed075ae3cd
Update ITimeZoneService.cs
Fix typo
2018-07-22 19:38:29 +00:00
Starlet 4b8a65fd84 Add Npdm parsing into Ryujinx.HLE 2018-07-20 17:53:06 -04:00
Rygnus 241b46540d Stub AppletOE UnlockExit (#279)
* Implement AppletOE UnlockExit
2018-07-19 20:27:50 -03:00
ReinUsesLisp 5fe0bc584b Send data to OpenGL host without client-side copies (#285)
* Directly send host address to buffer data

* Cleanup OGLShader

* Directly copy vertex and index data too

* Revert shader bind "cache"

* Address feedback
2018-07-19 16:02:51 -03:00
Thomas Guillemard c9fc52edb6 Fix SystemPathToSwitchPath platform issues and make sure to delete temporary NRO after sessions dispose (#293) 2018-07-19 15:44:52 -03:00
gdkchan 60f2198a1e
Support deswizzle of sparse tiled textures and some frame buffer fixes (#275)
* Attempt to support deswizzle of sparse tiled textures

* Use correct frame buffer and viewport sizes, started to clean up the copy engine

* Correct texture width alignment

* Use Scale/Translate registers to calculate viewport rect

* Allow texture copy between frame buffers
2018-07-19 02:30:21 -03:00
Ac_K 8b685b12f0 Implement SvcWaitForAddress 0x34 (#289)
* Implement SvcWaitForAddress 0x34

Currently needed by Sonic Mania Plus

* Fix mistake

* read-decrement-write locked
2018-07-19 01:03:53 -03:00
Ac_K 6a69001aa2
Update IGeneralService.cs
Fixed little mistake on the debug string.
2018-07-19 03:10:51 +02:00
simonmkwii-dev 2795af038d Implement GetCurrentIpAddress() and stub GetCurrentNetworkProfile() (#271)
* Implement GetCurrentIpAddress()

...and stub GetCurrentNetworkProfile()

* Update IGeneralService.cs

* Actually implement it properly this time...

* <snip>

* Made some requested changes

* Added requested changes.

* Added more requested changes.

* oof

* Local > Address

* Cyuubumped

* Change PrintInfo > PrintDebug

* Revert change
2018-07-19 03:06:45 +02:00
greggameplayer 120fe6b74a Implement BF10GF11RF11 TextureFormat (#246)
* add BF10GF11RF11 TextureFormat

* return correct PixelFormat & PixelType

* return correct texture size

* return correct Bytes Per Pixel

* correct PixelType
2018-07-19 01:26:28 +02:00
greggameplayer 0a13900bc9 Implement Z24S8 TextureFormat (#247)
* add Z24S8 TextureFormat

* return correct PixelFormat & PixelType

* return correct texture size

* return correct Bytes Per Pixel

* Correct PixelType
2018-07-19 01:19:37 +02:00
emmauss 2236f4b2c3 Implement IFileSystem:CleanDirectoryRecursively (#283)
* implement ifilesys:cleandirectoryrecursively

* clean up Ifilesystem
2018-07-18 21:05:17 +02:00
gdkchan 98223b0e7d Fix wrong assignment and allow null FilePaths on Executable 2018-07-17 17:28:41 -03:00
Thomas Guillemard c2c765b30f hbabi: Implement argv (#272)
This commit implements the argv config key in Ryujinx (by creating a temporary copy of the homebrew executable in the sdmc VFS) to make it possible
to load libnx's "romfs" files.

This commit also call Os.Dispose in Ns.OnFinish to dispose all resources when exiting
2018-07-17 16:14:27 -03:00
greggameplayer e71da4fb74 Implement BC6H_SF16 & BC6H_UF16 Texture Formats (#255)
* Implement BC6H_SF16 & BC6H_UF16

* correct coding style (1/5)

* correct coding style (2/5)

* correct coding style (3/5)

* correct coding style (4/5)

* correct coding style (5/5)
2018-07-16 15:09:34 -03:00
gdkchan 50b706e2ba Fix RevMagic on audren 2018-07-15 00:42:59 -03:00
gdkchan a48ed788bf Remove outdated comment 2018-07-15 00:37:30 -03:00
gdkchan 8652dbb57c Small nit on GetAudioRendererWorkBufferSize 2018-07-15 00:34:12 -03:00
gdkchan 21e590c3ab
Add support for ioctl2, SetTimeout and KickoffPbWithAttr (#261)
* Add support for ioctl2, SetTimeout and KickoffPbWithAttr

* Call UnloadProcess on NvHostChannelIoctl aswell
2018-07-15 00:04:46 -03:00
gdkchan 98c6ceede5
Audio Renderer improvements (#210)
* Partial voice implementation on audio renderer

* Implemented audren resampler (based on original impl)

* Fix BiquadFilter struct

* Pause audio playback on last stream buffer

* Split audren/audout files into separate folders, some minor cleanup

* Use AudioRendererParameter on GetWorkBufferSize aswell

* Bump audren version to REV4, name a few things, increase sample buffer size

* Remove useless new lines
2018-07-14 23:57:41 -03:00
gdkchan fc12fca962
Allow using ulong max value as yield (#263) 2018-07-14 13:53:44 -03:00
gdkchan 2f37583ab3
Some small shader related fixes (#258)
* Some small shader related fixes

* Address PR feedback
2018-07-14 13:08:39 -03:00
Starlet 494f8f0248 Implement CSRNG (Cryptographically Secure Random Bytes) (#216)
* Implement CSRNG (Cryptographically Secure Random Bytes)

* Compliant with review.

* Dispose Rng
2018-07-13 23:36:57 +02:00
Thomas Guillemard 37bf02f057 TimeZone implements cmd 0, 1, 2, 3, 4 and 100 (#250)
The implementation of the TimezoneRule isn't matching hardware but
doesn't need to be accurate (games are only passing the value)
2018-07-13 23:35:19 +02:00
greggameplayer 3b00333b0c Add return of Texture Size and Bytes Per Pixel of ASTC2D 5x5, 6x6, 8x8, 10x10 and 12x12 (#249)
* return correct size of ASTC 5x5, 6x6, 8x8, 10x10 and 12x12

* return correct Bytes Per Pixel

* Use method in order to get CompressedTextureSize

* Add Read16BptCompressedTexture method

* add Bpb integer argument
2018-07-12 21:27:59 -03:00
ReinUsesLisp cd18ab29df Loop GLScreen with custom method (#244)
* Loop GLScreen with custom method

* Fix deadlocks

* Fix screen resizing

* Change event to bool

* Try to fix quitting error

* Set title from main thread

* Queue max 1 vsync, fix high FPS after a slowdown
2018-07-12 14:03:52 -03:00
David 37071285bc NvGetConfig with production/non production swapping (#243)
* GetConfig should return 0x30006 in production mode

* GetConfig will now check settings only if nv!rmos_set_production_mode is set to "0"

* Code formatting, TryGetValue

* Slight fixup

* dont forget the setting

* Implemented non production mode setting grabbing

* format issue

* style changes
2018-07-12 03:41:35 +02:00
gdkchan 1968386808
Add locking methods to the ogl resource cache (#238)
* Add locking methods to the ogl resource cache

* Remove some unused arguments

* Add the ZF32 texture format
2018-07-09 23:01:59 -03:00
gdkchan 791fe70810
Allow sample rate of 0 on OpenAudioOut, fix 5.1 sound output (#240) 2018-07-09 22:49:07 -03:00
gdkchan 095db47e13
Query multiple pages at once with GetWriteWatch (#222)
* Query multiple pages at once with GetWriteWatch

* Allow multiple buffer types to share the same page, aways use the physical address as cache key

* Remove a variable that is no longer needed
2018-07-08 16:55:15 -03:00
ReinUsesLisp 6479c3e484 Implement GPU primitive restart (#221) 2018-07-08 13:14:35 -03:00
gdkchan dc04b5465f
Improvements to IAudioOutManager (#232)
* Improvements to IAudioOutManager

* Make implementation private
2018-07-08 12:42:10 -03:00
ReinUsesLisp 0bec547b9d Disable front facing and face culling to avoid regression (#226)
* Disable tests for framebuffer blitting
2018-07-06 23:40:12 -03:00
ReinUsesLisp 97ca974213 Implement some GPU features (#209)
* Implement stencil testing

* Implement depth testing

* Implement face culling

* Implement front face

* Comparison functions now take OGL enums too

* Fix front facing when flipping was used

* Add depth and stencil clear values
2018-07-05 15:47:29 -03:00
gdkchan c206239d28 Fix formatting on ISettingsServer 2018-07-03 21:45:41 -03:00
John Clemis d24ea0d51b Add Controller Support (#196)
* Added Basic Controller Support

* Added Extra Configuration Options

Added a GamePad_Enable option and GamePad_Index option

* Revert "Added Extra Configuration Options"

This reverts commit 6cc56bfe7e.

* Revert "Revert "Added Extra Configuration Options""

This reverts commit 4809e5effe.

* Forgot to change the Gamepad Index

* Added Configuration for the A B X Y Buttons

* Added Button Configuration for all other Buttons

* Added Basic Joystick Configuration

* Fixed Joystick Axis Problems

Fixed Joystick Axis Problems when switching around the Joysticks (Left Stick is Right and Right stick is Left)

* Refactored all of the button mapping code

* Changes in compliance with review

* Changes in compliance with review

* Fixed problems in the configuration file with different regions

* Changes in compliance with review
2018-07-02 19:08:54 -03:00
Thomas Guillemard 0c96e22d40 Some things for time:* (#211)
- Fully implement ISystemClock
- Implement ISteadyClock 1.0 cmds
- Add cmd 300 to IStaticService
- Add EphemeralNetwork to SystemClockType
2018-07-02 02:03:05 +02:00
Lordmau5 e913d56fdc Implement GetReleasedAudioOutBufferAuto properly (#206)
* Implement GetReleasedAudioOutBufferAuto properly

* Also implement AppendAudioOutBufferAuto properly
2018-06-30 12:53:04 -03:00
Thomas Guillemard 2f25b34941 Add linux-x64 to RID property to make tests works on linux (#205) 2018-06-30 12:43:04 -03:00
gdkchan 3e81421b2f
Add support for vertex base on indexed draws, fix index buffer first (untested) (#197) 2018-06-28 20:48:18 -03:00
greggameplayer 3262fd13da add the forgotten mm:u link (#190) 2018-06-28 23:32:07 +02:00
gdkchan 22f138628b Somewhat better ClearBuffers implementation 2018-06-28 00:11:49 -03:00
gdkchan e6eeb6f09f
Add support for Vertex Program A and other small shader improvements (#192)
* Add WIP support for Vertex Program A, add the FADD_I32 shader instruction, small fix on FFMA_I encoding, nits

* Add separate subroutines for program A/B, and copy attributes to a temp

* Move finalization code to main

* Add new line after flip uniform on the shader

* Handle possible case where VPB uses an output attribute written by VPA but not available on the vbo

* Address PR feedback
2018-06-27 23:55:08 -03:00
gdkchan 900a84ae0a Fix vertex buffer size on the gpu when the draw vertex count is less than the buffer size, added a few more registers (currently not implemented) 2018-06-27 01:32:28 -03:00
gdkchan b8be89ab2d Relax GetThreadContext3 by allowing it to get the context of a running thread 2018-06-26 01:26:21 -03:00
gdkchan 2f29894d9f Set PC value on SvcCall aswell 2018-06-26 01:14:18 -03:00
gdkchan 65105c2a3b Implement SvcGetThreadContext3 2018-06-26 01:10:15 -03:00
gdkchan 8f4cd35ade Fix GetLastOpenedUser stub returning an invalid account id value 2018-06-25 17:12:59 -03:00
gdkchan 7c7ee8f8ca Aways write voice state as finished playing while proper audren support is not in place 2018-06-25 02:04:19 -03:00
gdkchan e7559f128f
Small OpenGL Renderer refactoring (#177)
* Call OpenGL functions directly, remove the pfifo thread, some refactoring

* Fix PerformanceStatistics calculating the wrong host fps, remove wait event on PFIFO as this wasn't exactly was causing the freezes (may replace with an exception later)

* Organized the Gpu folder a bit more, renamed a few things, address PR feedback

* Make PerformanceStatistics thread safe

* Remove unused constant

* Use unlimited update rate for better pref
2018-06-23 21:39:25 -03:00
gdkchan 69697957e6 Workaround for recent audren regression 2018-06-23 03:17:07 -03:00
gdkchan c26ddd6259
Fix 3 graphics related issues (#180)
* Fix 3 graphics related bugs

* OGLShader shouldn't be public (yet)
2018-06-23 02:00:44 -03:00
Starlet 5182361f4b Better audren implementation (#179) 2018-06-23 02:00:14 -03:00
gdkchan 3e6afeb513
Fix some thread sync issues (#172)
* Fix some thread sync issues

* Remove some debug stuff

* Ensure that writes to the mutex address clears the exclusive monitor
2018-06-21 23:05:42 -03:00
Jules Blok 35e695552e NvGpuEngine3d: Fix uploading vertex arrays without index buffers. (#173) 2018-06-18 10:59:03 -03:00
gdkchan 46f18af6be Do not read or write macros to main memory, use a separate memory instead (as this apparently what the real thing does) 2018-06-18 01:32:11 -03:00
Ac_K 4e430760b4 Implement NPDM files parser (#169)
* Implement NPDM files parser

(Currently not used in Ryujinx)

* Add credits

* Add Swap32

* Update Npdm.cs

* Update ACI0.cs

* Update ACID.cs

* Update Npdm.cs

* Update EndianSwap.cs

* Update ACI0.cs

* Update ACID.cs

* Update KernelAccessControl.cs

* Update NpdmInfo.cs

* Update ServiceAccessControl.cs

* Update NpdmInfo.cs
2018-06-17 23:28:11 -03:00
Ac_K 3c4dafff3f
Merge pull request #152 from greggameplayer/patch-5
Implement ListAudioOutsAuto & OpenAudioOutAuto
2018-06-17 04:16:16 +00:00
greggameplayer 5a3449f5d9
delete mixed tabs & spaces & use void for methods 2018-06-15 17:54:18 +02:00
greggameplayer e40db09bed
add a new Method for OpenAudioOut & OpenAudioOutAuto 2018-06-15 17:41:07 +02:00
greggameplayer 4397049c6a Implement ListAudioOutsAuto & OpenAudioOutAuto 2018-06-15 17:24:02 +02:00
Ac_K e581abb2f5
Merge pull request #160 from greggameplayer/patch-7
Implement GetAvailableLanguageCodes2 with a method
2018-06-13 15:40:37 +00:00
greggameplayer 644a328b88
change places of the args of GetAvailableLanguagesCodesMethod 2018-06-13 17:38:19 +02:00
gdkchan 36827c2355
Partial GPU DMA support (#158) 2018-06-13 10:55:01 -03:00
greggameplayer 940de631ab
correct whitespaces 2018-06-13 15:12:03 +02:00
greggameplayer d70ed99fb1
Implement GetAvailableLanguageCodes2 with a method 2018-06-13 15:08:11 +02:00
Ac_K f1e866e248
Merge pull request #157 from Cyuubi/pctl-initialize-and-without-initialize
[PCTL] Add CreateServiceWithoutInitialize and Initialize
2018-06-13 00:53:54 +00:00
Starlet c646a00918 Compliant with review. 2018-06-12 20:51:59 -04:00
Lordmau5 5b9ce52108 Remove comment 2018-06-13 01:29:39 +02:00
Lordmau5 e6f6c6ad57 Merge branch 'master' into ICommonStateGetter 2018-06-13 01:28:49 +02:00
Starlet 8442a5917f [PCTL] Add CreateServiceWithoutInitialize and Initialize 2018-06-12 14:28:45 -04:00
Lordmau5 98e6a34608 Implement R16 texture format (#147) 2018-06-12 09:29:44 -03:00
DatBoiJay3 274c996ff1
Neatness counts 2018-06-11 19:53:44 -07:00
DatBoiJay3 39b8e6bc37
Fix input in SMO
Unsure if this will break other games though.
Please test. :)
2018-06-11 19:29:12 -07:00
Lordmau5 c636c74dd2 Merge branch 'master' into ICommonStateGetter 2018-06-11 06:03:37 +02:00
gdkchan 76f3b1b3a4 Rename Ryujinx.Core to Ryujinx.HLE and add a separate project for a future LLE implementation 2018-06-10 21:46:42 -03:00