[Release] Final Fantasy VII Script Code Assembler!

  • Thread starter Thread starter titeguy3
  • Start date Start date
Status
Not open for further replies.
T

titeguy3

Guest
I got sick and tired of having to manually edit all of the Jump points in an AI Script after modifying something and having to frequently look up the hex values for stuff, so I decided to write myself a little Assembler so that I can code directly in assembly and use labels and quantifiers instead of having to put in raw hex values.

It's nothing flashy, but it works pretty well. I've tested it against Sephiroth's Pre-Battle script and it matched perfectly.

Here's what the input file looked like:

Code: [Select]
Code:
; Sepher Sephiroth's Pre-Battle AI Script;Label Opcode Argument  PUSH12 Self ;This is a quantifier, There's a total of 124 of them built in. Typing "self" is the same as 2060 PUSH10 402C MASK PUSH01 01 STRA PUSH 00 PUSH02 0268 GLOB PUSH13 0020 PSHA01 GlobalAddress ;This is another one, this one stands for x2010 STRA PUSH01 00 PUSH01 5B GLOB PUSH13 0040 PSHA01 GlobalAddress STRA PUSH01 00 PUSH02 026C GLOB PSHA01 GlobalAddress PUSH01 01 EQU JMP0 jump1 ;This is a Label, it stores the address of any other instruction, so long as it's labeled with an identical label PUSH13 0060 PUSH03 013880 ;Note: when dealing with PUSH and PSHA, specifying a type (e.g. PUSH03) is optional--PSHA defaults to PSHA00, and PUSH defaults to opcodes 60, 61, or 62 depending on the argument size. STRA JUMP jump2jump1 PUSH13 0060 PUSH 00 ;See? not necessary STRAjump2 PUSH13 0000 PUSH 4E200 ;Trailing zeros are also not necessary STRA PUSH13 0000 PSHA03 0000 PUSH01 08 PSHA03 0020 SUB PUSH02 7530 MUL SUB STRA push12 SELF ;Case insensitivity ftw PUSH13 mhp MASK PSHA03 0000 PSHA03 0060 ADD STRA PUSH12 SELF PUSH13 HP MASK PSHA02 SELF PSHA03 MHP MASK PSHA03 0040 PUSH01 #100 ;you can also enter decimal values like this MUL SUB STRA PSHA02 SELF PSHA03 MHP MASK PSHA02 SELF PSHA03 HP MASK DEBUG  02 HP = %d / %d PUSH13 0000 PSHA02 SELF PSHA01 ATTACKPOWER MASK PSHA03 0020 PUSH01 02 MUL ADD STRA PUSH12 SELF PUSH11 ATTACKPOWER MASK PSHA03 0000 STRA PUSH13 0000 PSHA02 SELF PSHA02 PHYSDEFENSE MASK PSHA03 0020 PUSH01 14 MUL ADD STRA PUSH12 SELF PUSH12 ATTACKPOWER MASK PSHA03 0000 STRA PUSH13 0000 PSHA02 SELF PSHA01 MAGICPOWER MASK PSHA03 0020 PUSH01 05 MUL ADD STRA PUSH12 SELF PUSH11 MAGICPOWER MASK PSHA03 0000 STRA PUSH13 0000 PSHA02 SELF PSHA02 MAGDEFENSE MASK PSHA03 0020 PUSH01 10 MUL ADD STRA PUSH12 SELF PUSH12 MAGDEFENSE MASK PSHA03 0000 STRA PSHA02 SELF PSHA02 MAGDEFENSE MASK PSHA02 SELF PSHA01 MAGICPOWER MASK PSHA02 SELF PSHA02 PHYSDEFENSE MASK PSHA02 SELF PSHA01 ATTACKPOWER MASK DEBUG 04 AT %d DF %d ATM %d DFM %d PUSH12 TARGETMASK PUSH02 SELF STRA PUSH01 20 PUSH02 0368 ;"x" attack ATTK PUSH01 20 PUSH02 014F ;"Appear" attack ATTK END
And this was the output file:

Code: [Select]
Code:
12 206010 402C8060 019060 0061 02689513 002001 20109060 0060 5B9513 004001 20109060 0061 026C9501 201060 014070 003D13 006062 0138809072 004313 006060 009013 000062 04E2009013 000003 000060 0803 00203161 753032319012 206013 41808003 000003 0060309012 206013 41608002 206003 41808003 004060 6432319002 206003 41808002 206003 416080A0 02 HP = %d / %d13 000002 206001 40688003 002060 0232309012 206011 40688003 00009013 000002 206002 41008003 002060 1432309012 206012 40688003 00009013 000002 206001 40708003 002060 0532309012 206011 40708003 00009013 000002 206002 41108003 002060 1032309012 206012 41108003 00009002 206002 41108002 206001 40708002 206002 41008002 206001 406880A0 04 AT %d DF %d ATM %d DFM %d12 207061 20609060 2061 03689260 2061 014F9273
You can see a screenshot of it in action here:
screenshot.jpg


Told ya, the interface isn't exactly flashy but it gets the job done.

You can download it and try it out here

If you find any bugs, be sure to tell me, send me a screenshot or a copy of the error message and the input file and I'll try to fix it and get another version up.

Edit: FF7 Script Code Assembler is now v1.1! The max number of labels allowed is now 50 (from 10) and it no longer crashes when you exceed that. Note also that the max label size is 15 characters. The TBIT opcode has also been fixed.
 
Last edited:
Is this for script for PC version? i'm hoping for a psx enemy script
 
I haven't tried it, but since the scene.bin is the same in both versions of the game maybe this will work with both?
 
Last edited:
It just spits out a .txt file with the hex values for the script, which are gonna be the same between pc and psx.

I admit that this would be a ton more useful if you could just copy and paste tabbed entries into proudclod.
 
Last edited:
Status
Not open for further replies.
Back
Top