Pages: [1]   Go Down
  Print  
Author Topic: memory viewer enhancement - continuous update  (Read 1413 times)
0 Members and 1 Guest are viewing this topic.
Bg~
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 27


« on: 03 / July / 2008, 21:55:43 »

I noticed after using DataGhost's build that the built in memory viewer does not update unless you press a button. Since I've been trying to observe the live preview image index switching for the motion detection stuff, I modified the built in CHDK memory viewer to continuously update. This is the patch if anyone is interested:

Code:
Index: gui_debug.c
===================================================================
--- gui_debug.c (revision 431)
+++ gui_debug.c (working copy)
@@ -74,9 +74,9 @@
             draw_txt_string(2, 11, "DOUBLE :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
             draw_txt_string(2, 12, "STRING :", MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));
 
-            debug_to_draw = 2;
+            debug_to_draw = 0;
             break;
-        case 2:
+        default:
             sprintf(buf, "0x%08X", addr);
             draw_txt_string(10, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));
             sprintf(buf, "0x%08X", step);
@@ -86,9 +86,6 @@
 
             debug_to_draw = 0;
             break;
-        default:
-            debug_to_draw = 0;
-            break;
     }
 }
 
@@ -101,11 +98,9 @@
         break;
     case KEY_LEFT:
         addr-=step;
-        debug_to_draw = 2;
         break;
     case KEY_RIGHT:
         addr+=step;
-        debug_to_draw = 2;
         break;
     case KEY_DISPLAY:
         switch (step) {
@@ -113,7 +108,6 @@
             case 0x10000000: step = 0x00000004; break;
             default: step<<=4; break;
         }
-        debug_to_draw = 2;
         break;
     }
 }

If you don't want to bother with the patch, just change

Code:
debug_to_draw = 0;

to

Code:
debug_to_draw = 2;

in case 2 of the switch statement in the gui_debug_draw() function in gui_debug.c


Logged
cyril42e
Full Member
***

Karma: +18/-0
Offline Offline

Posts: 111


SD1000/Ixus70 1.02a


« Reply #1 on: 04 / July / 2008, 21:45:50 »

I like it. I don't think there is any drawback to constantly update the display, maybe it should be considered to change the default behavior into that.

Another improvement to do concerning the memory viewer: save the currently displayed address when exiting the memory viewer, and display the same address the next time it starts. It's very annoying when you have to exit the memory viewer to change some setting.
Logged
PhyrePhoX
Global Moderator
Hero Member
*****

Karma: +139/-37
Offline Offline

Posts: 1818


Coders Humiliate DSLR Kiddies


« Reply #2 on: 04 / July / 2008, 21:59:41 »

i see a lot of good things coming where that came from. keep up the good work you two, seems to me you got way more skills than i do, please use it frequently Big Grin
Logged

Bg~
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 27


« Reply #3 on: 06 / July / 2008, 01:49:14 »

Ok, I added saving the last used address in the memory viewer. It only saves when you exit <ALT> mode before turning off the camera (I think anyway). I'll need to learn more about the conf system details, I guess. I also added the use of the zoom key to change the increment in both directions, and the UP key now turns on and off the auto refresh option.

Patch attached.
Logged
cyril42e
Full Member
***

Karma: +18/-0
Offline Offline

Posts: 111


SD1000/Ixus70 1.02a


« Reply #4 on: 06 / July / 2008, 17:19:14 »

Great! Thanks Bg~!

i see a lot of good things coming where that came from. keep up the good work you two, seems to me you got way more skills than i do, please use it frequently Big Grin
Phyrephox is very smart, he's buttering us up to make us work! Big Grin
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: