Author Topic: [UNMAINTAINED] Canon 40D  (Read 291131 times)

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #100 on: September 28, 2012, 01:07:44 AM »
Some additional information:

http://en.wikipedia.org/wiki/Canon_EOS_40D

coutts

  • Developer
  • Senior
  • *****
  • Posts: 401
Re: Canon 40D
« Reply #101 on: September 28, 2012, 08:49:36 AM »
I managed to blur the image of the LCD. I now have to know the coordinates valid in order to draw a rectangle.

I used this STUB, and wrote somewhere in vram0.

NSTUB(0x1E450, bmp_vram_info)

In the coming days, I'll want to have a bmp_printf(...) function to write text on the display.

Once you get it, I want to improve the boot process.

you should start porting ML to the 40d, clone the latest repo and look for CONFIG_5DC, maybe add #define CONFIG_5DC CONFIG_40D and copy the same diretory structure / entry.S of the 5dc. All of the changes for the 5dc in menu.c should be valid for the 40d too.

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #102 on: September 28, 2012, 12:16:12 PM »
Thanks Coutts ... I'm working on it :)

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #103 on: September 30, 2012, 02:15:07 AM »
Good news ...

In recent days, me and Alex, we can give a good progress in 40D port.

Finally, we have a "Hello World" working ...

soon I'll post a picture here ...

dichterDichter

  • New to the forum
  • *
  • Posts: 6
Re: Canon 40D
« Reply #104 on: October 01, 2012, 04:22:18 PM »
Awsome. My Camera is still broken and im trying to repair it.

imme

  • New to the forum
  • *
  • Posts: 26
Re: Canon 40D
« Reply #105 on: October 03, 2012, 07:21:48 AM »
Me and many others are silently waiting for Good news

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #106 on: October 03, 2012, 11:45:50 AM »
With a little time and patience, one day will come true ...

The Coutts and Alex have done an excellent job with 5DC.
I think that much of this work can be useful for the 40D.

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #107 on: October 04, 2012, 01:08:11 AM »
Some more stubs

40D v1.1.1

Quote

NSTUB(0x1E458, LCD_Palette)
NSTUB(0x1E498, RGB_Palette)
NSTUB(0x1E388, PB_Palette)

NSTUB(0xFFCB0B6C, SetRGBPaletteToDisplayDevice)
NSTUB(0xFF867AA8, ChangeColorPalette)
NSTUB(0xFFCAFA0C, SetParameterToBitmapDisplayDevice)

NSTUB(0xFFCB7EBC, EnableBitmapVBufferForPlayBackAndWaiting)

NSTUB(0xFFCB9078, BmpDDev_give_semaphore);
NSTUB(0xFFCB9028, BmpDDev_take_semaphore);

NSTUB(0xFF8156F8, bindGUISwitchCBR)



Alex... I'm working on it :)

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #108 on: October 04, 2012, 03:35:29 AM »
Code: [Select]

  3878: 23394.264 [MC] M:1,ID:B(29)
  3879: 23394.303 [BIND] Switch (11, 5)
  3880: 23394.345 [GUI_E] GUI_Control:25 0x0
  3881: 23394.537 [JP] (50/3) my_gui_main_task:85: EVT 246[0]: p=19 *o=0x0/0x0/0x0 a=0
  3884: 23426.474 [JP] (50/3) my_gui_main_task:85: EVT 247[4]: p=0 *o=0x80030014/0x96/0x0 a=0
  3887: 23445.017 [MC] M:1,ID:B(30)
  3888: 23445.059 [BIND] Switch (11, 3)
  3889: 23445.092 [GUI_E] GUI_Control:23 0x0
  3890: 23458.398 [JP] (50/3) my_gui_main_task:85: EVT 248[0]: p=17 *o=0x0/0x0/0x0 a=0
  3893: 23489.950 [GUI] DlgPlayMain.c PRESS_MLT_RIGHT_BUTTON
  3894: 23490.172 [DispCon] SetTempForBackLight Temp 150
  3895: 23490.318 [GUI] DlgPlayMain.c PRESS_MLT_RIGHTUP_BUTTON
  3896: 23495.865 [MC] M:1,ID:B(31)
  3897: 23495.904 [BIND] Switch (11, 2)
  3898: 23495.941 [GUI_E] GUI_Control:22 0x0
  3899: 23496.137 [JP] (50/3) my_gui_main_task:85: EVT 249[0]: p=16 *o=0x0/0x0/0x0 a=0
  3902: 23527.803 [GUI] DlgPlayMain.c PRESS_MLT_UP_BUTTON
  3903: 23546.781 [MC] M:1,ID:B(32)
  3904: 23546.821 [BIND] Switch (11, 4)
  3905: 23546.853 [GUI_E] GUI_Control:24 0x0
  3906: 23547.040 [JP] (50/3) my_gui_main_task:85: EVT 250[0]: p=18 *o=0x0/0x0/0x0 a=0
  3909: 23578.686 [GUI] DlgPlayMain.c PRESS_MLT_LEFTUP_BUTTON
  3910: 23589.717 [MC] M:1,ID:B(0)
  3911: 23589.753 [BIND] Switch (11, 6)
  3912: 23589.790 [GUI_E] GUI_Control:26 0x0
  3913: 23589.970 [JP] (50/3) my_gui_main_task:85: EVT 251[0]: p=1a *o=0x0/0x0/0x0 a=0
  3916: 23621.610 [GUI] DlgPlayMain.c PRESS_MLT_LEFT_BUTTON
  3917: 23640.641 [MC] M:1,ID:B(1)
  3918: 23640.683 [BIND] Switch (11, 8)
  3919: 23640.721 [GUI_E] GUI_Control:28 0x0
  3920: 23640.907 [JP] (50/3) my_gui_main_task:85: EVT 252[0]: p=1c *o=0x0/0x0/0x0 a=0
  3923: 23672.516 [GUI] DlgPlayMain.c PRESS_MLT_LEFTDOWN_BUTTON
  3924: 23691.575 [MC] M:1,ID:B(2)
  3925: 23691.617 [BIND] Switch (11, 9)
  3926: 23691.655 [GUI_E] GUI_Control:29 0x0
  3927: 23691.839 [JP] (50/3) my_gui_main_task:85: EVT 253[0]: p=1d *o=0x0/0x0/0x0 a=0
  3930: 23723.499 [GUI] DlgPlayMain.c PRESS_MLT_DOWN_BUTTON
  3931: 23793.658 [MC] M:1,ID:B(3)
  3932: 23793.698 [BIND] Switch (11, 5)
  3933: 23793.737 [GUI_E] GUI_Control:25 0x0
  3934: 23793.937 [JP] (50/3) my_gui_main_task:85: EVT 254[0]: p=19 *o=0x0/0x0/0x0 a=0
  3937: 23825.534 [GUI] DlgPlayMain.c PRESS_MLT_RIGHT_BUTTON
  3938: 23844.343 [MC] M:1,ID:B(4)
  3939: 23844.384 [BIND] Switch (11, 3)
  3940: 23844.420 [GUI_E] GUI_Control:23 0x0
  3941: 23844.610 [JP] (50/3) my_gui_main_task:85: EVT 255[0]: p=17 *o=0x0/0x0/0x0 a=0
  3944: 23876.253 [GUI] DlgPlayMain.c PRESS_MLT_RIGHTUP_BUTTON
  3945: 23895.276 [MC] M:1,ID:B(5)
  3946: 23895.315 [BIND] Switch (11, 0)
  3947: 23895.350 [GUI_E] GUI_Control:21 0x0
  3948: 23895.543 [JP] (50/3) my_gui_main_task:85: EVT 256[0]: p=15 *o=0x0/0x0/0x0 a=0
  3951: 23945.275 [MC] M:1,ID:B(6)
  3952: 23945.317 [BIND] Switch (11, 6)
  3953: 23945.354 [GUI_E] GUI_Control:26 0x0
  3954: 23945.559 [JP] (50/3) my_gui_main_task:85: EVT 257[0]: p=1a *o=0x0/0x0/0x0 EVT 257 a=0
  3957: 23977.234 [GUI] DlgPlayMain.c PRESS_MLT_LEFT_BUTTON


nanomad

  • Administrator
  • Hero Member
  • *****
  • Posts: 2918
  • All your websites are belong to us
Re: Canon 40D
« Reply #109 on: October 04, 2012, 09:22:14 PM »
Do you have a fork with your 40D work on bitbucket? I'd like to "follow" it
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #110 on: October 04, 2012, 11:53:12 PM »
Do you have a fork with your 40D work on bitbucket? I'd like to "follow" it


Nanomad.  I haven't shared my code in this repository.
I sent my initial developments to Alex's email.
After that, he then began to integrate it into the ML.
We've been working together a few hours.
I loved working with him on this project, but we had little time.

Right now, I have a problem displaying the menus on the LCD.
I suspect there is a problem of any competition in memory access, calculations wrong, wrong resolutions or access buffers that were allocated dynamically and are already invalid.

Yes, I am thinking to create a repository on bitbucket

I also hope to have their precious help ;)

BR

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #111 on: October 05, 2012, 02:05:30 AM »
Hi guys

My 40D camera now say :

"Magic Lantern is up and running...3 tasks started."


... but has serious problems on the LCD. I still can not see the menu of ML :(
I can only see messages like "Hello World!" and sometimes appears at the top of the image a green rectangle,
a little blurred with pixels of other colors. I think is the menu! And sometimes the entire screen flashes.
It seems that, we switch the color palette. This is something very strange happens.

I'll have to ask someone for help ... I still can not fully understand the code of VRAM.
We should be using buffers invalid or the wrong dimensions. If I can I do some tests for next week

Guys? Someone can help me on this? ... Maybe you Alex ... ;)
Thank you in advance!

I'll keep you updated with the latest news ...

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #112 on: October 05, 2012, 02:10:25 AM »
I identified some errors ...

Code: [Select]

   618:  1078.659 [JP] (50/3) read_entire_file:889: File 'A:/ML/DATA/FONTS.DAT' size 32744 by
   619:  1091.459 [FR] readsize = 0x20000
   620:  1110.717 [FR] readsize = 0x20000
   621:  1124.497 [FR] readsize = 0x20000
   622:  1141.060 [FR] readsize = 0x20000
   623:  1155.195 [FR] readsize = 0x20000
   624:  1172.910 [FR] readsize = 0x1f000
   625:  1187.773 [FR] A:/DCIM/100CANON/IMG_1685.JPG read done (8288KB/S)
   626:  1187.961 [GUI] SetPlInfoPLAYMode(100_1685)
   627:  1188.080 [IMP] (PUB) SetDpRotationAngle 2845(0)
   628:  1188.119 [IMP] (PUB) SetColorConvertTable 2832( 0x0 )
   629:  1188.137 [Graphics] GuiDrawOneImage (PUB)
   630:  1188.180 SetImageVramParameter x:0 y:0 w:720 h:240/* Aspect:0*/
   631:  1188.208 [IMP] (PUB) SyncroClearImagePlayVram 2569
   632:  1188.226 [IMP] GetVramNumber 580
   633:  1188.246 [IMP] GetVramNumber 580
   634:  1189.050 <RECTCOLOR> RequestRectangleColor Before Lock
   635:  1189.432 [FW] fwSetUnitSize (0x200000)
   636:  1191.298 [IMP] (PUB) SetVramInformation(w:720 h:240) 1291
   637:  1191.367 [IMP] (PUB) SetImageAspect 3683
   638:  1191.451 SetImageVramParameter x:48 y:24 w:340 h:102/* Aspect:976264*/
   639:  1191.489 [IMP] (PUB) SetImageFileParameter 1348
   640:  1191.567 [IMP] (PUB) DrawImageToVram(rot:0 cb:0xFF8851E4) 1393
   641:  1191.593 [IMP] GetJpegInfo 750
   642:  1192.330 <DJP> RequestDecodeJpeg Before Lock
   643:  1214.231 [IMP] SetRotationAngle 616
   644:  1214.264 [IMP] SetVramImageParameter 640
   645:  1214.294 [IMP] GetVramNumber 580
   646:  1215.508 <DJP> RequestDecodeJpeg Before Lock
   647:  1242.982 [JP] (50/3) Calling init_func ../../src/bmp.c (b807f4)
   648:  1247.041 [JP] (50/3) Calling init_func ../../src/font-dyn.c (b82aa8)
   649:  1247.089 [JP] (50/3) Calling init_func debug (b87f68)
   650:  1247.193 [JP] (50/3) Calling init_func ../../src/property.c (b8b020)


   651:  1248.238 [PROPAD] ERROR GetPropertyData ID = 0x0205000E
   652:  1248.373 [PROP] ERROR NOT FOUND PROPERTY ID = 0x0205000E L:874
   653:  1248.839 [JP] (50/3) _prop_handler_PROP_LAST_JOB_STATE:1781: job state: 0
   654:  1249.631 [PROPAD] ERROR GetPropertyData ID = 0x0206001E
   655:  1249.745 [PROP] ERROR NOT FOUND PROPERTY ID = 0x0206001E L:874
   656:  1249.901 [PROPAD] ERROR GetPropertyData ID = 0x0204000D
   657:  1249.983 [PROP] ERROR NOT FOUND PROPERTY ID = 0x0204000D L:874

   658:  1250.579 [JP] (50/3) Calling init_func ../../src/tweaks.c (b8bf38)
   659:  1251.006 [JP] (50/3) Calling init_func lens (b8f1f8)
   660:  1251.151 [JP] (50/3) Calling init_func ../../src/zebra.c (b93e00)
   661:  1251.681 [JP] (50/3) Calling init_func shoot (b9f87c)
   662:  1252.387 [JP] (50/3) Calling init_func ../../src/movtweaks.c (ba7b30)
   663:  1252.554 [JP] (50/3) Calling init_func help_menu (ba8fbc)
   664:  1252.724 [JP] (50/3) Calling init_func ../../src/focus.c (ba97c0)
   665:  1253.079 [JP] (50/3) Calling init_func ../../src/notify_box.c (bab220)

Code: [Select]
  1381:  1791.326 < GUI Lock > GUILock_TurnOnDisplay (PUB)
  1382:  1791.488 < GUI Lock > GUILockTask 1
  1383:  1791.527 [DispCon] TurnOnDisplay (PUB)
  1384:  1791.555 [DispCon] TFT_POWDET Low Wait
  1385:  1792.743 [DispCon] TFT_POWDET Low Wait
  1386:  2262.465 [CFS] Mini Info. (0x1000000e)
  1387:  2262.552 [JP] (50/3) read_entire_file:910: failed

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #113 on: October 05, 2012, 02:23:00 AM »
The my_gui_main_task seems to be working... ;)

Code: [Select]
  5938: 15903.631 [MC] M:1,ID:E(1)
  5939: 15903.676 [BIND] Switch (14, 1)
  5940: 15903.714 [GUI_E] GUI_Control:1 0x0

  5941: 15903.898 [JP] (50/3) my_gui_main_task:85: EVT 372[0]: p=1
  5942: 15903.942 [JP] (50/3) my_gui_main_task:90: EVT 372 *o=0x0/0x0/0x0
  5943: 15903.973 [JP] (50/3) my_gui_main_task:93: EVT 372 a=0
  5944: 15935.627 [GUI] DlgPlayMain.c ROTATE_ELECTRONIC_SUB_DIAL_RIGHT

  5945: 15935.719 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)
  5946: 15935.804 [FC] _FC_GetDriveObject (1,1)
  5947: 15935.884 [GUI] GUI_GetTotalFileInDrive FM_GetDriveObject Num(5)
  5948: 15935.999 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)
  5949: 15936.053 [FC] _FC_GetDriveObject (1,1)
  5950: 15936.104 [GUI] GUI_GetTotalFileInDrive FM_GetDriveObject Num(5)
  5951: 15936.160 [GUI] ChangeMultiCurrentPositionForMove hOldFile(0x51906950)
  5952: 15936.213 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)
  5953: 15936.253 [FC] _FC_GetDriveObject (1,1)
  5954: 15936.297 [GUI] GUI_GetTotalFileInDrive FM_GetDriveObject Num(5)
  5955: 15936.334 [FC] _FC_GetFirstFileHandle
  5956: 15936.368 [FC] ctgFileGetFirstFileHandle (1, 0, 0, 0)

  5957: 15936.958 [JP] (50/3) my_gui_main_task:85: EVT 373[4]: p=0
  5958: 15937.035 [JP] (50/3) my_gui_main_task:90: EVT 373 *o=0x2050000/0x7f3c2c/0x6c
  5959: 15937.070 [JP] (50/3) my_gui_main_task:93: EVT 373 a=0
  5960: 15968.951 [JP] (50/3) my_gui_main_task:85: EVT 374[4]: p=0
  5961: 15969.028 [JP] (50/3) my_gui_main_task:90: EVT 374 *o=0x2050000/0x7f3d24/0x6c
  5962: 15969.061 [JP] (50/3) my_gui_main_task:93: EVT 374 a=0

  5963: 16000.466 [GUI] GUI_SetFileIndexInDrive(1)
  5964: 16000.993 [JP] (50/3) my_gui_main_task:85: EVT 375[4]: p=0
  5965: 16001.076 [JP] (50/3) my_gui_main_task:90: EVT 375 *o=0x2050000/0x7f3e1c/0x6c
  5966: 16001.115 [JP] (50/3) my_gui_main_task:93: EVT 375 a=0
  5967: 16032.895 [JP] (50/3) my_gui_main_task:85: EVT 376[4]: p=0
  5968: 16032.969 [JP] (50/3) my_gui_main_task:90: EVT 376 *o=0x2050000/0x7f3f14/0x6c
  5969: 16033.003 [JP] (50/3) my_gui_main_task:93: EVT 376 a=0
  5970: 16064.777 [JP] (50/3) my_gui_main_task:85: EVT 377[4]: p=0
  5971: 16064.855 [JP] (50/3) my_gui_main_task:90: EVT 377 *o=0x2050000/0x7f400c/0x6c
  5972: 16064.890 [JP] (50/3) my_gui_main_task:93: EVT 377 a=0
  5973: 16096.291 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)


I think that once the problem of LCD is resolved, we can say that we have the ML running on 40D :)


Be patience, ... we still have much work ahead!


samacochan

  • New to the forum
  • *
  • Posts: 23
Re: Canon 40D
« Reply #114 on: October 05, 2012, 09:29:09 PM »
The my_gui_main_task seems to be working... ;)

