World Map Scripts

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

The Main Routine that handles how the World Map Scripts are read, more research to be done.

00091238: 27bdffd8 addiu r29,r29,0xffd8			  
0009123c: 3c03800d lui r3,0x800d				  
00091240: 8c634674 lw r3,0x4674(r3)				  
00091244: 00042040 sll r4,r4,0x01				  
00091248: afbf0024 sw r31,0x0024(r29)			  
0009124c: afb40020 sw r20,0x0020(r29)			  
00091250: afb3001c sw r19,0x001c(r29)			  
00091254: afb20018 sw r18,0x0018(r29)			  
00091258: afb10014 sw r17,0x0014(r29)			  
0009125c: afb00010 sw r16,0x0010(r29)			  
00091260: 00832021 addu r4,r4,r3				  
00091264: 94820000 lhu r2,0x0000(r4)			  
00091268: 3c04800d lui r4,0x800d			r4 = 0x800d0000
0009126c: 24844648 addiu r4,r4,0x4648			r4 = 0x800d4648
00091270: 3042fffe andi r2,r2,0xfffe			
00091274: 00621821 addu r3,r3,r2				
00091278: ac830000 sw r3,0x0000(r4)				
0009127c: 3c02800d lui r2,0x800d				
00091280: 8c424648 lw r2,0x4648(r2)				
00091284: 00a0a021 addu r20,r5,r0			Move r5 to r20
00091288: 94430000 lhu r3,0x0000(r2)			
0009128c: 00000000 nop							
00091290: 10600031 beq r3,r0,0x00091358			
00091294: 00008821 addu r17,r0,r0			r17 = 0x0000
00091298: 24920004 addiu r18,r4,0x0004			r18 = 0x800d464c
0009129c: 24900008 addiu r16,r4,0x0008			r16 = 0x800d4650
000912a0: 3c13800a lui r19,0x800a			r19 = 0x800a0000
000912a4: 2673ee50 addiu r19,r19,0xee50			r19 = 0x8009ee50 ?????????
000912a8: 3c02800d lui r2,0x800d				
000912ac: 8c424674 lw r2,0x4674(r2)				
000912b0: 3063fffe andi r3,r3,0xfffe			
000912b4: a6400004 sh r0,0x0004(r18)			Store World Map Control byte total as 0x0000
000912b8: ae40fff8 sw r0,-0x0008(r18)			Store value at 0x800D4648 as 0x00000000
000912bc: 00431021 addu r2,r2,r3				
000912c0: ae420000 sw r2,0x0000(r18)			
000912c4: 96030000 lhu r3,0x0000(r16)			Load World Map Control byte total
000912c8: 3c04800d lui r4,0x800d			r4 = 0x800d0000
000912cc: 8c84464c lw r4,0x464c(r4)			Load Pointer to the World Map Control offset into r4
000912d0: 00031040 sll r2,r3,0x01			World Map Control byte * 2
000912d4: 00441021 addu r2,r2,r4			World Map Control offset + World Map Control byte * 2
000912d8: 94420000 lhu r2,0x0000(r2)			Load value into r2 (Controller to the World Map)
000912dc: 24630001 addiu r3,r3,0x0001			World Map Control byte ++
000912e0: a6030000 sh r3,0x0000(r16)			Store new byte total into 0x800d4650
000912e4: 00021080 sll r2,r2,0x02			Controller value * 4
000912e8: 00531021 addu r2,r2,r19			0x8009ee50 + Controller value * 4
000912ec: 8c420000 lw r2,0x0000(r2)			Load pointer to World Map Control Routine
000912f0: 00000000 nop							
000912f4: 0040f809 jalr r2,r31				Jump and Link to routine
000912f8: 00000000 nop
000912fc: 8e02fff4 lw r2,-0x000c(r16)			Load Word at 0x800D4644
00091300: 00000000 nop							
00091304: 30420003 andi r2,r2,0x0003			
00091308: 1040ffee beq r2,r0,0x000912c4			Loop if 0x800D4644 never has flags 0x01 or 0x02 set
0009130c: 00000000 nop							
00091310: 3c03800d lui r3,0x800d			r3 = 0x800d0000
00091314: 8c634644 lw r3,0x4644(r3)			Load Word at 0x800D4644 into r3
00091318: 00000000 nop							
0009131c: 30620001 andi r2,r3,0x0001			
00091320: 10400003 beq r2,r0,0x00091330			Branch if flag 0x0001 is not set
00091324: 00741024 and r2,r3,r20
00091328: 1440000c bne r2,r0,0x0009135c
0009132c: 34020001 ori r2,r0,0x0001
00091330: 26310001 addiu r17,r17,0x0001			r17++
00091334: 3222ffff andi r2,r17,0xffff			
00091338: 3c03800d lui r3,0x800d				
0009133c: 8c634648 lw r3,0x4648(r3)				
00091340: 00021040 sll r2,r2,0x01			r17 * 2
00091344: 00431021 addu r2,r2,r3				
00091348: 94430000 lhu r3,0x0000(r2)			
0009134c: 00000000 nop							
00091350: 1460ffd5 bne r3,r0,0x000912a8			
00091354: 00000000 nop							
00091358: 00001021 addu r2,r0,r0			r2 = 0x0000
0009135c: 8fbf0024 lw r31,0x0024(r29)
00091360: 8fb40020 lw r20,0x0020(r29)
00091364: 8fb3001c lw r19,0x001c(r29)
00091368: 8fb20018 lw r18,0x0018(r29)
0009136c: 8fb10014 lw r17,0x0014(r29)
00091370: 8fb00010 lw r16,0x0010(r29)
00091374: 27bd0028 addiu r29,r29,0x0028
00091378: 03e00008 jr r31
0009137c: 00000000 nop