--- hatari/doc/manual.html 2019/04/09 08:52:20 1.1.1.16 +++ hatari/doc/manual.html 2019/04/09 08:53:37 1.1.1.17 @@ -1,15 +1,13 @@ - +
-Version 1.6.2 +Version 1.7, June 2013
Manual written by: Thomas Huth, Matthias Arndt & Eero Tamminen
-Hatari on the WWW: http://hatari.tuxfamily.org/ +Hatari on the WWW: + +http://hatari.tuxfamily.org/ +
-Hatari is an Atari ST, STE, TT and Falcon emulator for Linux, OSX, Windows and other Systems which are supported by the SDL library. @@ -173,7 +107,7 @@ and demos. Of course you can run normal Recent versions of Hatari even feature STE, Falcon and basic TT emulation.
-There is support for following additional STE features:
There is support for following additional TT features:
There is support for following additional Falcon features:
Hatari currently has the following minimum system requirements:
Required:
Before you can start Hatari, you have to copy a TOS ROM image to the data @@ -381,7 +312,7 @@ more details), but it's free and compati find a suitable TOS image in the default dir, you'll get the chance to select a TOS image file from the GUI.
-Type make install as "root" user to do a systemwide installation.
@@ -392,7 +323,7 @@ be now able to start the Hatari executab option --help to find out more about its command line parameters. -Now type hatari to run the emulator for the first time. If all goes @@ -403,8 +334,28 @@ to turn on the GUI to configure Hatari to suit your needs, press F11 to toggle windowed and fullscreen mode.
-Hatari settings can come from several sources, with later ones +overriding the earlier given ones: +
Some of the run-time changes require emulation to be reseted for them +to take effect.
+ + +Usage:
@@ -433,1310 +384,437 @@ corresponds to A: or C:). -General options
-
| - | --h, --help | -
| - | -Print command line options and terminate - | -
| - | --v, --version | -
| - | -Print version information and terminate - | -
| - | ---confirm-quit <bool> | -
| - | -Whether Hatari confirms quitting - | -
| - | --c, --configfile -<filename> | -
| - | -use the given file as configuration file instead of -~/.hatari/hatari.cfg - | -
| - | --k, --keymap -<file> | -
| - | -load keyboard mapping from <file> - | -
−h, +−−help
+Print command line options and +terminate
+−v, +−−version
+Print version information and +terminate
+−−confirm-quit +<bool>
+Whether Hatari confirms quitting
+−c, −−configfile +<filename>
+Read additional configuration values from +<file>, these override values read from the global and +user configuration files +
+−k, −−keymap +<file>
+load keyboard mapping from +<file>
+−−fast-forward +<bool>
+On fast machine helps skipping (fast +forwarding) Hatari output
-| - | --m, --mono | -
| - | -Start in monochrome mode instead of color - | -
| - | ---monitor <x> | -
| - | -Select monitor type (x = mono/rgb/vga/tv) - | -
| - | --f, --fullscreen | -
| - | -Start the emulator in fullscreen mode - | -
| - | --w, --window | -
| - | -Start the emulator in window mode - | -
| - | ---grab | -
| - | -Grab mouse (also) in window mode - | -
| - | ---fast-forward <bool> | -
| - | -On fast machine helps skipping (fast forwarding) Hatari -output - | -
| - | ---frameskips <x> | -
| - | -Skip <x> frames after each displayed frame to -accelerate emulation (0=disabled, >4 uses automatic -frameskip with given value as maximum) - | -
| - | ---statusbar <bool> | -
| - | -Show statusbar (with floppy leds etc etc) - | -
| - | ---drive-led <bool> | -
| - | -Show overlay drive led when statusbar isn’t shown - | -
| - | ---bpp <bool> | -
| - | -Force internal bitdepth (x = 8/15/16/32, 0=disable) - | -
−m, +−−mono
+Start in monochrome mode instead of +color
+−−monitor +<x>
+Select monitor type (x = +mono/rgb/vga/tv)
+−f, +−−fullscreen
+Start the emulator in fullscreen +mode
+−w, +−−window
+Start the emulator in window mode
+−−grab
+Grab mouse (also) in window mode
+−−frameskips +<x>
+Skip <x> frames after each +displayed frame to accelerate emulation (0=disabled, >4 uses +automatic frameskip with given value as maximum)
+−−statusbar +<bool>
+Show statusbar (with floppy leds etc +etc)
+−−drive-led +<bool>
+Show overlay drive led when statusbar +isn’t shown
+−−bpp +<bool>
+Force internal bitdepth (x = +8/15/16/32, 0=disable)
-| - | ---borders <bool> | -
| - | -Show screen borders (for low/med resolution overscan demos) - | -
| - | ---desktop-st <bool> | -
| - | -Whether fullscreen mode uses desktop resolution to avoid: messing -multi-screen setups, several seconds delay needed by LCD monitors -resolution switching and the resulting sound break. As Hatari ST/E -display code doesn't support zooming (except low-rez doubling), it -doesn't get scaled (by Hatari or monitor) when this is enabled. -Therefore this is mainly useful only if you suffer from the described -effects, but still want to grab mouse and remove other distractions -from the screen just by toggling fullscreen mode. (disabled by default) - | -
| - | ---spec512 <x> | -
| - | -Hatari uses this threshold to decide when to render a -screen with the slower but more accurate Spectrum512 screen -conversion functions (0 <= x <= 512, 0=disable) - | -
| - | --z, --zoom <x> | -
| - | -Zoom low resolution (1=no, 2=yes) - | -
+−−borders <bool>
+Show ST/STE screen borders (for low/med +resolution overscan demos)
+−−desktop-st +<bool>
+Whether fullscreen mode uses desktop +resolution to avoid: messing multi-screen setups, several seconds +delay needed by LCD monitors resolution switching and the resulting +sound break. As Hatari ST/E display code doesn’t support +zooming (except low-rez doubling), it doesn’t get scaled (by +Hatari or monitor) when this is enabled. Therefore this is mainly +useful only if you suffer from the described effects, but still +want to grab mouse and remove other distractions from the screen +just by toggling fullscreen mode. (disabled by default)
+−−spec512 +<x>
+Hatari uses this threshold to decide +when to render a screen with the slower but more accurate +Spectrum512 screen conversion functions (0 <= x <= 512, +0=disable)
+−z, −−zoom +<x>
+Zoom (double) low resolution (1=no, +2=yes)
--Zooming to sizes specified below is internally done using integer -scaling factors. This means that different Atari resolutions may show -up with different sizes, but they are never blurry. -
-| - | ---desktop <bool> | -
| - | -Whether to use desktop resolution on fullscreen to avoid issues -related to resolution switching. Otherwise fullscreen will use -a resolution that is closest to the Hatari window size. -(enabled by default) - | -
| - | ---max-width <x> | -
| - | -Maximum window width for zooming - | -
| - | ---max-height <x> | -
| - | -Maximum window height for zooming - | -
| - | ---force-max <bool> | -
| - | -Hatari window size is forced to specified maximum size and black borders -used when Atari resolution doesn't scale evenly to it. This is most -useful when recording videos of Falcon demos that change their -resolution. (disabled by default) - | -
| - | ---aspect <bool> | -
| - | -Whether to do monitor aspect ratio correction (enabled by default) - | -
Zooming to sizes
+specified below is internally done using integer scaling factors.
+This means that different Atari resolutions may show up with
+different sizes, but they are never blurry.
+−−desktop <bool>
Whether to use desktop resolution on +fullscreen to avoid issues related to resolution switching. +Otherwise fullscreen will use a resolution that is closest to the +Hatari window size. (enabled by default)
+−−max-width +<x>
+Preferred / maximum window width
+−−max-height +<x>
+Preferred / maximum window height
+−−force-max +<bool>
+Hatari window size is forced to +specified maximum size and black borders used when Atari resolution +doesn’t scale evenly to it. This is most useful when +recording videos of Falcon demos that change their resolution. +(disabled by default)
+−−aspect +<bool>
+Whether to do monitor aspect ratio +correction (enabled by default)
-| - | ---vdi <bool> | -
| - | -Whether to use VDI screen mode - | -
| - | ---vdi-planes <x> | -
| - | -Use extended VDI resolution with bit depth <x> (x = 1, 2 or 4) - | -
| - | ---vdi-width <w> | -
| - | -Use extended VDI resolution with width <w> (320 < w <= 1280) - | -
| - | ---vdi-height <h> | -
| - | -Use extended VDI resolution with height <h> (200 < h <= 960) - | -
−−vdi +<bool>
+Whether to use VDI screen mode
+−−vdi−planes +<x>
+Use extended VDI resolution with bit +depth <x> (x = 1, 2 or 4)
+−−vdi−width +<w>
+Use extended VDI resolution with width +<w> (320 < w <= 1280)
+−−vdi−height +<h>
+Use extended VDI resolution with height +<h> (200 < h <= 960)
-| - | ---crop <bool> | -
| - | -Remove statusbar from the screen captures - | -
| - | ---avirecord | -
| - | -Start AVI recording - | -
| - | ---avi-vcodec <x> | -
| - | -Select avi video codec (x = bmp/png) - | -
| - | ---avi-fps <x> | -
| - | -Force avi frame rate (x = 50/60/71/...) - | -
| - | ---avi-file <file> | -
| - | -Use <file> to record avi - | -
−−crop +<bool>
+Remove statusbar from the screen +captures
+−−avirecord
+Start AVI recording
+−−avi-vcodec +<x>
+Select avi video codec (x = +bmp/png)
+−−avi-fps +<x>
+Force avi frame rate (x = +50/60/71/...)
+−−avi-file +<file>
+Use <file> to record avi
-| - | --j, --joystick -<port> | -
| - | -Emulate joystick with cursor keys in given port (0-5) - | -
| - | ---joy<port> -<type> | -
| - | -Set joystick type (none/keys/real) for given port - | -
| - | ---printer <file> | -
| - | -Enable printer support and write data to <file> - | -
| - | ---midi-in <filename> | -
| - | -Enable MIDI support and write MIDI data to <file> - | -
| - | ---midi-out <filename> | -
| - | -Enable MIDI support and read MIDI data from <file> - | -
| - | ---rs232-in <filename> | -
| - | -Enable serial port support and use <file> as the input device - | -
| - | ---rs232-out <filename> | -
| - | -Enable serial port support and use <file> as the output device - | -
−j, +−−joystick <port>
+Emulate joystick with cursor keys in +given port (0-5)
+−−joy<port> +<type>
+Set joystick type (none/keys/real) for +given port
+−−printer +<file>
+Enable printer support and write data +to <file>
+−−midi-in +<filename>
+Enable MIDI support and write MIDI data +to <file>
+−−midi-out +<filename>
+Enable MIDI support and read MIDI data +from <file>
+−−rs232-in +<filename>
+Enable serial port support and use +<file> as the input device
+−−rs232-out +<filename>
+Enable serial port support and use +<file> as the output device
-| - | ---disk-a <file> | -
| - | -Set disk image for floppy drive A - | -
| - | ---disk-b <file> | -
| - | -Set disk image for floppy drive B - | -
| - | ---protect-floppy <x> | -
| - | -Write protect floppy image contents (on/off/auto). With "auto" option -write protection is according to the disk image file attributes. - | -
| - | ---protect-hd <x> | -
| - | -Write protect harddrive <dir> contents (on/off/auto). With "auto" -option the protection can be controlled by setting individual files -attributes as it disables the file attribute modifications for -the GEMDOS hard disk emulation. - | -
| - | --d, --harddrive <dir> | -
| - | -Emulate harddrive partition(s) with <dir> contents - | -
| - | ---acsi <file> | -
| - | -Emulate an ACSI hard disk with an image <file> - | -
| - | ---ide-master <file> | -
| - | -Emulate an IDE master hard disk with an image <file> - | -
| - | ---ide-slave <file> | -
| - | -Emulate an IDE slave hard disk with an image <file> - | -
| - | ---fastfdc <bool> | -
| - | -speed up FDC emulation (can cause incompatibilities) - | -
−−disk-a +<file>
+Set disk image for floppy drive A
+−−disk-b +<file>
+Set disk image for floppy drive B
+−−protect-floppy +<x>
+Write protect floppy image contents +(on/off/auto). With "auto" option write protection is according to +the disk image file attributes.
+−−protect-hd +<x>
+Write protect harddrive <dir> +contents (on/off/auto). With "auto" option the protection can be +controlled by setting individual files attributes as it disables +the file attribute modifications for the GEMDOS hard disk +emulation.
+−−gemdos-case <x>
+Specify whether new dir/filenames are forced to be +in upper or lower case with the GEMDOS HD emulation. Off by default. +
+−d, −−harddrive +<dir>
+Emulate harddrive partition(s) with +<dir> contents. If directory contains only single letter +(C-Z) subdirectories, each of these subdirectories will be treated +as a separate partition, otherwise the given directory itself will +be assigned to drive "C:". In the multiple partition case, the +letters used as the subdirectory names will determine to which +drives/partitions they’re assigned.
+−−acsi +<file>
+Emulate an ACSI hard disk with an image +<file>
+−−ide−master +<file>
+Emulate an IDE master hard disk with an +image <file>
+−−ide−slave +<file>
+Emulate an IDE slave hard disk with an +image <file>
+−−fastfdc +<bool>
+speed up FDC emulation (can cause +incompatibilities)
-| - | --s, --memsize <x> | -
| - | -Set amount of emulated RAM, x = 1 to 14 MiB, or 0 for 512 -KiB - | -
| - | ---memstate <file> | -
| - | -Load memory snap-shot <file> - | -
+−−memstate <file>
+Load memory snap-shot <file>
+−s, −−memsize +<x>
+Set amount of emulated RAM, x = 1 to 14 +MiB, or 0 for 512 KiB
-| - | --t, --tos -<imagefile> | -
| - | -Specify TOS ROM image to use - | -
| - | ---patch-tos -<bool> | -
| - | -Use this option to enable/disable TOS ROM patching. Experts only! Leave -this enabled unless you know what you are doing! - | -
| - | ---cartridge <imagefile> | -
| - | -Use ROM cartridge image <file> (only works if -GEMDOS HD emulation and extended VDI resolution are -disabled) - | -
−t, +−−tos <imagefile>
+Specify TOS ROM image to use
+−−patch-tos +<bool>
+Use this option to enable/disable TOS +ROM patching. Experts only! Leave this enabled unless you know what +you are doing!
+−−cartridge +<imagefile>
+Use ROM cartridge image <file> +(only works if GEMDOS HD emulation and extended VDI resolution are +disabled)
-| - | ---cpulevel <x> | -
| - | -Specify CPU (680x0) to use (use x >= 1 with EmuTOS or -TOS >= 2.06 only!) - | -
| - | ---cpuclock <x> | -
| - | -Set the CPU clock (8, 16 or 32 Mhz) - | -
| - | ---compatible <bool> | -
| - | -Use a more compatible but slower 68000 CPU mode - | -
+−−cpulevel <x>
+Specify CPU (680x0) to use (use x >= +1 with EmuTOS or TOS >= 2.06 only!)
+−−cpuclock +<x>
+Set the CPU clock (8, 16 or 32 Mhz)
+−−compatible +<bool>
+Use a more compatible, but slower 68000 +CPU mode with better prefetch accuracy and cycle counting
-| - | ---machine <x> | -
| - | -Select machine type (x = st, ste, tt or falcon) - | -
| - | ---blitter <bool> | -
| - | -Enable blitter emulation (ST only) - | -
| - | ---dsp <x> | -
| - | -Falcon DSP emulation (x = none, dummy or emu, Falcon only) - | -
| - | ---timer-d <bool> | -
| - | -Patch redundantly high Timer-D frequency set by TOS. This about doubles -Hatari speed (for ST/e emulation) as the original Timer-D frequency causes -most of the interrupts. - | -
| - | ---fast-boot <bool> | -
| - | -Patch TOS and initialize the so-called "memvalid" system variables to -by-pass the memory test of TOS, so that the system boots faster. - | -
| - | ---rtc <bool> | -
| - | -Enable real-time clock - | -
+−−machine <x>
+Select machine type (x = st, ste, tt or +falcon)
+−−blitter +<bool>
+Enable blitter emulation (ST only)
+−−dsp <x>
+Falcon DSP emulation (x = none, dummy +or emu, Falcon only)
+−−timer-d +<bool>
+Patch redundantly high Timer-D +frequency set by TOS. This about doubles Hatari speed (for ST/e +emulation) as the original Timer-D frequency causes most of the +interrupts.
+−−fast-boot +<bool>
+Patch TOS and initialize the so-called +"memvalid" system variables to by-pass the memory test of TOS, so +that the system boots faster.
+−−rtc +<bool>
+Enable real-time clock
-| - | ---mic <bool> | -
| - | -Enable/disable (Falcon only) microphone - | -
| - | ---sound <x> | -
| - | -Sound frequency: 6000-50066. "off" disables the sound and speeds up -the emulation. To prevent extra sound artifacts, the frequency should be -selected so that it either matches evenly with the STE/TT/Falcon sound -DMA (6258, 12517, 250033, 50066 Hz) or your sound card frequencies -(11025, 22050, 44100 or 6000...48000 Hz). Check what your sound card -supports. - | -
| - | ---sound-buffer-size <x> | -
| - | -SDL's sound buffer size : 10-100, or 0 to use default buffer size. -By default Hatari uses an SDL buffer size of 1024 samples, which -gives approximatively 20-30 ms of sound depending on the chosen sound -frequency. Under some OS or with not fully supported sound card, this -default setting can cause a bigger delay at lower frequency (nearly 0.5 sec). -In that case, you can use this option to force the size of the sound -buffer to a fixed number of milliseconds of sound (using 20 is often -a good choice if you have such problems). Most users will not need this option. - | -
| - | ---sound-sync <bool> | -
| - |
-The emulation rate is nudged by +100 or 0 or -100 micro-seconds on occasion.
-This prevents the sound buffer from overflowing (long latency and
-lost samples) or underflowing (short latency and repeated samples).
-The emulation rate smoothly deviates by a maximum of 0.58% until
-synchronized, while the emulator continuously generates every sound
-sample and the crystal controlled sound system consumes every sample.
- (on|off, off is the default) - |
-
| - | ---ym-mixing <x> | -
| - | -Select a method for mixing the three YM2149 voice volumes together. -"model" uses a mathematical model of the YM voices, -"table" uses a lookup table of audio output voltage values measured -on STF and "linear" just averages the 3 YM voices. - | -
−−mic +<bool>
+Enable/disable (Falcon only) +microphone
+−−sound +<x>
+Sound frequency: 6000-50066. "off" +disables the sound and speeds up the emulation. To prevent extra +sound artifacts, the frequency should be selected so that it either +matches evenly with the STE/TT/Falcon sound DMA (6258, 12517, +250033, 50066 Hz) or your sound card frequencies (11025, 22050, +44100 or 6000...48000 Hz). Check what your sound card supports.
+−−sound-buffer-size +<x>
+SDL’s sound buffer size: 10-100, +or 0 to use default buffer size. By default Hatari uses an SDL +buffer size of 1024 samples, which gives approximatively 20-30 ms +of sound depending on the chosen sound frequency. Under some OS or +with not fully supported sound card, this default setting can cause +a bigger delay at lower frequency (nearly 0.5 sec). In that case, +you can use this option to force the size of the sound buffer to a +fixed number of milliseconds of sound (using 20 is often a good +choice if you have such problems). Most users will not need this +option.
+−−sound-sync +<bool>
+The emulation rate is nudged by +100 or
+0 or -100 micro-seconds on occasion. This prevents the sound buffer
+from overflowing (long latency and lost samples) or underflowing
+(short latency and repeated samples). The emulation rate smoothly
+deviates by a maximum of 0.58% until synchronized, while the
+emulator continuously generates every sound sample and the crystal
+controlled sound system consumes every sample.
+(on|off, off=default)
−−ym-mixing +<x>
+Select a method for mixing the three +YM2149 voice volumes together. "model" uses a mathematical model of +the YM voices, "table" uses a lookup table of audio output voltage +values measured on STF and "linear" just averages the 3 YM +voices.
-| - | --D, --debug | -
| - | -Toggle whether CPU exceptions invoke the debugger - | -
| - | ---bios-intercept | -
| - | -Toggle Bios/XBios call interception and BIOS CON: output -(e.g. EmuTOS console) redidirection to host terminal. -Needed for Bios/XBios call tracing. Allows Atari programs -to modify Hatari state through XBios 255 calls. - | -
| - | ---trace <trace1,...> | -
| - | -Activate debug traces, see --trace help for available tracing options - | -
| - | ---trace-file <file> | -
| - | -Save trace output to <file> (default=stderr) - | -
| - | ---parse <file> | -
| - | -Parse/execute debugger commands from <file> - | -
| - | ---control-socket <file> | -
| - | -Hatari reads options from given socket at run-time - | -
| - | ---log-file <file> | -
| - | -Save log output to <file> (default=stderr) - | -
| - | ---log-level <x> | -
| - | -Log output level (x=debug/todo/info/warn/error/fatal) - | -
| - | ---alert-level <x> | -
| - | -Show dialog for log messages above given level - | -
| - | ---run-vbls <x> | -
| - | -Exit after X VBLs - | -
−D, +−−debug
+Toggle whether CPU exceptions invoke +the debugger
+−−bios-intercept
+Toggle Bios/XBios call interception needed for +Bios/XBios call tracing. Allows Atari programs to modify Hatari state +through XBios 255 calls which are processed as Hatari commandline +arguments. Atari printscreen call takes also Hatari screenshot.
+−−conout <device>
+Enable console (xconout vector functions) output +redirection for given <device> to host terminal. Device 2 is for +the (CON:) VT52 console, which vector function catches also EmuTOS panic +messages and MiNT console output, not just normal BIOS console output.
+−−disasm <x>
+Set disassembly options. 'uae' and 'ext' select +the dissasembly engine to use, bitmask sets output options for the +external disassembly engine and 'help' lists them.
+−−natfeats <bool>
+Enable/disable (basic) Native Features support. +E.g. EmuTOS uses it for debug output.
+−−trace +<trace1,...>
+Activate debug traces, see +−−trace help for available tracing options
+−−trace-file +<file>
+Save trace output to <file> +(default=stderr)
+−−parse +<file>
+Parse/execute debugger commands from +<file>
+−−saveconfig
+Save Hatari configuration and exit. +Hatari UI needs Hatari configuration file to start, this can be +used to create it automatically.
+−−no-parachute
+Disable SDL parachute to get Hatari +core dumps. SDL parachute is enabled by default to restore video +mode in case Hatari terminates abnormally while using non-standard +screen resolution.
+−−control-socket +<file>
+Hatari reads options from given socket +at run-time
+−−log-file +<file>
+Save log output to <file> +(default=stderr)
+−−log-level +<x>
+Log output level +(x=debug/todo/info/warn/error/fatal)
+−−alert-level +<x>
+Show dialog for log messages above +given level
+−−run-vbls +<x>
+Exit after X VBLs
Type hatari --help to list all the command line options supported by a given version of Hatari.
-Once you've started Hatari succesfully, you can use the emulator as an almost complete Atari ST computer system.
-Press F12 to enter the GUI. Navigate it with the mouse. The GUI is rather self explanatory.
-
+
@@ -1768,10 +846,11 @@ changes that you have made.
-
+
@@ -1779,23 +858,25 @@ changes that you have made. or folder.
- To enter a folder or choose a file, simply click on the entry in the main box - of the dialog. You can use the arrows at the right, the cursor up and down - keys and the page up and down keys to navigate through the list. + To enter a folder or choose a file, simply click on the entry in the + main box of the dialog. To navigate in the file list, you can use the + scrollbar on the right with mouse, or use keyboard up + down arrow, + page up + down, Home and End keys.
You can use the three buttons in the upper right corner for additional folder - navigation. Use the button to go up one level - in the directory tree. Use the button to return - to your home directory. The button can be used + navigation. Click the button to go up one level + in the directory tree. Click the button to return + to your home directory. The button can be clicked to go to the root directory of the file system.
-
+
@@ -1829,7 +910,7 @@ changes that you have made.
some more advanced hardware features. There are not that many demos or
games that really require an STE but since most normal ST games/demos also
work with an STE, it's normally safe to always work in STE mode.
-
+
TT and Falcon are more advanced, but they are not as compatible to the ST as
the STE was. Therefore many old games and demos do not work with these machine
types anymore. There were only very few programs that were made for the TT
@@ -1880,17 +961,18 @@ changes that you have made.
--machine command line option.
+
This dialog can be used to choose which floppy disks should be emulated in the disk drives. You can use most standard Atari ST disk image files. You may select and browse also zipped disk images. See the chapter - "Floppy disk images" for details. + "Floppy disk images" for details.
Click on the button next to the
@@ -1908,7 +990,7 @@ insert the second disk of a two disk gam
Some games then use the second drive automatically.
In the case that a game is not able to find the disk in the second drive,
you have to insert the second disk in drive A: manually when prompted.
-
+
NOTE: This option only works properly if the file name of the
first disks ends with an 'a' before the extension and the second disk name
ends with a 'b'.
@@ -1927,7 +1009,8 @@ ends with a 'b'.
+
@@ -1952,10 +1035,11 @@ ends with a 'b'.
-
+
@@ -1983,10 +1067,11 @@ ends with a 'b'.
-
+
You can select the amount of RAM for the emulated ST here. Only @@ -2005,10 +1090,11 @@ different versions of Hatari. E.q. if yo cannot load your old memory snapshots back.
-
+
Here you can select the TOS image to use. Click on
- In this dialog, you can configure the emulated joysticks.
@@ -2072,11 +1159,11 @@ certain games. In some other games, it g
See also the chapter "Emulated Joystick" for details.
@@ -2091,7 +1178,7 @@ GUI - the Atari monitor dialog">
switch to ST medium resolution, you will get a TV-like screen rendering
which is a little bit faster but darker compared to the normal "RGB"
monitor mode. Switching between mono and a color monitor acts like a monitor
- switch on a real ST - so beware, this will reboot your emulated system!
@@ -2140,7 +1226,7 @@ on your screen.
a fast computer. When selecting 1, 2 or 4, drawing of corresponding number
of frames will be skipped after each frame actually shown by Hatari.
Select "Auto" to let the emulator to decide whether, and
- how many frames will be skipped.The Joystick Dialog
+The Joystick Dialog
+
The Atari Monitor Dialog
+The Atari Monitor Dialog
+
+ switch on a real ST - so beware, this will reboot your emulated system!
In TT mode, you can only choose between TT-high resolution ("Mono")
and normal modes (select one of the other monitor types).
Finally the Falcon mode supports all four types of monitors. Note that most
@@ -2110,19 +1197,18 @@ Extended VDI resolutions will emulate a
card in the emulated ST which give you larger resolutions with a higher
colordepth for GEM. Select a resolution and color depth. Check to
activate. It will disable all other video options mentioned above.
-Uncheck to get back to a normal ST behaviour.
+Uncheck to get back to a normal ST behaviour.
Note: Using an extended resolution will only work with GEM
conformant applications. 99% of all games and demos will not run if you
activate any extended resolution here.
The Hatari
-Screen Dialog
+The Hatari Screen Dialog
+
+ how many frames will be skipped.
Note: The frameskip option also affects the frame rate of the
screen animation recording!
+
Here you can select the keyboard mapping to use. Two different mappings @@ -2236,10 +1323,11 @@ the screenshots and recorded videos.
-
+
Here you can control the sound subsystem.
@@ -2272,20 +1360,21 @@ for accurate sound's emulation. -
+
Check the first checkmark to enable experimental printer support. -See the Emulated printer section for +
Check the first checkmark to enable printer support. +See the Emulated printer section for details.
As Hatari currently only supports printing to file, click on to select the file to print to. You can enter a new filename as well.
-Check the second checkmark to enable experimental RS232 support. +
Check the second checkmark to enable RS232 support. The RS232 device is configured according to the settings of the emulated RS232 of the Atari ST. This means Hatari will automatically use baudrate and handshaking as configured for the @@ -2294,7 +1383,7 @@ emulated ST.
device files for serial input and output. On Linux a good choice is /dev/ttyS0 or /dev/ttyS1. -Check the third checkmark to enable experimental MIDI support. +
Check the third checkmark to enable MIDI support. Click on to select a suitable MIDI device files for MIDI input and output.
midi-linux.txt file explains how to @@ -2305,91 +1394,92 @@ Hatari instances.
-While the emulator is running, you can activate or toggle various features via Hatari keyboard shortcuts. Below are listed the default shortcut key bindings:
-| Shortcut | -Purpose | +Shortcut | +Purpose |
|---|---|---|---|
| ALTGR+a | -record animation | +ALTGR+a | +record animation |
| ALTGR+g | -grab a screenshot | +ALTGR+g | +grab a screenshot |
| ALTGR+i | -boss key: leave full screen mode, pause Hatari -and iconify its window | +ALTGR+i | +boss key: leave full screen mode, pause Hatari + and iconify its window |
| ALTGR+j | -toggle joystick emulation via cursor keys -on/off between ports 0 and 1 | +ALTGR+j | +toggle joystick emulation via cursor keys + on/off between ports 0 and 1 |
| ALTGR+m | -(un-)lock the mouse into the window | +ALTGR+m | +(un-)lock the mouse into the window |
| ALTGR+r | -(warm) reset the ST | +ALTGR+r | +(warm) reset the ST |
| ALTGR+c | -coldreset the ST (same as the original power -switch) | +ALTGR+c | +coldreset the ST (same as the original power switch) |
| ALTGR+d | -open dialog to select/change disk A | +ALTGR+d | +open dialog to select/change disk A |
| ALTGR+s | -enable/disable sound | +ALTGR+s | +enable/disable sound |
| ALTGR+q | -quit the emulator | +ALTGR+q | +quit the emulator |
| ALTGR+x | -toggle normal speed/fast forward | +ALTGR+x | +toggle normal speed/fast forward |
| ALTGR+y | -enable/disable sound recording | +ALTGR+y | +enable/disable sound recording |
| ALTGR+k | -save memory snapshot | +ALTGR+k | +save memory snapshot |
| ALTGR+l | -load memory snapshot | +ALTGR+l | +load memory snapshot |
| ALTGR+f or F11 | -toggle between fullscreen and windowed mode | +ALTGR+f or F11 | +toggle between fullscreen and windowed mode |
| ALTGR+o or F12 | -activate the options GUI | +ALTGR+o or F12 | +activate the options GUI |
| PAUSE | -pause emulation | +PAUSE | +pause emulation |
| AltGr+PAUSE | -invoke the internal Hatari debugger | +AltGr+PAUSE | +invoke the internal Hatari debugger |
All other keys on the keyboard act as the normal Atari ST keys so pressing SPACE on your PC will result in an emulated press of the SPACE key on the ST. The following keys have special meanings:
-| Key | -Meaning | +Key | +Meaning |
|---|---|---|---|
| Alt | -will act as the ST's ALTERNATE key | +Alt | +will act as the ST's ALTERNATE key |
| left CTRL | -will act as the ST's CONTROL key | +left CTRL | +will act as the ST's CONTROL key |
| Print Screen | -will emulate the ST's HELP key | +Print Screen | +will emulate the ST's HELP key |
| Scroll Lock | -will emulate the ST's UNDO key | +Scroll Lock | +will emulate the ST's UNDO key |
| Page Up | -will emulate the ST's ( key in the keypad | +Page Up | +will emulate the ST's ( key in the keypad |
| Page Down | -will emulate the ST's ) in the keypad | +Page Down | +will emulate the ST's ) in the keypad |
For obvious reasons your PC mouse will act as the emulated Atari ST mouse. In fullscreen mode it will act as expected, directly controlling the ST mouse pointer.
-However it is a little bit different in windowed mode. To make the -mouse work there as expected you need to grab it first or lock it into -the Hatari window. Do this by pressing the ALTGR+m +
However it is a little bit different in windowed mode as +mouse cursor positions between host and emulated Atari can get +out of sync. This can be worked around by constraining the mouse +to the Hatari window. Pressing the ALTGR+m hotkey combination or starting Hatari with the ---grab command line option. +--grab command line option +grabs the mouse i.e. locks its movements to the Hatari window. Press the shortcut key (again) to go back to normal mouse behaviour which allows you to move mouse outside outside the Hatari window while Hatari is up and running. Note: pausing the emulation will also (temporarily) release the mouse grab.
Mouse scrollwheel will act as cursor up and down keys.
-The Atari ST joysticks are emulated ofcourse allowing you to play your favourite games with Hatari.
@@ -2489,7 +1584,7 @@ cursorkeys in this mode as long as you p along with the cursorkeys. You can also configure these keys from the joystick options. -Hatari emulates all screen modes of the original machine.
@@ -2506,11 +1601,11 @@ into your Mega ST.
Make sure to disable extended VDI modes for playing games as 99% of all ST games will not be able to make use of higher resolutions.
-Due to the fact that printer handling is very different between Unix -style machines and the Atari ST, emulation -of the printer is achieved by writing all printer output to a file.
+Due to the fact that printer handling is different on Atari and +current machines, emulation of the printer is achieved by writing all +printer output to a file.
The file will contain a sequence of data, the same that would appear on the data pins of the Atari ST printer port. That would include control characters and commands for graphic @@ -2520,13 +1615,13 @@ in a messy data dump in the printer outp do not format the output for a specific printer. The file contents can be used with your favourite text editor for further processing and printing to a real printer.
-To get real direct printing out of Hatari on a PostScript printer,
-you may set up a GDOS printer with a PostScript driver on the emulated
-Atari and set your printer device file as Hatari's printer output.
-NOTE: This has not been tested yet and the Hatari team cannot
-guarantee that it will work.
To get real direct printing out of Hatari you may set up a suitable
+(e.g. PostScript) GDOS or NVDI printer driver on the emulated Atari and
+set your printer device file as Hatari's printer output.
+NOTE: If the driver doesn't match or there's some other problem,
+this can cause your printer to print out hundreds of pages of garbage.
Serial communications in Hatari is designed to directly use a serial port on your PC.
@@ -2536,7 +1631,7 @@ the communication parameters like baudra software. Hatari will do the rest and handle the serial input and output for you. -Hatari does not use floppy disks directly but disk images due to differences between the floppy disk controllers of the ST and the PC. @@ -2607,7 +1702,7 @@ your highscores and savegames are lost i a zipped disk image.
-Hatari supports three ways of emulating Atari hard drives: The low-level @@ -2629,23 +1724,18 @@ TOS 1.0x supports up to 256MB partitions
-With the GEMDOS based drive emulation, you can easily "mount" a -folder from the host file system to a drive of the emulated Atari. To -use the GEMDOS based drive emulation, you should use a folder on your -hard disk that only contains files and folders with valid TOS -filenames i.e. file and folders names shouldn't contain invalid GEMDOS -filename characters and their length shouldn't exceed the 8+3 file name -length limit. +folder from the host file system to a drive of the emulated Atari.
-If you provide --harddisk option -a directory containing only single letter (C-Z) subdirectories, each -of these subdirectories will be treated as a separate partition, -otherwise the given directory itself will be assigned to drive "C:". -In the multiple partition case, the letters used as the subdirectory -names will determine to which drives/partitions they're assigned. +If you provide Hatari a directory containing only single letter (C-Z) +subdirectories, each of these subdirectories will be treated as a +separate partition, otherwise the given directory itself will be +assigned to drive "C:". In the multiple partition case, the letters +used as the subdirectory names will determine to which +drives/partitions they're assigned.
GEMDOS drive emulation is an easy way to share files between the @@ -2654,18 +1744,25 @@ limitations which are due to the way the implemented:
To use the ACSI hard disk emulation, you need a hard disk image file with a pre-installed HD driver in it. You can try to get an image of @@ -2704,7 +1801,7 @@ After installing the hard disk driver to HINSTALL.PRG, you can boot directly from the hard disk image.
-
As the IDE disk format (little endian) differs from the ACSI disk format @@ -2736,7 +1833,7 @@ the Cecile hard disk driver to the image Click the "Installer" button and save the Cecile driver to the 1st partition on "Hatari IDE disk". If you want to also use your HD image in ST/STE mode, you need to get and install AHDI 6 driver on it -instead (see ASCI hard disk +instead (see ASCI hard disk emulation section).
@@ -2745,8 +1842,7 @@ with the --ide
-Moving files to and from Atari hard disk images can be done either through GEMDOS partitions (host directories mounted inside @@ -2760,8 +1856,7 @@ a GEMDOS partition i.e. such to be befor and still to be able to access all the IDE/ACSI partitions, you need to use HD Driver.
-Uwe Seimet's HD
Driver works fine with both the Hatari GEMDOS partitions and normal
@@ -2796,8 +1891,7 @@ its AUTO folder, like this: "
-
If you want to access the harddisk image partitions also outside
@@ -2879,7 +1973,8 @@ the disk image from Hatari:
# losetup -d $loop
-
Hatari has a built-in debugging interface which can be used for
@@ -2889,8 +1984,8 @@ key combination.
-If you start Hatari with the "-D" command line option, m68k
-exceptions will automatically invoke the debugger. You can
+If you start Hatari with the "-D" command line option, certain m68k
+exceptions will automatically drop Hatari into the debugger. You can
toggle this also later from the debugger with the "setopt -D"
command.
At the debugger prompt, type "help" to get a list of all
@@ -2945,8 +2040,10 @@ CPU commands:
memdump ( m) : dump memory
memwrite ( w) : write bytes to memory
loadbin ( l) : load a file into memory
- savebin ( s) : save memory to a file
+ savebin ( ) : save memory to a file
symbols ( ) : load CPU symbols & their addresses
+ step ( s) : single-step CPU
+ next ( n) : step CPU, proceeding through subroutine calls
cont ( c) : continue emulation / CPU single-stepping
DSP commands:
@@ -2957,11 +2054,13 @@ DSP commands:
dspsymbols ( ) : load DSP symbols & their addresses
dspprofile (dp) : profile DSP code
dspreg (dr) : read/write DSP registers
+ dspstep (ds) : single-step DSP
+ dspnext (dn) : step DSP, proceeding through subroutine calls
dspcont (dc) : continue emulation / DSP single-stepping
-
-
After writing (with TAB completion) one of the above command names,
@@ -3016,13 +2115,13 @@ and it will be "evaluated" before being
-With command argument completion (see build
+With command argument completion (see build
notes), result from the last "evaluate" command can be inserted
by typing '$' and pressing TAB.
In the beginning, probably the most interesting commands are "m" and "d"
@@ -3060,6 +2159,11 @@ will be reseted to PC address everytime
+Use "setopt --disasm help" if you want to set options controlling
+the disassembly output.
+
You can use the "info" command to see state of specific sets of HW
registers (e.g. "info videl") and Atari OS structures (e.g. "info gemdos").
Accessing
-HDD image partitions outside of Hatari
+Accessing HDD image partitions outside of Hatari
The debugger
+
+The debugger
General debugger use
+General debugger use
Entering arguments to debugger commands
+
+Entering arguments to debugger commands
Inspecting emulation state
+Inspecting emulation state
+You can load debugging symbols to the debugger with the "symbols" +command (and with "dspsymbols" for DSP). These symbolic names can be +used in arithmetic expressions and conditional breakpoint expressions. +They also show up in the "disasm" command output and you can trace +calls to them with "trace cpu_symbols" (and DSP symbols with "trace +dsp_symbols"). +
+ + ++If you're using GEMDOS HD emulation, and your program contains symbol +table in DRI/GST format, you can load its symbol names/addresses to +the debugger with the following command, after program has been loaded +to the memory by TOS (see setting +breakpoint at program startup): +
++symbols prg ++
+ +
+The options you need to add suitable symbol table to your programs, +depend on which toolchain you use to build it: +
+You can view the generated symbols (and convert them to debugger +ASCII format) with tool installed with Hatari:
++$ gst2ascii -l -o program.tos > program.sym ++(Options -l and -o are used to exclude useless symbols from the output.) + + +
+If the program isn't run from a GEMDOS HD emulated drive, but from a +cartridge, floppy or HD image, you need to have the corresponding +program also as normal host file which location you can give to the +debugger: +
++symbols /path/to/the/program.tos ++ + +
-You can load symbol name/address information from a file to the -debugger with the "symbols" command (and with "dspsymbols" for DSP). -These symbolic names can be used in arithmetic expressions and -conditional breakpoint expressions. They also show up in the "disasm" -command output and you can trace calls to them with "trace cpu_symbols" -(and DSP symbols with "trace dsp_symbols"). +If Hatari complains that your program doesn't have DRI/GST format +symbol table, or its symbols are in some other format, and you +cannot re-compile it to have them, you have two options:
+The symbols file format is following:
+ASCII symbols file format is following:
e01034 T random e01076 T kbdvbase @@ -3121,28 +2294,23 @@ starting with '#' (comments) are ignored-AHCC C-compiler can provide a symbol file suitable for this with its -"-n" 'nm' list option (not enabled by default). If you're reverse -engineering some code, you could just create your own symbols file to -help in debugging it later. -
- --If you're debugging normal TOS/GEM programs instead of code loaded -into a fixed address (like e.g. EmuTOS is), after the program has been -loaded, load the symbols with the program text segment address offset: +Debugger will automatically "relocate" the symbol addresses when it +loads them from a program binary, but with ASCII symbol files you need +to give the relocation offset(s) separately, unless the symbol names +are for fixed adresses (like is the case e.g. with EmuTOS):
-symbols calc.sym "TEXT" +symbols program.sym TEXT DATA BSS-(The value of the above virtual "TEXT" debugger variable comes from a -program basepage, it's set after the program is loaded by TOS, see -"info basepage" output.) +If you're interested only about code symbols, you can leave DATA and +BSS offsets out (the values of the above virtual debugger variables +like TEXT come from the currently loaded program's basepage, they're +set after the program is loaded by TOS, see "info basepage" output).
-Breakpoints
+Breakpoints
There are two ways to specify breakpoints for Hatari. First, there are @@ -3194,7 +2362,7 @@ conditions need to be true for a breakpo
-Breakpoint options
+Breakpoint options
Normally when a breakpoint is triggered, emulation is stopped and you @@ -3236,7 +2404,7 @@ changes (explained below).
@@ -3260,7 +2439,7 @@ for address breakpoints you can give onl
-"b help" explains very briefly the breakpoint condition syntax: @@ -3291,7 +2470,7 @@ If the value is in parenthesis like in ' used value will be read from the memory address pointed by it. Note that this conditional breakpoint expression value is checked at run-time whereas quoted arithmetic expressions (mentioned in -Entering arguments +Entering arguments to debugger commands above) are evaluated already when adding a breakpoint. For example, to break when a value in an address (later) pointed by A0 matches the value currently in D0, one @@ -3306,7 +2485,7 @@ If you're interested only on certain bit '&' and a numeric mask on either side of comparison operator to mask the coresponding value, like this:
-b ($ff820).w & 3 = (a0) && (a1) = d0 & %1100 +b ($ff820).w & 3 = (a0) && (a1) = d0 & %1100
@@ -3317,6 +2496,9 @@ which indicates inequality ("is not") co b d0 > $20 && d0 < $40 && d0 ! $30 + +
As a convenience, if the both sides of the comparison are exactly the same (i.e. condition is redundant as it's always either true or @@ -3342,12 +2524,45 @@ like this: b ($ffff9202).w ! ($ffff9202).w :trace
-Typically with this one would use the breakpoint "trace" option like -above. +Because tracking breakpoint conditions will print the evaluated +value when it changes, they're typically used with the trace option +to track changes e.g. to some IO register.
-
In addition to loaded symbols, the debugger supports also setting
@@ -3364,11 +2579,11 @@ b pc = TEXT :once
Note1: It's better to trigger it only once because if you'd leave it on,
during reboot you would get a warning for every instruction until TOS sets
a valid basepage.
-
-Note2: you cannot use an address breakpoint for this because value of a
-variable given to it is evaluated when the breakpoint is set, not at
-run-time, so it cannot get the new value that the TEXT variable gets
-when you start a program.
+
+Note2: you cannot use an address breakpoint for this because value of
+a variable given to address breakpoint is evaluated when it's set, not
+at run-time, so it cannot get the new value that the TEXT variable
+gets when you start a program.
-b AesOpcode ! AesOpcode && AesOpcode < 0xffff :trace +b AesOpcode ! AesOpcode && AesOpcode < 0xffff :trace
As the file pointed by the breakpoint ":file" option (see -Breakpoint options) can contain any +Breakpoint options) can contain any debugger commands, it can also be used to do automatic "chaining" of debugger and breakpoint actions so that after one breakpoint is hit, another one is set. @@ -3419,12 +2633,18 @@ another one is set.
-b GemdosOpcode = 0x3D :trace :file trace.ini +b GemdosOpcode = 0x3D :trace :file program.ini ++
+b pc = TEXT :trace :file trace.ini
-setopt --bios-intercept --trace gemdos,xbios,fdc,io_all +symbols prg +trace gemdos,cpu_symbols b VBL = "VBL+4" :trace :file disable.ini
-hatari --parse break.ini -d testdir +hatari --parse break.ini /path/to/your/program.tos
After analyzing the emulation state and/or setting new breakpoints, @@ -3483,6 +2705,12 @@ triggers) if you omit the instruction co
+If you want to continue just to the next instruction, use "s" (step) +command to continue for exactly one instruction, or "n" (next), if you +want to skip subroutine calls. +
+ +If you want to continue with real-time disassembling, you can enable it with "trace cpu_disasm" (or "trace dsp_disasm" for DSP) at the debugger prompt before continuing. @@ -3504,15 +2732,13 @@ which tell it to intercept this higher l (which doesn't work under MiNT because it re-implements GEMDOS)
-Unlike with AES and VDI tracing, BIOS, GEMDOS and XBIOS traces show -arguments for most of the calls. +Unlike with VDI tracing, AES, BIOS, GEMDOS and XBIOS traces show arguments +for most of the calls.
-Tracing options can be set even from a program within the emulation +Tracing options can be set even from a program within the emulation, if you enable the Hatari "--bios-intercept" option and call XBios 255 -from the program with a suitable Hatari command line string. Bios -interception will also show the (Bios level) CON: output on the host -console. +from the program with a suitable Hatari command line string.
Note that the trace output file can be set only when Hatari starts, @@ -3525,14 +2751,16 @@ breakpoint option.
-Profiling tells where the emulated code spends most of its (emulated) time. It can be used to find out where a program is (apparently) -stuck or what are the largest performance bottlenecks for a program. +stuck, or what are the largest performance bottlenecks for a program.
+Profiling is used by first enabling the profiler (use "dp" for DSP):
@@ -3546,78 +2774,671 @@ And profiling will start once you contin> c Returning to emulation... -Allocated CPU profile buffer (18 MB). +Allocated CPU profile buffer (27 MB).
When you get back to the debugger, the collected profiling information -is processed and a summary of in which parts of the RAM the execution -happened is shown: +is processed and a summary of in which parts of memory the execution +happened, and how long it took, is shown:
-Allocated CPU profile address buffer (4 KB). -Normal RAM (0-0x400000): -- no activity -Cartridge ROM (0xFA0000-0xFC0000): -- no activity +Allocated CPU profile address buffer (57 KB). ROM TOS (0xE00000-0xE80000): - active address range: - 0xe0014c-0xe23f02 + 0xe00030-0xe611a4 - active instruction addresses: - 707 (100.00% of all) + 14240 (100.00% of all) - executed instructions: - 629144 (100.00% of all) + 4589668 (100.00% of all) - used cycles: - 9408503 (100.00% of all) -- address with most cycles: - 0xe0dcca, 402628 cycles (4.28% of all in area) -- address with most hits: - 0xe004a4, 4900 hits (0.78% of all in area) + 56898472 (100.00% of all) + = 7.09347s +Cartridge ROM (0xFA0000-0xFC0000): + - no activity + += 7.09347s
(DSP RAM will be shown only as single area in profile information.)
+ +-After this you can request more detailed profiling information: +When you're back in debugger, you can inspect the collected profile data:
-> profile
+> h profile
'profile' - profile CPU code
-Usage: profile <on|off|counts|cycles|symbols|stats> [show count]
- on & off enable and disable profiling. Data is collected
- until debugger is entered again after which you can view
- statistics about the data or view PC addresses that took
- most cycles or functions/symbols called most often.
- You can specify how many items are shown at most.
+Usage: profile <on|off|stats|counts|cycles|misses|symbols|callers|stack|addresses|save> [count|address|file]
+ 'on' & 'off' enable and disable profiling. Data is collected
+ until debugger is entered again at which point you get profiling
+ statistics ('stats') summary.
+
+ Then you can ask for list of the PC addresses, sorted either by
+ execution 'counts', used 'cycles' or cache 'misses'. First can
+ be limited just to named addresses with 'symbols'. Optional
+ count will limit how many items will be shown.
+
+ 'addresses' lists the profiled addresses in order, with the
+ instructions (currently) residing at them. By default this
+ starts from the first executed instruction, or you can
+ specify the starting address.
+
+ 'callers' shows (raw) caller information for addresses which
+ had symbol(s) associated with them. 'stack' shows the currect
+ profile stack, this is useful only with :noinit breakpoints.
+
+ Profile information can be saved with 'save'.
-For example:
+For example, to see which memory addresses were executed most +and what instructions those have at the end of profiling, use:
> profile counts 8 addr: count: -0xe004a4 0.78% 4900 -0xe004b6 0.78% 4896 -0xe0dcbc 0.55% 3448 -0xe0dcc6 0.55% 3448 -0xe0f59e 0.55% 3446 -0xe0dcce 0.55% 3445 -0xe0dcd6 0.55% 3445 +0xe06f10 12.11% 555724 move.l $4ba,d1 +0xe06f16 12.11% 555724 cmp.l d1,d0 +0xe06f18 12.11% 555724 bgt.s $e06f06 +0xe06f06 12.11% 555708 move.b $fffffa01.w,d1 +0xe06f0a 12.11% 555708 btst #5,d1 +0xe06f0e 12.11% 555708 beq.s $e06f1e +0xe00ed8 1.66% 76001 subq.l #1,d0 +0xe00eda 1.66% 76001 bpl.s $e00ed8 8 CPU addresses listed.+
-If you have loaded symbol information for code addresses, with the -"profile symbols" command you get a list of how many times the code -execution passed through the defined symbol addresses. +Then, to see what the executed code and its costs look like +around top addresses: +
+> profile addresses 0xe06f04 +# disassembly with profile data: +# <instructions percentage>% (<sum of instructions>, <sum of cycles>, <sum of i-cache misses>) +$e06f04 : bra.s $e06f10 0.00% (48, 576, 0) +$e06f06 : move.b $fffffa01.w,d1 12.11% (555708, 8902068, 0) +$e06f0a : btst #5,d1 12.11% (555708, 6685268, 0) +$e06f0e : beq.s $e06f1e 12.11% (555708, 4457312, 0) +$e06f10 : move.l $4ba,d1 12.11% (555724, 11125668, 0) +$e06f16 : cmp.l d1,d0 12.11% (555724, 4461708, 0) +$e06f18 : bgt.s $e06f06 12.11% (555724, 4455040, 0) +$e06f1a : moveq #1,d0 0.00% (16, 64, 0) +Disassembled 8 (of active 14240) CPU addresses. ++
+Unlike normal disassembly, "profile addresses" command shows only +memory addresses which instructions were executed during profiling. +You get instruction cache misses only when using cycle-accurate 030 +emulation with a Hatari version configured to use WinUAE CPU core. +
+If you have loaded symbol information, symbol names are shown above +the corresponding addresses. With the "profile symbols" command you +get a list of how many times the code execution passed through the +defined symbol addresses.
+ +Profile data accuracy depends on Hatari emulation accuracy. +Profile data accuracy from most to least accurate when Hatari's +default emulation options are used is following:
+-After the profiling information has been post-processed, it will -also be shown in the disassembly output. +If you have loaded symbols (see Debug symbols) +before continuing emulation/profiling, additional caller information +will be collected for all the code symbol addresses which are called +as subroutines. This information includes callstack, call counts, +calling instruction type (subroutine call, branch, return etc), and +costs for those calls, both including costs for further subroutine +calls and without them.
+When debugger is re-entered, current callstack is output before +profiling information:
++> a _P_LineAttack +CPU condition breakpoint 1 with 1 condition(s) added: + pc = $30f44 +$030f44 : 48e7 3820 movem.l d2-d4/a2,-(sp) +> c +... +CPU breakpoint condition(s) matched 1 times. + pc = $30f44 +Finalizing costs for 12 non-returned functions: +- 0x32a3c: _P_GunShot (return = 0x32b7e) +- 0x32b18: _A_FireShotgun (return = 0x3229a) +- 0x3223a: _P_SetPsprite (return = 0x32e86) +- 0x32e4e: _P_MovePsprites (return = 0x38070) +- 0x37f44: _P_PlayerThink (return = 0x36ea0) +- 0x36e44: _P_Ticker (return = 0x260e0) +- 0x25dcc: _G_Ticker (return = 0x1e4c6) +- 0x1e29e: _TryRunTics (return = 0x239fa) +- 0x238e8: _D_DoomLoop (return = 0x2556a) +- 0x24d7a: _D_DoomMain (return = 0x44346) +... ++ +
("profile stack" command can be used in breakpoints with :noinit +option to show backtraces during caller profiling.)
+ +Other information collected during profiling is shown with +following command:
++> profile callers +# <callee>: <caller1> = <calls> <types>[ <inclusive/totals>[ <exclusive/totals>]], <caller2> ..., <callee name> +# types: s = subroutine call, r = return from subroutine, e = exception, x = return from exception, +# b = branch/jump, n = PC moved to next instruction, u = unknown PC change +# totals: calls/instructions/cycles/misses +0xe00030: 0xffffff = 1 e, _main +0xe000fe: 0xe00a0c = 1 b, memdone +0xe0010a: 0xe04e34 = 1 s 1/5/72 1/5/72, _run_cartridge_applications +0xe00144: 0xe04dbe = 1 s 4/118/1512 1/27/444, _init_acia_vecs +0xe001ea: 0xe00ec6 = 1 b, _int_acia +0xe0038c: 0xe04c28 = 1 s 1/191/2052 1/191/2052, _init_exc_vec +0xe003a6: 0xe04c2e = 1 s 1/388/4656 1/388/4656, _init_user_vec +... ++ +
+For example, if you don't know all the places from which a certain +function is called, or in what context a certain interrupt handler can +be called during the period you're profiling, profile caller +information will tell you: +
++callee: caller: calls: calltype: + | | | / +0x379: 0x155 = 144 r, 0x283 = 112 b, 0x2ef = 112 b, 0x378 = 72 s +583236/359708265/1631189180 72/4419020/19123430, dsp_interrupt + | | | + inclusive costs exclusive costs callee name + (of calls from 0x378) -+Usage examples
+Calltypes: +- b: jump/branch +- n: PC just moved to next address +- r: subroutine return +- s: subroutine call +
+(Most "calls" to "dsp_interrupt" were subroutine call returns (=r) +to it from address 0x155.) +
+ ++With the execution counts in normal profiling data, caller information +can actually be used to have complete picture of what exactly the code +did during profiling. Main/overview work for this analysis is best done +automatically, by the profiler data post-processor (documented below). +
+ + +Everything about profile data accuracy applies also to caller costs, +but there are additional things to take into account, mainly because +profiler cannot determine when exceptions are being handling:
+It's useful to save the profile data to a file: +
+> profile save program-profile.txt ++ +
With the saved profile disassembly (and optional caller information) +you can more easily investigate what your program did during +profiling, search symbols & addresses in it, and compare the +results to profiles you've saved from earlier versions of your code.
+ +You may even create your own post-processing tools for +investigating the profiling data more closely, e.g. to +find +CPU/DSP communication bottlenecks.
+ + +Saved profile data can be post-processed with (Python) script +installed by Hatari, to:
+When the data is post-processed, you should always provide +the post-processor symbols for the profile code! Relying just on the +symbol in the profile data can cause costs to be asssigned to wrong +symbol, if symbol's code wasn't called through symbol's own address, +but by jumping inside its code.
+ +If your code is in fixed location, you should tell +post-processor to handle symbol addresses as absolute (-a):
++$ hatari_profile.py -a etos512k.sym emutos-profile.txt ++ +
Normal programs are relocated and you should instead give +the symbols as TEXT (code) section relative ones (-r):
++$ hatari_profile.py -r program.sym program-profile.txt ++ +
If symbols are included to your binary in DRI/GST format, first they +need to be extracted to the ASCII format +understood by the post-processor:
++$ gst2ascii -l -o program.prg > program.sym ++ +
If there are some extra symbols that you don't want to see +separately in profiles, because they aren't real functions, +but e.g. loop labels, you can either remove them manually +from the ASCII *.sym file, or filter them out with grep: +
++$ gst2ascii -l -o program.prg | grep -v -e useless1 -e useless2 | > program.sym ++ +
Above post-processor examples just parse + verify the given data +and produce output like this:
++Hatari profile data processor + +Parsing TEXT relative symbol address information from program.sym... +[...] +3237 lines with 1550 code symbols/addresses parsed, 0 unknown. + +Parsing profile information from program-profile.txt... +[...] +9575 lines processed with 368 functions. + +CPU profile information from 'program-profile.txt': +- Hatari v1.6.2+ (May 4 2013), WinUAE CPU core ++ + +
To get statistics (-s) and list of top (-t) CPU users in profile, +add "-st" option:
++$ hatari_profile.py -st -r program.sym program-profile.txt +[...] +CPU profile information from 'program-profile.txt': +- Hatari v1.6.2+ (May 4 2013), WinUAE CPU core + +Time spent in profile = 34.49539s. + +Calls: +- max = 187738, in __toupper at 0x52b88, on line 8286 +- 1585901 in total +Executed instructions: +- max = 1900544, in flat_remap_mips+14 at 0x47654, on line 7020 +- 64499351 in total +Used cycles: +- max = 15224620, in flat_remap_mips+18 at 0x47658, on line 7022 +- 553392132 in total +Instruction cache misses: +- max = 184308, in _BM_T_GetTicks at 0x43b90, on line 4772 +- 4941307 in total + +Calls: + 11.84% 187698 __toupper + 11.48% 182105 _BM_T_GetTicks + 11.48% 182019 _I_GetTime +[...] +Executed instructions: + 34.83% 22462729 flat_generate_mips + 14.08% 9080215 flat_remap_mips + 8.55% 5515945 render_patch_direct + 5.09% 3283328 _TryRunTics +[...] +Used cycles: + 23.62% 130702768 flat_generate_mips + 12.42% 68735832 flat_remap_mips + 9.77% 54041148 _TryRunTics + 5.80% 32111536 correct_element +[...] +Instruction cache misses: + 37.03% 1829764 _TryRunTics + 11.20% 553314 _BM_T_GetTicks + 9.44% 466319 _NetUpdate + 9.27% 457899 _HGetPacket +[...] ++ +
If you want to see also symbol addresses and what is per call +cost, add -i option:
+
+$ hatari_profile.py -st -i -r program.sym program-profile.txt +[...] +Executed instructions: + 34.83% 22462729 flat_generate_mips (0x04778a, 774576 / call) + 14.08% 9080215 flat_remap_mips (0x047646, 313110 / call) + 8.55% 5515945 render_patch_direct (0x047382, 29977 / call) + 5.09% 3283328 _TryRunTics (0x042356, 19660 / call) +[...] +Used cycles: + 23.62% 8.14728s 130702768 flat_generate_mips (0x04778a, 0.28094s / call) + 12.42% 4.28461s 68735832 flat_remap_mips (0x047646, 0.14775s / call) + 9.77% 3.36863s 54041148 _TryRunTics (0x042356, 0.02017s / call) + 5.80% 2.00165s 32111536 correct_element (0x04a658, 0.00001s / call) +[...] +Instruction cache misses: + 37.03% 1829764 _TryRunTics (0x042356, 10956 / call) + 11.20% 553314 _BM_T_GetTicks (0x043b90, 3 / call) + 9.44% 466319 _NetUpdate (0x041bcc, 5 / call) + 9.27% 457899 _HGetPacket (0x041754, 5 / call) +[...] ++ +
(For cycles the "per call" information is in seconds, not as +a cost count.)
+ +If your profile file contains caller information, you should +add -p option to see it, as that will also help in detecting symbol +issues (see Interpreting +the numbers):
+
+$ hatari_profile.py -st -p -r program.sym program-profile.txt +[...] +9575 lines processed with 368 functions. +[...] +Of all 1570498 switches, ignored 581 for type(s) ['r', 'u', 'x']. + +CPU profile information from 'badmood-level-load-CPU.txt': +- Hatari v1.6.2+ (May 4 2013), WinUAE CPU core +[...] +Calls: + 11.84% 11.84% 187698 187698 __toupper + 11.48% 11.48% 182105 182105 _BM_T_GetTicks + 11.48% 22.95% 182019 364038 _I_GetTime +[...] +Executed instructions: + 34.83% 34.86% 34.86% 22462729 22484024 22484024 flat_generate_mips + 14.08% 14.10% 14.10% 9080215 9091270 9091676 flat_remap_mips + 8.55% 5515945 render_patch_direct + 5.09% 5.11% 94.96% 3283328 3294022 61247717 _TryRunTics +[...] +Used cycles: + 23.62% 23.69% 23.69% 130702768 131100604 131100604 flat_generate_mips + 12.42% 12.46% 12.46% 68735832 68928816 68930904 flat_remap_mips + 9.77% 9.80% 95.66% 54041148 54238744 529368824 _TryRunTics + 5.80% 5.82% 5.82% 32111536 32193664 32193664 correct_element +[...] +Instruction cache misses: + 37.03% 37.14% 98.57% 1829764 1835261 4870573 _TryRunTics + 11.20% 11.24% 11.24% 553314 555191 555191 _BM_T_GetTicks + 9.44% 9.49% 29.13% 466319 468782 1439340 _NetUpdate + 9.27% 9.29% 9.37% 457899 459197 463217 _HGetPacket +[...] ++ +
Now there's a message telling that some of the calls were ignored as +based on "call type" they were determined to be actually returns from +exceptions, not real calls (this is mainly important for callgraph +generation, discussed below).
+ + +In addition to accuracy issues mentioned in previous Profiling +sections, function/symbol level costs have gotchas of their own.
+ +The first cost percentage and count columns are sums for all +the instructions that were in profile data file between +the indicated symbol's address and the address of the next symbol +(= "between-symbols" cost).
+ +NOTE: If your symbol file doesn't contain addresses +for all the relevant symbols, results from this can be misleading because +instructions costs get assigned to whatever symbol's address +happened to preceed those instructions. And you don't see which +caller is causing it from caller info or callgraph either, as entry +point for that time sink lacking a symbol means profiler hadn't +tracked calls to it...
+ +The next two cost percentage and count columns are for subroutine +calls costs, first one for exclusive and latter for inclusive cost +i.e. including costs for further subroutine calls. Values are based on +caller information documented above.
+ +Reasons why between-symbol costs, and subroutine call costs can +differ are following:
+In the first case, you should check the profile data to find out +whether there are missing symbols for executed function entry points. +You can notice function entry points as address gap and/or code +retrieving arguments from stack, and exit points from RTS instruction.
+ +Second case can also be seen from the profile data. Call count +is same as count for how many times first instruction is executed +(worst case: large loop on subroutine's first instruction).
+ +While subroutine costs should be more accurate and relevant, due to +code optimizations many of the functions are not called as subroutines +(on m68k, using JSR/BSR), but just jumped or branced to. Because of +this, it's useful to compare both subroutine and between-symbols +costs. One should be able to see from the profile disassembly which +of the above cases is cause for the discrepancy in the values.
+ +NOTE: Before starting to do any serious source +level optimizations, you should always verify from profile +data (disassembly) where exactly the costs are in a function, to make +sure your optimization efforts can actually help the performance.
+ + +Callgraphs require saved profile data to contain caller information, +i.e. symbols should have been loaded before starting profiling (normally +done with "symbols prg" command in Hatari debugger).
+ +Separate callgraphs will be created for each of the costs +(0=calls, 1=instructions, 2=cycles) with the -g option:
++$ hatari_profile.py -p -g -r program.sym program-profile.txt +[...] +Generating 'program-profile-0.dot' DOT callgraph file... + +Generating 'program-profile-1.dot' DOT callgraph file... + +Generating 'program-profile-2.dot' DOT callgraph file... +[...] ++ +
Callgraphs are saved in GraphViz +"dot" format. Dot files can be viewed:
++$ dot -Tsvg program-profile-1.dot > program-profile-1.svg ++ (problem with most PS/PDF and SVG viewers is that either they + don't allow zooming large callgraphs enough or they use huge + amounts of memory and get very slow) +
Produced callgraph will look like this:
+
+
+Interpreting the callgraph:
+If profile is for larger and more varied amount of code +(e.g. program startup), the resulting callgraph can be so +huge it's unreadable.
+ +If your code has interrupt handlers, they can get called +at any point, which can show in callgraph as "explicit" calls +from the interrupted functions. To get rid of such incorrect +calls, give interrupt handler names to --ignore-to option:
++$ hatari_profile.py -p -g --ignore-to handler1,handler2 -r program.sym program-profile.txt ++ +
In large callgraph most of the functions aren't really interesting, +because their contribution to the cost is insignificant. You can +remove large number of them with --no-leafs and --no-intermediate +options, they act only on on nodes which costs are below +given threshold. Leaf nodes are ones which don't have any parents +and/or children and intermediate ones which have only single parent +and children (node calling itself is not taken into account). + +
Threshold for this is given with the --limit (-l) option. With +that it typically makes also sense to change the node emphasis +threshold with --emph-limit (-e) option:
++$ hatari_profile.py -p -g -l 0.5 -e 2.0 -r program.sym program-profile.txt ++ +
If you're not interested in from how many different addresses +a given function calls another function, use --compact option. If you +still see multiple calls between two nodes with it, the reason is that +they happened through different call paths which were removed from +the callgraph after --compact option was applied:
++$ hatari_profile.py -p -g -l 1.0 -e 2.0 --no-leafs --no-intermediate --compact -r program.sym program-profile.txt ++ +
If even this doesn't help, you can remove all nodes below +the given cost threshold limit with --no-limited option, but this +often doesn't leave much of a call hiararchy. Instead you may +consider removing all nodes except for subroutine call ones with +--only-subroutines option.
+ +If you have trouble locating nodes you're specially interested +about, you can either color them differently with the --mark option, +or exclude everything else from the callgraph except those nodes and +their immediate callers & callees, with the --only option:
++$ hatari_profile.py -p -g --only func1,func2 -r program.sym program-profile.txt ++ +
Last option for reading the callgraph is using -k option to +export the data for use in (Linux) Kcachegrind UI. It generates +callgraphs on the fly, and just for the area around the function +you selected, so navigating in callgraph may be easier. It also +shows the related profile disassembly, which can make verifying +matters easier:
++$ hatari_profile.py -p -k -r program.sym program-profile.txt +[...] +Generating callgrind file 'program-profile.cg'... +[...] +$ kcachegrind program-profile.cg ++
+Here's a list of some common debugging tasks and how to do them @@ -3626,8 +3447,8 @@ with the Hatari debugger:
+history on +b pc=($8) ++After bus error invokes debugger, 'history' command can then be used +to see (executed memory addresses with their current) instructions +leading to the error. The most interesting vector addresses are: +$8 (Bus error), $C (Address error), $10 (Illegal instruction), +$14 (Division by zero). +
@@ -3688,7 +3527,7 @@ b ($ff820a).b & 2 ! ($ff820a).b & 2
b ($ff820a).b & 2 ! ($ff820a).b & 2 :trace @@ -3710,37 +3549,56 @@ b d0 = "d0 + 10"
+> trace gemdos
+> b GemdosOpcode = $3D
+> c
+[...continue until breakpoint...]
+1. CPU breakpoint condition(s) matched 1 times.
+ GemdosOpcode = $3D
+> n
+GEMDOS 0x3D Fopen("TEST.TXT", read-only)
+> e d0
+= %1000000 (bin), #64 (dec), $40 (hex)
+
+-history on +history cpu c [breakpoint is hit and debugger entered] -history 16 +history 16
-history on -lock history 16 +history on +lock history 16 c
-lock registers -c 1 +lock registers +s [new register values] -c 1 +s [new register values] ...@@ -3760,7 +3618,7 @@ you enter debugger manually etc, write t
lock file stack.ini-Please see also Chaining breakpoints +Please see also Chaining breakpoints section for more examples on what you can do with the debugger input files.
+profile on +symbols prg +b pc = _my_function :quiet :noinit :file showstack.ini ++I.e. whenever 'my_function' address is called, quietly trigger a +breakpoint without reseting profiling (callstack) information and run +debugger command(s) from the 'showstack.ini' debugger script file, +which contains following command: +
+profile stack ++
Hint: for most of the above commands, one just needs to prefix them with -"d" (or "dsp" if using full command names) to do similar operation on +"d" (or "dsp" when using full command names) to do similar operation on the DSP.
-Lastly, the debugger is much nicer to use with the command line @@ -3802,7 +3688,7 @@ By default it should be enabled.
-Hatari performance varies between Atari programs, depending on what features Hatari needs to emulate for them. Less accurate Atari @@ -3813,7 +3699,7 @@ overhead.
have a noticeable effect on performance. -Hatari currently runs best in 16 or 32 bits per pixel color depth @@ -3851,16 +3737,16 @@ can be slower despite optimizations.
-Emulation options have the largest impact on performance. These options can be changed from the Hatari GUI System dialog and the emulation needs to be rebooted for any of these changes to take -an effect! +an effect! They're enabled by default.
-Emulating the Falcon DSP is performance-wise several times more demanding than emulating the m68k; DSP runs at higher frequency, executes many @@ -3871,7 +3757,7 @@ that do use DSP, many use it only for ba fine without the real DSP emulation.
-The single largest factor contributing to general Hatari emulation performance is the handling of interrupts. Enabling Timer-D patching @@ -3880,7 +3766,15 @@ significantly reduces the number of inte Atari machine. Using this has adverse effect only for very rare programs.
-+While accurate FDC emulation doesn't take that much CPU, it slows down +floppy image accesses (and Hatari startup) a lot. Only very +few demos and games require accurate FDC emulation for their copy protection, +so enabling fast floppy access is fairly safe. +
+ +After the DSP and interrupts, m68k emulation takes most time. Disabling the "Slower but more compatible CPU" option will speed up @@ -3899,15 +3793,15 @@ machine.
-NOTE: Above options may cause some programs not to work correctly. +NOTE: Above options may cause some programs to work in correctly. The Hatari Software Compatibility List -lists programs known to need real real Falcon DSP emulation or Timer-D -frequency. Disabling "Compatible CPU" option is recommended only as -a last resort. +lists programs known to need real real Falcon DSP emulation, Timer-D +frequency or accurate FDC timings. Disabling "Compatible CPU" option +is recommended only as a last resort.
-Emulator options don't usually have as large effect on performance as @@ -3916,7 +3810,7 @@ just the quality of the emulation "outpu be toggled at run-time without rebooting the emulation.
-Internal Hatari sound handling and the SDL_mixer sound thread libALSA sound processing can account up to 1/3 of the Hatari CPU usage @@ -3927,7 +3821,7 @@ in Hatari as this can significantly redu interrupts.
-Screen rendering can take noticeable amount of CPU time. The default Hatari "auto" frame skipping should be used unless there's a good @@ -3944,7 +3838,7 @@ emulation to run slower than a real Atar Hatari does redundant work to convert frames you can't see.
-If you are not using frame skip, disabling zooming can have noticeable improvement on performance. You can do this by specifying @@ -3955,7 +3849,7 @@ mode-lines (e.g. "320x200") to your xorg to use zooming, disabling borders may help a bit.
-Handling Spec512 color modes which change the ST/e palette constantly takes some extra CPU. If you have problems with CPU usage in such @@ -3965,7 +3859,7 @@ completely by zeroing the threshold for --spec512 0 option.
-If your version of the SDL library uses VSync to synchronize the screen output, drawing of the statusbar or the drive LED may have some minor @@ -3973,7 +3867,7 @@ impact on performance too. Normally the
-There are a couple of ways to monitor and measure Hatari performance. @@ -4021,9 +3915,9 @@ at the same time you're making the measu
-This program is free software; you can redistribute it and/or modify @@ -4045,7 +3939,7 @@ Inc., 51 Franklin Street, Fifth Floor, B Foundation | The GNU General Public License
-Emulation via software is an art and Hatari is an example of this.
Emulation is to make a computer behave like a (probably) completely @@ -4081,20 +3975,7 @@ emulation of the various custom chips an parts of the emulated system is much trickier.
-| - June 2012 - | -