• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
May 20, 2024, 03:12:21 pm

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed! Find out how you can help in the Recruitment section or our Discord!


ASM Collective BATTLE.BIN Map

Started by formerdeathcorps, January 06, 2011, 05:09:33 am

Choto

unfortunately, I don't think it handles that kinda stuff. if we found the defend and equip change routines though, it might show how they make them direct commands.

Pickle Girl Fanboy

Is anything being done to make sprites less stupid?  Like, to make the battle sprite sheet used for the formation screen and the troop placement screen, so the only thing you have to deal with is custom animations in events?


Choto

If anybody uploads routines to the wiki (which I strongly encourage), here's a VERY easy way to format them correctly: If you have Microsoft office, copy and paste it into there. Under "edit", find "replace". type the character to be replaced as the beginning of the address for each line ex: "0005...." and replace it with "(space)0005..." hit replace all and voila, your arrow keys and space bar are saved from destruction!

Pickle Girl Fanboy

Leafpad, a plain text editor (like Windows Notepad) for Linux, has Replace and Replace All functionality.  You can access it from the Search menu, or with the keyboard shortcut Ctrl + h.

Choto

Does anybody have these routines documented?

00186af8               Wiznaibus/Witch Hunt Formula

00184360               Skill-Set Hard Coding
001869ec          Magic/Angel Song

They're from formulas 1d and 1c:

http://ffhacktics.com/wiki/1D_Hit_%28X%29%25
http://ffhacktics.com/wiki/1C_Hit_%28X%29%25

formerdeathcorps

March 26, 2012, 08:43:22 am #126 Last Edit: March 26, 2012, 08:57:47 am by formerdeathcorps
Who says old routines can't yield new fruit?


0011f91c: 27bdffe8 addiu r29,r29,-0x0018
0011f920: afbf0010 sw r31,0x0010(r29)
0011f924: 0c063ba8 jal 0x0018eea0             Get RN into r2.
0011f928: 00000000 nop
0011f92c: 3c038019 lui r3,0x8019
0011f930: 906338fa lbu r3,0x38fa(r3)            Load Y
0011f934: 00000000 nop
0011f938: 00430018 mult r2,r3
0011f93c: 00001012 mflo r2
0011f940: 04410002 bgez r2,0x0011f94c
0011f944: 00000000 nop
0011f948: 24427fff addiu r2,r2,0x7fff
0011f94c: 000213c3 sra r2,r2,0x0f
0011f950: 3c038019 lui r3,0x8019
0011f954: 946338ce lhu r3,0x38ce(r3)             Load XA = PA
0011f958: 24420001 addiu r2,r2,0x0001           r2 an RN from (1...Y)
0011f95c: 00430018 mult r2,r3
0011f960: 3c048019 lui r4,0x8019
0011f964: 8c842d90 lw r4,0x2d90(r4)
0011f968: 34020080 ori r2,r0,0x0080
0011f96c: a0820025 sb r2,0x0025(r4)               Set as HP DMG
0011f970: 3c038019 lui r3,0x8019
0011f974: 8c63f5fc lw r3,-0x0a04(r3)
0011f978: 00001012 mflo r2                            r2 = XA * (1...Y)
0011f97c: 14600017 bne r3,r0,0x0011f9dc
0011f980: a4820004 sh r2,0x0004(r4)               Store r2 as HP DMG
0011f984: 0c063ba8 jal 0x0018eea0                 Get RNG, put in r2
0011f988: 00000000 nop
0011f98c: 3c038019 lui r3,0x8019
0011f990: 8c632d94 lw r3,0x2d94(r3)
0011f994: 00000000 nop
0011f998: 90630024 lbu r3,0x0024(r3)              Get Caster Brave?  (Here's where the fun begins)
0011f99c: 00000000 nop
0011f9a0: 00430018 mult r2,r3
0011f9a4: 00002812 mflo r5
0011f9a8: 04a10002 bgez r5,0x0011f9b4
0011f9ac: 00000000 nop
0011f9b0: 24a57fff addiu r5,r5,0x7fff
0011f9b4: 3c028019 lui r2,0x8019
0011f9b8: 8c422d98 lw r2,0x2d98(r2)
0011f9bc: 00000000 nop
0011f9c0: 90440024 lbu r4,0x0024(r2)                  r4 is TarBr
0011f9c4: 0c017833 jal 0x0005e0cc                     Random Hits routine!
0011f9c8: 00052bc3 sra r5,r5,0x0f                       r5 is CasBr * RNG
0011f9cc: 14400003 bne r2,r0,0x0011f9dc             If Check fails, SKIP...
0011f9d0: 00000000 nop
0011f9d4: 0c0610fb jal 0x001843ec                      ...the Knockback routine
0011f9d8: 00000000 nop
0011f9dc: 8fbf0010 lw r31,0x0010(r29)
0011f9e0: 27bd0018 addiu r29,r29,0x0018
0011f9e4: 03e00008 jr r31


In short, what the above demonstrates is that the chance for knockback to occur in Vanilla is not 50%, but actually the chance CasBr * RNG will exceed TarBr * RNG.
What this means is that the probability of knockback on these formulas is actually (CasBr) / (CasBr + TarBr).
If you don't believe me, try using a 100 Brave Ramza to knockback an 10 or 11 brave opponent.  Your error rate should be only 9 - 10%
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Choto

Here's a little bit of the stuff SA was looking at for display. Its pretty much the basic framework for all post-action data display. Here are some noticeable things:

-His notes are AWESOME. They're clear as can be, i'm truly envious of how he tears through whole sections with such complete notes.

-there are 6 unused bytes under "status image data", which hopefully can be used to display custom or additional statii.

-there is some hardcoding for the 999 cap in the display section, should we ever want to take down that wall. (*wink wink)

all the rest is self-explanatory, i'm sure you guys will notice more things than i did checking it out. He said he has other notes but they're pretty disorganized/don't have many notes attached to them. I feel like this is a good basic starting point for post-action display alterations. I'll put this up on the wiki too, but here it is in file form.


Celdia

Quote from: Choto on May 02, 2012, 09:03:01 am
-there are 6 unused bytes under "status image data", which hopefully can be used to display custom or additional statii.

That's exactly what its for. Anyone that ever wanted to make the Wall status display something on screen now can using this. There are some additional notes that I don't think are in the raw that allow you to modify the same tables in WORLD.BIN so that you can make those status names appear in the Item List properly as well. A couple of examples in the spoilers below.







  • Modding version: PSX
  • Discord username: Celdia#0


Choto

Not sure if i ever posted these 2 routines, but they're worth mentioning.

This one is the main in-between turn routine... its on the wiki i think. It's analogous to the main reaction routine on the wiki, so it seems quite useful.



Main in between turn routine
001827f0: 27bdffc0 addiu r29,r29,0xffc0
001827f4: afb5002c sw r21,0x002c(r29)
001827f8: 0000a821 addu r21,r0,r0
001827fc: 34020001 ori r2,r0,0x0001
00182800: afbf003c sw r31,0x003c(r29)
00182804: afbe0038 sw r30,0x0038(r29)
00182808: afb70034 sw r23,0x0034(r29)
0018280c: afb60030 sw r22,0x0030(r29)
00182810: afb40028 sw r20,0x0028(r29)
00182814: afb30024 sw r19,0x0024(r29)
00182818: afb20020 sw r18,0x0020(r29)
0018281c: afb1001c sw r17,0x001c(r29)
00182820: afb00018 sw r16,0x0018(r29)
00182824: 1482001f bne r4,r2,0x001828a4
00182828: afa00010 sw r0,0x0010(r29)
0018282c: 34120003 ori r18,r0,0x0003
00182830: 3c038019 lui r3,0x8019
00182834: 2463f5fa addiu r3,r3,0xf5fa
00182838: 2402ffff addiu r2,r0,0xffff
0018283c: 3c018019 lui r1,0x8019
00182840: ac20f518 sw r0,-0x0ae8(r1)
00182844: 3c018019 lui r1,0x8019
00182848: ac22f520 sw r2,-0x0ae0(r1)
0018284c: a4600000 sh r0,0x0000(r3)
00182850: 2652ffff addiu r18,r18,0xffff
00182854: 0641fffd bgez r18,0x0018284c
00182858: 2463fffe addiu r3,r3,0xfffe
0018285c: 3c018019 lui r1,0x8019
00182860: a020389d sb r0,0x389d(r1)
00182864: 00009021 addu r18,r0,r0
00182868: 340400ff ori r4,r0,0x00ff
0018286c: 3c038019 lui r3,0x8019
00182870: 246308cc addiu r3,r3,0x08cc

00182874: a0600039 sb r0,0x0039(r3)       store 0 CT
00182878: a0600186 sb r0,0x0186(r3)      store turn over
0018287c: a0600189 sb r0,0x0189(r3)      store ?
00182880: a064015d sb r4,0x015d(r3)      Store Current ability CT = ff
00182884: 26520001 addiu r18,r18,0x0001
00182888: 2a420015 slti r2,r18,0x0015
0018288c: 1440fff9 bne r2,r0,0x00182874      cycles through each unit?
00182890: 246301c0 addiu r3,r3,0x01c0

00182894: 0c06398a jal 0x0018e628      ???
00182898: 00000000 nop
0018289c: 08060c11 j 0x00183044         jump to end?
001828a0: 3402e000 ori r2,r0,0xe000
001828a4: 34020002 ori r2,r0,0x0002
001828a8: 14820034 bne r4,r2,0x0018297c      ??
001828ac: 341e0001 ori r30,r0,0x0001
001828b0: 00009021 addu r18,r0,r0
001828b4: 340400ff ori r4,r0,0x00ff
001828b8: 3c038019 lui r3,0x8019
001828bc: 246308cc addiu r3,r3,0x08cc      unit data

001828c0: 90620001 lbu r2,0x0001(r3)      
001828c4: 00000000 nop
001828c8: 1044000b beq r2,r4,0x001828f8      unit exists check
001828cc: 00000000 nop
001828d0: 90620058 lbu r2,0x0058(r3)      current status
001828d4: 00000000 nop
001828d8: 30420064 andi r2,r2,0x0064
001828dc: 14400006 bne r2,r0,0x001828f8      dead/crystal/jump check
001828e0: 00000000 nop
001828e4: 90620059 lbu r2,0x0059(r3)      
001828e8: 00000000 nop
001828ec: 30420081 andi r2,r2,0x0081      
001828f0: 104001d4 beq r2,r0,0x00183044      petrify/treasure check
001828f4: 3642d000 ori r2,r18,0xd000
001828f8: 26520001 addiu r18,r18,0x0001
001828fc: 2a420015 slti r2,r18,0x0015
00182900: 1440ffef bne r2,r0,0x001828c0      cycles through each unit?
00182904: 246301c0 addiu r3,r3,0x01c0

00182908: 08060c11 j 0x00183044         jump to end?
0018290c: 3402df00 ori r2,r0,0xdf00
00182910: 3c018019 lui r1,0x8019
00182914: 00320821 addu r1,r1,r18
00182918: a020f8b0 sb r0,-0x0750(r1)      ??
0018291c: 08060c11 j 0x00183044
00182920: 36420300 ori r2,r18,0x0300
00182924: 001410c0 sll r2,r20,0x03
00182928: 00541023 subu r2,r2,r20
0018292c: 00021180 sll r2,r2,0x06
00182930: 3c038019 lui r3,0x8019
00182934: 246308cc addiu r3,r3,0x08cc      unit data
00182938: 00438821 addu r17,r2,r3
0018293c: 34030001 ori r3,r0,0x0001
00182940: a2230186 sb r3,0x0186(r17)      store turn = 1
00182944: a2230027 sb r3,0x0027(r17)      store active turn?
00182948: 34030009 ori r3,r0,0x0009
0018294c: a2200039 sb r0,0x0039(r17)      store CT = 0
00182950: a2200187 sb r0,0x0187(r17)      store can move
00182954: a2200188 sb r0,0x0188(r17)      store can act
00182958: 3c018019 lui r1,0x8019
0018295c: ac23f51c sw r3,-0x0ae4(r1)      store ? = 9
00182960: 3403000a ori r3,r0,0x000a
00182964: 3c018019 lui r1,0x8019
00182968: ac34f520 sw r20,-0x0ae0(r1)      store ? = r20 (set by jal routine?)
0018296c: 3c018019 lui r1,0x8019
00182970: ac23f518 sw r3,-0x0ae8(r1)      store ? = 10
00182974: 08060c11 j 0x00183044         jump to end
00182978: 36820100 ori r2,r20,0x0100
0018297c: 3c168019 lui r22,0x8019
00182980: 26d608cc addiu r22,r22,0x08cc      
00182984: 341700ff ori r23,r0,0x00ff
00182988: 3c038019 lui r3,0x8019
0018298c: 8c63f518 lw r3,-0x0ae8(r3)      store ?? = 10?
00182990: 00000000 nop
00182994: 2c620014 sltiu r2,r3,0x0014      set if r3 < 20
00182998: 104001a1 beq r2,r0,0x00183020
0018299c: 00031080 sll r2,r3,0x02
001829a0: 3c018017 lui r1,0x8017
001829a4: 00220821 addu r1,r1,r2
001829a8: 8c224174 lw r2,0x4174(r1)
001829ac: 00000000 nop
001829b0: 00400008 jr r2
001829b4: 00000000 nop
001829b8: 00009021 addu r18,r0,r0
001829bc: 00008021 addu r16,r0,r0

001829c0: 02168821 addu r17,r16,r22
001829c4: 0c060cb3 jal 0x001832cc      various checks
001829c8: 02202021 addu r4,r17,r0
001829cc: 00401821 addu r3,r2,r0
001829d0: 30620001 andi r2,r3,0x0001
001829d4: 14400013 bne r2,r0,0x00182a24
001829d8: 30620020 andi r2,r3,0x0020
001829dc: 92240038 lbu r4,0x0038(r17)      load speed
001829e0: 10400003 beq r2,r0,0x001829f0
001829e4: 30620010 andi r2,r3,0x0010
001829e8: 08060a80 j 0x00182a00
001829ec: 00042042 srl r4,r4,0x01
001829f0: 10400003 beq r2,r0,0x00182a00
001829f4: 3082ffff andi r2,r4,0xffff
001829f8: 00021042 srl r2,r2,0x01
001829fc: 00822021 addu r4,r4,r2
00182a00: 92220039 lbu r2,0x0039(r17)      load CT
00182a04: 00000000 nop
00182a08: 00821821 addu r3,r4,r2
00182a0c: 3062ffff andi r2,r3,0xffff
00182a10: 2c4200ff sltiu r2,r2,0x00ff
00182a14: 14400002 bne r2,r0,0x00182a20
00182a18: 00000000 nop
00182a1c: 340300fe ori r3,r0,0x00fe
00182a20: a2230039 sb r3,0x0039(r17)      store CT
00182a24: 26520001 addiu r18,r18,0x0001
00182a28: 2a420015 slti r2,r18,0x0015
00182a2c: 1440ffe4 bne r2,r0,0x001829c0      cycle through each unit

00182a30: 261001c0 addiu r16,r16,0x01c0
00182a34: 3c018019 lui r1,0x8019
00182a38: ac3ef518 sw r30,-0x0ae8(r1)
00182a3c: 08060c08 j 0x00183020
00182a40: 00000000 nop
00182a44: 34130063 ori r19,r0,0x0063
00182a48: 341400ff ori r20,r0,0x00ff
00182a4c: 00009021 addu r18,r0,r0
00182a50: 02c08021 addu r16,r22,r0

00182a54: 0c060cb3 jal 0x001832cc
00182a58: 02002021 addu r4,r16,r0
00182a5c: 30420001 andi r2,r2,0x0001
00182a60: 14400008 bne r2,r0,0x00182a84
00182a64: 00000000 nop
00182a68: 92030039 lbu r3,0x0039(r16)      laod CT
00182a6c: 00000000 nop
00182a70: 0263102b sltu r2,r19,r3
00182a74: 10400003 beq r2,r0,0x00182a84
00182a78: 00000000 nop
00182a7c: 0240a021 addu r20,r18,r0
00182a80: 00609821 addu r19,r3,r0
00182a84: 26520001 addiu r18,r18,0x0001
00182a88: 2a420015 slti r2,r18,0x0015
00182a8c: 1440fff1 bne r2,r0,0x00182a54
00182a90: 261001c0 addiu r16,r16,0x01c0



00182a94: 12970043 beq r20,r23,0x00182ba4
00182a98: 001410c0 sll r2,r20,0x03
00182a9c: 00541023 subu r2,r2,r20
00182aa0: 00021180 sll r2,r2,0x06
00182aa4: 00568821 addu r17,r2,r22
00182aa8: 92220058 lbu r2,0x0058(r17)      load status
00182aac: 00000000 nop
00182ab0: 30420004 andi r2,r2,0x0004
00182ab4: 10400003 beq r2,r0,0x00182ac4      jump check
00182ab8: 34020063 ori r2,r0,0x0063
00182abc: 08060c0e j 0x00183038
00182ac0: a2220039 sb r2,0x0039(r17)      store CT
00182ac4: 92220039 lbu r2,0x0039(r17)      Load CT
00182ac8: 00000000 nop
00182acc: 14570003 bne r2,r23,0x00182adc
00182ad0: 3c0251eb lui r2,0x51eb
00182ad4: 08060ac3 j 0x00182b0c
00182ad8: a2200039 sb r0,0x0039(r17)      store 0 in CT
00182adc: 3442851f ori r2,r2,0x851f
00182ae0: 3264ffff andi r4,r19,0xffff
00182ae4: 00820019 multu r4,r2
00182ae8: 00001810 mfhi r3
00182aec: 00031942 srl r3,r3,0x05
00182af0: 00031040 sll r2,r3,0x01
00182af4: 00431021 addu r2,r2,r3
00182af8: 000210c0 sll r2,r2,0x03
00182afc: 00431021 addu r2,r2,r3
00182b00: 00021080 sll r2,r2,0x02
00182b04: 00822023 subu r4,r4,r2
00182b08: a2240039 sb r4,0x0039(r17)      store CT
00182b0c: 02802021 addu r4,r20,r0
00182b10: 0c060c1e jal 0x00183078      undead revive, reraise, death sentence, etc.
00182b14: 02202821 addu r5,r17,r0
00182b18: 00408021 addu r16,r2,r0
00182b1c: 12000009 beq r16,r0,0x00182b44
00182b20: 32020001 andi r2,r16,0x0001
00182b24: 10400007 beq r2,r0,0x00182b44
00182b28: 36950300 ori r21,r20,0x0300
00182b2c: 161e0145 bne r16,r30,0x00183044
00182b30: 02a01021 addu r2,r21,r0
00182b34: 0c01799c jal 0x0005e670      [[Increase Casualties/Injured Counters]]
00182b38: 02202021 addu r4,r17,r0
00182b3c: 08060c11 j 0x00183044         jump to end
00182b40: 02a01021 addu r2,r21,r0
00182b44: 0c060cb3 jal 0x001832cc
00182b48: 02202021 addu r4,r17,r0
00182b4c: 30420007 andi r2,r2,0x0007
00182b50: 10400003 beq r2,r0,0x00182b60
00182b54: 34020002 ori r2,r0,0x0002
00182b58: 16020137 bne r16,r2,0x00183038
00182b5c: 00000000 nop
00182b60: a23e0186 sb r30,0x0186(r17)      store turn ?
00182b64: a2200187 sb r0,0x0187(r17)      store can move
00182b68: a2200188 sb r0,0x0188(r17)      store can act
00182b6c: 16000002 bne r16,r0,0x00182b78
00182b70: a23e0027 sb r30,0x0027(r17)      store units turn ?
00182b74: 36950100 ori r21,r20,0x0100
00182b78: 3c048019 lui r4,0x8019
00182b7c: 8c84f518 lw r4,-0x0ae8(r4)
00182b80: 3403000a ori r3,r0,0x000a
00182b84: 3c018019 lui r1,0x8019
00182b88: ac34f520 sw r20,-0x0ae0(r1)
00182b8c: 3c018019 lui r1,0x8019
00182b90: ac23f518 sw r3,-0x0ae8(r1)
00182b94: 3c018019 lui r1,0x8019
00182b98: ac24f51c sw r4,-0x0ae4(r1)
00182b9c: 08060c11 j 0x00183044
00182ba0: 02a01021 addu r2,r21,r0
00182ba4: 08060c06 j 0x00183018
00182ba8: 34020002 ori r2,r0,0x0002
00182bac: 00009021 addu r18,r0,r0
00182bb0: 02c08021 addu r16,r22,r0

00182bb4: 0c060cb3 jal 0x001832cc      various checks
00182bb8: 02002021 addu r4,r16,r0
00182bbc: 3042000f andi r2,r2,0x000f
00182bc0: 14400009 bne r2,r0,0x00182be8
00182bc4: 26520001 addiu r18,r18,0x0001
00182bc8: 9203015d lbu r3,0x015d(r16)      load current ability CT
00182bcc: 00000000 nop
00182bd0: 306200ff andi r2,r3,0x00ff
00182bd4: 10570004 beq r2,r23,0x00182be8   branch if not charging ability
00182bd8: 00000000 nop
00182bdc: 10400002 beq r2,r0,0x00182be8      branch if
00182be0: 2463ffff addiu r3,r3,0xffff      CT decrement?
00182be4: a203015d sb r3,0x015d(r16)      store new ability CT
00182be8: 2a420015 slti r2,r18,0x0015
00182bec: 1440fff1 bne r2,r0,0x00182bb4      cycle through each unit
00182bf0: 261001c0 addiu r16,r16,0x01c0      r16 = next unit

00182bf4: 34060003 ori r6,r0,0x0003
00182bf8: 3c018019 lui r1,0x8019
00182bfc: ac26f518 sw r6,-0x0ae8(r1)
00182c00: 08060c08 j 0x00183020
00182c04: 00000000 nop
00182c08: 00009021 addu r18,r0,r0
00182c0c: 00008021 addu r16,r0,r0
00182c10: 02168821 addu r17,r16,r22
00182c14: 0c060cb3 jal 0x001832cc
00182c18: 02202021 addu r4,r17,r0
00182c1c: 3042000f andi r2,r2,0x000f
00182c20: 14400015 bne r2,r0,0x00182c78
00182c24: 00000000 nop
00182c28: 9222015d lbu r2,0x015d(r17)      load ability CT
00182c2c: 00000000 nop
00182c30: 14400011 bne r2,r0,0x00182c78
00182c34: 00000000 nop
00182c38: 92220058 lbu r2,0x0058(r17)      load status
00182c3c: 00000000 nop
00182c40: 30420001 andi r2,r2,0x0001
00182c44: 10400006 beq r2,r0,0x00182c60      performing check
00182c48: 00000000 nop
00182c4c: 0c0179de jal 0x0005e778      [[Transfer Last Ability Used CT]]
00182c50: 02202021 addu r4,r17,r0
00182c54: 9222018b lbu r2,0x018b(r17)      load unit id?
00182c58: 08060b19 j 0x00182c64
00182c5c: a222015d sb r2,0x015d(r17)      store ability CT
00182c60: a237015d sb r23,0x015d(r17)      store ability CT
00182c64: 34020009 ori r2,r0,0x0009
00182c68: 3c018019 lui r1,0x8019
00182c6c: ac22f518 sw r2,-0x0ae8(r1)      store 9 into ??
00182c70: 08060c11 j 0x00183044
00182c74: 36420200 ori r2,r18,0x0200
00182c78: 26520001 addiu r18,r18,0x0001
00182c7c: 2a420015 slti r2,r18,0x0015
00182c80: 1440ffe3 bne r2,r0,0x00182c10
00182c84: 261001c0 addiu r16,r16,0x01c0      cycles through each unit

00182c88: 08060c06 j 0x00183018
00182c8c: 34020004 ori r2,r0,0x0004
00182c90: 00009021 addu r18,r0,r0
00182c94: 02c08021 addu r16,r22,r0
00182c98: 92020001 lbu r2,0x0001(r16)      load unit ID
00182c9c: 00000000 nop
00182ca0: 10570008 beq r2,r23,0x00182cc4   branch if doesn't exist?
00182ca4: 00000000 nop
00182ca8: 92020058 lbu r2,0x0058(r16)      laod status
00182cac: 00000000 nop
00182cb0: 30420004 andi r2,r2,0x0004
00182cb4: 14400003 bne r2,r0,0x00182cc4      jump check?
00182cb8: 00000000 nop
00182cbc: 0c063644 jal 0x0018d910      ??
00182cc0: 02402021 addu r4,r18,r0
00182cc4: 26520001 addiu r18,r18,0x0001
00182cc8: 2a420015 slti r2,r18,0x0015
00182ccc: 1440fff2 bne r2,r0,0x00182c98
00182cd0: 261001c0 addiu r16,r16,0x01c0      Cycles through each unit

00182cd4: 34060005 ori r6,r0,0x0005
00182cd8: 3c018019 lui r1,0x8019
00182cdc: ac26f518 sw r6,-0x0ae8(r1)
00182ce0: 08060c08 j 0x00183020
00182ce4: 00000000 nop
00182ce8: 00009021 addu r18,r0,r0
00182cec: 3c048019 lui r4,0x8019
00182cf0: 2484f8b0 addiu r4,r4,0xf8b0      AI data?
00182cf4: 02c01821 addu r3,r22,r0

00182cf8: a0800000 sb r0,0x0000(r4)
00182cfc: 90620001 lbu r2,0x0001(r3)
00182d00: 00000000 nop
00182d04: 10570009 beq r2,r23,0x00182d2c
00182d08: 26520001 addiu r18,r18,0x0001
00182d0c: 90620058 lbu r2,0x0058(r3)      
00182d10: 00000000 nop
00182d14: 30420004 andi r2,r2,0x0004
00182d18: 14400004 bne r2,r0,0x00182d2c      jump check
00182d1c: 00000000 nop
00182d20: 906201b1 lbu r2,0x01b1(r3)
00182d24: 00000000 nop
00182d28: a0820000 sb r2,0x0000(r4)
00182d2c: 24840001 addiu r4,r4,0x0001
00182d30: 2a420015 slti r2,r18,0x0015
00182d34: 1440fff0 bne r2,r0,0x00182cf8
00182d38: 246301c0 addiu r3,r3,0x01c0      Cycle through each nit

00182d3c: 34060006 ori r6,r0,0x0006
00182d40: 3c018019 lui r1,0x8019
00182d44: ac26f518 sw r6,-0x0ae8(r1)
00182d48: 08060c08 j 0x00183020
00182d4c: 00000000 nop
00182d50: 00009021 addu r18,r0,r0

00182d54: 3c018019 lui r1,0x8019
00182d58: 00320821 addu r1,r1,r18
00182d5c: 9022f8b0 lbu r2,-0x0750(r1)
00182d60: 00000000 nop
00182d64: 1440feea bne r2,r0,0x00182910      skip to active turn part
00182d68: 00000000 nop
00182d6c: 26520001 addiu r18,r18,0x0001
00182d70: 2a420015 slti r2,r18,0x0015
00182d74: 1440fff7 bne r2,r0,0x00182d54
00182d78: 00000000 nop

00182d7c: 3c018019 lui r1,0x8019
00182d80: ac20f518 sw r0,-0x0ae8(r1)
00182d84: 08060c08 j 0x00183020
00182d88: 00000000 nop
00182d8c: 341300fe ori r19,r0,0x00fe
00182d90: 341400ff ori r20,r0,0x00ff
00182d94: 00009021 addu r18,r0,r0
00182d98: 02c08821 addu r17,r22,r0
00182d9c: 00008021 addu r16,r0,r0
00182da0: 0c060cb3 jal 0x001832cc
00182da4: 02202021 addu r4,r17,r0
00182da8: 30420001 andi r2,r2,0x0001
00182dac: 1440000a bne r2,r0,0x00182dd8
00182db0: 263101c0 addiu r17,r17,0x01c0
00182db4: 3c018019 lui r1,0x8019
00182db8: 00300821 addu r1,r1,r16
00182dbc: 90230905 lbu r3,0x0905(r1)      load CT
00182dc0: 00000000 nop
00182dc4: 0263102b sltu r2,r19,r3
00182dc8: 10400003 beq r2,r0,0x00182dd8
00182dcc: 00000000 nop
00182dd0: 0240a021 addu r20,r18,r0
00182dd4: 00609821 addu r19,r3,r0
00182dd8: 26520001 addiu r18,r18,0x0001
00182ddc: 2a420015 slti r2,r18,0x0015
00182de0: 1440ffef bne r2,r0,0x00182da0
00182de4: 261001c0 addiu r16,r16,0x01c0      Cycle through each unit

00182de8: 1697fece bne r20,r23,0x00182924
00182dec: 34060003 ori r6,r0,0x0003
00182df0: 3c018019 lui r1,0x8019
00182df4: ac26f51c sw r6,-0x0ae4(r1)
00182df8: 08060c06 j 0x00183018
00182dfc: 3402000d ori r2,r0,0x000d
00182e00: 00009021 addu r18,r0,r0
00182e04: 02c09821 addu r19,r22,r0
00182e08: 02608821 addu r17,r19,r0
00182e0c: 92220186 lbu r2,0x0186(r17)      load current turn byte
00182e10: 00000000 nop
00182e14: 1040000f beq r2,r0,0x00182e54      skip if turn over?
00182e18: 00000000 nop
00182e1c: 0c060cb3 jal 0x001832cc      jump to ?
00182e20: 02202021 addu r4,r17,r0
00182e24: 02202021 addu r4,r17,r0
00182e28: 0c060f44 jal 0x00183d10      Jump to nullify act/move
00182e2c: 00408021 addu r16,r2,r0
00182e30: 32100001 andi r16,r16,0x0001
00182e34: 16000003 bne r16,r0,0x00182e44
00182e38: 267301c0 addiu r19,r19,0x01c0
00182e3c: 10400081 beq r2,r0,0x00183044
00182e40: 36420100 ori r2,r18,0x0100
00182e44: 0c060f1b jal 0x00183c6c
00182e48: 02402021 addu r4,r18,r0
00182e4c: 08060b96 j 0x00182e58
00182e50: a2200186 sb r0,0x0186(r17)      store turn over(?)
00182e54: 267301c0 addiu r19,r19,0x01c0
00182e58: 26520001 addiu r18,r18,0x0001
00182e5c: 2a420015 slti r2,r18,0x0015
00182e60: 1440ffea bne r2,r0,0x00182e0c
00182e64: 02608821 addu r17,r19,r0      cycle through each unit?

00182e68: 08060c06 j 0x00183018
00182e6c: 34020013 ori r2,r0,0x0013
00182e70: 3c038019 lui r3,0x8019
00182e74: 8c63f520 lw r3,-0x0ae0(r3)
00182e78: 3402000f ori r2,r0,0x000f
00182e7c: 3c018019 lui r1,0x8019
00182e80: ac22f518 sw r2,-0x0ae8(r1)
00182e84: 2402ffff addiu r2,r0,0xffff
00182e88: 10620065 beq r3,r2,0x00183020
00182e8c: 00000000 nop
00182e90: 000320c0 sll r4,r3,0x03
00182e94: 00832023 subu r4,r4,r3
00182e98: 00042180 sll r4,r4,0x06
00182e9c: 0c0635f2 jal 0x0018d7c8      Regen and Poison
00182ea0: 00962021 addu r4,r4,r22
00182ea4: 08060bc7 j 0x00182f1c
00182ea8: 00000000 nop
00182eac: 3c038019 lui r3,0x8019
00182eb0: 8c63f520 lw r3,-0x0ae0(r3)
00182eb4: 34020011 ori r2,r0,0x0011
00182eb8: 3c018019 lui r1,0x8019
00182ebc: ac22f518 sw r2,-0x0ae8(r1)
00182ec0: 2402ffff addiu r2,r0,0xffff
00182ec4: 10620056 beq r3,r2,0x00183020
00182ec8: 00000000 nop
00182ecc: 000320c0 sll r4,r3,0x03
00182ed0: 00832023 subu r4,r4,r3
00182ed4: 00042180 sll r4,r4,0x06
00182ed8: 0c0636a2 jal 0x0018da88      Poison Marsh Routine
00182edc: 00962021 addu r4,r4,r22
00182ee0: 08060bc7 j 0x00182f1c
00182ee4: 00000000 nop
00182ee8: 3c038019 lui r3,0x8019
00182eec: 8c63f520 lw r3,-0x0ae0(r3)
00182ef0: 3402000d ori r2,r0,0x000d
00182ef4: 3c018019 lui r1,0x8019
00182ef8: ac22f518 sw r2,-0x0ae8(r1)
00182efc: 2402ffff addiu r2,r0,0xffff
00182f00: 10620047 beq r3,r2,0x00183020
00182f04: 00000000 nop
00182f08: 000320c0 sll r4,r3,0x03
00182f0c: 00832023 subu r4,r4,r3
00182f10: 00042180 sll r4,r4,0x06
00182f14: 0c06361a jal 0x0018d868      transparent removal routine
00182f18: 00962021 addu r4,r4,r22
00182f1c: 10400040 beq r2,r0,0x00183020
00182f20: 00000000 nop
00182f24: 3c028019 lui r2,0x8019
00182f28: 8c42f520 lw r2,-0x0ae0(r2)
00182f2c: 08060c11 j 0x00183044
00182f30: 34420300 ori r2,r2,0x0300
00182f34: 3c028019 lui r2,0x8019
00182f38: 9042389d lbu r2,0x389d(r2)
00182f3c: 00000000 nop
00182f40: 10400033 beq r2,r0,0x00183010
00182f44: 3405005d ori r5,r0,0x005d
00182f48: 00009021 addu r18,r0,r0
00182f4c: 3c048019 lui r4,0x8019
00182f50: 2484f8b0 addiu r4,r4,0xf8b0
00182f54: 02c01821 addu r3,r22,r0

00182f58: a0800000 sb r0,0x0000(r4)
00182f5c: 90620003 lbu r2,0x0003(r3)
00182f60: 00000000 nop
00182f64: 14450006 bne r2,r5,0x00182f80
00182f68: 26520001 addiu r18,r18,0x0001
00182f6c: 90620001 lbu r2,0x0001(r3)
00182f70: 00000000 nop
00182f74: 10570002 beq r2,r23,0x00182f80
00182f78: 00000000 nop
00182f7c: a09e0000 sb r30,0x0000(r4)
00182f80: 24840001 addiu r4,r4,0x0001
00182f84: 2a420015 slti r2,r18,0x0015
00182f88: 1440fff3 bne r2,r0,0x00182f58
00182f8c: 246301c0 addiu r3,r3,0x01c0      Cycle through each unit

00182f90: 3406000e ori r6,r0,0x000e
00182f94: 3c018019 lui r1,0x8019
00182f98: ac26f518 sw r6,-0x0ae8(r1)
00182f9c: 08060c08 j 0x00183020
00182fa0: 00000000 nop
00182fa4: 3c018019 lui r1,0x8019
00182fa8: a020389d sb r0,0x389d(r1)
00182fac: 00009021 addu r18,r0,r0
00182fb0: 3c138019 lui r19,0x8019
00182fb4: 2673f8b0 addiu r19,r19,0xf8b0
00182fb8: 02c08821 addu r17,r22,r0

00182fbc: 92620000 lbu r2,0x0000(r19)
00182fc0: 00000000 nop
00182fc4: 1040000d beq r2,r0,0x00182ffc
00182fc8: 00000000 nop
00182fcc: 92220001 lbu r2,0x0001(r17)
00182fd0: 00000000 nop
00182fd4: 10570009 beq r2,r23,0x00182ffc
00182fd8: 00000000 nop
00182fdc: a2600000 sb r0,0x0000(r19)
00182fe0: 0c063c0e jal 0x0018f038
00182fe4: 02202021 addu r4,r17,r0
00182fe8: 00408021 addu r16,r2,r0
00182fec: 121eff20 beq r16,r30,0x00182c70
00182ff0: 2402ffff addiu r2,r0,0xffff
00182ff4: 12020013 beq r16,r2,0x00183044
00182ff8: 36420500 ori r2,r18,0x0500
00182ffc: 26730001 addiu r19,r19,0x0001
00183000: 26520001 addiu r18,r18,0x0001
00183004: 2a420015 slti r2,r18,0x0015
00183008: 1440ffec bne r2,r0,0x00182fbc
0018300c: 263101c0 addiu r17,r17,0x01c0      Cycle through each unit

00183010: 3c028019 lui r2,0x8019
00183014: 8c42f51c lw r2,-0x0ae4(r2)
00183018: 3c018019 lui r1,0x8019
0018301c: ac22f518 sw r2,-0x0ae8(r1)
00183020: 8fa60010 lw r6,0x0010(r29)
00183024: 00000000 nop
00183028: 24c60001 addiu r6,r6,0x0001
0018302c: 28c204b1 slti r2,r6,0x04b1
00183030: 10400003 beq r2,r0,0x00183040
00183034: afa60010 sw r6,0x0010(r29)
00183038: 12a0fe53 beq r21,r0,0x00182988
0018303c: 00000000 nop
00183040: 3402ff00 ori r2,r0,0xff00
00183044: 8fbf003c lw r31,0x003c(r29)
00183048: 8fbe0038 lw r30,0x0038(r29)
0018304c: 8fb70034 lw r23,0x0034(r29)
00183050: 8fb60030 lw r22,0x0030(r29)
00183054: 8fb5002c lw r21,0x002c(r29)
00183058: 8fb40028 lw r20,0x0028(r29)
0018305c: 8fb30024 lw r19,0x0024(r29)
00183060: 8fb20020 lw r18,0x0020(r29)
00183064: 8fb1001c lw r17,0x001c(r29)
00183068: 8fb00018 lw r16,0x0018(r29)
0018306c: 27bd0040 addiu r29,r29,0x0040
00183070: 03e00008 jr r31
00183074: 00000000 nop


This one handles undead revival, death sentence, reraise, crystal/treasure infliction, and a couple other things


Undead Revive, Reraise, death sentence, some brave change? some defend change?
00183078: 27bdffe0 addiu r29,r29,0xffe0
0018307c: afb00010 sw r16,0x0010(r29)
00183080: 00a08021 addu r16,r5,r0
00183084: afb10014 sw r17,0x0014(r29)
00183088: 2611018c addiu r17,r16,0x018c
0018308c: afbf0018 sw r31,0x0018(r29)
00183090: 0c062f5d jal 0x0018bd74
00183094: 02202021 addu r4,r17,r0
00183098: 0c0088c3 jal 0x0002230c
0018309c: 00000000 nop
001830a0: 00403021 addu r6,r2,r0
001830a4: 92030058 lbu r3,0x0058(r16)      load status
001830a8: 34020020 ori r2,r0,0x0020      dead check
001830ac: 30630030 andi r3,r3,0x0030      dead + undead check
001830b0: 14620013 bne r3,r2,0x00183100
001830b4: 00000000 nop
001830b8: 9202005a lbu r2,0x005a(r16)      load status
001830bc: 00000000 nop
001830c0: 30420020 andi r2,r2,0x0020      reraise check
001830c4: 1040000e beq r2,r0,0x00183100
001830c8: 3c03cccc lui r3,0xcccc
001830cc: 9602002a lhu r2,0x002a(r16)      load max hp
001830d0: 3463cccd ori r3,r3,0xcccd
001830d4: 00430019 multu r2,r3
001830d8: 34020002 ori r2,r0,0x0002
001830dc: 34030020 ori r3,r0,0x0020
001830e0: a20301ac sb r3,0x01ac(r16)      store remove dead
001830e4: a20301ae sb r3,0x01ae(r16)      store remove reraise
001830e8: 34030048 ori r3,r0,0x0048
001830ec: a20301b1 sb r3,0x01b1(r16)      store attack type HP recovery + status change
001830f0: 00001810 mfhi r3
001830f4: 000318c2 srl r3,r3,0x03
001830f8: 08060cad j 0x001832b4
001830fc: a6030192 sh r3,0x0192(r16)      store hp recovery
00183100: 92050058 lbu r5,0x0058(r16)      load status
00183104: 00000000 nop
00183108: 30a20020 andi r2,r5,0x0020      dead check?
0018310c: 1040003d beq r2,r0,0x00183204
00183110: 00000000 nop
00183114: 3c028019 lui r2,0x8019
00183118: 8c42f5fc lw r2,-0x0a04(r2)      load ?
0018311c: 00000000 nop
00183120: 14400038 bne r2,r0,0x00183204
00183124: 00000000 nop
00183128: 92020005 lbu r2,0x0005(r16)      load ENTD flags
0018312c: 00000000 nop
00183130: 30420004 andi r2,r2,0x0004
00183134: 1440005f bne r2,r0,0x001832b4      immortal check
00183138: 00001021 addu r2,r0,r0
0018313c: 92020006 lbu r2,0x0006(r16)      load gender
00183140: 00000000 nop
00183144: 30420009 andi r2,r2,0x0009
00183148: 1440005a bne r2,r0,0x001832b4      load/save formation check
0018314c: 00001021 addu r2,r0,r0
00183150: 92040007 lbu r4,0x0007(r16)      load death counter
00183154: 340200ff ori r2,r0,0x00ff
00183158: 2484ffff addiu r4,r4,0xffff
0018315c: 308300ff andi r3,r4,0x00ff
00183160: 10620003 beq r3,r2,0x00183170      something with death counter?
00183164: 00001021 addu r2,r0,r0
00183168: 08060cad j 0x001832b4
0018316c: a2040007 sb r4,0x0007(r16)      store death counter
00183170: 30a20010 andi r2,r5,0x0010
00183174: 10400012 beq r2,r0,0x001831c0      undead check?
00183178: 30c20001 andi r2,r6,0x0001
0018317c: 10400010 beq r2,r0,0x001831c0
00183180: 34020020 ori r2,r0,0x0020
00183184: 0c0088c3 jal 0x0002230c
00183188: a2220020 sb r2,0x0020(r17)      store dead status removal
0018318c: 9603002a lhu r3,0x002a(r16)      load max hp
00183190: 00000000 nop
00183194: 00430018 mult r2,r3
00183198: 00001812 mflo r3
0018319c: 04610002 bgez r3,0x001831a8
001831a0: 34020002 ori r2,r0,0x0002
001831a4: 24637fff addiu r3,r3,0x7fff
001831a8: 00031bc3 sra r3,r3,0x0f
001831ac: 24630001 addiu r3,r3,0x0001
001831b0: a6230006 sh r3,0x0006(r17)      store HP recovery      
001831b4: 34030048 ori r3,r0,0x0048
001831b8: 08060cad j 0x001832b4
001831bc: a2230025 sb r3,0x0025(r17)      store attack type
001831c0: 920201ba lbu r2,0x01ba(r16)      load ENTD flags
001831c4: 00000000 nop
001831c8: 30420008 andi r2,r2,0x0008      Control check
001831cc: 10400002 beq r2,r0,0x001831d8
001831d0: 34030010 ori r3,r0,0x0010
001831d4: 34030110 ori r3,r0,0x0110
001831d8: 00c31024 and r2,r6,r3
001831dc: 10400004 beq r2,r0,0x001831f0      ??
001831e0: 34020001 ori r2,r0,0x0001
001831e4: 34030040 ori r3,r0,0x0040
001831e8: 08060c7e j 0x001831f8
001831ec: a223001b sb r3,0x001b(r17)      store status infliction crystal
001831f0: 34030001 ori r3,r0,0x0001
001831f4: a223001c sb r3,0x001c(r17)      store status infliction treasure
001831f8: 34030008 ori r3,r0,0x0008
001831fc: 08060cad j 0x001832b4
00183200: a2230025 sb r3,0x0025(r17)      store status change attack type
00183204: 9202005c lbu r2,0x005c(r16)      load status 5
00183208: 00000000 nop
0018320c: 30420001 andi r2,r2,0x0001
00183210: 10400013 beq r2,r0,0x00183260      death sentence check
00183214: 00000000 nop
00183218: 9204006c lbu r4,0x006c(r16)      load death sentence CT
0018321c: 00000000 nop
00183220: 2484ffff addiu r4,r4,0xffff
00183224: 308200ff andi r2,r4,0x00ff      decrement?
00183228: 1440000c bne r2,r0,0x0018325c      branch if not death sentence killed
0018322c: 34020001 ori r2,r0,0x0001
00183230: a2220024 sb r2,0x0024(r17)      remove death sentence
00183234: 34020008 ori r2,r0,0x0008
00183238: a2220025 sb r2,0x0025(r17)      store status change
0018323c: 92020058 lbu r2,0x0058(r16)      load status
00183240: 00000000 nop
00183244: 30420010 andi r2,r2,0x0010      
00183248: 14400005 bne r2,r0,0x00183260      branch if not undead
0018324c: 34020020 ori r2,r0,0x0020
00183250: a222001b sb r2,0x001b(r17)      store add dead status
00183254: 08060cad j 0x001832b4         
00183258: 34020003 ori r2,r0,0x0003
0018325c: a204006c sb r4,0x006c(r16)      store death sentence CT
00183260: 92020058 lbu r2,0x0058(r16)      load status
00183264: 00000000 nop
00183268: 30420002 andi r2,r2,0x0002      defending flag?
0018326c: 10400004 beq r2,r0,0x00183280      branch if not defending?
00183270: 34020002 ori r2,r0,0x0002
00183274: a2220020 sb r2,0x0020(r17)      store defending status
00183278: 34020008 ori r2,r0,0x0008
0018327c: a2220025 sb r2,0x0025(r17)      store status change attack type
00183280: 92020024 lbu r2,0x0024(r16)      load status removal
00183284: 00000000 nop
00183288: 2c42000a sltiu r2,r2,0x000a
0018328c: 10400005 beq r2,r0,0x001832a4      ?
00183290: 34030081 ori r3,r0,0x0081
00183294: 92220025 lbu r2,0x0025(r17)      load attack type
00183298: a2230016 sb r3,0x0016(r17)      store brave change?
0018329c: 34420001 ori r2,r2,0x0001
001832a0: a2220025 sb r2,0x0025(r17)      store psuedo status change
001832a4: 92220025 lbu r2,0x0025(r17)      load attack type
001832a8: 00000000 nop
001832ac: 0002102b sltu r2,r0,r2      set if attack type != 0
001832b0: 00021040 sll r2,r2,0x01      attack type*2
001832b4: 8fbf0018 lw r31,0x0018(r29)
001832b8: 8fb10014 lw r17,0x0014(r29)
001832bc: 8fb00010 lw r16,0x0010(r29)
001832c0: 27bd0020 addiu r29,r29,0x0020
001832c4: 03e00008 jr r31
001832c8: 00000000 nop


sorry if i already posted this stuff, but i thought it was some important/useful ones

formerdeathcorps

0011acdc: 27bdff10 addiu r29,r29,-0x00f0
0011ace0: afb100cc sw r17,0x00cc(r29)
0011ace4: 00808821 addu r17,r4,r0
0011ace8: afb400d8 sw r20,0x00d8(r29)
0011acec: 00c0a021 addu r20,r6,r0
0011acf0: afb500dc sw r21,0x00dc(r29)
0011acf4: 0000a821 addu r21,r0,r0
0011acf8: afb000c8 sw r16,0x00c8(r29)
0011acfc: 00a08021 addu r16,r5,r0
0011ad00: afbf00e8 sw r31,0x00e8(r29)
0011ad04: afb700e4 sw r23,0x00e4(r29)
0011ad08: afb600e0 sw r22,0x00e0(r29)
0011ad0c: afb300d4 sw r19,0x00d4(r29)
0011ad10: 0c060435 jal 0x001810d4      //r2 = Address of Unit RAM
0011ad14: afb200d0 sw r18,0x00d0(r29)
0011ad18: 0040b021 addu r22,r2,r0
0011ad1c: 16c00003 bne r22,r0,0x0011ad2c
0011ad20: 320300ff andi r3,r16,0x00ff
0011ad24: 080607b0 j 0x00181ec0           //If address is zero, GOTO END
0011ad28: 00001021 addu r2,r0,r0
0011ad2c: 34020014 ori r2,r0,0x0014
0011ad30: 14620010 bne r3,r2,0x0011ad74   //If r16 isn't 0x14, store r2 = 0xFF and GOTO END
0011ad34: 340200ff ori r2,r0,0x00ff
0011ad38: 02202021 addu r4,r17,r0
0011ad3c: 34050014 ori r5,r0,0x0014
0011ad40: 27a60020 addiu r6,r29,0x0020
0011ad44: 27a20078 addiu r2,r29,0x0078
0011ad48: afa20010 sw r2,0x0010(r29)
0011ad4c: 27a20090 addiu r2,r29,0x0090
0011ad50: afa20018 sw r2,0x0018(r29)
0011ad54: 27a200a8 addiu r2,r29,0x00a8
0011ad58: 27a70060 addiu r7,r29,0x0060
0011ad5c: afa00014 sw r0,0x0014(r29)
0011ad60: 0c0605f0 jal 0x001817c0
0011ad64: afa2001c sw r2,0x001c(r29)
0011ad68: 00409021 addu r18,r2,r0
0011ad6c: 16400004 bne r18,r0,0x0011ad80
0011ad70: 340200ff ori r2,r0,0x00ff
0011ad74: a2820000 sb r2,0x0000(r20)
0011ad78: 080607b0 j 0x00181ec0
0011ad7c: 00001021 addu r2,r0,r0
0011ad80: 02b2102a slt r2,r21,r18
0011ad84: 10400018 beq r2,r0,0x0011ade8
0011ad88: 00008821 addu r17,r0,r0
0011ad8c: 3407fe82 ori r7,r0,-0x017e
0011ad90: 3c068006 lui r6,0x8006
0011ad94: 24c61020 addiu r6,r6,0x1020
0011ad98: 27a50048 addiu r5,r29,0x0048
0011ad9c: 27a40020 addiu r4,r29,0x0020
0011ada0: 94830000 lhu r3,0x0000(r4)
0011ada4: 00000000 nop
0011ada8: 00671021 addu r2,r3,r7
0011adac: 3042ffff andi r2,r2,-0x0001
0011adb0: 2c42000c sltiu r2,r2,0x000c
0011adb4: 10400008 beq r2,r0,0x0011add8
0011adb8: 24840002 addiu r4,r4,0x0002
0011adbc: 2462fe82 addiu r2,r3,-0x017e
0011adc0: 00021400 sll r2,r2,0x10
0011adc4: 00021403 sra r2,r2,0x10
0011adc8: 00461021 addu r2,r2,r6
0011adcc: 90420000 lbu r2,0x0000(r2)
0011add0: 00000000 nop
0011add4: a0a20000 sb r2,0x0000(r5)
0011add8: 26310001 addiu r17,r17,0x0001
0011addc: 0232102a slt r2,r17,r18
0011ade0: 1440ffef bne r2,r0,0x0011ada0
0011ade4: 24a50001 addiu r5,r5,0x0001
0011ade8: 00008821 addu r17,r0,r0
0011adec: 27b70048 addiu r23,r29,0x0048
0011adf0: 00009821 addu r19,r0,r0
0011adf4: 3c028006 lui r2,0x8006
0011adf8: 24422eb8 addiu r2,r2,0x2eb8
0011adfc: 02623021 addu r6,r19,r2
0011ae00: 90c20005 lbu r2,0x0005(r6)     //Load weapon type
0011ae04: 1a40000e blez r18,0x0011ae40
0011ae08: 00002021 addu r4,r0,r0
0011ae0c: 304700ff andi r7,r2,0x00ff
0011ae10: 02e01821 addu r3,r23,r0
0011ae14: 02432821 addu r5,r18,r3
0011ae18: 90620000 lbu r2,0x0000(r3)
0011ae1c: 00000000 nop
0011ae20: 14e20003 bne r7,r2,0x0011ae30  //If weapon type doesn't match that of THROW skill, GOTO NEXT
0011ae24: 00000000 nop
0011ae28: 08060790 j 0x00181e40
0011ae2c: 34040001 ori r4,r0,0x0001
0011ae30: 24630001 addiu r3,r3,0x0001
0011ae34: 0065102a slt r2,r3,r5
0011ae38: 1440fff7 bne r2,r0,0x0011ae18
0011ae3c: 00000000 nop
0011ae40: 10800019 beq r4,r0,0x0011aea8
0011ae44: 2673000c addiu r19,r19,0x000c
0011ae48: 90c20003 lbu r2,0x0003(r6)
0011ae4c: 00000000 nop
0011ae50: 30420080 andi r2,r2,0x0080        //Check for weapon
0011ae54: 10400014 beq r2,r0,0x0011aea8
0011ae58: 00000000 nop
0011ae5c: 90c20004 lbu r2,0x0004(r6)        //Weapon ID
0011ae60: 00000000 nop
0011ae64: 000210c0 sll r2,r2,0x03
0011ae68: 3c018006 lui r1,0x8006
0011ae6c: 00220821 addu r1,r1,r2
0011ae70: 90223ab9 lbu r2,0x3ab9(r1)
0011ae74: 00000000 nop
0011ae78: 30420002 andi r2,r2,0x0002
0011ae7c: 1040000a beq r2,r0,0x0011aea8     //Throwable Check
0011ae80: 02c02021 addu r4,r22,r0
0011ae84: 02208021 addu r16,r17,r0
0011ae88: 320500ff andi r5,r16,0x00ff
0011ae8c: 0c05f255 jal 0x0017c954
0011ae90: 00003021 addu r6,r0,r0
0011ae94: 14400004 bne r2,r0,0x0011aea8
0011ae98: 00000000 nop
0011ae9c: a2900000 sb r16,0x0000(r20)
0011aea0: 26940001 addiu r20,r20,0x0001
0011aea4: 26b50001 addiu r21,r21,0x0001
0011aea8: 26310001 addiu r17,r17,0x0001
0011aeac: 2a220100 slti r2,r17,0x0100
0011aeb0: 1440ffd0 bne r2,r0,0x0011adf4
0011aeb4: 340200ff ori r2,r0,0x00ff
0011aeb8: a2820000 sb r2,0x0000(r20)
0011aebc: 26a20100 addiu r2,r21,0x0100
0011aec0: 8fbf00e8 lw r31,0x00e8(r29)
0011aec4: 8fb700e4 lw r23,0x00e4(r29)
0011aec8: 8fb600e0 lw r22,0x00e0(r29)
0011aecc: 8fb500dc lw r21,0x00dc(r29)
0011aed0: 8fb400d8 lw r20,0x00d8(r29)
0011aed4: 8fb300d4 lw r19,0x00d4(r29)
0011aed8: 8fb200d0 lw r18,0x00d0(r29)
0011aedc: 8fb100cc lw r17,0x00cc(r29)
0011aee0: 8fb000c8 lw r16,0x00c8(r29)
0011aee4: 27bd00f0 addiu r29,r29,0x00f0
0011aee8: 03e00008 jr r31
0011aeec: 00000000 nop
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Choto

September 10, 2012, 10:16:02 pm #132 Last Edit: September 11, 2012, 09:32:08 am by Choto
I found this after setting a breakpoint to the beginning of effects data when cure was being cast. There is a ton of other routines before and some after this part, but this could let us crack into effects a bit.

0007b27c: 25087798 addiu r8,r8,0x7798
0007b280: 01006821 addu r13,r8,r0
0007b284: 3c08800a lui r8,0x800a
0007b288: 250877a0 addiu r8,r8,0x77a0
0007b28c: 01007021 addu r14,r8,r0
0007b290: c9800000 lwc2 gtedr00_vxy0,0x0000(r12)
0007b294: c9810004 lwc2 gtedr01_vz0,0x0004(r12)
0007b298: c9a20000 lwc2 gtedr02_vxy1,0x0000(r13)
0007b29c: c9a30004 lwc2 gtedr03_vz1,0x0004(r13)
0007b2a0: c9c40000 lwc2 gtedr04_vxy2,0x0000(r14)
0007b2a4: c9c50004 lwc2 gtedr05_vz2,0x0004(r14)
0007b2a8: 00000000 nop
0007b2ac: 00000000 nop
0007b2b0: 4a280030 rtpt
0007b2b4: 02571025 or r2,r18,r23
0007b2b8: 30420001 andi r2,r2,0x0001
0007b2bc: 10400004 beq r2,r0,0x0007b2d0
0007b2c0: 00000000 nop
0007b2c4: 90820007 lbu r2,0x0007(r4)
0007b2c8: 0801ecb7 j 0x0007b2dc
0007b2cc: 34420002 ori r2,r2,0x0002
0007b2d0: 90820007 lbu r2,0x0007(r4)
0007b2d4: 00000000 nop
0007b2d8: 304200fd andi r2,r2,0x00fd
0007b2dc: a0820007 sb r2,0x0007(r4)
0007b2e0: 96c20004 lhu r2,0x0004(r22)
0007b2e4: 32e30060 andi r3,r23,0x0060
0007b2e8: 00431025 or r2,r2,r3
0007b2ec: a4820016 sh r2,0x0016(r4)
0007b2f0: 96c20006 lhu r2,0x0006(r22)
0007b2f4: 00000000 nop
0007b2f8: a482000e sh r2,0x000e(r4)
0007b2fc: 24820008 addiu r2,r4,0x0008
0007b300: 00406021 addu r12,r2,r0
0007b304: 24820010 addiu r2,r4,0x0010
0007b308: 00406821 addu r13,r2,r0
0007b30c: 24820018 addiu r2,r4,0x0018
0007b310: 00407021 addu r14,r2,r0
0007b314: e98c0000 swc2 gtedr12_sxy0,0x0000(r12)
0007b318: e9ad0000 swc2 gtedr13_sxy1,0x0000(r13)
0007b31c: e9ce0000 swc2 gtedr14_sxy2,0x0000(r14)
0007b320: 3c08800a lui r8,0x800a
0007b324: 250877a8 addiu r8,r8,0x77a8
0007b328: 01006021 addu r12,r8,r0
0007b32c: c9800000 lwc2 gtedr00_vxy0,0x0000(r12)
0007b330: c9810004 lwc2 gtedr01_vz0,0x0004(r12)
0007b334: 00000000 nop
0007b338: 00000000 nop
0007b33c: 4a180001 rtps


I'm also posting some spreadsheets that Xif shared, which really got this kickstarted. Effects Data.txt is all the notes i have.. which isn't much. Graphics Routines are a huge bunch of seemingly-important graphic-related routines.

EDIT: updated Effect Data.txt

Glain

Interesting stuff.

If we want to try to crack into this a bit...
I found a site here that seems useful in determining what some of these commands do (lwc2, swc2). Still not entirely sure what "rtps" or "rtpt" are. The page at the link I posted shows them as commands but doesn't say what they do.
  • Modding version: Other/Unknown

Choto

Great find.. inside info ^_^

I found this that explains the commands a little bit more. just ctrl f and put in the command word

http://www.weblearn.hs-bremen.de/risse/RST/docs/MIPS/mips-isa.pdf

I'm gonna continue deciphering the routines... I think once we know a bit more about the effect architecture and we decipher some things close to the coprocessor commands they may be more easily understood

Glain

True enough.

I think rtps and rtpt have something to do with division.

They're listed here. Seems to be source code for the MAME emulator.

You do have to scroll through a bunch of code to find rtps and rtpt, and they do a bunch of math that's difficult to follow, but it looks like you could follow that code to figure out what they do...

Seems like different CPUs can have different coprocessors, and the PSX used its own unique one. So these commands are basically PSX-exclusive, not standard MIPS at all. (I couldn't find them in the document you linked... I did download it though; looks like a good resource.)
  • Modding version: Other/Unknown

Choto

I'm attaching an updated report on effect file data. I figured out that you can mess with some of the parameters of the effects... like what frame is called, how many of that frame are called, or how long that frame is called for. Although you still have to work within the architecture so it's not free reign yet. There are some patterns with the other blocks of data, but some sections are just ambiguous code blocks and sparse isolated values. I tried to structure the top as reader-friendly as possible. I think if you open cure in a hex editor you can follow the numbers in the .txt.

Here is a couple of examples of how things can change, courtesy of the awesome Celdia :D

http://www.youtube.com/watch?v=6vtfcyL-i78&feature=youtu.be

http://www.youtube.com/watch?v=CpTQvBDLEaM&feature=youtu.be


Still got a long way to go, but its the first breakthrough so far so.... \o/

Choto

OK, i'm posting effect data.txt one more time. I went through the entire E001.bin file and was able to determine what most of the sections do. There are a couple of sections that control motion. Another one of the sections is sound effect data which I have no clue how one would edit. The biggest block of data seems like a bunch of empty data that /could/ be utilized. It controls stuff like camera commands, background and foreground shading/flashing. However, I think it would be very difficult to develop a standard structure that applies for all effect files. Perhaps with more research we could lock down exactly what each bit does, but there's alot to go through.

Vanya

Sweet stuff, Choto. I've been waiting for this info to be cracked for a very long time. Can't wait to see it go further.
  • Modding version: Other/Unknown
¯\(°_0)/¯

Choto

Question: Does anybody know wtf this byte is/does???

lui r2,0x8019
lw r2,-0x0a10(r2)

It's used like everywhere in the routines that i'm decoding.. It seems to be some kind of control variable that decides what action to take later on... and it seems to be related to display. Could be totally wrong though