source: trunk/platform/sx220hs/sub/101b/lib.c @ 1328

Revision 1328, 1.8 KB checked in by reyalp, 21 months ago (diff)

set eol styles and ignores on recently added ports/subs

  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2
3/*
4SX220
5full 19131120
60x1048 *  BF4   =  C29CA0
74168 * 3060 = 12754080
8*/
9
10char *hook_raw_image_addr()
11{
12
13        if (*((int*)0x3F04) != 0)
14                return (char*) 0x46000000;
15        else
16                return (char*) 0x413591F0;
17
18}
19
20char *hook_alt_raw_image_addr()
21{
22
23        if (*((int*)0x3F04) == 0)
24                return (char*) 0x46000000;
25        else
26                return (char*) 0x413591F0;
27
28}
29
30long hook_raw_size()
31{
32        //FF375484 dword_FF375484  DCD 0x123EAF0
33        return 0x123EAF0;
34       
35}
36
37void *vid_get_viewport_live_fb()
38{
39        if ((mode_get()&MODE_MASK) == MODE_REC)
40                return (void*)((void*)(*(int*)(0x2258))-vid_get_viewport_xoffset()*3);
41        return (void*)(void*)(*(int*)(0x2258));
42       
43        // Found by searching RAM locations that referenced 0x405D7980 (viewport buffer)
44        // and also changed to the other buffer addresses over time. Then used each here
45        // and selected value that gave the fastest Motion Detect response using http://dataghost.com/chdk/md_meter.html.
46}
47
48// OSD buffer
49void *vid_get_bitmap_fb()
50{       
51        //SX220
52        //FF050F24                 LDR     R0, =0x40471000
53        return (void*)0x40471000;
54}                                 
55
56// Live picture buffer (shoot half-pressed)
57void *vid_get_viewport_fb()
58{
59        //sx220 or 0x4052ED80 ff050c2c
60               
61                if ((mode_get()&MODE_MASK) == MODE_REC)
62                return (void*)(0x405D7980-vid_get_viewport_xoffset()*3);   //return (void*)(0x405D7980-vid_get_viewport_xoffset()*3)
63       
64        return (void*)0x405D7980;                                                          // found by search for VRAM Address @FF371E8C(v100A)
65
66}
67
68void *vid_get_viewport_fb_d()
69{
70        //FF06C580 dword_FF06C580  DCD 0x3C70
71        //FF06D300                 STR     R12, [R5,#0x58
72        return (void*)(*(int*)(0x3C70+0x58));                 
73
74}
75
76char *camera_jpeg_count_str()
77{
78        //FF2327FC(v100A)          LDR     R0, =0xCA790
79        return (void*)0xCA790;                                     
80
81}
Note: See TracBrowser for help on using the repository browser.