500d development - page 159 - DSLR Hack development - CHDK Forum

500d development

  • 2487 Replies
  • 914696 Views
Re: 500d development
« Reply #1580 on: 30 / August / 2011, 02:24:40 »
Advertisements
Sweetness! This totally makes up for everyone making fun of my "Fan of Coutts" tattoo.

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: 500d development
« Reply #1581 on: 30 / August / 2011, 03:04:02 »
This is great discovery. 0% flicker in these dialogs, without any special handling; tested on 550D and 60D.

There are also templates which are not full-screen (which can be used for notifications). A lot of redraw bugs will go away :)

Feel free to play with the code (port the changeset above and those following it), and improve this page:

http://magiclantern.wikia.com/wiki/DialogTemplates

Re: 500d development
« Reply #1582 on: 30 / August / 2011, 14:35:52 »
Edit: I put the widgets.txt online again
and DryOS dialog functions from http://magiclantern.wikia.com/wiki/DryOS_API

// dialogs and windows (550d 108)
ROM:FF2B5EEC CreateDialogBox // (== ROM:FFA5499C dialog_create() in 5d2 107)
ROM:FF2B614C dialog_window_prepare() // mapped from 5d2 107
ROM:FF2B6154 ; void __fastcall dialog_resize(struct dialog *dialog, int w, int h, int unknown) // mapped from 5d2 107 and dialog.h
ROM:FF2B61F8 ; void __fastcall MoveAllDialogItem(struct dialog *dialog, int x, int y) // (ROM:FFA54CA4 dialog_move() in 5d2 107) and dialog.h
ROM:FF2B63D4 ; void __fastcall dialog_label_item(struct dialog *dialog, unsigned int id, const char *label, int len_maybe, int unknown)  // mapped from 5d2 107 and dialog.h
ROM:FF2B67F4 ; void __fastcall dialog_draw(struct dialog *dialog) // mapped from 5d2 107 and dialog.h
ROM:FF2B71B4 ; void __fastcall dialog_window_resize(struct dialog *dialog, int w, int h, int unknown) // mapped from 5d2 107 and dialog.h
ROM:FF2B7474 ; void __fastcall dialog_move_item(struct dialog *dialog, int x, int y, int index) // mapped from 5d2 107 and dialog.h
ROM:FF2B7564 ; void __fastcall dialog_set_origin_type(struct dialog *dialog, int type) // mapped from 5d2 107 and dialog.h
ROM:FF2B7744 ; void __fastcall dialog_window_draw(struct dialog *dialog) // mapped from 5d2 107 and dialog.h


Excellent work guys !

see http://magiclantern.wikia.com/wiki/DryOS_API
where I mapped dialog functions from Trammel 5d2 107 stubs to 550d 108.

and dialog.h from  Trammel
https://bitbucket.org/hudson/magic-lantern/src/9f843c096fda/dialog.h

where we have :
extern struct dialog *
dialog_create(
        int                     id,      // must be unique?
        int                     level_maybe,
        dialog_handler_t        handler,
        void *                  arg1,
        void *                  arg2
);

Indy

This is great discovery. 0% flicker in these dialogs, without any special handling; tested on 550D and 60D.

There are also templates which are not full-screen (which can be used for notifications). A lot of redraw bugs will go away :)

Feel free to play with the code (port the changeset above and those following it), and improve this page:

http://magiclantern.wikia.com/wiki/DialogTemplates
« Last Edit: 03 / September / 2011, 03:16:30 by arm.indiana »

Re: 500d development
« Reply #1583 on: 30 / August / 2011, 14:38:02 »

and also widgets structures in 550d 108.

see attached file

Indy


*

Offline 0xAF

  • ***
  • 220
    • 0xAF
Re: 500d development
« Reply #1584 on: 30 / August / 2011, 18:13:16 »
Hi there, i will subscribe to this thread too, the interesting part for me is the first 2 args of CreateDialogBox (dialog_create)... if someone find anything interesting about them please post.

from the Trammel's description posted by indy i see the first arg should be some ID, but what is it ?
it seems it does not have to be unique, at least, we call it with 0 every time... perhaps the second one "level" can explain a bit ... if we have OSD dialogs (OnScreenDisplay, dialogs which does not take the whole screen), but so far we call the second one with 0 too ...

another thing i need to understand is some special events like

        GUI_GOT_TOP_OF_CONTROL         = 0x800,
        GUI_LOST_TOP_OF_CONTROL        = 0x801,
        GUI_INITIALIZE_CONTROLLER      = 0x802,
        GUI_UNKNOWN0                   = 0x804,

this is from 400plus....

please if someone can explain this events, will be appreciated...
(i left the unknown0, one because its close to the others and i do not know what it is)


so far we are calling one canon's button handler to take care of the unknown-to-us events... if you do not handle them, you will have problems...


i've talked with alex and coutts about something important for navigating the menus
you will need this routines too:
GUI_Select_Item()
GUI_Highlight_Sub() // opens submenu in menu dialog template or highlights item.
GUI_Disable_Item()
these were found by Sergei and so far i haven't implemented them in 400plus...
for now we are calling the same canon's handler to move the highlighted item up and down when we have UP/DOWN button pressed...



p.s.
i really want to see that widgets.txt file from indy, but the forum seems to be broken and i cannot download it.
// AF

