-----------------------------------------------------------------------------
File name:	shipaddr.txt		Revision date:	2000.09.12
					Revision start:	2000.09.12
Revised by:	Ronald Andersson	Email:	dlanor@ettnet.se
Created by:	George Hooper		Email:	hooperh@ix.netcom.com
-----------------------------------------------------------------------------
Format:		Normal Ascii with 78 char line limit and 8 char tab spacing.
Origin:		"add1.doc" and "addr2.doc" from the archive "ffehack.zip".
-----------------------------------------------------------------------------
Revisions made:
Converted text from 'windows Words' to normal text format respecting 78
characters limit on line length (for readability in most resolutions).
In switching from the 160 char format it was also necessary to move some
text around, so as to make contiguous blocks of information lines that
belong together.  (eg: the verbose version descriptions)  Finally I have
added some clarifications at the end of the text, to describe things that
the original author overlooked (or took for granted).
-----------------------------------------------------------------------------
FRONTIER: FIRST ENCOUNTERS HEX ADDRESSES

Sh	Na			Eng-CD	Eng-CD	Eng-CD	Eng-FD	Eng-FD
ID	ID	ITEM		v1.01	v1.05	v1.1R	v1.02	v1.1R

04	00	Dummy Mine	088A80	088B94	088E48	088684	088C18
05	01	Proximity Mine	088B06	088C1A	088ECE	08870A	088C9E
06	02	Homing Missile	088B90	088CA4	088F58	088794	088D28
07	03	Smart Missile	088C1A	088D2E	088FE2	08881E	088DB2
08	04	Naval Missile	088CA4	088DB8	08906C	088898	088E3C
09	05	MV1 A.Missile	088D2E	088E42	0890F6	088932	088EC6
0A	06	MV2 A.Missile	088DB8	088ECC	089180	0889BC	088F50
0B	07	Tharg. Missile	088E42	088F56	08920A	088A46	088FDA
0C	08	Mycoid Missile	088ECC	088FE0	089294	088AD0	089064
0D	09	Nuclear Missile	088F56	08906A	08931E	088B5A	0890EE
0E	0A	Escape Capsule	089052	089166	08941C	088C56	0891EA
0F	0B	Inter Shuttle	089296	0893AA	08965E	088E9A	08942E
10	0C	StowMaster	0894A2	0895B6	08986A	0890A6	08963A
11	0D	Unknown_11	0895AC	0896C0	089974	0891B0	089744
12	0E	Lifter		089902	089A16	089CCA	089506	089A9A
13	0F	Osprey		089BF8	089D0C	089FC0	0897FC	089D90
14	10	Falcon		08A01C	08A130	08A3E4	089C20	08A1B4
15	11	Hawk		08A0E2	08A1F6	08A4AA	089CE6	08A27A
16	12	Kestrel		08A1F8	08A30C	08A5C0	089DFC	08A390
		. IXI .
17	14	Eagle Mk I	08A628	08A73C	08A9F0	08A22C	08A7C0
18	15	Eagle Mk II	08A6B4	08A7C8	08AA7C	08A2BB	08A84C
19	16	Eagle Mk III	08A740	08A854	08AB08	08A344	08A8D8
1A	17	Sidewinder	08AA58	08AB6C	08AE20	08A65C	08ABF0
1B	18	Krait		08AE0C	08AF20	08B1D4	08AA10	08AFA4
1C	19	Gecko		08B18E	08B2A2	08B556	08AD92	08B326
1D	1A	Adder		08B542	08B656	08B90A	08B146	08B6DA
1E	1B	Viper		08B8A6	08B9BA	08BC6E	08B4AA	08BA3E
1F	1C	Saker III	08BF70	08C084	08C338	08BB74	08C108
20	1D	Osprey X	08C27A	08C38E	08C642	08BE7E	08C412
21	1E	Merlin		08C7BA	08C8CE	08CB82	08C3BE	08C952
22	1F	Viper MkII	08CB0A	08CC1E	08CED2	08C70E	08CCA2
23	20	Gyr		08D25E	08D372	08D626	08CE62	08D3F6
24	21	Cobra Mk I	08D618	08D72C	08D9E0	08D21C	08D7B0
25	22	Moray		08D9BC	08DAD0	08DD84	08D5C0	08DB54
26	23	Cobra Mk III	08DDF8	08DF0C	08E1C0	08D9FC	08DF90
27	24	Constrictor	08E1DE	08E2F2	08E5A6	08DDE2	08E376
28	25	Asp Explorer	08E5AA	08E6BE	08E972	08E1AE	08E742
29	26	Lanner		08E870	08E984	08EC38	08E474	08EA08
2A	27	Harris		08EE40	08EF54	08F208	08EA44	08EFD8
2B	28	Spar		08F66E	08F782	08FA36	08F272	08F806
2C	29	Wyvern		08FAD0	08FBE4	08FE98	08F64D	08FC68
2D	2A	Skeet		08FFDC	0900F0	0903A4	08FBE0	090174
2E	2B	Turner		090870	090984	090C38	090474	090A08
2F	2C	Lanner II	090B70	090C84	090F38	090774	090D08
30	2D	Harrier		08EE44	0913B8	09166C	090EA8	09143C
31	2E	Unknown_31	0914F6	09160A	0918BE	0910FA	09168E
32	2F	Unknown_32	0915A4	0916B8	09196C	0911A8	09173C
33	30	Unknown_33	091838	091950	091C04	091440	0919D4
34	31	Unknown_34	0919AC	091AC0	091D74	0915B0	091B44
35	32	Transporter	091D38	091E4C	092100	09193C	091ED0
36	33	Lion		0922D4	0923E8	09269C	091ED8	09246C
37	35	Tiger		09268E	0927A2	092A56	092292	092826
38	36	Imp Courier	092928	092A3C	092CF0	09252C	092AC0
39	38	Python		092D30	092E44	0930F8	092934	092EC8
3A	37	Imp Trader	092DC8	092EDC	093190	0929CC	092F60
3B	39	Anaconda	093128	09323C	0934F0	092D26	0932C0
3C	34	Puma		0936B0	0937C4	093A78	0932B4	093848
3D	3A	Boa		093A38	093B4C	093E00	09363C	093BD0
3E	3B	Panther		093AD4	093BE8	093E9C	0936D8	093C6C
	3D	- NA -
3F	3E	Unknown_3F	093C38	093D4C	094000	09383C	093DD0
40	3F	Tiercel		09268E	09428C	094540	093D7C	094310
41	40	Imp Explorer	0949D6	094AEA	094D9E	0945DA	094B6E
	41	Vaccine		094AA6	094B5A	094E0E	09464A	094BDE
42	42	IRMA		095220	095334	0955E8	094E24	0953B8
43	43	Mantis		095B6A	095C7E	095F32	09576E	095D02
44	44	Griffin		0960BC	0961D0	096484	095CC0	096254
45	45	Thargoid	096430	096544	0967F8	096034	0965C8
46	3C	Lynx BC		096544	096658	09690C	096148	0966DC
47	46	LR Cruiser	0967E6	0968FA	096BAE	0963EA	09697E

Eng-CD v1.01  =  CD Rom  =  English Release 1.01 - 13/04/95
Eng-CD v1.05  =  CD Rom  =  English Release 1.05 - 15/05/95
Eng-CD v1.1R  =  CD Rom  =  English Release 1.1 [Remastered Version]
Eng-FD v1.02  =  3.5in Disk  =  English Release 1.02 - 21/04/95
Eng-FD v1.1R  =  3.5in Disk  =  English Release 1.1 [Remastered Version]


	The hex addresses above are the starting positions for the string
	of ship bytes to follow, starting with the first F-THR byte.

F-THR R-THR GM SM FLM   IC    COST  ZOOM  ID    CW    MP    DV
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 40 xx 00 xx 00 xx


F-THR	Forward  Thrust. Max values are about 60.1g = 32427 = 7E AB. Type
	into code AB 7E.

R-THR	Reverse Thrust. Max values are 60.1g = 65536 - 32427 = 33109 = 81 55.
	Type into code 55 81. Generally, you will get about 1 g for every 545
	decimal value added.

GM	Gun Mounts. Up to 4 can be added.  Best on ships with low profiles,
	so the hull doesn't block the view.  Not all turret mounted guns
	will work on all ships (blows up),  but it's great to have them for
	the view.

SM	Scoop Mount. Works on all ships. Value is not saved in the gamefile.
	Scoop and accessories work as long as you do not sell them.

FLM	Fully Laden Mass. Value is not saved in the gamefile, so reloading
	reverts back to the original.  Keeping a low FLM in the .EXE file is
	usually ok, as the IC will still be the same.  The mass will also be
	used to determine your hyperspace jump range per the formula:

	Jump Range = (Class)(Class)(300) / Mass
	exception: drive class 8 use 9,  class 4 military use 20

IC	Internal Capacity.  The maximum is a total of 65535 for the ship, of
	which the IC is only part of that. 16,000 is a good number, gives you
	10,000 for cargo after all equipment is installed.

COST	Multiply by 1000 to get the total. Numbers past 8000 have problems.
	Good way to make cash fast.  Make the value of your saved ship
	8,000,000, and the value of the ship you will buy 1,000.  Once you
	buy it, you're rich! Repeat the process for mega-millions. Note that
	there is a reset of the credits just past 214 million. At this point
	a negative sign will be placed in front of the credits, and you lose
	all your funds.

ZOOM	View size of the ship in the status windows and outside views.

SH ID	Ship ID Number. Used in gamesaves and the two default startup ships.
	Changing it will give you different ships.

NA ID	Name ID number. Changing it will give you different ship names.

CW	Crew. One is all we ever want.

MP	Missile Pylons. Up to 10 (0A) can be used. Value is not saved in the
	gamefile.

DV	Drive. Hyperspace Drives 1 - 8, Military Drives 1 - 4, Thargoid Drive
	8. Square the drive number to get the amount of fuel required for
	a maximum jump.  Exception. for Class 8 use the number 9, and for
	Class 4 Military use the number 20.

Notes

·	Hacked ships in the .EXE file can kill you. Pirates will buy them and
	mount the biggest gun they have room for. The best way is to hack
	your ship, buy and save it, then change the numbers in the .EXE file
	back to the original.Minor changes like number the number of missiles
	(10) can be left in with noproblem.

·	A small Fully Laden Mass and a large Hyperdrive will allow you to fly
	throughout the galaxy.

·	At 60.1g, you will be almost as fast as a missile (60.5g). You can
	easily outfly all other ships. Many more time completion missions can
	be performed.

·	Particle Accelerators do not use a Laser Cooling Booster.

·	Shields DO use an Energy Booster Unit. 300 shields is usually more
	than sufficient. Over 1023, and the number of shields starts back at
	zero.

George Hooper   hooperh@ix.netcom.com
-----------------------------------------------------------------------------
The above ends the original text by George Hooper.
-----------------------------------------------------------------------------
Here follow notes added during the revision by Ronald Andersson:

These cover the following subjects:
-----------------------------------
Additional patch bytes
Better thrust calculation details for F-THR and R-THR patch bytes
Drive codes for use in the DV patch bytes
Class 4 Military Drive calculations
-----------------------------------------------------------------------------
Additional patch bytes:

The above defines a block of 21 patch bytes for each ship type, and below
I have extended that to one more byte immediately following the 21st.  But
in addition to those 22 bytes there are several others, although some of
the 'ship' types don't have them (eg: missiles have no gun coordinates).

The first ten bytes after the 22 always exist, and are always 5 16bit words.
The first word defines the rating points*256 caused by killing such ship.
The next two words define the shiprelated coordinates of the front view
'camera', the 1st word for the length axis and the 2nd for the vertical.
The final two words define similar coordinates for the rear view 'camera'.
The coordinates are all signed numbers.

Immediately after those, thus starting at an offset of 32 ($20) from the base
address, come the gun mount and turret coordinates.

To find the right offset for these coordinates in 'hexed', relative to the
base of a patch area, you need to go down two lines and then back two bytes.

Each ship type only has the coordinates needed by the gun mounts defined for
that ship type in the original unhacked FFE, so don't attempt to patch any
other guns.  That will in fact be the start of some other table and making
changes there may cause bugs that prevent proper operation.

Eg:  I added funtional gun mounts and turrets to a dummy mine (!?!), and
     that affected the display of a proximity mine, which is the next table.
     However, in this case it hardly matters, as no one gets close enough
     to such a mine to care what it looks like in detail. (As it blows up!)
     By also patching other entries, I made the dummy into a functional ship,
     which had some neat properties (FLM = 1 ton).

For each defined gun there are two 16bit words (so 4 bytes), each of which
defines the distance from a reference coordinate to the point where the gun
beam will exit.  If that beam is inside the hull you have a suicidal ship !

However, front and rear guns seem to be treated differently from turrets in
this respect, because some of the original ships do have zeroed coordinates
for the front and rear guns which work fine with that.  Turrets do not...!


All guns are assumed to be centred sideways, so you can only define position
along the front-rear axis (the first 16bit word) and along the up-down axis
(the second 16 bit word).  It is not a good idea to place a gun far outside
the ship, but it is even worse to place it inside (for obvious reasons).

The order in which gunmounts are defined is always the same:

offset	Gun mount or turret	Exists if original GM byte was
------	-------------------	------------------------------
  20	Front gun mount		nonzero
  24	Rear gun mount		larger than 1
  28	Top turret		larger than 2
  2C	Bottom turret		larger than 3
-----------------------------------------------------------------------------
Better thrust calculation details for F-THR and R-THR patch bytes:

These values are signed 16bit values, scaled such that 1G is exactly a value
of +545 == $0221 for F-THR, and -545 == $FDDF for R-THR.  The latter needs
to be negative as it will be used to reduce forward speed (or to back).
The decimal form of the negative values can be calculated as:

	neg_value = (65536 - pos_value)

In both cases the finished value will need to be converted to hex, and then
entered in the usual reversed order (low byte first, high byte second).

It is of interest to note that the highest values used by the original game
is $7FBC, the forward thrust of the fastest missiles.  The negative value of
that, as useful for reverse thrustors, is $8044.  Using larger values does
not seem safe, as I think the game adds some offsets to these values in some
cases, without checking for overflow.  That could cause weird effects if the
raw thrust value was too close to overflow from the start. (reversed effects)
-----------------------------------------------------------------------------
Drive codes for use in the DV patch bytes:

The original author described this entry as a single byte, but there are
really two bytes here.

Each of the two bytes specifies a drive that can be supplied with the ship,
either when bought by the user, or when assigned to internal commanders, such
as pirates, traders, police, and base defenders.  In short, your opposition.
The code values used for each drive type are shown in a table further below.

The user will always get the drive specified by the LSB byte (the first one),
but internal commanders can get either that or the drive specified by the MSB
byte (the second one).  Additionally the top bit of the MSB byte is also used
as a flag for ships that have a fixed drive, making it impossible for a user
to switch to another drive in shipyards. Clearing the bit will allow fitting
any available drive that the ship has room for.

Drive code table:
-----------------
Code  Drive designation
 00   No drive
 01   Interplanetary drive
 02   Class 1 Hyperdrive
 03   Class 2 Hyperdrive
 04   Class 3 Hyperdrive
 05   Class 4 Hyperdrive
 06   Class 5 Hyperdrive
 07   Class 6 Hyperdrive
 08   Class 7 Hyperdrive
 09   Class 8 Hyperdrive      (hyperrange class 9)
 0A   Class 1 Military Drive
 0B   Class 2 Military Drive
 0C   Class 3 Military Drive
 0D   Class 4 Military Drive  (hyperrange class 20)
 0E   Unknown (Thargoid)      (hyperrange class 9)
-----------------------------------------------------------------------------
Class 4 Military Drive calculations:

Normally this drive is only available for 'Turner Class' ships, so you have
to take on the "Argent's Quest" mission to get one, as such ships are not
for sale on the open market.

In fact the Class 4 Military drive has 3 different and  unrelated class
characteristics.  The range is calculated as for hyperspace class 20, but
internal fuel consumption is like a class 4 drive, while hyperspatial fuel
consumption is uniquely calculated so as to consume 1 unit of fuel per 24
hours (rounded up, as always for hyperspace fuel consumption).  That would
correspond to a drive class of the square root of 7 (appx 2.65).

But that is not the full story, as there is also a limiting factor to the
distance each fuel unit will contribute, but for heavy ships the above will
be true.  For light ships, the following formulae will need to be considered.

power = 400;  norm_max_fuel = 7;  max_dist_per_fuel = 300

range = (power * 300) / mass;             /* 120000/mass */
ref_mass = power / norm_max_fuel;         /* 57.14 tons  */
lim_factor = round_up( mass / ref_mass );
dist_per_fuel = 300 / lim_factor;

max_fuel_used = round_up( range / dist_per_fuel);

That will give correct fuel consumption for ships making maximum jumps,
and for shorter jumps you simply use a slightly altered formula like this:

real_fuel_used = round_up( real_dist / dist_per_fuel);

NB: Similar, but not identical, formulae apply to other drives, although it
    will not normally be noticeable when used in a ship of normal size for
    that drive (nor in larger ships).
-----------------------------------------------------------------------------
End of file:	shipaddr.txt
-----------------------------------------------------------------------------
