Index: include/gui.h===================================================================--- include/gui.h (revision 459)+++ include/gui.h (working copy)@@ -18,6 +18,7 @@ GUI_MODE_READ, GUI_MODE_OSD, GUI_MODE_CALENDAR,+ GUI_MODE_MEMSEARCH, GUI_MODE_BENCH, GUI_MODE_MPOPUP }; Index: include/platform.h===================================================================--- include/platform.h (revision 459)+++ include/platform.h (working copy)@@ -265,6 +265,10 @@ long get_target_dir_num(); long get_target_file_num(); +// Copy the string at POINTER_PLAYBACK_FILENAME. Return NULL on failure.+// Caller owns the memory for the returned char pointer.+char *get_playback_filename();+ /******************************************************************/ void kbd_key_press(long key);Index: platform/ixus860_sd870/shooting.c===================================================================--- platform/ixus860_sd870/shooting.c (revision 459)+++ platform/ixus860_sd870/shooting.c (working copy)@@ -1,4 +1,6 @@ #define PARAM_FILE_COUNTER 0x38+#define POINTER_PLAYBACK_FILENAME 0x590a8+#define POINTER_PLAYBACK_THUMBNAIL 0x5980c // DRYOS-Notes: // propertycaseIndex: platform/generic/shooting.c===================================================================--- platform/generic/shooting.c (revision 459)+++ platform/generic/shooting.c (working copy)@@ -840,6 +840,16 @@ return v; } +char *get_playback_filename() {+#ifdef POINTER_PLAYBACK_FILENAME+ char *path = umalloc(32);+ strncpy(path, (char *) POINTER_PLAYBACK_FILENAME, 32);+ return path;+#else+ return NULL;+#endif+}+ int shooting_get_zoom() { return lens_get_zoom_point(); }Index: core/gui_lang.c===================================================================--- core/gui_lang.c (revision 459)+++ core/gui_lang.c (working copy)@@ -427,6 +427,8 @@ "339 \"RAWconv\"\n" "340 \"AF key\"\n"++"341 \"Memory search\"\n" ; //-------------------------------------------------------------------Index: core/gui_lang.h===================================================================--- core/gui_lang.h (revision 459)+++ core/gui_lang.h (working copy)@@ -438,9 +438,11 @@ #define LANG_MENU_BAD_PIXEL_RAW_CONVERTER 339 #define LANG_MENU_VIDEO_AF_KEY 340++#define LANG_MENU_DEBUG_MEMORY_SEARCH 341 //------------------------------------------------------------------- -#define GUI_LANG_ITEMS 340+#define GUI_LANG_ITEMS 341 //------------------------------------------------------------------- extern void gui_lang_init();Index: core/Makefile===================================================================--- core/Makefile (revision 459)+++ core/Makefile (working copy)@@ -13,7 +13,8 @@ OBJS=entry.o nothumb.o main.o gui_draw.o gui_menu.o gui_palette.o gui_mbox.o \ gui_reversi.o gui_debug.o gui_fselect.o gui_read.o gui.o kbd.o conf.o \- histogram.o gui_batt.o gui_space.o gui_osd.o script.o raw.o gui_sokoban.o gui_calendar.o \+ histogram.o gui_batt.o gui_space.o gui_osd.o script.o raw.o gui_sokoban.o \+ gui_calendar.o gui_memsearch.o \ gui_lang.o gui_bench.o gui_mpopup.o gui_grid.o motion_detector.o raw_merge.o gui.o: FORCEIndex: core/gui_memsearch.c===================================================================--- core/gui_memsearch.c (revision 0)+++ core/gui_memsearch.c (revision 0)@@ -0,0 +1,47 @@+#include "stdlib.h"+#include "gui.h"+#include "gui_draw.h"+#include "gui_memsearch.h"++//-------------------------------------------------------------------+// Search parameters+#define SEARCH_STRING "A/DCIM/100CANON/MVI_2519.AVI"+#define START_ADDRESS (void*) 0x0+#define END_ADDRESS (void*) 0x100000++//-------------------------------------------------------------------+// Display parameters+#define OUTPUT_COLOR (MAKE_COLOR(COLOR_WHITE, COLOR_BLACK))+#define ERROR_COLOR (MAKE_COLOR(COLOR_WHITE, COLOR_RED))+#define X_POSITION 2+#define Y_POSITION 1+#define DONE_MSG "Done"+#define NOT_FOUND_MSG "Not found"++//-------------------------------------------------------------------+void gui_memsearch_init() {+ void* addr;+ int found = 0;+ char buf[32];+ int y = Y_POSITION;++ draw_clear();++ const char* search_string = SEARCH_STRING;+ int len = strlen(search_string);++ for (addr = START_ADDRESS; addr < END_ADDRESS; addr += 0x4) {+ if (memcmp(search_string, addr, len) == 0) {+ sprintf(buf, "0x%08X", addr);+ draw_txt_string(X_POSITION, y, buf, OUTPUT_COLOR);+ found = 1;+ y = y + 1;+ }+ }++ if (found) {+ draw_txt_string(X_POSITION, y+1, DONE_MSG, OUTPUT_COLOR);+ } else {+ draw_txt_string(X_POSITION, y, NOT_FOUND_MSG, ERROR_COLOR);+ }+}Index: core/gui_memsearch.h===================================================================--- core/gui_memsearch.h (revision 0)+++ core/gui_memsearch.h (revision 0)@@ -0,0 +1,9 @@+#ifndef GUI_MEMSEARCH_H+#define GUI_MEMSEARCH_H++//-------------------------------------------------------------------+extern void gui_memsearch_init();++//-------------------------------------------------------------------++#endifIndex: core/gui.c===================================================================--- core/gui.c (revision 459)+++ core/gui.c (working copy)@@ -23,6 +23,7 @@ #include "gui_osd.h" #include "gui_read.h" #include "gui_calendar.h"+#include "gui_memsearch.h" #include "gui_bench.h" #include "gui_grid.h" #include "histogram.h"@@ -105,6 +106,7 @@ static void gui_draw_load_menu_rbf(int arg); static void gui_draw_load_rbf(int arg); static void gui_draw_calendar(int arg);+static void gui_draw_memsearch(int arg); static void gui_draw_load_lang(int arg); static void gui_menuproc_mkbootdisk(int arg); #ifndef OPTIONS_AUTOSAVE@@ -273,6 +275,7 @@ {LANG_MENU_DEBUG_PROPCASE_PAGE, MENUITEM_INT|MENUITEM_F_UNSIGNED|MENUITEM_F_MINMAX, &debug_propcase_page, MENU_MINMAX(0, 128) }, {LANG_MENU_DEBUG_SHOW_MISC_VALS, MENUITEM_BOOL, &debug_vals_show }, {LANG_MENU_DEBUG_MEMORY_BROWSER, MENUITEM_PROC, (int*)gui_draw_debug },+ {LANG_MENU_DEBUG_MEMORY_SEARCH, MENUITEM_PROC, (int*)gui_draw_memsearch }, {LANG_MENU_DEBUG_BENCHMARK, MENUITEM_PROC, (int*)gui_draw_bench }, {LANG_MENU_DEBUG_DUMP_RAM, MENUITEM_BOOL, &conf.ns_enable_memdump }, {LANG_MENU_DEBUG_MAKE_BOOTABLE, MENUITEM_PROC, (int*)gui_menuproc_mkbootdisk },@@ -1569,6 +1572,7 @@ case GUI_MODE_DEBUG: case GUI_MODE_OSD: case GUI_MODE_CALENDAR:+ case GUI_MODE_MEMSEARCH: case GUI_MODE_BENCH: draw_restore(); gui_mode = GUI_MODE_MENU;@@ -2272,6 +2276,12 @@ } //-------------------------------------------------------------------+void gui_draw_memsearch(int arg) {+ gui_mode = GUI_MODE_MEMSEARCH;+ gui_memsearch_init();+}++//------------------------------------------------------------------- static void gui_draw_rbf_selected(const char *fn) { if (fn) { strcpy(conf.reader_rbf_file, fn);
for (addr = START_ADDRESS; addr < END_ADDRESS; addr += 0x1) { if (memcmp(search_string, addr, len) == 0) { sprintf(buf, "0x%08X %-30s", addr, addr); draw_txt_string(X_POSITION, y, buf, OUTPUT_COLOR); found = 1; y = y + 1; } }
Started by zeno General Discussion and Assistance
Started by pygmy_giant Script Writing
Started by ralfhesse LUA Scripting
Started by cdordoni General Help and Assistance on using CHDK stable releases
Started by pigeonhill General Help and Assistance on using CHDK stable releases