Code: [Select]
  5938: 15903.631 [MC] M:1,ID:E(1)
  5939: 15903.676 [BIND] Switch (14, 1)
  5940: 15903.714 [GUI_E] GUI_Control:1 0x0

  5941: 15903.898 [JP] (50/3) my_gui_main_task:85: EVT 372[0]: p=1
  5942: 15903.942 [JP] (50/3) my_gui_main_task:90: EVT 372 *o=0x0/0x0/0x0
  5943: 15903.973 [JP] (50/3) my_gui_main_task:93: EVT 372 a=0
  5944: 15935.627 [GUI] DlgPlayMain.c ROTATE_ELECTRONIC_SUB_DIAL_RIGHT

  5945: 15935.719 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)
  5946: 15935.804 [FC] _FC_GetDriveObject (1,1)
  5947: 15935.884 [GUI] GUI_GetTotalFileInDrive FM_GetDriveObject Num(5)
  5948: 15935.999 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)
  5949: 15936.053 [FC] _FC_GetDriveObject (1,1)
  5950: 15936.104 [GUI] GUI_GetTotalFileInDrive FM_GetDriveObject Num(5)
  5951: 15936.160 [GUI] ChangeMultiCurrentPositionForMove hOldFile(0x51906950)
  5952: 15936.213 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)
  5953: 15936.253 [FC] _FC_GetDriveObject (1,1)
  5954: 15936.297 [GUI] GUI_GetTotalFileInDrive FM_GetDriveObject Num(5)
  5955: 15936.334 [FC] _FC_GetFirstFileHandle
  5956: 15936.368 [FC] ctgFileGetFirstFileHandle (1, 0, 0, 0)

  5957: 15936.958 [JP] (50/3) my_gui_main_task:85: EVT 373[4]: p=0
  5958: 15937.035 [JP] (50/3) my_gui_main_task:90: EVT 373 *o=0x2050000/0x7f3c2c/0x6c
  5959: 15937.070 [JP] (50/3) my_gui_main_task:93: EVT 373 a=0
  5960: 15968.951 [JP] (50/3) my_gui_main_task:85: EVT 374[4]: p=0
  5961: 15969.028 [JP] (50/3) my_gui_main_task:90: EVT 374 *o=0x2050000/0x7f3d24/0x6c
  5962: 15969.061 [JP] (50/3) my_gui_main_task:93: EVT 374 a=0

  5963: 16000.466 [GUI] GUI_SetFileIndexInDrive(1)
  5964: 16000.993 [JP] (50/3) my_gui_main_task:85: EVT 375[4]: p=0
  5965: 16001.076 [JP] (50/3) my_gui_main_task:90: EVT 375 *o=0x2050000/0x7f3e1c/0x6c
  5966: 16001.115 [JP] (50/3) my_gui_main_task:93: EVT 375 a=0
  5967: 16032.895 [JP] (50/3) my_gui_main_task:85: EVT 376[4]: p=0
  5968: 16032.969 [JP] (50/3) my_gui_main_task:90: EVT 376 *o=0x2050000/0x7f3f14/0x6c
  5969: 16033.003 [JP] (50/3) my_gui_main_task:93: EVT 376 a=0
  5970: 16064.777 [JP] (50/3) my_gui_main_task:85: EVT 377[4]: p=0
  5971: 16064.855 [JP] (50/3) my_gui_main_task:90: EVT 377 *o=0x2050000/0x7f400c/0x6c
  5972: 16064.890 [JP] (50/3) my_gui_main_task:93: EVT 377 a=0
  5973: 16096.291 [GUI] GUI_GetTotalFileInDrive hDriveHandle(0x50000000)


I think that once the problem of LCD is resolved, we can say that we have the ML running on 40D :)


Be patience, ... we still have much work ahead!
Good job. I am waiting.

Indy

  • Developer
  • Member
  • *****
  • Posts: 112
Re: Canon 40D
« Reply #115 on: October 06, 2012, 04:03:28 PM »
Jplxpto,

First: impressive progress for your first port!
if you could publish your code (bitbucket fork?) we can better help you...
for example see missing stubs/consts

Indy

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #116 on: October 07, 2012, 10:18:49 PM »
Jplxpto,

First: impressive progress for your first port!
if you could publish your code (bitbucket fork?) we can better help you...
for example see missing stubs/consts

Indy


Hi Indy

Will I have a great honor to also have your help.
You have given me a fantastic help. I am very grateful to you all.

My current code is all in hudson repository of ML.

For more details we can exchange some PM.

BR

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #117 on: October 07, 2012, 11:44:33 PM »
Sounds good.

Point the camera to something recognizable and dump roughly 1MB from the VRAM address to confirm it.

Another way to find VRAM buffers: look for EDMAC registers. In digic 4, these are c0f04008, c0f04108 ... c0f04f08, then c0f26008, c0f26108 etc. One of those registers should point to the LiveView buffer.


I found this :

MEM(0x00007648) = 0xC0F0B008

http://www.magiclantern.fm/forum/index.php?topic=1452.msg12152#msg12152

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #118 on: October 08, 2012, 02:04:15 AM »
I found three 40D v 1.1.1 fonts:

I used the script find_fnt.py but I changed it a bit.

Code: [Select]
...

print 'Find bitmap fonts in Canon DSLR firmwares'
print 'Arm.Indy. based on work by Pel, Trammel Hudson and A1ex\n'

off = 0
while off < len(m) and off <> -1:
  off = m.find('FNT\0', off)
  if off <> -1:
    val = getShortLE(m, off+4)
    if val==0xffd8 or val==0xffe2               or val==0xffec:
      parseFont(m, off, base)
    off = off + 4
...

Code: [Select]
python ../../../../find_fnt.py 40d.111.ROMF1.0xFF800000.bin 0xFF800000
Code: [Select]
Find bitmap fonts in Canon DSLR firmwares
Arm.Indy. based on work by Pel, Trammel Hudson and A1ex

0xff9ed2e4: FNT
0xff9ed2e8: (+0x04) 0xffec
0xff9ed2ea: (+0x06) font_width = 20
0xff9ed2ec: (+0x08) charmap_offset = 0x24
0xff9ed2f0: (+0x0c) charmap_size = 0x21f0
0xff9ed2f4: (+0x10) bitmap_size = 0x36858
0xff9ed2f8: (+0x14) font name = 'HCanonGothic'
0xff9ed308: (+0x24) char_codes[]. 2172 chars
0xff9ef4f8: (+0x2214) offsets[]. Last offset value = 0x367ea
0xff9f16e8: (+0x4404) bitmaps[]
  0xffa27ed2: (+0x3abee) last bitmap
  +0x00: bitmap width = 36
  +0x02: bitmap height = 36
  +0x04: char width = 36
  +0x06: X offset = 0
  +0x08: Y offset = 0
    bitmap size = 0xb4

0xffa27f40: FNT
0xffa27f44: (+0x04) 0xffe2
0xffa27f46: (+0x06) font_width = 30
0xffa27f48: (+0x08) charmap_offset = 0x24
0xffa27f4c: (+0x0c) charmap_size = 0x170
0xffa27f50: (+0x10) bitmap_size = 0x2eb8
0xffa27f54: (+0x14) font name = 'HCanonGothic'
0xffa27f64: (+0x24) char_codes[]. 92 chars
0xffa280d4: (+0x194) offsets[]. Last offset value = 0x2e36
0xffa28244: (+0x304) bitmaps[]
  0xffa2b07a: (+0x313a) last bitmap
  +0x00: bitmap width = 30
  +0x02: bitmap height = 30
  +0x04: char width = 30
  +0x06: X offset = 0
  +0x08: Y offset = 0
    bitmap size = 0x78

0xffa2b0fc: FNT
0xffa2b100: (+0x04) 0xffe2
0xffa2b102: (+0x06) font_width = 36
0xffa2b104: (+0x08) charmap_offset = 0x24
0xffa2b108: (+0x0c) charmap_size = 0x170
0xffa2b10c: (+0x10) bitmap_size = 0x4448
0xffa2b110: (+0x14) font name = 'HCanonGothic'
0xffa2b120: (+0x24) char_codes[]. 92 chars
0xffa2b290: (+0x194) offsets[]. Last offset value = 0x438a
0xffa2b400: (+0x304) bitmaps[]
  0xffa2f78a: (+0x468e) last bitmap
  +0x00: bitmap width = 36
  +0x02: bitmap height = 36
  +0x04: char width = 36
  +0x06: X offset = 0
  +0x08: Y offset = 0
    bitmap size = 0xb4

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12207
  • Maintenance mode
