PicoMiteVGAUSB: What gamepads are supported ?


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9773
Posted: 03:30pm 02 Feb 2025      

Try this

PicoMite.zip

Below is the decode for the two types of generic supported. Based on these write versions for your controllers given the diagnostic and let me have them and I'll incorporate them as VID/PID specific variants
The button bitmap is as follows:
BIT 0 Button R/R1
BIT 1 Button start/options
BIT 2 Button home
BIT 3 Button select/share
BIT 4 Button L/L1
BIT 5 Button down cursor
BIT 6 Button right cursor
BIT 7 Button up cursor
BIT 8 Button left cursor
BIT 9 Right shoulder button 2/R2
BIT 10 Button x/triangle
BIT 11 Button a/circle
BIT 12 Button y/square
BIT 13 Button b/cross
BIT 14 Left should button 2/L2
BIT 15 Touchpad

  Quote  void process_generic_gamepad(uint8_t const* report, uint16_t len, uint8_t n){
nunstruct[n].type=SNES;
uint16_t b=0;
if(report[5] & 0x10)b|=1<<10;
if(report[5] & 0x20)b|=1<<11;
if(report[5] & 0x40)b|=1<<13;
if(report[5] & 0x80)b|=1<<12;
if(report[6] & 1)b|=1<<4;
if(report[6] & 2)b|=1;
if(report[6] & 0x10)b|=1<<3;
if(report[6] & 0x20)b|=1<<1;
if(report[0] < 0x7f)b|=1<<8;
if(report[0] > 0x7f)b|=1<<6;
if(report[1] < 0x7f)b|=1<<7;
if(report[1] > 0x7f)b|=1<<5;
if((b ^ nunstruct[n].x0) & nunstruct[n].x1){
nunfoundc[n]=1;
}
nunstruct[n].x0=b;
}
void process_specific_gamepad(uint8_t const* report, uint16_t len, uint8_t n){
nunstruct[n].type=SNES;
uint16_t b=0;
if(report[5] & 0x10)b|=1<<10;
if(report[5] & 0x20)b|=1<<11;
if(report[5] & 0x40)b|=1<<13;
if(report[5] & 0x80)b|=1<<12;
if(report[6] & 1)b|=1<<4;
if(report[6] & 2)b|=1;
if(report[6] & 0x10)b|=1<<3;
if(report[6] & 0x20)b|=1<<1;
if(report[3] < 0x40)b|=1<<8;
if(report[3] > 0xC0)b|=1<<6;
if(report[4] < 0x40)b|=1<<7;
if(report[4] > 0xC0)b|=1<<5;
if((b ^ nunstruct[n].x0) & nunstruct[n].x1){
nunfoundc[n]=1;
}
nunstruct[n].x0=b;
}

Edited 2025-02-03 01:34 by matherp