diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp index d8b34e08fd..9ec1736f07 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.cpp @@ -7,129 +7,181 @@ logs::channel cellSysutilAvc2("cellSysutilAvc2"); -s32 cellSysutilAvc2GetPlayerInfo() +template<> +void fmt_class_string::format(std::string& out, u64 arg) { - fmt::throw_exception("Unimplemented" HERE); + format_enum(out, arg, [](auto error) + { + switch (error) + { + STR_CASE(CELL_AVC2_ERROR_UNKNOWN); + STR_CASE(CELL_AVC2_ERROR_NOT_SUPPORTED); + STR_CASE(CELL_AVC2_ERROR_NOT_INITIALIZED); + STR_CASE(CELL_AVC2_ERROR_ALREADY_INITIALIZED); + STR_CASE(CELL_AVC2_ERROR_INVALID_ARGUMENT); + STR_CASE(CELL_AVC2_ERROR_OUT_OF_MEMORY); + STR_CASE(CELL_AVC2_ERROR_ERROR_BAD_ID); + STR_CASE(CELL_AVC2_ERROR_INVALID_STATUS); + STR_CASE(CELL_AVC2_ERROR_TIMEOUT); + STR_CASE(CELL_AVC2_ERROR_NO_SESSION); + STR_CASE(CELL_AVC2_ERROR_WINDOW_ALREADY_EXISTS); + STR_CASE(CELL_AVC2_ERROR_TOO_MANY_WINDOWS); + STR_CASE(CELL_AVC2_ERROR_TOO_MANY_PEER_WINDOWS); + STR_CASE(CELL_AVC2_ERROR_WINDOW_NOT_FOUND); + } + + return unknown; + }); } -s32 cellSysutilAvc2JoinChat() +error_code cellSysutilAvc2GetPlayerInfo(vm::cptr player_id, vm::ptr player_info) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetPlayerInfo(player_id=*0x%x, player_info=*0x%x)", player_id, player_info); + return CELL_OK; } -s32 cellSysutilAvc2StopStreaming() +error_code cellSysutilAvc2JoinChat(vm::cptr room_id) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2JoinChat(room_id=*0x%x)", room_id); + return CELL_OK; } -s32 cellSysutilAvc2ChangeVideoResolution() +error_code cellSysutilAvc2StopStreaming() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2StopStreaming()"); + return CELL_OK; } -s32 cellSysutilAvc2ShowScreen() +error_code cellSysutilAvc2ChangeVideoResolution(CellSysutilAvc2VideoResolution resolution) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2ChangeVideoResolution(resolution=0x%x)", resolution); + return CELL_OK; } -s32 cellSysutilAvc2GetVideoMuting() +error_code cellSysutilAvc2ShowScreen() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2ShowScreen()"); + return CELL_OK; } -s32 cellSysutilAvc2GetWindowAttribute() +error_code cellSysutilAvc2GetVideoMuting(vm::ptr muting) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetVideoMuting(muting=*0x%x)", muting); + + *muting = 1; + + return CELL_OK; } -s32 cellSysutilAvc2StopStreaming2() +error_code cellSysutilAvc2GetWindowAttribute(SceNpMatching2RoomMemberId member_id, vm::ptr attr) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetWindowAttribute(member_id=0x%x, attr=*0x%x)", member_id, attr); + return CELL_OK; } -s32 cellSysutilAvc2SetVoiceMuting() +error_code cellSysutilAvc2StopStreaming2(CellSysutilAvc2MediaType mediaType) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2StopStreaming2(mediaType=0x%x)", mediaType); + return CELL_OK; } -s32 cellSysutilAvc2StartVoiceDetection() +error_code cellSysutilAvc2SetVoiceMuting(u8 muting) +{ + cellSysutilAvc2.todo("cellSysutilAvc2SetVoiceMuting(muting=0x%x)", muting); + return CELL_OK; +} + +error_code cellSysutilAvc2StartVoiceDetection() { cellSysutilAvc2.todo("cellSysutilAvc2StartVoiceDetection()"); return CELL_OK; } -s32 cellSysutilAvc2UnloadAsync() +error_code cellSysutilAvc2UnloadAsync() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2UnloadAsync()"); + return CELL_OK; } -s32 cellSysutilAvc2StopVoiceDetection() +error_code cellSysutilAvc2StopVoiceDetection() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2StopVoiceDetection()"); + return CELL_OK; } -s32 cellSysutilAvc2GetAttribute() +error_code cellSysutilAvc2GetAttribute(vm::ptr attr) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetAttribute(attr=*0x%x)", attr); + return CELL_OK; } -s32 cellSysutilAvc2LoadAsync() +error_code cellSysutilAvc2LoadAsync(SceNpMatching2ContextId ctx_id, u32 container, vm::ptr callback_func, vm::ptr user_data, vm::cptr init_param) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2LoadAsync(ctx_id=0x%x, container=0x%x, callback_func=*0x%x, user_data=*0x%x, init_param=*0x%x)", ctx_id, container, callback_func, user_data, init_param); + return CELL_OK; } -s32 cellSysutilAvc2SetSpeakerVolumeLevel() +error_code cellSysutilAvc2SetSpeakerVolumeLevel(f32 level) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetSpeakerVolumeLevel(level=0x%x)", level); + return CELL_OK; } -s32 cellSysutilAvc2SetWindowString() +error_code cellSysutilAvc2SetWindowString(SceNpMatching2RoomMemberId member_id, vm::cptr string) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetWindowString(member_id=0x%x, string=%s)", member_id, string); + return CELL_OK; } -s32 cellSysutilAvc2EstimateMemoryContainerSize(vm::cptr initparam, vm::ptr size) +error_code cellSysutilAvc2EstimateMemoryContainerSize(vm::cptr initparam, vm::ptr size) { cellSysutilAvc2.todo("cellSysutilAvc2EstimateMemoryContainerSize(initparam=*0x%x, size=*0x%x)", initparam, size); return CELL_OK; } -s32 cellSysutilAvc2SetVideoMuting() +error_code cellSysutilAvc2SetVideoMuting(u8 muting) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetVideoMuting(muting=0x%x)", muting); + return CELL_OK; } -s32 cellSysutilAvc2SetPlayerVoiceMuting() +error_code cellSysutilAvc2SetPlayerVoiceMuting(SceNpMatching2RoomMemberId member_id, u8 muting) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetPlayerVoiceMuting(member_id=0x%x, muting=0x%x)", member_id, muting); + return CELL_OK; } -s32 cellSysutilAvc2SetStreamingTarget() +error_code cellSysutilAvc2SetStreamingTarget() { - fmt::throw_exception("Unimplemented" HERE); + UNIMPLEMENTED_FUNC(cellSysutilAvc2); + return CELL_OK; } -s32 cellSysutilAvc2Unload() +error_code cellSysutilAvc2Unload() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2Unload()"); + return CELL_OK; } -s32 cellSysutilAvc2DestroyWindow() +error_code cellSysutilAvc2DestroyWindow(SceNpMatching2RoomMemberId member_id) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2DestroyWindow(member_id=0x%x)", member_id); + return CELL_OK; } -s32 cellSysutilAvc2SetWindowPosition() +error_code cellSysutilAvc2SetWindowPosition(SceNpMatching2RoomMemberId member_id, f32 x, f32 y, f32 z) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetWindowPosition(member_id=0x%x, x=0x%x, y=0x%x, z=0x%x)", member_id, x, y, z); + return CELL_OK; } -s32 cellSysutilAvc2GetSpeakerVolumeLevel() +error_code cellSysutilAvc2GetSpeakerVolumeLevel(vm::ptr level) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetSpeakerVolumeLevel(level=*0x%x)", level); + return CELL_OK; } -s32 cellSysutilAvc2IsCameraAttached(vm::ptr status) +error_code cellSysutilAvc2IsCameraAttached(vm::ptr status) { cellSysutilAvc2.todo("cellSysutilAvc2IsCameraAttached(status=*0x%x)", status); @@ -138,37 +190,43 @@ s32 cellSysutilAvc2IsCameraAttached(vm::ptr status) return CELL_OK; } -s32 cellSysutilAvc2MicRead() +error_code cellSysutilAvc2MicRead(vm::ptr ptr, vm::ptr pSize) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2MicRead(ptr=*0x%x, pSize=*0x%x)", ptr, pSize); + return CELL_OK; } -s32 cellSysutilAvc2GetPlayerVoiceMuting() +error_code cellSysutilAvc2GetPlayerVoiceMuting(SceNpMatching2RoomMemberId member_id, vm::ptr muting) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetPlayerVoiceMuting(member_id=0x%x, muting=*0x%x)", member_id, muting); + return CELL_OK; } -s32 cellSysutilAvc2JoinChatRequest() +error_code cellSysutilAvc2JoinChatRequest(vm::cptr room_id) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2JoinChatRequest(room_id=*0x%x)", room_id); + return CELL_OK; } -s32 cellSysutilAvc2StartStreaming() +error_code cellSysutilAvc2StartStreaming() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2StartStreaming()"); + return CELL_OK; } -s32 cellSysutilAvc2SetWindowAttribute() +error_code cellSysutilAvc2SetWindowAttribute(SceNpMatching2RoomMemberId member_id, vm::cptr attr) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetWindowAttribute(member_id=0x%x, attr=*0x%x)", member_id, attr); + return CELL_OK; } -s32 cellSysutilAvc2GetWindowShowStatus() +error_code cellSysutilAvc2GetWindowShowStatus(SceNpMatching2RoomMemberId member_id, vm::ptr visible) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetWindowShowStatus(member_id=0x%x, visible=*0x%x)", member_id, visible); + return CELL_OK; } -s32 cellSysutilAvc2InitParam(u16 version, vm::ptr option) +error_code cellSysutilAvc2InitParam(u16 version, vm::ptr option) { cellSysutilAvc2.warning("cellSysutilAvc2InitParam(version=%d, option=*0x%x)", version, option); @@ -215,99 +273,118 @@ s32 cellSysutilAvc2InitParam(u16 version, vm::ptr opti return CELL_OK; } -s32 cellSysutilAvc2GetWindowSize() +error_code cellSysutilAvc2GetWindowSize(SceNpMatching2RoomMemberId member_id, vm::ptr width, vm::ptr height) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetWindowSize(member_id=0x%x, width=*0x%x, height=*0x%x)", member_id, width, height); + return CELL_OK; } -s32 cellSysutilAvc2SetStreamPriority() +error_code cellSysutilAvc2SetStreamPriority(u8 priority) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetStreamPriority(priority=0x%x)", priority); + return CELL_OK; } -s32 cellSysutilAvc2LeaveChatRequest() +error_code cellSysutilAvc2LeaveChatRequest() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2LeaveChatRequest()"); + return CELL_OK; } -s32 cellSysutilAvc2IsMicAttached() +error_code cellSysutilAvc2IsMicAttached(vm::ptr status) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2IsMicAttached(status=*0x%x)", status); + + *status = CELL_AVC2_MIC_STATUS_DETACHED; + + return CELL_OK; } -s32 cellSysutilAvc2CreateWindow() +error_code cellSysutilAvc2CreateWindow(SceNpMatching2RoomMemberId member_id) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2CreateWindow(member_id=0x%x)", member_id); + return CELL_OK; } -s32 cellSysutilAvc2GetSpeakerMuting() +error_code cellSysutilAvc2GetSpeakerMuting(vm::ptr muting) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetSpeakerMuting(muting=*0x%x)", muting); + return CELL_OK; } -s32 cellSysutilAvc2ShowWindow() +error_code cellSysutilAvc2ShowWindow(SceNpMatching2RoomMemberId member_id) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2ShowWindow(member_id=0x%x)", member_id); + return CELL_OK; } -s32 cellSysutilAvc2SetWindowSize() +error_code cellSysutilAvc2SetWindowSize(SceNpMatching2RoomMemberId member_id, f32 width, f32 height) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetWindowSize(member_id=0x%x, width=0x%x, height=0x%x)", member_id, width, height); + return CELL_OK; } -s32 cellSysutilAvc2EnumPlayers() +error_code cellSysutilAvc2EnumPlayers(vm::ptr players_num, vm::ptr players_id) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2EnumPlayers(players_num=*0x%x, players_id=*0x%x)", players_num, players_id); + return CELL_OK; } -s32 cellSysutilAvc2GetWindowString() +error_code cellSysutilAvc2GetWindowString(SceNpMatching2RoomMemberId member_id, vm::ptr string, vm::ptr len) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetWindowString(member_id=0x%x, string=*0x%x, len=*0x%x)", member_id, string, len); + return CELL_OK; } -s32 cellSysutilAvc2LeaveChat() +error_code cellSysutilAvc2LeaveChat() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2LeaveChat()"); + return CELL_OK; } -s32 cellSysutilAvc2SetSpeakerMuting() +error_code cellSysutilAvc2SetSpeakerMuting(u8 muting) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2SetSpeakerMuting(muting=0x%x)", muting); + return CELL_OK; } -s32 cellSysutilAvc2Load(SceNpMatching2ContextId ctx_id, u32 container, vm::ptr callback_func, vm::ptr user_data, vm::cptr init_param) +error_code cellSysutilAvc2Load(SceNpMatching2ContextId ctx_id, u32 container, vm::ptr callback_func, vm::ptr user_data, vm::cptr init_param) { cellSysutilAvc2.todo("cellSysutilAvc2Load(ctx_id=0x%x, container=0x%x, callback_func=*0x%x, user_data=*0x%x, init_param=*0x%x)", ctx_id, container, callback_func, user_data, init_param); return CELL_OK; } -s32 cellSysutilAvc2SetAttribute(vm::cptr attr) +error_code cellSysutilAvc2SetAttribute(vm::cptr attr) { cellSysutilAvc2.todo("cellSysutilAvc2SetAttribute(attr=*0x%x)", attr); return CELL_OK; } -s32 cellSysutilAvc2UnloadAsync2() +error_code cellSysutilAvc2UnloadAsync2(CellSysutilAvc2MediaType mediaType) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2UnloadAsync2(mediaType=0x%x)", mediaType); + return CELL_OK; } -s32 cellSysutilAvc2StartStreaming2() +error_code cellSysutilAvc2StartStreaming2(CellSysutilAvc2MediaType mediaType) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2StartStreaming2(mediaType=0x%x)", mediaType); + return CELL_OK; } -s32 cellSysutilAvc2HideScreen() +error_code cellSysutilAvc2HideScreen() { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2HideScreen()"); + return CELL_OK; } -s32 cellSysutilAvc2HideWindow() +error_code cellSysutilAvc2HideWindow(SceNpMatching2RoomMemberId member_id) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2HideWindow(member_id=0x%x)", member_id); + return CELL_OK; } -s32 cellSysutilAvc2GetVoiceMuting(vm::ptr muting) +error_code cellSysutilAvc2GetVoiceMuting(vm::ptr muting) { cellSysutilAvc2.todo("cellSysutilAvc2GetVoiceMuting(muting=*0x%x)", muting); @@ -316,19 +393,22 @@ s32 cellSysutilAvc2GetVoiceMuting(vm::ptr muting) return CELL_OK; } -s32 cellSysutilAvc2GetScreenShowStatus() +error_code cellSysutilAvc2GetScreenShowStatus(vm::ptr visible) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetScreenShowStatus(visible=*0x%x)", visible); + return CELL_OK; } -s32 cellSysutilAvc2Unload2() +error_code cellSysutilAvc2Unload2(CellSysutilAvc2MediaType mediaType) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2Unload2(mediaType=0x%x)", mediaType); + return CELL_OK; } -s32 cellSysutilAvc2GetWindowPosition() +error_code cellSysutilAvc2GetWindowPosition(SceNpMatching2RoomMemberId member_id, vm::ptr x, vm::ptr y, vm::ptr z) { - fmt::throw_exception("Unimplemented" HERE); + cellSysutilAvc2.todo("cellSysutilAvc2GetWindowPosition(member_id=0x%x, x=*0x%x, y=*0x%x, z=*0x%x)", member_id, x, y, z); + return CELL_OK; } diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h index dc08ffa39b..2dc5e84bbb 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h +++ b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h @@ -3,7 +3,7 @@ namespace vm { using namespace ps3; } // Error codes -enum +enum CellSysutilAvc2Error : u32 { CELL_AVC2_ERROR_UNKNOWN = 0x8002b701, CELL_AVC2_ERROR_NOT_SUPPORTED = 0x8002b702, @@ -113,6 +113,14 @@ enum CELL_AVC2_CAMERA_STATUS_UNKNOWN = 3, }; +enum +{ + CELL_AVC2_MIC_STATUS_DETACHED = 0, + CELL_AVC2_MIC_STATUS_ATTACHED_OFF = 1, + CELL_AVC2_MIC_STATUS_ATTACHED_ON = 2, + CELL_AVC2_MIC_STATUS_UNKNOWN = 3, +}; + typedef u32 CellSysutilAvc2AttributeId; typedef u32 CellSysutilAvc2WindowAttributeId; @@ -143,7 +151,7 @@ struct CellSysutilAvc2VideoInitParam be_t max_video_windows; be_t max_video_framerate; be_t max_video_bitrate; - CellSysutilAvc2CoordinatesForm coordinates_form; + be_t coordinates_form; u8 video_stream_sharing; }; @@ -166,15 +174,15 @@ struct CellSysutilAvc2InitParam struct CellSysutilAvc2RoomMemberList { - vm::ptr member_id; + vm::bptr member_id; u8 member_num; }; struct CellSysutilAvc2MemberIpAndPortList { - vm::ptr member_id; - vm::ptr dst_addr; // in_addr - vm::ptr dst_port; + vm::bptr member_id; + vm::bptr dst_addr; // in_addr + vm::bptr dst_port; // in_port_t be_t my_member_id; u8 member_num; }; @@ -183,7 +191,7 @@ union CellSysutilAvc2AttributeParam { be_t int_param; be_t float_param; - vm::ptr ptr_param; + vm::bptr ptr_param; }; struct CellSysutilAvc2Attribute @@ -196,7 +204,7 @@ union CellSysutilAvc2WindowAttributeParam { be_t int_vector[4]; be_t float_vector[4]; - vm::ptr ptr_vector[4]; + vm::bptr ptr_vector[4]; }; struct CellSysutilAvc2WindowAttribute @@ -204,3 +212,12 @@ struct CellSysutilAvc2WindowAttribute be_t attr_id; CellSysutilAvc2WindowAttributeParam attr_param; }; + +struct CellSysutilAvc2PlayerInfo +{ + be_t member_id; + u8 joined; + u8 connected; + u8 mic_attached; + u8 reserved[11]; +};