*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #1585 on: 31 / August / 2011, 17:24:53 »
I might be onto something figuring out why the video buffers out when shooting 1080p @ 30fps (that'd be one hurdle down!).

When mvrRecStart is called, one of the things it does is retrieves what size buffer to use.

Code: [Select]
ROM:FF150454                 BL      MOVW_SetCameraInfo
ROM:FF150458                 CMP     R0, #0
ROM:FF15045C                 STR     R0, [SP,#4]
ROM:FF150460                 LDRNE   R0, [R4,#0xC]
ROM:FF150464                 ADRNE   R2, aMvrrecstartMovw_setcamerainf @ "mvrRecStart : MOVW_SetCameraInfo"
ROM:FF150468                 ANDNE   R0, R0, #0xFF
ROM:FF15046C                 BNE     loc_FF1504B0
ROM:FF150470                 ADD     R0, SP, #0x10
ROM:FF150474                 BL      MOVW_SetMovieInfo
ROM:FF150478                 CMP     R0, #0
ROM:FF15047C                 STR     R0, [SP,#4]
ROM:FF150480                 LDRNE   R0, [R4,#0xC]
ROM:FF150484                 ADRNE   R2, aMvrrecstartMovw_setmovieinfo @ "mvrRecStart : MOVW_SetMovieInfo"
ROM:FF150488                 ANDNE   R0, R0, #0xFF
ROM:FF15048C                 BNE     loc_FF1504B0
ROM:FF150490                 ADD     R0, SP, #0xC
ROM:FF150494                 BL      MOVW_GetBufferSize
ROM:FF150498                 CMP     R0, #0
ROM:FF15049C                 STR     R0, [SP,#4]
ROM:FF1504A0                 BEQ     loc_FF1505C4
ROM:FF1504A4                 LDR     R0, [R4,#0xC]
ROM:FF1504A8                 ADR     R2, aMvrrecstartMovw_getbuffersiz @ "mvrRecStart : MOVW_GetBufferSize"
ROM:FF1504AC                 AND     R0, R0, #0xFF

MOVW_GetBufferSize calls a function at 0xFF14B878 called MovwGetBufferSize, which does the actual calculating it looks like. It looks at the value of *(0x1E84) off_0xB4 when deciding the buffer size. This offset is interesting, I have some notes here:

720p (30fps) recording - off_0xB4 = 30
1080p (20fps) recording - off_0xB4 = 20
1080p (30fps) recording - off_0xB4 = 30

So, what I am thinking is that the camera just has 2 profiles, 20fps and 30fps. The 20fps "profile" has a buffer capable of handling 1080p video, while the 30fps "profile" has a buffer capable of handling 720p and 480p video. I'm curious if I can trick the camera into thinking it's still recording the 1080p video @ 20fps (find a way to change off_0xB4 to 20), it might not buffer out after ~10 seconds like it's doing now.


The problem:
The values in *(0x1E84) only change when recording starts. They are set from another location (this is the location I will want to change), but I can't find it. It's passed in arg0 to mvrRecStart, but mvrRecStart is called from the StateObject and not directly in the ROM, so I have no way of knowing the arguments passed to it without doing some testing with RAM dumps.


I believe the actual "algorithm" for calculating what size buffer to use is in this section of MovwGetBufferSize:
Code: [Select]
loc_FF14B8AC:
                LDR     LR, =0x708
                LDR     R0, [R0,#0xA0]
                MUL     R3, LR, R12
                CMP     R0, #0
                MOVNE   R2, LR
                ADD     R0, R3, R3,LSL#1
                ADD     R0, R0, R2
                MOV     R0, R0,LSL#2
                STR     R0, [R1]
                MOV     R0, #0
                LDMFD   SP!, {R4,PC}

I'm going to look at it more soon, I just wanted to let everyone know I'm still working on things when I get time :P



edit:
So I've found the 2 buffer sizes:
20fps = 439,200
30fps = 655,200

so maybe it's not so much the recording size that matters as much as the framerate?
« Last Edit: 31 / August / 2011, 18:20:08 by Coutts »
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

*

Offline utnuc

  • **
  • 55
Re: 500d development
« Reply #1586 on: 31 / August / 2011, 21:53:39 »
Glad to see that you are back into the code Coutts.  It will be impressive if you guys are able to fully implement ML with Canon's dialog system, exciting stuff.

Re: 500d development
« Reply #1587 on: 02 / September / 2011, 04:21:00 »
Sorry for posting here rather than in Bitbucket but I experienced a bug on the autoexec.bin Coutts posted on August 18th. Since it's an unofficial release I thought to post here. (Was I right to do so?)
The bulb timer set did not function. Can anybody else replicate this?
I know stuff like that is to be expected from an unofficial release but I thought it would be worth posting in case this gets into the next beta.
Regards,
Ben

EDIT: This was the advert at the bottom of the page. Grrr! https://rapidshare.com/files/4254183347/550D.PNG
« Last Edit: 02 / September / 2011, 04:23:55 by bkkenny »


Re: 500d development
« Reply #1588 on: 02 / September / 2011, 14:53:47 »
 Not sure on your first part but my friend mr. AdBlock can help you with your advert annoyance :D

Re: 500d development
« Reply #1589 on: 03 / September / 2011, 03:18:44 »
Coutts, 0xAF and A1ex,

I updated my previous post with widgets and dialogs functions signatures.

Indy

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal