SX60HS Porting - page 13 - DryOS Development - CHDK Forum

SX60HS Porting

  • 915 Replies
  • 371647 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: SX60HS Porting
« Reply #120 on: 30 / March / 2016, 12:52:47 »
Advertisements
There's a small problem in the menu system that I suspect someone will immediately know the solution too or at least what to check.  When I bring up an information screen that only has an ok button, like say cpuinfo for example, the screen displays and then almost instantly disappears as if I already pressed the "ok" which I believe is the function/set center button.
What happens if you press the ALT button after that?
It could be that the firmware redraws parts of the overlay and CHDK doesn't notice. You can expect that happening quite often when the cam is in shooting mode.
edit:
It can also be that CHDK doesn't always draw to the overlay buffer that's visible. In this case, the CHDK overlay becomes hidden when the firmware redraws the display.
Quote
On the sx60 there are dual purpose buttons, like Display/Down. These appear to have independent defs in chdk, how should I define them?
You can look at other ports. The G7x, for example, also has a shared DOWN/DISP button. Since the directional buttons are important, it's highly advised to treat them as such in CHDK.
Therefore, the G7x port has
#undef CAM_HAS_DISP_BUTTON
in platform_camera.h and the button appears as KEY_DOWN in kbd.c .
« Last Edit: 30 / March / 2016, 12:56:54 by srsa_4c »

*

Offline reyalp

  • ******
  • 14118
Re: SX60HS Porting
« Reply #121 on: 30 / March / 2016, 13:35:42 »
You can look at other ports. The G7x, for example, also has a shared DOWN/DISP button. Since the directional buttons are important, it's highly advised to treat them as such in CHDK.
Therefore, the G7x port has
#undef CAM_HAS_DISP_BUTTON
in platform_camera.h and the button appears as KEY_DOWN in kbd.c .
Yes, I strongly suggest only defining keys for the primary meaning of the button, e.g. the arrow keys should always be the arrow keys, not disp, flash etc.

DISPLAY should only be defined if the camera has a standalone display button.
Don't forget what the H stands for.

Re: SX60HS Porting
« Reply #122 on: 30 / March / 2016, 14:54:50 »
Quote
What happens if you press the ALT button after that?
It could be that the firmware redraws parts of the overlay and CHDK doesn't notice. You can expect that happening quite often when the cam is in shooting mode.
It is still in ALT mode. pressing the ALT button takes it out of ALT mode. pressing the func/set button (again) restores the display to how it was just before selecting the info function

I wrote a short script to use capdis to compare functions in stubs_entry_2.S...we actually have rather different stubs_entry_2.S's (g7x and sx60hs), so i guess sigfinder works with varying efficiency. I haven't fully investigated why. I did find that your address for CancelHPTimer looks to be wrong...needs plus one (g7x) in order to match mine.  My Fflush_Fut, begins with pop, before matching yours.

CancelHPTimer, 0xfc158e25
fc158e24:       e92d 41fc       push.w  {r2, r3, r4, r5, r6, r7, r8, lr}
fc158e28:       4f2d            ldr     r7, =0x0000c03c ; [pc, #180] (0xfc158ee0)
fc158e2a:       2615            movs    r6, #0x15
fc158e2c:       6839            ldr     r1, [r7]
fc158e2e:       b111       


I'll undef any dual purpose keys....I think the Func/Set key is just SET anyway.

Re: SX60HS Porting
« Reply #123 on: 30 / March / 2016, 15:11:56 »
Quote
The reboot isn't currently implemented for any of the d6 cams, so that's expected. Shutdown shouldn't trigger a reboot though, I'm not sure offhand how that would happen

Reboot from chdkptp seems to work...it takes several seconds. Shutdown now seems to just shutdown...I have Restart defined in stubs_entry_2.S
NHSTUB(Restart                              ,0xFC0B96E5)
this is the same as IAX had for firmware 100b


*

Offline reyalp

  • ******
  • 14118
Re: SX60HS Porting
« Reply #124 on: 30 / March / 2016, 16:16:49 »
I wrote a short script to use capdis to compare functions in stubs_entry_2.S...we actually have rather different stubs_entry_2.S's (g7x and sx60hs), so i guess sigfinder works with varying efficiency.
I'm confused. stubs_entry_2.S is for manually found functions. The sigfinder can fail to find some functions, but AFAIK it finds all the same ones on sx60 as it does on g7x. You have quite a few function defined that I have left nullsub, but those are only ones I haven't gotten around to finding yet, or aren't actually needed.

Quote
I haven't fully investigated why. I did find that your address for CancelHPTimer looks to be wrong...needs plus one (g7x) in order to match mine.
You're right, I neglected to set the thumb bit on that one. Thanks.
Quote
  My Fflush_Fut, begins with pop, before matching yours.
It's extremely unlikely that a function begins with POP. fc301dd2 is clearly the end of the preceding function.

Don't forget what the H stands for.

Re: SX60HS Porting
« Reply #125 on: 30 / March / 2016, 16:32:19 »
Hmmm yes pop doesn't make sense, I stupidly advanced the address by one and got garbage from capdis without looking at the disassembly. Obviously I should have advanced the address by two.

Re: SX60HS Porting
« Reply #126 on: 30 / March / 2016, 19:29:12 »
Looking at cameralog, I can see when zoom in/out is pressed, it's called wide, and tele, but I don't get any physw bits to see what key it really is. Same for jogdial. Do I need to snoop at this in a different place? Right now i snoop changes in core/kbd_process.c

*

Offline reyalp

  • ******
  • 14118
Re: SX60HS Porting
« Reply #127 on: 30 / March / 2016, 21:15:50 »
Looking at cameralog, I can see when zoom in/out is pressed, it's called wide, and tele, but I don't get any physw bits to see what key it really is. Same for jogdial. Do I need to snoop at this in a different place? Right now i snoop changes in core/kbd_process.c
In prevous cameras, zoom was in physw_status. Depending exactly how you have things setup, you might be seeing the value after it has been masked/modified by CHDK. You could get the raw values in kbd_fetch_data.

If your camera has a multi-stage zoom control, it would affect multiple bits depending on speed.

It is also certainly possible that canon handles the zoom input differently, without update physw_status.

Jogdial is not expected to affect physw, see change 4570 for how this is done for g7x.

There are 3 parts to jogdial support

1) sending jogdial actions from script (wheel_left / wheel_right). These are platform/lib.c functions that call PostLogicalEventToUI, and don't depend on any other code.

2) allow CHDK to read jogdial inputs, for example to scroll through menus. This is get_jogdial_direction in kbd.c

3) Prevent jogdial actions from going to the canon firmware when in alt mode. On known digic 6 cameras, this is done by modification in kbd task (kbd_p2_f_my in boot.c) and some supporting code in kbd.c (handle_jogdial, jog_dial control etc). Older cameras had a separate task for the jogdial.
Don't forget what the H stands for.


Re: SX60HS Porting
« Reply #128 on: 30 / March / 2016, 23:47:10 »
Here's what i see for zoom (I see quite similar messages for the jogdial see below)
Code: [Select]
00022850: UI:LogicalEvent:0x00003135:adr:0x2,Para:2
00022850: UI:Button:0x00000859:UnpressWideButton

00024420: UI:LogicalEvent:0x00003229:adr:0x4,Para:4
00025610: UI:LogicalEvent:0x00003135:adr:0x3,Para:3
00025610: UI:Button:0x00000854:PressTeleButton
00033000: UI:SetSyncroDisplayDeviceController
00033050: UI:LogicalEvent:0x00003135:adr:0x2,Para:2
00033050: UI:Button:0x00000859:UnpressWideButton
00034030: UI:LogicalEvent:0x00003135:adr:0x1,Para:1
00034030: UI:Button:0x00000858:PressWideButton


00025610: UI:Button:0x00000854:PressTeleButton
00026600: UI:DSIC:48,0
00026610: UI:LogicalEvent:0x00003135:adr:0x2,Para:2
00026610: UI:Button:0x00000855:UnpressTeleButton

00026650: UI:SetSyncroDisplayDeviceController
00029730: UI:LogicalEvent:0x00003135:adr:0x3,Para:3
00029730: UI:Button:0x00000854:PressTeleButton
00029730: UI:VTMLock

00033000: UI:SetSyncroDisplayDeviceController
00033050: UI:LogicalEvent:0x00003135:adr:0x2,Para:2
00033050: UI:Button:0x00000859:UnpressWideButton
00034030: UI:LogicalEvent:0x00003135:adr:0x1,Para:1
00034030: UI:Button:0x00000858:PressWideButton


For jogdial
Code: [Select]
00015740: UI:LogicalEvent:0x00001184:adr:0,Para:0
00015770: UI:VTMLock
00015770: UI:VTMUnLock
00021450: UI:Button:0x00001134:
00021450: UI:Button:0x000008AE:RotateEDialLeft
00024530: UI:Button:0x00001134:
00024530: UI:Button:0x000008AD:RotateEDialRight

*

Offline reyalp

  • ******
  • 14118
Re: SX60HS Porting
« Reply #129 on: 31 / March / 2016, 01:36:33 »
Here's what i see for zoom (I see quite similar messages for the jogdial see below)
I may be missing something, but I don't think the messages generated by the canon firmware are going to help you much. They give you the approximate time the state changed, but that's about it. The kbd.c and phsw_status stuff happens at a lower level than these events.
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal