mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	Port yuzu-emu/yuzu#4437: "core_timing: Make use of uintptr_t to represent user_data" (#5499)
Co-authored-by: LC <lioncash@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									7801907288
								
							
						
					
					
						commit
						3201943423
					
				
					 16 changed files with 62 additions and 58 deletions
				
			
		| 
						 | 
				
			
			@ -105,7 +105,7 @@ void Module::LoadInputDevices() {
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::UpdatePadCallback(u64 userdata, s64 cycles_late) {
 | 
			
		||||
void Module::UpdatePadCallback(std::uintptr_t user_data, s64 cycles_late) {
 | 
			
		||||
    SharedMem* mem = reinterpret_cast<SharedMem*>(shared_mem->GetPointer());
 | 
			
		||||
 | 
			
		||||
    if (is_device_reload_pending.exchange(false))
 | 
			
		||||
| 
						 | 
				
			
			@ -225,7 +225,7 @@ void Module::UpdatePadCallback(u64 userdata, s64 cycles_late) {
 | 
			
		|||
    system.CoreTiming().ScheduleEvent(pad_update_ticks - cycles_late, pad_update_event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::UpdateAccelerometerCallback(u64 userdata, s64 cycles_late) {
 | 
			
		||||
void Module::UpdateAccelerometerCallback(std::uintptr_t user_data, s64 cycles_late) {
 | 
			
		||||
    SharedMem* mem = reinterpret_cast<SharedMem*>(shared_mem->GetPointer());
 | 
			
		||||
 | 
			
		||||
    mem->accelerometer.index = next_accelerometer_index;
 | 
			
		||||
| 
						 | 
				
			
			@ -270,7 +270,7 @@ void Module::UpdateAccelerometerCallback(u64 userdata, s64 cycles_late) {
 | 
			
		|||
                                      accelerometer_update_event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::UpdateGyroscopeCallback(u64 userdata, s64 cycles_late) {
 | 
			
		||||
void Module::UpdateGyroscopeCallback(std::uintptr_t user_data, s64 cycles_late) {
 | 
			
		||||
    SharedMem* mem = reinterpret_cast<SharedMem*>(shared_mem->GetPointer());
 | 
			
		||||
 | 
			
		||||
    mem->gyroscope.index = next_gyroscope_index;
 | 
			
		||||
| 
						 | 
				
			
			@ -438,17 +438,17 @@ Module::Module(Core::System& system) : system(system) {
 | 
			
		|||
 | 
			
		||||
    // Register update callbacks
 | 
			
		||||
    Core::Timing& timing = system.CoreTiming();
 | 
			
		||||
    pad_update_event =
 | 
			
		||||
        timing.RegisterEvent("HID::UpdatePadCallback", [this](u64 userdata, s64 cycles_late) {
 | 
			
		||||
            UpdatePadCallback(userdata, cycles_late);
 | 
			
		||||
        });
 | 
			
		||||
    pad_update_event = timing.RegisterEvent("HID::UpdatePadCallback",
 | 
			
		||||
                                            [this](std::uintptr_t user_data, s64 cycles_late) {
 | 
			
		||||
                                                UpdatePadCallback(user_data, cycles_late);
 | 
			
		||||
                                            });
 | 
			
		||||
    accelerometer_update_event = timing.RegisterEvent(
 | 
			
		||||
        "HID::UpdateAccelerometerCallback", [this](u64 userdata, s64 cycles_late) {
 | 
			
		||||
            UpdateAccelerometerCallback(userdata, cycles_late);
 | 
			
		||||
        "HID::UpdateAccelerometerCallback", [this](std::uintptr_t user_data, s64 cycles_late) {
 | 
			
		||||
            UpdateAccelerometerCallback(user_data, cycles_late);
 | 
			
		||||
        });
 | 
			
		||||
    gyroscope_update_event =
 | 
			
		||||
        timing.RegisterEvent("HID::UpdateGyroscopeCallback", [this](u64 userdata, s64 cycles_late) {
 | 
			
		||||
            UpdateGyroscopeCallback(userdata, cycles_late);
 | 
			
		||||
    gyroscope_update_event = timing.RegisterEvent(
 | 
			
		||||
        "HID::UpdateGyroscopeCallback", [this](std::uintptr_t user_data, s64 cycles_late) {
 | 
			
		||||
            UpdateGyroscopeCallback(user_data, cycles_late);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
    timing.ScheduleEvent(pad_update_ticks, pad_update_event);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -307,9 +307,9 @@ public:
 | 
			
		|||
 | 
			
		||||
private:
 | 
			
		||||
    void LoadInputDevices();
 | 
			
		||||
    void UpdatePadCallback(u64 userdata, s64 cycles_late);
 | 
			
		||||
    void UpdateAccelerometerCallback(u64 userdata, s64 cycles_late);
 | 
			
		||||
    void UpdateGyroscopeCallback(u64 userdata, s64 cycles_late);
 | 
			
		||||
    void UpdatePadCallback(std::uintptr_t user_data, s64 cycles_late);
 | 
			
		||||
    void UpdateAccelerometerCallback(std::uintptr_t user_data, s64 cycles_late);
 | 
			
		||||
    void UpdateGyroscopeCallback(std::uintptr_t user_data, s64 cycles_late);
 | 
			
		||||
 | 
			
		||||
    Core::System& system;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue