diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilAvcExt.cpp b/rpcs3/Emu/Cell/Modules/cellSysutilAvcExt.cpp index c8ce91162a..b294d077b7 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilAvcExt.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutilAvcExt.cpp @@ -4,9 +4,15 @@ LOG_CHANNEL(cellSysutilAvcExt); +error_code cellSysutilAvcSetAttribute(CellSysUtilAvcAttribute attr_id, vm::ptr param); +error_code cellSysutilAvcLoadAsync(vm::ptr func, vm::ptr userdata, sys_memory_container_t container, CellSysUtilAvcMediaType media, CellSysUtilAvcVideoQuality videoQuality, CellSysUtilAvcVoiceQuality voiceQuality, vm::ptr request_id); + error_code cellSysutilAvcExtIsMicAttached(vm::ptr status) { cellSysutilAvcExt.todo("cellSysutilAvcExtIsMicAttached(status=*0x%x)", status); + + ensure(!!status); // Not actually checked + return CELL_OK; } @@ -25,6 +31,10 @@ error_code cellSysutilAvcExtSetWindowRotation(vm::ptr player_id, f32 ro error_code cellSysutilAvcExtGetWindowPosition(vm::ptr player_id, vm::ptr position_x, vm::ptr position_y, vm::ptr position_z) { cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowPosition(player_id=*0x%x, position_x=*0x%x, position_y=*0x%x, position_z=*0x%x)", player_id, position_x, position_y, position_z); + + if (!player_id || !position_x || !position_y || !position_z) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -43,6 +53,10 @@ error_code cellSysutilAvcExtSetWindowPosition(vm::ptr player_id, f32 po error_code cellSysutilAvcExtGetWindowSize(vm::ptr player_id, vm::ptr size_x, vm::ptr size_y) { cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowSize(player_id=*0x%x, size_x=*0x%x, size_y=*0x%x)", player_id, size_x, size_y); + + if (!player_id || !size_x || !size_y) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -55,6 +69,10 @@ error_code cellSysutilAvcExtStartCameraDetection() error_code cellSysutilAvcExtGetWindowShowStatus(vm::ptr player_id, vm::ptr is_visible) { cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowShowStatus(player_id=*0x%x, is_visible=*0x%x)", player_id, is_visible); + + if (!player_id || !is_visible) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -67,18 +85,30 @@ error_code cellSysutilAvcExtSetChatMode(u32 mode) error_code cellSysutilAvcExtGetNamePlateShowStatus(vm::ptr is_visible) { cellSysutilAvcExt.todo("cellSysutilAvcExtGetNamePlateShowStatus(is_visible=*0x%x)", is_visible); + + if (!is_visible) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } error_code cellSysutilAvcExtSetWindowAlpha(vm::ptr player_id, f32 alpha, CellSysutilAvcTransitionType transition_type) { cellSysutilAvcExt.todo("cellSysutilAvcExtSetWindowAlpha(player_id=*0x%x, alpha=%f, transition_type=0x%x)", player_id, alpha, +transition_type); + + if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } error_code cellSysutilAvcExtSetWindowSize(vm::ptr player_id, f32 size_x, f32 size_y, CellSysutilAvcTransitionType transition_type) { cellSysutilAvcExt.todo("cellSysutilAvcExtSetWindowSize(player_id=*0x%x, size_x=%f, size_y=%f, transition_type=0x%x)", player_id, size_x, size_y, +transition_type); + + if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -93,7 +123,30 @@ error_code cellSysutilAvcExtLoadAsyncEx(vm::ptr func, vm { cellSysutilAvcExt.todo("cellSysutilAvcExtLoadAsyncEx(func=*0x%x, userdata=*0x%x, container=0x%x, media=0x%x, videoQuality=0x%x, voiceQuality=0x%x, option=*0x%x, request_id=*0x%x)", func, userdata, container, +media, +videoQuality, +voiceQuality, option, request_id); - return CELL_OK; + + if (!option) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + + switch (option->avcOptionParamVersion) + { + case CELL_SYSUTIL_AVC_OPTION_PARAM_VERSION: + if (option->sharingVideoBuffer && media == CELL_SYSUTIL_AVC_VOICE_CHAT) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + + //cellSysutilAvcSetAttribute(0x10000100, &option->sharingVideoBuffer); + break; + case 180: + if (option->sharingVideoBuffer && media == CELL_SYSUTIL_AVC_VOICE_CHAT) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + + //cellSysutilAvcSetAttribute(0x10000100, &option->sharingVideoBuffer); + //cellSysutilAvcSetAttribute(0x10000102, &option->maxPlayers); + break; + default: + return CELL_AVC_ERROR_UNKNOWN; + } + + return cellSysutilAvcLoadAsync(func, userdata, container, media, videoQuality, voiceQuality, request_id); } error_code cellSysutilAvcExtSetShowNamePlate() @@ -111,12 +164,19 @@ error_code cellSysutilAvcExtStopVoiceDetection() error_code cellSysutilAvcExtShowWindow(vm::ptr player_id, CellSysutilAvcTransitionType transition_type) { cellSysutilAvcExt.todo("cellSysutilAvcExtStopVoiceDetection(player_id=*0x%x, transition_type=0x%x)", player_id, +transition_type); + + if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } error_code cellSysutilAvcExtIsCameraAttached(vm::ptr status) { cellSysutilAvcExt.todo("cellSysutilAvcExtIsCameraAttached(status=*0x%x)", status); + + ensure(!!status); // Not actually checked + return CELL_OK; } @@ -129,6 +189,10 @@ error_code cellSysutilAvcExtHidePanelEx(CellSysutilAvcTransitionType transition_ error_code cellSysutilAvcExtHideWindow(vm::ptr player_id, CellSysutilAvcTransitionType transition_type) { cellSysutilAvcExt.todo("cellSysutilAvcExtHideWindow(player_id=*0x%x, transition_type=0x%x)", player_id, +transition_type); + + if (!player_id || transition_type > CELL_SYSUTIL_AVC_TRANSITION_EXPONENT) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -141,6 +205,10 @@ error_code cellSysutilAvcExtSetChatGroup() error_code cellSysutilAvcExtGetWindowRotation(vm::ptr player_id, vm::ptr rotation_x, vm::ptr rotation_y, vm::ptr rotation_z) { cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowRotation(player_id=*0x%x, rotation_x=*0x%x, rotation_y=*0x%x, rotation_z=*0x%x)", player_id, rotation_x, rotation_y, rotation_z); + + if (!player_id || !rotation_x || !rotation_y || !rotation_z) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -153,6 +221,10 @@ error_code cellSysutilAvcExtStartMicDetection() error_code cellSysutilAvcExtGetWindowAlpha(vm::ptr player_id, vm::ptr alpha) { cellSysutilAvcExt.todo("cellSysutilAvcExtGetWindowAlpha(player_id=*0x%x, alpha=*0x%x)", player_id, alpha); + + if (!player_id || !alpha) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -165,6 +237,10 @@ error_code cellSysutilAvcExtStartVoiceDetection() error_code cellSysutilAvcExtGetSurfacePointer(vm::ptr player_id, vm::pptr surface_ptr, vm::ptr surface_size, vm::ptr surface_size_x, vm::ptr surface_size_y) { cellSysutilAvcExt.todo("cellSysutilAvcExtGetSurfacePointer(player_id=*0x%x, surface_ptr=*0x%x, surface_size=*0x%x, surface_size_x=*0x%x, surface_size_y=*0x%x)", player_id, surface_ptr, surface_size, surface_size_x, surface_size_y); + + if (!player_id || !surface_ptr || !surface_size || !surface_size_x || !surface_size_y) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; } @@ -177,12 +253,35 @@ error_code cellSysutilAvcExtStopMicDetection() error_code cellSysutilAvcExtInitOptionParam(s32 avcOptionParamVersion, vm::ptr option) { cellSysutilAvcExt.todo("cellSysutilAvcExtInitOptionParam(avcOptionParamVersion=0x%x, option=*0x%x)", avcOptionParamVersion, option); + + if (!option) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + + option->avcOptionParamVersion = avcOptionParamVersion; + + switch (option->avcOptionParamVersion) + { + case CELL_SYSUTIL_AVC_OPTION_PARAM_VERSION: + break; + case 180: + option->maxPlayers = 16; + break; + default: + return CELL_AVC_ERROR_UNKNOWN; + } + + option->sharingVideoBuffer = false; + return CELL_OK; } error_code cellSysutilAvcExtSetWindowZorder(vm::ptr player_id, u32 zorder) { cellSysutilAvcExt.todo("cellSysutilAvcExtSetWindowZorder(player_id=*0x%x, zorder=0x%x)", player_id, zorder); + + if (!player_id || zorder < CELL_SYSUTIL_AVC_ZORDER_FORWARD_MOST || zorder > CELL_SYSUTIL_AVC_ZORDER_BEHIND_MOST) + return CELL_AVC_ERROR_INVALID_ARGUMENT; + return CELL_OK; }