link fix tools for openwatcom

This commit is contained in:
Mario Fetka
2026-05-22 12:02:43 +02:00
parent 6d005a1713
commit fa27fe4213
2 changed files with 52 additions and 23 deletions

View File

@@ -14,14 +14,14 @@ enterIPX dd 0
.code
public _IPXinit
public _IPXopen_socket
public _IPXclose_socket
public _IPXlisten
public _xmemmove
public _Net_Call
public IPXinit_
public IPXopen_socket_
public IPXclose_socket_
public IPXlisten_
public xmemmove_
public Net_Call_
_IPXinit proc far
IPXinit_ proc far
push bp
mov bp, sp
push ds
@@ -48,9 +48,9 @@ ipxinit_done:
pop ds
pop bp
ret
_IPXinit endp
IPXinit_ endp
_xmemmove proc far
xmemmove_ proc far
push bp
mov bp, sp
@@ -74,8 +74,8 @@ _xmemmove proc far
push di
pushf
lds si, fword ptr [bp+10]
les di, fword ptr [bp+6]
lds si, dword ptr [bp+10]
les di, dword ptr [bp+6]
cmp di, si
jl xmem_forward
@@ -101,9 +101,9 @@ xmem_done:
pop bp
sti
ret
_xmemmove endp
xmemmove_ endp
_IPXopen_socket proc far
IPXopen_socket_ proc far
push bp
mov bp, sp
push ds
@@ -138,9 +138,9 @@ ipxopen_done:
pop ds
pop bp
ret
_IPXopen_socket endp
IPXopen_socket_ endp
_IPXclose_socket proc far
IPXclose_socket_ proc far
push bp
mov bp, sp
push ds
@@ -159,9 +159,9 @@ _IPXclose_socket proc far
pop ds
pop bp
ret
_IPXclose_socket endp
IPXclose_socket_ endp
_IPXlisten proc far
IPXlisten_ proc far
push bp
mov bp, sp
push ds
@@ -169,7 +169,7 @@ _IPXlisten proc far
push di
; int IPXlisten(ECB *ecb)
les si, fword ptr [bp+6]
les si, dword ptr [bp+6]
mov bx, @data
mov ds, bx
mov bx, 4
@@ -181,9 +181,9 @@ _IPXlisten proc far
pop bp
mov ah, 0
ret
_IPXlisten endp
IPXlisten_ endp
_Net_Call proc far
Net_Call_ proc far
push bp
mov bp, sp
@@ -200,8 +200,8 @@ _Net_Call proc far
push di
pushf
lds si, fword ptr [bp+8]
les di, fword ptr [bp+12]
lds si, dword ptr [bp+8]
les di, dword ptr [bp+12]
int 21h
popf
@@ -211,6 +211,6 @@ _Net_Call proc far
pop bp
mov ah, 0
ret
_Net_Call endp
Net_Call_ endp
end

29
tools.c Executable file → Normal file
View File

@@ -5,6 +5,35 @@
* (C)opyright (C) 1993,1996 Martin Stover, Marburg, Germany *
****************************************************************/
#ifdef __WATCOMC__
/*
* Borland C compatibility wrappers used by the historical mars-nwe DOS tools.
* Open Watcom does not provide getcurdir()/setdisk() under these Borland names.
*/
int getcurdir(int drive, char *directory)
{
REGS regs;
SREGS sregs;
regs.h.ah = 0x47; /* DOS: get current directory */
regs.h.dl = (unsigned char)drive; /* 0=current, 1=A:, 2=B:, ... */
sregs.ds = FP_SEG(directory);
regs.x.si = FP_OFF(directory);
intdosx(&regs, &regs, &sregs);
return(regs.x.cflag ? -1 : 0);
}
void setdisk(int drive)
{
REGS regs;
regs.h.ah = 0x0e; /* DOS: select default drive */
regs.h.dl = (unsigned char)drive; /* 0=A:, 1=B:, ... */
intdos(&regs, &regs);
}
#endif
int key_pressed(void)
{
#ifdef __WATCOMC__