diff options
| author | 2016-07-05 14:45:40 -0700 | |
|---|---|---|
| committer | 2016-07-05 14:45:40 -0700 | |
| commit | ff2d1a2b748283a7a7c24bed652e311479a108ef (patch) | |
| tree | 52f6020abf274509e188282b0da24675389adbe1 /src | |
| parent | Merge pull request #1850 from mailwl/erreula (diff) | |
| parent | HLE/FS: Document some command parameters and implemented command 0x08560240 (... (diff) | |
| download | yuzu-ff2d1a2b748283a7a7c24bed652e311479a108ef.tar.gz yuzu-ff2d1a2b748283a7a7c24bed652e311479a108ef.tar.xz yuzu-ff2d1a2b748283a7a7c24bed652e311479a108ef.zip | |
Merge pull request #1921 from Subv/fs_funcs
HLE/FS: Document some command parameters and implemented command 0x08560240
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/fs/fs_user.cpp | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 7df7da5a4..937868747 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp | |||
| @@ -645,20 +645,19 @@ static void DeleteSystemSaveData(Service::Interface* self) { | |||
| 645 | * FS_User::CreateSystemSaveData service function. | 645 | * FS_User::CreateSystemSaveData service function. |
| 646 | * Inputs: | 646 | * Inputs: |
| 647 | * 0 : 0x08560240 | 647 | * 0 : 0x08560240 |
| 648 | * 1 : High word of the SystemSaveData id to create | 648 | * 1 : u8 MediaType of the system save data |
| 649 | * 2 : Low word of the SystemSaveData id to create | 649 | * 2 : SystemSaveData id to create |
| 650 | * 3 : Unknown | 650 | * 3 : Total size |
| 651 | * 4 : Unknown | 651 | * 4 : Block size |
| 652 | * 5 : Unknown | 652 | * 5 : Number of directories |
| 653 | * 6 : Unknown | 653 | * 6 : Number of files |
| 654 | * 7 : Unknown | 654 | * 7 : Directory bucket count |
| 655 | * 8 : Unknown | 655 | * 8 : File bucket count |
| 656 | * 9 : Unknown (Memory address) | 656 | * 9 : u8 Whether to duplicate data or not |
| 657 | * Outputs: | 657 | * Outputs: |
| 658 | * 1 : Result of function, 0 on success, otherwise error code | 658 | * 1 : Result of function, 0 on success, otherwise error code |
| 659 | */ | 659 | */ |
| 660 | static void CreateSystemSaveData(Service::Interface* self) { | 660 | static void CreateSystemSaveData(Service::Interface* self) { |
| 661 | // TODO(Subv): Figure out the other parameters. | ||
| 662 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 661 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 663 | u32 savedata_high = cmd_buff[1]; | 662 | u32 savedata_high = cmd_buff[1]; |
| 664 | u32 savedata_low = cmd_buff[2]; | 663 | u32 savedata_low = cmd_buff[2]; |
| @@ -672,6 +671,38 @@ static void CreateSystemSaveData(Service::Interface* self) { | |||
| 672 | } | 671 | } |
| 673 | 672 | ||
| 674 | /** | 673 | /** |
| 674 | * FS_User::CreateLegacySystemSaveData service function. | ||
| 675 | * This function appears to be obsolete and seems to have been replaced by | ||
| 676 | * command 0x08560240 (CreateSystemSaveData). | ||
| 677 | * | ||
| 678 | * Inputs: | ||
| 679 | * 0 : 0x08100200 | ||
| 680 | * 1 : SystemSaveData id to create | ||
| 681 | * 2 : Total size | ||
| 682 | * 3 : Block size | ||
| 683 | * 4 : Number of directories | ||
| 684 | * 5 : Number of files | ||
| 685 | * 6 : Directory bucket count | ||
| 686 | * 7 : File bucket count | ||
| 687 | * 8 : u8 Duplicate data | ||
| 688 | * Outputs: | ||
| 689 | * 1 : Result of function, 0 on success, otherwise error code | ||
| 690 | */ | ||
| 691 | static void CreateLegacySystemSaveData(Service::Interface* self) { | ||
| 692 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 693 | u32 savedata_id = cmd_buff[1]; | ||
| 694 | |||
| 695 | LOG_WARNING(Service_FS, "(STUBBED) savedata_id=%08X cmd_buff[3]=%08X " | ||
| 696 | "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X " | ||
| 697 | "cmd_buff[9]=%08X", savedata_id, cmd_buff[3], cmd_buff[4], cmd_buff[5], | ||
| 698 | cmd_buff[6], cmd_buff[7], cmd_buff[8], cmd_buff[9]); | ||
| 699 | |||
| 700 | cmd_buff[0] = IPC::MakeHeader(0x810, 0x1, 0); | ||
| 701 | // With this command, the SystemSaveData always has save_high = 0 (Always created in the NAND) | ||
| 702 | cmd_buff[1] = CreateSystemSaveData(0, savedata_id).raw; | ||
| 703 | } | ||
| 704 | |||
| 705 | /** | ||
| 675 | * FS_User::InitializeWithSdkVersion service function. | 706 | * FS_User::InitializeWithSdkVersion service function. |
| 676 | * Inputs: | 707 | * Inputs: |
| 677 | * 0 : 0x08610042 | 708 | * 0 : 0x08610042 |
| @@ -820,7 +851,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 820 | {0x080D0144, nullptr, "ControlArchive"}, | 851 | {0x080D0144, nullptr, "ControlArchive"}, |
| 821 | {0x080E0080, CloseArchive, "CloseArchive"}, | 852 | {0x080E0080, CloseArchive, "CloseArchive"}, |
| 822 | {0x080F0180, FormatThisUserSaveData, "FormatThisUserSaveData"}, | 853 | {0x080F0180, FormatThisUserSaveData, "FormatThisUserSaveData"}, |
| 823 | {0x08100200, nullptr, "CreateSystemSaveData"}, | 854 | {0x08100200, CreateLegacySystemSaveData, "CreateLegacySystemSaveData"}, |
| 824 | {0x08110040, nullptr, "DeleteSystemSaveData"}, | 855 | {0x08110040, nullptr, "DeleteSystemSaveData"}, |
| 825 | {0x08120080, GetFreeBytes, "GetFreeBytes"}, | 856 | {0x08120080, GetFreeBytes, "GetFreeBytes"}, |
| 826 | {0x08130000, nullptr, "GetCardType"}, | 857 | {0x08130000, nullptr, "GetCardType"}, |