1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #ifndef FW_FUNCTIONS_H
35 #define FW_FUNCTIONS_H
36 #include "fw_types.h"
37 #include "ptp_handlers.h"
38 #ifdef CAM_DRYOS_REL
39 __stdcall int * GetSystemTime(int *t);
40 #else
41 __stdcall int GetSystemTime(void);
42 #endif
43 __stdcall int GetZoomLensCurrentPosition(void);
44 __stdcall int GetZoomLensCurrentPoint(void);
45 __stdcall int MoveZoomLensWithPoint(short *pos);
46 __stdcall int SetZoomActuatorSpeedPercent(short *perc);
47 __stdcall int GetFocusLensCurrentPosition(void);
48 __stdcall int GetFocusLensSubjectDistance(void);
49 __stdcall int GetFocusLensSubjectDistanceFromLens(void);
50 __stdcall void MoveFocusLensToDistance(short *dist);
51 __stdcall int MoveIrisWithAv(short*);
52 __stdcall void PutInNdFilter(void);
53 __stdcall void PutOutNdFilter(void);
54 __stdcall short get_nd_value(void);
55 __stdcall short get_current_nd_value(void);
56 __stdcall int GetCurrentShutterSpeed(void);
57 __stdcall int GetCurrentAvValue(void);
58 __stdcall int get_current_deltasv(void);
59 __stdcall int GetCurrentDriveBaseSvValue(void);
60 __stdcall short GetUsableMinAv(void);
61 __stdcall short GetUsableMaxAv(void);
62 __stdcall int GetCurrentTargetDistance(void);
63 __stdcall int GetPropertyCase(int opt_id, void *buf, int bufsize);
64 __stdcall int SetPropertyCase(int opt_id, void *buf, int bufsize);
65 __stdcall short PTM_GetCurrentItem(int id);
66 __stdcall int IsStrobeChargeCompleted(void);
67 __stdcall int VbattGet(void);
68 __stdcall int GetBatteryTemperature(void);
69 __stdcall int GetCCDTemperature(void);
70 __stdcall int GetOpticalTemperature(void);
71 #ifdef CAM_DRYOS_REL
72 __stdcall int GetAdChValue(int);
73 #else
74 __stdcall int GetAdChValue(int*);
75 #endif
76 __stdcall void PT_PlaySound(short , void*, int unk);
77 __stdcall void RefreshPhysicalScreen(int f);
78 __stdcall void Unmount_FileSystem(void);
79 __stdcall void Mount_FileSystem(void);
80 __stdcall void SleepTask(int msec);
81 __stdcall int CreateTask (const char *name, int prio, int stack_size, void *entry, int parm );
82 __stdcall void ExitTask(void);
83 __stdcall int taskNameToId(char* taskName);
84 __stdcall const char * taskName(int taskID);
85 __stdcall int taskIdListGet(int *idlist,int max);
86 __stdcall void taskSuspend(int taskId);
87 __stdcall void taskResume(int taskId);
88 __stdcall int errnoOfTaskGet(int tid);
89
90 __stdcall int SetEventFlag(int flag, int what);
91 __stdcall int CheckAnyEventFlag(int flag, int mask, int *res);
92 __stdcall int GetEventFlagValue(int flag, int *res);
93
94 __stdcall int ReceiveMessageQueue(int msgq, int *dst, int unk1 );
95
96
97 __stdcall int GetParameterData(int id, void *buf, int size);
98 __stdcall int SetParameterData(int id, void *buf, int size);
99 __stdcall void MakeSDCardBootable(int driveno);
100 __stdcall void UpdateMBROnFlash(int driveno, int offset, char *str);
101
102
103 __stdcall int creat (const char *name, int flags);
104 __stdcall int open (const char *name, int flags, int mode );
105 __stdcall int close (int fd);
106 __stdcall int write (int fd, const void *buffer, int nbytes);
107 __stdcall int read (int fd, void *buffer, int nbytes);
108 __stdcall int lseek (int fd, int offset, int whence);
109 __stdcall int mkdir(const char *dirname);
110
111 __stdcall int Open (const char *name, int flags, int mode );
112 __stdcall int Close (int fd);
113 __stdcall int Write (int fd, const void *buffer, int nbytes);
114 __stdcall int Read (int fd, void *buffer, int nbytes);
115
116
117 __stdcall int Remove(const char *name);
118
119 __stdcall FILE * Fopen_Fut(const char *filename, const char *mode);
120 __stdcall int Fclose_Fut(FILE *f);
121 __stdcall int Fread_Fut(void *buf, int elsize, int count, FILE *f);
122 __stdcall int Fwrite_Fut(const void *buf, int elsize, int count, FILE *f);
123 __stdcall int Fseek_Fut(FILE *f, int offset, int whence);
124 __stdcall int Fflush_Fut(FILE *f);
125 __stdcall int Feof_Fut(FILE *f);
126 __stdcall int Fflush_Fut(FILE *f);
127 __stdcall char * Fgets_Fut(char *buf, int n, FILE *f);
128 __stdcall int RenameFile_Fut(const char *oldname, const char *newname);
129 __stdcall int DeleteFile_Fut(const char *name);
130 __stdcall int MakeDirectory_Fut(const char *name,int unk);
131 __stdcall int DeleteDirectory_Fut(const char *name);
132
133 __stdcall int isdigit(int c);
134 __stdcall int isspace(int c);
135 __stdcall int isalpha(int c);
136 __stdcall int isupper(int c);
137 __stdcall int islower(int c);
138 __stdcall int ispunct(int c);
139 __stdcall int isxdigit(int c);
140
141 __stdcall int strlen(const char *s);
142 __stdcall int strcmp(const char *s1, const char *s2);
143 __stdcall int strncmp(const char *s1, const char *s2, int n);
144 __stdcall char * strchr(const char *s, int c);
145 __stdcall char * strcpy(char *dest, const char *src);
146 __stdcall char * strncpy(char *dest, const char *src, int n);
147 __stdcall char * strcat(char *dest, const char *app);
148 __stdcall char * strrchr(const char *s, int c);
149 __stdcall char * strpbrk(const char *s, const char *accept);
150
151 __stdcall int strtol(const char *nptr, char **endptr, int base);
152 __stdcall unsigned strtoul(const char *nptr, char **endptr, int base);
153
154
155 __stdcall int strtolx(const char *nptr, char **endptr, int base, int mode);
156
157 __stdcall int tolower(int c);
158 __stdcall int toupper(int c);
159
160 __stdcall int vsprintf(char *buf, const char *fmt, __builtin_va_list va_list);
161
162
163
164
165
166
167
168
169 __stdcall void * malloc(int size);
170 __stdcall void free(void *p);
171 __stdcall void * AllocateUncacheableMemory(int size);
172 __stdcall void FreeUncacheableMemory(void *p);
173
174 __stdcall void * memchr(const void *s, int c, int n);
175 __stdcall void * memcpy(void *dest, const void *src, int n);
176 __stdcall void * memset(void *s, int c, int n);
177 __stdcall int memcmp(const void *s1, const void *s2, int n);
178
179 __stdcall void qsort (void * _base, int _nelem, int _size, int (* _cmp)(const void * _e1, const void * _e2));
180
181
182 __stdcall int taskLock(void);
183 __stdcall int taskUnlock(void);
184 __stdcall int taskCreateHookAdd (void *createHook);
185 __stdcall int taskDeleteHookAdd (void *deleteHook);
186 __stdcall int iosDevAdd(void*,void*,int);
187 __stdcall int iosDevDelete(void*);
188 __stdcall int iosDrvInstall(void*,void*,void*,void*,void*,void*,void*);
189
190
191 __stdcall int TakeSemaphore(int sem, int timeout);
192 __stdcall void GiveSemaphore(int sem);
193
194
195 __stdcall int kbd_p1_f(void);
196 __stdcall void kbd_p2_f(void);
197 __stdcall void kbd_pwr_on(void);
198 __stdcall void kbd_pwr_off(void);
199 __stdcall void kbd_read_keys_r2(int *p);
200
201 __stdcall void kbd_fetch_data(int *dst);
202
203 __stdcall void UniqueLedOn(void *addr, int brightness);
204 __stdcall void UniqueLedOff(void *addr);
205
206 __stdcall int PostLEDMessage(struct led_control *);
207 __stdcall int LEDDrive(int led, int action);
208
209
210 __stdcall int LockMainPower(void);
211 __stdcall int UnlockMainPower(void);
212 __stdcall void SetAutoShutdownTime(int t);
213
214
215
216
217
218
219
220
221
222
223
224 __stdcall int PostLogicalEventForNotPowerType(int event, int unk);
225 __stdcall int PostLogicalEventToUI(int event, int unk);
226
227
228
229
230
231
232 __stdcall void SetLogicalEventActive(unsigned event, unsigned state);
233
234 __stdcall void SetScriptMode(unsigned mode);
235
236
237
238 __stdcall int rand(void);
239 __stdcall void srand(unsigned int seed);
240
241 __stdcall double _log(double x);
242 __stdcall double _log10(double x);
243 __stdcall double _pow(double x, double y);
244 __stdcall double _sqrt(double x);
245
246
247 __stdcall int utime(const char *file, void *newTimes);
248 __stdcall unsigned int time( unsigned int *timer);
249 __stdcall void * localtime(const unsigned int * tod);
250 __stdcall void * LocalTime(const unsigned int * tod, void * t_m);
251 __stdcall int strftime(char *s, unsigned int maxsize, const char *format, const void *timp);
252 __stdcall int mktime( void *timp);
253 __stdcall int mktime_ext(void *tim_extp);
254 __stdcall int SetDate(void *setdate_p);
255
256
257 #if CAM_DRYOS_REL >= 39
258 __stdcall int SetFileTimeStamp(const char *file_path, int time1, int time2);
259 __stdcall int SetFileAttributes(const char *fn, int attr);
260 #else
261 __stdcall int SetFileTimeStamp(int fd, int time1, int time2);
262 __stdcall void SetFileAttributes(int fd, int attr);
263 #endif
264
265
266 __stdcall int stat(const char *name, __stat *pStat);
267 __stdcall unsigned int GetDrive_ClusterSize(int drive);
268 __stdcall unsigned int GetDrive_TotalClusters(int drive);
269 __stdcall unsigned int GetDrive_FreeClusters(int drive);
270 __stdcall int WriteSDCard(unsigned int drive, unsigned int start_sect, unsigned int num_sect, void *buf);
271
272 __stdcall void UnsetZoomForMovie(void);
273 __stdcall void TurnOffMic(void);
274 __stdcall void TurnOnMic(void);
275
276 __stdcall void MakeAFScan(int*, int);
277 __stdcall void ExpCtrlTool_StartContiAE(int, int);
278 __stdcall void ExpCtrlTool_StopContiAE(int, int);
279
280 __stdcall int some_flag_for_af_scan;
281 __stdcall int parameter_for_af_scan;
282 __stdcall short SetAE_ShutterSpeed(short* tv);
283
284 __stdcall void EnterToCompensationEVF(void);
285 __stdcall void ExitFromCompensationEVF(void);
286
287 __stdcall void TurnOnBackLight(void);
288 __stdcall void TurnOffBackLight(void);
289 __stdcall void TurnOnDisplay(void);
290 __stdcall void TurnOffDisplay(void);
291
292 __stdcall void DoAELock(void);
293 __stdcall void UnlockAE(void);
294 __stdcall void DoAFLock(void);
295 __stdcall void UnlockAF(void);
296 __stdcall void MFOn(void);
297 __stdcall void MFOff(void);
298 __stdcall void PT_MFOn(void);
299 __stdcall void PT_MFOff(void);
300 __stdcall void SS_MFOn(void);
301 __stdcall void SS_MFOff(void);
302
303 __stdcall int EngDrvRead(int gpio_reg);
304
305 __stdcall int apex2us(int);
306
307 __stdcall void ScreenLock(void);
308 __stdcall void SetCurrentCaptureModeType(void);
309 __stdcall unsigned ExecuteEventProcedure(const char *name, ...);
310
311
312
313
314
315 __stdcall void Restart(unsigned option);
316
317
318 __stdcall void reboot_fw_update(const char* bootfile);
319
320
321 __stdcall int add_ptp_handler(int opcode, ptp_handler handler, int unk);
322 __stdcall void set_control_event(int);
323 __stdcall void PB2Rec(void);
324
325 #if CAM_DRYOS_REL < 54
326 __stdcall void Rec2PB(void);
327 #else
328 __stdcall void Rec2PB(int event);
329 #endif
330 __stdcall int get_ptp_buf_size(int slot);
331 __stdcall char * get_ptp_file_buf(void);
332
333
334
335
336
337 __stdcall void * exmem_alloc(unsigned int pool_id,unsigned int size,int unk,int unk2);
338
339
340 __stdcall void * exmem_ualloc(unsigned int type, unsigned int size, void *allocinf);
341 __stdcall void exmem_ufree(unsigned int type);
342
343
344
345 __stdcall int memPartFindMax(int mempart_id);
346 __stdcall int memPartInfoGet(int mempart_id,int *info);
347
348 __stdcall void GPS_UpdateData(void);
349
350
351
352 __stdcall void PT_MoveDigitalZoomToWide(void);
353 __stdcall void MoveOpticalZoomAt(long pt,int speed);
354 __stdcall int closedir(void *d);
355 __stdcall int get_fstype(int);
356 __stdcall void *OpenFastDir(const char* name);
357 __stdcall int ReadFastDir(void *d, void* dd);
358 __stdcall void *opendir(const char* name);
359 __stdcall void *readdir(void *d);
360 __stdcall void GetMemInfo(int*);
361 __stdcall int SetHPTimerAfterNow(int delay, int(*good_cb)(int, int), int(*bad_cb)(int, int), int );
362 __stdcall int CancelHPTimer(int);
363 __stdcall void EnableHDMIPower(void);
364 __stdcall void DisableISDriveError(void);
365 #if CAM_3ARG_DebugAssert
366 __stdcall void DebugAssert(int x, char *file, int line);
367
368 __stdcall void DebugAssert2(char *file, int line);
369 #else
370 __stdcall void DebugAssert(char *file, int line);
371 #endif
372 __stdcall int CreateBinarySemaphore(char *name, int v);
373 __stdcall void SetVideoOutType(int vt);
374 __stdcall int GetVideoOutType(void);
375 __stdcall void LogCameraEvent(int level, const char *fmt, ...);
376
377
378
379 __stdcall void transfer_src_overlay(int which);
380 __stdcall int GetVRAMHPixelsSize(void);
381 __stdcall int GetVRAMVPixelsSize(void);
382
383
384 __stdcall void GetKbdState(int *phsw);
385 __stdcall int get_dial_hw_position(int dial);
386
387
388 __stdcall void GetImageFolder(char * out,int filecount,int flags,int time);
389
390
391 __stdcall void * wrapped_malloc(int size);
392 __stdcall void * malloc_strictly(int size);
393 __stdcall int TakeSemaphoreStrictly(int sem, int timeout, const char *file, int line);
394 __stdcall int DeleteSemaphore(int sem);
395 __stdcall int CreateTaskStrictly (const char *name, int prio, int stack_size,int (*entry)(), int parm );
396 __stdcall int CreateEventFlag(const char *name, int v);
397 __stdcall int CreateEventFlagStrictly(const char *name, int v);
398 __stdcall int CreateBinarySemaphoreStrictly(const char *name, int v);
399 __stdcall int CreateCountingSemaphore(const char *name, int v);
400 __stdcall int CreateCountingSemaphoreStrictly(const char *name, int v);
401 __stdcall int createsemaphore_low(int v,int type, const char *name);
402 __stdcall int DeleteMessageQueue(int msgq);
403 __stdcall void dry_memcpy(void *dst, void *src, int n);
404 __stdcall void bzero(void *p, int n);
405 __stdcall void memset32(void *p, int n, int v);
406 __stdcall char *sprintf_FW(char *p, const char *fmt,...);
407 __stdcall int takesemaphore_low(int sem, int *t);
408 __stdcall int givesemaphore_low(int sem);
409 __stdcall void DisableDispatch(void);
410 __stdcall void EnableDispatch(void);
411 __stdcall int GetSemaphoreValue(int sem, int *p);
412 __stdcall int ClearEventFlag(int flag, int what);
413 __stdcall int TryTakeSemaphore(int sem);
414 __stdcall int WaitForAnyEventFlag(int flag, int what, int timeout);
415 __stdcall int ExportToEventProcedure_FW(const char *name, int (*func)());
416 #ifdef CAM_DRYOS_REL
417
418 __stdcall int RegisterEventProcedure(const char *name, int (*func)(), int (*func2)());
419 #endif
420 __stdcall int RegisterEventProcedure_FW(const char *name, int (*func)());
421 __stdcall int RegisterEventProcedure_alt1(const char *name, int (*func)());
422 __stdcall int RegisterEventProcedure_alt2(const char *name, int (*func)());
423 __stdcall int RegisterEventProcTable(const eventproc_table_entry *defs);
424 __stdcall int RegisterEventProcTable_alt(const eventproc_table_entry *defs);
425 __stdcall unsigned ExecuteEventProcedure_FW(const char *name,...);
426 __stdcall int UnRegisterEventProcedure(const char *name);
427 __stdcall int CreateTask_low(int (*entry)(),int parm, int unk1, int stack_size, int prio, int unk2, const char *name);
428 __stdcall int DeleteEventFlag(int flag);
429 __stdcall int CheckAllEventFlag(int flag, int mask, int *res);
430 __stdcall int WaitForAllEventFlag(int flag, int what, int timeout);
431 __stdcall int RegisterInterruptHandler(const char *name, int int_num, int (*int_handler)(),int unk);
432 __stdcall int CreateMessageQueue(const char *name, int unk);
433 __stdcall int CreateMessageQueueStrictly(const char *name, int unk);
434 __stdcall int TryReceiveMessageQueue(int msgq, int *dst);
435 __stdcall int PostMessageQueue(int msgq,int val,int timeout);
436 __stdcall int TryPostMessageQueue(int msgq,int val);
437 __stdcall int GetNumberOfPostedMessages(int msgq,int *res);
438
439
440 __stdcall FILE * fopen_low(const char *filename, const char *mode);
441 __stdcall int fclose_low(FILE *f);
442 __stdcall int fread_low(void *buf, int elsize, int count, FILE *f);
443 __stdcall int fwrite_low(const void *buf, int elsize, int count, FILE *f);
444 __stdcall int fseek_low(FILE *f, int offset, int whence);
445 __stdcall int fflush_low(FILE *f);
446 __stdcall int feof_low(FILE *f);
447 __stdcall int fflush_low(FILE *f);
448 __stdcall char * fgets_low(char *buf, int n, FILE *f);
449
450 __stdcall int fut_prepare(const char *name, int unk);
451
452 __stdcall int fut_finish(int unk);
453
454 __stdcall int fut_flush(FILE *f);
455
456 __stdcall void set_assert_handler(void (*assert_handler)());
457 __stdcall void set_exception_handler(void (*exception_handler)());
458 __stdcall void set_panic_handler(void (*panic_handler)());
459
460 __stdcall int *get_self_task_errno_pointer(void);
461 __stdcall int get_self_task_id(void);
462 __stdcall int get_task_properties(int task_id, void *task_props);
463 __stdcall void dry_error_printf(const char *fmt,...);
464 __stdcall int CreateTask_alt(const char *name, int prio, int stack_size, void *entry, int parm ,int core );
465 __stdcall int CreateTaskStrictly_alt(const char *name, int prio, int stack_size,int (*entry)(), int parm ,int core );
466
467 __stdcall int is_movie_recording(void);
468
469
470 __stdcall int _GetSystemTime(int *t);
471 __stdcall unsigned GetSRAndDisableInterrupt(void);
472 __stdcall void SetSR(unsigned sr_int_bit);
473
474 __stdcall int cache_flush_range(int is_data, void *addr, unsigned size);
475 __stdcall void dcache_flush_range(void *addr, unsigned size);
476 __stdcall void dcache_clean_range(void *addr, unsigned size);
477 __stdcall void icache_flush_range(void *addr, unsigned size);
478 __stdcall void dcache_clean_flush_and_disable(void);
479 __stdcall void dcache_flush_and_enable(void);
480 __stdcall void data_synchronization_barrier(void);
481
482 __stdcall void *heap_alloc(void *heap, unsigned size);
483 __stdcall void heap_free(void *heap, void *p);
484
485 __stdcall mzrm_msg * mzrm_createmsg(mzrm_context *ctx, int unk, int msg_type, int payload_size);
486 __stdcall int mzrm_sendmsg(mzrm_context *ctx, mzrm_msg *msg);
487 __stdcall void GraphicSystemCoreFinish(void);
488 __stdcall int GraphicSystemCoreFinish_helper(void);
489 __stdcall void zicokick_copy(void *dst, void *src, unsigned size);
490 __stdcall void zicokick_start(void);
491
492 __stdcall void *umalloc_strictly(unsigned size);
493 __stdcall void dry_memset(void *dst, unsigned n, int c);
494 __stdcall void dry_memzero(void *dst, unsigned n);
495
496 __stdcall void dry_memcpy_bytes(void *dst, void *src, unsigned n);
497
498 __stdcall void dry_memmove_bytes(void *dst, void *src, unsigned n);
499
500 __stdcall int GetRomID(void *adr, int unk);
501
502 __stdcall int init_task_error(const char *msg);
503 __stdcall int dry_panic(int module, int panic_code);
504 __stdcall int dry_panic_low(int module, int panic_code);
505
506 __stdcall void dry_con_printf(const char *fmt,...);
507
508 __stdcall int AcquireRecursiveLock(int lock,int timeout);
509 __stdcall int AcquireRecursiveLockStrictly(int lock,int timeout,const char *file, int line);
510 __stdcall int strstr(const char *s1, const char *s2);
511
512 __stdcall void cameracon_set_state(int state);
513 __stdcall int cameracon_get_state(void);
514
515 __stdcall int IsControlEventActive_FW(int event);
516 __stdcall controller_t *CreateController_FW(controller_fn *fn, void *controller_data);
517 __stdcall int DeleteController_FW(controller_t *controller);
518 __stdcall int MoveControllerToTopOfZOrder_FW(controller_t *controller);
519 __stdcall int CtrlMan_ChangeZOrder_FW(controller_t *controller,int order);
520 __stdcall controller_t *GetSelfControllerHandle_FW(void);
521
522 __stdcall int IsWirelessConnect(void);
523
524
525
526 __stdcall void *ui_malloc(unsigned size);
527 __stdcall void *ui_malloc_default(unsigned size);
528 __stdcall void ui_free(void *p);
529 __stdcall void ui_free_default(void *p);
530 __stdcall void *pvm_malloc(void *pool, unsigned size);
531 __stdcall void pvm_free(void *pool, void *p);
532 __stdcall void pvm_get_largest_free_block_size_ptr(void *pool, unsigned *free_size);
533 __stdcall int pvm_get_largest_free_block_size(void *pool);
534 __stdcall void *pvm_init_pool(void *mem, unsigned size);
535 __stdcall PTM_RestoreUIProperty_FW(int id, void *buf, int size);
536 #if defined(CAM_DRYOS_REL) && CAM_DRYOS_REL > 52
537 __stdcall int XimrExe(ximr_context *ximr_ctx);
538 __stdcall int XimrExeGain(ximr_context *ximr_ctx,int unk1, int unk2);
539 #endif
540 #endif
541