diff -r 9dbfdc26c53f platform/7D.203/consts.h --- a/platform/7D.203/consts.h Sat Oct 06 16:56:32 2012 +0200 +++ b/platform/7D.203/consts.h Sun Oct 07 00:01:20 2012 +0200 @@ -199,9 +199,9 @@ #define GUIMODE_ML_MENU (recording ? 0 : lv ? 45 : 2) // outside LiveView, Canon menu is a good choice - // position for displaying clock outside LV - #define DISPLAY_CLOCK_POS_X 435 - #define DISPLAY_CLOCK_POS_Y 452 +// position for displaying clock outside LV +#define DISPLAY_CLOCK_POS_X 167 +#define DISPLAY_CLOCK_POS_Y 422 #define MENU_DISP_ISO_POS_X 500 #define MENU_DISP_ISO_POS_Y 27 diff -r 9dbfdc26c53f platform/7D.203/misc.c --- a/platform/7D.203/misc.c Sat Oct 06 16:56:32 2012 +0200 +++ b/platform/7D.203/misc.c Sun Oct 07 00:01:20 2012 +0200 @@ -34,12 +34,12 @@ iso_refresh_display(); - bg = bmp_getpixel(15, 430); + bg = bmp_getpixel(285, 417); fnt = FONT(FONT_MED, COLOR_FG_NONLV, bg); hdr_display_status(fnt); - bmp_printf(fnt, 290, 415, "%d%% ", GetBatteryLevel()); + bmp_printf(fnt, 315, 410, " %d%% ", GetBatteryLevel()); //~ bmp_printf(fnt, 400, 450, "Flash:%s", //~ strobo_firing == 0 ? " ON" : @@ -47,6 +47,8 @@ //~ strobo_firing < 2 && flash_and_no_flash ? "/T" : " " //~ ); + bg = bmp_getpixel(40, 460); + fnt = FONT(FONT_MED, COLOR_FG_NONLV, bg); bmp_printf(fnt, 40, 460, get_mlu() ? "MLU" : " "); //~ display_lcd_remote_info(); @@ -85,17 +87,17 @@ // called every second void RefreshBatteryLevel_1Hz() { - return; // probably works, but let's play safe - static int k = 0; k++; + #if 0 // probably works, but let's play safe if (k % 10 == 0 && lens_info.job_state == 0) // who knows what race conditions are here... I smell one :) { int x = 31; prop_request_change(PROP_BATTERY_REPORT, &x, 1); // see PROP_Request PROP_BATTERY_REPORT } + #endif msleep(50); diff -r 9dbfdc26c53f platform/7D.203/stubs.S --- a/platform/7D.203/stubs.S Sat Oct 06 16:56:32 2012 +0200 +++ b/platform/7D.203/stubs.S Sun Oct 07 00:01:20 2012 +0200 @@ -39,6 +39,8 @@ NSTUB(0xFF83976C, master_msleep) NSTUB(0xFF839820, master_task_create) NSTUB(0xFF81AD28, master_write_memory) + +NSTUB(0xFF0705E4, set_brightness_registers) NSTUB(0xFF205FA8, AcquireRecursiveLock) // AJ_KernelDry_KerRLock.c NSTUB(0xff07cd24, AllocateMemory) NSTUB(0xff2ffd3c, CreateDialogBox) diff -r 9dbfdc26c53f src/bitrate.c --- a/src/bitrate.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/bitrate.c Sun Oct 07 00:01:20 2012 +0200 @@ -288,6 +288,18 @@ int fsg = free_space_32k >> 15; int fsgr = free_space_32k - (fsg << 15); int fsgf = (fsgr * 10) >> 15; + +#if defined(CONFIG_7D) + int x = DISPLAY_CLOCK_POS_X; + int y = DISPLAY_CLOCK_POS_Y - font_med.height - 14; + bmp_printf( + FONT(SHADOW_FONT(FONT_LARGE), COLOR_FG_NONLV, bmp_getpixel(x,y)), + x, y, + "%d.%dG", + fsg, + fsgf + ); +#else int x = time_indic_x + 2 * font_med.width; int y = 452; bmp_printf( @@ -297,6 +309,7 @@ fsg, fsgf ); +#endif } void time_indicator_show() diff -r 9dbfdc26c53f src/boot-hack.c --- a/src/boot-hack.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/boot-hack.c Sun Oct 07 00:01:20 2012 +0200 @@ -689,8 +689,7 @@ uint32_t temp = 0xDEADBEEF; Master_RequestRPC(0x28EF, &temp, 0x04, 0); - master_write_memory("ROM1.BIN", 0xf8000000, 0x00800000); - + return 0; } @@ -704,7 +703,98 @@ // 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 ); +#if defined(CONFIG_7D_MINIMAL) +int lcd_fade(int start, int end, int step, int delay) +{ + int old = *(int*)0xC0238004; + + if(start < 0) + { + start = old; + } + if(end < 0) + { + end = old; + } + + int brightness = start; + + brightness = COERCE(brightness, 0, 0xFF); + + if(end < brightness && step > 0) + { + step = -step; + } + + if(delay) + { + while((step > 0 && brightness < end) || (step < 0 && brightness > end)) + { + msleep(delay); + brightness += step; + *(int*)0xC0238004 = COERCE(brightness, 0, 0xFF); + } + } + else + { + *(int*)0xC0238004 = COERCE(end, 0, 0xFF); + } + + return old; +} + +uint32_t bootup_screen_finished = 0; + +void show_early_bootup_screen() +{ + struct bmp_file_t * doc = (void*) -1; + + if(bootup_screen_finished) + { + return; + } + + doc = bmp_load(CARD_DRIVE "ML/DATA/SPLASH.BMP", 1); + + if (!doc) + { + return; + } + + msleep(200); + + /* make sure canon does not change front buffer */ + canon_gui_disable_front_buffer(); + + /* fade out and fade in ML logo */ + lcd_fade(-1, 0, 8, 30); + bmp_draw_scaled_ex(doc, 0, 0, 720, 480, 0); + lcd_fade(-1, 0xFF, 8, 30); + FreeMemory(doc); + + for(int loop = 0; (loop < 100) && !bootup_screen_finished && canon_gui_front_buffer_disabled(); loop++) + { + msleep(100); + } + + /* canon forced displaying or LV is active, abort */ + if(!canon_gui_front_buffer_disabled()) + { + set_brightness_registers(); + return; + } + + /* now all the way back */ + lcd_fade(-1, 0, 8, 30); + bmp_idle_copy(1, 1); + canon_gui_enable_front_buffer(1); + + /* fade in then set brightness canon wants to have */ + lcd_fade(-1, 0xb0, 8, 30); + set_brightness_registers(); +} +#endif + /** Initial task setup. * * This is called instead of the task at 0xFF811DBC. @@ -715,6 +805,7 @@ my_init_task(int a, int b, int c, int d) { #if defined(CONFIG_7D_FIR_MASTER) + extern int __attribute__ ((long_call)) master_init_task( int a, int b, int c, int d ); 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); @@ -822,7 +913,11 @@ msleep(200); // at this point, gui_main_start should be started and should be able to tell whether SET was pressed at startup - + +#if defined(CONFIG_7D_MINIMAL) // only in FIR mode + show_early_bootup_screen(); + bootup_screen_finished = 1; +#else if (magic_off_request) { while (!DISPLAY_IS_ON) msleep(100); @@ -840,7 +935,8 @@ additional_version[7] = '\0'; return ans; } - +#endif + task_create("ml_init", 0x1e, 0x4000, my_big_init_task, 0 ); return ans; #endif // !CONFIG_EARLY_PORT diff -r 9dbfdc26c53f src/gui-common.c --- a/src/gui-common.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/gui-common.c Sun Oct 07 00:01:20 2012 +0200 @@ -104,6 +104,10 @@ return 1; } +#if defined(CONFIG_7D_MINIMAL) +extern int bootup_screen_finished; +#endif + int handle_common_events_startup(struct event * event) { extern int ml_gui_initialized; @@ -114,7 +118,24 @@ extern int ml_started; extern int magic_off_request; if (!ml_started) { + #if defined(CONFIG_7D_MINIMAL) + if (event->param == BGMT_PRESS_SET || + event->param == BGMT_MENU || + event->param == BGMT_TRASH || + event->param == BGMT_PLAY || + event->param == BGMT_PRESS_HALFSHUTTER || + event->param == BGMT_PRESS_UP || + event->param == BGMT_PRESS_DOWN || + event->param == BGMT_PRESS_LEFT || + event->param == BGMT_PRESS_RIGHT || + event->param == BGMT_WHEEL_UP || + event->param == BGMT_WHEEL_DOWN || + event->param == BGMT_WHEEL_LEFT || + event->param == BGMT_WHEEL_RIGHT + ) { bootup_screen_finished = 1; return 0;} + #else if (event->param == BGMT_PRESS_SET) { magic_off_request = 1; return 0;} // don't load ML + #endif #ifdef CONFIG_60D if (event->param == BGMT_MENU) return 0; // otherwise would interfere with swap menu-erase @@ -143,6 +164,12 @@ { // common to most cameras // there may be exceptions +#if defined(CONFIG_7D_MINIMAL) + if(!bootup_screen_finished) + { + return 1; + } +#endif // these are required for correct shutdown from powersave mode if (event->param == GMT_GUICMD_START_AS_CHECK || diff -r 9dbfdc26c53f src/lens.c --- a/src/lens.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/lens.c Sun Oct 07 00:01:20 2012 +0200 @@ -759,7 +759,7 @@ // battery indicator int xr = x_origin + 612 - font_large.width - 4; - #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) + #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) || defined(CONFIG_7D) int bat = GetBatteryLevel(); #else int bat = battery_level_bars == 0 ? 5 : battery_level_bars == 1 ? 30 : 100; @@ -767,7 +767,7 @@ int col = battery_level_bars == 0 ? COLOR_RED : battery_level_bars == 1 ? COLOR_YELLOW : - #if defined(CONFIG_60D) || defined(CONFIG_5D2) + #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_7D) bat <= 70 ? COLOR_WHITE : #endif COLOR_GREEN1; diff -r 9dbfdc26c53f src/menu.c --- a/src/menu.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/menu.c Sun Oct 07 00:01:20 2012 +0200 @@ -2150,7 +2150,7 @@ case BGMT_UNPRESS_SET: return 0; // block Canon menu redraws -#ifdef CONFIG_5D3 +#if defined(CONFIG_5D3) || defined(CONFIG_7D) case BGMT_JOY_CENTER: #endif case BGMT_PRESS_SET: diff -r 9dbfdc26c53f src/shoot.c --- a/src/shoot.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/shoot.c Sun Oct 07 00:01:20 2012 +0200 @@ -240,7 +240,7 @@ if (intervalometer_running && lens_info.job_state == 0 && !gui_menu_shown() && !get_halfshutter_pressed()) info_led_blink(1, 50, 0); - #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) + #if defined(CONFIG_60D) || defined(CONFIG_5D2) || defined(CONFIG_5D3) || defined(CONFIG_7D) RefreshBatteryLevel_1Hz(); #endif @@ -5978,6 +5978,7 @@ static void display_expsim_status() { +#if !defined(CONFIG_7D_MINIMAL) get_yuv422_vram(); static int prev_expsim = 0; int x = 610 + font_med.width; @@ -5993,6 +5994,7 @@ bmp_printf( FONT(FONT_MED, COLOR_WHITE, 0), x, y, " " ); } prev_expsim = expsim; +#endif } diff -r 9dbfdc26c53f src/vram.c --- a/src/vram.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/vram.c Sun Oct 07 00:01:20 2012 +0200 @@ -130,6 +130,10 @@ afframe_set_dirty(); } +#if defined(CONFIG_7D) +static uint32_t last_lv_size = 0; +#endif + void vram_params_update_if_dirty() { #if defined(CONFIG_7D) @@ -137,7 +141,6 @@ * 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) @@ -268,7 +271,11 @@ #else if (lv) // get image size from DMA register { + #if defined(CONFIG_7D) + uint32_t lv_size = last_lv_size; + #else uint32_t lv_size = shamem_read(REG_EDMAC_WRITE_LV_ADDR + 8); + #endif vram_lv.pitch = lv_size & 0xFFFF; vram_lv.width = vram_lv.pitch / 2; vram_lv.height = ((lv_size >> 16) & 0xFFFF) + 1; @@ -345,7 +352,7 @@ int bar_x = 0; int bar_y = is_movie_mode() && video_mode_resolution == 1 ? os.off_169 : 0; off_43+=0; // bypass warning - #elif defined(CONFIG_500D) + #elif defined(CONFIG_500D) || defined(CONFIG_7D) int bar_x = 0; int bar_y = 0; off_43+=0; // bypass warning diff -r 9dbfdc26c53f src/zebra.c --- a/src/zebra.c Sat Oct 06 16:56:32 2012 +0200 +++ b/src/zebra.c Sun Oct 07 00:01:20 2012 +0200 @@ -5362,8 +5362,8 @@ //~ } else { - #ifdef CONFIG_5D3 - BMP_LOCK( if (lv) draw_zebra_and_focus(focus_peaking==0 || k % 2 == 1, 1) ) // DIGIC 5 has more CPU power + #if defined(CONFIG_5D3) || defined(CONFIG_7D) + BMP_LOCK( if (lv) draw_zebra_and_focus(focus_peaking==0 || k % 2 == 1, 1) ) // DIGIC 5 and dual-DIGIC has more CPU power #else // luma zebras are fast // also, if peaking is off, zebra can be faster