INT 21h AH=4Bh (EXEC) on return, put a nonzero value in AX (and AL) for a buggy version of Magic Pockets so the INTRO proceeds to the GAME properly

This commit is contained in:
Jonathan Campbell
2025-10-09 17:48:41 -07:00
parent 3d2f54dfb3
commit 8f15d4da77
2 changed files with 12 additions and 0 deletions

View File

@@ -1,4 +1,9 @@
NEXT VERSION
- INT 21h AH=4Bh EXEC: Real MS-DOS returns a nonzero value like 0x3E01.
A buggy version of Magic Pockets fails to call INT 21 AH=4Dh to read
the INTRO.EXE exit code and expects AL to just be nonzero to continue
to the game. So to make it work properly (kind of), return a nonzero
value. (joncampbell123).
- Tandy machine type: Many registers are WRITE ONLY according to SX
documentation, yet "Troubadours" likes to read/modify/write those
registers in what appears to be hand-rolled manual modesetting code

View File

@@ -2352,6 +2352,13 @@ static Bitu DOS_21Handler(void) {
dos_program_running = false;
*appname=0;
*appargs=0;
/* Magic Pockets (slightly buggy version on the Internet Archive) expects AL
* to be nonzero to continue from INTRO.EXE to the game. The buggy version
* expects AL to be the INTRO.EXE error code but apparently they forgot to
* call INT 21h AH=4Dh to read it. Real MS-DOS appears to return something
* like AX=0x3E01 on return from INT 21h AH=4Bh. There is a non-buggy
* version on various abandonware sites that do not have this bug. */
reg_ax=0x3E01;
break;
case 0x4d: /* Get Return code */
reg_al=dos.return_code;/* Officially read from SDA and clear when read */