diff --git a/rpcs3/Emu/Cell/Modules/cellGem.cpp b/rpcs3/Emu/Cell/Modules/cellGem.cpp index 9c27f9e1f2..d58b2378fc 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGem.cpp @@ -757,7 +757,7 @@ error_code cellGemGetImageState(u32 gem_num, vm::ptr gem_imag gem_image_state->timestamp = gem_image_state->frame_timestamp + 10; gem_image_state->r = 10; gem_image_state->distance = 2 * 1000; // 2 meters away from camera - gem_image_state->visible = true; + gem_image_state->visible = gem.is_controller_ready(gem_num); gem_image_state->r_valid = true; if (g_cfg.io.move == move_handler::fake) @@ -930,14 +930,9 @@ error_code cellGemGetState(u32 gem_num, u32 flag, u64 time_parameter, vm::ptrext); - gem_state->tracking_flags = CELL_GEM_TRACKING_FLAG_POSITION_TRACKED | CELL_GEM_TRACKING_FLAG_VISIBLE; + u32 tracking_flags = CELL_GEM_TRACKING_FLAG_VISIBLE; + + if (gem.controllers[gem_num].enabled_tracking) + tracking_flags |= CELL_GEM_TRACKING_FLAG_POSITION_TRACKED; + + gem_state->tracking_flags = tracking_flags; gem_state->timestamp = (get_guest_system_time() - gem.start_timestamp); gem_state->camera_pitch_angle = 0.f; gem_state->quat[3] = 1.f; @@ -972,11 +972,21 @@ error_code cellGemGetState(u32 gem_num, u32 flag, u64 time_parameter, vm::ptrpad.digitalbuttons, gem_state->pad.analog_T); mouse_pos_to_gem_state(gem_num, gem_state); } - - return CELL_OK; } - return CELL_GEM_NOT_CONNECTED; + // TODO: verify position of this check. gem_state seems to be polled regardless (otherwise you would never be able to calibrate anyway) + if (!gem.controllers[gem_num].calibrated_magnetometer) + { + return CELL_GEM_SPHERE_NOT_CALIBRATED; + } + + // TODO: verify position of this check + if (!gem.controllers[gem_num].hue_set) + { + return CELL_GEM_HUE_NOT_SET; + } + + return CELL_OK; } error_code cellGemGetStatusFlags(u32 gem_num, vm::ptr flags)