A2300 porting thread - page 2 - DryOS Development - CHDK Forum

A2300 porting thread

  • 70 Replies
  • 38098 Views
Re: A2300 porting thread
« Reply #10 on: 17 / July / 2012, 21:01:38 »
Advertisements
I know that the value 0x24B8 is taken from a procedure called in taskcreate_Startup.  But how to find the button address (0xC0220048)? 
Should I use script as was done to find LED addresses?
I don't remember the last time I had to find this address,  but if you grep the trunk/platform file for "correct power-on"  (you need the quotes) you get the addresses for where this was found for many of the ports.

Once you understand the code for a camera close to yours,  you can probably use CHDK-PT to find the same routine for yours.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: A2300 porting thread
« Reply #11 on: 17 / July / 2012, 21:34:47 »
Now CHDK is booting.  I discovered that the problem was related to the start mode detection.

I'm using values from boot.c file for a4000 written by alvm.  I'm using the same values, but I'm not sure how to find them.  Is there any documentation about that?
Code: [Select]
    if ((*(int*) 0xC0220048) & 1)                   // look at play switch
            *(int*)(0x24B8 + 4) = 0x100000;         // start in play mode
    else
            *(int*)(0x24B8 + 4) = 0x200000;         // start in rec mode

I know that the value 0x24B8 is taken from a procedure called in taskcreate_Startup.  But how to find the button address (0xC0220048)? 
You can do that later, when you have a working OSD (or you search for the related addresses in your reference camera's firmware). Most probably you'll find that both of those are using a base pointer + offset addressing scheme (e.g. LDR Rx, =0xC0220000 later  followed by LDR Ry, [Rx, #0x48] according to your example). It's also a good idea not to set unknown words in RAM to some random values ;)
Quote
Should I use script as was done to find LED addresses?
That could be difficult: you need to detect the pressed state of either the On/Off or the Play button. You'd need to start the camera with one of those buttons held down. The Canon Basic script may not start under such a condition.

One more note, waterwingz's suggestion should be read as
Quote
but if you grep the trunk/platform folder for "correct power-on"  (you need the quotes) you get the addresses for where this was found for many of the ports
;)
« Last Edit: 17 / July / 2012, 21:42:19 by srsa_4c »

*

Offline nafraf

  • *****
  • 1308
Re: A2300 porting thread
« Reply #12 on: 21 / July / 2012, 16:07:56 »
a2300/kbd.c file was ported, keyboard is working and now It's possible to navigate through CHDK menu. 
Powershot Axxxx released in 2012 have a new Help button, can I add a new definition to include/keyboard.h?
Code: [Select]
//A810/A1300/A2300/A2400/A4000
#define KEY_HELP 39

I'm using the Help button to enter in ALT mode.  Is it OK or do you have any comment?



*

Offline srsa_4c

  • ******
  • 4451
Re: A2300 porting thread
« Reply #13 on: 21 / July / 2012, 16:31:38 »
Is it OK or do you have any comment?
Both sound good to me.


*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: A2300 porting thread
« Reply #14 on: 21 / July / 2012, 17:49:52 »
I'm using the Help button to enter in ALT mode.  Is it OK or do you have any comment?

I suggest the playback button [>], because we need an unified standard. The help button is a good option for the function '<ALT> mode button'.

http://chdk.setepontos.com/index.php?topic=6787.0

msl
CHDK-DE:  CHDK-DE links

*

Offline nafraf

  • *****
  • 1308
Re: A2300 porting thread
« Reply #15 on: 22 / July / 2012, 19:22:44 »
I suggest the playback button [>], because we need an unified standard. The help button is a good option for the function '<ALT> mode button'.
@msi
I like standards, so I followed your recommendation and I'm using playback button to enter in ALT mode.
But I did not understand the second part of your comment, what do you mean with "<ALT> mode button"? Am I missing some special  function button?

Btw, I don't know if the start mode controlled by pressing time of power button is an standard, but I like it. I saw it in SX200 Wiki and implemented in A2200.

Quote from: chdk_wikia link=http://chdk.wikia.com/wiki/SX200
The SX200 normally starts in Playback mode, to switch to Record mode half press the Shutter button once.
To start directly in Record mode, hold down the Power button ~ 1-2 seconds
I'm using that behavior in a2300 port. Any comment?

*

Offline reyalp

  • ******
  • 14111
Re: A2300 porting thread
« Reply #16 on: 22 / July / 2012, 21:22:07 »
@msi
I like standards, so I followed your recommendation and I'm using playback button to enter in ALT mode.
But I did not understand the second part of your comment, what do you mean with "<ALT> mode button"? Am I missing some special  function button?
I think he means making the help button an option, if you implement the adjustable alt key feature.
Quote
Quote from: chdk_wikia link=http://chdk.wikia.com/wiki/SX200
The SX200 normally starts in Playback mode, to switch to Record mode half press the Shutter button once.
To start directly in Record mode, hold down the Power button ~ 1-2 seconds
I'm using that behavior in a2300 port. Any comment?
Yes, this is the correct way. Otherwise users starting with the play button might have the lens extend unexpectedly, which could damage the camera.
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: A2300 porting thread
« Reply #17 on: 23 / July / 2012, 06:58:10 »
@msi
I like standards, so I followed your recommendation and I'm using playback button to enter in ALT mode.
But I did not understand the second part of your comment, what do you mean with "<ALT> mode button"? Am I missing some special  function button?
I think he means making the help button an option, if you implement the adjustable alt key feature.

That's correct, using the help button for the function 'adjustable <ALT> button'.

msl
CHDK-DE:  CHDK-DE links


*

Offline nafraf

  • *****
  • 1308
Re: A2300 porting thread
« Reply #18 on: 25 / July / 2012, 13:20:07 »
That's correct, using the help button for the function 'adjustable <ALT> button'.
OK.  ALT button is configurated. Playback button [>] to enter in ALT mode. Adjustable ALT button options: KEY_HELP, and KEY_VIDEO.  That's working.

Now I'm checking behavior using chdkptp. Command "mkdir DIRNAME" report error, but directories are created After reboot, directory dissapears.
Code: [Select]
con> ls
CHDK/
DCIM/
DISKBOOT.BIN
THANKS
changelog.txt
readme.txt
vers.req
con 4> mkdir NewDir 
ERROR: A/NewDir: error
con 5> ls
CHDK/
DCIM/
DISKBOOT.BIN
NewDir/
THANKS
changelog.txt
readme.txt
vers.req
con 6> delete NewDir
A/NewDir: OK
con 7> ls
CHDK/
DCIM/
DISKBOOT.BIN
THANKS
changelog.txt
readme.txt
vers.req

SDCard is formatted as FAT16.  Other commands like delete, ls, upload, download work OK.  Have you seen this bug before?

MakeDirectory_Fut was not found automatically, but I found it by comparison with sx260 dump.  I think that the address is correct, because directory is created.

« Last Edit: 26 / July / 2012, 17:40:45 by nafraf »

*

Offline srsa_4c

  • ******
  • 4451
Re: A2300 porting thread
« Reply #19 on: 25 / July / 2012, 14:10:49 »
Have you seen this bug before?

MakeDirectory_Fut was not found automatically, but I found it by comparison with sx260 dump.  I think that the address is correct, because directory is created.
The address you are using for MakeDirectory_Fut has been found by sigfinder as mkdir. It has two parameters. As platform/generic/wrappers.c is not in your repo, I can't see what you are using as that second param. It seems to have two references in firmware, one passes 1 as second parameter (@ff831b4c), the other one is passing through its own second parameter (@ff831ba0). Try it with 1 and 0.

http://chdk.setepontos.com/index.php?topic=7889.msg84690#msg84690
« Last Edit: 25 / July / 2012, 14:25:12 by srsa_4c »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal