source: trunk/platform/g12/sub/100f/lib.c @ 1300

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

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

Line 
1#include "platform.h"
2
3/*
4sensor size from code at sub_FFB787CC = (3744*2784)*(12/8) = 0xEE9200 = 15634944
5
6@FFB78800 = 0xea0 = 3744        // raw sensor size
7@FFB78808 = 0xae0 = 2784
8@FFB78810 = 0xe40 = 3648        // cropped size ??
9@FFB78818 = 0xab0 = 2736
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 FFBBAEF0, ref at FF8843F4
16        // used in _sub_FF8841BC__SsImgProcBuf.c__0
17        // checks [0x2E88 + 0xc] --> defines which buffer is active
18
19        if (*((int*)0x2E94) != 0)
20                return (char*) 0x46000000;
21        else
22                return (char*) 0x41269150;      // found at (0xFFB78B78) [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 FFBBAEF0, ref at FF8843F4
29        // used in _sub_FF8841BC__SsImgProcBuf.c__0
30        // checks [0x2E88 + 0xc] --> defines which buffer is active
31
32        if (*((int*)0x2E94) == 0)
33                return (char*) 0x46000000;
34        else
35                return (char*) 0x41269150;      // found at (0xFFB78B78) [search CRAW BUF]
36}
37
38long hook_raw_size()
39{
40        return 0xEE9200; // search CRAW BUF SIZE
41}
42
43
44char *camera_jpeg_count_str()
45{
46        return (char*)0xBB618; // loc_FFA43608 (search for "9999", passed to sprintf)
47}
48
49
50void *vid_get_bitmap_fb()
51{
52        return (void*)0x40471000; // DispCon_ShowBitmapColorBar
53}
54
55
56void *vid_get_viewport_live_fb()
57{
58        return (void*)(*(int*)(0x21F8));        // Found by searching RAM locations that referenced 0x40587700 (viewport buffer)
59                                                                                // and also changed to the other buffer addresses over time. Then used each here
60                                                                                // and selected value that gave the fastest Motion Detect response using http://dataghost.com/chdk/md_meter.html.
61}
62
63void *vid_get_viewport_fb()
64{
65    return (void *)0x40587700; // search on VRAM Address
66}
67
68void *vid_get_viewport_fb_d()
69{
70        return (void*)(*(int*)(0x2C10+0x58)); // @FF8781AC & FF8781E4 (comp 1.00c)
71}
Note: See TracBrowser for help on using the repository browser.