PowerShot SX210 IS - Porting Thread - page 18 - General Discussion and Assistance - CHDK Forum

PowerShot SX210 IS - Porting Thread

  • 589 Replies
  • 325069 Views
*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #170 on: 29 / August / 2010, 04:21:56 »
Advertisements
solved the stat mistery thanks to RaduP looking at the sd980 port http://chdk.setepontos.com/index.php/topic,4403.0.html

The address I find for the function is right, the problem was in the struct stat itself, there is a new one for newer cammeras,

so in camera.h you have to include this:

Code: [Select]
 #define CAM_DRYOS_2_3_R39 1
still in development but for now thats what I have, mostly copied from sx200

Code: [Select]
#elif defined (CAMERA_sx210is)
    // copied from SX200 and modified
    #define CAM_DRYOS_2_3_R39 1
    #define CAM_PROPSET                 2
    #define CAM_DRYOS                   1
    #define CAM_RAW_ROWPIX              4416 // from calcs see 100C lib.c   //ASM1989 08.20.2010
    #define CAM_RAW_ROWS                3296 //  "     "    "    "    "  //ASM1989 08.20.2010

    #undef  CAM_CAN_SD_OVER_NOT_IN_MF
    #undef  CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO
    #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1



    #define CAM_VIDEO_QUALITY_ONLY          1

    #undef  CAM_VIDEO_CONTROL
    #define CAM_MULTIPART               1
    #define CAM_HAS_JOGDIAL             1
    #undef  CAM_USE_ZOOM_FOR_MF
    #undef  CAM_UNCACHED_BIT  // shut up compiler
    #define CAM_UNCACHED_BIT    0x40000000
    #define DNG_SUPPORT                 1
    // pattern
    #define cam_CFAPattern 0x02010100 // Red  Green  Green  Blue
    // color
    //need fixing *****************************************************
    #define CAM_COLORMATRIX1                               \
      14134, 1000000, -5576, 1000000, -1527, 1000000, \
     -1991,  1000000, 10719,  1000000, 1273,   1000000, \
      -1158,   1000000, 1929,   1000000, 3581,  1000000

    #define cam_CalibrationIlluminant1 17 // Standard Light A
    // cropping  //ASM1989 08.20.2010
    #define CAM_JPEG_WIDTH  4320
    #define CAM_JPEG_HEIGHT 3240
    #define CAM_ACTIVE_AREA_X1 48
    #define CAM_ACTIVE_AREA_Y1 28
    #define CAM_ACTIVE_AREA_X2 4368
    #define CAM_ACTIVE_AREA_Y2 3324
    // camera name
    #define PARAM_CAMERA_NAME 4 // parameter number for GetParameterData
    #undef  CAM_SENSOR_BITS_PER_PIXEL
    #undef  CAM_WHITE_LEVEL
    #undef  CAM_BLACK_LEVEL
    #define CAM_SENSOR_BITS_PER_PIXEL   12
    #define CAM_WHITE_LEVEL             ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)
    #define CAM_BLACK_LEVEL             127

    #define CAM_EXT_TV_RANGE            1
    #undef CAM_BITMAP_PALETTE
    #define CAM_BITMAP_PALETTE    3
    #undef CAM_HAS_ERASE_BUTTON
    #define  CAM_SHOW_OSD_IN_SHOOT_MENU  1

    //nandoide sept-2009
    #undef CAM_USES_ASPECT_CORRECTION
    #undef CAM_USES_ASPECT_YCORRECTION
    #define CAM_USES_ASPECT_CORRECTION  1  //camera uses the modified graphics primitives to map screens an viewports to buffers more sized
    #define CAM_USES_ASPECT_YCORRECTION  0  //only uses mappings on x coordinate

