Skip to content

Commit 97f1284

Browse files
committed
found address for writing to the SD, added viewport functions for PTP
1 parent a1b5b92 commit 97f1284

File tree

5 files changed

+52
-6
lines changed

5 files changed

+52
-6
lines changed

platform/m6/lib.c

+44-2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,48 @@ long vid_get_viewport_height() {
119119
return _GetVRAMVPixelsSize();
120120
}
121121

122+
/**
123+
* @header viewport.h
124+
*/
125+
void* vid_get_opacity_active_buffer() {
126+
return opacity_buffer[active_bitmap_buffer & 1];
127+
}
128+
129+
/**
130+
* @header viewport.h
131+
*/
132+
int vid_get_viewport_display_xoffset_proper() {
133+
return vid_get_viewport_display_xoffset();
134+
}
135+
136+
/**
137+
* @header viewport.h
138+
*/
139+
int vid_get_viewport_display_yoffset_proper() {
140+
return vid_get_viewport_display_yoffset();
141+
}
142+
143+
/**
144+
* @header viewport.h
145+
*/
146+
int vid_get_viewport_fullscreen_width() {
147+
return CAM_SCREEN_WIDTH;
148+
}
149+
150+
/**
151+
* @header viewport.h
152+
*/
153+
int vid_get_viewport_fullscreen_height() {
154+
return CAM_SCREEN_HEIGHT;
155+
}
156+
157+
/**
158+
* @header viewport.h
159+
*/
160+
int vid_get_viewport_buffer_width_proper() {
161+
return CAM_BITMAP_WIDTH;
162+
}
163+
122164
/**
123165
* @header viewport.h
124166
*/
@@ -129,8 +171,8 @@ int vid_get_viewport_type() {
129171
/**
130172
* @header viewport.h
131173
*/
132-
void* vid_get_opacity_active_buffer() {
133-
return opacity_buffer[active_bitmap_buffer & 1];
174+
int vid_get_aspect_ratio() {
175+
return LV_ASPECT_3_2;
134176
}
135177

136178
/**

platform/m6/platform_camera.h

+4
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@
7070
#undef CAM_HAS_ERASE_BUTTON
7171
#undef CAM_USE_ZOOM_FOR_MF
7272

73+
#undef CAM_KEY_PRESS_DELAY
74+
#define CAM_KEY_PRESS_DELAY 60
75+
7376
#define CAM_3ARG_DebugAssert 1
7477
#define CAM_FILE_COUNTER_IS_VAR 1
78+
#define PARAM_CAMERA_NAME 2
7579
#define CAM_DATE_FOLDER_NAMING 0x80
7680
#define CAM_QUALITY_OVERRIDE 1
7781
#define CAM_CALC_BLACK_LEVEL 1

platform/m6/sub/101a/boot.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void __attribute__((naked,noinline)) CreateTask_my() {
178178
}
179179

180180
void __attribute__((naked,noinline)) init_file_modules_task() {
181-
// tools/capdis -f=chdk -jfw -stubs -s=task_InitFileModules -c=18 PRIMARY.BIN 0xe0000000
181+
// capdis -f=chdk -jfw -stubs -s=task_InitFileModules -c=18 PRIMARY.BIN 0xe0000000
182182
// task_InitFileModules 0xe00fdd05
183183
asm volatile (
184184
" push {r4, r5, r6, lr}\n"

platform/m6/sub/101a/stubs_entry.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ DEF_CONST(fw_yuv_layer_buf ,0x4196a000) // Found @0xe007b710
194194
//NHSTUB(RenameFile_Fut ,0x00000000) // 0 *** != 0xe0334f31
195195
//NHSTUB(SetFileAttributes ,0x00000000) // 0 *** != 0xe035f66f
196196
//NHSTUB(SetFileTimeStamp ,0x00000000) // 0 *** != 0xe035f627
197+
//NHSTUB(WriteSDCard ,0x00000000) // 0 *** != 0xe04faf19
197198
//NHSTUB(_sqrt ,0x00000000) // 0 *** != 0xdffd619d
198199
//NHSTUB(apex2us ,0x00000000) // 0 *** != 0xe01217c7
199200
//NHSTUB(exmem_ualloc ,0x00000000) // 0 *** != 0xe00744f7
@@ -282,7 +283,6 @@ NHSTUB(UnlockAF ,0xe027a2f1) // 0
282283
NHSTUB(UnlockMainPower ,0xe0088cdb) // 0
283284
NHSTUB(VbattGet ,0xe0072c69) // 0
284285
NHSTUB(Write ,0xe035f2fd) // 0
285-
//NHSTUB(WriteSDCard ,0x00000000) // 0 == 0x00000000
286286
NHSTUB(_log ,0xdffd52c9) // 0
287287
NHSTUB(_log10 ,0xdffd5621) // 0
288288
NHSTUB(_pow ,0xdffd5705) // 0

platform/m6/sub/101a/stubs_entry_2.S

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ NHSTUB(exmem_ualloc, 0xe00744f7)
1919
NHSTUB(exmem_ufree, 0xe0074553)
2020
NHSTUB(reboot_fw_update, 0xe039b733)
2121
NHSTUB(GetImageFolder, 0xe02e3031)
22+
NHSTUB(WriteSDCard, 0xe04faf19)
23+
NHSTUB(MakeSDCardBootable, 0xe036111b)
2224

2325
IGNORE(EngDrvRead)
2426
NHSTUB(EngDrvRead_FW, 0xe05b1d13) // in wrappers
@@ -28,7 +30,6 @@ NHSTUB(GetLensWideFocalLength, 0xe03f4573)
2830

2931
NHSTUB(VTMLock, NULL_SUB)
3032
NHSTUB(VTMUnlock, NULL_SUB)
31-
NHSTUB(MakeSDCardBootable, 0xe036111b)
3233

3334
// MMU
3435
NHSTUB(dcache_clean_by_mva, 0xe036ba79)
@@ -47,4 +48,3 @@ NHSTUB(MoveFocusLensToDistance, NULL_SUB) // TODO: MoveFocusLensWith
4748
NHSTUB(Restart, NULL_SUB) // TODO
4849
NHSTUB(TurnOffBackLight, NULL_SUB) // TODO
4950
NHSTUB(TurnOnBackLight, NULL_SUB) // TODO
50-
NHSTUB(WriteSDCard, NULL_SUB) // TODO

0 commit comments

Comments
 (0)