d3d9EX, I read that enabling frame delay is useless as you're already getting maximum input lag reduction when using that video mode.
Not 'maximum', just using d3d9ex (frame_delay off) means the video is synced within a single frame instead of the ususal 2~3, so it takes care of the greatest portion of the usual unwanted lag.
Then to get rid of most of that last remaining frame you will need frame_delay ON, often at the highest possible setting (requires extra cpu+gpu muscle on top of what the MAME drivers already require for themselves)
In theory plain d3d9 with frame_delay set to 1 behaves just like d3d9ex, however in practice some (heavy) games will freak out and it doesn't seem to necessarily be a matter of processing power, or at the very least it doesn't seem to be the
CPU's fault (maybe the GPU is the bottleneck, dunno for sure)
So for those games just use d3d9ex without frame_delay, until maybe future development changes that somehow.
(and, well, use triplebuffer in this particular case of course)