Difference between revisions of "Image loading setup? (0x14a834)"

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
(Created page with " # ROUTINE: Image loading setup? (0x14a834) # Parameters: # r4 = ? # r5 = ? # r6 = ? # r7 = Pointer to array of halfwords ...")
 
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
  #  ROUTINE: Image loading setup? (0x14a834)
 
  #  ROUTINE: Image loading setup? (0x14a834)
 
  #      Parameters:
 
  #      Parameters:
  #          r4 = ?
+
  #          r4 = (destPtr) Destination pointer
  #          r5 = ?
+
  #          r5 = (baseLoadLocation) Pointer to array of halfwords [X Location, Y Location]
  #          r6 = ?
+
  #          r6 = (baseScreenLocation) Pointer to array of halfwords [X Location, Y Location]
  #          r7 = Pointer to array of halfwords (2-byte values): [X Load Location, Y Load Location, Image Width, Image Height]
+
  #          r7 = (loadParameters) Pointer to array of halfwords (2-byte values): [X Load Location, Y Load Location, Image Width, Image Height, X Screen Location Offset, Y Screen Location Offset]
 
   
 
   
 
  0014a834: 27bdffd8 addiu r29,r29,-0x0028
 
  0014a834: 27bdffd8 addiu r29,r29,-0x0028
Line 15: Line 15:
 
  0014a850: afb00010 sw r16,0x0010(r29)
 
  0014a850: afb00010 sw r16,0x0010(r29)
 
  0014a854: afbf0020 sw r31,0x0020(r29)
 
  0014a854: afbf0020 sw r31,0x0020(r29)
  0014a858: 92220007 lbu r2,0x0007(r17)
+
  0014a858: 92220007 lbu r2,0x0007(r17)          #  *(destPtr + 7)
  0014a85c: 34030064 ori r3,r0,0x0064
+
  0014a85c: 34030064 ori r3,r0,0x0064           #  0x64 (100)
  0014a860: 3042007c andi r2,r2,0x007c
+
  0014a860: 3042007c andi r2,r2,0x007c           #  *(destPtr + 7) & 0x7c
  0014a864: 14430021 bne r2,r3,0x0014a8ec
+
  0014a864: 14430021 bne r2,r3,0x0014a8ec      
  0014a868: 00e08021 addu r16,r7,r0
+
  0014a868: 00e08021 addu r16,r7,r0             #  loadParameters
  0014a86c: 86020000 lh r2,0x0000(r16)
+
                                                #  if ((*(destPtr + 7) & 0x7c) == 0x64 (100)) {
 +
  0014a86c: 86020000 lh r2,0x0000(r16)           #      loadParameters.XLoadLocation
 
  0014a870: 00000000 nop
 
  0014a870: 00000000 nop
  0014a874: 04400012 bltz r2,0x0014a8c0
+
  0014a874: 04400012 bltz r2,0x0014a8c0         #      if (loadParameters.XLoadLocation >= 0) {
 
  0014a878: 00000000 nop
 
  0014a878: 00000000 nop
  0014a87c: 96420000 lhu r2,0x0000(r18)
+
  0014a87c: 96420000 lhu r2,0x0000(r18)         #          baseLoadLocation.X
  0014a880: 92030000 lbu r3,0x0000(r16)
+
  0014a880: 92030000 lbu r3,0x0000(r16)         #          loadParameters.XLoadLocation
  0014a884: 3042003f andi r2,r2,0x003f
+
  0014a884: 3042003f andi r2,r2,0x003f           #          baseLoadLocation.X & 0x3f
  0014a888: 00021080 sll r2,r2,0x02
+
  0014a888: 00021080 sll r2,r2,0x02             #          baseLoadLocation.X & 0x3f * 4
  0014a88c: 00431021 addu r2,r2,r3
+
  0014a88c: 00431021 addu r2,r2,r3               #          baseLoadLocation.X & 0x3f * 4 + loadParameters.XLoadLocation
  0014a890: a222000c sb r2,0x000c(r17)
+
  0014a890: a222000c sb r2,0x000c(r17)           #          *(destPtr + 0x0c) = baseLoadLocation.X & 0x3f * 4 + loadParameters.XLoadLocation
  0014a894: 92420002 lbu r2,0x0002(r18)
+
  0014a894: 92420002 lbu r2,0x0002(r18)         #          baseLoadLocation.Y
  0014a898: 92030002 lbu r3,0x0002(r16)
+
  0014a898: 92030002 lbu r3,0x0002(r16)         #          loadParameters.Y
 
  0014a89c: 00000000 nop
 
  0014a89c: 00000000 nop
  0014a8a0: 00431021 addu r2,r2,r3
+
  0014a8a0: 00431021 addu r2,r2,r3               #          baseLoadLocation.Y + loadParameters.Y
  0014a8a4: a222000d sb r2,0x000d(r17)
+
  0014a8a4: a222000d sb r2,0x000d(r17)           #          *(destPtr + 0x0d) = baseLoadLocation.Y + loadParameters.Y
  0014a8a8: 96020004 lhu r2,0x0004(r16)
+
  0014a8a8: 96020004 lhu r2,0x0004(r16)         #          loadParameters.Width
 
  0014a8ac: 00000000 nop
 
  0014a8ac: 00000000 nop
  0014a8b0: a6220010 sh r2,0x0010(r17)
+
  0014a8b0: a6220010 sh r2,0x0010(r17)           #          *(destPtr + 0x10) = loadParameters.Width
  0014a8b4: 96020006 lhu r2,0x0006(r16)
+
  0014a8b4: 96020006 lhu r2,0x0006(r16)         #          loadParameters.Height
 
  0014a8b8: 00000000 nop
 
  0014a8b8: 00000000 nop
  0014a8bc: a6220012 sh r2,0x0012(r17)
+
  0014a8bc: a6220012 sh r2,0x0012(r17)           #          *(destPtr + 0x12) = loadParameters.Height
  0014a8c0: 96620000 lhu r2,0x0000(r19)
+
                                                #      }
  0014a8c4: 96030008 lhu r3,0x0008(r16)
+
  0014a8c0: 96620000 lhu r2,0x0000(r19)         #      baseScreenLocation.X
 +
  0014a8c4: 96030008 lhu r3,0x0008(r16)         #      loadParameters.XLoadLocationScreenOffset 
 
  0014a8c8: 00000000 nop
 
  0014a8c8: 00000000 nop
  0014a8cc: 00431021 addu r2,r2,r3
+
  0014a8cc: 00431021 addu r2,r2,r3               #      baseScreenLocation.X + loadParameters.XScreenOffset
  0014a8d0: a6220008 sh r2,0x0008(r17)
+
  0014a8d0: a6220008 sh r2,0x0008(r17)           #      *(destPtr + 8) = baseScreenLocation.X + loadParameters.XScreenOffset
  0014a8d4: 96620002 lhu r2,0x0002(r19)
+
  0014a8d4: 96620002 lhu r2,0x0002(r19)         #      baseScreenLocation.Y
  0014a8d8: 9603000a lhu r3,0x000a(r16)
+
  0014a8d8: 9603000a lhu r3,0x000a(r16)         #      loadParameters.YScreenOffset
 
  0014a8dc: 00000000 nop
 
  0014a8dc: 00000000 nop
  0014a8e0: 00431021 addu r2,r2,r3
+
  0014a8e0: 00431021 addu r2,r2,r3               #      baseScreenLocation.Y + loadParameters.YScreenOffset
 
  0014a8e4: 08052a97 j 0x0014aa5c
 
  0014a8e4: 08052a97 j 0x0014aa5c
  0014a8e8: a622000a sh r2,0x000a(r17)
+
  0014a8e8: a622000a sh r2,0x000a(r17)           #      *(destPtr + 10) = baseScreenLocation.Y + loadParameters.YScreenOffset
  0014a8ec: 86020000 lh r2,0x0000(r16)
+
                                                #  } else {
 +
  0014a8ec: 86020000 lh r2,0x0000(r16)           #      loadParameters.XLoadLocation
 
  0014a8f0: 00000000 nop
 
  0014a8f0: 00000000 nop
  0014a8f4: 0440002d bltz r2,0x0014a9ac
+
  0014a8f4: 0440002d bltz r2,0x0014a9ac         #      if (loadParameters.XLoadLocation >= 0) {
  0014a8f8: 00002021 addu r4,r0,r0
+
  0014a8f8: 00002021 addu r4,r0,r0               #          // 4 bit compressed
  0014a8fc: 00002821 addu r5,r0,r0
+
  0014a8fc: 00002821 addu r5,r0,r0               #          // 0.5b + 0.5f semi transparency mode
 
  0014a900: 96470002 lhu r7,0x0002(r18)
 
  0014a900: 96470002 lhu r7,0x0002(r18)
 
  0014a904: 86460000 lh r6,0x0000(r18)
 
  0014a904: 86460000 lh r6,0x0000(r18)
  0014a908: 0c008e63 jal 0x0002398c
+
  0014a908: 0c008e63 jal 0x0002398c             #          ROUTINE: result = [[P00 GetTpage]] (0, 0, baseLoadLocation.X, baseLoadLocation.Y & 0x0f00) // (see notes)
 
  0014a90c: 30e70f00 andi r7,r7,0x0f00
 
  0014a90c: 30e70f00 andi r7,r7,0x0f00
  0014a910: a6220016 sh r2,0x0016(r17)
+
  0014a910: a6220016 sh r2,0x0016(r17)           #          *(destPtr + 0x16) = result
  0014a914: 92020000 lbu r2,0x0000(r16)
+
  0014a914: 92020000 lbu r2,0x0000(r16)         #          loadParameters.XLoadLocation
 
  0014a918: 00000000 nop
 
  0014a918: 00000000 nop
  0014a91c: a222000c sb r2,0x000c(r17)
+
  0014a91c: a222000c sb r2,0x000c(r17)           #          *(destPtr + 0x0c) = loadParameters.XLoadLocation
  0014a920: 92420002 lbu r2,0x0002(r18)
+
  0014a920: 92420002 lbu r2,0x0002(r18)         #          baseLoadLocation.Y
  0014a924: 92030002 lbu r3,0x0002(r16)
+
  0014a924: 92030002 lbu r3,0x0002(r16)         #          loadParameters.Y
 
  0014a928: 00000000 nop
 
  0014a928: 00000000 nop
  0014a92c: 00431021 addu r2,r2,r3
+
  0014a92c: 00431021 addu r2,r2,r3               #          baseLoadLocation.Y + loadParameters.Y
  0014a930: a222000d sb r2,0x000d(r17)
+
  0014a930: a222000d sb r2,0x000d(r17)           #          *(destPtr + 0x0d) = baseLoadLocation.Y + loadParameters.Y
  0014a934: 92020000 lbu r2,0x0000(r16)
+
  0014a934: 92020000 lbu r2,0x0000(r16)         #          loadParameters.XLoadLocation
  0014a938: 92030004 lbu r3,0x0004(r16)
+
  0014a938: 92030004 lbu r3,0x0004(r16)         #          loadParameters.Width
 
  0014a93c: 00000000 nop
 
  0014a93c: 00000000 nop
  0014a940: 00431021 addu r2,r2,r3
+
  0014a940: 00431021 addu r2,r2,r3               #          loadParameters.XLoadLocation + loadParameters.Width
  0014a944: a2220014 sb r2,0x0014(r17)
+
  0014a944: a2220014 sb r2,0x0014(r17)           #          *(destPtr + 0x14) = loadParameters.XLoadLocation + loadParameters.Width
  0014a948: 92420002 lbu r2,0x0002(r18)
+
  0014a948: 92420002 lbu r2,0x0002(r18)         #          baseLoadLocation.Y
  0014a94c: 92030002 lbu r3,0x0002(r16)
+
  0014a94c: 92030002 lbu r3,0x0002(r16)         #          loadParameters.Y
 
  0014a950: 00000000 nop
 
  0014a950: 00000000 nop
  0014a954: 00431021 addu r2,r2,r3
+
  0014a954: 00431021 addu r2,r2,r3               #          baseLoadLocation.Y + loadParameters.Y
  0014a958: a2220015 sb r2,0x0015(r17)
+
  0014a958: a2220015 sb r2,0x0015(r17)           #          *(destPtr + 0x15) = baseLoadLocation.Y + loadParameters.Y
  0014a95c: 92020000 lbu r2,0x0000(r16)
+
  0014a95c: 92020000 lbu r2,0x0000(r16)         #          loadParameters.XLoadLocation
 
  0014a960: 00000000 nop
 
  0014a960: 00000000 nop
  0014a964: a222001c sb r2,0x001c(r17)
+
  0014a964: a222001c sb r2,0x001c(r17)           #          *(destPtr + 0x1c) = loadParameters.XLoadLocation
  0014a968: 92420002 lbu r2,0x0002(r18)
+
  0014a968: 92420002 lbu r2,0x0002(r18)         #          baseLoadLocation.Y
  0014a96c: 92030002 lbu r3,0x0002(r16)
+
  0014a96c: 92030002 lbu r3,0x0002(r16)         #          loadParameters.Y
  0014a970: 92040006 lbu r4,0x0006(r16)
+
  0014a970: 92040006 lbu r4,0x0006(r16)         #          loadParameters.Height
  0014a974: 00431021 addu r2,r2,r3
+
  0014a974: 00431021 addu r2,r2,r3               #          baseLoadLocation.Y + loadParameters.Y
  0014a978: 00441021 addu r2,r2,r4
+
  0014a978: 00441021 addu r2,r2,r4               #          baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
  0014a97c: a222001d sb r2,0x001d(r17)
+
  0014a97c: a222001d sb r2,0x001d(r17)           #          *(destPtr + 0x1d) = baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
  0014a980: 92020000 lbu r2,0x0000(r16)
+
  0014a980: 92020000 lbu r2,0x0000(r16)         #          loadParameters.XLoadLocation
  0014a984: 92030004 lbu r3,0x0004(r16)
+
  0014a984: 92030004 lbu r3,0x0004(r16)         #          loadParameters.Width
 
  0014a988: 00000000 nop
 
  0014a988: 00000000 nop
  0014a98c: 00431021 addu r2,r2,r3
+
  0014a98c: 00431021 addu r2,r2,r3               #          loadParameters.XLoadLocation + loadParameters.Width
  0014a990: a2220024 sb r2,0x0024(r17)
+
  0014a990: a2220024 sb r2,0x0024(r17)           #          *(destPtr + 0x24) = loadParameters.XLoadLocation + loadParameters.Width
  0014a994: 92420002 lbu r2,0x0002(r18)
+
  0014a994: 92420002 lbu r2,0x0002(r18)         #          baseLoadLocation.Y
  0014a998: 92030002 lbu r3,0x0002(r16)
+
  0014a998: 92030002 lbu r3,0x0002(r16)         #          loadParameters.Y
  0014a99c: 92040006 lbu r4,0x0006(r16)
+
  0014a99c: 92040006 lbu r4,0x0006(r16)         #          loadParameters.Height
  0014a9a0: 00431021 addu r2,r2,r3
+
  0014a9a0: 00431021 addu r2,r2,r3               #          baseLoadLocation.Y + loadParameters.Y
  0014a9a4: 00441021 addu r2,r2,r4
+
  0014a9a4: 00441021 addu r2,r2,r4               #          baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
  0014a9a8: a2220025 sb r2,0x0025(r17)
+
  0014a9a8: a2220025 sb r2,0x0025(r17)           #          *(destPtr + 0x25) = baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
  0014a9ac: 96620000 lhu r2,0x0000(r19)
+
  0014a9ac: 96620000 lhu r2,0x0000(r19)         #          baseScreenLocation.X
  0014a9b0: 96030008 lhu r3,0x0008(r16)
+
                                                #      }
 +
  0014a9b0: 96030008 lhu r3,0x0008(r16)         #      loadParameters.XScreenOffset
 
  0014a9b4: 00000000 nop
 
  0014a9b4: 00000000 nop
  0014a9b8: 00431021 addu r2,r2,r3
+
  0014a9b8: 00431021 addu r2,r2,r3               #      loadParameters.XScreenOffset + baseScreenLocation.X
  0014a9bc: a6220008 sh r2,0x0008(r17)
+
  0014a9bc: a6220008 sh r2,0x0008(r17)           #      *(destPtr + 8) = loadParameters.XScreenOffset + baseScreenLocation.X
  0014a9c0: 96620002 lhu r2,0x0002(r19)
+
  0014a9c0: 96620002 lhu r2,0x0002(r19)         #      baseScreenLocation.Y 
  0014a9c4: 9603000a lhu r3,0x000a(r16)
+
  0014a9c4: 9603000a lhu r3,0x000a(r16)         #      loadParameters.YScreenOffset
 
  0014a9c8: 00000000 nop
 
  0014a9c8: 00000000 nop
  0014a9cc: 00431021 addu r2,r2,r3
+
  0014a9cc: 00431021 addu r2,r2,r3               #      baseScreenLocation.Y + loadParameters.YScreenOffset
  0014a9d0: a622000a sh r2,0x000a(r17)
+
  0014a9d0: a622000a sh r2,0x000a(r17)           #      *(destPtr + 10) = baseScreenLocation.Y + loadParameters.YScreenOffset
  0014a9d4: 96620000 lhu r2,0x0000(r19)
+
  0014a9d4: 96620000 lhu r2,0x0000(r19)         #      baseScreenLocation.X
  0014a9d8: 96030008 lhu r3,0x0008(r16)
+
  0014a9d8: 96030008 lhu r3,0x0008(r16)         #      loadParameters.XScreenOffset
  0014a9dc: 96040004 lhu r4,0x0004(r16)
+
  0014a9dc: 96040004 lhu r4,0x0004(r16)         #      loadParameters.Width
  0014a9e0: 00431021 addu r2,r2,r3
+
  0014a9e0: 00431021 addu r2,r2,r3               #      baseScreenLocation.X + loadParameters.XScreenOffset
  0014a9e4: 00441021 addu r2,r2,r4
+
  0014a9e4: 00441021 addu r2,r2,r4               #      baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
  0014a9e8: a6220010 sh r2,0x0010(r17)
+
  0014a9e8: a6220010 sh r2,0x0010(r17)           #      *(destPtr + 0x10) = baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
  0014a9ec: 96620002 lhu r2,0x0002(r19)
+
  0014a9ec: 96620002 lhu r2,0x0002(r19)         #      baseScreenLocation.Y
  0014a9f0: 9603000a lhu r3,0x000a(r16)
+
  0014a9f0: 9603000a lhu r3,0x000a(r16)         #      loadParameters.YScreenOffset
 
  0014a9f4: 00000000 nop
 
  0014a9f4: 00000000 nop
  0014a9f8: 00431021 addu r2,r2,r3
+
  0014a9f8: 00431021 addu r2,r2,r3               #      baseScreenLocation.Y + loadParameters.YScreenOffset
  0014a9fc: a6220012 sh r2,0x0012(r17)
+
  0014a9fc: a6220012 sh r2,0x0012(r17)           #      *(destPtr + 0x12) = baseScreenLocation.Y + loadParameters.YScreenOffset
  0014aa00: 96620000 lhu r2,0x0000(r19)
+
  0014aa00: 96620000 lhu r2,0x0000(r19)         #      baseScreenLocation.X
  0014aa04: 96030008 lhu r3,0x0008(r16)
+
  0014aa04: 96030008 lhu r3,0x0008(r16)         #      loadParameters.XScreenOffset
 
  0014aa08: 00000000 nop
 
  0014aa08: 00000000 nop
  0014aa0c: 00431021 addu r2,r2,r3
+
  0014aa0c: 00431021 addu r2,r2,r3               #      baseScreenLocation.X + loadParameters.XScreenOffset
  0014aa10: a6220018 sh r2,0x0018(r17)
+
  0014aa10: a6220018 sh r2,0x0018(r17)           #      *(destPtr + 0x18) = baseScreenLocation.X + loadParameters.XScreenOffset
  0014aa14: 96620002 lhu r2,0x0002(r19)
+
  0014aa14: 96620002 lhu r2,0x0002(r19)         #      baseScreenLocation.Y
  0014aa18: 9603000a lhu r3,0x000a(r16)
+
  0014aa18: 9603000a lhu r3,0x000a(r16)         #      loadParameters.YScreenOffset
  0014aa1c: 96040006 lhu r4,0x0006(r16)
+
  0014aa1c: 96040006 lhu r4,0x0006(r16)         #      loadParameters.Height
  0014aa20: 00431021 addu r2,r2,r3
+
  0014aa20: 00431021 addu r2,r2,r3               #      baseScreenLocation.Y + loadParameters.YScreenOffset
  0014aa24: 00441021 addu r2,r2,r4
+
  0014aa24: 00441021 addu r2,r2,r4               #      baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
  0014aa28: a622001a sh r2,0x001a(r17)
+
  0014aa28: a622001a sh r2,0x001a(r17)           #      *(destPtr + 0x1a) = baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
  0014aa2c: 96620000 lhu r2,0x0000(r19)
+
  0014aa2c: 96620000 lhu r2,0x0000(r19)         #      baseScreenLocation.X
  0014aa30: 96030008 lhu r3,0x0008(r16)
+
  0014aa30: 96030008 lhu r3,0x0008(r16)         #      loadParameters.XScreenOffset
  0014aa34: 96040004 lhu r4,0x0004(r16)
+
  0014aa34: 96040004 lhu r4,0x0004(r16)         #      loadParameters.Width
  0014aa38: 00431021 addu r2,r2,r3
+
  0014aa38: 00431021 addu r2,r2,r3               #      baseScreenLocation.X + loadParameters.XScreenOffset
  0014aa3c: 00441021 addu r2,r2,r4
+
  0014aa3c: 00441021 addu r2,r2,r4               #      baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
  0014aa40: a6220020 sh r2,0x0020(r17)
+
  0014aa40: a6220020 sh r2,0x0020(r17)           #      *(destPtr + 0x20) = baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
  0014aa44: 96620002 lhu r2,0x0002(r19)
+
  0014aa44: 96620002 lhu r2,0x0002(r19)         #      baseScreenLocation.Y
  0014aa48: 9603000a lhu r3,0x000a(r16)
+
  0014aa48: 9603000a lhu r3,0x000a(r16)         #      loadParameters.YScreenOffset
  0014aa4c: 96040006 lhu r4,0x0006(r16)
+
  0014aa4c: 96040006 lhu r4,0x0006(r16)         #      loadParameters.Height
  0014aa50: 00431021 addu r2,r2,r3
+
  0014aa50: 00431021 addu r2,r2,r3               #      baseScreenLocation.Y + loadParameters.YScreenOffset
  0014aa54: 00441021 addu r2,r2,r4
+
  0014aa54: 00441021 addu r2,r2,r4               #      baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
  0014aa58: a6220022 sh r2,0x0022(r17)
+
  0014aa58: a6220022 sh r2,0x0022(r17)           #      *(destPtr + 0x22) = baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
 +
                                                #  }
 
  0014aa5c: 8fbf0020 lw r31,0x0020(r29)
 
  0014aa5c: 8fbf0020 lw r31,0x0020(r29)
 
  0014aa60: 8fb3001c lw r19,0x001c(r29)
 
  0014aa60: 8fb3001c lw r19,0x001c(r29)
Line 152: Line 157:
 
  0014aa74: 03e00008 jr r31
 
  0014aa74: 03e00008 jr r31
 
  0014aa78: 00000000 nop
 
  0014aa78: 00000000 nop
 +
 +
=== Notes ===
 +
Illustration of jal 0x0002398c set to nop (Lv and Exp text are misdisplayed)
 +
[[File:Trash.png]]

Latest revision as of 11:08, 17 June 2023

#   ROUTINE: Image loading setup? (0x14a834)
#       Parameters:
#           r4 = (destPtr) Destination pointer
#           r5 = (baseLoadLocation) Pointer to array of halfwords [X Location, Y Location]
#           r6 = (baseScreenLocation) Pointer to array of halfwords [X Location, Y Location]
#           r7 = (loadParameters) Pointer to array of halfwords (2-byte values): [X Load Location, Y Load Location, Image Width, Image Height, X Screen Location Offset, Y Screen Location Offset]

0014a834: 27bdffd8 addiu r29,r29,-0x0028
0014a838: afb10014 sw r17,0x0014(r29)
0014a83c: 00808821 addu r17,r4,r0
0014a840: afb20018 sw r18,0x0018(r29)
0014a844: 00a09021 addu r18,r5,r0
0014a848: afb3001c sw r19,0x001c(r29)
0014a84c: 00c09821 addu r19,r6,r0
0014a850: afb00010 sw r16,0x0010(r29)
0014a854: afbf0020 sw r31,0x0020(r29)
0014a858: 92220007 lbu r2,0x0007(r17)          #   *(destPtr + 7)
0014a85c: 34030064 ori r3,r0,0x0064            #   0x64 (100)
0014a860: 3042007c andi r2,r2,0x007c           #   *(destPtr + 7) & 0x7c
0014a864: 14430021 bne r2,r3,0x0014a8ec        
0014a868: 00e08021 addu r16,r7,r0              #   loadParameters
                                               #   if ((*(destPtr + 7) & 0x7c) == 0x64 (100)) {
0014a86c: 86020000 lh r2,0x0000(r16)           #       loadParameters.XLoadLocation
0014a870: 00000000 nop
0014a874: 04400012 bltz r2,0x0014a8c0          #       if (loadParameters.XLoadLocation >= 0) {
0014a878: 00000000 nop
0014a87c: 96420000 lhu r2,0x0000(r18)          #           baseLoadLocation.X
0014a880: 92030000 lbu r3,0x0000(r16)          #           loadParameters.XLoadLocation
0014a884: 3042003f andi r2,r2,0x003f           #           baseLoadLocation.X & 0x3f
0014a888: 00021080 sll r2,r2,0x02              #           baseLoadLocation.X & 0x3f * 4
0014a88c: 00431021 addu r2,r2,r3               #           baseLoadLocation.X & 0x3f * 4 + loadParameters.XLoadLocation
0014a890: a222000c sb r2,0x000c(r17)           #           *(destPtr + 0x0c) = baseLoadLocation.X & 0x3f * 4 + loadParameters.XLoadLocation
0014a894: 92420002 lbu r2,0x0002(r18)          #           baseLoadLocation.Y
0014a898: 92030002 lbu r3,0x0002(r16)          #           loadParameters.Y
0014a89c: 00000000 nop
0014a8a0: 00431021 addu r2,r2,r3               #           baseLoadLocation.Y + loadParameters.Y
0014a8a4: a222000d sb r2,0x000d(r17)           #           *(destPtr + 0x0d) = baseLoadLocation.Y + loadParameters.Y
0014a8a8: 96020004 lhu r2,0x0004(r16)          #           loadParameters.Width
0014a8ac: 00000000 nop
0014a8b0: a6220010 sh r2,0x0010(r17)           #           *(destPtr + 0x10) = loadParameters.Width
0014a8b4: 96020006 lhu r2,0x0006(r16)          #           loadParameters.Height
0014a8b8: 00000000 nop
0014a8bc: a6220012 sh r2,0x0012(r17)           #           *(destPtr + 0x12) = loadParameters.Height
                                               #       }
0014a8c0: 96620000 lhu r2,0x0000(r19)          #       baseScreenLocation.X 
0014a8c4: 96030008 lhu r3,0x0008(r16)          #       loadParameters.XLoadLocationScreenOffset   
0014a8c8: 00000000 nop
0014a8cc: 00431021 addu r2,r2,r3               #       baseScreenLocation.X + loadParameters.XScreenOffset
0014a8d0: a6220008 sh r2,0x0008(r17)           #       *(destPtr + 8) = baseScreenLocation.X + loadParameters.XScreenOffset
0014a8d4: 96620002 lhu r2,0x0002(r19)          #       baseScreenLocation.Y
0014a8d8: 9603000a lhu r3,0x000a(r16)          #       loadParameters.YScreenOffset
0014a8dc: 00000000 nop
0014a8e0: 00431021 addu r2,r2,r3               #       baseScreenLocation.Y + loadParameters.YScreenOffset
0014a8e4: 08052a97 j 0x0014aa5c
0014a8e8: a622000a sh r2,0x000a(r17)           #       *(destPtr + 10) = baseScreenLocation.Y + loadParameters.YScreenOffset
                                               #   } else {
0014a8ec: 86020000 lh r2,0x0000(r16)           #       loadParameters.XLoadLocation
0014a8f0: 00000000 nop
0014a8f4: 0440002d bltz r2,0x0014a9ac          #       if (loadParameters.XLoadLocation >= 0) {
0014a8f8: 00002021 addu r4,r0,r0               #           // 4 bit compressed
0014a8fc: 00002821 addu r5,r0,r0               #           // 0.5b + 0.5f semi transparency mode
0014a900: 96470002 lhu r7,0x0002(r18)
0014a904: 86460000 lh r6,0x0000(r18)
0014a908: 0c008e63 jal 0x0002398c              #           ROUTINE: result = P00 GetTpage (0, 0, baseLoadLocation.X, baseLoadLocation.Y & 0x0f00) // (see notes)
0014a90c: 30e70f00 andi r7,r7,0x0f00
0014a910: a6220016 sh r2,0x0016(r17)           #           *(destPtr + 0x16) = result
0014a914: 92020000 lbu r2,0x0000(r16)          #           loadParameters.XLoadLocation
0014a918: 00000000 nop
0014a91c: a222000c sb r2,0x000c(r17)           #           *(destPtr + 0x0c) = loadParameters.XLoadLocation
0014a920: 92420002 lbu r2,0x0002(r18)          #           baseLoadLocation.Y
0014a924: 92030002 lbu r3,0x0002(r16)          #           loadParameters.Y
0014a928: 00000000 nop
0014a92c: 00431021 addu r2,r2,r3               #           baseLoadLocation.Y + loadParameters.Y
0014a930: a222000d sb r2,0x000d(r17)           #           *(destPtr + 0x0d) = baseLoadLocation.Y + loadParameters.Y
0014a934: 92020000 lbu r2,0x0000(r16)          #           loadParameters.XLoadLocation
0014a938: 92030004 lbu r3,0x0004(r16)          #           loadParameters.Width
0014a93c: 00000000 nop
0014a940: 00431021 addu r2,r2,r3               #           loadParameters.XLoadLocation + loadParameters.Width
0014a944: a2220014 sb r2,0x0014(r17)           #           *(destPtr + 0x14) = loadParameters.XLoadLocation + loadParameters.Width
0014a948: 92420002 lbu r2,0x0002(r18)          #           baseLoadLocation.Y
0014a94c: 92030002 lbu r3,0x0002(r16)          #           loadParameters.Y
0014a950: 00000000 nop
0014a954: 00431021 addu r2,r2,r3               #           baseLoadLocation.Y + loadParameters.Y
0014a958: a2220015 sb r2,0x0015(r17)           #           *(destPtr + 0x15) = baseLoadLocation.Y + loadParameters.Y
0014a95c: 92020000 lbu r2,0x0000(r16)          #           loadParameters.XLoadLocation
0014a960: 00000000 nop
0014a964: a222001c sb r2,0x001c(r17)           #           *(destPtr + 0x1c) = loadParameters.XLoadLocation
0014a968: 92420002 lbu r2,0x0002(r18)          #           baseLoadLocation.Y
0014a96c: 92030002 lbu r3,0x0002(r16)          #           loadParameters.Y
0014a970: 92040006 lbu r4,0x0006(r16)          #           loadParameters.Height
0014a974: 00431021 addu r2,r2,r3               #           baseLoadLocation.Y + loadParameters.Y
0014a978: 00441021 addu r2,r2,r4               #           baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
0014a97c: a222001d sb r2,0x001d(r17)           #           *(destPtr + 0x1d) = baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
0014a980: 92020000 lbu r2,0x0000(r16)          #           loadParameters.XLoadLocation
0014a984: 92030004 lbu r3,0x0004(r16)          #           loadParameters.Width
0014a988: 00000000 nop
0014a98c: 00431021 addu r2,r2,r3               #           loadParameters.XLoadLocation + loadParameters.Width
0014a990: a2220024 sb r2,0x0024(r17)           #           *(destPtr + 0x24) = loadParameters.XLoadLocation + loadParameters.Width
0014a994: 92420002 lbu r2,0x0002(r18)          #           baseLoadLocation.Y
0014a998: 92030002 lbu r3,0x0002(r16)          #           loadParameters.Y
0014a99c: 92040006 lbu r4,0x0006(r16)          #           loadParameters.Height
0014a9a0: 00431021 addu r2,r2,r3               #           baseLoadLocation.Y + loadParameters.Y
0014a9a4: 00441021 addu r2,r2,r4               #           baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
0014a9a8: a2220025 sb r2,0x0025(r17)           #           *(destPtr + 0x25) = baseLoadLocation.Y + loadParameters.Y + loadParameters.Height
0014a9ac: 96620000 lhu r2,0x0000(r19)          #           baseScreenLocation.X
                                               #       }
0014a9b0: 96030008 lhu r3,0x0008(r16)          #       loadParameters.XScreenOffset
0014a9b4: 00000000 nop
0014a9b8: 00431021 addu r2,r2,r3               #       loadParameters.XScreenOffset + baseScreenLocation.X
0014a9bc: a6220008 sh r2,0x0008(r17)           #       *(destPtr + 8) = loadParameters.XScreenOffset + baseScreenLocation.X
0014a9c0: 96620002 lhu r2,0x0002(r19)          #       baseScreenLocation.Y   
0014a9c4: 9603000a lhu r3,0x000a(r16)          #       loadParameters.YScreenOffset
0014a9c8: 00000000 nop
0014a9cc: 00431021 addu r2,r2,r3               #       baseScreenLocation.Y + loadParameters.YScreenOffset
0014a9d0: a622000a sh r2,0x000a(r17)           #       *(destPtr + 10) = baseScreenLocation.Y + loadParameters.YScreenOffset
0014a9d4: 96620000 lhu r2,0x0000(r19)          #       baseScreenLocation.X
0014a9d8: 96030008 lhu r3,0x0008(r16)          #       loadParameters.XScreenOffset
0014a9dc: 96040004 lhu r4,0x0004(r16)          #       loadParameters.Width
0014a9e0: 00431021 addu r2,r2,r3               #       baseScreenLocation.X + loadParameters.XScreenOffset
0014a9e4: 00441021 addu r2,r2,r4               #       baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
0014a9e8: a6220010 sh r2,0x0010(r17)           #       *(destPtr + 0x10) = baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
0014a9ec: 96620002 lhu r2,0x0002(r19)          #       baseScreenLocation.Y
0014a9f0: 9603000a lhu r3,0x000a(r16)          #       loadParameters.YScreenOffset
0014a9f4: 00000000 nop
0014a9f8: 00431021 addu r2,r2,r3               #       baseScreenLocation.Y + loadParameters.YScreenOffset
0014a9fc: a6220012 sh r2,0x0012(r17)           #       *(destPtr + 0x12) = baseScreenLocation.Y + loadParameters.YScreenOffset
0014aa00: 96620000 lhu r2,0x0000(r19)          #       baseScreenLocation.X
0014aa04: 96030008 lhu r3,0x0008(r16)          #       loadParameters.XScreenOffset
0014aa08: 00000000 nop
0014aa0c: 00431021 addu r2,r2,r3               #       baseScreenLocation.X + loadParameters.XScreenOffset
0014aa10: a6220018 sh r2,0x0018(r17)           #       *(destPtr + 0x18) = baseScreenLocation.X + loadParameters.XScreenOffset
0014aa14: 96620002 lhu r2,0x0002(r19)          #       baseScreenLocation.Y
0014aa18: 9603000a lhu r3,0x000a(r16)          #       loadParameters.YScreenOffset
0014aa1c: 96040006 lhu r4,0x0006(r16)          #       loadParameters.Height
0014aa20: 00431021 addu r2,r2,r3               #       baseScreenLocation.Y + loadParameters.YScreenOffset
0014aa24: 00441021 addu r2,r2,r4               #       baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
0014aa28: a622001a sh r2,0x001a(r17)           #       *(destPtr + 0x1a) = baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
0014aa2c: 96620000 lhu r2,0x0000(r19)          #       baseScreenLocation.X
0014aa30: 96030008 lhu r3,0x0008(r16)          #       loadParameters.XScreenOffset
0014aa34: 96040004 lhu r4,0x0004(r16)          #       loadParameters.Width
0014aa38: 00431021 addu r2,r2,r3               #       baseScreenLocation.X + loadParameters.XScreenOffset
0014aa3c: 00441021 addu r2,r2,r4               #       baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
0014aa40: a6220020 sh r2,0x0020(r17)           #       *(destPtr + 0x20) = baseScreenLocation.X + loadParameters.XScreenOffset + loadParameters.Width
0014aa44: 96620002 lhu r2,0x0002(r19)          #       baseScreenLocation.Y
0014aa48: 9603000a lhu r3,0x000a(r16)          #       loadParameters.YScreenOffset
0014aa4c: 96040006 lhu r4,0x0006(r16)          #       loadParameters.Height
0014aa50: 00431021 addu r2,r2,r3               #       baseScreenLocation.Y + loadParameters.YScreenOffset
0014aa54: 00441021 addu r2,r2,r4               #       baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
0014aa58: a6220022 sh r2,0x0022(r17)           #       *(destPtr + 0x22) = baseScreenLocation.Y + loadParameters.YScreenOffset + loadParameters.Height
                                               #   }
0014aa5c: 8fbf0020 lw r31,0x0020(r29)
0014aa60: 8fb3001c lw r19,0x001c(r29)
0014aa64: 8fb20018 lw r18,0x0018(r29)
0014aa68: 8fb10014 lw r17,0x0014(r29)
0014aa6c: 8fb00010 lw r16,0x0010(r29)
0014aa70: 27bd0028 addiu r29,r29,0x0028
0014aa74: 03e00008 jr r31
0014aa78: 00000000 nop

Notes

Illustration of jal 0x0002398c set to nop (Lv and Exp text are misdisplayed)
Trash.png