Magic Lantern Firmware Wiki
Advertisement

Parent: http://magiclantern.wikia.com/wiki/2.0.4_AJ

There is mention of using 'Engio writes' to change the zooming on this page: Ref: http://magiclantern.wikia.com/wiki/2.0.4_Zoom_n_Magnification Ref on how the DIGIC regs are programmed for Zoom: http://magiclantern.wikia.com/wiki/2.0.4_DIGIC_config_for_Zoom


Quick summary

When simple single, or lists of DIGIC variables are updated, AJ_EngDrvOut_1xVar() and AJ_EngDrvOut_NVariables() is used.


When there is negotiation then AJ_engio_write() is used. This has list of DIGIC regs (mapped into memory), and values to write to them, processed until the EndOfList maker 0xFFFFFFFF is found.

Some of these lists may repeat the same addresses more than once to pass data to the DIGIC.

[Guess] Some DIGIC addresses are send 0x80000000, 0x0, and 0x1. It seems these are used as a 'Need to modify related DIGIC addresses' / 'ok, done, DIGIC can now read the new values'.



[2009_06_21] AJ_EngDrvOut_1xVar_to_ShadowStruct() = 0xFF9A52F0

; +------------------------------------------------------------------+
; |  AJ_EngDrvOut_1xVar_to_ShadowStruct()                            |
; |                                                                  |
; | Store R1 to Shadow_struct[ Bot28Bits(R0) ]                       |
; +------------------------------------------------------------------+
;
; int R0 = parm1. Bottom 28 bits = offset in Shadow_struct.  (eg: 0xC0F0814C)
; int R1 = parm2.  Store Parm2 in shadow_struct[ bot28bits(parm1) ]

Below is an example in which a low_memory_copy of DIGIC memory - which I call is Shadow struct) has one of its values modified.

ROM:FFA8F228                 LDR     R0, =0xC0F11400
ROM:FFA8F22C                 MOV     R1, #1
ROM:FFA8F230                 BL      AJ_EngDrvOut_1xVar_to_ShadowStruct

[2009_06_21] AJ_EngDrvOut_NVariables() = 0x:FF9A539C.

; +---------------------------------------------------+
; |  AJ_EngDrvOut_NVariables()                        |
; |                                                   |
; |  Copy N variables from one struct to another.     |
; |  Make 2nd copy to shadow_struct based on STR addr |
; +---------------------------------------------------+
;
; int R0 = parm1 = STR to this address
; int R1 = parm2 = LDR from address
; int R2 = parm3 = number of variables to copy

And below is an example of this reading 4 quadwords from the Stack (SP), and writing them to 0xC0F11408.

ROM:FFA8F2E0                 LDR     R0, =0xC0F11408
ROM:FFA8F2E4                 MOV     R2, #4
ROM:FFA8F2E8                 MOV     R1, SP
ROM:FFA8F2EC                 BL      AJ_EngDrvOut_NVars

[2009_06_20] AJ_engio_write() = 0xFF9A5460. I will move this out to a separate page (when I get my act together!).

; +-----------------------------------------------------------+
; | AJ_engio_write()                                          |
; |                                                           |
; | Work through structure of [Addr,data] term by 0xFFFFFFFF  |
; | [Addr] = data.  Do the same into a shadow_struct          |
; +-----------------------------------------------------------+
;
; int R0 = parm1 = Addr of [addr, data] struct to read
; int RETURN_R0  = Number of variables copied (eg: 240 for aAJ_image_pass_x1)

And here is an example of an 'engio_write_struct' in memory. AJ_engio_write() goes through all the address on the left, and writes the data on right into that location.

aAJ_0xFFCA8A64_engio_write_struct_x1 
ROM:FFCA8A64    DCD unk_C0F1D040    ,        0x80000000; 0
ROM:FFCA8A64    DCD dword_C0F08130  ,        0x80000000; 2
ROM:FFCA8A64    DCD dword_C0F08180  ,        0x80000000; 4
ROM:FFCA8A64    DCD dword_C0F08020  ,        0x80000000; 6
ROM:FFCA8A64    DCD dword_C0F08000  ,        0x80000000; 8
ROM:FFCA8A64    DCD dword_C0F08540  ,        0x80000000; 10
ROM:FFCA8A64    DCD dword_C0F080A0  ,        0x80000000; 12
ROM:FFCA8A64    DCD dword_C0F08090  ,        0x80000000; 14
ROM:FFCA8A64    DCD aAJ_0xC0F08114_set_by_StartImagePass_x1,unk_A           ; 16
ROM:FFCA8A64    DCD dword_C0F0D000  ,        0x80000000; 18
ROM:FFCA8A64    DCD aAJ_0xC0F11004_EngDrvOut,unk_0           ; 20
ROM:FFCA8A64    DCD aAJ_0xC0F112C0_EngDrvOut,unk_1           ; 22
ROM:FFCA8A64    DCD aAJ_0xC0F11300_EngDrvOut,unk_1           ; 24
ROM:FFCA8A64    DCD dword_C0F111C0          ,unk_1           ; 26
ROM:FFCA8A64    DCD dword_C0F11580          ,unk_1           ; 28
ROM:FFCA8A64    DCD dword_C0F11584          ,unk_0           ; 30
ROM:FFCA8A64    DCD dword_C0F11440          ,unk_1           ; 32
ROM:FFCA8A64    DCD dword_C0F11444          ,unk_0           ; 34
ROM:FFCA8A64    DCD dword_C0F11044          ,unk_0           ; 36
ROM:FFCA8A64    DCD 0xFFFFFFFF,             0xFFFFFFFF; 38

2010_05_26] list of 16 routines for 'engio_write' to set zoom level to x1, x5 and x10 retrospectively starting at [ROM:0xFFC7A304]

[as mentioned at the top of this page -> more info on zooming here: http://magiclantern.wikia.com/wiki/2.0.4_Zoom_n_Magnification]


#     IntermediatePass_x1 
AJ_STR_to_HDMI_SetImagePass_struct_0x13E8C_0x04_x1,
AJ_calls_SetImagePass_x1, 
AJ_StartImagePass_x1, 
AJ_0xFFA081D4_seems_to_be_x1_related, 
AJ_calls_Guess_x1_related, 
AJ_Guess_Set_n_Start_x1_related, 
AJ_ImagePass_related_x1,
AJ_calls_eng_set_dummy_cbr, 
AJ_SetHivshdIrParameter_x1,
--> AJ_0x13F78_engine_struct_x1x5x10, 
AJ_SetIntermediatePass_x1, 
AJ_StarIntermediatePass_x1, 
--> AJ_0x13F78_n_callback_engine_struct_x1x5x10, 
--> AJ_0x13F78_LockEngineResources_x1x5x10, 
--> AJ_0x13F78_n_0xC0F1E000_x1x5x10, 
0

#     IntermediatePass_x5 
AJ_SetImagePassParameter_x5, 
AJ_SetImagePass_x5, 
AJ_StartImagePass_x5, 
AJ_0x13EC0_struct_engio_x5, 
AJ_ClearImagePass_x5,
AJ_0x13EC0_n_0xC0F08000_struct_engio_x5, 
AJ_Guess_Set_n_clear_ImagePass_x5_related,
AJ_eng_set_dummy_cbr_x5,
AJ_null_sub_x5,
--> AJ_0x13F78_engine_struct_x1x5x10, 
AJ_SetIntermediatePassMagnify_x5x10, 
AJ_StartIntermediatePassMagnify_x5x10, 
--> AJ_0x13F78_n_callback_engine_struct_x1x5x10, 
--> AJ_0x13F78_LockEngineResources_x1x5x10, 
--> AJ_0x13F78_n_0xC0F1E000_x1x5x10, 
0


#    IntermediatePass_x10 
AJ_STR_0x13F0C_0x04_SetImagePass_x10_struct, 
AJ_SetImagePass_x10, 
AJ_StartImagePass_x10, 
AJ_Start_n_SetImagePass_x10, 
AJ_dummy_cbr_engio_x10, 
AJ_0xC0F11000_n_0xC0F08000_engio_x10, 
AJ_Guess_Start_n_Set_ImagePass_x10_related, 
AJ_eng_set_dummy_cbr_x10, 
AJ_null_sub_x10, 
--> AJ_0x13F78_engine_struct_x1x5x10, 
AJ_SetIntermediatePassMagnify_x5x10, 
AJ_StartIntermediatePassMagnify_x5x10, 
--> AJ_0x13F78_n_callback_engine_struct_x1x5x10, 
--> AJ_0x13F78_LockEngineResources_x1x5x10, 
--> AJ_0x13F78_n_0xC0F1E000_x1x5x10, 
0
Advertisement