Display (bitmap overlay) - page 26 - General Discussion and Assistance - CHDK Forum

Display (bitmap overlay)

  • 403 Replies
  • 143873 Views
Re: Display (bitmap overlay)
« Reply #250 on: 07 / May / 2021, 01:59:54 »
Advertisements
Phil

Initial testing looks good.

I used the screen_needs_refresh() to 'just' call draw.overdraw(), but this didn't seem to work. I then used it to recall my drawing function, which BTW also uses draw.overdraw(), and this did the trick. Thus, as I switch between LCD and EVF, my DoF info bar auto refreshes.

The odd flicker/glitch is still there, but random and not often.

The console and my drawing lateral offset to the left, in the HDMI out, is still there, as shown in the previous video.

The CHDK histogram is now drawn as 'normal', I miss that large histogram already  :haha

One thing I have noticed, but it could have always been there, is the CHDK vs Canon histogram difference, and the CHDK LCD vs EVF histogram differences. I put the camera on a tripod, to freeze the scene, and looked at the CHDK LCD and EVF histograms, which are different.

Cheers

Garry

UPDATE 1

Forgot to say that the drawing overlay in the LCD is different to the EVF. In the LCD my bar, positioned at (0,0), and the ALT and console overlays the camera view. In the EVF, these sits outside the camera view.

UPDATE 2

The histogram remains persistent. Is there a way to switch off all CHDK drawing if the Canon stuff is being shown, ie the Q screen etc.

UPDATE 3

Further testing with my script, which allows the user to enter/exit ALT mode to do photo stuff, eg take pictures. If I do this, screen_needs_refresh() doesn't seem to work any more. Thus I need to do a manual refresh. But when I do, screen_needs_refresh() still doesn't work. It looks like going in and out of ALT mode impacts the functionality of screen_needs_refresh()...maybe?
« Last Edit: 07 / May / 2021, 03:46:46 by pigeonhill »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Display (bitmap overlay)
« Reply #251 on: 07 / May / 2021, 05:23:46 »
@pigeonhill


New version to fix screen_needs_refresh when the script exits alt mode.


We don't currently detect if the Q screen is displayed so there is no option to disable histogram / CHDK OSD.
You can set the histogram to only show when the shutter is half pressed; but this does not work 100% in this version (it may leave old histogram data on screen).


The Canon OSD does not scale to fill the screen when using the EVF - it remains the same size but is centred. Ours expands so things are in different places relative to the Canon stuff.


Phil

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Display (bitmap overlay)
« Reply #252 on: 07 / May / 2021, 05:57:46 »
Phil
That’s a little better, but I notice it gets confused and then stuck, eg: if I go out of ALT mode then in to the EVF from LCD, or the other way, the screen_needs_refresh() stops functioning. My manual refresh then brings the bar back, but screen_needs_refresh() then doesn't appear to be working as it should, ie doesn't detect the need for a refresh..

Quote
You can set the histogram to only show when the shutter is half pressed; but this does not work 100% in this version (it may leave old histogram data on screen).

Yes I have tried that, but as you say, it doesn't always work.

Still see histogram differences: LCD vs EVF and CHDK vs Canon.

UPDATE 1

Just noticed the console has shifted its (0,0) to the top of the screen. Any chance of the console position (0,0) being user positionable?
« Last Edit: 07 / May / 2021, 07:26:48 by pigeonhill »

*

Offline srsa_4c

  • ******
  • 4451
Re: Display (bitmap overlay)
« Reply #253 on: 07 / May / 2021, 12:29:51 »
When re-using the buffer of the yuv layer, all variants of XimrExe need to be hooked. When XimrExeGain is left untouched, it will overwrite the whole buffer in HDMI mode. The dry_memcpy-based hooking method modified the original ximr structure, which was then subsequently used by XimrExe and XimrExeGain. The mzrm_sendmsg hook only gets a copy of that struct.
So, in case of M3, I'd do this:
Code: [Select]
Index: platform/m3/sub/120f/boot.c
===================================================================
--- platform/m3/sub/120f/boot.c (revision 5892)
+++ platform/m3/sub/120f/boot.c (working copy)
@@ -195,17 +195,23 @@
             "    ldr     r0, =mzrm_sendmsg_ret_adr\n"   // Is return address in mzrm_sendmsg function?
             "    cmp     r0, lr\n"
             "    beq     do_ui_update\n"
