SX60HS Porting - page 70 - DryOS Development - CHDK Forum  

SX60HS Porting

  • 915 Replies
  • 348146 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #690 on: 25 / February / 2017, 08:42:41 »
Advertisements
@62ndidiot
Can you take a look at the sx60 loader files and make them similar to the other D6 ports? Compatibility check is currently disabled and the unified core_copy() is not used. Note that the current D6 stubs_entry.S files are suitable for auto-generated bin_compat.h headers which makes bin_compat_fix.h files unnecessary in most cases (except for sx280/275/270).

Re: SX60HS Porting
« Reply #691 on: 25 / February / 2017, 21:45:36 »
Sure, I haven't looked at those files in very long time.  It'll take a few days to get to it.

Re: SX60HS Porting
« Reply #692 on: 26 / February / 2017, 15:09:09 »
Quote
Can you take a look at the sx60 loader files and make them similar to the other D6 ports? Compatibility check is currently disabled and the unified core_copy() is not used.
I modified loader/sx60hs/main.c to use core copy.  As far as I can see compatibility checking is enabled, already i.e. check_compat() is called.

Quote
Note that the current D6 stubs_entry.S files are suitable for auto-generated bin_compat.h headers which makes bin_compat_fix.h files unnecessary in most cases (except for sx280/275/270).
I checked g7x and  I see bin_comp_fix.h is still used. I'll investigate further and see if I can bypass this.

Edit: deleted bin_comp.h and it is created correctly automatically.....



« Last Edit: 26 / February / 2017, 15:13:43 by 62ndidiot »

*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #693 on: 26 / February / 2017, 18:44:38 »
I modified loader/sx60hs/main.c to use core copy.  As far as I can see compatibility checking is enabled, already i.e. check_compat() is called.
The source in CHDK trunk does not call it (you may have a local copy that is different). Following diff is against current svn:
Code: [Select]
Index: loader/sx60hs/main.c
===================================================================
--- loader/sx60hs/main.c (revision 4759)
+++ loader/sx60hs/main.c (working copy)
@@ -1,4 +1,4 @@
-//#include "check_compat.c"
+#include "../generic/check_compat.c"
 
 extern long *blob_chdk_core;
 extern long blob_chdk_core_size;
@@ -5,34 +5,20 @@
 
 void __attribute__((noreturn)) my_restart()
 {
-//    check_compat();
+    check_compat();
 
-    // light up green LED
-//    *(int*)0xd20b0884 = 0x4d0002;
-    // LED done
     long *dst = (long*)MEMISOSTART;
     const long *src = blob_chdk_core;
     long length = (blob_chdk_core_size + 3) >> 2;
 
-    if (src < dst && dst < src + length) {
-        /* Have to copy backwards */
-        src += length;
-        dst += length;
-        while (length--) {
-            *--dst = *--src;
-        }
-    } else {
-        while (length--) {
-            *dst++ = *src++;
-        }
-    }
-     *(volatile unsigned *)(0x4ffc)=0x12345678;
+    core_copy(src, dst, length);
 
-//    *(int*)0xd20b0884 = 0x4d0002;
-    asm volatile ( // fc095c80 102b/102c
+    *(volatile unsigned *)(0x4ffc)=0x12345678;
+
+    asm volatile (
     "mov     r1, %1\n"
     "mov     r0, %0\n"
-    "ldr     r2, =0xfc1361cf\n" // address is for 100f
+    "ldr     r2, =0xfc1361cf\n" // address valid for 100f, 100c, 100b
     "blx     r2\n"              // caching related routine called at fw startup
     "mov     r0, %0\n"
     "add     r0, r0, #1\n"
The bin_comp_fix.h issue is not a major problem, just cosmetic.


Re: SX60HS Porting
« Reply #694 on: 26 / February / 2017, 21:09:30 »
Quote
The source in CHDK trunk does not call it (you may have a local copy that is different).
I've attached the loader diff file for sx60hs.
Code: [Select]
Index: loader/sx60hs/main.c
===================================================================
--- loader/sx60hs/main.c (revision 4757)
+++ loader/sx60hs/main.c (working copy)
@@ -1,4 +1,4 @@
-//#include "check_compat.c"
+#include "../generic/check_compat.c"
 
 extern long *blob_chdk_core;
 extern long blob_chdk_core_size;
@@ -5,34 +5,21 @@
 
 void __attribute__((noreturn)) my_restart()
 {
-//    check_compat();
+    check_compat();
 
-    // light up green LED
-//    *(int*)0xd20b0884 = 0x4d0002;
-    // LED done
     long *dst = (long*)MEMISOSTART;
     const long *src = blob_chdk_core;
     long length = (blob_chdk_core_size + 3) >> 2;
 
-    if (src < dst && dst < src + length) {
-        /* Have to copy backwards */
-        src += length;
-        dst += length;
-        while (length--) {
-            *--dst = *--src;
-        }
-    } else {
-        while (length--) {
-            *dst++ = *src++;
-        }
-    }
+    core_copy(src, dst, length);
+
+
      *(volatile unsigned *)(0x4ffc)=0x12345678;
 
-//    *(int*)0xd20b0884 = 0x4d0002;
     asm volatile ( // fc095c80 102b/102c
     "mov     r1, %1\n"
     "mov     r0, %0\n"
-    "ldr     r2, =0xfc1361cf\n" // address is for 100f
+    "ldr     r2, =0xfc1361cf\n" // address is for 100b, 100c, 100f
     "blx     r2\n"              // caching related routine called at fw startup
     "mov     r0, %0\n"
     "add     r0, r0, #1\n"

Perhaps I should post a diff of platform/sx60hs as well? There are a few differences that are not yet included in any build that I have posted as the "official" alpha release but I think could be included.

What about histogram and zebra ( and the motion detection color fix )? I've posted sources etc, but would a fresh diff be useful?

Re: SX60HS Porting
« Reply #695 on: 26 / February / 2017, 21:15:58 »
As I work through the G16 port, any updates you make to the dev trunk will no doubt be most helpful.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #696 on: 27 / February / 2017, 11:39:26 »
Perhaps I should post a diff of platform/sx60hs as well? There are a few differences that are not yet included in any build that I have posted as the "official" alpha release but I think could be included.
If those changes are considered stable, then post them as well.
Quote
What about histogram and zebra ( and the motion detection color fix )? I've posted sources etc, but would a fresh diff be useful?
Your zebra code relies on some changes in core (the drawing routines).
Since the future direction of D6 drawing has not been decided, your code may need to be changed (it will have to be cleaned up anyway).
The choice is between quarter resolution and full resolution. Unfortunately, I'm the only one working on it at the moment. If that continues to be so, it will take some time until all drawing related stuff gets sorted. I'm still working to complete the full res version of D6 drawing routines.

Re: SX60HS Porting
« Reply #697 on: 27 / February / 2017, 18:25:38 »
Quote
The choice is between quarter resolution and full resolution. Unfortunately, I'm the only one working on it at the moment. If that continues to be so, it will take some time until all drawing related stuff gets sorted. I'm still working to complete the full res version of D6 drawing routines.
Perhaps both choices should be supported?  The SX60HS LCD is a 4:3 (640x480) so scales nicely in any case, but some people may prefer to use the full resolution, depending on how they utilize CHDK.


Re: SX60HS Porting
« Reply #698 on: 01 / March / 2017, 19:58:23 »
reviewing some code....that I had implemented but then deleted for the 100f case testing.

Probably a stupid question:

What is the implementation of  task_Liveimage used/good for in movie_rec.c?

*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #699 on: 01 / March / 2017, 20:25:00 »
What is the implementation of  task_Liveimage used/good for in movie_rec.c?
Not a stupid question. In the latest pre-DIGIC 6 ports, that task is hooked to make movie quality/bitrate override possible at higher video resolutions (HD-fullHD). In earlier cameras, it was enough to hook task_MovieRecord.
It's not known whether that task is doing any video compression related work on D6.

 

Related Topics