mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-14 01:27:00 +00:00
cellPad: move CellPadData to pad_types for convenience
This commit is contained in:
parent
d4187242b9
commit
1dac708323
@ -207,7 +207,7 @@ void pad_get_data(u32 port_no, CellPadData* data)
|
||||
}
|
||||
else if (pad->ldd)
|
||||
{
|
||||
std::memcpy(data, pad->ldd_data, sizeof(CellPadData));
|
||||
pad->ldd_data = *data;
|
||||
if (setting & CELL_PAD_SETTING_SENSOR_ON)
|
||||
data->len = CELL_PAD_LEN_CHANGE_SENSOR_ON;
|
||||
else
|
||||
@ -909,7 +909,7 @@ error_code cellPadLddDataInsert(s32 handle, vm::ptr<CellPadData> data)
|
||||
if (!pads[handle]->ldd)
|
||||
return CELL_PAD_ERROR_NO_DEVICE;
|
||||
|
||||
memcpy(pads[handle]->ldd_data, data.get_ptr(), sizeof(CellPadData));
|
||||
pads[handle]->ldd_data = *data;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -126,12 +126,6 @@ enum
|
||||
CELL_PADFILTER_IIR_CUTOFF_2ND_LPF_BT_010 = 2, // 10% Nyquist frequency
|
||||
};
|
||||
|
||||
struct CellPadData
|
||||
{
|
||||
be_t<s32> len;
|
||||
be_t<u16> button[CELL_PAD_MAX_CODES];
|
||||
};
|
||||
|
||||
struct CellPadInfo
|
||||
{
|
||||
be_t<u32> max_connect;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/types.hpp"
|
||||
#include "util/endian.hpp"
|
||||
#include "Emu/Io/pad_config_types.h"
|
||||
|
||||
#include <vector>
|
||||
@ -170,6 +171,12 @@ enum
|
||||
CELL_MAX_PADS = 127,
|
||||
};
|
||||
|
||||
struct CellPadData
|
||||
{
|
||||
be_t<s32> len;
|
||||
be_t<u16> button[CELL_PAD_MAX_CODES];
|
||||
};
|
||||
|
||||
static constexpr u16 DEFAULT_MOTION_X = 512;
|
||||
static constexpr u16 DEFAULT_MOTION_Y = 399;
|
||||
static constexpr u16 DEFAULT_MOTION_Z = 512;
|
||||
@ -324,7 +331,7 @@ struct Pad
|
||||
u16 m_sensor_g{DEFAULT_MOTION_G};
|
||||
|
||||
bool ldd{false};
|
||||
u8 ldd_data[132] = {};
|
||||
CellPadData ldd_data{};
|
||||
|
||||
explicit Pad(pad_handler handler, u32 port_status, u32 device_capability, u32 device_type)
|
||||
: m_pad_handler(handler)
|
||||
|
@ -423,7 +423,7 @@ void pad_thread::operator()()
|
||||
continue;
|
||||
|
||||
// Check if an LDD pad pressed the PS button (bit 0 of the first button)
|
||||
if (pad->ldd && !!(static_cast<be_t<u16>>(pad->ldd_data[sizeof(be_t<u32>)]) & CELL_PAD_CTRL_LDD_PS))
|
||||
if (pad->ldd && !!(pad->ldd_data.button[0] & CELL_PAD_CTRL_LDD_PS))
|
||||
{
|
||||
ps_button_pressed = true;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user