mode_get - General Discussion and Assistance - CHDK Forum

mode_get

  • 6 Replies
  • 2504 Views
mode_get
« on: 14 / March / 2008, 17:12:23 »
Advertisements
hi *,

can anyone maybe please describe a bit how mode_get
is working? it looks like something is wrong with it on the
a530 port - but maybe i'm only understanding things
wrong.

basically everything seems to work fine (switching rec
and play mode etc.), but it looks like the osd sees some-
how the wrong state:
* everything is shown properly in osd layout monitor and
   the values seem to be ok (like raw remaining or batt)
* it never shows icons which are supposed to be shown
   all the time (like battery, clock etc.)
* some entries (like raw remaining) are only shown if i
   set the "show osd also in review mode" and that
   happens even in normal shooting mode - maybe some-
   how the camera thinks it is in review mode while in
   shooting mode? where this is set?
* settings which i can switch between "always" and "shoot"
   (like histogram) are only shown if i half-press the release
   button and they are set to "shoot" - on "always" they are
   never shown (not even with half presses release button)

just for reference the current mode_get code of the a530
port (hacked to somehow work from bondo)

Code: [Select]
int mode_get() {
    int mode, i, t=0xFF;

    mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY;
    mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED;
    mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED;

    //_GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4);
    _GetPropertyCase(0, &t, 4);
    for (i=0; i<MODESCNT; ++i) {
        if (modemap[i].canonmode == t) {
            return (mode | (modemap[i].hackmode & MODE_SHOOTING_MASK));
        }
    }

    return (mode);
}

a lot of thanks in advance and best wishes - image13

Re: mode_get
« Reply #1 on: 18 / March / 2008, 04:55:08 »
does really nobody here have any idea or a pointer on how
to move forward here?

a lot of thanks in advance and best wishes - image13

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: mode_get
« Reply #2 on: 18 / March / 2008, 05:43:36 »
Detection of review mode is not the responsibility of mode_get() function.

>   mode  = (physw_status[2] & 0x00002000)?MODE_REC:MODE_PLAY;
Checks a bit in keyboard flags to detect the position of play/rec mode switch.

>    mode |= (physw_status[2] & 0x00008000)?0:MODE_SCREEN_OPENED;
>    mode |= (physw_status[2] & 0x00004000)?0:MODE_SCREEN_ROTATED;
You can move these to trashcan because A530 does not have swivel  LCD screen.

>    //_GetPropertyCase(PROPCASE_SHOOTING_MODE, &t, 4);
>    _GetPropertyCase(0, &t, 4);
Detection of position of mode dial.

That's all about mode_get().

You may check the address of recreview_hold variable is properly set in stubs_min.S file for your camera.
CHDK Developer.

a530: recreview_hold
« Reply #3 on: 19 / March / 2008, 14:05:23 »
thanks grand,

looks like you are right - it looks like this address was
just copied from the a700.

how do i find out the proper address for
- recreview_hold
for the a530?

most probably the same applies to the addresses of
- canon_shoot_menu_active
- focus_busy
- zoom_busy
maybe someone can have a quick look at the a530
firmware dump to find out the proper addresses?

a lot of thanks in advance and best wishes - image13


*

Offline bondo

  • *
  • 42
  • Saluti from Italy!
Re: mode_get
« Reply #4 on: 19 / March / 2008, 14:35:59 »
a few note just to make clearness...

in stubs_min.S these values was checked in the a530 dump:

DEF(physw_status, 0xE258)   ///
DEF(physw_run, 0x1BB0)      ///
DEF(FlashParamsTable,0xFFD49A28)   ///
DEF(canon_menu_active,0x7FA8)   ///

other values are still not checked, this because now my camera is in warranty service and I can't do tests.

mode_get() is just a copy&paste from a700 code, adjusted only to run. I'm sorry for this but now I can't do otherwise.

recreview_hold value should be 0x6C7C0 if you want to test.

byee

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: a530: recreview_hold
« Reply #5 on: 19 / March / 2008, 14:39:51 »
how do i find out the proper address for
- recreview_hold
for the a530?

0x6C7C0

- canon_shoot_menu_active
- focus_busy
- zoom_busy

0x74F1
0x6F62C
0x6F300

Re: mode_get
« Reply #6 on: 19 / March / 2008, 15:24:17 »
cool! - works perfectly ... and with those addresses
now also iso and focus overwrite works ... only thing
left to my knowledge now is usb remote ... it is being
recognized - show misc values in debug shows a
change in the 3rd value

3: 3fff - no usb remote pressed

and

3: 7fff - usb remote pressed

and "whoever" ment that this should result in

Code: [Select]
#define USB_MASK 0x4000
#define USB_REG 2

but after adapting this in generic/kbd.c it still
does not work - any idea for this?

a big thanks to ewavr and bondo!

best wishes - image13