source: trunk/platform/sx30/sub/100l/lib.c @ 1300

Revision 1300, 2.1 KB checked in by philmoz, 21 months ago (diff)

Updated comments for G12 & SX30 to include correct firmware addresses for each version.

  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2
3/*
4sensor size from code at sub_FFB59D34 = (4464*3276)*(12/8) = 0x14EB7E0 = 21936096
5
6@FFB59D74 = 0x1170 = 4464       // raw sensor size
7@FFB59D7C = 0x0ccc = 3276
8@FFB59D84 = 0x10e0 = 4320       // cropped size ??
9@FFB59D8C = 0x0ca8 = 3240
10*/
11
12char *hook_raw_image_addr()
13{
14        // Appears to be two raw buffers (this returns active buffer)
15        // Addresses below found in table at FFB993D4, ref at FF888840
16        // used in _sub_FF888634__SsImgProcBuf.c__0
17        // checks [0x36a0 + 0xc] --> defines which buffer is active
18
19        if (*((int*)0x36ac) != 0)
20                return (char*) 0x443B4960;
21        else
22                return (char*) 0x4235F6B0;      // found at (FFB5A0E8) [search CRAW BUF]
23}
24
25char *hook_alt_raw_image_addr()
26{
27        // Appears to be two raw buffers (this returns inactive buffer)
28        // Addresses below found in table at FFB993D4, ref at FF888840
29        // used in _sub_FF888634__SsImgProcBuf.c__0
30        // checks [0x36a0 + 0xc] --> defines which buffer is active
31
32        if (*((int*)0x36ac) == 0)
33                return (char*) 0x443B4960;
34        else
35                return (char*) 0x4235F6B0;      // found at (FFB5A0E8) [search CRAW BUF]
36}
37
38long hook_raw_size()
39{
40        return 0x14EB7E0; // search CRAW BUF SIZE
41}
42
43
44char *camera_jpeg_count_str()
45{
46        return (char*)0xCF2FC; // loc_FFA3BCD8 (search "9999", passed to sprintf)
47}
48
49
50void *vid_get_bitmap_fb()
51{
52        return (void*)0x40471000; // sub_FF930630
53}
54
55
56void *vid_get_viewport_live_fb()
57{
58        // Values below found by searching firmware for references & usage of viewport buffer address 0x40587700
59        // then experimenting to see what gave best Motion Detector speed results using http://dataghost.com/chdk/md_meter.html.
60        long* t = (long*)0xFFB96A6C;                                            // Table of viewport buffer addresses (@FF853F24 in _sub_FF853DC0__LiveImage.c__10)
61        unsigned char i = *((unsigned char*)(0x20a8));          // Index value (byte) stored here (@FF853F50 in _sub_FF853DC0__LiveImage.c__10)
62        return (void*)t[(i-1)&3];                                                       // Appears to be 4 buffers, current index - 1 seems best
63}
64
65void *vid_get_viewport_fb()
66{
67        return (void*)0x40587700; // sub_FF8E8C5C
68}
69
70void *vid_get_viewport_fb_d()
71{
72        return (void*)(*(int*)(0x32B0+0x58)); // @FF878AB0 & FF878AE8 (comp to S95)
73}
Note: See TracBrowser for help on using the repository browser.