Fine. Let's see if this works: add these lines in mame.ini, they will override the d9800 settings.
monitor_specs0 15250-15900, 40-80, 2.187, 4.688, 6.719, 0.190, 0.191, 1.018, 0, 0, 248, 448
monitor_specs1 18001-19000, 40-80, 2.187, 4.688, 6.719, 0.140, 0.191, 0.950, 0, 0, 320, 448
monitor_specs2 20001-29000, 40-80, 2.910, 3.000, 4.440, 0.451, 0.164, 1.048, 0, 0, 384, 576
monitor_specs3 29001-32000, 40-80, 0.636, 3.813, 1.906, 0.318, 0.064, 1.048, 0, 0, 576, 768
monitor_specs4 32001-34000, 40-80, 0.636, 3.813, 1.906, 0.020, 0.106, 0.607, 0, 0, 576, 768
monitor_specs5 34001-38000, 40-80, 1.000, 3.200, 2.200, 0.020, 0.106, 0.607, 0, 0, 600, 768
Notice that they're still the same specs but for the first line. I want to force everything above 248 lines to jump to the monitor_specs1 range. Try mk, loht, 1942, etc. and let me know if it works.