1
0
mirror of https://github.com/prirun/p50em.git synced 2026-02-12 18:37:18 +00:00

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.
This commit is contained in:
Dennis Boone
2020-05-26 23:42:13 -04:00
parent 43bbf3cd8f
commit 4def8fe397

6
em.c
View File

@@ -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