I don't know how to say it without being an ass... but I really don't care about this whole nearptr bullshit trying to run in windows dos boxes. It's a mess and I already discussed this recently with Taniwha who used to be a fairly prolific DJGPP developer back in it's hey-day. He said the biggest issues I'm going to run into is that the conventional_base shifts around even between malloc and friends in Windows so you would have to wrap around all of it and years ago we tried this with QDOS and it was too much to do and we ended up leaving it be.
You're probably never going to get it to work properly in NTVDM or Win9x DOS BOX because of the real2ptr address constantly moving around. A large overhaul of the code and all it's libraries is probably necessary to convert everything to work properly. Another option might be Watcom, but again everything has to be converted over for this. I'm 100% not interested and I'm not interested in seeing snippets of code unless it's something that works and is ready to merge for such a project like this.
I know you're pretty hell-bent on trying to get this to work, but this entire project is intended for people with actual DOS computers with Sound Blasters and Gravis UltraSounds (GUS preferred 😉). Being able to play it properly in DOSBox, QEMU, (insert favourite VM/Emulator here) is just a nice side-effect. If you want to play the game with all it's extra enhacements (and I've personally spent wayyyy too much time on adding them all in and sezero has spent a massive amount of time auditing all of my changes to catch any potential creeper bugs) then compile it in Visual Studio 6. It can probably be upgraded to compile on modern Visual Studio considering the code compiles just fine in GCC 4.84 if this is an issue for you.
Not only will you get to experience it in Windows, properly, but on modern computers it actually runs faster in Windows than it does in DOS. On my older DOS computers it is the other way around.
...That being said. I can give you potential clues if you really must keep playing with it. That endtime change is a good catch and may be why s_mixahead actually works properly in Q2 (in Quake 1 it basically doesn't work at values past 0.4 and this can be a semi-hacky way to play 44100 on a slow computer at the expense of the sounds obviously being delayed by half a second). The crash is happening at the memset after the real2ptr for grabbing the DMA address. You can also try building a null video build and see if it still crashes at the memset. You're going to have to eliminate things one by one until you can actually get sound working in a Windows dos box. This is how I would do it. A good utility in Windows for comparing Q1 to Q2 files is BeyondCompare. There's a freeware alternative out there but I forget it's name.
Other side notes is that I have already tried compiling with DJ 2.03 with GCC 2.95 with OGG removed and all those friends (except WATT32) and still had the problem.
Inlining the vector math functions is probably worth it, but I haven't gotten around to it yet.
If you ever make it work, then I'll be glad to see the entire code project (no DIFFs, please). But please, no more discussion of it. To me it is senseless and everyone working on the project feels the same way.