Author Topic: Fieldscript - Finishing the unknown commands list  (Read 4905 times)

Grobycftw

  • Architect of Kajar
  • Porrean (+50)
  • *
  • Posts: 89
  • Chilling in the Bend of Time
    • View Profile
Fieldscript - Finishing the unknown commands list
« on: March 03, 2024, 07:09:14 pm »
On this page is all the currently known commands for the fieldscript
https://www.chronocompendium.com/Term/Chrono_Cross_Fieldscript_Notes.html

Here are all the Unknown Commands left :
Quote
03 - Unknown
04 - Unknown

27 XXYY - Unknown
28 XXYY - Unknown
29 XXYY - Unknown
2A XXYY ZZ - Unknown, ZZ is sign bits

32 XX YYZZ - Unknown
37 XX - Unknown
38 XX - Unknown
39 XX - Unknown
3E XXYY - Unknown

44 XX YY - Follow YY character ID with XX parameters? (See below)
47 XX - Unknown
4C PP QQRR SSTT UUVV WWXX YYZZ - Unknown, args may be one byte less than shown.
4D LL MMNN OOPP QQRR SSTT UUVV WWXX YYZZ - Unknown, args may be one byte less than shown.
4F WW XX YY ZZ - Unknown

59 - Unknown

63 XXYY - Unknown
64 XXYY ZZ - Unknown
65 XXYY - Unknown
66 WW XXYY ZZ - Unknown

74 WWXX YY ZZ - Unknown
76 WW XX YYZZ - Unknown
77 WW XX YYZZ - Unknown
78 WW XX YYZZ - Unknown

83 RRSS TTUU VVWW XXYY ZZ - Unknown (ZZ is sign bits for other arguments)
89 WWXX YY ZZ - Unknown, YY and ZZ may not be used
8B WWXX YYZZ - Unknown
8D XX - Unknown

91 XX - Unknown
92 XX YYZZ - Unknown
93 XX - Unknown
9A WWXX YYZZ - Unknown
9B VV WW XX YY ZZ - Unknown (effect-related?)
9C WW XX YY ZZ - Unknown
9D XX - Unknown

A0 XX - Unknown -> Randomize Movement  (00 = with pause, 01 = no pause)
A2 XX YYZZ - Unknown
A4 XXYY - Unknown
A5 XXYY - Unknown
A6 XX - Unknown
A7 SSTT UUVV WWXX YYZZ - Unknown
AB WWXX YYZZ - Unknown
AD XX - Unknown
AE XX - Unknown
AF TTUU VVWW XX YYZZ - Unknown (XX is sign bits for preceding arguments)

B1 XX - unknown
B5 XXYY - Unknown
B6 WW XX YY ZZ - Unknown
B7 XXYY ZZ - Unknown (ZZ is sign bits)
B9 TT UU VVWW XX YY ZZ - Unknown (parameter grouping uncertain)
BE - Unknown
BF WW XX YY ZZ - Unknown (parameter grouping uncertain)

C7 XXYY - Unknown
C8 NNOO PPQQ RRSS TTUU VV WWXX YYZZ - Unknown. VV is sign bits for the three preceding parameters.
CA - Unknown
CF XX YYZZ - Unknown

D2 - Unknown
D7 WW XX YY ZZ - Unknown
D8 TT UUVV WWXX YYZZ - Jump to ZZYY based on an unknown condition. TT is a character.
DF SSTT UUVV WW XXYY ZZ - Unknown (WW is sign bits for preceding arguments)

FE 01 XX - Unknown
FE 02 XXYY - Unknown
FE 03 WWXX YY ZZ - Unknown
FE 04 XX - Unknown
FE 06 XX - Unknown
FE 07 XX - Unknown
FE 09 XX YYZZ - Unknown (XX is a character)
FE 0A XX YYZZ - Unknown (XX is a character)
FE 0D XXYY - Unknown
FE 0E XXYY - Unknown
FE 0F XX YYZZ - Unknown (XX is a character)
FE 11 XXYY - Unknown
FE 12 UUVV WWXX YYZZ - Unknown
FE 14 XX - Unknown
FE 15 XXYY - Unknown
FE 17 XX - Unknown
FE 18 XX - Unknown
FE 19 XX - Unknown
FE 1A - Unknown
FE 1D WWXX YYZZ - Unknown
FE 25 XX - Unknown
FE 29 XXYY - Unknown
FE 2A XX - Unknown
FE 2B XX YYZZ - Unknown
FE 2C XX - Unknown
FE 2D XXYY - Unknown
FE 2F XX - Unknown
FE 31 XX - Unknown (XX is a character ID)
FE 32 - Unknown
FE 33 XX - Unknown
FE 34 PPQQ RRSS TTUU VVWW XXYY ZZ - Unknown. ZZ is sign bits for all previous arguments.
FE 35 XXYY ZZ - Unknown. ZZ is sign bits for previous argument.
FE 37 WWXX YYZZ - Unknown
FE 3A VVWW XXYY ZZ - Unknown. ZZ is sign bits for first argument.
FE 3F - Unknown
FE 40 XXYY - Unknown
FE 41 XX - Unknown
FE 42 XX - Unknown (yaz0r has a note here saying "save parameter to external array", but I don't know whether that's an indication of what this does or a coding TODO for his own software)
FE 43 WWXX YYZZ - Unknown
FE 45 00 XX YY - Unknown (YY is a character ID)
FE 45 VV WW XX YY ZZ - Unknown (XX is a character ID, VV > 0)
FE 46 TTUU VVWW XXYY ZZ - Unknown (ZZ is sign bits for preceding arguments)
FE 47 TTUU VVWW XXYY ZZ - Unknown (ZZ is sign bits for preceding arguments)
FE 48 SSTT UUVV WWXX YYZZ - Unknown
FE 49 VVWW XXYY ZZ - Unknown (ZZ is sign bits for preceding arguments)
FE 4B XX - Unknown
FE 4C XX - Unknown (XX is a character ID)
FE 52 XXYY - Unknown
FE 59 - Unknown
FE 5A XX - Unknown
FE 5C WW XX YYZZ - Unknown (XX is a character ID)
FE 64 XX YY - Unknown. YY is a character.
FE 6B XX - Unknown
FE 6F XX - Unknown
FE 70 XX - Unknown (XX is a character ID)
FE 72 -   Is Not even listed on the Field Page -> Looks like   Make NPC Rotate
FE 76 XXYY - Unknown
FE 7E - Unknown
FE 81 XX - Unknown


New discovered commands :
Quote
A0 XX = Randomize Movement for specific NPC (confirmed)
FE 31 = Dialogue Related (under study)
FE 38  = SET_HP function (under study)

44 XX YY - Follow YY character ID with XX parameters?
44 00 ID (Go to entity)
44 01 ID (Wait until there)




Thanks to F-man's works and research, we are currently trying to properly identify all the missing functions!
We discovered that   A0 00  is actually use for    Randomize Movement
Quote
A0 00 = Randomize Movement with random pauses/waits
A0 01 = Randomize Movement with no pauses (perpetual)
other F-man's potential unknown command under research :

  "I think FE 38 is actually SET_HP function."

  "opFE31 might be used to tell the target of dialogue. If you 0C it, game gets stuck waiting for dialog. "


I will update this post when more Unknown Commands are discovered!?

If you have any information you want to share to help this post please do share with us here! ty :)
« Last Edit: March 13, 2024, 04:20:36 pm by Grobycftw »

glennxserge

  • Earthbound (+15)
  • *
  • Posts: 40
  • Sacred lickaroo.... Not!
    • View Profile
    • Chrono Cross FateTerminal
Re: Fieldscript - Finishing the unknown commands list
« Reply #1 on: September 02, 2024, 09:50:09 pm »
Hey Grobycftw, I'm poking around and wanting to test some of the unknown commands, but I'm only getting halfway started. 

I'll run through the steps I'm imagining I'll need to take to make edits and check commands from the fieldscript files.  I'd love some pointers if you've got em for what's worked for you:
1. Dump disc ISO to files
2. Uncompress fieldscript files
3. Make edits
4. Recompress
5. Build ISO
6. Check behavior in emulator

That's a pretty crude way to iterate but I figured I'd start there. 
I've managed to get the disc dumped, with some modifications to purple cat tools (some windows issues with library paths), but I'm not having any luck rebuilding.  I end up with an ISO that fails to boot, even without any edits.

My backup method is a little more painful to set up, but probably faster to test incrementally:
1. Uncompress a fieldscript file
2. Run Chrono Cross in an emulator with debugger
2. Track disc reads and memory and find where in RAM it ends up
3. Make edits to RAM and observe

If you've got any advice for things that helped you test, I'd be grateful.  In particular if you know of script files that contain a mix of known and unknown opcodes, that would also be super helpful.

F-man

  • Earthbound (+15)
  • *
  • Posts: 17
    • View Profile
Re: Fieldscript - Finishing the unknown commands list
« Reply #2 on: October 13, 2024, 06:54:49 am »
My version of decompiler is hosted in mods and moogles discord. It contains the source code that lists all known and unknown opcodes so far.
« Last Edit: October 14, 2024, 07:05:26 am by F-man »