SD940 (IXUS120) porting thread - page 14 - DryOS Development - CHDK Forum

SD940 (IXUS120) porting thread

  • 542 Replies
  • 202819 Views
Re: SD940 (IXUS120) porting thread
« Reply #130 on: 23 / December / 2010, 14:57:07 »
Advertisements
Any ideas for what I could try?

Did you go through the "make bootable" part of the process ?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SD940 (IXUS120) porting thread
« Reply #131 on: 23 / December / 2010, 15:18:37 »
Yes, I will try with another SD-card to see if the problem persists.

Same result with the new card ...


Update: I copied the files in the 1.02c binaries (link on page 5 in this thread) onto the card. Made chdk work!
« Last Edit: 26 / December / 2010, 11:00:45 by brakar »

*

Offline waldo

  • ***
  • 238
Re: SD940 (IXUS120) porting thread
« Reply #132 on: 23 / December / 2010, 21:58:42 »
I think some of the current SD940 issues may be getting lost due to the length of this thread.

Here's my list of what is not working:

Edge overlay not working
http://chdk.setepontos.com/index.php?topic=5855.msg58277#msg58277

Difficult or impossible to use long press of DISP to get to Canon DISP functions
http://chdk.setepontos.com/index.php?topic=5855.msg58074#msg58074

Battery readout not working in 102c
http://chdk.setepontos.com/index.php?topic=5855.msg58084#msg58084

*

Offline waldo

  • ***
  • 238
Re: SD940 (IXUS120) porting thread
« Reply #133 on: 23 / December / 2010, 22:17:46 »
Here's my proposal for the DISP key issue:

Code: [Select]
void my_kbd_read_keys()
{
static int altDownTimer=0;
const int DISP_DOWN_TIME = 20;

kbd_prev_state[0] = kbd_new_state[0];
kbd_prev_state[1] = kbd_new_state[1];
kbd_prev_state[2] = kbd_new_state[2];

_platformsub_kbd_fetch_data(kbd_new_state);

kbd_new_state[2] |=0x00008000;  /// disable the battery door switch

// support for short/long press of Display
if (kbd_is_key_pressed(KEY_DISPLAY)) { // Display held down
altDownTimer++; // timer for DISP
}
else {
altDownTimer = 0;
}

if (kbd_process() == 0) {
// leave it alone...
physw_status[0] = kbd_new_state[0];
physw_status[1] = kbd_new_state[1];
physw_status[2] = kbd_new_state[2];

physw_status[0] |= alt_mode_key_mask;  /// disable the ALT mode button

physw_status[SD_READONLY_REG] = physw_status[SD_READONLY_REG] & ~SD_READONLY_FLAG;
}
else {
// override keys

physw_status[0] = (kbd_new_state[0] & (~KEYS_MASK0)) |(kbd_mod_state[0] & KEYS_MASK0);
physw_status[1] = (kbd_new_state[1] & (~KEYS_MASK1)) | (kbd_mod_state[1] & KEYS_MASK1);
physw_status[2] = (kbd_new_state[2] & (~KEYS_MASK2)) |(kbd_mod_state[2] & KEYS_MASK2);

if (altDownTimer > DISP_DOWN_TIME) {
physw_status[0] &= ~alt_mode_key_mask;  // press the Display button
}
}

_kbd_read_keys_r2(physw_status);

physw_status[2] = physw_status[SD_READONLY_REG] & ~SD_READONLY_FLAG;

remote_key = (physw_status[2] & USB_MASK)==USB_MASK;
if (remote_key) {
remote_count += 1;
}
else if (remote_count) {
usb_power = remote_count;
remote_count = 0;
}

if (conf.remote_enable) {
physw_status[2] = physw_status[SD_READONLY_REG] & ~(SD_READONLY_FLAG | USB_MASK);
} else {
physw_status[2] = physw_status[SD_READONLY_REG] & ~SD_READONLY_FLAG;
}
}

Changes are the lines dealing with altDownTimer. 
A quick press and release = ALT toggle.
A press of about 1/4 second to 1 second = Canon DISP
A press longer than 1 sec = Change LCD brightness

It seems fairly intuitive once you get the hang of the key press timing.  It's not ideal and will cause confusion for new users, but it's the best I came up with so far.


Re: SD940 (IXUS120) porting thread
« Reply #134 on: 23 / December / 2010, 22:43:28 »
I think some of the current SD940 issues may be getting lost due to the length of this thread.
I was wondering about that too so I've proposed a bit of an experiment.  There is probably a better way to do this but at least this is a start :

http://chdk.wikia.com/wiki/SD940_Beta_Testing_Status_Page

I linked it into the developer section of the wiki.  If that turns out to be a bad idea we can always remove it.

Here's my list of what is not working:

Edge overlay not working
http://chdk.setepontos.com/index.php?topic=5855.msg58277#msg58277

Difficult or impossible to use long press of DISP to get to Canon DISP functions
http://chdk.setepontos.com/index.php?topic=5855.msg58074#msg58074

Battery readout not working in 102c

Interesting about the battery stuff - works fine on the 103c right out of the box - although I have to adjust the max and min voltage levels down to get the icon and/or percentage indicators to work.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SD940 (IXUS120) porting thread
« Reply #135 on: 26 / December / 2010, 13:31:24 »
Hi guys,

Just touching base to make sure I'm not going way off track.  I'm using this as a guide to port 103B and using 103C as the reference.

I dropped the PRIMARY.BIN I extracted from my 103B camera into ixus120_sd940/sub/103b and then used CHDK shell to build 103b.

I then compared the new 103B stubs_entry.S with the one from 103C.  Found that there were 45 changed NSTUBS above address 0xff8687d4.

Before I continue, am I on the right track with this?  The PRIMARY.BIN files in the sub folders were all 0 length but the stubs_entry.S was present and populated.  Is that just to save space when distributing?  The stubs_entry.S I generated was the same as that in waterwingz trunk1001-SD940-BETA1.zip archive so I think I might be doing it right... :blink:

Re: SD940 (IXUS120) porting thread
« Reply #136 on: 26 / December / 2010, 14:06:52 »
Before I continue, am I on the right track with this? 
So far, so good.  To go any farther,  you are going to need a dissassembly of the PRIMARY.BIN file so that you can figure out the correct entries for stubs_entry_2.s,  lib.c, stubs.asm.h and the code for boot.c, capt_seq.c and movie_rec.c.

Does that make sense to you ?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: SD940 (IXUS120) porting thread
« Reply #137 on: 26 / December / 2010, 14:23:17 »
Yep, thanks waterwingz.  I've got my PRIMARY.BIN loaded up and processed in IDA.  I'll keep going and report back when (not if :) ) I get stuck.


*

Offline fe50

  • ******
  • 3147
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: SD940 (IXUS120) porting thread
« Reply #138 on: 26 / December / 2010, 15:38:11 »
I dropped the PRIMARY.BIN I extracted from my 103B camera into ixus120_sd940/sub/103b and then used CHDK shell to build 103b.
There are two relevant settings for this in the "Compile Options" menu: OPT_GEN_STUBS and OPT_GEN_SIGS
You can also set "PRIMARY_ROOT" to your own folder structure containing the firmware dumps - otherwise the CHDK-Shell will look in the current builds sub directory...

Quote
The PRIMARY.BIN files in the sub folders were all 0 length but the stubs_entry.S was present and populated.  Is that just to save space when distributing?
No; the firmware dumps (PRIMARY.BIN files) are not in the SVN tree; without a corresponding firmware dump file the build process creates an empty spare file and skips searching for signatures...

This wikia article may also be helpfull for you: http://chdk.wikia.com/wiki/Signature_finder

Re: SD940 (IXUS120) porting thread
« Reply #139 on: 26 / December / 2010, 15:58:44 »
What is the 103B directory in the trunk1001-SD940-BETA1.zip archive based on?  I just noticed that boot.c is quite different between it and the one for 103C.  Should I be using the files for 103C as a 103B baseline?

 

Related Topics