Skip to content

Commit

Permalink
Update cellSpudll
Browse files Browse the repository at this point in the history
- Stub cellSpudllGetImageSize
- Implement cellSpudllHandleConfigSetDefaultValues
  • Loading branch information
scribam authored and Nekotekina committed Apr 7, 2017
1 parent d160c86 commit 7a1fd27
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 6 deletions.
37 changes: 31 additions & 6 deletions 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<u32> psize, vm::cptr<void> so_elf, vm::cptr<struct CellSpudllHandleConfig> config)
s32 cellSpudllGetImageSize(vm::ptr<u32> psize, vm::cptr<void> so_elf, vm::cptr<CellSpudllHandleConfig> 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<struct CellSpudllHandleConfig> config)
s32 cellSpudllHandleConfigSetDefaultValues(vm::ptr<CellSpudllHandleConfig> 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;
});
26 changes: 26 additions & 0 deletions 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<u32> mode;
be_t<u32> dmaTag;
be_t<u32> numMaxReferred;
be_t<u32> numMaxDepend;
vm::bptr<void> unresolvedSymbolValueForFunc;
vm::bptr<void> unresolvedSymbolValueForObject;
vm::bptr<void> unresolvedSymbolValueForOther;
be_t<u32> __reserved__[9];
};
1 change: 1 addition & 0 deletions rpcs3/emucore.vcxproj
Expand Up @@ -579,6 +579,7 @@
<ClInclude Include="Emu\Cell\Modules\cellSaveData.h" />
<ClInclude Include="Emu\Cell\Modules\cellScreenshot.h" />
<ClInclude Include="Emu\Cell\Modules\cellSearch.h" />
<ClInclude Include="Emu\Cell\Modules\cellSpudll.h" />
<ClInclude Include="Emu\Cell\Modules\cellSpurs.h" />
<ClInclude Include="Emu\Cell\Modules\cellSpursJq.h" />
<ClInclude Include="Emu\Cell\Modules\cellSubdisplay.h" />
Expand Down
3 changes: 3 additions & 0 deletions rpcs3/emucore.vcxproj.filters
Expand Up @@ -1348,6 +1348,9 @@
<ClInclude Include="Emu\Cell\Modules\cellSearch.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellSpudll.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellSpurs.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
Expand Down

0 comments on commit 7a1fd27

Please sign in to comment.