| 1 | #include "platform.h" |
|---|
| 2 | |
|---|
| 3 | /* |
|---|
| 4 | ********************* |
|---|
| 5 | SX200IS |
|---|
| 6 | ********************** |
|---|
| 7 | note sensor size for camera.h is from |
|---|
| 8 | @ FFAC8D6C |
|---|
| 9 | 0x11CA240 = 18653760 |
|---|
| 10 | 18653760/12 * 8 - 12435840 --- |
|---|
| 11 | | |
|---|
| 12 | @ FFAC8A40 | |
|---|
| 13 | 0xFF0 and 0xBE8 = | |
|---|
| 14 | 4080 * 3048 = 12435840 --- |
|---|
| 15 | */ |
|---|
| 16 | |
|---|
| 17 | char *hook_raw_image_addr() |
|---|
| 18 | { |
|---|
| 19 | //found at FFAC8D10 |
|---|
| 20 | //ROM:FFAC8D10 LDR R6, =0x424B41C0 |
|---|
| 21 | //... |
|---|
| 22 | //ROM:FFAC8D60 MOV R1, R6 |
|---|
| 23 | //ROM:FFAC8D64 ADR R0, aCrawBuffP ; "CRAW BUFF %p" |
|---|
| 24 | |
|---|
| 25 | return (char*)(0x424B41C0); |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | long hook_raw_size() |
|---|
| 29 | { |
|---|
| 30 | //found at FFAC8D6C |
|---|
| 31 | //ROM:FFAC8D6C LDR R1, =0x11CA240 |
|---|
| 32 | //ROM:FFAC8D70 ADR R0, aCrawBuffSizeP ; "CRAW BUFF SIZE %p" |
|---|
| 33 | //ROM:FFAC8D74 BL sub_FF9037E8 |
|---|
| 34 | |
|---|
| 35 | return 0x11CA240; |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | // Live picture buffer (shoot not pressed) |
|---|
| 39 | void *vid_get_viewport_live_fb() |
|---|
| 40 | { |
|---|
| 41 | void **fb=(void **)0x2180; // 0x2150 or 0x2180 (suggested by ADamb) |
|---|
| 42 | unsigned char buff = *((unsigned char*)0x1FD8); // found at FF838090 |
|---|
| 43 | if (buff == 0) buff = 2; else buff--; |
|---|
| 44 | return fb[buff]; |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | // OSD buffer |
|---|
| 48 | void *vid_get_bitmap_fb() |
|---|
| 49 | { |
|---|
| 50 | return (void*)0x403F1000; // found at FF842AC4 and FFA2BED4 |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | // Live picture buffer (shoot half-pressed) |
|---|
| 54 | void *vid_get_viewport_fb() |
|---|
| 55 | { |
|---|
| 56 | return (void*)0x415F9E20; // found by search for VRAM Address @FFAC67F0 |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | // Histo etc. when in play mode maybe ? |
|---|
| 60 | void *vid_get_viewport_fb_d() |
|---|
| 61 | { |
|---|
| 62 | // return (void*)(*(int*)(0x2950+0x50)); // found at FF858A84 and FF859398 (0x58 at FF8594F0) |
|---|
| 63 | return (void*)(*(int*)(0x2950+0x58)); // suggested by ADamb |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | int vid_get_viewport_width() |
|---|
| 68 | { |
|---|
| 69 | return 360; // stays at 360 as IN SD990 |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | long vid_get_viewport_height() |
|---|
| 73 | { |
|---|
| 74 | return 240; |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | char *camera_jpeg_count_str() |
|---|
| 78 | { |
|---|
| 79 | return (void*)0x5408C; // found at FF9C1F28 |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | // PTP display stuff, untested, adapted from ewavr chdkcam patch |
|---|
| 83 | // reyalp - type probably wrong, chdkcam patch suggests opposite order from a540 (e.g. vuya) |
|---|
| 84 | int vid_get_palette_type() { return 2; } |
|---|
| 85 | int vid_get_palette_size() { return 16*4; } |
|---|
| 86 | |
|---|
| 87 | void *vid_get_bitmap_active_palette() { |
|---|
| 88 | return (void *)*(unsigned int*)(0x5744+0x28); // FF8E6230 |
|---|
| 89 | } |
|---|
| 90 | void *vid_get_bitmap_active_buffer() |
|---|
| 91 | { |
|---|
| 92 | return (void*)(*(int*)(0x5744+0x14)); //"Add: %p Width : %ld Hight : %ld", FF8E62DC |
|---|
| 93 | } |
|---|
| 94 | // TODO value of vid_getviewport_height_proper needs to be checked in play, rec, and the different video modes |
|---|
| 95 | //int vid_get_viewport_max_height() { return 240; } |
|---|
| 96 | |
|---|
| 97 | // values from chdkcam patch |
|---|
| 98 | // commented for now, protocol changes needed to handle correctly |
|---|
| 99 | // note, play mode may be 704, needs to be tested |
|---|
| 100 | #if 0 |
|---|
| 101 | int vid_get_viewport_width_proper() { |
|---|
| 102 | return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:*(int*)0x2150; // VRAM W DataSize |
|---|
| 103 | } |
|---|
| 104 | int vid_get_viewport_height_proper() { |
|---|
| 105 | return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x2150+4); // VRAM H DataSize |
|---|
| 106 | } |
|---|
| 107 | #endif |
|---|
| 108 | |
|---|