Node:Debug switches, Next:, Previous:Enhanced Keyboard Mapping, Up:Additional Reading



4.7 Debug switches

Debug switches are not useful for most people, but they can sometimes help fixing odd problems in the patch. They are mostly intended to be used by developers when testing the patch.

To use them, they must be the first switch on TTDPatch's command line, and start with an exclamation mark, "!". After the exclamation mark follows the list of debug switches, each of them possibly trailed by a "+" or "-" to choose two different modes of operation. Currently if neither "+" nor "-" is specified, "+" is assumed. An example:

ttdpatch.exe -!v+T+w-

This would run TTDPatch to collect new version information and terminate before even starting TTD. If any warnings occur, they are ignored.

Here's the complete list of debug switches:

Switch Meaning
v- Ignore TTD version info stored with TTDPatch (i.e. do not recognize TTD version)
v+ Collect TTD version info and write to a file
s- Never swap out the real mode code when starting TTD (DOS only)
s+ Always swap out the real mode code when starting TTD (DOS only)
c This switch is very special: if specified, TTDPatch will not process the command line options as usual, instead it will treat the rest of the command line as name and arguments of a program to run. This feature can be used to analyze TTDPatch's memory usage in the DOS version.
t- Assume TTDLOAD(W).OVL exists and is correct, don't process it or try to locate the original files. Currently this is useful only if combined with the c debug switch, otherwise it'll prevent TTDPatch from working and may cause a crash.
m- Run even if there's not enough memory to start TTD (DOS only)
f- Don't read or create the default ttdpatch.cfg
a- Don't check dependencies between switches. If used, TTDPatch will not correct illegal combinations of switches. Warning: some switch combinations are dangerous. For example, if startyear is set to 1927 and generalfixes to off, TTD will probably hang when you try to start a new random game. Normally, i.e. without this debug switch, TTDPatch would prevent that by turning generalfixes on. See New Starting Year for more information.
w- Do not wait for a key after a warning message, just continue
w+ Do not wait for a key after a warning message, just abort
o+ Reorder switches alphabetically when writing a configuration file
T+ Terminate TTD immediately after collecting version information (see v+)
L+ Load language data from the file named language.dat instead of the TTDPatch executable. Useful in debugging because many debuggers fail to load symbol information with those data appended to the executable.
C+ Load patch code from ttdprotd.bin for DOS or ttdprotw.bin for Windows. Useful in debugging because many debuggers fail to load symbol information with that code appended to the executable.
I- Prevent the enhanced keyboard handler from updating keyboard LED indicators. The Lock keys will still toggle internal flags, though. (DOS only)
S+ Dump information about all supported switches (non-debug, non-special ones) to swtchlst.txt and abort