Commit graph

208 commits

Author SHA1 Message Date
Weiyi Wang 9458e4d8ec CoreTiming: wrap into class 2018-11-04 10:26:38 -05:00
Weiyi Wang fc84091d88 Service, Kernel: move named port list to kernel 2018-11-01 12:56:40 -04:00
Weiyi Wang 263290d48c HLE: move SharedPage into Kernel
similar to config_mem, kernel is responsible for setting up this
2018-11-01 12:56:40 -04:00
Weiyi Wang 2183d0d6be core: use internal kernel pointer directly 2018-10-30 00:35:37 -04:00
Weiyi Wang 0478bc3dee Kernel/Thread: move thread queue, current thread, and scheduling related function into the manager
As we touched it, remove IPC::GetCommandBuffer
2018-10-26 16:07:11 -04:00
Weiyi Wang 8fb3d8ff38 kernel/process: move current process to kernel instance
Two functional change:
QueryProcessMemory uses the process passed from handle instead current_process
Thread::Stop() uses TLS from owner_process instead of current_process
2018-10-22 21:32:34 -04:00
Weiyi Wang 13c26b4371 Kernel: pass ref to session pair 2018-10-18 21:41:36 -04:00
Weiyi Wang 1213a298df Kernel: pass ref to port 2018-10-18 21:41:36 -04:00
Weiyi Wang 181646679c ServiceManager: pass down core reference 2018-10-18 21:41:36 -04:00
Weiyi Wang f446fd1fe5 Kernel: add KernelSystem class 2018-10-18 21:41:00 -04:00
Weiyi Wang 0962ab8da9
Merge pull request #4305 from wwylele/fs-global
FS/archive: wrap states into ArchiveManager class
2018-10-11 13:04:02 -04:00
Weiyi Wang 9adc407112
Merge pull request #4304 from B3n30/std_optional
Replace boost::optional with std::optional where possible
2018-10-11 12:40:00 -04:00
Weiyi Wang 389d3d630e fs/archive: wrap states into archive manager 2018-10-06 01:23:03 -04:00
Weiyi Wang b163502744
Core: pass down Core::System reference to all services (#4272)
* Core: pass down Core::System reference to all services

This has to be done at once due to unified interface used by HLE/LLE switcher

* apt: eliminate Core::System::GetInstance

* gpu_gsp: eliminate Core::System::GetInstance in service

* hid: eliminate Core::System::GetInstance

* nwm: eliminate Core::System::GetInstance

* err_f: eliminate Core::System::GetInstance
2018-10-05 10:59:43 -04:00
B3n30 2306af3600 Handle cases when std::optional does not contain a value 2018-10-05 16:51:33 +02:00
B3n30 d37a2270d6 Replace boost::optional with std::optional where possible 2018-10-05 13:51:09 +02:00
EverOddish fce7afb8dc Added CMake option to enable/disable scripting support 2018-09-23 19:16:18 -04:00
James Rowe 687e3e74ca
Merge pull request #3959 from zhaowenlan1779/semi-reset
service/apt: Implement soft reset & CloseApplication
2018-09-19 21:02:59 -06:00
EverOddish 04dd91be82 Initial support for scripting (#4016)
* Add ZeroMQ external submodule

* ZeroMQ libzmq building on macOS

* Added RPC namespace, settings and logging

* Added request queue handling and new classes

* Add C++ interface to ZeroMQ

* Added start of ZeroMQ RPC Server implementation.

* Request construction and callback request handling

* Read and write memory implementation

* Add ID to request format and send reply

* Add RPC setting to macOS UI

* Fixed initialization order bug and added exception handling

* Working read-write through Python

* Update CMakeLists for libzmq to resolve target name conflict on Windows

* Platform-specific CMake definitions for Windows/non-Windows

* Add comments

* Revert "Add RPC setting to macOS UI"

* Always run RPC server instead of configurable

* Add Python scripting example. Updated .gitignore

* Rename member variables to remove trailing underscore

* Finally got libzmq external project building on macOS

* Add missing dependency during libzmq build

* Adding more missing dependencies [skip ci]

* Only build what is required from libzmq

* Extra length checks on client input

* Call InvalidateCacheRange after memory write

* Revert MinGW change. Fix clang-format. Improve error handling in request/reply. Allow any length of data read/write in Python.

* Re-organized RPC static global state into a proper class. [skip ci]

* Make sure libzmq always builds in Release mode

* Renamed Request to Packet since Request and Reply are the same thing

* Moved request fulfillment out of Packet and into RPCServer

* Change request thread from sleep to condition variable

* Remove non-blocking polling from ZMQ server code. Receive now blocks and terminates properly without sleeping. This change significantly improves script speed.

* Move scripting files to dist/ instead of src/

* C++ code review changes for jroweboy [skip ci]

* Python code review changes for jroweboy [skip ci]

* Add docstrings and tests to citra.py [skip ci]

* Add host OS check for libzmq build

* Revert "Add host OS check for libzmq build"

* Fixed a hang when emulation is stopped and restarted due to improper destruction order of ZMQ objects [skip ci]

* Add scripting directory to archive packaging [skip ci]

* Specify C/CXX compiler variables on MinGW build

* Only specify compiler on Linux mingw

* Use gcc and g++ on Windows mingw

* Specify generator for mingw

* Don't specify toolchain on windows mingw

* Changed citra.py to support Python 3 instead of Python 2

* Fix bug where RPC wouldn't restart after Stop/Start emulation

* Added copyright to headers and reorganized includes and forward declarations
2018-09-11 22:00:12 +02:00
zhupengfei ad6b140cb0
service/apt: Implement soft reset & CloseApplication 2018-09-08 11:05:23 +08:00
James Rowe a6723ec2eb
Merge pull request #4126 from FearlessTobi/port-892
Port #892 from yuzu: "Make global EmuWindow instance part of the base renderer class"
2018-08-26 12:00:55 -06:00
Ben b20607dfc6 Add system time configuration (#4043)
* Add setting to switch between a fixed start time and the system time

Add clock settings to SDL

Make clock configureable in qt

Add a SharedPage handler class

Init shared_page_handler for tests
2018-08-26 11:47:45 -06:00
James Rowe 13262c187c
Merge pull request #3922 from zhaowenlan1779/qt-movie
movie: Add Qt Movie feature
2018-08-26 11:07:15 -06:00
fearlessTobi f61c9c3eb7 video_core: Make global EmuWindow instance part of the base renderer …
…class

Makes the global a member of the RendererBase class. We also change this
to be a reference. Passing any form of null pointer to these functions
is incorrect entirely, especially given the code itself assumes that the
pointer would always be in a valid state.

This also makes it easier to follow the lifecycle of instances being
used, as we explicitly interact the renderer with the rasterizer, rather
than it just operating on a global pointer.
2018-08-25 15:20:40 +02:00
Merry b49d042200
Merge pull request #4101 from Hedges/GDBClean
GDB Modernization
2018-08-25 13:58:38 +01:00
zhupengfei 0f44f7b481 core/movie: Movie refactor, add a completion callback 2018-08-20 11:27:25 +02:00
fearlessTobi d1c5f01afe Add more verbose popups for video_core errors 2018-08-19 15:48:40 +02:00
Jarek Syrylak bd658a8801 GDB Modernization:
- Can be used in either DynCom or Dynarmic mode
- Added support for threads
- Proper support for FPU registers
- Fix for NibbleToHex conversion that used to produce false error codes
- Fix for clang-format failing under Windows
2018-08-16 10:40:52 +01:00
James Rowe bf6da61da5
Merge pull request #3850 from zhaowenlan1779/swkbd
applets/swkbd: Software Keyboard Implementation
2018-07-17 09:02:55 -06:00
zhupengfei 5407ed8b5e
citra_qt/applets/swkbd: QtKeyboard and misc fixes
* Addressed comments and removed the applet interface

* swkbd: address @lioncash's comments

* core: more fixes

** Moved registered_swkbd to System

** Removed an usused virtual

** Removed functionality of DrawScreenKeyboard

** Removed src/core/settings.h change

* swkbd: address @lioncash's 2nd review

* swkbd: update logging macro

* QtKeyboard: Make dialog modal and hide help
2018-07-10 12:49:55 +08:00
MerryMage d269beab0d sink_details: Listing available devices should be separate from sink construction 2018-07-02 14:09:17 +01:00
wwylele 0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
wwylele 7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
Daniel Lim Wee Soong f407917eb7 core/core: Replace logging macros 2018-06-07 23:06:03 +08:00
Lioncash a78920e60b
sm: Relocate the service manager to the System class
Rather than have it live as a global variable, place it into the System class and make it instance-based.
2018-04-13 07:15:34 -04:00
MerryMage ab3d53131a audio_core: Remove global state 2018-02-03 15:15:17 +00:00
James Rowe 44d07574b1
Merge pull request #2882 from danzel/movie-squash
Movie (Game Inputs) recording and playback
2018-01-23 01:03:37 -07:00
Emmanuel Gil Peyrot e5a3dc2956 Core: Disable the JIT when dynarmic is not available 2018-01-08 19:13:58 +01:00
danzel 0238e0c5e7 Convert Movie to a class with a static instance, and other fixes based on B3n30 feedback. 2017-12-17 17:55:56 +13:00
danzel 04541150b1 Movie (recorded inputs) playback and recording. SDL has command lines to control it. 2017-12-17 16:43:09 +13:00
MerryMage 533feb42d1 core: Don't Shutdown before we've even Init-ed 2017-12-12 00:30:46 +00:00
MerryMage 7cd8b437aa core/arm: Improve timing accuracy before service calls in JIT
We also correct the CPU JIT's implementation of Step.
2017-12-03 16:06:46 +00:00
B3n30 e9a95b2e7d
CoreTiming: Reworked CoreTiming (#3119)
* CoreTiming: New CoreTiming; Add Test for CoreTiming
2017-11-25 14:56:57 +01:00
wwylele 499508389c core: clear format warnings 2017-11-01 12:35:32 +02: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
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
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
bunnei df8b9863f9 telemetry: Log performance, configuration, and system data. 2017-07-17 21:32:28 -04:00
TheKoopaKingdom f008b22e3b Addressed Bunnei's review comments, and made some other tweaks:
- Deleted GetStatus() because it wasn't used anywhere outside of Core::System.
 - Fixed design flaw where the message bar status could be set despite the game being stopped.
2017-06-02 18:40:39 -04:00
TheKoopaKingdom a8aef599e0 Created a whitelist of system archives to prevent false positives creating dialogs. 2017-06-02 18:28:14 -04:00
TheKoopaKingdom 37bec598ea Made some changes from review comments:
- Made LoadKernelSystemMode return a pair consisting of a system mode and a result code (Could use review).
- Deleted ErrorOpenGL error code in favor of just having ErrorVideoCore.
- Made dialog messages more clear.
- Compared archive ID in fs_user.cpp to ArchiveIdCode::NCCH as opposed to hex magic.
- Cleaned up some other stuff.
2017-06-02 18:28:14 -04:00
TheKoopaKingdom 1ecb322daa Added system for handling core errors in citra-qt. 2017-06-02 18:27:56 -04:00
bunnei f3e14cae1e core: Keep track of telemetry for the current emulation session. 2017-05-24 19:16:22 -04:00
Yuri Kunde Schlesner f18d454eb6 Kernel: Map special regions according to ExHeader
This replaces the hardcoded VRAM/DSP mappings with ones made based on
the ExHeader ARM11 Kernel caps list. While this has no visible effect
for most applications (since they use a standard set of mappings) it
does improve support for system modules and n3DS exclusives.
2017-05-09 21:44:00 -07:00
Yuri Kunde Schlesner b285c2a4ed Core: Make PerfStats internally locked
More ergonomic to use and will be required for upcoming changes.
2017-02-26 17:22:03 -08:00
Yuri Kunde Schlesner c75ae6c585 Add performance statistics to status bar 2017-02-26 17:22:03 -08:00
Yuri Kunde Schlesner da6a40e3d1 core: Free AppLoader on shutdown to release file (#2558)
Fixes #2455
2017-02-11 03:29:46 -08:00
wwylele fe2ed4bf72 Core: reset cpu_core in Shutdown to make IsPoweredOn work properly 2016-12-24 20:55:38 +02:00
bunnei e26fbfd1d7 core: Replace "AppCore" nomenclature with just "CPU". 2016-12-22 00:27:46 -05:00
bunnei 5ac5cbeab7 Address clang-format issues. 2016-12-21 23:48:14 -05:00
bunnei 4fc8b8229e core: Remove HLE module, consolidate code & various cleanups. 2016-12-21 23:48:13 -05:00
bunnei 232ef55c1a core: Consolidate core and system state, remove system module & cleanups. 2016-12-21 23:29:13 -05:00
Lioncash ba20dd9b61 gdbstub: Remove global variable from public interface
Currently, this is only ever queried, so adding a function to check if the
server is enabled is more sensible.

If directly modifying this externally is ever desirable, it should be done
by adding a function to the interface, rather than exposing implementation
details directly.
2016-12-15 16:37:22 -05:00
Yuri Kunde Schlesner 84fbbe2629 Use negative priorities to avoid special-casing the self-include 2016-09-21 00:15:56 -07:00
Emmanuel Gil Peyrot ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner 396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
bunnei 14085ec670 core: Add configuration option for CPU JIT. 2016-09-15 17:49:27 -04:00
bunnei 75cbfeee58 Merge pull request #1762 from bunnei/global
hle: Get rid of direct global access to g_reschedule
2016-05-05 21:45:57 -04:00
bunnei 4cb2995c61 HLE: Rename RescheduleIsPending to IsReschedulePending. 2016-05-05 21:34:10 -04:00
MerryMage a06dcfeb61 Common: Remove Common::make_unique, use std::make_unique 2016-04-05 13:31:17 +01:00
Lioncash 6b7ebb3f82 hle: Get rid of global access to g_reschedule
This shouldn't be directly exposed if there's already a partial API that operates on it.
We can just provide the rest of that API.
2016-03-21 02:57:12 -04:00
LittleWhite 4be68dddfb Improve error report from Init() functions
Add error popup when citra initialization failed
2016-03-08 22:05:25 +01:00
Lioncash cee8df6ff0 core: Use unique_ptr for holding the interpreter instances 2015-12-29 18:03:08 -05:00
polaris- 31dee93e84 Implement gdbstub 2015-10-04 11:16:59 -04:00
Emmanuel Gil Peyrot aea15f5c73 Core: Cleanup core includes. 2015-06-28 00:36:54 +01:00
Yuri Kunde Schlesner 7ada357b2d Memmap: Re-organize memory function in two files
memory.cpp/h contains definitions related to acessing memory and
configuring the address space
mem_map.cpp/h contains higher-level definitions related to configuring
the address space accoording to the kernel and allocating memory.
2015-05-15 00:04:38 -03:00
Yuri Kunde Schlesner 4f7a055081 Thread: Remove the idle thread
Instead just use nullptr to represent no thread is active.
2015-05-11 22:39:39 -03:00
Subv 000876858d Core/Memory: Give every emulated thread it's own TLS area.
The TLS area for thread T with id Ti is located at TLS_AREA_VADDR + (Ti - 1) * 0x200.
This allows some games like Mario Kart 7 to continue further.
2015-05-10 18:35:37 -05:00
Yuri Kunde Schlesner 1c0b87edc2 Memory: Re-organize and rename memory area address constants 2015-05-09 01:29:52 -03:00
Yuri Kunde Schlesner e1fbac3ca1 Common: Remove common.h 2015-05-07 15:45:22 -03:00
Lioncash 8004d35ea1 core: Migrate 3DS-specific CP15 register setting into Init 2015-04-06 13:01:19 -04:00
Lioncash b7fac494cd dyncom: Switch the app and system cores into the correct mode at initialization 2015-02-12 21:54:28 -05:00
Lioncash f44781fd7b arm: Adios armemu 2015-01-31 20:43:03 -05:00
Yuri Kunde Schlesner 9bf8462b96 Thread: Reduce use of Handles and move some funcs to inside the class. 2015-01-09 04:02:15 -02:00
Yuri Kunde Schlesner 7b3452c730 Move ThreadContext to core/core.h and deal with the fallout 2015-01-09 03:51:55 -02:00
Subv 40c1439c34 Core: Fixed a crash and removed some unused variables.
ARM_Disasm only has static methods, so there's no need to have an instance of it.
2015-01-08 21:49:41 -05:00
Subv 60a373a786 Threads: Use a dummy idle thread when no other are ready.
This thread will not actually execute instructions, it will only advance the timing/events and try to yield immediately to the next ready thread, if there aren't any ready threads then it will be rescheduled and start its job again.
2015-01-07 20:31:31 -05:00
bunnei 853b46c681 Core: Change default CPU to dyncom. 2015-01-02 22:33:53 -05:00
purpasmart96 ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Yuri Kunde Schlesner 0600e2d8b5 Convert old logging calls to new logging macros 2014-12-13 02:08:02 -02:00
Lioncash 7cbecde2ca Add static to some variables 2014-11-18 20:04:00 -05:00
archshift 0783498f57 Use configuration files to enable or disable the new dyncom interpreter. 2014-10-27 18:35:21 -07:00
archshift 6e606c515f core: Prune redundant includes 2014-09-08 17:54:14 -07:00
bunnei eb36d3fc90 Core: Refactor core to use only one function for execution.
Core: Cleaned up comment to be more readable.

Citra: Changed loop to be more readable.
2014-08-30 23:23:38 -04:00
bunnei ec14ffe1cd GSP: Implements preliminary command synchronization via GPU interrupts.
Core: Added a comment to explain the logic for the RunLoop iterations.
2014-08-05 23:57:53 -04:00
bunnei 004df76795 Merge branch 'threading' of https://github.com/bunnei/citra
Conflicts:
	src/core/hle/function_wrappers.h
	src/core/hle/service/gsp.cpp
2014-06-14 12:13:16 -04:00
bunnei c95972275e HLE: Updated all uses of NULL to nullptr (to be C++11 compliant) 2014-06-13 09:51:13 -04:00
bunnei 0deeda54ee Core: Cleaned up SingleStep(), updated default LCD refresh to assume each instruction is ~3 cycles 2014-06-13 09:51:09 -04:00
bunnei 3449aaa350 Core: Changed HW update/thread reschedule to occur more frequently (assume each instruction is ~3 cycles) 2014-06-13 09:51:09 -04:00
bunnei 174cc9a0ed hle: added a hokey way to force a thread reschedule during CPU single step mode (as used by the debugger) 2014-06-05 00:26:48 -04:00
bunnei 9839f3b6cd core: changed time delay before kernel reschedule to "approximate" a screen refresh 2014-05-29 20:30:17 -04:00
bunnei 51f636b3d4 core: added Kernel::Reschedule() call to check for thread changes, shortened delay time to 100 instructions 2014-05-22 22:54:07 -04:00
bunnei 265c770a9d updated how we call ARM core to make things much faster 2014-05-17 11:59:18 -04:00
bunnei 5d95bb9843 cleaned up some logging messages 2014-04-10 22:45:40 -04:00
bunnei f68de21ad1 added initial modules for setting up SysCall HLE 2014-04-10 19:58:28 -04:00
bunnei de0a034a84 fixed project includes to use new directory structure 2014-04-08 20:15:08 -04:00
bunnei 63e46abdb8 got rid of 'src' folders in each sub-project 2014-04-08 19:25:03 -04:00
Renamed from src/core/src/core.cpp (Browse further)