source: trunk/platform/sx220hs/sub/101a/lib.c @ 1828

Revision 1828, 1.5 KB checked in by philmoz, 13 months ago (diff)

Update to viewport functions and code using them to handle the G1X viewport system.
This is now more flexible by allowing viewport buffer offsets to be seperate from the viewport display offsets, it can handle stitch mode properly. This is also needed for reyalp's new live view system.

  • 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        return (void*)(void*)(*(int*)(0x2258));
40       
41        // Found by searching RAM locations that referenced 0x405D7980 (viewport buffer)
42        // and also changed to the other buffer addresses over time. Then used each here
43        // and selected value that gave the fastest Motion Detect response using http://dataghost.com/chdk/md_meter.html.
44}
45
46// OSD buffer
47void *vid_get_bitmap_fb()
48{       
49        //SX220
50        //FF050F24                 LDR     R0, =0x40471000
51        return (void*)0x40471000;
52}                                 
53
54// Live picture buffer (shoot half-pressed)
55void *vid_get_viewport_fb()
56{
57        //sx220 or 0x4052ED80 ff050c2c
58        return (void*)0x405D7980;                                                          // found by search for VRAM Address @FF371E8C(v100A)
59
60}
61
62void *vid_get_viewport_fb_d()
63{
64        //FF06C580 dword_FF06C580  DCD 0x3C70
65        //FF06D300                 STR     R12, [R5,#0x58
66        return (void*)(*(int*)(0x3C70+0x58));                 
67
68}
69
70char *camera_jpeg_count_str()
71{
72        //FF2327FC(v100A)          LDR     R0, =0xCA790
73        return (void*)0xCA790;                                     
74
75}
Note: See TracBrowser for help on using the repository browser.