summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--data/pcsx.glade2632
-rw-r--r--gui/Cheat.c706
-rw-r--r--gui/Gtk2Gui.c2
-rw-r--r--libpcsxcore/cdriso.c8
-rw-r--r--libpcsxcore/cheat.c602
-rw-r--r--libpcsxcore/cheat.h62
-rw-r--r--libpcsxcore/psxhw.c8
-rw-r--r--libpcsxcore/psxmem.h5
-rw-r--r--libpcsxcore/r3000a.c5
-rw-r--r--plugins/dfsound/alsa.c4
-rw-r--r--plugins/dfsound/spu.c34
-rw-r--r--win32/gui/WndMain.c16
13 files changed, 1792 insertions, 305 deletions
diff --git a/ChangeLog b/ChangeLog
index 25f66ca0..2d219424 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+June 29, 2009 Wei Mingzhi <weimingzhi@gmail.com>
+
+ * libpcsxcore/cheat.c: Implemented Cheat Search.
+ * libpcsxcore/cheat.h: Likewise.
+ * gui/Cheat.c: Likewise.
+ * gui/Gtk2Gui.c: Backup the memory for cheat search when continuing emulation.
+ * data/pcsx.glade2: Tweaked the cheat search dialog for implemention. Fixed
+ the main menu under newer version of Glade.
+ * libpcsxcore/r3000a.c: Free cheat search results on exit.
+ * libpcsxcore/psxmem.h: Fixed a typo in psxMu8(). Removed check for __sh__
+ macro.
+ * win32/gui/WndMain.c: Restarting is no longer needed at first run.
+
June 20, 2009 Wei Mingzhi <weimingzhi@gmail.com>
* libpcsxcore/misc.c: Fixed a bug which prevented files in a subdirectory
diff --git a/data/pcsx.glade2 b/data/pcsx.glade2
index f37cad67..0e3d698c 100644
--- a/data/pcsx.glade2
+++ b/data/pcsx.glade2
@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
+<?xml version="1.0"?>
<glade-interface>
+ <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="MainWindow">
<property name="width_request">350</property>
<property name="height_request">195</property>
<property name="visible">True</property>
<property name="title" translatable="yes">PCSX</property>
<property name="resizable">False</property>
- <property name="window_position">GTK_WIN_POS_CENTER</property>
+ <property name="window_position">center</property>
<property name="icon_name">pcsx-icon.png</property>
<signal name="destroy" handler="OnDestroy"/>
<child>
@@ -26,64 +26,69 @@
<widget class="GtkMenu" id="item1_menu">
<child>
<widget class="GtkImageMenuItem" id="RunCd">
- <property name="visible">True</property>
<property name="label" translatable="yes">Run _CD</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnFile_RunCd"/>
- <accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="O" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="image404">
+ <widget class="GtkImage" id="image1">
<property name="visible">True</property>
+ <property name="xalign">0.49000000953674316</property>
<property name="stock">gtk-cdrom</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="RunImage">
- <property name="visible">True</property>
<property name="label" translatable="yes">Run _ISO</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnFile_RunImage"/>
- <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="I" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image17">
+ <widget class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="RunBios">
- <property name="visible">True</property>
<property name="label" translatable="yes">Run _BIOS</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnFile_RunBios"/>
- <accelerator key="B" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="B" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="image405">
+ <widget class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="RunExe">
- <property name="visible">True</property>
<property name="label" translatable="yes">Run _EXE</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnFile_RunExe"/>
- <accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="E" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="image406">
+ <widget class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="stock">gtk-execute</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -95,16 +100,17 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="exit2">
- <property name="visible">True</property>
<property name="label" translatable="yes">E_xit</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnFile_Exit"/>
- <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="Q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="image412">
+ <widget class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-quit</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -122,30 +128,32 @@
<widget class="GtkMenu" id="emulator1_menu">
<child>
<widget class="GtkImageMenuItem" id="run1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Continue</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnEmu_Run"/>
<child internal-child="image">
- <widget class="GtkImage" id="image413">
+ <widget class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="reset1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Reset</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnEmu_Reset"/>
<child internal-child="image">
- <widget class="GtkImage" id="image414">
+ <widget class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -157,16 +165,17 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="SwitchImage">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Switch ISO</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnEmu_SwitchImage"/>
- <accelerator key="W" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="W" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="image1">
+ <widget class="GtkImage" id="image8">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -178,9 +187,10 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="save1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Save State</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<child>
<widget class="GtkMenu" id="save1_menu">
<child>
@@ -189,7 +199,7 @@
<property name="label" translatable="yes">Slot _1</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Save1"/>
- <accelerator key="1" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="1" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</widget>
</child>
<child>
@@ -198,7 +208,7 @@
<property name="label" translatable="yes">Slot _2</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Save2"/>
- <accelerator key="2" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="2" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</widget>
</child>
<child>
@@ -207,7 +217,7 @@
<property name="label" translatable="yes">Slot _3</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Save3"/>
- <accelerator key="3" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="3" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</widget>
</child>
<child>
@@ -216,7 +226,7 @@
<property name="label" translatable="yes">Slot _4</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Save4"/>
- <accelerator key="4" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="4" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</widget>
</child>
<child>
@@ -225,21 +235,22 @@
<property name="label" translatable="yes">Slot _5</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Save5"/>
- <accelerator key="5" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="5" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="other2">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Other...</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnStates_SaveOther"/>
- <accelerator key="0" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="0" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image23">
+ <widget class="GtkImage" id="image19">
<property name="visible">True</property>
- <property name="stock">gtk-open</property>
- <property name="icon_size">1</property>
+ <property name="stock">gtk-save-as</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -247,19 +258,20 @@
</widget>
</child>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image24">
+ <widget class="GtkImage" id="image9">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="load1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Load State</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<child>
<widget class="GtkMenu" id="load1_menu">
<child>
@@ -268,7 +280,7 @@
<property name="label" translatable="yes">Slot _1</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Load1"/>
- <accelerator key="1" modifiers="GDK_MOD1_MASK" signal="activate"/>
+ <accelerator key="1" signal="activate" modifiers="GDK_MOD1_MASK"/>
</widget>
</child>
<child>
@@ -277,7 +289,7 @@
<property name="label" translatable="yes">Slot _2</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Load2"/>
- <accelerator key="2" modifiers="GDK_MOD1_MASK" signal="activate"/>
+ <accelerator key="2" signal="activate" modifiers="GDK_MOD1_MASK"/>
</widget>
</child>
<child>
@@ -286,7 +298,7 @@
<property name="label" translatable="yes">Slot _3</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Load3"/>
- <accelerator key="3" modifiers="GDK_MOD1_MASK" signal="activate"/>
+ <accelerator key="3" signal="activate" modifiers="GDK_MOD1_MASK"/>
</widget>
</child>
<child>
@@ -295,7 +307,7 @@
<property name="label" translatable="yes">Slot _4</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Load4"/>
- <accelerator key="4" modifiers="GDK_MOD1_MASK" signal="activate"/>
+ <accelerator key="4" signal="activate" modifiers="GDK_MOD1_MASK"/>
</widget>
</child>
<child>
@@ -304,21 +316,22 @@
<property name="label" translatable="yes">Slot _5</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnStates_Load5"/>
- <accelerator key="5" modifiers="GDK_MOD1_MASK" signal="activate"/>
+ <accelerator key="5" signal="activate" modifiers="GDK_MOD1_MASK"/>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="other1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Other...</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnStates_LoadOther"/>
- <accelerator key="0" modifiers="GDK_MOD1_MASK" signal="activate"/>
+ <accelerator key="0" signal="activate" modifiers="GDK_MOD1_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image21">
+ <widget class="GtkImage" id="image20">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -326,10 +339,10 @@
</widget>
</child>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image22">
+ <widget class="GtkImage" id="image10">
<property name="visible">True</property>
<property name="stock">gtk-revert-to-saved</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -347,16 +360,17 @@
<widget class="GtkMenu" id="configuration1_menu">
<child>
<widget class="GtkImageMenuItem" id="plugins_bios">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Plugins &amp; BIOS</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="ConfigurePlugins"/>
- <accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="P" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="image415">
+ <widget class="GtkImage" id="image11">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -368,46 +382,49 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="cpu1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_CPU</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnConf_Cpu"/>
<child internal-child="image">
- <widget class="GtkImage" id="image421">
+ <widget class="GtkImage" id="image12">
<property name="visible">True</property>
<property name="stock">gtk-properties</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="memory_cards1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Memory Cards</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnConf_Mcds"/>
- <accelerator key="M" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ <accelerator key="M" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="image">
- <widget class="GtkImage" id="image422">
+ <widget class="GtkImage" id="image13">
<property name="visible">True</property>
<property name="stock">gtk-floppy</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="net1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Netplay</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnConf_Net"/>
<child internal-child="image">
- <widget class="GtkImage" id="image2">
+ <widget class="GtkImage" id="image14">
<property name="visible">True</property>
<property name="stock">gtk-properties</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -419,36 +436,39 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="cheat1">
- <property name="visible">True</property>
<property name="label" translatable="yes">Chea_t</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<child>
<widget class="GtkMenu" id="menu1">
<property name="visible">True</property>
<child>
<widget class="GtkImageMenuItem" id="browse1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Browse</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image18">
+ <widget class="GtkImage" id="image16">
<property name="visible">True</property>
<property name="stock">gtk-index</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="search1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_Search</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image19">
+ <widget class="GtkImage" id="image17">
<property name="visible">True</property>
<property name="stock">gtk-find</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -456,10 +476,10 @@
</widget>
</child>
<child internal-child="image">
- <widget class="GtkImage" id="menu-item-image2555">
+ <widget class="GtkImage" id="image15">
<property name="visible">True</property>
<property name="stock">gtk-indent</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -477,15 +497,16 @@
<widget class="GtkMenu" id="help1_menu">
<child>
<widget class="GtkImageMenuItem" id="about_pcsx1">
- <property name="visible">True</property>
<property name="label" translatable="yes">_About PCSX</property>
+ <property name="visible">True</property>
<property name="use_underline">True</property>
+ <property name="use_stock">False</property>
<signal name="activate" handler="OnHelp_About"/>
<child internal-child="image">
- <widget class="GtkImage" id="image423">
+ <widget class="GtkImage" id="image18">
<property name="visible">True</property>
- <property name="stock">gtk-dialog-question</property>
- <property name="icon_size">1</property>
+ <property name="stock">gtk-about</property>
+ <property name="icon-size">1</property>
</widget>
</child>
</widget>
@@ -498,6 +519,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -516,7 +538,7 @@
<property name="visible">True</property>
<property name="title" translatable="yes">Configure PCSX</property>
<property name="modal">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox4">
<property name="visible">True</property>
@@ -613,7 +635,7 @@
<child>
<widget class="GtkFileChooserButton" id="GtkFileChooser_Plugin">
<property name="visible">True</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+ <property name="action">select-folder</property>
<property name="title" translatable="yes">Select Folder to Search</property>
<signal name="current_folder_changed" handler="OnConfConf_PluginPath"/>
</widget>
@@ -645,7 +667,7 @@
<widget class="GtkButton" id="btn_ConfGpu">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_GpuConf"/>
<child>
<widget class="GtkImage" id="image321">
@@ -689,8 +711,8 @@
<widget class="GtkComboBox" id="GtkCombo_Pad1">
<property name="visible">True</property>
<accessibility>
- <atkrelation target="btn_ConfPad1" type="flows-to"/>
- <atkrelation target="btn_AboutSpu" type="flows-from"/>
+ <atkrelation type="flows-to" target="btn_ConfPad1"/>
+ <atkrelation type="flows-from" target="btn_AboutSpu"/>
</accessibility>
</widget>
<packing>
@@ -727,7 +749,7 @@
<widget class="GtkButton" id="btn_AboutSpu">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_SpuConf"/>
<child>
<widget class="GtkImage" id="image318">
@@ -749,7 +771,7 @@
<widget class="GtkButton" id="btn_AboutPad1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_Pad1About"/>
<child>
<widget class="GtkImage" id="image319">
@@ -771,7 +793,7 @@
<widget class="GtkButton" id="btn_AboutPad2">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_Pad2About"/>
<child>
<widget class="GtkImage" id="image320">
@@ -793,7 +815,7 @@
<widget class="GtkButton" id="btn_AboutCdr">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_CdrAbout"/>
<child>
<widget class="GtkImage" id="image311">
@@ -815,7 +837,7 @@
<widget class="GtkButton" id="btn_ConfCdr">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_CdrConf"/>
<child>
<widget class="GtkImage" id="image310">
@@ -837,7 +859,7 @@
<widget class="GtkButton" id="btn_ConfPad2">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_Pad2Conf"/>
<child>
<widget class="GtkImage" id="image317">
@@ -859,7 +881,7 @@
<widget class="GtkButton" id="btn_ConfPad1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_Pad1Conf"/>
<child>
<widget class="GtkImage" id="image316">
@@ -881,7 +903,7 @@
<widget class="GtkButton" id="btn_ConfSpu">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_SpuConf"/>
<child>
<widget class="GtkImage" id="image315">
@@ -976,7 +998,7 @@
<widget class="GtkButton" id="btn_AboutGpu">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnConfConf_GpuAbout"/>
<child>
<widget class="GtkImage" id="image313">
@@ -1010,6 +1032,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1031,6 +1054,7 @@
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1044,7 +1068,7 @@
<child>
<widget class="GtkFileChooserButton" id="GtkFileChooser_Bios">
<property name="visible">True</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+ <property name="action">select-folder</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -1080,22 +1104,29 @@
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area4">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="btn_ConfOk">
+ <property name="label">gtk-close</property>
+ <property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-close</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-5</property>
<signal name="clicked" handler="OnConfConf_Ok"/>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -1105,7 +1136,7 @@
<property name="visible">True</property>
<property name="title" translatable="yes">Configure CPU</property>
<property name="modal">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
@@ -1128,11 +1159,11 @@
<property name="n_columns">2</property>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_Dbg">
+ <property name="label" translatable="yes">Enable Debugger</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable Debugger</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1146,11 +1177,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_SpuIrq">
+ <property name="label" translatable="yes">SPU IRQ Always Enabled</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">SPU IRQ Always Enabled</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1162,11 +1193,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_Mdec">
+ <property name="label" translatable="yes">Black &amp; White Movies</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Black &amp; White Movies</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1178,11 +1209,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_PsxOut">
+ <property name="label" translatable="yes">Enable Console Output</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable Console Output</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1196,11 +1227,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_Cpu">
+ <property name="label" translatable="yes">Enable Interpreter CPU</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable Interpreter CPU</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1214,11 +1245,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_Sio">
+ <property name="label" translatable="yes">SIO IRQ Always Enabled</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">SIO IRQ Always Enabled</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1230,11 +1261,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_CDDA">
+ <property name="label" translatable="yes">Disable CD Audio</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Disable CD Audio</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1246,11 +1277,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_Xa">
+ <property name="label" translatable="yes">Disable XA Decoding</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Disable XA Decoding</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1259,14 +1290,17 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_RCntFix">
+ <property name="label" translatable="yes">Parasite Eve 2, Vandal Hearts 1/2 Fix</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Parasite Eve 2, Vandal Hearts 1/2 Fix</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1277,11 +1311,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_VSyncWA">
+ <property name="label" translatable="yes">InuYasha Sengoku Battle Fix</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">InuYasha Sengoku Battle Fix</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -1303,6 +1337,9 @@
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkFrame" id="frame16">
@@ -1316,17 +1353,18 @@
<property name="spacing">83</property>
<child>
<widget class="GtkCheckButton" id="GtkCheckButton_PsxAuto">
+ <property name="label" translatable="yes">Autodetect</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Autodetect</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<signal name="OnCPU_PSXAutoToggled" handler="on_GtkCheckButton_PsxAuto_toggled"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1366,21 +1404,28 @@ PAL</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="okbutton1">
+ <property name="label">gtk-close</property>
+ <property name="response_id">-7</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-close</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-7</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -1390,7 +1435,7 @@ PAL</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Configure NetPlay</property>
<property name="modal">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<signal name="destroy" handler="OnNet_Cancel"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
@@ -1416,6 +1461,9 @@ PAL</property>
<property name="visible">True</property>
<property name="stock">gtk-network</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkComboBox" id="GtkCombo_Net">
@@ -1429,7 +1477,7 @@ PAL</property>
<widget class="GtkButton" id="btn_ConfNet">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnNet_Conf"/>
<child>
<widget class="GtkImage" id="image335">
@@ -1448,7 +1496,7 @@ PAL</property>
<widget class="GtkButton" id="btn_AboutNet">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnNet_About"/>
<child>
<widget class="GtkImage" id="image336">
@@ -1481,6 +1529,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -1491,22 +1540,29 @@ PAL</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="okbutton2">
+ <property name="label">gtk-close</property>
+ <property name="response_id">-7</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-close</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-7</property>
<signal name="clicked" handler="OnNet_OK"/>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -1518,7 +1574,7 @@ PAL</property>
<property name="modal">True</property>
<property name="default_width">688</property>
<property name="default_height">400</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox3">
<property name="visible">True</property>
@@ -1539,9 +1595,9 @@ PAL</property>
<widget class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
<child>
<widget class="GtkTreeView" id="GtkCList_McdList1">
<property name="visible">True</property>
@@ -1549,6 +1605,9 @@ PAL</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox19">
@@ -1560,7 +1619,7 @@ PAL</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_Format" object="1"/>
<child>
<widget class="GtkAlignment" id="alignment50">
@@ -1579,6 +1638,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1598,13 +1658,18 @@ PAL</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="GtkButton_Reload1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_Reload1"/>
<child>
<widget class="GtkAlignment" id="alignment1">
@@ -1623,6 +1688,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1643,6 +1709,8 @@ PAL</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -1677,6 +1745,7 @@ PAL</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">4</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -1685,6 +1754,9 @@ PAL</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment51">
@@ -1695,13 +1767,13 @@ PAL</property>
<widget class="GtkVButtonBox" id="vbuttonbox2">
<property name="visible">True</property>
<property name="spacing">6</property>
- <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
+ <property name="layout_style">spread</property>
<child>
<widget class="GtkButton" id="GtkButton_CopyTo2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_CopyTo2"/>
<child>
<widget class="GtkAlignment" id="alignment41">
@@ -1720,6 +1792,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1739,13 +1812,18 @@ PAL</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="GtkButton_CopyTo1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_CopyTo1"/>
<child>
<widget class="GtkAlignment" id="alignment42">
@@ -1764,6 +1842,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1784,6 +1863,8 @@ PAL</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -1792,7 +1873,7 @@ PAL</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_Delete2"/>
<child>
<widget class="GtkAlignment" id="alignment44">
@@ -1811,6 +1892,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1831,6 +1913,8 @@ PAL</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
@@ -1839,7 +1923,7 @@ PAL</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_Delete1"/>
<child>
<widget class="GtkAlignment" id="alignment45">
@@ -1858,6 +1942,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1878,6 +1963,8 @@ PAL</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
@@ -1903,9 +1990,9 @@ PAL</property>
<widget class="GtkScrolledWindow" id="scrolledwindow4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
<child>
<widget class="GtkTreeView" id="GtkCList_McdList2">
<property name="visible">True</property>
@@ -1913,6 +2000,9 @@ PAL</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox20">
@@ -1924,7 +2014,7 @@ PAL</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_Format" object="2"/>
<child>
<widget class="GtkAlignment" id="alignment49">
@@ -1943,6 +2033,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -1962,13 +2053,18 @@ PAL</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="GtkButton_Reload2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
<signal name="clicked" handler="OnMcd_Reload2"/>
<child>
<widget class="GtkAlignment" id="alignment48">
@@ -1987,6 +2083,7 @@ PAL</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -2007,6 +2104,8 @@ PAL</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -2041,6 +2140,7 @@ PAL</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">4</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -2061,21 +2161,28 @@ PAL</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area3">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="closebutton1">
+ <property name="label">gtk-close</property>
+ <property name="response_id">-7</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="label">gtk-close</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
- <property name="response_id">-7</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -2084,9 +2191,9 @@ PAL</property>
<widget class="GtkAboutDialog" id="AboutDlg">
<property name="visible">True</property>
<property name="modal">True</property>
- <property name="window_position">GTK_WIN_POS_CENTER</property>
+ <property name="window_position">center</property>
<property name="destroy_with_parent">True</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="type_hint">normal</property>
<property name="program_name">PCSX-Reloaded</property>
<property name="copyright" translatable="yes">(C) 1999-2003 PCSX Team
(C) 2005-2006 Ryan Schultz
@@ -2132,11 +2239,11 @@ Romain Lafourcade</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox6">
<child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area6">
- </widget>
+ <widget class="GtkHButtonBox" id="dialog-action_area6"/>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -2147,8 +2254,8 @@ Romain Lafourcade</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Edit Cheat Codes</property>
<property name="modal">True</property>
- <property name="window_position">GTK_WIN_POS_CENTER</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="window_position">center</property>
+ <property name="type_hint">dialog</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox7">
<property name="visible">True</property>
@@ -2165,10 +2272,10 @@ Romain Lafourcade</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">5</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<property name="window_placement_set">True</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <property name="shadow_type">etched-in</property>
<child>
<widget class="GtkTreeView" id="GtkCList_Cheat">
<property name="width_request">300</property>
@@ -2190,6 +2297,9 @@ Romain Lafourcade</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkHBox" id="hbox1">
@@ -2197,22 +2307,23 @@ Romain Lafourcade</property>
<property name="spacing">10</property>
<child>
<widget class="GtkButton" id="addbutton1">
+ <property name="label" translatable="yes">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-add</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="editbutton1">
+ <property name="label" translatable="yes">gtk-edit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-edit</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
<packing>
<property name="position">1</property>
@@ -2220,12 +2331,11 @@ Romain Lafourcade</property>
</child>
<child>
<widget class="GtkButton" id="delbutton1">
+ <property name="label" translatable="yes">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-delete</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
<packing>
<property name="position">2</property>
@@ -2236,7 +2346,6 @@ Romain Lafourcade</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="response_id">0</property>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
@@ -2244,8 +2353,11 @@ Romain Lafourcade</property>
<widget class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-apply</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkLabel" id="label2">
@@ -2268,7 +2380,6 @@ Romain Lafourcade</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="response_id">0</property>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
@@ -2276,8 +2387,11 @@ Romain Lafourcade</property>
<widget class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="stock">gtk-cancel</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
@@ -2297,12 +2411,11 @@ Romain Lafourcade</property>
</child>
<child>
<widget class="GtkButton" id="loadbutton1">
+ <property name="label" translatable="yes">gtk-open</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-open</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
<packing>
<property name="position">5</property>
@@ -2310,12 +2423,11 @@ Romain Lafourcade</property>
</child>
<child>
<widget class="GtkButton" id="savebutton1">
+ <property name="label" translatable="yes">gtk-save-as</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-save-as</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
<packing>
<property name="position">6</property>
@@ -2336,21 +2448,26 @@ Romain Lafourcade</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area7">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="closbutton1">
+ <property name="label" translatable="yes">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-close</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -2361,8 +2478,8 @@ Romain Lafourcade</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Cheat Search</property>
<property name="modal">True</property>
- <property name="window_position">GTK_WIN_POS_CENTER</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="window_position">center</property>
+ <property name="type_hint">dialog</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox8">
<property name="visible">True</property>
@@ -2389,17 +2506,11 @@ Romain Lafourcade</property>
<property name="column_spacing">10</property>
<property name="row_spacing">10</property>
<child>
- <placeholder/>
- </child>
- <child>
<widget class="GtkComboBox" id="combo_datatype">
<property name="visible">True</property>
- <property name="items" translatable="yes">Unsigned 8-bit
-Unsigned 16-bit
-Unsigned 32-bit
-Signed 8-bit
-Signed 16-bit
-Signed 32-bit</property>
+ <property name="items" translatable="yes">8-bit
+16-bit
+32-bit</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -2462,7 +2573,13 @@ Signed 32-bit</property>
<property name="visible">True</property>
<property name="items" translatable="yes">Equal Value
Not Equal Value
-Range</property>
+Range
+Increased By
+Decreased By
+Increased
+Decreased
+Different
+No Change</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -2498,21 +2615,7 @@ Hexadecimal</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="check_bigendian">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Big-Endian</property>
- <property name="response_id">0</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label10">
+ <widget class="GtkLabel" id="label_valueto">
<property name="visible">True</property>
<property name="label" translatable="yes">To:</property>
</widget>
@@ -2535,10 +2638,17 @@ Hexadecimal</property>
<property name="bottom_attach">3</property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -2548,45 +2658,50 @@ Hexadecimal</property>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">etched-in</property>
<child>
- <widget class="GtkTreeView" id="treeview1">
+ <widget class="GtkTreeView" id="GtkCList_Result">
<property name="width_request">450</property>
<property name="height_request">250</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_expanders">False</property>
- <property name="enable_grid_lines">GTK_TREE_VIEW_GRID_LINES_VERTICAL</property>
+ <property name="enable_grid_lines">vertical</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox1">
<property name="visible">True</property>
<property name="spacing">20</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="layout_style">start</property>
<child>
- <widget class="GtkButton" id="button1">
+ <widget class="GtkButton" id="btn_freeze">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="response_id">0</property>
<child>
<widget class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image7">
<property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- <property name="icon_size">1</property>
+ <property name="stock">gtk-ok</property>
+ <property name="icon-size">1</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkLabel" id="label13">
<property name="visible">True</property>
- <property name="label" translatable="yes">label</property>
+ <property name="label" translatable="yes">Freeze</property>
</widget>
<packing>
<property name="position">1</property>
@@ -2595,27 +2710,34 @@ Hexadecimal</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkButton" id="button4">
+ <widget class="GtkButton" id="btn_modify">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="response_id">0</property>
<child>
<widget class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image8">
<property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- <property name="icon_size">1</property>
+ <property name="stock">gtk-edit</property>
+ <property name="icon-size">1</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkLabel" id="label14">
<property name="visible">True</property>
- <property name="label" translatable="yes">label</property>
+ <property name="label" translatable="yes">Modify</property>
</widget>
<packing>
<property name="position">1</property>
@@ -2625,29 +2747,33 @@ Hexadecimal</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="button5">
+ <widget class="GtkButton" id="btn_copy">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="response_id">0</property>
<child>
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image9">
<property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- <property name="icon_size">1</property>
+ <property name="stock">gtk-paste</property>
+ <property name="icon-size">1</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
- <property name="label" translatable="yes">label</property>
+ <property name="label" translatable="yes">Copy</property>
</widget>
<packing>
<property name="position">1</property>
@@ -2657,11 +2783,15 @@ Hexadecimal</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="padding">10</property>
<property name="position">1</property>
</packing>
@@ -2689,13 +2819,12 @@ Hexadecimal</property>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="spacing">20</property>
- <property name="layout_style">GTK_BUTTONBOX_CENTER</property>
+ <property name="layout_style">center</property>
<child>
<widget class="GtkButton" id="btn_start">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="response_id">0</property>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
@@ -2703,8 +2832,11 @@ Hexadecimal</property>
<widget class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-ok</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkLabel" id="label11">
@@ -2718,13 +2850,17 @@ Hexadecimal</property>
</widget>
</child>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkButton" id="btn_restart">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="response_id">0</property>
<child>
<widget class="GtkHBox" id="hbox6">
<property name="visible">True</property>
@@ -2732,8 +2868,11 @@ Hexadecimal</property>
<widget class="GtkImage" id="image6">
<property name="visible">True</property>
<property name="stock">gtk-undo</property>
- <property name="icon_size">1</property>
+ <property name="icon-size">1</property>
</widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkLabel" id="label12">
@@ -2748,6 +2887,8 @@ Hexadecimal</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@@ -2780,21 +2921,26 @@ Hexadecimal</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area8">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="closebutton">
+ <property name="label" translatable="yes">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-close</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
diff --git a/gui/Cheat.c b/gui/Cheat.c
index db3d4a26..f324ee7d 100644
--- a/gui/Cheat.c
+++ b/gui/Cheat.c
@@ -1,6 +1,6 @@
/* Cheat Support for PCSX-Reloaded
*
- * Copyright (C) 2009, Wei Mingzhi <whistler@openoffice.org>.
+ * Copyright (C) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,6 +29,7 @@
#include "Linux.h"
#include "../libpcsxcore/cheat.h"
+#include "../libpcsxcore/psxmem.h"
GtkWidget *CheatListDlg = NULL;
GtkWidget *CheatSearchDlg = NULL;
@@ -427,7 +428,7 @@ static void OnCheatListDlg_SaveClicked(GtkWidget *widget, gpointer user_data) {
g_free(filename);
}
-static void OnCheatListDlg_Clicked() {
+static void OnCheatListDlg_CloseClicked() {
gtk_widget_destroy(CheatListDlg);
CheatListDlg = NULL;
}
@@ -501,7 +502,7 @@ void RunCheatListDialog() {
// Setup a handler for when Close or Cancel is clicked
g_signal_connect_data(GTK_OBJECT(CheatListDlg), "response",
- GTK_SIGNAL_FUNC(OnCheatListDlg_Clicked), xml, (GClosureNotify)g_object_unref, G_CONNECT_AFTER);
+ GTK_SIGNAL_FUNC(OnCheatListDlg_CloseClicked), xml, (GClosureNotify)g_object_unref, G_CONNECT_AFTER);
gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "savebutton1")), NumCheats);
gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "editbutton1")), FALSE);
@@ -513,18 +514,663 @@ void RunCheatListDialog() {
///////////////////////////////////////////////////////////////////////////////
-struct cheatSearchResult {
+#define SEARCH_EQUALVAL 0
+#define SEARCH_NOTEQUALVAL 1
+#define SEARCH_RANGE 2
+#define SEARCH_INCBY 3
+#define SEARCH_DECBY 4
+#define SEARCH_INC 5
+#define SEARCH_DEC 6
+#define SEARCH_DIFFERENT 7
+#define SEARCH_NOCHANGE 8
+
+#define SEARCHTYPE_8BIT 0
+#define SEARCHTYPE_16BIT 1
+#define SEARCHTYPE_32BIT 2
+
+#define SEARCHBASE_DEC 0
+#define SEARCHBASE_HEX 1
+
+static char current_search = SEARCH_EQUALVAL;
+static char current_searchtype = SEARCHTYPE_8BIT;
+static char current_searchbase = SEARCHBASE_DEC;
+static uint32_t current_valuefrom = 0;
+static uint32_t current_valueto = 0;
+
+// update the cheat search dialog
+static void UpdateCheatSearchDialog() {
+ GladeXML *xml;
+ char buf[256];
+ int i;
u32 addr;
+ GtkListStore *store = gtk_list_store_new(1, G_TYPE_STRING);
+ GtkTreeIter iter;
+ GtkWidget *widget;
+
+ xml = glade_get_widget_tree(CheatSearchDlg);
+ widget = glade_xml_get_widget(xml, "GtkCList_Result");
+
+ gtk_combo_box_set_active(GTK_COMBO_BOX(glade_xml_get_widget(xml, "combo_searchfor")), current_search);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(glade_xml_get_widget(xml, "combo_datatype")), current_searchtype);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(glade_xml_get_widget(xml, "combo_database")), current_searchbase);
+
+ if (current_searchbase == SEARCHBASE_DEC) {
+ sprintf(buf, "%u", current_valuefrom);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value")), buf);
+ sprintf(buf, "%u", current_valueto);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto")), buf);
+ }
+ else {
+ sprintf(buf, "%X", current_valuefrom);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value")), buf);
+ sprintf(buf, "%X", current_valueto);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto")), buf);
+ }
+
+ if (current_search == SEARCH_RANGE) {
+ gtk_widget_show(GTK_WIDGET(glade_xml_get_widget(xml, "label_valueto")));
+ gtk_widget_show(GTK_WIDGET(glade_xml_get_widget(xml, "entry_valueto")));
+ }
+ else {
+ gtk_widget_hide(GTK_WIDGET(glade_xml_get_widget(xml, "label_valueto")));
+ gtk_widget_hide(GTK_WIDGET(glade_xml_get_widget(xml, "entry_valueto")));
+ }
+
+ if (current_search >= SEARCH_INC) {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "entry_value")), FALSE);
+ }
+ else {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "entry_value")), TRUE);
+ }
+
+ if (current_search >= SEARCH_INCBY && prevM == NULL) {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_start")), FALSE);
+ }
+ else {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_start")), TRUE);
+ }
+
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_freeze")), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_modify")), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_copy")), FALSE);
+
+ if (prevM != NULL) {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "combo_datatype")), FALSE);
+
+ if (NumSearchResults > 100) {
+ // too many results to be shown
+ gtk_list_store_append(store, &iter);
+ gtk_list_store_set(store, &iter, 0, _("Too many addresses found."), -1);
+ gtk_widget_set_sensitive(widget, FALSE);
+ }
+ else {
+ for (i = 0; i < NumSearchResults; i++) {
+ addr = SearchResults[i];
+
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ sprintf(buf, _("%.8X Current: %u (%.2X), Previous: %u (%.2X)"),
+ addr, PSXMu8(addr), PSXMu8(addr), PrevMu8(addr), PrevMu8(addr));
+ break;
+
+ case SEARCHTYPE_16BIT:
+ sprintf(buf, _("%.8X Current: %u (%.4X), Previous: %u (%.4X)"),
+ addr, PSXMu16(addr), PSXMu16(addr), PrevMu16(addr), PrevMu16(addr));
+ break;
+
+ case SEARCHTYPE_32BIT:
+ sprintf(buf, _("%.8X Current: %u (%.8X), Previous: %u (%.8X)"),
+ addr, PSXMu32(addr), PSXMu32(addr), PrevMu32(addr), PrevMu32(addr));
+ break;
+
+ default:
+ assert(FALSE); // impossible
+ break;
+ }
+
+ gtk_list_store_append(store, &iter);
+ gtk_list_store_set(store, &iter, 0, buf, -1);
+ }
+ gtk_widget_set_sensitive(widget, TRUE);
+ }
+
+ sprintf(buf, _("Founded Addresses: %d"), NumSearchResults);
+ gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(xml, "label_resultsfound")), buf);
+ }
+ else {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "combo_datatype")), TRUE);
+ gtk_widget_set_sensitive(widget, FALSE);
+
+ gtk_label_set_text(GTK_LABEL(glade_xml_get_widget(xml, "label_resultsfound")),
+ _("Enter the values and start your search."));
+ }
+
+ gtk_tree_view_set_model(GTK_TREE_VIEW(widget), GTK_TREE_MODEL(store));
+ g_object_unref(G_OBJECT(store));
+ gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(widget), TRUE);
+ gtk_widget_show(widget);
+}
+
+// get the current selected result index in the list
+static int GetSelectedResultIndex() {
+ GladeXML *xml;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ GtkTreePath *path;
+ gboolean selected;
+ int i;
+
+ xml = glade_get_widget_tree(CheatSearchDlg);
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(glade_xml_get_widget(xml, "GtkCList_Result")));
+ selected = gtk_tree_selection_get_selected(selection, &model, &iter);
+
+ if (!selected) {
+ return -1;
+ }
+
+ path = gtk_tree_model_get_path(model, &iter);
+ i = *gtk_tree_path_get_indices(path);
+
+ assert(i < NumSearchResults);
+ return i;
+}
+
+// add cheat code to freeze the value
+static void OnCheatSearchDlg_FreezeClicked(GtkWidget *widget, gpointer user_data) {
+ GtkWidget *dlg;
+ GtkWidget *box, *hbox, *label, *descr_edit, *value_edit;
+ char buf[256];
+ u32 addr, val = 0;
+
+ addr = SearchResults[GetSelectedResultIndex()];
+
+ dlg = gtk_dialog_new_with_buttons(_("Freeze value"), GTK_WINDOW(CheatListDlg),
+ GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
+
+ box = GTK_WIDGET(GTK_DIALOG(dlg)->vbox);
+
+ label = gtk_label_new(_("Description:"));
+ gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
+ gtk_widget_show(label);
+
+ descr_edit = gtk_entry_new();
+ gtk_box_pack_start(GTK_BOX(box), descr_edit, FALSE, FALSE, 10);
+ gtk_widget_show(descr_edit);
+
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 15);
+
+ label = gtk_label_new(_("Value:"));
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
+ gtk_widget_show(label);
+
+ value_edit = gtk_entry_new();
+ gtk_box_pack_start(GTK_BOX(hbox), value_edit, FALSE, FALSE, 10);
+ gtk_widget_show(value_edit);
+
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ val = PSXMu8(addr);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ val = PSXMu16(addr);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ val = PSXMu32(addr);
+ break;
+
+ default:
+ assert(FALSE); // should not reach here
+ break;
+ }
+
+ sprintf(buf, "%u", val);
+ gtk_entry_set_text(GTK_ENTRY(value_edit), buf);
+
+ sprintf(buf, "%.8X", addr);
+ gtk_entry_set_text(GTK_ENTRY(descr_edit), buf);
+
+ gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER);
+ gtk_widget_show_all(dlg);
+
+ if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT) {
+ val = 0;
+ sscanf(gtk_entry_get_text(GTK_ENTRY(value_edit)), "%u", &val);
+
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ if (val > (u32)0xFF) {
+ val = 0xFF;
+ }
+ sprintf(buf, "%.8X %.4X", (addr & 0x1FFFFF) | (CHEAT_CONST8 << 24), val);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ if (val > (u32)0xFFFF) {
+ val = 0xFFFF;
+ }
+ sprintf(buf, "%.8X %.4X", (addr & 0x1FFFFF) | (CHEAT_CONST16 << 24), val);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ sprintf(buf, "%.8X %.4X\n%.8X %.4X",
+ (addr & 0x1FFFFF) | (CHEAT_CONST16 << 24), val & 0xFFFF,
+ ((addr + 2) & 0x1FFFFF) | (CHEAT_CONST16 << 24), ((val & 0xFFFF0000) >> 16) & 0xFFFF);
+ break;
+
+ default:
+ assert(FALSE); // should not reach here
+ break;
+ }
+
+ if (AddCheat(gtk_entry_get_text(GTK_ENTRY(descr_edit)), buf) == 0) {
+ Cheats[NumCheats - 1].Enabled = 1;
+ }
+ }
+
+ gtk_widget_destroy(dlg);
+}
+
+// modify the value on the fly
+static void OnCheatSearchDlg_ModifyClicked(GtkWidget *widget, gpointer user_data) {
+ GtkWidget *dlg;
+ GtkWidget *box, *hbox, *label, *value_edit;
+ char buf[256];
+ u32 addr, val = 0;
+
+ addr = SearchResults[GetSelectedResultIndex()];
+
+ dlg = gtk_dialog_new_with_buttons(_("Modify value"), GTK_WINDOW(CheatListDlg),
+ GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
+
+ box = GTK_WIDGET(GTK_DIALOG(dlg)->vbox);
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
+
+ label = gtk_label_new(_("New value:"));
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
+ gtk_widget_show(label);
+
+ value_edit = gtk_entry_new();
+ gtk_box_pack_start(GTK_BOX(hbox), value_edit, FALSE, FALSE, 10);
+ gtk_widget_show(value_edit);
+
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ val = PSXMu8(addr);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ val = PSXMu16(addr);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ val = PSXMu32(addr);
+ break;
+
+ default:
+ assert(FALSE); // should not reach here
+ break;
+ }
+
+ sprintf(buf, "%u", val);
+ gtk_entry_set_text(GTK_ENTRY(value_edit), buf);
+
+ gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER);
+ gtk_widget_show_all(dlg);
+
+ if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT) {
+ val = 0;
+ sscanf(gtk_entry_get_text(GTK_ENTRY(value_edit)), "%u", &val);
+
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ psxMemWrite8(addr, (u8)val);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ psxMemWrite16(addr, (u16)val);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ psxMemWrite32(addr, (u32)val);
+ break;
+
+ default:
+ assert(FALSE); // should not reach here
+ break;
+ }
+
+ UpdateCheatSearchDialog();
+ }
+
+ gtk_widget_destroy(dlg);
+}
+
+// copy the selected address to clipboard
+static void OnCheatSearchDlg_CopyClicked(GtkWidget *widget, gpointer user_data) {
+ int i;
+ char buf[9];
+
+ i = GetSelectedResultIndex();
+ assert(i != -1);
+
+ sprintf(buf, "%8X", SearchResults[i]);
+ buf[8] = '\0';
+
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), buf, 8);
+}
+
+// preform the search
+static void OnCheatSearchDlg_SearchClicked(GtkWidget *widget, gpointer user_data) {
+ GladeXML *xml;
+
+ xml = glade_get_widget_tree(CheatSearchDlg);
+
+ current_search = gtk_combo_box_get_active(GTK_COMBO_BOX(glade_xml_get_widget(xml, "combo_searchfor")));
+ current_searchtype = gtk_combo_box_get_active(GTK_COMBO_BOX(glade_xml_get_widget(xml, "combo_datatype")));
+ current_searchbase = gtk_combo_box_get_active(GTK_COMBO_BOX(glade_xml_get_widget(xml, "combo_database")));
+ current_valuefrom = 0;
+ current_valueto = 0;
+
+ if (current_searchbase == SEARCHBASE_DEC) {
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value"))), "%u", &current_valuefrom);
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto"))), "%u", &current_valueto);
+ }
+ else {
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value"))), "%x", &current_valuefrom);
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto"))), "%x", &current_valueto);
+ }
+
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ if (current_valuefrom > (u32)0xFF) {
+ current_valuefrom = 0xFF;
+ }
+ if (current_valueto > (u32)0xFF) {
+ current_valueto = 0xFF;
+ }
+ break;
+
+ case SEARCHTYPE_16BIT:
+ if (current_valuefrom > (u32)0xFFFF) {
+ current_valuefrom = 0xFFFF;
+ }
+ if (current_valueto > (u32)0xFFFF) {
+ current_valueto = 0xFFFF;
+ }
+ break;
+ }
+
+ if (current_search == SEARCH_RANGE && current_valuefrom > current_valueto) {
+ u32 t = current_valuefrom;
+ current_valuefrom = current_valueto;
+ current_valueto = t;
+ }
+
+ switch (current_search) {
+ case SEARCH_EQUALVAL:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchEqual8((u8)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchEqual16((u16)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchEqual32((u32)current_valuefrom);
+ break;
+ }
+ break;
+
+ case SEARCH_NOTEQUALVAL:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchNotEqual8((u8)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchNotEqual16((u16)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchNotEqual32((u32)current_valuefrom);
+ break;
+ }
+ break;
+
+ case SEARCH_RANGE:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchRange8((u8)current_valuefrom, (u8)current_valueto);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchRange16((u16)current_valuefrom, (u16)current_valueto);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchRange32((u32)current_valuefrom, (u32)current_valueto);
+ break;
+ }
+ break;
+
+ case SEARCH_INCBY:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchIncreasedBy8((u8)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchIncreasedBy16((u16)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchIncreasedBy32((u32)current_valuefrom);
+ break;
+ }
+ break;
+
+ case SEARCH_DECBY:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchDecreasedBy8((u8)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchDecreasedBy16((u16)current_valuefrom);
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchDecreasedBy32((u32)current_valuefrom);
+ break;
+ }
+ break;
+
+ case SEARCH_INC:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchIncreased8();
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchIncreased16();
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchIncreased32();
+ break;
+ }
+ break;
+
+ case SEARCH_DEC:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchDecreased8();
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchDecreased16();
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchDecreased32();
+ break;
+ }
+ break;
+
+ case SEARCH_DIFFERENT:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchDifferent8();
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchDifferent16();
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchDifferent32();
+ break;
+ }
+ break;
+
+ case SEARCH_NOCHANGE:
+ switch (current_searchtype) {
+ case SEARCHTYPE_8BIT:
+ CheatSearchNoChange8();
+ break;
+
+ case SEARCHTYPE_16BIT:
+ CheatSearchNoChange16();
+ break;
+
+ case SEARCHTYPE_32BIT:
+ CheatSearchNoChange32();
+ break;
+ }
+ break;
+
+ default:
+ assert(FALSE); // not possible
+ break;
+ }
+
+ UpdateCheatSearchDialog();
+}
+
+// restart the search
+static void OnCheatSearchDlg_RestartClicked(GtkWidget *widget, gpointer user_data) {
+ FreeCheatSearchResults();
+ FreeCheatSearchMem();
+
+ current_search = SEARCH_EQUALVAL;
+ current_searchtype = SEARCHTYPE_8BIT;
+ current_searchbase = SEARCHBASE_DEC;
+ current_valuefrom = 0;
+ current_valueto = 0;
+
+ UpdateCheatSearchDialog();
+}
+
+// close the cheat search window
+static void OnCheatSearchDlg_CloseClicked(GtkWidget *widget, gpointer user_data) {
+ gtk_widget_destroy(CheatSearchDlg);
+ CheatSearchDlg = NULL;
+}
+
+static void OnCheatSearchDlg_SearchForChanged(GtkWidget *widget, gpointer user_data) {
+ GladeXML *xml;
+
+ xml = glade_get_widget_tree(CheatSearchDlg);
+
+ if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) == SEARCH_RANGE) {
+ gtk_widget_show(GTK_WIDGET(glade_xml_get_widget(xml, "label_valueto")));
+ gtk_widget_show(GTK_WIDGET(glade_xml_get_widget(xml, "entry_valueto")));
+ }
+ else {
+ gtk_widget_hide(GTK_WIDGET(glade_xml_get_widget(xml, "label_valueto")));
+ gtk_widget_hide(GTK_WIDGET(glade_xml_get_widget(xml, "entry_valueto")));
+ }
+
+ if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) >= SEARCH_INC) {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "entry_value")), FALSE);
+ }
+ else {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "entry_value")), TRUE);
+ }
+
+ if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) >= SEARCH_INCBY && prevM == NULL) {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_start")), FALSE);
+ }
+ else {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_start")), TRUE);
+ }
+}
+
+static void OnCheatSearchDlg_DataBaseChanged(GtkWidget *widget, gpointer user_data) {
u32 val;
-};
+ char buf[256];
+ GladeXML *xml;
-struct cheatSearchResult *SearchResult = NULL;
-int NumSearchResult = 0;
+ xml = glade_get_widget_tree(CheatSearchDlg);
+
+ if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) == SEARCHBASE_DEC) {
+ val = 0;
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value"))), "%x", &val);
+ sprintf(buf, "%u", val);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value")), buf);
+
+ val = 0;
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto"))), "%x", &val);
+ sprintf(buf, "%u", val);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto")), buf);
+ }
+ else {
+ val = 0;
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value"))), "%u", &val);
+ sprintf(buf, "%X", val);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_value")), buf);
+
+ val = 0;
+ sscanf(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto"))), "%u", &val);
+ sprintf(buf, "%X", val);
+ gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry_valueto")), buf);
+ }
+}
+
+static void CheatSearch_TreeSelectionChanged(GtkTreeSelection *selection, gpointer user_data) {
+ GladeXML *xml;
+
+ xml = glade_get_widget_tree(CheatSearchDlg);
+
+ if (GetSelectedResultIndex() != -1) {
+ // If a row was selected, we can now enable some of the disabled widgets
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_freeze")), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_modify")), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_copy")), TRUE);
+ } else {
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_freeze")), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_modify")), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(glade_xml_get_widget(xml, "btn_copy")), FALSE);
+ }
+}
// run the cheat search dialog
void RunCheatSearchDialog() {
GladeXML *xml;
GtkWidget *widget;
+ GtkCellRenderer *renderer;
+ GtkTreeSelection *treesel;
+ GtkTreeViewColumn *column;
xml = glade_xml_new(PACKAGE_DATA_DIR "pcsx.glade2", "CheatSearchDlg", NULL);
if (!xml) {
@@ -534,4 +1180,50 @@ void RunCheatSearchDialog() {
CheatSearchDlg = glade_xml_get_widget(xml, "CheatSearchDlg");
gtk_window_set_title(GTK_WINDOW(CheatSearchDlg), _("Cheat Search"));
+
+ widget = glade_xml_get_widget(xml, "GtkCList_Result");
+
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes(_("Search Results"),
+ renderer, "text", 0, NULL);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(widget), column);
+
+ treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
+ gtk_tree_selection_set_mode (treesel, GTK_SELECTION_SINGLE);
+ g_signal_connect_data(G_OBJECT(treesel), "changed",
+ G_CALLBACK(CheatSearch_TreeSelectionChanged),
+ NULL, NULL, G_CONNECT_AFTER);
+
+ UpdateCheatSearchDialog();
+
+ widget = glade_xml_get_widget(xml, "btn_freeze");
+ g_signal_connect_data(GTK_OBJECT(widget), "clicked",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_FreezeClicked), xml, NULL, G_CONNECT_AFTER);
+
+ widget = glade_xml_get_widget(xml, "btn_modify");
+ g_signal_connect_data(GTK_OBJECT(widget), "clicked",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_ModifyClicked), xml, NULL, G_CONNECT_AFTER);
+
+ widget = glade_xml_get_widget(xml, "btn_copy");
+ g_signal_connect_data(GTK_OBJECT(widget), "clicked",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_CopyClicked), xml, NULL, G_CONNECT_AFTER);
+
+ widget = glade_xml_get_widget(xml, "btn_start");
+ g_signal_connect_data(GTK_OBJECT(widget), "clicked",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_SearchClicked), xml, NULL, G_CONNECT_AFTER);
+
+ widget = glade_xml_get_widget(xml, "btn_restart");
+ g_signal_connect_data(GTK_OBJECT(widget), "clicked",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_RestartClicked), xml, NULL, G_CONNECT_AFTER);
+
+ widget = glade_xml_get_widget(xml, "combo_searchfor");
+ g_signal_connect_data(GTK_OBJECT(widget), "changed",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_SearchForChanged), xml, NULL, G_CONNECT_AFTER);
+
+ widget = glade_xml_get_widget(xml, "combo_database");
+ g_signal_connect_data(GTK_OBJECT(widget), "changed",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_DataBaseChanged), xml, NULL, G_CONNECT_AFTER);
+
+ g_signal_connect_data(GTK_OBJECT(CheatSearchDlg), "response",
+ GTK_SIGNAL_FUNC(OnCheatSearchDlg_CloseClicked), xml, (GClosureNotify)g_object_unref, G_CONNECT_AFTER);
}
diff --git a/gui/Gtk2Gui.c b/gui/Gtk2Gui.c
index f39c49c1..08336e37 100644
--- a/gui/Gtk2Gui.c
+++ b/gui/Gtk2Gui.c
@@ -706,6 +706,7 @@ void OnEmu_Run() {
}
if (Config.Dbg) hdb_start();
+ CheatSearchBackupMemory();
psxCpu->Execute();
}
@@ -758,6 +759,7 @@ void OnEmu_SwitchImage() {
cdOpenCase = time(NULL) + 2;
if (Config.Dbg) hdb_start();
+ CheatSearchBackupMemory();
psxCpu->Execute();
}
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c
index 8de93763..07751ce5 100644
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -33,7 +33,6 @@ FILE *cdHandle = NULL;
static unsigned char cdbuffer[CD_FRAMESIZE_RAW * 10];
char* CALLBACK CDR__getDriveLetter(void);
-unsigned char* CALLBACK CDR__getBufferSub(void);
long CALLBACK CDR__configure(void);
long CALLBACK CDR__test(void);
void CALLBACK CDR__about(void);
@@ -279,6 +278,11 @@ static long CALLBACK ISOstop(void) {
return 0; // TODO
}
+// gets subchannel data
+unsigned char* CALLBACK ISOgetBufferSub(void) {
+ return NULL; // TODO
+}
+
void imageReaderInit(void) {
assert(hCDRDriver == NULL);
@@ -292,10 +296,10 @@ void imageReaderInit(void) {
CDR_getBuffer = ISOgetBuffer;
CDR_play = ISOplay;
CDR_stop = ISOstop;
+ CDR_getBufferSub = ISOgetBufferSub;
CDR_getStatus = CDR__getStatus;
CDR_getDriveLetter = CDR__getDriveLetter;
- CDR_getBufferSub = CDR__getBufferSub;
CDR_configure = CDR__configure;
CDR_test = CDR__test;
CDR_about = CDR__about;
diff --git a/libpcsxcore/cheat.c b/libpcsxcore/cheat.c
index 284d833b..763c8d01 100644
--- a/libpcsxcore/cheat.c
+++ b/libpcsxcore/cheat.c
@@ -1,6 +1,6 @@
/* Cheat Support for PCSX-Reloaded
*
- * Copyright (c) 2009, Wei Mingzhi <whistler@openoffice.org>.
+ * Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,26 +31,12 @@ CheatCode *CheatCodes = NULL;
int NumCodes = 0;
static int NumCodesAllocated = 0;
-#define ALLOC_INCREMENT 100
+s8 *prevM = NULL;
+u32 *SearchResults = NULL;
+int NumSearchResults = 0;
+static int NumSearchResultsAllocated = 0;
-// cheat types
-#define CHEAT_CONST8 0x30 /* 8-bit Constant Write */
-#define CHEAT_CONST16 0x80 /* 16-bit Constant Write */
-#define CHEAT_INC16 0x10 /* 16-bit Increment */
-#define CHEAT_DEC16 0x11 /* 16-bit Decrement */
-#define CHEAT_INC8 0x20 /* 8-bit Increment */
-#define CHEAT_DEC8 0x21 /* 8-bit Decrement */
-#define CHEAT_SLIDE 0x50 /* Slide Codes */
-#define CHEAT_MEMCPY 0xC2 /* Memory Copy */
-
-#define CHEAT_EQU8 0xE0 /* 8-bit Equal To */
-#define CHEAT_NOTEQU8 0xE1 /* 8-bit Not Equal To */
-#define CHEAT_LESSTHAN8 0xE2 /* 8-bit Less Than */
-#define CHEAT_GREATERTHAN8 0xE3 /* 8-bit Greater Than */
-#define CHEAT_EQU16 0xD0 /* 16-bit Equal To */
-#define CHEAT_NOTEQU16 0xD1 /* 16-bit Not Equal To */
-#define CHEAT_LESSTHAN16 0xD2 /* 16-bit Less Than */
-#define CHEAT_GREATERTHAN16 0xD3 /* 16-bit Greater Than */
+#define ALLOC_INCREMENT 100
void ClearAllCheats() {
int i;
@@ -457,3 +443,579 @@ int EditCheat(int index, const char *descr, char *code) {
return 0;
}
+
+void FreeCheatSearchResults() {
+ if (SearchResults != NULL) {
+ free(SearchResults);
+ }
+ SearchResults = NULL;
+
+ NumSearchResults = 0;
+ NumSearchResultsAllocated = 0;
+}
+
+void FreeCheatSearchMem() {
+ if (prevM != NULL) {
+ free(prevM);
+ }
+ prevM = NULL;
+}
+
+void CheatSearchBackupMemory() {
+ if (prevM != NULL) {
+ memcpy(prevM, psxM, 0x200000);
+ }
+}
+
+static void CheatSearchInitBackupMemory() {
+ if (prevM == NULL) {
+ prevM = (s8 *)malloc(0x200000);
+ CheatSearchBackupMemory();
+ }
+}
+
+static void CheatSearchAddResult(u32 addr) {
+ if (NumSearchResults >= NumSearchResultsAllocated) {
+ NumSearchResultsAllocated += ALLOC_INCREMENT;
+
+ if (SearchResults == NULL) {
+ SearchResults = (u32 *)malloc(sizeof(u32) * NumSearchResultsAllocated);
+ }
+ else {
+ SearchResults = (u32 *)realloc(SearchResults, sizeof(u32) * NumSearchResultsAllocated);
+ }
+ }
+
+ SearchResults[NumSearchResults++] = addr;
+}
+
+void CheatSearchEqual8(u8 val) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i++) {
+ if (PSXMu8(i) == val) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu8(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchEqual16(u16 val) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i += 2) {
+ if (PSXMu16(i) == val) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu16(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchEqual32(u32 val) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i += 4) {
+ if (PSXMu32(i) == val) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu32(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchNotEqual8(u8 val) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i++) {
+ if (PSXMu8(i) != val) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu8(SearchResults[i]) != val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchNotEqual16(u16 val) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i += 2) {
+ if (PSXMu16(i) != val) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu16(SearchResults[i]) != val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchNotEqual32(u32 val) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i += 4) {
+ if (PSXMu32(i) != val) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu32(SearchResults[i]) != val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchRange8(u8 min, u8 max) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i++) {
+ if (PSXMu8(i) >= min && PSXMu8(i) <= max) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu8(SearchResults[i]) >= min && PSXMu8(SearchResults[i]) <= max) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchRange16(u16 min, u16 max) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i += 2) {
+ if (PSXMu16(i) >= min && PSXMu16(i) <= max) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu16(SearchResults[i]) >= min && PSXMu16(SearchResults[i]) <= max) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchRange32(u32 min, u32 max) {
+ u32 i, j;
+
+ CheatSearchInitBackupMemory();
+
+ if (SearchResults == NULL) {
+ // search the whole memory
+ for (i = 0; i < 0x200000; i += 4) {
+ if (PSXMu32(i) >= min && PSXMu32(i) <= max) {
+ CheatSearchAddResult(i);
+ }
+ }
+ }
+ else {
+ // only search within the previous results
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu32(SearchResults[i]) >= min && PSXMu32(SearchResults[i]) <= max) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+ }
+}
+
+void CheatSearchIncreasedBy8(u8 val) {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu8(SearchResults[i]) - PrevMu8(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchIncreasedBy16(u16 val) {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu16(SearchResults[i]) - PrevMu16(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchIncreasedBy32(u32 val) {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PSXMu32(SearchResults[i]) - PrevMu32(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDecreasedBy8(u8 val) {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu8(SearchResults[i]) - PSXMu8(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDecreasedBy16(u16 val) {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu16(SearchResults[i]) - PSXMu16(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDecreasedBy32(u32 val) {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu32(SearchResults[i]) - PSXMu32(SearchResults[i]) == val) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchIncreased8() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu8(SearchResults[i]) < PSXMu8(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchIncreased16() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu16(SearchResults[i]) < PSXMu16(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchIncreased32() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu32(SearchResults[i]) < PSXMu32(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDecreased8() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu8(SearchResults[i]) > PSXMu8(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDecreased16() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu16(SearchResults[i]) > PSXMu16(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDecreased32() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu32(SearchResults[i]) > PSXMu32(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDifferent8() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu8(SearchResults[i]) != PSXMu8(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDifferent16() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu16(SearchResults[i]) != PSXMu16(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchDifferent32() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu32(SearchResults[i]) != PSXMu32(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchNoChange8() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu8(SearchResults[i]) == PSXMu8(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchNoChange16() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu16(SearchResults[i]) == PSXMu16(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
+
+void CheatSearchNoChange32() {
+ u32 i, j;
+
+ assert(prevM != NULL); // not possible for the first search
+
+ j = 0;
+
+ for (i = 0; i < NumSearchResults; i++) {
+ if (PrevMu32(SearchResults[i]) == PSXMu32(SearchResults[i])) {
+ SearchResults[j++] = SearchResults[i];
+ }
+ }
+
+ NumSearchResults = j;
+}
diff --git a/libpcsxcore/cheat.h b/libpcsxcore/cheat.h
index 3e32c753..c5c74cd7 100644
--- a/libpcsxcore/cheat.h
+++ b/libpcsxcore/cheat.h
@@ -1,6 +1,6 @@
/* Cheat Support for PCSX-Reloaded
*
- * Copyright (C) 2009, Wei Mingzhi <whistler@openoffice.org>.
+ * Copyright (C) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -43,9 +43,69 @@ int AddCheat(const char *descr, char *code);
void RemoveCheat(int index);
int EditCheat(int index, const char *descr, char *code);
+void FreeCheatSearchResults();
+void FreeCheatSearchMem();
+void CheatSearchBackupMemory();
+
+void CheatSearchEqual8(u8 val);
+void CheatSearchEqual16(u16 val);
+void CheatSearchEqual32(u32 val);
+void CheatSearchNotEqual8(u8 val);
+void CheatSearchNotEqual16(u16 val);
+void CheatSearchNotEqual32(u32 val);
+void CheatSearchRange8(u8 min, u8 max);
+void CheatSearchRange16(u16 min, u16 max);
+void CheatSearchRange32(u32 min, u32 max);
+void CheatSearchIncreasedBy8(u8 val);
+void CheatSearchIncreasedBy16(u16 val);
+void CheatSearchIncreasedBy32(u32 val);
+void CheatSearchDecreasedBy8(u8 val);
+void CheatSearchDecreasedBy16(u16 val);
+void CheatSearchDecreasedBy32(u32 val);
+void CheatSearchIncreased8();
+void CheatSearchIncreased16();
+void CheatSearchIncreased32();
+void CheatSearchDecreased8();
+void CheatSearchDecreased16();
+void CheatSearchDecreased32();
+void CheatSearchDifferent8();
+void CheatSearchDifferent16();
+void CheatSearchDifferent32();
+void CheatSearchNoChange8();
+void CheatSearchNoChange16();
+void CheatSearchNoChange32();
+
extern Cheat *Cheats;
extern CheatCode *CheatCodes;
extern int NumCheats;
extern int NumCodes;
+extern s8 *prevM;
+extern u32 *SearchResults;
+extern int NumSearchResults;
+
+#define PREVM(mem) (&prevM[mem])
+#define PrevMu8(mem) (*(u8 *)PREVM(mem))
+#define PrevMu16(mem) (SWAP16(*(u16 *)PREVM(mem)))
+#define PrevMu32(mem) (SWAP32(*(u32 *)PREVM(mem)))
+
+// cheat types
+#define CHEAT_CONST8 0x30 /* 8-bit Constant Write */
+#define CHEAT_CONST16 0x80 /* 16-bit Constant Write */
+#define CHEAT_INC16 0x10 /* 16-bit Increment */
+#define CHEAT_DEC16 0x11 /* 16-bit Decrement */
+#define CHEAT_INC8 0x20 /* 8-bit Increment */
+#define CHEAT_DEC8 0x21 /* 8-bit Decrement */
+#define CHEAT_SLIDE 0x50 /* Slide Codes */
+#define CHEAT_MEMCPY 0xC2 /* Memory Copy */
+
+#define CHEAT_EQU8 0xE0 /* 8-bit Equal To */
+#define CHEAT_NOTEQU8 0xE1 /* 8-bit Not Equal To */
+#define CHEAT_LESSTHAN8 0xE2 /* 8-bit Less Than */
+#define CHEAT_GREATERTHAN8 0xE3 /* 8-bit Greater Than */
+#define CHEAT_EQU16 0xD0 /* 16-bit Equal To */
+#define CHEAT_NOTEQU16 0xD1 /* 16-bit Not Equal To */
+#define CHEAT_LESSTHAN16 0xD2 /* 16-bit Less Than */
+#define CHEAT_GREATERTHAN16 0xD3 /* 16-bit Greater Than */
+
#endif
diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c
index 27e69ec8..2e48469c 100644
--- a/libpcsxcore/psxhw.c
+++ b/libpcsxcore/psxhw.c
@@ -54,7 +54,7 @@ u8 psxHwRead8(u32 add) {
#endif
return hard;
}
-
+
#ifdef PSXHW_LOG
PSXHW_LOG("*Known 8bit read at address %lx value %x\n", add, hard);
#endif
@@ -111,7 +111,7 @@ u16 psxHwRead16(u32 add) {
// case 0x1f801054: hard = serial_status_read(); break;
// case 0x1f80105a: hard = serial_control_read(); break;
// case 0x1f80105e: hard = serial_baud_read(); break;
-
+
case 0x1f801100:
hard = psxRcntRcount(0);
#ifdef PSXHW_LOG
@@ -166,12 +166,12 @@ u16 psxHwRead16(u32 add) {
PSXHW_LOG("T2 target read16: %x\n", hard);
#endif
return hard;
-
+
//case 0x1f802030: hard = //int_2000????
//case 0x1f802040: hard =//dip switches...??
default:
- if (add>=0x1f801c00 && add<0x1f801e00) {
+ if (add >= 0x1f801c00 && add < 0x1f801e00) {
hard = SPU_readRegister(add);
} else {
hard = psxHu16(add);
diff --git a/libpcsxcore/psxmem.h b/libpcsxcore/psxmem.h
index cc4616c6..ba880ed5 100644
--- a/libpcsxcore/psxmem.h
+++ b/libpcsxcore/psxmem.h
@@ -50,7 +50,7 @@ s8 *psxM;
#define psxMs8(mem) psxM[(mem) & 0x1fffff]
#define psxMs16(mem) (SWAP16(*(s16*)&psxM[(mem) & 0x1fffff]))
#define psxMs32(mem) (SWAP32(*(s32*)&psxM[(mem) & 0x1fffff]))
-#define psxMu8(mem) (*(u8*)&psxM[(mem) & 0x1fffff]))
+#define psxMu8(mem) (*(u8*)&psxM[(mem) & 0x1fffff])
#define psxMu16(mem) (SWAP16(*(u16*)&psxM[(mem) & 0x1fffff]))
#define psxMu32(mem) (SWAP32(*(u32*)&psxM[(mem) & 0x1fffff]))
@@ -119,8 +119,7 @@ u8** psxMemRLUT;
#define PSXMu32ref(mem) (*(u32*)PSXM(mem))
-
-#if !defined(PSXREC) && (defined(__x86_64__) || defined(__i386__) || defined(__sh__) || defined(__ppc__)) && !defined(NOPSXREC)
+#if !defined(PSXREC) && (defined(__x86_64__) || defined(__i386__) || defined(__ppc__)) && !defined(NOPSXREC)
#define PSXREC
#endif
diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c
index b46ec124..6f45a1bb 100644
--- a/libpcsxcore/r3000a.c
+++ b/libpcsxcore/r3000a.c
@@ -51,6 +51,9 @@ int psxInit() {
}
void psxReset() {
+ FreeCheatSearchResults();
+ FreeCheatSearchMem();
+
psxCpu->Reset();
psxMemReset();
@@ -81,6 +84,8 @@ void psxShutdown() {
psxCpu->Shutdown();
ClearAllCheats();
+ FreeCheatSearchResults();
+ FreeCheatSearchMem();
}
void psxException(u32 code, u32 bd) {
diff --git a/plugins/dfsound/alsa.c b/plugins/dfsound/alsa.c
index 5daa2857..e9ea0a3b 100644
--- a/plugins/dfsound/alsa.c
+++ b/plugins/dfsound/alsa.c
@@ -145,8 +145,8 @@ unsigned long SoundGetBytesBuffered(void)
if (handle == NULL) // failed to open?
return SOUNDSIZE;
l = snd_pcm_avail_update(handle);
- if(l < 0) return 0;
- if(l < buffer_size / 2) // can we write in at least the half of fragments?
+ if (l < 0) return 0;
+ if (l < buffer_size / 2) // can we write in at least the half of fragments?
l = SOUNDSIZE; // -> no? wait
else l = 0; // -> else go on
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c
index ce697382..e1b0e099 100644
--- a/plugins/dfsound/spu.c
+++ b/plugins/dfsound/spu.c
@@ -23,7 +23,7 @@
#include "cfg.h"
#include "dsoundoss.h"
#include "regs.h"
-
+
#if defined(USEALSA)
static char * libraryName = "ALSA Sound";
#elif defined (USEOSS)
@@ -629,39 +629,37 @@ ENDX: ;
}
}
else // stereo:
- for(ns=0;ns<NSSIZE;ns++)
+ for (ns = 0; ns < NSSIZE; ns++)
{
- SSumL[ns]+=MixREVERBLeft(ns);
+ SSumL[ns] += MixREVERBLeft(ns);
- d=SSumL[ns]/voldiv;SSumL[ns]=0;
- if(d<-32767) d=-32767;if(d>32767) d=32767;
- *pS++=d;
+ d = SSumL[ns] / voldiv; SSumL[ns] = 0;
+ if (d < -32767) d = -32767; if (d > 32767) d = 32767;
+ *pS++ = d;
- SSumR[ns]+=MixREVERBRight();
+ SSumR[ns] += MixREVERBRight();
- d=SSumR[ns]/voldiv;SSumR[ns]=0;
- if(d<-32767) d=-32767;if(d>32767) d=32767;
- *pS++=d;
+ d = SSumR[ns] / voldiv; SSumR[ns] = 0;
+ if(d < -32767) d = -32767; if(d > 32767) d = 32767;
+ *pS++ = d;
}
InitREVERB();
// feed the sound
// wanna have around 1/60 sec (16.666 ms) updates
-
- if(iCycle++>8) //temp fix: lowered for low latency alsa configs
+ if (iCycle++ > 16)
{
- SoundFeedStreamData((unsigned char*)pSpuBuffer,
- ((unsigned char *)pS)-
- ((unsigned char *)pSpuBuffer));
- pS=(short *)pSpuBuffer;
- iCycle=0;
+ SoundFeedStreamData((unsigned char *)pSpuBuffer,
+ ((unsigned char *)pS) - ((unsigned char *)pSpuBuffer));
+ pS = (short *)pSpuBuffer;
+ iCycle = 0;
}
}
// end of big main loop...
- bThreadEnded=1;
+ bThreadEnded = 1;
return 0;
}
diff --git a/win32/gui/WndMain.c b/win32/gui/WndMain.c
index e5654a3b..1ba3e8ce 100644
--- a/win32/gui/WndMain.c
+++ b/win32/gui/WndMain.c
@@ -126,13 +126,19 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
Config.PsxAuto = 1;
strcpy(Config.PluginsDir, "Plugins\\");
strcpy(Config.BiosDir, "Bios\\");
- SysMessage(_("Pcsx needs to be configured"));
- ConfPlug=1;
+
+ strcpy(Config.Mcd1, "memcards\\Mcd001.mcr");
+ strcpy(Config.Mcd2, "memcards\\Mcd002.mcr");
+
+ ConfPlug = 1;
+
ConfigurePlugins(gApp.hWnd);
- DialogBox(gApp.hInstance, MAKEINTRESOURCE(IDD_MCDCONF), gApp.hWnd, (DLGPROC)ConfigureMcdsDlgProc);
- SysMessage(_("Pcsx now will quit, restart it"));
- return 0;
+
+ if (LoadConfig() == -1) {
+ return 0;
+ }
}
+
if (Config.Lang[0] == 0) {
strcpy(Config.Lang, "English");
}