Fixed touch wheel OSD overwriting CHDK menu on SD870IS - General Discussion and Assistance - CHDK Forum

Fixed touch wheel OSD overwriting CHDK menu on SD870IS

  • 4 Replies
  • 7012 Views
*

Offline mil22

  • *
  • 29
Fixed touch wheel OSD overwriting CHDK menu on SD870IS
« on: 20 / July / 2008, 08:48:37 »
Advertisements
Trying to figure out how to disable the touch wheel display on the SD870IS, the one that overwrites the CHDK menu. Here's what I've discovered so far... this is on SD870IS firmware version 100c.

* The touch wheel (and buttons) are monitored by a kernel task called TouchW. The task function starts at FF8E6DC0.
* There's a data structure that maintains the wheel state starting at 0x9C10. It looks something like this:

0x9C10 +
0x00: 1 = PrintTouchWheel mode (qPrints status messages to console)
0x04: debug level (at least 10)
0x08: 1 if TouchW task already started, 0 otherwise
0x10:
0x14:
0x18:
0x1C:
0x20:
0x24: event or state, gets shifted <<4 to look up address in jump table
0x28: event or state, gets shifted <<2 to look up address in jump table
0x2C: idle timer? counts down from X
0x30:

0x9C60 seems to store button state in 5 consecutive bytes

* There's a jump table to handle touch wheel events, at 0xFFAA0D8C. There are 12 possible events, and my guess is they're organized 3x4 in a state machine, where there are 3 internal touch wheel states, and 4 possible incoming events (or vice versa).

event 0: ff8e7778; [0x2c]=0x14; checks 0x429F4 (touch_keys_angle), prints "PRESS " and "UNPRESS" messages
event 1: ff8e73c0; puts 0 in 0x28, [0x2c]=0x14; prints "TOPRESS "
event 2: ff8e73f4; prints "INACTIVE ", then goes to ff837188
event 3: ff8e73f4; prints "INACTIVE ", then goes to ff837188

event 4: ff8376fc; counts down [0x2C], calls FF8E7188 if zero (some button processing, then message "IDLE ")
event 5: no-op
event 6: ff8e6b8; counts down [0x2C], prints "INACTIVE " when it hits zero
event 7: ff8e6b8; counts down [0x2C], prints "INACTIVE " when it hits zero

event 8: ff8e7724; counts down [0x2C], does some processing if zero (FF8E7188)
event 9: ff8e71f4; touch event; [0x2C]=0x14, [0x28]=2, prints "ACTIVE" and "TOUCH[%d] " where %d=0...4
event 10: ff8e784c; [0x2C]=0x14; prints "TOROTATE "
event 11: ff8e78f4; [0x2C]=0x14; prints "ROTATE%d[%d] "

* It's possible to turn off the TouchW task by adding the following line to task_Startup_my(). However, it entirely disables the wheel including the buttons, so it makes the camera a bit useless.
    *((int*)0x9C18) = 1; // this completely disables the wheel and buttons

Unknowns:
* Where do the events originate from?
* Where is the code that draws the OSD? I don't know enough about the DryOs GUI code to know how to find this.

Possible hacks to disable the OSD:
* various possibilities
  -> manipulate the internal state at 0x9C10 from kbd.c
  -> manipulate the button state, e.g. at 0x429F4
* could disable the touch messages but leave the press messages intact (this would prevent using the wheel, but the buttons would still work)
* figure out where the OSD is being drawn and kill that method somehow when CHDK is active
« Last Edit: 21 / July / 2008, 19:50:54 by mil22 »

*

Offline mil22

  • *
  • 29
Re: Progress on disabling touch wheel OSD on SD870IS
« Reply #1 on: 21 / July / 2008, 18:57:18 »
OK, I figured this out. The fix is to disable the event handler for the touch event (jump table entry 9, ff8e71f4) when the keyboard is blocked. Et voila, no more do the annoying touch icons erase the CHDK menu.  8)

Patch and test firmware attached (firmware includes SDHC/dual-boot and movie_rec too).

The next thing I want to fix on the SD870IS is the way the camera boots up in playback mode... coming soon.

*

Offline fe50

  • ******
  • 3152
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Fixed touch wheel OSD overwriting CHDK menu on SD870IS
« Reply #2 on: 22 / July / 2008, 05:40:38 »
Works great, that stuff should be integrated in the trunk as fast as possible !   ... EWAVR, can you hear me ? :haha

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Fixed touch wheel OSD overwriting CHDK menu on SD870IS
« Reply #3 on: 22 / July / 2008, 06:45:20 »
i can do it, but it seems the patchfile is fubared, tortoise svn tells me something about "an unknown line type was found in line 41". the other patch (movie_rec and multiboot) went fine.

could you perhaps create another patch, this time including all three changes and allso the svnadd?

*

Offline mil22

  • *
  • 29
Re: Fixed touch wheel OSD overwriting CHDK menu on SD870IS
« Reply #4 on: 22 / July / 2008, 07:04:46 »
No problem, trying again. I probably fubarred the patch while trying to separate the SDHC and touch wheel code in boot.c. This time I'm not going to separate them... just apply this one after the SDHC/movie_rec patch. Hope it works.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal