--- hatari/doc/manual.html 2019/04/09 08:51:25 1.1.1.15 +++ hatari/doc/manual.html 2019/04/09 08:58:26 1.1.1.21 @@ -1,15 +1,13 @@ - - + + Hatari User's Manual - - - - - - + content="User's manual for the Atari ST emulator Hatari" /> + + + + + @@ -55,105 +64,30 @@

Hatari User's Manual

-

Index

- +

Index

+
+ +
-

Introduction

+

Introduction

-

General description

+

General description

-Hatari is an Atari ST, STE, TT and Falcon emulator for Linux, OSX, +Hatari is an Atari ST, STE, TT and Falcon emulator for Linux, *BSD, macOS, Windows and other Systems which are supported by the SDL library. The emulator is open source software and is distributed under the terms of the GNU General @@ -170,13 +104,14 @@ Unlike many other Atari ST emulators whi environment for running GEM applications, Hatari tries to emulate the hardware of a ST as close as possible so that it is able to run most of the old ST games and demos. Of course you can run normal GEM applications with Hatari, too. -Recent versions of Hatari even feature STE, Falcon and basic TT emulation.

-

Features

+

Features

-

STE hardware emulation

There is support for following additional STE features:

+

+Hatari can also emulate a Mega-STE, which had slightly different hardware +compared to a normal STE (like a built-in real time clock chip). +

-

Experimental TT hardware emulation

There is support for following additional TT features:

+

+Note that TT emulation is incomplete – additional hardware like the +second MFP and the SCC UARTs is not emulated yet. +

-

Falcon hardware emulation

There is support for following additional Falcon features:

@@ -260,41 +204,20 @@ Software Compatibility List for whic to be affected by them.

-

System requirements

- -

Hatari currently has the following minimum system requirements:

- +

System requirements

-In the course of time Hatari has successfully been tested by various people on -the following systems: +Hatari needs a fast machine (1 GHz or more for ST/STE emulation, > 2 GHz +for Falcon emulation) which is running a POSIX compatible operating system +(preferably GNU/Linux) that supports the SDL library. +There are also some ports to other operating systems like macOS or Windows, +but they are not used by the developers, so such builds are normally not very +well tested.

- -

Compiling and running

+

Compiling and running

-

Compiling Hatari

+

Compiling Hatari

Required:

@@ -2182,22 +1496,23 @@ Selecting "Crop statusbar" option will l the screenshots and recorded videos.

-

The Keyboard Dialog

+

The Keyboard Dialog

-Hatari's GUI - the keyboard dialog + Hatari's GUI - the keyboard dialog

Here you can select the keyboard mapping to use. Two different mappings called "Symbolic" and "Scancode" are predefined.

"Symbolic" tries to map the symbolic values of your PC keys to the ST keys. It should be working pretty good on all systems as long - as your keyboard layout looks close to the standard english keyboard + as your keyboard layout looks close to the standard English keyboard layout. However, you might experience some problems with special keys like brackets etc.

-

"Scancode" uses the scancode values of your PC keys for keyboard - mapping. This only works on certain architectures like Linux where the - scancodes are similar to the ST scancodes (e.g. it does not work on Mac OS X). +

"Scancode" uses the scancode values of your PC keys for keyboard mapping. + This only works on certain architectures like Linux where the scancodes are + similar to the ST scancodes (e.g. it does not work on macOS with SDL1.2). If it works on your system, this often gives better results than the symbolic mapping. Note that you also need a TOS version with the right language (e.g. use a French TOS if you are using a French keyboard).

@@ -2207,22 +1522,42 @@ the screenshots and recorded videos. at the supplied example mapfile (keymap-sample.txt) to see how to create your own keyboard mapping.

