Random++	11:01:22 PM 6/30/08
+-+-+-+-+-+-+

  The latest demo of the randomizer patch.  Here's what this version does:
1)  You can use random bodies (FF) in actions BD, BE, and object 09
2)  You can use 2710+ presets in object 09
3)  Allows random bodies and heads in the multiplayer select menu (FF for either)
4)  Players can choose the same character slot
5)  Adds Random to character menu, pushing default # to 9
6)  !Revised! Upon game completion allows all characters multi; number dynamically set, so no need to update the value
7)  !Revised! Allows random bodies in character introductions; use value 0xFF
8)  Eliminates five TLB pointers from 21990 tied to Bond in intro
9)  Revision of random weapons in intro; see 21990 below
10) Halves the size of the intro block at 0xA870
11) !NEW! Accounts for player perspective, in solo and multiplayer!
12) !NEW! Eliminates need for the watch arm entry in body/head table
13) !NEW! MP character select entries are half the size, allowing up to 128 entries
14) !NEW! Reconfigured single-region text table allows one more text bank entry
15) !NEW! All stage numbers now load a valid text bank - no more endless loops!
16) !NEW! Player spawns can use 2710+ presets; spawns may exceed 15
17) !NEW! Newly revised smartspawns patch incorporated
18) !NEW! Intro animation block reduced to half the size
19) !NEW! Stage intro animations reduced to half the size
20) !NEW! Random multiplayer death table is half the size; half the size = x2 entries
21) !NEW! Revised legal screen format.  You can tack in a few lines, like patch ID
22) !NEW! Major revision of monitor animations

+-+-+-+-+-+-+

  Here's changes to the 21990:
1) Revised intro weapon block:	block is revised if 0xACE4 != 000000D0
  New format:
0xACE4	1	# models when unarmed; max of 3
0xACE5	1	# pistol models; max of 15 (0xF)
0xACE6	1	# rifle models; max of 12 (0xC)

0xACA8-0xACC0	rifle models; each entry 2 byte model #
0xACC0-0xACDE	pistol models; each entry 2 byte model #
0xACDE-0xACE4	unarmed models; each entry 2 byte model #

  Feel free to set these to any valid object ID.  Remember to alter the number of entries if you add or remove anything.
  This patch lists almost every weapon in the game.  You can reduce this to the original number if you wish.

2) Random Body/Head Table:	block is revised if BF78 != 0
  New format:
0xBF70	RESERVED for number of entries (filled at runtime)
BF74	RESERVED for current entries (filled at runtime)
BF78-C0B0	table of bodies/heads

  Table consists of a list of body values ending with FF, followed by male heads ending with FF, followed by female heads ending with FF.
  The table is fully dynamic so the number of entries and offsets to each are computed at runtime.

3) Added "Random" to character select table at 0xA408

4) 0x30D5C - 0x30D70 set to zero.  TLB pointers no longer needed

5) Intro Character List:	block is revised if 0xA870 != 00000005
  Block may span from 0xA870-0xAB2C.  Each entry now 10 (0xA) bytes each.  70 (0x46) entries maximum.
  Intros end at an entry with +0x9 set nonzero.  That character is not used.  Leave the body set to 00 on the last entry to ensure proper function.
  New format:
0x0	1	body.  0xFF for random
0x1	1	head.  0xFF (or any negative number) for random
0x2	2	text 1
0x4	2	text 2
0x6	2	text 3
0x8	1	1= credits only
0x9	1	nonzero ends the list

6) MP Character List:	block is revised if the byte at 0xA704 is set to -1 (0xFF)
  Block may span from 0xA408-0xA708.  Each entry now 6 bytes each.  128 (0x80) entries maximum.
  The list size is deterimined dynamically.  The last entry must have the flag set to function properly.  0xA704 should ALWAYS be set to 0xFF to ensure the table ends at some point and to mark a revised binary.
  New format:
0x0	2	text ID
0x2	1	end flag; normally 0, -1 (FF) marks last entry
0x3	1	portrait
0x4	1	body.	0xFF for random
0x5	1	head.	0xFF for random

  Perspective and gender are drawn from the body entries in the Body/Head Table.

7) Max MP Character Register:
  The value at 0xA404 is no longer necessary with a revised list.  It is dynamically set at runtime.  It is highly advised to set it to zero (00000000)
  The value is now read as a halfword at 0xA404 and 0xA407 is a register to indicate if the 'all MP characters' code has been triggered.
  Setting 0xA407 nonzero is now the trigger for all MP characters available.
  Completing Cradle activates the full list of multiplayer characters, however many there happen to be.

8) Text String Lookup	block is revised if 0x27744 is != 0
  The table spanning 0x27744-0x278AC is reduced to only entries for one region game.
  Offsetting is in use, so the first entry (LameX) starts at 0x27744.
  If japanese text support is enabled, only one additional entry (B4XX) is allowed.  More can be added if wide character support is disabled.

9) Assigned Stage Text Banks	block is revised if 0x3ADD0 != 7F0C
  The table of TLB pointers from 0x3ADD0-0x3AE88 has been replaced with the data they recover.
  Each value is the first byte of the textID# >> 2.  First entry corresponds to stage 9.  Invalid stages (>0x37) default to stage 9's entry.
  This corrects a lookup issue that can cause an infinite loop for stages with unassigned text IDs.  

10) Intro Animation Table	block is revised if 0xAB2C != 0000003F
  Block may span from 0xAB2C-0xAC9C. Each entry is now 0x8 bytes each.  45 (0x2D) plus terminating entry maximum.
  Table ends with a negative animation value (usually FFFF).
  New Format:
0x0	2	animation value
0x2	2	start point
0x4	2	rate, multiplied by 10000 (0x2710)
0x6	2	applicable weapon set; 0-unarmed, 1-pistols, 2-rifles

  The format now corresponds roughly to that of the 0A animation command.  0A doesn't specify a rate, but 2710 (100%) or 1388 (50%) work well.
  Intro animations are set to run until complete.


11) Stage Intro Animation Table	block is revised if 0x15788 != 00005744
  Block may span from 0x15788-0x15818.  Each entry now 0x8 bytes each.  18 (0x12) entries maximum.
  New Format:
0x0	2	animation value
0x2	2	start point
0x4	2	end point; -1 runs for duration
0x6	2	rate, multiplied by 10000 (0x2710)

  An additional nine entries can be added to the list.
  The format corresponds roughly with that of the 0A animation command.  0A doesn't specify a particular rate, but 1388 or 2710 work well for most animations.
  A sample entry would be:
0069 001D FFFF 1840
  When used, bond fixes his tie and cufflinks.  If you only wish to see him fix the cufflinks, move the start point:
0069 0040 FFFF 1840
  Likewise, you can use an endpoint so he only fixes the tie:
0069 001D 0040 1840

12) Body and Head Index 	revised if 0x1D088 != 3F800000
  Block may span from 0x1D088-1D6D4.  Each entry now 0xC bytes each.  Currently only entries 00-7F are supported, though this may change.
  As a special note, an entry is no longer required for the left hand model.
  New Format:
0x0	4	pointer to object header data
0x4	4	pointer to recall lookup string
0x8	2	perspective * 10000 (0x2710)
0xA	1	gender flag; 0-female: 1-male
0xB	1	head flag; 1 indicates a head model is present

  Perspective and y-offset are merged into one value.  It is saved as an unsigned integer multiplied by 10000 (0x2710).  A value of 1.0 would be 0x2710, a value of 0.5 0x1388, etc.

13) Monitor Animations
  [fill in silly]

+-+-+-+-+-+-+

Revised SmartSpawns Usage:
  SmartSpawns is a special feature that allows spawn points to selectively be 'turned off' depending on the number of players in the stage.  By using set values, it ensures that roms that do not allow smart spawns simply ignore the feature.
  This is done by setting flags in the spawn's "set" value.  When a flag is set, it disables the spawn for the given number of players.
00	spawn normally
10	do not allow in solo
20	do not allow 2 player
40	do not allow 3 player
80	do not allow 4 player

  In this revision, the flags can be combined.  For instance, 60 would disable the spawn in both 2 and 3 player, but allow it in solo and 4 player.
  SmartSpawn flags can not be set in spawns used for introductory movies, or it will not be able to match the set number for the spawn to that used in the movie.

-------------
Known issues:
  4-player matches in certain stages with randomly-generated characters can overload memory and cause the game to crash.  Then again, selecting the same characters under the same conditions would also do so.  A necessary evil.
  Selecting a random body but using a fixed head does not check the head's gender, and special characters supercede the head selection.
  The terminating entry for the intro block can not use character bodies 0C-0F, 27, or 28.  It is recommended to set all data in this final entry to 00 to ensure the best possible compression.

-------------
To-do list:
  Find the roving camera for intros.
  Link SmartSpawns into all intro set values.
  Diminish movement animation tables - at least kill NULL entries
  Overhaul ammo crate code to eliminate unused features and allow collecting all ammo types
  Overhaul MP weapon set code

-Zoinkity
