Powershot A3100 - Porting thread - page 2 - DryOS Development - CHDK Forum

Powershot A3100 - Porting thread

  • 139 Replies
  • 64542 Views
Re: Powershot A3100 - Porting thread
« Reply #10 on: 24 / August / 2010, 14:00:46 »
Advertisements

#define FLASH   0xC022000C

FLASH "LED" shoots flash once

You are saying that writing the value 0x46 to address 0xC022000C triggers the camera's electronic flash ?

Re: Powershot A3100 - Porting thread
« Reply #11 on: 24 / August / 2010, 14:46:23 »
You are saying that writing the value 0x46 to address 0xC022000C triggers the camera's electronic flash ?
Yes (if flash's capacitor is full and battery not low voltage), and the same situation is for sx210 and sd3500, but addresses may be different, because I don't explore deeply that cameras, just used blinker (0xC0220000-0xC02200FF), and flash triggered.
But flash triggers just once, I don't know why, because if &(0xC022000C)==0x46 flash must triggers when capacitor recharge process completed, but recharge time pass and nothing happens. I'll make some experiments with flash tomorrow, and report any results

Re: Powershot A3100 - Porting thread
« Reply #12 on: 24 / August / 2010, 15:27:47 »
Maybe you have to write 0x44 to that location after flash triggers and then 0x46.

*

Offline reyalp

  • ******
  • 14080
Re: Powershot A3100 - Porting thread
« Reply #13 on: 24 / August / 2010, 22:12:46 »
I would suggest using camera functions to control the flash (once the port is a bit further along, obviously). IMO, it's one of the components more likely to have the capability to do actual damage somewhere. I'd similarly avoid unnecessary poking of random MMIO addresses, although AFAIK no one managed to melt their camera yet doing this.
Don't forget what the H stands for.


Re: Powershot A3100 - Porting thread
« Reply #14 on: 26 / August / 2010, 08:31:54 »
Maybe you have to write 0x44 to that location after flash triggers and then 0x46.
No, it doesn't work.

Today's progress:
Looks like I found right values for vid_<> fucntions from platform/<camera>/sub/<fw>/lib.c, because draw-funcs (like draw_line, or draw_txt_string) works well, after draw_init() & font_init()

Here is source code for platform/<camera>/sub/<fw>/lib.c:
Code: [Select]
#include "platform.h"
//-- --------------------A3100IS--------------------------

char *hook_raw_image_addr()
{
//found at FFAADCF0
//Near to "CRAW BUFF       %p"
return (char*)(0x1062C660);
}

long hook_raw_size()
{
//found at FFAADD50
//Near to "CRAW BUFF SIZE  %p"
return 0x11CA240;
}

// Live picture buffer (shoot not pressed)
void *vid_get_viewport_live_fb()
{
    void **fb=(void **)0x3BC0;                               // May be not. Found: 0xFF8CD778
    unsigned char buff = *((unsigned char*)0x437C);          // found at FF8CD38C (near string "TgTask")
    if (buff == 0) buff = 2;  else buff--;   
    return fb[buff];
}

// OSD buffer
void *vid_get_bitmap_fb()
{
return (void*)0x103E1000;       // found at FFA0F230
}

// Live picture buffer (shoot half-pressed)
void *vid_get_viewport_fb()
{
return (void*)0x106F3BC0;       //found at FFAAA8E8 (search like for A2000)
}

void *vid_get_viewport_fb_d()
{                 
return (void*)(*(int*)(0x2630+0x48));    // found at FF863AC8 and  (0x48 at FF863AD0)
}

// found at FF8EBC78                 height 240
// found at FF8EBC7C                width 720

long vid_get_bitmap_screen_width()
{
return 720;
}

long vid_get_bitmap_screen_height()
{
return 240;
}


int vid_get_viewport_width()
{
    return 360;                                               
}

long vid_get_viewport_height()
{
    return 240;
}

char *camera_jpeg_count_str()
{
 return (void*)0x76B3C;    // found at FF9A9124, search string: "9999"
}

long vid_get_bitmap_buffer_width() { return 360; }

long vid_get_bitmap_buffer_height() { return 240; }

Re: Powershot A3100 - Porting thread
« Reply #15 on: 27 / August / 2010, 11:35:48 »
Some progress for today:
in core/main.c funcs conf_restore() & gui_init() now works, but I commented some conf defs, because of it's funcs crash camera:
Code: [Select]
void conf_load_defaults() {
   ....
    for (i=0; i<CONF_NUM; ++i) {
        #if defined (CAMERA_a3100)
if (i==65)
continue;
if (i==186)
continue;
#endif
....
I have no idea why this crash camera

gui_redraw() in main.c also partially work. But without gui_draw_osd()
Logo (from CHDK/DATA/logo.dat) doesn't work.

And another big problem: fonts are very big. OSD have only about 10x30 lines max. Why it can be? (May be wrong values of vid_get_bitmap_screen_height or vid_get_viewport_height in platform/<camera>/sub/<fw>/lib.c?)

Re: Powershot A3100 - Porting thread
« Reply #16 on: 18 / September / 2010, 23:00:49 »
I got my A3100 IS a while back and was completely underwhelmed by it's features. I would love an update on the progress of this hack! And is there anything I could do to help?

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: Powershot A3100 - Porting thread
« Reply #17 on: 20 / September / 2010, 13:16:01 »
And another big problem: fonts are very big. OSD have only about 10x30 lines max. Why it can be? (May be wrong values of vid_get_bitmap_screen_height or vid_get_viewport_height in platform/<camera>/sub/<fw>/lib.c?)
Very likely your video buffer stuff is not correct:

platform\a3100\sub\<firmware>\lib.c
Code: (c) [Select]
long vid_get_bitmap_screen_width() { return 960; }
long vid_get_bitmap_screen_height() { return 240; }

int vid_get_viewport_width() { return 360; }
long vid_get_viewport_height() { return 240; }

long vid_get_bitmap_buffer_width() { return 960; }
long vid_get_bitmap_buffer_height() { return 270; }
These are values i currently use on SD4000 (not nesserary correct).

otherwise play with this stuff:
include\camera.h
Code: (c) [Select]
CAM_USES_ASPECT_CORRECTION
CAM_USES_ASPECT_YCORRECTION

ASPECT_XCORRECTION
ASPECT_YCORRECTION

ASPECT_VIEWPORT_XCORRECTION
ASPECT_VIEWPORT_YCORRECTION
« Last Edit: 20 / September / 2010, 13:19:43 by pixeldoc2000 »


Re: Powershot A3100 - Porting thread
« Reply #18 on: 22 / September / 2010, 06:47:37 »
Thanks pixeldoc2000!
I changed this:
Code: [Select]
ASPECT_XCORRECTION(x)  ( (x)/2 )   //correction x*screen_buffer_width/screen_width = x*360/720 = x/2And screen now looks pretty good.

Now I'll try to make keymap and kbd staff..
Any links "how to do" or help welcome.  :)


 

Related Topics