diff --git a/rpcs3/Emu/Cell/Modules/cellGem.cpp b/rpcs3/Emu/Cell/Modules/cellGem.cpp index 25971744d2..e7d4c0cb22 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGem.cpp @@ -131,6 +131,7 @@ s32 cellGemGetInfo(vm::ptr info) for (int i = 0; i < CELL_GEM_MAX_NUM; i++) { info->status[i] = CELL_GEM_STATUS_DISCONNECTED; + info->port[i] = 0; } return CELL_OK; @@ -160,10 +161,18 @@ s32 cellGemGetRumble() return CELL_OK; } -s32 cellGemGetState() +s32 cellGemGetState(u32 gem_num, u32 flag, u64 time_parameter, vm::ptr gem_state) { - UNIMPLEMENTED_FUNC(cellGem); - return CELL_OK; + cellGem.todo("cellGemGetState(gem_num=%d, flag=0x%x, time=0x%llx, gem_state=*0x%x)", gem_num, flag, time_parameter, gem_state); + const auto gem = fxm::get(); + + if (!gem) + return CELL_GEM_ERROR_UNINITIALIZED; + + // clear out gem_state so no games get any funny ideas about them being connected... + std::memset(gem_state.get_ptr(), 0, sizeof(CellGemState)); + + return CELL_GEM_NOT_CONNECTED; } s32 cellGemGetStatusFlags() diff --git a/rpcs3/Emu/Cell/Modules/cellGem.h b/rpcs3/Emu/Cell/Modules/cellGem.h index fce1ea14fb..de85d72055 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.h +++ b/rpcs3/Emu/Cell/Modules/cellGem.h @@ -96,10 +96,10 @@ struct CellGemAttribute struct CellGemCameraState { be_t exposure; - float exposure_time; - float gain; - float pitch_angle; - float pitch_angle_estimate; + be_t exposure_time; + be_t gain; + be_t pitch_angle; + be_t pitch_angle_estimate; }; struct CellGemExtPortData @@ -116,14 +116,14 @@ struct CellGemExtPortData struct CellGemImageState { - //system_time_t frame_timestamp; // TODO: Figure what to use for them - //system_time_t timestamp; - float u; - float v; - float r; - float projectionx; - float projectiony; - float distance; + be_t frame_timestamp; + be_t timestamp; + be_t u; + be_t v; + be_t r; + be_t projectionx; + be_t projectiony; + be_t distance; u8 visible; u8 r_valid; }; @@ -136,15 +136,15 @@ struct CellGemPadData struct CellGemInertialState { - //vec_float4 accelerometer; // TODO: Figure what to use as replacement for vec_float4 - //vec_float4 gyro; - //vec_float4 accelerometer_bias; - //vec_float4 gyro_bias; + be_t accelerometer[4]; + be_t gyro[4]; + be_t accelerometer_bias[4]; + be_t gyro_bias[4]; CellGemPadData pad; CellGemExtPortData ext; - //system_time_t timestamp; + be_t timestamp; be_t counter; - float temperature; + be_t temperature; }; struct CellGemInfo @@ -157,20 +157,20 @@ struct CellGemInfo struct CellGemState { - //vec_float4 pos; - //vec_float4 vel; - //vec_float4 accel; - //vec_float4 quat; - //vec_float4 angvel; - //vec_float4 angaccel; - //vec_float4 handle_pos; - //vec_float4 handle_vel; - //vec_float4 handle_accel; + be_t pos[4]; + be_t vel[4]; + be_t accel[4]; + be_t quat[4]; + be_t angvel[4]; + be_t angaccel[4]; + be_t handle_pos[4]; + be_t handle_vel[4]; + be_t handle_accel[4]; CellGemPadData pad; CellGemExtPortData ext; - //system_time_t timestamp; - float temperature; - float camera_pitch_angle; + be_t timestamp; + be_t temperature; + be_t camera_pitch_angle; be_t tracking_flags; }; @@ -179,10 +179,10 @@ struct CellGemVideoConvertAttribute be_t version; be_t output_format; be_t conversion_flags; - float gain; - float red_gain; - float green_gain; - float blue_gain; + be_t gain; + be_t red_gain; + be_t green_gain; + be_t blue_gain; be_t buffer_memory; be_t video_data_out; u8 alpha;