diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am
index e22603e97..3552ea42e 100644
--- a/desmume/src/Makefile.am
+++ b/desmume/src/Makefile.am
@@ -5,6 +5,7 @@ libdesmume_a_SOURCES = \
arm_instructions.c arm_instructions.h \
bios.c bios.h cp15.c cp15.h \
cflash.c cflash.h fs.h \
+ fs-$(desmume_arch).c \
debug.c debug.h \
Disassembler.c Disassembler.h \
FIFO.c FIFO.h \
@@ -16,4 +17,3 @@ libdesmume_a_SOURCES = \
saves.c saves.h \
SPU.c SPU.h \
thumb_instructions.c thumb_instructions.h
-libdesmume_a_LIBADD = fs-$(desmume_arch).$(OBJEXT)
diff --git a/desmume/src/gtk-glade/Makefile.am b/desmume/src/gtk-glade/Makefile.am
index 216d54e0c..c50a64314 100644
--- a/desmume/src/gtk-glade/Makefile.am
+++ b/desmume/src/gtk-glade/Makefile.am
@@ -2,7 +2,8 @@ bin_PROGRAMS = desmume-glade
desmume_glade_SOURCES = \
callbacks.c callbacks.h callbacks_IO.c callbacks_IO.h desmume.c desmume.h \
globals.h keyval_names.c main.c printscreen.c \
- dTools/callbacks_1_ioregs.c dTools/callbacks_2_memview.c dTools/callbacks_dtools.h \
+ dTools/callbacks_1_ioregs.c dTools/callbacks_2_memview.c \
+ dTools/callbacks_3_palview.c dTools/callbacks_dtools.h \
../sndsdl.h ../sndsdl.c ../ctrlssdl.h ../ctrlssdl.c
desmume_glade_LDADD = ../libdesmume.a $(SDL_LIBS) $(LIBGLADE_LIBS)
desmume_glade_CFLAGS = $(SDL_CFLAGS) $(LIBGLADE_CFLAGS)
diff --git a/desmume/src/gtk-glade/callbacks.c b/desmume/src/gtk-glade/callbacks.c
index 78c8838a6..98e98350d 100755
--- a/desmume/src/gtk-glade/callbacks.c
+++ b/desmume/src/gtk-glade/callbacks.c
@@ -275,6 +275,11 @@ void on_menu_memview_activate (GtkMenuItem *menuitem, gpointer user_data)
gtk_widget_show(dlg);
}
+void on_menu_palview_activate (GtkMenuItem *menuitem, gpointer user_data) {
+ GtkWidget * dlg = glade_xml_get_widget(xml_tools, "wtools_3_PalView");
+ gtk_widget_show(dlg);
+}
+
diff --git a/desmume/src/gtk-glade/callbacks.h b/desmume/src/gtk-glade/callbacks.h
index 0dd808d51..f41598ee7 100755
--- a/desmume/src/gtk-glade/callbacks.h
+++ b/desmume/src/gtk-glade/callbacks.h
@@ -58,6 +58,7 @@ void on_menu_rotatescreen_activate (GtkMenuItem *menuitem, gpointer user_data);
/* MENU TOOLS */
void on_menu_IO_regs_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menu_memview_activate (GtkMenuItem *menuitem, gpointer user_data);
+void on_menu_palview_activate (GtkMenuItem *menuitem, gpointer user_data);
/* MENU ? */
void on_menu_apropos_activate (GtkMenuItem *menuitem, gpointer user_data);
diff --git a/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c b/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c
index a025b9cbb..fc6c1ae12 100755
--- a/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c
+++ b/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c
@@ -28,7 +28,7 @@ static BOOL hword;
static GtkLabel * reg_address;
static GtkEntry * reg_value;
-void display_current_reg();
+static void display_current_reg();
/* update */
@@ -39,7 +39,7 @@ void wtools_1_update () {
/* registers */
-void display_current_reg() {
+static void display_current_reg() {
char text_address[16];
char text_value[16];
char * patt = "0x%08X";
@@ -52,7 +52,7 @@ void display_current_reg() {
gtk_entry_set_text(reg_value, text_value);
}
-void display_reg(u32 address_, BOOL hword_) {
+static void display_reg(u32 address_, BOOL hword_) {
address = address_;
hword = hword_;
display_current_reg();
@@ -65,6 +65,10 @@ void on_wtools_1_combo_cpu_changed (GtkComboBox *widget, gpointer user_data)
display_current_reg();
}
+
+
+/* show, register, unregister */
+
void on_wtools_1_IOregs_show (GtkWidget *widget, gpointer user_data) {
GtkWidget * b = glade_xml_get_widget(xml_tools, "wtools_1_r_ime");
GtkWidget * combo = glade_xml_get_widget(xml_tools, "wtools_1_combo_cpu");
@@ -78,13 +82,15 @@ void on_wtools_1_IOregs_show (GtkWidget *widget, gpointer user_data) {
register_Tool(wtools_1_update);
}
-gboolean on_wtools_1_IOregs_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) {
+
+gboolean on_wtools_1_IOregs_close (GtkWidget *widget, ...) {
unregister_Tool(wtools_1_update);
gtk_widget_hide(widget);
return TRUE;
}
+
void on_wtools_1_r_ipcfifocnt_toggled (GtkToggleButton *togglebutton, gpointer user_data) { display_reg(REG_IPCFIFOCNT,TRUE); }
void on_wtools_1_r_spicnt_toggled (GtkToggleButton *togglebutton, gpointer user_data) { display_reg(REG_SPICNT,TRUE); }
void on_wtools_1_r_ime_toggled (GtkToggleButton *togglebutton, gpointer user_data) { display_reg(REG_IME,TRUE); }
diff --git a/desmume/src/gtk-glade/dTools/callbacks_2_memview.c b/desmume/src/gtk-glade/dTools/callbacks_2_memview.c
index 2f0575804..b53f18dcd 100755
--- a/desmume/src/gtk-glade/dTools/callbacks_2_memview.c
+++ b/desmume/src/gtk-glade/dTools/callbacks_2_memview.c
@@ -42,8 +42,8 @@ static GtkEntry *wAddress;
static GtkDrawingArea *wPaint;
static GtkRange *wRange;
-void refresh();
-void initialise();
+static void refresh();
+static void initialize();
/* update */
@@ -142,14 +142,14 @@ void on_wtools_2_r32_toggled (GtkToggleButton *togglebutton, gpointer
#define STEP_ONE_PAGE 0x100
#define STEP_x10_PAGE 0x1000
-void scroll_address(u32 addr) {
+static void scroll_address(u32 addr) {
address = addr & ADDR_MASK;
refresh();
}
-void change_address(u32 addr) {
+static void change_address(u32 addr) {
gtk_range_set_value(wRange, addr);
}
-void add_to_address(u32 inc) {
+static void add_to_address(u32 inc) {
change_address(address+inc);
}
@@ -164,12 +164,13 @@ void on_wtools_2_GotoButton_clicked (GtkButton *button, gpointer user_data) {
}
+/* show, register, unregister */
-void on_wtools_2_MemView_show (GtkWidget *widget, gpointer user_data) {
+void on_wtools_2_MemView_show (GtkWidget *widget, gpointer user_data) {
initialize();
register_Tool(wtools_2_update);
}
-gboolean on_wtools_2_MemView_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) {
+gboolean on_wtools_2_MemView_close (GtkWidget *widget, ...) {
unregister_Tool(wtools_2_update);
gtk_widget_hide(widget);
return TRUE;
@@ -201,7 +202,7 @@ gboolean on_wtools_2_draw_expose_event (GtkWidget *widget, GdkEventExpose *event
/* initialise what we have to */
-void initialize() {
+static void initialize() {
GtkWidget * combo;
GtkAdjustment *adj;
int i,j;
@@ -245,7 +246,7 @@ void initialize() {
}
/* PAINT memory panel */
-void refresh() {
+static void refresh() {
GtkWidget * area = (GtkWidget*)wPaint;
PangoLayout* playout = gtk_widget_create_pango_layout(area, NULL);
GdkGC * GC = area->style->fg_gc[area->state];
diff --git a/desmume/src/gtk-glade/dTools/callbacks_3_palview.c b/desmume/src/gtk-glade/dTools/callbacks_3_palview.c
new file mode 100755
index 000000000..92757ec8a
--- /dev/null
+++ b/desmume/src/gtk-glade/dTools/callbacks_3_palview.c
@@ -0,0 +1,84 @@
+/* callbacks_3_palview.c - this file is part of DeSmuME
+ *
+ * Copyright (C) 2007 Damien Nozay (damdoum)
+ * Author: damdoum at users.sourceforge.net
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "callbacks_dtools.h"
+
+static u16* base_addr[20];
+
+static BOOL init=FALSE;
+static void initialize() {
+ GtkComboBox * combo;
+ int i=0;
+ if (init) return;
+
+ combo = (GtkComboBox*)glade_xml_get_widget(xml_tools, "wtools_3_palette");
+#define DO(str,addr) gtk_combo_box_append_text(combo,str); base_addr[i]=(u16*)(addr); i++;
+ DO("Main screen BG PAL", ARM9Mem.ARM9_VMEM)
+ DO("Main screen SPR PAL", ARM9Mem.ARM9_VMEM + 0x100)
+ DO("Sub screen BG PAL", ARM9Mem.ARM9_VMEM + 0x200)
+ DO("Sub screen SPR PAL", ARM9Mem.ARM9_VMEM + 0x300)
+ DO("Main screen ExtPAL 0", ARM9Mem.ExtPal[0][0])
+ DO("Main screen ExtPAL 1", ARM9Mem.ExtPal[0][1])
+ DO("Main screen ExtPAL 2", ARM9Mem.ExtPal[0][2])
+ DO("Main screen ExtPAL 3", ARM9Mem.ExtPal[0][3])
+ DO("Sub screen ExtPAL 0", ARM9Mem.ExtPal[1][0])
+ DO("Sub screen ExtPAL 1", ARM9Mem.ExtPal[1][1])
+ DO("Sub screen ExtPAL 2", ARM9Mem.ExtPal[1][2])
+ DO("Sub screen ExtPAL 3", ARM9Mem.ExtPal[1][3])
+ DO("Main screen SPR ExtPAL 0", ARM9Mem.ObjExtPal[0][0])
+ DO("Main screen SPR ExtPAL 1", ARM9Mem.ObjExtPal[0][1])
+ DO("Sub screen SPR ExtPAL 0", ARM9Mem.ObjExtPal[1][0])
+ DO("Sub screen SPR ExtPAL 1", ARM9Mem.ObjExtPal[1][1])
+ DO("Texture PAL 0", ARM9Mem.texPalSlot[0])
+ DO("Texture PAL 1", ARM9Mem.texPalSlot[1])
+ DO("Texture PAL 2", ARM9Mem.texPalSlot[2])
+ DO("Texture PAL 3", ARM9Mem.texPalSlot[3])
+#undef DO
+ init=TRUE;
+}
+
+#if 0
+ for(y = 0; y < 16; ++y)
+ {
+ for(x = 0; x < 16; ++x)
+ {
+ c = adr[(y<<4)+x+0x100*num];
+ brush = CreateSolidBrush(RGB((c&0x1F)<<3, (c&0x3E0)>>2, (c&0x7C00)>>7)
+ }
+ }
+
+#endif
+
+
+void on_wtools_3_PalView_show (GtkWidget *widget, gpointer data) {
+ initialize();
+}
+gboolean on_wtools_3_PalView_close (GtkWidget *widget, ...) {
+// unregister_Tool(wtools_1_update);
+ gtk_widget_hide(widget);
+ return TRUE;
+}
+
+
+gboolean on_wtools_3_draw_expose_event (GtkWidget *, GdkEventExpose *, gpointer );
+void on_wtools_3_palette_changed (GtkComboBox *, gpointer );
+void on_wtools_3_palnum_value_changed (GtkSpinButton *, gpointer );
+
diff --git a/desmume/src/gtk-glade/dTools/callbacks_dtools.h b/desmume/src/gtk-glade/dTools/callbacks_dtools.h
index 0f3546f31..ff89659a4 100755
--- a/desmume/src/gtk-glade/dTools/callbacks_dtools.h
+++ b/desmume/src/gtk-glade/dTools/callbacks_dtools.h
@@ -26,39 +26,50 @@ void wtools_2_update();
/* ***** ***** IO REGISTERS ***** ***** */
-void on_wtools_1_combo_cpu_changed (GtkComboBox *widget, gpointer user_data);
-void on_wtools_1_IOregs_show (GtkWidget *widget, gpointer user_data);
-gboolean on_wtools_1_IOregs_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data);
-void on_wtools_1_r_ipcfifocnt_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_spicnt_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_ime_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_ie_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_if_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_power_cr_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispa_win0h_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispa_win1h_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispa_win0v_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispa_win1v_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispa_winin_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispa_winout_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispb_win0h_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispb_win1h_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispb_win0v_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispb_win1v_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispb_winin_toggled(GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_1_r_dispb_winout_toggled(GtkToggleButton *togglebutton, gpointer user_data);
+void on_wtools_1_combo_cpu_changed (GtkComboBox *, gpointer );
+void on_wtools_1_IOregs_show (GtkWidget *, gpointer );
+gboolean on_wtools_1_IOregs_close (GtkWidget *, ...);
+
+void on_wtools_1_r_ipcfifocnt_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_spicnt_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_ime_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_ie_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_if_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_power_cr_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispa_win0h_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispa_win1h_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispa_win0v_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispa_win1v_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispa_winin_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispa_winout_toggled(GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispb_win0h_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispb_win1h_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispb_win0v_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispb_win1v_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispb_winin_toggled (GtkToggleButton *, gpointer );
+void on_wtools_1_r_dispb_winout_toggled(GtkToggleButton *, gpointer );
/* ***** ***** MEMORY VIEWER ***** ***** */
-gboolean on_wtools_2_MemView_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data);
-gboolean on_wtools_2_draw_button_release_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data);
-void on_wtools_2_cpu_changed (GtkComboBox *widget, gpointer user_data);
-void on_wtools_2_MemView_show (GtkWidget *widget, gpointer user_data);
-void on_wtools_2_r8_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_2_r16_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_2_r32_toggled (GtkToggleButton *togglebutton, gpointer user_data);
-void on_wtools_2_GotoAddress_activate (GtkEntry *entry, gpointer user_data);
-void on_wtools_2_GotoAddress_changed (GtkEntry *entry, gpointer user_data);
-void on_wtools_2_GotoButton_clicked (GtkButton *button, gpointer user_data);
-void on_wtools_2_scroll_value_changed (GtkRange *range, gpointer user_data);
-gboolean on_wtools_2_draw_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data);
-gboolean on_wtools_2_draw_scroll_event (GtkWidget *widget, GdkEventScroll *event, gpointer user_data);
+void on_wtools_2_MemView_show (GtkWidget *, gpointer );
+gboolean on_wtools_2_MemView_close (GtkWidget *, ...);
+
+void on_wtools_2_cpu_changed (GtkComboBox *, gpointer );
+void on_wtools_2_r8_toggled (GtkToggleButton *, gpointer );
+void on_wtools_2_r16_toggled (GtkToggleButton *, gpointer );
+void on_wtools_2_r32_toggled (GtkToggleButton *, gpointer );
+void on_wtools_2_GotoAddress_activate (GtkEntry *, gpointer );
+void on_wtools_2_GotoAddress_changed (GtkEntry *, gpointer );
+void on_wtools_2_GotoButton_clicked (GtkButton *, gpointer );
+void on_wtools_2_scroll_value_changed (GtkRange *, gpointer );
+gboolean on_wtools_2_draw_button_release_event(GtkWidget *, GdkEventButton *, gpointer );
+gboolean on_wtools_2_draw_expose_event (GtkWidget *, GdkEventExpose *, gpointer );
+gboolean on_wtools_2_draw_scroll_event (GtkWidget *, GdkEventScroll *, gpointer );
+
+/* ***** ***** PALETTE VIEWER ***** ***** */
+void on_wtools_3_PalView_show (GtkWidget *, gpointer );
+gboolean on_wtools_3_PalView_close (GtkWidget *, ...);
+
+gboolean on_wtools_3_PalView_delete_event (GtkWidget *, GdkEvent *, gpointer );
+gboolean on_wtools_3_draw_expose_event (GtkWidget *, GdkEventExpose *, gpointer );
+void on_wtools_3_palette_changed (GtkComboBox *, gpointer );
+void on_wtools_3_palnum_value_changed (GtkSpinButton *, gpointer );
diff --git a/desmume/src/gtk-glade/glade/DeSmuMe.glade b/desmume/src/gtk-glade/glade/DeSmuMe.glade
index 24068b79b..de2785f54 100755
--- a/desmume/src/gtk-glade/glade/DeSmuMe.glade
+++ b/desmume/src/gtk-glade/glade/DeSmuMe.glade
@@ -117,7 +117,7 @@
-
+
True
gtk-refresh
1
@@ -328,7 +328,7 @@
-
+
True
gtk-preferences
1
@@ -349,7 +349,7 @@
-
+
True
gtk-preferences
1
@@ -423,7 +423,7 @@
-
+
True
gtk-properties
1
@@ -444,7 +444,28 @@
-
+
+ True
+ gtk-properties
+ 1
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+
+
+
+