The Command Editor lets you edit the DVD’s commands. It is composed of several parts (2 examples are shown below).
At the top are the command selection menus. The first three menus present the complete list of all the commands, sorted differently in each of these menus. The fourth menu shows only Jumps and Calls, sorted according to the type of source and destination PGCs. It enables you to easily select the legal Jump or Call in all situations. The commands that would be illegal given the source PGC are greyed out. Use the scratchbook if you wish to experiment with all commands without restriction.
Below the menus is a field containing the hexadecimal representation of the command, the validation menu button (see below) and the name of the current command. If you wish, you may click on the name of the command to find out more about it, its usage, legal syntax etc (Windows users only). This involves a call to the Internet.
Below this is a field showing the “disassembled” current command, with the syntax that is used for the commands displayed in the list of the main window.
Note: You can right click on any GPRM or SPRM button to bring up the Info dialogue for GPRMs / SPRMs (same as Info → GPRMs / SPRMs).
You may modify the command in the interface below the disassembled command. This interface is different for each command and, if you use this, you will only be allowed to input a legal value for each command. This is the easiest way to edit a command.
The numerical fields of this part of the interface accept values in decimal, hexadecimal (by prefixing them by “0x”), octal (prefixed by “0”) or ASCII (prefixed by ’, the single quote character, aka apostrophe). Between parentheses, on the right side of these numerical fields, is the legal range of the parameter. If you wish, click the “B” when you want to set/compare button numbers.
In theory, you will not be able to enter an illegal value. (However, to be able to type a value in hexadecimal or octal, you must be able to type a zero alone, even if this value is illegal. In that case, the program beeps, and the disassembled command is highlighted in colour). Note that only theoretical errors are detected: it is thus possible to type legal, but meaningless values. For example, a Jump to VTS 99 is legal, and will be accepted, but it makes sense only if VTS 99 exists.
Advanced users – Test your changes with validation
In normal use, the hexadecimal field is updated automatically when you change the command, and when you modify the values of the current command.
It is also possible (although less easy) to type the command directly into the hexadecimal field. When this field is manually edited, the modifications are not automatically updated in the other parts of the interface. To force the update of the command, you must validate the contents of the hexadecimal field. To do that, just type Enter/Return in this field. At the time of validation, the contents of the hexadecimal field are analysed and transcribed in the other parts of the interface. If an error is detected, two things can happen:
a. If the resulting command does not exist, an error message pops up, and the cursor is positioned on the digit which caused the error.
b. If a value is illegal or out of range, it is corrected in the hexadecimal field, and this value is highlighted in colour, so you can easily locate the errors. In this case, you can revert to the contents of the field before validation by selecting the Undo Validation option on the Validation menu, or you can erase the highlights with Clear Validation Highlights.
Of course, if things go really bad, simply click Cancel and start again.
The Disassemble Without Validate option lets you visualize the disassembled command without correcting the possible value errors, and without transferring the values in the interactive part of the interface. This lets you check that the command is complete and coherent before validating it.
The menu button next to the hex field also contains options to copy and paste the contents of the field. Copy as Hex String and Copy as Binary are options allowing you to exchange the command with another program. The simple Copy option is used internally by PgcEdit.