User Tools

Site Tools


en:emulators:mz8emu:doc

This is an old revision of the document!


SHARP MZ-800 Emulator for Windows by Zdeněk Adler

This is not official documentation/help page for this emulator.

Sources:

FIXME Please help us with this translation and fix any translation mistakes.

Basic Overview

Emulator (mz8emu) is an application for Windows that allows you to run applications and code for a computer of SHARP MZ-800 model range and work with a large number of devices that were used with this computer.

Emulator is designed not only for ordinary users who like to remind their computer history, but also for programmers, as there is integrated line assembler, disassembler, debugger and other tools which allows you to develop and debug programs on your PC.

Minimum System Requirements

The minimum requirements to run the emulator is a PC running at least Windows 95, 98, ME, 2000 or XP. It is not functional under Windows NT. Furthermore, it should have DirectX installed correctly (at least version 7), a sound card is an advantage but is not required.

For optimal performance PC with at least 600 MHz processor or higher is recommended and good AGP graphics card. Content of the SHARP ROM (or so called firmware) is also required as it is not directly bundled with emulator. If you're the real owner of MZ-800, you can download it, or get content directly from your computer using an EPROM programmer.

Emulated Hardware

All SHARP's hardware is emulated as follows:

  • Z80 CPU with precise timing including undocumented instructions
  • Graphics Processor GDG - emulated using the screen scanlines, the possibility to choose 16/32 kilobytes of videoRAM, all graphics modes emulated, including two undocumented (3 and 7)
  • Z80-PIO, 8253, 8255
  • Sound - all 3 channels + 1 noise of PSG emulated (white and synchronous noise) + one channel from 8253, all in the 44100 Hz, 8 bits quality
  • Floppy disk controller compatible with WD279X, floppy disk drive emulation using image MZ-emulation * IDE (8-bit interface for connecting hard disk), viz. more text.
  • Quick drive MZ-1F11 including controller
  • Tape drive as virtual device
  • Ramdisk with power backup (compatible with the original) up to 1 MB or 512 kilobytes Pezik (without power backup)
  • Printer color / black / green screen
  • Mouse Emulation
  • Four-color plotter MZ-1P16

Emulator's License

The emulator is shareware, where the unregistered installation of the emulator is limited for 3 minutes run. Upon expiration of this time the emulator terminates itself and you must start it again. Unlike the full version there are also blocked buttons to save / load emulator states (snapshots) and it will display startup information dialog every time. Primary purpose of this demo mode is to allow you to check whether the emulator will work properly on your PC without any troubles.

Price, Payment Methods

Registration fee is 150 CZK (or 10 US dollars) and can be paid either by electronic payment or by postal order at the post office. This price includes free updates - ie registered user gets the possibility to download a new version of the emulator from the internet without the need for new registration. Method of payment from abroad customers is determined by mutual agreement. For registration related and further information contact the emulator's author via e-mail : zdeneka@seznam.cz.

Registration Process and Terms

After receiving an e-mail with a request for registration an information needed for payment of registration fee will be sent you back, like the account number and a constant symbol. After payment please send a copy of proof of the payment via e-mail (or information, about date in which was an electronic payment acknowledged and under what variable symbol), the name and surname of the buyer and the home address (these data are not collected or used for other purposes). On the basis of the received payment registration key will be generated and immediately sent to you (in ZIP archive). After receiving the key just unzip it to any folder on your hard disk (it's recommended to use the same folder in which you have the emulator). Then run the emulator which will displays the registration screen - continue pressing the Register button (on the right side) after which the dialog for opening the file will appear. Select the correct path to the folder in which the registration key is stored (file with .reg extension) and double click it (or select it and click open) to activate the full version of the emulator. Subsequently, a window a successful registration will be shown, which also includes your registration information. After this step it is still necessary to terminate and restart the emulator.

emu_reg.jpg

How to Install New Version

You should download emulator only from author's website http://mz-800.xf.cz/download.htm.

<wrap important>It is strictly prohibited by the author of this emulator to upload it to other web sites.</wrap>

Emulator is distributed as a ZIP archive that contains the executable application files and other information, but does not contain ROM files. You have to download them separately because of possible conflicts with SHARP Corporation demands (this may change in future versions).

Installation is done by extracting the file into the appropriate folder - for example, you can create a folder named “MZ-800 Emulator” in the folder for Windows programs (“Program Files”). Depending on the version of the operating system it might be necessary to have administration level credentials to install / run programs. When you start the emulator for the first time, it creates configuration files and attempts to associate MZF, MZS and DSK file types. This behavior can then changed in the settings dialog in the emulator.

If you are upgrading the application on the same computer where you have already registered the older version, it is sufficient to download shareware version from the Internet and overwrite mz8emu.exe with the new version. Your registration information will be retained.

In case of installation on another computer you need to repeat the registration process.

Basic Work With Emulator

After running the emulator switches to the same mode as in which there is a real emulated computer. Depending on the connected devices specific operating system is loaded or there is available basic menu with the following options:

  • M - Enter monitor mode
  • C - Load and run the file from tape
  • Q - Load and run the file from quickdisk drive (if QD drive is connected)
  • F - Load and run the file from floppydisk drive (if FDD drive is connected)

The most common first step is to load and run/execute the selected application from some device that is available.

Loading Files From Cassette Tapes

Emulator provides two ways to retrieve files from tapes.

Fast File Loading

Emulator by default associates files for MZF quick start. It is also possible to open files using fast loading in the running emulator (MZF is loaded directly into memory), if there is option in the settings Hardware / Setup / Enable Tape CMT patch in ROM enabled.

In this case, the boot-time by pressing the C key or L command in monitor mode brings up the following dialog screen that allows you to select a file to load:

Loading Files Using Virtual Načítání CMT

If the option “CMT patch in ROM” is disabled, or application does not read data using monitor routines, data are expected to be retrieved from the virtual tape. This behavior is typically for programming languages ​​such as BASIC and multipart cassette games. Virtual tape window can be opened from the menu Hardware / Virtual CMT or from cassette icon on the panel.

For this to work, you have to press Open button to select one or more MZF files and press the Play button to start data transfer to the emulated system. The state of the loading process is shown as green stripe and a time stamp.

Loading Files of the Floppy Drive Type

Emulator allows you to work with floppy disks stored in a format created using DSK CPDREAD 3.24 (see download section) where the contents of each disk is saved as a single large file (360 kB 720 K, 1.44 MB). These files can also be copied back to disk using CPDWRITE 1.03 (again in the download section).

If the *.dsk files are associated with the emulator (optional in the Misc Setup tab), then you can just double click on the DSK file - emulator will start and automatically switches to emulate FDD into the drive A: and “insert” the DSK file in it, and attempt to boot from id. If you want to change the DSK file on the fly, there are two ways: first is to use the toolbar when clicked on the floppy icon to expand popup menu, where you can either change the DSK file in the drive (Open image file) or remove it completely from the drive (eject).

Similar settings can also be done from Setup. There is also another option to enable / disable saving the image during closing the emulator, or to swap floppy disks (Save image on change or exit emulator). It is possible to entirely enable or disable the FDD controller emulation (Enable FDD). The last option on this panel are tools for working with disk images (Disc tools), but will be described in a separate chapter.

Loading Files of the Quickdisk Type

Emulator supports opening QD media in Setup dialog in QD tab. To open an existing image use the “Open file” button and the device itself need to be allowed, which might eventually effect after the next reboot of the emulated machine.

Loading Files from ramdisk/romdisk/cartridge

<wrap todo>TODO: Ramdisk</wrap>

Emulated Components

Processor

The Zilog Z-80 processor is properly emulated including expansion instruction sets. In the settings you can change the processor speed, when you need to speed up or slow down program execution:

Basic mode can be also affected by setting of emulator's priority and changing the emulator mode switches (DIP switches) in “Other” settings tab, where there is also an option to select language for application and file associations in the operating system.

Screen

Almost all the known abilities of the graphical chip GDG are emulated and also some partly undocumented modes. The image is drawn through the scanline simulation, ie. the beam running the TV screen including can be backward runs, etc. and also includes rendering of the screen edge (border) in the same width as in the real MZ-800. This should allow to properly render all the graphically demanding programs that require precise timing (for example slap Fight from JO, GP Simulator, Picture Show, Sound FX 4, Game music, MogMog2, the Interkarate loader + and many others…). It can work both in the basic configuration with a 16-KB videoRAM and with videoRAM expanded to 32 KB.

You can select the screen type to be simulated monitor. A choices are color and monochrome monitor in shades of gray, or green.

Another possibility is the so-called frame dropping, which may partly help owners of slower computers (Refresh every 4th frame only). This is more or less about that rendering SHARP's screen must be done 50 times per second, while if we use dropped frames, it can be reduced to 25, 17 or 12 frames per second. The more frames is dropping, the more there may appear “jerky” movements such as game-characters in games, scrolling text, etc. If you have sufficient PC performance, it's recommended to move slider set to “Every 1 frame” to get most realistic emulation.

There is also an option for the full-screen mode. It is recommended to use the highest possible resolution or native resolution of your monitor respectively - this will ensure adequate image quality and its proper spread across the screen. Higher color depth on older computers may slow down rendering. Set depth to 16 bits can improve the rendering, but might require additional graphics card mode switching.

The last settings, see the “double screen” item which toggles between normal and double resolution mode and with “Extended VRAM 32K” you can enable / disable the emulation of expanded videoRAM memory - it is recommended to keep this option always on.

Keyboard and Mouse

The following table shows the mapping of some special keys which might be hard and time-consuming to find. Most other keys are mapped to similar places where they were on SHARP. Beware, however, that for example on the MZ-series the plus key was SHIFT-variant of the semicolon key…

Key on MZ Key on PC
? F8
BREAK/ESC End
DEL Backspace
INST Insert
TAB TAB
GRAPH Caps Lock
ALPHA \
BLANK KEY ~
@ F6
\ F7

F12 key is of particular importance, as it causes a reset of the emulator. You can also use CTRL + F12, just as it was possible on SHARP to press CTRL + RESET to restart some programs.

Emulator also has a virtual keyboard, which may help you to find and press a specific character, number or letter. Represented by a thumbnail picture of a real SHARP's keyboard, where you can press the keys with the mouse. Pressing multiple keys at the same time can be achieved by holding down the Shift key (on the PC keyboard) and then pressing the buttons to be pressed simultaneously. When you release the Shift key on the PC keyboard it will also release simultaneously held keys/buttons.

The mouse is emulated by a Tatra software's specification that comes from the (ing. Jan Koštial) - it was a classic Atari parallel mouse connected via joystick port, and has worked with many programs and games - such as Lemmings, MZ Paint 4, Return to Kyrandia, Solitaires, POOL mouse, HD Setup and more… It's emulated using the default PC mouse (or other pointing device). The setting is typically set to the port JOY2 where mouse was usually connected in supported applications. If a program or game expect regular joystict on the same port connected joystick instead, it can lead to unusual behavior. Mouse emulation suppresses unpleasant phenomenon, which manifested itself on SHARP - if you're pushing the mouse very quickly in one direction, the cursor started to move in the opposite direction. If this phenomenon manifests itself after all, try to correct mouse sensitivity using slider in the “Mouse sensitivity” Setup dialog.

The remaining options in the setting is what is connected to the JOY1 and JOY2 ports. You can choose either a mouse, simulated joystick using the numeric keypad (keyboard 4,8,6,2 + 5 fire) or the option to indicate the unoccupied port. The default JOY1 port is simulated using the joystick on num. keyboard and JOY2 port is not occupied (None).

Cassette Tape

Cassette tape is emulated in two ways - either by modifying the ROM, or as a virtual tape device.

Modified ROM mode serves primarily to load programs only after powering on the emulated system (or after reset), press “C” key or run “L” command from the monitor, as it works only in programs that calls monitor loading routines. Modification is done on the following two addresses:

04D8h - Load head
04F8h - Load program

The “load head” routine adds emulator OUT (01h),A instruction, which takes care of displaying a dialog for selecting files and loading MZF file header into memory. Into “Load program” routine there is added OUT (02),A instruction which loads the body of the selected program. It is possible enable or disable the whole modification in the ROM in the setup by selecting the “Enable CMT patch in ROM”. After activating this setting it is necessary to reset the emulated computer.

Virtual Cassette Tape (virtual CMT)

It serves as a almost full replacement for traditional tape recorder connected to SHARP. It supports not only MZ formats (*. MZF, *. M12), but als the format of the ZX Spectrum (*.TAP) and a universal audio format (*.WAV) in 8-bit MONO format with any sampling rate without compression.

You can open virtual CMT dialog either from the toolbar or from Hardware→Virtual CMT menu. Instead of inserting the cassette you have to select file (one of the above types) using the Eject button. Then you only need to prepare the program that expected data from the tape and press Play. This way it is possible to load multi-part cassette tape games. For example Interkarate+ game, which has a total of 3 parts (loader, image, main program):

Speed of the virtual CMT corresponds to the speed on the original computer. Approximate time to the end of the recording is displayed in the Virtual CMT. If you do not want to wait so long, it is advisable to set a higher speed of emulation, which can significantly shorten the recording time.

Floppy Disk Drive

The emulated floppy disk drive controller compatible with the Sharp ROM circuit equipped with WD 2797 chip and up to four drives, currently up to 720 kilobytes per disk. Floppy drives are not emulated by the PC drive, but using the disk image.

Quickdisk Drive

The emulator provides full support for QD drive (read, write, format), its image format is compatible with other emulators. Compared with real media (QD media was double-side), it is necessary to have one quick disk image for each side. To open an existing image use “Open file” button, to eject disk from the imaginary unit there is “Eject” button and if you need to create a new unformatted disk use the “Create new” button. QD emulation can be enabled using “Enable QD” checkbox. You can prevent write access to disk by checking the “Write protect” option.

Following example describe use with pre-loaded software support in the SHARP ROM memory. After creating a new image, it needs to be formatted before use. To do this, use “QF” command in the monitor.

Loading a program from tape to disk - QX
Disk directory listing - QD
Loading the program - QL
Save a block of memory to disk - QS

Ram Disk / Rom Disk / Cartridge

Sound Generator

It is fully emulated - 3 tone channels and 1 noise (SN 76489AN chip). The noise generator is done exactly as the original, it emulates both white and synchronous noise. It's all in the 44100 Hz, 8 bit mono quality. The sound should be sufficiently clean and of high quality on a faster PCs (> 500 MHz).

Setup is quite simple - it is possible to control the volume of audio output (mixer does not affect Windows). To achieve highest quality its I recommend to have this element set to maximum - otherwise they might lose tones with low volume. It is also possible to mute the sound completely with “Mute” option or by clicking the speaker icon in the main toolbar. There is also separated option to mute noise generator only (“Emulate noise” option).

Printers

Plotter MZ-1P16

This widely used plotter was an original accessory available from SHARP Corporation. It is also fully emulated while printed output from it is not passed directly to the printer (or connected plotter itself), but the bitmaps (standard *.BMP format, 16 colors) which can be then either edited or directly printed. For this plotter single-chip processor is directly emulated including a program that is found in the plotter, so the printouts should exactly match the original output. It is even possible to run plotter hardware self-test, which we'll get later to…

Simply run the plotter emulation - either from the Hardware→MZ-1P16 Plotter menu, or in the main toolbar by clicking on the icon of the printer. ATTENTION - plotter is emulated only if its window is open (not necessarily active). Once you close its window, it will look like it was turned off and the programs will not detect/work with it!

This brings us to describe the plotter window - it's located on the left toolbar, where are following buttons (ordered from top): The first is to store a bitmap representing the paper in the plotter to a file - it is possible to print this file in any graphics program to any printer working with Windows. Another button can reset plotter (plotter processor) - it will switch everything to the default state, if you did not save the contents of “paper”, it will be deleted. Last button is the “Paper Feed” to scroll the paper - note that this button acts as a switch, ie. that if you want to move a piece of paper, you must press the button 2 times. To run plotter self-test mode, you must first press the “Paper Feed” and then press the reset button - then plotter will begin printing its entire character generator set in four colors. On the very bottom of the window there is located toolbar with data on an XY pen position and whether it is currently executing any plotter command.

Harddisk

<wrap todo>TODO: It is emulated (?) 8/16-bitové IDE disks according to specifications…</wrap>

Debugger

Emulátor poskytuje integrovaný nástroj debugger určený pro ladění činnosti procesoru architektury Z80. Debugger můžete použít pro krokování vašich programů napsaných ve strojovém kódu. Okno debuggeru zobrazuje průběžně aktuální pozici a zpětný překlad instrukcí (dissasembling), zobrazuje aktuální stav registrů a příznaků procesoru (flag).

Běh programu je možné pozastavit a krokovat pomocí běhových tlačítek a lze kdykoliv změnit obsah registrů a stav příznaků. Hodnotu registrů lze změnit dvojklikem myši a zadáním nové hodnoty do vstupního řádku. Příznaky je možné měnit změnou zaškrtnutí.

V okně debuggeru je možné používat následující klávesové zkratky:

Klávesa Funkce Popis
F7 Step provedení právě jedné instrukce
F8 Pause pozastavení běhu programu
F9 Run spuštění programu

Okno debuggeru

Výpis paměti a zásobníku

K dispozici je okno pro výpis obsahu paměti a také okno pro vypsání aktuálního stavu zásobníku. Vypisuje se pouze obsah aktuálního namapování paměti v adresovatelném rozsahu procesoru $0000 to $FFFF.

Obsah zásobníku procesoru Okno s výpisem části paměti

Body přerušení

Je možné nastavit více bodů přerušení (breakpoint), při kterých se zastaví provádění instrukcí před prováděním instrukce na daném místě v paměti.

Body přerušení je možné nastavovat dvěma způsoby:
V oknu debuggeru je možné nastavit místo přerušení kliknutím pravým tlačítkem myši na konkrétní instrukci v seznamu instrukcí.

Nastavení bodu přerušení (breakpoint)

Druhou možností je přímo editovat seznam bodů a zde vložit nový bod přerušení zadáním konkrétního umístění v paměti.

Jiný způsob nastavení bodu přerušení (breakpoint)

Integrovaný assembler / disassembler

Debugger umožňuje provádět jak normální (assembling), tak zpětný překlad (dissasembling) instrukcí.

Je možné změnit libovolnou instrukci v seznamu instrukcí. Stačí ji zvolit a napsat její název do vstupního řádku, který se objeví po stisku první klávesy.

Inline Assembler

Stejně tak je možné načíst textový soubor a provést jeho překlad do strojového kódu na konkrétní místo v paměti a také zpětně přeložený kód uložit jako textový soubor.

Dissasembler

Načtení a ukládání MZF souborů

Také je možné načítat a ukládat části paměti jako MZF soubory. Tímto postupem je možné načítat programy či data na jiné než v hlavičce souboru uvedené výchozí místo paměti.

Funkce debuggeru pro načítání MZF souborů

Po zvolení souboru pro načtení je možné případně změnit cílové místo v paměti kam budou data umístěna a případně zvolit pro načtení pouze část souboru.

Pro uložení je potřeba zadat jak rozsahy adres, tak adresu spuštění, do hlavičky je pak také vhodné zadat název souboru a volitelně také komentář.

Uložení části paměti v debuggeru

Kromě toho je také možné do paměti načíst libovolný soubor jako binární data bez hlavičky.

Nástroje

Převaděč formátů

Slouží k převodu formátů MZF,WAV a BIN. Dostupný je z nabídky Tools → Format convertor. Nejčastější využití zřejmě najde obousměrná konverzi MZF↔WAV kterou lze použít k přenosu programů z kazet do PC, ale také zpětnému přehrání programu přímo do MZ, nebo zpět na kazetu.

Správa disků

Slouží k lepší a pohodlnější práci s obrazy disket. Umožňuje následující věci:

Struktura disku (Disc structure)

Graficky znázorní rozložení sektorů na disketě, barevně dokáže odlišit vadné sektory, nebo neformátovaný prostor. Pro zobrazení / skrytí legendy stiskněte tlačítko “Legend”. Pokud se jedná o oboustrannou disketu, můžete vybrat zobrazení nulté nebo první strany pomocí comboboxu vlevo dole. Ještě pod ním se nachází combobox pro výběr zobrazení diskety v mechanice A: - D:

Přenos souborů (File transfer)

Je určen nejen pro extrakci jednotlivých souborů z image diskety, ale i pro extrakci zavaděče systému. Detekovány jsou zatím tři základní formáty disket na MZ-800, a to: CP/M LEC, originální P-CP/M 80 a DISK BASIC. Pokud nechcete, aby byl formát automaticky zvolen, zrušte zaškrtnutí políčka “Autodetect disc format”. Samotná extrakce souborů se děje následovně: standardním způsobem označíte soubory, které chcete z image vytáhnout (více souborů naráz můžete označit, pokud přidržíte tlačítko Shift nebo CTRL) a stisknete ikonku diskety ve spodní nástrojové liště. Potom již emulátor pro každý soubor zobrazí standardní dialogové okno pro uložení souboru, ve kterém si ještě případně můžete upravit jméno souboru. Upozorňuji jen, že emulátor automaticky nahrazuje veškeré znaky, které nejsou povoleny pro název souboru ve Windows znakem “_” (podtržítko). Extrakci zavaděče můžete provést stiskem na červenou ikonu diskety s nápisem IPL. Přenos souborů zpět do image bude možný až v příštích verzích emulátoru.

Základní informace o disketě (General info)

  • zobrazí počet stop a stran diskety. Pokud je disketa systémová, zobrazí i jméno systému. V opačném případě se zobrazí pouze tři otazníky.

Screenshot obrazovky

Je možné vytvořit screenshot aktuálního stavu emulace jako BMP obrázek.

Version History

Version 0.097 news (29.3.2006)

An unpublished and precompiled version on disk found by the author after a long time. The project will be continued next.

Version 0.096 news (19.6.2003)

No news available.
(Note: The copyright screen shows incorrect information for this (last?) version: URL and version number.)

Version 0.095 news ( beta test version )

- New design of the virtual CMT
- The emulator supports the floppy HD drive A: if the 1.44Mb floppy disk inserted contains one or more DSK-formatted files.
- errors of the PIT 8253 emulation corrected
- Japanese language support in progress (unfinished)

Version 0.092 news

- The emulator supports drag & drop for MZF- and MZS-files
- code optimizations which improve the emulation speed

For a complete listing of the history of the emulator visit:

http://mz-800.xf.cz/emu_history.htm

en/emulators/mz8emu/doc.1339663522.txt.gz · Last modified: 2012/06/14 10:45 by hajdam