Assembla home | Assembla project page
 

Changeset 400

Show
Ignore:
Timestamp:
05/20/08 16:33:37 (2 years ago)
Author:
DataGhost
Message:

Branch dataghost:
+ Added A570 1.00e (very basic because of broken firmware file)
+ Added A570 1.01a (full)
+ Added a firmware dumper
Revision 400 :)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dataghost/core/dgmod.c

    r397 r400  
    4444int *dg_cameralog_file_dynamic_entry; 
    4545 
     46int dg_firm_dump_start_addr; 
    4647 
    4748//--- Local global variables ---------------------------------------- 
     
    140141void dg_cameralog_file_stop(); 
    141142void dg_cameralog_file_dynamic_call(int arg); 
     143 
     144void dg_dump_firmware(int arg); 
    142145 
    143146//--- Local function prototypes ------------------------------------- 
     
    15431546} 
    15441547 
     1548 
     1549// --- Firmware dumper ---------------------------------------------- 
     1550void dg_dump_firmware(int arg) { 
     1551        char *base; 
     1552        int fd; 
     1553         
     1554        started(); 
     1555         
     1556        if(dg_firm_dump_start_addr == 0) { 
     1557                base = (char *) 0xFF810000; 
     1558        } else { 
     1559                base = (char *) 0xFFC00000; 
     1560        } 
     1561         
     1562        fd = open("A/PRIMARY.BIN", O_WRONLY|O_CREAT|O_TRUNC, 0777); 
     1563        if(fd >= 0) { 
     1564                write(fd, base, 0xFFFFFFFF - (int) base); 
     1565                close(fd); 
     1566        } 
     1567         
     1568        finished(); 
     1569} 
     1570 
     1571 
     1572 
  • branches/dataghost/core/dgmod.h

    r397 r400  
    8080extern void dg_dynamic_menu_init(); 
    8181 
     82extern void dg_dump_firmware(int arg); 
     83 
    8284extern long *_GetShutterReadyStateVar(long); 
    8385 
     
    9496extern int *dg_cameralog_file_dynamic_entry; 
    9597 
     98extern int dg_firm_dump_start_addr; 
    9699 
    97100 
  • branches/dataghost/core/gui.c

    r399 r400  
    174174const char* gui_dg_led_number_enum(int change, int arg); 
    175175const char* gui_dg_led_action_enum(int change, int arg); 
     176const char* gui_dg_firmware_addr_enum(int change, int arg); 
    176177static void gui_draw_dg_hexviewer(int arg); 
    177178static int dg_show_is_internals_always = 0; 
     
    239240static CMenu dg_is_submenu = {LANG_MENU_DG_IS_MENU_TITLE, NULL, dg_is_submenu_items }; 
    240241 
     242static CMenuItem dg_firmware_submenu_items[] = { 
     243        {LANG_MENU_DG_FIRM_DUMP_START_ADDR,MENUITEM_ENUM,           (int*)gui_dg_firmware_addr_enum }, 
     244        {LANG_MENU_DG_FIRM_DUMP_DUMP,      MENUITEM_PROC,           (int*)dg_dump_firmware }, 
     245        {LANG_MENU_BACK,                   MENUITEM_UP }, 
     246        {0} 
     247}; 
     248 
     249static CMenu dg_firmware_submenu = {LANG_MENU_DG_FIRM_DUMP_MENU_TITLE, NULL, dg_firmware_submenu_items }; 
     250 
    241251 
    242252static CMenuItem dg_submenu_items[] = { 
     
    247257        {LANG_MENU_DG_BRIGHT_MENU,         MENUITEM_SUBMENU,        (int*)&dg_bright_submenu }, 
    248258#endif 
     259        {LANG_MENU_DG_FIRM_DUMP_MENU,      MENUITEM_SUBMENU,        (int*)&dg_firmware_submenu }, 
    249260        {LANG_MENU_DG_QUICK_DEBUGGER,      MENUITEM_PROC,           (int*)dg_quick_debugger }, 
    250261        {LANG_MENU_DG_HEXVIEWER,           MENUITEM_PROC,           (int*)gui_draw_dg_hexviewer }, 
     
    14901501        dg_cameralog_screen_draw(); 
    14911502    } 
    1492      
     1503    //static int disablemute = 0; 
     1504    //if(!disablemute) { 
     1505        //_DispSwCon_DisableMute(); // Disables screen muting (log entries still appear, though) 
     1506        //disablemute = 1; 
     1507    //} 
    14931508    // Disables disabling the screen, so it still displays stuff during image 
    14941509    // capture and shutdown. 
    14951510    //_MuteOffPhysicalScreen(); 
    1496      
     1511    //_DispSwCon_MuteOffPhysicalScreen(); 
     1512    //_TurnOnDisplay(); 
     1513    //_DispSw_Unlock(); 
    14971514    gui_in_redraw = 1; 
    14981515    gui_mode_old = gui_mode; 
     
    25182535} 
    25192536 
    2520          
    2521  
    2522  
     2537 
     2538const char* gui_dg_firmware_addr_enum(int change, int arg) { 
     2539    static const char* modes[]={ "FF81...", "FFC0..."}; 
     2540 
     2541    dg_firm_dump_start_addr+=change; 
     2542    if (dg_firm_dump_start_addr<0) 
     2543        dg_firm_dump_start_addr = 1; 
     2544    else if (dg_firm_dump_start_addr>1) 
     2545        dg_firm_dump_start_addr = 0; 
     2546 
     2547    return modes[dg_firm_dump_start_addr]; 
     2548
     2549 
     2550 
     2551 
     2552 
  • branches/dataghost/core/gui_lang.c

    r397 r400  
    505505"403 \"Resume logging camera log to file\"\n" 
    506506 
     507"404 \"Firmware dumping ->\"\n" 
     508"405 \"Firmware dumping\"\n" 
     509"406 \"FW start address\"\n" 
     510"407 \"Dump FW to A/PRIMARY.BIN\"\n" 
    507511 
    508512; 
  • branches/dataghost/core/gui_lang.h

    r397 r400  
    514514#define LANG_MENU_DG_CAMLOG_FILE_RESUME         403 
    515515 
     516#define LANG_MENU_DG_FIRM_DUMP_MENU             404 
     517#define LANG_MENU_DG_FIRM_DUMP_MENU_TITLE       405 
     518#define LANG_MENU_DG_FIRM_DUMP_START_ADDR       406 
     519#define LANG_MENU_DG_FIRM_DUMP_DUMP             407 
     520 
    516521 
    517522 
    518523//------------------------------------------------------------------- 
    519524 
    520 #define GUI_LANG_ITEMS                  403 
     525#define GUI_LANG_ITEMS                  407 
    521526 
    522527//------------------------------------------------------------------- 
  • branches/dataghost/platform/a570/sub/100e/stubs_entry_2.S

    r311 r400  
    1616NHSTUB(GetDrive_FreeClusters, 0xFFE463BC) 
    1717NHSTUB(WriteSDCard, 0xFFE58EEC) 
     18 
     19 
     20/////////// 
     21// Following functions are for dgmod. If there is documentation for them, it is 
     22// likely to be found in platform/s5is/sub/101b/stubs_entry_2.S. 
     23// Currently these functions ALL point to nullsub_1 (FFC017E4). They are here 
     24// only to get CHDK to compile. Please do not use the functions using these, 
     25// behaviour may be undefined. 
     26NHSTUB(GetISPitchPWM,                   0xFFC017E4) 
     27NHSTUB(GetISYawPWM,                     0xFFC017E4) 
     28NHSTUB(GetISShiftLensPitchPosition,     0xFFC017E4) 
     29NHSTUB(GetISShiftLensYawPosition,       0xFFC017E4) 
     30NHSTUB(SetISPitchPWM,                   0xFFC017E4) 
     31NHSTUB(SetISYawPWM,                     0xFFC017E4) 
     32NHSTUB(MoveISLensToTopLimitPosition,    0xFFC017E4) 
     33NHSTUB(MoveISLensToBottomLimitPosition, 0xFFC017E4) 
     34NHSTUB(MoveISLensToLeftLimitPosition,   0xFFC017E4) 
     35NHSTUB(MoveISLensToRightLimitPosition,  0xFFC017E4) 
     36NHSTUB(MoveISLensToCentralPosition,     0xFFC017E4) 
     37 
     38NHSTUB(GetISHallDevicePitchOffset,      0xFFC017E4) 
     39NHSTUB(GetISHallDeviceYawOffset,        0xFFC017E4) 
     40NHSTUB(GetISHallDevicePitchGain,        0xFFC017E4) 
     41NHSTUB(GetISHallDeviceYawGain,          0xFFC017E4) 
     42NHSTUB(GetISGyroPitchOffset,            0xFFC017E4) 
     43NHSTUB(GetISGyroYawOffset,              0xFFC017E4) 
     44NHSTUB(GetISGyroPitchGain,              0xFFC017E4) 
     45NHSTUB(GetISGyroYawGain,                0xFFC017E4) 
     46NHSTUB(GetISLensCenterShiftAaxis,       0xFFC017E4) 
     47NHSTUB(GetISLensCenterShiftBaxis,       0xFFC017E4) 
     48NHSTUB(GetISLensEViAaxis,               0xFFC017E4) 
     49NHSTUB(GetISLensEViBaxis,               0xFFC017E4) 
     50NHSTUB(GetISLensDampAaxis,              0xFFC017E4) 
     51NHSTUB(GetISLensDampBaxis,              0xFFC017E4) 
     52 
     53// Second set of IS lens controls 
     54NHSTUB(GetISDriveAaxis,                 0xFFC017E4) 
     55NHSTUB(GetISDriveBaxis,                 0xFFC017E4) 
     56NHSTUB(GetISPositionAaxis,              0xFFC017E4) 
     57NHSTUB(GetISPositionBaxis,              0xFFC017E4) 
     58NHSTUB(GetISHallOffsetAaxis,            0xFFC017E4) 
     59NHSTUB(GetISHallOffsetBaxis,            0xFFC017E4) 
     60NHSTUB(GetISHallGainAaxis,              0xFFC017E4) 
     61NHSTUB(GetISHallGainBaxis,              0xFFC017E4) 
     62NHSTUB(GetISGyroGainAaxis,              0xFFC017E4) 
     63NHSTUB(GetISGyroGainBaxis,              0xFFC017E4) 
     64NHSTUB(GetISCoefficientP_A,             0xFFC017E4) 
     65NHSTUB(GetISCoefficientP_B,             0xFFC017E4) 
     66NHSTUB(GetISCoefficientI_A,             0xFFC017E4) 
     67NHSTUB(GetISCoefficientI_B,             0xFFC017E4) 
     68NHSTUB(GetISCoefficientD_A,             0xFFC017E4) 
     69NHSTUB(GetISCoefficientD_B,             0xFFC017E4) 
     70NHSTUB(GetISPLFAaxis,                   0xFFC017E4) 
     71NHSTUB(GetISPLFBaxis,                   0xFFC017E4) 
     72NHSTUB(GetISLPFAaxis,                   0xFFC017E4) 
     73NHSTUB(GetISLPFBaxis,                   0xFFC017E4) 
     74NHSTUB(GetISDbgData,                    0xFFC017E4) 
     75NHSTUB(GetISADData,                     0xFFC017E4) 
     76NHSTUB(GetISDampAaxis,                  0xFFC017E4) 
     77NHSTUB(GetISDampBaxis,                  0xFFC017E4) 
     78NHSTUB(GetISEViAaxis,                   0xFFC017E4) 
     79NHSTUB(GetISEViBaxis,                   0xFFC017E4) 
     80NHSTUB(GetISHallOut1Amp,                0xFFC017E4) 
     81NHSTUB(ISActive,                        0xFFC017E4) 
     82 
     83NHSTUB(GetWBStruct,                     0xFFC017E4) 
     84 
     85NHSTUB(MuteOffPhysicalScreen,           0xFFC017E4) 
     86 
     87 
     88NHSTUB(PostLEDMessage,                  0xFFC017E4) 
     89 
     90NHSTUB(TurnOnDisplay,                   0xFFC017E4) 
     91NHSTUB(TurnOffDisplay,                  0xFFC017E4) 
     92NHSTUB(TurnOnBackLight,                 0xFFC017E4) 
     93NHSTUB(TurnOffBackLight,                0xFFC017E4) 
     94NHSTUB(SwitchOnDisplay,                 0xFFC017E4) 
     95NHSTUB(SwitchOffDisplay,                0xFFC017E4) 
     96 
     97NHSTUB(StopContinuousVRAMData,          0xFFC017E4) 
     98 
     99NHSTUB(GetShutterReadyStateVar,         0xFFC017E4) 
     100 
  • branches/dataghost/platform/a570/sub/100e/stubs_min.S

    r247 r400  
    1111DEF(canon_shoot_menu_active,0x27B1) 
    1212DEF(recreview_hold, 0x2584) 
     13 
     14// Found in PutsCameraLogEvent, right before calling the actual 'puts' function 
     15// ROM:FFC059BC   LDR     R3, =0xD9CC 
     16// ROM:FFC059C0   LDR     R0, [R3] 
     17// ROM:FFC059C4   BL      LogPutsToBuffer 
     18DEF(dg_cameralog_base, 0xD9CC) 
     19 
  • branches/dataghost/platform/a570/sub/101a/stubs_entry_2.S

    r311 r400  
    1717NHSTUB(WriteSDCard, 0xFFE58F60) 
    1818 
     19 
     20/////////// 
     21// Following functions are for dgmod. If there is documentation for them, it is 
     22// likely to be found in platform/s5is/sub/101b/stubs_entry_2.S. 
     23NHSTUB(GetISPitchPWM,                             0xFFE0F1BC) 
     24NHSTUB(GetISYawPWM,                               0xFFE0F1D0) 
     25NHSTUB(GetISShiftLensPitchPosition,               0xFFE0F1E4) 
     26NHSTUB(GetISShiftLensYawPosition,                 0xFFE0F1F8) 
     27NHSTUB(SetISPitchPWM,                             0xFFE0EF58) 
     28NHSTUB(SetISYawPWM,                               0xFFE0EF68) 
     29NHSTUB(MoveISLensToTopLimitPosition,              0xFFE0EE4C) 
     30NHSTUB(MoveISLensToBottomLimitPosition,           0xFFE0EE3C) 
     31NHSTUB(MoveISLensToLeftLimitPosition,             0xFFE0EE2C) 
     32NHSTUB(MoveISLensToRightLimitPosition,            0xFFE0EE1C) 
     33NHSTUB(MoveISLensToCentralPosition,               0xFFE0F090) 
     34 
     35NHSTUB(GetISHallDevicePitchOffset,                0xFFE0F15C) 
     36NHSTUB(GetISHallDeviceYawOffset,                  0xFFE0F16C) 
     37NHSTUB(GetISHallDevicePitchGain,                  0xFFE0F17C) 
     38NHSTUB(GetISHallDeviceYawGain,                    0xFFE0F18C) 
     39NHSTUB(GetISGyroPitchOffset,                      0xFFE0EDD4) 
     40NHSTUB(GetISGyroYawOffset,                        0xFFE0EDCC) 
     41NHSTUB(GetISGyroPitchGain,                        0xFFE0F19C) 
     42NHSTUB(GetISGyroYawGain,                          0xFFE0F1AC) 
     43NHSTUB(GetISLensCenterShiftAaxis,                 0xFFE0EDA0) 
     44NHSTUB(GetISLensCenterShiftBaxis,                 0xFFE0EDA8) 
     45NHSTUB(GetISLensEViAaxis,                         0xFFE0F20C) 
     46NHSTUB(GetISLensEViBaxis,                         0xFFE0F220) 
     47NHSTUB(GetISLensDampAaxis,                        0xFFE0F234) 
     48NHSTUB(GetISLensDampBaxis,                        0xFFE0F248) 
     49 
     50// Second set of IS lens controls 
     51NHSTUB(GetISDriveAaxis,                           0xFFE8B0C8) 
     52NHSTUB(GetISDriveBaxis,                           0xFFE8B104) 
     53NHSTUB(GetISPositionAaxis,                        0xFFE8B144) 
     54NHSTUB(GetISPositionBaxis,                        0xFFE8B184) 
     55NHSTUB(GetISHallOffsetAaxis,                      0xFFE8B1C8) 
     56NHSTUB(GetISHallOffsetBaxis,                      0xFFE8B20C) 
     57NHSTUB(GetISHallGainAaxis,                        0xFFE8B24C) 
     58NHSTUB(GetISHallGainBaxis,                        0xFFE8B28C) 
     59NHSTUB(GetISGyroGainAaxis,                        0xFFE8B2CC) 
     60NHSTUB(GetISGyroGainBaxis,                        0xFFE8B30C) 
     61NHSTUB(GetISCoefficientP_A,                       0xFFE8B810) 
     62NHSTUB(GetISCoefficientP_B,                       0xFFE8B850) 
     63NHSTUB(GetISCoefficientI_A,                       0xFFE8B890) 
     64NHSTUB(GetISCoefficientI_B,                       0xFFE8B8D0) 
     65NHSTUB(GetISCoefficientD_A,                       0xFFE8B910) 
     66NHSTUB(GetISCoefficientD_B,                       0xFFE8B950) 
     67NHSTUB(GetISPLFAaxis,                             0xFFE8B68C) 
     68NHSTUB(GetISPLFBaxis,                             0xFFE8B6BC) 
     69NHSTUB(GetISLPFAaxis,                             0xFFE8B70C) 
     70NHSTUB(GetISLPFBaxis,                             0xFFE8B73C) 
     71NHSTUB(GetISDbgData,                              0xFFE8B3D8) 
     72NHSTUB(GetISADData,                               0xFFE8B41C) 
     73NHSTUB(GetISDampAaxis,                            0xFFE8B56C) 
     74NHSTUB(GetISDampBaxis,                            0xFFE8B5A4) 
     75NHSTUB(GetISEViAaxis,                             0xFFE8B5DC) 
     76NHSTUB(GetISEViBaxis,                             0xFFE8B614) 
     77NHSTUB(GetISHallOut1Amp,                          0xFFE8B50C) 
     78NHSTUB(ISActive,                                  0xFFC017E4) // nullsub_1 
     79 
     80NHSTUB(GetWBStruct,                               0xFFC017E4) // nullsub_1, useless for now 
     81 
     82NHSTUB(MuteOffPhysicalScreen,                     0xFFC34DD8) 
     83 
     84 
     85NHSTUB(PostLEDMessage,                            0xFFDE5890) 
     86 
     87NHSTUB(TurnOnDisplay,                             0xFFC34CE8) 
     88NHSTUB(TurnOffDisplay,                            0xFFC34D14) 
     89NHSTUB(TurnOnBackLight,                           0xFFC34D40) 
     90NHSTUB(TurnOffBackLight,                          0xFFC34D70) 
     91NHSTUB(SwitchOnDisplay,                           0xFFE0C28C) 
     92NHSTUB(SwitchOffDisplay,                          0xFFE0C258) 
     93 
     94NHSTUB(StopContinuousVRAMData,                    0xFFC017E4) // nullsub_1, useless for now 
     95 
     96NHSTUB(GetShutterReadyStateVar,                   0xFFC017E4) // nullsub_1, useless for now 
     97 
     98 
     99 
  • branches/dataghost/platform/a570/sub/101a/stubs_min.S

    r247 r400  
    1111DEF(canon_shoot_menu_active,0x27B1) 
    1212DEF(recreview_hold, 0x2584) 
     13 
     14// Found in PutsCameraLogEvent, right before calling the actual 'puts' function 
     15// ROM:FFC059BC   LDR     R3, =0xD9CC 
     16// ROM:FFC059C0   LDR     R0, [R3] 
     17// ROM:FFC059C4   BL      LogPutsToBuffer 
     18DEF(dg_cameralog_base, 0xD9CC) 
     19