So, I don't understand, we can control ISO, Aperture, Shutter Speed, etc. through CHDK. But why not control video/photo resolution? How exactly does the PowerShot know that it's supposed to film at let's say 640x480? There's got to be something that tells the sensor to capture in that predefined resolution. Right?
Well, there's got be something, but I'd expect it's not
one thing. There will be parameters for the readout hardware, parameters for the display, parameters for the hardware that does jpeg and video encoding, and for all the software that ties them together. There's no particular reason to think there's one place that sets "width=640, height=480" and that you could just replace those with arbitrary values. It's likely that some of the subsystems involved only expect certain, specific values.
Even if those limits aren't hardware limits (which they could well be in some cases) the firmware code tends to have a variables where say, display mode 1 is 720x240, and 2 is 720x480. Various parts of the code then have switch statements involving the mode variable, and which set a bunch of parameters accordingly. To set a custom mode, you can't just set the mode variable, you'd have to find out everywhere it was used and find a way to override all the different values.
Worse, it's not necessarily a matter of just finding some simple variables. For example, the live view typically has 3-4 frame buffers packed together, starting at some specific address (so if buffer one is at X, buffer two is at X + 640*480*bit depth). If you made the resolution bigger, then all but the first buffer would need to move, and even worse, the space immediately after the buffers is likely used by some unrelated thing that would be broken if they grew.
Note the above description refers to the display system, because I have explored that code to some extent. This is related to and interacts with video recording, but isn't the same thing.
All that said, my limited understanding is that magic lantern managed to implement raw video at somewhat arbitrary resolutions, so perhaps examining how they did that would provide insights relevant to CHDK. I haven't looked into it myself.
Technically, it could be possible to monitor the memory changes live, while switching video resolutions, to see what those settings trigger, and find out what memory address changes and then inject custom values to make custom resolutions?
In theory, sure. In practice, a lot of things change, and identifying the significant ones could be challenging. And as described above, even knowing the changes doesn't mean you can necessarily just set arbitrary values.
Or is it something else that doesn't allow this to be done? I'm confused. It doesn't seem to be impossible. Reyalp? I think this one's for you, since you know a lot about the YUV frame buffers and stuff. Maybe you could explain why CHDK can't do this yet? Since technically this shouldn't be any harder than finding how to control the ISO, Aperture, and Shutter Speed. Right?
Exposure parameters are significantly simpler, and happen to be exposed through a well defined interface. There is no reason to assume the same applies to other things.