The A mode seems to work ok with my K-x, M glass and 540 combo, provided the distance to image is reasonable (eg I don't think the A mode can control the flash well enough at macro type distances).
The on-camera flash can be quite reasonable as well as a fully manual flash and with a GN of 13, maths is simple. One metre equals F13, 2 metres equals F6.5 at ISO 100. In practice, I take a test shot and view the histogram and fine tune aperture as needed.
This was a couple of metres distance and worked well, using the 540 on A mode and as a bounce off the ceiling. Lens was a M85 2.0
This was using the on-board flash outdoors, again with the M85: