• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 19, 2024, 02:24:29 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - formerdeathcorps

1
FFT Arena / Arena Team Battle
November 19, 2014, 10:25:21 am
RULES:
1) Each team will have 4 players chosen at random from the eligible players.  Once a team has formed, the teammates will discuss amongst themselves their unit order.
2) Each player can submit only 1 Arena valid unit.
3) After submissions are in, each participant is then randomly paired with 3 other participants to form a team.
4) The JP cap appies.  The 2-of-a-kind limit for equips and skills does not because there is no way to enforce that without affecting the randomness of the team selection process.  (The alternative of selecting teammates first and then making units is too susceptible for collusion as stronger players can make units for more inexperienced teammates.)
5) The tournament will be in round-robin style with 4-6 rounds.
6) WE need not include this rule, but I think it would be more fun if we did.  After each round, losing teams may choose one player on their team to modify their submitted unit.  Unit substitutions can only be done once or twice per team per tournament.  (I'm not sure yet which would be better).
2
War of the Lions Hacking / Code Documentation Thread
March 10, 2014, 03:25:07 am
PLEASE STICKY.

The main code for WotL is located in BOOT.BIN.  This thread is dedicated to its documentation.

Rafa / Malak New Hardcoding (found in 0xCF8CC in BOOT.BIN)

088d3878: 3c0408a7 lui r4,0x08a7
088d387c: 248464c0 addiu r4,r4,0x64c0
088d3880: 00853021 addu r6,r4,r5           //r6 = Ability Offset
088d3884: 90c50003 lbu r5,0x0003(r6)     //r5 = Ability Flags 1
088d3888: 90d10009 lbu r17,0x0009(r6)    //r17 = Ability X
088d388c: 3c04092f lui r4,0x092f
088d3890: 90d20008 lbu r18,0x0008(r6)    //r18 = Ability Formula
088d3894: a085975c sb r5,-0x68a4(r4)     //Store r5 in ability RAM.
088d3898: 324500ff andi r5,r18,0x00ff
088d389c: 24a4ffe2 addiu r4,r5,-0x001e
088d38a0: 2c810002 sltiu r1,r4,0x0002
088d38a4: 50200027 beql r1,r0,0x088d3944    //If not Rafa / Malak formulas, check for Formula 5E (Triple Thunder / Flame)
088d38a8: 2404005e addiu r4,r0,0x005e
088d38ac: 3c04092e lui r4,0x092e
088d38b0: 8c845b9c lw r4,0x5b9c(r4)
088d38b4: 14800022 bne r4,r0,0x088d3940      //If not during combat phase, check for Formula 5E
088d38b8: 00000000 nop
088d38bc: 3c1008a8 lui r16,0x08a8
088d38c0: 00002021 addu r4,r0,r0
088d38c4: 0e288700 jal 0x08a21c00               //Stores 0 (r4) into 0x097a7514
088d38c8: 2610b1f0 addiu r16,r16,-0x4e10      //r16 = Chance of N Hits Table Offset (see below)
088d38cc: 3c0408a8 lui r4,0x08a8
088d38d0: 2484b1fc addiu r4,r4,-0x4e04
088d38d4: 0e2886c0 jal 0x08a21b00            //Input r4 = 0x08a7b1fc, r5 = 0x155e into routine, but these values (which seem to be an offset containing a special RNG seed / multiplier) are not used
088d38d8: 2405155e addiu r5,r0,0x155e

08a21b00: 27bdfff0 addiu r29,r29,-0x0010
08a21b04: afbf000c sw r31,0x000c(r29)
08a21b08: 0e288ab0 jal 0x08a22ac0                    //r2 = Word at (0x97a7114)
08a21b0c: 00000000 nop
08a21b10: 24030001 addiu r3,r0,0x0001
08a21b14: 14430010 bne r2,r3,0x08a21b58          //If r2 isn't 1, GOTO RNG Routine  (Is this a multiplayer check?)
08a21b18: 00000000 nop
08a21b1c: 3c02097a lui r2,0x097a
08a21b20: 8c457514 lw r5,0x7514(r2)               //ELSE, override r5 with value at 0x097a7514 (0)
08a21b24: 3c03097a lui r3,0x097a
08a21b28: 3c02097a lui r2,0x097a
08a21b2c: 2442744c addiu r2,r2,0x744c            //r2 = 0x97a744c
08a21b30: 00052040 sll r4,r5,0x01                   
08a21b34: 00441021 addu r2,r2,r4                   //r2 = r2 + r5 * 2 (0x097a744c)
08a21b38: 24a40001 addiu r4,r5,0x0001           //r4 = r5 + 1 (1)
08a21b3c: 84420000 lh r2,0x0000(r2)              //r2 = halfword at the address of r2 (0 in my test run)
08a21b40: 28810064 slti r1,r4,0x0064
08a21b44: 14200006 bne r1,r0,0x08a21b60      //GOTO END if r4 < 100 and store r4 as value in 0x97a7514
08a21b48: ac647514 sw r4,0x7514(r3)
08a21b4c: 3c03097a lui r3,0x097a
08a21b50: 10000003 beq r0,r0,0x08a21b60      //ELSE, GOTO END and store 0 as value in 0x97a7514
08a21b54: ac607514 sw r0,0x7514(r3)
//Pretty much, this whole thing means that if the value at 0x97a7114 is 1, let X be the value at 0x97a7514.  X is incremented if less than 100 and set to 0 otherwise.  Return the Xth entry in the halfword table of 100 entries starting at 0x97a744c.  Since this is the RNG routine, we're talking about returning a fixed set of probabilities listed on that table.
08a21b58: 0e27c030 jal 0x089f00c0              //RNG routine

The meat of the RNG routine is performed not at 89f00c0, but at 880e338.  All 89f00c0 does is reduce the output to a value between 0000-7FFF.
0880e338: 27bdfff0 addiu r29,r29,-0x0010
0880e33c: afbf0004 sw r31,0x0004(r29)
0880e340: 0e202dc0 jal 0x0880b700            //r2 = 08a71fe8 unless value at the address (r26 + 4) is non-zero, where r26 must be non-zero.
0880e344: afb00000 sw r16,0x0000(r29)
0880e348: 0e202dc0 jal 0x0880b700            //Routine run again for stupid reason, r16 = r2.
0880e34c: 00408021 addu r16,r2,r0
0880e350: 8c4800a8 lw r8,0x00a8(r2)         //r8 = Previous RNG Seed's lower 32 bits
0880e354: 3c074c95 lui r7,0x4c95
0880e358: 34e77f2d ori r7,r7,0x7f2d           //r7 = Fixed Multiplier Lower
0880e35c: 01070019 multu r8,r7
0880e360: 3c065851 lui r6,0x5851
0880e364: 34c6f42d ori r6,r6,0xf42d          //r6 = Fixed Multiplier Upper
0880e368: 8c4900ac lw r9,0x00ac(r2)        //r9 = Previous RNG Seed's upper 32 bits
0880e36c: 00002810 mfhi r5                     //r5 = Upper 32 bits of r8 * r7 (erases input)
0880e370: 00002012 mflo r4                     //r4 = Lower 32 bits of r8 * r7 (erases input)
0880e374: 00a00013 mtlo r5                     //r5 -> LO
0880e378: 00c8001c madd r6,r8                // (HI, LO) = (r5, r5) + r6 * r8, where (rX, rY) designates a 64-bit number with rX in the upper 32 bits and rY in the lower 32
0880e37c: 24820001 addiu r2,r4,0x0001
0880e380: 0044202b sltu r4,r2,r4              //r4 = 1 if carry-over
0880e384: ae0200a8 sw r2,0x00a8(r16)      //Store New RNG seed's lower 32-bits
0880e388: 00e9001c madd r7,r9               //(HI, LO) = (r5 + UPP32(r6 * r8), r5 + LOW32(r6 * r8)) + r7 * r9
0880e38c: 00003012 mflo r6
0880e390: 00861821 addu r3,r4,r6
0880e394: 0e202dc0 jal 0x0880b700           //More retarded calls (see above for why).
0880e398: ae0300ac sw r3,0x00ac(r16)      //Store New RNG seed's upper 32-bits.
0880e39c: 8c4300ac lw r3,0x00ac(r2)
0880e3a0: 8fbf0004 lw r31,0x0004(r29)
0880e3a4: 8fb00000 lw r16,0x0000(r29)
0880e3a8: 00601021 addu r2,r3,r0             //r2 = RNG Upper 32-bits.
0880e3ac: 7c02ffc4 ins r2,r0,0x1f,0x01       //Erases the sign of r2.  Equivalent to sll r2, r2, 0x01, srl r2, r2, 0x01
0880e3b0: 03e00008 jr r31
0880e3b4: 27bd0010 addiu r29,r29,0x0010

08a21b5c: 00000000 nop
08a21b60: 8fbf000c lw r31,0x000c(r29)
08a21b64: 03e00008 jr r31
08a21b68: 27bd0010 addiu r29,r29,0x0010

088d38dc: 00021880 sll r3,r2,0x02
088d38e0: 00622021 addu r4,r3,r2
088d38e4: 00041880 sll r3,r4,0x02
088d38e8: 00831821 addu r3,r4,r3
088d38ec: 00031880 sll r3,r3,0x02                     //r3 = RN{0...7FFF} * 100
088d38f0: 04610003 bgez r3,0x088d3900            //This is guaranteed, GOTO 0x88d3900 and r5 = RN{0...99}
088d38f4: 00032bc3 sra r5,r3,0x0f
088d38f8: 24637fff addiu r3,r3,0x7fff                 //Ensures positivity, but this isn't necessary.
088d38fc: 00032bc3 sra r5,r3,0x0f
088d3900: 3c0308a8 lui r3,0x08a8
088d3904: 9064b1f0 lbu r4,-0x4e10(r3)              //Starting at 0x08a7b1f0 (or BOOT.BIN 0x277244) is a table listing the probability of for getting N hits on Rafa / Malak formulas.  There are 10 entries; thus, the maximum # of hits is hard-coded as 10.
Hit 1    5%
Hit 2    5%
Hit 3    10%
HIt 4   10%
Hit 5    20%
HIt 6    20%
HIt 7    10%
Hit 8    10%
Hit 9     5%
Hit 10    5%
088d3908: 0085082a slt r1,r4,r5
088d390c: 10200009 beq r1,r0,0x088d3934          //GOTO 0x88d3934 if failed on the first attempt
088d3910: 24110001 addiu r17,r0,0x0001             //r17 = 1
088d3914: 00a42823 subu r5,r5,r4                     //ELSE (on success), reduce RN by the probability of the previous table entry
088d3918: 26100001 addiu r16,r16,0x0001           //Increment one slot on the failure table
088d391c: 26230001 addiu r3,r17,0x0001
088d3920: 92040000 lbu r4,0x0000(r16)
088d3924: 307100ff andi r17,r3,0x00ff               //r17++
088d3928: 0085182a slt r3,r4,r5
088d392c: 5460fffa bnel r3,r0,0x088d3918         //Keep going until number of hits is determined
088d3930: 00a42823 subu r5,r5,r4
088d3934: 3c03092e lui r3,0x092e
088d3938: 10000048 beq r0,r0,0x088d3a5c       //GOTO OTHER CHECKS, store r17 as the number of hits
088d393c: a0715c4e sb r17,0x5c4e(r3)
3
Spam / Things I Learned on FFH
September 21, 2013, 01:08:20 pm
1) You leave by thanking the community.
2) DERP is the largest known unit of e-penis.
3) All the trolls are Magitek clones.
4) You can believe in Zodiac, fake difficulty, and St. Ajora, or you can believe in tolerance, having fun, and atheism, but you can't believe in both.
5) Enlightenment is when all your dreams come true.  Most people are not enlightened because all their nightmares would also come true.
6) The worst attention whores pretend they are not to feed their ego off the deception.  Hence, cheating is a form of narcissism.  So too, is bad leadership.
7) IRC is FFH's heart, the Forum is FFH's brain, but Spam is FFH's soul.  He who can rule Spam successfully is the true king of FFH.
4
The Lounge / 8-15
September 19, 2013, 03:08:29 pm
It's that time of year again to go home, see your folks, observe the nice round full moon, and eat mooncakes!  Hopefully the clouds don't block your view (as they did where I'm at).

Happy Mid-Autumn Harvest Festival!
5
Spriting / Map Editing
September 09, 2013, 10:32:12 am
I don't normally post here, but I'm not sure where this goes.

TIGER is now ACID TRIP HELL.
6
PSX FFT Hacking / FFT Slide Rule
September 04, 2013, 02:46:25 pm
The PSX is built on an integer processor.  For those of you not versed in Computer Science, this means every value stored in the game is an negative or positive whole number.  And yet, as secondadvent and I found out, the archer's arcing attacks requires the calculation of a parabola's trajectory to determine whether a target in range can actually be hit.  This requires FFT to solve the quadratic formula, leaving us both wondering how FFT calculates the square root.  After some digging by SA (http://ffhacktics.com/paste/7hJtayK4), we found that Square coded an entire functioning slide rule / logarithm table into FFT starting at SCUS location 0x1c0b8 (0x2b8b8 in RAM).  (For those of you who are math illiterate, PM me and I'll explain more.)  Furthermore, previous hex values before the given table suggests that Square also hard-coded similar tables for evaluating trig functions (necessary for map and unit movement graphics).
The usual Squarecode wastage aside, Square's table is inaccurate for large inputs.  Small numbers like sqrt(2) or sqrt(6) have errors of no more than 1 / 5000, but a 31-bit signed word I picked at random has an error of 22%, or a 1000x increase in error.

Seeing this mess, I decided to fix it.  My solution (http://ffhacktics.com/paste/QSTmeHZ3) will take a bit more runtime, but should be perfectly accurate (to the nearest integer) and cuts out the need for tables altogether.  Given 32-bit inputs, it need not iterate more than 5 times.
7
RP Forum / Forum Roleplay---Double Dilemma
August 05, 2013, 07:41:58 am
OK, I've got a game I thought up and you all are going to be the guinea pigs.

It's based off the Prisoner's Dilemma, but with teamplay.  I call it Double Dilemma.

A) Each team will have the same number of people, somewhere between 6-10.  At start, all players will know who is on their team and who is on the other team.
B) Within both teams, there is a spy and an anti-spy.
C) The spy works for the other team.  The spy's job is to kill off the members of the team he is spying on (see below) and to provide accurate information (see below).  The anti-spy's job is to poison the information received by the other team with doubt and to eliminate the spy (see below).
D) Before the face-off phase (see below), the spy may reveal EITHER who he thinks the anti-spy is OR the number of players on the other team (both of which can affect team strategy).  He may not reveal anything else.  The anti-spy reveals the same type of information to the other team, but in a way intended to confuse.
E) Each team will choose two of their members to face off the other team's chosen members 1v1.
F) Before the duel, each person may declare himself a spy of the team the person is dueling.  Of course, this need not be believed.
G) On the basis of the information given in F), each person facing off can either say to kill or spare the other person.
  I) If one person in a face-off says kill and the other says spare, the killer's wish is granted.
  II) If both people in a face-off say kill, then the other pair is killed UNLESS...
  III) If both people in a face-off say spare, they are both spared AND they get to reflect a type II) attack back to sender.  In other words, if Face-Off 1 results in kill / kill and Face-Off 2 results in spare / spare, then Face-Off 1's players die.
  IV) Obviously, Face-Off 1 and Face-Off 2's players do not know each others' decisions.
H) The rest of the team will know of the results of G) as pertaining to their team only, but not the choices made.  Without a word from the survivors (if any), the team is to vote on the fate of the survivors of the face-off.  Votes are either kill or spare and in the case of a tie, the person is spared.  People killed this way have the right to say whatever they want as a last word.
I) A team loses if they have only one loyal member left.  If both teams lose, the result is a tie.
8
The Lounge / Farewell
May 12, 2012, 06:29:53 am
I'll be gone for at least a month.  I'll probably be gone the entire summer, if not longer.
9
Bugs and Suggestions / Dead Links
April 25, 2012, 07:39:52 am
There's a good number of links on the main page that are now obsolete or dead.  If anyone notices such a link, post it and if possible, post a correction.
10
Bugs and Suggestions / Wiki Letter Search
March 27, 2012, 06:13:32 pm
I want the ability to search for all FFH Wiki articles that start with a given letter.

1) This will better allow us to find and delete spam.
2) This will allow us to better categorize Wiki threads as there are many buried articles which contain good information without links to the front page.
11
Spam / Magitek for Spam Mod
March 25, 2012, 01:50:40 pm
Dome, let's face it.  Ever since you've taken over this place, this place has been in decline.  Spam is now populated with:
1) Serious posts.
2) Insufficient trolling.
3) Posts insulting your authority.

All this reduces the volume of posts in Spam.  This reflects on your lack of creativity and skill at trolling, which is an insult to the traditions of this subforum.  Thus, we need to transfer your authority to someone more skilled at trolling, hence the title.  Either that, or we satisfy Celdia and Eternal's wish of closing this place since it is now completely worthless.
12
Recruitment / FFT Patcher 0.479 ASM Hack Collection
January 13, 2012, 05:49:17 pm
I'm collecting and editing all of FFH's ASM hacks for the upcoming official release of FFT Patcher .479.  However, the task of tracking down all of my private hacks is already wearing me out; I really don't think I'll be in a fit state to track down everyone else's hacks.

Hence, I humbly request everyone who's ever written ASM hacks for FFH except myself, Razele, Xifanie, and nates1984 to please gather all your non-table ASM hacks posted in either on the forums (regardless of whether in a help topic or in a specialized personal hacks thread) or in a FTP.  Please post the gathered ASMs in .XML form in this thread.  It would be really nice if you could also check your hacks for errors (load delay, does not do as advertised, has unintentional effects on mechanics), if only to save me the work of scrutinizing every hack.

NOTE: You do not need to be proficient at ASM.  If you simply want to help search the Hacking and Help! section for hacks authored by someone that wasn't organized previously into a personal hacks thread, I'd certainly appreciate the help as well.
13
RP Forum / MOVED: Poll: Strictly support, no Offense
January 13, 2012, 11:11:23 am
Topic moved to General.  Link

Reason: It's more about one's preferences in RP combat and less about roleplaying itself (either starting a RP or pointing to a well-done RP on another forum).  Hence, the discussion is essentially one that could involve anyone who's ever played ANY RPG, and thus, belongs in General.
14
Non-FFT Modding / LuCT Hacking (PSX)
December 29, 2011, 12:48:32 am
I am simply starting this, but I'm going to post my work.


So far:

PRG.EXE is the ASM file that contains the battle and world routines.
PRG RAM = PRG ROM + 0xF900

SLUS_005.60 is the ASM file that contains the routines only loaded when the game is turned on (up until the New GAme/Continue/Tutorial menu).  As far as I can tell, it is not loaded during the actual game.
SLUS RAM = SLUS ROM + 0x157000

UBF.BIN is the file that contains almost no ASM (I haven't looked too carefully, the LEDecoder decompiled file is 125 MB and takes minutes to open).  I suspect it contains all the storyline events, names, sprites, maps, and possibly sounds as well.  This file is 16 MB, so I doubt all of it is loaded into the RAM; instead probably only the relevant sections are loaded.

UBF2.BIN is the file that contains ASM with variable RAM to ROM translation.  I suspect it contains all the event triggers that tells the game to load only a subset of the events for the different story routes.  The file is 1.4 MB, but I suspect only parts of it are loaded into RAM.

From what I've seen so far of the RAM, it seems like nothing changes much, and most of the RAM consists of tables.  The same RAM data exists between across between the World Map, Formation Screen, and Battle.  I suspect this is to track everything that happened in the storyline (which is more complicated than FFT).  By comparison, in FFT, almost all of the RAM is reloaded between the World Map and Battle Screens (meaning FFT has more data to load when it comes to battle mechanics).


What I Need:

Gameshark Codes (This should help me figure out RAM addresses to track)
Debuggers (You must be proficient in using a PSX debugger.  Hopefully, you have played LuCT before as well.
Hexers (You must be patient.  Scan the UBF.BIN file for patterns and correspondences to game data.  Let's make an event editor by the time we're done.)


Attached Files:
Decompiled by LEDecoder (Thanks, Glain!)

Key.txt (This Post)
UBF2.txt (Decompiled version of UBF2.BIN)
SLUS.txt (Decompiled version of SLUS_005.60)
PRG.txt (Decompiled version of PRG.EXE)
UBF.BIN (Too large to decompile, most of the contents are gibberish, but I suspect TO's meat lie in here; hence why I need hexers and time to unravel this)
15
Recruitment / Recruitment Forum Rules
December 17, 2011, 09:00:32 pm
RECRUITMENT SUBFORUM

This subforum is for people who make large projects they cannot test themselves.  This includes large ASM hacks / tools, as well as your traditional game patches.  FFH right now has way too many solo projects (many of which may be impossibly large), not enough teamwork, and virtually no testing (for bugs or balance).  Even when there is teamwork, it's never durable.  This impairs our ability to comprehensively hack the game.

To stop laziness, recruiters must meet the following requirements
1) They must have, by their own work, released a WORKING BETA with at least some of the desired features.
2) After the recruitment process, they will continue to do work on the patch.  MERE ADMINISTRATION OF THE RECRUITS IS NOT WORK ON THE PATCH ITSELF.
3) They must specify an estimate of how many people they need and what each person should be doing.  In particular, testers should be told to analyze whatever the recruiter thinks could be broken/bugged (whether this be in the plot, in the balance, or in the ASM code).

Similarly, to ensure work is done steadily, fairly, and without duplication, recruits must meet the following requirements.
1) They should voluntarily agree to work for the project and do what they are best at.
2) If more than one person is working on a section, there should exist constant communication between all members working on that section.  This way, the final result is self-consistent.
3) SELF-IMPOSED DEADLINES ARE TO BE EXPECTED FROM EVERY RECRUIT'S WORK.  Essentially, a recruit will say that he expects to finish some % of the total work by a given time when he starts the task.  If unforeseen difficulties arise, it is acceptable for the work to not be entirely completed, but on the deadline, WHAT WAS COMPLETED WILL BE SUBMITTED AS WELL AS AN EXPLANATION OF WHAT IT DOES DO AND DOES NOT YET DO.  Either not submitting work or submitting minimal changes between any two deadlines WILL RESULT IN TERMINATION FROM THE PROJECT.
4) THE RECRUITER HIMSELF IS NOT EXEMPT FROM THESE RULES.  A RECRUITER WHO REFUSES TO ABIDE BY THESE GUIDELINES HIMSELF LOSES ANY AUTHORITY TO COMPEL OTHERS TO WORK.

The categories (not mutually exclusive nor exhaustive) for recruits are:
1) ASMers
2) Event Editors
3) Mechanics (i.e. people who work on/balance battle mechanics)
4) Spriters/Graphic Editors (the latter includes battle animations)
5) Writers
6) Testers
16
Bugs and Suggestions / Subforum Proposal
December 08, 2011, 09:49:45 pm
1) LEARNING SUBFORUM

This subforum, under Help!, should be for people who want someone to tutor them in whatever they wish to learn.  FFH right now has way too large a knowledge divide between people who are new and people who have been here for years.  Furthermore, not everyone learns well from written or video tutorials.  Thus, I feel some people may need active help to learn how to event edit, write ASM hacks, sprite, or whatever else.  This should be entirely voluntary (and obviously without charge) for the tutors and learners.  This way, FFH can better make use of all of her potential.

Learners should submit two things
A) What they want to learn
B) Their learning style, if they know it...this makes it easier to find the right tutor or for the tutor to teach the most effectively

Tutors obviously should only teach in what they know as well as post how they intend to teach (over PM/Skype/iRC/in real life [if you live nearby]...)  Curious onlookers are obviously welcome; detractors will be asked to leave.


2) RECRUITMENT SUBFORUM

This subforum, under Help!, should be for people who make large projects they cannot test themselves.  This includes large ASM hacks / tools, as well as your traditional game patches.  FFH right now has way too many solo projects (many of which may be impossibly large), not enough teamwork, and virtually no testing (for bugs or balance).  Even when there is teamwork, it's never durable.  This impairs our ability to comprehensively hack the game.

To stop laziness, recruiters must meet the following requirements
1) They must have, by their own work, released a WORKING BETA with at least some of the desired features.
2) After the recruitment process, they will continue to do work on the patch.  MERE ADMINISTRATION OF THE RECRUITS IS NOT WORK ON THE PATCH ITSELF.
3) They must specify an estimate of how many people they need and what each person should be doing.  In particular, testers should be told to analyze whatever the recruiter thinks could be broken/bugged (whether this be in the plot, in the balance, or in the ASM code).

Similarly, to ensure work is done steadily, fairly, and without duplication, recruits must meet the following requirements.
1) They should voluntarily agree to work for the project and do what they are best at.
2) If more than one person is working on a section, there should exist constant communication between all members working on that section.  This way, the final result is self-consistent.
3) SELF-IMPOSED DEADLINES ARE TO BE EXPECTED FROM EVERY RECRUIT'S WORK.  Essentially, a recruit will say that he expects to finish some % of the total work by a given time when he starts the task.  If unforeseen difficulties arise, it is acceptable for the work to not be entirely completed, but on the deadline, WHAT WAS COMPLETED WILL BE SUBMITTED AS WELL AS AN EXPLANATION OF WHAT IT DOES DO AND DOES NOT YET DO.  Either not submitting work or submitting minimal changes between any two deadlines WILL RESULT IN TERMINATION FROM THE PROJECT.
4) THE RECRUITER HIMSELF IS NOT EXEMPT FROM THESE RULES.  A RECRUITER WHO REFUSES TO ABIDE BY THESE GUIDELINES HIMSELF LOSES ANY AUTHORITY TO COMPEL OTHERS TO WORK.

The categories (not mutually exclusive) I can think of for recruits are:
1) ASMers
2) Event Editors
3) Mechanics (i.e. people who work on/balance battle mechanics)
4) Spriters/Graphic Editors (the latter includes battle animations)
5) Writers
6) Testers
17
The Lounge / Music as Image
December 07, 2011, 12:12:16 am
Zaen found this site and it looks pretty neat.  It effectively lets you generate your own rhythm as a picture.

Site:
http://www.sembeo.com/media/Matrix.swf

Sample picture with .MP3 file provided.
18
The Lounge / Gone for the Week
November 19, 2011, 01:22:24 am
I won't be back until the night of Thanksgiving.  I'll be in Las Vegas with my friends and it's unknown if the hotel/casino will have free Internet.

However, on my return, I may do several things.

1) Post a picture of me.
2) Release v.2 of the Formula Hack
3) Post pending requests via PM.  The 3-4 of you know who you are and what you can expect.

Anything else you all would like me to see or do?
19
PSX FFT Hacking / Formula Hack v0.57
November 14, 2011, 06:41:21 pm
I will update the version numbers as features get added.

v0.1 means only the existing formulas that allow evasion will have the evasion toggle.
v0.2 means that all existing formulas will be evadable, if you so flag it.
v0.3 will render my blind/transparent hacks entirely obsolete by rewriting how the AI understands base hit chance.  Doing it this way makes it very easy to make skills that boost/lower accuracy by X%.
v0.37 allows you to set W and C-M-EV.  It also contains Xif's global C-EV hack and my monster C-EV = A-EV hack.
v0.5 allows you to set all the necessary features for virtually any character stat (PA/MA/WP/LVL) or HP/MP% based damage / healing routine into Formula 11.  Incorporates by default a version of the Weapon Strike Fix, the Oil Fix, the Mighty Sword Fix, the HP/MP% DMG cap.
Currently Working On: v0.7 and v0.77, which synchronizes my routines (coded nearly two years apart), adds more optional features (multi-hit) and odd restrictions (katana break, item usage, etc.) from the original Square code, and codes the +Stats and pure % to inflict effect formulas.

Ev Toggle = how to set an attack as taking P/M-EV
Equip EV Explanation = how to set weapons/jobs as having P/M-EV
Instructions = how to set up X / Y / D / O bytes to take their proper values
If you don't understand the latter two, download instructions.rar.  There is a spreadsheet inside (expanded on Choto's original) that will assist with calculation.


Part I (Evasion)


BATTLE.BIN: 0x121510
E8FFBD27
1980013C
D6382294
0680013C
C0100200
21082200
F7EB2290
1000B0AF
01005030
09000012
1400BFAF
E713060C
00000000
B914060C
00000000
CA14060C
00000000
5B210608
00000000
7114060C
00000000
2E15060C
00000000
DF14060C
00000000
FD14060C
00000000
08000012
00000000
1980013C
E4382190
00000000
03002014
00000000
CE15060C
00000000
3F15060C
00000000
2221060C
00000000
1400BF8F
1000B08F
0800E003
1800BD27


BATTLE.BIN: 0x121CA4
4421060C


BATTLE.BIN: 0x121D8C
4421060C


BATTLE.BIN: 0x121DFC
4421060C


BATTLE.BIN: 0x121E80
4421060C


BATTLE.BIN: 0x121FCC
4421060C


BATTLE.BIN: 0x12208C
4421060C


BATTLE.BIN: 0x1220E4
4421060C


BATTLE.BIN: 0x1221B4
4421060C


BATTLE.BIN: 0x12220C
4421060C


BATTLE.BIN: 0x122264
4421060C


BATTLE.BIN: 0x1222B4
4421060C


BATTLE.BIN: 0x122344
4421060C


BATTLE.BIN: 0x12237C
E8FFBD27
1000BFAF
7F1D060C
00000000
1980023C
902D428C
00000000
00004290
00000000
18004010
00000000
4421060C
00000000
14004014
00000000
D810060C
00000000
10004014
00000000
1980013C
E5382190
1C000234
07002214
00000000
2517060C
00000000
7B1A060C
00000000
01250608
00000000
A716060C
00000000
BE1A060C
00000000
1000BF8F
1800BD27
0800E003
00000000
BATTLE.BIN: 0x128684
7C


BATTLE.BIN: 0x1215C0
E8FFBD27
1000BFAF
441E060C
00000000
4421060C
00000000
03004014
00000000
01250608
00000000
01250608
1800BD27
BATTLE.BIN: 0x1225CC
7021060C
BATTLE.BIN: 0x1225FC
7021060C
BATTLE.BIN: 0x12265C
7021060C
BATTLE.BIN: 0x122684
7021060C


BATTLE.BIN: 0x12243C
4421060C


BATTLE.BIN: 0x12246C
4421060C


BATTLE.BIN: 0x1226BC
4421060C


BATTLE.BIN: 0x122910
E8FFBD27
1000BFAF
4421060C
00000000
1C004014
00000000
6017060C
00000000
5912060C
00000000
6719060C
00000000
441D060C
00000000
1980043C
902D828C
942D838C
00004290
982D818C
0D004010
00000000
06006390
06002190
E0006330
E0004230
05006214
00000000
C310060C
00000000
65260608
00000000
C91F060C
00000000
1000BF8F
1800BD27
0800E003
00000000


BATTLE.BIN: 0x1229A4
E8FFBD27
1400BFAF
7F1D060C
1000B0AF
1980013C
982D308C
942D238C
06000292
91006190
20004230
05004010
10002130
03002014
00000000
C310060C
00000000
BE20060C
00000000
8C010292
00000000
13004010
00000000
4421060C
00000000
0F004014
00000000
6017060C
00000000
5912060C
00000000
6719060C
00000000
441D060C
00000000
8C010292
00000000
03004010
00000000
011B060C
00000000
1400BF8F
1000B08F
0800E003
1800BD27


BATTLE.BIN: 0x122E28
E8FFBD27
1400BFAF
4421060C
1000B0AF
11004014
1980103C
6B17060C
902D108E
5318060C
00001092
9518060C
00000000
5912060C
00000000
6719060C
00000000
441D060C
00000000
03000012
00000000
C91F060C
00000000
1400BF8F
1000B08F
0800E003
1800BD27


BATTLE.BIN: 0x122FD4
4421060C


BATTLE.BIN: 0x12302C
E8FFBD27
1000BFAF
4421060C
00000000
1A004014
00000000
8C17060C
00000000
7E21060C
00000000
6719060C
00000000
441D060C
00000000
1980013C
982D228C
E5382390
8C014190
58004290
0B002010
40000134
07006114
10004230
05004014
00000000
C310060C
00000000
2A280608
00000000
C91F060C
00000000
1000BF8F
1800BD27
0800E003
00000000
BATTLE.BIN: 0x128710
2C


BATTLE.BIN: 0x123114
E8FFBD27
1000BFAF
4421060C
00000000
13004014
00000000
A122060C
00000000
0F004014
1980013C
982D228C
942D248C
09004290
09008490
F0004230
F0008430
05006214
00000000
C310060C
00000000
5B280608
00000000
C91F060C
00000000
07280608
00000000


BATTLE.BIN: 0x12317C
E8FFBD27
1000BFAF
4421060C
00000000
18004014
00000000
8117060C
00000000
5912060C
00000000
1980013C
CE382394
D0382294
00000000
19006200
902D238C
12100000
040062A4
F9382390
8C2D248C
1B004300
12100000
01000334
000083A0
040082A4
902D228C
80000334
250043A0
250083A0
1000BF8F
1800BD27
0800E003
00000000


BATTLE.BIN: 0x123428
4421060C


BATTLE.BIN: 0x1235EC
4421060C


BATTLE.BIN: 0x1236A0
4421060C


BATTLE.BIN: 0x123700
4421060C


BATTLE.BIN: 0x123910
4421060C


BATTLE.BIN: 0x123AA0
4421060C


BATTLE.BIN: 0x123AD0
4421060C


BATTLE.BIN: 0x123B20
4421060C


BATTLE.BIN: 0x123B60
4421060C



BATTLE.BIN: 0x11E814
1980043C
D6388294
F6388390
E0FFBD27
02004010
02006330
44006010
1800BFAF
DC388790
DE388324
21280000
04000634
00006190
64000234
23084100
19002700
12380000
01006324
FFFFC624
1B00E200
12380000
002A0500
F5FFC014
2128A700
C388000C
00000000
DC388890
64000234
19006200
10100000
982D838C
2B080201
04000634
1F002014
FF000734
02460500
2B080201
01000634
1A002014
1C006790
02440500
FF000831
2B080201
11002014
02000634
02420500
FF000831
2B080201
0E002014
03000634
FF00A830
2B080201
04000634
0B002014
FF000734
4D160608
00000000
1D006790
FF000134
0200E114
00000000
46160608
1E006790
42160608
02006324
FCF5818C
902D838C
04002014
00000000
000060A0
020066A0
030067A0
902D838C
FF00A530
2A0065A0
1800BF8F
2000BD27
0800E003
00000000


BATTLE.BIN: 0x11A30C
E8FFBD27
1400BFAF
5C008290
5B008190
14004230
23004014
01000234
02002130
20002014
82018190
1000B0AF
40002230
1B004014
01000234
2804060C
21808000
BATTLE.BIN: 0x11A3AC
1000B08F
1400BF8F


Optional Features


Description: This adds Xif's Global C-EV hack and my monster C-EV = A-EV hack
BATTLE.BIN: 0x11E4FC
1980013C
982D228C
942D238C
06004490
47006590
20008430
54008014
47004490
48004694
2340A400
48006790
FF00C530
2338E500
0003C630
1A00E800
10200000
12280000
1F00C010
00020334
1D00C310
00000000
0100A524
0B00A010
01000334
0900A310
02000334
0300A310
00000000
8B150608
00000000
03008010
00000000
8B150608
00000000
00010334
0700C310
00000000
3500001D
00000000
2B000005
00000000
8B150608
00000000
2700001D
00000000
2D000005
00000000
8B150608
00000000
01000334
2328A300
0C00A104
02000334
23180300
0500A310
2A18A300
07006014
00000000
8B150608
00000000
03008010
00000000
8B150608
00000000
0700C010
00000000
1800E01C
00000000
0E00E004
00000000
8B150608
00000000
0A00E01C
00000000
1000E004
00000000
E1382390
0080023C
01004224
19006200
10200000
9A150608
E13824A0
E1382390
0040023C
01004224
19006200
10200000
E13824A0
DF3820A0
E03820A0
0800E003
00000000



Description: This adds C/W M-EV.  This does not fix the display.  Attached also is a picture describing how this works.  The .RAR file contains a .FFTPATCH file with re-normed C/W-EV numbers.
BATTLE.BIN: 0x11DF9C
1980053C
982DA48C
E8FFBD27
8E008790
1000BFAF
4000E730
0400E010
21380000
C304060C
00000000
0100472C
982DA48C
64000234
DC38A2A0
DE38A0A0
DF38A0A0
43008390
E038A0A0
03000012
0F006230
FF130608
80100200
F0006230
82100200
06008390
E138A2A0
20006330
42006014
1C008390
0680013C
0C000234
19006200
12100000
21082200
BB2E2690
BC2E2390
0800C630
0900C010
0680013C
40180300
21082300
03000016
583F2390
00000000
593F2390
0680013C
DE38A3A0
1D008390
0C000234
19006200
12100000
21082200
BB2E2690
BC2E2390
8000C630
0E00C010
0680013C
0C00E010
00000000
C0180300
21082300
BD3A2390
03000012
0F006230
2B140608
80100200
F0006230
82100200
3F140608
DF38A2A0
1E008390
0C000234
19006200
12100000
21082200
BB2E2690
BC2E2390
4000C630
0900C010
0680013C
40180300
21082300
03000016
B83E2390
00000000
B93E2390
0680013C
DF38A3A0
1980083C
01000825
0300A810
02008424
16140608
0100A524
1000BF8F
1800BD27
0800E003
00000000
BATTLE.BIN: 0x121510
E8FFBD27
1980013C
D6382294
0680013C
C0100200
21082200
F7EB2290
1000B0AF
01005030
09000012
1400BFAF
E713060C
00000000
B914060C
00000000
CA14060C
00000000
5B210608
00000000
E713060C
00000000
2E15060C
00000000
DF14060C
00000000
FD14060C
00000000
08000012
00000000
1980013C
E4382190
00000000
03002014
00000000
CE15060C
00000000
3F15060C
00000000
2221060C
00000000
1400BF8F
1000B08F
0800E003
1800BD27


Part II (XA/YA values)
Part III (Multipliers)
Part IV (Special Effects)


BATTLE.BIN: 0xEFC00
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000



BATTLE.BIN: 0xF0000
D4FFBD27
0800B0AF
0C00B1AF
1400B2AF
1800B3AF
1000BFAF
1980123C
D6385396
0680013C
C0981300
21083300
F0EB2124
06003194
04003094
00012232
05004010
982D538E
4421060C
00000000
02000010
00000000
6E21060C
1C00B4AF
79014014
942D548E
F9384292
06000534
0F004430
1B008500
12300000
10180000
0300C014
FFFFC624
03000010
21386002
21388002
1100C014
2800E524
01006130
02002010
42180300
0400A524
04006010
FFFF6324
07006010
0200A494
03000010
0000A694
03000010
2120C000
00000000
23208600
16000010
CE3844A6
10006010
FFFF6324
10006010
FFFF6324
F9FF6010
0E00A490
02394692
FCFFA390
F5FFC014
2120C000
19008300
12200000
64000334
00000000
1B008300
EEFF0010
12200000
ECFF0010
0F00A490
EAFF0010
1000A490
F0004230
82100200
22008392
09000434
1B006400
1580043C
21204400
5871828C
12180000
08004000
04006324
98711580
A0711580
A8711580
B0711580
B8711580
C0711580
C8711580
D0711580
D8711580
E8711580
F0711580
F8711580
00721580
08721580
10721580
1C721580
25000010
01000434
23000010
80000434
21000010
21206000
1F000010
31008492
1D000010
32008492
1B000010
36008492
19000010
37008492
17000010
38008492
02394592
00000000
1300A014
2120A000
11000010
30008492
36008592
0B000010
37008492
09000010
38008592
07000010
36008492
05000010
21286000
03000010
37008492
21286000
38008492
00000000
21208500
42200400
D6384596
1580033C
40280500
21186500
2000B5AF
2400B6AF
006C7594
D03844A6
CE384396
0010B632
0400C012
FA384292
CE3844A6
900163A6
D03842A6
F7384392
F3384592
04394492
0400A230
02004010
25B0C502
25186400
FF17060C
F73943A2
58006192
00200232
10002130
400A0100
24082200
25B0C102
03000332
01000234
22086200
E1002004
02002130
DF002014
C0000132
DD002010
001A0300
000A0100
25B0C302
25B0C102
03002432
1B008010
02008430
0C008010
00000000
8118060C
00000000
0001C132
14002014
00000000
C718060C
00000000
1819060C
00000000
0E000010
00000000
1518060C
00000000
9518060C
00000000
0001C132
07002014
00000000
B318060C
00000000
DB18060C
00000000
3E19060C
00000000
0010C232
04004010
D0384496
CE384396
08000010
21186400
FA384382
00000000
20208300
0200801C
CE384396
01000424
D03844A6
5912060C
CE3843A6
0010C232
05004014
00040532
5A19060C
CE384496
03000010
90016396
90016496
CE384396
0200A010
CE3844A6
541C060C
900163A6
F3384192
90016296
80002130
0F002010
0010C132
90016296
24006392
10270434
19004300
12100000
24008392
00000000
19004300
12100000
00000000
00000000
1B004400
12100000
900162A6
07002010
21184000
441D060C
00000000
8C016292
CE384396
86004010
01000234
E803622C
02004014
00000000
E7030324
B41B060C
900163A6
90016296
FF00A332
01006324
19004300
12100000
C2110200
FE1B060C
900162A6
8C016292
00000000
74004010
01000234
90016196
000FA332
0B006010
01000234
8C0182A2
19002300
B1018292
12080000
80004234
B10182A2
90018296
02090100
21104100
900182A6
0001C132
06002010
B1016492
90016296
7F008430
920162A6
02000010
80008434
3F1C060C
B10164A2
0020C132
90016296
92016396
04002010
B1016492
920162A6
900163A6
C0008438
90016296
92016396
0040C132
0D002010
0080C132
C0008530
82300500
04002010
25208600
42100200
04000010
42180300
26208500
900160A6
920160A6
940162A6
960163A6
B10164A2
4000C132
26002010
01000134
90016296
8C0181A2
28006396
94016496
2B086200
02002010
2C006596
21106000
900162A6
2B08A400
02002010
92016396
2020A000
940164A6
90018196
22104300
22104100
05004004
B1018192
920182A6
7F002130
05000010
40002134
22100200
900182A6
BF002130
80002134
96016596
B1016692
960184A6
3000C630
0400C010
940185A6
3000C638
CF002130
25082600
B10181A2
04000132
08002010
00000000
C388000C
00000000
21086002
721E060C
00E0A332
8E1D060C
00000000
FB384292
00000000
8000412C
05002010
00000000
AD1F060C
00000000
07000010
00000000
3021060C
00000000
03004014
00000000
B91D060C
00000000
2000B58F
2400B68F
0800B08F
0C00B18F
1400B28F
1000BF8F
1800B38F
1C00B48F
0800E003
2C00BD27



BATTLE.BIN: 0x1209c8
421B0300
06000434
04008314
19004300
12180000
C21B0300
01006324
05000234
1A002424
00008590
06004314
FF000634
0400A610
04000634
04304600
11000010
A50126A0
FFFF4224
03004628
F5FFC010
01008424
0E004010
00008590
F9FF4314
FF000634
0500A614
04000634
02008590
FF000634
F3FFA610
01000634
04304600
A50126A0
8F0125A0
0800E003
21100000
FE000234
A50122A0
0800E003
8F0120A0



BATTLE.BIN: 0x122124
005C0508
00000000



BATTLE.BIN: 0x12002C
1980033C
902D638C
00000000
04006294
00000000
40100200
040062A4


Limitations:
1) Drain or Recoil with AoE AND evadable or self-damage or healing creates unintuitive behavior.  In particular, I didn't check the cases where a drain HP attack is cast on self + recoil.
2) 2H and martial arts will apply as long as damage is flagged as physical.  I can make a version where 2H is never applied to physical damage OR a version where 2H only applies to weapon strike / weapon ranged attacks but NOT one where it corresponds only to WP in the formula without serious rewriting of this code's IF / JUMP statements (which is a headache as is).
3) Elemental fixes (to make heal + weak or weak + absorb more intuitive) was not coded because I wanted to get the original Square behavior down first.  More complicated fixes are on the TODO list.
4) Currently conflicts with almost every other ASM hack in terms of Kanji space.  Sorry, will fix later.
5) Hand slot break (break everything in RH, then LH) was not coded, but it's on the TODO list.
6) Does not address the +Stat formulas (that is next) or pure % to cause status formulas.  Also, % to cause damage may display totally wrong accuracies.
7) Does not support formulas taking both physical and magical multipliers, though I probably don't want to do this.
8) Breaks the Steal and EQ Break routines.  Top priority on my TODO list.

Formula:
[(XA1 +/- C) * XA2 * (D + 1) / 128]
OR
Accuracy = (XA1 + C) * (Br or Fa)%
Effect = [XA2 * (D + 1) / 128]
Built-IN ASMs:
Oil Fix
If Weapon Strike, then Ability Element = Ability Element + Weapon Element
If DMG / Heal deals X% of tar/cas|cur/max|HP/MP, then pre-elemental DMG / Heal caps at min{999 * X%, tar/cas|cur/max|HP/MP * X%}
Mighty Sword Fix
Optional Selections:
* CasBr% * TarBr%
* CasFa% * TarFa%
* Physical Multipliers
* Magical Multipliers
Proc Spell (ID Range 0x80 - 0xFF)
Proc Status Proc (ID Range 0x00-0x7F)
Break Target Gear (Random, Head, Armor, Accessory, WPN, Shield)
Healing
Drain
Undead Reverse
P or M-EV (a different implementation than above)
Recoil

Instructions:
See attachment...it should all be self-explanatory except:
1) Flags with black dots means they now have actual effects on damage (and not just for the AI)
2) E means if flagged, element = ability element + weapon element.
3) If you see two of the same letter next to 2+ different flags, that means all related flags need to be flagged for the effect to work.
4) H+ means HP healing, H- means HP damage, M+ means MP Healing, M- means MP damage, HM- means HP / MP damage where MP damage is half of HP damage, HM+ means HP / MP healing where MP healing is half of HP healing.  P means PEV and M means MEV.
5) If you don't have a weapon, XA1 defaults to Naked PA and XA2 defaults to PA * Br%.
6) If you use the first formula, XA2 takes all multipliers (like ATKUP).  If you use the second formula, XA1 does, but the sum takes compat.
7) If you flag healing, reducing multipliers like Shell or DEFUP will be ignored.
20
Archives / Enforced Generic Class Challenge
October 25, 2011, 07:14:08 am
Patch Instructions: Unzip the .rar file and patch the enclosed .ppf file to a clean vanilla ISO.  I did not do any sprite edits, so your ISO does not need to be pre-expanded with ShiShi .457.  I also attached my orgASM .XML file so you all can see what I've been up to.

This is my attempt to make a hard patch, but one that still feels like vanilla.


1) Gear that adds transparent have been removed.  Gear that adds initial haste have been converted into +SPD.  No buyable gear adds Always: Protect/Shell and nothing adds Always: Re-Raise.  You can't use Equip Change because you can exploit the game (by manipulating Initial: Status).
2) The best gear of any type in terms of HP/WP never adds anything else.
3) You can only steal shields and accessories.  Thief skillset was reworked.
4) You cannot farm the game.  This means no spillover JP, no bar props, no DD, no random battles, no treasure boxes, level/JP gain is now fixed after completing missions (so you can't spam frog + heal for JP).  Similarly, this means no Secret Hunt or Steal Gil/Persuade/Shine Lover/Gilgame Heart.  Items sell for 0 Gil.  Your units start with 40/55 stats and bad compat (with poor compatibility against future bosses).  Soldier's Office recruits now cost 5000 gil.
5) The AI is now harder to exploit.  Golem/Hamedo were removed.  DS overrides re-raise.  It also works even if you're immune to dead, and the undead cannot be DS'd.  However, you cannot DS your own units.  Transparent ends at the end of your turn, even if you don't take any actions.  Confuse status has been totally removed from the game.
6) AI units will use previously "rare" flagged items, including ones you'll likely never get.  More previously "rare" gear is now buyable, but the timing is slightly different.
7) Special classes will no longer join you, nor should you expect special class guests to give you above average items.  Nor can you invite anyone, but it is possible for monsters to join your squad.  All monsters now can use their "beastmaster" skill.
8) Obviously, glitches like JP Scroll Glitch and item duplication glitch have been deleted.  Oil also works now.
9) Calculator still exists, but most spells aren't calculable.  To stop exploitation, CT and 3 were removed, and maximum level is 49.
10) White Mage spells were slightly redone so the AI actually uses protect/shell.  To encourage player use (and to compensate for lower SPD totals), all positive status effects except Haste/Wall had their CTs doubled.  However, most negative status effects (which the players tend to use better than the AI) had their Y values reduced by 25-45%.  No spell or archer charge will cost more than 8 CTR.  Reflect no longer blocks defensive magic.
11) Accumulative tactics were deleted.  This means no more Speed Save/A Save/MA Save/Accumulate/Yell/most Songs/most Dances/Stat Breaks.  The Lucavi are stronger in that they all have Initial: Wall (24 CT) and all of them have HP Restore, except Altima II (who has Innate: Regen instead).  % HP spells, however, will deal no more than specified % * 1000.  Otherwise, except for Calculator SPD and Bard stats, you should not see any significant change in multipliers.  Bard/Dancer now have the same multipliers, with equal access to the remaining songs and dances.
12) Most weapons are either 2H or 2S, but not both.  Many are neither, while a few still require 2 hands to use.  Longbows have 6 range.  Samurai got 2H innate for parity reasons (with ninja).  This being said, the pool of player reactions was tightened significantly.
13) Blind sets maximum accuracy to 50%, including gunshots, overriding concentrate and transparent.  Abandon and defend each do something similar, but do not override the above.  Performing units lost the right to evade or react, while charging units may do both (but still can be hit for 1.5x above normal).  All projectile weapons have 25% less accuracy at night or in storms (but this is overridden by Any Weather).
14) Any consecutive series of battles no longer loads the formation menu in between battles.  This means that whatever stat changes you sustain will transfer into the next battle.  You must save Algus and Musty.  Also, you must inflict a KO status to obtain a unit's drop (so you can't just beat Zalmo and get the drops of all his subordinates).
15) It now costs more JP to gain job levels.  As a hint, it's what 1.3 did to job levels (+1 to job level prerequisites) combined with WoTL's job level requirements (so more JP is required to gain each job level).  This is mostly so the AI can use more skills.



1) A reopened Beowulf sidequest/DD (once I figure out how to make the DD once-only).  Colliery is expected to be at level 70; DD will be at level 99.



1) Reintroduce all the broken R/S/M that were removed.  I wrote ASMs to balance most of them, but I kind of like the idea of boss-only reactions.
2) More player accessible monster classes/gil/JP?  The current implementation may be too hard.



1) A fixed version of equip change so it correctly deletes the initial status of the removed item and adds the initial status of the stone gun only.  This way, I can actually give battle rewards/move-finds in the last sequence of battles.
2) AI hacking.  May introduce Golem or more reactions if I can get the AI to understand what they do properly.



1) PSP "generic" classes?  I think I may be able to hack at least one of them in, but they are all OP.  Similarly, I can add PSP exclusive items by deleting some of the redundant, lower-level items (the way I did in my story-patch), but a lot of them already overlap, if not exceed, the function of existing items.



1) The original posted version caused guns to freeze the game when fired because of a typo (which overrode the stack pointer, r29).  This has been fixed.
2) The "all monsters use their Monster Skill enabled ability hack" only works for the player.  I am working on this.  This has been fixed.
3) The ASM that lets the AI learn skills scaled to level was removed because it freezes the game.  I'm working on this.  I have fixed this; this ASM means there should be no more knights knowing throw stone late game.
4) "Little money" slowdown.  I may or may not fix this since it's overall unimportant.
5) Custom formulas weren't working because they were pointing to the wrong addresses (off by 0x1000).  I fixed this and restored the wrongly modified areas.
6) The formula for Steal Woe had multiple errors.  I fixed them all.
7) Fixed 2 routines which would not run on the real machine due to load delay errors.  Yes, even I make them.
8) Bar propositions were still possible, even though you couldn't select any characters.
9) Protect and Shell did not have parity due to an oversight.
21
RP Forum / RP Request Thread
July 07, 2011, 10:15:13 pm
There's two purposes for this thread.

1) RPers who have an idea for an RP can post ideas here to gauge interest and pick up potential members of the RP.
2) RPers looking for a RP that fits their interests can find one to join.

Do not use this thread for any other purpose.
22
RP Forum / FFT CYOA
July 03, 2011, 05:06:11 am
This RP stands for FFT Choose Your Own Adventure.

Rules:
1) We will run through the story and game of FFT over the forum.  However, at key junctures, instead of following FFT's script, we will subject the actions of Ramza (and his squad, if during battle) to public vote.  Actions may be submitted by anyone on FFH.  The most popular action will then be followed.  I am not allowed to vote except to break ties.
2) That being said, we must still stay somewhat true to the original plot.  IN short, you cannot change the game to produce anachronisms (Ramza pulls out a machine gun and kills everyone), contrary-to-fact occurrences that would ruin the basis for FFT's plot/personality of major characters (Algus not being a jerk, The Lion War not occuring, Ovelia not getting kidnapped, Wiegraf not joining the Lucavi, Delita not becoming King of Ivalice at the end of the Lion War, Ramza not vanishing from history or not fighting Ultima...), or involve of special characters not included in FFT's combat system (like Aerith) or indulge in non-canon fan memes (like Agrias being raped by a marlboro).
3) I will try my best, for logistics and simplicity reasons, to not involve tabletop style tactics during battle.  For complicated scenarios, I may occasionally post screenshots from vanilla FFT itself (with edited ENTDs and memcards) so people can see the progression of the battle.  This means your choices during combat should be more along the lines of general strategy (think of it more like FFXII where you have some control over the AI that controls the guests to attack enemies).
4) For obvious logistics and balance reasons, I will try my best to avoid the JP system altogether.  Instead, as the story progresses, I will inform you of which characters can use which jobs.  Good RPing on the part of everyone will ensure characters "learn skills" in their jobs faster.  Poor RPing or inept battle decisions will result in minimal skills learned, or even death.  All dead humans will yield "treasure boxes", essentially you are allowed to loot their dead bodies for one randomly chosen equip.  Monsters will yield nothing, though this may change with the advent of secret hunt in Chapter 2.
5) This will be played as vanilla, except the damage/CT/evasion system wouldn't be rigidly adhered to.  Essentially this means that good RPing will result in a thief or mediator being more effective than in vanilla, or a black mage being able to cast Fire4 even against enemy ninjas, while bad decisions will result in total ineptitude, even from ninjas and knights with abandon.  However, since this is vanilla, squires do not have a resurrection spell, calculators aren't Zalera worshipers, thieves can't use katanas, mimes don't have extraordinary move...
6) For storyline, balance, and length reasons, we assume Ramza and company take the fastest possible route towards the next assignment.  In short, you should not expect repeated grindfests in Mandalia Plains (at least past Chapter 1, anyways).  Similarly, this means when units enter a town, they must decide what they want to buy while there because they usually will not have a second chance to reenter that town.  However, to make sure adequate EXP is actually gained, if during the course of advancing towards a destination, the party must cross a wilderness area ("green" dot in FFT), RPers should always expect a random battle.  Obviously, there is no save feature, so please think through your actions.
7) The first battle will be the first battle of Chapter 1, rather than the tutorial introduction battle because if the plot is changed sufficiently in Chapter 1, that battle may not occur.  Ovelia will still be kidnapped, though.
8) Have fun.


First decision:

What is the main character's name?
A) Ramza
B) Pac-Manza
C) Soledad
D-Z) Your choice here

What are the names of your 6 starting generics?
A) Randomly chosen names from FFT's name bank; 3 male/3 female
B) Blinky (Male); Pinky (Female); Inky (Female); Clyde (Male); Sue (Female); Tim (Male)
C-Z) Your choice here.  Please submit a name for 3 males and 3 females
23
RP Forum / RP Forum Rules
July 01, 2011, 05:34:55 pm
This forum is for roleplays.  This includes:

1) Tabletop gaming (with or without storytelling)
 i) With storytelling includes games like D&D and its variants
 ii) Without storytelling includes games like Risk, Diplomacy...
2) Collaborative storytelling (carried by sequences of pictures or words)
 i) Freeform RP (written with words)
 ii) A "picture war" thread with a plot
3) Fixed Plot Games where players determine roles
 i) Mafia
 ii) A RP where players reenact a known (video)game according to the game's plot

Rules for making and joining RP threads:

1) The topic author (known in D&D as the DM) is the one responsible for stating the type of RP he wants to start, the mechanics (if any) he wants to employ, the types of allowed characters, and the setting/starting plot.  As the RP progresses, players may modify such designs if the topic author allows it, but the topic author is the one primarily in charge of mediating this process and resolving conflicts that occur.
2) The above does not give any player free license to break forum rules, spam, or post things clearly unrelated to the RP in posts.
3) It is usually considered bad taste to control/kill off another player's character without their consent.  Of course, the topic author has more leeway in this respect.
4) It is generally considered bad form to pick an invincible character, or one with no character flaws.
5) Please conform to whatever posting standards the topic author asks for.  If the RP is to issue commands (like in Diplomacy), please post commands in the correct format.  If the RP is to post character actions, please post with readable spelling and grammar (except for characterization purposes).  If the RP is to post pictures, please post clear pictures that do not require further written explanations to be understood.

Rules for locking RP threads:

1) If a RP is dead from disinterest, it will be locked 2 weeks after the last active post unless the topic author states a reason beforehand (such as going on vacation, being sick, taking a break from FFH...)
2) A RP thread is not a place for spam or petty out-of-character arguments.  Posts made of this character will be deleted if the topic author is unable to resolve the issue.  Repeated occurrences in one RP will cause the RP to be locked, though I will give warning before this happens.
3) If a RP is completed, it will be locked.
4) I'm willing to also accept fanfiction and fanart (as long as the latter has nothing to do with spriting) in this forum, but poorly drawn/written examples will be archived upon public vote (just like how dead RPs will be locked).
24
PSX FFT Hacking / Floating Point Multiplication
June 28, 2011, 12:36:06 am
OK, here's a way to implement floating point multiplication in FFT.  Here's a basic outline from me (SA, feel free to improve this routine's register use efficiency):

r1 = numerator
r2 = denominator
r3 = FFFFFFFF
r4 = INT PART
r5 = FRAC PART
IF r1 < r2, r3 = r3 / r2 * r1 + 1
ELSE:
  r3 = r3 / r2 + 1
  r2 = 1
DO r4 * r3
r4 = MFHI
r6 = MFLO
DO r5 * r3
r3 = MFHI
r5 = r3 + r6
If r5 < r3, then r4 = r4 + 1 (carry-over)
If r2 = 1, then:
  DO r4 * r1
 r4 = MFLO
  DO r5 * r1
 r6 = MFHI
 r5 = MFLO
 r4 = r4 + r6.

Anyone care to code this?
25
The Lounge / RP Forum Name?
June 26, 2011, 07:19:06 am
Eternal is soon to make the RP forum.  What would you all want it to be named?  Please propose names and vote on the choices given.  You may only vote for one name.  If you propose a name, you voted for it, unless you post otherwise.  Voting and nominations will end by next Friday.

1) The Goug (or Grog) Tavern
2) Roleplay Forum
3) Writer's Lounge
4) RP'n shit
5) Forum Games Section
...Your idea here
26
PSX FFT Hacking / Coding Standards Sticky
June 22, 2011, 05:40:21 am
There have been too many instances of code that only works on one emulator and not another.  I suspect the primary reason is load delay.  IN short, r3000 does not allow:

RAM (0x8000) load rX from memory
RAM (0x8004) any command involving rX

You must type:

RAM (0x8000) load rX from memory
RAM (0x8004) nop
RAM (0x8008) any command involving rX

However, I suspect certain (but not all) versions of ePSXe allows the former to occur.  Thus, it is possible to code a hack that works on ePSXe but not pSXfin or the real PSX.

To ensure compatibility, all coders should obey the latter format.  If you have code that's written in the former method, please rewrite and republish it.  If you know of someone who no longer ASMs, but has contributed hacks that look like the above, please post the corrected versions in this thread as well.
27
PSX FFT Hacking / Weapon Hacking Part I
June 15, 2011, 05:22:11 pm
OK, I just rewrote the weapon XA routine because it was a mess.

XA can be:
PA
MA
(PA+SP)*.5
(PA+MA)*.5
[PA*Br*.01]
RN{1+[PA/2], PA+[PA/2]} (yes, before you ask, I did hack that last one in to replace the old RN{1...PA} formula because nobody liked the axe/bag/flail formula)
It also leaves some extra space for people who want to hack new formulas/make older ones more complex.   For anyone interested, you can now make a quick spreadsheet that can make any weapon type use any existing formula type.  All you have to do is change the branch offsets to the start of the appropriate formula type.

The following documentation is mostly SA's, though I fixed a few bits (code is now in little-endian).  All the offsets posted are RAM so you must subtract 0x67000 to get the BATTLE.BIN offset (which is 0x11EA9C).


00185a9c: 1980023C lui r2,0x8019
00185aa0: D8384290 lbu r2,0x38d8(r2)                Load Used Weapon ID
00185aa4: E8FFBD27 addiu r29,r29,0xffe8
00185aa8: 1400BFAF sw r31,0x0014(r29)
00185aac: 1000B0AF sw r16,0x0010(r29)
00185ab0: 40180200 sll r3,r2,0x01                      ID * 2
00185ab4: 21186200 addu r3,r3,r2                      ID * 3
00185ab8: 80180300 sll r3,r3,0x02                      ID * 12
00185abc: 0680013C lui r1,0x8006
00185ac0: 21082300 addu r1,r1,r3                      80060000 + ID * 12
00185ac4: BD2E2390 lbu r3,0x2ebd(r1)                Load Used Weapon Item Type
00185ac8: 1980023C lui r2,0x8019
00185acc: 942D428C lw r2,0x2d94(r2)                 Load Attacker's Data Pointer
00185ad0: 1980013C lui r1,0x8019      
00185ad4: 36005090 lbu r16,0x0036(r2)              Load Attacker's PA
00185ad8: 37004690 lbu r6,0x0037(r2)                Load Attacker's MA
00185adc: 24004590 lbu r5,0x0024(r2)                Load Attacker's Brave
00185ae0: 38004490 lbu r4,0x0038(r2)                Load Attacker's SP
00185ae4: 32006010 beq r3,r0,0x00185bb0          Branch if bare-fisted
00185ae8: 01000234 ori r2,r0,0x0001                  r2 = 1
00185aec: 2A006210 beq r3,r2,0x00185b98         Branch if Used Weapon is a Knife
00185af0: 02000234 ori r2,r0,0x0002                   r2 = 2
00185af4: 28006210 beq r3,r2,0x00185b98          Branch if Used Weapon is a Ninjato
00185af8: 03000234 ori r2,r0,0x0003                   r2 = 3
00185afc: 29006210 beq r3,r2,0x00185ba4          Branch if Used Weapon is a Sword
00185b00: 04000234 ori r2,r0,0x0004                  r2 = 4
00185b04: 34006210 beq r3,r2,0x00185bd8         Branch if Used Weapon is a Knight Sword
00185b08: 05000234 ori r2,r0,0x0005                  r2 = 5
00185b0c: 32006210 beq r3,r2,0x00185bd8         Branch if Used Weapon is a Katana
00185b10: 06000234 ori r2,r0,0x0006                  r2 = 6
00185b14: 3B006210 beq r3,r2,0x00185c04         Branch if Used Weapon is a Axe
00185b18: 07000234 ori r2,r0,0x0007                  r2 = 7
00185b1c: 21006210 beq r3,r2,0x00185ba4         Branch if Used Weapon is a Rod
00185b20: 08000234 ori r2,r0,0x0008                  r2 = 8
00185b24: 1E006210 beq r3,r2,0x00185ba0         Branch if Used Weapon is a Staff
00185b28: 09000234 ori r2,r0,0x0009                  r2 = 9
00185b2c: 35006210 beq r3,r2,0x00185c04         Branch if Used Weapon is a Flail
00185b30: 0A000234 ori r2,r0,0x000a                  r2 = 10
00185b34: 15006210 beq r3,r2,0x00185b8c         Branch if Used Weapon is a Gun
00185b38: 0B000234 ori r2,r0,0x000b                  r2 = 11
00185b3c: 19006210 beq r3,r2,0x00185ba4         Branch if Used Weapon is a Crossbow
00185b40: 0C000234 ori r2,r0,0x000c                  r2 = 12
00185b44: 14006210 beq r3,r2,0x00185b98         Branch if Used Weapon is a Bow
00185b48: 0D000234 ori r2,r0,0x000d                  r2 = 13
00185b4c: 0D006210 beq r3,r2,0x00185b84         Branch if Used Weapon is a Instrument
00185b50: 0E000234 ori r2,r0,0x000e                  r2 = 14
00185b54: 0B006210 beq r3,r2,0x00185b84         Branch if Used Weapon is a Book
00185b58: 0F000234 ori r2,r0,0x000f                   r2 = 15
00185b5c: 11006210 beq r3,r2,0x00185ba4         Branch if Used Weapon is a Spear
00185b60: 10000234 ori r2,r0,0x0010                  r2 = 16
00185b64: 0E006210 beq r3,r2,0x00185ba0         Branch if Used Weapon is a Stick
00185b68: 11000234 ori r2,r0,0x0011                  r2 = 17
00185b6c: 25006210 beq r3,r2,0x00185c04         Branch if Used Weapon is a Bag
00185b70: 12000234 ori r2,r0,0x0012                  r2 = 18
00185b74: 03006210 beq r3,r2,0x00185b84         Branch if Used Weapon is a Veil
00185b78: 00000000 nop
00185b7c: 1F170608 j 0x00185c7c                     Jump to WP = YA
00185b80: 00000000 nop
00185b84: 1D170608 j 0x00185c74                     Jump to Halving
00185b88: 21100602 addu r2,r16,r6                    PA + MA if Veil, Book, or Instrument
00185b8c: 02392290 lbu r2,0x3902(r1)                Load WP
00185b90: 1F170608 j 0x00185c7c                     Jump to WP = YA
00185b94: CE3822A4 sh r2,0x38ce(r1)                XA = WP, if Gun
00185b98: 1D170608 j 0x00185c74                     Jump to Halving
00185b9c: 21100402 addu r2,r16,r4                    PA + SP if Knife, Ninjato, or Bow
00185ba0: 1F170608 j 0x00185c7c                      Jump to WP = YA
00185ba4: CE3826A4 sh r6,0x38ce(r1)                  XA = MA, if Staff, Stick
00185ba8: 1F170608 j 0x00185c7c                      Jump to WP = YA
00185bac: CE3830A4 sh r16,0x38ce(r1)                XA = PA, if Sword, Rod, Crossbow, Spear
00185bb0: 1800B000 mult r5,r16                         Brave * PA
00185bb4: 12180000 mflo r3                               r3 = Brave * PA
00185bb8: 8F02023C lui r2,0x028F
00185bbc: 285C4234 ori r2,r2,0x5C28
00185bc0: 19006200 multu r3,r2                         Brave * PA * 0.01
00185bc4: 10100000 mfhi r2                               r2 = Brave * PA * 0.01
00185bc8: 2D004014 bne r2,r0,0x00185c80         Branch if YA > 0
00185bcc: CE3830A4 sh r16,0x38ce(r1)               Store XA = PA            
00185bd0: 20170608 j 0x00185c80                      ELSE, Jump to end
00185bd4: 01000224 addiu r2,r0,0x0001              r2 = 1 (minimum of 1 YA)
00185bd8: 1800B000 mult r5,r16                         Brave * PA
00185bdc: 12180000 mflo r3                               r3 = Brave * PA
00185be0: 8F02023C lui r2,0x028F
00185be4: 285C4234 ori r2,r2,0x5C28
00185be8: 19006200 multu r3,r2                         Brave * PA * 0.01
00185bec: 10100000 mfhi r2                                r2 = Brave * PA * 0.01      
00185bf0: 02004014 bne r2,r0,0x00185bfc          Branch if YA > 0
00185bf4: 00000000 nop      
00185bf8: 01000224 addiu r2,r0,0x0001              ELSE, r2 = 1 (minimum of 1 YA)
00185bfc: 1F170608 j 0x00185c7c                      Jump to set WP
00185c00: CE3822A4 sh r2,0x38ce(r1)                 Store r2 as XA
00185c04: A83B060C jal 0x0018eea0                    Random Process
00185c08: 00000000 nop
00185c0c: 18000202 mult r16,r2                         PA * 0->7fff
00185c10: 12100000 mflo r2                               r2 = PA * Random
00185c14: 02004104 bgez r2,0x00185c2c            Branch if PA * Random >= 0
00185c18: 1980013C lui r1,0x8019
00185c1c: FF7F4224 addiu r2,r2,0x7fff                  Make result positive
00185c20: C3130200 sra r2,r2,0x0f                      PA * 0->7fff / 8000h (0->PA - 1)
00185c24: 01004224 addiu r2,r2,0x0001               r2 = (1->PA)
00185c28: 42181000 srl r3,r16,0x01                     r3 = [PA / 2]
00185c2c: 21104300 addu r2,r2,r3                       r2 = {1 + [PA / 2]->PA + [PA / 2]}
00185c30: 1F170608 j 0x00185c7c                      Jump to WP = YA
00185c34: CE3822A4 sh r2,0x38ce(r1)                 Store r2 as XA

0x185c38-0x185c73 can be used for new formulas.

00185c74: 43100200 sra r2,r2,0x01                    PA + ?? / 2 (MA or SP, depending on Weapon)
00185c78: CE3822A4 sh r2,0x38ce(r1)                Store XA = PA + ?? / 2
00185c7c: 02392290 lbu r2,0x3902(r1)                Load WP
00185c80: 1400BF8F lw r31,0x0014(r29)
00185c84: D03822A4 sh r2,0x38d0(r1)                YA = WP
00185c88: 1000B08F lw r16,0x0010(r29)
00185c8c: 0800E003 jr r31
00185c90: 1800BD27 addiu r29,r29,0x0018


28
Hacking/Patching Tools / FFT Patcher (.497)
May 14, 2011, 03:57:55 am

Latest release (.497) here. (Direct download)




Original post from fdc:

I know everyone's been waiting forever for this, so here it is.

This is the original from Melonhead for .478, errors and all.

NEWEST VERSION HERE:
http://ffhacktics.com/smf/index.php?topic=7163.msg212754#msg212754

-Elric
29
War of the Lions Hacking / Recompilation
February 28, 2011, 03:51:15 pm
Here's an idea Wasabi got me started on.  I'm just posting here to see how many people would be interested in helping (testing, decompiling/interpretation, ASM hack writing) because it's a massive idea.  Personally, I have my formula/AI hacks to finish first, but I'd still like to gauge the general level of interest and support in this idea.

1) Compare all the primary differences between WoTL's and FFT's code (on the major battle files like WORLD.BIN/SCUS/BATTLE.BIN)  Since most of WoTL's files are smaller than FFT's, the goal is to port WoTL's features into FFT, while simultaneously expanding the free space of each of the three aforementioned files by 2-20 KB in FFT.
2) Figure out how to insert ASM hacks into WoTL (at last) by correctly identifying the Kanji section in BATTLE/WORLD.BIN.
3) Delete the slowdown on PSP by reinserting the recompiled FFT code into the PSP.
4) Delete stupid hard-code features FFT didn't have (Malak/Rafa formulas having a hard-coded max hit of 10, for example).
5) Add in PSP features (not the movies, but the sound novels, extra battles/maps [just find a way to read the PSP's larger TEST.EVT and map folder], minigames [I'm not sure on this one])
6) Bonus feature: Replace Tutorial mode with Debug mode, allowing PvP and PvAI in one game.
7) Bonus feature: Make all maps in both versions selectable (without bugs) in Debug mode, at least.
30
Tutorials and Learning / ASM Tutorial 2
February 13, 2011, 05:48:41 pm
The following is a work in progress.

This assumes you've already mastered Xif's Tutorial.  If you do not know what logical operators (AND, OR, XOR, SHIFT LEFT/RIGHT) or signed numbers are, please read that tutorial first.

Section I: Commands and Opcodes

A command is something the computer uses to manipulate the values stored in registers (essentially variables that can take any value from 0x00000000-0xFFFFFFFF).  The values stored in registers on the computer chip (electric signals) are the data used in any game.  There are 29 registers that can be freely used (register X will henceforth be abbreviated as rX) because r0 is always 0, r31 stores special offsets (see later), and r29 stores the stack pointer's offset (see later).
However, for a computer to understand commands, it must be written in hex.  Each assembly language (MIPS, ARM...) has its own notation.  All commands in MIPS are 4 bytes or 32 bits (1 byte = 8 bits = 0x00-0xFF in hex).

An opcode is the 6-bit part of a command that determines the nature of the command.  Opcodes are always read first by the machine, but MIPS is little endian.  This means the chips using MIPS will read each 4 byte sequence, also known as a word, from the last byte to the first.  Hence, opcodes are always put last in the 4 byte sequence.

For example, given the RAM line
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
the chip will read this as:
Word 1 = 03 02 01 00
Word 2 = 07 06 05 04
Word 3 = 0B 0A 09 08
Word 4 = 0F 0E 0D 0C
where the hypothetical opcode is in purple.

There are three types of commands in MIPS.
1) J-commands
2) I-commands
3) R-commands

J or Jump commands allow the game to read another section of the code.  All jump commands use load delay, which means the command immediately after the jump command is always executed right after the jump command (before the command at the address to be jumped to).  For all J commands, the 6 bit opcode is read first, then the 26 bit address.  In jump commands, the value of the 26 bits is multiplied by 4 to determine the RAM offset to be jumped to.  J commands include:
j JUMP (jump to specified address)  The opcode is 000010 (binary) or 08.
jal JUMP AND LINK (jump to specified address, but store address of jal command + 8 bytes into r31)  The opcode is 000011 (binary) or 0C.

Example:
01 02 03 08 is j 0x30201 * 4 = j 0xC0804
01 02 03 09 is j 0x1030201 * 4 = j 0x40C0804

I or Immediate commands allow the game to modify a register by a value specified by a 16 bit number.  The immediate values are always signed except on logical commands.  Like the jump commands, all the branch commands use load delay.  Furthermore, all load commands encounter pipeline hazards; they require you to not use the given register that now holds the loaded value in the next command.  For all I commands, the 6 bit opcode is read first, then the 10 bits specifying the first and second registers (5 each), and then the 16 bits specifying the immediate or value added.  I commands include:
addi ADD IMMEDIATE (first register = second register as signed + immediate)  The opcode is 001000 (binary) or 20.
addiu ADD IMMEDIATE UNSIGNED (first register = second register as unsigned + immediate)  The opcode is 001001 (binary) or 24.
andi AND IMMEDIATE (first register = second register AND immediate)  The opcode is 001100 (binary) or 30.
beq BRANCH IF EQUAL (branch to current location + immediate * 4 + 4 if first and second registers are equal)  The opcode is 000100 (binary) or 10.
bne BRANCH IF NOT EQUAL (branch to current location + immediate * 4 + 4 if first and second registers aren't equal)  The opcode is 000101 (binary) or 14.
lb LOAD BYTE (load to first register the value of the signed byte at second register + immediate)  The opcode is 100000 (binary) or 80.
lbu LOAD BYTE UNSIGNED (load to first register the value of the unsigned byte at second register + immediate)  The opcode is 100100 (binary) or 90.
lh LOAD HALFWORD (load to first register the value of the signed 2 bytes at second register + immediate normed to be a multiple of 2)  The opcode is 100001 (binary) or 84.
lhu LOAD HALFWORD UNSIGNED (load to first register the value of the unsigned 2 bytes at second register + immediate normed to be a multiple of 2)  The opcode is 100101 (binary) or 94.
lw LOAD WORD (load to first register the value of the 4 bytes at second register + immediate normed to be a multiple of 4)  The opcode is 100011 (binary) or 8C
lui LOAD UPPER IMMEDIATE (first register = 0xIMMD0000, where IMMD is the 2 bytes of the immediate value)  The opcode is 001111 (binary) or 3C.
ori OR IMMEDIATE (first register = second register OR immediate)  The opcode is 001101 (binary) or 34.
xori XOR IMMEDIATE (first register = second register XOR immediate)  The opcode is 001110 (binary) or 38.
sb STORE BYTE (store the value of the first register to the second register + immediate)  The opcode is 101000 (binary) or A0.
sh STORE HALFWORD (store the value of the first register to the second register + immediate normed to be a multiple of 2)  The opcode is 101001 (binary) or A4.   
sw STORE WORD (store the value of the first register to the second register + immediate normed to be a multiple of 4)  The opcode is 101011 (binary) or AC.
slti SET ON LESS THAN IMMEDIATE (first register = 1 if second register as signed < immediate, ELSE, first register = 0)  The opcode is 001010 (binary) or 28.
sltiu SET ON LESS THAN IMMEDIATE UNSIGNED (first register = 1 if second register as unsigned < immediate, ELSE, first register = 0)  The opcode is 001011 (binary) or 2C.

The first register is determined by: Third Byte % 0x20
The second register is determined by: (Last/Opcode Byte % 0x4) * 8 + [Third Byte / 0x20]
Note, in the above, [...] means the rounded down and % means remainder upon division.  All bytes are given in the order as written in the game ROM (and not in the reversed order the machine reads code in).

Example:
01 02 03 24 is addiu r3, r0 0x0201 (Note, this is how MIPS assigns values to registers; you add 0 to some immediate value and store it into a given register.)
01 02 60 24 is addiu r0, r3 0x0201 (Note, this will not be executed, because r0 is hard-coded as 0.)
01 02 7C 27 is addiu r28, r27 0x0201
01 00 03 10 is beq r3, r0 command address + 0x8
FF FF 63 10 is beq r3, r3 command address (This is an infinite loop since r3 always equals itself.  Useful for freezing the game while debugging.  Similarly, you can check if rX equals some number Z if you set rY equal to Z and then run this check.)

R or Register commands allow the game to modify registers by the values stored in other registers.  The command determines whether or not variables are treated as signed.  All the move (mfhi/lo) commands, like their load counterparts, encounter the same pipeline hazards (so you can't move a value to a register and then use that register next command) with the added requirement that no multiplication or division command can be executed within 2 commands of mfhi/lo.  For all R commands, the opcode is 0, and the order of reading by the machine is the 15 bits for the three registers, a 5-bit shift amount used on srl/sll/sra, and a 6-bit function operation (which allows the machine to differentiate between R commands).  R commands include:
add ADD (first register = second + third register both as signed)  The function is 100000 (binary) or 20.
addu ADD UNSIGNED (first register = second + third register both as unsigned)  The function is 100001 (binary) or 21.
and AND (first register = second register AND third register)  The function is 100100 (binary) or 24.
div DIVIDE (divide first register by the third register both as signed and store the quotient into LO and the remainder into HI.)  The function is 011010 (binary) or 1A.
divu DIVIDE UNSIGNED (divide first register by the third register both as unsigned and store the quotient into LO and the remainder into HI.)  The function is 011011 (binary) or 1B.
jr JUMP REGISTER (jump to address at third register)  The opcode is 001000 (binary) or 08.
mfhi MOVE FROM HI (first Register = HI value)  The function is 010000 (binary) or 10.
mflo MOVE FROM LO (first Register = LO value)  The function is 010010 (binary) or 12.
mult MULTIPLY (multiply first register by the third register both as signed and store the top 32 bits in HI and the bottom 32 bits in LO.)  The function is 011000 (binary) or 18.
multu MULTIPLY UNSIGNED (multiply first register by the third register both as unsigned and store the top 32 bits in HI and the bottom 32 bits in LO.)  The function is 011001 (binary) or 19.
or OR (first register = second register OR third register)  The function is 100101 (binary) or 25.
xor XOR (first register = second register XOR third register)  The function is 100110 (binary) or 26.
sll SHIFT LEFT LOGICAL (first register = third register * 2^{shift amount}, where all registers are unsigned)  The function is 000000 (binary) or 00.
sllv SHIFT LEFT LOGICAL VARIABLE (first register = third register * 2^{second register}, where all registers are unsigned)  The function is 000100 (binary) or 04.   
sra SHIFT RIGHT ARITHMETIC (first register = third register / 2^{shift amount}, where all registers are signed)  The function is 000011 (binary) or 03.
srav SHIFT RIGHT ARITHMETIC VARIABLE (first register = third register / 2^{second register}, where all registers are signed)  The function is 000111 (binary) or 07.
srl SHIFT RIGHT LOGICAL (first register = third register / 2^{shift amount}, where all registers are unsigned)  The function is 000010 (binary) or 02.
srlv SHIFT RIGHT LOGICAL VARIABLE (first register = third register / 2^{second register}, where all registers are unsigned)  The function is 000110 (binary) or 06.
sub SUBTRACT (first register = third register - second register, all as signed)  The function is 100010 (binary) or 22.
subu SUBTRACT UNSIGNED (first register = third register - second register, all as unsigned)  The function is 100011 (binary) or 23.

The first register is determined by: [Second Byte / 0x08]
The second register is determined by: Third Byte % 0x20
The third register is determined by: (Last Byte % 0x4) * 8 + [Third Byte / 0x20]
The shift amount is determined by: [First Byte / 0x40] * 8 + Second Byte % 0x8

Example:
00 00 00 00 is sll r0, r0, 0x0 (Note, this is also known as NOP, since r0 is hard-coded as 0 and the system will simply lay idle during this command.)
08 00 E0 03 is jr r31 (Since r31 stores the return address, or 8 bytes after the address of the previous location that calls this routine, jr r31 is the ASM equivalent of a return statement.)
10 10 00 00 is mfhi r2
22 CF EF 03 is sub r25, r31, r15
82 1F E0 00 sra r3, r7, 0x17