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

Revision 1706, 1.7 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*)0;
6}
7
8void *hook_raw_ret_addr()
9{
10    return (void*)0;
11}
12
13char *hook_raw_image_addr()
14{
15    return (char*)0x10F6C860;
16}
17
18long hook_raw_size()
19{
20    return 0x9DCCE0;
21}
22
23void *vid_get_viewport_live_fb()
24{
25//    return (void*)0;//0x10670ee0;
26    void **fb=(void **)0x21D0;
27    unsigned char buff = *((unsigned char*)0x2084);
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*)0x10361000;
40}
41
42void *vid_get_viewport_fb()
43{
44    return (void*)0x1065A4D0; // 0x107D5FD0
45}
46
47void *vid_get_viewport_fb_d()
48{
49    return (void*)(*(int*)0x540C);  //5410
50}
51
52long vid_get_viewport_height()
53{
54    return 240;
55}
56char *camera_jpeg_count_str()
57{
58    return (char*)0x580CC;
59}
60
61// PTP display stuff
62int vid_get_palette_type() { return 1; }
63int vid_get_palette_size() { return 16*4; }
64
65void *vid_get_bitmap_active_palette() {
66    return (void *)0x4183C; // GetPaletteFromPhysicalScreen
67}
68
69void *vid_get_bitmap_active_buffer()
70{
71    return (void*)(*(int*)0x93A0); // DisplayPhysicalScreenWithYUVPalette
72}
73// TODO value of vid_getviewport_height_proper needs to be checked in play, rec, and the different video modes
74//int vid_get_viewport_max_height()               { return 240; }
75
76// values from chdkcam patch
77// commented for now, protocol changes needed to handle correctly
78// note, play mode may be 704, needs to be tested
79#if 0
80int vid_get_viewport_width_proper() {
81    return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:*(int*)0x21A0; // VRAM DataSize  -> sub_FFC2BBF8
82}
83int vid_get_viewport_height_proper() {
84    return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x21A0+4); // VRAM DataSize -> sub_FFC2BC04
85}
86#endif
87
Note: See TracBrowser for help on using the repository browser.