Final Fantasy VII Field Script Debugger
Square's event script debugger, left switched off in the field module of Final Fantasy VII.
| Game | Final Fantasy VII (USA), SCUS-94163 |
|---|---|
| Module | FIELD/FIELD.BIN |
This is an old revision of this page, as edited by RemmyLee at 00:33, 2 November 2026. Edit this revision | Latest revision
Overview
The field module of Final Fantasy VII, FIELD/FIELD.BIN, contains the event debugger that Square used to follow the scripts of a room while they run. The debugger draws text windows over the field screen that show the script author and the name of the room, the Go, Stop and Step commands, the current actor and its position, and the script command being executed. In the retail game the code and its text remain in the module; however, the windows are never drawn.12
Every script command handler calls a trace routine, which reports the internal name of the command and its argument bytes. The internal names are short words such as mes, mjump and kawai. The module also holds the labels and error messages of the debugger, among them "Authr", "Word:", "Actor:", "RqLv", "Actor OFF", "Bad Event code!" and "Bad Event arg!".12
Windows
The debugger uses six text windows, which are records of 17Ah bytes each in a table at 800E0748h. When a room is loaded, the setup routine at 800D7F9Ch opens windows 1, 3, 4 and 5 and writes the author line, the room line and the Go, Stop, Step, Actor OFF and Info OFF rows into window 5. The same routine then marks each window as hidden, and because the draw routine skips any hidden window, nothing appears on the screen. The contents of each window are shown below.2
| Window | Contents |
|---|---|
| 1 | Controller rows ("ctrl:"); no retail call fills it |
| 3 | "Word:" and the script command being executed |
| 4 | "Actor:", the entity, RqLv, its script line and its position |
| 5 | "Authr:" and the script author, "Event:" and the room name, Go, Stop, Step, Actor OFF, Info OFF |
Switches
The retail program disables the debugger in three ways. The enable flags at 8009D820h and 80071E24h are written only by the room setup routine, which stores 0 to them at 800D8160h and 800D8158h. The window draw routine at 800D85FCh is never called, since no jal instruction, pointer or address load in FIELD.BIN or SCUS_941.63 refers to it. Finally, the room setup routine hides each window that it opens.12
A state byte at 80099FFCh controls script execution: 3 means that the scripts run and 4 means that they are stopped. A value of 5 selects step mode, in which one script command is executed per frame; however, the retail program stores only 3 and 4 to this byte, so step mode is never entered.2
Operation
The debugger can be shown by making three changes in memory while the field module runs. The per-frame call at 800BA7A8h is changed from jal 800BC438h to jal 800D85FCh so that the windows are drawn every frame, the enable flags at 8009D820h and 80071E24h are set to 1, and the hide bytes of windows 1, 3, 4 and 5 (800E0A3Ah, 800E0D2Eh, 800E0EA8h and 800E1022h) are set to 0. Because each room load hides the windows again, and each return from battle reloads FIELD.BIN with the original call, the changes must be repeated after either event.12
These changes were made on a SCPH-5501 on 31 October 2026 in room MDS5_3. The screen then showed AUTHR:AKIYAMA and EVENT:MDS5_3 in window 5 with the GO, STOP, STEP, ACTOR OFF and INFO OFF rows below them. Window 4 showed ACTOR:FURYOB with its RQLV, MAN, DIR and position rows (X FE32, Y FF34), and window 3 showed WORD:RET.3
The text draw routine at 800D9C04h draws at most 344 character sprites in one frame, whereas the four windows together need about 400. Consequently, when all four windows are open, the text is cut off: in the StationX emulator, window 5 stopped partway through its author line. When the sprite buffer was extended into the unused field pointer code, all four windows were drawn in full with 357 sprites.2
References
-
^ a b c d Final Fantasy VII (USA) disc 1, SCUS-94163, read 1 November 2026: FIELD/FIELD.BIN unpacked to 800A0000h, and SCUS_941.63.
-
^ a b c d e f g psx.wiki bench notes, Final Fantasy VII field module, 31 October and 1 November 2026.
-
^ psx.wiki bench, SCPH-5501, 31 October 2026, 16:26, room MDS5_3: photograph of the debugger windows on screen.