Reset Misc Unit Graphic Trigger

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: RESET MISC UNIT GRAPHIC TRIGGER
#       Resets the graphic trigger and a related field in the misc unit data.
#       Parameters:
#           r4 = (unitMiscID) Unit Misc ID
#       Returns:
#           r2 =    1, if misc unit was found with specified ID
#                   0, otherwise

8008d18c: 27bdffe8 addiu r29,r29,-0x0018
8008d190: afbf0010 sw r31,0x0010(r29)
8008d194: 0c01e9b9 jal 0x8007a6e4                   #   miscUnit = Get Unit Misc Data Pointer (unitMiscID);
8008d198: 3084ffff andi r4,r4,0xffff
8008d19c: 00401821 addu r3,r2,r0                    #   miscUnit
                                                    #   result = 1
8008d1a0: 14600003 bne r3,r0,0x8008d1b0             #   if (miscUnit == null) {
8008d1a4: 34020001 ori r2,r0,0x0001                 
8008d1a8: 0802346e j 0x8008d1b8                     #       return 0;
8008d1ac: 00001021 addu r2,r0,r0                    #   }
8008d1b0: a460000a sh r0,0x000a(r3)                 #   miscUnit.0x0a = 0
8008d1b4: a46001d8 sh r0,0x01d8(r3)                 #   miscUnit.graphicTrigger = 0
8008d1b8: 8fbf0010 lw r31,0x0010(r29)               #   return result;
8008d1bc: 27bd0018 addiu r29,r29,0x0018
8008d1c0: 03e00008 jr r31
8008d1c4: 00000000 nop