diff --git a/platform/1100D.105/internals.h b/platform/1100D.105/internals.h index aaf5733c2..ec91e9562 100644 --- a/platform/1100D.105/internals.h +++ b/platform/1100D.105/internals.h @@ -6,6 +6,8 @@ /** The 1100D port is pretty stable, so I think we can enable properties safely. **/ #define CONFIG_PROP_REQUEST_CHANGE +#define CONFIG_HELLO_WORLD + /** * State object hooks are pieces of code that run in Canon tasks (state objects). See state-object.c . * They might slow down Canon code, so here you can disable all of them (useful for debugging or early ports) diff --git a/platform/1100D.105/internals.h.cust b/platform/1100D.105/internals.h.cust new file mode 100644 index 000000000..34d92f963 --- /dev/null +++ b/platform/1100D.105/internals.h.cust @@ -0,0 +1,12 @@ +#define CONFIG_EARLY_PORT +#define CONFIG_HELLO_WORLD + + +#define CONFIG_NEW_TASK_STRUCTS +#define CONFIG_TASK_STRUCT_V2 +#define CONFIG_TASK_ATTR_STRUCT_V2 + +#define CONFIG_DIGIC_IV + +#define CONFIG_ALLOCATE_MEMORY_POOL +#define FEATURE_FLASH_TWEAKS \ No newline at end of file diff --git a/platform/2000D.110-my/Makefile b/platform/2000D.110-my/Makefile new file mode 100644 index 000000000..58fa0b44a --- /dev/null +++ b/platform/2000D.110-my/Makefile @@ -0,0 +1,4 @@ +#Makefile for 2000D / T7 / 1500D + +MODEL=2000D +include ../Makefile.platform diff --git a/platform/2000D.110-my/Makefile.platform.default b/platform/2000D.110-my/Makefile.platform.default new file mode 100644 index 000000000..03f92d72d --- /dev/null +++ b/platform/2000D.110-my/Makefile.platform.default @@ -0,0 +1,12 @@ +# 2000D 1.1.0 + +CANON_NAME_FIR = CCF26110.FIR +FIRMWARE_ID = 0x80000432 + +# 32MB ROM, like 1300D +ROMBASEADDR = 0xFE0C0000 +PLATFORM_ARCH = armv5te +# Load ML at the end of the AllocateMemory pool +# Default 0x2D0000 - 0xD00000, patched to 0x2D0000 - 0xC80000 (512K for us). +RESTARTSTART = 0xC80000 +ML_BOOT_OBJ = boot-d45-ch.o diff --git a/platform/2000D.110-my/Makefile.setup.default b/platform/2000D.110-my/Makefile.setup.default new file mode 100644 index 000000000..bf91e900e --- /dev/null +++ b/platform/2000D.110-my/Makefile.setup.default @@ -0,0 +1,7 @@ +#Makefile for 2000D + +TOP_DIR=../.. +ML_AF_PATTERNS_OBJ = n + +# 2000D_101.sym is to long +ML_MODULES_SYM_NAME=t7_$(FW_VERSION).sym diff --git a/platform/2000D.110-my/consts.h b/platform/2000D.110-my/consts.h new file mode 100644 index 000000000..aa0810734 --- /dev/null +++ b/platform/2000D.110-my/consts.h @@ -0,0 +1,23 @@ +/* + * 2000D 1.1.0 consts + */ + +#define CARD_LED_ADDRESS 0xC0220134 // http://magiclantern.wikia.com/wiki/Led_addresses +#define LEDON 0x46 +#define LEDOFF 0x44 + +#define HIJACK_CACHE_HACK + +#define HIJACK_CACHE_HACK_BSS_END_ADDR 0xfe0c1b74 +#define HIJACK_CACHE_HACK_BSS_END_INSTR 0xE3A01732 // should be the correct INSTRUCTION MOV R1, 0xc80000 +#define HIJACK_CACHE_HACK_INITTASK_ADDR 0xfe0c3b34 + +#define HIJACK_INSTR_BL_CSTART 0xFE0C0638 +#define HIJACK_INSTR_BSS_END 0xfe0c3b24 +#define HIJACK_FIXBR_BZERO32 0xfe0c3a6c +#define HIJACK_FIXBR_CREATE_ITASK 0xfe0c3b0c +#define HIJACK_INSTR_MY_ITASK 0xfe0c3b34 + +#define HIJACK_TASK_ADDR 0x31170 +#define DISPLAY_STATEOBJ (*(struct state_object **)0x318B8) +#define DISPLAY_IS_ON (DISPLAY_STATEOBJ->current_state != 0) diff --git a/platform/2000D.110-my/features.h b/platform/2000D.110-my/features.h new file mode 100644 index 000000000..828e33784 --- /dev/null +++ b/platform/2000D.110-my/features.h @@ -0,0 +1,8 @@ +// for early porting +#undef CONFIG_CRASH_LOG +#undef CONFIG_PROP_REQUEST_CHANGE +#undef CONFIG_AUTOBACKUP_ROM + +#define CONFIG_TASK_ATTR_STRUCT_V2 +#define CONFIG_TASK_STRUCT_V2 +#define CONFIG_ALLOCATE_MEMORY_POOL diff --git a/platform/2000D.110-my/gui.h b/platform/2000D.110-my/gui.h new file mode 100644 index 000000000..f26378a20 --- /dev/null +++ b/platform/2000D.110-my/gui.h @@ -0,0 +1,3 @@ +#ifndef _cameraspecific_gui_h_ +#define _cameraspecific_gui_h_ +#endif diff --git a/platform/2000D.110-my/internals.h b/platform/2000D.110-my/internals.h new file mode 100644 index 000000000..f7c403a43 --- /dev/null +++ b/platform/2000D.110-my/internals.h @@ -0,0 +1,6 @@ +/** + * Camera internals for 2000D 1.1.0 + */ +#define CONFIG_DIGIC_IV + +#define CONFIG_HELLO_WORLD diff --git a/platform/2000D.110-my/stubs.S b/platform/2000D.110-my/stubs.S new file mode 100644 index 000000000..22fcb3672 --- /dev/null +++ b/platform/2000D.110-my/stubs.S @@ -0,0 +1,44 @@ +/** \file + * Entry points into the firmware image. + * + * These are the functions that we can call from our tasks + * in the Canon 1.1.0 firmware for the 2000D + * + */ +/* + * Copyright (C) 2021 Magic Lantern Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +// kitor: functions in early ram regions seem to match 1:1 1300D.110 + +/** Startup **/ +NSTUB( ROMBASEADDR, firmware_entry ) // 0xFE0C0000 +NSTUB(0xfe0c3a38, cstart) // +NSTUB( 0x29898, bzero32) // called by cstart() rom +NSTUB( 0x5254, create_init_task) // must be called from ram +NSTUB(0xFE129718, init_task) // passed as arg to create_init_task, look for dmSetup + +NSTUB( 0x3780, msleep) +NSTUB( 0x55820, bmp_vram_info) +NSTUB( 0x38FC, task_create) + +NSTUB(0xfe11f3c8, DryosDebugMsg) +NSTUB(0xfe2bbbc8, vsnprintf) // from DryosDebugMsg diff --git a/platform/2000D.110/Makefile b/platform/2000D.110/Makefile new file mode 100644 index 000000000..2b7bb0294 --- /dev/null +++ b/platform/2000D.110/Makefile @@ -0,0 +1,4 @@ +#Makefile for 2000D + +MODEL=2000D +include ../Makefile.platform diff --git a/platform/2000D.110/Makefile.platform.default b/platform/2000D.110/Makefile.platform.default new file mode 100644 index 000000000..f883fee07 --- /dev/null +++ b/platform/2000D.110/Makefile.platform.default @@ -0,0 +1,13 @@ +# 2000D 1.1.0 + +CANON_NAME_FIR = CCF26110.FIR +FIRMWARE_ID = 0x80000432 + +# 32MB ROM, like 1300D +ROMBASEADDR = 0xFE0C0000 +PLATFORM_ARCH = armv5te +# Load ML at the end of the AllocateMemory pool +# Default 0x2D0000 - 0xD00000, patched to 0x2D0000 - 0xC80000 (512K for us). +RESTARTSTART = 0xC80000 +ML_BOOT_OBJ = boot-d45-ch.o +#ML_SRC_EXTRA_OBJS += function_overrides.o diff --git a/platform/2000D.110/Makefile.setup.default b/platform/2000D.110/Makefile.setup.default new file mode 100644 index 000000000..bf91e900e --- /dev/null +++ b/platform/2000D.110/Makefile.setup.default @@ -0,0 +1,7 @@ +#Makefile for 2000D + +TOP_DIR=../.. +ML_AF_PATTERNS_OBJ = n + +# 2000D_101.sym is to long +ML_MODULES_SYM_NAME=t7_$(FW_VERSION).sym diff --git a/platform/2000D.110/cfn.c b/platform/2000D.110/cfn.c new file mode 100644 index 000000000..5cf599ad0 --- /dev/null +++ b/platform/2000D.110/cfn.c @@ -0,0 +1,17 @@ +#include +#include +#include + +// look on camera menu or review sites to get custom function numbers + +int get_htp() { return GetCFnData(0, 5); } +void set_htp(int value) { SetCFnData(0, 5, value); } + +// No MLU on the 1300D :( +int get_mlu() { return 0; } +void set_mlu(int value) { return; } + +int cfn_get_af_button_assignment() { return GetCFnData(0, 7); } +void cfn_set_af_button(int value) { SetCFnData(0, 7, value); } + +GENERIC_GET_ALO diff --git a/platform/2000D.110/consts.h b/platform/2000D.110/consts.h new file mode 100644 index 000000000..2b02f601c --- /dev/null +++ b/platform/2000D.110/consts.h @@ -0,0 +1,277 @@ +/* + * 2000D 1.1.0 consts + */ + +#define CANON_SHUTTER_RATING 100000 + +#define CARD_LED_ADDRESS 0xC0220134 // http://magiclantern.wikia.com/wiki/Led_addresses +#define LEDON 0x46 +#define LEDOFF 0x44 + +#define HIJACK_CACHE_HACK + +#define HIJACK_CACHE_HACK_BSS_END_ADDR 0xfe0c1b74 +#define HIJACK_CACHE_HACK_BSS_END_INSTR 0xE3A01732 // should be the correct INSTRUCTION MOV R1, 0xc80000 +#define HIJACK_CACHE_HACK_INITTASK_ADDR 0xfe0c3b34 + +#define HIJACK_INSTR_BL_CSTART 0xfe0c0638 +#define HIJACK_INSTR_BSS_END 0xfe0c3b24 +#define HIJACK_FIXBR_BZERO32 0xfe0c3a6c +#define HIJACK_FIXBR_CREATE_ITASK 0xfe0c3b0c +#define HIJACK_INSTR_MY_ITASK 0xfe0c3b34 +/* new-style DryOS hooks? */ +#define HIJACK_TASK_ADDR 0x31170 // ok + +//#define ARMLIB_OVERFLOWING_BUFFER 0x310A8 //0x167FC // in AJ_armlib_setup_related3 // this is deactivated in config for this camera, maybe we need to activate it again + +#define DRYOS_ASSERT_HANDLER 0x35888 // ok// dec TH_assert or assert_0 // not sure +#define MVR_992_STRUCT (*(void**)(0x315dc+0x4)) // ok look in MVR_Initialize for AllocateMemory call + +#define div_maybe(a,b) ((a)/(b)) +#define MVR_BUFFER_USAGE_FRAME ABS(div_maybe(-100*MEM(356 + MVR_992_STRUCT) - 100*MEM(364 + MVR_992_STRUCT) - 100*MEM(952 + MVR_992_STRUCT) - 100*MEM(960 + MVR_992_STRUCT) + 100*MEM(360 + MVR_992_STRUCT) + 100*MEM(368 + MVR_992_STRUCT), -MEM(356 + MVR_992_STRUCT) - MEM(364 + MVR_992_STRUCT) + MEM(360 + MVR_992_STRUCT) + MEM(368 + MVR_992_STRUCT))) +#define MVR_BUFFER_USAGE_SOUND div_maybe(-100*MEM(544 + MVR_992_STRUCT) + 100*MEM(532 + MVR_992_STRUCT), 0xa) +#define MVR_BUFFER_USAGE MAX(MVR_BUFFER_USAGE_FRAME, MVR_BUFFER_USAGE_SOUND) + +#define MVR_FRAME_NUMBER (*(int*)(332 + MVR_992_STRUCT)) // in mvrSMEncodeDone 0x14C=332 +#define MVR_BYTES_WRITTEN MEM((296 + MVR_992_STRUCT)) //in mvrSMEncodeDone + +#define MOV_RES_AND_FPS_COMBINATIONS 9 +#define MOV_OPT_NUM_PARAMS 2 +#define MOV_GOP_OPT_NUM_PARAMS 5 +#define MOV_OPT_STEP 5 +#define MOV_GOP_OPT_STEP 5 + + + #define AUDIO_MONITORING_HEADPHONES_CONNECTED 0 +//#define HOTPLUG_VIDEO_OUT_PROP_DELIVER_ADDR 0x1a8c // this prop_deliver performs the action for Video Connect and Video Disconnect // not present on 1300D (see FE0C69C8: taskHotPlug) +//#define HOTPLUG_VIDEO_OUT_STATUS_ADDR 0x1ac4 // passed as 2nd arg to prop_deliver; 1 = display connected, 0 = not, other values disable this event (trick) // not present on 1300D (see FE0C69C8: taskHotPlug) + + +// 720x480, changes when external monitor is connected + #define YUV422_LV_BUFFER_1 0x40d07800 + #define YUV422_LV_BUFFER_2 0x4c233800 + #define YUV422_LV_BUFFER_3 0x4f11d800 + + #define REG_EDMAC_WRITE_LV_ADDR 0xc0f04308 // SDRAM address of LV buffer (aka VRAM) + #define REG_EDMAC_WRITE_HD_ADDR 0xc0f04208 // SDRAM address of HD buffer (aka YUV) + +#define YUV422_LV_BUFFER_DISPLAY_ADDR (*(uint32_t*)0x318C8) // ok 0x31818+0xB0 +#define YUV422_HD_BUFFER_DMA_ADDR (shamem_read(REG_EDMAC_WRITE_HD_ADDR)) + +// changes during record + #define YUV422_HD_BUFFER_1 0x44000080 + #define YUV422_HD_BUFFER_2 0x46000080 + #define YUV422_HD_BUFFER_3 0x48000080 + #define YUV422_HD_BUFFER_4 0x4e000080 + #define YUV422_HD_BUFFER_5 0x50000080 +#define FOCUS_CONFIRMATION (*(int*)(0x36e20 + 0x4)) // ok see "focusinfo" and Wiki:Struct_Guessing +#define HALFSHUTTER_PRESSED (*(int*)(0x359A4 + 0x1C)) //ok look for string "[MC] permit LV instant" +#define DISPLAY_SENSOR_POWERED (*(int*)(0x359A0 + 0x18)) //ok Look up *"ForceDisableDisplay (%d)" + +// for gui_main_task +#define GMT_NFUNCS 7 +//de verificat +#define GMT_FUNCTABLE 0xFE851F20 // dec gui_main_task + + + + +#define LV_BOTTOM_BAR_DISPLAYED (((*(int8_t*)0x3830C) == 0xF) || ((*(int8_t*)0x3FE14) != 0x17)) +#define LV_BOTTOM_BAR_STATE (*(uint8_t*)0x3AA80) // in JudgeBottomInfoDispTimerState, if bottom bar state is 2, Judge returns 0; ML will make it 0 to hide bottom bar +#define ISO_ADJUSTMENT_ACTIVE ((*(int*)0x3830C) == 0xF) +#define SHOOTING_MODE (*(int*)0x35930) +#define UNAVI_FEEDBACK_TIMER_ACTIVE (MEM(0x3fc74) != 0x17) //ok dec CancelUnaviFeedBackTimer + + + + + + + #define AE_STATE (*(int8_t*)(0x3AA80 + 0x1C)) + #define AE_VALUE (*(int8_t*)(0x3AA80 + 0x1D)) + +#define CURRENT_GUI_MODE (*(int*)0x36560) // ok GUIMode_maybe 0x36478 + 0x48 + // from a screenshot +#define COLOR_FG_NONLV 80 +//#define COLOR_FG_NONLV 1 +#define GUIMODE_WB 5 +#define GUIMODE_FOCUS_MODE 9 +#define GUIMODE_DRIVE_MODE 8 +#define GUIMODE_PICTURE_STYLE 4 + +#define GUIMODE_PLAY 1 +#define GUIMODE_MENU 2 +#define GUIMODE_Q_UNAVI 0x1F +#define GUIMODE_FLASH_AE 0x22 +#define GUIMODE_PICQ 6 + #define GUIMODE_MOVIE_ENSURE_A_LENS_IS_ATTACHED (CURRENT_GUI_MODE == 0x1e) + #define GUIMODE_MOVIE_PRESS_LV_TO_RESUME (CURRENT_GUI_MODE == 0x1f) +//~ #define GUIMODE_MOVIE_ENSURE_A_LENS_IS_ATTACHED 0 // not good +//~ #define GUIMODE_MOVIE_PRESS_LV_TO_RESUME 0 + + #define PLAY_MODE (gui_state == GUISTATE_PLAYMENU && CURRENT_GUI_MODE == GUIMODE_PLAY) + #define MENU_MODE (gui_state == GUISTATE_PLAYMENU && CURRENT_GUI_MODE == GUIMODE_MENU) + + + +// position for ML ISO disp outside LV +#define MENU_DISP_ISO_POS_X 527 +#define MENU_DISP_ISO_POS_Y 45 + +//position for ML MAX ISO +#define MAX_ISO_POS_X 590 +#define MAX_ISO_POS_Y 28 + +// for ML hdr display +#define HDR_STATUS_POS_X 562 +#define HDR_STATUS_POS_Y 100 + +//for HTP mode on display +#define HTP_STATUS_POS_X 500 +#define HTP_STATUS_POS_Y 233 + +//for Mirror Lock Up enabled on display +#define MLU_STATUS_POS_X 316 +#define MLU_STATUS_POS_Y 310 + +#define WBS_GM_POS_X 365 +#define WBS_GM_POS_Y 230 + +#define WBS_POS_X 365 +#define WBS_POS_Y 260 + +// Audio remote shot position info photo mode +#define AUDIO_REM_SHOT_POS_X 200 +#define AUDIO_REM_SHOT_POS_Y 386 + +// position for displaying clock outside LV +#define DISPLAY_CLOCK_POS_X 440 +#define DISPLAY_CLOCK_POS_Y 400 + +#define DISPLAY_DATE_POS_X 425 +#define DISPLAY_DATE_POS_Y 430 + +#define DISPLAY_BATTERY_POS_X 350 +#define DISPLAY_BATTERY_POS_Y 400 + +// position for displaying K icon in photo info display +#define WB_K_ICON_POS_X 307 +#define WB_K_ICON_POS_Y 226 + +// position for displaying K values in photo info display +#define WB_KELVIN_POS_X 307 +#define WB_KELVIN_POS_Y 260 + +// position for displaying card size remain outside LV +#define DISPLAY_GB_POS_X 305 +#define DISPLAY_GB_POS_Y 410 + +// for displaying TRAP FOCUS msg outside LV +#define DISPLAY_TRAP_FOCUS_POS_X 65 +#define DISPLAY_TRAP_FOCUS_POS_Y 360 +#define DISPLAY_TRAP_FOCUS_MSG "TRAP FOCUS" +#define DISPLAY_TRAP_FOCUS_MSG_BLANK " " + +// In bindGUIEventFromGUICBR, look for "LV Set" => arg0 = 8 -> 1300D are val 6 +// Next, in SetGUIRequestMode, look at what code calls NotifyGUIEvent(8, something) +//#define GUIMODE_ML_MENU (RECORDING ? 0 : lv ? 68 : 2) +// skip RECORDING variant for now +#define GUIMODE_ML_MENU (lv ? 68 : 2) + +#define NUM_PICSTYLES 10 + + +#define FLASH_MAX_EV 3 +#define FLASH_MIN_EV -5 +#define FASTEST_SHUTTER_SPEED_RAW 152 +#define MAX_AE_EV 5 +#define DIALOG_MnCardFormatBegin (0x462c8+4) // ret_CreateDialogBox(...DlgMnCardFormatBegin_handler...) is stored there +#define DIALOG_MnCardFormatExecute (0x49c4c+4) // ret_CreateDialogBox(...DlgMnCardFormatBegin_handler...) is stored there +#define FORMAT_BTN_NAME "[Q]" +#define FORMAT_BTN BGMT_Q +#define FORMAT_STR_LOC 11 + +#define BULB_MIN_EXPOSURE 1000 + +// http://magiclantern.wikia.com/wiki/Fonts +//#define BFNT_CHAR_CODES 0xff23eac8 +#define BFNT_CHAR_CODES 0xf92c7820 +//#define BFNT_BITMAP_OFFSET 0xff241a08 +#define BFNT_BITMAP_OFFSET 0xf92c79a8 +//#define BFNT_BITMAP_DATA 0xff244944 +#define BFNT_BITMAP_DATA 0xf92c7b30 + +// from CFn +#define AF_BTN_HALFSHUTTER 0 +#define AF_BTN_STAR 1 + +#define IMGPLAY_ZOOM_LEVEL_ADDR (0x3affc+12) // dec GuiImageZoomDown and look for a negative counter +#define IMGPLAY_ZOOM_LEVEL_MAX 14 +#define IMGPLAY_ZOOM_POS_X MEM(0x6f9b8) // Zoom CentrePos Look up *"CentrePos x:%ld y:%ld" +#define IMGPLAY_ZOOM_POS_Y MEM(0x6f9b8+0x4) // Look up *"CentrePos x:%ld y:%ld" +#define IMGPLAY_ZOOM_POS_X_CENTER 0x144 +#define IMGPLAY_ZOOM_POS_Y_CENTER 0xd8 +#define IMGPLAY_ZOOM_POS_DELTA_X (0x144 - 0x93) +#define IMGPLAY_ZOOM_POS_DELTA_Y (0xd8 - 0x7d) + +#define BULB_EXPOSURE_CORRECTION 100 // min value for which bulb exif is OK [not tested] + +#define WINSYS_BMP_DIRTY_BIT_NEG MEM(0x3da10+0x2C) // see http://magiclantern.wikia.com/wiki/VRAM/BMP + +// manual exposure overrides +#define LVAE_STRUCT 0x3B7A4 //ok +#define CONTROL_BV (*(uint16_t*)(LVAE_STRUCT+0x1c)) // ok EP_SetControlBv old 1c +#define CONTROL_BV_TV (*(uint16_t*)(LVAE_STRUCT+0x1e)) // EP_SetControlParam +#define CONTROL_BV_AV (*(uint16_t*)(LVAE_STRUCT+0x20)) +#define CONTROL_BV_ISO (*(uint16_t*)(LVAE_STRUCT+0x22)) +#define CONTROL_BV_ZERO (*(uint16_t*)(LVAE_STRUCT+0x24)) +#define LVAE_ISO_SPEED (*(uint8_t* )(LVAE_STRUCT)) // offset 0x0; at 3 it changes iso very slowly +#define LVAE_ISO_MIN (*(uint8_t* )(LVAE_STRUCT+0x2a)) // string: ISOMin:%d ??? +#define LVAE_ISO_HIS (*(uint8_t* )(LVAE_STRUCT+0x2c)) // no idea what this is +#define LVAE_DISP_GAIN (*(uint16_t*)(LVAE_STRUCT+0x26)) // lvae_setdispgain +#define LVAE_MOV_M_CTRL (*(uint8_t* )(LVAE_STRUCT+0x78)) // lvae_setmoviemanualcontrol + +#define DISPLAY_ORIENTATION MEM(0x31818+0x7C) // read-only; string: UpdateReverseTFT + +#define MIN_MSLEEP 20 + +#define INFO_BTN_NAME "DISP" +#define Q_BTN_NAME (RECORDING ? "INFO" : "[Q]") +//#define ARROW_MODE_TOGGLE_KEY "" + +#define DISPLAY_STATEOBJ (*(struct state_object **)0x318B8) //0x31818+0xa0 +#define DISPLAY_IS_ON (DISPLAY_STATEOBJ->current_state != 0) + +#define VIDEO_PARAMETERS_SRC_3 0x6a5d4 +#define FRAME_SHUTTER_TIMER (*(uint16_t*)(VIDEO_PARAMETERS_SRC_3+0xC)) +#define FRAME_ISO (*(uint8_t*)(VIDEO_PARAMETERS_SRC_3+0x8)) +#define FRAME_APERTURE (*(uint8_t*)(VIDEO_PARAMETERS_SRC_3+0x9)) +#define FRAME_SHUTTER (*(uint8_t*)(VIDEO_PARAMETERS_SRC_3+0xa)) +#define FRAME_BV ((int)FRAME_SHUTTER + (int)FRAME_APERTURE - (int)FRAME_ISO) + +#define FRAME_SHUTTER_BLANKING_ZOOM (*(uint16_t*)0x40481B20) // ADTG register 805f +#define FRAME_SHUTTER_BLANKING_NOZOOM (*(uint16_t*)0x40481B24) // ADTG register 8061 +#define FRAME_SHUTTER_BLANKING_READ (lv_dispsize > 1 ? FRAME_SHUTTER_BLANKING_NOZOOM : FRAME_SHUTTER_BLANKING_ZOOM) /* when reading, use the other mode, as it contains the original value (not overriden) */ +#define FRAME_SHUTTER_BLANKING_WRITE (lv_dispsize > 1 ? &FRAME_SHUTTER_BLANKING_ZOOM : &FRAME_SHUTTER_BLANKING_NOZOOM) +//#define LV_DISP_MODE (MEM(0x66b00 + 0x24) != 3) //on EOSM is (MEM(0x89BAC + 0x7C) != 3)// 00067548 + +// see "Malloc Information" +#define MALLOC_STRUCT 0x66760 +#define MALLOC_FREE_MEMORY (MEM(MALLOC_STRUCT + 8) - MEM(MALLOC_STRUCT + 0x1C)) // "Total Size" - "Allocated Size" +#define SRM_BUFFER_SIZE 0x1f68000 //0x14E8000 /* print it from srm_malloc_cbr */ + + +// for bulb ramping calibration: delay between two exposure readings (increase it if brightness updates slowly) +// if not defined, default is 500 +#define BRAMP_CALIBRATION_DELAY 1000 + +//~ max volume supported for beeps +#define ASIF_MAX_VOL 5 +// look for "JudgeBottomInfoDispTimerState(%d)" +#define JUDGE_BOTTOM_INFO_DISP_TIMER_STATE 0x3fe5c + +// temperature convertion from raw-temperature to celsius +// http://www.magiclantern.fm/forum/index.php?topic=9673.0 +#define EFIC_CELSIUS ((int)efic_temp * 55 / 100 - 68) + + diff --git a/platform/2000D.110/features.h b/platform/2000D.110/features.h new file mode 100644 index 000000000..9c8fc8f4f --- /dev/null +++ b/platform/2000D.110/features.h @@ -0,0 +1,57 @@ +//#define CONFIG_HELLO_WORLD + +// #include "all_features.h" + + +// +// Nothing can be done in here, commented everything out +// + + +/* Can't Be Implemented */ + +//#define FEATURE_DIGITAL_ZOOM_SHORTCUT +//#define FEATURE_LV_3RD_PARTY_FLASH +//#define FEATURE_FLASH_TWEAKS +//#define FEATURE_EYEFI_TRICKS + +//#define DEBUG_TASK_HOOK + + +//#define FEATURE_INTERMEDIATE_ISO_PHOTO_DISPLAY + +//#undef FEATURE_FLEXINFO + +//#undef FEATURE_SHOW_TASKS +//#undef FEATURE_SHOW_CPU_USAGE +//#undef FEATURE_SHOW_GUI_EVENTS + +//#undef FEATURE_SHOW_IMAGE_BUFFERS_INFO +//#undef FEATURE_SHOW_EDMAC_INFO + +//#undef CONFIG_TSKMON +//#undef FEATURE_LV_ZOOM_SETTINGS +//#undef FEATURE_EXPO_ISO +//#undef FEATURE_FPS_OVERRIDE +//////////////////////// + + +//#undef FEATURE_FORCE_LIVEVIEW // Already Live View +//#undef FEATURE_MLU // No Mirror +//#undef FEATURE_MLU_HANDHELD +//#undef FEATURE_STICKY_DOF // No DOF button +//#undef FEATURE_IMAGE_EFFECTS // DigicV new effects check "Art Filter" +//#undef FEATURE_INTERMEDIATE_ISO_PHOTO_DISPLAY // Well.. it will work in 1 mode +//#undef FEATURE_AF_PATTERNS // No regular AF +//#undef FEATURE_VOICE_TAGS // Just to be sure +//#undef FEATURE_SHOW_IMAGE_BUFFERS_INFO +//#undef FEATURE_SHOW_EDMAC_INFO +//#undef FEATURE_SHOW_SIGNATURE +//#undef CONFIG_TSKMON +//#undef FEATURE_QUICK_ZOOM +//#define FEATURE_HISTOGRAM + +#undef CONFIG_CRASH_LOG +#undef CONFIG_PROP_REQUEST_CHANGE +#undef CONFIG_AUTOBACKUP_ROM + diff --git a/platform/2000D.110/features.h.citrix b/platform/2000D.110/features.h.citrix new file mode 100644 index 000000000..a081cd793 --- /dev/null +++ b/platform/2000D.110/features.h.citrix @@ -0,0 +1,52 @@ +//#define CONFIG_HELLO_WORLD + +#include "all_features.h" + + +// +// Nothing can be done in here, commented everything out +// + + +/* Can't Be Implemented */ + +//#define FEATURE_DIGITAL_ZOOM_SHORTCUT +//#define FEATURE_LV_3RD_PARTY_FLASH +//#define FEATURE_FLASH_TWEAKS +//#define FEATURE_EYEFI_TRICKS + +//#define DEBUG_TASK_HOOK + + +//#define FEATURE_INTERMEDIATE_ISO_PHOTO_DISPLAY + +//#undef FEATURE_FLEXINFO + +//#undef FEATURE_SHOW_TASKS +//#undef FEATURE_SHOW_CPU_USAGE +//#undef FEATURE_SHOW_GUI_EVENTS + +//#undef FEATURE_SHOW_IMAGE_BUFFERS_INFO +//#undef FEATURE_SHOW_EDMAC_INFO + +//#undef CONFIG_TSKMON +#undef FEATURE_LV_ZOOM_SETTINGS +#undef FEATURE_EXPO_ISO +#undef FEATURE_FPS_OVERRIDE +//////////////////////// + + +#undef FEATURE_FORCE_LIVEVIEW // Already Live View +#undef FEATURE_MLU // No Mirror +#undef FEATURE_MLU_HANDHELD +#undef FEATURE_STICKY_DOF // No DOF button +#undef FEATURE_IMAGE_EFFECTS // DigicV new effects check "Art Filter" +#undef FEATURE_INTERMEDIATE_ISO_PHOTO_DISPLAY // Well.. it will work in 1 mode +#undef FEATURE_AF_PATTERNS // No regular AF +#undef FEATURE_VOICE_TAGS // Just to be sure +#undef FEATURE_SHOW_IMAGE_BUFFERS_INFO +#undef FEATURE_SHOW_EDMAC_INFO +#undef FEATURE_SHOW_SIGNATURE +#undef CONFIG_TSKMON +#undef FEATURE_QUICK_ZOOM +#define FEATURE_HISTOGRAM diff --git a/platform/2000D.110/function_overrides.c b/platform/2000D.110/function_overrides.c new file mode 100644 index 000000000..39761e133 --- /dev/null +++ b/platform/2000D.110/function_overrides.c @@ -0,0 +1,31 @@ +// functions 200D/101 + +// SJE overrides for functions I couldn't find stubs for, +// as well as ones that I think function sig has changed, +// so we can define wrappers. + +#include +#include +#include +#include +#include +#include +#include + +extern struct task* first_task; +int get_task_info_by_id(int task_id, void *task_attr) +{ + // D678 uses the high half of the ID for some APIs, D45 looks to only + // use the low half. We use the low half as index to find the full value. +// printf("[cristi] - in get_task_info_by_id: %x\n", task_id); + struct task *task = first_task + (task_id & 0xff); + return _get_task_info_by_id(task->taskId, task_attr); +} +//void _engio_write(uint32_t* reg_list) +//{ +// int param2=""; +// int param3=""; +// int param4=""; +// DryosDebugMsg(0, 15, "Apelez _engio_write2 \n"); + // return _engio_write2(reg_list, param2, param3, param4); +//} diff --git a/platform/2000D.110/gui.h b/platform/2000D.110/gui.h new file mode 100644 index 000000000..42307efb8 --- /dev/null +++ b/platform/2000D.110/gui.h @@ -0,0 +1,64 @@ +#ifndef _cameraspecific_gui_h_ +#define _cameraspecific_gui_h_ + +// BGMT Button codes as received by gui_main_task +#define BGMT_MENU 6 +#define BGMT_INFO 7 +#define BGMT_PRESS_DISP 8 +#define BGMT_UNPRESS_DISP 9 +#define BGMT_PLAY 0xB + +#define BGMT_Q 0x1C +#define BGMT_LV 0x1D + +#define BGMT_PRESS_SET 4 +#define BGMT_UNPRESS_SET 5 +#define BGMT_PRESS_RIGHT 0x23 +#define BGMT_UNPRESS_RIGHT 0x24 +#define BGMT_PRESS_LEFT 0x25 +#define BGMT_UNPRESS_LEFT 0x26 +#define BGMT_PRESS_UP 0x27 +#define BGMT_UNPRESS_UP 0x28 +#define BGMT_PRESS_DOWN 0x29 +#define BGMT_UNPRESS_DOWN 0x2A + +#define BGMT_ISO 0x33 + +#define BGMT_PRESS_HALFSHUTTER 0x48 + +#define BGMT_PRESS_ZOOM_OUT 0x10 +#define BGMT_UNPRESS_ZOOM_OUT 0x11 + +#define BGMT_PRESS_ZOOM_IN 0xe +#define BGMT_UNPRESS_ZOOM_IN 0xf + +// AV / AE COMP button +/// See gui.c for the actual press/unpress handling +// + +#define BGMT_AV (event->type == 0 && event->param == 0x61 && ( \ + (is_movie_mode() && event->arg == 0xe) || \ + (shooting_mode == SHOOTMODE_P && event->arg == 0xa) || \ + (shooting_mode == SHOOTMODE_ADEP && event->arg == 0xa) || \ + (shooting_mode == SHOOTMODE_AV && event->arg == 0xf) || \ + (shooting_mode == SHOOTMODE_M && event->arg == 0xe) || \ + (shooting_mode == SHOOTMODE_TV && event->arg == 0x10)) ) + +#define INT_EV_OBJ (*(int*)(event->obj)) + + #define BGMT_TRASH (13) // not present on 1300D + +#define BGMT_WHEEL_LEFT 0x2 +#define BGMT_WHEEL_RIGHT 0x3 +#define BGMT_WHEEL_UP 0x0 +#define BGMT_WHEEL_DOWN 0x1 + +#define GMT_OLC_INFO_CHANGED 0x61 // backtrace copyOlcDataToStorage call in IDLEHandler + #define GMT_LOCAL_DIALOG_REFRESH_LV 0x34 // event type = 2, gui code = 0x100000a1 in 600d // not present on 1300D + +// needed for correct shutdown from powersave modes +#define GMT_GUICMD_START_AS_CHECK 0x59 +#define GMT_GUICMD_OPEN_SLOT_COVER 0x55 +#define GMT_GUICMD_LOCK_OFF 0x53 + +#endif diff --git a/platform/2000D.110/include/platform/mvr.h b/platform/2000D.110/include/platform/mvr.h new file mode 100644 index 000000000..01c0fe1cc --- /dev/null +++ b/platform/2000D.110/include/platform/mvr.h @@ -0,0 +1,138 @@ +#ifndef __PLATFORM_MVR_H__ +#define __PLATFORM_MVR_H__ + +// Movie recording. +// tab size: 4 +// not all values are correct (most of them are for 550D) +struct mvr_config +{ + uint16_t debug_flag; // 0x00, 6290, 1 = write debugmsg's OK + uint16_t qscale_mode; // 0x02, 6292, 1 = QScale, 0 = CBR + uint16_t db_filter_a; // 0x04, 67c0, no effect + uint16_t db_filter_b; // 0x06, 67c2, no effect + int16_t def_q_scale; // 0x08, 67c4, works when qscale_mode = 1 + int16_t qscale_related_1; // 0x0a, 67c6 + int16_t qscale_related_2; // 0x0c, 67c8 + int16_t qscale_related_3; // 0x0e, 67ca + int16_t qscale_limit_L; // 0x10, 67cc + int16_t qscale_limit_H; // 0x12, 67ce + uint16_t time_const; // 0x14, 67d0, unknown + uint16_t x67d0; // 0x16, 67d2 + uint32_t fullhd_30fps_opt_size_I;// 0x18, 62a8, works when qscale_mode = 0 + uint32_t fullhd_30fps_opt_size_P;// 0x1c, 62ac + uint32_t D1_30fps; // 0x20, 67dc + uint32_t D2_30fps; // 0x24, 67e0 + uint32_t x67e4; // 0x28, 67e4 + uint32_t fullhd_25fps_opt_size_I;// 0x2c, 67e8 OK + uint32_t fullhd_25fps_opt_size_P;// 0x30, 67ec + uint32_t fullhd_25fps_D1; // 0x34, 67f0 + uint32_t fullhd_25fps_D2; // 0x38, 67f4 + uint32_t x67f8; // 0x3c, 67f8 + uint32_t fullhd_24fps_opt_size_I;// 0x40, 67fc + uint32_t fullhd_24fps_opt_size_P;// 0x44, 6800 + uint32_t fullhd_24fps_D1; // 0x48, 6804 + uint32_t fullhd_24fps_D2; // 0x4c, 6808 + uint32_t x680c; // 0x50, 680c + uint32_t hd_60fps_opt_size_I; // 0x54, 6810 OK + uint32_t hd_60fps_opt_size_P; // 0x58, 6814 + uint32_t hd_60fps_D1; // 0x5c, 6818 + uint32_t hd_60fps_D2; // 0x60, 681c + uint32_t x6820; // 0x64, 6820 + uint32_t hd_50fps_opt_size_I; // 0x68, 6824 + uint32_t hd_50fps_opt_size_P; // 0x6c, 6828 + uint32_t hd_50fps_D1; // 0x70, 682c + uint32_t hd_50fps_D2; // 0x74, 6830 + uint32_t x6834_kinda_counter; // 0x78, 6834 + uint32_t vga_60fps_opt_size_I; // 0x7c, 6838 nope (it's for other resolution) + uint32_t vga_60fps_opt_size_P; // 0x80, 683c + uint32_t vga_60fps_D1; // 0x84, 6840 + uint32_t vga_60fps_D2; // 0x88, 6844 + uint32_t x6848; // 0x8c, 6848 + uint32_t vga_50fps_opt_size_I; // 0x90, 684c + uint32_t vga_50fps_opt_size_P; // 0x94, 6850 + uint32_t vga_50fps_D1; // 0x98, 6854 + uint32_t vga_50fps_D2; // 0x9c, 6858 + uint32_t x685c; // 0xa0, 685c + int32_t xa4; // 0xa4, 6860 here is for VGA + int32_t xa8; // 0xa8, 6864 + int32_t xac; // 0xac, 6868 + uint32_t xb0; // 0xb0, 686c + uint32_t xb4; // 0xb4, 6870 + uint32_t xb8; // 0xb8, 6874 and here should be the second + uint32_t xbc; // 0xbc, 6878 + uint32_t xc0; // 0xc0, 687c + uint32_t xc4; // 0xc4, 6880 + uint32_t xc8; // 0xc8, 6884 + uint32_t xcc; // 0xcc, 6888 + uint32_t xd0; // 0xd0, 688c + uint32_t xd4; // 0xd4, 6890 + uint32_t xd8; // 0xd8, 6894 + uint32_t xdc; // 0xdc, 6898 + uint32_t xe0; // 0xe0, 689c + uint32_t xe4; // 0xe4, 68a0 + uint32_t xe8; // 0xe8, 68a4 + uint32_t xec; // 0xec, 68a8 + uint32_t xf0; // 0xf0, 68ac + int32_t another_def_q_scale; // 0xf4, 68b0 + int32_t IniQScale; // 0xf8, 68b4 + int32_t actual_qscale_maybe; // 0xfc, 68b8 + uint32_t x100; // 0x100, 68bc + uint32_t x104; // 0x104, 68c0 + uint32_t x108; // 0x108, 68c4 + uint32_t x10c; // 0x10c, 68c8 + uint32_t x110; // 0x110, 68cc + uint32_t x114; // 0x114, 68d0 + uint32_t x118; // 0x118, 68d4 + uint32_t x11c; // 0x11c, 68d8 + uint32_t x120; // 0x120, 68dc + uint32_t x124; // 0x124, 68e0 + uint32_t fullhd_30fps_gop_opt_0; // 0x128, 63b8 OK + uint32_t fullhd_30fps_gop_opt_1; // 0x12c + uint32_t fullhd_30fps_gop_opt_2; // 0x130 + uint32_t fullhd_30fps_gop_opt_3; // 0x134 + uint32_t fullhd_30fps_gop_opt_4; // 0x138 + uint32_t fullhd_25fps_gop_opt_0; // 0x13c OK + uint32_t fullhd_25fps_gop_opt_1; // 0x140 + uint32_t fullhd_25fps_gop_opt_2; // 0x144 + uint32_t fullhd_25fps_gop_opt_3; // 0x148 + uint32_t fullhd_25fps_gop_opt_4; // 0x14c + uint32_t fullhd_24fps_gop_opt_0; // 0x150 OK + uint32_t fullhd_24fps_gop_opt_1; // 0x154 + uint32_t fullhd_24fps_gop_opt_2; // 0x158 + uint32_t fullhd_24fps_gop_opt_3; // 0x15c + uint32_t fullhd_24fps_gop_opt_4; // 0x160 + uint32_t hd_60fps_gop_opt_0; // 0x164, 63f4 OK + uint32_t hd_60fps_gop_opt_1; // 0x168 + uint32_t hd_60fps_gop_opt_2; // 0x16c + uint32_t hd_60fps_gop_opt_3; // 0x170 + uint32_t hd_60fps_gop_opt_4; // 0x174 + uint32_t hd_50fps_gop_opt_0; // 0x178 OK + uint32_t hd_50fps_gop_opt_1; // 0x17c + uint32_t hd_50fps_gop_opt_2; // 0x180 + uint32_t hd_50fps_gop_opt_3; // 0x184 + uint32_t hd_50fps_gop_opt_4; // 0x188 + uint32_t unk_xfps_gop_opt_0; // 0x18c // ?? + uint32_t unk_xfps_gop_opt_1; // 0x190 + uint32_t unk_xfps_gop_opt_2; // 0x194 + uint32_t unk_xfps_gop_opt_3; // 0x198 + uint32_t unk_xfps_gop_opt_4; // 0x19c + uint32_t unk_yfps_gop_opt_0; // 0x1a0 // ?? + uint32_t unk_yfps_gop_opt_1; // 0x1a4 + uint32_t unk_yfps_gop_opt_2; // 0x1a8 + uint32_t unk_yfps_gop_opt_3; // 0x1ac + uint32_t unk_yfps_gop_opt_4; // 0x1b0 + uint32_t vga_60fps_gop_opt_0; // 0x1b4, 6444 // that's first VGA + uint32_t vga_60fps_gop_opt_1; // 0x1b8 + uint32_t vga_60fps_gop_opt_2; // 0x1bc + uint32_t vga_60fps_gop_opt_3; // 0x1c0 + uint32_t vga_60fps_gop_opt_4; // 0x1c4 + uint32_t vga_50fps_gop_opt_0; // 0x1c8 OK + uint32_t vga_50fps_gop_opt_1; // 0x1cc + uint32_t vga_50fps_gop_opt_2; // 0x1d0 + uint32_t vga_50fps_gop_opt_3; // 0x1d4 + uint32_t vga_50fps_gop_opt_4; // 0x1d8 +}__attribute__((aligned,packed)); + +//~ SIZE_CHECK_STRUCT( mvr_config, 0x30 ); + +#endif /* __PLATFORM_MVR_H__ */ diff --git a/platform/2000D.110/include/platform/state-object.h b/platform/2000D.110/include/platform/state-object.h new file mode 100644 index 000000000..6bcdd7730 --- /dev/null +++ b/platform/2000D.110/include/platform/state-object.h @@ -0,0 +1,13 @@ +#ifndef __platform_state_object_h +#define __platform_state_object_h + +#define DISPLAY_STATE DISPLAY_STATEOBJ +#define INPUT_ENABLE_IMAGE_PHYSICAL_SCREEN_PARAMETER 20 +#define EVF_STATE (*(struct state_object **)0x37890) +#define MOVREC_STATE (*(struct state_object **)0x386b0) + + + + + +#endif // __platform_state_object_h diff --git a/platform/2000D.110/internals.h b/platform/2000D.110/internals.h new file mode 100644 index 000000000..81d6cd5d8 --- /dev/null +++ b/platform/2000D.110/internals.h @@ -0,0 +1,26 @@ +#define CONFIG_EARLY_PORT +//#define CONFIG_HELLO_WORLD + +#define MEM_DEBUG +//#define CONFIG_NO_ADDITIONAL_VERSION +#define CONFIG_ADDITIONAL_VERSION +#define CONFIG_STATE_OBJECT_HOOKS +#define DEBUG_TASK_HOOK + +#define CONFIG_NEW_DRYOS_TASK_HOOKS +#define CONFIG_NEW_TASK_STRUCTS +#define CONFIG_TASK_STRUCT_V2 +#define CONFIG_TASK_ATTR_STRUCT_V2 + +#define CONFIG_DIGIC_IV + +#define CONFIG_ALLOCATE_MEMORY_POOL +#define CONFIG_Q_MENU_PLAYBACK +#define CONFIG_4_3_SCREEN + +#define CONFIG_LIVEVIEW +#define CONFIG_MOVIE +//#define FEATURE_FLASH_TWEAKS + +// #undef CONFIG_MODULES +#define CONFIG_MENU_WITH_AV diff --git a/platform/2000D.110/internals.h.old b/platform/2000D.110/internals.h.old new file mode 100644 index 000000000..5d15d0fc0 --- /dev/null +++ b/platform/2000D.110/internals.h.old @@ -0,0 +1,162 @@ +/** + * Camera internals for 1300D 1.1.0 + */ + +/** Properties are persistent (saved in NVRAM) => a mistake can cause permanent damage. Undefine this for new ports. */ +/** The 1300D port is very early, so I think we should not enable properties. **/ +//#undef CONFIG_PROP_REQUEST_CHANGE + +/** + * State object hooks are pieces of code that run in Canon tasks (state objects). See state-object.c . + * They might slow down Canon code, so here you can disable all of them (useful for debugging or early ports) + */ +/** No additional_version stub on this DryOS version **/ +#define CONFIG_EARLY_PORT +#define CONFIG_HELLO_WORLD + +#define CONFIG_NO_ADDITIONAL_VERSION + +#define CONFIG_STATE_OBJECT_HOOKS + +/** This camera runs DryOS **/ +//~ #define CONFIG_VXWORKS + +/** This camera has a DIGIC IV chip */ +//~#define CONFIG_DIGIC_IV +//~#define CONFIG_KILL_FLICKER + +/** This camera uses new-style DryOS task hooks */ +#define CONFIG_NEW_DRYOS_TASK_HOOKS + +/** This camera has an APS-C sensor */ +//~ #define CONFIG_FULLFRAME + +/** This camera has LiveView and can record video **/ +#define CONFIG_LIVEVIEW +#define CONFIG_MOVIE + +/** This camera has a 4:3 screen, 720x480 **/ +#define CONFIG_4_3_SCREEN + +/** We only have a single red LED **/ +//~ #define CONFIG_BLUE_LED + +/** There is no LCD sensor that turns the display off **/ +//~ #define CONFIG_LCD_SENSOR + +/** This camera does not have a mirror lockup feature **/ +//~ #define CONFIG_MLU + +/** This camera reports focus info in LiveView **/ +/* to be checked */ +//#define CONFIG_LV_FOCUS_INFO + +/** No level sensor **/ +//~ #define CONFIG_ELECTRONIC_LEVEL + +/** Define this if the camera has an ambient light sensor used for auto brightness **/ +//~ #define CONFIG_AUTO_BRIGHTNESS + +/** There is a Q menu in Play mode, with image protect, rate etc **/ +#define CONFIG_Q_MENU_PLAYBACK + +/** No flip-out display **/ +//~ #define CONFIG_VARIANGLE_DISPLAY + +/** Battery does not report exact percentage **/ +//~ #define CONFIG_BATTERY_INFO + +/** We can do bulb exposures **/ +//#define CONFIG_BULB + +/** Bulb mode is done by going to M mode and setting shutter speed beyond 30s **/ +//~ #define CONFIG_SEPARATE_BULB_MODE + +/** We can't control audio settings from ML **/ +//~ #define CONFIG_AUDIO_CONTROLS + +/** Zoom button can be used while recording (for Magic Zoom) **/ +/* to be checked */ +//~ #define CONFIG_ZOOM_BTN_NOT_WORKING_WHILE_RECORDING + +/** We can redirect the display buffer to some arbitrary address, just by changing YUV422_LV_BUFFER_DISPLAY_ADDR **/ +//#define CONFIG_CAN_REDIRECT_DISPLAY_BUFFER_EASILY +//#define CONFIG_CAN_REDIRECT_DISPLAY_BUFFER + +/** Therefore, we can implement display filters (features that alter the LiveView image in real-time) **/ +//#define CONFIG_DISPLAY_FILTERS + +/** We can override ISO on a per-frame basis, by changing FRAME_ISO (e.g. for HDR video or gradual exposure) **/ +//#define CONFIG_FRAME_ISO_OVERRIDE + +/** But we can't override the digital ISO component via FRAME_ISO **/ +//#define CONFIG_FRAME_ISO_OVERRIDE_ANALOG_ONLY + +/** We can also override shutter on a per-frame basis */ +//#define CONFIG_FRAME_SHUTTER_OVERRIDE + +/** We can change ExpSim from ML **/ +/* to be checked */ +//#define CONFIG_EXPSIM + +/** We can playback sounds via ASIF DMA **/ +//#define CONFIG_BEEP +#undef CONFIG_BEEP + +/** This camera has trouble saving Kelvin and/or WBShift in movie mode, so ML has to do this instead **/ +/* to be checked */ +//#define CONFIG_WB_WORKAROUND + +/** We can restore ML files after formatting the card in the camera **/ +//#define CONFIG_RESTORE_AFTER_FORMAT + +/** We can use DMA_MEMCPY but it has no real benefit **/ +//~ #define CONFIG_DMA_MEMCPY + +/** We know how to use edmac_memcpy. This one is really fast (600MB/s!) */ +//#define CONFIG_EDMAC_MEMCPY + +/** We should warn the user if movie exposure is Auto **/ +//#define CONFIG_MOVIE_AE_WARNING + +/** We can display some extra info in photo mode (not LiveView) **/ +//#define CONFIG_PHOTO_MODE_INFO_DISPLAY + +/** Show 4 char if camera support only 3 in photo mode (not LiveView) **/ + +/** FIO_RenameFile works **/ +//#define CONFIG_FIO_RENAMEFILE_WORKS + +/** Perfect sync using EVF_STATE **/ +//#define CONFIG_EVF_STATE_SYNC + +/** This camera loads ML into the AllocateMemory pool **/ +//#define CONFIG_ALLOCATE_MEMORY_POOL + +/** FPS override: we can change both timer A and B */ +//~ #define CONFIG_FPS_TIMER_A_ONLY + +/** FPS override: Canon changes FPS registers often; we need to undo their changes asap */ +//~ #define CONFIG_FPS_AGGRESSIVE_UPDATE + +/** This camera has a mono microphone input, so we should display only one audio meter **/ +//#define CONFIG_MONO_MIC + +/** This camera uses the exposure comp button to open ML menu */ +//#define CONFIG_MENU_WITH_AV + +/** We don't have access to Raw data (yet) */ +//~ #define CONFIG_RAW_LIVEVIEW +//#define CONFIG_RAW_PHOTO + + +/** Hide Canon bottom bar from DebugMsg hook */ +//~ #define CONFIG_LVAPP_HACK_DEBUGMSG + +/** Workaround for menu timeout in LiveView */ +//~ #define CONFIG_MENU_TIMEOUT_FIX + +/** Use a patched LiveViewApp dialog hander to hide Canon bottom bar */ +/** FIXME: long calls during relocation **/ +//~ #define CONFIG_LVAPP_HACK_RELOC + diff --git a/platform/2000D.110/stubs.S b/platform/2000D.110/stubs.S new file mode 100644 index 000000000..16cb8f640 --- /dev/null +++ b/platform/2000D.110/stubs.S @@ -0,0 +1,400 @@ +/** \file + * Entry points into the firmware image. + * + * These are the functions that we can call from our tasks + * in the Canon 1.1.0 firmware for the 2000D + * + */ +/* + * Copyright (C) 2021 Magic Lantern Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +// kitor: functions in early ram regions seem to match 1:1 1300D.110 + +/** Startup **/ +NSTUB( ROMBASEADDR, firmware_entry ) //X // 0xFE0C0000 +NSTUB(0xfe0c3a38, cstart) //X // +NSTUB( 0x29898, bzero32) // called by cstart() rom +NSTUB( 0x5254, create_init_task) //X // must be called from ram +NSTUB(0xFE129718, init_task) //X // passed as arg to create_init_task, look for dmSetup +NSTUB( 0x669e8, additional_version) + +/** File I/O **/ +NSTUB(0xfe2a35ac, FIO_CloseFile) // +NSTUB(0xfe2a4580, FIO_FindClose) // called with ret_FIO_FindFirstEx after finishing the dir scanning loop +NSTUB(0xfe2a44a0, FIO_FindNextEx) // +NSTUB(0xfe2a335c, _FIO_ReadFile) // +NSTUB(0xfe2a340c, FIO_SeekSkipFile) // same as SeekFile +NSTUB(0xfe2a34fc, _FIO_WriteFile) // +NSTUB(0xfe2a3dec, _FIO_CreateDirectory) // +NSTUB(0xfe2a3208, _FIO_CreateFile) // +NSTUB(0xfe2a43ac, _FIO_FindFirstEx) // +NSTUB(0xfe2a3728, _FIO_GetFileSize) // +NSTUB(0xfe2a314c, _FIO_OpenFile) // +NSTUB(0xfe2a32b4, _FIO_RemoveFile) // +NSTUB(0xfe2a3c24, _FIO_RenameFile) + +/** GUI **/ +NSTUB( 0x3136C, gui_main_struct) // in gui_main_task +NSTUB( 0x3d8c0, gui_task_list) +NSTUB(0xfe0cca74, GUI_ChangeMode) +NSTUB(0xfe0cc8b8, GUI_Control) +NSTUB(0xfe14d5b4, SetGUIRequestMode) +NSTUB(0xfe0ccf28, gui_init_end) // EndGuiInit +NSTUB(0xfe0cc4e8, gui_main_task) // message at 0x30, counter at 0x0c +NSTUB(0xfe14fe2c, gui_massive_event_loop) // GUI_Control_Post +NSTUB(0xfe2eac48, GUI_SetLvMode) /* present on 500D.111, 50D.109, 5D2.212 */ +// NSTUB( ???, GUI_SetMovieSize_a) /* present on 50D.109 */ +// NSTUB( ???, GUI_SetMovieSize_b) /* present on 50D.109 */ +NSTUB(0xfe2eae7c, Gui_SetSoundRecord) /* present on 6D.113, 5D2.212 */ + +/** ASIF **/ +// TODO: +NSTUB(0xfe11d200, PowerAudioOutput) //ok /* not found old FE108E44*/ +NSTUB(0xfe11b96c, SetAudioVolumeOut) //ok +NSTUB(0xfe106ac4, SetNextASIFADCBuffer) +NSTUB(0xfe106cb0, SetNextASIFDACBuffer) +NSTUB(0xfe11c6c4, SetSamplingRate) +NSTUB(0xfe105fac, StartASIFDMAADC) +NSTUB(0xfe106380, StartASIFDMADAC) +NSTUB(0xfe106600, StopASIFDMADAC) +NSTUB(0xfe11cd38, PowerMicAmp) /* present on 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe106728, SetASIFMode) /* present on 700D.113 , On 1300D not used*/ +//NSTUB(0xFE108E10, SetAudioVolumeIn) //? /* present on 6D.113 */ +NSTUB(0xfe108aa0, SoundDevActiveIn) //ok /* present on 7D.203, 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe108cf8, SoundDevShutDownIn)//ok /* present on 7D.203, 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe106258, StopASIFDMAADC) //ok /* present on 7D.203, 6D.113, EOSM.202 */ + + +/** Audio **/ +NSTUB( 0x31604, sounddev) // in sounddev_task +// TODO: Not found direct write it looks like its some kind of serial connection now + +NSTUB(0xfe2b2d5c, _audio_ic_read) // FE2B3A3C 0xFE2B3A3C +NSTUB(0xfe2b29f4, _audio_ic_write) // posible sub_FE2B3A18 + + +NSTUB(0xfe8b9b84, audio_thresholds) // find "ALV_Initialize", then pointer to "AudioLevel", thresholds are following array of 41 values +NSTUB(0xfe108aa0, sounddev_active_in) // "SoundDevActiveIn" +NSTUB(0xfe108690, sounddev_task) // "[SND] _SoundDeviceTask" +// NSTUB( ???, _audio_ic_write_bulk) /* present on 6D.116 */ + +/** Bitmap **/ +NSTUB( 0x54020, LCD_Palette) // in InitializeBitmapDisplayDevice, right after 0xc0f14800 +NSTUB( 0x55820, bmp_vram_info) + +/** CFN **/ +NSTUB(0xfe712ed4, GetCFnData) +NSTUB(0xfe713100, SetCFnData) +// NSTUB( ???, GUI_GetCFnForTab4) /* present on 7D.203 */ +// NSTUB(0xFE4716F0, GUI_SetCFnForTab4) /* present on 7D.203 */ + +/** Camera interface? **/ +// TODO: + NSTUB(0xC0220000, camera_engine) + +/** MPU communication **/ +NSTUB(0xFE2993B4, _mpu_send); /* dwSize < TXBD_DATA_SIZE */ +NSTUB(0xFE10FA70, _mpu_recv); /* registered in InitializeIntercom as CBR */ + +/** DMA **/ +NSTUB(0xfe124530, dma_memcpy) + +/** Debug messages **/ +NSTUB( 0x31bf4, dm_names) // in DebugMsg, before the 1st loop target +NSTUB(0xfe11f3c8, DryosDebugMsg) +NSTUB(0xfe11f730, dm_set_store_level) // called by "dmstore" +NSTUB(0xfe11f6c8, dm_set_print_level) + +/** Dialog API **/ +NSTUB(0xfe3f0334, dialog_redraw) +NSTUB(0xfe2f807c, dialog_set_property_str) + +/** Dialog handlers **/ +NSTUB(0xfe5ac5f4, ErrCardForLVApp_handler) // LiveViewErrorApp, as in 60D +NSTUB(0xfe455038, ErrForCamera_handler) // ERR70, ERR80 etc (DlgErrForCamera.c, AJ_DIALOG.HANDLER_DlgErrForCamera.c) +NSTUB(0xfe487ea8, HideUnaviFeedBack_maybe) // look for StartUnaviFeedBackTimer +NSTUB(0xfe48ca60, LiveViewApp_handler) +NSTUB(0xfe48d0cc, LiveViewApp_handler_BL_JudgeBottomInfoDispTimerState) +NSTUB(0xfe48e708, LiveViewApp_handler_end) // start of next function +NSTUB(0xfe4a8544, PlayMain_handler) +NSTUB(0xfe5e7ec8, PlayMovieGuideApp_handler) +NSTUB(0xfe49bc18, ShootOlcApp_handler) +// NSTUB( ???, LiveViewLevelApp_handler) /* present on 5D3.113 */ +// NSTUB( ???, LiveViewShutterApp_handler) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +// NSTUB(0xFE49AA14, LiveViewWbApp_handler) /* present on 7D.203, 5D3.113, 5D2.212 */ +// NSTUB( ???, LiveViewWifiApp_handler) /* present on 6D.113 */ +// NSTUB( ???, StartPlayProtectGuideApp) /* present on 7D.203, 5D2.212 */ +// NSTUB( ???, StopPlayProtectGuideApp) /* present on 7D.203, 5D2.212 */ + +/** Display **/ +NSTUB(0xfe40e2d4, MirrorDisplay) +NSTUB(0xfe40e334, NormalDisplay) +NSTUB(0xfe40e304, ReverseDisplay) + +/** EDMAC **/ +NSTUB(0xfe29da58, AbortEDmac) +NSTUB(0xfe29d764, ConnectReadEDmac) +NSTUB(0xfe29d6a0, ConnectWriteEDmac) +NSTUB(0xfe29db20, RegisterEDmacAbortCBR) +NSTUB(0xfe29daf8, RegisterEDmacCompleteCBR) +NSTUB(0xfe29dc24, RegisterEDmacPopCBR) +NSTUB(0xfe29d5e8, SetEDmac) +NSTUB(0xfe29d904, StartEDmac) +NSTUB(0xfe29db60, UnregisterEDmacAbortCBR) +NSTUB(0xfe29db0c, UnregisterEDmacCompleteCBR) +NSTUB(0xfe29dc38, UnregisterEDmacPopCBR) + +/** Electronic Level **/ +NSTUB(0xfe2ea488, GUI_SetRollingPitchingLevelStatus) + +/** Engio **/ +NSTUB(0xfe29e9f4, _EngDrvOut) +NSTUB(0xfe29eda0, _engio_write) +NSTUB(0xfe29e8e4, shamem_read) + +/** Eventprocs (call by name) **/ +NSTUB(0xfe1202bc, call) + +/** Events **/ +NSTUB(0xfe2c162c, TryPostEvent) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe2c1688, TryPostEvent_end) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe2bda54, TryPostStageEvent) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe2bdab0, TryPostStageEvent_end) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ + +/** ExMem **/ +NSTUB(0xfe122cb8, AddMemoryChunk) +NSTUB(0xfe125168, AllocateContinuousMemoryResource) // m_pfContAllocMemoryCBR +NSTUB(0xfe12511c, AllocateMemoryResource) // m_pfAllocMemoryCBR +NSTUB(0xfe122234, CreateMemoryChunk) +NSTUB(0xfe122a18, CreateMemorySuite) // FFCCEF34 +NSTUB(0xfe12284c, DeleteMemorySuite) // FFCCED2C +NSTUB(0xfe125280, FreeMemoryResource) // m_pfFreeMemoryCBR +NSTUB(0xfe122d88, GetFirstChunkFromSuite) // AJ_PackMemory_PackMem_p3 +NSTUB(0xfe1227d8, GetMemoryAddressOfMemoryChunk) // AJ_PackMemory_PackMem.c_IsChunkSignature +NSTUB(0xfe123514, GetNextMemoryChunk) +NSTUB(0xfe0d54fc, SRM_AllocateMemoryResourceFor1stJob) +NSTUB(0xfe0d58d0, SRM_FreeMemoryResourceFor1stJob) + +/** GUI for old cameras **/ +NSTUB( 0x36c0c, gui_timer_struct) // in GUI_Control_Post +NSTUB(0xfe151ccc, gui_change_mode) // GUI_ChangeMode_Post +NSTUB(0xfe1524ac, gui_local_post) +NSTUB(0xfe152ad4, gui_other_post) +// NSTUB( ???, gui_change_lcd_state_post) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ + +NSTUB(0xfe152ebc, gui_change_shoot_type_post) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ +NSTUB(0xfe153748, gui_init_event) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ +NSTUB(0xfe152e34, gui_post_10000085) /* present on 500D.111, 50D.109, 5D2.212 */ +// NSTUB( ???, gui_timer_something) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ + +/** GUI timers **/ +NSTUB(0xfe4828f8, CancelDateTimer) /* present on 7D.203, 6D.113, 5D3.113 */ +NSTUB(0xfe1290c8, CancelTimer) +NSTUB(0xfe120d20, SetHPTimerAfterNow) +NSTUB(0xfe120e10, SetHPTimerNextTick) +NSTUB(0xfe128ff8, SetTimerAfter) + +/** H264 Encoder **/ +NSTUB( 0x38a3c, mvr_config) +NSTUB(0xfe280edc, mvrFixQScale) +NSTUB(0xfe2809a0, mvrSetDefQScale) +NSTUB(0xfe2809e8, mvrSetFullHDOptSize) +NSTUB(0xfe280bcc, mvrSetGopOptSizeFULLHD) + +/** Interrupts **/ +// NSTUB( ???, isr_table_handler) /* present on 7D_MASTER.203 */ +// NSTUB( ???, isr_table_param) /* present on 7D_MASTER.203 */ +//NSTUB( ???, post_isr_hook) /* present on 7D.203, 6D.113, 5D3.113, EOSM.202 */ +//NSTUB( ???, pre_isr_hook) /* present on 7D.203, 6D.113, 5D3.113, 7D_MASTER.203, EOSM.202 */ + +/** LCD Sensor **/ +NSTUB(0xfe12bc18, DispSensorStart) +// NSTUB( ???, LightMeasure_n_Callback_r0) /* present on 7D.203, 5D2.212 */ + +/** Making the card bootable **/ +NSTUB( 0x48f94, cf_device) +NSTUB( 0x48fb8, sd_device) // in sdReadBlk +NSTUB(0xfe543e24, fsuDecodePartitionTable) + +/** Memory allocation **/ +NSTUB(0xfe127918, GetMemoryInformation) // called from AllocateMemory +NSTUB(0xfe1278c4, GetSizeOfMaxRegion) +NSTUB(0xfe127b78, _AllocateMemory) // "[MEM] NG AllocateMemory" +NSTUB(0xfe127f14, _FreeMemory) +NSTUB(0xfe11f3c8, _alloc_dma_memory) +NSTUB(0xfe2c5f28, _free) +NSTUB(0xfe2c1888, _free_dma_memory) +NSTUB(0xfe2c5ed0, _malloc) // maybe its better to use Allocate/Free? +// NSTUB( ???, free_dma_memory) /* present on 7D_MASTER.203 */ + +/** Message queues **/ +NSTUB( 0x7868, msg_queue_count) //ok +NSTUB( 0x7480, msg_queue_create) //ok CreateMessageQueue +NSTUB( 0x7814, msg_queue_post) //ok +NSTUB( 0x75d0, msg_queue_receive) //ok + +/** PTP **/ +NSTUB(0xfe36e86c, ptp_register_handler) +NSTUB(0xfe1fc97c, ptpPropSetUILock) /* present on 650D.104, 700D.113 */ + +/** Properties **/ +NSTUB(0xfe10c5e0, _prop_cleanup) +NSTUB(0xfe10be44, _prop_request_change) +NSTUB(0xfe10c438, prop_deliver) +NSTUB(0xfe10c4c0, prop_register_slave) // called by"GUI_RegisterPropertySlave" +// NSTUB( ???, prop_unregister_slave) /* present on 7D.203 */ + +/** RPC (for 7D) **/ +// NSTUB(0xFE2B8E18, BulkInIPCTransfer) /* present on 7D.203 */ +// NSTUB(0xFE2B8D54, BulkOutIPCTransfer) /* present on 7D.203 */ +// NSTUB(0xFE2B8F8C, QuickOutIPCTransfer) /* present on 7D.203 */ +// NSTUB(0xFE2B950C, RegisterRPCHandler) /* present on 7D.203, 7D_MASTER.203 */ +// NSTUB(0xFE2B95BC, RequestRPC) /* present on 7D.203, 7D_MASTER.203 */ + +/** Recursive locks **/ +NSTUB( 0xbcb8, AcquireRecursiveLock) +NSTUB( 0xbbf8, CreateRecursiveLock) +NSTUB( 0xbe28, ReleaseRecursiveLock) + +/** ResLock **/ +NSTUB(0xfe2a1818, CreateResLockEntry) +NSTUB(0xfe2a1d58, LockEngineResources) +NSTUB(0xfe2a1e90, UnLockEngineResources) + +/** Semaphores **/ +NSTUB( 0x30c8, create_named_semaphore) +NSTUB( 0x3358, give_semaphore) +NSTUB( 0x3270, take_semaphore) + +/** Task info **/ +//ok +NSTUB( 0x358ec, task_max) +//ok +NSTUB(0x4080, get_task_by_id) // AJ_task_trampoline_related_p10 FE2C2ED0 + +NSTUB(0x24c4, _get_task_info_by_id) // AJ_task_trampoline_related_p10 FE2C2ED0 +NSTUB(0x24c4, get_task_info_by_id) +THUMB_FN(0xfcb46b2c, _get_task_info_by_id) +//NSTUB(0xfEa95880, is_taskid_valid) // AJ_task_trampoline_related_p10 FE2C2ED0 + +NSTUB( 0x24c4, is_taskid_valid) // AJ_task_trampoline_related_p10 FE2C2ED0 + +NSTUB( 0x31170, current_task) +NSTUB( 0x640, current_interrupt) // in interrupt handler (0x18), where MEM(C0201004) is stored + + + + +/** Task sleep **/ +NSTUB( 0x3780, msleep) // called from EV_GETDONE_CACHE param 0x64 + +/** Tasks **/ +//NSTUB( 0x35924, task_dispatch_hook) // task_trampoline -> last call -> last non-empty BL -> one indirect call here +NSTUB( 0x8FBE0, task_dispatch_hook) +NSTUB( 0x38FC, task_create) +NSTUB( 0x41DC, task_trampoline) +// NSTUB( ???, current_task_ctx) /* present on 7D.203 */ +// NSTUB( ???, next_task_ctx) /* present on 7D.203 */ + +/** Misc **/ +NSTUB( 0x6d0a0, lv_path_struct) // first arg of SelectPathDriveMode +NSTUB(0xfe11ac24, LoadCalendarFromRTC) +NSTUB(0xfe2bbbc8, vsnprintf) +//NSTUB(0xFE0180A8, _print_serial) +//NSTUB( 0xff37aee4, ChangeHDMIOutputSizeToFULLHD) +//NSTUB( 0xff37b174, ChangeHDMIOutputSizeToVGA) +NSTUB(0xfe114b54, EnableImagePhysicalScreenParameter) /* present on 7D.203, 50D.109, 5D2.212 */ +// NSTUB( ???, FSUunMountDevice) /* present on 5D3.113 */ +// NSTUB( ???, PtpDps_remote_release_SW1_SW2_worker) /* present on 7D.203, 5D2.212 */ +// NSTUB( ???, memcpy) /* present on 7D_MASTER.203 */ + +NSTUB(0xfe0d48e4, TryReceiveMessageQueue) + + +/** Unused stubs or porting notes **/ +// NSTUB( 0xFF34B724, AJ_guess_LED_OFF ) +// NSTUB( 0xFF34B6F4, AJ_guess_LED_ON ) // led for SD/CF read and write ops +// NSTUB(0xFF29E25C, AfCtrl_SetLensParameterRemote) +// NSTUB(0xFF37FAF4, CancelBottomInfoDispTimer) +// NSTUB(0xFF234FCC, ChangeColorPalette) +// NSTUB(0xFF31DA7C, CreateDialogBox) +// NSTUB(0xFF31D214, DeleteDialogBox) +// NSTUB(0xFF1E65E4, FIO_SeekFile) +// NSTUB(0xFF23081C, GUI_GetFirmVersion) +// NSTUB(0xFF1115DC, GetJpegBufForLV) +// NSTUB(0xFF1115E8, GetJpegSizeForLV) +// NSTUB(0xFF073910, GetNumberOfChunks) +// NSTUB(0xFF073580, GetRemainOfMemoryChunk) +// NSTUB(0xFF0735B0, GetSizeOfMemoryChunk) +// NSTUB(0xFF0738AC, GetSizeOfMemorySuite) +// NSTUB(0xFF378968, HideBottomInfoDisp_maybe) // look for StartBottomInfoDispTimer +// NSTUB( 0x3787C, LV_EX_X) +// NSTUB( 0x37880, LV_EX_Y) +// NSTUB(0xFF1E963C, MuteOff_0) +// NSTUB(0xFF1E95F4, MuteOn_0) +// NSTUB(0xFF039D4C, PD_GetBatteryPower) +// NSTUB(0xFF0396E4, PD_RemoteRelease) +// NSTUB(0xFF05CB28, PROPAD_GetPropertyData) +// NSTUB(0xFF05BF04, PROP_GetMulticastProperty) +// NSTUB(0xFF1E09F8, PopEDmac) +// NSTUB( 0xFF1A16D0, ReadyLiveViewDevice ) +// NSTUB( 0xff33a734, RedrawDisplay ) +// NSTUB(0xFF14B9E4, RemoteRelease) +//NSTUB(0xFE1139DC, SetBitmapVramAddress) // where to find bmp_vram_info +// NSTUB(0xFF06FB60, SetHPTimerAfterTimeout) +// NSTUB( 0xFF1A1CA4, SleepLiveViewDevice ) // not found +// NSTUB(0xFF072280, _AllocateMemory_do) // no err70, malloc structure at 0x3070 +// NSTUB(0xFF05BF04, _prop_get_value) +// NSTUB(0xFF06DFCC, bootdisk_disable) +// NSTUB(0xFF06DFC0, bootdisk_enable) +// NSTUB( 0xFF4F2648, cfReadBlk ) +// NSTUB(0xFF010500, cli_save) +// NSTUB(0xFF31C444, ctrlman_dispatch_event) +// NSTUB(0xFF070F38, delete_semaphore) +// NSTUB(0xFF1E8FE0, dispcheck) +// NSTUB(0xFF06E690, dm_set_print_level) +// NSTUB(0xFF06E318, dmstart) +// NSTUB(0xFF06E358, dmstop) +// NSTUB(0xFF06ED38, dumpf) +// NSTUB(0xFF14B8F4, gui_lock) // PtpPropSetUILock +// NSTUB(0xFF56DCCC, gui_main_task_functbl) // 7 functions +// NSTUB(0xFF31C594, gui_task_create) +// NSTUB(0xFF31C6B4, gui_task_destroy) +// NSTUB( 0x1A7C, hotplug_struct) +// NSTUB(0xFF01B5D8, hotplug_task) +// NSTUB( 0x1AC8, hotplug_usb_buf) // after "USB Disconnect" +// NSTUB(0xFF04E9E4, mvrSetBitRate) +// NSTUB(0xFF1C94E0, mvrSetDeblockingFilter) +// NSTUB(0xFF1C97FC, mvrSetGopOptSizeHD) +// NSTUB(0xFF1C9874, mvrSetGopOptSizeVGA) +// NSTUB(0xFF1C96E8, mvrSetHDOptSize) +// NSTUB(0xFF1C9A94, mvrSetPrintMovieLog) +// NSTUB(0xFF1C9730, mvrSetVGAOptSize) +// NSTUB(0xFF06FCE4, oneshot_timer) +// NSTUB(0xFF230E48, prop_request_icu_auto_poweroff) // "PROP_Request PROP_ICU_AUTO_POWEROFF(%d)" +// NSTUB(0xFF14BAC8, ptpPropButtonSW1) +// NSTUB(0xFF14BC30, ptpPropButtonSW2) +// NSTUB(0xFF1FAEEC, register_func) +// NSTUB(0xFF4F838C, sdReadBlk) +// NSTUB(0xFF010514, sei_restore) +// NSTUB(0xFF2E1124, vram_get_number) // after "[ImgPlyer] Rate" +// NSTUB(0xFF1E7C04, vram_get_pos_and_size) diff --git a/platform/2000D.110/stubs.S.save b/platform/2000D.110/stubs.S.save new file mode 100644 index 000000000..93be2fecb --- /dev/null +++ b/platform/2000D.110/stubs.S.save @@ -0,0 +1,399 @@ +/** \file + * Entry points into the firmware image. + * + * These are the functions that we can call from our tasks + * in the Canon 1.1.0 firmware for the 2000D + * + */ +/* + * Copyright (C) 2021 Magic Lantern Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +// kitor: functions in early ram regions seem to match 1:1 1300D.110 + +/** Startup **/ +NSTUB( ROMBASEADDR, firmware_entry ) // 0xFE0C0000 +NSTUB(0xfe0c3a38, cstart) // +NSTUB( 0x29898, bzero32) // called by cstart() rom +NSTUB( 0x5254, create_init_task) // must be called from ram +NSTUB(0xFE129718, init_task) // passed as arg to create_init_task, look for dmSetup +NSTUB( 0x669e8, additional_version) + +/** File I/O **/ +NSTUB(0xfe2a35ac, FIO_CloseFile) // +NSTUB(0xfe2a4580, FIO_FindClose) // called with ret_FIO_FindFirstEx after finishing the dir scanning loop +NSTUB(0xfe2a44a0, FIO_FindNextEx) // +NSTUB(0xfe2a335c, _FIO_ReadFile) // +NSTUB(0xfe2a340c, FIO_SeekSkipFile) // same as SeekFile +NSTUB(0xfe2a34fc, _FIO_WriteFile) // +NSTUB(0xfe2a3dec, _FIO_CreateDirectory) // +NSTUB(0xfe2a3208, _FIO_CreateFile) // +NSTUB(0xfe2a43ac, _FIO_FindFirstEx) // +NSTUB(0xfe2a3728, _FIO_GetFileSize) // +NSTUB(0xfe2a314c, _FIO_OpenFile) // +NSTUB(0xfe2a32b4, _FIO_RemoveFile) // +NSTUB(0xfe2a3c24, _FIO_RenameFile) + +/** GUI **/ +NSTUB( 0x3136C, gui_main_struct) // in gui_main_task +NSTUB( 0x3d8c0, gui_task_list) +NSTUB(0xfe0cca74, GUI_ChangeMode) +NSTUB(0xfe0cc8b8, GUI_Control) +NSTUB(0xfe14d5b4, SetGUIRequestMode) +NSTUB(0xfe0ccf28, gui_init_end) // EndGuiInit +NSTUB(0xfe0cc4e8, gui_main_task) // message at 0x30, counter at 0x0c +NSTUB(0xfe14fe2c, gui_massive_event_loop) // GUI_Control_Post +NSTUB(0xfe2eac48, GUI_SetLvMode) /* present on 500D.111, 50D.109, 5D2.212 */ +// NSTUB( ???, GUI_SetMovieSize_a) /* present on 50D.109 */ +// NSTUB( ???, GUI_SetMovieSize_b) /* present on 50D.109 */ +NSTUB(0xfe2eae7c, Gui_SetSoundRecord) /* present on 6D.113, 5D2.212 */ + +/** ASIF **/ +// TODO: +NSTUB(0xfe11d200, PowerAudioOutput) //ok /* not found old FE108E44*/ +NSTUB(0xfe11b96c, SetAudioVolumeOut) //ok +NSTUB(0xfe106ac4, SetNextASIFADCBuffer) +NSTUB(0xfe106cb0, SetNextASIFDACBuffer) +NSTUB(0xfe11c6c4, SetSamplingRate) +NSTUB(0xfe105fac, StartASIFDMAADC) +NSTUB(0xfe106380, StartASIFDMADAC) +NSTUB(0xfe106600, StopASIFDMADAC) +NSTUB(0xfe11cd38, PowerMicAmp) /* present on 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe106728, SetASIFMode) /* present on 700D.113 , On 1300D not used*/ +//NSTUB(0xFE108E10, SetAudioVolumeIn) //? /* present on 6D.113 */ +NSTUB(0xfe108aa0, SoundDevActiveIn) //ok /* present on 7D.203, 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe108cf8, SoundDevShutDownIn)//ok /* present on 7D.203, 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe106258, StopASIFDMAADC) //ok /* present on 7D.203, 6D.113, EOSM.202 */ + + +/** Audio **/ +NSTUB( 0x31604, sounddev) // in sounddev_task +// TODO: Not found direct write it looks like its some kind of serial connection now + +NSTUB(0xfe2b2d5c, _audio_ic_read) // FE2B3A3C 0xFE2B3A3C +NSTUB(0xfe2b29f4, _audio_ic_write) // posible sub_FE2B3A18 + + +NSTUB(0xfe8b9b84, audio_thresholds) // find "ALV_Initialize", then pointer to "AudioLevel", thresholds are following array of 41 values +NSTUB(0xfe108aa0, sounddev_active_in) // "SoundDevActiveIn" +NSTUB(0xfe108690, sounddev_task) // "[SND] _SoundDeviceTask" +// NSTUB( ???, _audio_ic_write_bulk) /* present on 6D.116 */ + +/** Bitmap **/ +NSTUB( 0x54020, LCD_Palette) // in InitializeBitmapDisplayDevice, right after 0xc0f14800 +NSTUB( 0x55820, bmp_vram_info) + +/** CFN **/ +NSTUB(0xfe712ed4, GetCFnData) +NSTUB(0xfe713100, SetCFnData) +// NSTUB( ???, GUI_GetCFnForTab4) /* present on 7D.203 */ +// NSTUB(0xFE4716F0, GUI_SetCFnForTab4) /* present on 7D.203 */ + +/** Camera interface? **/ +// TODO: + NSTUB(0xC0220000, camera_engine) + +/** MPU communication **/ +NSTUB(0xFE2993B4, _mpu_send); /* dwSize < TXBD_DATA_SIZE */ +NSTUB(0xFE10FA70, _mpu_recv); /* registered in InitializeIntercom as CBR */ + +/** DMA **/ +NSTUB(0xfe124530, dma_memcpy) + +/** Debug messages **/ +NSTUB( 0x31bf4, dm_names) // in DebugMsg, before the 1st loop target +NSTUB(0xfe11f3c8, DryosDebugMsg) +NSTUB(0xfe11f730, dm_set_store_level) // called by "dmstore" +NSTUB(0xfe11f6c8, dm_set_print_level) + +/** Dialog API **/ +NSTUB(0xfe3f0334, dialog_redraw) +NSTUB(0xfe2f807c, dialog_set_property_str) + +/** Dialog handlers **/ +NSTUB(0xfe5ac5f4, ErrCardForLVApp_handler) // LiveViewErrorApp, as in 60D +NSTUB(0xfe455038, ErrForCamera_handler) // ERR70, ERR80 etc (DlgErrForCamera.c, AJ_DIALOG.HANDLER_DlgErrForCamera.c) +NSTUB(0xfe487ea8, HideUnaviFeedBack_maybe) // look for StartUnaviFeedBackTimer +NSTUB(0xfe48ca60, LiveViewApp_handler) +NSTUB(0xfe48d0cc, LiveViewApp_handler_BL_JudgeBottomInfoDispTimerState) +NSTUB(0xfe48e708, LiveViewApp_handler_end) // start of next function +NSTUB(0xfe4a8544, PlayMain_handler) +NSTUB(0xfe5e7ec8, PlayMovieGuideApp_handler) +NSTUB(0xfe49bc18, ShootOlcApp_handler) +// NSTUB( ???, LiveViewLevelApp_handler) /* present on 5D3.113 */ +// NSTUB( ???, LiveViewShutterApp_handler) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +// NSTUB(0xFE49AA14, LiveViewWbApp_handler) /* present on 7D.203, 5D3.113, 5D2.212 */ +// NSTUB( ???, LiveViewWifiApp_handler) /* present on 6D.113 */ +// NSTUB( ???, StartPlayProtectGuideApp) /* present on 7D.203, 5D2.212 */ +// NSTUB( ???, StopPlayProtectGuideApp) /* present on 7D.203, 5D2.212 */ + +/** Display **/ +NSTUB(0xfe40e2d4, MirrorDisplay) +NSTUB(0xfe40e334, NormalDisplay) +NSTUB(0xfe40e304, ReverseDisplay) + +/** EDMAC **/ +NSTUB(0xfe29da58, AbortEDmac) +NSTUB(0xfe29d764, ConnectReadEDmac) +NSTUB(0xfe29d6a0, ConnectWriteEDmac) +NSTUB(0xfe29db20, RegisterEDmacAbortCBR) +NSTUB(0xfe29daf8, RegisterEDmacCompleteCBR) +NSTUB(0xfe29dc24, RegisterEDmacPopCBR) +NSTUB(0xfe29d5e8, SetEDmac) +NSTUB(0xfe29d904, StartEDmac) +NSTUB(0xfe29db60, UnregisterEDmacAbortCBR) +NSTUB(0xfe29db0c, UnregisterEDmacCompleteCBR) +NSTUB(0xfe29dc38, UnregisterEDmacPopCBR) + +/** Electronic Level **/ +NSTUB(0xfe2ea488, GUI_SetRollingPitchingLevelStatus) + +/** Engio **/ +NSTUB(0xfe29e9f4, _EngDrvOut) +NSTUB(0xfe29eda0, _engio_write) +NSTUB(0xfe29e8e4, shamem_read) + +/** Eventprocs (call by name) **/ +NSTUB(0xfe1202bc, call) + +/** Events **/ +NSTUB(0xfe2c162c, TryPostEvent) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe2c1688, TryPostEvent_end) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe2bda54, TryPostStageEvent) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ +NSTUB(0xfe2bdab0, TryPostStageEvent_end) /* present on 6D.113, 650D.104, EOSM.202, 700D.113 */ + +/** ExMem **/ +NSTUB(0xfe122cb8, AddMemoryChunk) +NSTUB(0xfe125168, AllocateContinuousMemoryResource) // m_pfContAllocMemoryCBR +NSTUB(0xfe12511c, AllocateMemoryResource) // m_pfAllocMemoryCBR +NSTUB(0xfe122234, CreateMemoryChunk) +NSTUB(0xfe122a18, CreateMemorySuite) // FFCCEF34 +NSTUB(0xfe12284c, DeleteMemorySuite) // FFCCED2C +NSTUB(0xfe125280, FreeMemoryResource) // m_pfFreeMemoryCBR +NSTUB(0xfe122d88, GetFirstChunkFromSuite) // AJ_PackMemory_PackMem_p3 +NSTUB(0xfe1227d8, GetMemoryAddressOfMemoryChunk) // AJ_PackMemory_PackMem.c_IsChunkSignature +NSTUB(0xfe123514, GetNextMemoryChunk) +NSTUB(0xfe0d54fc, SRM_AllocateMemoryResourceFor1stJob) +NSTUB(0xfe0d58d0, SRM_FreeMemoryResourceFor1stJob) + +/** GUI for old cameras **/ +NSTUB( 0x36c0c, gui_timer_struct) // in GUI_Control_Post +NSTUB(0xfe151ccc, gui_change_mode) // GUI_ChangeMode_Post +NSTUB(0xfe1524ac, gui_local_post) +NSTUB(0xfe152ad4, gui_other_post) +// NSTUB( ???, gui_change_lcd_state_post) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ + +NSTUB(0xfe152ebc, gui_change_shoot_type_post) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ +NSTUB(0xfe153748, gui_init_event) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ +NSTUB(0xfe152e34, gui_post_10000085) /* present on 500D.111, 50D.109, 5D2.212 */ +// NSTUB( ???, gui_timer_something) /* present on 7D.203, 500D.111, 50D.109, 5D2.212 */ + +/** GUI timers **/ +NSTUB(0xfe4828f8, CancelDateTimer) /* present on 7D.203, 6D.113, 5D3.113 */ +NSTUB(0xfe1290c8, CancelTimer) +NSTUB(0xfe120d20, SetHPTimerAfterNow) +NSTUB(0xfe120e10, SetHPTimerNextTick) +NSTUB(0xfe128ff8, SetTimerAfter) + +/** H264 Encoder **/ +NSTUB( 0x38a3c, mvr_config) +NSTUB(0xfe280edc, mvrFixQScale) +NSTUB(0xfe2809a0, mvrSetDefQScale) +NSTUB(0xfe2809e8, mvrSetFullHDOptSize) +NSTUB(0xfe280bcc, mvrSetGopOptSizeFULLHD) + +/** Interrupts **/ +// NSTUB( ???, isr_table_handler) /* present on 7D_MASTER.203 */ +// NSTUB( ???, isr_table_param) /* present on 7D_MASTER.203 */ +//NSTUB( ???, post_isr_hook) /* present on 7D.203, 6D.113, 5D3.113, EOSM.202 */ +//NSTUB( ???, pre_isr_hook) /* present on 7D.203, 6D.113, 5D3.113, 7D_MASTER.203, EOSM.202 */ + +/** LCD Sensor **/ +NSTUB(0xfe12bc18, DispSensorStart) +// NSTUB( ???, LightMeasure_n_Callback_r0) /* present on 7D.203, 5D2.212 */ + +/** Making the card bootable **/ +NSTUB( 0x48f94, cf_device) +NSTUB( 0x48fb8, sd_device) // in sdReadBlk +NSTUB(0xfe543e24, fsuDecodePartitionTable) + +/** Memory allocation **/ +NSTUB(0xfe127918, GetMemoryInformation) // called from AllocateMemory +NSTUB(0xfe1278c4, GetSizeOfMaxRegion) +NSTUB(0xfe127b78, _AllocateMemory) // "[MEM] NG AllocateMemory" +NSTUB(0xfe127f14, _FreeMemory) +NSTUB(0xfe11f3c8, _alloc_dma_memory) +NSTUB(0xfe2c5f28, _free) +NSTUB(0xfe2c1888, _free_dma_memory) +NSTUB(0xfe2c5ed0, _malloc) // maybe its better to use Allocate/Free? +// NSTUB( ???, free_dma_memory) /* present on 7D_MASTER.203 */ + +/** Message queues **/ +NSTUB( 0x7868, msg_queue_count) //ok +NSTUB( 0x7480, msg_queue_create) //ok CreateMessageQueue +NSTUB( 0x7814, msg_queue_post) //ok +NSTUB( 0x75d0, msg_queue_receive) //ok + +/** PTP **/ +NSTUB(0xfe36e86c, ptp_register_handler) +NSTUB(0xfe1fc97c, ptpPropSetUILock) /* present on 650D.104, 700D.113 */ + +/** Properties **/ +NSTUB(0xfe10c5e0, _prop_cleanup) +NSTUB(0xfe10be44, _prop_request_change) +NSTUB(0xfe10c438, prop_deliver) +NSTUB(0xfe10c4c0, prop_register_slave) // called by"GUI_RegisterPropertySlave" +// NSTUB( ???, prop_unregister_slave) /* present on 7D.203 */ + +/** RPC (for 7D) **/ +// NSTUB(0xFE2B8E18, BulkInIPCTransfer) /* present on 7D.203 */ +// NSTUB(0xFE2B8D54, BulkOutIPCTransfer) /* present on 7D.203 */ +// NSTUB(0xFE2B8F8C, QuickOutIPCTransfer) /* present on 7D.203 */ +// NSTUB(0xFE2B950C, RegisterRPCHandler) /* present on 7D.203, 7D_MASTER.203 */ +// NSTUB(0xFE2B95BC, RequestRPC) /* present on 7D.203, 7D_MASTER.203 */ + +/** Recursive locks **/ +NSTUB( 0xbcb8, AcquireRecursiveLock) +NSTUB( 0xbbf8, CreateRecursiveLock) +NSTUB( 0xbe28, ReleaseRecursiveLock) + +/** ResLock **/ +NSTUB(0xfe2a1818, CreateResLockEntry) +NSTUB(0xfe2a1d58, LockEngineResources) +NSTUB(0xfe2a1e90, UnLockEngineResources) + +/** Semaphores **/ +NSTUB( 0x30c8, create_named_semaphore) +NSTUB( 0x3358, give_semaphore) +NSTUB( 0x3270, take_semaphore) + +/** Task info **/ +//ok +NSTUB( 0x358ec, task_max) +//ok +NSTUB(0x4080, get_task_by_id) // AJ_task_trampoline_related_p10 FE2C2ED0 + +NSTUB(0x24c4, _get_task_info_by_id) // AJ_task_trampoline_related_p10 FE2C2ED0 +NSTUB(0x24c4, get_task_info_by_id) +THUMB_FN(0xfcb46b2c, _get_task_info_by_id) +//NSTUB(0xfEa95880, is_taskid_valid) // AJ_task_trampoline_related_p10 FE2C2ED0 + +NSTUB( 0x24c4, is_taskid_valid) // AJ_task_trampoline_related_p10 FE2C2ED0 + +NSTUB( 0x31170, current_task) +NSTUB( 0x640, current_interrupt) // in interrupt handler (0x18), where MEM(C0201004) is stored + + + + +/** Task sleep **/ +NSTUB( 0x3780, msleep) // called from EV_GETDONE_CACHE param 0x64 + +/** Tasks **/ +NSTUB( 0x35924, task_dispatch_hook) // task_trampoline -> last call -> last non-empty BL -> one indirect call here +NSTUB( 0x38FC, task_create) +NSTUB( 0x41DC, task_trampoline) +// NSTUB( ???, current_task_ctx) /* present on 7D.203 */ +// NSTUB( ???, next_task_ctx) /* present on 7D.203 */ + +/** Misc **/ +NSTUB( 0x6d0a0, lv_path_struct) // first arg of SelectPathDriveMode +NSTUB(0xfe11ac24, LoadCalendarFromRTC) +NSTUB(0xfe2bbbc8, vsnprintf) +//NSTUB(0xFE0180A8, _print_serial) +//NSTUB( 0xff37aee4, ChangeHDMIOutputSizeToFULLHD) +//NSTUB( 0xff37b174, ChangeHDMIOutputSizeToVGA) +NSTUB(0xfe114b54, EnableImagePhysicalScreenParameter) /* present on 7D.203, 50D.109, 5D2.212 */ +// NSTUB( ???, FSUunMountDevice) /* present on 5D3.113 */ +// NSTUB( ???, PtpDps_remote_release_SW1_SW2_worker) /* present on 7D.203, 5D2.212 */ +// NSTUB( ???, memcpy) /* present on 7D_MASTER.203 */ + +NSTUB(0xfe0d48e4, TryReceiveMessageQueue) + + +/** Unused stubs or porting notes **/ +// NSTUB( 0xFF34B724, AJ_guess_LED_OFF ) +// NSTUB( 0xFF34B6F4, AJ_guess_LED_ON ) // led for SD/CF read and write ops +// NSTUB(0xFF29E25C, AfCtrl_SetLensParameterRemote) +// NSTUB(0xFF37FAF4, CancelBottomInfoDispTimer) +// NSTUB(0xFF234FCC, ChangeColorPalette) +// NSTUB(0xFF31DA7C, CreateDialogBox) +// NSTUB(0xFF31D214, DeleteDialogBox) +// NSTUB(0xFF1E65E4, FIO_SeekFile) +// NSTUB(0xFF23081C, GUI_GetFirmVersion) +// NSTUB(0xFF1115DC, GetJpegBufForLV) +// NSTUB(0xFF1115E8, GetJpegSizeForLV) +// NSTUB(0xFF073910, GetNumberOfChunks) +// NSTUB(0xFF073580, GetRemainOfMemoryChunk) +// NSTUB(0xFF0735B0, GetSizeOfMemoryChunk) +// NSTUB(0xFF0738AC, GetSizeOfMemorySuite) +// NSTUB(0xFF378968, HideBottomInfoDisp_maybe) // look for StartBottomInfoDispTimer +// NSTUB( 0x3787C, LV_EX_X) +// NSTUB( 0x37880, LV_EX_Y) +// NSTUB(0xFF1E963C, MuteOff_0) +// NSTUB(0xFF1E95F4, MuteOn_0) +// NSTUB(0xFF039D4C, PD_GetBatteryPower) +// NSTUB(0xFF0396E4, PD_RemoteRelease) +// NSTUB(0xFF05CB28, PROPAD_GetPropertyData) +// NSTUB(0xFF05BF04, PROP_GetMulticastProperty) +// NSTUB(0xFF1E09F8, PopEDmac) +// NSTUB( 0xFF1A16D0, ReadyLiveViewDevice ) +// NSTUB( 0xff33a734, RedrawDisplay ) +// NSTUB(0xFF14B9E4, RemoteRelease) +//NSTUB(0xFE1139DC, SetBitmapVramAddress) // where to find bmp_vram_info +// NSTUB(0xFF06FB60, SetHPTimerAfterTimeout) +// NSTUB( 0xFF1A1CA4, SleepLiveViewDevice ) // not found +// NSTUB(0xFF072280, _AllocateMemory_do) // no err70, malloc structure at 0x3070 +// NSTUB(0xFF05BF04, _prop_get_value) +// NSTUB(0xFF06DFCC, bootdisk_disable) +// NSTUB(0xFF06DFC0, bootdisk_enable) +// NSTUB( 0xFF4F2648, cfReadBlk ) +// NSTUB(0xFF010500, cli_save) +// NSTUB(0xFF31C444, ctrlman_dispatch_event) +// NSTUB(0xFF070F38, delete_semaphore) +// NSTUB(0xFF1E8FE0, dispcheck) +// NSTUB(0xFF06E690, dm_set_print_level) +// NSTUB(0xFF06E318, dmstart) +// NSTUB(0xFF06E358, dmstop) +// NSTUB(0xFF06ED38, dumpf) +// NSTUB(0xFF14B8F4, gui_lock) // PtpPropSetUILock +// NSTUB(0xFF56DCCC, gui_main_task_functbl) // 7 functions +// NSTUB(0xFF31C594, gui_task_create) +// NSTUB(0xFF31C6B4, gui_task_destroy) +// NSTUB( 0x1A7C, hotplug_struct) +// NSTUB(0xFF01B5D8, hotplug_task) +// NSTUB( 0x1AC8, hotplug_usb_buf) // after "USB Disconnect" +// NSTUB(0xFF04E9E4, mvrSetBitRate) +// NSTUB(0xFF1C94E0, mvrSetDeblockingFilter) +// NSTUB(0xFF1C97FC, mvrSetGopOptSizeHD) +// NSTUB(0xFF1C9874, mvrSetGopOptSizeVGA) +// NSTUB(0xFF1C96E8, mvrSetHDOptSize) +// NSTUB(0xFF1C9A94, mvrSetPrintMovieLog) +// NSTUB(0xFF1C9730, mvrSetVGAOptSize) +// NSTUB(0xFF06FCE4, oneshot_timer) +// NSTUB(0xFF230E48, prop_request_icu_auto_poweroff) // "PROP_Request PROP_ICU_AUTO_POWEROFF(%d)" +// NSTUB(0xFF14BAC8, ptpPropButtonSW1) +// NSTUB(0xFF14BC30, ptpPropButtonSW2) +// NSTUB(0xFF1FAEEC, register_func) +// NSTUB(0xFF4F838C, sdReadBlk) +// NSTUB(0xFF010514, sei_restore) +// NSTUB(0xFF2E1124, vram_get_number) // after "[ImgPlyer] Rate" +// NSTUB(0xFF1E7C04, vram_get_pos_and_size) diff --git a/platform/Makefile.platform.map b/platform/Makefile.platform.map index c842bc188..6d3a95680 100755 --- a/platform/Makefile.platform.map +++ b/platform/Makefile.platform.map @@ -22,6 +22,7 @@ PLATFORM_MAP = \ 750D.110 \ 850D.100 \ 1100D.105 \ + 2000D.110 \ EOSM.202 \ M50.110 \ R.180 \ diff --git a/src/bmp.c b/src/bmp.c index d1616b7c6..7e93c2762 100755 --- a/src/bmp.c +++ b/src/bmp.c @@ -371,7 +371,7 @@ bmp_puts( uint32_t fg_color = fontspec_fg(fontspec); uint32_t bg_color = fontspec_bg(fontspec); - + qprintf("A"); int len = rbf_draw_string((void*)font_dynamic[FONT_ID(fontspec)].bitmap, *x, *y, s, FONT(fontspec, fg_color, bg_color)); *x += len; @@ -1167,6 +1167,7 @@ int bfnt_draw_char(int c, int px, int py, int fg, int bg) if (c >= 0 && !bfnt_ok()) { #ifndef PYCPARSER /* circular dependency */ + qprintf("Font Addr Bad, %x", c); bmp_printf(FONT_SMALL, 0, 0, "font addr bad"); #endif return 0; diff --git a/src/fps-engio.c b/src/fps-engio.c index 65f77910d..10a8207f2 100755 --- a/src/fps-engio.c +++ b/src/fps-engio.c @@ -317,6 +317,17 @@ static void fps_read_current_timer_values(); #define FPS_TIMER_B_MIN 1050 #define SENSOR_TIMING_TABLE MEM(0xce98) #define VIDEO_PARAMETERS_SRC_3 0x70C0C + +#elif defined(CONFIG_1300D) || defined(CONFIG_2000D) +// #define NEW_FPS_METHOD 1 +// #define SENSOR_TIMING_TABLE MEM(0x4015C) +// #define VIDEO_PARAMETERS_SRC_3 0x6A95C + #define TG_FREQ_BASE 28800000 + #undef FPS_TIMER_A_MIN + #define FPS_TIMER_A_MIN (ZOOM ? 734 : MV1080 ? 546 :576) + #undef FPS_TIMER_B_MIN + #define FPS_TIMER_B_MIN (ZOOM ? 1312 : MV480 ? 2000 : MV720 ? 1000 : 2200) + #elif defined(CONFIG_5D3) #define NEW_FPS_METHOD 1 #ifdef CONFIG_5D3_123 diff --git a/src/fw-signature.h b/src/fw-signature.h index be1047906..c92c6aa28 100755 --- a/src/fw-signature.h +++ b/src/fw-signature.h @@ -48,6 +48,7 @@ #define SIG_850D_100 0xad55d877 // from e0040000 #define SIG_SX740_102 0x53535fe8 // from e0040000 #define SIG_SX70_111 0x7c81fbc1 // from 0xe004000 +#define SIG_2000D_110 0x70ca4ca6 // from FE0C0000 (atypical) static uint32_t compute_signature(uint32_t * start, uint32_t num) { diff --git a/src/gui-common.c b/src/gui-common.c index 4f20000d5..38fb170d8 100644 --- a/src/gui-common.c +++ b/src/gui-common.c @@ -165,6 +165,9 @@ int handle_common_events_startup(struct event * event) if (handle_tricky_canon_calls(event) == 0) return 0; + qprintf("HANDLE_COMMOMEV"); + qprintn(event->param); + extern int ml_started; if (!ml_started) { #if defined(BGMT_Q_SET) // combined Q/SET button? diff --git a/src/gui.c b/src/gui.c index 825f9b706..5c94baf0a 100755 --- a/src/gui.c +++ b/src/gui.c @@ -74,7 +74,8 @@ static int handle_buttons(struct event * event) if (!ml_started) return 1; // SJE Want to log button presses? Uncomment the following line -// DryosDebugMsg(0,15,"event: %08x", event->param); + DryosDebugMsg(0,15,"BUTTON event: %08x", event->param); +// qprintf("button %x", event->param); if (handle_common_events_by_feature(event) == 0) return 0; return 1; @@ -106,11 +107,12 @@ extern struct gui_main_struct gui_main_struct; void ml_gui_main_task() { + qprintf("Hello from ml_gui_main_task"); + DryosDebugMsg(0,15,"ml_gui_main_task"); struct event * event = NULL; int index = 0; void* funcs[GMT_NFUNCS]; memcpy(funcs, (void*)GMT_FUNCTABLE, 4*GMT_NFUNCS); - gui_init_end(); // no params? while(1) diff --git a/src/init.c b/src/init.c index e07a74fdc..871c31409 100755 --- a/src/init.c +++ b/src/init.c @@ -331,12 +331,17 @@ static void hello_world() while (!bmp_vram_raw()) msleep(100); - //DryosDebugMsg(0, 15, "==== HELLO WORLD ===="); + DryosDebugMsg(0, 15, "==== HELLO WORLD ===="); int colour = 4; while(1) { - bmp_printf(FONT_LARGE, 140, 50, "Hello, World!"); - bmp_printf(FONT_LARGE, 140, 400, "firmware signature = 0x%x", sig); + DryosDebugMsg(0, 15, "Before bmpprint"); + void *pc; + asm("mov %0, pc" : "=r"(pc)); + qprintf("%#x\n", pc); + bmp_printf(0x0201, 140, 50, "Hello, World!"); + DryosDebugMsg(0, 15, "After bmpprint"); +// bmp_printf(FONT_LARGE, 140, 400, "firmware signature = 0x%x", sig); if (colour == 15) colour = 4; @@ -347,7 +352,7 @@ static void hello_world() draw_test_pattern(colour); ml_refresh_display_needed = 1; - msleep(200); + msleep(50); //info_led_blink(1, 500, 500); } } @@ -406,6 +411,7 @@ static void led_fade(int arg1, void * on) */ static void my_big_init_task() { + qprintf("Hello from ml_init\n"); _mem_init(); _find_ml_card(); @@ -440,8 +446,10 @@ static void my_big_init_task() return; } + qprintf("Trying to load Fonts"); _load_fonts(); + qprintf("Success loading Fonts"); // SJE not sure on best place to do this. Before HELLO_WORLD is nice // if possible, needs to be after DryOS inits task scheduler. I assume // that has happened but don't know how to check. @@ -461,10 +469,15 @@ static void my_big_init_task() return; #endif + qprintf("[DBG] PowerSave\n"); call("DisablePowerSave"); + qprintf("[DBG] cbr\n"); _ml_cbr_init(); + qprintf("[DBG] Menu\n"); menu_init(); + qprintf("[DBG] dgbinit\n"); debug_init(); + qprintf("[DBG] callinit\n"); call_init_funcs(); // among other things, this initialises modules msleep(200); // leave some time for property handlers to run @@ -503,6 +516,7 @@ static void my_big_init_task() task->entry = PIC_RESOLVE(task->entry); task->arg = PIC_RESOLVE(task->arg); #endif + qprintf("TASK CREATE %s\n", task->name); task_create( task->name, task->priority, @@ -679,7 +693,7 @@ void boot_post_init_task(void) } msleep(50); - task_create("ml_init", 0x1e, 0x4000, my_big_init_task, 0 ); + task_create("ml_init", 0x1f, 0x4000, my_big_init_task, 0 ); return; } diff --git a/src/mem.c b/src/mem.c index 398e4f7b1..b4d76fe44 100644 --- a/src/mem.c +++ b/src/mem.c @@ -794,7 +794,7 @@ static int search_for_allocator(int size, int require_preferred_size, int requir /* do we have enough free space without exceeding the preferred limit? */ int free_space = allocators[a].get_free_space ? allocators[a].get_free_space() : 30*1024*1024; - //~ dbg_printf("%s: free space %s\n", allocators[a].name, format_memory_size(free_space)); + dbg_printf("%s: free space %s\n", allocators[a].name, format_memory_size(free_space)); if (!( ( /* preferred free space is... well... optional */ diff --git a/src/menu.c b/src/menu.c index 3afaedaa9..644b0d597 100755 --- a/src/menu.c +++ b/src/menu.c @@ -5133,6 +5133,9 @@ int handle_ml_menu_touch(struct event * event) int handle_ml_menu_keys(struct event * event) { + + qprintf("Handle_ml_key %x", event->param); + if (menu_shown || arrow_keys_shortcuts_active()) handle_ml_menu_keyrepeat(event); @@ -6248,15 +6251,15 @@ static struct longpress qset_longpress = { int handle_ml_menu_erase(struct event *event) { // SJE if we get here, ML GUI is almost working! -// DryosDebugMsg(0, 15, "in handle_ml_menu_erase"); + DryosDebugMsg(0, 15, "in handle_ml_menu_erase"); if (dofpreview) return 1; // don't open menu when DOF preview is locked // SJE useful for logging buttons -// DryosDebugMsg(0, 15, "event->param 0x%x", event->param); + DryosDebugMsg(0, 15, "event->param 0x%x", event->param); // SJE logging GUIMODE -// DryosDebugMsg(0, 15, "guimode: %d", CURRENT_GUI_MODE); + DryosDebugMsg(0, 15, "guimode: %d", CURRENT_GUI_MODE); #if 0 // SJE bubbles hack for fun diff --git a/src/propvalues.h b/src/propvalues.h index 219517e79..d21e1fc5b 100644 --- a/src/propvalues.h +++ b/src/propvalues.h @@ -32,6 +32,7 @@ extern char camera_serial[32]; #define MODEL_EOS_700D 0x80000326 #define MODEL_EOS_M 0x80000331 #define MODEL_EOS_100D 0x80000346 +#define MODEL_EOS_2000D 0x80000417 #ifndef _DONT_INCLUDE_PROPVALUES_ extern int lv; // TRUE when LiveView is active diff --git a/src/raw.c b/src/raw.c index abad600f7..dce5a6f59 100755 --- a/src/raw.c +++ b/src/raw.c @@ -310,6 +310,26 @@ static int get_default_white_level() -903, 10000, 2016, 10000, 6728, 10000 #endif +#ifdef CONFIG_1300D + // PLACEHOLDER DATA FROM 600D TO BUILD HELLOWORLD + //~ { "Canon EOS 1300D", 0, 0x3510, + //~ { 6461,-907,-882,-4300,12184,2378,-819,1944,5931 } }, + #define CAM_COLORMATRIX1 \ + 6461, 10000, -907, 10000, -882, 10000,\ + -4300, 10000, 12184, 10000, 2378, 10000, \ + -819, 10000, 1944, 10000, 5931, 10000 +#endif + +#ifdef CONFIG_2000D + // PLACEHOLDER DATA FROM 1300D TO BUILD HELLOWORLD + //~ { "Canon EOS 2000D", 0, 0x3510, + //~ { 6461,-907,-882,-4300,12184,2378,-819,1944,5931 } }, + #define CAM_COLORMATRIX1 \ + 6461, 10000, -907, 10000, -882, 10000,\ + -4300, 10000, 12184, 10000, 2378, 10000, \ + -819, 10000, 1944, 10000, 5931, 10000 +#endif + #ifdef CONFIG_60D //~ { "Canon EOS 60D", 0, 0x2ff7, //~ { 6719,-994,-925,-4408,12426,2211,-887,2129,6051 } }, @@ -552,6 +572,10 @@ static int dynamic_ranges[] = {1146, 1139, 1116, 1061, 980, 898, 806, 728}; static int dynamic_ranges[] = {1099, 1098, 1082, 1025, 965, 877, 784}; // No ISO 12800 available #endif +#ifdef CONFIG_2000D +static int dynamic_ranges[] = {1095, 1104, 1075, 1027, 953, 874, 785}; +#endif + #ifdef CONFIG_650D static int dynamic_ranges[] = {1062, 1047, 1021, 963, 888, 804, 695, 623, 548}; #endif diff --git a/tools/font/CanonMonospace_40_ffd8.bfnt b/tools/font/CanonMonospace_40_ffd8.bfnt new file mode 100644 index 000000000..c95b76cae Binary files /dev/null and b/tools/font/CanonMonospace_40_ffd8.bfnt differ diff --git a/tools/font/HCanonGothic_40_ffd8.bfnt b/tools/font/HCanonGothic_40_ffd8.bfnt new file mode 100644 index 000000000..e81abcb70 Binary files /dev/null and b/tools/font/HCanonGothic_40_ffd8.bfnt differ diff --git a/tools/indy/CanonMonospace_40_ffd8.bfnt b/tools/indy/CanonMonospace_40_ffd8.bfnt new file mode 100644 index 000000000..c95b76cae Binary files /dev/null and b/tools/indy/CanonMonospace_40_ffd8.bfnt differ diff --git a/tools/indy/HCanonGothic_40_ffd8.bfnt b/tools/indy/HCanonGothic_40_ffd8.bfnt new file mode 100644 index 000000000..e81abcb70 Binary files /dev/null and b/tools/indy/HCanonGothic_40_ffd8.bfnt differ