You can't specify a resolution like 399x253 unless you have it available in windows (use a tool like quickres to see your available res list).
The general rule of thumb that I use to pick a resolution is this:
1) From your list of available resolutions, pick those with exactly as many horizontal lines (the 2nd number) as the target res, or slightly more
2) Of those, pick one with exactly as many vertical lines (the first number) as the target res, or slightly more.
For your Rampage example, 399x253, the closest resolutions available would be the 256 horizontal line ones. Of those, the closest would be 401x256.
I also try to avoid 'squareish' resolutions like 256x240, 240x240, 256x256, etc as those never seem to display games correctly (I actually removed those using Soft15khz). MAME will almost always choose those square resolutions on 'auto'.