SX30 IS porting thread - page 8 - General Discussion and Assistance - CHDK Forum

SX30 IS porting thread

  • 115 Replies
  • 63308 Views
Re: SX30 IS porting thread
« Reply #70 on: 12 / December / 2010, 11:07:16 »
Advertisements

Code: [Select]
extern void _LockAndRefresh(); // wrapper function for screen lock
extern void _UnlockAndRefresh(); // wrapper function for screen unlock


Okay - maybe I just don't understand the terminology here so I'll ask a dumb question.  What do you mean by wrapper function ?  I can find ScreenLock() and ScreenUnlock() by matching the S90 port.  The code even seems to make some sense - incrementing and decrementing some sort of lock counter each time the respective routine is called. When you get a minute,  would you mind doing a cut&paste of code for the wrapper function so I can see what you mean?  ScreenLock & Screenunlock seem to get called from a lot of place ( over 450 each ).

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: SX30 IS porting thread
« Reply #71 on: 13 / December / 2010, 06:32:44 »

Okay - maybe I just don't understand the terminology here so I'll ask a dumb question.  What do you mean by wrapper function ?  I can find ScreenLock() and ScreenUnlock() by matching the S90 port.  The code even seems to make some sense - incrementing and decrementing some sort of lock counter each time the respective routine is called. When you get a minute,  would you mind doing a cut&paste of code for the wrapper function so I can see what you mean?  ScreenLock & Screenunlock seem to get called from a lot of place ( over 450 each ).



The wrappers are the functions created by the NHSTUB macro in the stubs_entry_2.s file. They are used to allow the CHDK code written in C to safely call the assembler functions in the firmware.

Regards,
Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: SX30 IS porting thread
« Reply #72 on: 21 / December / 2010, 18:38:57 »
@Phil

I am going to check PARAM_FILE_COUNTER and get_parameter_data() for the S95.

In case I get bogged-down, any tips for finding them ?

I am disasembling SX30 100h now so can you tell me those two addresses for comparison ?

David
« Last Edit: 21 / December / 2010, 18:57:14 by Microfunguy »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: SX30 IS porting thread
« Reply #73 on: 21 / December / 2010, 18:58:39 »
@Phil

I am going to check PARAM_FILE_COUNTER and get_parameter_data() for the S95.

In case I get bogged-down, any tips for finding them ?


David

Easiest way to find PARAM values is to enable the debug display. For FILE_COUNTER take photos and see which value increases each time.

I found GetParameterData by comparing the code for SX20 and S95 in IDA.
It seems to be the function jumped to near the start of eventproc_export_PTM_RestoreUIProperty (BCS _sub_XXXX)

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: SX30 IS porting thread
« Reply #74 on: 21 / December / 2010, 19:01:30 »
SDM does not have debug display, he will have to use CHDK.


So, GetParameterData address is correct for S95 100E ?

That must mean FILE_COUNTER is wrong.

The tester can save RAW if I force my own image folder and image number.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: SX30 IS porting thread
« Reply #75 on: 21 / December / 2010, 19:09:37 »
SDM does not have debug display, he will have to use CHDK.


So, GetParameterData address is correct for S95 100E ?

That must mean FILE_COUNTER is wrong.

The tester can save RAW if I force my own image folder and image number.

I don't have an S95 so I can't say whether the value is correct or not.

The PARAM_FILE_COUNTER value was 0x38 on the SX20; but it's 0x3A on the SX30.
A lot of the PROPCASE values changed as well so it could be different on the S95.

I also had to replace the logic in get_target_dir_num to always return 100. The newer cameras use a new folder naming system based on the current date so you can't determine the JPEG folder from the FILE_COUNTER value anymore.
I haven't worked out how to determine the folder name on the SX30 yet.

Regards,
Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: SX30 IS porting thread
« Reply #76 on: 21 / December / 2010, 19:13:51 »
It is getting late in New Zealand .. to save me time can you post that code ?

The function that returns file counter number causes the camera to crash.

Can you save CHDK RAW on the SX30 ?
« Last Edit: 21 / December / 2010, 19:18:30 by Microfunguy »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: SX30 IS porting thread
« Reply #77 on: 21 / December / 2010, 19:19:59 »
It is getting late in New Zealand .. to save me time can you post that code ?

 :) 1:20pm is late ?

Quote
The function that returns target file number causes the camera to crash.

If get_target_file_num crashes then you definitely have the wrong value for PARAM_FILE_COUNTER.

My get_target_dir_num is:
Code: [Select]
long get_target_dir_num() {
// SX30 uses date to name directory
return 100;
/*
long n;

n = get_file_next_counter();
n = (n>>18)&0x3FF;
return n;
*/
}

Quote
Can you save CHDK RAW on the SX30 ?

Yes, RAW is working fine (except for low light scene mode).

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: SX30 IS porting thread
« Reply #78 on: 21 / December / 2010, 19:22:29 »
No, it is not late for me either  :)

EDIT

I guess I got that wrong !

Incidentally, a text search in IDA for 'eventproc_export_PTM_RestoreUIProperty' doesn't find anything.

Even a search for just part of that does not find anything.

So, do all your raws go into 100DCIM ?
« Last Edit: 21 / December / 2010, 19:27:11 by Microfunguy »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: SX30 IS porting thread
« Reply #79 on: 21 / December / 2010, 19:27:03 »
Incidentally, a text search in IDA for 'eventproc_export_PTM_RestoreUIProperty' doesn't find anything.

Even a search for just part of that does not find anything.

If you applied the DryOS signatures and ran FE50's scripts then it should have found and named that function automatically.
It found it on the S95 1.00H firmware version that I used as a reference for my port.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal