SUBPAGE TITLE HERE:RAM map
$65E8 - $65FF Castle list The routine used to generate this list is designed to create a specific order. Starting with the Players Capital, then Player controlled territories Highest to lowest, Then Comp controlled territories Highest to lowest. The last 3 bytes are reserved for Player territories chosen to act for the month (Captial is always chosen). It determines how the scroll works on the world map as well as Battlefield map selected. Pretty sure its also used to generate pointers to Castle data RAM.
$7000 Current Battlefield Map ID The Battlefield Map is determined by the Castle List. When selecting a manual battle The selected castle is stored into $3FD. Battlefield Maps are then chosen via $90CB which simply Decrements the Value and Stores it into $7000 for a range of Field Maps (#$00 - #$14) the exact number of castles #21. Castle Maps are selected from this same value the exact same way, but when a castle battle is chosen #$15 is added to $3FD via $917E so when its decremented your given a range of castle maps that correspond with the field maps #$15 - #$29 the exact number of castles 21.
$7032 Battle turn count
$70F4 - $70FF TOTAL TROOP COUNT Player/Comp (HQ, CAV, RM, AR, LNC, INF) this is used in conjunction with $70D0 - $70DC to determine after battle rewards (XP, Money, Product)
$70D0 - $70DC AFTER BATTLE TROOP COUNT REMAINING Player/Comp (HQ, CAV, RM, AR, LNC, INF)
Auto Battle Data: Note this is also apparent during manual battles but use $4A0 instead. Attacker data: Defender Data is + #$10 $300 Ruler ID (#$00-#$11/ +#$11 for heirs) of Attacking castle $301 Equal to $300 (Castle RULER ID) if it is the RULER's Capital, otherwise = 00 $302 - $303 Attacker Rank (though afaik the Rank only goes up to #100 so idk why its given a high byte) $304 - $305 Attacker XP $306 - $30B # of troops (HQ, CAV, RM, AR, LNC, INF) $30C CIP(Castle ID pointer) MANUAL FIELD BATTLE Statistics
0x3748A - 0x374A7 Field unit battle statistics: (HQ, CAV, RM, AR, LNC, INF) #$05(00 - 04) bytes each BYTE #$00 Movement Range (# of squares) BYTE #$01 Attack Range (only RM and AR # of squares) BYTE #$02 Melee Damage BYTE #$03 Ranged Damage BYTE #$04 Defense
$4A0 - $4CF(player data) $4D0 - $4FF(Comp data) Field unit statistics Each army has 12 units: (1 HQ, 2 each of CAV, RM, AR, LNC, and 3 INF) #$04(00 - 03) bytes each BYTE #$00 Unit ID (00 - 05)
00 = HQ 01 = CAV 02 = RM 03 = AR 04 = LNC 05 = INF
BYTE #$01 Unit X coord BYTE #$02 Unit Y coord BYTE #$03 Unit # of troops
$700E Selected Unit Movement
$700F Selected Unit ID (#$00 - #$0B: HQ, CAV1, CAV2, RM1, RM2, AR1, AR2, LNC1 LNC2, INF1, INF2, INF3)
$7010 Selected Unit # of troops (written from $ 4A0 - $4FF)
$7033 Slected Unit Movement (once movement is selected)
$7088 2 bytes (low/high byte) Attacker Unit Damage if succesful Rush command initiated
$708A 2 bytes (low/high byte) Defender Unit Defense if Rush command initiated.
$708C Player's Castle Rank
$708D Computer Castle Rank
$70C4 - $70CF Unit Action Flag: For all 12 units (HQ, CAV1, CAV2, etc) Note shared by player and computer. A value of #$01 means units action has been confirmed for current turn. A value of 00 means unit has yet to act.