| 1 | #include "platform.h" |
|---|
| 2 | |
|---|
| 3 | /* |
|---|
| 4 | sensor size from code at sub_FFB59AD0 = (4464*3276)*(12/8) = 0x14EB7E0 = 21936096 |
|---|
| 5 | |
|---|
| 6 | @FFB59B10 = 0x1170 = 4464 // raw sensor size |
|---|
| 7 | @FFB59B18 = 0x0ccc = 3276 |
|---|
| 8 | @FFB59B20 = 0x10e0 = 4320 // cropped size ?? |
|---|
| 9 | @FFB59B28 = 0x0ca8 = 3240 |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | char *hook_raw_image_addr() |
|---|
| 13 | { |
|---|
| 14 | // Appears to be two raw buffers (this returns active buffer) |
|---|
| 15 | // Addresses below found in table at FFB99170, ref at FF88883C |
|---|
| 16 | // used in _sub_FF888630__SsImgProcBuf.c__0 |
|---|
| 17 | // checks [0x36a0 + 0xc] --> defines which buffer is active |
|---|
| 18 | |
|---|
| 19 | if (*((int*)0x36ac) != 0) |
|---|
| 20 | return (char*) 0x443B4960; |
|---|
| 21 | else |
|---|
| 22 | return (char*) 0x4235F6B0; // found at (FFB59E84) [search CRAW BUF] |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | char *hook_alt_raw_image_addr() |
|---|
| 26 | { |
|---|
| 27 | // Appears to be two raw buffers (this returns inactive buffer) |
|---|
| 28 | // Addresses below found in table at FFB99170, ref at FF88883C |
|---|
| 29 | // used in _sub_FF888630__SsImgProcBuf.c__0 |
|---|
| 30 | // checks [0x36a0 + 0xc] --> defines which buffer is active |
|---|
| 31 | |
|---|
| 32 | if (*((int*)0x36ac) == 0) |
|---|
| 33 | return (char*) 0x443B4960; |
|---|
| 34 | else |
|---|
| 35 | return (char*) 0x4235F6B0; // found at (FFB59E84) [search CRAW BUF] |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | long hook_raw_size() |
|---|
| 39 | { |
|---|
| 40 | return 0x14EB7E0; // search CRAW BUF SIZE |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | char *camera_jpeg_count_str() |
|---|
| 45 | { |
|---|
| 46 | return (char*)0xCF2FC; // loc_FFA3BA74 (search "9999", passed to sprintf) |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | void *vid_get_bitmap_fb() |
|---|
| 51 | { |
|---|
| 52 | return (void*)0x40471000; // sub_FF9305F8 |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | void *vid_get_viewport_live_fb() |
|---|
| 57 | { |
|---|
| 58 | // Values below found by searching firmware for references & usage of viewport buffer address 0x40587700 |
|---|
| 59 | // then experimenting to see what gave best Motion Detector speed results using http://dataghost.com/chdk/md_meter.html. |
|---|
| 60 | long* t = (long*)0xFFB96808; // Table of viewport buffer addresses (@FF853F24 in _sub_FF853DC0__LiveImage.c__10) |
|---|
| 61 | unsigned char i = *((unsigned char*)(0x20a8)); // Index value (byte) stored here (@FF853F50 in _sub_FF853DC0__LiveImage.c__10) |
|---|
| 62 | return (void*)t[(i-1)&3]; // Appears to be 4 buffers, current index - 1 seems best |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | void *vid_get_viewport_fb() |
|---|
| 66 | { |
|---|
| 67 | return (void*)0x40587700; // sub_FF8E8C58 |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | void *vid_get_viewport_fb_d() |
|---|
| 71 | { |
|---|
| 72 | return (void*)(*(int*)(0x32B0+0x58)); // @FF878AB0 & FF878AE8 (comp to S95) |
|---|
| 73 | } |
|---|