• Welcome to Final Fantasy Hacktics. Please login or sign up.
September 29, 2020, 07:14:56 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.

Messages - Glain

Completed Mods / Re: Auto-SCC Patch
September 16, 2020, 08:02:21 pm
Sure, I suppose you could.  At least, I can't think of any reason why not off the top of my head.
Beta v4 release:

    * Fixed bug in ability editor where it could try to update the "inflict status" values for abilities without attributes
    * Fix for ampersands inside certain controls that use TextRenderer.DrawText() (Includes ENTD unit area)

    * Made PSXText.xml and PSPText.xml external files that can be used to configure section entries, DTE, compression, etc.  These were previously the internal psx.xml and psp.xml files.
    * Text sections now have at least the number of entries specified in the appropriate XML file, even if text is loaded from a file without those entries listed.
    * Corrected number of entries for Diary of Nanai and Wyuvle.

    * Moving ASM blocks also updates loads/stores and address references!

ASM Encoder/Decoder:
    * No longer flags load delay on writeback registers.
The conflict is not in data.  It arises because the two hacks are editing program code in the same routine: https://ffhacktics.com/wiki/Equipment_Attribute_Setting

Those hacks rewrite that routine in different ways, so they are not compatible.  There's no way to get around that by moving anything (indeed, there is nothing to move).

(Writing only to free space would be useless because the new code or data would never be referenced by the game.  Other changes are needed to change the behavior of the game.  Some hacks don't need or use free space at all.)
Each entry in the free space viewer refers to one section of a patch. 
Length refers to the length (in bytes) of that section.

Address + Length = Next Address
Next Address + Space To Next Patch = Address of next entry in the list (or the end of the free space block, if there isn't one)

If the Space To Next Patch is negative, it will be colored red, and indicate a conflict with the next entry in the list.

In the screenshot, the free space viewer is only showing one entry, so no conflict is shown.

I took a look at Pride's Item Attribute rewrite patch (v1.1), and it doesn't appear to use free space at all... 

When you saw the conflict in the conflict checker, was the background color red or white?  If it was red, that conflict was not in free space and cannot be resolved with a move.
I'm releasing another version of my XML (and Include files), including the Unit bench hack (10 extra unit slots)!  It's attached to the original post in this thread (direct download).

This update includes the Now Loading routine rewrite, a patch that can expand load and save data, and the Unit bench hack (which includes the former).
This version of my .XML also comes with (and requires) the latest FFTPatcher suite 0.493, currently available here.

EDIT - Uploaded new version of XML to fix problem with circle menu regarding the bench hack.
EDIT - Uploaded new version of XML to add the option to change the checksum end block for the Expand Load and Save Data and Unit Bench hacks.  Changing 3C to 40 (hexadecimal values) will cause saves made without the patch not to load!
EDIT - Uploaded new version of XML to fix issues regarding Tutorials.

EDIT - Uploaded new version of XML to fix an issue with the Speed shortens Ability CT patch where AI routines were unaware of the CT change.
Some fixes and features later, another beta...

FFTPatcher 0.493 Beta v3:

    * Added and modified some patch XMLs (Dokurider.xml added).
    * Fixed issues with Free Space viewer and Conflict Checker.
    * "Complete!" message no longer appears when Canceling an action.
    * Now supports <Include> tags with a "patch" attribute to include another patch (by name).
    * Reload button now reloads the currently selected file.  Select All in the file list before pressing Reload to reload all the files.

This also includes the latest version of my XML file (including the unit bench hack).
EDIT - Updated attachment to include latest fix for bench hack.
I'll have a better consolidation of this later, reflecting the newer version of my XML coming in .493.  But for now...

Now Loading Routine Rewrite

This is a rewrite of the routine that builds the Now Loading message in order to make it shorter.  This frees up 1272 bytes in SCUS.   Also has variables to set the color of the Now Loading message!

    <Patch name="Now Loading Routine Rewrite">
        <Location file="SCUS_942_21" offset="40BD8" mode="ASM" offsetMode="RAM">
             #   ROUTINE: Build Now Loading Message (Rewrite)
                    addiu   sp, sp, -48
                    sw      s0, 16(sp)
                    sw      s1, 20(sp)
                    sw      s2, 24(sp)
                    sw      s3, 28(sp)
                    sw      s4, 32(sp)
                    sw      s5, 36(sp)
                    sw      ra, 40(sp)
                    move    s1, a1
                    move    s2, a2
                    lui     s3, 0x8005
                    addiu   s0, s3, -0x28e0
                    sw      a0, 0x8004760c
                    move    a0, s0
                    li      v0, 9
                    sb      v0, -0x28dd(s3)
                    li      v0, 0x2c
                    sb      v0, -0x28d9(s3)
                    li      t0, 0x80
                    li      t1, 0x80
                    li      t2, 0x80
                    sw      zero, -0x1a48(s3)
                    sb      t0, -0x28dc(s3)
                    sb      t1, -0x28db(s3)
                    sb      t2, -0x28da(s3)
                    jal     0x80023c68
                    li      a1, 0
                    li      v0, 0x1f
                    sh      v0, -0x28ca(s3)
                    li      v0, 0x7887
                    sh      v0, -0x28d2(s3)
                    li      s5, 1
                    addiu   s4, s0, 40
                    move    a0, s4
                    move    a1, s0
                    jal     copy_words
                    li      a2, 40
                    addiu   s5, s5, 1
                    sltiu   t0, s5, 7
                    bne     t0, zero, copy_loop
                    addiu   s4, s4, 40
                    #   "No" block
                    la      a0, 0x8004d720
                    addiu   a1, s2, 200
                    addiu   a2, s1, 160
                    addiu   a3, s2, 208
                    addiu   t0, s1, 172
                    li      t1, 155
                    li      t2, 228
                    li      t3, 163
                    jal     write_and_copy_block
                    li      t4, 240
                    #   "w" block
                    la      a0, 0x8004d748
                    addiu   a1, s2, 200
                    addiu   a2, s1, 171
                    addiu   a3, s2, 208
                    addiu   t0, s1, 178
                    li      t1, 163
                    li      t2, 228
                    li      t3, 171
                    jal     write_and_copy_block
                    li      t4, 235
                    #   "loa" block
                    la      a0, 0x8004d770
                    addiu   a1, s2, 200
                    addiu   a2, s1, 183
                    addiu   a3, s2, 208
                    addiu   t0, s1, 195
                    li      t1, 85
                    li      t2, 173
                    li      t3, 93
                    jal     write_and_copy_block
                    li      t4, 185
                    #   "d" block
                    la      a0, 0x8004d798
                    addiu   a1, s2, 200
                    addiu   a2, s1, 195
                    addiu   a3, s2, 208
                    addiu   t0, s1, 200
                    li      t1, 96
                    li      t2, 209
                    li      t3, 104
                    jal     write_and_copy_block
                    li      t4, 214
                    #   "i" block
                    la      a0, 0x8004d7c0
                    addiu   a1, s2, 200
                    addiu   a2, s1, 199
                    addiu   a3, s2, 208
                    addiu   t0, s1, 202
                    li      t1, 82
                    li      t2, 124
                    li      t3, 90
                    jal     write_and_copy_block
                    li      t4, 127
                    #   "n" block
                    la      a0, 0x8004d7e8
                    addiu   a1, s2, 200
                    addiu   a2, s1, 201
                    addiu   a3, s2, 208
                    addiu   t0, s1, 206
                    li      t1, 204
                    li      t2, 206
                    li      t3, 212
                    jal     write_and_copy_block
                    li      t4, 211
                    #   "g" block
                    la      a0, 0x8004d810
                    addiu   a1, s2, 202
                    addiu   a2, s1, 205
                    addiu   a3, s2, 210
                    addiu   t0, s1, 210
                    li      t1, 164
                    li      t2, 235
                    li      t3, 172
                    jal     write_and_copy_block
                    li      t4, 240
                    la      a0, 0x800459e0
                    li      a1, 0x70
                    jal     0x80022d78
                    li      a2, 0x1e2
                    lw      ra, 40(sp)
                    lw      s5, 36(sp)
                    lw      s4, 32(sp)
                    lw      s3, 28(sp)
                    lw      s2, 24(sp)
                    lw      s1, 20(sp)
                    lw      s0, 16(sp)
                    jr      ra
                    addiu   sp, sp, 48

            #   ROUTINE: Write and copy block
            #       Combines write block with copy segment.
            #       Parameters: Same as Write Block
                    addiu   sp, sp, -16
                    sw      s0, 4(sp)
                    sw      ra, 8(sp)
                    jal     write_block
                    move    s0, a0
                    addiu   a0, s0, 0x118
                    move    a1, s0
                    jal     copy_words
                    li      a2, 40
                    lw      ra, 8(sp)
                    lw      s0, 4(sp)
                    jr      ra
                    addiu   sp, sp, 16

            #   ROUTINE: Write block
            #       Writes a block corresponding to a graphic.
            #       Parameters:
            #           a0 = Base pointer for block
            #           a1 = Top Y Position (Screen)
            #           a2 = Left X Position (Screen)
            #           a3 = Bottom Y Position (Screen)
            #           t0 = Right X Position (Screen)
            #           t1 = Top Y Position (Bitmap)
            #           t2 = Left X Position (Bitmap)
            #           t3 = Bottom Y Position (Bitmap)
            #           t4 = Right X Position (Bitmap)
                    sh      a1, 10(a0)
                    sh      a1, 18(a0)
                    sh      a2, 8(a0)
                    sh      a2, 24(a0)
                    sh      a3, 26(a0)
                    sh      a3, 34(a0)
                    sh      t0, 16(a0)
                    sh      t0, 32(a0)
                    sb      t1, 13(a0)
                    sb      t1, 21(a0)
                    sb      t2, 12(a0)
                    sb      t4, 20(a0)
                    sb      t2, 28(a0)
                    sb      t3, 29(a0)
                    sb      t4, 36(a0)
                    jr      ra
                    sb      t3, 37(a0)

            #   ROUTINE: Copy words
            #       Word-aligned memcpy.  Size must be multiple of 4.
            #       Parameters:
            #           a0 = dest, a1 = src, a2 = size
                    beq     a2, zero, copy_words_end
                    lw      t0, 0(a1)
                    addiu   a2, a2, -4
                    sw      t0, 0(a0)
                    addiu   a0, a0, 4
                    j       copy_words
                    addiu   a1, a1, 4
                    jr      ra
        <Variable name="Color Red Value" file="SCUS_942_21" offset="40C24" offsetMode="RAM" bytes="1" default="80" />
        <Variable name="Color Green Value" file="SCUS_942_21" offset="40C28" offsetMode="RAM" bytes="1" default="80" />
        <Variable name="Color Blue Value" file="SCUS_942_21" offset="40C2C" offsetMode="RAM" bytes="1" default="80" />
Hmm.  It was counting variables wrong.  A simple fix, but that's a pretty fundamental thing that blocks testing, so it's going to require another beta version.  Here it is, attached (Beta v2).  This also includes ctrl + mouse wheel functionality for Shishi zoom and the problem with the cut-off Shishi text about duplicate sprites should also be fixed.
I'm now ready to release the FFTPatcher .493 beta!  This contains a LOT of new features and fixes and is probably the biggest release I've done!

Special thanks to the following for their contributions which helped make this release possible (as well as others!):

Raijinili: Feature requests (including ENTD unit table changes and the concept for View Stats), convenience feature ideas, labeling fixes, team color research, etc.
Xifanie: Reference data, Gameshark conditionals, FFTText Editor concepts (including Altima font), Ideas around consolidating/repointing duplicate entries, etc.
Elric: Ideas for improving several of the tools, including FFTPatcher defaults, separating the two UNIT/WLDFACE entries, fixing Proposition text, changing around Shishi sections, and adding functionality to Shishi
RetroTypes: Consolidating patch XMLs, ideas for Shishi features (including Zoom and other images entry numbers), discussions about labeling
Raven: Ideas around consolidating Item Attributes and Inflict Status, General ideas, labeling discussions
Choto: Effect notes
FFMaster: Idea about supporting more pseudoinstructions with non-specified source operand for ALU commands
Jumza: Team color information
Emmy: Information about FFTPatcher labeling, especially in the Propositions section
cadence: Idea for showing information about Item Attributes and Inflict Status, and pointing out some ASM hacks
Here's my latest version of the FFTPatcher suite including a version of Shishi that can edit the extra palettes in WLDFACE.BIN. The new entries are just added at the end of the list. They're annoyingly arranged in the file, so if modifying one of these entries, both the original and new entries should be updated.

I also separated out the XML files that define what goes in the Other Images section so that they can be updated without needing to recompile the Shishi EXE.

There are also a few convenience changes to the ASM patcher added in here.


    * In the Other Images section, WLDFACE.BIN now has extra sections for units with extra palettes.  If changing one of these units, both the original and new entries should be changed.
    * The PSXFiles.xml and PSPFiles.xml files that define the entries in the Other Images section are now external files rather than being compiled into the program. This enables custom entries to be added into Shishi by adding them to the appropriate XML file(s)! Just an example...
        <Section Filename="E173.BIN" Filesize="48304">
                <Name>Night Sword</Name>

    * ASM checker no longer shows a warning if a stack pointer offset is not a multiple of 8 (but will if the offset is not a multiple of 4).
    * Multiple offsets can now be specified in one Location tag using comma separated values. 
            <Location file="EFFECT_E137_BIN" offset="AAB,923,E7F,B6F,C33,9E7,CF7,DBB,85F,10CB,F43" mode="DATA">
PSX FFT Hacking / Re: The Blue Mage
March 30, 2020, 03:44:48 pm
I'd just like to point out that the Learn with JP flag is only for whether or not the player can spend JP to learn the skill from the formation screen (which is why the flag name has "(Player)" next to it). I don't believe the game even checks it when generating units from ENTD.

Neither one of those flags should affect whether generated units learn abilities...
Help! / Re: ENTD locations?
February 14, 2020, 12:32:50 pm
The files are ENTD1.ENT through ENTD4.ENT in the BATTLE directory of the disc image.  Only the current ENTD entry is kept in RAM for any length of time (which is why GS codes for them can't really be generated, at least without a ton of conditionals).
That's 0x5FE74, not 0x5EE74.  Location in file is 0x50674, not 0x4F674.
I think the codes starting with 7 are conditional codes, although I don't know if that's proper form for the Gameshark.  It should probably be D instead of 7.  So essentially, if the value at 0x14E61C == 0xF400, run the next code.  This is probably a test to see if BATTLE.BIN is loaded (and that's the binary file you're looking for).

Glancing at the Data/Table locations page, here's the memory range being edited:
801b63f0 - Ability Effect (2 bytes each, 0x1c6 total)
The Lion War / Re: ASM conflict problem
January 13, 2020, 03:26:13 pm
Hmm.  Is that definitely the latest version of the apply defense patch?  0xF2130 should be the earliest write location.

You can get the latest version of my XML from this thread.
Use an execute breakpoint, not a memory read breakpoint.  The former breaks when the instruction at that address is executed; the latter breaks when the value from that RAM location is read (by a different instruction somewhere).
You can hit breakpoints in the formation screen just fine.  It also doesn't make sense that the breakpoint would fire after BATTLE.BIN is loaded because that should overwrite the breakpoint (due to the way pSX handles execute breakpoints).  Are you sure you have the address right?  Your screenshot shows no breakpoint...
PSX FFT Hacking / Re: Any ASM tutors available?
January 03, 2020, 10:10:12 am
As an aside, if you're looking for specific data in the PSX version, we've documented a lot of it in the Data/Table Locations page on the Wiki.
PSX FFT Hacking / Re: Any ASM tutors available?
January 01, 2020, 08:42:36 pm
You would have more success asking more specific questions...

"What operations do what" and "how to look for specific things" doesn't exactly give much to go on.  What specific things?  The location of party data in RAM?  The location of the subroutine that levels a unit up in the game code?  For the PSP version, we don't have much of that mapped out.  That means this will be something of a pioneering effort, and you'll need to use a debugger.  You were already, seemingly, on the right track with that, using PPSSPP.  CWCheat codes might also give you a clue as to where certain values are in RAM (and those can be generated with FFTPatcher).  There are also a few relevant threads in the PSP hacking section.  I would think you would have at least looked at this one.

And what do you mean by "operations"?  That does read like you mean low-level instructions, as in arithmetic/logical operations.  If that's not it, what do you actually mean?  Again, we don't have most of the subroutines mapped out for the PSP version, at least as of yet...
The PSP CPU is called Allegrex. The architecture it uses is MIPS32 release 2 (32 bit), and it also has some custom instructions/encodings.

When I was adding the PSP instructions into MassHexASM/LEDecoder, I was able to look up most of the instructions in the general MIPS32r2 documentation, and I found the rest in the source code of a PSP emulator.

Take a look at the replies in this thread: http://ffhacktics.com/smf/index.php?topic=7758.0

Documentation for MIPS32 release 2: http://personal.denison.edu/~bressoud/cs281-s10/Supplements/ISA_Vol_2.pdf
PSP emulator source code: http://code.google.com/p/pspemu/source/browse/trunk/src/pspemu/core/cpu/tables/Table.d?r=315