Usage

WHDLoad can be started from the command line (CLI/Shell) or from the Workbench. Options can specified in a global configuration file and via arguments or Tooltypes. The Slave option is usually required. Other options maybe necessary too, depending on your hardware and the program to execute within WHDLoad. When started from the command line WHDLoad exits with the follwing return codes:

Options and global configuration

There are local and global options. Local options are specified as arguments via the command line or as ToolTypes when started from the Workbench.
The global configuration file is "S:WHDLoad.prefs". It is a usual ASCII file and contains one option per line. Empty lines and comments are ignored. A comment is line based, starts with the character ";" and goes up to the end of line.
An example configuration file is contained in the WHDLoad package ("S/WHDLoad.prefs").

Overview

List of available options

Name of optionTypeLocalGlobalDefault value
BranchCacheswitcherx-
ButtonWaitswitcherxx
Cacheswitcherx-
Chkswitcherx-
ChkBltHogswitcherx-
ChkBltSizeswitcherx-
ChkBltWaitswitcherx-
ChkColBstswitcherx-
ChkCopConswitcherx-
ChkIntsswitcherx-
ChipNoCacheswitcherxx
CoreDumpswitcherx-
CoreDumpPathstring-xPROGDIR:
Customstringx-
Custom1numericalx-
Custom2numericalx-
Custom3numericalx-
Custom4numericalx-
Custom5numericalx-
Dswitcherx-
Datastringx--
DebugKeynumericalxx-
DCacheswitcherx-
ExecuteCleanupstring-x-
ExecuteStartupstring-x-
Expertswitcher-x
ExpChipswitcherx-
ExpLocalswitcherx-
Exp24Bitswitcherx-
FileLogswitcherx-
FreezeKeynumericalxx
MMUswitcherxx
NoAutoVecswitcherxx
NoCacheswitcherx-
NoFileCacheswitcherx-
NoFilterswitcherxx
NoFlushMemswitcherxx
NoMMUswitcherxx
NoReqswitcherxx
NoTrapHandlerswitcherx-
NoVBRMoveswitcherx-
NoWriteCacheswitcherxx
NTSCswitcherxx
PALswitcherxx
Preloadswitcherx-
QuitKeynumericalxx-
ReadDelaynumerical-x0
RestartKeynumericalxx-
ShowRegsstring-xSYS:Utilities/MultiView
Slavestringx-WHDLoad.Slave
Snoopswitcherx-
SnoopAGAswitcherx-
SnoopECSswitcherx-
SnoopOCSswitcherx-
SplashDelaynumericalxx200
StoreBufferswitcherx-
SuperScalarswitcherx-
TimeOutnumericalx-0
WriteDelaynumericalxx150

Types of options

numerical: the value of the option is an integer,
on the command line you must use decimal notation, as ToolType you can also use hexadecimal notation indicated by a leading "$"
string: the value of the option is a string
switcher: option will be enabled if specified (boolean)

Example

Workbench: Workbench Options
CLI or Shell: 1> WHDLoad SuperGame.Slave Preload NTSC QuitKey=69 Custom1=1

Description of each Option

ButtonWait/S

This option does not affect WHDLoad itself, but can be tested by the Slave.
The meaning of this option is that if set, the users wants the installed program to wait for pressing a button when it shows pictures and/or plays music and normally it does this only for a very limited time (due to HD/RAM loading compared to slow disk loading).

BranchCache/S

This option enables the branch cache of the 68060. On other CPU-types it has no effect.
The option has no effect if NoCache/S is also set.

Cache/S

This option enables the instruction cache and disables the data cache for the installed program. If the MMU is used by WHDLoad it marks the Chip-Memory as Cacheable Writethrough (impercise).
The option has no effect if NoCache/S is also set.

Chk/S

This option is a shortcut and enables the options ChkBltSize/S, ChkBltWait/S and ChkColBst/S.

ChkBltHog/S

This option checks that all the time the blthog (bltpri) bit in the custom.dmacon register is not set. That feature works only in conjuction with one of the SnoopOCS/SnoopECS/SnoopAGA options.

ChkBltSize/S

This option checks that the installed program correctly uses the blitter, so that only valid memory areas will be used for the blitter operations. That feature works only in conjunction with one of the SnoopOCS/SnoopECS/SnoopAGA options.

ChkBltWait/S

This option checks that the installed program correctly waits for the blitter finish before starting a new blitter job. That feature works only in conjunction with one of the SnoopOCS/SnoopECS/SnoopAGA options.

ChkColBst/S

This option checks that all the time the color bit in the custom.bplcon0 register is set. That feature works only in conjunction with one of the SnoopOCS/SnoopECS/SnoopAGA options.

ChkCopCon/S

This option checks that the installed program does not enable the copper access to DMA registers via setting custom.copcon. That feature works only in conjunction with one of the SnoopOCS/SnoopECS/SnoopAGA options.

ChkInts/S

This option checks on each interrupt occuring if there is a matching pair in intreq and intena set for this interrupt. If not the installed will be terminated with an appropriate error request. This feature allows the easy detection of interrupt acknowledge problems on faster machines (68040/060) or bad hardware which causes unwanted interrupts. Due the fact that the condition my also raise if the interrupts are disabled by setting intena at the same time an interrupt occurs this has been implemented as a switchable option.

ChipNoCache/S

This option disables the cachebility of the Chip-Memory (BaseMem). It should be used on hardware which does not allow the cachebility of Chip-Memory (e.g. BlizzardPPC boards) to avoid slowdowns in the execution speed of the installed program. See also CPU Cache Handling.

CoreDump/S

If selected, on every exit from an installed program, WHDLoad creates a memory and register dump. This may be useful to rip a music-module from the memory dump or for debugging.

CoreDumpPath

The destination directory for all dump files created by WHDLoad.

Custom/K, Custom1/K/N, Custom2/K/N, Custom3/K/N, Custom4/K/N, Custom5/K/N

These options are not used by WHDLoad itself, but can be tested by the Slave to control various Slave specific things. Custom/K can contain a string and Custom1-5/K can only hold an integer. Check the documentation of the specific install if it supports Custom options.

D/S

This option his useful for debugging. If the option is enabled and a supported software freezer (Hrt/TK) is found in memory, WHDLoad simulates an NMI before executing the first cpu instruction contained in the Slave.

Data/K

Using this option a directory can be specified which WHDLoad enters before it starts to load data for the installed program. This options overwrites the value ws_CurrentDir contained in the Slave.

DCache/S

This option enables the instruction and the data cache for the installed program. If the MMU is used by WHDLoad it marks the Chip-Memory as Cacheable Writethrough (impercise).
The option has no effect if NoCache/S is also set.

DebugKey/K/N

Sets the rawkey code to quit the program with debug (write coredump files and quit). This works only if the expert mode is active, if the VBR is moved by WHDLoad (NoVBRMove/S is not set and the cpu is at least a 68010) or the Slave itself supports it.

ExecuteCleanup

With this option a command can be specified which will executed by WHDLoad on exit.

ExecuteStartup

With this option a command can be specified which will executed by WHDLoad on startup. Can be used to disable hardware which makes problems in conjunction with WHDLoad, or to stop the TCP/IP stack or similar stuff.

Expert/S

This option enables the expert mode of WHDLoad. Currently it affects the DebugKey/S feature and warnings during the switch between installed program and OS (color cycle copper screens). If expert mode is not active DebugKey/S is not available. In expert mode also another button in some error requesters by WHDLoad appears. This button named Show Regs allows to display register and status informations similar as written to the register dump.

ExpChip/S, ExpLocal/S, Exp24Bit/S

