diff --git a/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt index e65e50c167..fdd42314d7 100644 --- a/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -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 diff --git a/rpcs3/Emu/Cell/Modules/sys_game.cpp b/rpcs3/Emu/Cell/Modules/sys_game_.cpp similarity index 100% rename from rpcs3/Emu/Cell/Modules/sys_game.cpp rename to rpcs3/Emu/Cell/Modules/sys_game_.cpp diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index fdb493b7a8..592386b272 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -3280,6 +3280,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only) { std::unordered_map link_table { + { "sys_game_board_storage_read", reinterpret_cast(ppu_execute_syscall) }, { "__trap", reinterpret_cast(&ppu_trap) }, { "__error", reinterpret_cast(&ppu_error) }, { "__check", reinterpret_cast(&ppu_check) }, diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index e3333532f0..5b873251a7 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -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, 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 diff --git a/rpcs3/Emu/Cell/lv2/sys_game.cpp b/rpcs3/Emu/Cell/lv2/sys_game.cpp new file mode 100644 index 0000000000..5b720a87a8 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_game.cpp @@ -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 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; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_game.h b/rpcs3/Emu/Cell/lv2/sys_game.h new file mode 100644 index 0000000000..8bbeedf914 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_game.h @@ -0,0 +1,3 @@ +#pragma once + +error_code _sys_game_board_storage_read(vm::ptr data, u8 type); diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index f76e66184f..fd7a7f0808 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -62,6 +62,7 @@ true + @@ -341,7 +342,7 @@ - + @@ -472,6 +473,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index 85dabd03c9..28bad7f3b6 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -642,7 +642,7 @@ Emu\Cell\Modules - + Emu\Cell\Modules @@ -1093,6 +1093,9 @@ Utilities + + Emu\Cell\lv2 + @@ -2179,6 +2182,9 @@ Utilities + + Emu\Cell\lv2 +