(Vita) Add target - not finished
[pcsx_rearmed.git] / frontend / libretro.c
index acc64a1..b611e84 100644 (file)
@@ -51,6 +51,7 @@ extern char McdDisable[2];
 /* PCSX ReARMed core calls and stuff */
 int in_type1, in_type2;
 int in_a1[2] = { 127, 127 }, in_a2[2] = { 127, 127 };
+int in_a3[2] = { 127, 127 }, in_a4[2] = { 127, 127 };
 int in_keystate;
 int in_enable_vibration = 1;
 
@@ -256,6 +257,8 @@ void retro_set_environment(retro_environment_t cb)
       { "pcsx_rearmed_duping_enable", "Frame duping; on|off" },
       { "pcsx_rearmed_spu_reverb", "Sound: Reverb; on|off" },
       { "pcsx_rearmed_spu_interpolation", "Sound: Interpolation; simple|gaussian|cubic|off" },
+      { "pcsx_rearmed_pe2_fix", "Parasite Eve 2/Vandal Hearts 1/2 Fix; disabled|enabled" },
+      { "pcsx_rearmed_inuyasha_fix", "InuYasha Sengoku Battle Fix; disabled|enabled" },
       { NULL, NULL },
    };
 
@@ -1085,6 +1088,28 @@ static void update_variables(bool in_flight)
          spu_config.iUseInterpolation = 0;
    }
 
+   var.value = "NULL";
+   var.key = "pcsx_rearmed_pe2_fix";
+
+   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+   {
+      if (strcmp(var.value, "disabled") == 0)
+         Config.RCntFix = 0;
+      else if (strcmp(var.value, "enabled") == 0)
+         Config.RCntFix = 1;
+   }
+   
+   var.value = "NULL";
+   var.key = "pcsx_rearmed_inuyasha_fix";
+
+   if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
+   {
+      if (strcmp(var.value, "disabled") == 0)
+         Config.VSyncWA = 0;
+      else if (strcmp(var.value, "enabled") == 0)
+         Config.VSyncWA = 1;
+   }
+
    if (in_flight) {
       // inform core things about possible config changes
       plugin_call_rearmed_cbs();
@@ -1125,6 +1150,14 @@ void retro_run(void)
                in_a2[1] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
        }
 
+       if (in_type2 == PSE_PAD_TYPE_ANALOGPAD)
+       {
+               in_a3[0] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
+               in_a3[1] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
+               in_a4[0] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
+               in_a4[1] = (input_state_cb(1, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
+       }
+
        stop = 0;
        psxCpu->Execute();