• Welcome to Final Fantasy Hacktics. Please login or sign up.
December 05, 2021, 12:04:39 pm


Use of ePSXe before 2.0 is highly discouraged. Mednafen/RetroArch is 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 - nitwit

From 0 to 9, how would you rate these buffs and debuffs?

0: Not an issue
9: Critically serious

0: Wasted turn.
9: Always useful.

Darkness (Rate it twice: as vanilla, and if all classes had better C-Ev that worked partially on the back and sides)
Blood Suck
Oil (Assume it actually worked, and made you weak to fire no matter what)
Berserk (Rate it twice: as vanilla, and if it allowed player control but blocked the use of silence-flagged skills)
Don't Move
Don't Act
Death Sentence (rate it twice: as vanilla, and if death immunity didn't prevent it and it didn't stack with undead)


In vanilla FFT, undead absorb dark and are weak to holy. They are also damaged by most curative skills. The spell that inflicts death is hardcoded to fail against undead; instead it heals them to maximum HP. Phoenix Down and Elixir are hardcoded to automatically kill undead.

Abstracted from the "undead" mechanic, how does this work in your opinion?

I'm trying to figure out how the undead reversal mechanic would work if you applied the same principle behind it to a healing spell with a different element and a character that has some modification to that element. Basically, what is the principle behind undead reversal?

How would the game behave if there were a generalized "elemental reversal" flag and curative spells with elements other than holy?

How would a fire elemental react to a fire element healing spell? What about an ice element healing spell?

My observations are below.

1. Element reversal increases the magnitude of existing elemental relationships.
In this case: whatever your relationship to an element, if you reverse that element then:
  • Healing and absorb becomes maximal healing.
  • Healing and immune heals the normal amount or some multiplier of it.
  • Healing and halve heals the normal amount or some multiplier of it.
  • Healing and normal heals the normal amount.
  • Weakness and healing becomes instant destruction.

So if you undead - you absorb dark and are harmed by holy, then if you are hit by a holy spell it will harm you regardless of it being damaging or healing. If you are hit by a dark element skill, it will heal you if it's innately harmful and if it's helpful.

This seems to best describe the elemental effects present in FFT, and more broadly the FF franchise.

2. Element reversal flips your relationship with that element.
If you absorb holy and you are hit with a holy elemental healing spell, then you will be damaged by that spell.

In this case, curative is a property that inverts the normal elemental effects.

This isn't how the game works, and it also doesn't make sense. Why would a paladin by harmed by a holy element healing spell?

Possibly a more important question: what should #1 be called, as it's clearly not reversing anything?
Tutorials and Learning / Command Prompt FAQ
June 14, 2021, 09:16:16 pm
1. What is the command prompt?

Command prompt is a program included with all versions of Windows which allows you to execute scripts (small programs) using a purely text-based interface.
Contrast this with the graphical user interface (buttons, mouse interactions) found in most programs you've previously used.

The command prompt reacts only to text based commands, and to some degree to mouse clicks. If you want something to work, you need to type it in and hit enter.

2. How do I access the command prompt?

You can access the command prompt (another term for command line) by navigating the Windows Start menu. It's usually under System or System Tools. You could also use the Run or Search menus to look for cmd.exe, which is the name of the actual command prompt program.

Access the Run menu with the Windows Key and the r key, then type cmd.exe and hit enter to bring up the command prompt.

If you want a version of the command prompt with a few more features, then you can use Powershell instead. It's found in it's own menu in the Windows 10 Start Menu.

3. How do I use the command prompt once I have it open?

As I said above, you type things into it (commands) and hit enter to execute those things.

Two useful commands that you should know are cd (change directory), and dir (view directory contents). If you're not familiar with the term, directory means essentially the same thing as folder in the context of Windows.

Type cd followed by the name of the folder you want to navigate to, then hit enter. For example:
cd Users

If you want to view the contents of a folder, type dir followed by the name of the folder you want to inspect and then hit enter. For example:
dir Users

If you don't want to type the full name, or are unsure of what constitutes a legal folder name, then type the command, and then hit tab to cycle through all legal inputs for that command in the current working folder.

Tab will autofill stuff like the folder names, required prefixes, and the backslash that indicates the end of a folder.

You can navigate through more than one folder at a time, by separating each folder in the path you want to navigate through with a backslash. For example:
cd Users\Nitwit

dir Users\Nitwit

Usually, cd and dir operate assuming that you're navigating from the folder you are currently in, which is found just before the part of the command prompt in which your typing appears. This is the full path to the current folder, starting from the name of the hard drive where you started. For example:

This is called the absolute path. At any time and in any location, you can navigate to an absolute path by typing it in full, starting with the name of the hard drive where it is found and going sequentially from there through each folder.
cd D:\Backups\Mods\FFT\

dir E:\

The command prompt always starts in the named drive where Windows operating system is installed, in this case:

If you want to navigate up a folder, enter .. after the command. For example:
cd ..

You can navigate up multiple folders by separating each .. with a backslash. For example:
cd ..\..

You can navigate both up and down multiple folders by combining .. and folder names. For example:
cd ..\..\FFT\editors\

You can send the text output of a command (what it prints in the command prompt) to a text file with the redirection operator, which is the > character. For example:
dir C:\Users\Nitwit\Mods\FFT\gamefiles > fft_files_listing.txt

You can switch between any commands you've previously entered with the up and down arrows.

It is impossible to break anything with cd and dir, feel free to explore.

4. Why should I learn how to use the command prompt?

There are several reasons you should learn this.
  • A lot of tools lack the graphical user interface (GUI) found in things like FFTPatcher, and can only be used with either the command prompt or through a batch file: a sort of script that can be made to run a command by clicking on it, among other things. Most coders don't make batch files. Many of these tools are very useful, and few people want to make a version with a GUI.
  • Tools that can be run through the command prompt can be run through scripts in other programming languages, enhancing their usefulness and automating drudgery. For instance, CD Mage lacks the ability to import multiple files at once, so I wrote a python script that calls Cebix's psxinject program to import hundreds of modified files into a disc image.
  • Knowing how to use the command line makes it easier to learn how to do other coding and administration tasks, from file hashing to using a compiler. It's one of the first tasks that every novice programmer and hacker should learn how to do.
  • Some tools with a GUI only produce error messages when called from the command line. Without an error message, you have fewer leads as to why a tool isn't working.
  • If for some godforsaken reason you use Linux, you have no option but to use command line tools, scripts, and spreadsheets to make game editors.
  • The command line accepts wildcards (also known as regular expressions if you want a deep dive on the subject), which can be a simple and easy to way automate boring tasks.
Spriting / Spriter Workflow Poll
June 09, 2021, 03:26:16 am
1. What image editors do you use?
2. What is your workflow like?
3. How much time is spent spriting compared to housekeeping tasks like previewing sprites, copying and pasting body parts, and aligning pieces together on the spritesheet?
4. What tools and resources do you use to shorten and ease your workflow? I assume you use position template spritesheets, preview generators, collections of sprite parts you've disassembled for franken-spriting.
5. What parts of your job, if any, could be automated and how?

Also please post any template spritesheets - position or otherwise - you have so a guide on FFT-specific spriting can be made later.
I'm posting this here on the chance that someone else is working on getting all the data tables and disassembled routines on the wiki into a form which can be assembled. Right now it's just copies of most of the disassembled routines for the files straight from the wiki.  Attached is a zipped folder with text files containing the disassembled routines.

It's more tedious than difficult, but with current circumstances being what they are I have more free time than usual. If you want to have the disassembled routines in a convenient off-line form, this would be it. If you have additional information not found in these files or one the wiki, please share or update the wiki.

  • Rip the disassembled routines from the files I haven't done yet from the wiki into the appropriate text files.
  • Add the missing routines into these text files.
  • Add data tables to the text files.
  • Make a duplicate set of files named with the *.asm extension instead of the *.txt extension, for assembling.
  • Replace all the routine calls in *.asm with labels.
  • Replace operands with labels where appropriate in *.asm; will require a bit of thought or maybe pseudo-opcodes.
  • Put data tables in the *.asm files in a form which my assembler will recognize, ideally using labels so they can be resized and altered at will.
  • Put compressed text tables, uncompressed text tables where they exist, and metadata/pointers for media assets into the files or devise some way to automate their creation given a set of inputs.
  • Do whatever else I currently don't know to get the *.asm files to assemble.
  • Apply all the essential and definitive bug-fixes, optimizations, and extensions to the *.asm files.
  • Improve comments in both *.txt and *asm files.
  • Discuss, plan, and implement new optimizations and extensions.
  • Port the codebase and assets to a platform that allows more resources for improving and expanding the codebase, data, and assets, such as the PS2 or PSP. Please note that the PSP version is hardly a real port.

