--- hatari/doc/manual.html 2019/04/01 07:15:45 1.1.1.9 +++ hatari/doc/manual.html 2019/04/09 08:47:34 1.1.1.10 @@ -21,6 +21,14 @@ h2 { border-bottom:solid thin black;} h4.gui { clear:right } + h5 { margin-bottom:2px; margin-left:1em; } + + pre { color: black; + background-color: #eeeeee; + margin: 0px 20px 8px 20px; + padding: 2px 8px 1px 8px; + border: solid thin #ccaa88; + } td { font-family:Verdana,Arial,Helvetica,sans-serif; } @@ -31,7 +39,7 @@ *.commandline { font-family:Fixed,Courier,monospace; font-size:90% } *.file { color: #000088;} - *.button { color: #468E64;} + *.button { color:#000000; background-color:#c0c0c0; border:outset thin grey; font-family:Fixed,Courier,monospace; padding-left:1em; padding-right:1em;} *.key { color:#550000; font-family:Fixed,Courier,monospace; font-size:90% } *.backdropped { background-color:#ffffee; } *.image {margin-left: 5px; margin-right: 5px; border-width:2px; border-style:solid; border-color:#eeeeff; padding:1cm; text-align:center; } @@ -46,11 +54,11 @@
-Version 1.2 +Version 1.3
Manual written by: Thomas Huth, Matthias Arndt - & Eero Tamminen + & Eero Tamminen
Hatari on the WWW: The GUI
-DSP emulation is still very experimental and unstable, but there's a dummy mode,
+DSP emulation is still very experimental, but many games and demos
+already work with it. If it takes too much CPU, there's a dummy mode
too, which helps to get some demos and games running.
@@ -153,8 +171,8 @@ Recent versions of Hatari even feature b
- CFLAGS="-O3 -fomit-frame-pointer" ./configure -
++CFLAGS="-O3 -fomit-frame-pointer" ./configure +
Then compile Hatari by typing make. If all @@ -509,6 +529,21 @@ Start the emulator in window mode
| + | +Grab mouse (also) in window mode + | +
| + | −z, −−zoom <x> |
| +−−timer−d <bool> | +
| + | +Patch redundantly high Timer-D frequency set by TOS. This about doubles +Hatari speed as the original Timer-D frequency causes most of the +interrupts. + | +
| + | −−dsp <x> |
| -Sound quality (off/low/med/hi, off=faster) +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. |
| -−D, −−debug -<bool> | +−D, −−debug
| -Enable Hatari debugger console interface +Toggle whether CPU exceptions invoke the debugger |
| + | +−−run-vbls <x> | +
| + | +Exit after X VBLs + | +
Type hatari --help to list all @@ -1192,7 +1263,7 @@ the command line options supported by a
Once you've started Hatari succesfully, you can use the emulator as -an allmost complete Atari ST computer system.
+an almost complete Atari ST computer system.
+
From the main menu, you can reach the other setup dialogs by clicking on the appropriate buttons.
You can load the current settings from a configuration file by clicking -on the button and you can save the -current settings to a configuration file with the button.
+on the button and you can save the +current settings to a configuration file with the + button. -Click to go back to the emulated +
Click to go back to the emulated ST. All changed options will be applied.
-Check the option if you want -the emulated ST to perform a cold reset. This is equal to +
Check the button if you want +the emulated machine to perform a cold reset. This is equal to switching the power off and on again on a real ST.
Click to terminate Hatari and @@ -1225,10 +1296,35 @@ return to the host OS.
Click to abandon any changes that you have made.
+ +
++ The file selector dialog appears whenever you are prompted to choose a file + 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. +
++ 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 + to go to the root directory of the file system. +
+ +
+
@@ -1285,6 +1381,15 @@ that you have made.
the emulation of 68k address errors and the CPU prefetch buffer. This is needed for best compatibility, but it slows down emulation a little bit so you can disable it if you don't need it. ++ For Falcon mode, you can choose whether you want to enable DSP emulation, + fake it or completely disable it. Most Falcon programs only play sound or work + correctly when you enable the DSP emulation, but it needs a lot of host CPU + power (more than 2 GHz). So if you have a slow host CPU, you can try if your + Falcon program also runs with DSP disabled or in "dummy" mode. + Note that you can not change this option while the DSP based program already + runs. +
You can also enable/disable Blitter emulation here. The Blitter is a custom chip that accelerates some graphical operations. This switch only toggles the Blitter in plain ST mode. In STE mode, the Blitter is always enabled (since all @@ -1297,36 +1402,28 @@ that you have made.
value slows down the emulation. The patch gives you a better performance. It is normally safe to enable the patch, but if you encounter a program that does not work, you can try to disable the patch to see if it works then. -- Select if you want to use slow FDC emulation. "Slow down FDC" is - normally not required, except for some few slideshows / intros which run too - fast without this option. -
NOTE: These parameters are very sensitive to the emulated ST and it is strongly recommended to reset the emulated ST after changing these options.
-
-Use the upper dialog 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.
- -Click on the button next to the -A: and B: option to go to the fileselector: -
- -
+
+ 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. +
++ Click on the button next to the + A: and B: option to go to the fileselector to choose a disk image for the + corresponding drive. +
Click on to eject a disk image from the emulated drive. The emulated ST will act as if had no floppy disk in its drive.
@@ -1343,33 +1440,65 @@ you have to insert the second disk in dr first disks ends with an 'a' before the extension and the second disk name ends with a 'b'. -If you need to create a new blank disk image, click on . -Parameters for the new image can be set in the following dialog. Click -on create to create the image or on to get back to the -disk dialog. -
--After clicking , a fileselector -appears. You can browse the filesystem now. Select the target -directory, click beside File: -and type in a name for the new disk image. The name should terminate -with .st or .msa. -
-Hatari can currently create plain .ST and .MSA disk images -exclusively.
-You can choose if you want Hatari to writeprotect your disks. Atari ST virii can spread on disk images too so it is ok to -enable the write protection option. However you can't save highscores or games to your disk images then.
-Use the lower dialog to change the harddisk settings.
-You can select a harddrive image for harddrive emulation via image -file here or you may select -a directory of your local filesystem to be emulated as the ST's -harddrive.
-Check "Boot from HD" if you want Hatari to execute the AUTO folder -on the harddrive. -This option is checked by default if you specify a harddrive image or a -directory via the command line.
++ Select if you want to use slow FDC (Floppy Disk Controller) emulation. + "Slow floppy access" is normally not required, except for some few + slideshows / intros which run too fast without this option. +
++ You can choose if you want Hatari to write-protect your disks. Atari ST virii + can spread on disk images too so it might be a good idea to enable the write + protection option. However you can't save highscores or games to your disk + images in that case. +
+ +
++ If you need to create a new blank disk image, click on + . + Parameters for the new image can be set in the following dialog. + Click on to save the new image or on + to return to the disk dialog. +
++ After clicking , a fileselector + appears. You can browse the filesystem now. Select the target directory, + click beside "File:" and type in a name for the new disk image. + The name should terminate with .st or .msa. +
++ Hatari can currently create plain .ST and .MSA disk images exclusively. +
+ + +
++ This dialog can be used to change the harddisk settings. +
++ You can select a harddrive image for ACSI or IDE hard drive emulation via + image file here or you may select a directory of your local filesystem to be + emulated as the harddrive of the emulated system. +
++ Check "Boot from HD" if you want Hatari to execute the AUTO folder + on the harddrive. + This option is checked by default if you specify a harddrive image or a + directory via the command line. +
++ Note that for IDE hard disk emulation you also need a TOS version >= 2.05. + And ACSI hard disk emulation does not work with TOS 4.0x in Falcon mode. +
+For each ST joystick, choose whether you want to disable it, use the keyboard for emulation or use a real PC joystick.
For keyboard emulation, you can select the keys by pressing the - button. You will be prompted to press + button. You will be prompted to press the keys for up, down, left, right and fire.
If you want to use a real PC joystick for the emulation, you should connect it to your PC before you start Hatari. Then you can choose the joystick with @@ -1528,9 +1657,9 @@ Uncheck to get back to a normal ST behav conformant applications. 99% of all games and demos will not run if you activate any extended resolution here.
-Click to create a +
Click to create a screenshot in PNG (or BMP) format to the current working directory or click - to record a sequence of single + to record a sequence of single screenshots. You can opt to only record new movie frames when the screen content really changed.
@@ -1571,50 +1700,60 @@ screen content really changed.
+
Here you can control the sound subsystem.
Check if you want emulated sound at all. Emulation is faster if sound emulation is turned off.
-3 frequencies from low to high quality are available. Experiment a -little bit to find out which fits best for your setup. -Medium quality will work ok in most cases.
-You can select to record a piece of sound here. The file name -extension you use (.WAV or .YM), determines in which format the sound -is recorded in. The record button is a toggle so you will need to -return to the GUI to switch sound recording off again -(or to use the keyboard shortcut for that).
++ Nine frequencies from low to high quality are available. Experiment a + little bit to find out which fits best for your setup. + For most modern computers, 44100 Hz or 48000 Hz should be fine. + For older or slower host systems, you should use a lower frequency. + 12517, 250033 and 50066 Hz are frequencies supported by + the STE/TT/Falcon sound DMA. +
++ You can select to record a piece of sound here. + Use the button to choose a file. + The file name extension that you use (.WAV or .YM) determines in which format + the sound is recorded in. The button + is a toggle so you will need to return to the GUI to switch sound recording off + again (or to use the keyboard shortcut for that). +
+
Check here if you want to enable experimental printer support. See -the chapter "Emulated printer" for details.
+Check the first checkmark to enable experimental 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 + class="button">Browse to select the file to print to. You can enter a new filename as well.
-Check the second checkmark if you want to enable experimental RS232 -support. The RS232 device is configured according to the settings of +
Check the second checkmark to enable experimental 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 emulated ST.
-Select a suitable device file for input and output. Click on to select. -A good choice is /dev/ttyS0 or /dev/ttyS1. -
-You can enable MIDI as well. This currently works for outputting -MIDI data only. A good choice is /dev/midi00.
-Click on to select a suitable -MIDI device file for output.
-Your sound driver must support MIDI to make this work.
-NOTE: RS232 and MIDI emulation are very experimental, too. -Don't enable them unless you really need them! +
Click on to select suitable +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. +Click on to select a suitable +MIDI device files for MIDI input and output.
+midi-linux.txt file explains how to +select the correct MIDI device file, how to set up softare sound +synthetizing on Linux (using Alsa), if your sound card/driver doesn't +support MIDI, and how to set up MIDI networking between multiple +Hatari instances.
@@ -1674,7 +1813,7 @@ switch)You can change the key bindings from the Hatari configuration file. -The required key values you can see from the SDL_keysym.h include file +The required key values can be seen in the SDL_keysym.h include file (usually in /usr/include/SDL/).
@@ -1761,9 +1903,12 @@ 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 -hotkey combination. -Press it again to go back to normal mouse behaviour which allows you to -work in other X11 windows while Hatari is up and running.
+hotkey combination or starting Hatari with the +--grab command line option. +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 other possibility is to image the disk on a real Atari ST. There are programs like the Magic Shadow Archiver for this task. Hatari @@ -1908,36 +2053,21 @@ so your highscores and savegames are lost if you load the game from such a zipped disk image.
+-Hatari supports two ways of emulating a ST hard drive: The low-level -ACSI hard disk emulation and a GEMDOS based drive emulation. Please -note that changing the HD-image or the GEMDOS HD-folder will reset +Hatari supports three ways of emulating Atari hard drives: The low-level +ACSI and IDE hard disk emulation and a GEMDOS based drive emulation. +In most cases the GEMDOS based hard disk emulation is best as it allows +exchanging files easily between the emulated and the host environment. +
++Please note that changing the HD-image or the GEMDOS HD-folder will reset the emulated Atari since it is not possible to switch the hard disk while the emulator is running.
--To use the ACSI hard disk emulation, you need a hard disk image file -with a pre-installed HD driver in it. So either try to image your old -ST hard disk or grab one from the internet (e.g. from the Hatari website). -Please note that AHDI 5.0 is currently the only hard disk driver -that is officially supported. Other hard disk drivers might not work. -
--To create a new ACSI hard disk image, you can start with an empty image that -you have for example created with the following command: -dd if=/dev/zero of=hd.img bs=512 count=xxx. -Then copy the complete AHDI 5.0 package to a floppy disk image, and enable -this floppy disk image and the fresh hard disk image in the emulator. -Start HDX.PRG from the floppy disk and format and partition the hard disk -with this tool. When you're finished, you have to restart the emulated system, -run AHDI.PRG from the floppy disk and HINSTALL.PRG afterwards. -With HINSTALL.PRG you can install the hard disk driver to the fresh HD image, -so you can directly boot from the hard disk image in the future. -
With the GEMDOS based drive emulation, you can easily "mount" a @@ -1966,6 +2096,479 @@ to use the GEMDOS HD emulation.
++To use the ACSI hard disk emulation, you need a hard disk image file +with a pre-installed HD driver in it. So either try to image your old +ST hard disk or grab one from the internet (e.g. from the Hatari website). +Please note that AHDI 5.0 is currently the only hard disk driver +that is officially supported. Other hard disk drivers might not work. +
++To create a new ACSI hard disk image, you can start with an empty image that +you have for example created with the following command: +dd if=/dev/zero of=hd.img bs=512 count=xxx. +Then copy the complete AHDI 5.0 package to a floppy disk image, and enable +this floppy disk image and the fresh hard disk image in the emulator. +Start HDX.PRG from the floppy disk and format and partition the hard disk +with this tool. When you're finished, you have to restart the emulated system, +run AHDI.PRG from the floppy disk and HINSTALL.PRG afterwards. +With HINSTALL.PRG you can install the hard disk driver to the fresh HD image, +so you can directly boot from the hard disk image in the future. +
+ ++Create an empty image file with the size of your choice with: +dd if=/dev/zero of=hd.img bs=1k count=xxx. +Then get the Cecile hard disk driver from +http://centek.free.fr/atari/softs/s_cecile.htm +and put it on a floppy disk image (named "cecile.st") e.g. with: +zip2st.sh cecile.zip. +
++Run Hatari with +hatari --machine falcon --tos tos404.rom --ide hd.img cecile.st, +warm up your French language skills, start the Cecile hard disk driver +CECILE.PRG, then use the tool CC_TOOLS.APP to partition your hard disk +image: click to "Partition", select "Hatari IDE disk" and set suitable +partition size. Then click "Valider". +
++If you only want to use your HD image in Falcon mode, you can install +the Cecile hard disk driver to the image from the Cecile CC_TOOLS.APP: +select "Installer" from main menu 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 emulation" section for AHDI usage +instructions). +
++Then you can boot from your hard disk image by simply specifying it +with the --ide parameter. +
+ + ++If you want to access the partitions also outside the emulation, +the disk image needs to have a DOS partition table. The +atari-hd-image script included +with Hatari can be used to create such an image. +
++Inside the Hatari emulator, EmuTOS can access partition(s) on these +kind of images directly without any driver software. Of the Atari HD +drivers, Centek's Cecile (mentioned above) and Uwe Seimet's +HD Driver +(demo) work fine with them. E.g. AHDI and CBHD don't. +
++Note also that plain EmuTOS supports only ACSI and the drivers support +only IDE (emulation). Cecile needs TT or Falcon and HD driver doesn't +work with EmuTOS or TOS4. To summarise; if ASCI emulation and EmuTOS +are enough, use those. Otherwise, if you want to use TT or Falcon +emulation, use Cecile (or full HD Driver version if you have it), +otherwise use HD driver (demo). +
++To access the content of the partitions on Linux host, there are two +possibilities: + +
+For this you need to add an entry for the hard disk +image to your ~/.mtoolsrc and +specify which partition you want to access from the image. For +an image created with the above mentioned script, the line in +the configuration file should look something like this: +
++MTOOLS_NO_VFAT=1 +drive c: file="/home/user/hatari/hd.img" partition=1 ++
+Note that Mtools is instructed to use FAT compatibility mode because +EmuTOS cannot deal properly with VFAT file information. If you don't +want this setting for all your Mtools drives, you can set it also via +the environment like this: +
++MTOOLS_NO_VFAT=1 mcopy foobar.txt c: ++ +
+This is recommended even by Mtools documentation, but it's less +convenient as it requires root rights. First you need to "loop" +mount the image: +
+
+$ su
+# image="hd.img"; mountdir="hd"
+# start=$(parted $image unit s print | awk '/ 1 /{print $2}' | tr -d s)
+# losetup -f $image -o $((512*$start))
+# loop=$(losetup -a | tail -1 | cut -d: -f1)
+# mkdir -p $mountdir
+# mount -t msdos $loop $mountdir
+
++This uses parted to find out the first +partition offset in sectors and then tells losetup +to bind the first free loop device to a corresponding offset from +the hd.img image. +mount is then used to mount the file system +from the loop device on top of the "hd" directory. +
++After you've copied the relevant files to the "hd" directory, you need +unmount the file system and remove the loop device binding before using +the disk image from Hatari: +
++# umount $mountdir +# losetup -d $loop ++ +
+Hatari has a built-in debugging interface which can be used for +analyzing the program that runs in the emulated system. The debugger +uses Hatari's parent console window, so make sure you run Hatari from +the command line when you want to use the debugger. To invoke +the debugger, press the AltGr + Pause key +combination. +
+ +
+If you start Hatari with the "-D" command line option, m68k +exceptions will automatically invoke the debugger. You can toggle +this also later from the debugger with the "setopt -D" +command. +
+ ++When entering values to the debugger in other number bases than the +default/selected one, they need to be prefixed with a character +indicating this. For decimals it's "#" (#15), for +hexadecimals "$" ($F), and for binary values it's +"%" (%1111). By default the debugger expects all values +without a prefix to be decimals, but you can change the default number +base with the "value" command. +
+ ++At the debugger prompt, type "help" to get a list of all +the available commands and their shortcuts: +
++Available commands: + dspaddress (da) : toggle or list (traditional) DSP address breakpoints + dspbreak (db) : set/remove/list DSP register/RAM condition breakpoints + dspdisasm (dd) : disassemble DSP code + dspmemdump (dm) : dump DSP memory + dspreg (dr) : read/write DSP registers + dspcont (dc) : continue emulation / DSP single-stepping + address ( a) : toggle or list (traditional) CPU address breakpoints + breakpoint ( b) : set/remove/list register/RAM condition breakpoints + disasm ( d) : disassemble from PC, or given address + cpureg ( r) : dump register values or set register to value + memdump ( m) : dump memory + memwrite ( w) : write bytes to memory + logfile ( f) : open or close log file + loadbin ( l) : load a file into memory + savebin ( s) : save memory to a file + setopt ( o) : set Hatari command line options + value ( v) : set number base / show value in other number bases + cont ( c) : continue emulation / CPU single-stepping + quit ( q) : quit emulator + help ( h) : print help ++ +
+In the beginning, probably the most interesting commands are +"m" and "d" for dumping and disassembling memory +regions. +
++> help memdump +'memdump' or 'm' - dump memory +Usage: m [address] + dump memory at address or continue dump from previous address. ++
+> help disasm +'disasm' or 'd' - disassemble from PC, or given address +Usage: d [address] + If no address is given, this command disassembles from the last + position or from current PC if no last postition is available. ++
+> d +0000aa6e: 2f08 0241 0fff 207c 00fe MOVE.L A0,-(A7) +0000aa70: 0241 0fff 207c 00fe 78c0 AND.W #$0fff,D1 +0000aa74: 207c 00fe 78c0 2070 1000 MOVEA.L #$00fe78c0,A0 +0000aa7a: 2070 1000 4ed0 0241 0ffe MOVEA.L (A0, D1.W*1, $00) == $00fe34ae,A0 +0000aa7e: 4ed0 0241 0ffe 6712 e549 JMP.L (A0) ++ +
+Hatari has two kinds of breakpoints. First, there are the fast and +simple address breakpoints which trigger when the CPU (or DSP) program counter +hits a given address. Use "a" (or "da" for the DSP) to +manage them. Then there are the conditional breakpoints which are a little bit +slower but can handle more complex break conditions. Use "b" (or +"db" for the DSP) to manage them. "b help" explains +the syntax: +
+ ++breakpoint = <expression> [ && <expression> [ && <expression> ] ... ] +expression = <value>[.mode] [& <number>] <condition> <value>[.mode] + +where: + value = [(] <register-name | hatari-variable | number> [)] + number = [#|$|%]<digits> + condition = '<' | '>' | '=' | '!' + addressing mode (width) = 'b' | 'w' | 'l' + addressing mode (space) = 'p' | 'x' | 'y' ++ +
+If the value is in parenthesis like in '($ff820)' or '(a0)', then the +used value will be read from the memory address pointed by it. +
++M68k addresses can have byte ("b"), word ("w") or +long ("l", default) width. DSP addresses belong to different +address spaces: "P", "X" or "Y". Note +that on DSP only R0-R7 registers can be used for memory addressing. +
+ +Examples:
++pc = $64543 && ($ff820).w & 3 = (a0) && d0 = %1100 +(r0).x = 1 && (r0).y = 2 ++ +
+The debugger supports also setting breakpoints on values of some +internal Hatari variables (listed by "b help"). For example +if you want to stop at a specific cycle within a frame (that is, PC +relative to the current VBL/HBL in cycles), set breakpoints to specific +"HBL" and "LineCycles" variable values. + +
+After analyzing and/or setting new breakpoints, you can continue the emulation +with the "c" command. You can continue for a given number of +CPU instructions (or DSP instructions when "dc" is used), or +you can continue forever (until a breakpoint triggers) if you omit the +instruction count. +
+ ++By the way, if you want to continue with real-time disassembling, you +can enable it by typing "setopt --trace cpu_disasm" at the +debugger prompt. Disable it with "setopt --trace none" when +you enter the debugger again. "--trace help" can be used to +list all the supported trace points. (Similar things can be done even +from a program within the emulation if you enable Hatari +"--bios-intercept" option and call XBios 255 from +the program with a suitable command line string.) +
+ ++Lastly, the debugger is much nicer to use with the command line +editing support. If you're building Hatari yourself, please make sure +that you have the GNU readline development files installed (on Debian +/ Ubuntu these come from the libreadline5-dev package). Otherwise +this doesn't get enabled when you configure Hatari. +
+ + ++Unless you've disabled compiler optimizations (like GCC's -O2 or -O3 +options) in the Hatari build, the extra optimization flags (like GCC's +"-mtune=i686") don't seem to have very large effect on Hatari +performance. +
++However, Hatari can be sped up considerably by giving up some +emulation or emulator accuracy. Most of these options should +be needed only on slow devices like handhelds. +
+ + ++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! +
+ ++Emulating the DSP is performance-wise several times more demanding +than emulating the m68k; DSP runs at higher frequency, executes many +instructions for each m68k instruction and emulation isn't as mature +and optimized. Unless some program needs DSP, none or +dummy DSP emulation mode could be used. Even of the programs +that do use DSP, many use it only for background music and work +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 +option (about) doubles Hatari performance as it significantly reduces +the number of interrupts generated by the emulated Atari machine. +Using this has adverse effect only for very rare programs. +
++After the DSP and Timer-D interrupts, m68k emulation takes most time. +Disabling the "Slower but more compatible CPU" option will speed up +the emulation a lot, but it won't anymore be cycle accurate. This can +be fine for many games and other programs, but won't work e.g. for demos +using overscan or rasters. +
+ ++Roughly speaking, for DSP emulation, one needs at least 2Ghz machine; +for normal (unpatched) Timer-D frequency on some specific cases (like +demos with overscan 512 color animations) one may need over 1GHz +machine. For Compatible CPU one needs at least 1/2Ghz machine. +
++Above options may cause some programs not to work correctly. +The Hatari Software Compatibility List lists +programs known to need real DSP emulation or Timer-D frequency. +
+ + ++Emulator options don't have as large effect on performance as +emulation options, but they don't affect the emulated programs at all, +just the quality of the emulation "output". These options can also +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 +(depending on other options you're using). Disabling sound will get +rid of that. Using low sound frequency or one matching your sound +card may also help. Best is if you disable also background music +from the programs you run in Hatari as this can significantly reduce +the number of generated interrupts. +
++Screen rendering can take noticeable amount of CPU time. The default +Hatari "auto" frame skipping should be used unless there's a good +reason not to. It will skip converting and showing some of the frames +if there's not enough time for them. If your monitor refresh frequency +is lower than the selected Hatari monitor frequency (e.g. LCD monitors +usually use 60Hz whereas Atari monochrome monitor uses 72Hz), you +should use frameskip of one. The reason is that if your SDL library +uses VSync to synchronize the output to screen (like OSX one?), with +zero frame skip that forces the emulation to run slower than a real +Atari. If SDL doesn't use VSync, 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. If you still want to have a +nice fullscreen mode, you should rather add the right resolution +mode-lines (e.g. "320x200") to your xorg.conf file. If you still +want 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 +screens and you care more e.g. from the sound quality than visuals, you +can disable the Spec512 mode handling by zeroing the threshold for that +with the --spec512 0 option. +
++If your version of libSDL uses VSync to synchronize the screen +output, drawing of the statusbar or the drive LED (when statusbar is +disabled) may have some minor impact on performance too. Normally +they shouldn't. +
+ ++Btw. Hatari currently runs best in 16 or 32 bits per pixel color depth +mode, so try to avoid 24 bits per pixel display modes if possible. +16-bit mode is fastest. +
++If nothing else helps, try an earlier Hatari version. More accurate +emulation or emulator output in newer Hatari versions means that they +can be slower despite optimizations. +
+ + ++There are a couple of ways to monitor and measure Hatari performance. +
++By default Hatari has Statusbar visible and automatic frameskip +enabled. When Hatari has enough time that it can sleep a little each +frame, the statusbar frame skip ("FS") value keeps at zero. If Hatari +is completely busy, it will increase to the maximum specified +(automatic) frame skip value. +
++Hatari has also a facility to measure FPS i.e. Frames Per Second. +Just enable the --fast-forward option +on command line (or use the corresponding keyboard shortcut), and +after a while, press the "Pause" key. Whenever Hatari emulation is +paused, Hatari will show how many VBLs it could show per second along +with some other numbers. +
++It depends on what you want to measure, but usually it's best to +disable sound and set high frame skip like +--sound off --frameskips 60 so that +the associated external overheads are minimized. E.g. video output +can on some platforms do VSync and measurements would then show +your monitor refresh frequency instead of actual Hatari performance. +
++On Unix systems with times() function +call, only the time spent by the Hatari process itself is measured. +On other systems much less accurate SDL "wall clock" timings are +used. To make latter more accurate you could use also +--run-vbls option to specify how many +VBLs Hatari should run in fast forward mode before it exits. In this +case it's best to either have the test-case run automatically from the +AUTO-folder or given as memory snapshot to Hatari with the frame skip +set equal to the VBL count. +
++Note that the numbers can fluctuate quite a bit, especially +when the SDL timings are used, so for (statistically) reliable numbers +you may need to repeat the measurement several times. You should of +course make also sure that the system doesn't have any other activity +at the same time you're making the measurements. +
+ +