Source Code Snippets

DID’s Air Dominance Fighter and Total Air War.
Post Reply
User avatar
Krishty
Site Admin
Posts: 1382
Joined: 2022-Jan-09, 00:59

Source Code Snippets

Post by Krishty »

I opened the patches for the Japanese ADF version (the ones listed/linked here) in a hex editor (to find out how patch files are compressed) and was quite surprised to find source code in there.

Code: Select all

		mov	[esi],ax	;convert from 68000 format
		push	esi
		call	[fixroute]
		pop	esi
		mov	ax,[esi]
		cmp	ax,7fffh	;closest?
		jne	@@loop
		ret

_fixdp_		dd	OFFSET fixdp0,OFFSET globfixdp0
_fixroute_	dd	OFFSET fixroute1,OFFSET fixroute2

@@is_problem:	push	OFFSET byte_problem_msg
		call	[_fatal_error]
		ret
iLocateShape	ENDP

		ALIGN	4

fixroute_code	proc	near

; esi = current shape  _shptr_ = start of shape data

fixroute1	proc	near
		mov	ebx,esi
		add	ebx,16

Code: Select all

at
; it only handles exceptions caused when in protected mode
;─────────────────────────────────────────────────────────────────────────


		ALIGN	4

		PUBLIC	c mydiv0

; eax = address of divide instruction
; this routine only

Code: Select all

;		mov	eax,OFFSET ProjOverflow_Y
;		mov	eax,OFFSET ProjBehind
;		ret

;abort_conecheck:
;		mov	eax,OFF

Code: Select all

DD	0		;ptr to smallest y coord
Numpoints	DD	0		;number of points in this poly

div0off		DD	0
;our_ds
The way these snippets are interleaved with other data indicates that their homebrew tool for packing patches did not properly initialize all memory it uses. Windows 95/98 (DID’s/Imagineer’s platform at the time) does not isolate processes. So instead of ending up full of zeros, the uninitialized regions ended up containing whatever happened to be in RAM when some other process previously released the memory – in this case, source code.

I will now check all their patches/installers.
User avatar
Krishty
Site Admin
Posts: 1382
Joined: 2022-Jan-09, 00:59

Re: Source Code Snippets

Post by Krishty »

TAW patches did not come with installers; they were just ZIP files.

The Japanese TAW CD-ROM uses InstallShield. There is one file in its root directory that wasn’t intended for shipping – langdef.h – but it is not giving away much:

Code: Select all

/* ==================================================================
*	Copyright:		Digital Image Design Ltd
*	File:				langdef.h
*	Author:			Roger Godfrey
*	Date:				26th July 1996
*	Format:        Install Sheild
*	Description:   Tells setup.rul which language to use (german, english
*                 French etc...)
*
* ===================================================================== */


/* DEFINES */


/* Use these defines to localise the code.
 * Only define one language at a time!
 */

// English Text:
#define ENGLISH    1

// French Text:
//#define FRENCH   2

// German Text:
//#define GERMAN   3

// Spanish Text:
//#define SPANISH 4

// Italian Text:
//#define ITALIAN 5
All four ADF patches contain the same source snippets.

The RSO installer does not seem to contain source snippets, but probably other interesting stuff (search for .MPG).

Japanese ADF installer and Desert Storm installer (Japanese version of RSO) yet to be analyzed.
User avatar
Krishty
Site Admin
Posts: 1382
Joined: 2022-Jan-09, 00:59

Re: Source Code Snippets

Post by Krishty »

The problem wasn’t specific to Imagineer, though. Download any of the official ADF patches and you see:

Code: Select all

uteForGroup
	Return:			n/a
	Parameters:		n/a
	Description:
--------------------------------------------------------------------- */
char GetRouteForGroup(short group_ID) {
	int mapposx;
	int mapposz;
	long dx, dz;
	short i;
	ROUTE_DIRECTION_ETYPE direction1,direction2,bad_direction;
	ROUTE_TYPE_ETYPE route_type;

	nb_gb_routes = 0;
	mapposx=(groups[group_ID].position[0]>>tileshift);
	mapposz=(groups[group_ID].position[2]>>tileshift);

	switch(groups[group_ID].vehicle

Code: Select all

* Tidy up file stuff */
	CloseParser( pf );
	fileClose(file_handle);

   /* Return the apropriate value in the parameters */
   *number_of_gbvtypes = gbv_count;
   return(TRUE);
}

Scorpion82
Pilot
Posts: 66
Joined: 2022-Oct-17, 17:07

Re: Source Code Snippets

Post by Scorpion82 »

That raises the question whether that langdef file is also available in EF2000, or at least SEF2000? If I'm not mistaken, the insignias/roundles used in F-22 are not impacted by the installed game language though.
mikew
Data Genius
Posts: 617
Joined: 2022-Jan-09, 20:21

Re: Source Code Snippets

Post by mikew »

That's what I thought, as the words 'italian' and 'spanish' are present in the SEF2000 exe, although we don't think there were SEF2000 versions for those languages. It's not the same definition file though, as they are not in the same order.
ef_lang_ida.PNG
ef_lang_ida.PNG (9.06 KiB) Viewed 93 times
...or it's just TFX code, which did have all those languages.
Post Reply