Yes, the author of MIDAS port urged to make such patch.
His response:
----------------------------------------------------------------------
Thanks for your interest in my hack. :) I understand the need for a sound library, actually I even did my own .XM/.MOD player back around 2000 in Free Pascal, when I couldn't get MIDAS working, because I didn't understand C well enough... :D This is why I did this hack at the end - now I had enough knowledge on how to integrate MIDAS and FPC finally, so I just got it running. But it was more-or-less just an experiment which I wanted to do for a long time. We can improve on it if someone like you needs it.
So long story short: the double definition of __crt0_startup_flags I knew about, and I wanted to commit a fix to Free Pascal's GO32v2 support (I have commit rights to the SVN), however, I simply forgot this after I published my MIDAS hack. However, your email now reminded me, and it's now committed in the SVN trunk. I will try to get it merged to the next 3.2.2 release.
You might want to patch v2prt0.as from FPC with this change, and recompile it yourself. You only need GNU AS for that, it should be trivial.
https://github.com/graemeg/freepascal/commit/56c03...5914ec4dce982aec1608a4d5b355360d6ef8c025ce3b99a
With this change in place, you don't even need the extra unit you created, I think, as FPC's startup code will handle MIDAS's request for a locked memory just fine.
About Windows 98 and its DPMI woes - I have no idea. I didn't even use Windows 98 back then (I used OS/2 Warp), let alone these days. :) However, I still see some instability with DOSBox too, which might be related to the problems you see. I don't know. I really only have a DOS PC, and DOSBox. I haven't even tried the code under real DOS yet, only on DOSBox. It's also possible that this problem isn't caused by the lack of memory locking, but somehow the interrupt handler which I hacked together is still broken...? --- DOS-u-akbar! |