diff -r e6fae444c60b Makefile --- a/Makefile Thu Oct 04 14:58:02 2012 +0300 +++ b/Makefile Fri Oct 05 19:11:11 2012 +0200 @@ -50,6 +50,11 @@ 7D: $(MAKE) -C $(PLATFORM_PATH)/7D.203 +7DFIR: + $(MAKE) FIR-MASTER -C $(PLATFORM_PATH)/7D.203 + $(MAKE) FIR-SLAVE -C $(PLATFORM_PATH)/7D.203 + ./build_fir7.py -r -s $(PLATFORM_PATH)/7D.203/autoexec-fir-slave.bin -m $(PLATFORM_PATH)/7D.203/autoexec-fir-master.bin $(PLATFORM_PATH)/7D.203/7D000203.FIR $(PLATFORM_PATH)/7D.203/7D000203_ML.FIR + 5DC: $(MAKE) -C $(PLATFORM_PATH)/5DC.111 diff -r e6fae444c60b Makefile.inc --- a/Makefile.inc Thu Oct 04 14:58:02 2012 +0300 +++ b/Makefile.inc Fri Oct 05 19:11:11 2012 +0200 @@ -343,6 +343,16 @@ $(STAT_CMD) autoexec.bin; \ $(READELF) -l magiclantern | grep -C 2 MemSiz +autoexec-fir: reboot.o + $(call build,LD,$(LD) \ + -o $@ \ + -nostdlib \ + -march=armv5te \ + -e _start \ + -Ttext 0x40800120 \ + $^ -Xlinker --cref -Xlinker -Map=autoexec.map \ + ); + %-stubs.S: %.map perl -ne > $@ < $< '\ BEGIN { print "#define SYM(a,n) n=a; .global n;\n" }\ diff -r e6fae444c60b platform/7D.203/Makefile --- a/platform/7D.203/Makefile Thu Oct 04 14:58:02 2012 +0300 +++ b/platform/7D.203/Makefile Fri Oct 05 19:11:11 2012 +0200 @@ -72,7 +72,26 @@ # DryOSmemory map # RESTARTSTART is selected to be just above the end of the bss # -ROMBASEADDR = 0xFF010000 -RESTARTSTART = 0xC80100 +ROMBASEADDR = 0xF8010000 +RESTARTSTART = 0xC80100 + +CFLAGS += -DCONFIG_7D_MINIMAL=1 all: autoexec.bin + +FIR-MASTER: autoexec-fir-master +FIR-SLAVE: autoexec-fir-slave + +autoexec-fir-master: CFLAGS += -DCONFIG_7D_FIR_MASTER +autoexec-fir-slave: CFLAGS += -DCONFIG_7D_FIR_SLAVE + +autoexec-fir-master: clean autoexec-fir + $(call build,OBJCOPY,$(OBJCOPY) -O binary autoexec-fir $@.bin) + $(STAT_CMD) $@.bin; + $(READELF) -l autoexec-fir | grep -C 2 MemSiz + + +autoexec-fir-slave: clean autoexec-fir + $(call build,OBJCOPY,$(OBJCOPY) -O binary autoexec-fir $@.bin) + $(STAT_CMD) $@.bin; + $(READELF) -l autoexec-fir | grep -C 2 MemSiz diff -r e6fae444c60b platform/7D.203/consts.h --- a/platform/7D.203/consts.h Thu Oct 04 14:58:02 2012 +0300 +++ b/platform/7D.203/consts.h Fri Oct 05 19:11:11 2012 +0200 @@ -1,12 +1,19 @@ #define CARD_DRIVE "A:/" #define CARD_LED_ADDRESS 0xC022D06C // http://magiclantern.wikia.com/wiki/Led_addresses +#define HIJACK_CACHE_HACK + +#if defined(CONFIG_7D_FIR_MASTER) +#define HIJACK_CACHE_HACK_BSS_END_ADDR 0xFF811508 +#define HIJACK_CACHE_HACK_BSS_END_INSTR 0xE3A01732 +#define HIJACK_CACHE_HACK_INITTASK_ADDR 0xFF811064 +#else +#define HIJACK_CACHE_HACK_BSS_END_ADDR 0xFF011F2C +#define HIJACK_CACHE_HACK_BSS_END_INSTR 0xE3A01732 +#define HIJACK_CACHE_HACK_INITTASK_ADDR 0xFF011064 +#endif + // thanks Indy -#define HIJACK_INSTR_BL_CSTART 0xff010158 -#define HIJACK_INSTR_BSS_END 0xff011058 -#define HIJACK_FIXBR_BZERO32 0xff010fc0 -#define HIJACK_FIXBR_CREATE_ITASK 0xff011048 -#define HIJACK_INSTR_MY_ITASK 0xff011064 #define HIJACK_TASK_ADDR 0x1A1C #define ARMLIB_OVERFLOWING_BUFFER 0x240d4 // in AJ_armlib_setup_related3 @@ -36,9 +43,8 @@ #define IS_HD_BUFFER(x) ((0x40FFFFFF & (x)) == 0x40000080) // quick check if x looks like a valid HD buffer -#define YUV422_LV_BUFFER_DMA_ADDR (*(uint32_t*)0x225C) -#define YUV422_HD_BUFFER_DMA_ADDR (*(uint32_t*)0x451C) - #define YUV422_LV_BUFFER_DISPLAY_ADDR YUV422_LV_BUFFER_DMA_ADDR +#define YUV422_LV_BUFFER_DISPLAY_ADDR (*(uint32_t*)0x225C) +#define YUV422_HD_BUFFER_DMA_ADDR (shamem_read(REG_EDMAC_WRITE_HD_ADDR)) // see "focusinfo" and Wiki:Struct_Guessing #define FOCUS_CONFIRMATION (*(int*)0x3A90) diff -r e6fae444c60b platform/7D.203/stubs.S --- a/platform/7D.203/stubs.S Thu Oct 04 14:58:02 2012 +0300 +++ b/platform/7D.203/stubs.S Fri Oct 05 19:11:11 2012 +0200 @@ -34,6 +34,11 @@ NSTUB( ROMBASEADDR, firmware_entry ) + +NSTUB(0xFF812B4C, master_init_task) +NSTUB(0xFF83976C, master_msleep) +NSTUB(0xFF839820, master_task_create) +NSTUB(0xFF81AD28, master_write_memory) NSTUB(0xFF205FA8, AcquireRecursiveLock) // AJ_KernelDry_KerRLock.c NSTUB(0xff07cd24, AllocateMemory) NSTUB(0xff2ffd3c, CreateDialogBox) @@ -148,6 +153,7 @@ NSTUB(0xFF35AC90, OlcAFFrameApp_handler) NSTUB(0xff430250, ErrCardForLVApp_handler) NSTUB(0xFF3674A4, LiveViewWbApp_handler) +NSTUB(0xFF236E9C, GUI_SetRollingPitchingLevelStatus) NSTUB(0xff336d60, ErrForCamera_handler) // ERR70, ERR80 etc (DlgErrForCamera.c, AJ_DIALOG.HANDLER_DlgErrForCamera.c) NSTUB(0xff1f6b20, _engio_write) diff -r e6fae444c60b src/af_patterns.c --- a/src/af_patterns.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/af_patterns.c Fri Oct 05 19:11:11 2012 +0200 @@ -318,7 +318,7 @@ } static struct menu_entry afp_focus_menu[] = { -#if !defined(CONFIG_5DC) && !defined(CONFIG_5D3) +#if !defined(CONFIG_5DC) && !defined(CONFIG_5D3) && !defined(CONFIG_7D_MINIMAL) { .name = "Focus Patterns", .priv = &af_patterns, diff -r e6fae444c60b src/bitrate.c --- a/src/bitrate.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/bitrate.c Fri Oct 05 19:11:11 2012 +0200 @@ -544,7 +544,10 @@ { menu_add( "Movie", mov_menus, COUNT(mov_menus) ); } + +#if !defined(CONFIG_7D_MINIMAL) INIT_FUNC(__FILE__, bitrate_init); +#endif static void bitrate_task( void* unused ) diff -r e6fae444c60b src/boot-hack.c --- a/src/boot-hack.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/boot-hack.c Fri Oct 05 19:11:11 2012 +0200 @@ -33,7 +33,7 @@ #include "version.h" #include "property.h" #include "consts.h" -#ifdef CONFIG_7D +#ifdef HIJACK_CACHE_HACK #include "cache_hacks.h" #endif @@ -85,7 +85,7 @@ // Set the flag if this was an autoboot load autoboot_loaded = (offset == 0); -#ifdef CONFIG_7D +#ifdef HIJACK_CACHE_HACK /* make sure we have the first segment locked in d/i cache for patching */ uint32_t old_int = cli(); clean_d_cache(); @@ -94,9 +94,9 @@ sei(old_int); /* patch init code to start our init task instead of canons default */ - cache_fake(0xFF011064, (uint32_t) my_init_task, TYPE_DCACHE); - - /* now restart firmware */ + cache_fake(HIJACK_CACHE_HACK_INITTASK_ADDR, (uint32_t) my_init_task, TYPE_DCACHE); + + /* now start main firmware */ void (*reset)(void) = (void*) ROMBASEADDR; reset(); #else @@ -680,10 +680,31 @@ } #endif +#if defined(CONFIG_7D_FIR_MASTER) +uint32_t (*Master_RequestRPC) (uint32_t id, uint32_t data, uint32_t length, uint32_t unk2) = 0xFF838F50; +uint32_t (*Master_RegisterRPCHandler) (uint32_t, uint32_t) = 0xFF838EA0; + +uint32_t master_rpc_handler (uint32_t parm1, uint32_t parm2, uint32_t parm3, uint32_t parm4) +{ + uint32_t temp = 0xDEADBEEF; + + Master_RequestRPC(0x28EF, &temp, 0x04, 0); + master_write_memory("ROM1.BIN", 0xf8000000, 0x00800000); + + return 0; +} + +void master_ml_init() +{ + master_msleep(5000); + Master_RegisterRPCHandler(0x28EE, &master_rpc_handler); +} +#endif // flag set to 1 when gui_main_task started to process messages from queue int gui_init_done = 0; +extern int __attribute__ ((long_call)) master_init_task( int a, int b, int c, int d ); /** Initial task setup. * * This is called instead of the task at 0xFF811DBC. @@ -693,6 +714,16 @@ int my_init_task(int a, int b, int c, int d) { +#if defined(CONFIG_7D_FIR_MASTER) + cache_fake(HIJACK_CACHE_HACK_BSS_END_ADDR, HIJACK_CACHE_HACK_BSS_END_INSTR, TYPE_ICACHE); + + int ans = master_init_task(a,b,c,d); + + master_task_create("ml_init", 0x18, 0x4000, &master_ml_init, 0 ); + + return ans; +#else + #ifdef ARMLIB_OVERFLOWING_BUFFER // An overflow in Canon code may write a zero right in the middle of ML code unsigned int *backup_address = 0; @@ -707,6 +738,15 @@ } #endif +#ifdef HIJACK_CACHE_HACK + /* as we do not return in the middle of te init task as in the hijack-through-copy method, we have to install the hook here */ + task_dispatch_hook = my_task_dispatch_hook; + + /* now patch init task and continue execution */ + cache_fake(HIJACK_CACHE_HACK_BSS_END_ADDR, HIJACK_CACHE_HACK_BSS_END_INSTR, TYPE_ICACHE); + + int ans = init_task(a,b,c,d); +#else // Call their init task #ifdef CONFIG_550D int ans = init_task_patched_for_550D(a,b,c,d); @@ -714,13 +754,10 @@ int ans = init_task_patched_for_600D(a,b,c,d); #elif defined(CONFIG_1100D) int ans = init_task_patched_for_1100D(a,b,c,d); - #elif defined(CONFIG_7D) - task_dispatch_hook = my_task_dispatch_hook; - cache_fake(0xFF011F2C, 0xE3A01732, TYPE_ICACHE); - int ans = init_task(a,b,c,d); #else int ans = init_task(a,b,c,d); #endif +#endif #ifdef ARMLIB_OVERFLOWING_BUFFER // Restore the overwritten value, if any @@ -803,9 +840,11 @@ additional_version[7] = '\0'; return ans; } + task_create("ml_init", 0x1e, 0x4000, my_big_init_task, 0 ); return ans; #endif // !CONFIG_EARLY_PORT +#endif } #ifdef CONFIG_5D3 diff -r e6fae444c60b src/chdk-gui_draw.c --- a/src/chdk-gui_draw.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/chdk-gui_draw.c Fri Oct 05 19:11:11 2012 +0200 @@ -69,7 +69,7 @@ } while (dx<=dy); } -#ifdef CONFIG_60D // only used for level indicator +#if defined(CONFIG_60D) || defined(CONFIG_7D) // only used for level indicator #include "cordic-16bit.h" diff -r e6fae444c60b src/debug.c --- a/src/debug.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/debug.c Fri Oct 05 19:11:11 2012 +0200 @@ -1557,7 +1557,7 @@ PROP_INT(PROP_ICU_UILOCK, uilock); -#ifdef CONFIG_60D +#if defined(CONFIG_60D) || defined(CONFIG_7D) struct rolling_pitching { @@ -2608,6 +2608,7 @@ .submenu_width = 650, //.essential = FOR_MOVIE | FOR_PHOTO, .children = (struct menu_entry[]) { + #ifndef CONFIG_7D_MINIMAL #ifndef CONFIG_5D3_MINIMAL // will change some settings and you can't restore them #ifndef CONFIG_5DC // many things incompatible, mostly liveview stuff { @@ -2624,6 +2625,7 @@ .priv = stress_test_random_task, .help = "A thorough test which randomly enables functions from menu. " }, + #endif { .name = "Menu backend test (infinite)", .select = (void(*)(void*,int))run_in_separate_task, @@ -2771,7 +2773,7 @@ //.essential = FOR_MOVIE | FOR_PHOTO, }, #endif - #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) + #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) || defined(CONFIG_7D) #ifndef CONFIG_5D3_MINIMAL { .name = "Battery remaining", @@ -3571,7 +3573,7 @@ #else if (event->param == BGMT_PRESS_SET) set_pressed = 1; #endif - #if defined(CONFIG_5D2) || defined(CONFIG_50D) + #if defined(CONFIG_5D2) || defined(CONFIG_50D) || defined(CONFIG_7D) if (event->param == BGMT_JOY_CENTER) joy_center_pressed = 1; if (event->param == BGMT_UNPRESS_UDLR) joy_center_pressed = 0; #endif diff -r e6fae444c60b src/focus.c --- a/src/focus.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/focus.c Fri Oct 05 19:11:11 2012 +0200 @@ -1257,7 +1257,11 @@ { .name = "Trap Focus", .priv = &trap_focus, + #if defined(CONFIG_7D_MINIMAL) + .max = 1, + #else .max = 2, + #endif .display = trap_focus_display, .help = "Takes a picture when the subject comes in focus. MF only.", //.essential = FOR_PHOTO, @@ -1267,6 +1271,7 @@ }; static struct menu_entry focus_menu[] = { #if !defined(CONFIG_5DC) +#if !defined(CONFIG_7D_MINIMAL) { .name = "Follow Focus", .priv = &follow_focus, @@ -1430,13 +1435,14 @@ MENU_EOL }, }, +#endif // CONFIG_7D_MINIMAL { .name = "Focus distance", .display = display_lens_hyperfocal, .help = "Focus distance and DOF info (read-only)", //.essential = FOR_PHOTO | FOR_MOVIE, }, -#endif +#endif // CONFIG_5DC }; diff -r e6fae444c60b src/fps-engio.c --- a/src/fps-engio.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/fps-engio.c Fri Oct 05 19:11:11 2012 +0200 @@ -37,7 +37,7 @@ #include "config.h" #include "math.h" -#ifdef CONFIG_5D3_MINIMAL +#if defined(CONFIG_5D3_MINIMAL) || defined(CONFIG_7D_MINIMAL) #include "disable-this-module.h" #endif diff -r e6fae444c60b src/hdr.c --- a/src/hdr.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/hdr.c Fri Oct 05 19:11:11 2012 +0200 @@ -279,7 +279,9 @@ } +#if !defined(CONFIG_7D) INIT_FUNC("hdr", hdr_init); +#endif void hdr_mvr_log(char* mvr_logfile_buffer) { diff -r e6fae444c60b src/lv-img-engio.c --- a/src/lv-img-engio.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/lv-img-engio.c Fri Oct 05 19:11:11 2012 +0200 @@ -690,7 +690,9 @@ static void lv_img_init() { + #if !defined(CONFIG_7D_MINIMAL) menu_add( "Movie", lv_img_menu, COUNT(lv_img_menu) ); + #endif #ifdef CONFIG_DIGIC_POKE menu_add( "Debug", dbg_menu, COUNT(dbg_menu) ); #endif diff -r e6fae444c60b src/movtweaks.c --- a/src/movtweaks.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/movtweaks.c Fri Oct 05 19:11:11 2012 +0200 @@ -1227,7 +1227,7 @@ .display = rec_notify_print, #if defined(CONFIG_5D2) || defined(CONFIG_500D) .select = menu_quinternary_toggle, // beeps and blue led - #elif defined(CONFIG_600D) || defined(CONFIG_5D3) + #elif defined(CONFIG_600D) || defined(CONFIG_5D3) || defined(CONFIG_7D) .select = menu_ternary_toggle, // no beeps, no blue led #else .select = menu_quaternary_toggle, // beeps are OK, no blue led @@ -1236,7 +1236,7 @@ //.essential = FOR_MOVIE, //~ .edit_mode = EM_MANY_VALUES_LV, }, - #if !defined(CONFIG_50D) && !defined(CONFIG_5D3) + #if !defined(CONFIG_50D) && !defined(CONFIG_5D3) && !defined(CONFIG_7D) { .name = "Movie REC key", .priv = &movie_rec_key, @@ -1263,7 +1263,7 @@ .display = zebra_nrec_display, .help = "You can disable zebra during recording." },*/ - #if !defined(CONFIG_50D) && !defined(CONFIG_5D3) + #if !defined(CONFIG_50D) && !defined(CONFIG_5D3) && !defined(CONFIG_7D) { .name = "Force LiveView", .priv = &enable_liveview, @@ -1283,7 +1283,7 @@ //.essential = FOR_MOVIE, }, #endif -#if !defined(CONFIG_50D) && !defined(CONFIG_500D) && !defined(CONFIG_5D3) +#if !defined(CONFIG_50D) && !defined(CONFIG_500D) && !defined(CONFIG_5D3) && !defined(CONFIG_7D) { .name = "Shutter Lock", .priv = &shutter_lock, @@ -1293,7 +1293,7 @@ //.essential = FOR_MOVIE, }, #endif -#ifndef CONFIG_500D +#if !defined(CONFIG_500D) && !defined(CONFIG_7D) { .name = "Gradual Expo.", .priv = &smooth_iso, @@ -1314,6 +1314,7 @@ }, }, #endif +#if !defined(CONFIG_7D_MINIMAL) { .name = "Clip length", .priv = &movie_cliplen, @@ -1329,6 +1330,7 @@ .choices = (const char *[]) {"OFF", "ON"}, .help = "Autostart recording as soon as the camera wakes up due to halfshutter press." }, +#endif }; struct menu_entry expo_override_menus[] = { diff -r e6fae444c60b src/propvalues.c --- a/src/propvalues.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/propvalues.c Fri Oct 05 19:11:11 2012 +0200 @@ -60,9 +60,9 @@ bool is_movie_mode() { - #if defined(CONFIG_50D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) + #if defined(CONFIG_50D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) || defined(CONFIG_7D) return lv && lv_movie_select == LVMS_ENABLE_MOVIE - #ifndef CONFIG_50D + #if !defined(CONFIG_50D) && !defined(CONFIG_7D) && expsim == 2 // movie enabled, but photo display is considered photo mode #endif ; diff -r e6fae444c60b src/reboot.c --- a/src/reboot.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/reboot.c Fri Oct 05 19:11:11 2012 +0200 @@ -155,8 +155,19 @@ #if defined(CONFIG_5D2) || defined(CONFIG_50D) || defined(CONFIG_500D) *(int*)0xC02200BC = 0x46; // CF card LED on #elif defined(CONFIG_7D) - *(int*)0xC0A00024 = 0x80000010; // send SSTAT for master processor, so it is in right state for rebooting - *(int*)0xC022D06C = 0x00138800; // CF card LED on + + #if !defined(CONFIG_7D_FIR_MASTER) && !defined(CONFIG_7D_FIR_SLAVE) + *(volatile int*)0xC022D06C = 0x00138800; // CF card LED on + /* clear IPC interrupt lines */ + *(volatile int*)0xC0A0000C = *(volatile int*)0xC0A00008; + /* send command to master processor, so it is in right state for rebooting */ + *(volatile int*)0xC0A00024 = 0x80000010; + /* wait for interrupt */ + asm("MCR p15, 0, R0, c7, c0, 4\n":::"r0"); + + /* clear IPC interrupt lines */ + *(volatile int*)0xC0A0000C = *(volatile int*)0xC0A00008; + #endif #elif defined(CONFIG_550D) || defined(CONFIG_60D) || defined(CONFIG_600D) || defined(CONFIG_1100D) *(int*)0xC0220134 = 0x46; // SD card LED on #elif defined(CONFIG_40D) diff -r e6fae444c60b src/shoot.c --- a/src/shoot.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/shoot.c Fri Oct 05 19:11:11 2012 +0200 @@ -4942,7 +4942,7 @@ .icon_type = IT_SUBMENU, .help = "Disable x5 or x10, boost contrast/sharpness...", .children = (struct menu_entry[]) { - #ifndef CONFIG_5D3_MINIMAL + #if !defined(CONFIG_5D3_MINIMAL) && !defined(CONFIG_7D_MINIMAL) { .name = "Zoom x5", .priv = &zoom_disable_x5, @@ -6186,7 +6186,7 @@ BMP_LOCK ( display_shooting_info_lv(); ) - #if !defined(CONFIG_50D) && !defined(CONFIG_500D) && !defined(CONFIG_5D2) && !defined(CONFIG_5D3) + #if !defined(CONFIG_50D) && !defined(CONFIG_500D) && !defined(CONFIG_5D2) && !defined(CONFIG_5D3) && !defined(CONFIG_7D) if (is_movie_mode() && !ae_mode_movie && lv_dispsize == 1) { static int ae_warned = 0; @@ -6778,7 +6778,7 @@ { set_maindial_sem = create_named_semaphore("set_maindial_sem", 1); -#ifndef CONFIG_5D3_MINIMAL +#if !defined(CONFIG_5D3_MINIMAL) && !defined(CONFIG_7D_MINIMAL) menu_add( "Shoot", shoot_menus, COUNT(shoot_menus) ); #ifndef CONFIG_5DC @@ -6802,7 +6802,9 @@ #endif } +#if !defined(CONFIG_7D_MINIMAL) INIT_FUNC("shoot", shoot_init); +#endif void iso_refresh_display() // in photo mode diff -r e6fae444c60b src/state-object.c --- a/src/state-object.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/state-object.c Fri Oct 05 19:11:11 2012 +0200 @@ -10,6 +10,10 @@ #include "state-object.h" #include "property.h" +#ifdef CONFIG_7D +#include "cache_hacks.h" +#endif + #ifdef CONFIG_550D #define DISPLAY_STATE DISPLAY_STATEOBJ #define INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER 19 @@ -191,6 +195,11 @@ #ifdef EMState stateobj_start_spy(EMState); #endif + + #ifdef CONFIG_7D + /* will work, but this is LV only - not recorded */ + // cache_fake(0xFF10D2F4, BL_INSTR(0xFF10D2F4, &vsync_func), TYPE_ICACHE); + #endif } INIT_FUNC("state_init", state_init); diff -r e6fae444c60b src/tasks.h --- a/src/tasks.h Thu Oct 04 14:58:02 2012 +0300 +++ b/src/tasks.h Fri Oct 05 19:11:11 2012 +0200 @@ -37,28 +37,31 @@ { uint32_t off_0x00; // always 0? uint32_t off_0x04; // stack maybe? - uint32_t off_0x08; // flags? + uint32_t run_prio; // flags? void * entry; // off 0x0c uint32_t arg; // off_0x10; - uint32_t off_0x14; + uint32_t waitObjId; uint32_t off_0x18; - uint32_t off_0x1c; - uint32_t off_0x20; + uint32_t stackStartAddr; + uint32_t stackSize; char * name; // off_0x24; uint32_t off_0x28; uint32_t off_0x2c; - uint32_t off_0x30; + uint32_t self; uint32_t off_0x34; uint32_t off_0x38; uint32_t off_0x3c; - uint32_t off_0x40; + uint32_t taskId; uint32_t off_0x44; uint8_t off_0x48; - uint8_t off_0x49; + uint8_t currentState; uint8_t off_0x4a; - uint8_t exited; // off_0x4b; + uint8_t yieldRequest; + uint8_t off_0x4c; + uint8_t sleepReason; + uint8_t off_0x4e; + uint8_t off_0x4f; struct context * context; // off 0x4C - uint32_t pad_1[12]; }; diff -r e6fae444c60b src/tweaks.c --- a/src/tweaks.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/tweaks.c Fri Oct 05 19:11:11 2012 +0200 @@ -2976,6 +2976,7 @@ .edit_mode = EM_MANY_VALUES_LV, //.essential = FOR_LIVEVIEW, }, + #if !defined(CONFIG_7D_MINIMAL) { .name = "LV display gain", .display = display_gain_print, @@ -2983,6 +2984,7 @@ .help = "Boost LiveView display gain, for night vision (photo mode).", .edit_mode = EM_MANY_VALUES_LV, }, + #endif { .name = "Color scheme ", .priv = &bmp_color_scheme, @@ -3022,7 +3024,7 @@ .max = 1, .help = "Emphasizes camera shake on LiveView display.", },*/ - #ifndef CONFIG_5D3_MINIMAL + #if !defined(CONFIG_5D3_MINIMAL) && !defined(CONFIG_7D_MINIMAL) { .name = "Defishing", .priv = &defish_preview, @@ -3350,9 +3352,9 @@ { extern struct menu_entry tweak_menus_shoot[]; menu_add( "Prefs", play_menus, COUNT(play_menus) ); -#ifndef CONFIG_5DC +#if !defined(CONFIG_5DC) && !defined(CONFIG_7D_MINIMAL) menu_add( "Prefs", tweak_menus_shoot, 1 ); - #ifndef CONFIG_5D3_MINIMAL + #if !defined(CONFIG_5D3_MINIMAL) && !defined(CONFIG_7D_MINIMAL) menu_add( "Prefs", key_menus, COUNT(key_menus) ); #endif #endif diff -r e6fae444c60b src/vram.c --- a/src/vram.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/vram.c Fri Oct 05 19:11:11 2012 +0200 @@ -132,6 +132,21 @@ void vram_params_update_if_dirty() { +#if defined(CONFIG_7D) + /* it has to be checked how to know (by properties) when dma size is correct again. + * for now force updating every time LV dma register changes. + * (but this might be a good idea to do anyway to make sure we catch all changes) + */ + static uint32_t last_lv_size = 0; + uint32_t lv_size = shamem_read(REG_EDMAC_WRITE_LV_ADDR + 8); + + if(lv_size != last_lv_size) + { + vram_params_dirty = 1; + last_lv_size = lv_size; + } +#endif + if (vram_params_dirty) { BMP_LOCK( diff -r e6fae444c60b src/zebra.c --- a/src/zebra.c Thu Oct 04 14:58:02 2012 +0300 +++ b/src/zebra.c Fri Oct 05 19:11:11 2012 +0200 @@ -188,6 +188,10 @@ { if (is_movie_mode()) return 1; +#if defined(CONFIG_7D) + return 1; +#endif + extern int digic_iso_gain_photo; return expsim && digic_iso_gain_photo == 1024; } @@ -3050,7 +3054,11 @@ int handle_transparent_overlay(struct event * event) { +#if defined(CONFIG_7D) + if (transparent_overlay && event->param == BGMT_PRESS_RAW_JPEG && PLAY_OR_QR_MODE) +#else if (transparent_overlay && event->param == BGMT_LV && PLAY_OR_QR_MODE) +#endif { schedule_transparent_overlay(); return 0; @@ -3287,7 +3295,7 @@ .choices = (const char *[]) {"1st deriv.", "2nd deriv.", "Nyquist H"}, .help = "Contrast detection method. 2: more accurate, 1: less noisy.", },*/ - #ifndef CONFIG_5D3_MINIMAL + #if !defined(CONFIG_5D3_MINIMAL) && !defined(CONFIG_7D_MINIMAL) { .name = "Display type", .priv = &focus_peaking_disp, @@ -3438,7 +3446,11 @@ .priv = &transparent_overlay, .display = transparent_overlay_display, .select = menu_binary_toggle, +#if defined(CONFIG_7D) + .help = "Overlay image in LM. In PLAY mode, press RAW/JPEG btn.", +#else .help = "Overlay any image in LiveView. In PLAY mode, press LV btn.", +#endif //.essential = FOR_PLAYBACK, }, #endif @@ -3591,7 +3603,7 @@ }; struct menu_entry level_indic_menus[] = { - #ifdef CONFIG_60D + #if defined(CONFIG_60D) || defined(CONFIG_7D) { .name = "Level Indicator", .priv = &electronic_level, @@ -3638,7 +3650,7 @@ }*/ }; -#if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) +#if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) || defined(CONFIG_7D) void batt_display( void * priv, int x, @@ -3722,7 +3734,7 @@ .help = "Turn off GlobalDraw when idle, to save some CPU cycles.", //~ .edit_mode = EM_MANY_VALUES, }, - #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) + #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) || defined(CONFIG_7D) { .name = "Battery remaining", .display = batt_display, @@ -5367,7 +5379,7 @@ BMP_LOCK( if (lv) spotmeter_step(); ) prev_s = s; - #ifdef CONFIG_60D + #if defined(CONFIG_60D) || defined(CONFIG_7D) if (electronic_level && k % 8 == 5) BMP_LOCK( if (lv) show_electronic_level(); ) #endif @@ -5725,10 +5737,12 @@ //~ menu_add( "Debug", livev_dbg_menus, COUNT(livev_dbg_menus) ); //~ menu_add( "Movie", movie_menus, COUNT(movie_menus) ); //~ menu_add( "Config", cfg_menus, COUNT(cfg_menus) ); -#ifndef CONFIG_5D3_MINIMAL +#if !defined(CONFIG_5D3_MINIMAL) +#ifndef CONFIG_7D_MINIMAL #ifndef CONFIG_5DC menu_add( "Prefs", powersave_menus, COUNT(powersave_menus) ); #endif +#endif menu_add( "Display", level_indic_menus, COUNT(level_indic_menus) ); #endif }