Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented sys_game_board_storage_read() #12597

Merged
merged 1 commit into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rpcs3/Emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ target_sources(rpcs3_emu PRIVATE
Cell/lv2/sys_event.cpp
Cell/lv2/sys_event_flag.cpp
Cell/lv2/sys_fs.cpp
Cell/lv2/sys_game.cpp
Cell/lv2/sys_gamepad.cpp
Cell/lv2/sys_gpio.cpp
Cell/lv2/sys_hid.cpp
Expand Down Expand Up @@ -339,7 +340,7 @@ target_sources(rpcs3_emu PRIVATE
Cell/Modules/sceNpUtil.cpp
Cell/Modules/StaticHLE.cpp
Cell/Modules/sys_crashdump.cpp
Cell/Modules/sys_game.cpp
Cell/Modules/sys_game_.cpp
Cell/Modules/sys_heap.cpp
Cell/Modules/sys_io_.cpp
Cell/Modules/sys_libc_.cpp
Expand Down
1 change: 1 addition & 0 deletions rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3280,6 +3280,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only)
{
std::unordered_map<std::string, u64> link_table
{
brian218 marked this conversation as resolved.
Show resolved Hide resolved
{ "sys_game_board_storage_read", reinterpret_cast<u64>(ppu_execute_syscall) },
{ "__trap", reinterpret_cast<u64>(&ppu_trap) },
{ "__error", reinterpret_cast<u64>(&ppu_error) },
{ "__check", reinterpret_cast<u64>(&ppu_check) },
Expand Down
3 changes: 2 additions & 1 deletion rpcs3/Emu/Cell/lv2/lv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "sys_cond.h"
#include "sys_event.h"
#include "sys_event_flag.h"
#include "sys_game.h"
#include "sys_interrupt.h"
#include "sys_memory.h"
#include "sys_mmapper.h"
Expand Down Expand Up @@ -451,7 +452,7 @@ const std::array<std::pair<ppu_intrp_func_t, std::string_view>, 1024> g_ppu_sysc
null_func,//BIND_SYSC(sys_...), //407 (0x197) PM
NULL_FUNC(sys_sm_get_tzpb), //408 (0x198) PM
NULL_FUNC(sys_sm_get_fan_policy), //409 (0x199) PM
NULL_FUNC(sys_game_board_storage_read), //410 (0x19A)
BIND_SYSC(_sys_game_board_storage_read), //410 (0x19A)
NULL_FUNC(sys_game_board_storage_write), //411 (0x19B)
NULL_FUNC(sys_game_get_rtc_status), //412 (0x19C)
null_func,//BIND_SYSC(sys_...), //413 (0x19D) ROOT
Expand Down
34 changes: 34 additions & 0 deletions rpcs3/Emu/Cell/lv2/sys_game.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "stdafx.h"
#include "Emu/Memory/vm_ptr.h"
#include "Emu/Cell/ErrorCodes.h"

brian218 marked this conversation as resolved.
Show resolved Hide resolved
#include "sys_game.h"

LOG_CHANNEL(sys_game);

error_code _sys_game_board_storage_read(vm::ptr<u8> buffer, u8 code)
{
sys_game.trace("sys_game_board_storage_read(buffer=*0x%x, code=0x%02x)", buffer, code);

if (!buffer)
{
return CELL_EFAULT;
}

switch (code)
{
case 0xF0:
brian218 marked this conversation as resolved.
Show resolved Hide resolved
{
constexpr u8 response[16] = { 0x01, 0xFC, 0x43, 0x50, 0xA7, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
memcpy(buffer.get_ptr(), response, 16);
break;
}
default:
{
sys_game.error("sys_game_board_storage_read(): Unknown code 0x%02x", code);
break;
}
}

return CELL_OK;
}
3 changes: 3 additions & 0 deletions rpcs3/Emu/Cell/lv2/sys_game.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

error_code _sys_game_board_storage_read(vm::ptr<u8> data, u8 type);
4 changes: 3 additions & 1 deletion rpcs3/emucore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Emu\cache_utils.cpp" />
<ClCompile Include="Emu\Cell\lv2\sys_game.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellMusicSelectionContext.cpp" />
<ClCompile Include="Emu\Cell\Modules\libfs_utility_init.cpp" />
<ClCompile Include="Emu\Cell\Modules\sys_crashdump.cpp" />
Expand Down Expand Up @@ -341,7 +342,7 @@
<ClCompile Include="Emu\Cell\Modules\sceNpUtil.cpp" />
<ClCompile Include="Emu\Cell\Modules\sceNpPlus.cpp" />
<ClCompile Include="Emu\Cell\Modules\sysPrxForUser.cpp" />
<ClCompile Include="Emu\Cell\Modules\sys_game.cpp" />
<ClCompile Include="Emu\Cell\Modules\sys_game_.cpp" />
<ClCompile Include="Emu\Cell\Modules\sys_heap.cpp" />
<ClCompile Include="Emu\Cell\Modules\sys_io_.cpp" />
<ClCompile Include="Emu\Cell\Modules\sys_libc.cpp" />
Expand Down Expand Up @@ -472,6 +473,7 @@
</ClInclude>
<ClInclude Include="Emu\cache_utils.hpp" />
<ClInclude Include="Emu\Cell\lv2\sys_crypto_engine.h" />
<ClInclude Include="Emu\Cell\lv2\sys_game.h" />
<ClInclude Include="Emu\Cell\Modules\cellCrossController.h" />
<ClInclude Include="Emu\Cell\Modules\cellMusicDecode.h" />
<ClInclude Include="Emu\Cell\Modules\cellRec.h" />
Expand Down
8 changes: 7 additions & 1 deletion rpcs3/emucore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@
<ClCompile Include="Emu\Cell\Modules\sceNpPlus.cpp">
<Filter>Emu\Cell\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\Cell\Modules\sys_game.cpp">
<ClCompile Include="Emu\Cell\Modules\sys_game_.cpp">
<Filter>Emu\Cell\Modules</Filter>
</ClCompile>
<ClCompile Include="Emu\Cell\Modules\sys_heap.cpp">
Expand Down Expand Up @@ -1093,6 +1093,9 @@
<ClCompile Include="..\Utilities\stack_trace.cpp">
<Filter>Utilities</Filter>
</ClCompile>
<ClCompile Include="Emu\Cell\lv2\sys_game.cpp">
<Filter>Emu\Cell\lv2</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Crypto\aes.h">
Expand Down Expand Up @@ -2179,6 +2182,9 @@
<ClInclude Include="..\Utilities\stack_trace.h">
<Filter>Utilities</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\lv2\sys_game.h">
<Filter>Emu\Cell\lv2</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Emu\RSX\Program\GLSLSnippets\GPUDeswizzle.glsl">
Expand Down