-            "exit_debug_logging_my:"
+            "exit_debug_logging_my:\n"
             "    bx      lr\n"
 
-            "do_ui_update:"
+            "do_ui_update:\n"
             "    mov     r0, r11\n"                     // mzrm_sendmsg 'msg' value (2nd parameter, saved in r11)
             "    ldr     r1, [r0]\n"                    // message type
+            "    mov     r2, #0x24\n"                   // XimrExeGain?
+            "    cmp     r1, r2\n"
+            "    beq     handle_ximrexegain\n"
             "    mov     r2, #0x23\n"                   // Ximr update? (3rd parameter to mzrm_createmsg)
             "    cmp     r1, r2\n"
             "    bne     exit_debug_logging_my\n"
             "    add     r0, r0, #16\n"                 // Offset to Ximr context in 'msg'
             "    b       update_ui\n"
+            "handle_ximrexegain:\n"
+            "    add     r0, r0, #24\n"                 // Offset to Ximr context in 'msg'
+            "    b       update_ui\n"
     );
 }
 

*

Offline Ant

  • *****
  • 509
Re: Display (bitmap overlay)
« Reply #254 on: 07 / May / 2021, 13:01:46 »
I did that more simply:
Code: [Select]
        "ldr     r0, =mzrm_sendmsg_ret_adr\n"
"cmp     r0,lr\n"
"beq     chk_msg_type\n"
"bx      lr\n"

"chk_msg_type:\n"
"ldr     r0, [r11]\n"
"cmp     r0, 0x23\n"   // message type XimrExe
"beq     do_ui_update\n"
"cmp     r0, 0x24\n"   // message type XimrExeGain
"beq     do_ui_update\n"
"bx      lr\n"

"do_ui_update:\n"
"ldr     r0, [r11, 0x0C]\n" //address of Ximr Context
"b       update_ui\n"
« Last Edit: 07 / May / 2021, 13:06:47 by Ant »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Display (bitmap overlay)
« Reply #255 on: 09 / May / 2021, 05:44:35 »
@pigeonhill


Updated version;
- includes updated mzrm_sendmsg override logic from srsa_4c and Ant
- entering alt mode when a script is running fixed
- console position adjusted relative to the bottom of the screen if the screen size changes
- CHDK histogram should erase if not displayed
- screen_needs_refresh should work better

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline kitor

  • *
  • 20
Re: Display (bitmap overlay)
« Reply #256 on: 09 / May / 2021, 06:11:05 »
XimrExeGain is used when the Canon overlay is faded in/out.

Out of curiosity, it is used for some kind of animation? I see it uses the same structure, but takes 2 more params? I don't see any calls to XimrExeGain in 200D, M50, R. It seems to be missing at all from R6/Digic X. (but there's a new XimrExeDirect referenced there)
Magic Lantern / EOS R / 200D

Re: Display (bitmap overlay)
« Reply #257 on: 09 / May / 2021, 06:19:53 »
@philmoz

Quote
@pigeonhill
Updated version;
- includes updated mzrm_sendmsg override logic from srsa_4c and Ant
- entering alt mode when a script is running fixed
- console position adjusted relative to the bottom of the screen if the screen size changes
- CHDK histogram should erase if not displayed
- screen_needs_refresh should work better

Phil: looking good  :)

Histogram disappears nicely, saved me one line of code, ie clearing the display  ;)

In and out of ALT is solid.

Exit ALT, ie with a button other that full shutter, after I've been in and out of ALT, is solid.

The old console was always positioned at the bottom, this one is at the top. Not an issue but interested to know why the change?

Cheers

Garry

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Display (bitmap overlay)
« Reply #258 on: 09 / May / 2021, 06:30:26 »
The old console was always positioned at the bottom, this one is at the top. Not an issue but interested to know why the change?


I made a change to try and keep the console position relative to the bottom of the screen when the screen height changes; but I think I got it wrong.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Display (bitmap overlay)
« Reply #259 on: 09 / May / 2021, 06:41:51 »
@pigeonhill


See if this version fixes the console.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal