Commit graph

19 commits

Author SHA1 Message Date
Mary
3443023a08
hid: Rewrite shared memory management (#2257)
* hid: Rewrite shared memory management

This entirely rewrite our ancient (and original) HID shared memory
interface to be more usable and accurate.

HID update logics were updated to reflect those changes but should work
still the same way it previously did.

This need heavy testing just in case to avoid possible regressions.

* Silence warnings

* Address gdkchan's comments

* Address Ac_K's comments

* Address one missing nit
2021-05-02 22:01:30 +02:00
riperiperi
dc8c781d7a
Return focus from controller applet after completion (#2218)
* Return focus from controller applet after completion

This fixes controller applet related in Mario Kart 8 Deluxe, in 2 player mode or when opening the applet in character select.

* Return focus for player select
2021-04-17 18:57:03 +02:00
Ac_K
7344dee475
account: Adds AccountManager (#2184)
* account: Adds Account Manager

In a way to have Custom User Profiles merged in master faster, this PR adds a `AccountManager` class (based on `AccountUtils` class) and the following changes have been made:
- Adds a "default profile values" which were the old hardcoded ones.
- The image profile is moved to the Account service folder.
- The hardcoded UserId for the savedata is now using the `AccountManager` last opened one.
- The DeviceId in Mii service is changed to the right value (checked by REd sys:set call).

* Fix csproj

* Addresses gdkchan's comments

* Fix UserProfile fields

* Fix mii GetDeviceId()

* Update Ryujinx.HLE.csproj
2021-04-13 03:16:43 +02:00
Ac_K
db56b2166d
ErrorApplet: Implement ApplicationErrorArg (#2123)
This PR implement `ApplicationErrorArg` to the Error Applet. It's used by the guest to throw some specific error messages.
The code was done for (and merged) LDN2 build since long time ago and have been tested a bunch of times because of that! In a way to reduce the differences between LDN and master build it's fine to add it to master.
2021-03-19 00:04:49 +01:00
Caian Benedicto
8b4e4fc076
Improve heuristic for showing the keyboard (#2066) 2021-02-28 11:26:00 +01:00
Caian Benedicto
f16d7f91f1
Improve inline keyboard compatibility (#1959)
* Improve compatibility of the inline keyboard with some games

* Send an empty first text to avoid crashing some games

* Implement SetCustomizedDictionaries and fix SetCustomizeDic

* Expand Bg and Fg –abbreviations in the swkbd applet

* Fix variable names and add comments to software keyboard
2021-02-11 01:28:44 +01:00
Caian Benedicto
e57b140429
Add support for inline software keyboard (#1868)
* Add background mode configuration to SoftwareKeyboardApplet

* Add placeholder text generator for Software Keyboard in background mode

* Add stub for GetIndirectLayerImageMap

* Fix default state of DecidedCancel response

* Add GUI text input to Software Keyboard in background mode

* Fix graphical glitch when Inline Software Keyboard appears

* Improve readability of InlineResponses class

* Improve code styling and fix compiler warnings

* Replace ServiceDisplay log class by ServiceVi

* Replace static readonly by const

* Add proper finalization to the keyboard applet in inline mode

* Rename constants to start with uppercase

* Fix inline keyboard not working with some games

* Improve code readability

* Fix code styling
2021-01-11 19:27:55 +01:00
Ac_K
4f65043ad7
Basic impl of Error Applet (#1551) 2020-09-28 00:00:38 +02:00
mageven
27179d0218
Improve multi-controller support in HID and Controller Applet (#1453)
* Initial commit

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

* Notify in log periodically when no matched controllers

* Remove duplicate StructArrayHelpers in favor of Common.Memory

Fix struct padding CS0169 warns in Touchscreen

* Remove GTK markup from Controller Applet

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

* Restrict ControllerWindow to show valid controller types

Add selected player name to ControllerWindow title

* ControllerWindow: Fix controller type initial value

NpadDevices: Simplify default battery charge

* Address AcK's comments

Use explicit types and fix formatting

* Remove HashSet for SupportedPlayers

Fixes potential exceptions due to race

* Fix ControllerSupportArg struct packing

Also comes with two revisions of struct for 4/8 players max.
2020-08-23 22:54:11 +02:00
mageven
a33dc2f491
Improved Logger (#1292)
* Logger class changes only

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

* Misc formatting

* Manual optimizations

PrintGuestLog
PrintGuestStackTrace
Surfaceflinger DequeueBuffer

* Reduce SendVibrationXX log level to Debug

* Add Notice log level

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

* Unify unhandled exception event handlers

* Print enabled LogLevels during init

* Re-add App Exit disposes in proper order

nit: switch case spacing

* Revert PrintGuestStackTrace to Info logs due to #1407

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

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

* Relocate UI handler to Emu Context from Config

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

Add basic input length validation in InputDialog

* Add Transfer Memory support to AppletCreator

Read Initial Text for SwKbd using Transfer Memory

* Improve InputDialog widget

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

* Misc improvements

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

* Add proper Cancel functionality

Also handle GUI errors in UI handler

* Address jD's comments

* Fix _uiHandler init

* Address AcK's comments
2020-08-03 03:30:58 +02:00
Thog
0ff00bd6d3
am: Implement common web applets (#1188)
* am: Implemnet common web applets

This implement parsing of input and output of web applets while making
those close directly.

TODO for the future: Use and hook a web browser.

* Address Ac_K's comments
2020-05-15 03:56:14 +02:00
mageven
492bb6ee5f
Suppress CS0169 CS0649 warns from HID structs (#1222)
Also fix typo in a pragma restore in Logger
2020-05-10 16:02:41 +02:00
mageven
4d93f97408
Revert SwKbd Applet ReadStruct and fix IApplet's ReadStruct to catch (#1087)
error at compile time
2020-04-03 17:53:06 +11:00
mageven
2365ddfc36
HID SharedMem Rework (#1003)
* Delete old HLE.Input

* Add new HLE Input.

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

* Change HID Service

* Change Ryujinx UI to reflect new Input

* Add basic ControllerApplet

* Add DebugPad

Should fix Kirby Star Allies

* Address Ac_K's comments

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

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

* Further address Ac_K's comments

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

* Address AcK's review comments

* Address AcK's second review comments

* Replace missed Marshal.SizeOf and address gdkchan's comments
2020-04-03 11:10:02 +11:00
bunnei
ad2424171a SoftwareKeyboard: Interactive data size should include size field. (#907) 2020-01-26 16:14:21 +11:00
jduncanator
d562ba37a0 Fully reverse swkbd configuration structure and follow-up to swkbd implementation (#839)
* am: Fully reverse swkbd configuration structure

* Add documentation

* Remove explicit access modifiers

* Fix formatting

* Fix further formatting issues
2019-12-03 05:00:56 +01:00
jduncanator
ee81ab547e Initial swkbd implementation (#826)
* am: Initial swkbd implementation

Currently only implements the full screen keyboard, inline keyboard will come later.

* Remove unnecessary logging

* Miscellaneous tidy up

* am: Always pop incoming interactive session data

* am: Add a reminder to implement the full config struct

* am: Check for a max length of zero

We should only limit/truncate text when the max length is set to a non-zero value.

* Add documentation

* am: Return IStorage not available when queue is empty

We should be returning the appropriate error code when the FIFO is empty, rather than just throwing an exception and killing the emulator.

* Fix typo

* Code style changes
2019-11-18 12:16:26 +01:00
jduncanator
35e5612766 Implement a rudimentary applets system (#804)
* Implement Player Select applet

* Initialize the Horizon system reference

* Tidy up namespaces

* Resolve nits

* Resolve nits

* Rename stack to queue

* Implement an applet FIFO

* Remove debugging log

* Log applet creation events

* Reorganise AppletFifo

* More reorganisation

* Final changes
2019-11-14 06:18:44 +01:00