Added support for 00 geolayout command.

This commit is contained in:
kurethedead
2019-12-04 20:12:57 -08:00
parent f3b770c959
commit 5f91595def
2 changed files with 21 additions and 3 deletions
+2 -2
View File
@@ -88,8 +88,8 @@ nodeCmds = [
]
geoCmdStatic = {
0x04: [0x00, 0x01, 0x03, 0x04, 0x05, 0x09, 0x0B, 0x0C, 0x17, 0x20],
0x08: [0x02, 0x0D, 0x0E, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19],
0x04: [0x01, 0x03, 0x04, 0x05, 0x09, 0x0B, 0x0C, 0x17, 0x20],
0x08: [0x00, 0x02, 0x0D, 0x0E, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19],
0x0C: [0x08, 0x13, 0x1C],
0x14: [0x0F],
}
+19 -1
View File
@@ -180,7 +180,12 @@ def parseNode(romfile, geoStartAddress, currentAddress, currentCmd, jumps,
armatureObj = armatureMeshTuple[0]
switchLevel = switchCount
if currentCmd[0] == GEO_BRANCH and not ignoreNode: # 0x02
if currentCmd[0] == GEO_BRANCH_STORE and not ignoreNode: #0x00
currentAddress = parseBranchStore(romfile, currentCmd, currentAddress,
jumps, segmentData = segmentData)
singleChildStack.append(False)
nodeIndex.append(0)
elif currentCmd[0] == GEO_BRANCH and not ignoreNode: # 0x02
currentAddress = parseBranch(romfile, currentCmd, currentAddress,
jumps, segmentData = segmentData)
singleChildStack.append(False)
@@ -687,6 +692,19 @@ def parseBranch(romfile, currentCmd, currentAddress, jumps,
return currentAddress
def parseBranchStore(romfile, currentCmd, currentAddress, jumps,
segmentData = None):
print("BRANCH AND STORE " + hex(currentAddress))
romfile.seek(currentAddress)
postJumpAddr = currentAddress + getGeoLayoutCmdLength(*currentCmd)
currentCmd = romfile.read(getGeoLayoutCmdLength(*currentCmd))
jumps.append(postJumpAddr)
currentAddress = decodeSegmentedAddr(currentCmd[4:8],
segmentData = segmentData)
return currentAddress
def parseReturn(currentCmd, currentAddress, jumps):
print("RETURN " + hex(currentAddress))
currentAddress = jumps.pop()