psx.wiki

Final Fantasy VII Field Script Debugger

Square's event script debugger, left switched off in the field module of Final Fantasy VII.

Final Fantasy VII Field Script Debugger
GameFinal Fantasy VII (USA), SCUS-94163
ModuleFIELD/FIELD.BIN

This is an old revision of this page, as edited by RemmyLee at 23:54, 1 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 a room's scripts. It draws text windows over the field screen that give the room's script author, the room name, Go, Stop and Step commands, the current actor with its position, and the script command that is running. The retail game keeps the code and its text but never draws the windows.12

Each script command handler calls a trace routine that names the command with its internal name, such as mes, mjump or kawai, and gives its argument bytes. The module's strings include "Authr", "Word:", "Actor:", "RqLv", "Actor OFF", "Bad Event code!" and "Bad Event arg!".12

Windows

The debugger has six text windows of 17Ah bytes each at 800E0748h. At each room load the setup routine at 800D7F9Ch opens windows 1, 3, 4 and 5 and fills window 5 with the author line, the room line and the Go, Stop, Step, Actor OFF and Info OFF rows. It then hides each window, and the draw routine skips a hidden window.2

Table 1: Debugger windows
Window Contents
1 Controller rows ("ctrl:"); no retail call fills it
3 "Word:" and the script command that is running
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 turns the debugger off in three places. The two enable flags at 8009D820h and 80071E24h are written only by the setup routine, which stores 0 to them at 800D8160h and 800D8158h. The window draw routine at 800D85FCh has no caller: no jal instruction, pointer or address load in FIELD.BIN or SCUS_941.63 names it. The per-frame call at 800BA7A8h is jal 800BC438h, which draws the field pointer instead.1

The state byte at 80099FFCh holds 3 while the scripts run and 4 when they stop. Value 5 is step mode: one script command runs per frame. The retail program never stores 5.2

Operation

The debugger appears when the frame call at 800BA7A8h is changed to jal 800D85FCh, the enable flags at 8009D820h and 80071E24h are set to 1, and the hide bytes of windows 1, 3, 4 and 5 at 800E0A3Ah, 800E0D2Eh, 800E0EA8h and 800E1022h are set to 0. A room load hides the windows again, and a return from battle loads FIELD.BIN again, so the changes are made again after each.2

On a SCPH-5501 on 31 October 2026, with these changes made in room MDS5_3, the screen showed AUTHR:AKIYAMA, EVENT:MDS5_3, the GO, STOP, STEP, ACTOR OFF and INFO OFF rows, ACTOR:FURYOB with its RQLV, MAN, DIR and X FE32 Y FF34 rows, and WORD:RET.3

The text draw routine at 800D9C04h draws at most 344 character sprites a frame, and the four windows together need about 400. In the StationX emulator with all four windows open, window 5 stopped partway through its author line. With the sprite buffer extended into the unused field pointer code, the four windows drew complete with 357 sprites.2

References


  1. ^ a b c Final Fantasy VII (USA) disc 1, SCUS-94163, read 1 November 2026: FIELD/FIELD.BIN unpacked to 800A0000h, and SCUS_941.63.

  2. ^ a b c d e f psx.wiki bench notes, Final Fantasy VII field module, 31 October and 1 November 2026.

  3. ^ psx.wiki bench, SCPH-5501, 31 October 2026, 16:26, room MDS5_3: photograph of the debugger windows on screen.

Categories: Final Fantasy VII