While working on something else, I noticed that the setmode.lua test failed consistently on cameras where it previously passed. It turns out this happened when get_mode was changed to use cached information from camera_info instead of calling camera functions directly. The camera_info updates in spytask, so it can take kbd_task iterations before script sees the mode change.

In trunk r4195, I added a call to mode_get after the mode switch. The test now passes on all my cams. I could have just updated the test to sleep for a while or query the propcase directly, but the old behavior of the mode change being immediately visible seems more convenient.

In trunk 4200, I made raw not save if GetRawCount is < 1. I added a 0.25 raw size margin to GetRawCount to allow for uncertainty in the jpeg calculation, dng header etc.

This may cause previously working ports to break if GetFreeCardSpaceKb (_GetDrive_FreeClusters, GetDrive_ClusterSize) or GetJpgCount have major problems. Since these were previously just informational, it's possible problems have gone unnoticed.

In trunk 4210, I added a script function get_raw_support, which returns true if the current capture mode has valid raw data according to the CHDK defines. I updated the setmode.lua test to report this value.

This can be used with rawop to know in advance if raw framebuffer functions will work, but isn't part of rawop because it's useful in other situations.

I'm not in love with the name but I couldn't come up with a better one, so alternative suggestions are welcome (for a limited time, I'm not going to repeat the remote timing debacle)

Notes:* A fair number of ports probably don't set the DISABLE_RAW_IN_* defines correctly.* Currently, dedicated video modes will return true, even though capturing stills in these modes is not possible on many cameras. This is because CHDK doesn't know which cameras can shoot still in video. One thing I've wanted to do for a long time is attach flags to modes (can shoot stills, can start video, uses USER propcases etc) but that's a project for another day.* This does not check raw settings (enable, exceptions) to see if raw will actually be saved, the purpose is only to check if valid date will be available.* It might be better to be able to pass the mode number instead of using the current one, but the existing C code isn't set up to do that.