

 [December 02, 2013, 09:05:42 PM]

« Reply #13 on: December 02, 2013, 09:05:42 PM »
Haven't forgotten this yet, important routines for the cause. Some scarce notes on some of the routines while I figure out what is happening during it all. Sorry Sort Items 00125374: 308403ff andi r4,r4,0x03ff 00125378: 2882007a slti r2,r4,0x007a 0012537c: 14400013 bne r2,r0,0x001253cc 00125380: 00001821 addu r3,r0,r0 00125384: 28820080 slti r2,r4,0x0080 00125388: 14400010 bne r2,r0,0x001253cc 0012538c: 34030005 ori r3,r0,0x0005 00125390: 28820090 slti r2,r4,0x0090 00125394: 1440000d bne r2,r0,0x001253cc 00125398: 34030001 ori r3,r0,0x0001 0012539c: 288200ac slti r2,r4,0x00ac 001253a0: 1440000a bne r2,r0,0x001253cc 001253a4: 34030002 ori r3,r0,0x0002 001253a8: 288200d0 slti r2,r4,0x00d0 001253ac: 10400003 beq r2,r0,0x001253bc 001253b0: 00000000 nop 001253b4: 080494f3 j 0x001253cc 001253b8: 34030003 ori r3,r0,0x0003 001253bc: 288200f0 slti r2,r4,0x00f0 001253c0: 10400002 beq r2,r0,0x001253cc 001253c4: 34030005 ori r3,r0,0x0005 001253c8: 34030004 ori r3,r0,0x0004 001253cc: 03e00008 jr r31 001253d0: 00601021 addu r2,r3,r0
00123824: 308403ff andi r4,r4,0x03ff Item ID 00123828: 3c018006 lui r1,0x8006 r1 = 0x8006 0012382c: 00240821 addu r1,r1,r4 r1 = 0x80060000 + Item ID 00123830: 90229494 lbu r2,0x6b6c(r1) Load Poach'd item inventory 00123834: 00000000 nop 00123838: 00451821 addu r3,r2,r5 Inventory + r5 ? 0012383c: 04610003 bgez r3,0x0012384c 00123840: 28620100 slti r2,r3,0x0100 00123844: 00001821 addu r3,r0,r0 Set r3 to 0 00123848: 28620100 slti r2,r3,0x0100 0012384c: 14400002 bne r2,r0,0x00123858 00123850: 00000000 nop 00123854: 340300ff ori r3,r0,0x00ff r3 = 0xff 00123858: 3c018006 lui r1,0x8006 0012385c: 00240821 addu r1,r1,r4 00123860: a0239494 sb r3,0x6b6c(r1) Store Inventory Item 00123864: 03e00008 jr r31 00123868: 00601021 addu r2,r3,r0 Move to r2
0012457c: 27bdffe0 addiu r29,r29,0xffe0 00124580: afb10014 sw r17,0x0014(r29) 00124584: 00808821 addu r17,r4,r0 00124588: afb00010 sw r16,0x0010(r29) 0012458c: 30b003ff andi r16,r5,0x03ff Move Item ID to r16 00124590: 16000003 bne r16,r0,0x001245a0 Branch if item exist 00124594: afbf0018 sw r31,0x0018(r29) 00124598: 0804917f j 0x001245fc Jump to end if Item does not exist 0012459c: 34020001 ori r2,r0,0x0001 001245a0: 0c0494dd jal 0x00125374 Sort items 001245a4: 02002021 addu r4,r16,r0 Move Item ID to r4 001245a8: 34030005 ori r3,r0,0x0005 r3 = 0x05 001245ac: 14430003 bne r2,r3,0x001245bc 001245b0: 00111400 sll r2,r17,0x10 001245b4: 0804917f j 0x001245fc Jump to end 001245b8: 2402ffff addiu r2,r0,0xffff 001245bc: 00021383 sra r2,r2,0x0e 001245c0: 3c01801d lui r1,0x801d 001245c4: 00220821 addu r1,r1,r2 001245c8: 8c24d5ec lw r4,0x2a14(r1) 001245cc: 0c04ac6d jal 0x0012b1b4 001245d0: 24840073 addiu r4,r4,0x0073 001245d4: 0c0493f4 jal 0x00124fd0 Load Item's Item Type 001245d8: 02002021 addu r4,r16,r0 r4 = Item ID 001245dc: 0c04ac7b jal 0x0012b1ec 001245e0: 00402021 addu r4,r2,r0 Move Item type to r4 001245e4: 0c04ac7b jal 0x0012b1ec 001245e8: 34040001 ori r4,r0,0x0001 001245ec: 14400002 bne r2,r0,0x001245f8 001245f0: 34030001 ori r3,r0,0x0001 001245f4: 2403ffff addiu r3,r0,0xffff 001245f8: 00601021 addu r2,r3,r0 001245fc: 8fbf0018 lw r31,0x0018(r29) 00124600: 8fb10014 lw r17,0x0014(r29) 00124604: 8fb00010 lw r16,0x0010(r29) 00124608: 27bd0020 addiu r29,r29,0x0020 0012460c: 03e00008 jr r31 00124610: 00000000 nop
0012502c: 27bdffa0 addiu r29,r29,0xffa0 00125030: afb60050 sw r22,0x0050(r29) 00125034: 8fb60070 lw r22,0x0070(r29) 00125038: 34020001 ori r2,r0,0x0001 0012503c: afbf005c sw r31,0x005c(r29) 00125040: afbe0058 sw r30,0x0058(r29) 00125044: afb70054 sw r23,0x0054(r29) 00125048: afb5004c sw r21,0x004c(r29) 0012504c: afb40048 sw r20,0x0048(r29) 00125050: afb30044 sw r19,0x0044(r29) 00125054: afb20040 sw r18,0x0040(r29) 00125058: afb1003c sw r17,0x003c(r29) 0012505c: afb00038 sw r16,0x0038(r29) 00125060: afa70018 sw r7,0x0018(r29) 00125064: 16c20008 bne r22,r2,0x00125088 00125068: a7a40010 sh r4,0x0010(r29) 0012506c: 3c028004 lui r2,0x8004 00125070: 8c4273ac lw r2,0x73ac(r2) 00125074: 3c030180 lui r3,0x0180 00125078: 00431024 and r2,r2,r3 0012507c: 10400003 beq r2,r0,0x0012508c 00125080: 00061400 sll r2,r6,0x10 00125084: 34160002 ori r22,r0,0x0002 00125088: 00061400 sll r2,r6,0x10 0012508c: 00021c03 sra r3,r2,0x10 00125090: 28620002 slti r2,r3,0x0002 00125094: 10400004 beq r2,r0,0x001250a8 00125098: afa00020 sw r0,0x0020(r29) 0012509c: 0000a021 addu r20,r0,r0 001250a0: 08049445 j 0x00125114 001250a4: 341e0001 ori r30,r0,0x0001 001250a8: 34020002 ori r2,r0,0x0002 001250ac: 14620004 bne r3,r2,0x001250c0 001250b0: 34020003 ori r2,r0,0x0003 001250b4: 34140002 ori r20,r0,0x0002 001250b8: 08049445 j 0x00125114 001250bc: 341e0002 ori r30,r0,0x0002 001250c0: 14620004 bne r3,r2,0x001250d4 001250c4: 34020004 ori r2,r0,0x0004 001250c8: 34140003 ori r20,r0,0x0003 001250cc: 08049445 j 0x00125114 001250d0: 341e0003 ori r30,r0,0x0003 001250d4: 14620004 bne r3,r2,0x001250e8 001250d8: 34020005 ori r2,r0,0x0005 001250dc: 34140004 ori r20,r0,0x0004 001250e0: 08049445 j 0x00125114 001250e4: 341e0004 ori r30,r0,0x0004 001250e8: 14620004 bne r3,r2,0x001250fc 001250ec: 34020006 ori r2,r0,0x0006 001250f0: 0000a021 addu r20,r0,r0 001250f4: 08049445 j 0x00125114 001250f8: 0000f021 addu r30,r0,r0 001250fc: 14620004 bne r3,r2,0x00125110 00125100: 341e0005 ori r30,r0,0x0005 00125104: 34140001 ori r20,r0,0x0001 00125108: 08049445 j 0x00125114 0012510c: 341e0001 ori r30,r0,0x0001 00125110: 34140005 ori r20,r0,0x0005 00125114: 00051400 sll r2,r5,0x10 00125118: 00028403 sra r16,r2,0x10 0012511c: 2a020064 slti r2,r16,0x0064 00125120: 1040004c beq r2,r0,0x00125254 00125124: 00009021 addu r18,r0,r0 00125128: 0c03bc6a jal 0x000ef1a8 Get Integer (Shop ID) 0012512c: 3404006f ori r4,r0,0x006f r4 = 0x6f (Shop ID integer) 00125130: 00009021 addu r18,r0,r0 00125134: afa20028 sw r2,0x0028(r29) 00125138: 34028000 ori r2,r0,0x8000 0012513c: 02021007 srav r2,r2,r16 00125140: 8fa80020 lw r8,0x0020(r29) 00125144: 0000b821 addu r23,r0,r0 00125148: afa20030 sw r2,0x0030(r29) 0012514c: 00081040 sll r2,r8,0x01 00125150: 8fa80018 lw r8,0x0018(r29) 00125154: 00008821 addu r17,r0,r0 00125158: 0048a821 addu r21,r2,r8 0012515c: 00121400 sll r2,r18,0x10 00125160: 00029c03 sra r19,r2,0x10 00125164: 0c0494dd jal 0x00125374 Sort Items 00125168: 02602021 addu r4,r19,r0 0012516c: 3283ffff andi r3,r20,0xffff 00125170: 3042ffff andi r2,r2,0xffff 00125174: 10620003 beq r3,r2,0x00125184 00125178: 02408021 addu r16,r18,r0 0012517c: 17c2002e bne r30,r2,0x00125238 00125180: 00000000 nop 00125184: 3c018019 lui r1,0x8019 00125188: 00310821 addu r1,r1,r17 0012518c: 9023d844 lbu r3,0x27bc(r1) 00125190: 3c018019 lui r1,0x8019 00125194: 00310821 addu r1,r1,r17 00125198: 9022d845 lbu r2,0x27bb(r1) 0012519c: 8fa80030 lw r8,0x0030(r29) 001251a0: 00031a00 sll r3,r3,0x08 001251a4: 00431025 or r2,r2,r3 001251a8: 00481024 and r2,r2,r8 001251ac: 10400022 beq r2,r0,0x00125238 001251b0: 00000000 nop 001251b4: 3c018006 lui r1,0x8006 001251b8: 00370821 addu r1,r1,r23 001251bc: 90222ec2 lbu r2,0x2ec2(r1) 001251c0: 8fa80028 lw r8,0x0028(r29) 001251c4: 00000000 nop 001251c8: 0102102a slt r2,r8,r2 001251cc: 1440001a bne r2,r0,0x00125238 001251d0: 00000000 nop 001251d4: 12c00013 beq r22,r0,0x00125224 001251d8: 02602821 addu r5,r19,r0 001251dc: 97a80010 lhu r8,0x0010(r29) 001251e0: 00000000 nop 001251e4: 00082400 sll r4,r8,0x10 001251e8: 0c04915f jal 0x0012457c Best Fit Routine 001251ec: 00042403 sra r4,r4,0x10 001251f0: 00401821 addu r3,r2,r0 001251f4: 34020002 ori r2,r0,0x0002 001251f8: 16c20004 bne r22,r2,0x0012520c 001251fc: 00000000 nop 00125200: 2408ffff addiu r8,r0,0xffff 00125204: 1068000c beq r3,r8,0x00125238 00125208: 00000000 nop 0012520c: 34020001 ori r2,r0,0x0001 00125210: 16c20004 bne r22,r2,0x00125224 00125214: 2408ffff addiu r8,r0,0xffff 00125218: 14680002 bne r3,r8,0x00125224 0012521c: 00000000 nop 00125220: 36504000 ori r16,r18,0x4000 00125224: a6b00000 sh r16,0x0000(r21) 00125228: 8fa80020 lw r8,0x0020(r29) 0012522c: 26b50002 addiu r21,r21,0x0002 00125230: 25080001 addiu r8,r8,0x0001 00125234: afa80020 sw r8,0x0020(r29) 00125238: 26f7000c addiu r23,r23,0x000c 0012523c: 26520001 addiu r18,r18,0x0001 00125240: 2a4200fe slti r2,r18,0x00fe 00125244: 1440ffc5 bne r2,r0,0x0012515c 00125248: 26310002 addiu r17,r17,0x0002 0012524c: 080494c5 j 0x00125314 00125250: 00000000 nop 00125254: 8fa80020 lw r8,0x0020(r29) 00125258: 3295ffff andi r21,r20,0xffff 0012525c: 00081040 sll r2,r8,0x01 00125260: 8fa80018 lw r8,0x0018(r29) 00125264: 2414ffff addiu r20,r0,0xffff 00125268: 00489821 addu r19,r2,r8 0012526c: 00121400 sll r2,r18,0x10 00125270: 00028c03 sra r17,r2,0x10 00125274: 0c0494dd jal 0x00125374 Sort Items 00125278: 02202021 addu r4,r17,r0 0012527c: 3042ffff andi r2,r2,0xffff 00125280: 12a20003 beq r21,r2,0x00125290 00125284: 02408021 addu r16,r18,r0 00125288: 17c2001e bne r30,r2,0x00125304 0012528c: 00000000 nop 00125290: 02202021 addu r4,r17,r0 Move r17 to r4 00125294: 0c048e09 jal 0x00123824 Get Poached Items 00125298: 00002821 addu r5,r0,r0 Clear r5 0012529c: 10400019 beq r2,r0,0x00125304 001252a0: 00000000 nop 001252a4: 12c00012 beq r22,r0,0x001252f0 001252a8: 02202821 addu r5,r17,r0 001252ac: 97a80010 lhu r8,0x0010(r29) 001252b0: 00000000 nop 001252b4: 00082400 sll r4,r8,0x10 001252b8: 0c04915f jal 0x0012457c Best Fit Routine 001252bc: 00042403 sra r4,r4,0x10 001252c0: 00401821 addu r3,r2,r0 001252c4: 34020002 ori r2,r0,0x0002 001252c8: 16c20003 bne r22,r2,0x001252d8 001252cc: 00000000 nop 001252d0: 1074000c beq r3,r20,0x00125304 001252d4: 00000000 nop 001252d8: 34020001 ori r2,r0,0x0001 001252dc: 16c20004 bne r22,r2,0x001252f0 001252e0: 00000000 nop 001252e4: 14740002 bne r3,r20,0x001252f0 001252e8: 00000000 nop 001252ec: 36504000 ori r16,r18,0x4000 001252f0: a6700000 sh r16,0x0000(r19) 001252f4: 8fa80020 lw r8,0x0020(r29) 001252f8: 26730002 addiu r19,r19,0x0002 001252fc: 25080001 addiu r8,r8,0x0001 00125300: afa80020 sw r8,0x0020(r29) 00125304: 26520001 addiu r18,r18,0x0001 00125308: 2a4200fe slti r2,r18,0x00fe 0012530c: 1440ffd8 bne r2,r0,0x00125270 00125310: 00121400 sll r2,r18,0x10 00125314: 8fa80020 lw r8,0x0020(r29) 00125318: 00000000 nop 0012531c: 00081040 sll r2,r8,0x01 00125320: 8fa80018 lw r8,0x0018(r29) 00125324: 2403ffff addiu r3,r0,0xffff 00125328: 00481021 addu r2,r2,r8 0012532c: a4430000 sh r3,0x0000(r2) 00125330: 8fa50018 lw r5,0x0018(r29) 00125334: 0c048595 jal 0x00121654 Main Shop Routine 00125338: 34040006 ori r4,r0,0x0006 0012533c: 8fa20020 lw r2,0x0020(r29) 00125340: 8fbf005c lw r31,0x005c(r29) 00125344: 8fbe0058 lw r30,0x0058(r29) 00125348: 8fb70054 lw r23,0x0054(r29) 0012534c: 8fb60050 lw r22,0x0050(r29) 00125350: 8fb5004c lw r21,0x004c(r29) 00125354: 8fb40048 lw r20,0x0048(r29) 00125358: 8fb30044 lw r19,0x0044(r29) 0012535c: 8fb20040 lw r18,0x0040(r29) 00125360: 8fb1003c lw r17,0x003c(r29) 00125364: 8fb00038 lw r16,0x0038(r29) 00125368: 27bd0060 addiu r29,r29,0x0060 0012536c: 03e00008 jr r31 00125370: 00000000 nop
00124fd0: 308403ff andi r4,r4,0x03ff 00124fd4: 00041040 sll r2,r4,0x01 Item ID * 2 00124fd8: 00441021 addu r2,r2,r4 Item ID * 3 00124fdc: 00021080 sll r2,r2,0x02 Item ID * 12 00124fe0: 3c018006 lui r1,0x8006 00124fe4: 00220821 addu r1,r1,r2 0x80060000 + Item ID * 12 00124fe8: 90222ebd lbu r2,0x2ebd(r1) Load Item's Item Type 00124fec: 03e00008 jr r31 00124ff0: 00000000 nop


