595
671
delete Devices[port];
596
672
Devices[port] = NULL;
598
if(!strcmp(type, "gamepad"))
675
irq10_pulse_ts[port] = PSX_EVENT_MAXTS;
677
if(!strcmp(type, "gamepad") || !strcmp(type, "dancepad"))
599
678
Devices[port] = Device_Gamepad_Create();
600
679
else if(!strcmp(type, "dualanalog"))
601
680
Devices[port] = Device_DualAnalog_Create(false);
602
681
else if(!strcmp(type, "analogjoy"))
603
682
Devices[port] = Device_DualAnalog_Create(true);
683
else if(!strcmp(type, "dualshock"))
686
trio_snprintf(name, 256, _("DualShock on port %u"), port + 1);
687
Devices[port] = Device_DualShock_Create(std::string(name));
604
689
else if(!strcmp(type, "mouse"))
605
690
Devices[port] = Device_Mouse_Create();
691
else if(!strcmp(type, "negcon"))
692
Devices[port] = Device_neGcon_Create();
693
else if(!strcmp(type, "guncon"))
694
Devices[port] = Device_GunCon_Create();
695
else if(!strcmp(type, "justifier"))
696
Devices[port] = Device_Justifier_Create();
607
698
Devices[port] = new InputDevice();
700
Devices[port]->SetAMCT(amct_enabled);
701
Devices[port]->SetCrosshairsColor(chair_colors[port]);
609
702
DeviceData[port] = ptr;
611
704
MapDevicesToPorts();
763
bool FrontIO::RequireNoFrameskip(void)
765
for(unsigned i = 0; i < 8; i++)
766
if(Devices[i]->RequireNoFrameskip())
772
void FrontIO::GPULineHook(const pscpu_timestamp_t timestamp, const pscpu_timestamp_t line_timestamp, bool vsync, uint32 *pixels, const MDFN_PixelFormat* const format, const unsigned width, const unsigned pix_clock_offset, const unsigned pix_clock)
776
for(unsigned i = 0; i < 8; i++)
778
pscpu_timestamp_t plts = Devices[i]->GPULineHook(line_timestamp, vsync, pixels, format, width, pix_clock_offset, pix_clock);
782
irq10_pulse_ts[i] = plts;
784
if(irq10_pulse_ts[i] <= timestamp)
786
irq10_pulse_ts[i] = PSX_EVENT_MAXTS;
787
IRQ_Assert(IRQ_PIO, true);
788
IRQ_Assert(IRQ_PIO, false);
793
PSX_SetEventNT(PSX_EVENT_FIO, CalcNextEventTS(timestamp, 0x10000000));
672
796
static InputDeviceInfoStruct InputDeviceInfoPSXPort[] =
686
811
"Digital Gamepad",
812
"PlayStation digital gamepad; SCPH-1080.",
688
814
sizeof(Device_Gamepad_IDII) / sizeof(InputDeviceInputInfoStruct),
689
815
Device_Gamepad_IDII,
818
// Dual Shock Gamepad(SCPH-1200)
822
"DualShock gamepad; SCPH-1200. Emulation in Mednafen includes the analog mode toggle button.",
824
sizeof(Device_DualShock_IDII) / sizeof(InputDeviceInputInfoStruct),
825
Device_DualShock_IDII,
692
828
// Dual Analog Gamepad(SCPH-1180), forced to analog mode.
832
"Dual Analog gamepad; SCPH-1180. It is the predecessor/prototype to the more advanced DualShock. Emulated in Mednafen as forced to analog mode, and without rumble.",
697
834
sizeof(Device_DualAnalog_IDII) / sizeof(InputDeviceInputInfoStruct),
698
835
Device_DualAnalog_IDII,
715
854
sizeof(Device_Mouse_IDII) / sizeof(InputDeviceInputInfoStruct),
716
855
Device_Mouse_IDII,
861
"Namco's unconventional twisty racing-game-oriented gamepad; NPC-101.",
863
sizeof(Device_neGcon_IDII) / sizeof(InputDeviceInputInfoStruct),
870
"Namco's light gun; NPC-103.",
872
sizeof(Device_GunCon_IDII) / sizeof(InputDeviceInputInfoStruct),
879
"Konami's light gun; SLUH-00017. Rumored to be wrought of the coagulated rage of all who tried to shoot The Dog. If the game you want to play supports the \"GunCon\", you should use that instead. NOTE: Currently does not work properly when on any of ports 1B-1D and 2B-2D.",
881
sizeof(Device_Justifier_IDII) / sizeof(InputDeviceInputInfoStruct),
882
Device_Justifier_IDII,
888
"Dingo Dingo Rodeo!",
890
sizeof(Device_Dancepad_IDII) / sizeof(InputDeviceInputInfoStruct),
891
Device_Dancepad_IDII,
721
896
static const InputPortInfoStruct PortInfo[] =
723
{ 0, "port1", "Port 1/1A", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
724
{ 0, "port2", "Port 2/2A", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
725
{ 0, "port3", "Port 1B", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
726
{ 0, "port4", "Port 1C", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
727
{ 0, "port5", "Port 1D", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
728
{ 0, "port6", "Port 2B", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
729
{ 0, "port7", "Port 2C", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
730
{ 0, "port8", "Port 2D", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
898
{ "port1", "Port 1/1A", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
899
{ "port2", "Port 2/2A", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
900
{ "port3", "Port 1B", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
901
{ "port4", "Port 1C", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
902
{ "port5", "Port 1D", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
903
{ "port6", "Port 2B", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
904
{ "port7", "Port 2C", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
905
{ "port8", "Port 2D", sizeof(InputDeviceInfoPSXPort) / sizeof(InputDeviceInfoStruct), InputDeviceInfoPSXPort, "gamepad" },
733
908
InputInfoStruct FIO_InputInfo =