Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions rcw.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,34 @@ def build_pbi(lines):
v2 = struct.pack(endianess + 'L', p2)
subsection += v1
subsection += v2
elif op == 'loadc':
if p1 == None or p2 == None:
print('Error: "loadc" instruction requires two parameters')
return ''
v1 = struct.pack(endianess + 'L', 0x80140000)
v2 = struct.pack(endianess + 'L', p1)
v3 = struct.pack(endianess + 'L', p2)
subsection += v1
subsection += v2
subsection += v3
elif op == 'jumpc':
if p1 == None or p2 == None:
print('Error: "jumpc" instruction requires two parameters')
return ''
v1 = struct.pack(endianess + 'L', 0x80850000)
v2 = struct.pack(endianess + 'L', p1)
v3 = struct.pack(endianess + 'L', p2)
subsection += v1
subsection += v2
subsection += v3
elif op == 'jump':
if p1 == None:
print('Error: "jump" instruction requires a parameter')
return ''
v1 = struct.pack(endianess + 'L', 0x80840000)
v2 = struct.pack(endianess + 'L', p1)
subsection += v1
subsection += v2
elif op == 'awrite':
if opsize == '.b5':
# altconfig write with B=5 (16 bytes)
Expand Down Expand Up @@ -932,7 +960,7 @@ def create_source():
i += 4
arg2 = struct.unpack(endianess + 'L', pbi[i:i+4])[0]
i += 4
source += "loadcondition 0x%08x,0x%08x\n" % (arg1, arg2)
source += "loadc 0x%08x,0x%08x\n" % (arg1, arg2)
elif cmd == 0x20:
source += "/* Disassemble not implemented for word 0x%08x */\n" % (word)
elif cmd == 0x22:
Expand All @@ -956,9 +984,9 @@ def create_source():
elif cmd == 0x82:
source += "wait 0x%08x\n" % (word & 0xffff)
elif cmd == 0x84:
source += "/* Disassemble not implemented for word 0x%08x */\n" % (word)
source += "/* Disassemble not implemented for word 0x%08x (jump) */\n" % (word)
elif cmd == 0x85:
source += "/* Disassemble not implemented for word 0x%08x */\n" % (word)
source += "/* Disassemble not implemented for word 0x%08x (jumpc) */\n" % (word)
elif cmd == 0x8f:
arg1 = struct.unpack(endianess + 'L', pbi[i:i+4])[0]
i += 4
Expand Down