diff --git a/rpcs3/Emu/Cell/Modules/cellGem.cpp b/rpcs3/Emu/Cell/Modules/cellGem.cpp index 37d526d5ff..5b544b9668 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGem.cpp @@ -1223,13 +1223,20 @@ error_code cellGemPrepareVideoConvert(vm::cptr vc_ const auto vc = *vc_attribute; - if (!vc_attribute || vc.version == 0 || vc.output_format == 0 || - (vc.conversion_flags & CELL_GEM_COMBINE_PREVIOUS_INPUT_FRAME && !vc.buffer_memory)) + if (!vc_attribute || vc.version != CELL_GEM_VERSION) { return CELL_GEM_ERROR_INVALID_PARAMETER; } - if (vc.video_data_out & 0x1f || vc.buffer_memory & 0xff) + if (vc.output_format != CELL_GEM_NO_VIDEO_OUTPUT) + { + if (!vc.video_data_out || ((vc.conversion_flags & CELL_GEM_COMBINE_PREVIOUS_INPUT_FRAME) && !vc.buffer_memory)) + { + return CELL_GEM_ERROR_INVALID_PARAMETER; + } + } + + if (!vc.video_data_out.aligned(16) || !vc.buffer_memory.aligned(128)) { return CELL_GEM_ERROR_INVALID_ALIGNMENT; } diff --git a/rpcs3/Emu/Cell/Modules/cellGem.h b/rpcs3/Emu/Cell/Modules/cellGem.h index eed3dddf14..e0d11712e8 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.h +++ b/rpcs3/Emu/Cell/Modules/cellGem.h @@ -1,5 +1,7 @@ #pragma once +#include "Emu/Memory/vm_ptr.h" + static const float CELL_GEM_SPHERE_RADIUS_MM = 22.5f; // Error codes @@ -265,7 +267,7 @@ struct CellGemVideoConvertAttribute be_t red_gain; be_t green_gain; be_t blue_gain; - be_t buffer_memory; - be_t video_data_out; + vm::ptr buffer_memory; + vm::ptr video_data_out; u8 alpha; };