1 #include "platform.h" 2 #include "keyboard.h" 3 4 /*********** 5 ROM:FF8EBD04 loc_FF8EBD04 ; CODE XREF: sub_FF8EBA14+288 6 ROM:FF8EBD04 ; sub_FF8EBA14+2A8 7 ROM:FF8EBD04 LDR R5, =unk_4BB44 8 ROM:FF8EBD08 MOV R2, #0 9 ROM:FF8EBD0C MOV R1, #0x220000 10 ROM:FF8EBD10 LDR R0, [R5] 11 ROM:FF8EBD14 BL unknown_libname_21 ; "Canon A-Series Firmware" 12 ROM:FF8EBD18 MOV R1, #0x220000 13 ROM:FF8EBD1C LDR R0, [R5] 14 ROM:FF8EBD20 BL ClearEventFlag 15 ROM:FF8EBD24 LDR R3, =unk_4BB5C 16 ROM:FF8EBD28 LDR R2, =0x4BB58 <-- hook_raw_fptr 17 ROM:FF8EBD2C LDR R0, [R3] 18 ROM:FF8EBD30 MOV LR, PC 19 ROM:FF8EBD34 LDR PC, [R2] 20 ROM:FF8EBD38 BL nullsub_46 <-- hook_raw_ret_addr points here 21 ROM:FF8EBD3C LDR R3, =unk_5840 22 ***********/ 23 void *hook_raw_fptr() 24 { 25 return (void*)0x4BB58; // find on "taskcreate_ImageSensorTask" 26 } 27 void *hook_raw_ret_addr() 28 { 29 return (void*)0xFF9B8524; // BL nullsub_46 30 } 31 32 /*********** 33 ROM:FF8E5128 MOVL R7, 0x10F00000 ; This plus the 0x600 from below is raw_img_addr 34 ROM:FF8E5130 MOV R3, #0x8C0000 35 ROM:FF8E5134 ADD R7, R7, #0x600 36 ROM:FF8E5138 ADD R3, R3, #0xAE00 37 ROM:FF8E513C ADD R8, SP, #0x16C+var_168 38 ... 39 ROM:FF8E5148 MOV R2, R7 ; raw_image_addr = 0x10F00600 40 ROM:FF8E514C ADD R3, R3, #0x10 ; raw_size = 0x8CAE10 41 ***********/ 42 char *hook_raw_image_addr() 43 { 44 return (char*)(0x10F00600); // 0x10F00000 + 0x600 (find on "A/%08.CRW") 45 } 46 47 /*************** 48 ROM:FFB19720 loc_FFB19720 ; CODE XREF: sub_FFB196D4+34 49 ROM:FFB19720 BL sub_FF8BF204 50 ROM:FFB19724 LDR R2, =0x106571F0 51 ROM:FFB19728 MOVL R3, 0x7E900 52 ROM:FFB19730 MOV R1, R2 53 ROM:FFB19734 STMIA R4, {R2,R3} 54 ROM:FFB19738 LDR R0, =aVramAddressP 55 ROM:FFB1973C BL sub_FFB0F1E8 56 ROM:FFB19740 LDR R1, [R4,#4] 57 ROM:FFB19744 LDR R0, =aVramSize0xX 58 ROM:FFB19748 BL sub_FFB0F1E8 59 ROM:FFB1974C MOV R0, #0 60 ROM:FFB19750 LDMFD SP!, {R4-R7,PC} 61 ROM:FFB19750 ; End of function sub_FFB196D4 62 ROM:FFB19750 63 ROM:FFB19750 ; --------------------------------------------------------------------------- 64 ROM:FFB19754 viewport_fb DCD 0x106571F0 ; DATA XREF: sub_FFB196D4+50 65 ROM:FFB19758 off_FFB19758 DCD aVramAddressP ; DATA XREF: sub_FFB196D4+64 66 ROM:FFB19758 ; "VRAM Address : %p\r" 67 ROM:FFB1975C off_FFB1975C DCD aVramSize0xX ; DATA XREF: sub_FFB196D4+70 68 ROM:FFB1975C ; "VRAM Size : 0x%x\r" 69 ***************/ 70 void *vid_get_viewport_live_fb() 71 { 72 // return (void*)0; // 0x106571F0 + 0x7E900 73 void **fb=(void **)0x5564; //ixus850 @ 0xff8bc488 74 unsigned char buff = *((unsigned char*)0x5574); 75 if (buff == 0) { 76 buff = 2; 77 } 78 else { 79 buff--; 80 } 81 return fb[buff]; 82 } 83 84 /*********** 85 ROM:FF960DC0 MOVL R3, 0x10360000 86 ROM:FF960DC8 LDR LR, =unk_67E0 87 ROM:FF960DCC MOV R12, #0x2D0 88 ROM:FF960DD0 MOV R2, #0xF0 ; '=' 89 ROM:FF960DD4 ADD R3, R3, #0x1000 90 ***********/ 91 void *vid_get_bitmap_fb() 92 { 93 return (void*)0x10361000; // 0x10360000 + 0x1000, see after "BmpDDev.c" in sub_FF960E00 94 } 95 96 /*********** 97 ROM:FFB19720 BL sub_FF8BF204 98 ROM:FFB19724 LDR R2, =0x106571F0 99 ROM:FFB19728 MOVL R3, 0x7E900 100 ROM:FFB19730 MOV R1, R2 101 ***********/ 102 void *vid_get_viewport_fb() 103 { 104 return (void*)0x106571F0; // see after "VRAM Address : %p" in loc_FFB19720 105 } 106 107 /*********** 108 ROM:FF962874 LDR R1, =0x89818 109 ROM:FF962878 ADD R3, R3, R3,LSL#2 110 ***********/ 111 void *vid_get_viewport_fb_d() 112 { 113 return (void*)(*(int*)0x89818); // see before "ImagePlayer.c" at loc_FF962874 114 } 115 116 long vid_get_viewport_height() 117 { 118 //return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:230; 119 return 240; //nafraf 120 //extern int _GetVRAMVPixelsSize(); 121 //return _GetVRAMVPixelsSize(); 122 } 123 124 int vid_get_viewport_width() 125 { 126 return 360; 127 //extern int _GetVRAMHPixelsSize(); 128 //return _GetVRAMHPixelsSize(); 129 } 130 131 extern int _GetVRAMVPixelsSize(); 132 extern int _GetVRAMHPixelsSize(); 133 134 int vid_get_viewport_buffer_width_proper() { return 720; } 135 136 int vid_get_viewport_width_proper() { 137 //return vid_get_viewport_width(); 138 return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:_GetVRAMHPixelsSize(); 139 } 140 141 int vid_get_viewport_height_proper() { 142 return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize(); 143 } 144 145 int vid_get_viewport_fullscreen_height() { 146 // except for stitch, always full screen 147 int m = mode_get(); 148 if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) { 149 return 240; 150 } 151 return vid_get_viewport_height_proper(); 152 } 153 154 int vid_get_viewport_fullscreen_width() { 155 // except for stitch, always full screen 156 int m = mode_get(); 157 if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) { 158 return 720; 159 } 160 return vid_get_viewport_width_proper(); 161 } 162 163 int vid_get_viewport_display_xoffset_proper() { 164 int val=0; 165 int m = mode_get(); 166 if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) { 167 short dir=0; 168 short seq=0; 169 get_property_case(PROPCASE_STITCH_DIRECTION,&dir,sizeof(dir)); 170 get_property_case(PROPCASE_STITCH_SEQUENCE,&seq,sizeof(seq)); 171 // overall stitch window is 3/4 screen width, centered 172 // live part is 1/2, so margin is either 1/8th or 3/8th 173 if(dir==0) { 174 val = seq?270:90; 175 } else { 176 val = seq?90:270; 177 } 178 } 179 return val; 180 } 181 int vid_get_viewport_display_yoffset_proper() { 182 int m = mode_get(); 183 return ((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH)?60:0; // window is 120, centered in 240 screen 184 } 185 186 /***************** 187 ROM:FFAA77B4 a9999 DCB "9999",0 ; DATA XREF: ROM:off_FFAA7824 188 ROM:FFAA77B9 DCB 0 189 ROM:FFAA77BA DCB 0 190 ROM:FFAA77BB DCB 0 191 ROM:FFAA77BC aD_0 DCB "%d",0 ; DATA XREF: ROM:off_FFAA7828 192 ROM:FFAA77BF DCB 0 193 ROM:FFAA77C0 194 ROM:FFAA77C0 ; =============== S U B R O U T I N E ======================================= 195 ROM:FFAA77C0 196 ROM:FFAA77C0 197 ROM:FFAA77C0 sub_FFAA77C0 ; CODE XREF: sub_FFAA79F0+D4 198 ROM:FFAA77C0 MOV R3, #0x2700 199 ROM:FFAA77C4 MOV R2, R0 200 ROM:FFAA77C8 STMFD SP!, {R4,LR} 201 ROM:FFAA77CC ADD R3, R3, #0xE 202 ROM:FFAA77D0 LDR R4, =unk_96F80 203 ROM:FFAA77D4 CMP R2, R3 204 ROM:FFAA77D8 LDR R1, =a9999 205 ROM:FFAA77DC MOV R0, R4 206 ROM:FFAA77E0 BLS loc_FFAA77EC 207 *****************/ 208 char *camera_jpeg_count_str() 209 { 210 return (char*)0x96F80; 211 }