diff --git a/Production/Firmware/iidx_pico.uf2 b/Production/Firmware/iidx_pico.uf2 index fd24782..e140d50 100644 Binary files a/Production/Firmware/iidx_pico.uf2 and b/Production/Firmware/iidx_pico.uf2 differ diff --git a/doc/Firmware_manual.pptx b/doc/Firmware_manual.pptx index 2187df5..3d2fd13 100644 Binary files a/doc/Firmware_manual.pptx and b/doc/Firmware_manual.pptx differ diff --git a/firmware/src/config.h b/firmware/src/config.h index 6f3019f..2f12e49 100644 --- a/firmware/src/config.h +++ b/firmware/src/config.h @@ -37,6 +37,7 @@ typedef struct __attribute ((packed)) { uint8_t e3; uint8_t e4; } effects; + bool konami; /* konami spoof */ } iidx_cfg_t; extern iidx_cfg_t *iidx_cfg; diff --git a/firmware/src/main.c b/firmware/src/main.c index 54ea01f..d7c164b 100644 --- a/firmware/src/main.c +++ b/firmware/src/main.c @@ -57,6 +57,24 @@ void boot_check() } } +void mode_check() +{ + uint16_t key1 = (1 << (button_num() - 1)); + uint16_t key2 = (1 << (button_num() - 2)); + uint16_t buttons = button_read(); + if (buttons & key1) { + iidx_cfg->konami = true; + save_request(); + } else if (buttons & key2) { + iidx_cfg->konami = false; + save_request(); + } + + if (iidx_cfg->konami) { + konami_mode(); + } +} + static bool request_core1_pause = false; static void pause_core1(bool pause) @@ -132,6 +150,8 @@ void init() setup_init(); config_init(); save_init(pause_core1); + + mode_check(); } int main(void) diff --git a/firmware/src/usb_descriptors.c b/firmware/src/usb_descriptors.c index d813e04..203f61e 100644 --- a/firmware/src/usb_descriptors.c +++ b/firmware/src/usb_descriptors.c @@ -42,7 +42,7 @@ //--------------------------------------------------------------------+ // Device Descriptors //--------------------------------------------------------------------+ -tusb_desc_device_t const desc_device_joy = { +tusb_desc_device_t desc_device_joy = { .bLength = sizeof(tusb_desc_device_t), .bDescriptorType = TUSB_DESC_DEVICE, .bcdUSB = 0x0200, @@ -127,7 +127,7 @@ uint8_t const* tud_descriptor_configuration_cb(uint8_t index) { //--------------------------------------------------------------------+ // array of pointer to string descriptors -char const* string_desc_arr[] = { +const char *string_desc_arr[] = { (const char[]){0x09, 0x04}, // 0: is supported language is English (0x0409) "WHowe" , // 1: Manufacturer "Pico IIDX Controller", // 2: Product @@ -185,3 +185,11 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid) { return _desc_str; } + +void konami_mode() +{ + desc_device_joy.idVendor = 0x1ccf; + desc_device_joy.idProduct = 0x8048; + string_desc_arr[1] = "Konami Amusement"; + string_desc_arr[2] = "beatmania IIDX controller premium model"; +} diff --git a/firmware/src/usb_descriptors.h b/firmware/src/usb_descriptors.h index a6efd8d..c6021d8 100644 --- a/firmware/src/usb_descriptors.h +++ b/firmware/src/usb_descriptors.h @@ -64,4 +64,8 @@ enum { HID_USAGE_PAGE(HID_USAGE_PAGE_KEYBOARD), HID_USAGE_MIN(0), \ HID_USAGE_MAX(31 * 8 - 1), HID_INPUT(HID_VARIABLE), HID_COLLECTION_END + +/* Enable Konami spoof mode */ +void konami_mode(); + #endif /* USB_DESCRIPTORS_H_ */ \ No newline at end of file