source: branches/reyalp-ptp-live/platform/a610/sub/100e/lib.c @ 1706

Revision 1706, 2.0 KB checked in by reyalp, 15 months ago (diff)

integrate ptp live view related functions from old chdkcam patch found at http://ewavr.nm.ru/chdk/for_test/ note all are untested, not all firmwares of every camera done. Address related comments are copied from the patch, may be wrong
also comments + warning fix for a540

  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2
3void *hook_raw_fptr()
4{
5    return (void*)0x367D0;
6}
7
8void *hook_raw_ret_addr()
9{
10    return (void*)0xffcb48d4;
11}
12
13char *hook_raw_image_addr()
14{
15    return (char*)0x1058ebd4;
16}
17
18long hook_raw_size()
19{
20    return 0x644C40;
21}
22
23void *vid_get_viewport_live_fb()
24{
25    //return (void*)0x10670d50;
26    void **fb=(void **)0x52EC;
27    unsigned char buff = *((unsigned char*)0x52FC);
28    if (buff == 0) {
29        buff = 2;
30    }
31    else {
32        buff--;
33    }
34    return fb[buff];
35}
36
37void *vid_get_bitmap_fb()
38{
39    return (void*)0x103C79A0;
40}
41
42void *vid_get_viewport_fb()
43{
44    return (void*)0x10559570;
45}
46
47void *vid_get_viewport_fb_d()
48{
49    return (void*)(*(int*)0x7279c);
50}
51
52long vid_get_viewport_height()
53{
54    return 240;
55}
56
57long vid_is_bitmap_shown()
58{
59    return 1;
60}
61
62char *camera_jpeg_count_str()
63{
64    return (char*)0x80A90;
65}
66
67void _EnterToCompensationEVF() {} // Dummy function. To be removed after stub is found. See stubs_entry_2.S.
68void _ExitFromCompensationEVF() {} // Dummy function. To be removed after stub is found. See stubs_entry_2.S.
69
70// PTP display stuff, untested, adapted from ewavr chdkcam patch
71int vid_get_palette_type() { return 1; }
72int vid_get_palette_size() { return 16*4; }
73
74void *vid_get_bitmap_active_palette() {
75    return (void *)(0x724E0); // GetPaletteFromPhysicalScreen
76}
77void *vid_get_bitmap_active_buffer()
78{
79    return (void*)(*(int*)0x6A58);
80}
81// TODO value of vid_getviewport_height_proper needs to be checked in play, rec, and the different video modes
82//int vid_get_viewport_max_height()               { return 240; }
83
84// values from chdkcam patch
85// commented for now, protocol changes needed to handle correctly
86// note, play mode may be 704, needs to be tested
87#if 0
88int vid_get_viewport_width_proper() {
89    return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:*(int*)0x35F20;// VRAM DataSize
90}
91int vid_get_viewport_height_proper() {
92    return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x35F20+4); // VRAM DataSize     
93}
94#endif
Note: See TracBrowser for help on using the repository browser.