Commit Graph

2580 Commits

Author SHA1 Message Date
Huw Pascoe
a13ab958cb Fixed type conversion ambiguity 2017-09-30 09:34:35 +01:00
bunnei
b07af7dda8 Merge pull request #2961 from Subv/load_titles
Loaders: Don't automatically set the current process every time we load an application.
2017-09-29 14:58:42 -04:00
Subv
8432749db7 Kernel/Threads: When putting a thread to wait, specify a function to execute when it is awoken.
This change makes for a clearer (less confusing) path of execution in the scheduler, now the code to execute when a thread awakes is closer to the code that puts the thread to sleep (WaitSynch1, WaitSynchN). It also allows us to implement the special wake up behavior of ReplyAndReceive without hacking up WaitObject::WakeupAllWaitingThreads.

If savestates are desired in the future, we can change this implementation to one similar to the CoreTiming event system, where we first register the callback functions at startup and assign their identifiers to the Thread callback variable instead of directly assigning a lambda to the wake up callback variable.
2017-09-28 11:53:32 -05:00
Subv
7f48aa8d25 Loaders: Don't automatically set the current process every time we load an application.
The loaders will now just create a Kernel::Process, construct it and return it to the caller, which is responsible for setting it as the current process and configuring the global page table.
2017-09-26 18:17:47 -05:00
James Rowe
5620327e03 Merge pull request #2954 from Subv/cache_unmapped_mem
Memory/RasterizerCache: Ignore unmapped memory regions when caching physical regions
2017-09-26 16:55:47 -06:00
Subv
3165466b66 Kernel/Thread: Allow specifying which process a thread belongs to when creating it.
Don't automatically assume that Thread::Create will only be called when the parent process is currently scheduled. This assumption will be broken when applets or system modules are loaded.
2017-09-26 17:40:49 -05:00
Subv
35da7f57ef Memory: Allow IsValidVirtualAddress to be called with a specific process parameter.
There is still an overload of IsValidVirtualAddress that only takes the VAddr and will default to the current process.
2017-09-26 17:27:44 -05:00
Subv
e27ae04696 HLE/APT: Always set up the APT parameter when starting a library applet.
Only use the HLE interface if an HLE applet with the desired id was started.

This commit reorganizes the APT code surrounding parameter creation and delivery to make it easier to support LLE applets in the future.

As future work, the HLE applet interface can be reworked to utilize the same facilities as the LLE interface.
2017-09-25 23:47:50 -05:00
Subv
41f6c9f87f Memory/RasterizerCache: Ignore unmapped memory regions when caching physical regions.
Not all physical regions need to be mapped into the address space of every process, for example, system modules do not have a VRAM mapping.

This fixes a crash when loading applets and system modules.
2017-09-25 19:37:45 -05:00
Subv
774e7deae8 HLE/Archives: Allow multiple loaded applications to access their SelfNCCH archive independently.
The loaders now register each loaded ROM with the SelfNCCH factory, which keeps the data around for the duration of the emulation session.

When opening the SelfNCCH archive, the factory queries the current program's programid and uses that as a key to the map that contains the NCCHData structure (RomFS, Icon, Banner, etc).

3dsx files do not have a programid and will use a default of 0 for this value, thus, only 1 3dsx file with RomFS is loadable at the same time.
2017-09-25 09:45:02 -05:00
B3n30
d881dee818 Merge pull request #2952 from MerryMage/page-tables
Switchable Page Tables
2017-09-25 08:29:32 +02:00
B3n30
a21b9deb98 Merge pull request #2948 from Subv/register_service
HLE/SRV: Implemented RegisterService.
2017-09-25 08:22:05 +02:00
Max Thomas
c91ccbd0ba Loader/NCCH: Add support for loading application updates (#2927)
* loader/ncch: split NCCH parsing into its own file

* loader/ncch: add support for loading update NCCHs from the SD card

* loader/ncch: fix formatting

* file_sys/ncch_container: Return a value for OpenFile

* loader/ncch: cleanup, always instantiate overlay_ncch to base_ncch

* file_sys/ncch_container: better encryption checks, allow non-app NCCHs to load properly and for the existence of NCCH structures to be checked

* file_sys/ncch_container: pass filepath as a const reference
2017-09-25 08:17:38 +02:00
B3n30
d673d508dd Services/UDS: Added a function to send EAPoL-Start packets (#2920)
* Services/UDS: Added a function to generate the EAPoL-Start packet body.

* Services/UDS: Added filter for beacons.

* Services/UDS: Lock a mutex when accessing connection_status from both the emulation and network thread.

* Services/UDS: Handle the Association Response frame and respond with the EAPoL-Start frame.

* fixup: make use of current_node, changed received_beacons into a list, mutex and assert corrections

* fixup: fix damn clang-format
2017-09-25 08:16:27 +02:00
MerryMage
67a70bd9e1 ARM_Interface: Implement PageTableChanged 2017-09-24 23:08:25 +01:00
MerryMage
4e5eb2044a memory: Remove GetCurrentPageTablePointers 2017-09-24 22:43:28 +01:00
MerryMage
c02bbb7030 memory: Add GetCurrentPageTable/SetCurrentPageTable
Don't expose Memory::current_page_table as a global.
2017-09-24 22:42:42 +01:00
Subv
7096f01c14 HLE/APT: Always return an error from PrepareToStartNewestHomeMenu so that the Home Menu doesn't try to reboot the system.
As per 3dbrew:
"During Home Menu start-up it uses APT:PrepareToStartNewestHomeMenu. If that doesn't return an error(normally NS returns 0xC8A0CFFC for that), Home Menu starts a hardware reboot with APT:StartNewestHomeMenu etc. "
2017-09-24 08:59:31 -05:00
Subv
b57d58c0dc HLE/APT: Prepare the APT Wakeup parameter when the game calls Initialize
We need to know what is being run so we can set the APT parameter destination AppId correctly.
Delaying the preparation of the parameter until we know which AppId is running lets us support booting both the Home Menu and normal game Applications.
2017-09-24 08:59:30 -05:00
Subv
0b33e36292 HLE/SRV: Implemented RegisterService.
Now system modules can do more than just crash immediately on startup.
2017-09-24 00:12:58 -05:00
B3n30
28c726f205 WebService: Verify username and token (#2930)
* WebService: Verify username and token; Log errors in PostJson

* Fixup: added docstrings to the functions

* Webservice: Added Icons to the verification, imrpved error detection in cpr, fixup nits

* fixup: fmt warning
2017-09-18 21:18:26 -04:00
Yuri Kunde Schlesner
255fd8768d Merge pull request #2906 from Subv/ns_new_framework
Services/NS: Port ns:s to the new service framework.
2017-09-16 21:13:51 +02:00
Subv
3d86e3afc4 Services/NS: Port ns:s to the new service framework. 2017-09-16 10:52:45 -05:00
B3n30
813837c5cf Merge pull request #2842 from Subv/switchable_page_table
Kernel/Memory: Give each process its own page table and allow switching the current page table upon reschedule
2017-09-15 22:41:45 +02:00
Subv
7a3ab7c63d CPU/Dynarmic: Disable the fast page-table access in dynarmic until it supports switching page tables at runtime. 2017-09-15 14:26:22 -05:00
Subv
f18a176b60 Kernel/Memory: Make IsValidPhysicalAddress not go through the current process' virtual memory mapping. 2017-09-15 14:26:18 -05:00
Subv
b178089251 Kernel/Threads: Don't clear the CPU instruction cache when performing a context switch from an idle thread into a thread in the same process.
We were unnecessarily clearing the cache when going from Process A -> Idle -> Process A, this caused extreme performance regressions.
2017-09-15 14:26:15 -05:00
Subv
214150f00c Kernel/Memory: Changed GetPhysicalPointer so that it doesn't go through the current process' page table to obtain a pointer. 2017-09-15 14:26:13 -05:00
bunnei
588077184b Merge pull request #2915 from wwylele/font-archive-2
APT: load different shared font depending on the region
2017-09-11 21:39:56 -04:00
Subv
c34ec5e77c Kernel/Memory: Switch the current page table when a new process is scheduled. 2017-09-10 15:14:31 -05:00
Subv
6d2734a074 Kernel/Memory: Give each Process its own page table.
The loader is in charge of setting the newly created process's page table as the main one during the loading process.
2017-09-10 15:13:41 -05:00
Weiyi Wang
617b6974b9 Merge pull request #2831 from Subv/uds_auth
Services/UDS: Handle beacon frames and the basic AP connection sequence frames.
2017-09-05 15:03:56 +03:00
mailwl
11f2eff17d Remove _flag in var names 2017-09-04 12:15:15 +03:00
mailwl
589babbf74 Mii Selector Applet: update Mii structures 2017-09-04 12:04:12 +03:00
wwylele
59a9aaf388 APT: load different shared font depending on the region 2017-09-03 12:34:11 +03:00
bunnei
75cd28a7cc Merge pull request #2899 from wwylele/touch-refactor
Refactor touch input into a TouchDevice
2017-08-29 11:29:10 -04:00
Sebastian Valle
acbd46366c Merge pull request #2905 from danzel/fix-2902
Use recursive_mutex instead of mutex to fix #2902
2017-08-29 09:35:56 -05:00
danzel
8266064796 Use recursive_mutex instead of mutex to fix #2902 2017-08-29 20:39:55 +12:00
Subv
f64cd87604 Services/UDS: Remove an old duplicated declaration of WifiPacket. 2017-08-27 10:48:15 -05:00
Subv
d088dbfbe1 Services/UDS: Handle the connection sequence packets.
There is currently no stage tracking, a client is considered "Connected" when it receives the EAPoL Logoff packet from the server, this is not yet implemented.
2017-08-27 10:48:13 -05:00
Subv
2e9f544ecc Services/UDS: Store the received beacon frames until RecvBeaconBroadcastData is called, up to 15 beacons at the same time, removing any older beacon frames when the limit is exceeded. 2017-08-27 10:48:11 -05:00
Subv
54411bef4e Services/UDS: Add functions to generate 802.11 auth and assoc response frames. 2017-08-27 10:48:09 -05:00
bunnei
04bd0c957e web_services: Refactor to remove dependency on Core. 2017-08-25 23:10:02 -04:00
bunnei
9f0da33c33 qt: Add an option to view/regenerate telemetry ID. 2017-08-25 23:10:02 -04:00
bunnei
c781aea947 settings: Add enable_telemetry, citra_username, and citra_token. 2017-08-25 23:10:00 -04:00
bunnei
d6a819c7cb telemetry_session: Log telemetry ID. 2017-08-25 23:10:00 -04:00
ThaMighty90
3cdf854e44 SidebySide Layout (#2859)
* added a SidebySide Layout

* Reworked, so both screen have the same height and cleaned up screen translates.

* added the option in the UI, hope this is the right way to do it. formated framebuffer_layout.cpp

* delete the x64 files

* deleted ui_configure_graphics.h

* added Option for the Layout in the xml

* got rid of SIDE_BY_SIDE_ASPECT_RATIO because it was useless. pulled translate into variables

* changed shift variables to u32 and moved them in their respective branch. remove notr="true" for the Screen layout drop down

* reworked intends :). changed function description for SideFrameLayout

* some description reworking
2017-08-25 17:53:07 -04:00
wwylele
2617de1fe6 EmuWindow: refactor touch input into a TouchDevice 2017-08-24 15:00:56 +03:00
wwylele
c84e60b470 HID: use TouchDevice for touch pad 2017-08-24 13:56:43 +03:00
James Rowe
61442d6afb Merge pull request #2839 from Subv/global_kernel_lock
Kernel/HLE: Use a mutex  to synchronize access to the HLE kernel state between the cpu thread and any other possible threads that might touch the kernel (network thread, etc).
2017-08-23 18:17:44 -06:00
bunnei
2bbff9fa96 Merge pull request #2893 from Subv/not_schedule_main_thread
Kernel/Threads: Don't immediately switch to the new main thread when loading a new process.
2017-08-22 17:45:47 -04:00
Subv
f484927ed0 Kernel/Memory: Acquire the global HLE lock when a memory read/write operation falls outside of the fast path, for it might perform an MMIO operation. 2017-08-22 09:30:58 -05:00
Subv
bca8916cea Kernel/HLE: Use a mutex to synchronize access to the HLE kernel state between the cpu thread and any other possible threads that might touch the kernel (network thread, etc).
This mutex is acquired in SVC::CallSVC, ie, as soon as the guest application enters the HLE kernel, and should be acquired by the aforementioned threads before modifying kernel structures.
2017-08-22 09:30:55 -05:00
Subv
fa228ca637 Kernel/Threads: Don't immediately switch to the new main thread when loading a new process.
This is necessary for loading multiple processes at the same time.
The main thread will be automatically scheduled when necessary once the scheduler runs.
2017-08-21 20:54:29 -05:00
Subv
8a9a4e2c42 GPU/Warnings: Explicitly cast the screen refresh ticks to u64. 2017-08-21 08:34:30 -05:00
Subv
65f19b51c4 Warnings: Add UNREACHABLE macros to switches that contemplate all possible values. 2017-08-21 08:34:28 -05:00
Subv
145a7293a3 HLE/Applets: Fixed some conversion warnings when creating the framebuffer shared memory objects. 2017-08-21 08:34:27 -05:00
Subv
d237a89048 CPU/Dynarmic: Fixed a warning when incrementing the number of ticks in ExecuteInstructions. 2017-08-21 08:34:25 -05:00
Subv
9d0841b48b Dyncom: Use size_t instead of int to store the instruction offsets in the instruction cache.
Fixes a few warnings.
2017-08-21 08:34:23 -05:00
Subv
d3fb1d6c38 Dyncom: Fixed a conversion warning when decoding thumb instructions. 2017-08-21 08:20:36 -05:00
James Rowe
bbfa9d0635 Merge pull request #2861 from wwylele/motion-refactor
Refactor MotionEmu into a InputDevice
2017-08-19 23:43:01 -06:00
wwylele
54c0c8adee HID: fix a comment and a warning 2017-08-20 08:37:48 +03:00
B3n30
5d0a1e7efd Added missing parts in libnetwork (#2838)
* Network: Set and send the game information over enet

Added Callbacks for RoomMember and GetMemberList to Room in preparation for web_services.
2017-08-19 11:14:33 -06:00
Yuri Kunde Schlesner
21204ba488 Merge pull request #2881 from MerryMage/dsp-firm-check
dsp_dsp: Remove size assertion in LoadComponent
2017-08-15 20:14:41 -07:00
MerryMage
b67c2dc82c dsp_dsp: Remove size assertion in LoadComponent 2017-08-15 10:16:50 +01:00
Sebastian Valle
d59f503729 Merge pull request #2843 from Subv/applet_slots
Services/APT: Use an array to hold data about the 4 possible concurrent applet types (Application, Library, HomeMenu, System)
2017-08-12 10:27:57 -05:00
wwylele
188194908c move MotionEmu from core/frontend to input_common as a InputDevice 2017-08-11 11:05:08 +03:00
wwylele
867eabd6b7 HID: use MotionDevice for Accelerometer and Gyroscope 2017-08-11 11:03:18 +03:00
Weiyi Wang
aaf5161344 Merge pull request #2863 from wwylele/pad-state-zero
HID: zero unused PadState bits
2017-08-10 17:50:18 +03:00
wwylele
599de29ea3 HID: zero unused PadState bits 2017-08-10 17:01:03 +03:00
bunnei
c2466a2f19 Merge pull request #2862 from j-selby/update-cryptopp
Update CryptoPP (byte ambiguity)
2017-08-09 16:18:43 -04:00
mailwl
a6273dd56a Service/dlp: Update function tables according 3dbrew 2017-08-09 16:14:07 +03:00
James
1a44949ef7 Update cryptopp 2017-08-08 17:50:09 +10:00
Subv
177e8ce655 Services/APT: Use the AppletAttributes union directly when dealing with applet attrs. 2017-08-07 16:09:55 -05:00
Subv
73fba0de46 Services/APT: Use an array to hold data about the 4 possible concurrent applet types (Application, Library, HomeMenu, System).
This gives each applet type its own set of events as per the real NS module.
2017-08-07 14:53:58 -05:00
bunnei
fb8de89859 telemetry: Add field for OsPlatform. 2017-08-03 20:10:38 -04:00
bunnei
9390d54bb3 telemetry: Add field for BuildName. 2017-08-03 20:10:37 -04:00
bunnei
5c631ec9c5 telemetry: Add field for RequiresSharedFont. 2017-08-03 20:10:37 -04:00
bunnei
a621ab6853 telemetry_session: Log BuildDate and ProgramName fields. 2017-08-03 20:10:37 -04:00
bunnei
9b8e5bea66 core: Expose AppLoader as a public interface. 2017-08-03 20:10:37 -04:00
bunnei
f5cf9960d9 loader: Expose program title. 2017-08-03 20:10:37 -04:00
James
941a722ff1 Handle invalid filenames when renaming files/directories 2017-07-31 17:11:53 +10:00
bunnei
f15e5522dc Merge pull request #2840 from Subv/apt_parameter
Services/APT: Corrected the behavior of the Receive/Send/Glance/CancelParameter functions
2017-07-27 11:14:27 -04:00
Weiyi Wang
045d0b5bbd Merge pull request #2799 from yuriks/virtual-cached-range-flush
Add address conversion functions returning optional, Add function to flush virtual region from rasterizer cache
2017-07-22 10:15:52 +03:00
Subv
e59ab7c1d6 Service/APT: Log Send/Cancel/Receive/GlanceParameter calls even if they return an error. 2017-07-21 15:03:06 -05:00
Subv
68596a7068 Services/APT: Return the proper error code when calling SendParameter with an outstanding parameter already in memory. 2017-07-21 14:59:26 -05:00
Subv
a9bc417f59 Services/APT: Reset the APT parameter inside CancelParameter if the conditions are met. 2017-07-21 14:59:25 -05:00
Subv
e403638d9b Services/APT: Properly clear the apt parameter after a successful ReceiveParameter call. 2017-07-21 14:59:22 -05:00
Subv
2dc720c355 Services/APT: Use the right error codes in ReceiveParameter and GlanceParameter when the parameter doesn't exist. 2017-07-21 14:59:21 -05:00
Subv
5682608df7 Services/APT: Use boost::optional for the APT parameter structure. 2017-07-21 14:59:20 -05:00
bunnei
df8b9863f9 telemetry: Log performance, configuration, and system data. 2017-07-17 21:32:28 -04:00
B3n30
7dbbd8a02e stubbed frd::UnscrambleLocalFriendCode (#2827) 2017-07-16 21:32:08 -05:00
Weiyi Wang
e634b75754 Merge pull request #2784 from wwylele/font-archive
load shared font from system archive
2017-07-16 20:12:55 +03:00
bunnei
33b012e86b web_service: Add CMake flag to enable. 2017-07-11 18:33:41 -04:00
bunnei
8af3ebb149 telemetry_session: Use TelemetryJson to submit real telemetry. 2017-07-11 18:33:40 -04:00
bunnei
52fbe1e10c web_service: Add skeleton project. 2017-07-10 00:15:40 -04:00
bunnei
8abf808854 settings: Add telemetry endpoint URL. 2017-07-10 00:15:39 -04:00
Sebastian Valle
669757a97b Merge pull request #2815 from mailwl/bossp
Service/boss:P: Add some functions to FunctionTable
2017-07-08 13:58:40 -05:00
bunnei
6d4bac8522 Merge pull request #2797 from yuriks/cached-vma-free-crash
Memory: Fix crash when unmapping a VMA covering cached surfaces
2017-07-08 14:07:47 -04:00
mailwl
8582194a4c Service/boss:P: Add some functions to FunctionTable 2017-07-01 12:21:38 +03:00