It wouldn't be a bad idea to upload these files to a source host that allows incremental revision such as Github. I make no claims of copyright to any of these files.

I use the assembler ARMIPS.

This thread may be useful if it isn't already incorporated in the wiki.

As of the last edit of this post I have grabbed all the wiki entries on equip.out and require.out; they are in the zip file below. I'm going with the smallest files first. They are missing quite a few disassembled routines which weren't in or disappeared from the wiki, and the comments are sparse compared to SCUS and the battle.out file.

Let me know if you have any issues with these files.
... to navigate to files and load them?
PSX FFT Hacking / RetDec, a retargetable decompiler
March 02, 2018, 05:18:54 pm
QuoteRetDec is a retargetable machine-code decompiler based on LLVM.

The decompiler is not limited to any particular target architecture, operating system, or executable file format:

* Supported file formats: ELF, PE, Mach-O, COFF, AR (archive), Intel HEX, and raw machine code.
* Supported architectures (32b only): Intel x86, ARM, MIPS, PIC32, and PowerPC.


* Static analysis of executable files with detailed information.
* Compiler and packer detection.
* Loading and instruction decoding.
* Signature-based removal of statically linked library code.
* Extraction and utilization of debugging information (DWARF, PDB).
* Reconstruction of instruction idioms.
* Detection and reconstruction of C++ class hierarchies (RTTI, vtables).
* Demangling of symbols from C++ binaries (GCC, MSVC, Borland).
* Reconstruction of functions, types, and high-level constructs.
* Integrated disassembler.
* Output in two high-level languages: C and a Python-like language.
* Generation of call graphs, control-flow graphs, and various statistics.

You can try all of these features by using our online decompilation service.

It can only handle files smaller than 10 megabytes, but I wonder what it would output from BATTLE.BIN or the SCUS?
Help! / Tools to improve hacking workflow?
July 29, 2017, 06:04:11 am
I was thinking earlier about how much effort it would take to actually rewrite a set of routines, like reactions or forumulas.  Most of the difficulty even for an expert assembly programmer isn't in the programming itself, it's in managing all the information.  Everything you need to know is spread across hundreds of pages on the wiki, so first you need to manually copy and paste all those pages into a bunch of text files and come up with a system to document them and how they all fit together.  When you're done with that you must develop a build cycle so you can compile all these things, put them in the right place, and then get them into a disc image and test them.

This is suboptimal.  It's like trying to develop using build methods and techniques from the 1950s.  It's insane that we still do this in an era of free online source hosting with automated build tools.

Please note that I intend this thread as a discussion on the nature of these problems, and potential best practices and solutions.  I will present my opinion in replies to this.  I encourage everyone - hacker or not - to do the same.  My goal is to create a system where we can do the best hacking and programming with the least effort.  Do not be afraid to comment!

1. What is the ideal build cycle for an average assembly hacker?

2. What is the ideal build cycle for someone who wants to rewrite and optimize large portions of the game mechanics?

3. What is your current build cycle?

4. What tools exist to improve our build cycles?

5. What is the gap between the tools that exist and what would be ideal?

6. What tools, techniques, and protocols would lower the entrance barrier for assembly hacking?

7. What non-coding obstacles prevent you from setting up your ideal build environment?

8. Why did previous attempts at rewrites fail?
The Lounge / FFH image assets?
July 17, 2017, 02:24:32 am
Where can I find the image assets from the previous incarnations of FFH?  Specifically the one where the area outside of posts replicated the FFT formation menu?
The Lounge / Synthwave
January 01, 2017, 09:44:51 pm
Found something great for programming and lifting.  I've never heard anything like this music.


This gets some very weird results (72000 damage) when I feed it 70 faith for both parties and 5 MA.


Should be divided by 10,000 (or 100, twice), since the (100 - caster faith) and (100 - target faith) are actually percentages.

If I change a specific knife to a sword-type in FFTPatcher would the formula it uses change as well?  Or are the formulas hardcoded to the specific item slots?

I'm pretty sure that only the equipped-in-body-slot is hardcoded (you can't turn a hat/helmet/ribbon into an armor/clothing/robe).
Help! / Wiki Attention Thread
September 22, 2016, 11:18:17 am
I'm doing a bit of work since I have free time due to insomnia.  I'm adding links to every documented subroutine call (jal 0x????????) where it is called.

I do this by going to any formula or routine, ctrl + f jal, finding the address it jumps and links to, and then ctrl + f that address on the Routine Locations wiki page:

Generally a good idea to include on every subroutine what jal's to that page, but that's less important since you can use the Special Page "What Links Here" on the left sidebar under the tools menu to find the same information.

If you see anything that needs attention in the wiki make a post.

Question for asm hackers and wiki admins - why does the Return Locations section in those subroutines that are jal'd to contain the start of that routine as the address listed, instead of the address to which it would return after that routine?

The above page jumps and links to the below page 3 times:

Data Nullifying displays the addresses to which the jal subroutine calls in Current Action Data Nulling return.  Other wiki pages instead display the first address of the routine from which they are called, and not the addresses to which they return on completion.  Which should I use?

Something else, I've found several duplicate pages, with different titles and different comments on the disassembly.  I assume that these are parameterized, but shouldn't these duplicate pages acknowledge one another?
Help! / Allowing FFTPatcher to edit unknown bytes?
September 10, 2016, 01:43:19 pm

While scrolling through this page in the wiki, I noticed that there are a few unused/unknown bytes in several data tables.

80062eb8 - Item Data Start (12 bytes each)
0x00 - Palette
0x01 - Sprite ID
0x02 - Required Level (for random generation)
0x03: Type Flags
0x80 - Weapon
0x40 - Shield
0x20 - Headgear
0x10 - Armor
0x08 - Accessory
0x04 -
0x02 - Rare
0x01 -
0x04 - Second Table ID
0x05: Item Type
01 - Knife
02 - Ninja Blade
03 - Sword
04 - Knight Sword
05 - Katana
06 - Axe
07 - Rod
08 - Staff
09 - Flail
0a - Gun
0b - Crossbow
0c - Bow
0d - Instrument
0e - Book
0f - Polearm
10 - Pole
11 - Bag
12 - Cloth
13 - Shield
14 - Helmet
15 - Hat
16 - Hair Adornment
17 - Armor
18 - Clothing
19 - Robe
1a - Shoes
1b - Armguard
1c - Ring
1d - Armlet
1e - Cloak
1f - Perfume
20 - Throwing
21 - Bomb
22 - Item
0x06 -                         //unknown/unused
0x07 - Item Attributes
0x08 - Price
0x0a - Shop Availability
0x0b -                         //unknown/unused

80063ab8 - Weapon Secondary Data
0x00 - Range
0x01 - Attack Flags
0x80 - Striking
0x40 - Lunging
0x20 - Direct
0x10 - Arc
0x08 - 2 Swords
0x04 - 2 Hands
0x02 - Throwable
0x01 - Forced 2 Hands
0x02 - Formula
0x03 -                         //unknown/unused
0x04 - Weapon Power
0x05 - Evade
0x06: Element
0x80 - Fire
0x40 - Lightning
0x20 - Ice
0x10 - Wind
0x08 - Earth
0x04 - Water
0x02 - Holy
0x01 - Dark
0x07 - Inflict Status/Cast Spell
I saw them somewhere, but I don't recall where.

I need something that will calculate stats at level 1, 99, and somewhere in between for given raw stats and class growths and multipliers.  If I can then select an ability or a formula and the x/y values for it and have the damage at various levels that would be cool too.


statBonus at any given level = [currentRawStat / (Growth + Level)]

I know there's some math function - probably related to either sequences or series - that deals with this sort of thing, but I can't remember it.  I could easily write a loop to figure this out, or even a recursive function... if only I had paid attention in discrete math 2!


Screw it, I can make a command line program to do the calculations for me.


RAM -> File
-0x67000 -> WLDCORE.bin
-0x67000 -> Battle.bin
-0xE0000 -> World.bin
-0xF800 -> SCUS

800610b8 - 0x518B8 - Job Data

0x00 - Skillset
0x01 - Innate Ability 1
0x03 - Innate Ability 2
0x05 - Innate Ability 3
0x07 - Innate Ability 4
0x09 - Equippable Items 1
0x0a - Equippable Items 2
0x0b - Equippable Items 3
0x0c - Equippable Items 4
0x0d - HP Growth
0x0e - HP Multiplier
0x0f - MP Growth
0x10 - MP Multiplier
0x11 - Speed Growth
0x12 - Speed Multiplier
0x13 - PA Growth
0x14 - PA Multiplier
0x15 - MA Growth
0x16 - MA Multiplier
0x17 - Move
0x18 - Jump
0x19 - C-EV
0x1a - Innate Statuses 1
0x1b - Innate Statuses 2
0x1c - Innate Statuses 3
0x1d - Innate Statuses 4
0x1e - Innate Statuses 5
0x1f - Status Immunity 1
0x20 - Status Immunity 2
0x21 - Status Immunity 3
0x22 - Status Immunity 4
0x23 - Status Imminity 5
0x24 - Starting Statuses 1
0x25 - Starting Statuses 2
0x26 - Starting Statuses 3
0x27 - Starting Statuses 4
0x28 - Starting Statuses 5
0x29 - Absorbed Elements
0x2a - Nullified Elements
0x2b - Halved Elements
0x2c - Elemental Weakness
0x2d - Monster Portrait
0x2e - Monster Palette
0x2f - Monster Graphic[\code]

8005fbf0 - 0x503F0 - Ability Data 2

0x00 - Range
0x01 - Effect Area
0x02 - Vertical
0x03: Flags 1
0x04: Flags 2
0x05: Flags 3
0x06: Flags 4
0x07 - Element
0x08 - Formula
0x09 - X
0x0a - Y
0x0b - Inflict Status
0x0c - CT
0x0d - MP Cost

8005e90c - 0x4F10C - Base Data (12 bytes each, 4 total)
   Order: 0 = Male, 1 = Female, 2 = Ramza, 3 = Monster

0x00 - HP (these * 16384 = Min Raw)
0x01 - MP
0x02 - SP
0x03 - PA
0x04 - MA
0x05 - Helmet
0x06 - Armor
0x07 - Accessory
0x08 - RH Weapon
0x09 - RH Shield
0x0a - LH Weapon
0x0b - LH Shield

rawStats.csv (4 entries - male, female, ramza, monster)
hp, mp, sp, pa, ma

jobs.csv (0x9a entries - squire 0x00 to 0x9a ultima demon)

0x0d - HP Growth
0x0e - HP Multiplier
0x0f - MP Growth
0x10 - MP Multiplier
0x11 - Speed Growth
0x12 - Speed Multiplier
0x13 - PA Growth
0x14 - PA Multiplier
0x15 - MA Growth
0x16 - MA Multiplier

abilities.csv (0x001 cure to 0x164 parasite)

0x08 - Formula
0x09 - X
0x0a - Y
Help! / How are exit tiles chosen in the Deep Dungeon?
September 06, 2016, 12:57:47 am
The png maps of the Deep Dungeon by jekoln at GameFAQs indicate that each map has 1 exit tile out of 5 possible tiles.  Is this a table, and has anyone located it?  Also what does the event scripting of the DD differ from other maps?
The Lounge / How do I use hexchat?
July 23, 2016, 08:51:27 pm
I hate using firefox to access the web client.
If possible, I'd like the code tag to not expand horizontally, but i would like it to expand vertically.  By expand, I mean it will not use a scrollbar and will instead take up enough of the webpage as is needed to fit the tagged text.

Because this is really dumb:

Does anyone have an account to ask here:
PSX FFT Hacking / this is crap
July 23, 2016, 08:44:23 pm
delete me
Help! / Linux alternatives to CD Mage or cdprog?
July 05, 2016, 08:55:14 am
They won't work with every version of wine I installed, and I can't get wine to compile.
Also what are the various ways that PS1 games load files into memory?  Is there are built-in function that does that automagically or does it need to know which sector a file is in?

If I move files around in a disc image, will the game still work?

If this is true, then the best way to deal with most games would be to dissect the disc image into files, modify those files, and then reassemble the files into a disc image.
I must make a project of my own, and I think I should make either a Steam game or an Android app.  I'd like to make a tactical RPG, but I'm one person and there's only so much I can do.  I'm thinking that procedural generation could be a very good mechanic to reduce the amount of work involved, but I'm not sure what sort of mechanics should be involved.  What tactical RPGs do you recommend I study to find interesting mechanics that are suited to procedural generation?  What are the most basic mechanics a tactical RPG should have?
The Lounge / Galaxy Mage, a tactical RPG
June 04, 2016, 08:04:30 pm

GalaxyMage is a free, open-source tactical/strategic RPG for Windows, Linux, and Macintosh, with online multiplayer support. A tactical RPG is a type of role-playing game where turn-based battles are fought on a 3D map. Examples of commercial tactical RPGs include Final Fantasy Tactics, Vandal Hearts, and Disgaea: Hour of Darkness. Our goal is to make GalaxyMage a game that is relatively simple to pick up and play -- you can dive right in without getting bogged down in the details of the battle mechanics -- but to also allow for a lot of character development and customization. We also intend to create a unique, advanced AI system that allows enemy units to work together as a team and employ a wide variety of strategies.

Hacking/Patching Tools / Looking for bugs
February 01, 2016, 05:44:05 pm
I and my group mates need to fix bugs for a class.  Are there any programs that have bugs?  Where is the latest source code hosted?
PSX FFT Hacking / disassembly of FFT files with labels?
December 11, 2015, 08:56:31 am
There's plenty of good material on the wiki, but it's hard to keep track of it all because it's split across so many pages and there is no use of labels.  Has anyone tried to make a single definitive disassembly of each file, while changing address references to labels?  It could make things much easier to modify in the future.
Recruitment / Available for application programming
November 26, 2015, 09:02:06 pm
I wouldn't mind writing a small application for my portfolio.  I'm most proficient with Java, but I've taken classes on C and Python, though I don't remember much of Python and I didn't go very in depth with C.  If anyone is interested please tell me exactly what behavior you want in your application, provide a sketch or image of the GUI if it is a GUI application, and provide any specifications and information about the data you want it to process.
I'm curious about how FFTPatcher directly patches a disc image, specifically how it updates the error detection and correction areas when data in a sector is altered.  Does anyone have any technical information on this?


This seems useful.  I'm not familiar with C# though so I can't follow it that well.
What is known about item attribute data?  I know it can be repointed, but last I checked there were still issues with menus and item previews.  Have new routines related to this been documented?



0005c67c: 00000000 nop
0005c680: 34420008 ori r2,r2,0x0008 Enable Sword
0005c684: a2220184 sb r2,0x0184(r17) Store new Equipped Flags?
0005c688: 30a300ff andi r3,r5,0x00ff
0005c68c: 340200ff ori r2,r0,0x00ff r2 = ff
0005c690: 10620062 beq r3,r2,0x 0005c81c Branch if nothing is equipped
0005c694: 00031040 sll r2,r3,0x01 ID * 2
0005c698: 00803021 addu r6,r4,r0 r6 = Unit's Data Pointer (Bonus Stats)
0005c69c: 00431021 addu r2,r2,r3 ID * 3
0005c6a0: 00021080 sll r2,r2,0x02 ID * 12
0005c6a4: 3c038006 lui r3,0x8006
0005c6a8: 24632eb8 addiu r3,r3,0x2eb8
0005c6ac: 00434821 addu r9,r2,r3
0005c6b0: 91230007 lbu r3,0x0007(r9) Load Equipment's Item Attributes
0005c6b4: 24880003 addiu r8,r4,0x0003 r8 = Unit's Data Pointer (PA)
0005c6b8: 00031040 sll r2,r3,0x01 ID * 2
0005c6bc: 00431021 addu r2,r2,r3 ID * 3
0005c6c0: 000210c0 sll r2,r2,0x03 ID * 24
0005c6c4: 00431021 addu r2,r2,r3 ID * 25
0005c6c8: 3c038006 lui r3,0x8006
0005c6cc: 246342c4 addiu r3,r3,0x42c4
0005c6d0: 00433821 addu r7,r2,r3 r7 = Item Attribute's Data Location
0005c6d4: 00e02821 addu r5,r7,r0 r5 = Item Attribute's Data Location
0005c6d8: 90a20000 lbu r2,0x0000(r5) Load Item Attribute's Stat
0005c6dc: 90c30000 lbu r3,0x0000(r6) Load Unit's Bonus Stat
0005c6e0: 00000000 nop
0005c6e4: 00431821 addu r3,r2,r3 Bonus Stat + Item Attribute's Stat
0005c6e8: 2c620100 sltiu r2,r3,0x0100
0005c6ec: 14400002 bne r2,r0,0x 0005c6f8 Branch if new Stat < 256
0005c6f0: 24a50001 addiu r5,r5,0x0001 Item Attribute's Data Pointer += 1
0005c6f4: 340300ff ori r3,r0,0x00ff Stat = 255
0005c6f8: a0c30000 sb r3,0x0000(r6) Store new Bonus Stat
0005c6fc: 24c60001 addiu r6,r6,0x0001 Unit's Bonus Stat Pointer += 1
0005c700: 00c8102a slt r2,r6,r8
0005c704: 1440fff4 bne r2,r0,0x 0005c6d8 Branch if all Bonus Stats haven't been checked