source: branches/reyalp-ptp-live/platform/sx10/sub/101a/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
3char *hook_raw_image_addr()
4{
5        return (char*) (*(int*)(0x55CC+0x18) ? 0x424F1948 : 0x40F65B18);
6}
7
8long hook_raw_size()
9{
10        return 0xEC04F0;
11}
12
13void *vid_get_viewport_live_fb()
14{
15    void **fb=(void **)0x227C;
16    unsigned char buff = *((unsigned char*)0x20D0); // sub_FF839DD8
17    if (buff == 0) buff = 2;  else buff--;   
18    return fb[buff];
19}
20
21void *vid_get_bitmap_fb()
22{
23        return (void*)0x403B1000;
24}
25
26void *vid_get_viewport_fb()
27{
28        return (void*)0x4070D9D0;
29}
30
31void *vid_get_viewport_fb_d()
32{
33        return (void*)(*(int*)(0x5260+0x58));
34}
35
36long vid_get_viewport_height()
37{
38        return 240;
39}
40
41char *camera_jpeg_count_str()
42{
43        return (char*)0x4C138;
44}
45
46
47// PTP display stuff, untested, adapted from ewavr chdkcam patch
48// reyalp - type probably wrong, looks like 2 with opposite order
49int vid_get_palette_type() { return 2; }
50int vid_get_palette_size() { return 16*4; }
51
52void *vid_get_bitmap_active_palette() {
53    return (void *)*(unsigned int*)(0x8378+0x20);  // sub_FF8F3A10
54}
55void *vid_get_bitmap_active_buffer()
56{
57    return (void*)(*(int*)(0x8378+0x0C)); //"Add: %p Width : %ld Hight : %ld", sub_FF8F3AD4
58}
59// TODO value of vid_getviewport_height_proper needs to be checked in play, rec, and the different video modes
60//int vid_get_viewport_max_height()               { return 240; }
61
62// values from chdkcam patch
63// commented for now, protocol changes needed to handle correctly
64// note, play mode may be 704, needs to be tested
65#if 0
66int vid_get_viewport_width_proper() {
67    return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:*(int*)0x224C; // VRAM DataSize
68}
69int vid_get_viewport_height_proper() {
70    return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x224C+4); // VRAM DataSize
71}
72#endif
Note: See TracBrowser for help on using the repository browser.