- When the emulator runs in fast forward mode, and you want to type text, - it can be annoying that the emulated system detects multiple key events - due to the key repetition of the emulated system. To avoid this you can - disable the key repetition in fast forward mode here. + The "Shortcuts" section can be used to configure the keyboard shortcuts + that can be activated while the emulation is running. Hatari supports + two sets of keyboard shortcuts: The first type is activated by pressing a + modifier key (AltGr / right Alt by default, Cmd key on macOS) together with + the key, and the second type is directly activated by pressing a single key, + without additional modifier key. + Use the arrow buttons to select the shortcut that you want to change, + then press one of the Define buttons to + change the key for the shortcut. You'll be prompted to press the key + that should be used. + If you reconsider and don't want to change the key, you can press the + left mouse button instead. By pressing the right mouse button during + the prompt, you can also erase the current shortcut setting. +

+

+ The last setting in this dialog can be used to disable the key repetition + in fast forward mode. When the emulator runs in fast forward mode, and you + want to type text, it can be annoying that the emulated system detects + multiple key events due to the key repetition of the emulated system. + So this can be avoided by enabling this option.

-

The Sound Dialog

+

The Sound Dialog

-Hatari's GUI - the sound dialog + Hatari's GUI - the sound dialog

Here you can control the sound subsystem.

-

Check if you want emulated sound at all. Emulation is faster if +

Check "Enabled" if you want emulated sound at all. Emulation is faster if sound emulation is turned off.

+

If you experiment latency issues with your OS audio's output, you +can check the "Synchronize" option to adjust Hatari's video emulation to match +your OS audio.

Nine frequencies from low to high quality are available. Experiment a little bit to find out which fits best for your setup. @@ -2232,8 +1567,10 @@ sound emulation is turned off.

the STE/TT/Falcon sound DMA.

-YM voice volume mixing "ST table" method uses a lookup table of audio output -voltage values measured on STF and "Linear" just averages the 3 YM voices. +YM voices volume mixing "ST table" method uses a lookup table of audio output +voltage values measured on STF, "Math model" uses a complex model to mix the +3 YM voices and "Linear" just averages the 3 YM voices. Use "ST table" or "Math model" +for accurate sound's emulation.

You can select to record a piece of sound here. @@ -2245,20 +1582,21 @@ voltage values measured on STF and "Line

-

The Devices Dialog

+

The Devices Dialog

-Hatari's GUI - the device dialog + Hatari's GUI - the device dialog
-

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 Browse 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 @@ -2267,145 +1605,195 @@ 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 Browse 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 software sound -synthetizing on Linux (using Alsa) if your sound card/driver doesn't +synthesizing on Linux (using Alsa) if your sound card/driver doesn't support MIDI, and how to set up MIDI networking e.g. between multiple Hatari instances.

-

Keyboard shortcuts

+

Keyboard shortcuts for the SDL GUI

+ +

There are multiple ways to interact with the SDL GUI.

+ +

TAB and cursor keys change focus between UI elements. Additionally +Home key moves focus to first item, End key to last one. Initially +focus is on default UI element, but focus changes are remembered +between dialog invocations. Enter and Space invoke focused item. UI +elements with underlined characters can be invoked directly with Alt + +key with that character. Alt + arrow keys will act on arrow +buttons.

+ +

Most importantly:

+ + + +

Keyboard shortcuts during emulation

While the emulator is running, you can activate or toggle various -features via Hatari keyboard shortcuts. Below are listed the default -shortcut key bindings:

- - +features via Hatari keyboard shortcuts. Most of them require the +AltGr (right Alt) +modifier key. On Mac macOS, the Cmd key ⌘ is used instead. +Below are listed the default shortcut key bindings:

+
+ - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
ShortcutPurposeShortcutPurpose
AltGr+arecord animation
AltGr+ggrab a screenshot
AltGr+iboss key: leave full screen mode, pause Hatari + and iconify its window
AltGr+m(un-)lock the mouse into the window
AltGr+r(warm) reset the ST
ALTGR+arecord animationAltGr+ccold reset the ST (same as the original power switch)
ALTGR+ggrab a screenshotAltGr+dopen dialog to select/change disk A
ALTGR+iboss key: leave full screen mode, pause Hatari -and iconify its windowAltGr+senable/disable sound
ALTGR+jtoggle joystick emulation via cursor keys -on/off between ports 0 and 1AltGr+qquit the emulator
ALTGR+m(un-)lock the mouse into the windowAltGr+xtoggle normal speed/fast forward
ALTGR+r(warm) reset the STAltGr+yenable/disable sound recording
ALTGR+ccoldreset the ST (same as the original power -switch)AltGr+ksave memory snapshot
ALTGR+dopen dialog to select/change disk AAltGr+lload memory snapshot
ALTGR+senable/disable soundAltGr+jtoggle joystick emulation via cursor keys + on/off between ports 0 and 1
ALTGR+qquit the emulatorAltGr+F1switch joystick type on joy port 0
ALTGR+xtoggle normal speed/fast forwardAltGr+F2switch joystick type on joy port 1
ALTGR+yenable/disable sound recordingAltGr+F3switch joystick type for joypad A
ALTGR+ksave memory snapshotAltGr+F4switch joystick type for joypad B
ALTGR+lload memory snapshotAltGr+btoggle borders on/off
ALTGR+f or F11toggle between fullscreen and windowed modeAltGr+f or F11toggle between fullscreen and windowed mode
ALTGR+o or F12activate the options GUIAltGr+o or F12activate the options GUI
PAUSEpause emulationPausepause emulation
AltGr+PAUSEinvoke the internal Hatari debuggerAltGr+Pauseinvoke the internal Hatari debugger

You can change the key bindings from the Hatari configuration file. -The required key values can be seen in the SDL_keysym.h include file -(usually in /usr/include/SDL/).

+See keymap-sample.txt file for instructions.

-

Emulated Atari ST keyboard

+

Emulated Atari ST keyboard

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:

- - + +
+ - - + + + + - - + + - - + + - - + + - - + + - - + + - - + +
KeyMeaningKeyMeaning
Altwill act as the ST's ALTERNATE keyAltwill act as the ST's ALTERNATE key
left CTRLwill act as the ST's CONTROL keyleft CTRLwill act as the ST's CONTROL key
Print Screenwill emulate the ST's HELP keyPrint Screenwill emulate the ST's HELP key
Scroll Lockwill emulate the ST's UNDO keyScroll Lockwill emulate the ST's UNDO key
Page Upwill emulate the ST's ( key in the keypadPage Upwill emulate the ST's ( key in the keypad
Page Downwill emulate the ST's ) in the keypadPage Downwill emulate the ST's ) in the keypad
@@ -2415,35 +1803,40 @@ are used for the directions and -

NOTE: Problems with simultenous keypresses most likely aren't an +

NOTE: Problems with simultaneous keypresses most likely aren't an issue in Hatari as many modern keyboards report/support only three -simultenous key presses (or even just two depending on which keys +simultaneous key presses (or even just two depending on which keys are in question). Expensive gaming keyboards support more.

-

Emulated mouse

+

Emulated mouse

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 +which allows you to move mouse outside the Hatari window while Hatari is up and running. Note: pausing the emulation will also (temporarily) release the mouse grab.

+

Middle button click emulates double click, which is very useful +in Fast Forward mode (where normal double clicking is nearly +impossible).

Mouse scrollwheel will act as cursor up and down keys.

-

Emulated joystick

+

Emulated joystick

-

The Atari ST joysticks are emulated ofcourse allowing you to play +

The Atari ST joysticks are emulated of course allowing you to play your favourite games with Hatari.

The default mode is to use a connected PC joystick. You can use any -joystick that is supported by your kernel. If your joystick works with -other applications, it will likely work with Hatari as well. Make sure +joystick that is supported by your kernel / SDL library. If your joystick works +with other applications, it will likely work with Hatari as well. Make sure it is calibrated and then off you go. Move the stick to point into the desired direction. Please note that Hatari will not detect analogue movement as the Atari ST only had digital joysticks. The first @@ -2462,7 +1855,7 @@ cursorkeys in this mode as long as you p along with the cursorkeys. You can also configure these keys from the joystick options.

-

Emulated video

+

Emulated video

Hatari emulates all screen modes of the original machine.

@@ -2479,11 +1872,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.

-

Emulated printer

+

Emulated printer

-

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 @@ -2493,13 +1886,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.

-

Emulated RS232

+

Emulated RS232

Serial communications in Hatari is designed to directly use a serial port on your PC.

@@ -2509,13 +1902,35 @@ the communication parameters like baudra software. Hatari will do the rest and handle the serial input and output for you.

-

Floppy disk images

+

Floppy disk images

Hatari does not use floppy disks directly but disk images due to differences between the floppy disk controllers of the ST and the PC. -Three types of disk images are currently supported: The raw "ST" type, -the similar "DIM" type and -the compressed "MSA" (Magic-Shadow-Archiver) type.

+Several types of disk images are currently supported : +

+ + +

The raw type (file suffix should be "*.st") is simply a sector by sector image of a real floppy disk. You can easily create such an image with the dd program which should @@ -2530,7 +1945,7 @@ or doesn't use a MSDOS compatible file system, this might fail. So be very careful if you are not sure about the disk format.

The other possibility is to image the disk on a real Atari ST. -There +For non-protected disk, there are programs like the Magic Shadow Archiver for this task. Hatari supports this slightly compressed MSA disk images, too. Note that Hatari @@ -2541,8 +1956,15 @@ Hatari-incompatible disk images. However disk and want to use it with Hatari, you can still run the corresponding MSA program within Hatari to extract the incompatible disk image to a -normal floppy disk image.

-

While *.ST and *.MSA are more or less the "standard" types of Atari +normal floppy disk image. +

+For protected disk, the most widely used method is to run pasti.prg on +a real Atari ST and get a .STX image. +
+For more complex protections or altered disk, one can use *.IPF or *.CTR +which include tools to check MFM data and possible problems when dumping a disk. +

+

While *.ST, *.MSA and *.STX are more or less the "standard" types of Atari disk images, you might sometimes also find STT or ADF images on the internet. These currently do not work with Hatari.

Hatari can now also utilize *.DIM images just as *.ST ones without @@ -2580,82 +2002,134 @@ your highscores and savegames are lost i a zipped disk image.

-

Hard disk support

+

Hard disk support

-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 +Hatari supports three ways of emulating Atari hard drives: The +low-level ACSI and IDE hard drive emulation and a GEMDOS based HD +emulation. In most cases the GEMDOS HD 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 +the emulated Atari since it is not possible to switch the hard drive while the emulator is running.

On a 32-bit host system, the size of a hard disk image is limited to 2 GB. On 64-bit host systems, bigger images might be possible but the support -for bigger images is not tested very well yet. How large partition sizes -are supported inside the hard disk (images) depends on the TOS version. -TOS 1.0x supports up to 256MB partitions and TOS 4.0x up to 1GB ones. +for bigger images is not tested very well yet. +

+

+The maximum size of partitions inside the hard disk (images) depends on the +TOS version. TOS 1.00 and 1.02 support up to 256 MB, TOS 1.04 to 3.06 up to +512 MB and TOS 4.0x supports up to 1 GB partitions. +

+

+NOTE: you need to be careful when mounting device files. Depending on +the system setup (e.g. udev settings) partitions on memory cards etc. +can be mounted automatically. When Hatari is started and uses a device +file with partitions that are already mounted, data can be destroyed +(when several programs independently write to the same device). +Disable your desktop automount, or remember to manually unmount +devices before giving them to Hatari.

-

GEMDOS based hard disk emulation

+

GEMDOS based hard drive emulation

-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. +With GEMDOS HD emulation, you can easily "mount" a 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. For example following +directory setup:

+
+partitions/
+  + C/
+  + D/
+

-GEMDOS drive emulation is an easy way to share files between the +That is given to Hatari as "hatari -d partitions", will give you +GEMDOS HD emulated C: and D: drives. +

+

+GEMDOS HD emulation is an easy way to share files between the host system and the emulated Atari, but there are also some known -limitations which are due to the way the GEMDOS drive emulation is +limitations which are due to the way GEMDOS HD emulation is implemented:

-So, if your programs complain that they could not find/read/write -files on the GEMDOS emulated drive, you should try to copy them to a -floppy disk image or a real hard disk image! +If your programs complain that they could not find/read/write +files on the GEMDOS emulated drive, you can copy and use them +from a floppy disk image or a real hard disk image instead. +

+ + +

ACSI & IDE hard drive emulation with EmuTOS

+ +

+Accessing HD image files is easiest with EmuTOS. It supports both +ASCI and IDE interfaces, regardless of emulated machine type, and +understands DOS partition tables without additional drivers. +atari-hd-image.sh script coming +with Hatari can be used to create such image files and to copy +initial data to them. +

+

+If you have an hard drive (image) with Atari format partition table, +that should already have hard disk driver on it and work fine. +Partitioning/formatting them is the problem. Creating such images +from scratch is described in following sections.

-

ACSI hard disk emulation

+ +

ACSI hard drive emulation

-To use the ACSI hard disk emulation, you need a hard disk image file +To use the ACSI hard drive emulation, you need a hard disk image file with a pre-installed HD driver in it. You can try to get an image of your old ST hard disk or grab one from the internet (e.g. from the Hatari website). +Please note that the size of ACSI hard drive is normally limited to 1 GB +due to some addressing constraints of the ACSI bus. Bigger disks were only +possible with certain host adapters – this behaviour is emulated by +Hatari, too, but you need a hard disk driver that supports these extensions.

To create a new ACSI hard disk image, you can start with an empty @@ -2676,13 +2150,19 @@ the hard disk image from the emulated At After installing the hard disk driver to the fresh HD image with HINSTALL.PRG, you can boot directly from the hard disk image.

+

+HD Driver (v9) partitioning is also compatible with Hatari ACSI +emulation. CBHD and ICDPro AdSCSI drivers work on images which have +been partitioned elsewhere. +

+ -

IDE hard disk emulation

+

IDE hard drive emulation

As the IDE disk format (little endian) differs from the ACSI disk format (big endian), you need separate disk images for them. Hatari doesn't -currently support formatting IDE disks with AHDI, but you can do it with +currently support partitioning IDE disks with AHDI, but you can do it with Cecile.

@@ -2708,9 +2188,9 @@ If you only want to use your HD image in the Cecile hard disk driver to the image from the Cecile CC_TOOLS.APP: 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 -emulation section). +image in ST/STE mode, you need to get and install either HD Driver or +AHDI 6 driver on it instead (see ASCI +hard drive emulation section).

Then you can boot from your hard disk image by simply specifying it @@ -2718,62 +2198,66 @@ with the --ide

-

Moving files -to/from hard disk images

+

Moving files to/from hard disk images

