Author Topic: SX200is Porting  (Read 102094 times)

Offline reyalp

  • Guru Member
  • ******
  • Posts: 4468
Re: SX200is Porting
« Reply #105 on: 30 / August / 2009, 03:48:54 »
But CHDK is running just not showing the menus, I have been chasing through main, gui and conf in the core trying to see what could cause the crash when you activate OPT_DEBUGGING.
You shouldn't have to change any of those.

The only thing that should really matter in lib.c is the bitmap buffer address being correct, and the size being <= the actual size of the buffer. If you set the sizes too small, the display will look messed up, but it won't crash. 320x200 should be safe.

The other very likely cause of frequent crashes are a bad entry point or variable address (stubs_entry.S, stubs_entry_2.s, stubs_min.S)

edit:
display drawing issues could be related to RefreshPhysicalScreen (AKA ScreenUnLock) and ScreenLock.
« Last Edit: 30 / August / 2009, 03:50:53 by reyalp »
Don't forget what the H stands for.

Offline Darkness

  • Jr. Member
  • **
  • Posts: 69
  • SX200IS 100D
Re: SX200is Porting
« Reply #106 on: 30 / August / 2009, 05:27:34 »
edit:
display drawing issues could be related to RefreshPhysicalScreen (AKA ScreenUnLock) and ScreenLock.
in that case, let me put this here:

RefreshPhysicalScreen should be here I think: (stubs_entry_2.S)
NSTUB(RefreshPhysicalScreen, 0xFF9D4F7C)
SX200IS 100D

Offline OldGit

  • Sr. Member
  • ****
  • Posts: 303
Re: SX200is Porting
« Reply #107 on: 30 / August / 2009, 11:39:17 »
You shouldn't have to change any of those.
.......
display drawing issues could be related to RefreshPhysicalScreen (AKA ScreenUnLock) and ScreenLock.
Hi,
thanks for the all the help.
reyalp
I'm not changing anything in the core, just seting blink points to check where it fails.
I have already checked all entry points (and found a lot missing / wrong) but it may be worth a third or fourth look.

Darkness,
the entry point for RefreshPhysicalScreen you quote is correct, unfortunatly I already have this in stubs_entry_2.
By the way, if you add to stubs_entry_2 I think it needs to be NHSTUB, I made that mistake.

I've just tried the address from ADamb, but that just moves the splash to the left of the screen.

Oh well back to more testing, I WILL get this thing to work.

Thanks again all,
I'll check back later
OldGit
SX200 IS-100C

Offline reyalp

  • Guru Member
  • ******
  • Posts: 4468
Re: SX200is Porting
« Reply #108 on: 30 / August / 2009, 13:08:53 »
By the way, if you add to stubs_entry_2 I think it needs to be NHSTUB, I made that mistake.
Yes, otherwise it may not override stubs_entry.S
Don't forget what the H stands for.

Offline Darkness

  • Jr. Member
  • **
  • Posts: 69
  • SX200IS 100D
Re: SX200is Porting
« Reply #109 on: 30 / August / 2009, 18:09:47 »
indeed, should be NHSTUB
SX200IS 100D

Offline OldGit

  • Sr. Member
  • ****
  • Posts: 303
Re: SX200is Porting
« Reply #110 on: 31 / August / 2009, 01:54:48 »
OK some progress at last.
I haven't completely fixed the splash screen size problem but OPT_DEBUGGING no longer crashes the camera.
So....
Splash screen .... Still very small
OSD debug can be forced on (very small)
Both boot options working
Keys working (not fully checked)
Menus working .. (very small font)
Dual partition ... on but not checked , (bought SDHC 8 GB card and forgot an SDHC card reader)
Movie and capt_seq etc. not switched on
Note that I have not checked any functionality yet.

Before I continue, and bust the thing again, I will check the sources into svn, but I need to install a client first, and I am having a rest tonight as a celebration of getting past this stage. So sources will be up in the morning.

Darkness and others on the 100D port, please note that in boot.c the createhook calls are wrong, the 1330 / 1334 (or whatever it is) need to increase by 4 on both.

And finally, my thanks to all that have given tips, time, advance and support, I needed it over that last week.
Keep smiling all, OldGit
SX200 IS-100C

Offline Darkness

  • Jr. Member
  • **
  • Posts: 69
  • SX200IS 100D
Re: SX200is Porting
« Reply #111 on: 31 / August / 2009, 03:35:29 »
that's great news!  :xmas

I didn't have as much time over the weekend as hoped, but I will definitely check it out tomorrow morning.
SX200IS 100D

Offline Haf

  • Newbie
  • *
  • Posts: 3
Re: SX200is Porting
« Reply #112 on: 31 / August / 2009, 10:30:21 »
Wow, there's been a lot of progress going on here, quite impressive!
Unfortunately I couldn't find the time yet to look into the code myself and now I'm going on vacation. :) But I am confident that you'll have the CHDK up and running soon. So when I'm back, I'll probably be able to help testing. :)

Offline OldGit

  • Sr. Member
  • ****
  • Posts: 303
Re: SX200is Porting
« Reply #113 on: 31 / August / 2009, 11:25:42 »
Ok,
the sources are on svn.
Can someone check we have them all for the 100C, I'm new to svn and don't want to skip a file.
Next I will go back and add more to stubs_entry_2 then switch on capt_seq_task, movie_record_task, and exp_drv_task and debug them.

I know I should get the vid settings fixed but I need a rest from that.

Also if someone can check we are starting in the right mode (play / record) and that the buttons in CHDK mode buttons are OK (used print for alt) that would be good.
This is my first time with CHDK, got my first look at the screens last night, so I need to be sure I am following the standard for CHDK.

Thanks, OldGit
SX200 IS-100C

CHDK Forum

Re: SX200is Porting
« Reply #113 on: 31 / August / 2009, 11:25:42 »

Offline tr1stan

  • Rookie
  • *
  • Posts: 12
Re: SX200is Porting
« Reply #114 on: 31 / August / 2009, 17:33:24 »
I don't have the current sources but could one of you could please check if the pointers in vid_get_viewport_live_fb()
are really correct?

I think it must be "unsigned char buff = *((unsigned char*)0xFEC8);" instead of 0x1FD8.

Maybe this is the reason for the small screens?

tr1stan

Offline OldGit

  • Sr. Member
  • ****
  • Posts: 303
Re: SX200is Porting
« Reply #115 on: 31 / August / 2009, 17:36:32 »
Hi again,
found some extra addresses for stubs_entry_2 so the complete list is,

Code: [Select]
NHSTUB(AllocateMemory, 0xFFA6954C)
NHSTUB(GetSystemTime, 0xFF8606AC)
NHSTUB(UpdateMBROnFlash, 0xFF857924)
NHSTUB(qsort, 0xFFAAF200)
NHSTUB(AllocateUncacheableMemory, 0xFF82780C)
NHSTUB(EnterToCompensationEVF, 0xFF825748)
NHSTUB(ExitFromCompensationEVF, 0xFF8257F4)
NHSTUB(GetDrive_ClusterSize, 0xFF857ACC)          //  ?? not sure
NHSTUB(GetDrive_FreeClusters, 0xFF857B24)
NHSTUB(GetDrive_TotalClusters, 0xFF857AF8)
NHSTUB(RefreshPhysicalScreen, 0xFF9D4F7C)
NHSTUB(TurnOffBackLight, 0xFF889254)
NHSTUB(VbattGet, 0xFF820644)                      //  ?? not sure
NHSTUB(kbd_read_keys, 0xFF821E24)
NHSTUB(strchr, 0xFF88FCAC)
NHSTUB(vsprintf, 0xFF81CBA0)
NHSTUB(SetPropertyCase, 0xFF8741E0)
NHSTUB(kbd_read_keys_r2, 0xFF847B04)
NHSTUB(strrchr, 0xFF9D7430)
NHSTUB(GetCurrentTargetDistance, 0xFF92F7E4)
NHSTUB(GetOpticalTemperature, 0xFF84B61C)
NHSTUB(kbd_p2_f, 0xFF821760)
NHSTUB(PostLogicalEventForNotPowerType, 0xFF879A08)
NHSTUB(LEDDrive, 0xFF847614)
NHSTUB(apex2us, 0xFF9D8170)
NHSTUB(WriteSDCard, 0xFF920CA4)
NHSTUB(UnlockAF, 0xFF825644)
NHSTUB(DoAFLock, 0xFF82560C)
NHSTUB(ExpCtrlTool_StartContiAE, 0xFF8303C0)
NHSTUB(ExpCtrlTool_StopContiAE, 0xFF830504)
NHSTUB(GiveSemaphore, 0xFF827228)
NHSTUB(UnsetZoomForMovie, 0xFFD3E94)
NHSTUB(eventproc_export_PostLogicalEventToUI, 0xff879a54)
NHSTUB(eventproc_export_SleepTask, 0xff827490)
NHSTUB(eventproc_export_ExitTask, 0xff81b23c)
NHSTUB(MakeAFScan, 0xFF93B4B8)               //different from other cams but simular to SX110
NHSTUB(PostLEDMessage, 0xFF847470 )               //questionable, might be wrong... simular to SX110

// found by tr1stan and validated
NHSTUB(PT_PlaySound, 0xFF86046C)                 
NHSTUB(platformsub_kbd_fetch_data, 0xFF848340)

// not found so - pointed these at nullsub_1 as labelled in IDA

NHSTUB(SetZoomActuatorSpeedPercent, 0xFF810950)   //  ???????????????????  may be around FFA5BCAC SetZoomActuatorSpeedPPS
NHSTUB(rewinddir, 0xFF810950)                     //  ???????????????????
NHSTUB(Unmount_FileSystem, 0xFF810950)            //  ???????????????????
NHSTUB(Mount_FileSystem, 0xFF810950)              //  ???????????????????
NHSTUB(kbd_pwr_off, 0xFF810950)                   //  ???????????????????
NHSTUB(kbd_pwr_on, 0xFF810950)                    //  ???????????????????  may be around FF848340
NHSTUB(TurnOffMic, 0xFF810950)                    //  ???????????????????
NHSTUB(TurnOnMic, 0xFF810950)                     //  ???????????????????


also switched on everthing in boot.c, all seems ok.

I did find a mistake in kbd.c,  KEYS_MASK0 should be 0x00000300, NOT 0x00000400 (my only excuse is "it was late")

Some how while playing with the menus I managed to run the property dump script so I now have a dump file, well at least the scripts seem to work.

All the nice screen things (Histo etc.) don't want to play yet, so I think I'll just have to go back and start playing with lib.c again.

Thats it for now, I'm going for a drink and relax.
OldGit
SX200 IS-100C

Offline OldGit

  • Sr. Member
  • ****
  • Posts: 303
Re: SX200is Porting
« Reply #116 on: 31 / August / 2009, 17:59:38 »
Hi, tr1stan,
just saw your post as I was logging out, I just tried this quickly and it seems not to make a difference.
I think the address that affects for splash and OSD menus is vid_get_viewport_fb_d.
I could be wrong on this, so I'll test it some more with your address when I get some more time.

Thanks for the update.

If you want the sources ask Darkness, he has setup the svn and can grant access.
The more of us that try the better chance we have.
OldGit
SX200 IS-100C

Offline Darkness

  • Jr. Member
  • **
  • Posts: 69
  • SX200IS 100D
Re: SX200is Porting
« Reply #117 on: 31 / August / 2009, 18:36:13 »
for SVN write access, create an account on this website and tell me your username: www.xp-dev.com

I enabled public read access for all you lurkers out there  ::)

repository: http://svn2.xp-dev.com/svn/Darkness-sx200/
SX200IS 100D

Offline tr1stan

  • Rookie
  • *
  • Posts: 12
Re: SX200is Porting
« Reply #118 on: 31 / August / 2009, 19:57:41 »
Well I'm at work at the moment so no time for doing such things   ???
For the vid_get_viewport_fd_d() function please try this one:

void *vid_get_viewport_fb_d()
{
   return (void*)(*(int*)(0x2950+0x50));   // found at FF858EB8 in the 100D FW
}

Compared to the SX10 this seems more correct...

tr1stan

Offline Darkness

  • Jr. Member
  • **
  • Posts: 69
  • SX200IS 100D
Re: SX200is Porting
« Reply #119 on: 31 / August / 2009, 22:01:40 »
my initial test: run the 100C port on 100D --> it works!

First thing I noticed, It boots up the camera in shooting mode if I press the play button. Press play again and I end up in play mode.

the menu/splash size issue does not happen on 100D

A really horrible phone camera image:


power button did not seem to work when in ALT mode to shut down the camera.
SX200IS 100D

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal