diff --git a/src/controller/emulated.rs b/src/controller/emulated.rs index dfc6c6e..c37d28b 100644 --- a/src/controller/emulated.rs +++ b/src/controller/emulated.rs @@ -94,7 +94,8 @@ pub fn set_model(state: &ControllerState) -> Option { /* else if state.button_a { model_name = "VOK-00106"; model = ControllerModel::VOK00106; - } */ + descriptors = (&vok00106::DEVICE_DESCRIPTOR, &vok00106::DESCRIPTORS, &vok00106::STRINGS); + } */ else { println!("No controller selected."); return None; diff --git a/src/controller/emulated/vok00106.rs b/src/controller/emulated/vok00106.rs index ce975db..11f0fab 100644 --- a/src/controller/emulated/vok00106.rs +++ b/src/controller/emulated/vok00106.rs @@ -1,4 +1,19 @@ use crate::controller::physical::ControllerState; +use crate::controller::emulated::{DeviceDescriptor, ENDPOINT1}; + +pub const DESCRIPTORS: [u8; 76] = [0x01, 0x00, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, +0x09, 0x04, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, +0x07, 0x05, 0x82, 0x02, 0x20, 0x00, 0x00, +0x07, 0x05, 0x02, 0x02, 0x20, 0x00, 0x00, +0x07, 0x05, 0x81, 0x03, 0x08, 0x00, 0x01, +0x09, 0x04, 0x00, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x00, +0x07, 0x05, 0x82, 0x02, 0x20, 0x00, 0x00, +0x07, 0x05, 0x02, 0x02, 0x20, 0x00, 0x00, +0x07, 0x05, 0x81, 0x03, 0x08, 0x00, 0x01,]; +pub const STRINGS: [u8; 16] = [0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; + +pub const DEVICE_DESCRIPTOR: DeviceDescriptor = DeviceDescriptor{b_device_class: 0x02, b_device_sub_class: 0x0, id_vendor: 0x067B, id_product: 0x2303, i_manufacturer: "TAITO", i_product: "Densha de Go! Plug & Play (Master Controller II mode)", i_serial_number: "VOK-00106"}; + const POWER_NOTCHES: [&str; 6] = ["TSA50", "TSA55", "TSA65", "TSA75", "TSA85", "TSA95"]; const BRAKE_NOTCHES: [&str; 10] = ["TSA50", "TSA45", "TSA35", "TSA25", "TSA15", "TSA05", "TSE99", "TSB40", "TSB30", "TSB20"];