Commit graph

491 commits

Author SHA1 Message Date
bunnei
9eaef4e04a Merge pull request #413 from purpasmart96/serv_clean
Services: Clean up a few things and add a few function names
2015-01-05 22:48:58 -05:00
bunnei
9b83f0e158 Merge pull request #272 from rohit-n/sign-compare
Silence some -Wsign-compare warnings.
2015-01-05 22:10:56 -05:00
purpasmart96
379b39e583 Services: Clean up a few things and add a few function names 2015-01-05 16:07:15 -08:00
bunnei
e9650f1c61 DSP: Signal (faked) interrupt on every frame.
- Hack to work around games checking that the DSP event has been signaled by a real DSP interrupt.
2015-01-05 00:25:37 -05:00
bunnei
cc23269ff4 Merge pull request #407 from Subv/arbiter
AddressArbiter: Ported arbitration type 2 from 3dmoo.
2015-01-05 00:05:50 -05:00
bunnei
96e6b2aa50 Merge pull request #408 from Subv/mutex
Mutex: Add the calling thread to the waiting list when needed
2015-01-04 22:55:53 -05:00
bunnei
26f31a2dfb Merge pull request #386 from archshift/y2ru
Stub the y2r:u service
2015-01-04 21:40:58 -05:00
Subv
ea80363cc2 Mutex: Add the calling thread to the waiting list when needed
This will happen when the mutex is already owned by another thread. Should fix some issues with games being stuck due to waiting threads not being awoken.
2015-01-04 12:52:34 -05:00
Subv
90dffe3fc1 Archives: Make SYSTEM_ID and SDCARD_ID strings 2015-01-04 09:10:27 -05:00
Subv
71a063f45c Archives: Changed the way paths are built for the archives.
Each archive now takes a mount point of either NAND or SDMC, and builds its own directory structure there, trying to simulate an HLE-friendly hardware layout
2015-01-03 20:46:05 -05:00
archshift
48130b1eaa Stub the y2r:u service 2015-01-03 16:42:39 -03:00
Subv
0276a75f24 AddressArbiter: Ported arbitration type 2 from 3dmoo.
(Thanks 3dmoo!)
2015-01-03 12:09:11 -05:00
Subv
3bc9f5509b Archives: Change the folder layout of some archives.
This is to better represent the hardware layout, they are still aren't quite accurate, but this better and will help a bit when implementing the other archives like NAND-RO and NAND-RW
2015-01-02 21:55:13 -05:00
Subv
aade417b14 Archives: Reduced duplicate code in RomFS and SaveCheck.
Fixed a few warnings and cleaned up the code
2015-01-02 21:13:54 -05:00
Subv
13efbdc201 SaveDataCheck: Preliminary work in this archive.
This allows Steel Diver to boot further, some files are needed.

This is still not ready and needs a big cleanup, this will possibly be delayed until the way we handle archives is fixed (with factory classes instead of ahead-of-time creation of archives)
2015-01-02 21:13:53 -05:00
bunnei
3d9bf13439 Merge pull request #391 from lioncash/pedantic
archive/elf: Minor misc changes.
2015-01-02 21:04:49 -05:00
Lioncash
0d81b1e75b archive: Fix initializer list order 2015-01-02 20:30:57 -05:00
Lioncash
bdbd111c7e soc_u: Fix a missing formatting argument 2015-01-02 19:54:21 -05:00
Rohit Nirmal
c589d82052 Silence some -Wsign-compare warnings. 2015-01-01 16:38:36 -06:00
Subv
97a7381d29 SOC_U: Preliminary implementation of sockets.
Stubbed CreateMemoryBlock

Using Berkeley sockets, and Winsock2.2 on Windows.
So far ftpony creates the socket and accepts incoming connections

SOC_U: Renamed functions to maintain consistency

Also prevents possible scope errors / conflicts with the actual Berkeley socket functions

SOCU: Close all the opened sockets when cleaning up SOCU
2014-12-31 10:51:44 -05:00
Subv
545ded954d APT:A: Some style changes 2014-12-29 22:59:28 -05:00
Subv
2c89d4d5cd Archives: Implemented ExtSaveData and SharedExtSaveData
They will be stored in /extsavedata/SDMC and /extsavedata/NAND respectively.
Also redirect some APT_A functions to their APT_U equivalents.
Implemented the gamecoin.dat file in SharedExtSaveData in the PTM module.
Implemented formatting the savegame.
Retake a previous savegame if it exists instead of reporting them as not formatted every time a game is loaded.
2014-12-29 22:29:55 -05:00
Yuri Kunde Schlesner
7e2903cb74 Kernel: New handle manager
This handle manager more closely mirrors the behaviour of the CTR-OS
one. In addition object ref-counts and support for DuplicateHandle have
been added.

Note that support for DuplicateHandle is still experimental, since parts
of the kernel still use Handles internally, which will likely cause
troubles if two different handles to the same object are used to e.g.
wait on a synchronization primitive.
2014-12-28 11:52:55 -02:00
Yuri Kunde Schlesner
23f2142009 Kernel: Replace GetStaticHandleType by HANDLE_TYPE constants 2014-12-28 11:52:53 -02:00
Yuri Kunde Schlesner
73fba22c01 Rename ObjectPool to HandleTable 2014-12-28 11:52:52 -02:00
bunnei
e5ddbfee02 Merge pull request #339 from bunnei/fixup-gsp-synch
Fixup gsp synch
2014-12-25 22:52:40 -05:00
bunnei
5d2ee78d8f Merge pull request #330 from purpasmart96/new_srv
More services & small clean ups
2014-12-25 22:51:38 -05:00
bunnei
4783133bbd ARM: Add a mechanism for faking CPU time elapsed during HLE.
- Also a few cleanups.
2014-12-25 22:46:44 -05:00
purpasmart96
9796bc1fa2 More services & small clean ups 2014-12-25 19:08:33 -08:00
archshift
81a538ccc2 Stubbed IsSdmcWriteable to always return writeable. 2014-12-23 22:22:48 -03:00
bunnei
2188af4a65 Merge pull request #322 from chinhodado/master
More warning cleanups
2014-12-22 00:12:43 -05:00
Subv
2030f9d946 CFG: Fixed some warnings and errors in Clang 2014-12-21 18:25:49 -05:00
Subv
304735fb52 CFG: More style changes 2014-12-21 18:02:27 -05:00
Subv
f080e3ccfa CFGU: Indentation 2014-12-21 17:54:14 -05:00
Subv
6f304d3b00 CFG: Some indentation 2014-12-21 17:41:35 -05:00
Subv
b3cee19289 CFG: Changed the CreateConfigInfoBlk search loop 2014-12-21 17:26:51 -05:00
Subv
3e94b9054c CFG: Corrected the licenses in cfg_i.cpp and cfg_u.cpp 2014-12-21 16:45:13 -05:00
Subv
6115f013a9 CFG: Create a new subfolder cfg inside service to handle cfg
Moved most of the shared CFG code there, implemented a few CFG:I functions
2014-12-21 16:41:06 -05:00
Subv
9e45240e23 CFGU: Some changes 2014-12-21 16:39:29 -05:00
Subv
cdd78fa01d CFGU: Addressed some issues. 2014-12-21 16:39:26 -05:00
Subv
718a120754 CFGU: Addressed some comments. 2014-12-21 16:39:23 -05:00
Subv
a1b9b80a55 Style: Addressed some comments 2014-12-21 16:39:20 -05:00
Subv
a7cc7972de CFG_U: Use Common::make_unique instead of the std version 2014-12-21 16:39:17 -05:00
Subv
9029efd873 CFG:U: Implemented some more blocks 2014-12-21 16:39:14 -05:00
Subv
8b0ee93526 CFG: Implemented block 0x00070001 in the config savefile 2014-12-21 16:39:11 -05:00
Subv
b3d1c8ba6a CFGU: Use an absolute offset in the config savefile blocks 2014-12-21 16:39:08 -05:00
Subv
95ca6ae1e1 CFG: Load the Config savedata file if it already exists. 2014-12-21 16:39:05 -05:00
Subv
b49bdb6ba7 CFGU: Added block 0x000A0002 to the default savegame file
That's the language id block, we're using LANGUAGE_EN for now. This block allows some games to boot further
2014-12-21 16:39:02 -05:00
Subv
4cd21b43c1 CFG: Refactored how the config file works.
It is now kept in memory as per 3dbrew, all updates happen on memory, then they can be saved using UpdateConfigNANDSavegame.
2014-12-21 16:38:59 -05:00
Subv
462740278d CFG:U: Add some data to the 0x00050005 config block.
Seems to allow some games to boot further, thanks @Normmatt for sharing this information
2014-12-21 16:38:57 -05:00
Subv
fa3d72ab3e CFG: Implemented the GetConfigInfoBlk2 function.
Added a "config" file to the CFG process service (CFG:U), and added a few default blocks to it.

Implemented GetSystemModel and GetModelNintendo2DS
2014-12-21 16:38:54 -05:00
bunnei
0de6a08d75 Merge pull request #291 from purpasmart96/license
License change
2014-12-21 16:05:44 -05:00
Chin
0199a7d9ef More warning cleanups 2014-12-21 10:58:55 -05:00
bunnei
572ce043c2 Merge pull request #271 from archshift/createf
Added CreateFile to the FS_USER service
2014-12-21 01:45:00 -05:00
archshift
0625dd09ea Added CreateFile to the FS_USER service
Tested with hwtests.
2014-12-21 02:21:49 -03:00
purpasmart96
ebfd831ccb License change 2014-12-20 21:20:24 -08:00
bunnei
4fcdbed9f6 Thread: Wait current thread on svc_SleepThread
- Removed unused VBLANK sleep mode
- Added error log for bad context switch
- Renamed VerifyWait to CheckWaitType to be more clear
2014-12-20 23:20:19 -05:00
bunnei
2e5869c939 Merge pull request #316 from yuriks/thread-handle
Kernel: Implement support for current thread pseudo-handle
2014-12-20 16:36:01 -05:00
bunnei
2b0d7a1d29 Merge pull request #315 from chinhodado/master
Clean up some warnings
2014-12-20 11:59:18 -05:00
Chin
e795692614 Clean up some warnings 2014-12-20 10:03:36 -05:00
Yuri Kunde Schlesner
82528ba7df Common: Add a clone of std::make_unique 2014-12-20 03:45:02 -02:00
Yuri Kunde Schlesner
adee775f44 Kernel: Implement support for current thread pseudo-handle
This boots a few (mostly Nintendo 1st party) games further.
2014-12-20 03:27:47 -02:00
bunnei
f1309e6bf0 Merge pull request #306 from Subv/even_more_savedata
SaveData: Added some documentation to FormatSaveData
2014-12-19 23:20:31 -05:00
Subv
fc73bef692 FS_U: Added the command to the docs of SaveData functions 2014-12-19 22:45:39 -05:00
bunnei
017e6a488e Merge pull request #302 from purpasmart96/flushshutup
GSP_GPU: Shut up FlushDataCache
2014-12-18 23:40:10 -05:00
purpasmart96
b2c64eb5ff GSP_GPU: Shut up FlushDataCache 2014-12-18 16:39:55 -08:00
bunnei
765dbabdb6 Merge pull request #308 from Subv/more_savedata
SystemSaveData: Fixed a typo that was segfaulting
2014-12-18 18:05:03 -05:00
Subv
78e0f36857 SystemSaveData: Fixed a typo that was segfaulting 2014-12-18 18:01:47 -05:00
bunnei
c71f8840e5 Merge pull request #301 from Subv/more_savedata
SaveData: Implemented the SystemSaveData archive.
2014-12-18 17:29:34 -05:00
Subv
77f0cdfaf4 SaveData: Added some documentation to FormatSaveData
We still don't know what the other parameters do, but they appear to be very similar to those of FormatThisUserSaveData.
Most likely FormatThisUserSaveData is just an alias for FormatSaveData with LowPathType Empty
2014-12-18 15:30:28 -05:00
Subv
bec527fa24 SaveData: Implemented the SystemSaveData archive.
It will be stored in the /syssavedata folder. This archive is user by various Services and possibly games via the FS:U service.
2014-12-17 23:44:32 -05:00
bunnei
7bae450379 Merge pull request #185 from purpasmart96/mem_perm
Kernel: Add missing permissions
2014-12-17 20:56:04 -05:00
Subv
ea9ce0fba7 Filesystem/Archives: Implemented the SaveData archive
The savedata for each game is stored in /savedata/<ProgramID> for NCCH files. ELF files and 3DSX files use the folder 0 because they have no ID information

Got rid of the code duplication in File and Directory

Files that deal with the host machine's file system now live in DiskFile, similarly for directories and DiskDirectory and archives with DiskArchive.

FS_U: Use the correct error code when a file wasn't found
2014-12-17 19:21:38 -05:00
Yuri Kunde Schlesner
082bf803ab Comment out empty arrays causing compile errors in MSVC 2014-12-16 01:37:13 -02:00
bunnei
cd2a31eaf4 Merge pull request #283 from yuriks/archive-refactor
Archive refactor
2014-12-15 22:15:08 -05:00
Yuri Kunde Schlesner
666f6deb47 Work around libstdc++'s lack of support for std::hash on enums 2014-12-16 01:09:21 -02:00
Yuri Kunde Schlesner
83e6e4ffec FS.Archive: Clean up treatment of archives and their handles
- Refactor FS::Archive internals to make Archive creation and lifetime
  management clearer.
- Remove the "Archive as a File" hack.
- Implement 64-bit Archive handles.
2014-12-16 01:08:44 -02:00
Yuri Kunde Schlesner
0931a42af0 Service.FS: Rename FileSys::File to FileBackend 2014-12-16 01:08:43 -02:00
Yuri Kunde Schlesner
d51afab0bc Service.FS: Rename FileSys::Directory to DirectoryBackend 2014-12-16 01:08:43 -02:00
Yuri Kunde Schlesner
82fe821e87 Service.FS: Rename FileSys::Archive to ArchiveBackend 2014-12-16 01:08:42 -02:00
Yuri Kunde Schlesner
f6153679b0 Service.FS: Do archive registration using IdCode instead of name 2014-12-16 01:08:42 -02:00
Yuri Kunde Schlesner
ca67bb7945 HLE: Rename namespaces to match move & fix initialization order 2014-12-16 01:08:38 -02:00
Yuri Kunde Schlesner
c72ccfa6db HLE: Move kernel/archive.* to service/fs/ 2014-12-16 01:08:14 -02:00
bunnei
5df176425b Merge pull request #282 from archshift/services
Added stubs for ldr:ro, cecd:u, nim:aoc, and am:app services
2014-12-15 19:28:13 -05:00
archshift
89eef9eb6d Added stub for nim:aoc service... 2014-12-15 15:32:42 -08:00
archshift
1356a6b313 Added stub for cecd:u service...
I couldn't find any information about this service...
2014-12-15 15:32:42 -08:00
archshift
6117fad036 Added stub for ldr:ro service... 2014-12-15 15:32:42 -08:00
archshift
6b51683bb1 Added am:app service stub.
Apparently nothing at all is known about this service...
2014-12-15 15:32:41 -08:00
Yuri Kunde Schlesner
e321decf98 Remove SyncRequest from K::Object and create a new K::Session type
This is a first step at fixing the conceptual insanity that is our
handling of service and IPC calls. For now, interfaces still directly
derived from Session because we don't have the infrastructure to do it
properly. (That is, Processes and scheduling them.)
2014-12-15 18:26:17 -02:00
Subv
1051795c32 Kernel/Semaphores: Fixed build 2014-12-13 13:43:01 -05:00
Subv
ea95876431 Kernel/Semaphore: Small style change 2014-12-13 13:40:19 -05:00
Subv
effb181888 Kernel/Semaphores: Invert the available count checking.
Same semantics, idea by @yuriks
2014-12-13 13:40:18 -05:00
Subv
5e25986235 Kernel/Semaphores: Addressed some issues. 2014-12-13 13:40:16 -05:00
Subv
cc81a510e3 Semaphore: Removed an unneeded function 2014-12-13 13:40:15 -05:00
Subv
61434651d8 Semaphores: Addressed some style issues 2014-12-13 13:40:13 -05:00
Subv
abff4a7ee2 Semaphore: Implemented the initial_count parameter. 2014-12-13 13:40:12 -05:00
Subv
49b31badba SVC: Implemented ReleaseSemaphore.
This behavior was tested on hardware, however i'm still not sure what use the "initial_count" parameter has
2014-12-13 13:40:10 -05:00
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