SUBPAGE TITLE HERE:ROM map

From Data Crystal
Revision as of 17:35, 14 August 2021 by Armagon (talk | contribs)
Jump to: navigation, search

Castle Ids:					Ruler Ids:	(Add + #$11 for Heirs)		Battlefield Map Ids:			        Castle Map IDs:
#$01	Kai					#$01		Shingen Takeda		        Subtract #$01 from castle ID		Add #$15 to Castle ID
#$02	Shinano				#$02		Ujiyasu Hojo					
#$03	Sagami				#$03		Kenshin Uesugi
#$04	Musashi				#$04		Kiyo Murakami
#$05	Kozuke				#$05		Yoshimasa Kiso
#$06	Echigo				#$06		Moto	Imagawa
#$07	N Shinano				#$07		Hiro Matsudaira
#$08	W Shinano				#$08		Nobunaga Oda
#$09	Suruga				#$09		Dosan Saito
#$0A	Totoumi				#$0A		Yori Anekoji									
#$0B	Mikawa				#$0B		Tsuna Hatakeyama
#$0C	Owari				#$0C		General Li		
#$0D	Mino					#$0D		The Ikko Sect
#$0E	Hida					#$0E		Takakage Asakura
#$0F	Etchu				#$0F		Hisamasa Asai
#$10	Noto					#$10		Haru Kitabatake
#$11	Kaga					#$11		Yoshiteru Ashikaga
#$12	Echizen
#$13	Oumi
#$14	Ise
#$15	Yamashiro

Castle DATA Start
	Note: Castle data is loaded into RAM at $6150. ROM Data is #$1A(00 - 25) bytes each, but RAM includes other data and is #$38(00 - 55) bytes each.
	CASTLE DATA CASTLES BY ORDER: KAI, SHINANO, SAGAMI, MUSASHI, KOZUKE, ECHIGO, N SHINANO, W SHINANO, SURUGA, TOTOUMI, MIKAWA, OWARI, MINO, HIDA, ETCHU, NOTO, KAGA, ECHIZEN, OUMI, ISE, YAMASHIRO.


0x016016 - 0x016237	
	BYTE #$00		This byte represents a ruler's capital. Ruler's ID (#$01 - #$11/ + #$11 for heirs)  is stored here if it is The ruler's capital, otherwise, it is     #$00.
	BYTE #$01		Castle controlled (non capital) RULER ID (#$01 - #$11/ + #$11 for heirs)
	BYTE #$02		YIF(YIELD INCREMENTAL FACTOR) This byte directly corresponds to the game's FA-Development Command. Castle Yield is subtracted from this value to determine whether or not to add the Castles Rank to the base YI(YIELD INCREMENTAL - see https://gamefaqs.gamespot.com/nes/587609-shingen-the-ruler/faqs/76326 Territory Management Guide by ireant) of 0x03B7BF(#$28/YIELD), 0x3B85D(#$32/WEALTH). Basically any time the castles yield is above this value, the castles rank is added to the price to increase YIELD/WEALTH via the FA-DEVELOPMENT COMMAND. Setting these values to #$64(#100) or above means that the $$ price to increase YIELD/WEALTH via FA_DEVELOPMENT will never increase.
	BYTE #$03		Castle YIELD
	BYTE #$04		Castle DISASTER
	BYTE #$05		Castle CULTURE
	BYTE #$06		Castle LOYALTY
	BYTE #$07		Castle WEALTH
	BYTE #$08 - BYTE #$09 	Castle $$(money) LOW/HIGH BYTE max #$0F27(#9999)
	BYTE #$0A - BYTE #$0B		Castle PRODUCT; LOW/HIGH BYTE max #$0F27(#9999)
	BYTE #$0C		Castle Gold Mines (#00 - #100)
	BYTE #$0D and BYTE #$0E	unknown.
	BYTE #$0F		Epidemic #$00 = NO / #$01 = YES
	BYTE #$10 - BYTE #$11 	Castle RANK (i think max is #$64(#100), so only the first byte is used)
	BYTE #$12 - BYTE #$13		Castle XP; LOW/HIGH BYTE max I think is #$07E3(#999)
	BYTE #$14 - BYTE #$19		# of troops 1 BYTE each (max #$FF) for each of HQ(headquarters). CAV(Cavalry), RM(Riflemen), AR(Archer), LNC(Lancer), INF(Infantry)
    
Commonly Used Routines:
OFFSET Routine
0x03C92C ($C91C) Addition: Adds a 2 Byte value in $40 - $41+A. Result in $41 - $41.
0x03C938 ($C928) Addition Adds a 2 Byte Value in $40 - $41+Y(Low Byte), X(High Byte) Result in $40 - $41.
0x03C992 ($C982) Multiplication: Multiplies a 2 byte value in $40 - $41xA. Result in $40 - $41
0x03CA2D ($CA1D) Division: Divides a 2 byte value in $40 - $41/A. Result in $40 - $41
0x0391B7 ($91A7) Division: Divides a 2 byte value in $75 - $76 into an exact printable (decimal)value for rendering, across $79 - $7C. The values
                                               correspond to the cursor scroll:																															 
                                                               3 digit wide values = $79(hundreds), $7A(tens), $7B(Ones).	

4 digit wide values = $79(thousands), $7A(hundreds), $7B(Tens), $7C(Ones)

0x039215 ($9205) Multiplication: This is the exact opposite of ($91A7). It takes rendered (decimal)values in $79 - $7C multiples them into
                                                       (hexadecimal)values, and stores them in $75 - $76.
0x03BF0B ($BEFB) Pointer Generator: Creates a 2 Byte CDP(Castle Data Pointer), to the start of "Active Castles" Castle Data. And stores the pointer in
                                                               $7E - $7F
0x03CD3F ($CD2F) Pointer Generator: Creates a 2 Byte CDP(Castle Data Pointer), Requires X loaded with CIP(Castle ID Pointer).
0x03C010($C000) Bank Swap