Stub sys_gamepad ycon interface (#2435)

* Attempt to add sys_gamepad...

* Stub ycon methods

Signed-off-by: clienthax <clienthax@gmail.com>
This commit is contained in:
clienthax 2017-02-28 16:15:11 +00:00 committed by Ivan
parent 557e1c3694
commit bd85f23ed9
6 changed files with 137 additions and 1 deletions

View File

@ -29,6 +29,7 @@
#include "sys_vm.h"
#include "sys_fs.h"
#include "sys_dbg.h"
#include "sys_gamepad.h"
LOG_CHANNEL(sys_cond);
LOG_CHANNEL(sys_dbg);
@ -53,6 +54,7 @@ LOG_CHANNEL(sys_timer);
LOG_CHANNEL(sys_trace);
LOG_CHANNEL(sys_tty);
LOG_CHANNEL(sys_vm);
LOG_CHANNEL(sys_gamepad);
extern std::string ppu_get_syscall_name(u64 code);
@ -600,7 +602,7 @@ std::array<ppu_function_t, 1024> g_ppu_syscall_table
null_func,//BIND_FUNC(sys_storage_set_region_acl) //618 (0x26A)
null_func,//BIND_FUNC(sys_storage_async_send_device_command) //619 (0x26B)
null_func,//BIND_FUNC(sys_...) //620 (0x26C) ROOT
null_func,//BIND_FUNC(sys_gamepad_ycon_if) //621 (0x26D)
BIND_FUNC(sys_gamepad_ycon_if), //621 (0x26D)
null_func,//BIND_FUNC(sys_storage_get_region_offset) //622 (0x26E)
null_func,//BIND_FUNC(sys_storage_set_emulated_speed) //623 (0x26F)
null_func,//BIND_FUNC(sys_io_buffer_create) //624 (0x270)

View File

@ -40,6 +40,8 @@ void MMJoystickHandler::Init(const u32 max_connect)
js_info.dwSize = sizeof(js_info);
js_info.dwFlags = JOY_RETURNALL;
joyGetDevCaps(JOYSTICKID1, &js_caps, sizeof(js_caps));
bool JoyPresent = (joyGetPosEx(JOYSTICKID1, &js_info) == JOYERR_NOERROR);
if (JoyPresent)
{

View File

@ -384,6 +384,7 @@
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="sys_gamepad.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\3rdparty\stblib\stb_image.h" />
@ -661,6 +662,7 @@
<ClInclude Include="restore_new.h" />
<ClInclude Include="rpcs3_version.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="sys_gamepad.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\3rdparty\libpng\projects\vstudio\libpng\libpng.vcxproj">

View File

@ -890,6 +890,9 @@
<ClCompile Include="..\Utilities\sema.cpp">
<Filter>Utilities</Filter>
</ClCompile>
<ClCompile Include="sys_gamepad.cpp">
<Filter>Emu\Cell\lv2</Filter>
</ClCompile>
<ClCompile Include="Loader\PUP.cpp">
<Filter>Loader</Filter>
</ClCompile>
@ -1717,6 +1720,9 @@
<ClInclude Include="Emu\Cell\Modules\cellOskDialog.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="sys_gamepad.h">
<Filter>Emu\Cell\lv2</Filter>
</ClInclude>
<ClInclude Include="Loader\PUP.h">
<Filter>Loader</Filter>
</ClInclude>

117
rpcs3/sys_gamepad.cpp Normal file
View File

@ -0,0 +1,117 @@
#include "stdafx.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/ErrorCodes.h"
#include "sys_gamepad.h"
namespace vm { using namespace ps3; }
logs::channel sys_gamepad("sys_gamepad", logs::level::notice);
u32 sys_gamepad_ycon_initalize(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_initalize(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_finalize(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_finalize(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_has_input_ownership(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_has_input_ownership(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_enumerate_device(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_enumerate_device(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_get_device_info(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_get_device_info(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_read_raw_report(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_read_raw_report(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_write_raw_report(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_write_raw_report(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_get_feature(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_get_feature(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_set_feature(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_set_feature(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
u32 sys_gamepad_ycon_is_gem(vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
sys_gamepad.todo("sys_gamepad_ycon_is_gem(in=%d, out=%d) -> CELL_OK", in, out);
return CELL_OK;
}
// syscall(621,packet_id,uint8_t *in,uint8_t *out) Talk:LV2_Functions_and_Syscalls#Syscall_621_.280x26D.29 gamepad_if usage
u32 sys_gamepad_ycon_if(uint8_t packet_id, vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out)
{
switch (packet_id)
{
case 0:
return sys_gamepad_ycon_initalize(in, out);
break;
case 1:
return sys_gamepad_ycon_finalize(in, out);
break;
case 2:
return sys_gamepad_ycon_has_input_ownership(in, out);
break;
case 3:
return sys_gamepad_ycon_enumerate_device(in, out);
break;
case 4:
return sys_gamepad_ycon_get_device_info(in, out);
break;
case 5:
return sys_gamepad_ycon_read_raw_report(in, out);
break;
case 6:
return sys_gamepad_ycon_write_raw_report(in, out);
break;
case 7:
return sys_gamepad_ycon_get_feature(in, out);
break;
case 8:
return sys_gamepad_ycon_set_feature(in, out);
break;
case 9:
return sys_gamepad_ycon_is_gem(in, out);
break;
default:
sys_gamepad.error("sys_gamepad_ycon_if(packet_id=*%d, in=%d, out=%d), unknown packet id", packet_id, in, out);
break;
}
return CELL_OK;
}

7
rpcs3/sys_gamepad.h Normal file
View File

@ -0,0 +1,7 @@
#pragma once
#include "Emu/Cell/ErrorCodes.h"
//Syscalls
u32 sys_gamepad_ycon_if(uint8_t packet_id, vm::ps3::ptr<uint8_t> in, vm::ps3::ptr<uint8_t> out);