cellMic: add EyeToy and PsEye types

This commit is contained in:
Megamouse
2026-09-16 01:42:59 +02:00
parent 4b9f2af41f
commit 2d103407f8
10 changed files with 88 additions and 3 deletions
+2
View File
@@ -25,6 +25,8 @@ enum CellAudioInDeviceMode
enum CellAudioInPortType
{
CELL_AUDIO_IN_PORT_EYETOY1 = 1, // speculative, EyeToy
CELL_AUDIO_IN_PORT_EYETOY2 = 2, // speculative, PS EYE
CELL_AUDIO_IN_PORT_USB = 3,
CELL_AUDIO_IN_PORT_BLUETOOTH = 4,
};
+44
View File
@@ -89,6 +89,50 @@ avconf_manager::avconf_manager()
}
break;
}
case microphone_handler::eye_toy:
{
for (u32 index = 0; index < mic_list.size(); index++)
{
device_info device {};
device.info.portType = CELL_AUDIO_IN_PORT_EYETOY1;
device.info.availableModeCount = 1;
device.info.state = CELL_AUDIO_IN_DEVICE_STATE_AVAILABLE;
device.info.deviceId = 0xE11CC0DE + curindex;
device.info.type = 0xC0DEE11C;
device.info.availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM;
device.info.availableModes[0].channel = CELL_AUDIO_IN_CHNUM_2;
device.info.availableModes[0].fs = CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ;
device.info.deviceNumber = curindex;
device.full_device_name = mic_list[index];
strcpy_trunc(device.info.name, device.full_device_name);
devices.push_back(std::move(device));
curindex++;
}
break;
}
case microphone_handler::ps_eye:
{
for (u32 index = 0; index < mic_list.size(); index++)
{
device_info device {};
device.info.portType = CELL_AUDIO_IN_PORT_EYETOY2;
device.info.availableModeCount = 1;
device.info.state = CELL_AUDIO_IN_DEVICE_STATE_AVAILABLE;
device.info.deviceId = 0xE11CC0DE + curindex;
device.info.type = 0xC0DEE11C;
device.info.availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM;
device.info.availableModes[0].channel = CELL_AUDIO_IN_CHNUM_2;
device.info.availableModes[0].fs = CELL_AUDIO_IN_FS_8KHZ | CELL_AUDIO_IN_FS_12KHZ | CELL_AUDIO_IN_FS_16KHZ | CELL_AUDIO_IN_FS_24KHZ | CELL_AUDIO_IN_FS_32KHZ | CELL_AUDIO_IN_FS_48KHZ;
device.info.deviceNumber = curindex;
device.full_device_name = mic_list[index];
strcpy_trunc(device.info.name, device.full_device_name);
devices.push_back(std::move(device));
curindex++;
}
break;
}
case microphone_handler::real_singstar:
case microphone_handler::singstar:
{
+15 -1
View File
@@ -208,6 +208,8 @@ u32 mic_context::register_device(const std::string& device_name)
case microphone_handler::standard:
case microphone_handler::real_singstar:
case microphone_handler::rocksmith:
case microphone_handler::eye_toy:
case microphone_handler::ps_eye:
{
microphone_device& device = ::at32(mic_list, index);
device = microphone_device(g_cfg.audio.microphone_type.get());
@@ -328,6 +330,8 @@ error_code microphone_device::open_microphone(const u8 type, const u32 dsp_r, co
switch (device_type)
{
case microphone_handler::standard:
case microphone_handler::eye_toy:
case microphone_handler::ps_eye:
break;
case microphone_handler::singstar:
case microphone_handler::real_singstar:
@@ -729,6 +733,8 @@ void microphone_device::get_data(const u32 num_samples)
}
case microphone_handler::standard:
case microphone_handler::rocksmith:
case microphone_handler::eye_toy:
case microphone_handler::ps_eye:
{
constexpr u8 channel_size = bit_resolution / 8;
const usz bufsize = num_samples * sample_size;
@@ -1458,7 +1464,15 @@ error_code cellMicGetType(s32 dev_num, vm::ptr<s32> ptr_type)
return CELL_MICIN_ERROR_NOT_INIT;
// TODO: get proper type (log message is trace because of massive spam)
*ptr_type = CELLMIC_TYPE_USBAUDIO; // Needed for Guitar Hero: Warriors of Rock (BLUS30487)
if (dev_num < static_cast<s32>(mic_thr.mic_list.size()))
{
const microphone_device& device = ::at32(mic_thr.mic_list, dev_num);
*ptr_type = device.get_mic_type();
}
else
{
*ptr_type = CELLMIC_TYPE_UNDEF;
}
return CELL_OK;
}
+11 -2
View File
@@ -114,8 +114,8 @@ enum CellMicType : s32
{
CELLMIC_TYPE_UNDEF = -1,
CELLMIC_TYPE_UNKNOWN = 0,
CELLMIC_TYPE_EYETOY1 = 1,
CELLMIC_TYPE_EYETOY2 = 2,
CELLMIC_TYPE_EYETOY1 = 1, // EyeToy
CELLMIC_TYPE_EYETOY2 = 2, // PS EYE
CELLMIC_TYPE_USBAUDIO = 3,
CELLMIC_TYPE_BLUETOOTH = 4,
CELLMIC_TYPE_A2DP = 5,
@@ -311,6 +311,15 @@ public:
return 1; // BE
}
}
s32 get_mic_type() const
{
switch(device_type)
{
case microphone_handler::eye_toy: return CELLMIC_TYPE_EYETOY1;
case microphone_handler::ps_eye: return CELLMIC_TYPE_EYETOY2;
default: return CELLMIC_TYPE_USBAUDIO; // Needed for Guitar Hero: Warriors of Rock (BLUS30487)
}
}
u32 read_raw(u8* buf, u32 size) { return rbuf_raw.read_bytes(buf, size); }
u32 read_dsp(u8* buf, u32 size) { return rbuf_dsp.read_bytes(buf, size); }
+6
View File
@@ -575,6 +575,12 @@ usb_handler_thread::usb_handler_thread()
case microphone_handler::standard:
usb_devices.push_back(std::make_shared<usb_device_mic>(0, get_new_location(), MicType::Logitech));
break;
case microphone_handler::eye_toy:
usb_devices.push_back(std::make_shared<usb_device_mic>(0, get_new_location(), MicType::EyeToy));
break;
case microphone_handler::ps_eye:
usb_devices.push_back(std::make_shared<usb_device_mic>(0, get_new_location(), MicType::PsEye));
break;
case microphone_handler::real_singstar:
case microphone_handler::singstar:
usb_devices.push_back(std::make_shared<usb_device_mic>(0, get_new_location(), MicType::SingStar));
+2
View File
@@ -7,6 +7,8 @@ enum class MicType
SingStar,
Logitech,
Rocksmith,
EyeToy,
PsEye,
};
enum
+2
View File
@@ -358,6 +358,8 @@ void fmt_class_string<microphone_handler>::format(std::string& out, u64 arg)
case microphone_handler::singstar: return "SingStar";
case microphone_handler::real_singstar: return "Real SingStar";
case microphone_handler::rocksmith: return "Rocksmith";
case microphone_handler::eye_toy: return "Eye Toy";
case microphone_handler::ps_eye: return "PS Eye";
}
return unknown;
+2
View File
@@ -178,6 +178,8 @@ enum class microphone_handler
singstar,
real_singstar,
rocksmith,
eye_toy,
ps_eye,
};
enum class pad_handler_mode
+2
View File
@@ -1142,6 +1142,8 @@ QString emu_settings::GetLocalizedSetting(const QString& original, emu_settings_
case microphone_handler::singstar: return tr("SingStar", "Microphone handler");
case microphone_handler::real_singstar: return tr("Real SingStar", "Microphone handler");
case microphone_handler::rocksmith: return tr("Rocksmith", "Microphone handler");
case microphone_handler::eye_toy: return tr("Eye Toy", "Microphone handler");
case microphone_handler::ps_eye: return tr("PS Eye", "Microphone handler");
}
break;
case emu_settings_type::KeyboardHandler:
+2
View File
@@ -880,6 +880,8 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
break;
case microphone_handler::real_singstar:
case microphone_handler::rocksmith:
case microphone_handler::eye_toy:
case microphone_handler::ps_eye:
max = 1;
break;
case microphone_handler::null: