Implemented sys_game_board_storage_read()

This commit is contained in:
brian218 2022-09-04 06:55:25 +08:00 committed by Ivan
parent 905496e926
commit 75efc79930
8 changed files with 52 additions and 4 deletions

View file

@ -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
@ -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

View file

@ -3280,6 +3280,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only)
{
std::unordered_map<std::string, u64> link_table
{
{ "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) },

View file

@ -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"
@ -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

View file

@ -0,0 +1,34 @@
#include "stdafx.h"
#include "Emu/Memory/vm_ptr.h"
#include "Emu/Cell/ErrorCodes.h"
#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:
{
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;
}

View file

@ -0,0 +1,3 @@
#pragma once
error_code _sys_game_board_storage_read(vm::ptr<u8> data, u8 type);

View file

@ -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" />
@ -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" />
@ -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" />

View file

@ -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">
@ -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">
@ -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">