Vertical Threshold Routine
Jump to navigation
Jump to search
DUPLICATED Check_Vert_Tolerance_and_if_Tiles_can_be_Chosen
r4 = Height Value if Non Zero r5 = Vertical r6 = 0 001792a4: 30a500ff andi r5,r5,0x00ff r5 = Vertical 001792a8: 00052840 sll r5,r5,0x01 001792ac: 308a00ff andi r10,r4,0x00ff r10 = Height 001792b0: 00005821 addu r11,r0,r0 r11 = Tile Counter 001792b4: 3c0e8019 lui r14,0x8019 001792b8: 25cef8cc addiu r14,r14,-0x0734 r14 = Tile Data (18f8cc) 001792bc: 3c098019 lui r9,0x8019 001792c0: 25292dd8 addiu r9,r9,0x2dd8 r9 = Tile Grid Data (192dd8) 001792c4: 01207821 addu r15,r9,r0 r15 = Tile Grid Data (192dd8) 001792c8: 340d0500 ori r13,r0,0x0500 r13 = 0x500 001792cc: 340c0800 ori r12,r0,0x0800 r12 = 0x800 001792d0: 000b10c0 sll r2,r11,0x03 r2 = Tile Counter 001792d4: 004e1821 addu r3,r2,r14 r3 = Get Current Tile Data 001792d8: 90620006 lbu r2,0x0006(r3) r2 = Selectablity Byte 001792dc: 00000000 nop 001792e0: 30420001 andi r2,r2,0x0001 If Selectable 001792e4: 1440000a bne r2,r0,0x00179310 Branch if True 001792e8: 2407ff01 addiu r7,r0,-0x00ff r7 = -0x00ff 001792ec: 90640002 lbu r4,0x0002(r3) r4 = Tile Height 001792f0: 90630003 lbu r3,0x0003(r3) r3 = Tile Height Halves and Depths 001792f4: 00042040 sll r4,r4,0x01 001792f8: 3062001f andi r2,r3,0x001f r2 = Height Halves (Ignore Depths) 001792fc: 00822021 addu r4,r4,r2 r4 = Height + Halves 00179300: 00031942 srl r3,r3,0x05 r3 = Depths (Ignore Halves) 00179304: 00031840 sll r3,r3,0x01 00179308: 0805e4c6 j 0x00179318 0017930c: 00833821 addu r7,r4,r3 r7 = Height + Halves + Depths 00179310: a1200000 sb r0,0x0000(r9) Dump Range on Current Tile 00179314: a1200001 sb r0,0x0001(r9) Current Tile is not Targeted 00179318: 018e1821 addu r3,r12,r14 r3 = Tile Data + 0x800 (1900cc) 0017931c: 90620006 lbu r2,0x0006(r3) r2 = Selectablity 00179320: 00000000 nop 00179324: 30420001 andi r2,r2,0x0001 If Current Tile is Selectable 00179328: 1440000a bne r2,r0,0x00179354 Branch if True 0017932c: 01af4021 addu r8,r13,r15 r8 = Tile Grid Data + 0x500 00179330: 90640002 lbu r4,0x0002(r3) r4 = Tile Height 00179334: 90630003 lbu r3,0x0003(r3) r3 = Tile Height Halves and Depths 00179338: 00042040 sll r4,r4,0x01 0017933c: 3062001f andi r2,r3,0x001f r2 = Height Halves (Ignore Depths) 00179340: 00822021 addu r4,r4,r2 r4 = Height + Halves 00179344: 00031942 srl r3,r3,0x05 r3 = Depths (Ignore Halves) 00179348: 00031840 sll r3,r3,0x01 0017934c: 0805e4d8 j 0x00179360 00179350: 00832021 addu r4,r4,r3 r4 = Height + Halves + Depths 00179354: 2404ff01 addiu r4,r0,-0x00ff r4 = -0x00ff 00179358: a1000000 sb r0,0x0000(r8) Dump Range on Current Tile 0017935c: a1000001 sb r0,0x0001(r8) Current Tile is not Targeted 00179360: 10c00006 beq r6,r0,0x0017937c Branch if r6 = 0 00179364: 00e4102a slt r2,r7,r4 If Height Value < Height Value (0x800) 00179368: 14400003 bne r2,r0,0x00179378 Branch if True 0017936c: 00000000 nop 00179370: 0805e4df j 0x0017937c 00179374: 2404ff01 addiu r4,r0,-0x00ff r4 = -0x00ff 00179378: 2407ff01 addiu r7,r0,-0x00ff r7 = -0x00ff 0017937c: 00ea102a slt r2,r7,r10 If Height Value < Height 00179380: 14400002 bne r2,r0,0x0017938c Branch if True 00179384: 01471823 subu r3,r10,r7 r3 = Height - Height Value 00179388: 00ea1823 subu r3,r7,r10 r3 = Height Value - Height 0017938c: 008a102a slt r2,r4,r10 If Height Value (0x800) < Height 00179390: 14400003 bne r2,r0,0x001793a0 Branch if True 00179394: 00000000 nop 00179398: 0805e4e9 j 0x001793a4 0017939c: 008a2023 subu r4,r4,r10 r4 = Height Value (0x800) - Height 001793a0: 01442023 subu r4,r10,r4 r4 = Height - Height Value (0x800) 001793a4: 0083102a slt r2,r4,r3 If Height Diff. (0x800) < Height Diff. 001793a8: 10400007 beq r2,r0,0x001793c8 Branch if False 001793ac: 00a4102a slt r2,r5,r4 If Vertical < Height Diff. (0x800) 001793b0: a1200000 sb r0,0x0000(r9) Current Tile is not apart of Range 001793b4: 1040000a beq r2,r0,0x001793e0 Branch if False 001793b8: a1200001 sb r0,0x0001(r9) Current Tile not Targeted 001793bc: a1000000 sb r0,0x0000(r8) Current Tile is not apart of Range (0x500) 001793c0: 0805e4f8 j 0x001793e0 001793c4: a1000001 sb r0,0x0001(r8) Current Tile not Targeted (0x500) 001793c8: 00a3102a slt r2,r5,r3 If Vertical < Height Diff. 001793cc: a1000000 sb r0,0x0000(r8) Current Tile is not apart of Range (0x500) 001793d0: 10400003 beq r2,r0,0x001793e0 Branch if False 001793d4: a1000001 sb r0,0x0001(r8) Current Tile not Targeted (0x500) 001793d8: a1200000 sb r0,0x0000(r9) Current Tile is not apart of Range 001793dc: a1200001 sb r0,0x0001(r9) Current Tile not Targeted 001793e0: 25290005 addiu r9,r9,0x0005 Next Tile 001793e4: 25ad0005 addiu r13,r13,0x0005 Next Tile (0x800) + 5 001793e8: 256b0001 addiu r11,r11,0x0001 Tile Counter++ 001793ec: 29620100 slti r2,r11,0x0100 If Tile Counter < 0x100 001793f0: 1440ffb7 bne r2,r0,0x001792d0 Branch Back if True 001793f4: 258c0008 addiu r12,r12,0x0008 Next Tile 001793f8: 03e00008 jr r31 001793fc: 00000000 nop