diff --git a/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c b/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c
index fc6c1ae12..f50b1541e 100755
--- a/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c
+++ b/desmume/src/gtk-glade/dTools/callbacks_1_ioregs.c
@@ -32,7 +32,7 @@ static void display_current_reg();
/* update */
-void wtools_1_update () {
+static void wtools_1_update () {
display_current_reg();
}
diff --git a/desmume/src/gtk-glade/dTools/callbacks_2_memview.c b/desmume/src/gtk-glade/dTools/callbacks_2_memview.c
index b53f18dcd..fb4049fe8 100755
--- a/desmume/src/gtk-glade/dTools/callbacks_2_memview.c
+++ b/desmume/src/gtk-glade/dTools/callbacks_2_memview.c
@@ -48,7 +48,7 @@ static void initialize();
/* update */
-void wtools_2_update() {
+static void wtools_2_update() {
int i,j, x,y=5;
int px = w/78, qx;
u8 m8, *mem8 =mem; u16 m16, *mem16=(u16*)mem; u32 m32, *mem32=(u32*)mem;
diff --git a/desmume/src/gtk-glade/dTools/callbacks_3_palview.c b/desmume/src/gtk-glade/dTools/callbacks_3_palview.c
index 3eb68cdc1..bd942fe7c 100755
--- a/desmume/src/gtk-glade/dTools/callbacks_3_palview.c
+++ b/desmume/src/gtk-glade/dTools/callbacks_3_palview.c
@@ -22,53 +22,85 @@
#include "callbacks_dtools.h"
static u16* base_addr[20];
-
static BOOL init=FALSE;
+static int palnum=0;
+static int palindex=0;
+static void refresh();
+static GtkWidget * wPaint;
+
+static void wtools_3_update() {
+ refresh();
+}
+
+
+static void refresh() {
+ int x,y,X,Y; u16 * addr = base_addr[palindex];
+ COLOR c; COLOR32 c32;
+
+ GdkGC * GC = gdk_gc_new(wPaint->window);
+
+ for(y=Y= 0; y < 16; y++,Y+=16)
+ for(x=X= 0; x < 16; x++,X+=16)
+ {
+ if (addr) {
+ c.val = *(addr+Y+x+0x100*palnum);
+ COLOR_16_32(c,c32)
+ gdk_rgb_gc_set_foreground(GC, c32.val);
+ gdk_draw_rectangle(wPaint->window, GC, TRUE, X, Y, 15, 15);
+ } else {
+ gdk_rgb_gc_set_foreground(GC, 0x808080);
+ gdk_draw_rectangle(wPaint->window, GC, TRUE, X, Y, 15, 15);
+ gdk_rgb_gc_set_foreground(GC, 0xFF0000);
+ gdk_draw_line(wPaint->window, GC, X+14, Y+1, X+1, Y+14);
+ gdk_draw_line(wPaint->window, GC, X+1, Y+1, X+14, Y+14);
+ }
+
+
+ }
+ g_object_unref(GC);
+}
+
+
static void initialize() {
GtkComboBox * combo;
- GtkTreeIter iter;
-
+ GtkTreeIter iter, *parent=NULL;
+ GtkListStore* model;
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])
+ model = (GtkListStore*)gtk_combo_box_get_model(combo);
+ wPaint= glade_xml_get_widget(xml_tools, "wtools_3_draw");
+
+#define DO(str,addr,r) \
+ gtk_list_store_append (model, &iter); \
+ gtk_list_store_set (model, &iter, 0, str,-1); \
+ base_addr[i]=((u16*)(addr) r); 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();
@@ -81,8 +113,11 @@ gboolean on_wtools_3_PalView_close (GtkWidget *widget, ...) {
gboolean on_wtools_3_draw_expose_event (GtkWidget * widget, GdkEventExpose *event, gpointer user_data) {
+ refresh();
}
void on_wtools_3_palette_changed (GtkComboBox *combo, gpointer user_data) {
+ palindex = gtk_combo_box_get_active(combo);
+ refresh();
}
void on_wtools_3_palnum_value_changed (GtkSpinButton *spin, gpointer user_data) {
}
diff --git a/desmume/src/gtk-glade/dTools/callbacks_dtools.h b/desmume/src/gtk-glade/dTools/callbacks_dtools.h
index ff89659a4..b5463f4fb 100755
--- a/desmume/src/gtk-glade/dTools/callbacks_dtools.h
+++ b/desmume/src/gtk-glade/dTools/callbacks_dtools.h
@@ -20,10 +20,6 @@
*/
#include "../globals.h"
-/* update functions */
-void wtools_1_update();
-void wtools_2_update();
-
/* ***** ***** IO REGISTERS ***** ***** */
void on_wtools_1_combo_cpu_changed (GtkComboBox *, gpointer );
diff --git a/desmume/src/gtk-glade/glade/DeSmuMe.glade b/desmume/src/gtk-glade/glade/DeSmuMe.glade
index de2785f54..c027ffb3d 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
@@ -164,7 +164,7 @@
True
1
True
- True
+ False
fs0
@@ -175,7 +175,7 @@
True
2
True
- True
+ False
fs0
@@ -186,7 +186,7 @@
True
3
True
- True
+ False
fs0
@@ -197,7 +197,7 @@
True
4
True
- True
+ False
fs0
@@ -208,7 +208,7 @@
True
5
True
- True
+ False
fs0
@@ -219,7 +219,7 @@
True
6
True
- True
+ False
fs0
@@ -230,7 +230,7 @@
True
7
True
- True
+ False
fs0
@@ -241,7 +241,7 @@
True
8
True
- True
+ False
fs0
@@ -252,7 +252,7 @@
True
9
True
- True
+ False
fs0
@@ -286,7 +286,7 @@
True
2x
True
- True
+ False
size1x
@@ -297,7 +297,7 @@
True
3x
True
- True
+ False
size1x
@@ -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,7 @@
-
+
True
gtk-properties
1
@@ -465,7 +465,7 @@
-
+
True
gtk-properties
1
diff --git a/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade b/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade
index 231d1e3a8..1645d9ce1 100755
--- a/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade
+++ b/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade
@@ -909,6 +909,7 @@ ARM7 cpu
True
+
False
True
@@ -985,8 +986,8 @@ ARM7 cpu
3
1
2
- fill
- fill
+
+