This commit is contained in:
Mario Fetka
2026-05-23 15:09:50 +02:00
parent ed5da6c063
commit 99c3eed1bf
3 changed files with 177 additions and 1 deletions

45
kern.c
View File

@@ -179,6 +179,51 @@ int KERN_C_CALL Net_Call_F2_C(unsigned int function,
return (int)(ret_ax & 0x00ff);
}
/*
* Fully generic INT 21h register test wrapper.
* Used for reproducing the NWCREQUEST/NWCSHELLREQ register calls seen in
* DeveloperNet 1997 clndos16.lib.
*/
int KERN_C_CALL Net_Call_F2X_C(unsigned int ax,
unsigned int bx,
unsigned int cx,
unsigned int dx,
void *req,
void *repl)
{
union REGS inregs;
union REGS outregs;
struct SREGS segregs;
unsigned int ret_ax;
memset(&inregs, 0, sizeof(inregs));
memset(&outregs, 0, sizeof(outregs));
memset(&segregs, 0, sizeof(segregs));
net_call_c_clear();
inregs.x.ax = ax;
inregs.x.bx = bx;
inregs.x.cx = cx;
inregs.x.dx = dx;
inregs.x.si = FP_OFF(req);
inregs.x.di = FP_OFF(repl);
segregs.ds = FP_SEG(req);
segregs.es = FP_SEG(repl);
net_call_c_save_in(&inregs, &segregs, req, repl);
int86x(0x21, &inregs, &outregs, &segregs);
ret_ax = outregs.x.ax & 0x00ff;
if (ret_ax)
ret_ax |= 0x8900;
net_call_c_save_out(&outregs, ret_ax);
return (int)(ret_ax & 0x00ff);
}
void KERN_C_CALL Net_Call_C_Dump(void)
{
fprintf(stdout, "NETCALLC in : AX=%04X BX=%04X CX=%04X DX=%04X DS:SI=%04X:%04X ES:DI=%04X:%04X\n",