// reyalp TODO not sure this stuff belongs in camera.h there will probably only be a few different setups
// maybe we can just have one CAM_ options that picks what to use ?
// values need to be better documented
// reyalp - I guess these are bitmap ?
    //default mappings
    #undef ASPECT_XCORRECTION
    #define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 )   //correction x*screen_buffer_width/screen_width = x*720/320 = x*9/4 = (x<<3 + x)>>2

    //grids
    #undef ASPECT_GRID_XCORRECTION
    #define ASPECT_GRID_XCORRECTION(x)  ( ((x)<<3)/9  )  //grids are designed on a 360x240 basis and screen is 320x240, we need x*320/360=x*8/9
    #undef ASPECT_GRID_YCORRECTION
    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.

    //viewport
    #undef ASPECT_VIEWPORT_XCORRECTION
    #define ASPECT_VIEWPORT_XCORRECTION(x) ASPECT_GRID_XCORRECTION(x) //viewport is 360x240 and screen 320x240, we need x*320/360=x*8/9, equal than grids, used by edgeoverlay
    #undef ASPECT_VIEWPORT_YCORRECTION
    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
    #undef EDGE_HMARGIN
    #define EDGE_HMARGIN 20

    //games mappings
   #undef GAMES_SCREEN_WIDTH
   #undef GAMES_SCREEN_HEIGHT
   #define GAMES_SCREEN_WIDTH 360
   #define GAMES_SCREEN_HEIGHT 240
   #undef ASPECT_GAMES_XCORRECTION
   // 720/360=2 same aspect than grids and viewport but another approach: there is a lot of corrections to do in game's code, and we decide to paint directly on display buffer wirh another resolution
   // used by gui.c that configures the draw environment (trhough new draw_gui function) depending on gui_mode: we have then 360x240 for games (but deformed output:circles are not circles) and 320x240 for
   // other modes in perfect aspect ratio 4/3: slightly better visualization: file menus more readable, ...
   #define ASPECT_GAMES_XCORRECTION(x)   ( ((x)<<1) )
   #undef ASPECT_GAMES_YCORRECTION
   #define ASPECT_GAMES_YCORRECTION(y)   ( (y) )  //none

   //zebra letterbox for saving memory
   #undef ZEBRA_HMARGIN0
   #define ZEBRA_HMARGIN0  30 //this 30 rows are not used by the display buffer is 720x240 effective, no 960x270, i.e. (270-240) reduction in widht possible but not done (more difficult to manage it and slower).

   //end nandoide sept-2009
   #define CAM_QUALITY_OVERRIDE 1
   #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1
//----------------------------------------------------------
« Last Edit: 29 / August / 2010, 04:24:35 by asm1989 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #171 on: 29 / August / 2010, 07:09:31 »
Ok, new version of the sources Here http://es.drop.io/sx210is_platformv01
File Sourcesx210isASM1989-v.03.zip

As soon as Harpoma joins, I think wont take long to get a working alpha,

For now the spytask y correctly loaded, and the logo and info, show,
-Almost all of the funcs have the right addresss


it still remains on the screen, not fixed yet.
« Last Edit: 29 / August / 2010, 07:23:25 by asm1989 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #172 on: 29 / August / 2010, 16:13:17 »
The vid_bitmap_refresh mistery solved

The logo screen seems to dont go away, but it can be solved, looking again at the  RaduP  sd980 port, you have to find another "magic number", in the case of the sx210 was 0x9D08, found at FFA1CF50, tracing back from FFA1DB68

Code: [Select]
void vid_bitmap_refresh()
{
 extern int enabled_refresh_physical_screen;
 enabled_refresh_physical_screen=1;
 *(int*)0x9D08=3;//this is set somewhere in a function called by RefreshPhysicalScreen, should be easy to find
 _RefreshPhysicalScreen(1);
}
and the logo screen shows and disappear as expected.
« Last Edit: 29 / August / 2010, 16:16:38 by asm1989 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #173 on: 01 / September / 2010, 13:28:04 »
OK still things to solve, but a litle look into keyboard,

values in review mode for some keys:
physw_status (0,1,2)
iddle   <>   880a19b   <>   ffdbf   <>   400000
menu   <>   880a19b   <>   bfdbf   <>   400000
disp   <>   880a19b   <>   dfdbf   <>   400000
zoomup   <>   880a19b   <>   ffdbb   <>   400000
zoomdwn   <>   880a19b   <>   ffdbe   <>   400000
print   <>   880a19b   <>   7fdbf   <>   400000
func   <>   880a19b   <>   efdbf   <>   400000
soft press                  
right   <>   880a19b   <>   fddbf   <>   400000
left   <>   880a19b   <>   fedbf   <>   400000
up   <>   880a19b   <>   ff9bf   <>   400000
down   <>   880a19b   <>   ff5bf   <>   400000
hard press                  
right   <>   880a19b   <>   f95bf   <>   400000
left   <>   880a19b   <>   f65bf   <>   400000
up   <>   880a11b   <>   ffe9f   <>   400000
down   <>   880a09b   <>   ff5bf   <>   400000

now how do I get the keymap[] and masks?

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: PowerShot SX210 IS - Porting Thread
« Reply #174 on: 01 / September / 2010, 13:54:14 »
OK still things to solve, but a litle look into keyboard,

values in review mode for some keys:
physw_status (0,1,2)
iddle   <>   880a19b   <>   ffdbf   <>   400000
menu   <>   880a19b   <>   bfdbf   <>   400000
disp   <>   880a19b   <>   dfdbf   <>   400000
zoomup   <>   880a19b   <>   ffdbb   <>   400000
zoomdwn   <>   880a19b   <>   ffdbe   <>   400000
print   <>   880a19b   <>   7fdbf   <>   400000
func   <>   880a19b   <>   efdbf   <>   400000
soft press                  
right   <>   880a19b   <>   fddbf   <>   400000
left   <>   880a19b   <>   fedbf   <>   400000
up   <>   880a19b   <>   ff9bf   <>   400000
down   <>   880a19b   <>   ff5bf   <>   400000
hard press                  
right   <>   880a19b   <>   f95bf   <>   400000
left   <>   880a19b   <>   f65bf   <>   400000
up   <>   880a11b   <>   ffe9f   <>   400000
down   <>   880a09b   <>   ff5bf   <>   400000

now how do I get the keymap[] and masks?
I already answered your question here: http://chdk.setepontos.com/index.php/topic,5574.msg54457.html#msg54457 .

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #175 on: 01 / September / 2010, 13:58:56 »
Thanks pixeldoc2000,

some of them:

Code: [Select]
{ 1, KEY_SET , 0x00010000 },     // ASM1989 untested
{ 1, KEY_MENU , 0x00040000 },     // ASM1989 untested
{ 1, KEY_DISPLAY    , 0x00020000 },     // ASM1989 untested
{ 1, KEY_PRINT , 0x00080000 },     // ASM1989 untested

Regarding up,down,left,right,

what should I use, the soft or hard press numbers? 

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: PowerShot SX210 IS - Porting Thread
« Reply #176 on: 01 / September / 2010, 14:14:14 »
Regarding up,down,left,right,

what should I use, the soft or hard press numbers?  
You must use the value you get when you fully press down the key.
The value you get when you gently lay your finger down on the key is your "feather" value (should only happend on Jogdial anyway).
« Last Edit: 01 / September / 2010, 14:32:22 by pixeldoc2000 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #177 on: 02 / September / 2010, 12:26:09 »
OK I wasn't able yet to make the keyboard to work, I fact I'm not still sure if the hook is working, to dont stop and since my port comes from sx200, I have many code regarding the jogdial that is't set yet.

I find at FF862024 the JogDial_task but its somehow different from sx200

Harpoma as soon as you get it let me know, so we can advance faster.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #178 on: 02 / September / 2010, 14:53:42 »
OK, finished the port of JogDial_task_my for boot.c

Need to be tested, but from the sd980 looks like the function is right with some changes its at at FF862024

here is the code: http://www.zshare.net/download/7999710207e61e17/

boot.c is almost finished, but needs testing
« Last Edit: 02 / September / 2010, 15:05:01 by asm1989 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: PowerShot SX210 IS - Porting Thread
« Reply #179 on: 03 / September / 2010, 15:22:10 »
Half of the capt_seq.c finished

Left here for the intrepids, http://www.zshare.net/download/80031811aa00a574/

including comments with the diferences with the sx200


 

Related Topics


SimplePortal © 2008-2014, SimplePortal