• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 29, 2024, 05:54:04 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.


Source code for the event compiler and decompiler?

Started by nitwit, November 22, 2014, 09:22:36 pm


Xifanie

  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

nitwit

Do you remember the structure of it?  What language did you use?

It doesn't seem very complicated.

Xifanie

Gosh, it was years ago.
I used Delphi Pascal 7 I think, and the structure huh... was really bad.

It's not a very complicated program as a base, it's just reading and reformatting text to and from arrays of bytes.
Without asking me anything specific, I might as well rewrite the damn thing just to answer you.
  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

nitwit

That isn't necessary, a pseudocode approximation works, abstracted from FFT opcodes.

Xifanie

  • Modding version: PSX
Love what you're seeing? https://supportus.ffhacktics.com/ 💜 it's really appreciated

Anything is possible as long as it is within the hardware's limits. (ie. disc space, RAM, Video RAM, processor, etc.)
<R999> My target market is not FFT mod players
<Raijinili> remember that? it was awful

Raijinili

  • Modding version: Other/Unknown

nitwit

November 23, 2014, 04:49:01 pm #7 Last Edit: November 23, 2014, 05:23:15 pm by nitwit
LOCATE EVENTS
Load event file.
Create text file.
Go to event scripts in event file (assuming the event scripts are located only in a specific location in the file).




DECODE AND WRITE
If byte at current address equals opcode n, then:
{
     Decode opcode n and parameter bytes (if any) to english language equivalents.
     Write English language equivalents to text file.
     Append newline character.
     Move current address to byte after the last parameter byte.
}




LOOPING MECHANISM
Not sure how to do this, or if it's necessary.  Should I loop through the IF THEN ELSE block (which will be huge) for every byte until I read the end of the file?  If the event script is only located at a certain point in the file then I need to detect the start and the length of the event scripting, then I can set up a WHILE loop for currentAddress != scriptStart + scriptLength.  Actually I think that's right, a FOR loop wouldn't work because there is no set length of event scripts in a given block.  The variable length of parameter bytes means that in a space of 100 bytes I could have 100 opcodes or fewer.




I answered my own question.