IXUS145/ELPH135 Porting attempt - page 3 - DryOS Development - CHDK Forum supplierdeeply

IXUS145/ELPH135 Porting attempt

  • 136 Replies
  • 64014 Views
*

Offline akira

  • *
  • 19
Re: IXUS145/ELPH135 Porting attempt
« Reply #20 on: 01 / January / 2015, 11:44:18 »
Advertisements
Happy New Year everybody,

A little progress here, now the OSD and keyboard has some functionality, but the key mappings are wrong and the FW still responding with original actions for the keypresses.
I will work on the key mappings, but I don't know what to check for the supression of the FW actions on keypresses.
Another problem, sometimes the y position goes shifted up by the half of the resolution, I happens with the logo and the menus.

O won't be able to find the correct palette, I used the same from PSM, but the colors  displayed are the same from the FW menus.

Regards

*

Offline akira

  • *
  • 19
Re: IXUS145/ELPH135 Porting attempt
« Reply #21 on: 01 / January / 2015, 11:47:03 »
Images

*

Offline akira

  • *
  • 19
Re: IXUS145/ELPH135 Porting attempt
« Reply #22 on: 01 / January / 2015, 11:50:12 »
More images

*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS145/ELPH135 Porting attempt
« Reply #23 on: 01 / January / 2015, 12:03:41 »
Another problem, sometimes the y position goes shifted up by the half of the resolution, I happens with the logo and the menus.
Try adding
#define CAM_BITMAP_HEIGHT               270
to platform_camera.h. The Canon bitmap overlay is double buffered, the firmware flips the buffers occasionally (mostly when walking in a Canon menu). When not defined, CHDK assumes 240 for CAM_BITMAP_HEIGHT. Most new <= DIGIC5 cameras have bitmap buffers with 270 px height.

Quote
I will work on the key mappings, but I don't know what to check for the supression of the FW actions on keypresses.
If you enable the debug display I mentioned earlier, you'll get 3 hex numbers on the screen. Press the buttons one by one and see which one of those numbers change. Most buttons change 1 bit, the bit is usually 0 when the button is pressed. If the camera has more than one zoom speed, there will be more than one zoom bits in each direction.

Once you have working keyboard, activate the CHDK palette viewer and find unused blocks in the system palettes in playback and record mode (those blocks are usually white). Note the start index of the largest common block and use that as CHDK_COLOR_BASE. You then need to find the 2 required palette related fw variables and enable the CHDK custom palette.


*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS145/ELPH135 Porting attempt
« Reply #24 on: 06 / January / 2015, 11:15:06 »
@akira
If you have trouble getting ahead, better ask. It's very much possible that I forgot mentioning some important details.

*

Offline akira

  • *
  • 19
Re: IXUS145/ELPH135 Porting attempt
« Reply #25 on: 06 / January / 2015, 13:20:57 »
Hi srsa_4c,

I was strugling with the buffer shift problem, but I think found the issue:
Code: [Select]
in gui_draw.c:

void draw_init()
{
#ifndef DRAW_ON_ACTIVE_BITMAP_BUFFER_ONLY
    frame_buffer[0] = vid_get_bitmap_fb();
    frame_buffer[1] = frame_buffer[0] + camera_screen.buffer_size;
#endif

The camera_screen.buffer_size was being filled with the value 172800 which is 2/3 of the resolution, I forced the value 259200, which made the buffers flips stay aligned.
I was not able to find/understand  where the camera_screen.buffer_size is calculated to make the "right" correction.

On the other side, I had success making the keyboard work, now I can navigate through all the menus.

Some sugestion for the next features to try ? Firing a shot is making the camera turn off and generating a log dump, also the Histogram, but an histogram is showed right before.

(editt) Forgot, video recording works, but the elapsed time indicator is wrong, the bitrate seems ok.

Regards

« Last Edit: 06 / January / 2015, 14:10:55 by akira »

*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS145/ELPH135 Porting attempt
« Reply #26 on: 06 / January / 2015, 14:32:25 »
The camera_screen.buffer_size was being filled with the value 172800 which is 2/3 of the resolution, I forced the value 259200, which made the buffers flips stay aligned.
I was not able to find/understand  where the camera_screen.buffer_size is calculated to make the "right" correction.
See include/camera_info.h and core/camera_info.c for the camera_screen struct - you'll find some explanations and the defines that are used. It's possible that you need to re-define more of them in platform_camera.h

Quote
On the other side, I had success making the keyboard work, now I can navigate through all the menus.
Cool, can you push the change to svn? I'm curious about the keyboard bits (and how they are related to those found by the sigfinder).

Quote
Some sugestion for the next features to try ?
Custom palette? You can now start the palette viewer. You'll need to find the 2 fw variables involved, of course.

Quote
Firing a shot is making the camera turn off and generating a log dump, also the Histogram, but an histogram is showed right before.
I don't know whether you enabled capt_seq, but CHDK can write to some fw variables even without capt_seq_task enabled. So, I'd wait with shoot until all addresses in stubs_min.S (and lib.c) are fixed.

The romlogs may help finding what's wrong, see http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29
If CHDK addresses are involved, a core/main.bin.dump corresponding to the CHDK build used at the time of crash can be useful.

*

Offline akira

  • *
  • 19
Re: IXUS145/ELPH135 Porting attempt
« Reply #27 on: 07 / January / 2015, 06:24:21 »
Hi,

Quote
Cool, can you push the change to svn? I'm curious about the keyboard bits (and how they are related to those found by the sigfinder).

Pushed to svn, I think the most significant bits was correct, and the least significant was wrong.


Regards


*

Offline srsa_4c

  • ******
  • 4426
Re: IXUS145/ELPH135 Porting attempt
« Reply #28 on: 08 / January / 2015, 11:19:57 »
Pushed to svn, I think the most significant bits was correct, and the least significant was wrong.
I'm a bit confused about the comments in kbd.c (the 'hackkey' constants contradict the comments, for example KEY_LEFT vs. 'UP').

edit:
you'll need these in platform_camera.h:
Code: [Select]
    #undef  CAM_BITMAP_WIDTH
    #define CAM_BITMAP_WIDTH                          960 // Actual width of bitmap screen in bytes (may be larger than displayed area)
    #undef  CAM_BITMAP_HEIGHT
    #define CAM_BITMAP_HEIGHT                         270 // Actual height of bitmap screen in rows (240 or 270)
« Last Edit: 08 / January / 2015, 11:29:31 by srsa_4c »

*

Offline akira

  • *
  • 19
Re: IXUS145/ELPH135 Porting attempt
« Reply #29 on: 08 / January / 2015, 14:04:33 »
Code: [Select]
I'm a bit confused about the comments in kbd.c (the 'hackkey' constants contradict the comments, for example KEY_LEFT vs. 'UP').
Sorry, the comments was wrong, until I figured out, I was scrapping on the comments, at the end I didn't correct the comments. Pushed a version with correct comments.


 

Related Topics