From 7a1fd27eccee857179cc5adbfe49193ab0a50c45 Mon Sep 17 00:00:00 2001 From: scribam Date: Fri, 7 Apr 2017 22:52:31 +0200 Subject: [PATCH] Update cellSpudll - Stub cellSpudllGetImageSize - Implement cellSpudllHandleConfigSetDefaultValues --- rpcs3/Emu/Cell/Modules/cellSpudll.cpp | 37 ++++++++++++++++++++++----- rpcs3/Emu/Cell/Modules/cellSpudll.h | 26 +++++++++++++++++++ rpcs3/emucore.vcxproj | 1 + rpcs3/emucore.vcxproj.filters | 3 +++ 4 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 rpcs3/Emu/Cell/Modules/cellSpudll.h diff --git a/rpcs3/Emu/Cell/Modules/cellSpudll.cpp b/rpcs3/Emu/Cell/Modules/cellSpudll.cpp index 68f0a80a7c..80ecdef94e 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpudll.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpudll.cpp @@ -1,22 +1,47 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } +#include "cellSpudll.h" logs::channel cellSpudll("cellSpudll", logs::level::notice); -s32 cellSpudllGetImageSize(vm::ptr psize, vm::cptr so_elf, vm::cptr config) +s32 cellSpudllGetImageSize(vm::ptr psize, vm::cptr so_elf, vm::cptr config) { - fmt::throw_exception("Unimplemented" HERE); + cellSpudll.todo("cellSpudllGetImageSize(psize=*0x%x, so_elf=*0x%x, config=*0x%x)", psize, so_elf, config); + + if (!psize || !so_elf) + { + return CELL_SPUDLL_ERROR_NULL_POINTER; + } + + // todo + + return CELL_OK; } -s32 cellSpudllHandleConfigSetDefaultValues(vm::ptr config) +s32 cellSpudllHandleConfigSetDefaultValues(vm::ptr config) { - fmt::throw_exception("Unimplemented" HERE); + cellSpudll.trace("cellSpudllHandleConfigSetDefaultValues(config=*0x%x)", config); + + if (!config) + { + return CELL_SPUDLL_ERROR_NULL_POINTER; + } + + config->mode = 0; + config->dmaTag = 0; + config->numMaxReferred = 16; + config->unresolvedSymbolValueForFunc = vm::null; + config->unresolvedSymbolValueForObject = vm::null; + config->unresolvedSymbolValueForOther = vm::null; + + std::memset(config->__reserved__, 0, sizeof(config->__reserved__)); + + return CELL_OK; } DECLARE(ppu_module_manager::cellSpudll)("cellSpudll", []() { REG_FUNC(cellSpudll, cellSpudllGetImageSize); - REG_FUNC(cellSpudll, cellSpudllHandleConfigSetDefaultValues); + REG_FUNC(cellSpudll, cellSpudllHandleConfigSetDefaultValues).flags = MFF_PERFECT; }); diff --git a/rpcs3/Emu/Cell/Modules/cellSpudll.h b/rpcs3/Emu/Cell/Modules/cellSpudll.h new file mode 100644 index 0000000000..eb7bafeee8 --- /dev/null +++ b/rpcs3/Emu/Cell/Modules/cellSpudll.h @@ -0,0 +1,26 @@ +#pragma once + +namespace vm { using namespace ps3; } + +enum +{ + CELL_SPUDLL_ERROR_INVAL = 0x80410602, + CELL_SPUDLL_ERROR_STAT = 0x8041060f, + CELL_SPUDLL_ERROR_ALIGN = 0x80410610, + CELL_SPUDLL_ERROR_NULL_POINTER = 0x80410611, + CELL_SPUDLL_ERROR_SRCH = 0x80410605, + CELL_SPUDLL_ERROR_UNDEF = 0x80410612, + CELL_SPUDLL_ERROR_FATAL = 0x80410613, +}; + +struct CellSpudllHandleConfig +{ + be_t mode; + be_t dmaTag; + be_t numMaxReferred; + be_t numMaxDepend; + vm::bptr unresolvedSymbolValueForFunc; + vm::bptr unresolvedSymbolValueForObject; + vm::bptr unresolvedSymbolValueForOther; + be_t __reserved__[9]; +}; diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 8266fe734d..4de590baf1 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -579,6 +579,7 @@ + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index ee0cf4890e..a9c2f5ae6c 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -1348,6 +1348,9 @@ Emu\Cell\Modules + + Emu\Cell\Modules + Emu\Cell\Modules