mirror of https://github.com/PCSX2/pcsx2.git
Linux: Hack microVU into the Gui.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1275 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
477f5fa674
commit
e8ae911664
|
@ -55,7 +55,7 @@
|
|||
# else
|
||||
# define jBREAKPOINT() ((void) *(volatile char *) 0)
|
||||
# endif
|
||||
# define jASSUME(exp) do { if(exp) ; else jBREAKPOINT() } while(0);
|
||||
# define jASSUME(exp) do { if(exp) ; else jBREAKPOINT(); } while(0);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@ -94,6 +94,13 @@ default: \
|
|||
#define __naked __declspec(naked)
|
||||
#define __unused /*unused*/
|
||||
#define __noinline __declspec(noinline)
|
||||
|
||||
// Don't know if there are Visual C++ equivalents of these.
|
||||
#define __hot
|
||||
#define __cold
|
||||
#define likely(x) x
|
||||
#define unlikely(x) x
|
||||
|
||||
#define CALLBACK __stdcall
|
||||
|
||||
#else
|
||||
|
@ -106,7 +113,7 @@ default: \
|
|||
/* Test for GCC > 4.4.0; Should be adjusted when new versions come out */
|
||||
#if GCC_VERSION >= 40400
|
||||
#define THE_UNBEARABLE_LIGHTNESS_OF_BEING_GCC_4_4_0
|
||||
#define __nooptimization __attribute__((optimize("O0"))
|
||||
#define __nooptimization __attribute__((optimize("O0")))
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -137,6 +144,10 @@ This theoretically unoptimizes. Not having much luck so far.
|
|||
#define _inline __inline__ __attribute__((unused))
|
||||
#define __forceinline __attribute__((always_inline,unused))
|
||||
#define __noinline __attribute__((noinline))
|
||||
#define __hot __attribute__((hot))
|
||||
#define __cold __attribute__((cold))
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
#endif
|
||||
|
||||
#ifndef THE_UNBEARABLE_LIGHTNESS_OF_BEING_GCC_4_4_0
|
||||
|
|
|
@ -31,6 +31,10 @@ void OnCpu_Ok(GtkButton *button, gpointer user_data)
|
|||
newopts |= PCSX2_VU0REC;
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_VU1rec"))))
|
||||
newopts |= PCSX2_VU1REC;
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_microVU0rec"))))
|
||||
newopts |= PCSX2_MICROVU0;
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_microVU1rec"))))
|
||||
newopts |= PCSX2_MICROVU1;
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_MTGS"))))
|
||||
newopts |= PCSX2_GSMULTITHREAD;
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkRadioButton_LimitNormal"))))
|
||||
|
@ -82,6 +86,8 @@ void OnConf_Cpu(GtkMenuItem *menuitem, gpointer user_data)
|
|||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_EERec")), !!CHECK_EEREC);
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_VU0rec")), !!CHECK_VU0REC);
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_VU1rec")), !!CHECK_VU1REC);
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_microVU0rec")), !!CHECK_MICROVU0);
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_microVU1rec")), !!CHECK_MICROVU1);
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkCheckButton_MTGS")), !!CHECK_MULTIGS);
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkRadioButton_LimitNormal")), CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_NORMAL);
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(CpuDlg, "GtkRadioButton_LimitLimit")), CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_LIMIT);
|
||||
|
|
|
@ -79,6 +79,9 @@ void on_Speed_Hacks(GtkMenuItem *menuitem, gpointer user_data)
|
|||
set_checked(SpeedHacksDlg, "check_wait_cycles_sync_hack", Config.Hacks.WaitCycleExt);
|
||||
set_checked(SpeedHacksDlg, "check_intc_sync_hack", Config.Hacks.INTCSTATSlow);
|
||||
set_checked(SpeedHacksDlg, "check_idle_loop_fastforward", Config.Hacks.IdleLoopFF);
|
||||
set_checked(SpeedHacksDlg, "check_microvu_flag_hack_1", Config.Hacks.vuFlagHack1);
|
||||
set_checked(SpeedHacksDlg, "check_microvu_flag_hack_2", Config.Hacks.vuFlagHack2);
|
||||
set_checked(SpeedHacksDlg, "check_microvu_min_max_hack", Config.Hacks.vuMinMax);
|
||||
|
||||
gtk_range_set_value(vuScale, Config.Hacks.VUCycleSteal);
|
||||
on_vu_slider_changed(vuScale, NULL);
|
||||
|
@ -101,6 +104,9 @@ void on_Speed_Hack_OK(GtkButton *button, gpointer user_data)
|
|||
newhacks.WaitCycleExt = is_checked(SpeedHacksDlg, "check_wait_cycles_sync_hack");
|
||||
newhacks.INTCSTATSlow = is_checked(SpeedHacksDlg, "check_intc_sync_hack");
|
||||
newhacks.IdleLoopFF = is_checked(SpeedHacksDlg, "check_idle_loop_fastforward");
|
||||
newhacks.vuFlagHack1 = is_checked(SpeedHacksDlg, "check_microvu_flag_hack_1");
|
||||
newhacks.vuFlagHack2 = is_checked(SpeedHacksDlg, "check_microvu_flag_hack_2");
|
||||
newhacks.vuMinMax = is_checked(SpeedHacksDlg, "check_microvu_min_max_hack");
|
||||
|
||||
newhacks.VUCycleSteal = gtk_range_get_value(GTK_RANGE(lookup_widget(SpeedHacksDlg, "VUCycleHackScale")));
|
||||
newhacks.EECycleRate = gtk_range_get_value(GTK_RANGE(lookup_widget(SpeedHacksDlg, "EECycleHackScale")));
|
||||
|
|
|
@ -644,9 +644,19 @@ create_SpeedHacksDlg (void)
|
|||
GtkWidget *check_idle_loop_fastforward;
|
||||
GtkWidget *label110;
|
||||
GtkWidget *hseparator1;
|
||||
GtkWidget *frame41;
|
||||
GtkWidget *alignment36;
|
||||
GtkWidget *vbox75;
|
||||
GtkWidget *check_microvu_flag_hack_1;
|
||||
GtkWidget *check_microvu_flag_hack_2;
|
||||
GtkWidget *check_microvu_min_max_hack;
|
||||
GtkWidget *label113;
|
||||
GtkWidget *dialog_action_area3;
|
||||
GtkWidget *button99;
|
||||
GtkWidget *button98;
|
||||
GtkTooltips *tooltips;
|
||||
|
||||
tooltips = gtk_tooltips_new ();
|
||||
|
||||
SpeedHacksDlg = gtk_dialog_new ();
|
||||
gtk_widget_set_name (SpeedHacksDlg, "SpeedHacksDlg");
|
||||
|
@ -717,7 +727,7 @@ create_SpeedHacksDlg (void)
|
|||
gtk_box_pack_start (GTK_BOX (vbox61), label91, FALSE, FALSE, 0);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (label91), TRUE);
|
||||
|
||||
label105 = gtk_label_new (_("<b>EmotionEngine (EE) Sync Hacks</b>"));
|
||||
label105 = gtk_label_new (_("EmotionEngine (EE) Sync Hacks"));
|
||||
gtk_widget_set_name (label105, "label105");
|
||||
gtk_widget_show (label105);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame37), label105);
|
||||
|
@ -752,7 +762,7 @@ create_SpeedHacksDlg (void)
|
|||
gtk_box_pack_start (GTK_BOX (vbox73), vu_cycle_stealing_label, FALSE, FALSE, 0);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (vu_cycle_stealing_label), TRUE);
|
||||
|
||||
label111 = gtk_label_new (_("<b>VU Cycle Stealing (Speedup for 3d geometry)</b>"));
|
||||
label111 = gtk_label_new (_("VU Cycle Stealing (Speedup for 3d geometry)"));
|
||||
gtk_widget_set_name (label111, "label111");
|
||||
gtk_widget_show (label111);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame39), label111);
|
||||
|
@ -767,8 +777,9 @@ create_SpeedHacksDlg (void)
|
|||
gtk_widget_set_name (check_iop_cycle_rate, "check_iop_cycle_rate");
|
||||
gtk_widget_show (check_iop_cycle_rate);
|
||||
gtk_box_pack_start (GTK_BOX (vbox60), check_iop_cycle_rate, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_iop_cycle_rate, _("Small speedup, and works well with most games."), NULL);
|
||||
|
||||
label96 = gtk_label_new (_("Small speedup, and works well with most games,"));
|
||||
label96 = gtk_label_new (_("Small speedup, and works well with most games."));
|
||||
gtk_widget_set_name (label96, "label96");
|
||||
gtk_widget_show (label96);
|
||||
gtk_box_pack_start (GTK_BOX (vbox60), label96, FALSE, FALSE, 0);
|
||||
|
@ -778,6 +789,7 @@ create_SpeedHacksDlg (void)
|
|||
gtk_widget_set_name (check_wait_cycles_sync_hack, "check_wait_cycles_sync_hack");
|
||||
gtk_widget_show (check_wait_cycles_sync_hack);
|
||||
gtk_box_pack_start (GTK_BOX (vbox60), check_wait_cycles_sync_hack, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_wait_cycles_sync_hack, _("Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes."), NULL);
|
||||
|
||||
label97 = gtk_label_new (_("Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes."));
|
||||
gtk_widget_set_name (label97, "label97");
|
||||
|
@ -789,6 +801,7 @@ create_SpeedHacksDlg (void)
|
|||
gtk_widget_set_name (check_intc_sync_hack, "check_intc_sync_hack");
|
||||
gtk_widget_show (check_intc_sync_hack);
|
||||
gtk_box_pack_start (GTK_BOX (vbox60), check_intc_sync_hack, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_intc_sync_hack, _("Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks)."), NULL);
|
||||
|
||||
label101 = gtk_label_new (_("Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks)."));
|
||||
gtk_widget_set_name (label101, "label101");
|
||||
|
@ -805,8 +818,9 @@ create_SpeedHacksDlg (void)
|
|||
gtk_widget_set_name (check_idle_loop_fastforward, "check_idle_loop_fastforward");
|
||||
gtk_widget_show (check_idle_loop_fastforward);
|
||||
gtk_box_pack_start (GTK_BOX (vbox71), check_idle_loop_fastforward, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_idle_loop_fastforward, _("Speedup for a few games, including FFX with no known side effects."), NULL);
|
||||
|
||||
label110 = gtk_label_new (_("Speedup for a few games, including FFX with no known side effects. More later."));
|
||||
label110 = gtk_label_new (_("Speedup for a few games, including FFX with no known side effects."));
|
||||
gtk_widget_set_name (label110, "label110");
|
||||
gtk_widget_show (label110);
|
||||
gtk_box_pack_start (GTK_BOX (vbox71), label110, FALSE, FALSE, 0);
|
||||
|
@ -817,6 +831,46 @@ create_SpeedHacksDlg (void)
|
|||
gtk_widget_show (hseparator1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox60), hseparator1, FALSE, FALSE, 0);
|
||||
|
||||
frame41 = gtk_frame_new (NULL);
|
||||
gtk_widget_set_name (frame41, "frame41");
|
||||
gtk_widget_show (frame41);
|
||||
gtk_box_pack_start (GTK_BOX (dialog_vbox3), frame41, TRUE, TRUE, 0);
|
||||
|
||||
alignment36 = gtk_alignment_new (0.5, 0.5, 1, 1);
|
||||
gtk_widget_set_name (alignment36, "alignment36");
|
||||
gtk_widget_show (alignment36);
|
||||
gtk_container_add (GTK_CONTAINER (frame41), alignment36);
|
||||
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment36), 0, 0, 12, 0);
|
||||
|
||||
vbox75 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_set_name (vbox75, "vbox75");
|
||||
gtk_widget_show (vbox75);
|
||||
gtk_container_add (GTK_CONTAINER (alignment36), vbox75);
|
||||
|
||||
check_microvu_flag_hack_1 = gtk_check_button_new_with_mnemonic (_("Flag Hack 1 (microVU only)"));
|
||||
gtk_widget_set_name (check_microvu_flag_hack_1, "check_microvu_flag_hack_1");
|
||||
gtk_widget_show (check_microvu_flag_hack_1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox75), check_microvu_flag_hack_1, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_microvu_flag_hack_1, _("Big Speedup and moderately compatible. May cause SPS and Infinite loop problems."), NULL);
|
||||
|
||||
check_microvu_flag_hack_2 = gtk_check_button_new_with_mnemonic (_("Flag Hack 2 (microVU only)"));
|
||||
gtk_widget_set_name (check_microvu_flag_hack_2, "check_microvu_flag_hack_2");
|
||||
gtk_widget_show (check_microvu_flag_hack_2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox75), check_microvu_flag_hack_2, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_microvu_flag_hack_2, _("Big Speedup and moderately compatible. SuperVU does something similar by default."), NULL);
|
||||
|
||||
check_microvu_min_max_hack = gtk_check_button_new_with_mnemonic (_("Min / Max Hack (microVU only)"));
|
||||
gtk_widget_set_name (check_microvu_min_max_hack, "check_microvu_min_max_hack");
|
||||
gtk_widget_show (check_microvu_min_max_hack);
|
||||
gtk_box_pack_start (GTK_BOX (vbox75), check_microvu_min_max_hack, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_microvu_min_max_hack, _("Small Speedup. May cause SPS, hanging, and missing geometry."), NULL);
|
||||
|
||||
label113 = gtk_label_new (_("Vertex Unit (VU) Hacks"));
|
||||
gtk_widget_set_name (label113, "label113");
|
||||
gtk_widget_show (label113);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame41), label113);
|
||||
gtk_label_set_use_markup (GTK_LABEL (label113), TRUE);
|
||||
|
||||
dialog_action_area3 = GTK_DIALOG (SpeedHacksDlg)->action_area;
|
||||
gtk_widget_set_name (dialog_action_area3, "dialog_action_area3");
|
||||
gtk_widget_show (dialog_action_area3);
|
||||
|
@ -882,9 +936,17 @@ create_SpeedHacksDlg (void)
|
|||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, check_idle_loop_fastforward, "check_idle_loop_fastforward");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, label110, "label110");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, hseparator1, "hseparator1");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, frame41, "frame41");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, alignment36, "alignment36");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, vbox75, "vbox75");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, check_microvu_flag_hack_1, "check_microvu_flag_hack_1");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, check_microvu_flag_hack_2, "check_microvu_flag_hack_2");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, check_microvu_min_max_hack, "check_microvu_min_max_hack");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, label113, "label113");
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (SpeedHacksDlg, dialog_action_area3, "dialog_action_area3");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, button99, "button99");
|
||||
GLADE_HOOKUP_OBJECT (SpeedHacksDlg, button98, "button98");
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (SpeedHacksDlg, tooltips, "tooltips");
|
||||
|
||||
return SpeedHacksDlg;
|
||||
}
|
||||
|
@ -3859,6 +3921,12 @@ create_CpuDlg (void)
|
|||
GtkWidget *GtkCheckButton_VU0rec;
|
||||
GtkWidget *GtkCheckButton_VU1rec;
|
||||
GtkWidget *label32;
|
||||
GtkWidget *frame40;
|
||||
GtkWidget *alignment35;
|
||||
GtkWidget *vbox74;
|
||||
GtkWidget *GtkCheckButton_microVU0rec;
|
||||
GtkWidget *GtkCheckButton_microVU1rec;
|
||||
GtkWidget *label112;
|
||||
GtkWidget *GtkCheckButton_MTGS;
|
||||
GtkWidget *vbox48;
|
||||
GtkWidget *frame9;
|
||||
|
@ -3984,11 +4052,44 @@ create_CpuDlg (void)
|
|||
gtk_widget_show (GtkCheckButton_VU1rec);
|
||||
gtk_box_pack_start (GTK_BOX (vbox26), GtkCheckButton_VU1rec, FALSE, FALSE, 0);
|
||||
|
||||
label32 = gtk_label_new (_("VU Recompilers - All options are set by default"));
|
||||
label32 = gtk_label_new (_("VU Recompilers"));
|
||||
gtk_widget_set_name (label32, "label32");
|
||||
gtk_widget_show (label32);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame6), label32);
|
||||
|
||||
frame40 = gtk_frame_new (NULL);
|
||||
gtk_widget_set_name (frame40, "frame40");
|
||||
gtk_widget_show (frame40);
|
||||
gtk_box_pack_start (GTK_BOX (vbox47), frame40, FALSE, FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame40), 5);
|
||||
|
||||
alignment35 = gtk_alignment_new (0.5, 0.5, 1, 1);
|
||||
gtk_widget_set_name (alignment35, "alignment35");
|
||||
gtk_widget_show (alignment35);
|
||||
gtk_container_add (GTK_CONTAINER (frame40), alignment35);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (alignment35), 5);
|
||||
|
||||
vbox74 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_set_name (vbox74, "vbox74");
|
||||
gtk_widget_show (vbox74);
|
||||
gtk_container_add (GTK_CONTAINER (alignment35), vbox74);
|
||||
|
||||
GtkCheckButton_microVU0rec = gtk_check_button_new_with_mnemonic (_("microVU0 - Use microVU rec instead of VU0rec. ! Beta !"));
|
||||
gtk_widget_set_name (GtkCheckButton_microVU0rec, "GtkCheckButton_microVU0rec");
|
||||
gtk_widget_show (GtkCheckButton_microVU0rec);
|
||||
gtk_box_pack_start (GTK_BOX (vbox74), GtkCheckButton_microVU0rec, FALSE, FALSE, 0);
|
||||
|
||||
GtkCheckButton_microVU1rec = gtk_check_button_new_with_mnemonic (_("microVU1 - Use microVU rec instead of VU1rec. ! Beta !"));
|
||||
gtk_widget_set_name (GtkCheckButton_microVU1rec, "GtkCheckButton_microVU1rec");
|
||||
gtk_widget_show (GtkCheckButton_microVU1rec);
|
||||
gtk_box_pack_start (GTK_BOX (vbox74), GtkCheckButton_microVU1rec, FALSE, FALSE, 0);
|
||||
|
||||
label112 = gtk_label_new (_("microVU Recompilers - ! Beta !"));
|
||||
gtk_widget_set_name (label112, "label112");
|
||||
gtk_widget_show (label112);
|
||||
gtk_frame_set_label_widget (GTK_FRAME (frame40), label112);
|
||||
gtk_label_set_use_markup (GTK_LABEL (label112), TRUE);
|
||||
|
||||
GtkCheckButton_MTGS = gtk_check_button_new_with_mnemonic (_("Multi threaded GS mode (MTGS)\n (faster on dual core/HT CPUs, requires pcsx2 restart)"));
|
||||
gtk_widget_set_name (GtkCheckButton_MTGS, "GtkCheckButton_MTGS");
|
||||
gtk_widget_show (GtkCheckButton_MTGS);
|
||||
|
@ -4194,6 +4295,12 @@ create_CpuDlg (void)
|
|||
GLADE_HOOKUP_OBJECT (CpuDlg, GtkCheckButton_VU0rec, "GtkCheckButton_VU0rec");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, GtkCheckButton_VU1rec, "GtkCheckButton_VU1rec");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, label32, "label32");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, frame40, "frame40");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, alignment35, "alignment35");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, vbox74, "vbox74");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, GtkCheckButton_microVU0rec, "GtkCheckButton_microVU0rec");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, GtkCheckButton_microVU1rec, "GtkCheckButton_microVU1rec");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, label112, "label112");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, GtkCheckButton_MTGS, "GtkCheckButton_MTGS");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, vbox48, "vbox48");
|
||||
GLADE_HOOKUP_OBJECT (CpuDlg, frame9, "frame9");
|
||||
|
|
|
@ -1394,7 +1394,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkLabel" id="label105">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>EmotionEngine (EE) Sync Hacks</b></property>
|
||||
<property name="label" translatable="yes">EmotionEngine (EE) Sync Hacks</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
|
@ -1497,7 +1497,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkLabel" id="label111">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>VU Cycle Stealing (Speedup for 3d geometry)</b></property>
|
||||
<property name="label" translatable="yes">VU Cycle Stealing (Speedup for 3d geometry)</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
|
@ -1540,6 +1540,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkCheckButton" id="check_iop_cycle_rate">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Small speedup, and works well with most games.</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Enable IOP x2 Cycle Rate</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
@ -1559,7 +1560,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkLabel" id="label96">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Small speedup, and works well with most games,</property>
|
||||
<property name="label" translatable="yes">Small speedup, and works well with most games.</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
|
@ -1585,6 +1586,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkCheckButton" id="check_wait_cycles_sync_hack">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Small speedup. Works well with most games, but it may cause certain games to crash, or freeze up during bootup or stage changes.</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">WaitCycles Sync Hack</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
@ -1630,6 +1632,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkCheckButton" id="check_intc_sync_hack">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Huge speedup in many games, and a pretty high compatibility rate (some games still work better with EE sync hacks).</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">INTC Sync Hack</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
@ -1680,6 +1683,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkCheckButton" id="check_idle_loop_fastforward">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Speedup for a few games, including FFX with no known side effects.</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Idle Loop Fast-Forward (experimental)</property>
|
||||
<property name="use_underline">True</property>
|
||||
|
@ -1699,7 +1703,7 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<child>
|
||||
<widget class="GtkLabel" id="label110">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Speedup for a few games, including FFX with no known side effects. More later.</property>
|
||||
<property name="label" translatable="yes">Speedup for a few games, including FFX with no known side effects.</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
|
@ -1759,6 +1763,125 @@ If you have problems, Disable all of these and try again.</property>
|
|||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame41">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="label_yalign">0.5</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment36">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">1</property>
|
||||
<property name="yscale">1</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">12</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox75">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="check_microvu_flag_hack_1">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Big Speedup and moderately compatible. May cause SPS and Infinite loop problems.</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Flag Hack 1 (microVU only)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="check_microvu_flag_hack_2">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Big Speedup and moderately compatible. SuperVU does something similar by default.</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Flag Hack 2 (microVU only)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="check_microvu_min_max_hack">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Small Speedup. May cause SPS, hanging, and missing geometry.</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Min / Max Hack (microVU only)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label113">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Vertex Unit (VU) Hacks</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -6718,7 +6841,7 @@ Version x.x</property>
|
|||
<child>
|
||||
<widget class="GtkLabel" id="label32">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">VU Recompilers - All options are set by default</property>
|
||||
<property name="label" translatable="yes">VU Recompilers</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
|
@ -6745,6 +6868,105 @@ Version x.x</property>
|
|||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame40">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="label_yalign">0.5</property>
|
||||
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment35">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">1</property>
|
||||
<property name="yscale">1</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox74">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="GtkCheckButton_microVU0rec">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">microVU0 - Use microVU rec instead of VU0rec. ! Beta !</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="GtkCheckButton_microVU1rec">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">microVU1 - Use microVU rec instead of VU1rec. ! Beta !</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label112">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">microVU Recompilers - ! Beta !</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="GtkCheckButton_MTGS">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -343,7 +343,12 @@ void SuperVUAlloc(int vuindex)
|
|||
{
|
||||
// upper 4 bits must be zero!
|
||||
// Changed "first try base" to 0xb800000, since 0x0c000000 liked to fail a lot. (air)
|
||||
// With microVU as optional now, Linux fails with 0x0e000000, and prefers 0x0c000000. --arcum42
|
||||
#ifdef __LINUX__
|
||||
s_recVUMem = SysMmapEx(0x0c000000, VU_EXESIZE, 0x10000000, "SuperVUAlloc");
|
||||
#else
|
||||
s_recVUMem = SysMmapEx(0x0e000000, VU_EXESIZE, 0x10000000, "SuperVUAlloc");
|
||||
#endif
|
||||
|
||||
if (s_recVUMem == NULL)
|
||||
{
|
||||
|
|
|
@ -37,8 +37,6 @@ PCSX2_ALIGNED16( u8 g_RealGSMem[0x2000] );
|
|||
|
||||
static void RegHandlerSIGNAL(const u32* data)
|
||||
{
|
||||
//MTGS_LOG("MTGS SIGNAL data %x_%x CSRw %x\n",data[0], data[1], CSRw);
|
||||
|
||||
GSSIGLBLID->SIGID = (GSSIGLBLID->SIGID&~data[1])|(data[0]&data[1]);
|
||||
|
||||
if ((CSRw & 0x1)) GSCSRr |= 1; // signal
|
||||
|
@ -48,8 +46,6 @@ static void RegHandlerSIGNAL(const u32* data)
|
|||
|
||||
static void RegHandlerFINISH(const u32* data)
|
||||
{
|
||||
//MTGS_LOG("MTGS FINISH data %x_%x CSRw %x\n",data[0], data[1], CSRw);
|
||||
|
||||
if ((CSRw & 0x2)) GSCSRr |= 2; // finish
|
||||
|
||||
if (!(GSIMR & 0x200) ) GSirq();
|
||||
|
|
|
@ -29,15 +29,15 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
HINSTANCE hInst=NULL;
|
||||
HINSTANCE hInst = NULL;
|
||||
static pthread_spinlock_t s_mutexStatus;
|
||||
static u32 s_keyPress[2], s_keyRelease[2];
|
||||
extern u16 status[2];
|
||||
|
||||
extern string s_strIniPath;
|
||||
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
WNDPROC GSwndProc=NULL;
|
||||
HWND GShwnd=NULL;
|
||||
WNDPROC GSwndProc = NULL;
|
||||
HWND GShwnd = NULL;
|
||||
|
||||
extern keyEvent event;
|
||||
|
||||
|
@ -51,19 +51,21 @@ void SaveConfig()
|
|||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||
szTemp = strrchr(szIniFile, '\\');
|
||||
|
||||
if(!szTemp) return;
|
||||
if (!szTemp) return;
|
||||
strcpy(szTemp, "\\inis\\zeropad.ini");
|
||||
|
||||
for (j=0; j<2; j++) {
|
||||
for (i=0; i<PADKEYS; i++) {
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
for (i = 0; i < PADKEYS; i++)
|
||||
{
|
||||
sprintf(szProf, "%d_%d", j, i);
|
||||
sprintf(szValue, "%d", conf.keys[j][i]);
|
||||
WritePrivateProfileString("Interface", szProf,szValue,szIniFile);
|
||||
WritePrivateProfileString("Interface", szProf, szValue, szIniFile);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(szValue,"%u",conf.log);
|
||||
WritePrivateProfileString("Interface", "Logging",szValue,szIniFile);
|
||||
sprintf(szValue, "%u", conf.log);
|
||||
WritePrivateProfileString("Interface", "Logging", szValue, szIniFile);
|
||||
}
|
||||
|
||||
void LoadConfig()
|
||||
|
@ -95,18 +97,21 @@ void LoadConfig()
|
|||
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
|
||||
szTemp = strrchr(szIniFile, '\\');
|
||||
|
||||
if(!szTemp) return ;
|
||||
if (!szTemp) return ;
|
||||
strcpy(szTemp, "\\inis\\zeropad.ini");
|
||||
fp=fopen("inis\\zeropad.ini","rt");//check if usbnull.ini really exists
|
||||
if (!fp) {
|
||||
CreateDirectory("inis",NULL);
|
||||
fp = fopen("inis\\zeropad.ini", "rt");//check if usbnull.ini really exists
|
||||
if (!fp)
|
||||
{
|
||||
CreateDirectory("inis", NULL);
|
||||
SaveConfig();//save and return
|
||||
return ;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
for (j=0; j<2; j++) {
|
||||
for (i=0; i<PADKEYS; i++) {
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
for (i = 0; i < PADKEYS; i++)
|
||||
{
|
||||
sprintf(szProf, "%d_%d", j, i);
|
||||
GetPrivateProfileString("Interface", szProf, NULL, szValue, 20, szIniFile);
|
||||
conf.keys[j][i] = strtoul(szValue, NULL, 10);
|
||||
|
@ -117,12 +122,13 @@ void LoadConfig()
|
|||
conf.log = strtoul(szValue, NULL, 10);
|
||||
}
|
||||
|
||||
void SysMessage(char *fmt, ...) {
|
||||
void SysMessage(char *fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
char tmp[512];
|
||||
|
||||
va_start(list,fmt);
|
||||
vsprintf(tmp,fmt,list);
|
||||
va_start(list, fmt);
|
||||
vsprintf(tmp, fmt, list);
|
||||
va_end(list);
|
||||
MessageBox(0, tmp, "PADwinKeyb Msg", 0);
|
||||
}
|
||||
|
@ -135,12 +141,13 @@ s32 _PADopen(void *pDsp)
|
|||
s_keyPress[0] = s_keyPress[1] = 0;
|
||||
s_keyRelease[0] = s_keyRelease[1] = 0;
|
||||
|
||||
if( GShwnd != NULL && GSwndProc != NULL ) {
|
||||
if (GShwnd != NULL && GSwndProc != NULL)
|
||||
{
|
||||
// revert
|
||||
SetWindowLongPtr(GShwnd, GWLP_WNDPROC, (LPARAM)(WNDPROC)(GSwndProc));
|
||||
}
|
||||
|
||||
GShwnd = (HWND)*(long*)pDsp;
|
||||
GShwnd = (HWND) * (long*)pDsp;
|
||||
GSwndProc = (WNDPROC)GetWindowLongPtr(GShwnd, GWLP_WNDPROC);
|
||||
GSwndProc = ((WNDPROC)SetWindowLongPtr(GShwnd, GWLP_WNDPROC, (LPARAM)(WNDPROC)(PADwndProc)));
|
||||
|
||||
|
@ -149,7 +156,8 @@ s32 _PADopen(void *pDsp)
|
|||
|
||||
void _PADclose()
|
||||
{
|
||||
if( GShwnd != NULL && GSwndProc != NULL ) {
|
||||
if (GShwnd != NULL && GSwndProc != NULL)
|
||||
{
|
||||
SetWindowLongPtr(GShwnd, GWLP_WNDPROC, (LPARAM)(WNDPROC)(GSwndProc));
|
||||
GSwndProc = NULL;
|
||||
GShwnd = NULL;
|
||||
|
@ -173,19 +181,23 @@ void CALLBACK PADupdate(int pad)
|
|||
|
||||
LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int i,pad,keyPress[2]={0},keyRelease[2]={0};
|
||||
static bool lbutton=false,rbutton=false;
|
||||
int i, pad, keyPress[2] = {0}, keyRelease[2] = {0};
|
||||
static bool lbutton = false, rbutton = false;
|
||||
|
||||
switch (msg) {
|
||||
switch (msg)
|
||||
{
|
||||
case WM_KEYDOWN:
|
||||
if (lParam & 0x40000000)
|
||||
return TRUE;
|
||||
|
||||
for(pad = 0; pad < 2; ++pad ) {
|
||||
for (i=0; i<PADKEYS; i++) {
|
||||
if (wParam == conf.keys[pad][i]) {
|
||||
keyPress[pad] |=(1<<i);
|
||||
keyRelease[pad] &=~(1<<i);
|
||||
for (pad = 0; pad < 2; ++pad)
|
||||
{
|
||||
for (i = 0; i < PADKEYS; i++)
|
||||
{
|
||||
if (wParam == conf.keys[pad][i])
|
||||
{
|
||||
keyPress[pad] |= (1 << i);
|
||||
keyRelease[pad] &= ~(1 << i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -196,11 +208,14 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_KEYUP:
|
||||
for(pad = 0; pad < 2; ++pad ) {
|
||||
for (i=0; i<PADKEYS; i++) {
|
||||
if (wParam == conf.keys[pad][i]) {
|
||||
keyPress[pad] &=~(1<<i);
|
||||
keyRelease[pad] |= (1<<i);
|
||||
for (pad = 0; pad < 2; ++pad)
|
||||
{
|
||||
for (i = 0; i < PADKEYS; i++)
|
||||
{
|
||||
if (wParam == conf.keys[pad][i])
|
||||
{
|
||||
keyPress[pad] &= ~(1 << i);
|
||||
keyRelease[pad] |= (1 << i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -236,14 +251,14 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
if(lbutton)
|
||||
if (lbutton)
|
||||
{
|
||||
g_lanalog[0].x = LOWORD(lParam) & 254;
|
||||
g_lanalog[0].y = HIWORD(lParam) & 254;
|
||||
g_lanalog[1].x = LOWORD(lParam) & 254;
|
||||
g_lanalog[1].y = HIWORD(lParam) & 254;
|
||||
}
|
||||
if(rbutton)
|
||||
if (rbutton)
|
||||
{
|
||||
g_ranalog[0].x = LOWORD(lParam) & 254;
|
||||
g_ranalog[0].y = HIWORD(lParam) & 254;
|
||||
|
@ -263,7 +278,8 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
pthread_spin_lock(&s_mutexStatus);
|
||||
for(pad = 0; pad < 2; ++pad ) {
|
||||
for (pad = 0; pad < 2; ++pad)
|
||||
{
|
||||
s_keyPress[pad] |= keyPress[pad];
|
||||
s_keyPress[pad] &= ~keyRelease[pad];
|
||||
s_keyRelease[pad] |= keyRelease[pad];
|
||||
|
@ -277,13 +293,15 @@ LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
string GetKeyLabel(const int pad, const int index)
|
||||
{
|
||||
const int key = conf.keys[pad][index];
|
||||
char buff[16]="NONE)";
|
||||
char buff[16] = "NONE)";
|
||||
if (key < 0x100)
|
||||
{
|
||||
if (key == 0)
|
||||
strcpy (buff, "NONE");
|
||||
else {
|
||||
if(key>=0x60 && key<=0x69) {
|
||||
strcpy(buff, "NONE");
|
||||
else
|
||||
{
|
||||
if (key >= 0x60 && key <= 0x69)
|
||||
{
|
||||
sprintf(buff, "NumPad %c", '0' + key - 0x60);
|
||||
}
|
||||
else sprintf(buff, "%c", key);
|
||||
|
@ -291,42 +309,45 @@ string GetKeyLabel(const int pad, const int index)
|
|||
}
|
||||
else if (key >= 0x1000 && key < 0x2000)
|
||||
{
|
||||
sprintf (buff, "J%d_%d", (key & 0xfff) / 0x100, (key & 0xff) + 1);
|
||||
sprintf(buff, "J%d_%d", (key & 0xfff) / 0x100, (key & 0xff) + 1);
|
||||
}
|
||||
else if (key >= 0x2000 && key < 0x3000)
|
||||
{
|
||||
static const char name[][4] = { "MIN", "MAX" };
|
||||
const int axis = (key & 0xff);
|
||||
sprintf (buff, "J%d_AXIS%d_%s", (key & 0xfff) / 0x100, axis / 2, name[axis % 2]);
|
||||
sprintf(buff, "J%d_AXIS%d_%s", (key & 0xfff) / 0x100, axis / 2, name[axis % 2]);
|
||||
if (index >= 17 && index <= 20)
|
||||
buff[strlen (buff) -4] = '\0';
|
||||
buff[strlen(buff) -4] = '\0';
|
||||
}
|
||||
else if (key >= 0x3000 && key < 0x4000)
|
||||
{
|
||||
static const char name[][7] = { "FOWARD", "RIGHT", "BACK", "LEFT" };
|
||||
const int pov = (key & 0xff);
|
||||
sprintf (buff, "J%d_POV%d_%s", (key & 0xfff) / 0x100, pov /4, name[pov % 4]);
|
||||
sprintf(buff, "J%d_POV%d_%s", (key & 0xfff) / 0x100, pov / 4, name[pov % 4]);
|
||||
}
|
||||
|
||||
return buff;
|
||||
}
|
||||
|
||||
BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND hWC;
|
||||
TCITEM tcI;
|
||||
int i,key, numkeys;
|
||||
int i, key, numkeys;
|
||||
u8* pkeyboard;
|
||||
static int disabled=0;
|
||||
static int padn=0;
|
||||
static int disabled = 0;
|
||||
static int padn = 0;
|
||||
|
||||
switch(uMsg) {
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
LoadConfig();
|
||||
padn = 0;
|
||||
if (conf.log) CheckDlgButton(hW, IDC_LOG, TRUE);
|
||||
|
||||
for (i=0; i<PADKEYS; i++) {
|
||||
hWC = GetDlgItem(hW, IDC_L2 + i*2);
|
||||
for (i = 0; i < PADKEYS; i++)
|
||||
{
|
||||
hWC = GetDlgItem(hW, IDC_L2 + i * 2);
|
||||
Button_SetText(hWC, GetKeyLabel(padn, i).c_str());
|
||||
}
|
||||
|
||||
|
@ -344,41 +365,46 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return TRUE;
|
||||
|
||||
case WM_TIMER:
|
||||
if (disabled){
|
||||
if (disabled)
|
||||
{
|
||||
key = 0;
|
||||
//pkeyboard = SDL_GetKeyState(&numkeys);
|
||||
for (int i = 0; i < numkeys; ++i) {
|
||||
if( pkeyboard[i] ) {
|
||||
for (int i = 0; i < numkeys; ++i)
|
||||
{
|
||||
if (pkeyboard[i])
|
||||
{
|
||||
key = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( key == 0 ) {
|
||||
if (key == 0)
|
||||
{
|
||||
// check joystick
|
||||
}
|
||||
|
||||
if (key != 0){
|
||||
if (key != 0)
|
||||
{
|
||||
KillTimer(hW, 0x80);
|
||||
hWC = GetDlgItem(hW, disabled);
|
||||
conf.keys[padn][disabled-IDC_L2] = key;
|
||||
Button_SetText(hWC, GetKeyLabel(padn, disabled-IDC_L2).c_str());
|
||||
Button_SetText(hWC, GetKeyLabel(padn, disabled - IDC_L2).c_str());
|
||||
EnableWindow(hWC, TRUE);
|
||||
disabled=0;
|
||||
disabled = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
for(i = IDC_L2; i <= IDC_LEFT; i+=2)
|
||||
for (i = IDC_L2; i <= IDC_LEFT; i += 2)
|
||||
{
|
||||
if(LOWORD(wParam) == i)
|
||||
if (LOWORD(wParam) == i)
|
||||
{
|
||||
if (disabled)//change selection
|
||||
EnableWindow(GetDlgItem(hW, disabled), TRUE);
|
||||
|
||||
EnableWindow(GetDlgItem(hW, disabled=wParam), FALSE);
|
||||
EnableWindow(GetDlgItem(hW, disabled = wParam), FALSE);
|
||||
|
||||
SetTimer(hW, 0x80, 250, NULL);
|
||||
|
||||
|
@ -386,7 +412,8 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
}
|
||||
|
||||
switch(LOWORD(wParam)) {
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDCANCEL:
|
||||
KillTimer(hW, 0x80);
|
||||
EndDialog(hW, TRUE);
|
||||
|
@ -403,12 +430,14 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
switch (wParam) {
|
||||
switch (wParam)
|
||||
{
|
||||
case IDC_TABC:
|
||||
hWC = GetDlgItem(hW, IDC_TABC);
|
||||
padn = TabCtrl_GetCurSel(hWC);
|
||||
|
||||
for (i=0; i<PADKEYS; i++) {
|
||||
for (i = 0; i < PADKEYS; i++)
|
||||
{
|
||||
hWC = GetDlgItem(hW, IDC_EL3 + i);
|
||||
Button_SetText(hWC, GetKeyLabel(padn, i).c_str());
|
||||
}
|
||||
|
@ -421,13 +450,16 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||
switch(uMsg) {
|
||||
BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)) {
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
EndDialog(hW, FALSE);
|
||||
return TRUE;
|
||||
|
@ -436,24 +468,28 @@ BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void CALLBACK PADconfigure() {
|
||||
void CALLBACK PADconfigure()
|
||||
{
|
||||
DialogBox(hInst,
|
||||
MAKEINTRESOURCE(IDD_DIALOG1),
|
||||
GetActiveWindow(),
|
||||
(DLGPROC)ConfigureDlgProc);
|
||||
}
|
||||
|
||||
void CALLBACK PADabout() {
|
||||
void CALLBACK PADabout()
|
||||
{
|
||||
SysMessage("Author: zerofrog\nThanks to SSSPSXPad, TwinPAD, and PADwin plugins");
|
||||
}
|
||||
|
||||
s32 CALLBACK PADtest() {
|
||||
s32 CALLBACK PADtest()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HANDLE hModule, // DLL INIT
|
||||
DWORD dwReason,
|
||||
LPVOID lpReserved) {
|
||||
LPVOID lpReserved)
|
||||
{
|
||||
hInst = (HINSTANCE)hModule;
|
||||
return TRUE; // very quick :)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue