Please login or register.

Login with username, password and session length
Advanced search  

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed. Find out how you can help in the Recruitment section.

Pages: [1]
Emmy [Posts: 226]
  • View Profile
  • share
  • [December 22, 2015, 07:05:55 PM]
How to troubleshoot why this doesn't work on some emulators?
« on: December 22, 2015, 07:05:55 PM »
Several people have told me there were issues with my mod on some emulators.  Is it due to any asm in particular and if so how to fix it?

These from Raven's Workbooks: http://pastebin.com/aXJJZ32M
Misc other ASM: http://pastebin.com/BjYKWTi1

Also the Game Progression workbook ones.  All ASM has been found somewhere on this site.
Choto [Posts: 818]
  • View Profile
  • share
  • [December 22, 2015, 07:36:06 PM]
Re: How to troubleshoot why this doesn't work on some emulators?
« Reply #1 on: December 22, 2015, 07:36:06 PM »
Different emulators react differently to various "illegal procedures" in asm code. For example, when you load a value to a register, it usually doesn't appear there until 2 commands later for some emulators. If you tried to use the value 1 command after the load, it wouldnt be there yet and could cause problems. So if the asm hacks you used don't follow the safest procedures of how to code, they may fail on some emulators this way.

So really the only way to fix it is scan the asm hacks and see if you can find some of those illegal series of commands. Unfortunately people started writing hacks before we knew about those issues :/
French Maid
Xifanie (Webmistress) [Posts: 4234]
  • View Profile
  • Final Fantasy Hacktics
  • http://steamcommunity.com/id/Xifanie
  • share
  • [December 23, 2015, 02:35:21 PM]
Re: How to troubleshoot why this doesn't work on some emulators?
« Reply #2 on: December 23, 2015, 02:35:21 PM »
You are using at least 5 faulty hacks with errors in them. I have a tool that reads xml data to auto-detect these issues, but it's not perfect, so that means there might be more.


    • Modding version: PSX
  • <R999> My target market is not FFT mod players
    <Raijinili> remember that? it was awful
    Emmy [Posts: 226]
    • View Profile
    • share
    • [December 23, 2015, 04:49:33 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #3 on: December 23, 2015, 04:49:33 PM »
    Thank you.  I guess something to figure out later if I ever figure out asm.
    Emmy [Posts: 226]
    • View Profile
    • share
    • [December 24, 2015, 09:10:38 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #4 on: December 24, 2015, 09:10:38 PM »
    Posting this, both in case it helps someone else, and because a few questions came up.  This person's background isn't in FFT modding but other modding that requires asm knowledge.  (needed someone to explain extreme basics)


    Anyway:

    1.  how do i get something that looks like the code that i pasted in that topic (on pastebin) to the slightly more readable code like what xifanie posted?

    2.  Can instructions be "padded out" or do the code blocks need to be of specific length?

    3.  What is the context of "invalid immediate value" error? 
    Choto [Posts: 818]
    • View Profile
    • share
    • [December 25, 2015, 12:55:18 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #5 on: December 25, 2015, 12:55:18 PM »
    just out of curiousity, who's that dude insaeno? they had some good analogies.

    1. OK so... instructions (like the ones that appear in what Xifanie posted) are encoded into Hex numbers. so something like

    addiu r2, r3, 0x0010

    gets encoded into

    10006224

    the game reads those numbers and reacts accordingly, while humans generally like to see the other format.  Except SecondAdvent cause he's a RobotASMGuruGenius. Patch xmls for use in FFTOrgASM generally use the hex numbers. Glain wrote a program called MassHexASM which converts to and from either format. It can be found here: http://ffhacktics.com/smf/index.php?topic=7130.0

    2. Instructions unfortunately cannot be padded out. The instructions are stored in memory and some instructions jump to specific addresses in memory. If everything gets moved down then all the jumps are off. However, there are ways of fixing load delays in a somewhat convenient way. Basically you can jump to free space, pad whatever you want or write whatever code you want, then jump back to the original routine, all of which does not affect the overall length of the original routine.

    3. If I'm correct, I believe that when you load a value, you can only load from addresses which have a multiple of 4 for some emulators. so

    lw r2, 0x0004 (r2)

    would work while

    lw r2, 0x0006 (r2)

    would not. Keep in mind that it's a hexadecimal number system so the immediate would have to end in 0x0000, 0x0004, 0x0008, or 0x000C.

    If you haven't already, I'd suggest looking at the tutorials that various users have posted on the forums. They all cover different stuff and the more collective knowledge you have, the more things start to make sense.http://ffhacktics.com/smf/index.php?topic=9204.0

    this may also be useful: http://ffhacktics.com/smf/index.php?topic=9608.0
    Emmy [Posts: 226]
    • View Profile
    • share
    • [December 27, 2015, 11:47:17 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #6 on: December 27, 2015, 11:47:17 PM »
    To answer your question, insaeno is someone from another website who helped with Project M.  Different game so obviously different code/probably a different language altogether, but with no tools available you kinda need to know your stuff to be helpful there.

    Progress!  Managed to rewrite Critical Hit hack successfully.  Oil seems to be faulty so trying different Oil hack (as far as I can tell no issue, but could be wrong).  **Edit** Not sure wtf is up with flee now.  It seems to be interpreting characters that don't have Flee as having +4 move always.

    Hacks placed here for future reference:


    Not sure how to fix the Weapon XA rewrite though.  Offending code is in the middle of something that looks important, so can't be lengthened. :p
    « Last Edit: December 30, 2015, 03:07:20 AM by Emmy »
    • Modding version: PSX
  • Emmy [Posts: 226]
    • View Profile
    • share
    • [December 30, 2015, 04:53:09 AM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #7 on: December 30, 2015, 04:53:09 AM »
    Potentially helpful information:


    New Flee hack:

    Emmy [Posts: 226]
    • View Profile
    • share
    • [January 09, 2016, 07:49:58 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #8 on: January 09, 2016, 07:49:58 PM »
    Final hack (Weapon Formulas edit) fixed, as long as there's nothing wrong with this code:


    Since everything has been either fixed or removed, topic solved. :)
    Choto [Posts: 818]
    • View Profile
    • share
    • [January 09, 2016, 08:48:46 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #9 on: January 09, 2016, 08:48:46 PM »
    you have some problems with your hack. The location you're jumping to in the weapon formula thing is 0x951c0... that's not in free space. Free space starts at like 0xE92ac and goes to somewhere around 0xf7000. So your hack should be jumping in there somewhere. Other places that have 00's may (and probably are) used by the game for dynamically loaded stuff.

    Also, you're jumping back to 0x185bf4. Which is where you jumped from. which means you will endlessly jump back and forth and effectively freeze the game. you gotta jump back to 2 locations after the original jump - 0x185bfc
    Emmy [Posts: 226]
    • View Profile
    • share
    • [January 09, 2016, 09:31:28 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #10 on: January 09, 2016, 09:31:28 PM »
    Thanks. :)


    What exactly are those large chunks of 00's that exist in a few odd spaces?  For example, the one that's between 0x2f200 - 0x7fabc? Is the chunk from 0xe8334 onwards the only safe one to use?
    Choto [Posts: 818]
    • View Profile
    • share
    • [January 09, 2016, 09:52:16 PM]
    Re: How to troubleshoot why this doesn't work on some emulators?
    « Reply #11 on: January 09, 2016, 09:52:16 PM »
    Well... hex numbers can represent a whole crapload of things. It could be assembly code. It could be visual graphics. It could be sound effect information. It could be music. It could be straight up data. So honestly, who knows what it could be.

    different files on the ISO are loaded into different places in RAM. So even though it may be 00's right now, the game may load some data in their later, erasing your hack.

    The only reason what we call free space is safe, is because we know that it was just filled with japanese characters that were never used in the US version, and nothing is ever loaded there.
    Pages: [1]