• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

SD2 UV map viewing

Started by eatrawmeat391, June 08, 2018, 11:58:42 am

eatrawmeat391

Hi, I know this forum from internet and I have learnt how to use a debugger (psxfin) for PSX.I'm trying to figure out Smackdown 2 PS1 emd.I got the objects correctly loaded.Now I need to view the UV mapping from it.Here is the code I have generated by using psxfin.I knew this is uv because if I disabled the 2 lw instruction the texture will get messed up.
In the code the value is read and is ORed with a big number 0x4030 0000 and 0x85 0000.If I prevent the OR operation to take place, the color will be messed up, wrestler will be in blue and black.>>l means shift right logical.What confuses me there is only supposed to have 2 UVs value for each data, uv_x and uv_y . However in chunk type 0x34 it has 3 sw operations and in 0x3C it has 4 sw operations.I tried putting a breakpoint at the address of the sw function but psxfin doesn't break so I guess the value is in native PS1 format that can be read easily.I want to ask if any one who has hacked PS1's model and knew about UV map can look at how the data is unpacked and helps me?Thanks


0x61ec0: UV map 0x34
# 04 05 06 07 08 09 0A 0B
# 61 DC 61 D0 6D DD 00 00
lw r4, -0x08(r16) # offset 0x4
lw r7, -0x04(r16) # offset 0x8
# r4 = 0xd061dc61
# r7 = 0x0000dd6d
r5 = r4 >>l 0x10 = 0x0000d061
# r5 = r5 | r17 = 0xd061 | 0x00850000 = 0x0085d061
# r4 = r4 & 0xffff = 0x0000dc61
# r4 = r4 | r22 = 0x0000dc61 | 0x40300000 = 0x4030dc61
sw r4, 0x0C(r18) # 0x4030dc61 # offset 0x04, 0x4030
sw r5, 0x18(r18) # 0x0085d061 # offset 0x06, 0x85
sw r7, 0x24(r18) # 0x0000dd6d # offset 0x08, offset 0x0A

0x61dc4: UV map 0x3C
# 04 05 06 07 08 09 0A 0B
# 50 CE 61 D0 5F DA 61 DC
lw r4, -0x08(r16) # offset 0x04
lw r7, -0x04(r16) # offset 0x08
# r16 = 0x800bb0c8
# r4 = 0xd061ce50
# r7 = 0xdc61da5f
# r5 = r4 >>l 0x10 = 0xd061
# r5 = r5 | r17 = 0xd061 | 0x00850000 = 0x85d061
# r4 = r4 & 0xFFFF = 0xce50
# r4 = r4 | r22 = 0xce50 | 0x40300000 = 0x4030ce50
sw r4, 0x0C(r18) # 0x4030ce50 # offset 0x04, 0x4030
sw r5, 0x18(r18) # 0x0085d061   # offset 0x06, 0x85
sw r7, 0x24(r18) # 0xdc61da5f # offset 0x08, offset 0x0A
# r7 = r7 >>l 0x10 = 0xdc61
sw r7, 0x30(r18) # 0xdc61     # offset 0x0A, 0
  • Modding version: Other/Unknown