Users browsing this thread: 1 Guest(s)
Good Lord Send Us An Esper Level Up Bonus Patch

#2
Posts: 290
Threads: 3
Thanks Received: 40
Thanks Given: 1
Joined: Apr 2012
Reputation: 9
Status
None
(01-31-2016, 02:49 AM)ReturnerScum Wrote: Why....does it increase Y, copy X to A, then maybe make it carry, then copy Y to X, which I think is then used to determine which stat is changed based on what's in X, which is then increased based on the carry?  This seems like an awfully weird way of doing it, and a perfect way from preventing me to change it to what I want.

Y is simply used as an index here. The game will jump to that series of INYs at a certain spot depending on what stat you're boosting (check the jump table at C2/614E - or more specifically, the part starting at C2/6160).

See the disassembler comments at C2/60F1 for why bit 1 of X is moved into the carry. It's simply so the game knows whether to boost the stat by 1 or 2.

Y is transferred to X after that simply for indexing purposes again. Y was set above with the series of INY instructions - it's going to be a number zero through three, used for determing which stat at $161A in the SRAM to raise.

HP/MP is actually quite a bit simpler as it's written in vanilla (using percentages). The tricky thing to understand here is how it knows to boost HP or MP - it does this by checking the jump index (C2/60F1). X will be equal to 0, 2, or 4 if it's boosting HP, so a check is run to see if X is greater than or equal to six. If it is, then MP is boosted. Otherwise, HP is.

What you want to do isn't difficult, but you will need to re-write the esper bonus function in order to fit it all in efficiently.

I suppose the key to all of this is understanding how indexed (or indirect) jumping and jump tables work.


GET A SILK BAG FROM THE GRAVEYARD DUCK TO LIVE LONGER.

Brave New World
  Find
Quote  
[-] The following 1 user says Thank You to Synchysi for this post:
  • ReturnerScum (01-31-2016)



Messages In This Thread
RE: Good Lord Send Us An Esper Level Up Bonus Patch - by Synchysi - 01-31-2016, 06:38 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite