Please login or register.

Login with username, password and session length
Advanced search  

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!

Formula request please?  (Read 808 times)
Pages: [1]
A Blood Red Fox [Posts: 83]
  • View Profile
  • share
  • [March 10, 2014, 10:09:32 AM]
Formula request please?
« on: March 10, 2014, 10:09:32 AM »
I really need to add in a formula that works the same as Accumulate or Yell do, but instead of +PA or +SP, I need it to be +MA. I don't see any other formulas that do that.

If anybody would be willing to do that for me I'd really appreciate it. I guess "18" and "19" are blank slots? Maybe it could be put in those spaces? I really don't know much of anything about ASM hacks, I apologize if I'm unknowingly talking nonsense.
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1322]
  • View Profile
  • share
  • [March 10, 2014, 12:23:33 PM]
Re: Formula request please?
« Reply #1 on: March 10, 2014, 12:23:33 PM »
I was going to wait until the full version of the formula hack was out, but if you insist...

1) The below is the formula for +PA
lui r2,0x8019      
lbu r2,0x38fa(r2)        #Load Y
lui r3,0x8019      
lw r3,0x2d90(r3)      
ori r2,r2,0x0080         #Make Negative
sb r2,0x0014(r3)         #Load as 0x80 + PA decrement (bonus)
lui r3,0x8019      
lw r3,0x2d90(r3)      
ori r2,r0,0x0001         #Load as Psuedo-Status
jr r31         
sb r2,0x0025(r3)      

2) Copy the above exactly into massHex (Glain's ASM coding tool).  You can find it here.

3) Change sb r2, 0x0014 to sb r2, 0x0015 (this changes it from +PA to +MA).

4) IN the address box, type in some address in my BATTLE.BIN Kanji space (it's OK, I hardly ever use it).  NOTE: Valid addresses must be divisible by 4 (meaning they end in 0/4/8/C).  That information is found here.  Compile into hex.

5) Open your hex editor (I prefer HxD, DO NOT use Windhex) and open your patch's copy of BATTLE.BIN (by exporting it with CD Mage, found here).  Although it shouldn't matter for this small hack, as a safety notice (to prevent overlapping ASMs), you should make sure the version of BATTLE.BIN you are about to edit does not contain any ASMs you did not personally insert with this method.  Goto (Ctrl+G) the location you chose, copy the hex values created in massHex, and overwrite (Ctrl+B) the values at the existing location.

6) Open Windows Calculator and change it to hexadecimal mode (or if you are good with math, you can do it yourself).  Add 67000 to the number you just typed in the address box.  Add 80 to the front of the number and then reverse the bytes.  This means you reverse each group of 2 hex digits as a group.  I'll give an example:

Original Offset: E7420
New Offset: E7420 + 67000 = 14E420
Add "80" to the front: 8014E420
Flip Bytes:
80 | 14 | E4 | 20
becomes
20 | E4 | 14 | 80

7) IN the same BATTLE.BIN file, GOTO (Ctrl+G) the offset 125670 (we are overriding formula 18).  Type in your final result from step 6.

8) Save BATTLE.BIN and import it into your patch with CD Mage.  Formula 18 has now become +Y MA.


I believe revealing the method is more important than giving you the answer because this is the first lesson in becoming an ASMer.
« Last Edit: March 10, 2014, 12:32:29 PM by formerdeathcorps »
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.
A Blood Red Fox [Posts: 83]
  • View Profile
  • share
  • [March 10, 2014, 01:17:21 PM]
Re: Formula request please?
« Reply #2 on: March 10, 2014, 01:17:21 PM »
Thanks :)

It's going to take me a long time to figure this out though. Hopefully with enough time I'll eventually be able to get it.
Queen of Palemoon
Celdia [Posts: 1642]
  • View Profile
  • http://steamcommunity.com/profiles/76561198029710324/
  • share
  • [March 11, 2014, 04:46:22 AM]
Re: Formula request please?
« Reply #3 on: March 11, 2014, 04:46:22 AM »
You could do all that but you'd be left wondering why it didn't work in the end, all because of a simple typo.

Or you could just put the attached file here into the same folder as FFTorgASM and use it to apply the 'Formula 18 becomes +MA_(Y)' patch and it'll actually work.

@FDC: They wanted a formula, not an Intro To ASM lesson. If they wanted to learn how to do it from the ground up on their own, I'm sure they would have asked for such. I did dump the new formula data right at the start of your Kanjispace though so if you know that that's going to conflict with any specific hacks, I'll happy modify this for a more reasonable location since I don't have any of my own.
Pages: [1]