If the installed program uses expansion memory (ws_ExpMem) these options can be used to force WHDLoad to allocate this memory respective in Chip Memory, Local Memory or 24BitDma Memory. This may result in a performance degration because the specified memory may be slower accessed by the CPU compared to the default Fast memory. You can use third party tools (e.g. SysInfo, GvpInfo,...) to check your memory configuration and see which memory has which properties.
In general these options are intended to fix compatibility problems of installed programs on fast machines by making them slower in execution due using slower memory.

FileLog/S

This option is only for debugging purposes. See Dumps and Logfiles for more info.

FreezeKey/K/N

If you are using one of the supported software freezers (HrtMon or Thrillkill) you can use this option to setup a rawkey code on which pressed WHDLoad will enter the freezer. For this to work, the VBR must be moved by WHDLoad (NoVBRMove/S must not be set and the cpu must be at least a 68010) and the freezer must be active.

MMU/S

This must be used on 68030 machines to get the MMU related features working (memory protection, improved cache managment, Snooping, resload_Protect#? functions). On 68040/060 this option has no effect because the MMU will be used by default. It is recommended to set this option in the global configuration file on all systems containing a 68030 with working MMU (i.e. not a 68ec030) because it increases stability and security a lot. If the option NoMMU/S is also set this option has no effect.

NoAutoVec/S

If selected WHDLoad will not quit if an unexpected autovector interrupt or NMI occurs (vectors #25-31 / $64-$7c). This should be used on systems/hardware which will create at random such interrupts to prevent WHDLoad from exiting (or better remove the broken hardware!).

NoCache/S

If selected all caches will be disabled.
This option overrides BranchCache/S, Cache/S, DCache/S, StoreBuffer/S and SuperScalar/S.

NoFileCache/S

Disables the file cache of WHDLoad and forces a switch to the OS for each disk operation of the installed program.
This option disables Preload/S.

NoFilter/S

Disables the audio filter. Note that this option only affects the initialisation at startup, if the installed program itself changes the state of the audio filter this option will be without effect.

NoFlushMem/S

Normally WHDLoad flushes the memory at startup to get as much free memory as possible for the Preload/S operation. That will remove all unused ressources like libraries, fonts etc. from memory. Using this option WHDLoad will not flush the memory. It may be used on systems with much free memory to improve system performance.

NoReq/S

This option can only be used when WHDLoad has been started from the command line (CLI/Shell). Started from the Workbench it has no effect. The option forces WHDLoad to not show any requesters in a new, seperate window but output messages to the command window WHDLoad has been started from.

NoMMU/S

If this option is set WHDLoad will not use the MMU. This is a critical and dangerous option recommended only for testing or debugging and not for normal use. See chapter MMU for more info. The option overides MMU/S.

NoTrapHandler/S

If this option is enabled WHDLoad will use the original vector table from the OS which is active on starting WHDLoad. On startup WHDLoad will copy the system vector table instead of creating its own. This will only be useful for debugging purposes and should not be used for normal operation. Warning: if an exception handler called through the original vector table tries to call any OS function or tries to use OS data structures the machine will crash (e.g. exec.Alert).

NoVBRMove/S

By default WHDLoad moves the vector table using the VBR (Vector base Register) to a different memory location from $0. This has the advantage that the installed program cannot change the vector table, which increases security and stability of WHDLoad greatly. Some installed programs/slaves will not correctly work with a moved VBR. The reason for this is that the installed program may do some strange stuff which is not supported by a moved VBR or the author of the install was too lame to support a moved VBR. In such a case, this option must be set to prevent WHDLoad from moving the VBR.
Another feature of the moved VBR is that WHDLoad can check the keyboard each time an Autovector interrupt occurs. With this check WHDLoad is able to terminate the installed program independently from the work of installed program/slave if QuitKey/S or DebugKey/S is pressed (similarly the installed program can be interrupted when FreezeKey/S is pressed).
The VBR moving feature requires at least a 68010 to work. On a 68000 this option has no effect, because the VBR is always at $0 and cannot be moved.

NoWriteCache/S

This option disables the disk write cache feature of WHDLoad. Without this option WHDLoad will try to cache all write operations in memory and defer them until program exit to avoid unnecessary switches to the operating system.

NTSC/S

If selected, WHDLoad will use an NTSC display (60Hz) for the installed program. On a PAL Amiga, the NTSC monitor driver must be installed in "DEVS:Monitors/".

PAL/S

If selected, WHDLoad will use a PAL display (50Hz) for the installed program. On an NTSC Amiga, the PAL monitor driver must be installed in "DEVS:Monitors/".

Preload/S

If this option is enabled, WHDLoad will load as many files and disk images as possible into memory (depending on how much memory is free) at startup. This increases performance when the installed program is running, because it avoids switching to the OS to load data directly from the harddisk. This option should always be enabled.

QuitKey/K/N

Sets the rawkey code to quit the program, this works only if the VBR is moved by WHDLoad (NoVBRMove/S must not be set and the cpu must be at least a 68010) or the slave itself does support it.

ReadDelay/K/N

This option specifies the time in 1/50ths of a second that WHDLoad will wait after it has loaded data from disks, and will also wait this time after Preload has finished. This solves problems with drives (e.g. CD drives) which want do something after reading (e.g. switching the motor off).

RestartKey/K/N

Using this option you can setup a rawkey code on which pressed WHDLoad will restart the installed program.

ShowRegs/K/N

This option is only useful in conjunction with the option Expert/S. With this option the program can be specified which will be used by WHDLoad to display the register dump if the Show Regs button in an error requester by WHDLoad will be pressed. WHDLoad will append the filename of the temporarly saved file (currently T:.whdl_register) onto the specified command string.

Slave

Name of the slave which should be used by WHDLoad. The slave contains the interface code which is required for communication between the installed program and WHDLoad.

Snoop/S, SnoopAGA/S, SnoopECS/S, SnoopOCS/S

These options enables the Cia/Custom register snoop feature of WHDLoad.

SplashDelay/K/N

This option specifies the time in 1/50 seconds that WHDLoad shows the information window at startup. If SplashDelay/K/N is lower than ReadDelay/K/N it is ignored and the window is displayed using the time from ReadDelay/K/N. The window is displayed at least as long as Preload/S is working.
If the option is set to 0 no window will be displayed.

StoreBuffer/S

This option enables the Store Buffer of the 68060. On other CPU-types it has no effect.
The option has no effect if NoCache/S is also set.

SuperScalar/S

This option enables the ability of the 68060 to execute multiple instructions per machine cycle. On other CPU-types it has no effect.
The option has no effect if NoCache/S is also set.

TimeOut/K/N

If set lets WHDLoad and the installed program quit after the specified time. Requires that option NoVBRMove/S is not set and that the installed program does not modify the ciaa.ciatod timer. The time after to quit is specified in 1/50ths of a second. To measure that time for a demo or game enable option Expert/S and set a DebugKey/K/N, when the point you want to the quit the program is reached press the debug key. Now look into the created .whdl-register file and search the ciaa-event value. If your Power Supply Frequency is 50 Hz then it's the value you have to set with TimeOut/K/N, if the Frequency is 60 Hz you have to multiply the value with 5/6.

WriteDelay/K/N

This option specifies the time in 1/50 seconds that WHDLoad will wait after writing anything physically to disk. It affects all resload_Save#? functions and the FileLog/S feature. This makes sense because filesystems will not usually write data immedately to disk. It takes some time (1..3 sec) until all structures of the filesystem have been successfully updated. The default value for WriteDelay is 150 which lets WHDLoad wait 3 seconds after each write to the harddisk. You can set this value to 0, but then you should never exit by a reset from the installed program because saved data may not be written correctly to disk.