Re: Canon 40D
« Reply #119 on: October 08, 2012, 12:06:17 PM »
Sounds good.

On 5Dc, ML changes the palette, so it's probably normal. Can you post some screenshots?

You can map the button codes, and once this is done, menu should be usable.

Indy

  • Developer
  • Member
  • *****
  • Posts: 112
Re: Canon 40D
« Reply #120 on: October 09, 2012, 08:23:27 PM »
At least someone else is using this script ;-) maybe I should put them on bitbucket...

@jplxpto
your files on bitbucket are one week old and comments are "not tested"
- what is working/not working ?
- what are missing / working stubs and consts values ?

Indy

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #121 on: October 09, 2012, 11:06:57 PM »
At least someone else is using this script ;-) maybe I should put them on bitbucket...

@jplxpto
your files on bitbucket are one week old and comments are "not tested"
- what is working/not working ?
- what are missing / working stubs and consts values ?

Indy



Indy, you're right files have one week ... in the last days I had little time to work on it.
I was just looking for some stubs and clarify my doubts with other forum members.

Yes I used your script and it was useful to confirm the addresses of fonts.

I have enabled the bootflags and dump the ROM dump.

Last week, me and Alex located the HD & BMP VRAM, but I still do not know the address of the LV VRAM.
I already have some ML threads running but, still could not see any menu. Is there any problem in presenting the image on the LCD.
I should have solved this, but my lack of time and knowledge has not allowed me to resolve this issue.
There is also a problem in the image display on the LCD.
The can.on menus are constantly changing color. The problem must be related to the color palette.
I already found the addresses of color palettes and some stubs used by Alex in 5DC. I did not upload but did post here.




jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #122 on: October 10, 2012, 02:58:07 AM »
Some more stubs

40D v1.1.1

Code: [Select]
NSTUB(0xFFD4F338, TryPostEvent)
NSTUB(0xFFD4F398, TryPostEvent_end)

NSTUB(0xFFD56470, TryPostStageEvent)
NSTUB(0xFFD564FC, TryPostStageEvent_end) // PendStageEvent

NSTUB(0xFFD6A1C8, get_current_task) // 0x22E00
NSTUB(0xFFD69F8C, get_task_info)
NSTUB(0xFFD6B8B0, get_active_task_list)

jplxpto

  • Developer
  • Hero Member
  • *****
  • Posts: 506
Re: Canon 40D
« Reply #123 on: October 10, 2012, 03:45:29 AM »
I commented out the calls to the set_ml_palette and set_ml_palette_if_dirty functions and,
now the colors are presented as they were before.

I have not created my repository to share my changes with you, but I hope to do that later this week.

After upgrading my project with the latest version of ML available,
I checked that the code does not compile.
 Some more stubs are needed to 40D. I however able find what was missing.

I'm now using changeset a53eef8d1c7d.

Code: [Select]
NSTUB(0xFFD6A1C8, get_current_task) // 0x22E00
NSTUB(0xFFD69F8C, get_task_info)
NSTUB(0xFFD6B8B0, get_active_task_list)


My next step is to draw a rectangle on the screen to see if I understand what is happening with the VRAM. Later, I'll validate events. The ML is already processing some events but I have to review all the constants.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12207
  • Maintenance mode
Re: Canon 40D
« Reply #124 on: October 10, 2012, 07:59:28 AM »
For drawing, use bmp_fill and bmp_draw_rect (they both have the same syntax, so rectangles drawn with those two functions should overlap).