Update:
the EMS 4.0 functions is now added, but the function 5Bh (alternate map register set), 5C (prepare EMS HW for warm boot), 5D (enable/disable OS/E Function Set) is not implemented, those mostly are used by OS (e.g. win3.x/win9x) and maybe implemented in the future along with GEMMIS. I only test 2 games, ALADDIN and LEMMING2. MSCDEX /E also tested. here's a list of programs that uses EMS https://www.vogonswiki.com/index.php/List_of_ … hat_require_EMS. I may find another time to test more.
My Thinkpad T540p only have 64K (+4K used by VDPMI) uma available, with USB support on, and LAN option ROM off. So when EMS is enabled, there is no UMB. I have to add more option to make some UMB for some drivers, e.g. DOSKEY and CTMOUSE.
Changes:
1.
/EMS option, default value=0, valid value [0-8]
/EMS equals /EMS=1, which enables EMS with default amount: 4M, /EMS=0 disables EMS, /EMS=[2-8] set amount in MB. EMS4.0 support up to 32M EMS memory but I don't think it's really needed.
2.
/MV option, default value=b000, valid value [b000-b700]. it is a specialized option for Ixxxx-B7FFF. only works when EMS enabled.
this include the monochrome video buffer. enabled by default. set /MV=0 to disable it. or /MV=b600 to include B600-B7FF. I'm considering a Ixxxx-xxxx option like EMM386, but not very sure.
3.
/EMSX option, default value=0, valid value [0-8]
this is similar to /EMS, and also set page frame to be F000, inspired by QEMM386. I don't know how QEMM does it but its idea is good. you only need either /EMS or /EMSX, not both. this option use the BIOS ROM area as page frame so that it saves the 64K for UMB. this option may have bugs, at least as I tested, it's OK for Aladdin and Lemming2.
In short, /EMSX gives you EMS without losing any of the UMB you had.
4.
Fix Lemmings2 startup freeze, not EMS related, but probably FAT32/DOS/BIOS related.
5.
Disable the "VM timing" feature, as it previously has bug and not working as expected, so it just appears OK but after I fixed that bug, the music becomes slow. disabled and may be used in debug mode.
EDIT: 6.
Fix incorrect DPMI client RM stack pointer that corrupts UMB.
Extra notes: with EMS enabled, a VDS might be needed, but as I tested for Lemmings2, without VDS it uses the page-mapped EMS address directly for DMA (while DMA controller require a physical address), I think without VDS it assumes a physical EMS board, not a emulator like EMM386 - and that works with SBEMU by chance - whether to add VDS remains undetermined.
now with /MV enabled by default, and set /EMSX, I have 96K UMB, which gives a relief.
My next plan is to integrate TSF features, after doing some clean ups. There is no exact date when I'm gonna start it yet.
Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD