us_disassemble: us bits were moved to bits/
This commit is contained in:
parent
d14f1c21dd
commit
9d974cd113
20
conv/bgra_to_rgba.py
Normal file
20
conv/bgra_to_rgba.py
Normal file
@ -0,0 +1,20 @@
|
||||
import sys
|
||||
|
||||
with open(sys.argv[1], 'rb') as f:
|
||||
buf = f.read()
|
||||
|
||||
out = bytearray(len(buf))
|
||||
|
||||
for i in range(len(buf) // 4):
|
||||
b = buf[i * 4 + 0]
|
||||
g = buf[i * 4 + 1]
|
||||
r = buf[i * 4 + 2]
|
||||
a = 255
|
||||
|
||||
out[i * 4 + 0] = r
|
||||
out[i * 4 + 1] = g
|
||||
out[i * 4 + 2] = b
|
||||
out[i * 4 + 3] = a
|
||||
|
||||
with open(sys.argv[2], 'wb') as f:
|
||||
f.write(out)
|
@ -4,10 +4,10 @@ import pvs_dst_bits
|
||||
from pprint import pprint
|
||||
|
||||
code = [
|
||||
0xf00203,
|
||||
0xd10001,
|
||||
0x1248001,
|
||||
0x1248001
|
||||
0x00f00203,
|
||||
0x00d10001,
|
||||
0x01248001,
|
||||
0x01248001,
|
||||
]
|
||||
|
||||
# Radeon Compiler Program
|
||||
|
@ -1,6 +1,7 @@
|
||||
import parse_bits
|
||||
from pprint import pprint
|
||||
from collections import OrderedDict
|
||||
from os import path
|
||||
|
||||
register_names = [
|
||||
"US_CMN_INST",
|
||||
@ -45,7 +46,7 @@ fc = [
|
||||
|
||||
def parse_registers():
|
||||
for register in register_names:
|
||||
filename = register.lower() + ".txt"
|
||||
filename = path.join("bits", register.lower() + ".txt")
|
||||
l = list(parse_bits.parse_file_fields(filename))
|
||||
yield register, OrderedDict(
|
||||
(d.field_name, d) for d in parse_bits.aggregate(l)
|
||||
@ -54,7 +55,6 @@ def parse_registers():
|
||||
registers = dict(parse_registers())
|
||||
US_CMN_INST = registers["US_CMN_INST"]
|
||||
|
||||
"""
|
||||
code = [
|
||||
0x00078005,
|
||||
0x08020080,
|
||||
@ -63,7 +63,6 @@ code = [
|
||||
0x1c810003,
|
||||
0x00000005,
|
||||
]
|
||||
"""
|
||||
|
||||
# DCL IN[0].xyz, GENERIC[0], PERSPECTIVE
|
||||
# DCL OUT[0], COLOR
|
||||
|
Loading…
x
Reference in New Issue
Block a user