diff options
author | Daniel Serpell <daniel.serpell@gmail.com> | 2020-05-23 13:08:44 -0400 |
---|---|---|
committer | Daniel Serpell <daniel.serpell@gmail.com> | 2020-05-23 13:08:44 -0400 |
commit | 81acc54ca0b9776b86fc689a40dc9a358ec73730 (patch) | |
tree | 3b5420351654e6651a639647b6dd6ae0c441f06e | |
parent | a230bbfad28e854cf35f9df54aeb183ce8187173 (diff) | |
download | emu2-81acc54ca0b9776b86fc689a40dc9a358ec73730.tar.gz |
Adds environment variable to limit available DOS memory.
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | src/dbg.c | 5 | ||||
-rw-r--r-- | src/dos.c | 7 | ||||
-rw-r--r-- | src/env.h | 1 |
4 files changed, 16 insertions, 3 deletions
@@ -55,6 +55,12 @@ The available environment variables are: output, but does not change the DOS NLS information. The default code-page is CP437. +- `EMU2_LOWMEM` Limits main memory to 512KB, this fixes some old DOS + programs with a bug that checks available memory using + "signed" comparison insructions (JLE instead of JBE). + This is needed at least for MASM versions 1.0 and 1.10. + + Simple Example -------------- @@ -29,9 +29,10 @@ void print_usage(void) " %-18s DOS current working directory, use 'C:\\' if not given.\n" " %-18s Set unix path as root of drive 'n', by default all drives\n" "\t\t point to the unix working directory.\n" - ". %-18s Set DOS code-page. Set to '?' to show lost of code-pages.\n", + ". %-18s Set DOS code-page. Set to '?' to show lost of code-pages.\n" + ". %-18s Limit DOS memory to 512KB, fixes some old buggy programs.\n", prog_name, ENV_DBG_NAME, ENV_DBG_OPT, ENV_PROGNAME, ENV_DEF_DRIVE, ENV_CWD, - ENV_DRIVE "n", ENV_CODEPAGE); + ENV_DRIVE "n", ENV_CODEPAGE, ENV_LOWMEM); exit(EXIT_SUCCESS); } @@ -2052,7 +2052,12 @@ void init_dos(int argc, char **argv) // Init memory handling - available start address at 0x800, // ending address at 0xA0000. - mcb_init(0x80, 0xA000); + // We limit here memory to less than 512K to fix some old programs + // that check memori using "JLE" instead of "JBE". + if(getenv(ENV_LOWMEM)) + mcb_init(0x80, 0x7FFF); + else + mcb_init(0x80, 0xA000); // Init SYSVARS dos_sysvars = get_static_memory(128, 0); @@ -8,3 +8,4 @@ #define ENV_CWD "EMU2_CWD" #define ENV_DRIVE "EMU2_DRIVE_" #define ENV_CODEPAGE "EMU2_CODEPAGE" +#define ENV_LOWMEM "EMU2_LOWMEM" |