From e8395950538d76e6f29523864bb167dd2c861155 Mon Sep 17 00:00:00 2001 From: brian218 Date: Tue, 11 Oct 2022 01:14:40 +0800 Subject: [PATCH] Implemented sys_game_get_system_sw_version() --- rpcs3/Emu/Cell/PPUThread.cpp | 1 + rpcs3/Emu/Cell/lv2/lv2.cpp | 2 +- rpcs3/Emu/Cell/lv2/sys_game.cpp | 6 ++++++ rpcs3/Emu/Cell/lv2/sys_game.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 015bfa09ee..01c1c91a2e 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -3296,6 +3296,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) }, + { "sys_game_get_system_sw_version", 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 e28f621241..248bc32955 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -424,7 +424,7 @@ const std::array, 1024> g_ppu_sysc NULL_FUNC(sys_game_watchdog_stop), //373 (0x175) NULL_FUNC(sys_game_watchdog_clear), //374 (0x176) NULL_FUNC(sys_game_set_system_sw_version), //375 (0x177) ROOT - NULL_FUNC(sys_game_get_system_sw_version), //376 (0x178) ROOT + BIND_SYSC(_sys_game_get_system_sw_version), //376 (0x178) ROOT NULL_FUNC(sys_sm_set_shop_mode), //377 (0x179) ROOT BIND_SYSC(sys_sm_get_ext_event2), //378 (0x17A) ROOT BIND_SYSC(sys_sm_shutdown), //379 (0x17B) ROOT diff --git a/rpcs3/Emu/Cell/lv2/sys_game.cpp b/rpcs3/Emu/Cell/lv2/sys_game.cpp index 8049d7b5ef..2b459b4cc1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_game.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_game.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "util/sysinfo.hpp" #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" #include "Emu/system_config.h" @@ -34,3 +35,8 @@ error_code _sys_game_board_storage_read(vm::ptr buffer1, vm::ptr buffer2 return CELL_OK; } + +u64 _sys_game_get_system_sw_version() +{ + return stof(utils::get_firmware_version()) * 10000; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_game.h b/rpcs3/Emu/Cell/lv2/sys_game.h index 2dc8a4be3a..bebfb307f7 100644 --- a/rpcs3/Emu/Cell/lv2/sys_game.h +++ b/rpcs3/Emu/Cell/lv2/sys_game.h @@ -1,3 +1,4 @@ #pragma once error_code _sys_game_board_storage_read(vm::ptr buffer1, vm::ptr buffer2); +u64 _sys_game_get_system_sw_version();