From 4def8fe397ae7804ce4a843622d1d0dd128425ba Mon Sep 17 00:00:00 2001 From: Dennis Boone Date: Tue, 26 May 2020 23:42:13 -0400 Subject: [PATCH] Support for booting DOS pre-Rev20 PRIMOS2 was built to be relocated after being loaded by BOOT. The build process rewrote the RVEC in the save file. The SA was anded with :160000; the result was subtracted from SA and EA in the RVEC, and stored into RA in the RVEC. The BOOT program knew to add the RA value during the load process. This change causes the emulator to recognize such an RVEC when booting an R-mode executable from unix disk, and to adjust the RVEC before actually loading the program. This fixes failure to boot *DOS64 from 19.2.9, for example. The code only makes this adjustment if RA is non-zero, and RP is not between SA and EA. --- em.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/em.c b/em.c index e971eae..10a0b14 100644 --- a/em.c +++ b/em.c @@ -4770,6 +4770,12 @@ int main (int argc, char **argv) { for (i=0; i<9; i++) rvec[i] = swap16(rvec[i]); + if (rvec[3] != 0) { + if (rvec[2] > rvec[1]) { + rvec[0] += rvec[3]; + rvec[1] += rvec[3]; + } + } } else { /* If no filename follows -boot, then the sense switches are used to