| 1 | #include "stubs_asm.h" |
|---|
| 2 | |
|---|
| 3 | // ROM addresses |
|---|
| 4 | |
|---|
| 5 | // used to point non existing or not found functions to empty sub |
|---|
| 6 | #define NULLSUB 0xFF810B1C |
|---|
| 7 | |
|---|
| 8 | // --- not found by finsig |
|---|
| 9 | NHSTUB(Lseek, 0xFF836ED4) // OK, same as lseek, like G11 |
|---|
| 10 | NHSTUB(RefreshPhysicalScreen, 0xFFA12124) // OK, search String "ScreenUnLock", like G11 |
|---|
| 11 | NHSTUB(ScreenLock, 0xFFA1356C) // search String "ScreenLock", G11 is different |
|---|
| 12 | NHSTUB(ScreenUnLock, 0xFFA12124) // aka. RefreshPhysicalScreen, search String "ScreenUnLock", G11 is different |
|---|
| 13 | NHSTUB(Remove, 0xFF836DEC) // OK!, like G11, SX200 is different but reference is same, lua os.remove delete file but fail on directory, looks like other cameras behave the same, wrong ?!? |
|---|
| 14 | NHSTUB(kbd_read_keys, 0xFF8347D4) // OK!! |
|---|
| 15 | NHSTUB(openfastdir, 0xFFA95C90) // OK, AKA. opendir, looks simular to A720, like G11 |
|---|
| 16 | NHSTUB(readfastdir, 0xFFA95DE4) // maybe ok, looks simular to A720, G11 is different but referens is same |
|---|
| 17 | NHSTUB(ReadFastDir, 0xFFA95DE4) // aka. readfastdir |
|---|
| 18 | NHSTUB(UIFS_WriteFirmInfoToFile, 0xFF984AB4) // OK!, eventproc |
|---|
| 19 | //NHSTUB(SetScriptMode, 0xFF895904) // eventproc |
|---|
| 20 | NHSTUB(SetScriptMode, 0xFF810F6C) // OK!, like SX210 and G11 |
|---|
| 21 | //NHSTUB(UnlockAF, 0xFF83831C) // OK!, like SX210 and G11 |
|---|
| 22 | NHSTUB(UnlockAF, 0xFF87A920) // PT_UnlockAF, like D10 |
|---|
| 23 | //NHSTUB(DoAFLock, 0xFF8382E4) // OK!, like SX210 and G11 |
|---|
| 24 | NHSTUB(DoAFLock, 0xFF87A910) // PT_DoAFLock, like D10 |
|---|
| 25 | |
|---|
| 26 | NHSTUB(GiveSemaphore, 0xFF839E38) // OK!!, eventproc, like G11 |
|---|
| 27 | NHSTUB(GetDrive_FreeClusters, 0xFF871E90) // OK!, like SX210 and G11, UI does show free space |
|---|
| 28 | NHSTUB(PT_PlaySound, 0xFF8840B8) // OK!, like SX210 and G11, plays sound on CHDK startup |
|---|
| 29 | //NHSTUB(rename, 0xFF83669C) // maybe OK, like SX210 |
|---|
| 30 | NHSTUB(rename, 0xFF836E94) // maybe OK, like G11 |
|---|
| 31 | NHSTUB(qsort, 0xFFB0B1F8) // maybe OK, like SX210, G11 and D10 are different but referens is same |
|---|
| 32 | NHSTUB(EnterToCompensationEVF, 0xFF8383E4) // OK, like SX210 and G11 |
|---|
| 33 | NHSTUB(ExitFromCompensationEVF, 0xFF838428) // OK, like SX210 and G11 |
|---|
| 34 | NHSTUB(PostLEDMessage, 0xFF860C6C) // like SX210 |
|---|
| 35 | NHSTUB(TurnOffBackLight, 0xFF8A4980) // OK, like G11 |
|---|
| 36 | NHSTUB(TurnOnBackLight, 0xFF8A4968) // OK, like G11 |
|---|
| 37 | NHSTUB(GetZoomLensCurrentPoint, 0xFF965E54) // OK, like SX210, G11 is different but referens is same |
|---|
| 38 | NHSTUB(GetZoomLensCurrentPosition, 0xFFAA9298) // OK, like SX210, G11 is different but referens is same |
|---|
| 39 | NHSTUB(GetCurrentAvValue, 0xFF9644F8) // OK, like SX210, G11 is different but referens is same |
|---|
| 40 | NHSTUB(PutInNdFilter, 0xFFB2056C) // OK, like G11, referens from Function Table (ROM:FFC2AE64) |
|---|
| 41 | NHSTUB(PutOutNdFilter, 0xFFB205A4) // OK, like G11, referens from Function Table (ROM:FFC2AE5C) |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | // Multi Partition Support |
|---|
| 45 | //NHSTUB(ReadSDCard, 0xFF9522B0) // probably, like SD990 |
|---|
| 46 | // "Make bootable" does nothing, "Debug Parameters -> Create card with two partitions" cause shutdown (create_partitions()) |
|---|
| 47 | NHSTUB(WriteSDCard, 0xFF952494) // shutdown |
|---|
| 48 | //NHSTUB(WriteSDCard, 0xFF9522B0) // shutdown |
|---|
| 49 | //NHSTUB(WriteSDCard, 0xFF95266C) // shutdown |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | // --- NULLSTUBS (not found by finsig) |
|---|
| 53 | NHSTUB(UnsetZoomForMovie, NULLSUB) // nullsub_1, does not exist since canon firmware allow Zoom for Movie |
|---|
| 54 | NHSTUB(SetZoomActuatorSpeedPercent, NULLSUB) // ToDo: nullsub_1 |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | // --- Those aren't used or don't exist in DryOS (like A720 and other) |
|---|
| 58 | NHSTUB(Mount_FileSystem, NULLSUB) // nullsub_1 |
|---|
| 59 | NHSTUB(Unmount_FileSystem, NULLSUB) // nullsub_1 |
|---|
| 60 | NHSTUB(rewinddir, NULLSUB) // nullsub_1 |
|---|
| 61 | NHSTUB(kbd_pwr_off, NULLSUB) // nullsub_1, does not exist, like SD990 |
|---|
| 62 | NHSTUB(kbd_pwr_on, NULLSUB) // nullsub_1, does not exist, like SD990 |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | // --- stubs_entry.S (finsig) |
|---|
| 66 | // ROM:FF96CBFC register libc function |
|---|
| 67 | //NHSTUB(AllocateMemory, 0xffab8cf0) // OK!! (malloc) |
|---|
| 68 | //NHSTUB(AllocateMemory, 0xFF814100) // malloc, is the actual function, other are just jumps |
|---|
| 69 | //NHSTUB(AllocateUncacheableMemory, 0xff83a41c) // OK!! |
|---|
| 70 | //NHSTUB(Close, 0xff836db8) // OK!!!, eventproc |
|---|
| 71 | //NHSTUB(CreateTask, 0xff81e83c) // OK!!, eventproc |
|---|
| 72 | //NHSTUB(DeleteFile_Fut, 0xff836730) // OK! |
|---|
| 73 | //NHSTUB(ExecuteEventProcedure, 0xFF88B9C0) // cause shutdown, referens from FactoryMode Stuff and eventproc_export_ExecuteEventProcedure() |
|---|
| 74 | //NHSTUB(ExecuteEventProcedure, 0xFF88B948) // finsig, like SD990, OK |
|---|
| 75 | //NHSTUB(ExitTask, 0xff81eacc) // OK!, eventproc |
|---|
| 76 | //NHSTUB(Fclose_Fut, 0xff8368ac) // OK!, eventproc |
|---|
| 77 | //NHSTUB(Feof_Fut, 0xff836a98) // OK! |
|---|
| 78 | //NHSTUB(Fflush_Fut, 0xff836ad4) // OK!! |
|---|
| 79 | //NHSTUB(Fgets_Fut, 0xff836a00) // OK! |
|---|
| 80 | //NHSTUB(Fopen_Fut, 0xff83686c) // OK!, eventproc |
|---|
| 81 | //NHSTUB(Fread_Fut, 0xff836958) // OK!, eventproc |
|---|
| 82 | //NHSTUB(FreeMemory, 0xffab8ce8) // OK!, eventproc |
|---|
| 83 | //NHSTUB(FreeUncacheableMemory, 0xff83a45c) // OK!!, finsig2 |
|---|
| 84 | //NHSTUB(Fseek_Fut, 0xff836a4c) // OK!, eventproc |
|---|
| 85 | //NHSTUB(Fwrite_Fut, 0xff8369ac) // OK!, eventproc |
|---|
| 86 | //NHSTUB(GetBatteryTemperature, 0xff8652a0) // OK |
|---|
| 87 | //NHSTUB(GetCCDTemperature, 0xff86522c) // OK |
|---|
| 88 | //NHSTUB(GetDrive_ClusterSize, 0xff871e30) // maybe ok, like D10, finsig2 |
|---|
| 89 | //NHSTUB(GetDrive_TotalClusters, 0xff871e64) // maybe ok, finsig2 |
|---|
| 90 | //NHSTUB(GetFocusLensSubjectDistance, 0xff9629b8) // maybe ok |
|---|
| 91 | //NHSTUB(GetFocusLensSubjectDistanceFromLens, 0xff962d40) // maybe ok, finsig2 |
|---|
| 92 | //NHSTUB(GetOpticalTemperature, 0xff865314) // maybe ok |
|---|
| 93 | //NHSTUB(GetParameterData, 0xff9975f4) // OK!, like SX210 |
|---|
| 94 | //NHSTUB(GetPropertyCase, 0xff88f660) // OK! |
|---|
| 95 | //NHSTUB(GetSystemTime, 0xffab8d48) // OK!!, eventproc |
|---|
| 96 | //NHSTUB(IsStrobeChargeCompleted, 0xff8da44c) |
|---|
| 97 | //NHSTUB(IsStrobeChargeCompleted, 0xFF8DA424) // maybe ok |
|---|
| 98 | NHSTUB(IsStrobeChargeCompleted, 0xFF8DA44C) // like SX210 |
|---|
| 99 | //NHSTUB(LocalTime, 0xff88923c) // OK |
|---|
| 100 | //NHSTUB(LockMainPower, 0xff895b78) // OK! |
|---|
| 101 | //NHSTUB(MakeDirectory_Fut, 0xff8367a4) // OK, like SD990, finsig2 |
|---|
| 102 | //NHSTUB(MoveFocusLensToDistance, 0xffb228b0) // finsig2 |
|---|
| 103 | NHSTUB(MoveFocusLensToDistance, 0xFFB2289C) // ?!? |
|---|
| 104 | //NHSTUB(MoveZoomLensWithPoint, 0xffab6b64) // maybe ok |
|---|
| 105 | //NHSTUB(NewTaskShell, 0xff88f06c) // OK |
|---|
| 106 | //NHSTUB(Open, 0xff86f13c) // finsig, WRONG ? |
|---|
| 107 | //NHSTUB(Open, 0xFF81A9E4) // open, don't cause shutdown |
|---|
| 108 | //NHSTUB(Open, 0xFF836D4C) // eventproc, like SX210, cause shutdown |
|---|
| 109 | //NHSTUB(PostLogicalEventForNotPowerType, 0xff893948) // OK!!, eventproc |
|---|
| 110 | //NHSTUB(PostLogicalEventToUI, 0xff893994) // OK!, eventproc |
|---|
| 111 | //NHSTUB(Read, 0xff81ac7c) // OK!! |
|---|
| 112 | //NHSTUB(RenameFile_Fut, 0xff836868) // finsig, WRONG!, does not point to function start, finsig2 |
|---|
| 113 | NHSTUB(RenameFile_Fut, 0xFF83669C) // OK, like SD990 and G11 |
|---|
| 114 | //NHSTUB(SetAutoShutdownTime, 0xff895bec) // OK |
|---|
| 115 | //NHSTUB(SetCurrentCaptureModeType, 0xff89e550) // OK |
|---|
| 116 | //NHSTUB(SetFileTimeStamp, 0xff9514c0) // finsig, WRONG!, does not point to function start, finsig2 |
|---|
| 117 | NHSTUB(SetFileTimeStamp, 0xFF837054) // maybe ok, like G11 and SX210 |
|---|
| 118 | //NHSTUB(SetLogicalEventActive, 0xff8958b4) // OK |
|---|
| 119 | //NHSTUB(SetParameterData, 0xff997564) // maybe ok |
|---|
| 120 | //NHSTUB(SetPropertyCase, 0xff88f530) // maybe ok |
|---|
| 121 | //NHSTUB(SleepTask, 0xff83a0a0) // OK eventproc |
|---|
| 122 | //NHSTUB(TakeSemaphore, 0xff839d68) // OK eventproc |
|---|
| 123 | //NHSTUB(UnlockMainPower, 0xff895acc) // OK eventproc |
|---|
| 124 | |
|---|
| 125 | //NHSTUB(UpdateMBROnFlash, 0xFF871CB0) // finsig, OK, "Make card bootable" does work (ROM:FFAB92B8 MakeScriptDisk -> ROM:FF871D5C aMakeScriptDisk -> ROM:FF871CB0 UpdateMBROnFlash), finsig2 |
|---|
| 126 | //NHSTUB(MakeSDCardBootable, 0xFF871D30) // not used |
|---|
| 127 | |
|---|
| 128 | //NHSTUB(VbattGet, 0xff8330d8) // OK, eventproc |
|---|
| 129 | //NHSTUB(_log, 0xffb5b348) |
|---|
| 130 | //NHSTUB(_log10, 0xffb59fd4) |
|---|
| 131 | //NHSTUB(_pow, 0xffb5a144) |
|---|
| 132 | //NHSTUB(_sqrt, 0xffb5cf50) |
|---|
| 133 | //NHSTUB(close, 0xff81aa94) // OK!!!, like D10 |
|---|
| 134 | //NHSTUB(closedir, 0xffa95e28) // does not point to function start, finsig2 |
|---|
| 135 | NHSTUB(closedir, 0xFFA95C40) // OK, like SX210 |
|---|
| 136 | //NHSTUB(closefastdir, 0xffa95e28) // finsig, WRONG!, does not point to function start, finsig2 |
|---|
| 137 | NHSTUB(closefastdir, 0xFFA95C40) // aka. closedir |
|---|
| 138 | //NHSTUB(free, 0xff81415c) // OK! |
|---|
| 139 | //NHSTUB(kbd_p1_f, 0xff83484c) // OK |
|---|
| 140 | //NHSTUB(kbd_p1_f_cont, 0xff834858) // OK |
|---|
| 141 | //NHSTUB(kbd_p2_f, 0xff8340d0) // maybe ok |
|---|
| 142 | //NHSTUB(kbd_read_keys_r2, 0xff86122c) // OK! |
|---|
| 143 | //NHSTUB(lseek, 0xff836ee0) // finsig, WRONG!, does not point to function start |
|---|
| 144 | NHSTUB(lseek, 0xFF836ED4) // OK, same as Lseek |
|---|
| 145 | //NHSTUB(malloc, 0xff814100) // OK!, referens from AllocateUncacheableMemory, D10 is different |
|---|
| 146 | //NHSTUB(memcmp, 0xff82066c) // OK!!, eventproc, like D10 |
|---|
| 147 | //NHSTUB(memcpy, 0xff83fae8) // OK!!, eventproc, like D10 |
|---|
| 148 | //NHSTUB(memset, 0xffa15ddc) // OK!, eventproc |
|---|
| 149 | //NHSTUB(mkdir, 0xff837254) // OK!, like SX210 and G11, finsig2 |
|---|
| 150 | //NHSTUB(mktime_ext, 0xff8ac9f0) // OK!, like SD990 and G11 |
|---|
| 151 | //NHSTUB(open, 0xff81a9e4) // OK!!!, like D10 |
|---|
| 152 | //NHSTUB(opendir, 0xffa95c90) // looks OK, AKA openfastdir, D10 is different, finsig2 |
|---|
| 153 | //NHSTUB(rand, 0xff820774) // OK, finsig2 |
|---|
| 154 | //NHSTUB(read, 0xff81ac7c) // OK! |
|---|
| 155 | //NHSTUB(srand, 0xff820768) // OK, finsig2 |
|---|
| 156 | //NHSTUB(stat, 0xff836f1c) // OK, like G11 |
|---|
| 157 | //NHSTUB(strcat, 0xff813f5c) // WRONG, does point to strncpy, finsig2 |
|---|
| 158 | NHSTUB(strcat, 0xFF8AC1AC) // OK!!, like G11 and D10 |
|---|
| 159 | //NHSTUB(strchr, 0xff813fe4) // OK!!, like D10, finsig2 |
|---|
| 160 | //NHSTUB(strcmp, 0xff820628) // OK |
|---|
| 161 | //NHSTUB(strcpy, 0xff820610) // OK |
|---|
| 162 | //NHSTUB(strftime, 0xff8ac3f8) // OK, like G11 |
|---|
| 163 | //NHSTUB(strlen, 0xff814030) // OK |
|---|
| 164 | //NHSTUB(strncmp, 0xff813f98) // OK!, like D10 |
|---|
| 165 | //NHSTUB(strncpy, 0xff813f5c) // OK!, finsig2 |
|---|
| 166 | //NHSTUB(strrchr, 0xff83fac0) // finsig, WRONG!, finsig2 |
|---|
| 167 | NHSTUB(strrchr, 0xFF814008) // OK!!, like G11 and D10 |
|---|
| 168 | //NHSTUB(strtol, 0xff83fdc8) // OK |
|---|
| 169 | //NHSTUB(strtolx, 0xff83fbcc) // OK |
|---|
| 170 | //NHSTUB(time, 0xff88981c) // looks simular to A720, finsig2 |
|---|
| 171 | //NHSTUB(vsprintf, 0xff8205d4) // OK! |
|---|
| 172 | //NHSTUB(write, 0xff81acdc) // OK, like SD990 and G11 |
|---|
| 173 | //NHSTUB(Write, 0xff836e48) // OK, eventproc, like SX210 and G11 |
|---|
| 174 | //NHSTUB(Restart, 0xff83bbfc) // maybe OK, like G11 |
|---|
| 175 | |
|---|
| 176 | |
|---|
| 177 | // DEBUG Stuff |
|---|
| 178 | NHSTUB(GetLogToFile, 0xFF975780) // this is where Event Procedure does jump (native call does shutdown camera), like G11 |
|---|
| 179 | //NHSTUB(GetLogToFile, 0xFF975444) // directly points to function like A720 |
|---|
| 180 | NHSTUB(dumpMemoryToFile, 0xFF836004) // writes a portion of memory into a file (char* filename, 0, (void*) src, int length) |
|---|
| 181 | NHSTUB(LogPrintf,0xFF88C920) // like D10 |
|---|
| 182 | |
|---|
| 183 | // video buffer stuff |
|---|
| 184 | NHSTUB(UnlockAndRefresh, 0xFFA13398) // SX20 102: ROM:FFA0498C, SX210: ROM:FFA1EDDC, search "Window Instance" |
|---|
| 185 | NHSTUB(LockAndRefresh, 0xFFA13354) // SX20 102: ROM:FFA048E8, SX210: ROM:FFA1ED98, search "Window Instance" |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | // PTP stuff |
|---|
| 189 | //NHSTUB(initialise_ptp_handlers_data, 0xFFA4E898) |
|---|
| 190 | NHSTUB(get_ptp_handler, 0xFFA4EC7C) |
|---|
| 191 | //NHSTUB(add_ptp_handler, 0xFFA4EABC) // finsig address ok |
|---|
| 192 | NHSTUB(remove_ptp_handler, 0xFFA4EBB0) |
|---|
| 193 | NHSTUB(get_task_lists, 0xFF83544C) |
|---|
| 194 | NHSTUB(get_task_info, 0xFF813A38) |
|---|
| 195 | NHSTUB(PB2Rec, 0xFF898B40) // search String "AC:PB2Rec" |
|---|
| 196 | NHSTUB(Rec2PB, 0xFF897590) // search String "AC:Rec2PB" |
|---|
| 197 | //NHSTUB(set_control_event, 0xFF8955C4) // via eventproc_export_IsControlEventActive (last call), levent_table contains control event id's (Logical Event Table) |
|---|
| 198 | //NHSTUB(set_control_event, 0xff895504) // finsig ok (ptpcam --chdk mode command does work) |
|---|
| 199 | //NHSTUB(reboot_fw_update, 0xffa9b228) // finsig address ok, finsig2 |
|---|
| 200 | |
|---|
| 201 | |
|---|
| 202 | NHSTUB(taskResume, 0xFF8955C4) // maybe |
|---|
| 203 | |
|---|
| 204 | NHSTUB(GetImageFolder, 0xFF94337C) // like S95 and SD4500, function before 'GetCameraObjectTmpPath' string http://chdk.setepontos.com/index.php?topic=5641.msg58970#msg58970, for CAM_DATE_FOLDER_NAMING |
|---|
| 205 | //NHSTUB(GetImageFolder, 0xFF94345C) |
|---|
| 206 | |
|---|
| 207 | NHSTUB(exmem_alloc, 0xFF88A17C) // = ExMem.AllocCacheable ?, experimental alternate memory allocation http://chdk.setepontos.com/index.php?topic=5980.0 |
|---|
| 208 | |
|---|
| 209 | NHSTUB(LEDDrive, 0xFF860C6C) // camera_set_led() |
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 | // Added by finsig_dryos V2 to match old values found by finsig.
|
|---|
| 213 | // Values should be checked in firmware, if the new address in stubs_entry.S
|
|---|
| 214 | // is correct then delete the correspoding entry below.
|
|---|
| 215 | NHSTUB(Open ,0xff86f13c) // New address = 0xff836d4c
|
|---|
| 216 | NHSTUB(write ,0xff81acdc) // New address = 0xff836e48
|
|---|