Initial commit of Command & Conquer Red Alert source code.
This commit is contained in:
145
IPX/FIXTHUNK.CPP
Normal file
145
IPX/FIXTHUNK.CPP
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
unsigned char thunk_file[1000000];
|
||||
unsigned char thunk_file_out[100050];
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* Search_For_String -- search for a string of chars within a buffer *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
* INPUT: string *
|
||||
* ptr to buffer to search in *
|
||||
* length of buffer *
|
||||
* *
|
||||
* OUTPUT: ptr to string in buffer or NULL if not found *
|
||||
* *
|
||||
* WARNINGS: None *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 11/20/95 5:42PM ST : Created *
|
||||
*=============================================================================================*/
|
||||
|
||||
char *Search_For_String (char *string , char *buffer_ptr , int buffer_length)
|
||||
{
|
||||
int j;
|
||||
int string_length=strlen(string);
|
||||
|
||||
for (int i=0 ; i<buffer_length-string_length ; i++){
|
||||
|
||||
for (j=0 ; j<string_length ; j++){
|
||||
if ( *(string+j) != *(buffer_ptr+i+j)) break;
|
||||
}
|
||||
if (j==string_length) return buffer_ptr+i;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int handle;
|
||||
char find_string[]={";************************ START OF THUNK BODIES************************"};
|
||||
char find_other_string[]={"public _IPX_Initialise@4"};
|
||||
|
||||
char insert_string1[]={"\n\r;\n\r"};
|
||||
char insert_string2[]={";For some reason, inserting these lines makes it assemble correctly\n\r"};
|
||||
char insert_string3[]={";\n\r"};
|
||||
char insert_string4[]={"Externdef IPX_Initialise:near\n\r"};
|
||||
char insert_string5[]={"IPX_Initialise label near\n\r\n\r"};
|
||||
|
||||
unsigned char *pointer;
|
||||
unsigned char *pointer2;
|
||||
int copy_length;
|
||||
int file_length;
|
||||
|
||||
handle = open ("thipx.asm", O_RDONLY | O_BINARY);
|
||||
|
||||
if (handle==-1)return (1);
|
||||
|
||||
file_length = filelength(handle);
|
||||
|
||||
if (read (handle, thunk_file, file_length) != file_length){
|
||||
close (handle);
|
||||
return (1);
|
||||
}
|
||||
|
||||
close (handle);
|
||||
|
||||
pointer = (unsigned char*)Search_For_String(find_string, (char*)thunk_file, file_length);
|
||||
|
||||
if (pointer){
|
||||
|
||||
pointer += strlen(find_string);
|
||||
|
||||
copy_length = (int)( (int)pointer - (int)&thunk_file[0]);
|
||||
|
||||
memcpy (thunk_file_out, thunk_file, copy_length);
|
||||
|
||||
sprintf ((char*)&thunk_file_out[copy_length], "%s%s%s%s%s", insert_string1,
|
||||
insert_string2,
|
||||
insert_string3,
|
||||
insert_string4,
|
||||
insert_string5);
|
||||
|
||||
|
||||
pointer2 = (unsigned char*)Search_For_String(find_other_string, (char*)pointer, file_length);
|
||||
if (!pointer2) return (1);
|
||||
pointer2 += strlen(find_other_string);
|
||||
|
||||
memcpy (&thunk_file_out [copy_length+ strlen(insert_string1)
|
||||
+ strlen(insert_string2)
|
||||
+ strlen(insert_string3)
|
||||
+ strlen(insert_string4)
|
||||
+ strlen(insert_string5)],
|
||||
pointer2,
|
||||
file_length-((int)pointer2-(int)&thunk_file[0]));
|
||||
|
||||
|
||||
handle = open ("thipx.asm", O_WRONLY | O_BINARY | O_TRUNC);
|
||||
|
||||
if (handle == -1) return (1);
|
||||
|
||||
write (handle, thunk_file_out, file_length+ strlen(insert_string1)
|
||||
+ strlen(insert_string2)
|
||||
+ strlen(insert_string3)
|
||||
+ strlen(insert_string4)
|
||||
+ strlen(insert_string5));
|
||||
|
||||
close (handle);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
2
IPX/IPX.RC
Normal file
2
IPX/IPX.RC
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
|
62
IPX/IPX16.ASM
Normal file
62
IPX/IPX16.ASM
Normal file
@@ -0,0 +1,62 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
|
||||
|
||||
IDEAL
|
||||
P386N
|
||||
LOCALS ??
|
||||
|
||||
|
||||
|
||||
segment realcode para public USE16 'code'
|
||||
|
||||
|
||||
global PASCAL ASM_IPX_INITIALISE:far
|
||||
global PASCAL ASM_IPX_UNINITIALISE:far
|
||||
|
||||
|
||||
proc ASM_IPX_INITIALISE PASCAL FAR
|
||||
|
||||
int 3
|
||||
mov ax,7a00h
|
||||
int 2fh
|
||||
and eax,0ffh
|
||||
cmp al,-1
|
||||
setz al
|
||||
ret
|
||||
|
||||
endp ASM_IPX_INITIALISE
|
||||
|
||||
|
||||
|
||||
|
||||
proc ASM_IPX_UNINITIALISE PASCAL FAR
|
||||
|
||||
ret
|
||||
|
||||
endp ASM_IPX_UNINITIALISE
|
||||
|
||||
|
||||
|
||||
ends
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
13
IPX/IPX16.BAK
Normal file
13
IPX/IPX16.BAK
Normal file
@@ -0,0 +1,13 @@
|
||||
system windows_dll
|
||||
option redefsok
|
||||
option quiet
|
||||
option map
|
||||
option eliminate
|
||||
option caseexact
|
||||
option one
|
||||
|
||||
debug all
|
||||
file ipx16a.obj
|
||||
file ipx16c.obj
|
||||
|
||||
name wwipx16.dll
|
25
IPX/IPX16.H
Normal file
25
IPX/IPX16.H
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
extern "C"{
|
||||
BOOL FAR __cdecl IPX_Initialise(int);
|
||||
}
|
||||
|
||||
|
1472
IPX/IPX16A.ASM
Normal file
1472
IPX/IPX16A.ASM
Normal file
File diff suppressed because it is too large
Load Diff
62
IPX/IPX16C.CPP
Normal file
62
IPX/IPX16C.CPP
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
extern "C"{
|
||||
extern BOOL FAR __pascal ASM_IPX_Initialise(void);
|
||||
extern BOOL FAR __pascal ASM_IPX_Uninitialise(void);
|
||||
}
|
||||
|
||||
|
||||
extern "C"{
|
||||
BOOL FAR __pascal _export IPX_Initialise(int);
|
||||
void FAR __pascal _export IPX_Uninitialise(void);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int CALLBACK LibMain (HANDLE, WORD, WORD, LPSTR)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL FAR __pascal _export IPX_Initialise(int)
|
||||
{
|
||||
|
||||
return (ASM_IPX_Initialise());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FAR __pascal _export IPX_Uninitialise(void)
|
||||
{
|
||||
|
||||
ASM_IPX_Uninitialise();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
37
IPX/IPXTEST.CPP
Normal file
37
IPX/IPXTEST.CPP
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define WIN32
|
||||
#ifndef _WIN32 // Denzil 6/2/98 Watcom 11.0 complains without this check
|
||||
#define _WIN32
|
||||
#endif // _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
|
||||
int PASCAL WinMain ( HINSTANCE instance , HINSTANCE , char *, int)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
8
IPX/MAKE.BAK
Normal file
8
IPX/MAKE.BAK
Normal file
@@ -0,0 +1,8 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
wpp -ml -bd -zu -bt=windows -0 ipx16c.cpp
|
||||
tasm /ml ipx16a.asm
|
||||
wlink @ipx16.lnk
|
||||
wlib -c -n wwipx16.lib +wwipx16.dll
|
||||
call setinc2.bat
|
8
IPX/MAKE.BAT
Normal file
8
IPX/MAKE.BAT
Normal file
@@ -0,0 +1,8 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
wpp -s -ml -bd -zu -bt=windows -0 ipx16c.cpp
|
||||
tasm /ml ipx16a.asm
|
||||
wlink @ipx16.lnk
|
||||
wlib -c -n wwipx16.lib +wwipx16.dll
|
||||
call setinc2.bat
|
32
IPX/MAKEFILE
Normal file
32
IPX/MAKEFILE
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Command & Conquer Red Alert(tm)
|
||||
# Copyright 2025 Electronic Arts Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
.nocheck
|
||||
|
||||
ALL: thipx32.dll &
|
||||
thipx16.dll
|
||||
|
||||
thipx32.dll: thipx.thk thipx32c.cpp thmap32.asm thipx32.lnk
|
||||
maketh32
|
||||
|
||||
thipx16.dll: thipx.thk thipx16a.asm thipx16c.cpp thmap16.asm thipx16.lnk
|
||||
maketh16
|
||||
|
||||
|
||||
|
||||
|
12
IPX/MAKETH16.BAK
Normal file
12
IPX/MAKETH16.BAK
Normal file
@@ -0,0 +1,12 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
thunk Thipx.thk
|
||||
wpp -ml -bd -zu -bt=windows -0 thipx16c.cpp
|
||||
ml /c /W3 ipx16a.asm
|
||||
ml /DIS_16 /c /W3 /Fothipx16a.obj thipx.asm
|
||||
ml /c /W3 thmap16.asm
|
||||
ml /c /W3 ipx16a.asm
|
||||
wlink @thipx16.lnk
|
||||
rc -40 thipx16.dll
|
||||
call setinc2.bat
|
11
IPX/MAKETH16.BAT
Normal file
11
IPX/MAKETH16.BAT
Normal file
@@ -0,0 +1,11 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
thunk Thipx.thk
|
||||
wpp -ml -bd -zu -bt=windows -0 thipx16c.cpp
|
||||
ml /c /W3 ipx16a.asm
|
||||
ml /DIS_16 /c /W3 /Fothipx16a.obj thipx.asm
|
||||
ml /c /W3 thmap16.asm
|
||||
wlink @thipx16.lnk
|
||||
rc -40 thipx16.dll
|
||||
call setinc2.bat
|
7
IPX/MAKETH32.BAK
Normal file
7
IPX/MAKETH32.BAK
Normal file
@@ -0,0 +1,7 @@
|
||||
rem thunk Thipx.thk
|
||||
rem fixthunk
|
||||
wpp386 -s -mf -3s -bt=nt -bd -zu -4 thipx32c.cpp
|
||||
ml /DIS_32 /Zf /Fl /c /W3 /Fothipx32a.obj thipx.asm
|
||||
ml /c /W3 thmap32.asm
|
||||
wlink @thipx32.lnk
|
||||
wlib -c -n wwipx32.lib +thipx32.dll
|
7
IPX/MAKETH32.BAT
Normal file
7
IPX/MAKETH32.BAT
Normal file
@@ -0,0 +1,7 @@
|
||||
thunk Thipx.thk
|
||||
rem fixthunk
|
||||
wpp386 -s -mf -3s -bt=nt -bd -zu -4 thipx32c.cpp
|
||||
ml /DIS_32 /Zf /Fl /c /W3 /Fothipx32a.obj thipx.asm
|
||||
ml /c /W3 thmap32.asm
|
||||
wlink @thipx32.lnk
|
||||
wlib -c -n wwipx32.lib +thipx32.dll
|
145
IPX/OK/FIXTHUNK.CPP
Normal file
145
IPX/OK/FIXTHUNK.CPP
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
unsigned char thunk_file[1000000];
|
||||
unsigned char thunk_file_out[100050];
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* Search_For_String -- search for a string of chars within a buffer *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
* INPUT: string *
|
||||
* ptr to buffer to search in *
|
||||
* length of buffer *
|
||||
* *
|
||||
* OUTPUT: ptr to string in buffer or NULL if not found *
|
||||
* *
|
||||
* WARNINGS: None *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 11/20/95 5:42PM ST : Created *
|
||||
*=============================================================================================*/
|
||||
|
||||
char *Search_For_String (char *string , char *buffer_ptr , int buffer_length)
|
||||
{
|
||||
int j;
|
||||
int string_length=strlen(string);
|
||||
|
||||
for (int i=0 ; i<buffer_length-string_length ; i++){
|
||||
|
||||
for (j=0 ; j<string_length ; j++){
|
||||
if ( *(string+j) != *(buffer_ptr+i+j)) break;
|
||||
}
|
||||
if (j==string_length) return buffer_ptr+i;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int handle;
|
||||
char find_string[]={";************************ START OF THUNK BODIES************************"};
|
||||
char find_other_string[]={"public _IPX_Initialise@4"};
|
||||
|
||||
char insert_string1[]={"\n\r;\n\r"};
|
||||
char insert_string2[]={";For some reason, inserting these lines makes it assemble correctly\n\r"};
|
||||
char insert_string3[]={";\n\r"};
|
||||
char insert_string4[]={"Externdef IPX_Initialise:near\n\r"};
|
||||
char insert_string5[]={"IPX_Initialise label near\n\r\n\r"};
|
||||
|
||||
unsigned char *pointer;
|
||||
unsigned char *pointer2;
|
||||
int copy_length;
|
||||
int file_length;
|
||||
|
||||
handle = open ("thipx.asm", O_RDONLY | O_BINARY);
|
||||
|
||||
if (handle==-1)return (1);
|
||||
|
||||
file_length = filelength(handle);
|
||||
|
||||
if (read (handle, thunk_file, file_length) != file_length){
|
||||
close (handle);
|
||||
return (1);
|
||||
}
|
||||
|
||||
close (handle);
|
||||
|
||||
pointer = (unsigned char*)Search_For_String(find_string, (char*)thunk_file, file_length);
|
||||
|
||||
if (pointer){
|
||||
|
||||
pointer += strlen(find_string);
|
||||
|
||||
copy_length = (int)( (int)pointer - (int)&thunk_file[0]);
|
||||
|
||||
memcpy (thunk_file_out, thunk_file, copy_length);
|
||||
|
||||
sprintf ((char*)&thunk_file_out[copy_length], "%s%s%s%s%s", insert_string1,
|
||||
insert_string2,
|
||||
insert_string3,
|
||||
insert_string4,
|
||||
insert_string5);
|
||||
|
||||
|
||||
pointer2 = (unsigned char*)Search_For_String(find_other_string, (char*)pointer, file_length);
|
||||
if (!pointer2) return (1);
|
||||
pointer2 += strlen(find_other_string);
|
||||
|
||||
memcpy (&thunk_file_out [copy_length+ strlen(insert_string1)
|
||||
+ strlen(insert_string2)
|
||||
+ strlen(insert_string3)
|
||||
+ strlen(insert_string4)
|
||||
+ strlen(insert_string5)],
|
||||
pointer2,
|
||||
file_length-((int)pointer2-(int)&thunk_file[0]));
|
||||
|
||||
|
||||
handle = open ("thipx.asm", O_WRONLY | O_BINARY | O_TRUNC);
|
||||
|
||||
if (handle == -1) return (1);
|
||||
|
||||
write (handle, thunk_file_out, file_length+ strlen(insert_string1)
|
||||
+ strlen(insert_string2)
|
||||
+ strlen(insert_string3)
|
||||
+ strlen(insert_string4)
|
||||
+ strlen(insert_string5));
|
||||
|
||||
close (handle);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
2
IPX/OK/IPX.RC
Normal file
2
IPX/OK/IPX.RC
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
|
62
IPX/OK/IPX16.ASM
Normal file
62
IPX/OK/IPX16.ASM
Normal file
@@ -0,0 +1,62 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
|
||||
|
||||
IDEAL
|
||||
P386N
|
||||
LOCALS ??
|
||||
|
||||
|
||||
|
||||
segment realcode para public USE16 'code'
|
||||
|
||||
|
||||
global PASCAL ASM_IPX_INITIALISE:far
|
||||
global PASCAL ASM_IPX_UNINITIALISE:far
|
||||
|
||||
|
||||
proc ASM_IPX_INITIALISE PASCAL FAR
|
||||
|
||||
int 3
|
||||
mov ax,7a00h
|
||||
int 2fh
|
||||
and eax,0ffh
|
||||
cmp al,-1
|
||||
setz al
|
||||
ret
|
||||
|
||||
endp ASM_IPX_INITIALISE
|
||||
|
||||
|
||||
|
||||
|
||||
proc ASM_IPX_UNINITIALISE PASCAL FAR
|
||||
|
||||
ret
|
||||
|
||||
endp ASM_IPX_UNINITIALISE
|
||||
|
||||
|
||||
|
||||
ends
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
13
IPX/OK/IPX16.BAK
Normal file
13
IPX/OK/IPX16.BAK
Normal file
@@ -0,0 +1,13 @@
|
||||
system windows_dll
|
||||
option redefsok
|
||||
option quiet
|
||||
option map
|
||||
option eliminate
|
||||
option caseexact
|
||||
option one
|
||||
|
||||
debug all
|
||||
file ipx16a.obj
|
||||
file ipx16c.obj
|
||||
|
||||
name wwipx16.dll
|
25
IPX/OK/IPX16.H
Normal file
25
IPX/OK/IPX16.H
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
extern "C"{
|
||||
BOOL FAR __cdecl IPX_Initialise(int);
|
||||
}
|
||||
|
||||
|
1450
IPX/OK/IPX16A.ASM
Normal file
1450
IPX/OK/IPX16A.ASM
Normal file
File diff suppressed because it is too large
Load Diff
62
IPX/OK/IPX16C.CPP
Normal file
62
IPX/OK/IPX16C.CPP
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
extern "C"{
|
||||
extern BOOL FAR __pascal ASM_IPX_Initialise(void);
|
||||
extern BOOL FAR __pascal ASM_IPX_Uninitialise(void);
|
||||
}
|
||||
|
||||
|
||||
extern "C"{
|
||||
BOOL FAR __pascal _export IPX_Initialise(int);
|
||||
void FAR __pascal _export IPX_Uninitialise(void);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int CALLBACK LibMain (HANDLE, WORD, WORD, LPSTR)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL FAR __pascal _export IPX_Initialise(int)
|
||||
{
|
||||
|
||||
return (ASM_IPX_Initialise());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FAR __pascal _export IPX_Uninitialise(void)
|
||||
{
|
||||
|
||||
ASM_IPX_Uninitialise();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
37
IPX/OK/IPXTEST.CPP
Normal file
37
IPX/OK/IPXTEST.CPP
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#define WIN32
|
||||
#ifndef _WIN32 // Denzil 6/2/98 Watcom 11.0 complains without this check
|
||||
#define _WIN32
|
||||
#endif // _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
|
||||
int PASCAL WinMain ( HINSTANCE instance , HINSTANCE , char *, int)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
8
IPX/OK/MAKE.BAK
Normal file
8
IPX/OK/MAKE.BAK
Normal file
@@ -0,0 +1,8 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
wpp -ml -bd -zu -bt=windows -0 ipx16c.cpp
|
||||
tasm /ml ipx16a.asm
|
||||
wlink @ipx16.lnk
|
||||
wlib -c -n wwipx16.lib +wwipx16.dll
|
||||
call setinc2.bat
|
8
IPX/OK/MAKE.BAT
Normal file
8
IPX/OK/MAKE.BAT
Normal file
@@ -0,0 +1,8 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
wpp -s -ml -bd -zu -bt=windows -0 ipx16c.cpp
|
||||
tasm /ml ipx16a.asm
|
||||
wlink @ipx16.lnk
|
||||
wlib -c -n wwipx16.lib +wwipx16.dll
|
||||
call setinc2.bat
|
12
IPX/OK/MAKETH16.BAK
Normal file
12
IPX/OK/MAKETH16.BAK
Normal file
@@ -0,0 +1,12 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
thunk Thipx.thk
|
||||
wpp -ml -bd -zu -bt=windows -0 thipx16c.cpp
|
||||
ml /c /W3 ipx16a.asm
|
||||
ml /DIS_16 /c /W3 /Fothipx16a.obj thipx.asm
|
||||
ml /c /W3 thmap16.asm
|
||||
ml /c /W3 ipx16a.asm
|
||||
wlink @thipx16.lnk
|
||||
rc -40 thipx16.dll
|
||||
call setinc2.bat
|
11
IPX/OK/MAKETH16.BAT
Normal file
11
IPX/OK/MAKETH16.BAT
Normal file
@@ -0,0 +1,11 @@
|
||||
set include >temp.txt
|
||||
set include=c:\wat\h;c:\wat\h\win
|
||||
copy setinc.bat+temp.txt setinc2.bat
|
||||
thunk Thipx.thk
|
||||
wpp -ml -bd -zu -bt=windows -0 thipx16c.cpp
|
||||
ml /c /W3 ipx16a.asm
|
||||
ml /DIS_16 /c /W3 /Fothipx16a.obj thipx.asm
|
||||
ml /c /W3 thmap16.asm
|
||||
wlink @thipx16.lnk
|
||||
rc -40 thipx16.dll
|
||||
call setinc2.bat
|
7
IPX/OK/MAKETH32.BAK
Normal file
7
IPX/OK/MAKETH32.BAK
Normal file
@@ -0,0 +1,7 @@
|
||||
rem thunk Thipx.thk
|
||||
rem fixthunk
|
||||
wpp386 -s -mf -3s -bt=nt -bd -zu -4 thipx32c.cpp
|
||||
ml /DIS_32 /Zf /Fl /c /W3 /Fothipx32a.obj thipx.asm
|
||||
ml /c /W3 thmap32.asm
|
||||
wlink @thipx32.lnk
|
||||
wlib -c -n wwipx32.lib +thipx32.dll
|
7
IPX/OK/MAKETH32.BAT
Normal file
7
IPX/OK/MAKETH32.BAT
Normal file
@@ -0,0 +1,7 @@
|
||||
thunk Thipx.thk
|
||||
rem fixthunk
|
||||
wpp386 -s -mf -3s -bt=nt -bd -zu -4 thipx32c.cpp
|
||||
ml /DIS_32 /Zf /Fl /c /W3 /Fothipx32a.obj thipx.asm
|
||||
ml /c /W3 thmap32.asm
|
||||
wlink @thipx32.lnk
|
||||
wlib -c -n wwipx32.lib +thipx32.dll
|
BIN
IPX/OK/OLTHIPX.ASM
Normal file
BIN
IPX/OK/OLTHIPX.ASM
Normal file
Binary file not shown.
1091
IPX/OK/PCMACRO.16
Normal file
1091
IPX/OK/PCMACRO.16
Normal file
File diff suppressed because it is too large
Load Diff
503
IPX/OK/THIPX.ASM
Normal file
503
IPX/OK/THIPX.ASM
Normal file
@@ -0,0 +1,503 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
page ,132
|
||||
|
||||
;Thunk Compiler Version 1.8 May 11 1995 13:16:19
|
||||
;File Compiled Fri Jan 26 16:12:04 1996
|
||||
|
||||
;Command Line: C:\BIN\THUNK.EXE Thipx.thk
|
||||
|
||||
TITLE $Thipx.asm
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
IFNDEF IS_16
|
||||
IFNDEF IS_32
|
||||
%out command line error: specify one of -DIS_16, -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_32
|
||||
ENDIF ;IS_16
|
||||
|
||||
|
||||
IFDEF IS_32
|
||||
IFDEF IS_16
|
||||
%out command line error: you can't specify both -DIS_16 and -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_16
|
||||
;************************* START OF 32-BIT CODE *************************
|
||||
|
||||
|
||||
.model FLAT,STDCALL
|
||||
|
||||
|
||||
;-- Import common flat thunk routines (in k32)
|
||||
|
||||
externDef MapHInstLS :near32
|
||||
externDef MapHInstLS_PN :near32
|
||||
externDef MapHInstSL :near32
|
||||
externDef MapHInstSL_PN :near32
|
||||
externDef FT_Prolog :near32
|
||||
externDef FT_Thunk :near32
|
||||
externDef QT_Thunk :near32
|
||||
externDef FT_Exit0 :near32
|
||||
externDef FT_Exit4 :near32
|
||||
externDef FT_Exit8 :near32
|
||||
externDef FT_Exit12 :near32
|
||||
externDef FT_Exit16 :near32
|
||||
externDef FT_Exit20 :near32
|
||||
externDef FT_Exit24 :near32
|
||||
externDef FT_Exit28 :near32
|
||||
externDef FT_Exit32 :near32
|
||||
externDef FT_Exit36 :near32
|
||||
externDef FT_Exit40 :near32
|
||||
externDef FT_Exit44 :near32
|
||||
externDef FT_Exit48 :near32
|
||||
externDef FT_Exit52 :near32
|
||||
externDef FT_Exit56 :near32
|
||||
externDef SMapLS :near32
|
||||
externDef SUnMapLS :near32
|
||||
externDef SMapLS_IP_EBP_8 :near32
|
||||
externDef SUnMapLS_IP_EBP_8 :near32
|
||||
externDef SMapLS_IP_EBP_12 :near32
|
||||
externDef SUnMapLS_IP_EBP_12 :near32
|
||||
externDef SMapLS_IP_EBP_16 :near32
|
||||
externDef SUnMapLS_IP_EBP_16 :near32
|
||||
externDef SMapLS_IP_EBP_20 :near32
|
||||
externDef SUnMapLS_IP_EBP_20 :near32
|
||||
externDef SMapLS_IP_EBP_24 :near32
|
||||
externDef SUnMapLS_IP_EBP_24 :near32
|
||||
externDef SMapLS_IP_EBP_28 :near32
|
||||
externDef SUnMapLS_IP_EBP_28 :near32
|
||||
externDef SMapLS_IP_EBP_32 :near32
|
||||
externDef SUnMapLS_IP_EBP_32 :near32
|
||||
externDef SMapLS_IP_EBP_36 :near32
|
||||
externDef SUnMapLS_IP_EBP_36 :near32
|
||||
externDef SMapLS_IP_EBP_40 :near32
|
||||
externDef SUnMapLS_IP_EBP_40 :near32
|
||||
|
||||
MapSL PROTO NEAR STDCALL p32:DWORD
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
;************************* COMMON PER-MODULE ROUTINES *************************
|
||||
|
||||
.data
|
||||
|
||||
public Thipx_ThunkData32 ;This symbol must be exported.
|
||||
Thipx_ThunkData32 label dword
|
||||
dd 3130534ch ;Protocol 'LS01'
|
||||
dd 0228d3h ;Checksum
|
||||
dd 0 ;Jump table address.
|
||||
dd 3130424ch ;'LB01'
|
||||
dd 0 ;Flags
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd offset QT_Thunk_Thipx - offset Thipx_ThunkData32
|
||||
dd offset FT_Prolog_Thipx - offset Thipx_ThunkData32
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect32@24:near32
|
||||
|
||||
public Thipx_ThunkConnect32@16
|
||||
Thipx_ThunkConnect32@16:
|
||||
pop edx
|
||||
push offset Thipx_ThkData16
|
||||
push offset Thipx_ThunkData32
|
||||
push edx
|
||||
jmp ThunkConnect32@24
|
||||
Thipx_ThkData16 label byte
|
||||
db "Thipx_ThunkData16",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pfnQT_Thunk_Thipx dd offset QT_Thunk_Thipx
|
||||
pfnFT_Prolog_Thipx dd offset FT_Prolog_Thipx
|
||||
.data
|
||||
QT_Thunk_Thipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
FT_Prolog_Thipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;************************ START OF THUNK BODIES************************
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Close_Socket95@4
|
||||
_IPX_Close_Socket95@4:
|
||||
mov cl,9
|
||||
jmp II_IPX_Close_Socket95@4
|
||||
public _IPX_Initialise@4
|
||||
_IPX_Initialise@4:
|
||||
mov cl,12
|
||||
jmp II_IPX_Close_Socket95@4
|
||||
public _IPX_Open_Socket95@4
|
||||
_IPX_Open_Socket95@4:
|
||||
mov cl,10
|
||||
; _IPX_Close_Socket95(16) = _IPX_Close_Socket95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
;
|
||||
public II_IPX_Close_Socket95@4
|
||||
II_IPX_Close_Socket95@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_Internet_Address95@12
|
||||
_IPX_Get_Internet_Address95@12:
|
||||
mov cl,7
|
||||
; _IPX_Get_Internet_Address95(16) = _IPX_Get_Internet_Address95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
; dword ptr [ebp+12]: netnum
|
||||
; dword ptr [ebp+16]: node
|
||||
;
|
||||
public II_IPX_Get_Internet_Address95@12
|
||||
II_IPX_Get_Internet_Address95@12:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
call SMapLS_IP_EBP_16
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_12
|
||||
call SUnMapLS_IP_EBP_16
|
||||
leave
|
||||
retn 12
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_User_ID95@8
|
||||
_IPX_Get_User_ID95@8:
|
||||
mov cl,6
|
||||
; _IPX_Get_User_ID95(16) = _IPX_Get_User_ID95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
; dword ptr [ebp+12]: user_id
|
||||
;
|
||||
public II_IPX_Get_User_ID95@8
|
||||
II_IPX_Get_User_ID95@8:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_12
|
||||
leave
|
||||
retn 8
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Send_Packet95@12
|
||||
_IPX_Send_Packet95@12:
|
||||
mov cl,5
|
||||
; _IPX_Send_Packet95(16) = _IPX_Send_Packet95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: address
|
||||
; dword ptr [ebp+12]: buffer
|
||||
; dword ptr [ebp+16]: param3
|
||||
;
|
||||
public II_IPX_Send_Packet95@12
|
||||
II_IPX_Send_Packet95@12:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
push word ptr [ebp+16] ;param3: dword->word
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
call SUnMapLS_IP_EBP_12
|
||||
leave
|
||||
retn 12
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Broadcast_Packet95@8
|
||||
_IPX_Broadcast_Packet95@8:
|
||||
mov cl,4
|
||||
; _IPX_Broadcast_Packet95(16) = _IPX_Broadcast_Packet95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: buffer
|
||||
; dword ptr [ebp+12]: param2
|
||||
;
|
||||
public II_IPX_Broadcast_Packet95@8
|
||||
II_IPX_Broadcast_Packet95@8:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
push word ptr [ebp+12] ;param2: dword->word
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
leave
|
||||
retn 8
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_Local_Target95@16
|
||||
_IPX_Get_Local_Target95@16:
|
||||
mov cl,3
|
||||
; _IPX_Get_Local_Target95(16) = _IPX_Get_Local_Target95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: netnum
|
||||
; dword ptr [ebp+12]: node
|
||||
; dword ptr [ebp+16]: param3
|
||||
; dword ptr [ebp+20]: address
|
||||
;
|
||||
public II_IPX_Get_Local_Target95@16
|
||||
II_IPX_Get_Local_Target95@16:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
push word ptr [ebp+16] ;param3: dword->word
|
||||
call SMapLS_IP_EBP_20
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
call SUnMapLS_IP_EBP_12
|
||||
call SUnMapLS_IP_EBP_20
|
||||
leave
|
||||
retn 16
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Shut_Down95@0
|
||||
_IPX_Shut_Down95@0:
|
||||
mov cl,1
|
||||
jmp II_IPX_Shut_Down95@0
|
||||
public _IPX_Uninitialise@0
|
||||
_IPX_Uninitialise@0:
|
||||
mov cl,11
|
||||
jmp II_IPX_Shut_Down95@0
|
||||
public _IPX_Get_Connection_Number95@0
|
||||
_IPX_Get_Connection_Number95@0:
|
||||
mov cl,8
|
||||
jmp II_IPX_Shut_Down95@0
|
||||
public _IPX_Start_Listening95@0
|
||||
_IPX_Start_Listening95@0:
|
||||
mov cl,2
|
||||
; _IPX_Shut_Down95(16) = _IPX_Shut_Down95(32) {}
|
||||
;
|
||||
;
|
||||
public II_IPX_Shut_Down95@0
|
||||
II_IPX_Shut_Down95@0:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
leave
|
||||
retn
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_Outstanding_Buffer95@4
|
||||
_IPX_Get_Outstanding_Buffer95@4:
|
||||
mov cl,0
|
||||
; _IPX_Get_Outstanding_Buffer95(16) = _IPX_Get_Outstanding_Buffer95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: buffer
|
||||
;
|
||||
public II_IPX_Get_Outstanding_Buffer95@4
|
||||
II_IPX_Get_Outstanding_Buffer95@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
ELSE
|
||||
;************************* START OF 16-BIT CODE *************************
|
||||
|
||||
|
||||
|
||||
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
externDef _IPX_Get_Outstanding_Buffer95:far16
|
||||
externDef _IPX_Shut_Down95:far16
|
||||
externDef _IPX_Start_Listening95:far16
|
||||
externDef _IPX_Get_Local_Target95:far16
|
||||
externDef _IPX_Broadcast_Packet95:far16
|
||||
externDef _IPX_Send_Packet95:far16
|
||||
externDef _IPX_Get_User_ID95:far16
|
||||
externDef _IPX_Get_Internet_Address95:far16
|
||||
externDef _IPX_Get_Connection_Number95:far16
|
||||
externDef _IPX_Close_Socket95:far16
|
||||
externDef _IPX_Open_Socket95:far16
|
||||
externDef _IPX_Uninitialise:far16
|
||||
externDef _IPX_Initialise:far16
|
||||
|
||||
|
||||
FT_ThipxTargetTable label word
|
||||
dw offset _IPX_Get_Outstanding_Buffer95
|
||||
dw seg _IPX_Get_Outstanding_Buffer95
|
||||
dw offset _IPX_Shut_Down95
|
||||
dw seg _IPX_Shut_Down95
|
||||
dw offset _IPX_Start_Listening95
|
||||
dw seg _IPX_Start_Listening95
|
||||
dw offset _IPX_Get_Local_Target95
|
||||
dw seg _IPX_Get_Local_Target95
|
||||
dw offset _IPX_Broadcast_Packet95
|
||||
dw seg _IPX_Broadcast_Packet95
|
||||
dw offset _IPX_Send_Packet95
|
||||
dw seg _IPX_Send_Packet95
|
||||
dw offset _IPX_Get_User_ID95
|
||||
dw seg _IPX_Get_User_ID95
|
||||
dw offset _IPX_Get_Internet_Address95
|
||||
dw seg _IPX_Get_Internet_Address95
|
||||
dw offset _IPX_Get_Connection_Number95
|
||||
dw seg _IPX_Get_Connection_Number95
|
||||
dw offset _IPX_Close_Socket95
|
||||
dw seg _IPX_Close_Socket95
|
||||
dw offset _IPX_Open_Socket95
|
||||
dw seg _IPX_Open_Socket95
|
||||
dw offset _IPX_Uninitialise
|
||||
dw seg _IPX_Uninitialise
|
||||
dw offset _IPX_Initialise
|
||||
dw seg _IPX_Initialise
|
||||
|
||||
|
||||
|
||||
|
||||
.data
|
||||
|
||||
public Thipx_ThunkData16 ;This symbol must be exported.
|
||||
Thipx_ThunkData16 dd 3130534ch ;Protocol 'LS01'
|
||||
dd 0228d3h ;Checksum
|
||||
dw offset FT_ThipxTargetTable
|
||||
dw seg FT_ThipxTargetTable
|
||||
dd 0 ;First-time flag.
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect16:far16
|
||||
|
||||
public Thipx_ThunkConnect16
|
||||
Thipx_ThunkConnect16:
|
||||
pop ax
|
||||
pop dx
|
||||
push seg Thipx_ThunkData16
|
||||
push offset Thipx_ThunkData16
|
||||
push seg Thipx_ThkData32
|
||||
push offset Thipx_ThkData32
|
||||
push cs
|
||||
push dx
|
||||
push ax
|
||||
jmp ThunkConnect16
|
||||
Thipx_ThkData32 label byte
|
||||
db "Thipx_ThunkData32",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF
|
||||
END
|
355
IPX/OK/THIPX.BAK
Normal file
355
IPX/OK/THIPX.BAK
Normal file
@@ -0,0 +1,355 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
page ,132
|
||||
|
||||
;Thunk Compiler Version 1.8 May 11 1995 13:16:19
|
||||
;File Compiled Tue Jan 23 15:12:09 1996
|
||||
|
||||
;Command Line: C:\BIN\THUNK.EXE thipx.thk
|
||||
|
||||
TITLE $thipx.asm
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
IFNDEF IS_16
|
||||
IFNDEF IS_32
|
||||
%out command line error: specify one of -DIS_16, -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_32
|
||||
ENDIF ;IS_16
|
||||
|
||||
|
||||
IFDEF IS_32
|
||||
IFDEF IS_16
|
||||
%out command line error: you can't specify both -DIS_16 and -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_16
|
||||
;************************* START OF 32-BIT CODE *************************
|
||||
|
||||
|
||||
.model FLAT,STDCALL
|
||||
|
||||
|
||||
;-- Import common flat thunk routines (in k32)
|
||||
|
||||
externDef MapHInstLS :near32
|
||||
externDef MapHInstLS_PN :near32
|
||||
externDef MapHInstSL :near32
|
||||
externDef MapHInstSL_PN :near32
|
||||
externDef FT_Prolog :near32
|
||||
externDef FT_Thunk :near32
|
||||
externDef QT_Thunk :near32
|
||||
externDef FT_Exit0 :near32
|
||||
externDef FT_Exit4 :near32
|
||||
externDef FT_Exit8 :near32
|
||||
externDef FT_Exit12 :near32
|
||||
externDef FT_Exit16 :near32
|
||||
externDef FT_Exit20 :near32
|
||||
externDef FT_Exit24 :near32
|
||||
externDef FT_Exit28 :near32
|
||||
externDef FT_Exit32 :near32
|
||||
externDef FT_Exit36 :near32
|
||||
externDef FT_Exit40 :near32
|
||||
externDef FT_Exit44 :near32
|
||||
externDef FT_Exit48 :near32
|
||||
externDef FT_Exit52 :near32
|
||||
externDef FT_Exit56 :near32
|
||||
externDef SMapLS :near32
|
||||
externDef SUnMapLS :near32
|
||||
externDef SMapLS_IP_EBP_8 :near32
|
||||
externDef SUnMapLS_IP_EBP_8 :near32
|
||||
externDef SMapLS_IP_EBP_12 :near32
|
||||
externDef SUnMapLS_IP_EBP_12 :near32
|
||||
externDef SMapLS_IP_EBP_16 :near32
|
||||
externDef SUnMapLS_IP_EBP_16 :near32
|
||||
externDef SMapLS_IP_EBP_20 :near32
|
||||
externDef SUnMapLS_IP_EBP_20 :near32
|
||||
externDef SMapLS_IP_EBP_24 :near32
|
||||
externDef SUnMapLS_IP_EBP_24 :near32
|
||||
externDef SMapLS_IP_EBP_28 :near32
|
||||
externDef SUnMapLS_IP_EBP_28 :near32
|
||||
externDef SMapLS_IP_EBP_32 :near32
|
||||
externDef SUnMapLS_IP_EBP_32 :near32
|
||||
externDef SMapLS_IP_EBP_36 :near32
|
||||
externDef SUnMapLS_IP_EBP_36 :near32
|
||||
externDef SMapLS_IP_EBP_40 :near32
|
||||
externDef SUnMapLS_IP_EBP_40 :near32
|
||||
|
||||
MapSL PROTO NEAR STDCALL p32:DWORD
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
;************************* COMMON PER-MODULE ROUTINES *************************
|
||||
|
||||
.data
|
||||
|
||||
public thipx_ThunkData32 ;This symbol must be exported.
|
||||
thipx_ThunkData32 label dword
|
||||
dd 3130534ch ;Protocol 'LS01'
|
||||
dd 0a179h ;Checksum
|
||||
dd 0 ;Jump table address.
|
||||
dd 3130424ch ;'LB01'
|
||||
dd 0 ;Flags
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd offset QT_Thunk_thipx - offset thipx_ThunkData32
|
||||
dd offset FT_Prolog_thipx - offset thipx_ThunkData32
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect32@24:near32
|
||||
|
||||
public thipx_ThunkConnect32@16
|
||||
thipx_ThunkConnect32@16:
|
||||
pop edx
|
||||
push offset thipx_ThkData16
|
||||
push offset thipx_ThunkData32
|
||||
push edx
|
||||
jmp ThunkConnect32@24
|
||||
thipx_ThkData16 label byte
|
||||
db "thipx_ThunkData16",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pfnQT_Thunk_thipx dd offset QT_Thunk_thipx
|
||||
pfnFT_Prolog_thipx dd offset FT_Prolog_thipx
|
||||
.data
|
||||
QT_Thunk_thipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
FT_Prolog_thipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;************************ START OF THUNK BODIES************************
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Close_Socket95@4
|
||||
_IPX_Close_Socket95@4:
|
||||
mov cl,3
|
||||
jmp II_IPX_Close_Socket95@4
|
||||
public _IPX_Initialise@4
|
||||
_IPX_Initialise@4:
|
||||
mov cl,6
|
||||
jmp II_IPX_Close_Socket95@4
|
||||
public _IPX_Open_Socket95@4
|
||||
_IPX_Open_Socket95@4:
|
||||
mov cl,4
|
||||
; _IPX_Close_Socket95(16) = _IPX_Close_Socket95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
;
|
||||
public II_IPX_Close_Socket95@4
|
||||
II_IPX_Close_Socket95@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call dword ptr [pfnQT_Thunk_thipx]
|
||||
cwde
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_Connection_Number95@0
|
||||
_IPX_Get_Connection_Number95@0:
|
||||
mov cl,2
|
||||
jmp II_IPX_Get_Connection_Number95@0
|
||||
public _IPX_Uninitialise@0
|
||||
_IPX_Uninitialise@0:
|
||||
mov cl,5
|
||||
; _IPX_Get_Connection_Number95(16) = _IPX_Get_Connection_Number95(32) {}
|
||||
;
|
||||
;
|
||||
public II_IPX_Get_Connection_Number95@0
|
||||
II_IPX_Get_Connection_Number95@0:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call dword ptr [pfnQT_Thunk_thipx]
|
||||
cwde
|
||||
leave
|
||||
retn
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_Internet_Address95@12
|
||||
_IPX_Get_Internet_Address95@12:
|
||||
mov cl,1
|
||||
; _IPX_Get_Internet_Address95(16) = _IPX_Get_Internet_Address95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
; dword ptr [ebp+12]: netnum
|
||||
; dword ptr [ebp+16]: node
|
||||
;
|
||||
public II_IPX_Get_Internet_Address95@12
|
||||
II_IPX_Get_Internet_Address95@12:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
call SMapLS_IP_EBP_16
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_12
|
||||
call SUnMapLS_IP_EBP_16
|
||||
leave
|
||||
retn 12
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public __IPX_Get_User_ID95@8
|
||||
__IPX_Get_User_ID95@8:
|
||||
mov cl,0
|
||||
; __IPX_Get_User_ID95(16) = __IPX_Get_User_ID95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
; dword ptr [ebp+12]: user_id
|
||||
;
|
||||
public II__IPX_Get_User_ID95@8
|
||||
II__IPX_Get_User_ID95@8:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_12
|
||||
leave
|
||||
retn 8
|
||||
|
||||
|
||||
|
||||
|
||||
ELSE
|
||||
;************************* START OF 16-BIT CODE *************************
|
||||
|
||||
|
||||
|
||||
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
externDef __IPX_Get_User_ID95:far16
|
||||
externDef _IPX_Get_Internet_Address95:far16
|
||||
externDef _IPX_Get_Connection_Number95:far16
|
||||
externDef _IPX_Close_Socket95:far16
|
||||
externDef _IPX_Open_Socket95:far16
|
||||
externDef _IPX_Uninitialise:far16
|
||||
externDef _IPX_Initialise:far16
|
||||
|
||||
|
||||
FT_thipxTargetTable label word
|
||||
dw offset __IPX_Get_User_ID95
|
||||
dw seg __IPX_Get_User_ID95
|
||||
dw offset _IPX_Get_Internet_Address95
|
||||
dw seg _IPX_Get_Internet_Address95
|
||||
dw offset _IPX_Get_Connection_Number95
|
||||
dw seg _IPX_Get_Connection_Number95
|
||||
dw offset _IPX_Close_Socket95
|
||||
dw seg _IPX_Close_Socket95
|
||||
dw offset _IPX_Open_Socket95
|
||||
dw seg _IPX_Open_Socket95
|
||||
dw offset _IPX_Uninitialise
|
||||
dw seg _IPX_Uninitialise
|
||||
dw offset _IPX_Initialise
|
||||
dw seg _IPX_Initialise
|
||||
|
||||
|
||||
|
||||
|
||||
.data
|
||||
|
||||
public thipx_ThunkData16 ;This symbol must be exported.
|
||||
thipx_ThunkData16 dd 3130534ch ;Protocol 'LS01'
|
||||
dd 0a179h ;Checksum
|
||||
dw offset FT_thipxTargetTable
|
||||
dw seg FT_thipxTargetTable
|
||||
dd 0 ;First-time flag.
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect16:far16
|
||||
|
||||
public thipx_ThunkConnect16
|
||||
thipx_ThunkConnect16:
|
||||
pop ax
|
||||
pop dx
|
||||
push seg thipx_ThunkData16
|
||||
push offset thipx_ThunkData16
|
||||
push seg thipx_ThkData32
|
||||
push offset thipx_ThkData32
|
||||
push cs
|
||||
push dx
|
||||
push ax
|
||||
jmp ThunkConnect16
|
||||
thipx_ThkData32 label byte
|
||||
db "thipx_ThunkData32",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF
|
||||
END
|
98
IPX/OK/THIPX.THK
Normal file
98
IPX/OK/THIPX.THK
Normal file
@@ -0,0 +1,98 @@
|
||||
|
||||
enablemapdirect3216 = true;
|
||||
|
||||
typedef int BOOL;
|
||||
typedef int INT;
|
||||
|
||||
|
||||
typedef struct tag_network_number {
|
||||
unsigned char bytes[4];
|
||||
}network_number;
|
||||
|
||||
typedef struct tag_physical_node {
|
||||
unsigned char bytes[6];
|
||||
}physical_node;
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL _IPX_Initialise(INT)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL _IPX_Uninitialise(void)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Open_Socket95(INT)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Close_Socket95(INT)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Get_Connection_Number95(void)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Get_Internet_Address95(INT, network_number* netnum, physical_node* node)
|
||||
{
|
||||
netnum = output;
|
||||
node = output;
|
||||
}
|
||||
|
||||
INT _IPX_Get_User_ID95(INT, char *user_id)
|
||||
{
|
||||
user_id = output;
|
||||
}
|
||||
|
||||
|
||||
typedef struct tag_send_address_struct{
|
||||
unsigned char address[6];
|
||||
}send_address_struct;
|
||||
|
||||
typedef struct tag_send_buffer_struct{
|
||||
unsigned char buffer[512];
|
||||
}send_buffer_struct;
|
||||
|
||||
|
||||
INT _IPX_Send_Packet95(send_address_struct *address, send_buffer_struct *buffer, INT)
|
||||
{
|
||||
address = input;
|
||||
buffer = input;
|
||||
}
|
||||
|
||||
INT _IPX_Broadcast_Packet95(send_buffer_struct *buffer, INT)
|
||||
{
|
||||
buffer = input;
|
||||
}
|
||||
|
||||
INT _IPX_Get_Local_Target95(network_number *netnum, physical_node *node, short, send_address_struct *address)
|
||||
{
|
||||
netnum = input;
|
||||
node = input;
|
||||
address = output;
|
||||
}
|
||||
|
||||
|
||||
INT _IPX_Start_Listening95(void)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Shut_Down95(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
typedef struct tag_get_buffer_struct{
|
||||
unsigned char get_buffer[1024];
|
||||
}get_buffer_struct;
|
||||
|
||||
INT _IPX_Get_Outstanding_Buffer95(get_buffer_struct *buffer)
|
||||
{
|
||||
buffer = output;
|
||||
}
|
||||
|
||||
|
||||
|
51
IPX/OK/THIPX16C.CPP
Normal file
51
IPX/OK/THIPX16C.CPP
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
extern "C" {
|
||||
BOOL FAR PASCAL Thipx_ThunkConnect16_(LPSTR pszDll16, LPSTR pszDll32, WORD hInst, DWORD dwReason);
|
||||
}
|
||||
|
||||
int CALLBACK LibMain (HANDLE, WORD, WORD, LPSTR)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
BOOL FAR PASCAL DllEntryPoint_ (DWORD dwReason, WORD hInst, WORD, WORD, DWORD, WORD);
|
||||
}
|
||||
|
||||
|
||||
BOOL FAR PASCAL DllEntryPoint_ (DWORD dwReason, WORD hInst, WORD, WORD, DWORD, WORD)
|
||||
{
|
||||
OutputDebugString("In 16bit DLL entry point. Calling Thipx_ThunkConnect16\r\n");
|
||||
|
||||
if (!Thipx_ThunkConnect16_("THIPX16.DLL", "THIPX32.DLL", hInst, dwReason)){
|
||||
OutputDebugString("In 16bit DllEntryPoint: thkThunkConnect16 ret FALSE\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
OutputDebugString("In 16bit DllEntryPoint: thkThunkConnect16 ret TRUE\r\n");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
52
IPX/OK/THIPX32C.CPP
Normal file
52
IPX/OK/THIPX32C.CPP
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#define WIN32
|
||||
#ifndef _WIN32 // Denzil 6/2/98 Watcom 11.0 complains without this check
|
||||
#define _WIN32
|
||||
#endif // _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
|
||||
extern "C" {
|
||||
BOOL WINAPI Thipx_ThunkConnect32(LPSTR pszDll16, LPSTR pszDll32, DWORD hIinst, DWORD dwReason);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL APIENTRY DllMain(DWORD hInst, DWORD dwReason, DWORD dwReserved)
|
||||
|
||||
{
|
||||
OutputDebugString("In THIPX32.DLL : DllMain\r\n");
|
||||
if (! Thipx_ThunkConnect32("THIPX16.DLL", "THIPX32.DLL", hInst, dwReason)) {
|
||||
OutputDebugString("ERROR! 32Bit ThunkConnect32 failed!\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
OutputDebugString("32Bit ThunkConnect32 succeeded.\r\n");
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
BOOL APIENTRY LibMain(DWORD hInst, DWORD dwReason, DWORD dwReserved)
|
||||
{
|
||||
return (DllMain(hInst, dwReason, dwReserved));
|
||||
}
|
60
IPX/OK/THMAP16.ASM
Normal file
60
IPX/OK/THMAP16.ASM
Normal file
@@ -0,0 +1,60 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
.8086
|
||||
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externdef pascal Thipx_ThunkConnect16_:far16
|
||||
extern pascal Thipx_ThunkConnect16:near16
|
||||
|
||||
Thipx_ThunkConnect16_ proc far16 pascal
|
||||
|
||||
jmp Thipx_ThunkConnect16
|
||||
|
||||
Thipx_ThunkConnect16_ endp
|
||||
|
||||
|
||||
|
||||
externdef DllEntryPoint:far16
|
||||
extern pascal DllEntryPoint_:far16
|
||||
|
||||
DllEntryPoint proc far16
|
||||
|
||||
jmp DllEntryPoint_
|
||||
|
||||
DllEntryPoint endp
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
188
IPX/OK/THMAP32.ASM
Normal file
188
IPX/OK/THMAP32.ASM
Normal file
@@ -0,0 +1,188 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
.model FLAT
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
;externdef _DllMain@12:near
|
||||
;externdef DllMain@12:near
|
||||
;
|
||||
;DllMain proc near
|
||||
;
|
||||
; jmp _DllMain@12
|
||||
;
|
||||
;DllMain endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Initialise:near
|
||||
externdef __IPX_Initialise@4:near
|
||||
|
||||
_IPX_Initialise proc near
|
||||
|
||||
jmp __IPX_Initialise@4
|
||||
|
||||
_IPX_Initialise endp
|
||||
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Uninitialise:near
|
||||
externdef __IPX_Uninitialise@0:near
|
||||
|
||||
_IPX_Uninitialise proc near
|
||||
|
||||
jmp __IPX_Uninitialise@0
|
||||
|
||||
_IPX_Uninitialise endp
|
||||
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Open_Socket95:near
|
||||
externdef __IPX_Open_Socket95@4:near
|
||||
|
||||
_IPX_Open_Socket95 proc near
|
||||
|
||||
jmp __IPX_Open_Socket95@4
|
||||
|
||||
_IPX_Open_Socket95 endp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Close_Socket95:near
|
||||
externdef __IPX_Close_Socket95@4:near
|
||||
|
||||
_IPX_Close_Socket95 proc near
|
||||
|
||||
jmp __IPX_Close_Socket95@4
|
||||
|
||||
_IPX_Close_Socket95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Get_Connection_Number95:near
|
||||
externdef __IPX_Get_Connection_Number95@0:near
|
||||
|
||||
_IPX_Get_Connection_Number95 proc near
|
||||
|
||||
jmp __IPX_Get_Connection_Number95@0
|
||||
|
||||
_IPX_Get_Connection_Number95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Get_Internet_Address95:near
|
||||
externdef __IPX_Get_Internet_Address95@12:near
|
||||
|
||||
_IPX_Get_Internet_Address95 proc near
|
||||
|
||||
jmp __IPX_Get_Internet_Address95@12
|
||||
|
||||
_IPX_Get_Internet_Address95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Get_User_ID95:near
|
||||
externdef __IPX_Get_User_ID95@8:near
|
||||
|
||||
_IPX_Get_User_ID95 proc near
|
||||
|
||||
jmp __IPX_Get_User_ID95@8
|
||||
|
||||
_IPX_Get_User_ID95 endp
|
||||
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Send_Packet95:near
|
||||
externdef __IPX_Send_Packet95@12:near
|
||||
|
||||
_IPX_Send_Packet95 proc near
|
||||
|
||||
jmp __IPX_Send_Packet95@12
|
||||
|
||||
_IPX_Send_Packet95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Broadcast_Packet95:near
|
||||
externdef __IPX_Broadcast_Packet95@8:near
|
||||
|
||||
_IPX_Broadcast_Packet95 proc near
|
||||
|
||||
jmp __IPX_Broadcast_Packet95@8
|
||||
|
||||
_IPX_Broadcast_Packet95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Get_Local_Target95:near
|
||||
externdef __IPX_Get_Local_Target95@16:near
|
||||
|
||||
_IPX_Get_Local_Target95 proc near
|
||||
|
||||
jmp __IPX_Get_Local_Target95@16
|
||||
|
||||
_IPX_Get_Local_Target95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Start_Listening95:near
|
||||
externdef __IPX_Start_Listening95@0:near
|
||||
|
||||
_IPX_Start_Listening95 proc near
|
||||
|
||||
jmp __IPX_Start_Listening95@0
|
||||
|
||||
_IPX_Start_Listening95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Shut_Down95:near
|
||||
externdef __IPX_Shut_Down95@0:near
|
||||
|
||||
_IPX_Shut_Down95 proc near
|
||||
|
||||
jmp __IPX_Shut_Down95@0
|
||||
|
||||
_IPX_Shut_Down95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Get_Outstanding_Buffer95:near
|
||||
externdef __IPX_Get_Outstanding_Buffer95@4:near
|
||||
|
||||
_IPX_Get_Outstanding_Buffer95 proc near
|
||||
|
||||
jmp __IPX_Get_Outstanding_Buffer95@4
|
||||
|
||||
_IPX_Get_Outstanding_Buffer95 endp
|
||||
|
||||
|
||||
end
|
243
IPX/OK/WWIPX.ASM
Normal file
243
IPX/OK/WWIPX.ASM
Normal file
@@ -0,0 +1,243 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
page ,132
|
||||
|
||||
;Thunk Compiler Version 1.8 May 11 1995 13:16:19
|
||||
;File Compiled Tue Jan 16 13:53:22 1996
|
||||
|
||||
;Command Line: D:\MSTOOLS\BIN\THUNK.EXE wwipx.thk
|
||||
|
||||
TITLE $wwipx.asm
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
IFNDEF IS_16
|
||||
IFNDEF IS_32
|
||||
%out command line error: specify one of -DIS_16, -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_32
|
||||
ENDIF ;IS_16
|
||||
|
||||
|
||||
IFDEF IS_32
|
||||
IFDEF IS_16
|
||||
%out command line error: you can't specify both -DIS_16 and -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_16
|
||||
;************************* START OF 32-BIT CODE *************************
|
||||
|
||||
|
||||
.model FLAT,STDCALL
|
||||
|
||||
|
||||
;-- Import common flat thunk routines (in k32)
|
||||
|
||||
externDef MapHInstLS :near32
|
||||
externDef MapHInstLS_PN :near32
|
||||
externDef MapHInstSL :near32
|
||||
externDef MapHInstSL_PN :near32
|
||||
externDef FT_Prolog :near32
|
||||
externDef FT_Thunk :near32
|
||||
externDef QT_Thunk :near32
|
||||
externDef FT_Exit0 :near32
|
||||
externDef FT_Exit4 :near32
|
||||
externDef FT_Exit8 :near32
|
||||
externDef FT_Exit12 :near32
|
||||
externDef FT_Exit16 :near32
|
||||
externDef FT_Exit20 :near32
|
||||
externDef FT_Exit24 :near32
|
||||
externDef FT_Exit28 :near32
|
||||
externDef FT_Exit32 :near32
|
||||
externDef FT_Exit36 :near32
|
||||
externDef FT_Exit40 :near32
|
||||
externDef FT_Exit44 :near32
|
||||
externDef FT_Exit48 :near32
|
||||
externDef FT_Exit52 :near32
|
||||
externDef FT_Exit56 :near32
|
||||
externDef SMapLS :near32
|
||||
externDef SUnMapLS :near32
|
||||
externDef SMapLS_IP_EBP_8 :near32
|
||||
externDef SUnMapLS_IP_EBP_8 :near32
|
||||
externDef SMapLS_IP_EBP_12 :near32
|
||||
externDef SUnMapLS_IP_EBP_12 :near32
|
||||
externDef SMapLS_IP_EBP_16 :near32
|
||||
externDef SUnMapLS_IP_EBP_16 :near32
|
||||
externDef SMapLS_IP_EBP_20 :near32
|
||||
externDef SUnMapLS_IP_EBP_20 :near32
|
||||
externDef SMapLS_IP_EBP_24 :near32
|
||||
externDef SUnMapLS_IP_EBP_24 :near32
|
||||
externDef SMapLS_IP_EBP_28 :near32
|
||||
externDef SUnMapLS_IP_EBP_28 :near32
|
||||
externDef SMapLS_IP_EBP_32 :near32
|
||||
externDef SUnMapLS_IP_EBP_32 :near32
|
||||
externDef SMapLS_IP_EBP_36 :near32
|
||||
externDef SUnMapLS_IP_EBP_36 :near32
|
||||
externDef SMapLS_IP_EBP_40 :near32
|
||||
externDef SUnMapLS_IP_EBP_40 :near32
|
||||
|
||||
MapSL PROTO NEAR STDCALL p32:DWORD
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
;************************* COMMON PER-MODULE ROUTINES *************************
|
||||
|
||||
.data
|
||||
|
||||
public wwipx_ThunkData32 ;This symbol must be exported.
|
||||
wwipx_ThunkData32 label dword
|
||||
dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dd 0 ;Jump table address.
|
||||
dd 3130424ch ;'LB01'
|
||||
dd 0 ;Flags
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd offset QT_Thunk_wwipx - offset wwipx_ThunkData32
|
||||
dd offset FT_Prolog_wwipx - offset wwipx_ThunkData32
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect32@24:near32
|
||||
|
||||
public wwipx_ThunkConnect32@16
|
||||
wwipx_ThunkConnect32@16:
|
||||
pop edx
|
||||
push offset wwipx_ThkData16
|
||||
push offset wwipx_ThunkData32
|
||||
push edx
|
||||
jmp ThunkConnect32@24
|
||||
wwipx_ThkData16 label byte
|
||||
db "wwipx_ThunkData16",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pfnQT_Thunk_wwipx dd offset QT_Thunk_wwipx
|
||||
pfnFT_Prolog_wwipx dd offset FT_Prolog_wwipx
|
||||
.data
|
||||
QT_Thunk_wwipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
FT_Prolog_wwipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;************************ START OF THUNK BODIES************************
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public IPX_Initialise@4
|
||||
IPX_Initialise@4:
|
||||
mov cl,0
|
||||
; IPX_Initialise(16) = IPX_Initialise(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
;
|
||||
public IIIPX_Initialise@4
|
||||
IIIPX_Initialise@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call dword ptr [pfnQT_Thunk_wwipx]
|
||||
cwde
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
ELSE
|
||||
;************************* START OF 16-BIT CODE *************************
|
||||
|
||||
|
||||
|
||||
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
externDef IPX_Initialise:far16
|
||||
|
||||
|
||||
FT_wwipxTargetTable label word
|
||||
dw offset IPX_Initialise
|
||||
dw seg IPX_Initialise
|
||||
|
||||
|
||||
|
||||
|
||||
.data
|
||||
|
||||
public wwipx_ThunkData16 ;This symbol must be exported.
|
||||
wwipx_ThunkData16 dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dw offset FT_wwipxTargetTable
|
||||
dw seg FT_wwipxTargetTable
|
||||
dd 0 ;First-time flag.
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect16:far16
|
||||
|
||||
public wwipx_ThunkConnect16
|
||||
wwipx_ThunkConnect16:
|
||||
pop ax
|
||||
pop dx
|
||||
push seg wwipx_ThunkData16
|
||||
push offset wwipx_ThunkData16
|
||||
push seg wwipx_ThkData32
|
||||
push offset wwipx_ThkData32
|
||||
push cs
|
||||
push dx
|
||||
push ax
|
||||
jmp ThunkConnect16
|
||||
wwipx_ThkData32 label byte
|
||||
db "wwipx_ThunkData32",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF
|
||||
END
|
243
IPX/OK/WWIPX16.ASM
Normal file
243
IPX/OK/WWIPX16.ASM
Normal file
@@ -0,0 +1,243 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
page ,132
|
||||
|
||||
;Thunk Compiler Version 1.8 May 11 1995 13:16:19
|
||||
;File Compiled Tue Jan 16 13:14:21 1996
|
||||
|
||||
;Command Line: D:\MSTOOLS\BIN\THUNK.EXE wwipx16.thk
|
||||
|
||||
TITLE $wwipx16.asm
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
IFNDEF IS_16
|
||||
IFNDEF IS_32
|
||||
%out command line error: specify one of -DIS_16, -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_32
|
||||
ENDIF ;IS_16
|
||||
|
||||
|
||||
IFDEF IS_32
|
||||
IFDEF IS_16
|
||||
%out command line error: you can't specify both -DIS_16 and -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_16
|
||||
;************************* START OF 32-BIT CODE *************************
|
||||
|
||||
|
||||
.model FLAT,STDCALL
|
||||
|
||||
|
||||
;-- Import common flat thunk routines (in k32)
|
||||
|
||||
externDef MapHInstLS :near32
|
||||
externDef MapHInstLS_PN :near32
|
||||
externDef MapHInstSL :near32
|
||||
externDef MapHInstSL_PN :near32
|
||||
externDef FT_Prolog :near32
|
||||
externDef FT_Thunk :near32
|
||||
externDef QT_Thunk :near32
|
||||
externDef FT_Exit0 :near32
|
||||
externDef FT_Exit4 :near32
|
||||
externDef FT_Exit8 :near32
|
||||
externDef FT_Exit12 :near32
|
||||
externDef FT_Exit16 :near32
|
||||
externDef FT_Exit20 :near32
|
||||
externDef FT_Exit24 :near32
|
||||
externDef FT_Exit28 :near32
|
||||
externDef FT_Exit32 :near32
|
||||
externDef FT_Exit36 :near32
|
||||
externDef FT_Exit40 :near32
|
||||
externDef FT_Exit44 :near32
|
||||
externDef FT_Exit48 :near32
|
||||
externDef FT_Exit52 :near32
|
||||
externDef FT_Exit56 :near32
|
||||
externDef SMapLS :near32
|
||||
externDef SUnMapLS :near32
|
||||
externDef SMapLS_IP_EBP_8 :near32
|
||||
externDef SUnMapLS_IP_EBP_8 :near32
|
||||
externDef SMapLS_IP_EBP_12 :near32
|
||||
externDef SUnMapLS_IP_EBP_12 :near32
|
||||
externDef SMapLS_IP_EBP_16 :near32
|
||||
externDef SUnMapLS_IP_EBP_16 :near32
|
||||
externDef SMapLS_IP_EBP_20 :near32
|
||||
externDef SUnMapLS_IP_EBP_20 :near32
|
||||
externDef SMapLS_IP_EBP_24 :near32
|
||||
externDef SUnMapLS_IP_EBP_24 :near32
|
||||
externDef SMapLS_IP_EBP_28 :near32
|
||||
externDef SUnMapLS_IP_EBP_28 :near32
|
||||
externDef SMapLS_IP_EBP_32 :near32
|
||||
externDef SUnMapLS_IP_EBP_32 :near32
|
||||
externDef SMapLS_IP_EBP_36 :near32
|
||||
externDef SUnMapLS_IP_EBP_36 :near32
|
||||
externDef SMapLS_IP_EBP_40 :near32
|
||||
externDef SUnMapLS_IP_EBP_40 :near32
|
||||
|
||||
MapSL PROTO NEAR STDCALL p32:DWORD
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
;************************* COMMON PER-MODULE ROUTINES *************************
|
||||
|
||||
.data
|
||||
|
||||
public wwipx16_ThunkData32 ;This symbol must be exported.
|
||||
wwipx16_ThunkData32 label dword
|
||||
dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dd 0 ;Jump table address.
|
||||
dd 3130424ch ;'LB01'
|
||||
dd 0 ;Flags
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd offset QT_Thunk_wwipx16 - offset wwipx16_ThunkData32
|
||||
dd offset FT_Prolog_wwipx16 - offset wwipx16_ThunkData32
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect32@24:near32
|
||||
|
||||
public wwipx16_ThunkConnect32@16
|
||||
wwipx16_ThunkConnect32@16:
|
||||
pop edx
|
||||
push offset wwipx16_ThkData16
|
||||
push offset wwipx16_ThunkData32
|
||||
push edx
|
||||
jmp ThunkConnect32@24
|
||||
wwipx16_ThkData16 label byte
|
||||
db "wwipx16_ThunkData16",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pfnQT_Thunk_wwipx16 dd offset QT_Thunk_wwipx16
|
||||
pfnFT_Prolog_wwipx16 dd offset FT_Prolog_wwipx16
|
||||
.data
|
||||
QT_Thunk_wwipx16 label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
FT_Prolog_wwipx16 label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;************************ START OF THUNK BODIES************************
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public IPX_Initialise@4
|
||||
IPX_Initialise@4:
|
||||
mov cl,0
|
||||
; IPX_Initialise(16) = IPX_Initialise(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
;
|
||||
public IIIPX_Initialise@4
|
||||
IIIPX_Initialise@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call dword ptr [pfnQT_Thunk_wwipx16]
|
||||
cwde
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
ELSE
|
||||
;************************* START OF 16-BIT CODE *************************
|
||||
|
||||
|
||||
|
||||
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
externDef IPX_Initialise:far16
|
||||
|
||||
|
||||
FT_wwipx16TargetTable label word
|
||||
dw offset IPX_Initialise
|
||||
dw seg IPX_Initialise
|
||||
|
||||
|
||||
|
||||
|
||||
.data
|
||||
|
||||
public wwipx16_ThunkData16 ;This symbol must be exported.
|
||||
wwipx16_ThunkData16 dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dw offset FT_wwipx16TargetTable
|
||||
dw seg FT_wwipx16TargetTable
|
||||
dd 0 ;First-time flag.
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect16:far16
|
||||
|
||||
public wwipx16_ThunkConnect16
|
||||
wwipx16_ThunkConnect16:
|
||||
pop ax
|
||||
pop dx
|
||||
push seg wwipx16_ThunkData16
|
||||
push offset wwipx16_ThunkData16
|
||||
push seg wwipx16_ThkData32
|
||||
push offset wwipx16_ThkData32
|
||||
push cs
|
||||
push dx
|
||||
push ax
|
||||
jmp ThunkConnect16
|
||||
wwipx16_ThkData32 label byte
|
||||
db "wwipx16_ThunkData32",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF
|
||||
END
|
1472
IPX/OLD/IPX16A.ASM
Normal file
1472
IPX/OLD/IPX16A.ASM
Normal file
File diff suppressed because it is too large
Load Diff
BIN
IPX/OLTHIPX.ASM
Normal file
BIN
IPX/OLTHIPX.ASM
Normal file
Binary file not shown.
564
IPX/PCMACRO.16
Normal file
564
IPX/PCMACRO.16
Normal file
@@ -0,0 +1,564 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
;***************************************************************************
|
||||
;** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
|
||||
;***************************************************************************
|
||||
;* *
|
||||
;* Project Name : 16 bit ASM Macros *
|
||||
;* *
|
||||
;* File Name : PCMACRO.16 *
|
||||
;* *
|
||||
;* Programmer : Steve Tall *
|
||||
;* *
|
||||
;* Start Date : November 17th, 1995 *
|
||||
;* *
|
||||
;* Last Update : November 20th, 1995 [ST] *
|
||||
;* *
|
||||
;*-------------------------------------------------------------------------*
|
||||
;* Functions: *
|
||||
;* *
|
||||
;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
|
||||
|
||||
|
||||
saveall macro
|
||||
save ax,bx,cx,dx,bp,si,di,es,ds
|
||||
endm
|
||||
|
||||
restall macro
|
||||
restore ax,bx,cx,dx,bp,si,di,es,ds
|
||||
endm
|
||||
|
||||
save macro r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14
|
||||
IFNB <r0>
|
||||
push r0
|
||||
save r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14
|
||||
ENDIF
|
||||
endm
|
||||
|
||||
restore macro r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14
|
||||
IFNB <r14>
|
||||
pop r14
|
||||
ENDIF
|
||||
IFNB <r13>
|
||||
pop r13
|
||||
ENDIF
|
||||
IFNB <r12>
|
||||
pop r12
|
||||
ENDIF
|
||||
IFNB <r11>
|
||||
pop r11
|
||||
ENDIF
|
||||
IFNB <r10>
|
||||
pop r10
|
||||
ENDIF
|
||||
IFNB <r9>
|
||||
pop r9
|
||||
ENDIF
|
||||
IFNB <r8>
|
||||
pop r8
|
||||
ENDIF
|
||||
IFNB <r7>
|
||||
pop r7
|
||||
ENDIF
|
||||
IFNB <r6>
|
||||
pop r6
|
||||
ENDIF
|
||||
IFNB <r5>
|
||||
pop r5
|
||||
ENDIF
|
||||
IFNB <r4>
|
||||
pop r4
|
||||
ENDIF
|
||||
IFNB <r3>
|
||||
pop r3
|
||||
ENDIF
|
||||
IFNB <r2>
|
||||
pop r2
|
||||
ENDIF
|
||||
IFNB <r1>
|
||||
pop r1
|
||||
ENDIF
|
||||
IFNB <r0>
|
||||
pop r0
|
||||
ENDIF
|
||||
endm
|
||||
|
||||
bhi macro lab
|
||||
ja lab
|
||||
endm
|
||||
|
||||
bls macro lab
|
||||
jbe lab
|
||||
endm
|
||||
|
||||
bcc macro lab
|
||||
jnc lab
|
||||
endm
|
||||
|
||||
bcs macro lab
|
||||
jc lab
|
||||
endm
|
||||
|
||||
bhs macro lab
|
||||
jnc lab
|
||||
endm
|
||||
|
||||
blo macro lab
|
||||
jc lab
|
||||
endm
|
||||
|
||||
bne macro lab
|
||||
jne lab
|
||||
endm
|
||||
|
||||
beq macro lab
|
||||
je lab
|
||||
endm
|
||||
|
||||
bpl macro lab
|
||||
jns lab
|
||||
endm
|
||||
|
||||
bmi macro lab
|
||||
js lab
|
||||
endm
|
||||
|
||||
bge macro lab
|
||||
jge lab
|
||||
endm
|
||||
|
||||
blt macro lab
|
||||
jl lab
|
||||
endm
|
||||
|
||||
bgt macro lab
|
||||
jg lab
|
||||
endm
|
||||
|
||||
ble macro lab
|
||||
jle lab
|
||||
endm
|
||||
|
||||
bra macro lab
|
||||
jmp lab
|
||||
endm
|
||||
|
||||
|
||||
bhis macro lab
|
||||
ja lab
|
||||
endm
|
||||
|
||||
blss macro lab
|
||||
jbe lab
|
||||
endm
|
||||
|
||||
bccs macro lab
|
||||
jnc lab
|
||||
endm
|
||||
|
||||
bcss macro lab
|
||||
jc lab
|
||||
endm
|
||||
|
||||
bnes macro lab
|
||||
jne lab
|
||||
endm
|
||||
|
||||
beqs macro lab
|
||||
je lab
|
||||
endm
|
||||
|
||||
bpls macro lab
|
||||
jns lab
|
||||
endm
|
||||
|
||||
bmis macro lab
|
||||
js lab
|
||||
endm
|
||||
|
||||
bges macro lab
|
||||
jge lab
|
||||
endm
|
||||
|
||||
blts macro lab
|
||||
jl lab
|
||||
endm
|
||||
|
||||
bgts macro lab
|
||||
jg lab
|
||||
endm
|
||||
|
||||
bles macro lab
|
||||
jle lab
|
||||
endm
|
||||
|
||||
bras macro lab
|
||||
jmp lab
|
||||
endm
|
||||
|
||||
|
||||
clear macro first
|
||||
xor first,first
|
||||
endm
|
||||
|
||||
rts macro
|
||||
ret
|
||||
endm
|
||||
|
||||
|
||||
|
||||
mov_b macro label,label2
|
||||
mov byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
mov_w macro label,label2
|
||||
mov word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
mov_d macro label,label2
|
||||
mov dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
cmp_b macro label,label2
|
||||
cmp byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
cmp_w macro label,label2
|
||||
cmp word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
cmp_d macro label,label2
|
||||
cmp dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
add_b macro label,label2
|
||||
add byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
add_w macro label,label2
|
||||
add word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
add_d macro label,label2
|
||||
add dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
sub_b macro label,label2
|
||||
sub byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
sub_w macro label,label2
|
||||
sub word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
sub_d macro label,label2
|
||||
sub dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
or_b macro label,label2
|
||||
or byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
or_w macro label,label2
|
||||
or word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
or_d macro label,label2
|
||||
or dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
xor_b macro label,label2
|
||||
xor byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
xor_w macro label,label2
|
||||
xor word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
xor_d macro label,label2
|
||||
xor dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
eor_b macro label,label2
|
||||
xor byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
eor_w macro label,label2
|
||||
xor word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
eor_d macro label,label2
|
||||
xor dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
and_b macro label,label2
|
||||
and byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
and_w macro label,label2
|
||||
and word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
and_d macro label,label2
|
||||
and dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
test_b macro label,label2
|
||||
test byte ptr label,byte ptr label2
|
||||
endm
|
||||
|
||||
test_w macro label,label2
|
||||
test word ptr label,word ptr label2
|
||||
endm
|
||||
|
||||
test_d macro label,label2
|
||||
test dword ptr label,dword ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
shr_b macro label,label2
|
||||
shr byte ptr label,label2
|
||||
endm
|
||||
|
||||
shr_w macro label,label2
|
||||
shr word ptr label,label2
|
||||
endm
|
||||
|
||||
shr_d macro label,label2
|
||||
shr dword ptr label,label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
shl_b macro label,label2
|
||||
shl byte ptr label,label2
|
||||
endm
|
||||
|
||||
shl_w macro label,label2
|
||||
shl word ptr label,label2
|
||||
endm
|
||||
|
||||
shl_d macro label,label2
|
||||
shl dword ptr label,label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
sar_b macro label,label2
|
||||
sar byte ptr label,label2
|
||||
endm
|
||||
|
||||
sar_w macro label,label2
|
||||
sar word ptr label,label2
|
||||
endm
|
||||
|
||||
sar_d macro label,label2
|
||||
sar dword ptr label,label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sal_b macro label,label2
|
||||
sal byte ptr label,label2
|
||||
endm
|
||||
|
||||
sal_w macro label,label2
|
||||
sal word ptr label,label2
|
||||
endm
|
||||
|
||||
sal_d macro label,label2
|
||||
sal dword ptr label,label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
inc_b macro label
|
||||
inc byte ptr label
|
||||
endm
|
||||
|
||||
inc_w macro label
|
||||
inc word ptr label
|
||||
endm
|
||||
|
||||
inc_d macro label
|
||||
inc dword ptr label
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
dec_b macro label
|
||||
dec byte ptr label
|
||||
endm
|
||||
|
||||
dec_w macro label
|
||||
dec word ptr label
|
||||
endm
|
||||
|
||||
dec_d macro label
|
||||
dec dword ptr label
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
movzx_b macro label,label2
|
||||
movzx label,byte ptr label2
|
||||
endm
|
||||
|
||||
|
||||
movzx_w macro label,label2
|
||||
movzx label,word ptr label2
|
||||
endm
|
||||
|
||||
|
||||
movsx_b macro label,label2
|
||||
movsx label,byte ptr label2
|
||||
endm
|
||||
|
||||
|
||||
movsx_w macro label,label2
|
||||
movsx label,word ptr label2
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
mul_b macro label
|
||||
mul byte ptr label
|
||||
endm
|
||||
|
||||
|
||||
mul_w macro label
|
||||
mul word ptr label
|
||||
endm
|
||||
|
||||
|
||||
div_b macro label
|
||||
div byte ptr label
|
||||
endm
|
||||
|
||||
|
||||
div_w macro label
|
||||
div word ptr label
|
||||
endm
|
||||
|
||||
|
||||
idiv_b macro label
|
||||
idiv byte ptr label
|
||||
endm
|
||||
|
||||
|
||||
idiv_w macro label
|
||||
idiv word ptr label
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
tst_b macro label
|
||||
cmp byte ptr label,0
|
||||
endm
|
||||
|
||||
tst_w macro label
|
||||
cmp word ptr label,0
|
||||
endm
|
||||
|
||||
tst_d macro label
|
||||
cmp dword ptr label,0
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
not_b macro label
|
||||
not byte ptr label
|
||||
endm
|
||||
|
||||
not_w macro label
|
||||
not word ptr label
|
||||
endm
|
||||
|
||||
not_d macro label
|
||||
not dword ptr label
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
||||
neg_b macro label
|
||||
neg byte ptr label
|
||||
endm
|
||||
|
||||
neg_w macro label
|
||||
neg word ptr label
|
||||
endm
|
||||
|
||||
neg_d macro label
|
||||
neg dword ptr label
|
||||
endm
|
||||
|
||||
|
||||
|
||||
|
438
IPX/THIPX.ASM
Normal file
438
IPX/THIPX.ASM
Normal file
@@ -0,0 +1,438 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
page ,132
|
||||
|
||||
;Thunk Compiler Version 1.8 May 11 1995 13:16:19
|
||||
;File Compiled Tue Mar 12 13:23:57 1996
|
||||
|
||||
;Command Line: C:\BIN\THUNK.EXE Thipx.thk
|
||||
|
||||
TITLE $Thipx.asm
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
IFNDEF IS_16
|
||||
IFNDEF IS_32
|
||||
%out command line error: specify one of -DIS_16, -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_32
|
||||
ENDIF ;IS_16
|
||||
|
||||
|
||||
IFDEF IS_32
|
||||
IFDEF IS_16
|
||||
%out command line error: you can't specify both -DIS_16 and -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_16
|
||||
;************************* START OF 32-BIT CODE *************************
|
||||
|
||||
|
||||
.model FLAT,STDCALL
|
||||
|
||||
|
||||
;-- Import common flat thunk routines (in k32)
|
||||
|
||||
externDef MapHInstLS :near32
|
||||
externDef MapHInstLS_PN :near32
|
||||
externDef MapHInstSL :near32
|
||||
externDef MapHInstSL_PN :near32
|
||||
externDef FT_Prolog :near32
|
||||
externDef FT_Thunk :near32
|
||||
externDef QT_Thunk :near32
|
||||
externDef FT_Exit0 :near32
|
||||
externDef FT_Exit4 :near32
|
||||
externDef FT_Exit8 :near32
|
||||
externDef FT_Exit12 :near32
|
||||
externDef FT_Exit16 :near32
|
||||
externDef FT_Exit20 :near32
|
||||
externDef FT_Exit24 :near32
|
||||
externDef FT_Exit28 :near32
|
||||
externDef FT_Exit32 :near32
|
||||
externDef FT_Exit36 :near32
|
||||
externDef FT_Exit40 :near32
|
||||
externDef FT_Exit44 :near32
|
||||
externDef FT_Exit48 :near32
|
||||
externDef FT_Exit52 :near32
|
||||
externDef FT_Exit56 :near32
|
||||
externDef SMapLS :near32
|
||||
externDef SUnMapLS :near32
|
||||
externDef SMapLS_IP_EBP_8 :near32
|
||||
externDef SUnMapLS_IP_EBP_8 :near32
|
||||
externDef SMapLS_IP_EBP_12 :near32
|
||||
externDef SUnMapLS_IP_EBP_12 :near32
|
||||
externDef SMapLS_IP_EBP_16 :near32
|
||||
externDef SUnMapLS_IP_EBP_16 :near32
|
||||
externDef SMapLS_IP_EBP_20 :near32
|
||||
externDef SUnMapLS_IP_EBP_20 :near32
|
||||
externDef SMapLS_IP_EBP_24 :near32
|
||||
externDef SUnMapLS_IP_EBP_24 :near32
|
||||
externDef SMapLS_IP_EBP_28 :near32
|
||||
externDef SUnMapLS_IP_EBP_28 :near32
|
||||
externDef SMapLS_IP_EBP_32 :near32
|
||||
externDef SUnMapLS_IP_EBP_32 :near32
|
||||
externDef SMapLS_IP_EBP_36 :near32
|
||||
externDef SUnMapLS_IP_EBP_36 :near32
|
||||
externDef SMapLS_IP_EBP_40 :near32
|
||||
externDef SUnMapLS_IP_EBP_40 :near32
|
||||
|
||||
MapSL PROTO NEAR STDCALL p32:DWORD
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
;************************* COMMON PER-MODULE ROUTINES *************************
|
||||
|
||||
.data
|
||||
|
||||
public Thipx_ThunkData32 ;This symbol must be exported.
|
||||
Thipx_ThunkData32 label dword
|
||||
dd 3130534ch ;Protocol 'LS01'
|
||||
dd 014cdch ;Checksum
|
||||
dd 0 ;Jump table address.
|
||||
dd 3130424ch ;'LB01'
|
||||
dd 0 ;Flags
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd offset QT_Thunk_Thipx - offset Thipx_ThunkData32
|
||||
dd offset FT_Prolog_Thipx - offset Thipx_ThunkData32
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect32@24:near32
|
||||
|
||||
public Thipx_ThunkConnect32@16
|
||||
Thipx_ThunkConnect32@16:
|
||||
pop edx
|
||||
push offset Thipx_ThkData16
|
||||
push offset Thipx_ThunkData32
|
||||
push edx
|
||||
jmp ThunkConnect32@24
|
||||
Thipx_ThkData16 label byte
|
||||
db "Thipx_ThunkData16",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pfnQT_Thunk_Thipx dd offset QT_Thunk_Thipx
|
||||
pfnFT_Prolog_Thipx dd offset FT_Prolog_Thipx
|
||||
.data
|
||||
QT_Thunk_Thipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
FT_Prolog_Thipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;************************ START OF THUNK BODIES************************
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Close_Socket95@4
|
||||
_IPX_Close_Socket95@4:
|
||||
mov cl,7
|
||||
jmp II_IPX_Close_Socket95@4
|
||||
public _IPX_Open_Socket95@4
|
||||
_IPX_Open_Socket95@4:
|
||||
mov cl,8
|
||||
; _IPX_Close_Socket95(16) = _IPX_Close_Socket95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
;
|
||||
public II_IPX_Close_Socket95@4
|
||||
II_IPX_Close_Socket95@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Send_Packet95@20
|
||||
_IPX_Send_Packet95@20:
|
||||
mov cl,5
|
||||
; _IPX_Send_Packet95(16) = _IPX_Send_Packet95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: address
|
||||
; dword ptr [ebp+12]: buffer
|
||||
; dword ptr [ebp+16]: param3
|
||||
; dword ptr [ebp+20]: net
|
||||
; dword ptr [ebp+24]: node
|
||||
;
|
||||
public II_IPX_Send_Packet95@20
|
||||
II_IPX_Send_Packet95@20:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
push word ptr [ebp+16] ;param3: dword->word
|
||||
call SMapLS_IP_EBP_20
|
||||
push eax
|
||||
call SMapLS_IP_EBP_24
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
call SUnMapLS_IP_EBP_12
|
||||
call SUnMapLS_IP_EBP_20
|
||||
call SUnMapLS_IP_EBP_24
|
||||
leave
|
||||
retn 20
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Broadcast_Packet95@8
|
||||
_IPX_Broadcast_Packet95@8:
|
||||
mov cl,4
|
||||
; _IPX_Broadcast_Packet95(16) = _IPX_Broadcast_Packet95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: buffer
|
||||
; dword ptr [ebp+12]: param2
|
||||
;
|
||||
public II_IPX_Broadcast_Packet95@8
|
||||
II_IPX_Broadcast_Packet95@8:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
push word ptr [ebp+12] ;param2: dword->word
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
leave
|
||||
retn 8
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_Local_Target95@16
|
||||
_IPX_Get_Local_Target95@16:
|
||||
mov cl,3
|
||||
; _IPX_Get_Local_Target95(16) = _IPX_Get_Local_Target95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: netnum
|
||||
; dword ptr [ebp+12]: node
|
||||
; dword ptr [ebp+16]: param3
|
||||
; dword ptr [ebp+20]: address
|
||||
;
|
||||
public II_IPX_Get_Local_Target95@16
|
||||
II_IPX_Get_Local_Target95@16:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
call SMapLS_IP_EBP_12
|
||||
push eax
|
||||
push word ptr [ebp+16] ;param3: dword->word
|
||||
call SMapLS_IP_EBP_20
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
call SUnMapLS_IP_EBP_12
|
||||
call SUnMapLS_IP_EBP_20
|
||||
leave
|
||||
retn 16
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Shut_Down95@0
|
||||
_IPX_Shut_Down95@0:
|
||||
mov cl,1
|
||||
jmp II_IPX_Shut_Down95@0
|
||||
public _IPX_Initialise@0
|
||||
_IPX_Initialise@0:
|
||||
mov cl,9
|
||||
jmp II_IPX_Shut_Down95@0
|
||||
public _IPX_Get_Connection_Number95@0
|
||||
_IPX_Get_Connection_Number95@0:
|
||||
mov cl,6
|
||||
jmp II_IPX_Shut_Down95@0
|
||||
public _IPX_Start_Listening95@0
|
||||
_IPX_Start_Listening95@0:
|
||||
mov cl,2
|
||||
; _IPX_Shut_Down95(16) = _IPX_Shut_Down95(32) {}
|
||||
;
|
||||
;
|
||||
public II_IPX_Shut_Down95@0
|
||||
II_IPX_Shut_Down95@0:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
leave
|
||||
retn
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public _IPX_Get_Outstanding_Buffer95@4
|
||||
_IPX_Get_Outstanding_Buffer95@4:
|
||||
mov cl,0
|
||||
; _IPX_Get_Outstanding_Buffer95(16) = _IPX_Get_Outstanding_Buffer95(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: buffer
|
||||
;
|
||||
public II_IPX_Get_Outstanding_Buffer95@4
|
||||
II_IPX_Get_Outstanding_Buffer95@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
call SMapLS_IP_EBP_8
|
||||
push eax
|
||||
call dword ptr [pfnQT_Thunk_Thipx]
|
||||
cwde
|
||||
call SUnMapLS_IP_EBP_8
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
ELSE
|
||||
;************************* START OF 16-BIT CODE *************************
|
||||
|
||||
|
||||
|
||||
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
externDef _IPX_Get_Outstanding_Buffer95:far16
|
||||
externDef _IPX_Shut_Down95:far16
|
||||
externDef _IPX_Start_Listening95:far16
|
||||
externDef _IPX_Get_Local_Target95:far16
|
||||
externDef _IPX_Broadcast_Packet95:far16
|
||||
externDef _IPX_Send_Packet95:far16
|
||||
externDef _IPX_Get_Connection_Number95:far16
|
||||
externDef _IPX_Close_Socket95:far16
|
||||
externDef _IPX_Open_Socket95:far16
|
||||
externDef _IPX_Initialise:far16
|
||||
|
||||
|
||||
FT_ThipxTargetTable label word
|
||||
dw offset _IPX_Get_Outstanding_Buffer95
|
||||
dw seg _IPX_Get_Outstanding_Buffer95
|
||||
dw offset _IPX_Shut_Down95
|
||||
dw seg _IPX_Shut_Down95
|
||||
dw offset _IPX_Start_Listening95
|
||||
dw seg _IPX_Start_Listening95
|
||||
dw offset _IPX_Get_Local_Target95
|
||||
dw seg _IPX_Get_Local_Target95
|
||||
dw offset _IPX_Broadcast_Packet95
|
||||
dw seg _IPX_Broadcast_Packet95
|
||||
dw offset _IPX_Send_Packet95
|
||||
dw seg _IPX_Send_Packet95
|
||||
dw offset _IPX_Get_Connection_Number95
|
||||
dw seg _IPX_Get_Connection_Number95
|
||||
dw offset _IPX_Close_Socket95
|
||||
dw seg _IPX_Close_Socket95
|
||||
dw offset _IPX_Open_Socket95
|
||||
dw seg _IPX_Open_Socket95
|
||||
dw offset _IPX_Initialise
|
||||
dw seg _IPX_Initialise
|
||||
|
||||
|
||||
|
||||
|
||||
.data
|
||||
|
||||
public Thipx_ThunkData16 ;This symbol must be exported.
|
||||
Thipx_ThunkData16 dd 3130534ch ;Protocol 'LS01'
|
||||
dd 014cdch ;Checksum
|
||||
dw offset FT_ThipxTargetTable
|
||||
dw seg FT_ThipxTargetTable
|
||||
dd 0 ;First-time flag.
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect16:far16
|
||||
|
||||
public Thipx_ThunkConnect16
|
||||
Thipx_ThunkConnect16:
|
||||
pop ax
|
||||
pop dx
|
||||
push seg Thipx_ThunkData16
|
||||
push offset Thipx_ThunkData16
|
||||
push seg Thipx_ThkData32
|
||||
push offset Thipx_ThkData32
|
||||
push cs
|
||||
push dx
|
||||
push ax
|
||||
jmp ThunkConnect16
|
||||
Thipx_ThkData32 label byte
|
||||
db "Thipx_ThunkData32",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF
|
||||
END
|
104
IPX/THIPX.BAK
Normal file
104
IPX/THIPX.BAK
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
enablemapdirect3216 = true;
|
||||
|
||||
typedef int BOOL;
|
||||
typedef int INT;
|
||||
|
||||
|
||||
typedef struct tag_network_number {
|
||||
unsigned char bytes[4];
|
||||
}network_number;
|
||||
|
||||
typedef struct tag_physical_node {
|
||||
unsigned char bytes[6];
|
||||
}physical_node;
|
||||
|
||||
typedef struct tag_send_address_struct{
|
||||
unsigned char address[6];
|
||||
}send_address_struct;
|
||||
|
||||
typedef struct tag_send_buffer_struct{
|
||||
unsigned char buffer[512];
|
||||
}send_buffer_struct;
|
||||
|
||||
typedef struct tag_get_buffer_struct{
|
||||
unsigned char get_buffer[1024];
|
||||
}get_buffer_struct;
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL _IPX_Initialise(INT)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
INT _IPX_Open_Socket95(INT)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Close_Socket95(INT)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Get_Connection_Number95(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
INT _IPX_Send_Packet95(send_address_struct *address, send_buffer_struct *buffer, INT, network_number *net, physical_node* node)
|
||||
{
|
||||
address = input;
|
||||
buffer = input;
|
||||
net = input;
|
||||
node = input;
|
||||
}
|
||||
|
||||
INT _IPX_Broadcast_Packet95(send_buffer_struct *buffer, INT)
|
||||
{
|
||||
buffer = input;
|
||||
}
|
||||
|
||||
INT _IPX_Get_Local_Target95(network_number *netnum, physical_node *node, short, send_address_struct *address)
|
||||
{
|
||||
netnum = input;
|
||||
node = input;
|
||||
address = output;
|
||||
}
|
||||
|
||||
|
||||
INT _IPX_Start_Listening95(void)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Shut_Down95(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
INT _IPX_Get_Outstanding_Buffer95(get_buffer_struct *buffer)
|
||||
{
|
||||
buffer = output;
|
||||
}
|
||||
|
||||
|
||||
|
86
IPX/THIPX.THK
Normal file
86
IPX/THIPX.THK
Normal file
@@ -0,0 +1,86 @@
|
||||
|
||||
enablemapdirect3216 = true;
|
||||
|
||||
typedef int BOOL;
|
||||
typedef int INT;
|
||||
|
||||
|
||||
typedef struct tag_network_number {
|
||||
unsigned char bytes[4];
|
||||
}network_number;
|
||||
|
||||
typedef struct tag_physical_node {
|
||||
unsigned char bytes[6];
|
||||
}physical_node;
|
||||
|
||||
typedef struct tag_send_address_struct{
|
||||
unsigned char address[6];
|
||||
}send_address_struct;
|
||||
|
||||
typedef struct tag_send_buffer_struct{
|
||||
unsigned char buffer[512];
|
||||
}send_buffer_struct;
|
||||
|
||||
typedef struct tag_get_buffer_struct{
|
||||
unsigned char get_buffer[1024];
|
||||
}get_buffer_struct;
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL _IPX_Initialise(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
INT _IPX_Open_Socket95(INT)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Close_Socket95(INT)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Get_Connection_Number95(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
INT _IPX_Send_Packet95(send_address_struct *address, send_buffer_struct *buffer, INT, network_number *net, physical_node* node)
|
||||
{
|
||||
address = input;
|
||||
buffer = input;
|
||||
net = input;
|
||||
node = input;
|
||||
}
|
||||
|
||||
INT _IPX_Broadcast_Packet95(send_buffer_struct *buffer, INT)
|
||||
{
|
||||
buffer = input;
|
||||
}
|
||||
|
||||
INT _IPX_Get_Local_Target95(network_number *netnum, physical_node *node, short, send_address_struct *address)
|
||||
{
|
||||
netnum = input;
|
||||
node = input;
|
||||
address = output;
|
||||
}
|
||||
|
||||
|
||||
INT _IPX_Start_Listening95(void)
|
||||
{
|
||||
}
|
||||
|
||||
INT _IPX_Shut_Down95(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
INT _IPX_Get_Outstanding_Buffer95(get_buffer_struct *buffer)
|
||||
{
|
||||
buffer = output;
|
||||
}
|
||||
|
||||
|
||||
|
100
IPX/THIPX16C.CPP
Normal file
100
IPX/THIPX16C.CPP
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : Command & Conquer 95 *
|
||||
* *
|
||||
* File Name : THIPX16C.CPP *
|
||||
* *
|
||||
* Programmer : Steve Tall *
|
||||
* *
|
||||
* Start Date : 1/15/96 *
|
||||
* *
|
||||
* Last Update : January 29thth 1996 [ST] *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Overview: *
|
||||
* *
|
||||
* 'C' code for the 16 bit IPX library. This library is 'thunked' down to from a 32bit *
|
||||
* .dll. *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* *
|
||||
* Functions: *
|
||||
* LibMain -- library entry point *
|
||||
* DllEntryPoint -- called each time a new app requests use of the .dll *
|
||||
* *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
BOOL FAR PASCAL Thipx_ThunkConnect16_(LPSTR pszDll16, LPSTR pszDll32, WORD hInst, DWORD dwReason);
|
||||
BOOL FAR PASCAL DllEntryPoint_ (DWORD dwReason, WORD hInst, WORD, WORD, DWORD, WORD);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* LibMain -- library entry point *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
* INPUT: the usual windows rubbish *
|
||||
* *
|
||||
* OUTPUT: true *
|
||||
* *
|
||||
* WARNINGS: None *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 1/29/96 10:45AM ST : Created *
|
||||
*=============================================================================================*/
|
||||
int CALLBACK LibMain (HANDLE, WORD, WORD, LPSTR)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* DllEntryPoint -- called each time a new app requests use of the .dll *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
* INPUT: windows junk *
|
||||
* *
|
||||
* OUTPUT: true *
|
||||
* *
|
||||
* WARNINGS: None *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 1/29/96 10:45AM ST : Created *
|
||||
*=============================================================================================*/
|
||||
BOOL FAR PASCAL DllEntryPoint_ (DWORD dwReason, WORD hInst, WORD, WORD, DWORD, WORD)
|
||||
{
|
||||
if (!Thipx_ThunkConnect16_("THIPX16.DLL", "THIPX32.DLL", hInst, dwReason)){
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
100
IPX/THIPX32C.CPP
Normal file
100
IPX/THIPX32C.CPP
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : Command & Conquer 95 *
|
||||
* *
|
||||
* File Name : THIPX16C.CPP *
|
||||
* *
|
||||
* Programmer : Steve Tall *
|
||||
* *
|
||||
* Start Date : 1/15/96 *
|
||||
* *
|
||||
* Last Update : January 29thth 1996 [ST] *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Overview: *
|
||||
* *
|
||||
* 'C' code for the 32 bit IPX library. This library 'thunks' down to a 16bit .dll *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* *
|
||||
* Functions: *
|
||||
* DllMain -- called each time a new app requests use of the .dll *
|
||||
* *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#define WIN32
|
||||
#ifndef _WIN32 // Denzil 6/2/98 Watcom 11.0 complains without this check
|
||||
#define _WIN32
|
||||
#endif // _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
BOOL WINAPI Thipx_ThunkConnect32(LPSTR pszDll16, LPSTR pszDll32, DWORD hIinst, DWORD dwReason);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* DllMain -- called every time a new app requests use of the .dll *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
* INPUT: usual windoze junk *
|
||||
* *
|
||||
* OUTPUT: true *
|
||||
* *
|
||||
* WARNINGS: None *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 1/29/96 10:55AM ST : Created *
|
||||
*=============================================================================================*/
|
||||
BOOL APIENTRY DllMain(DWORD hInst, DWORD dwReason, DWORD dwReserved)
|
||||
|
||||
{
|
||||
if (! Thipx_ThunkConnect32("THIPX16.DLL", "THIPX32.DLL", hInst, dwReason)) {
|
||||
return FALSE;
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* LibMain -- This just calls DllMain. Watcom erroneously links this in as the entry point! *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
* INPUT: Nothing *
|
||||
* *
|
||||
* OUTPUT: Nothing *
|
||||
* *
|
||||
* WARNINGS: None *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 1/29/96 10:56AM ST : Created *
|
||||
*=============================================================================================*/
|
||||
BOOL APIENTRY LibMain(DWORD hInst, DWORD dwReason, DWORD dwReserved)
|
||||
{
|
||||
return (DllMain(hInst, dwReason, dwReserved));
|
||||
}
|
60
IPX/THMAP16.ASM
Normal file
60
IPX/THMAP16.ASM
Normal file
@@ -0,0 +1,60 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
.8086
|
||||
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externdef pascal Thipx_ThunkConnect16_:far16
|
||||
extern pascal Thipx_ThunkConnect16:near16
|
||||
|
||||
Thipx_ThunkConnect16_ proc far16 pascal
|
||||
|
||||
jmp Thipx_ThunkConnect16
|
||||
|
||||
Thipx_ThunkConnect16_ endp
|
||||
|
||||
|
||||
|
||||
externdef DllEntryPoint:far16
|
||||
extern pascal DllEntryPoint_:far16
|
||||
|
||||
DllEntryPoint proc far16
|
||||
|
||||
jmp DllEntryPoint_
|
||||
|
||||
DllEntryPoint endp
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
142
IPX/THMAP32.ASM
Normal file
142
IPX/THMAP32.ASM
Normal file
@@ -0,0 +1,142 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
;***************************************************************************
|
||||
;** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
|
||||
;***************************************************************************
|
||||
;* *
|
||||
;* Project Name : Command & Conquer *
|
||||
;* *
|
||||
;* File Name : THMAP32.ASM *
|
||||
;* *
|
||||
;* Programmer : Steve Tall *
|
||||
;* *
|
||||
;* Start Date : January 25th, 1996 *
|
||||
;* *
|
||||
;* Last Update : January 29th, 1996 [ST] *
|
||||
;* *
|
||||
;*-------------------------------------------------------------------------*
|
||||
;* Overview: *
|
||||
;* These functions exist simply to map similar function names to each *
|
||||
;* other. *
|
||||
;* *
|
||||
;*-------------------------------------------------------------------------*
|
||||
;* Functions: *
|
||||
;* *
|
||||
;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
|
||||
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
.model FLAT
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Initialise:near
|
||||
externdef __IPX_Initialise@0:near
|
||||
_IPX_Initialise proc near
|
||||
|
||||
jmp __IPX_Initialise@0
|
||||
|
||||
_IPX_Initialise endp
|
||||
|
||||
externdef _IPX_Open_Socket95:near
|
||||
externdef __IPX_Open_Socket95@4:near
|
||||
_IPX_Open_Socket95 proc near
|
||||
|
||||
jmp __IPX_Open_Socket95@4
|
||||
|
||||
_IPX_Open_Socket95 endp
|
||||
|
||||
externdef _IPX_Close_Socket95:near
|
||||
externdef __IPX_Close_Socket95@4:near
|
||||
_IPX_Close_Socket95 proc near
|
||||
|
||||
jmp __IPX_Close_Socket95@4
|
||||
|
||||
_IPX_Close_Socket95 endp
|
||||
|
||||
externdef _IPX_Get_Connection_Number95:near
|
||||
externdef __IPX_Get_Connection_Number95@0:near
|
||||
_IPX_Get_Connection_Number95 proc near
|
||||
|
||||
jmp __IPX_Get_Connection_Number95@0
|
||||
|
||||
_IPX_Get_Connection_Number95 endp
|
||||
|
||||
externdef _IPX_Send_Packet95:near
|
||||
externdef __IPX_Send_Packet95@20:near
|
||||
_IPX_Send_Packet95 proc near
|
||||
|
||||
jmp __IPX_Send_Packet95@20
|
||||
|
||||
_IPX_Send_Packet95 endp
|
||||
|
||||
externdef _IPX_Broadcast_Packet95:near
|
||||
externdef __IPX_Broadcast_Packet95@8:near
|
||||
_IPX_Broadcast_Packet95 proc near
|
||||
|
||||
jmp __IPX_Broadcast_Packet95@8
|
||||
|
||||
_IPX_Broadcast_Packet95 endp
|
||||
|
||||
externdef _IPX_Get_Local_Target95:near
|
||||
externdef __IPX_Get_Local_Target95@16:near
|
||||
_IPX_Get_Local_Target95 proc near
|
||||
|
||||
jmp __IPX_Get_Local_Target95@16
|
||||
|
||||
_IPX_Get_Local_Target95 endp
|
||||
|
||||
externdef _IPX_Start_Listening95:near
|
||||
externdef __IPX_Start_Listening95@0:near
|
||||
_IPX_Start_Listening95 proc near
|
||||
|
||||
jmp __IPX_Start_Listening95@0
|
||||
|
||||
_IPX_Start_Listening95 endp
|
||||
|
||||
externdef _IPX_Shut_Down95:near
|
||||
externdef __IPX_Shut_Down95@0:near
|
||||
_IPX_Shut_Down95 proc near
|
||||
|
||||
jmp __IPX_Shut_Down95@0
|
||||
|
||||
_IPX_Shut_Down95 endp
|
||||
|
||||
|
||||
|
||||
externdef _IPX_Get_Outstanding_Buffer95:near
|
||||
externdef __IPX_Get_Outstanding_Buffer95@4:near
|
||||
|
||||
_IPX_Get_Outstanding_Buffer95 proc near
|
||||
|
||||
jmp __IPX_Get_Outstanding_Buffer95@4
|
||||
|
||||
_IPX_Get_Outstanding_Buffer95 endp
|
||||
|
||||
|
||||
end
|
243
IPX/WWIPX.ASM
Normal file
243
IPX/WWIPX.ASM
Normal file
@@ -0,0 +1,243 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
page ,132
|
||||
|
||||
;Thunk Compiler Version 1.8 May 11 1995 13:16:19
|
||||
;File Compiled Tue Jan 16 13:53:22 1996
|
||||
|
||||
;Command Line: D:\MSTOOLS\BIN\THUNK.EXE wwipx.thk
|
||||
|
||||
TITLE $wwipx.asm
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
IFNDEF IS_16
|
||||
IFNDEF IS_32
|
||||
%out command line error: specify one of -DIS_16, -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_32
|
||||
ENDIF ;IS_16
|
||||
|
||||
|
||||
IFDEF IS_32
|
||||
IFDEF IS_16
|
||||
%out command line error: you can't specify both -DIS_16 and -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_16
|
||||
;************************* START OF 32-BIT CODE *************************
|
||||
|
||||
|
||||
.model FLAT,STDCALL
|
||||
|
||||
|
||||
;-- Import common flat thunk routines (in k32)
|
||||
|
||||
externDef MapHInstLS :near32
|
||||
externDef MapHInstLS_PN :near32
|
||||
externDef MapHInstSL :near32
|
||||
externDef MapHInstSL_PN :near32
|
||||
externDef FT_Prolog :near32
|
||||
externDef FT_Thunk :near32
|
||||
externDef QT_Thunk :near32
|
||||
externDef FT_Exit0 :near32
|
||||
externDef FT_Exit4 :near32
|
||||
externDef FT_Exit8 :near32
|
||||
externDef FT_Exit12 :near32
|
||||
externDef FT_Exit16 :near32
|
||||
externDef FT_Exit20 :near32
|
||||
externDef FT_Exit24 :near32
|
||||
externDef FT_Exit28 :near32
|
||||
externDef FT_Exit32 :near32
|
||||
externDef FT_Exit36 :near32
|
||||
externDef FT_Exit40 :near32
|
||||
externDef FT_Exit44 :near32
|
||||
externDef FT_Exit48 :near32
|
||||
externDef FT_Exit52 :near32
|
||||
externDef FT_Exit56 :near32
|
||||
externDef SMapLS :near32
|
||||
externDef SUnMapLS :near32
|
||||
externDef SMapLS_IP_EBP_8 :near32
|
||||
externDef SUnMapLS_IP_EBP_8 :near32
|
||||
externDef SMapLS_IP_EBP_12 :near32
|
||||
externDef SUnMapLS_IP_EBP_12 :near32
|
||||
externDef SMapLS_IP_EBP_16 :near32
|
||||
externDef SUnMapLS_IP_EBP_16 :near32
|
||||
externDef SMapLS_IP_EBP_20 :near32
|
||||
externDef SUnMapLS_IP_EBP_20 :near32
|
||||
externDef SMapLS_IP_EBP_24 :near32
|
||||
externDef SUnMapLS_IP_EBP_24 :near32
|
||||
externDef SMapLS_IP_EBP_28 :near32
|
||||
externDef SUnMapLS_IP_EBP_28 :near32
|
||||
externDef SMapLS_IP_EBP_32 :near32
|
||||
externDef SUnMapLS_IP_EBP_32 :near32
|
||||
externDef SMapLS_IP_EBP_36 :near32
|
||||
externDef SUnMapLS_IP_EBP_36 :near32
|
||||
externDef SMapLS_IP_EBP_40 :near32
|
||||
externDef SUnMapLS_IP_EBP_40 :near32
|
||||
|
||||
MapSL PROTO NEAR STDCALL p32:DWORD
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
;************************* COMMON PER-MODULE ROUTINES *************************
|
||||
|
||||
.data
|
||||
|
||||
public wwipx_ThunkData32 ;This symbol must be exported.
|
||||
wwipx_ThunkData32 label dword
|
||||
dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dd 0 ;Jump table address.
|
||||
dd 3130424ch ;'LB01'
|
||||
dd 0 ;Flags
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd offset QT_Thunk_wwipx - offset wwipx_ThunkData32
|
||||
dd offset FT_Prolog_wwipx - offset wwipx_ThunkData32
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect32@24:near32
|
||||
|
||||
public wwipx_ThunkConnect32@16
|
||||
wwipx_ThunkConnect32@16:
|
||||
pop edx
|
||||
push offset wwipx_ThkData16
|
||||
push offset wwipx_ThunkData32
|
||||
push edx
|
||||
jmp ThunkConnect32@24
|
||||
wwipx_ThkData16 label byte
|
||||
db "wwipx_ThunkData16",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pfnQT_Thunk_wwipx dd offset QT_Thunk_wwipx
|
||||
pfnFT_Prolog_wwipx dd offset FT_Prolog_wwipx
|
||||
.data
|
||||
QT_Thunk_wwipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
FT_Prolog_wwipx label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;************************ START OF THUNK BODIES************************
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public IPX_Initialise@4
|
||||
IPX_Initialise@4:
|
||||
mov cl,0
|
||||
; IPX_Initialise(16) = IPX_Initialise(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
;
|
||||
public IIIPX_Initialise@4
|
||||
IIIPX_Initialise@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call dword ptr [pfnQT_Thunk_wwipx]
|
||||
cwde
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
ELSE
|
||||
;************************* START OF 16-BIT CODE *************************
|
||||
|
||||
|
||||
|
||||
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
externDef IPX_Initialise:far16
|
||||
|
||||
|
||||
FT_wwipxTargetTable label word
|
||||
dw offset IPX_Initialise
|
||||
dw seg IPX_Initialise
|
||||
|
||||
|
||||
|
||||
|
||||
.data
|
||||
|
||||
public wwipx_ThunkData16 ;This symbol must be exported.
|
||||
wwipx_ThunkData16 dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dw offset FT_wwipxTargetTable
|
||||
dw seg FT_wwipxTargetTable
|
||||
dd 0 ;First-time flag.
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect16:far16
|
||||
|
||||
public wwipx_ThunkConnect16
|
||||
wwipx_ThunkConnect16:
|
||||
pop ax
|
||||
pop dx
|
||||
push seg wwipx_ThunkData16
|
||||
push offset wwipx_ThunkData16
|
||||
push seg wwipx_ThkData32
|
||||
push offset wwipx_ThkData32
|
||||
push cs
|
||||
push dx
|
||||
push ax
|
||||
jmp ThunkConnect16
|
||||
wwipx_ThkData32 label byte
|
||||
db "wwipx_ThunkData32",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF
|
||||
END
|
243
IPX/WWIPX16.ASM
Normal file
243
IPX/WWIPX16.ASM
Normal file
@@ -0,0 +1,243 @@
|
||||
;
|
||||
; Command & Conquer Red Alert(tm)
|
||||
; Copyright 2025 Electronic Arts Inc.
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 3 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
;
|
||||
|
||||
page ,132
|
||||
|
||||
;Thunk Compiler Version 1.8 May 11 1995 13:16:19
|
||||
;File Compiled Tue Jan 16 13:14:21 1996
|
||||
|
||||
;Command Line: D:\MSTOOLS\BIN\THUNK.EXE wwipx16.thk
|
||||
|
||||
TITLE $wwipx16.asm
|
||||
|
||||
.386
|
||||
OPTION READONLY
|
||||
OPTION OLDSTRUCTS
|
||||
|
||||
IFNDEF IS_16
|
||||
IFNDEF IS_32
|
||||
%out command line error: specify one of -DIS_16, -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_32
|
||||
ENDIF ;IS_16
|
||||
|
||||
|
||||
IFDEF IS_32
|
||||
IFDEF IS_16
|
||||
%out command line error: you can't specify both -DIS_16 and -DIS_32
|
||||
.err
|
||||
ENDIF ;IS_16
|
||||
;************************* START OF 32-BIT CODE *************************
|
||||
|
||||
|
||||
.model FLAT,STDCALL
|
||||
|
||||
|
||||
;-- Import common flat thunk routines (in k32)
|
||||
|
||||
externDef MapHInstLS :near32
|
||||
externDef MapHInstLS_PN :near32
|
||||
externDef MapHInstSL :near32
|
||||
externDef MapHInstSL_PN :near32
|
||||
externDef FT_Prolog :near32
|
||||
externDef FT_Thunk :near32
|
||||
externDef QT_Thunk :near32
|
||||
externDef FT_Exit0 :near32
|
||||
externDef FT_Exit4 :near32
|
||||
externDef FT_Exit8 :near32
|
||||
externDef FT_Exit12 :near32
|
||||
externDef FT_Exit16 :near32
|
||||
externDef FT_Exit20 :near32
|
||||
externDef FT_Exit24 :near32
|
||||
externDef FT_Exit28 :near32
|
||||
externDef FT_Exit32 :near32
|
||||
externDef FT_Exit36 :near32
|
||||
externDef FT_Exit40 :near32
|
||||
externDef FT_Exit44 :near32
|
||||
externDef FT_Exit48 :near32
|
||||
externDef FT_Exit52 :near32
|
||||
externDef FT_Exit56 :near32
|
||||
externDef SMapLS :near32
|
||||
externDef SUnMapLS :near32
|
||||
externDef SMapLS_IP_EBP_8 :near32
|
||||
externDef SUnMapLS_IP_EBP_8 :near32
|
||||
externDef SMapLS_IP_EBP_12 :near32
|
||||
externDef SUnMapLS_IP_EBP_12 :near32
|
||||
externDef SMapLS_IP_EBP_16 :near32
|
||||
externDef SUnMapLS_IP_EBP_16 :near32
|
||||
externDef SMapLS_IP_EBP_20 :near32
|
||||
externDef SUnMapLS_IP_EBP_20 :near32
|
||||
externDef SMapLS_IP_EBP_24 :near32
|
||||
externDef SUnMapLS_IP_EBP_24 :near32
|
||||
externDef SMapLS_IP_EBP_28 :near32
|
||||
externDef SUnMapLS_IP_EBP_28 :near32
|
||||
externDef SMapLS_IP_EBP_32 :near32
|
||||
externDef SUnMapLS_IP_EBP_32 :near32
|
||||
externDef SMapLS_IP_EBP_36 :near32
|
||||
externDef SUnMapLS_IP_EBP_36 :near32
|
||||
externDef SMapLS_IP_EBP_40 :near32
|
||||
externDef SUnMapLS_IP_EBP_40 :near32
|
||||
|
||||
MapSL PROTO NEAR STDCALL p32:DWORD
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
;************************* COMMON PER-MODULE ROUTINES *************************
|
||||
|
||||
.data
|
||||
|
||||
public wwipx16_ThunkData32 ;This symbol must be exported.
|
||||
wwipx16_ThunkData32 label dword
|
||||
dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dd 0 ;Jump table address.
|
||||
dd 3130424ch ;'LB01'
|
||||
dd 0 ;Flags
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd 0 ;Reserved (MUST BE 0)
|
||||
dd offset QT_Thunk_wwipx16 - offset wwipx16_ThunkData32
|
||||
dd offset FT_Prolog_wwipx16 - offset wwipx16_ThunkData32
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect32@24:near32
|
||||
|
||||
public wwipx16_ThunkConnect32@16
|
||||
wwipx16_ThunkConnect32@16:
|
||||
pop edx
|
||||
push offset wwipx16_ThkData16
|
||||
push offset wwipx16_ThunkData32
|
||||
push edx
|
||||
jmp ThunkConnect32@24
|
||||
wwipx16_ThkData16 label byte
|
||||
db "wwipx16_ThunkData16",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
pfnQT_Thunk_wwipx16 dd offset QT_Thunk_wwipx16
|
||||
pfnFT_Prolog_wwipx16 dd offset FT_Prolog_wwipx16
|
||||
.data
|
||||
QT_Thunk_wwipx16 label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
FT_Prolog_wwipx16 label byte
|
||||
db 32 dup(0cch) ;Patch space.
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;************************ START OF THUNK BODIES************************
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
public IPX_Initialise@4
|
||||
IPX_Initialise@4:
|
||||
mov cl,0
|
||||
; IPX_Initialise(16) = IPX_Initialise(32) {}
|
||||
;
|
||||
; dword ptr [ebp+8]: param1
|
||||
;
|
||||
public IIIPX_Initialise@4
|
||||
IIIPX_Initialise@4:
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
push ecx
|
||||
sub esp,60
|
||||
push word ptr [ebp+8] ;param1: dword->word
|
||||
call dword ptr [pfnQT_Thunk_wwipx16]
|
||||
cwde
|
||||
leave
|
||||
retn 4
|
||||
|
||||
|
||||
|
||||
|
||||
ELSE
|
||||
;************************* START OF 16-BIT CODE *************************
|
||||
|
||||
|
||||
|
||||
|
||||
OPTION SEGMENT:USE16
|
||||
.model LARGE,PASCAL
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
|
||||
externDef IPX_Initialise:far16
|
||||
|
||||
|
||||
FT_wwipx16TargetTable label word
|
||||
dw offset IPX_Initialise
|
||||
dw seg IPX_Initialise
|
||||
|
||||
|
||||
|
||||
|
||||
.data
|
||||
|
||||
public wwipx16_ThunkData16 ;This symbol must be exported.
|
||||
wwipx16_ThunkData16 dd 3130534ch ;Protocol 'LS01'
|
||||
dd 043bh ;Checksum
|
||||
dw offset FT_wwipx16TargetTable
|
||||
dw seg FT_wwipx16TargetTable
|
||||
dd 0 ;First-time flag.
|
||||
|
||||
|
||||
|
||||
.code
|
||||
|
||||
|
||||
externDef ThunkConnect16:far16
|
||||
|
||||
public wwipx16_ThunkConnect16
|
||||
wwipx16_ThunkConnect16:
|
||||
pop ax
|
||||
pop dx
|
||||
push seg wwipx16_ThunkData16
|
||||
push offset wwipx16_ThunkData16
|
||||
push seg wwipx16_ThkData32
|
||||
push offset wwipx16_ThkData32
|
||||
push cs
|
||||
push dx
|
||||
push ax
|
||||
jmp ThunkConnect16
|
||||
wwipx16_ThkData32 label byte
|
||||
db "wwipx16_ThunkData32",0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ENDIF
|
||||
END
|
Reference in New Issue
Block a user