Commit graph

444 commits

Author SHA1 Message Date
Subv 82c84883a5 SVC: Implemented svcCreateSemaphore
ToDo: Implement svcReleaseSemaphore
* Some testing against hardware needed
2014-12-13 13:40:09 -05:00
Lioncash cfc0ee9c60 kernel: Remove unused log arguments 2014-12-13 10:15:58 -05:00
Yuri Kunde Schlesner 0600e2d8b5 Convert old logging calls to new logging macros 2014-12-13 02:08:02 -02:00
Yuri Kunde Schlesner 616d874443 New logging system 2014-12-13 01:59:52 -02:00
bunnei a6791e4fc7 Merge pull request #267 from bunnei/apt-shared-font
APT shared font loading
2014-12-12 22:12:12 -05:00
bunnei 6fe61d3deb APT_U: Added GetSharedFont service function. 2014-12-12 22:06:10 -05:00
bunnei 988998cca5 DSP: Added stub for ReadPipeIfPossible. 2014-12-12 00:53:51 -05:00
bunnei 4cb7a44d4e MemMap: Renamed "GSP" heap to "linear", as this is not specific to GSP.
- Linear simply indicates that the mapped physical address is always MappedVAddr+0x0C000000, thus this memory can be used for hardware devices' DMA (such as the GPU).
2014-12-12 00:15:47 -05:00
bunnei 3a75c8069e Merge pull request #256 from Subv/mutex
Kernel/Mutex: Properly lock the mutex when a thread enters it
2014-12-10 22:52:55 -05:00
Emmanuel Gil Peyrot 5a3b1b5f44 CFG:U: Store country codes as u16 instead of char pointers, and return the correct error in GetCountryCodeID. 2014-12-10 22:33:23 +00:00
bunnei f94d8f9603 GSP: Trigger GPU interrupts at more accurate locations. 2014-12-09 19:07:14 -05:00
bunnei e90b37b935 GSP: Updated TriggerCmdReqQueue to return success code. 2014-12-09 19:07:14 -05:00
bunnei 3e1654eaa8 GSP: Updated RegisterInterruptRelayQueue to return expected magic number. 2014-12-09 19:07:14 -05:00
bunnei 170123982d GPU: Fixed bug in command list size decoding. 2014-12-09 19:07:13 -05:00
bunnei b7327f807c Merge pull request #217 from archshift/cmd_buff
Log the cmd_buff arguments when citra comes across an unimplemented function
2014-12-08 23:13:07 -05:00
bunnei dd203f7068 Thread: Fixed to wait on address when in arbitration. 2014-12-08 19:44:10 -05:00
archshift 20d2ed0950 Make OpenDirectory fail if the directory doesn't exist
This is in line with what the hardware itself does.

It does this by splitting the initial directory opening into Directory.Open(), which will return false if a stat fails.
Then, Archive::OpenDirectory will return nullptr, and archive.cpp will return an error code .
2014-12-07 14:47:14 -08:00
Subv bc318c464b Mutex: Remove some forward declarations
Moved Mutex::WaitSynchronization to the end of the file.
2014-12-07 15:57:28 -05:00
Subv 64128aa61a Mutex: Release all held mutexes when a thread exits. 2014-12-07 15:44:21 -05:00
Subv e3c8e4901c Mutex: Properly lock the mutex when a thread enters it
Also resume only the next immediate thread waiting for the mutex when it is released, instead of resuming them all.
2014-12-05 23:40:43 -05:00
bunnei 17fae11fc7 Merge pull request #250 from Subv/cbranch_2
SVC: Implemented GetThreadId.
2014-12-04 22:15:03 -05:00
bunnei 5056329a80 Merge pull request #222 from archshift/renamexyz
Implemented RenameFile and RenameDirectory in FS:USER
2014-12-04 22:07:47 -05:00
bunnei 21d183e1e6 Merge pull request #248 from lioncash/kernel
Misc minor kernel-related changes.
2014-12-04 22:05:20 -05:00
Subv 6fac2bf0ab Threads: Remove a redundant function.
Use the next_thread_id variable directly.
2014-12-04 14:59:56 -05:00
Subv ef1d5cda06 Threads: Implemented a sequential thread id 2014-12-04 08:13:53 -05:00
archshift 139a4d91d9 Updated archive.cpp functions for proper error handling 2014-12-03 22:50:44 -08:00
Subv 029ff9f1fd SVC: Implemented GetThreadId.
For now threads are using their Handle value as their Id, it should not really cause any problems because Handle values are unique in Citra, but it should be changed. I left a ToDo there because this is not correct behavior as per hardware.
2014-12-04 00:25:35 -05:00
bunnei 306b5392ca Merge pull request #247 from lioncash/const
hid_user: Pass by reference with PadButtonPress/PadButtonRelease
2014-12-03 23:56:35 -05:00
bunnei abbc340957 Merge pull request #238 from archshift/dsp
Add stub for ConvertProcessFromDspDram
2014-12-03 23:35:06 -05:00
archshift a404ad5272 Add stub for ConvertProcessFromDspDram
Should theoretically push retail stuff further along
2014-12-03 20:03:57 -08:00
Lioncash 208598dbe2 kernel: Shorten GetCount 2014-12-03 22:52:02 -05:00
Lioncash 9b68d5e074 kernel: Make some functions const 2014-12-03 19:48:34 -05:00
Lioncash 7ff8f0d916 hid_user: Pass by reference with PadButtonPress/PadButtonRelease 2014-12-03 19:33:54 -05:00
purpasmart96 16fc98af64 PTM_U: Added a stub for GetBatteryLevel & GetBatteryChargeState & GetAdapterState 2014-12-03 15:09:59 -08:00
bunnei e5b2733801 Merge pull request #231 from purpasmart96/serv_ac_wifi_status
AC_U: Added a stub for GetWifiStatus
2014-12-03 10:00:13 -05:00
bunnei e2e56c7bac Merge pull request #219 from Subv/ptm
PTM_U: Implemented the GetShellState function.
2014-12-03 09:58:52 -05:00
purpasmart96 32d420330d AC_U: Added a stub for GetWifiStatus 2014-12-02 15:30:42 -08:00
bunnei 884ecd58ea Merge pull request #224 from bunnei/dsp-service-improvements
Dsp service improvements
2014-11-30 23:21:34 -05:00
bunnei b0a5b3d986 Merge pull request #214 from Subv/master
CFG:U: Implemented the GetCountryCodeID and GetCountryCodeString
2014-11-30 23:19:07 -05:00
bunnei 3e286fff7c DSP: Added stubs for several commonly used DSP service functions. 2014-11-30 23:14:57 -05:00
bunnei 45fd3fe5c4 DSP: Fixed typo in port name. 2014-11-30 23:14:48 -05:00
Subv 4cdaac44d3 PTM_U: Implemented the GetShellState function. 2014-11-30 19:50:14 -05:00
bunnei e3d1ffff4b Merge pull request #225 from bunnei/fix-release-mutex
Mutex: Changed behavior to always release mutex for all threads.
2014-11-30 08:47:49 -05:00
bunnei a5afad0937 Merge pull request #226 from bunnei/svc-and-thread-fixes
Svc and thread fixes
2014-11-30 08:41:49 -05:00
Subv 5753da89e4 CFG:U: Implemented the GetCountryCodeID and GetCountryCodeString. 2014-11-29 21:16:28 -05:00
vaguilar 223e76d51d Fixed formatting and switch statement warnings 2014-11-27 02:59:14 -08:00
bunnei de851ba1a1 Thread: Check that thread is actually in "wait state" when verifying wait. 2014-11-26 15:04:08 -05:00
bunnei f985469901 SVC: Add debug log to ArbitrateAddress. 2014-11-26 15:04:07 -05:00
bunnei e0e7443517 SVC: SleepThread should yield to the next ready thread. 2014-11-26 15:04:07 -05:00
bunnei a449e0e11a Mutex: Changed behavior to always release mutex for all threads. 2014-11-26 14:38:42 -05:00
archshift 43a682a106 Log the cmd_buff arguments when citra comes across an unimplemented function 2014-11-24 15:51:48 -08:00
archshift e5ff01c2cd Implemented RenameDirectory in FS:USER 2014-11-24 15:09:12 -08:00
archshift 45afc15aa6 Implemented RenameFile in FS:USER 2014-11-24 15:09:11 -08:00
Yuri Kunde Schlesner 8189593255 Use pointers instead of passing handles around in some functions. 2014-11-24 17:08:37 -02:00
Yuri Kunde Schlesner 22c86824a4 Remove duplicated docs/update them for changed parameters. 2014-11-24 17:08:36 -02:00
Yuri Kunde Schlesner c2588403c0 HLE: Revamp error handling throrough the HLE code
All service calls in the CTR OS return result codes indicating the
success or failure of the call. Previous to this commit, Citra's HLE
emulation of services and the kernel universally either ignored errors
or returned dummy -1 error codes.

This commit makes an initial effort to provide an infrastructure for
error reporting and propagation which can be use going forward to make
HLE calls accurately return errors as the original system. A few parts
of the code have been updated to use the new system where applicable.

One part of this effort is the definition of the `ResultCode` type,
which provides facilities for constructing and parsing error codes in
the structured format used by the CTR.

The `ResultVal` type builds on `ResultCode` by providing a container for
values returned by function that can report errors. It enforces that
correct error checking will be done on function returns by preventing
the use of the return value if the function returned an error code.

Currently this change is mostly internal since errors are still
suppressed on the ARM<->HLE border, as a temporary compatibility hack.
As functionality is implemented and tested this hack can be eventually
removed.
2014-11-24 17:08:36 -02:00
bunnei ef1b16a7eb Merge pull request #191 from archshift/deletexyz
Added DeleteFile and DeleteDirectory functions to FS:USER and the archives.
2014-11-23 20:02:23 -05:00
archshift 8aeadbd95a Added DeleteFile and DeleteDirectory functions to FS:USER and the archives. 2014-11-23 00:33:43 -08:00
purpasmart96 9821bfcb8e Add more services and some fixes, along with more "override"
in the service's headers
2014-11-20 17:09:57 -08:00
bunnei c0cd0fa78e Merge pull request #211 from linkmauve/master
Remove trailing spaces from the entire project
2014-11-19 15:24:46 -05:00
bunnei 112768f436 Merge pull request #208 from lioncash/statics
Add static to some variables
2014-11-19 09:39:20 -05:00
Emmanuel Gil Peyrot f5d38649c7 Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated 2014-11-19 09:03:07 +00:00
Lioncash 7cbecde2ca Add static to some variables 2014-11-18 20:04:00 -05:00
purpasmart96 66431bceda Kernel:Add missing permissions in shared memory & svc 2014-11-18 15:57:25 -08:00
Lioncash 1a8f466217 Remove extraneous semicolons 2014-11-18 08:27:16 -05:00
Lioncash 72846c418e core: Mark some hle functions as static
These functions are not referred to by their linkage name outside of the translation unit, so they can be marked as static.
2014-11-17 22:41:49 -05:00
bunnei 11641b5e79 Archive: Fixed to not destroy archive handle on close. 2014-11-17 22:19:14 -05:00
bunnei bcb0dbf7e1 Archive: Fixed close archive before freeing. 2014-11-17 22:19:14 -05:00
bunnei 3e09c07378 FS_User: Support FileSye::Path in a more generic way.
added a todo to kernel archive
2014-11-17 22:18:58 -05:00
bunnei a3107a6b57 FileSys: Updated backend code to use FileSys::Path instead of string for paths. 2014-11-17 21:49:24 -05:00
archshift e27f169acb Add missing boss:U service, needed according to Nintendo Zone logs. 2014-11-17 07:31:37 -08:00
Lioncash ac58b76e71 Fix two format strings. 2014-11-14 12:08:26 -05:00
bunnei 3cfdabb2e3 Merge pull request #183 from archshift/lowpath
Add support for UTF-16 strings for LowPaths in FS:USER
2014-11-12 22:56:27 -05:00
archshift 1f7c4ab7f6 Use std::u16string for conversion between UTF-8 and UTF-16, FS:USER functions 2014-11-12 19:30:17 -08:00
bunnei a490490336 Merge pull request #188 from bunnei/apt-fixes
APT_U: Various improvements and bug fixes.
2014-11-12 00:06:45 -05:00
bunnei 9fb549cb84 APT_U: Added stub for function AppletUtility. 2014-11-11 23:51:54 -05:00
bunnei 19cfcfe8c0 APT_U: Set a valid parameter buffer size in GlanceParameter.
- Also Clarified GlanceParameter/ReceiveParameter documentation.
2014-11-11 23:51:54 -05:00
bunnei 8eced1b697 APT_U: Release service lock on initialization. 2014-11-11 23:51:54 -05:00
bunnei 0df9c34410 APT_U: Fixes for GetLockHandle to boot system titles.
- Also added comment to GetLockHandle function.
2014-11-11 23:51:33 -05:00
archshift 37e582c395 Add FRD:U service and functions 2014-11-10 22:43:45 -08:00
archshift 0ad5964c8b Add support for UTF-16 strings for LowPaths in FS:USER 2014-11-10 10:53:26 -08:00
bunnei 9be17e4d84 Merge pull request #163 from archshift/create-directory
Added CreateDirectory function to service/fs.cpp, and in Archive.
2014-11-02 17:15:52 -05:00
archshift 04c90c395d Added CreateDirectory function to service/fs.cpp, and in Archive. 2014-11-02 10:48:28 -08:00
archshift 40a84833ae Added ReceiveNotification, PublishToSubscriber unimplemented functions to SRV 2014-11-01 23:15:38 -07:00
archshift c22923f8c4 Added stub err:f service. 2014-11-01 20:07:59 -07:00
purpasmart96 539b4c883d Added a bunch of services 2014-11-01 15:28:35 -07:00
bunnei 01e37962e7 Merge pull request #162 from SeannyM/warning-fixes
Fix some warnings
2014-10-29 21:07:27 -04:00
archshift ed797a4354 FS:USER - Implemented IsSdmcDetected 2014-10-29 17:43:48 -07:00
Sean 9a012ff007 Fix some warnings 2014-10-29 20:26:15 -04:00
Gareth Poole 38df9e96dd Renamed souce files of services to match port names 2014-10-29 15:55:51 -04:00
bunnei a110b06fb6 Merge pull request #141 from archshift/crash-hunt
hid.cpp: Fixed crash when updating pad data while null
2014-10-27 21:35:01 -04:00
Yuri Kunde Schlesner d72708c1f5 Add override keyword through the code.
This was automated using `clang-modernize`.
2014-10-26 16:18:05 -02:00
bunnei 53a22b84da ARM: Integrate SkyEye faster "dyncom" interpreter.
Fixed typo (make protected member public)

Added license header back in. I originally removed this because I mostly rewrote the file, but meh

ARM: Fixed a type error in dyncom interpreter.

ARM: Updated dyncom to use unique_ptr for internal ARM state.
2014-10-25 14:11:39 -04:00
Emmanuel Gil Peyrot 2d960f5040 Don’t fail on empty filename in OpenFileDirectly, return the archive handle instead 2014-10-25 16:12:57 +00:00
archshift 366ae1b351 hid.cpp: Fixed crash when updating pad data while null
Fixes #137
2014-10-13 22:18:03 -07:00
bunnei 8d1154c24e Merge pull request #128 from purpasmart96/master
APT:U Added a stub fuction for "GlanceParameter"
2014-10-07 20:30:21 -04:00
purpasmart96 20f15f31dd APT: Added a stub for the "GlanceParameter" function. 2014-10-07 17:10:54 -07:00
Emmanuel Gil Peyrot 0be5c03176 FileSys: split the constructor into an Open method, in order to notify the opener something went wrong.
Kernel: Return an invalid handle to OpenFile when it failed to open.
2014-10-06 19:58:42 +02:00
Emmanuel Gil Peyrot 23c2fbfc7a FileSys/Kernel: Implement SetSize service call for File objects. 2014-10-06 19:58:37 +02:00
purpasmart96 1d0ac47832 Added some more names to the function table
Added "SetApplicationCpuTimeLimit" and "GetApplicationCpuTimeLimit" to apt.cpp
2014-10-04 15:01:36 -07:00
purpasmart96 7d6f7684e1 added "StoreDataCache" to the function table
seems simple enough
2014-09-30 09:13:29 -07:00
archshift 1966f7b0ad Use the citra user path for the sdmc directory 2014-09-21 09:34:33 -07:00
Emmanuel Gil Peyrot 3a570a9fee Kernel: Implement the Close command for Archive, File and Directory. 2014-09-17 14:35:46 +00:00
Emmanuel Gil Peyrot 99bfa4ae1f FS: Implement OpenArchive, OpenDirectory, OpenFile and OpenFileDirectly calls. 2014-09-17 14:35:46 +00:00
Emmanuel Gil Peyrot c197ce2180 Kernel: Add a Directory object and a getter for it from an Archive object. 2014-09-17 14:35:46 +00:00
Emmanuel Gil Peyrot 19d04f3abe Kernel: Add a File object and a getter for it from an Archive object. 2014-09-17 14:35:46 +00:00
Lioncash 741321ac24 Core: Get rid of unnecessary switch statement in Kernel 2014-09-14 21:31:09 -04:00
Kevin Hartman 02fd19b2f6 Added support for multiple input device types for KeyMap and connected Qt. 2014-09-12 01:15:14 -07:00
Kevin Hartman 4a94ec934a Initial HID PAD work, with GLFW only. 2014-09-11 22:43:42 -07:00
Kevin Hartman bb7ddede15 Created structure for PAD. 2014-09-11 22:43:42 -07:00
bunnei 532a9e80a0 Merge pull request #99 from archshift/ext-check
loader.cpp: improved file extension checking, made Upper/LowerStr useful, moved string_util into Common namespace
2014-09-11 00:04:36 -04:00
archshift 6e606c515f core: Prune redundant includes 2014-09-08 17:54:14 -07:00
archshift 5472fd4d9b Added string_util to common, small changes in loader.cpp 2014-09-08 15:43:22 -07:00
Lioncash d30747efea core: Pass string by reference in FetchFromPortName and DeleteService 2014-09-06 13:30:27 -04:00
bunnei 304999dfeb Threading: Fix thread starting to execute first instruction correctly. 2014-08-28 17:51:49 -04:00
bunnei fb908b9395 srv::Initialize: Return "success" status code. 2014-08-28 17:51:41 -04:00
Tony Wasserka 26ade98411 Pica/citra-qt: Replace command list view and command list debugging code with something more sophisticated. 2014-08-25 22:03:18 +02:00
Tony Wasserka 14b24a75b3 GSP: Update framebuffer information when necessary. 2014-08-25 22:03:18 +02:00
Tony Wasserka 590c206ac8 GSP: Implement SetBufferSwap. 2014-08-25 22:03:18 +02:00
Tony Wasserka e832bbe554 GSP: Add a helper function for convenience. 2014-08-25 22:02:33 +02:00
archshift 4c4a01bf41 Added FS functions to Archive and Archive_RomFS 2014-08-22 15:45:10 -07:00
Lioncash ab4648d3ca Core: Use std::array for managing kernel object space
These avoid relying on memset for clearing the arrays.
2014-08-19 00:32:48 -04:00
bunnei e9c5c563a5 Merge pull request #55 from lioncash/string
Core: Alter the kernel string functions to use std::string instead of const char*.
2014-08-18 21:42:44 -04:00
bunnei 10f25866e2 SVC: Added support for svc_GetSystemTick.
Changed HLE function return methods to be static inline functions.
2014-08-18 21:26:20 -04:00
Lioncash 98fa3f7cba Core: Alter the kernel string functions to use std::string instead of const char*.
Most functions already operate on std::strings. This also removes the need to manually null terminate thread names.
2014-08-17 23:12:20 -04:00
Lioncash 986dd27392 Core: Fix a formatting error in svc.cpp
entry_point would not be added to the string. Also used StringFromFormat
so that the buffer is unnecessary.
2014-08-17 14:28:39 -04:00
bunnei bf7bc3dacd Merge pull request #39 from bunnei/hid-minor-improvements
Hid minor improvements
2014-08-12 18:23:17 -04:00
bunnei 091f6cf55b HID: Added new function entries from 3dbrew to FunctionTable.
HID: Fix typo with DisableGyroscopeLow command.
2014-08-12 18:08:09 -04:00
Tony Wasserka 7b6a7d7dfb Pica/GPU: Change hardware registers to use physical addresses rather than virtual ones.
This cleans up the mess that address reading/writing had become and makes the code a *lot* more sensible.
This adds a physical<->virtual address converter to mem_map.h. For further accuracy, we will want to properly extend this to support a wider range of address regions. For now, this makes simply homebrew applications work in a good manner though.
2014-08-12 13:32:56 +02:00
Tony Wasserka bd798390d5 GSP: Fix a major regression introduced in ffda035c, due to which no display transfers were triggered at all anymore. 2014-08-12 13:32:18 +02:00
Tony Wasserka 9c781a6c76 Remove the fancy RegisterSet class introduced in 4c2bff61e.
While it was some nice and fancy template usage, it ultimately had many practical issues regarding length of involved expressions under regular usage as well as common code completion tools not being able to handle the structures.
Instead, we now use a more conventional approach which is a lot more clean to use.
2014-08-12 02:17:21 +02:00
bunnei 552287498a HID: Implemented HID_User::GetIPCHandles service function. 2014-08-07 20:27:56 -04:00
bunnei 66f91b4346 SVC: Fixed typo with MapMemoryBlock DEBUG_LOG call. 2014-08-07 20:27:11 -04:00
bunnei d4bd2f2e5d Thread: Added more descriptive comment to WaitCurrentThread. 2014-08-06 18:19:59 -04:00
bunnei cad2f21985 GSP: Cleaned up command buffer decoding.
GSP: Cleaned up code and added additional comments.

GSP: Removed unnecessary TODO comment.

GSP: Changed u32 iterators in TriggerCmdReqQueue to unsigned.
2014-08-06 18:19:56 -04:00
bunnei 36fd1c169e GSP: Added reinitialization of other state objects. 2014-08-05 23:58:00 -04:00
bunnei 4e9f305ed2 GSP: Removed dumb GX prefixes to functions/structs in GSP namespace.
- Various other cleanups.
2014-08-05 23:58:00 -04:00
bunnei 99e404e221 GSP: Removed unnecessary GX_FinishCommand function. 2014-08-05 23:57:59 -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 2542350b85 AddressArbiter: Removed unnecessary HLE::Reschedule. 2014-08-05 23:54:28 -04:00
bunnei 60078baab1 AddressArbiter: Fixed bug with break statements missing from case statements. 2014-08-05 23:54:27 -04:00
bunnei 1b247b8031 SRV: Updated GetProcSemaphore to create an event instead of a mutex. 2014-08-05 23:54:27 -04:00
bunnei 4d4607041b SVC: Removed ArbitrateAddress log message that spams to much. 2014-08-05 23:53:58 -04:00
bunnei 7a1f813be1 Kernel: Updated Event and Mutex to specify handle that they are blocking for. 2014-08-05 20:14:51 -04:00
bunnei 81fa804b3c FS: Fix port name (old port name was based on an unaligned memory read). 2014-08-05 19:58:33 -04:00
Tony Wasserka afcb250b31 Fix a few warnings.
Templates shouldn't be marked as inline if they aren't defined in the header.
2014-07-23 00:44:31 +02:00
Tony Wasserka 4b141791ed GSP: Add a few comments. 2014-07-23 00:44:31 +02:00
Tony Wasserka 9b0d0c81a0 GSP: Clean up GX command processing a lot and treat command id as a u8 rather than a u32.
Anonymous structs are not standard C++, hence don't use them.
2014-07-23 00:44:31 +02:00
Tony Wasserka 75775e9ef4 GPU: Make use of RegisterSet. 2014-07-23 00:33:08 +02:00
Tony Wasserka baf0aa04f5 GPU: Emulate memory fills. 2014-07-23 00:33:08 +02:00