Moving files to and from Atari hard disk images can be done -either through GEMDOS partitions (host directories mounted inside +either through GEMDOS HD partitions (host directories mounted inside Hatari emulation) or accessing the images directly on the host (outside the emulation). Both have their own limitations.

-

If it's fine for the IDE/ACSI partitions to be first, you can use -hard disk images with AHDI or Cecile driver and a multipartition -GEMDOS setup as described in above sections. If you want to boot from -a GEMDOS partition i.e. such to be before hard disk image partitions, -and still to be able to access all the IDE/ACSI partitions, you need to -use HD Driver.

+

If it's fine for the IDE/ACSI partitions to be first, you can +either use ACSI/IDE partition skip option, or a multipartition GEMDOS +HD setup as described in above sections. +

+ +

If you want to boot from a GEMDOS HD partition i.e. such to be +before hard disk image partitions, and still to be able to access all +the IDE/ACSI partitions, you need to use HD Driver. Note: this is the +preferred method with EmuTOS (v0.9.x), because it doesn't run/use +driver installed to the IDE/ACSI image directly although its own +partition table/type support is very limited.

-

Using HD Driver -with GEMDOS partitions

+

Using HD Driver with GEMDOS partitions

Uwe Seimet's HD -Driver works fine with both the Hatari GEMDOS partitions and normal -hard disk images. However, it doesn't work with EmuTOS so you need -real TOS (at least version v1.04). +Driver works fine with both the Hatari GEMDOS HD partitions and normal +hard disk images.

-

First copy the HDDRIVER.PRG binary into your GEMDOS drive emulation +

First copy the HDDRIVER.PRG binary into your GEMDOS HD emulation directory AUTO folder. Then start the HDDRUTIL.APP configuration utility, locate HDDRIVER.PRG, open the "Devices and Partitions" dialog and select the "Preserve Existing Partitions" option. Then you can just start Hatari with your hard disk image and -this GEMDOS directory, for example like this: -"hatari --harddisk gemdos-hd/ --ide-master +this GEMDOS HD directory, for example like this: +"hatari --harddrive gemdos-hd/ --ide-master ide-hd.image".

-

If you're using the demo version of HD Driver, you can -write files only to the C: partition, i.e. in above case only copy -files from the hard disk image partition to the GEMDOS partition (with -some write slowndowns included into the demo version). If you want to -copy files to the hard disk image with the demo version of -the HD Driver, you need to set the hard disk image as drive C:.

+

If you're using +the demo version +of HD Driver, you can write files only to the C: partition, i.e. in +above case only copy files from the hard disk image partition to the +GEMDOS HD partition (with some write slowdowns included into the demo +version). If you want to copy files to the hard disk image with +the demo version of the HD Driver, you need to set the hard disk +image as drive C:.

-

To accomplish this, set the GEMDOS partitions to be from D: forward, +

To accomplish this, set the GEMDOS HD partitions to be from D: forward, i.e. have a directory which contains only single letter subdirectories, starting from "D" like in "mkdir gemdos-hd; mkdir gemdos-hd/D". Then give Hatari (as the last parameter) a boot floppy image containing the demo version of HDDRIVER.PRG in its AUTO folder, like this: "hatari ---ide-master ide-hd.image --harddisk gemdos-hd/ hd-driver-floppy.st". -

+--ide-master ide-hd.image --harddrive gemdos-hd/ hd-driver-floppy.st
". +You can convert HD Driver ZIP package to floppy image with the +zip2st utility.

-

Accessing -HDD image partitions outside of Hatari

+

Accessing HDD image partitions outside of Hatari

-If you want to access the harddisk image partitions also outside +If you want to access the hard disk image 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. @@ -2783,14 +2267,12 @@ Inside the Hatari emulator, EmuTOS can a kind of images directly without any driver software. Of the Atari HD drivers mentioned above, Centek's Cecile and Uwe Seimet's HD Driver (demo) work fine with these partitions. E.g. AHDI and CBHD don't. +Cecile works only with TT or Falcon.

-Note that plain EmuTOS supports only ACSI and the listed HD drivers -support only IDE (emulation). Cecile needs TT or Falcon and HD Driver -doesn't work with EmuTOS. 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 summarise; if EmuTOS is enough, use that. 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 @@ -2844,50 +2326,80 @@ from the loop device on top of the "hd"

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: +to unmount the file system and remove the loop device binding before +using the disk image from Hatari:

 # umount $mountdir
 # losetup -d $loop
 
-

The debugger

+ +

The debugger

Hatari has a built-in debugging interface which can be used for -analyzing code that runs in the emulated system. To invoke the -debugger, press the AltGr + Pause -key combination. +analyzing code that runs in the emulated system.

-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. +On Unix (Linux / macOS) debugger uses Hatari's parent console window, so +make sure you run Hatari from the command line when you want to use +the debugger. On Windows you need to use "-W" option to get console +window. You can add an icon to your desktop that does it. On Linux +it should do something like this (replace "xterm" with your favorite +terminal program):

+
+xterm -T "Hatari debug window" -e hatari
+

-To run debugger commands at Hatari startup, one can use the "--parse -<file>" command line option. This is useful e.g. for debugging -TOS or some demo startup code, or if you always want to use some -specific debugger setup (breakpoints etc). +To run debugger commands from a file at Hatari startup, one can use +the "--parse <file>" command line option. This is useful e.g. +for debugging TOS or some demo startup code, or if you always want to +use some specific debugger setup (breakpoints etc).

-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. On -Linux you can add for example an icon to your desktop that does it -with something like this (replace "xterm" with your favorite terminal -program): +Note that when debugger scripts are run, current directory is set to +the currently running script's directory i.e. all file operations are +relative to it. After script finishes, earlier current directory is +restored. To set current directory from a setup script, e.g. for +scripts run at breakpoints, you need to give '-f' option for the +'cd' command. +

+ + +

Invoking the debugger

+ +

+You can invoke the debugger manually by pressing the +AltGr + Pause key combination. +

+ +

+With the "-D" command line option, you can toggle whether m68k +exceptions will also invoke the debugger. Which exceptions cause +this, can be controlled with the "--debug-except" option.

-
-xterm -T "Hatari debug window" -e hatari
-
+

+Giving "-D" option at Hatari startup is not advised because TOS HW +checks generate some exceptions at every TOS boot. It's better to +toggle exception catching later from the debugger with the "setopt -D" +command. +

-

General debugger use

+

+Alternatively, you can give "--debug-except" option "autostart" flag +(e.g. "--debug-except all,autostart"). This will enable catching of +(specified) exceptions after TOS boot, when Atari program given on +Hatari command line is autostarted. +

+ + +

General debugger use

At the debugger prompt, type "help" to get a list of all @@ -2898,15 +2410,18 @@ Generic commands: cd ( ) : change directory evaluate ( e) : evaluate an expression help ( h) : print help - history (hi) : show last CPU & DSP PC values & executed instructions + history (hi) : show last CPU/DSP PC values & executed instructions info ( i) : show machine/OS information lock ( ) : specify information to show on entering the debugger logfile ( f) : open or close log file parse ( p) : get debugger commands from file + rename ( ) : rename given file + reset ( ) : reset emulation setopt ( o) : set Hatari command line and debugger options stateload ( ) : restore emulation state statesave ( ) : save emulation state trace ( t) : select Hatari tracing settings + variables ( v) : List builtin symbols / variables quit ( q) : quit emulator CPU commands: @@ -2918,8 +2433,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 through subroutine calls / to given instruction type cont ( c) : continue emulation / CPU single-stepping DSP commands: @@ -2930,11 +2447,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 through subroutine calls / to given instruction type dspcont (dc) : continue emulation / DSP single-stepping - -

Entering arguments to debugger commands

+ +

Entering arguments to debugger commands

After writing (with TAB completion) one of the above command names, @@ -2971,7 +2490,7 @@ D0 register values to a command, use "a0

Within arithmetic expressions parenthesis are used both to change -the order of precendence and to indicate indirect addressing. +the order of precedence and to indicate indirect addressing. Unlike with conditional breakpoint expressions (explained below), you cannot give size for the indirect addressing, a long value is always read from the RAM address given within parenthesis. For example to @@ -2981,7 +2500,7 @@ get a long value pointed by stack pointe

Values of arithmetic expressions are always evaluated before being given to a command. Except for "evaluate" and "address" commands, -they always need to be marked with quotes (""). Besides arithmetics, +they always need to be marked with quotes (""). Besides arithmetic, this can be used also to give symbol/register/variable values to commands that don't otherwise interpret them. If command complains that it didn't recognize e.g. a register name, just put it to quotes @@ -2989,13 +2508,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.

-

Inspecting emulation state

+

Inspecting emulation state

In the beginning, probably the most interesting commands are "m" and "d" @@ -3029,7 +2548,12 @@ Both commands accept in addition to nume and symbol names, like in above example. If you don't specify an address, the commands continue showing from an address that comes after the previously shown data. "disasm" command default address -will be reseted to PC address everytime you re-enter the debugger. +will be reset to PC address every time you re-enter the debugger. +

+ +

+Use "setopt --disasm help" if you want to set options controlling +the disassembly output.

@@ -3069,17 +2593,105 @@ Without arguments "lock" command will sh

-

Debug symbols

+

Debug symbols

-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. +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").

-

The symbols file format is following:

+ +

For a program under GEMDOS HD emulation

+ +

+If currently running program contains symbol table in DRI/GST format, +and it's started from GEMDOS HD emulated drive, its symbol names / +addresses are automatically loaded when debugger is entered, and +removed when program terminates.

+ +

+Above happens only if there are no symbols loaded when the program +starts. If there are, you can load program symbol data manually 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: +

+
+
Devpac:
+
"OPT D+,X+"
+
AHCC:
+
"-g", and "-l" option for local symbols, both for linking
+
GCC:
+
"-Wl,--traditional-format" option for linking, + and "-g" for compilation to get local symbols
+
VBCC:
+
"-g" (can only be used at linking phase), when VBCC + configuration file uses "-bataritos" option for + the linker
+
+ +

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.) + + +

For a program on a (disk) image

+ +

+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
+
+ + +

ASCII debug symbol files

+ +

+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: +

+ + +

NOTE: nm output for GCC generated +a.out binaries includes labels also for loops, +not just functions. While loop labels are fine for debugging, they should +be removed before profiling. Besides causing misleading profile +results, loop labels can seriously slow down profiling +(call graph tracking is automatically enabled for profiling when debug +symbols are loaded, and operations done on each matched symbol address +cause huge overhead if that match is for something happening every few +instructions). +

+ + +

ASCII symbols file format is following:

 e01034 T random
 e01076 T kbdvbase
@@ -3093,28 +2705,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 addresses (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 @@ -3166,7 +2773,7 @@ conditions need to be true for a breakpo

-

Breakpoint options

+

Breakpoint options

Normally when a breakpoint is triggered, emulation is stopped and you @@ -3189,7 +2796,7 @@ a $1234 :2 Delete the breakpoint when it's hit i.e. trigger it only once. It may be useful if you just want to get a specific address. Or if you're on an instruction that jumps back to a start of the loop and you want to -finish the loop, you couuld use: +finish the loop, you could use:

 b pc > "pc" :once
 continue
@@ -3208,7 +2815,7 @@ changes (explained below).
 
Show the same information on breakpoint hit as you see when entering the debugger (see the "lock" command in -Inspecting emulation state +Inspecting emulation state above). This enables also trace option as you would anyway see this information if debugger would be entered.
@@ -3219,10 +2826,21 @@ Execute debugger commands from given < is hit. With this you have complete control over what information is show when the debugger is hit, you can even chain breakpoints (as explained in -Chaining breakpoints later on) +Chaining breakpoints later on) etc. Use this if "lock" option isn't enough or you want different information show on breakpoints and when entering the debugger. + +
noinit
+
+Hitting breakpoint doesn't re-initialize debugger which would e.g. +cause profiling data to be reset. This implies trace option as +entering debugger would also re-initialize debugger state. This option +is mainly intended for breakpoints that use :file option to show +backtraces with "profile stack" command during +profiling. See +Usage examples section for an example. +

@@ -3232,7 +2850,7 @@ for address breakpoints you can give onl

-

Breakpoint conditions

+

Breakpoint conditions

"b help" explains very briefly the breakpoint condition syntax: @@ -3263,7 +2881,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 @@ -3276,9 +2894,9 @@ b (a0) = "d0"

If you're interested only on certain bits in the value, you can use '&' and a numeric mask on either side of comparison operator to -mask the coresponding value, like this: +mask the corresponding value, like this:

-b ($ff820).w & 3 = (a0)  &&  (a1) = d0 & %1100
+b ($ff820).w & 3 = (a0)  &&  (a1) = d0 & %1100
 

@@ -3289,6 +2907,9 @@ which indicates inequality ("is not") co b d0 > $20 && d0 < $40 && d0 ! $30

+ +
Tracking breakpoint conditions
+

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 @@ -3314,17 +2935,50 @@ 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 I/O register.

-

Breakpoint variables

+
Breakpoint condition notes
+ + + + +

Breakpoint variables

In addition to loaded symbols, the debugger supports also setting conditional breakpoints on values of some "virtual" variables listed -by "b help". For example: +by "variables" (v) command. For example:

-Hint: "info" command "aes", "gemdos" and "vdi" subcommands for can be -used to list the corresponding OS-call opcodes. For example, -to see the GEMDOS opcodes, use:

+Hint: "info" command "aes", "bios", "gemdos", "vdi" and "xbios" +subcommands can be used to list the corresponding OS-call opcodes. +For example, to see the GEMDOS opcodes, use:

 info gemdos 1
 
- -

Chaining breakpoints and other actions

+

Chaining breakpoints and other actions

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. @@ -3391,13 +3044,19 @@ another one is set.